npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-input-spark

v0.1.2

Published

A replacement for <input> customizeable with Ember Sparks.

Downloads

1

Readme

{{input-spark}}

A replacement for <input>

http://www.ember-sparks.com/


Installation and usage

Install the Ember Sparks addon (this components is part of the standard library)

ember install ember-sparks

Now restart your Ember app and drop the component in there!

{{input-spark
  placeholder="Start typing"
}}

Properties

| Name | Type | Default | Description | |------------------|------------------|---------------------------|------------------------------------| | value | string | null | The predefined value of the input. | | placeholder | string | null | The text to be displayed before the user enters a value. | | prefix | string | null | The prefix to be displayed before the user's input. This comes in handy if you want to show a domain name in front of a username input for example. | | label | boolean/string | true | The label to show on top of the input, when the placeholder is no longer visible. If set to true, it will have the same value as placeholder. | | maxlength | number | unlimited | The maximum number of characters that the user can type. | | disabled | boolean | false | Determines whether the input should be disabled or not. | | error | string | null | Specifies an error with the input. If it's set, an error message will appear underneath. | | errorComponent | string | input-spark/error-spark | The name of the component to render for error messages. You can overwrite the default one, as long as you make sure it accepts the error property. | | scrollOnError | boolean | false | Determines whether the page should scroll to the input when error is set. This is handy if your page is long, and you want the user to automatically be taken to whichever input is faulty. |

Actions

| Name | Description | |------------------|---------------------------------------------------------------------------------------| | onKeyUp | Triggers when the user releases a key. | | onKeyDown | Triggers when the user presses down a key. | | onEnter | Triggers when the user pressed the enter key. | | onFocus | Triggers when the user focuses on the input. | | onBlur | Triggers when the user blurs (stops focusing) on the input. | | onInput | Triggers when the user changes the value of the input. | | onFinishTyping | Triggers when the user hasn't typed anything new for 1 second. | | onChange | Triggers when the user has changed the value of the input and then focuses out of it. |

Block version

If you use the blocking version of the component, you can set an icon at the beginning of the input. This can be done through inline SVG (recommended), an icon font or an img-tag.

{{#input-spark}}
  <svg role="img">
    <use xlink:href="/assets/icons.svg#user"></use>
  </svg>
{{/input-spark}}

Theming

To see these examples in action, check out the interactive documentation.

Important! All classes are local in order to avoid naming collisions and unintended CSS side effects. To understand how to style them, check out the Ember Sparks documentation.

  • .container

    Set some default settings here, such as width, font-size... etc.

    Example:

    .container {
      font-size: 11px;
    }
  • .input

    The (virtual) input box that the user interacts in. If the input is focused, the class .focused is appended to it. If the input is disabled, the class .disabled is appended to it. If the error bubble is showing, the class .has-error is appended to it.

    Example:

    .input {
      background-color: #ffd9d5;
    }
  • .prefix

    Style the prefix at the beginning of the input.

    Example:

    .prefix {
      color: blue;
    }
  • .icon

    Style the icon container that contains the eventual SVG icon. Block mode only.

  • .label

    Style the floating label above the input.

    Example:

    .label {
      color: red;
    }
  • .error

    Style the default error box.

    Example:

    .prefix {
      background-color: #ffdc30;
      color: #af7c38;
    }

Contributing

Check out the guidelines at http://ember-sparks.com/docs#contribute