@unpunnyfuns/swatchbook-addon 0.20.3 → 0.20.5

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 CHANGED
@@ -1,10 +1,10 @@
1
1
  # swatchbook-addon
2
2
 
3
- The Storybook 10 side of [swatchbook](https://github.com/unpunnyfuns/swatchbook).
3
+ Storybook 10 addon for documenting DTCG design tokens.
4
4
 
5
- Loads your DTCG tokens at config time, exposes the resolved graph to the preview through a virtual module, and renders a toolbar popover with one dropdown per modifier axis (`mode`, `brand`, ), preset pills, and a color-format picker. Ships a typed `useToken()` hook for stories that need a resolved value at runtime.
5
+ Loads your token files, resolves the alias graph, and adds a toolbar that flips the active theme tuple (`mode × brand × contrast × …`). Every story and MDX doc block re-renders against the new tuple without per-story wiring — component stories and the token reference share one source of truth.
6
6
 
7
- One install pulls the whole React surface toolbar, preview decorator, every MDX doc block, `ThemeSwitcher`, `useToken()`. `import { TokenTable, ThemeSwitcher, useToken } from '@unpunnyfuns/swatchbook-addon'` works without a second install line because the addon re-exports the full blocks + switcher API.
7
+ Bundles MDX doc blocks (`<TokenTable />`, `<ColorPalette />`, `<TokenDetail />`, …), a standalone `<ThemeSwitcher>` for non-Storybook surfaces, and a typed `useToken()` hook for stories that need a resolved value at runtime. Re-exports [`@unpunnyfuns/swatchbook-blocks`](../blocks) and [`@unpunnyfuns/swatchbook-switcher`](../switcher) a single install covers the whole React surface.
8
8
 
9
9
  ## Install
10
10
 
@@ -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 * 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"}
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.20.3",
3
+ "version": "0.20.5",
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.20.3",
74
- "@unpunnyfuns/swatchbook-core": "0.20.3",
75
- "@unpunnyfuns/swatchbook-switcher": "0.20.3"
73
+ "@unpunnyfuns/swatchbook-blocks": "0.20.5",
74
+ "@unpunnyfuns/swatchbook-core": "0.20.5",
75
+ "@unpunnyfuns/swatchbook-switcher": "0.20.5"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "react": ">=18",