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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@amber-ds/components

v1.2.6

Published

Web Components implementation of the Amber Design System.

Downloads

48

Readme

amber-components

Build Status Project Status: Active – The project has reached a stable, usable state and is being actively developed. https://david-dm.org/bitrockteam/amber-components.svg

Web Components implementation of the Amber Design System.

logo.svg

This repository is aimed mainly to developers and contributors, for the proper documentation & styleguide please refer to https://amber.bitrock.it.

You can preview/try the components on the live Storybook.

Usage

Install

$ yarn add @amber-ds/components
--- or ---
$ npm install @amber-ds/components

optionally, you may want to add the Web Components polyfills to support previous versions of Firefox and Edge.

$ yarn add @webcomponents/webcomponentsjs
--- or ---
$ npm install @webcomponents/webcomponentsjs

Add in project

You can import the components in your project in different way depending on the environment:

as Javascript files with a bundler (like Webpack)

// myfile.js

// import the whole components library
import AmberComponents from '@amber-ds/components';

// import a single component (button for instance)
import '@amber-ds/components/button',

as Javascript files from HTML without a bundler

<!-- mypage.html -->

<!-- import the whole components library -->
<script type="module" src="./node_modules/@amber-ds/components/index.js"></script>
<!-- import a single component (button for instance) -->
<script type="module" src="./node_modules/@amber-ds/components/button.js"></script>

then in an .html file, or a templating that produces an HTML output:

<!-- myfile.html -->

<amber-button priority="primary">
  Get ready!
<amber-button>

Development

A brief description of the development architecture, stack and how to work on the code:

WebComponents

The WebComponents specification is an umbrella term to group the Custom Elements v1 and Shadow DOM v1 specification. These browser APIs let you write W3C compliant custom HTML tags with their own functionalities, scoped styles and markup that works across browsers and frontend frameworks.

Typescript

To achieve a better code resilience, all components are written in TypeScript to take advantage mainly of static type checking and the decorators syntax. It is also used to transpile code to ES-2015.

Based on Lit-HTML & LitElement

Since Web Components as a standard doesn't handle the rendering mechanics and data-binding, we are adopting Lit-HTML and its Web Component class LitElement as a foundation layer for every comoponent within this library.

Internal utilities

  • triggerEvent(element, name, ?detail) - a wrapper to create a new custom event and dispatch it with an optional detail object. Bubbling is already turned on.

Add a new component

To quickly create the required (but minimal) boilerplate for a new Amber component, we have included a small CLI utility:

$ yarn create:component [name]
--- or ---
$ npm run create:component [name]

This will create a subfolder within the ./src/components folder with the two required starter files index.ts and style.scss.

You will only need to import the new component inside the ./src/components/library.ts file to chain it in the dev & build processess.

Styling

You can define the styles of each component using SASS, the main index.scss file within the component folder gets processed by the compiler and then is injected in the Shadow DOM.

If you need to share styles, mixins or whatever else between components you should create a separated file and then import it where they are required.

Tests

At the moment only the core libraries (plain .ts files within the src/libs folder) are being tested via Jest.

Available NPM tasks

Start the project in development mode with a live reload Storybook

$ yarn start

Start the project in development mode with a simple HTML page

$ yarn dev

Create a static Storybook build in the ./dist folder

$ yarn build:storybook

Run the unit tests

$ yarn test:unit

Branching policy

This project follows a simple branching policy:

  • master contains only stable code, and should not be updated directly
  • development where evolutive or experimental code is written
  • gh-pages where the distrubutable static Storybook build files are deployed

Do NOT merge directly development into master (it's admin-locked...), always send a PR to have a review.

Publish a new version

Before attempting to publish a new version of the package on NPM, first run through this checklist:

  • tests passes (it is required for PRs)
  • increment version number in package.json file following semver guidelines
  • report the changes on the amber-website docs

If the release include a new component:

  • versioning should be incremented by a minor version
  • be sure to add a new entry point webpack.config.js, this is required to create the standalone module
  • be sure to import the component and add it in the /src/components/library.ts files, this way it will be accessible when user imports the whole library
  • add the component tag name it in the /src/elements.ts array, this can help with Vue.js compatibility in some cases

When a new bumped version is pushed to the master branch it will automatically trigger the deploy on NPM (after all automated checks passes) using the bitrock-admin account.

License

Code in this repo and the Amber Design Sytem logo are distributed by the Bitrock UI Engineering team, released under the MIT license.