@unpunnyfuns/swatchbook-addon 0.8.0 → 0.9.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 +3 -7
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -7,14 +7,10 @@ Published as `@unpunnyfuns/swatchbook-addon`. Storybook 10 addon for DTCG design
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
npm install -D @unpunnyfuns/swatchbook-addon
|
|
10
|
+
npm install -D @unpunnyfuns/swatchbook-addon
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
npm install @unpunnyfuns/swatchbook-blocks
|
|
17
|
-
```
|
|
13
|
+
One package pulls the whole React surface — toolbar, preview decorator, `useToken()`, every MDX doc block (`TokenTable`, `ColorPalette`, `TokenDetail`, `SwatchbookProvider`, block-side hooks), and the standalone `ThemeSwitcher`. `swatchbook-core`, `-blocks`, and `-switcher` come along transitively; each is still independently installable for slice-only consumers.
|
|
18
14
|
|
|
19
15
|
Peer requirements: `storybook@^10.3`, `react` / `react-dom` 18+.
|
|
20
16
|
|
|
@@ -64,7 +60,7 @@ export default definePreview({
|
|
|
64
60
|
## `useToken`
|
|
65
61
|
|
|
66
62
|
```ts
|
|
67
|
-
import { useToken } from '@unpunnyfuns/swatchbook-addon
|
|
63
|
+
import { useToken } from '@unpunnyfuns/swatchbook-addon';
|
|
68
64
|
|
|
69
65
|
function Card() {
|
|
70
66
|
const bg = useToken('color.surface.default');
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { t as AddonOptions } from "./options-rvGQy0uV.mjs";
|
|
2
2
|
import { definePreviewAddon } from "storybook/internal/csf";
|
|
3
|
+
export * from "@unpunnyfuns/swatchbook-blocks";
|
|
4
|
+
export * from "@unpunnyfuns/swatchbook-switcher";
|
|
3
5
|
|
|
4
6
|
//#region src/constants.d.ts
|
|
5
7
|
declare const ADDON_ID = "swatchbook";
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { i as preview_exports } from "./preview-hz8hF3q0.mjs";
|
|
2
2
|
import { c as PARAM_KEY, i as GLOBAL_KEY, m as VIRTUAL_MODULE_ID, n as AXES_GLOBAL_KEY, t as ADDON_ID } from "./constants-B3vYm529.mjs";
|
|
3
3
|
import { definePreviewAddon } from "storybook/internal/csf";
|
|
4
|
+
export * from "@unpunnyfuns/swatchbook-blocks";
|
|
5
|
+
export * from "@unpunnyfuns/swatchbook-switcher";
|
|
4
6
|
//#region src/index.ts
|
|
5
7
|
/**
|
|
6
8
|
* CSF Next factory. Consumers call this inside
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["previewExports"],"sources":["../src/index.ts"],"sourcesContent":["import { definePreviewAddon } from 'storybook/internal/csf';\nimport * as previewExports from './preview.tsx';\n\nexport {\n ADDON_ID,\n AXES_GLOBAL_KEY,\n GLOBAL_KEY,\n PARAM_KEY,\n VIRTUAL_MODULE_ID,\n} from '#/constants.ts';\nexport type { AddonOptions } from '#/options.ts';\n\n/**\n * CSF Next factory. Consumers call this inside\n * `definePreview({ addons: [swatchbookAddon()] })` so the preview annotations\n * (decorator, globalTypes, initialGlobals) are added to the preview bundle.\n */\nexport default function swatchbookAddon(): ReturnType<typeof definePreviewAddon> {\n return definePreviewAddon(previewExports);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["previewExports"],"sources":["../src/index.ts"],"sourcesContent":["import { definePreviewAddon } from 'storybook/internal/csf';\nimport * as previewExports from './preview.tsx';\n\nexport {\n ADDON_ID,\n AXES_GLOBAL_KEY,\n GLOBAL_KEY,\n PARAM_KEY,\n VIRTUAL_MODULE_ID,\n} from '#/constants.ts';\nexport type { AddonOptions } from '#/options.ts';\n\n/**\n * Re-export the full user-facing surface from `@unpunnyfuns/swatchbook-blocks`\n * and `@unpunnyfuns/swatchbook-switcher` so consumers can\n * `import { TokenTable, ThemeSwitcher, useToken } from '@unpunnyfuns/swatchbook-addon'`\n * without adding the sibling packages to their own package.json. Both are\n * declared as regular dependencies of the addon, so they come along for the\n * ride. Subpath entries (`./preset`, `./manager`, `./preview`, `./hooks`)\n * still exist for Storybook's preset loader — this meta re-export is just\n * for the React / MDX consumer path.\n */\nexport * from '@unpunnyfuns/swatchbook-blocks';\nexport * from '@unpunnyfuns/swatchbook-switcher';\n\n/**\n * CSF Next factory. Consumers call this inside\n * `definePreview({ addons: [swatchbookAddon()] })` so the preview annotations\n * (decorator, globalTypes, initialGlobals) are added to the preview bundle.\n */\nexport default function swatchbookAddon(): ReturnType<typeof definePreviewAddon> {\n return definePreviewAddon(previewExports);\n}\n"],"mappings":";;;;;;;;;;;AA8BA,SAAwB,kBAAyD;AAC/E,QAAO,mBAAmBA,gBAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unpunnyfuns/swatchbook-addon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Storybook addon for DTCG design tokens — toolbar, panel, and useToken hook.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "unpunnyfuns <unpunnyfuns@gmail.com>",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"jiti": "^2.4.0",
|
|
72
72
|
"picomatch": "^4.0.4",
|
|
73
|
-
"@unpunnyfuns/swatchbook-blocks": "0.
|
|
74
|
-
"@unpunnyfuns/swatchbook-core": "0.
|
|
75
|
-
"@unpunnyfuns/swatchbook-switcher": "0.
|
|
73
|
+
"@unpunnyfuns/swatchbook-blocks": "0.9.0",
|
|
74
|
+
"@unpunnyfuns/swatchbook-core": "0.9.0",
|
|
75
|
+
"@unpunnyfuns/swatchbook-switcher": "0.9.0"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": ">=18",
|