@blockle/blocks 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1,70 @@
|
|
|
1
|
-
# @blockle/blocks
|
|
1
|
+
# @blockle/blocks design system
|
|
2
|
+
|
|
3
|
+
Design system for react with vanilla-extract.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @blockle/blocks
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
import React from 'react';
|
|
15
|
+
|
|
16
|
+
import '@blockle/blocks/reset';
|
|
17
|
+
import { BlocksProvider } from '@blockle/blocks';
|
|
18
|
+
import { momotaro } from '@blockle/blocks-theme-momotaro';
|
|
19
|
+
|
|
20
|
+
const App = () => (
|
|
21
|
+
<BlocksProvider theme={momotaro}>
|
|
22
|
+
<div>Your app here</div>
|
|
23
|
+
</BlocksProvider>
|
|
24
|
+
);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```jsx
|
|
30
|
+
import React from 'react';
|
|
31
|
+
import { Button } from '@blockle/blocks';
|
|
32
|
+
|
|
33
|
+
const App = () => <Button variant="ghost">Click me</Button>;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Theming
|
|
37
|
+
|
|
38
|
+
yourTheme.css.ts
|
|
39
|
+
|
|
40
|
+
```jsx
|
|
41
|
+
import { ThemeTokens, makeComponentTheme, makeTheme, style } from "@blockle/blocks";
|
|
42
|
+
|
|
43
|
+
const tokens: ThemeTokens = {
|
|
44
|
+
// ...
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const button = makeComponentTheme('button', {
|
|
48
|
+
base: style({
|
|
49
|
+
...
|
|
50
|
+
}),
|
|
51
|
+
variants: {
|
|
52
|
+
primary: style({
|
|
53
|
+
...
|
|
54
|
+
}),
|
|
55
|
+
secondary: style({
|
|
56
|
+
...
|
|
57
|
+
})
|
|
58
|
+
},
|
|
59
|
+
compoundVariants: [],
|
|
60
|
+
defaultVariants: {
|
|
61
|
+
variant: 'primary',
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export const theme = makeTheme({
|
|
66
|
+
name: 'Theme name',
|
|
67
|
+
tokens,
|
|
68
|
+
components,
|
|
69
|
+
});
|
|
70
|
+
```
|