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

@smartbear/design-system

v0.9.1

Published

Presentational components implementing the SmartBear Design System

Downloads

23

Readme

Node.js CI

SmartBear Design System

This repository contains presentational components implementing the SmartBear Design System.

See a live demo based on StoryBook.

Frameworks

Currently only React is supported. If you need support for a different framework please submit a pull request.

Installation

First, make sure you add the following snippet to your <head> element in your HTML

<link
  href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap"
  rel="stylesheet"
/>

This is because the SmartBear design system registers Open Sans as the default sans font.

Second, install the design system using one of the following mechanisms:

Quick and Dirty

Just add the CSS directly to your <head> element:

<!-- Replace VERSION with the version you want -->
<link
  href="https://cdn.jsdelivr.net/npm/@smartbear/design-system@VERSION/dist/style.css"
  rel="stylesheet"
/>

While this is quick and makes it easy to try out, it is not recommended for production use, as the stylesheet is very large, and you will only be able to use the CSS Components.

The HTML Components are only available if you install it with Node.js

Node.js

Install the npm module as a runtime dependency:

npm install --save @smartbear/design-system

You can now use React Components as well as the Tailwind CSS Plugin

Tailwind CSS Plugin

It's highly recommended you install Tailwind CSS.

Add the plugin to your Tailwind config:

// tailwind.config.js
module.exports = {
  plugins: [require('@smartbear/design-system').tailwindPlugin],
}

Contribute

We would love pull requests from people in SmartBear to improve this library. Start by cloning this repo and fire up Storybook to see existing components:

# Force the use of PostCSS 8 to avoid Storybook problems
npx npm-force-resolutions

# Install dependencies
npm install

# View components in Storybook
npm run storybook

Defining components

We follow the tailwindcss guidelines for Extracting Components. This design system provides CSS components and Example components.

When you define a new component you should always start by creating a new stories/*/MyComponent.stories.tsx file.

While you're experimenting you can define the component in the same file, and when you're happy with it, extract it to a CSS Component or HTML Component.

CSS Components

Components that only require a single HTML element are defined as CSS Components. To create a new CSS Component:

  • Create a new src/molecules/*.css file.
  • Run npm run build-css-components. This will generate a CSS-in-JS .js file.
  • Register the component with addComponents in src/tailwindPlugin.js
  • @import the file in stories/index.css (otherwise it won't be loaded in StoryBook)

HTML Components

Components that require two or more HTML elements are defined as HTML components.

This library currently uses React to define HTML Components. Support for additional UI libraries are welcome!

React Components

To create a new React Component just create a new src/{molecules,organism}/*.tsx file.

SmartBear theme

Because tailwindcss is centred around utility classes, the SmartBear theme is implemented by overriding and adding utilities to the standard set of utilities. This is described in more detail in Customizing Your Design System.

The theme defines the following values:

  • Colours (using design system specific names)
  • Spacing (padding, margin, width and height)

The theme is defined in src/tailwindPlugin.js.

Releasing

Before you release, update dependencies:

npx npm-check-updates --upgrade
npm install

Verify that everything still looks ok in Storybook.

Update the version number in standalone-example.html Update CHANGELOG.md and commit. Now you can release:

npm version [major|minor|patch]
npm publish --access public && npm run deploy-storybook
git push && git push --tags