@terra-money/station-ui
v1.0.13
Published
![Banner](Banner.png)
Downloads
12
Keywords
Readme
Station UI
Station UI is a component library to serve Station Web and Station Extension.
Local Storybook
This library uses Storybook for local testing and development of components.
To use Storybook:
- Install the dependencies:
npm install
- Build the package: This is primary to build the tokens
npm run build
- Start the Storybook server:
npm run storybook
Building the Package
npm run build
This will first run npm run build-dictionary
to generate CSS tokens.
Then it will build the package and output it to dist/
.
Style Dictionary
This library uses Style Dictionary to generate CSS tokens.
To generate CSS tokens:
npm run build-dictionary
This will output the tokens to src/styles/variables.css
.
Any change make to the JSON in /style-dictionary/tokens/
will need npm run build-dictionary
to update the changes.
Linking the built package
To test the package locally, you can link the package to your project.
- Build the package:
npm run build
- Link the package:
npm link
- In your project, link the package:
npm link station-ui
- Add the station-ui stylesheet to your project (likely in
src/index.tsx
):
import 'station-ui/dist/style.css';
- Import the package:
import { Button } from 'station-ui';
Linking local with .tgz
- Build the package:
npm run build
- Pack the build:
npm pack