2.5.1 • Published 4 years ago

@bekk/storybook v2.5.1

Weekly downloads
93
License
MIT
Repository
github
Last release
4 years ago

CircleCI

This component library uses https://github.com/storybooks/storybook.

Welcome!

This package is maintained by employees at Bekk. Check us out at bekk.no!

You can see the app live at storybook.bekk.no

Usage

In your project, run:

npm install @bekk/storybook

This will fetch and install the files in your node_modules folder. You can then import the files you require as you please.

React Components

You can import the components you need as named imports.

import { DatePicker, TextField } from '@bekk/storybook';

For a full list of available components, please refer to the documentation or source code

Usage with Webpack, Parcel et al

Most popular web application bundler provide ways to load CSS files into their dependency graphs. Parcel lets you do this by default, and Webpack requires a loader (see this article on how to set that up). If you're using create-react-app, this is already set up for you.

Once you can specify CSS files as dependencies, you might want to include the following ones:

Color variables

import '@bekk/storybook/build/lib/constants/styles.css';

This will set all our colors as CSS variables globally. To see which ones are available, please see the source code.

You can also access (at least some of) these variables from JavaScript (or TypeScript):

import * as colors from '@bekk/storybook/build/lib/constants/styles';

Fonts

import '@bekk/storybook/build/lib/fonts/webfonts.css';

This will load our web fonts, and make them available to use in your CSS. Note that font weights aren't supported, so you have to specify different font-families instead. The ones that are available are:

  • FFDINWebProLight - our basic body text font (sans-serif).
  • DINW01LightItalic - same as above, but italic. Use instead of font-style: italic
  • DINW01Regular - same as above, but bold. Use instead of font-weight: bold
  • DINW01Medium - same as above, but black (super-bold).
  • NewZaldBook - our large heading font (serif)

Development

Clone the the repository Go to root of project Run:

npm install
npm run storybook

Changed made to code will automatically be reflected in the app.

You can also create a static build:

npm run build

Go to folder storyboard-static and open index.html in browser.

Note: TSconfig

Storybook requires a tsconfig.json in the .storybook directory to correctly compile TS on npm run storybook, while most text editors requires it at the root directory for correct linting. Thus the "compilerOptions" are to be defined in ./tsconfig.json and .storybook/tsconfig.json extends this file and contains the relative paths to the "baseUrl", "rootDir" and "outDir" as well as the "include"and "exclude" options.

NNB!! The .storybook/tsconfig is the correct file to use when compiling to create a build!

Local testing in dependent project

In the root folder of the Storybook run:

npm run link

Then in the directory containing the package.json of the dependent project run:

npm link @bekk/storybook

This creates a symlink of your local version of the Storybook to the node_modules of the dependent project. Changes done to the Storybook will then be automatically reflected in the project importing it.

To remove the symlink from the dependent project run:

npm unlink --no-save @bekk/storybook

Deployment and npm publish

To deploy and publish a new version you have to create a release / tag.

  • The release have to conform to this regex [1-9]+\.(0|[1-9]+)\.(0|[1-9]+). (For example 2.3.1. )
  • The release must use semantic versioning. ( https://semver.org/ )

This is important because the release tag will be the version of the new npm package.

If everything works:

Contribute

Clone the repository and make a pull request

Thanks!

This repository is forked from https://github.com/sw-yx/react-typescript-storybook-starter
Using https://github.com/storybooks/storybook

2.5.1

4 years ago

2.5.0

4 years ago

2.4.9

4 years ago

2.4.8

4 years ago

2.4.7

5 years ago

2.4.6

5 years ago

2.4.5

5 years ago

2.4.2

5 years ago

2.4.1

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.8

5 years ago

2.2.7

5 years ago

2.2.6

5 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.16

5 years ago

2.0.15

5 years ago

2.0.14

5 years ago

2.0.13

5 years ago

2.0.12

5 years ago

2.0.10

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.14.0

5 years ago

1.13.11

5 years ago

1.13.10

5 years ago

1.13.9

5 years ago

1.13.8

5 years ago

1.13.7

5 years ago

1.13.6

5 years ago

1.13.5

5 years ago

1.13.4

5 years ago

1.13.3

5 years ago

1.13.2

5 years ago

1.13.1

5 years ago

1.13.0

5 years ago

1.12.1

5 years ago

1.12.0

5 years ago

1.2.1

5 years ago

1.11.11

5 years ago

1.11.8

5 years ago

1.11.7

5 years ago

1.11.6

5 years ago

1.11.5

5 years ago

1.11.2

5 years ago

1.11.1

5 years ago

1.10.9

5 years ago

1.10.8

5 years ago

1.10.7

5 years ago

1.10.6

5 years ago

1.10.5

5 years ago

1.10.4

5 years ago

1.10.3

5 years ago

1.10.2

5 years ago

1.10.1

6 years ago

1.9.68

6 years ago

1.9.67

6 years ago

1.9.66

6 years ago

1.9.65

6 years ago

1.9.64

6 years ago

1.9.63

6 years ago

1.9.62

6 years ago

1.9.61

6 years ago

1.9.6

6 years ago

1.9.59

6 years ago

1.9.58

6 years ago

1.9.57

6 years ago

1.9.55

6 years ago

1.9.54

6 years ago

1.9.3

6 years ago

1.9.2

6 years ago

1.9.1

6 years ago

1.9.0

6 years ago

1.8.0

6 years ago

1.7.0

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago