diff --git a/package.json b/package.json index 7690610..4ad1f87 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ }, "devDependencies": { "@auto-it/released": "^11.3.0", - "@storybook/addon-designs": "*", + "@storybook/addon-designs": "workspace:*", "@storybook/addon-docs": "^10.0.0-0", "@storybook/react-vite": "^10.0.0-0", "@types/react": "^18.2.65", diff --git a/packages/storybook-addon-designs/src/index.ts b/packages/storybook-addon-designs/src/index.ts index d169a2e..9045e2f 100644 --- a/packages/storybook-addon-designs/src/index.ts +++ b/packages/storybook-addon-designs/src/index.ts @@ -1,5 +1,8 @@ +import { definePreviewAddon } from "storybook/internal/csf"; + import { PanelName, ParameterName } from "./constants"; import { Config } from "./config"; +import type { DesignTypes } from "./types"; /** * Dumb function to ensure typings or enchance IDE auto completion. @@ -10,3 +13,6 @@ export const config = (c: Config | Config[]) => c; * Useful exports for third party developers and advanced usages */ export { Config, ParameterName as PARAM_KEY, PanelName }; +export type { DesignTypes } from "./types"; + +export default () => definePreviewAddon({}); diff --git a/packages/storybook-addon-designs/src/types.ts b/packages/storybook-addon-designs/src/types.ts new file mode 100644 index 0000000..c343933 --- /dev/null +++ b/packages/storybook-addon-designs/src/types.ts @@ -0,0 +1,16 @@ +import type { Config } from "./config"; + +export interface DesignParameters { + /** + * Design addon configuration for embedding design previews in the addon panel. + * + * Supports Figma, Sketch, images, iframes, and links. + * + * @see https://github.com/storybookjs/addon-designs + */ + design?: Config | Config[]; +} + +export interface DesignTypes { + parameters: DesignParameters; +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fac3f15..505428c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^11.3.0 version: 11.3.0(@types/node@24.9.2)(typescript@5.9.3) '@storybook/addon-designs': - specifier: '*' - version: 11.0.0(@storybook/addon-docs@10.0.0(@types/react@18.3.26)(esbuild@0.25.11)(rollup@4.52.5)(storybook@10.0.0(@testing-library/dom@10.4.1)(prettier@3.6.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vite@7.1.12(@types/node@24.9.2)))(vite@7.1.12(@types/node@24.9.2)))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.0.0(@testing-library/dom@10.4.1)(prettier@3.6.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vite@7.1.12(@types/node@24.9.2))) + specifier: workspace:* + version: link:packages/storybook-addon-designs '@storybook/addon-docs': specifier: ^10.0.0-0 version: 10.0.0(@types/react@18.3.26)(esbuild@0.25.11)(rollup@4.52.5)(storybook@10.0.0(@testing-library/dom@10.4.1)(prettier@3.6.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vite@7.1.12(@types/node@24.9.2)))(vite@7.1.12(@types/node@24.9.2)) @@ -349,17 +349,9 @@ packages: cpu: [x64] os: [win32] - '@figspec/components@1.0.3': - resolution: {integrity: sha512-fBwHzJ4ouuOUJEi+yBZIrOy+0/fAjB3AeTcIHTT1PRxLz8P63xwC7R0EsIJXhScIcc+PljGmqbbVJCjLsnaGYA==} - '@figspec/components@2.0.5': resolution: {integrity: sha512-nJ2Ms3Ua8r3f18fWVC6GEAN1qchJ0KheZIV+lPaDjZa4KJW9FXi2Ora2tuPkp8SMFl6uaqibYk7/VwTq+zNQ7A==} - '@figspec/react@1.0.4': - resolution: {integrity: sha512-jaPvkIef4d6NjsRiw91OZabrfdPH9FtoPGYcY5mpXjYEcdUqIq1aHtLq3SkMVyVysEapTEJ6yS8amy93MyXBEQ==} - peerDependencies: - react: ^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - '@figspec/react@2.0.1': resolution: {integrity: sha512-xflqJ3XQZVzm8+7dsm8OFxVAmBNNA3Mg65sqwNHiq7VRSMSD7qwH4BPsBy07ZaX+9nHeaacBpFZd3Q0aIsISqw==} peerDependencies: @@ -397,23 +389,14 @@ packages: '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - '@lit-labs/react@1.2.1': - resolution: {integrity: sha512-DiZdJYFU0tBbdQkfwwRSwYyI/mcWkg3sWesKRsHUd4G+NekTmmeq9fzsurvcKTNVa0comNljwtg4Hvi1ds3V+A==} - '@lit-labs/react@2.1.3': resolution: {integrity: sha512-OD9h2JynerBQUMNzb563jiVpxfvPF0HjQkKY2mx0lpVYvD7F+rtJpOGz6ek+6ufMidV3i+MPT9SX62OKWHFrQg==} - '@lit-labs/ssr-dom-shim@1.4.0': - resolution: {integrity: sha512-ficsEARKnmmW5njugNYKipTm4SFnbik7CXtoencDZzmzo/dQ+2Q0bgkzJuoJP20Aj0F+izzJjOqsnkd6F/o1bw==} - '@lit/react@1.0.8': resolution: {integrity: sha512-p2+YcF+JE67SRX3mMlJ1TKCSTsgyOVdAwd/nxp3NuV1+Cb6MWALbN6nT7Ld4tpmYofcE5kcaSY1YBB9erY+6fw==} peerDependencies: '@types/react': 17 || 18 || 19 - '@lit/reactive-element@1.6.3': - resolution: {integrity: sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==} - '@mdx-js/react@3.1.1': resolution: {integrity: sha512-f++rKLQgUVYDAtECQ6fn/is15GkEH9+nZPM3MS0RcxVqoTfawHvDlSCH7JbMhAM6uJ32v3eXLvLmLvjGu7PTQw==} peerDependencies: @@ -608,21 +591,6 @@ packages: cpu: [x64] os: [win32] - '@storybook/addon-designs@11.0.0': - resolution: {integrity: sha512-MH4rM5JsG/YndaQM0QqJo2kUZ/Io0XJbOvzBPdQ7Z5Xox5MSPgWocuvVsQuu9/B7bVCsnt1xv5c1sCHww6stPg==} - peerDependencies: - '@storybook/addon-docs': ^10.0.0 || ^10.0.0-0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.0.0 || ^10.0.0-0 - peerDependenciesMeta: - '@storybook/addon-docs': - optional: true - react: - optional: true - react-dom: - optional: true - '@storybook/addon-docs@10.0.0': resolution: {integrity: sha512-mwEI/os48ncIQMrLFAI3rJf88Ge/2/7Pj+g6+MRYjWAz5x9zCLrOgRUJFRvuzVY4SJKsKuSPYplrbmj4L+YlRQ==} peerDependencies: @@ -782,9 +750,6 @@ packages: '@types/resolve@1.20.6': resolution: {integrity: sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ==} - '@types/trusted-types@2.0.7': - resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} - '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} @@ -1411,15 +1376,6 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - lit-element@3.3.3: - resolution: {integrity: sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA==} - - lit-html@2.8.0: - resolution: {integrity: sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q==} - - lit@2.8.0: - resolution: {integrity: sha512-4Sc3OFX9QHOJaHbmTMk28SYgVxLN3ePDjg7hofEft2zWlehFL3LiAuapWc4U/kYwMYJSh2hTCPZ6/LIC7ii0MA==} - load-json-file@4.0.0: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} engines: {node: '>=4'} @@ -2635,18 +2591,8 @@ snapshots: '@esbuild/win32-x64@0.25.11': optional: true - '@figspec/components@1.0.3': - dependencies: - lit: 2.8.0 - '@figspec/components@2.0.5': {} - '@figspec/react@1.0.4(react@18.3.1)': - dependencies: - '@figspec/components': 1.0.3 - '@lit-labs/react': 1.2.1 - react: 18.3.1 - '@figspec/react@2.0.1(@types/react@18.3.26)(react@18.3.1)': dependencies: '@figspec/components': 2.0.5 @@ -2697,24 +2643,16 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.5 - '@lit-labs/react@1.2.1': {} - '@lit-labs/react@2.1.3(@types/react@18.3.26)': dependencies: '@lit/react': 1.0.8(@types/react@18.3.26) transitivePeerDependencies: - '@types/react' - '@lit-labs/ssr-dom-shim@1.4.0': {} - '@lit/react@1.0.8(@types/react@18.3.26)': dependencies: '@types/react': 18.3.26 - '@lit/reactive-element@1.6.3': - dependencies: - '@lit-labs/ssr-dom-shim': 1.4.0 - '@mdx-js/react@3.1.1(@types/react@18.3.26)(react@18.3.1)': dependencies: '@types/mdx': 2.0.13 @@ -2903,15 +2841,6 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.52.5': optional: true - '@storybook/addon-designs@11.0.0(@storybook/addon-docs@10.0.0(@types/react@18.3.26)(esbuild@0.25.11)(rollup@4.52.5)(storybook@10.0.0(@testing-library/dom@10.4.1)(prettier@3.6.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vite@7.1.12(@types/node@24.9.2)))(vite@7.1.12(@types/node@24.9.2)))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.0.0(@testing-library/dom@10.4.1)(prettier@3.6.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vite@7.1.12(@types/node@24.9.2)))': - dependencies: - '@figspec/react': 1.0.4(react@18.3.1) - storybook: 10.0.0(@testing-library/dom@10.4.1)(prettier@3.6.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vite@7.1.12(@types/node@24.9.2)) - optionalDependencies: - '@storybook/addon-docs': 10.0.0(@types/react@18.3.26)(esbuild@0.25.11)(rollup@4.52.5)(storybook@10.0.0(@testing-library/dom@10.4.1)(prettier@3.6.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vite@7.1.12(@types/node@24.9.2)))(vite@7.1.12(@types/node@24.9.2)) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - '@storybook/addon-docs@10.0.0(@types/react@18.3.26)(esbuild@0.25.11)(rollup@4.52.5)(storybook@10.0.0(@testing-library/dom@10.4.1)(prettier@3.6.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vite@7.1.12(@types/node@22.18.13)))(vite@7.1.12(@types/node@22.18.13))': dependencies: '@mdx-js/react': 3.1.1(@types/react@18.3.26)(react@18.3.1) @@ -3131,8 +3060,6 @@ snapshots: '@types/resolve@1.20.6': {} - '@types/trusted-types@2.0.7': {} - '@types/unist@3.0.3': {} '@vitest/expect@3.2.4': @@ -3745,22 +3672,6 @@ snapshots: lines-and-columns@1.2.4: {} - lit-element@3.3.3: - dependencies: - '@lit-labs/ssr-dom-shim': 1.4.0 - '@lit/reactive-element': 1.6.3 - lit-html: 2.8.0 - - lit-html@2.8.0: - dependencies: - '@types/trusted-types': 2.0.7 - - lit@2.8.0: - dependencies: - '@lit/reactive-element': 1.6.3 - lit-element: 3.3.3 - lit-html: 2.8.0 - load-json-file@4.0.0: dependencies: graceful-fs: 4.2.11