@unpunnyfuns/swatchbook-blocks 1.2.0 → 2.0.0
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 +5 -3
- package/dist/host-e2nSv-sA.mjs +791 -0
- package/dist/host-e2nSv-sA.mjs.map +1 -0
- package/dist/host.d.mts +57 -0
- package/dist/host.mjs +2 -0
- package/dist/index.d.mts +190 -348
- package/dist/index.mjs +485 -1100
- package/dist/index.mjs.map +1 -1
- package/dist/registry-Dm25Go94.d.mts +244 -0
- package/dist/style.css +237 -240
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -24,17 +24,19 @@ import { ColorPalette, TokenTable, TokenDetail } from '@unpunnyfuns/swatchbook-a
|
|
|
24
24
|
<TokenDetail path="color.accent.bg" />
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Outside Storybook, wrap your tree in `SwatchbookProvider` and pass a `
|
|
27
|
+
Outside Storybook, wrap your tree in `SwatchbookProvider` and pass a wire snapshot (core's `snapshotForWire(project, css)`, typically written to JSON at build time):
|
|
28
28
|
|
|
29
29
|
```tsx
|
|
30
30
|
import { SwatchbookProvider, TokenTable } from '@unpunnyfuns/swatchbook-blocks';
|
|
31
|
-
import
|
|
31
|
+
import wire from './tokens-snapshot.json';
|
|
32
32
|
|
|
33
|
-
<SwatchbookProvider
|
|
33
|
+
<SwatchbookProvider snapshot={wire} defaultAxes={{ mode: 'Light' }}>
|
|
34
34
|
<TokenTable filter="color.**" />
|
|
35
35
|
</SwatchbookProvider>;
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
Pass `defaultAxes` and flip the tuple with `useSetAxes()`, or pass `axes` to drive it from the host's own state.
|
|
39
|
+
|
|
38
40
|
Block catalogue, props, and composition patterns live in the [blocks reference](https://unpunnyfuns.github.io/swatchbook/reference/blocks) and the [authoring guide](https://unpunnyfuns.github.io/swatchbook/guides/authoring-doc-stories).
|
|
39
41
|
|
|
40
42
|
## Boundaries
|