New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@nacho-ui/pill

Package Overview
Dependencies
Maintainers
5
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nacho-ui/pill

The default blueprint for ember-cli addons.

latest
npmnpm
Version
0.0.37
Version published
Maintainers
5
Created
Source

@nacho-ui/pill

The Nacho pill component creates an interactive element that can be added, dismissed, toggled, or defined by user-generated content.

Installation

ember install @nacho-ui/pill

Usage

NachoPillInput

The Nacho pill input component is used when you want to allow input for a set of tags that appear as a pill-like item.

Expected behavior:

  • If the tag already has a value, clicking on the X will trigger a function with the intention to delete the tag
  • If the tag is an empty tag, clicking on the + will put us in "editing" mode to add a value
  • While in editing mode, clicking the + again or pressing the enter key will create a new tag
  • While in editing mode, pressing the tab key will create a new tag and also leave us in editing mode still to quickly add more tags
  • While in editing mode, clicking away will cause the input pill to reset

Params:

NameTypeDescription
value`stringundefined`
placeholder`stringundefined`
onComplete(p: string) => voidTriggers the completion task for adding a tag, where p is the value of the user's text input
onDelete(p: string) => voidTriggers the deletion of the tag, where P is the value of the value passed into the component
baseStatePillState as stringAllows the user to specify a custom state for the tag (defaults to PillState.NeutralInverse) when a value is displayed
emptyStatePillState as stringAllows the user to specify a custom state for the tag (defaults to PillState.Inverse) when prompting to enter a value
Example usage
<NachoPillInput
  @value="stringOrUndefined"
  @placeholder={{"string" || undefined}}
  @onComplete={{action onComplete}}
  @onDelete={{action onDelete}}
  @baseState={{PillState.Good}}
  @emptyState={{PillState.GoodInverse}}
/>
{{#each this.tagList as |tag|}}
  <NachoPillInput @value={{tag}} @onDelete={{action this.removeTag tag}}/>
{{/each}}
<NachoPillInput @placeholder="Add Pokemon" @onComplete={{action this.addTag}}/>

Contributing

Installation

  • git clone <repository-url>
  • cd nacho-pill
  • yarn install

Linting

  • yarn lint:hbs
  • yarn lint:js
  • yarn lint:js --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

  • ember serve
  • Visit the dummy application at http://localhost:4200.

For more information on using ember-cli, visit https://ember-cli.com/.

License

This project is licensed under the MIT License.

Keywords

ember-addon

FAQs

Package last updated on 17 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts