@strategies/ui v1.17.20
Strategies' Design System UI Components
Installation
pnpm add @strategies/ui
Usage
There are two types of components in the system: interface components and portals.
The interface components specify the child elements to act as portals that you can declaratively pass your content into. Regardless of declaration order, these named portals will place their children inside of the elements specified by the interface component.
Example
import { Modal, Title, Body, Buttons, Button } from '@strategies/ui';
<Modal>
<Title>My Modal</Title>
<Body>
<p>This is the body of my modal</p>
</Body>
<Buttons>
<Button onClick={cancel}>
Cancel
</Button>
<Button onClick={save}>
Save
</Button>
</Buttons>
</Modal>
The interface components that are available are:
- Accordion
- Button
- Checkbox
- CheckboxPill
- ColorItem
- IconButton
- List
- ListItem
- MenuBar
- Modal
- Panel
- Pill
- RadioSlider
- Select
- Slider
Build
pnpm run build
Design Tokens
Using the tokens in css or scss file
@use '~@strategies/tokens/color';
@use '~@strategies/tokens/font';
.YourComponent {
color: color.$blue;
font-size: font.$size-small;
}
Using the tokens in js/jsx/ts/tsx file
- the `token
function is for getting the value by passing in a path string
- to use the
token
function, please install another package@strategeies/ui
pnpm add --save-dev @strategies/ui
- usage example
import { ConfigProvider } from 'antd';
import { token } from '@strategeies/ui';
export const ButtonAntConfig = ({children}) => {
return (
<ConfigProvider
theme={{
token: {
/* token fn here */
colorPrimary: token('color.text.danger', '#ff0000'),
}
}}>
{children}
</ConfigProvider>
)
}
export default ButtonAntConfig;
3 days ago
3 days ago
17 days ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
11 months ago
11 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago