0.1.28 • Published 4 years ago

@refract-ui/docs v0.1.28

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

@refract-ui/docs

Storybook documentation and add-on for @refract-ui

Getting Started

This assumes you have Storybook installed.

  1. Install docs: yarn add -D @refract-ui/docs
  2. Update .storybook/main.js with the following:

    module.exports = {
      "stories": [
        ...,
        "@refract-ui/docs/dist/**/*.stories.js"
      ],
      "addons": [
        ...,
        "@refract-ui/docs/preset"
      ]
    }
  3. Run storybook to see docs for refract

Add On

@refract-ui contains a preset add-on that does a few things:

  • It provides a decorator that includes a Theme Provider so that the packaged stories have access to necessary theme props
  • It orders the packaged stories
  • It provides a toolbar tool for storybook that allows users to easily toggle between the default refract theme and a provided theme.

To add your own theme to the tool, create a new theme object and pass it to the refract.themes array in preview.js's parameters.

// ./storybook/preview.js
import { theme } from '@refract-ui/core';

const tomatoTheme = {
  name: 'Tomato Theme',
  theme: theme({
    themeColors: ({ defaults }) => ({
      ...defaults,
      primary: 'tomato'
    })
  })
}

export const parameters = {
  refract: {
    themes: [
      tomatoTheme
    ]
  }
}
0.1.10

4 years ago

0.1.11

4 years ago

0.1.12

4 years ago

0.1.13

4 years ago

0.1.14

4 years ago

0.1.15

4 years ago

0.1.27

4 years ago

0.1.28

4 years ago

0.1.20

4 years ago

0.1.21

4 years ago

0.1.22

4 years ago

0.1.23

4 years ago

0.1.24

4 years ago

0.1.25

4 years ago

0.1.26

4 years ago

0.1.16

4 years ago

0.1.17

4 years ago

0.1.18

4 years ago

0.1.19

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.5

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago