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

nypr-ui

v0.5.2

Published

The default blueprint for ember-cli addons.

Downloads

111

Readme

nypr-ui

Greenkeeper badge CircleCI GitHub release GitHub pull requests GitHub contributors

The New York Public Radio UI Library

The goal of this ember add on is to centralize all of our common UI components so we can avoid branching dependencies and also provide a way for the multiple client apps to share reusable code.

Install and Setup

$ npm install --save-dev nypublicradio/nypr-ui

As of this writing, this provides access to these SASS partials:

@import "nypr-ui/buttons";
@import "nypr-ui/card";
@import "nypr-ui/input";
@import "nypr-ui/vars";

Careful when using these. nypr-ui/card, nypr-ui/input, and nypr-ui/buttons all output CSS, so they should not be imported more than once in a project or else your CSS will become bloated.

Most Common Use Case

Looks like this:

// project/app/styles/app.scss
@import "nypr-ui";

@import "your-local-partial";
@import "another-local-partial";

Then you can freely use mixins or override styles defined in nypr-ui.

Notes for Addons

When using this library in an addon, some things to remember.

  • Add an included hook to the addon's index.js:
// index.js
module.exports = {
  ...
  included: function() {
    this._super.included(this, arguments);
  }
  ...
}
  • If you're using ember-cli-sass or ember-cli-compass-compiler, special care needs to be taken when arranging your sass files.
addon/
|__ styles/
    |__ addon.scss # empty file; include it so the compilers don't choke

app/
|__ styles/
    |__ <your-addon-name>.scss # put your styles and exportable sass mixins here

tests/
|__ dummy/
    |__ app/
        |__ styles/
            |__ app.scss # dummy app styles go here, never touched by consuming app or addons

With this structure, apps or addons which consume your addon should be have access to your sass mixins through @import "<your-addon-name>";.

  • If you're using ember-cli-sass or ember-cli-compass-compiler, they need to be listed in the dependencies section of your package.json -- not the devDependencies section. And remember that those addons are mutually exclusive.

Components

This add-on also provides a few components which can be invoked in templates:

  • nypr-form: basic form which abstracts a lot of boilerplate for using changesets
  • nypr-card: basic UI widget
  • nypr-multi-card: switch between multiple panels in the same card
  • nypr-input: form field with error states. compatible with changesets
  • nypr-social-icons: a list of links formatted as a row of font awesome icons
  • nypr-svg: add svg icons in your templates

Installation

  • git clone [email protected]:nypublicradio/nypr-ui.git this repository
  • cd nypr-ui
  • npm install
  • bower install

Linting

  • npm run lint:js
  • npm run 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"
  • npm test – Runs ember try:each to test your addon against multiple Ember versions

Running the dummy application

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

License

This project is licensed under the MIT License.