@storybook/design-system
Storybook design system
Last updated 15 days ago by kylesuss .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @storybook/design-system 
SYNC missed versions from official npm registry.

Storybook Design System

NPM JavaScript Style Guide

Used by

Note: this design system is not used in Storybook's UI. The stack is different and theming requirements of Storybook add complexity beyond the scope of this project. However, Storybook's visual design is identical to what's here.

Tech stack

Building components

Maintaining the system

Why

The Storybook design system codifies existing UI components into a central, well-maintained repository. It is built to address having to paste the same components into multiple projects again and again. This simplifies building UI's with Storybook's design patterns.

What we're doing

  • Build and maintain a design system in the open
  • Share UI components between multiple apps
  • Dogfood upcoming Storybook features
  • Welcome contributors of all levels and backgrounds

What we're not doing

  • Rewrite all new components from scratch
  • Overhaul the visual design of components
  • Typescript (the consumer apps don't use it)
  • Compete with more general design systems like ANT or Material.

Install

npm install --save @storybook/design-system

Global Styles

Components within the design system assume that a set of global styles have been configured. Depending upon the needs of the application, this can be done several ways:

Option 1: Render the GlobalStyle component

Useful when you don't need any custom body styling in the application, typically this would be placed in a layout component that wraps all pages, or a top-level App component.

import { global } from '@storybook/design-system';
const { GlobalStyle } = global;
/* Render the global styles once per page */
<GlobalStyle />

Option 2: Use the bodyStyles to apply styling

Useful when you want build upon the shared global styling.

import { createGlobalStyle } from 'styled-components';
import { global } from '@storybook/design-system';
const { bodyStyles } = global;

const CustomGlobalStyle = createGlobalStyle`
  body {
    ${bodyStyles}
    // Custom body styling for the app
  }
`;
/* Render the global styles once per page */
<CustomGlobalStyle />

Font Loading

Rather than @import fonts in the GlobalStyle component, the design system's font URL is exported with the intention of using it in a <link> tag as the href. Different frameworks and environments handle component re-renders in their own way (a re-render would cause the font to be re-fetched), so this approach allows the design system consumers to choose the font loading method that is most appropriate for their environment.

Option 1: Build the link tag manually

import { global } from '@storybook/design-system';

const fontLink = document.createElement('link');

fontLink.href = global.fontUrl;
fontLink.rel = 'stylesheet';

document.head.appendChild(fontLink);

Option 2: Render the link tag in a component

import React from 'react';
import { global } from '@storybook/design-system';

const Layout = ({ children }) => (
  <html>
    <head>
      <link href={global.fontUrl} rel="stylesheet" />
    </head>

    <body>{children}</body>
  </html>
);

export default Layout;

Development Scripts

yarn release

Bump the version

Push a release to GitHub and npm

Push a changelog to GitHub

Notes:

  • Requires authentication with npm adduser
  • auto is used to generate a changelog and push it to GitHub. In order for this to work correctly, an environment variable called GH_TOKEN is needed that references a GitHub personal access token with the appropriate permissions to update the repo.

License

MIT © shilman

Current Tags

  • 1.1.7-alpha.1                                ...           alpha (a year ago)
  • 5.1.28-canary.8a6cfa2.0                                ...           canary (12 hours ago)
  • 6.0.0-debug.0                                ...           debug (6 months ago)
  • 5.1.27                                ...           latest (15 days ago)

111 Versions

  • 5.1.28-canary.8a6cfa2.0                                ...           12 hours ago
  • 5.1.28-canary.94f7620.0                                ...           a day ago
  • 5.1.28-canary.411130b.0                                ...           2 days ago
  • 5.1.28-canary.db238a9.0                                ...           2 days ago
  • 5.1.28-canary.4a0fe01.0                                ...           2 days ago
  • 5.1.28-canary.4a188a3.0                                ...           2 days ago
  • 5.1.28-canary.1ef02f1.0                                ...           2 days ago
  • 5.1.28-canary.011a6c6.0                                ...           2 days ago
  • 5.1.28-canary.aec637e.0                                ...           2 days ago
  • 5.1.28-canary.ebd4c56.0                                ...           2 days ago
  • 5.1.28-canary.568712e.0                                ...           2 days ago
  • 5.1.28-canary.9c28fdb.0                                ...           2 days ago
  • 5.1.27                                ...           15 days ago
  • 5.1.26                                ...           2 months ago
  • 5.1.26-canary.7fbbf43.0                                ...           2 months ago
  • 5.1.26-canary.fa2fb1f.0                                ...           2 months ago
  • 5.1.25                                ...           2 months ago
  • 5.1.24                                ...           3 months ago
  • 5.1.24-canary.c2cfec9.1                                ...           3 months ago
  • 5.1.24-canary.c2cfec9.0                                ...           3 months ago
  • 5.1.24-canary.b8bb677.0                                ...           3 months ago
  • 5.1.24-canary.e7110ca.0                                ...           3 months ago
  • 5.1.24-canary.9eda2a9.0                                ...           3 months ago
  • 5.1.23                                ...           3 months ago
  • 5.1.22                                ...           3 months ago
  • 5.1.21                                ...           3 months ago
  • 5.1.20                                ...           3 months ago
  • 5.1.19                                ...           3 months ago
  • 5.1.18                                ...           3 months ago
  • 5.1.17                                ...           3 months ago
  • 5.1.16                                ...           3 months ago
  • 5.1.15                                ...           3 months ago
  • 5.1.14                                ...           3 months ago
  • 5.1.13                                ...           3 months ago
  • 5.1.12                                ...           3 months ago
  • 5.1.11                                ...           3 months ago
  • 5.1.10                                ...           3 months ago
  • 5.1.9                                ...           3 months ago
  • 5.1.8                                ...           3 months ago
  • 5.1.7                                ...           3 months ago
  • 5.1.6                                ...           3 months ago
  • 5.1.5                                ...           3 months ago
  • 5.1.4                                ...           3 months ago
  • 5.1.3                                ...           3 months ago
  • 5.1.2                                ...           3 months ago
  • 5.1.1                                ...           4 months ago
  • 5.1.0                                ...           5 months ago
  • 6.0.0-debug.0                                ...           6 months ago
  • 5.0.4                                ...           7 months ago
  • 5.0.3                                ...           7 months ago
  • 5.0.2                                ...           7 months ago
  • 5.0.1                                ...           7 months ago
  • 5.0.0                                ...           8 months ago
  • 4.0.0                                ...           8 months ago
  • 3.0.1-canary.c3fb844                                ...           9 months ago
  • 3.0.1-canary.3.5ab7f06                                ...           9 months ago
  • 3.0.1-canary.2.db89173                                ...           9 months ago
  • 3.0.1-canary.1.fd3d62b                                ...           9 months ago
  • 3.0.1-canary.fd3d62b                                ...           9 months ago
  • 3.0.0                                ...           9 months ago
  • 2.0.5                                ...           10 months ago
  • 2.0.4                                ...           10 months ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.1.7-alpha.1                                ...           a year ago
  • 1.1.7-alpha.0                                ...           a year ago
  • 1.1.7                                ...           a year ago
  • 1.1.6                                ...           a year ago
  • 1.1.5                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.0.44                                ...           a year ago
  • 0.0.44-canary.a94a65f                                ...           a year ago
  • 0.0.43                                ...           a year ago
  • 0.0.42                                ...           a year ago
  • 0.0.41                                ...           a year ago
  • 0.0.40                                ...           a year ago
  • 0.0.39                                ...           a year ago
  • 0.0.38                                ...           a year ago
  • 0.0.37                                ...           a year ago
  • 0.0.36                                ...           a year ago
  • 0.0.35                                ...           a year ago
  • 0.0.34                                ...           a year ago
  • 0.0.33                                ...           a year ago
  • 0.0.32                                ...           a year ago
  • 0.0.31                                ...           a year ago
  • 0.0.30                                ...           a year ago
  • 0.0.29                                ...           a year ago
  • 0.0.28                                ...           a year ago
  • 0.0.27                                ...           a year ago
  • 0.0.26                                ...           a year ago
  • 0.0.25                                ...           a year ago
  • 0.0.24                                ...           a year ago
  • 0.0.23                                ...           a year ago
  • 0.0.22                                ...           a year ago
  • 0.0.21                                ...           a year ago
  • 0.0.20                                ...           a year ago
  • 0.0.19                                ...           a year ago
  • 0.0.18                                ...           a year ago
  • 0.0.17                                ...           a year ago
  • 0.0.14                                ...           a year ago
  • 0.0.12                                ...           a year ago
  • 0.0.10                                ...           a year ago
  • 0.0.9                                ...           a year ago
  • 0.0.8                                ...           a year ago
  • 0.0.7                                ...           a year ago
  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.2                                ...           a year ago

Copyright 2014 - 2017 © taobao.org |