lace-ui-toolkit 1.3.0
Install from the command line:
Learn more about npm packages
$ npm install @input-output-hk/lace-ui-toolkit@1.3.0
Install via package.json:
"@input-output-hk/lace-ui-toolkit": "1.3.0"
About this version
- yarn v3.8.2. Follow installation guide
First, install the dependencies:
yarn install
Storybook is used for development, run it using command:
yarn storybook
Type | PURPOSE |
---|---|
Overview | Dumb components presented as 1:1 parity from Figma file |
Interactions | Used for testing and to simulate user interactions |
Controls | Interact with a component's arguments dynamically without needing to code |
Make sure to export components
and subcomponents
so they are displayed in the Docs
tab.
export default {
title: 'List & tables/Assets table',
component: AssetsTable,
subcomponents: {
TokenProfile,
TokenAmount,
MarketPrice,
}
} as Meta;
FILES | PURPOSE |
---|---|
*.index.ts | Defines the public API to be imported by other modules |
*.component.tsx | Defines the UI component |
*.css.ts | Vanilla-extract CSS files |
*.stories.ts | Storybook files |
*.data.ts | Defines the data/types representation of the UI component or application logic |
*.context.ts | Defines the UI component's inner state to be consumed by nested children |
*.hooks.ts | Defines methods to manipulate the context state |
Adding new or updating existing icon require:
- Copy icon to
src/icons/raw
directory - Run command
yarn build:icons
. It will generate tsx component insrc/icons
directory and updatesrc/icons/index.ts
- Commit moved icon to raw directory and built component
To use icon in this project import it using lookup location @icons/
import AdaComponent from '@icons/AdaComponents';
To use icon in dependent project import it like this
import { AdaComponent } from '@input-output-hk/lace-ui-toolkit';
We recommend using yalc for linking a package from your local development environment to another project. This is particularly helpful when developing multiple packages that depend on each other and you want to test changes in real time without needing to publish the package to a registry.
[!NOTE] Yalc is simple local npm registry which works across package managers. Learn more about yalc
If you work with projects using different package managers like npm, yarn, or pnpm the recommended approach is to use yalc, as it work across different package managers. You can easily link yarn based repository like Lace UI Toolkit to npm, yarn, or pnpm repositories in the same time.
- Install dependencies:
yarn install
- Build project Lace UI Toolkit:
yarn build
- Publish to yalc:
yalc publish
- Link Lace UI Toolkit to dependent project:
yalc link @input-output-hk/lace-ui-toolkit
- Update package in dependant project after each published build:
yalc update @input-output-hk/lace-ui-toolkit
- Once development done unlink Lace UI Toolkit:
yalc remove @input-output-hk/lace-ui-toolkit
- Install dependencies:
yarn install
- Watch for changes and build, publish and push updates:
yarn watch:pub
-
yarn watch:pub
uses commandsyarn build --watch
andyalc push
. -
yalc push
is alias foryalc publish --push
. Push will auto update Lace UI Toolkit in all linked projects.
-
- Navigate to dependent project and link Lace UI Toolkit:
yalc link @input-output-hk/lace-ui-toolkit
- Once development done unlink Lace UI Toolkit:
yalc remove @input-output-hk/lace-ui-toolkit
-
yalc link @input-output-hk/lace-ui-toolkit
: Link Lace UI Toolkit with other projects -
yalc remove @input-output-hk/lace-ui-toolkit
: Unlink Lace UI Toolkit from other projects -
yalc installations show @input-output-hk/lace-ui-toolkit
: List all projects linking to Lace UI Toolkit -
yalc publish
: Publish package to yalc's registry -
yalc update @input-output-hk/lace-ui-toolkit
: Update Lace UI Toolkit in dependent project -
yalc push
oryalc publish --push
: Publish package to yalc's registry and auto update dependant projects