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

ncbi-design-system

v2.2.0

Published

NCBI Design System

Downloads

2

Readme

NCBI Web Design System (NWDS)

NCBI-themed USWDS!

  • USWDS theme settings are set to NCBI defaults in /_ncbi-theme.scss.
  • Roboto has been installed as the default font.
  • Color themes follow the NCBI specification at https://www.ncbi.nlm.nih.gov/style-guide/basics/colors/

A live demo of all components included in the design package can be accessed at https://ncbi-codeathons.github.io/nds1-team-2-design-package/.

Note that Github Pages deployments need to be active on the gh-pages branch for this to be accessible, otherwise this will show a 404.

Requirements

  • Node.js (v16.x.x)
  • npm
  • uswds
  • uswds-compile

Team

  • James Hancock
    • 4:00 am – 12:30 pm US / 9:00 am - 5:30 pm UK
  • Pradeep Chand
    • 9:00 am – 5:00 pm US / 2:00 pm - 10:00 pm UK

Since the team members are working in different timezones, we have agreed upon following work handoff protocol:

  • Each developer will work on a feature branch and create a pull request for any completed feature for other developer to review
  • Other developer will review the pull request, make necessary changes and merge the changes.
  • The other developer will start new work off the merged code base.

How to use

Install via direct download

Developers can download all NWDS assets (including CSS, JavaScript, fonts and icons) from the latest release in the repository releases page.

These assets can be added to a webpage in the following manner:

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- Include meta-tags here -->
    <link rel="stylesheet" href="/assets/css/styles.css" />
    <script src="/assets/js/uswds-init.min.js"></script>
  </head>
  <body>
    <!--
      Include your USWDS components here.
      If they include a reference to an icon which isn't loading, you can update the `src` to the correct asset path.
      Favicons, icons and images can be found in `/assets/img`.
    -->
    <script src="/assets/js/uswds.min.js"></script>
  </body>
</html>

Install via NPM

Installing via NPM with your own build process allows you to create further custom styles on top of NWDS.

First, run `npm install ncbi-design-system @uswds/uswds'

Update your build process so the Sass compiler can find the project SCSS files. Here's an example configuration for WebPack sass-loader.

{
  loader: "sass-loader",
  options: {
    sassOptions: {
      includePaths: [
        "./node_modules/@uswds/uswds/packages",
        "./node_modules/ncbi-design-system/src/theme/sass",
      ],
    },
  },
},

Next, create an index.scss file, the root from which all your project styles will be compiled.

// Load the USWDS styles with the NCBI theme settings applied.
@forward "ncbi-theme";
@forward "uswds";

// Load extra NCBI specific custom styles and settings
@import "ncbi-settings";
@import "ncbi-typography";

// Load the custom NCBI component styles
@import "ncbi-components/site-alert";
@import "ncbi-components/collection";

For documentation on how to modify or add to these styles, please read the customizing styles documentation.

Your build process should now be able to compile index.scss into the NCBI styles. For an example build process using Webpack, see the NCBI Django Reference App. This project uses uswds-compile to build releases with Gulp - this approach will need some adaptation to include the NCBI design system node_module path when compiling the SCSS, as well as updates to uswds.paths.src settings.

Architecture

  • This package is built on top of @uswds/uswds v3.3.
  • [uswds-compile](https://github.com/uswds/uswds-compile) builds the releases of this project, compiling SCSS and copying assets.
  • Github Actions builds and publishes the release files automatically when code is pushed to main.

workflow

Contributing to this package

Override USWDS settings in /ncbi-theme.scss or add further custom components in /ncbi-components. Make sure to update styles.scss with an import to your new component. You can copy and paste components to index.html from the USWDS component library to verify that your new styles work or you can use storybook following the instructions below.

Running storybook

First run npm run build, this will move assets such as fonts and images into the assets folder, then run npm run watch along with npm run storybook.

Any SCSS changes made will now appear in storybook, note that changes can take 5-10 seconds to display.

Commands

  • npm run build - compiles Sass files and copies other USWDS assets into the assets directory.
  • npm run compile - compiles only SCSS files
  • npm run watch - watches the SCSS files for changes and re-compiles on save.
  • npm run format - formats files with Prettier.
  • npm run lint - lints files with Stylelint.

Refer uswds-compile functions documentation to understand the role of each function.

Documentation and assets

Documentation is found inside /docs/ directory and related images should be stored inside /docs/images/.