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

@buildit/ds-demo-lib

v0.0.2

Published

Design System Demo UI Library.

Downloads

5

Readme

Design System Demo Library

What is this?

This is a demo of how integration with tools like Frontify or Brand.ai can automate some parts of the workflow when it comes to building web apps. The demo consists of four repositories:

  • ds-demo-lib: this is a React library of common components
  • ds-demo-app1: a consumer app of the above library. This pretends to be some kind of banking app where a table of data is shown.
  • ds-demo-app2: a second React app, consuming the common library. This has a simple form to make a "payment" of some sort.
  • ds-demo-web: a static HTML site which consumes the styles available in the library.

Here's what the flow looks like:

Design System demo components

What am I looking at

The common library has three components:

Styling is done via less. To see the component in the library run the storybook script. For the rest of the projects (the two apps and the static site) just run the start script. Open the following in a browser to see each project:

  • http://localhost:9000 (library storybook)
  • http://localhost:9001 (app 1)
  • http://localhost:9002 (app 2)
  • http://localhost:9003 (static site)

Configuration

The library currently has the sample styles we created already in the src/assets diretory. The assets script will download any styles you have and extract them there. Obviously you will need a respective Frontify and/or Brand.ai account. You also need to create a brandai.config.js in the library root folder. This needs to look like this:

const brandai = {
  logos: <BRAND.AI ENDPOINT>,
  icons: <BRAND.AI ENDPOINT>,
  image:  <BRAND.AI ENDPOINT>,
  styles:  <BRAND.AI ENDPOINT>
};

const frontify = {
  devkit: <FRONTIFY ENDPOINT>,
  logo:  <FRONTIFY ENDPOINT>
};

exports.default = {
  brandai,
  frontify
};

You can adjust the above config and assets task in the gulp file depending how your style library is created.

How do the styles work?

There are three main styles files in src:

  • vanilla.less
  • taco-bank.less
  • unicorn-inc.less

There is also a sample styleguide in sample.less. Each of the less files provides a mapping to the styles imported from the various tools. The vanilla one is actually hardcoded values, to demonstrate how that is another option. The idea is that as a developer of a consumer app you only have to worry about the names defined in the style files. These then map them to whatever the various design tools export.

What about the static site

That is there to demo that the styles can easily be reused for a static site, not just React apps. In fact, the styles can be used by anything that understands less. Note that the choice of less is just for this example, both Frontify and Brand.ai can export SCSS or plain CSS too.