Code Monkey home page Code Monkey logo

design-system's Introduction

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 { Global, css } from '@storybook/theming';
import { global } from '@storybook/design-system';
const { bodyStyles } = global;

const customGlobalStyle = css`
  body {
    ${bodyStyles}// Custom body styling for the app
  }
`;

const CustomGlobalStyle = () => <Global styles={customGlobalStyle} />;
/* 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, environment variables called GH_TOKEN and NPM_TOKEN are needed that reference a GitHub personal access token and a NPM "Publish" token with the appropriate permissions to update the repo.

License

MIT Β© shilman

design-system's People

Contributors

alii avatar andarist avatar andrewortwein avatar atanasster avatar cdedreuille avatar d3portillo avatar darleendenno avatar dependabot-preview[bot] avatar dependabot[bot] avatar domyen avatar elseloop avatar ghengeveld avatar github-actions[bot] avatar hipstersmoothie avatar jonathankolnik avatar jsomsanith avatar jsomsanith-tlnd avatar kylegach avatar kylesuss avatar leerob avatar michaelarestad avatar ndelangen avatar oliviertassinari avatar oorestisime avatar shilman avatar thafryer avatar tmeasday avatar winkervsbecks avatar yannbf avatar zhyd1997 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

design-system's Issues

[Bug] Input stacked doesn't render the correct border radius in Safari iOS

Describe the bug

In Safari iOS, the rounded corners get applied universally to the top and bottom of stacked inputs

image

Steps to reproduce the behavior

  1. Go to this url on your iOS device
  2. See that the corners are all rounded when only the top or bottom corners should be rounded respectively.

Expected behavior

Only the top or bottom corners should be rounded respectively.

Screenshots and/or logs

If applicable, add screenshots and/or logs to help explain your problem.

Environment

  • OS: iOS

Upgrade Popper and react-popper-tooltip

Our tooltips use an old version of Popper and react-popper-tooltip, and upgrading to a new version is non-trivial and will require updating to use hooks.

[Upgrade] Update uuid and other dependencies

Users are reporting getting dependency warnings from addons that depend on SDS.
β”œβ”€β”¬ @chromaui/[email protected]
β”‚ β”œβ”€β”¬ @storybook/[email protected]
β”‚ β”‚ └── [email protected]

npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

Solution

Audit dependencies and upgrade dependencies to the latest versions where possible.

Pass Forwarding Refs to the component

Today the components are like this:

function Button({
  isDisabled,
  isLoading,
  loadingText,
  isLink,
  children,
  ButtonWrapper,
  ...props
}) {
  // ... rest components

  return (
    <SelectedButton isLoading={isLoading} disabled={isDisabled} {...props}>
      {buttonInner}
    </SelectedButton>
  );
}

to

const Button = React.forwardRef(
  (
    {
      isDisabled,
      isLoading,
      loadingText,
      isLink,
      children,
      ButtonWrapper,
      ...props
    },
    ref
  ) => {
    // ... components

    return (
      <SelectedButton
        ref={ref}
        isLoading={isLoading}
        disabled={isDisabled}
        {...props}
      >
        {buttonInner}
      </SelectedButton>
    );
  }
);

So we can we want to forward the ref from the outside of.
https://reactjs.org/docs/forwarding-refs.html

I can work on that refctory and open a PR for better evaluation.

However, I would like to know how to trade.

Tooltip with trigger="click" behavior

Issue
When I click on the tooltip I can't close it unless I click outside of it.

Expected behavior
The tooltip should toggle between showing and hiding when I click on it.

Gif
Screen Recording 2019-07-02 at 12 57 PM

This is a regression because the tooltip is working as expected on Chromatic's homepage.
Screen Recording 2019-07-02 at 01 02 PM

Fix tooltip hover issue

Sometimes the tooltip can have issues where when you try to hover over the dropdown, it disappears instantly:

tooltip

Maybe the hover target is too small?

Document how to mock prismjs in consumers

Mocking prismjs was a bit difficult in one of the consumers. I tried this in the test file:

jest.mock('prismjs/components/index');
jest.mock('prismjs', () => ({
  highlightAllUnder: jest.fn(),
}));

Sadly that did not work & I had to create mock files like this:

// __mocks__/prismjs/components/index.js
const loadLanguages = jest.fn();

export default loadLanguages;
// __mocks__/prismjs.js 
export default {
  highlightAllUnder: jest.fn(),
};

Figure out if that is the best way to do this & add something to the README about it so others don't waste time on it.

Add offset to keyboard-focused outlines

Description

The outline for keyboard-focused elements looks a little crowded. It was recommended in #271 to add an outline offset to improve visibility and streamline accessibility design.

image

Acceptance Criteria

  • All buttons that are keyboard-focused should have an outline offset
  • All links that are keyboard-focused should have an outline offset

(NEW-Codes)##Fortnite Free V Bucks Generator(2024-2025)~Free V-Bucks Codes List 100% Working Code for Every Fortnite Player May-june

1 minutes ago - Fortnite Free V Bucks Generator(2024-2025)~Free V-Bucks Codes List 100% Working Code for Every Fortnite Player May-june

CLICK HERE TO FREE GENERATOR

With every new chapter and season, Epic Games introduces thrilling events, diverse quests, and milestones, offering players the chance to earn free in-game rewards, such as skins, cosmetics, V-bucks, and emotes. While participating in events and reaching milestones or completing quests requires gameplay and meeting specific conditions, redeem codes provide a more straightforward path. They grant access to rewards without the need for any additional effort.

Fortnite V-Bucks Claim your V Bucks Package by filling out the form below: Please note that you can only use this generator once every 1 hours so that Epic Games doesn't get suspicious. vbucks code generator, fortnite v buck generator updated, free vbuck generator no verification, fortnite v buck generator no survey

For those looking to dive right in, there are Fortnite accounts for sale that come pre-loaded with a variety of rewards and progress. This article offers a thorough overview of both active and expired promo codes and includes a detailed, step-by-step guide on how to redeem these codes to claim your Fortnite rewards.

This is the freshest and latest form of Fortnite v bucks generator. Which incorporates an alternative to get boundless free v bucks. We built up this fortnite vbuck generator since this sec ago. 16 bucks generat or, free v bucks gen erator 3ddi game is developing and got quantities of gamers on Fortnite servers. All of you know how much every gamer requires v bucks and in-game assets to ace it.free v bucks xbox

As the demand for Free V Bucks Codes continues to rise, so do the number of scams and unauthorized methods claiming to provide them. It is crucial to be aware of potential risks and avoid falling victim to scams, which can lead to the loss of personal information, account suspensions, or even malware infections.

Numerous websites and software claim to generate Free V Bucks Codes, but most of them are scams. These code generators often require users to complete surveys, watch ads, or provide personal information, only to deliver fake or invalid codes. Additionally, using such generators violates Epic Games' terms of service, putting your Fortnite account at risk of being permanently banned.
Active Fortnite Codes

BANANNANANANA - Nanner Ringer Emote (Update Code)
9BS9-NSKB-JAT2-8WYA – Free V Bucks reward.
LJG6-DGYB-RMTH-YMB5 – Free V Bucks reward.
D8PT-33YY-B3KP-HHBJ – Free V Bucks reward.
69JS-99GS-6344-STT8 – Free V Bucks reward.
WDCT-SD21-RKJ6-UACP – Free V Bucks reward.

Some scammers may attempt to trick players into revealing their Fortnite account details by sending phishing emails, messages, or links to malicious websites. It is essential to remain vigilant and avoid clicking on suspicious links or sharing personal information with untrustworthy sources.

In conclusion, Free V Bucks Codes provide an exciting opportunity for Fortnite players to acquire in-game currency without spending real money. While legitimate methods exist to obtain these codes through official promotions, giveaways, and events, it is crucial to be cautious of scams and unauthorized methods that can jeopardize your account and personal information. Always prioritize the security of your Fortnite account and follow Epic Games' guidelines to ensure a safe and enjoyable gaming experience.

Why Are My Fortnite Codes Not Working?
Most of the time, the issue is typing errors. Since Fortnite codes are complex, copying and pasting them is safer than typing them out. If you're sure the spelling is correct and the code still doesn't work, it might have expired. When you hit 'Redeem,' a message will pop up saying the code is expired or doesn't exist. If you find a code on our list that doesn’t exist, please let us know so we can correct it immediately.

That wraps up our list of all active and expired codes for Fortnite. Be sure to claim your rewards quickly, since you never know when the codes might expire. Keep returning to this page, as we'll update it whenever new codes are released.

How to use the --docs parameter?

Hi, I saw a script build-docs in the package.json with --docs.
I forked your project and installed all dependencies and run this script. However, the output files still contain "canvas" tabs :(
Could you please tell me how to get the static files like your website demo?

Remove font loading in `GlobalStyle`

Remove the font loading of Nunito Sans here or potentially configure the GlobalStyle to conditionally load it.

Currently, design system consumer app frameworks could re-render layout components (Gatsby is an example of a framework that does this) on each page change. This causes the font to be requested on every page change and also a flickering of fonts when that happens.

It might be easiest to just pass a prop to GlobalStyle like this:

export const GlobalStyle = createGlobalStyle`
  ${props => !props.withoutFonts && `
    @import url('https://fonts.googleapis.com/css?family=Nunito+Sans:400,700,800,900');
  `

  body {
    ${bodyStyles}
    margin: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }
`;

// Should we assume that font loading is the default?
<GlobalStyle />
<GlobalStyle withoutFonts />

...but other ideas are welcomed as well.

[Bug] Tree shaking when using the DS library in a host application

Describe the bug

I installed storybook DS as a dependency of a sample React app and verified how it affects the final bundle. At a first glance it seems that the library is not tree-shakable, meaning that importing just a single component of the DS results in the entire library being part of the final bundle.

Steps to reproduce the behavior

You can clone the repo at https://github.com/nebarf/storyboook-ds-tree-shaking and just playing with the commented import and jsx (https://github.com/nebarf/storyboook-ds-tree-shaking/blob/main/src/App.js#L3 and https://github.com/nebarf/storyboook-ds-tree-shaking/blob/main/src/App.js#L11). Screenshots below show how the final bundle does not change by importing and using a different set of library components.

Screenshots

Build 1

build-1-1
build-1

Build 2

build-2-1
build-2

Expected behavior

I would expect the library to be fully tree shakable and having only the imported components being part of the application bundle when the library is consumed.

Environment

  • OS: Ubuntu 20.04.4 LTS
  • Node.js version: v17.6.0
  • NPM version:8.5.1

Consider using Reakit to improve accessibility

Hi all!

I'd like to suggest Reakit to improve accessibility on new components here. It's an open source library that provides low level accessible components and hooks. It's being used in projects like CodeSandbox.

I'm willing to help with that or with anything around accessibility in general.

[Bug]

Describe the bug

A clear and concise description of what the bug is.

Steps to reproduce the behavior

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots and/or logs

If applicable, add screenshots and/or logs to help explain your problem.

Environment

  • OS: [e.g. iOS]
  • Node.js version: [e.g. v12.17.0]
  • NPM version: [e.g. 6.14.4]
  • Browser (if applicable): [e.g. chrome, safari]
  • Browser version (if applicable): [e.g. 22]
  • Device (if applicable): [e.g. iPhone6]

Additional context

Add any other context about the problem here.

Add support for inverse Buttons

To gain a better understanding of the design system, I'm going to try and replace some hand-rolled components in Learn Storybook with the design system components.

image

I noticed the Button component uses an inverse prop. Do we want to port that over?

 ${props => props.inverse && css`
	color: ${color.primary};
    background: ${color.lightest};

    svg path { fill: ${color.primary}; }

    &:hover { box-shadow: rgba(0,0,0,.1) 0 3px 10px 0; }

    &:active {
      color: ${darken(0.05, color.primary)};
    }
 }

If so, I can get a PR going πŸ‘

Revamp release process

It fails a lot & currently doesn't work because it isn't updating the package.json. You have to manually update package.json. Would be nice to clean this up.

Incorrect use of `styled`

This commit: 6bed387

Introduces a memory leak as you are definitely not supposed to use styled inline inside a component. What that does is create a leak where a new style definition is created every time you render the component.

Color palette accessibility

Reported by @Hypnosphi

Goal
Audit and update color palette to something that's perceptually similar to the current palette but with improved accessibility.

image

Examples:

  • πŸ”΄ White text on blue background
  • πŸ”΄ Green text on green background in badge
  • πŸ”΄ #666 grey on white isn't accessible

Reference

Would love some help with this if you have experience with perceptual colors + a11y. πŸ™

Could you keep repositories with examples that simply work?

Hello guys,

I am frustrated because I tried very hard to make it very hard with the DocsPage, getting the descriptions (from comments), and the PropTypes. Thinking I was too tired to figure it out, I hired another developer for a whole day, but apparently that wasn't enough to figure this all out. I thought it was supposed to work out of the box, but it definitely doesn't.

So basically, this library became too complex to use (and has quite a few bugs too), the tutorials are out of sync with each other, and the support threads are all referring to different versions.

But I am certain that with the right environment, Storybook works. And to be honest, I would be happy to adapt my environment to an environment that allows Storybook to run nicely, without any tricks and hacks.

My request is this: could you keep a simple repository with simple yet complete examples (with one button, and the doc generated for it, for instance), for each major version? A repository we could refer at, then build on. I have looked around (in the main repo too), but there is nothing like this. I have found nice and simple repos but they are all using old versions.

That said, I would like to thank you for your work. I am really glad Storybook exists.

[Bug] Focus state for tooltips with <button> triggers is unnecessary

Describe the bug

When a tooltip has a button or an a as the trigger it requires keyboard users to tab twice to activate the trigger.

https://www.loom.com/share/1744473606a049e5aa0785252c12c3fa

Steps to reproduce the behavior

  1. Go to a place where the tooltip is used here
  2. Tab to the diff toggle buttons on the right hand side
    image
  3. Try to enable the focus feature (the left icon)
  4. See that you have to tab twice to activate the feature

Expected behavior

When I tab, I go straight to the interactive element.

Ideas for paths forward

  • Add a prop that allows us to manually set the tabIndex of the wrapper component to -1
  • Auto-detect when the direct descendent is an a or button and passthrough the focus state (via tabIndex) or remove role="button".

What do you think? @jsomsanith @kylesuss @winkerVSbecks

Not able to view react native stories on web

Hi ,
First of all storybook is amazing!.
I am trying to use it for building design system library for react-native.
I have installed react-native through react-native init and configured storybook through sb init
On running storybook server, i am able to view default stories on mobile device but web shows default stories but on selecting it changes in mobile and view is not there in web
sb
Since i want to share the design stories with others and viewable on site (final deploy)
What is the general process to view react native stories on mobile(this is working fine) as well as web view as i do not find any solution 😞
I have gone through this below issues and tried configuring but does not help and i need some proper configuration even after future update of sb
Please advise on this situation.
one
two
three
Below version
"react": "16.9.0",
"react-native": "0.61.5",
"@storybook/addon-actions": "^5.2.8",
"@storybook/addon-links": "^5.2.8",
"@storybook/addons": "^5.2.8",
"@storybook/react-native": "^5.2.8",
"@storybook/react-native-server": "^5.2.8"
storybook version :- 5.2.8

Why are primitives coupled to React?

First off, sorry for this length of this. But I have a lot to say here. @shilman I suppose this is sort of a continuation of our discussion on Medium πŸ˜ƒ but I didn't realize until today that you guys had this repo...


So, I've been spending a lot of time getting to understand the storybook ecosystem in the last couple of days and I really appreciate a lot of amazing things this team has accomplished. Having went through the CDD tutorials, noticing how well you've documented integrating with several frameworks from react to svelte to platform based html! Kudos.

Background: I was coauthor of a very popular Sass Buttons library, have built two react-styleguidist (yikes am I allowed to say that!) design systems at Ethos and Mavelink my last two jobs.

I started learning Svelte earlier this year, and also started investigating the rationale behind stencil but became discouraged by way you have to retrofit react components to actually realize stencil's goals (reacts fault not ionic's!).

With these adventures I started thinking to myself: "Why the F--- do I keep building these component libraries from scratch?" and "Why are the last two tied to React and do me no good for Svelte or Angular or whatever other framework I want to use as a polyglot engineer?" and "If frameworks are not playing friendly with the platform via things like web-components, should I just be going back to authoring in pure HTML/CSS and sprinkles of JS just for DOM handlers and then figuring out how to port THAT into react, svelte, angular, etc.?".

Ideal UI Primitives

With all these questions I started to realize that our current ecosystem seems to be entirely broken and downright silly if you think about it. We have so many almost perfect frameworks with semantic html/css yet too tied to a framework. Heck, Bootstrap or Github's Primer are actually examples of fairly agnostic frameworks based off html/css. But still, they're just a bit too opinionated aesthetically for someone who wants to work from primitives and build out a custom enterprise design system for the company or product professional. You know the whole "looks like Bootstrap" thing.

So, why are storybookjs/design-system components tied to React?

Then I somehow learned about this repo with boilerplate components and thought "oh wait, maybe they're already providing generic primitives to the ecosystem?". But no, not exactly. You're components are, in fact, tied to React so far as I see by looking at button.js, and also, it's css-in-js. This is fine for a react only project, but, in my humble opinion, not for primitives that I "should" be able to use in my Svelte or Angular or Ember or Vue based projects. I mean, storybook itself is already doing a good job of supporting all the frameworks, so why aren't these primitives?

AgnosticUI Idea

So, I had and idea recently of an AgnosticUI that would work like this. I'd start with top level html/css. Then have sub-directories for popular frameworks that, as much as possible, used those top level html/css components. Really, this is exactly like how Addy Osmani's TodoMVC examples has evolved naturally as that exercise is now available in most of the frameworks even all the way back to knockout and backbone.

So, I did an experiment over the last couple of days. I wrote a simple nodejs script which copied over the button.css into the <style>...</style> tags of svelte and vue components to see if it would "just work". It did.

I decided, ok, storybook clearly has the best CDD and authoring experience, so, somehow, I will use it for each of these. Maybe I'll eventually create a fancy portal site to wrap it all up, but I'd like to leverage storybook as much as possible. But how can I have a react storybook and svelte storybook etc., and have them all wrapped?

Then I found out about storybook composition. Brilliant -- it's like everything my project could need is already in existence!


All to say, before I go and build out this idea of mine, AgnosticUI, is there some way I can ingratiate myself with the storybook powerhouse team and either keep you guys abreast of my progress or perhaps integrate the idea here or somehow collaborate?

I do have an ulterior motive that I want to personally be coupled to said framework so that I can never have to build it again, tell any company that I work for that the framework "comes with me" so to speak.

Ok, here's a more visual sketch of the idea of AgnosticUI. Note the first two files at the top button.css and button.html -- those would drive how all framework based versions worked:

└── button
    β”œβ”€β”€ button.css
    β”œβ”€β”€ button.html
    β”œβ”€β”€ react
    β”‚   β”œβ”€β”€ index.html
    β”‚   β”œβ”€β”€ package.json
    β”‚   β”œβ”€β”€ src
    β”‚   β”‚   β”œβ”€β”€ Button.js
    β”‚   β”‚   └── app.js
    β”‚   β”œβ”€β”€ webpack.config.js
    β”œβ”€β”€ svelte
    β”‚   β”œβ”€β”€ README.md
    β”‚   β”œβ”€β”€ copystyles.js
    β”‚   β”œβ”€β”€ package.json
    β”‚   β”œβ”€β”€ public
    β”‚   β”‚   └── index.html
    β”‚   β”œβ”€β”€ rollup.config.js
    β”‚   β”œβ”€β”€ src
    β”‚   β”‚   β”œβ”€β”€ App.svelte
    β”‚   β”‚   β”œβ”€β”€ Button.svelte
    └── vue
        β”œβ”€β”€ README.md
        β”œβ”€β”€ babel.config.js
        β”œβ”€β”€ copystyles.js
        β”œβ”€β”€ package.json
        β”œβ”€β”€ src
        β”‚   β”œβ”€β”€ Button.vue
        β”‚   └── main.js

My thought is that I'd have a storybook for each. Simply have the stories.js glob for something like "components/src/**/react/**/*.stories.@(js|jsx|ts|tsx)" for react (forgive if my regex is wrong) and so on for each framework. Then, I suppose Storybook Composition could be used to present all of these together.

The copystyles is a 10 liner node script that simply plops the button.css into the <style>...</style> tags for vue and svelte which both appear to just work. React could likely just use composes: btn from ../path/to/button.css via CSS Modules or something else easily. I've done this before so I know it would also work; but that's about where I am with my POC.

Cooperative Strategy

Is this something that y'all are interested in or think could work? Would it possibly be doing the same exact thing in spirit to what you're trying to achieve here but not tied to React? Or, is my idea something that should be completely orthogonal to storybookjs/design-system?

I'm really curious about your thoughts regarding everything I've said above. Do you agree that components ought not to be tied to a framework at the base level? My purpose for posting this is to reach out preemptively before I fully create this framework since it's the ecosystem and our shared culture I'd like to ultimately facilitate and you all have already done so much I'd prefer to be collaborative then to just create yet another framework without being thoughtful about why :)

Styleguide / MDX examples

Storybook 5.3 will include official MDX support and we should incorporate more of that into the design system. Specifically:

  • Introduction - add a kitchen sink example story?
  • Styleguide / design tokens
  • Convert one component from DocsPage to MDX as an example?

More ideas welcome.

Access all the components / stories from another project

Hi All,

Is there a way to access to all the components / stories at runtime from another react project which install this design system as a npm package?

This can then be leveraged in the existing project that is completely encapsulated from the SDS repo to perform different operations?

Generate sketch file from Storybook

Looking for contributors to help us explore this uncharted territory.

Goal
Generate Sketch (or other design files) from the production components and stories. This helps designers stay in sync with the bonafide UI instead of toying with UI facsimile.

TODOs

  • Integrate a tool like HTML sketchapp or Sketch constructor (by Amazon)
  • Explore the workflow for generating file on CI build
  • Explore workflow of how a designer consumes the design system

Add guidance on importing best practices

Hey y'all! πŸ‘‹

I spend most of my time working on a component library. It's closed source, but it's using React + Storybook inside a Lerna Monorepo.

Anyways, one thing that I've learned that I don't see reflected here (or in the consumers of the SDS) is how to properly import for the smallest bundle size.

If you import your component like this:

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

Then it's pulling in the entire design system. Which, might be okay, but it also might not. Thus, you can change it to something like this.

import {Button} from '@storybook/design-system/dist/components/Button';

Which then only imports that specific file. That works, but then you can't combine imports into a single line. Thus, Ant Design created babel-plugin-import to translate dist/components/Button to the correct location.

An example Babel config might be this:

module.exports = {
    plugins: [
        [
            'import',
            {
                libraryDirectory: 'dist/components',
                libraryName: '@storybook/design-system'
            }
        ]
    ]
};

Should there be guidance here on what consumers should do to properly import (such as Ant Design has done)?

Cheers 🍻

Support LinkWrapper in Button component

Similar to how we support the concept of a LinkWrapper in our Link component, we need the same concept in the Button component.

Sometimes something should visually look like a button but also be a link. We support that right now with the isLink prop on Button, however it does not cover the case where you need to use a special Link component (from Gatsby, Next, React Router, etc.).

We have a less than ideal workaround for this now, which is to put a Button inside of a Link, but the LinkWrapper solution discussed here is more ideal and accessible per #34 .

Run tests?

In package.json the tests reference react-scripts:

    "test": "cross-env CI=1 react-scripts test --env=jsdom",
    "test:watch": "react-scripts test --env=jsdom"

But react-scripts are not installed. How are y'all runnin yo tests?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.