storybook-addon-design-system-docs 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.
Files changed (41) hide show
  1. package/README.md +143 -15
  2. package/dist/TypographySection-D8HHJr-s.d.ts +258 -0
  3. package/dist/TypographySection-DsqZs5oA.d.cts +258 -0
  4. package/dist/TypographySection-c6k_4ZVC.d.ts +258 -0
  5. package/dist/TypographySection-lyEjSYKu.d.cts +258 -0
  6. package/dist/assets.cjs +9 -0
  7. package/dist/assets.cjs.map +1 -0
  8. package/dist/assets.d.cts +28 -0
  9. package/dist/assets.d.ts +28 -0
  10. package/dist/assets.js +7 -0
  11. package/dist/assets.js.map +1 -0
  12. package/dist/components/assets/index.cjs +634 -0
  13. package/dist/components/assets/index.cjs.map +1 -0
  14. package/dist/components/assets/index.d.cts +150 -0
  15. package/dist/components/assets/index.d.ts +150 -0
  16. package/dist/components/assets/index.js +604 -0
  17. package/dist/components/assets/index.js.map +1 -0
  18. package/dist/components/primitives/index.cjs +963 -0
  19. package/dist/components/primitives/index.cjs.map +1 -0
  20. package/dist/components/primitives/index.d.cts +194 -0
  21. package/dist/components/primitives/index.d.ts +194 -0
  22. package/dist/components/primitives/index.js +905 -0
  23. package/dist/components/primitives/index.js.map +1 -0
  24. package/dist/index.cjs +8695 -0
  25. package/dist/index.cjs.map +1 -0
  26. package/dist/index.d.cts +136 -0
  27. package/dist/index.d.ts +136 -0
  28. package/dist/index.js +8639 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/jsx-runtime.d-kG9JzmQF.d.cts +15239 -0
  31. package/dist/jsx-runtime.d-kG9JzmQF.d.ts +15239 -0
  32. package/dist/manager.js +2 -2
  33. package/dist/manager.js.map +1 -0
  34. package/dist/preset.cjs +8185 -172
  35. package/dist/preset.cjs.map +1 -0
  36. package/dist/preset.js +8187 -8
  37. package/dist/preset.js.map +1 -0
  38. package/dist/types-BVOYHsBN.d.cts +178 -0
  39. package/dist/types-BVOYHsBN.d.ts +178 -0
  40. package/package.json +141 -143
  41. package/templates/spacing.mdx +1 -1
package/README.md CHANGED
@@ -64,35 +64,163 @@ export default config;
64
64
 
65
65
  ### Options
66
66
 
67
- | Option | Type | Required | Default | Description |
68
- | ---------------- | -------------- | -------- | ------------------ | ------------------------------------------ |
69
- | `tailwindConfig` | `string` | **Yes** | - | Path to `tailwind.config.js` |
70
- | `sidebarGroup` | `string` | No | `'Design System/'` | Sidebar group name for generated docs |
71
- | `assets` | `AssetGroup[]` | No | `[]` | List of asset groups to generate |
72
- | `showOnlyCustom` | `boolean` | No | `false` | If true, only shows custom Tailwind values |
67
+ | Option | Type | Required | Default | Description |
68
+ | ---------------- | --------------- | -------- | ------------------ | ------------------------------------------------ |
69
+ | `tailwindConfig` | `string` | **Yes** | - | Path to `tailwind.config.js` |
70
+ | `sidebarGroup` | `string` | No | `'Design System/'` | Global sidebar group prefix for all docs |
71
+ | `sections` | `Section[]` | No | Default sections | Customize which theme sections to display |
72
+ | `assets` | `AssetGroup[]` | No | `[]` | Asset groups to generate galleries for |
73
+ | `showOnlyCustom` | `boolean` | No | `false` | If true, only shows custom Tailwind values |
74
+ | `templates` | `TemplateConfig`| No | Built-in templates | Override default MDX templates |
75
+
76
+ ### Sidebar Organization
77
+
78
+ The addon provides flexible control over where documentation pages appear in Storybook's sidebar through the `sidebarGroup` option and individual `path` properties.
79
+
80
+ #### Understanding `sidebarGroup` and `path`
81
+
82
+ - **`sidebarGroup`**: A global prefix applied to all generated documentation (both sections and assets)
83
+ - **`path`**: An optional per-section or per-asset path that controls placement relative to the `sidebarGroup`
84
+
85
+ #### Path Resolution Rules
86
+
87
+ The final sidebar location is determined by combining `sidebarGroup` and `path`:
88
+
89
+ 1. **Absolute path** (starts with `/`): Ignores `sidebarGroup` entirely
90
+ ```ts
91
+ sidebarGroup: 'Design System/'
92
+ sections: [{ name: 'Colors', path: '/' }]
93
+ // Result: "Colors" (at root level)
94
+ ```
95
+
96
+ 2. **Relative path**: Appends to `sidebarGroup`
97
+ ```ts
98
+ sidebarGroup: 'Design System/'
99
+ sections: [{ name: 'Colors', path: 'Theme/' }]
100
+ // Result: "Design System/Theme/Colors"
101
+ ```
102
+
103
+ 3. **No path specified**: Uses `sidebarGroup` directly
104
+ ```ts
105
+ sidebarGroup: 'Design System/'
106
+ sections: [{ name: 'Colors' }]
107
+ // Result: "Design System/Colors"
108
+ ```
109
+
110
+ 4. **Empty `sidebarGroup`**: Uses only the `path` (or just the name if no path)
111
+ ```ts
112
+ sidebarGroup: ''
113
+ sections: [{ name: 'Colors', path: 'Theme/' }]
114
+ // Result: "Theme/Colors"
115
+ ```
116
+
117
+ #### Examples
118
+
119
+ ```ts
120
+ {
121
+ name: 'storybook-addon-design-system-docs',
122
+ options: {
123
+ tailwindConfig: '../tailwind.config.js',
124
+ sidebarGroup: 'Design System/',
125
+
126
+ // Customize section placement
127
+ sections: [
128
+ { name: 'Colors', path: '/' }, // → "Colors" (root level)
129
+ { name: 'Typography', path: '/' }, // → "Typography" (root level)
130
+ { name: 'Spacing', path: 'Layout/' }, // → "Design System/Layout/Spacing"
131
+ { name: 'Shadows', path: 'Layout/' }, // → "Design System/Layout/Shadows"
132
+ ],
133
+
134
+ // Asset paths work the same way
135
+ assets: [
136
+ {
137
+ name: 'Icons',
138
+ source: './src/icons',
139
+ path: '/Resources/', // → "Resources/Icons" (absolute path, ignores sidebarGroup)
140
+ },
141
+ {
142
+ name: 'Illustrations',
143
+ source: './src/illustrations',
144
+ path: 'Assets/', // → "Design System/Assets/Illustrations" (relative to sidebarGroup)
145
+ },
146
+ ],
147
+ }
148
+ }
149
+ ```
150
+
151
+ ### Section Configuration
152
+
153
+ Customize which Tailwind theme sections to display and where they appear:
154
+
155
+ ```ts
156
+ sections: [
157
+ 'Colors', // Simple string uses defaults
158
+ {
159
+ name: 'Typography',
160
+ path: 'Theme/', // Custom sidebar location
161
+ },
162
+ {
163
+ name: 'Spacing',
164
+ path: '/', // Place at root level
165
+ },
166
+ ]
167
+ ```
168
+
169
+ Available sections: `Colors`, `Typography`, `Spacing`, `Shadows`, `BorderRadius` (or `Radius`)
73
170
 
74
171
  ### Asset Configuration
75
172
 
173
+ Generate asset galleries from your file system:
174
+
76
175
  ```ts
77
176
  assets: [
78
177
  {
79
- name: 'Icons', // Display name
80
- source: './src/icons', // Source directory (relative to project root)
81
- staticPath: '/icons', // URL path (must match where you serve static files or let addon handle it)
178
+ name: 'Icons', // Display name
179
+ source: './src/icons', // Source directory (relative to project root)
180
+ path: 'Assets/', // Optional: sidebar location (relative to sidebarGroup)
181
+ staticPath: '/icons', // Optional: URL path to serve assets from
82
182
  variants: {
83
- // Optional variants
84
- enabled: true,
85
- suffixes: ['.light', '.dark'],
183
+ enabled: true, // Enable variant detection
184
+ suffixes: ['.light', '.dark'], // Filename suffixes for variants
86
185
  },
87
186
  display: {
88
- // Optional display settings
89
- layout: 'grid',
90
- showFilename: true,
187
+ layout: 'grid', // 'grid' or 'list'
188
+ showFilename: true, // Show filenames below assets
91
189
  },
92
190
  },
93
191
  ];
94
192
  ```
95
193
 
194
+ **Asset Path Resolution**: Works exactly like section paths - supports both absolute (`/`) and relative paths, combined with `sidebarGroup`.
195
+
196
+ ### Template Customization
197
+
198
+ Override the default MDX templates for any section:
199
+
200
+ ```ts
201
+ {
202
+ templates: {
203
+ directory: './.storybook/design-system-docs', // Custom template directory
204
+ }
205
+ }
206
+ ```
207
+
208
+ Place custom MDX files in the specified directory with names matching sections (e.g., `colors.mdx`, `typography.mdx`).
209
+
210
+ ## Tailwind v4 Support
211
+
212
+ The addon automatically detects and supports both Tailwind CSS v3 (config file) and v4 (CSS `@theme` directive):
213
+
214
+ **Tailwind v3:**
215
+ ```ts
216
+ { tailwindConfig: './tailwind.config.js' }
217
+ ```
218
+
219
+ **Tailwind v4:**
220
+ ```ts
221
+ { tailwindConfig: './src/app.css' } // CSS file with @theme directive
222
+ ```
223
+
96
224
  ## Contributing
97
225
 
98
226
  We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
@@ -0,0 +1,258 @@
1
+ import { J as JSX } from './jsx-runtime.d-kG9JzmQF.js';
2
+ import { d as NormalizedSection, e as TemplateConfig } from './types-BVOYHsBN.js';
3
+ import react__default, { ReactNode } from 'react';
4
+
5
+ /**
6
+ * Normalized configuration for the Design System Addon.
7
+ * This is the internal representation of the options after validation and defaults.
8
+ */
9
+ interface NormalizedAddonOptions {
10
+ /** The validated Tailwind config path */
11
+ tailwindConfig: string;
12
+ /** The base sidebar group name (e.g., "Design System/") */
13
+ sidebarGroup: string;
14
+ /** The list of enabled and normalized primitive sections */
15
+ sections: NormalizedSection[];
16
+ /** Optional configuration for forcing all primitives into a single document */
17
+ forceSingleDoc?: NormalizedSection;
18
+ /** Whether to hide default Tailwind values */
19
+ showOnlyCustom: boolean;
20
+ /** Typography configuration */
21
+ typography?: {
22
+ example?: string;
23
+ };
24
+ /** Template engine configuration */
25
+ templates?: TemplateConfig;
26
+ }
27
+ /**
28
+ * Represents a single color definition in the theme.
29
+ */
30
+ interface ColorData {
31
+ /** The base name of the color (e.g., 'blue') */
32
+ baseName: string;
33
+ /** A record of shades where key is the shade level (e.g., '500') and value is the hex code */
34
+ shades: Record<string, string>;
35
+ /** A descriptive subtitle for the color group */
36
+ subtitle: string;
37
+ /** Whether this color is a custom definition (not in base Tailwind) */
38
+ isCustom: boolean;
39
+ /** Whether this color extends an existing Tailwind color */
40
+ isExtended: boolean;
41
+ /** Whether this is a default Tailwind color */
42
+ isDefault: boolean;
43
+ }
44
+ /**
45
+ * Context data for rendering the colors section.
46
+ */
47
+ interface ColorsContext {
48
+ /** All color definitions */
49
+ colors: ColorData[];
50
+ /** Colors marked as custom/extended */
51
+ customColors: ColorData[];
52
+ /** Colors from Tailwind defaults */
53
+ builtInColors: ColorData[];
54
+ /** Whether there are any colors to display */
55
+ hasColors: boolean;
56
+ }
57
+ /**
58
+ * Context data for rendering the typography section.
59
+ */
60
+ interface TypographyContext {
61
+ /** Font family definitions as pairs of [label, fontFamily] */
62
+ fontFamilies: [string, string][];
63
+ /** Custom font families defined in the theme */
64
+ customFamilies: [string, string][];
65
+ /** Standard Tailwind built-in font families (sans, serif, mono) */
66
+ builtInFamilies: [string, string][];
67
+ /** Font weight definitions as pairs of [label, value] */
68
+ fontWeights: [string, string][];
69
+ /** Font size definitions as pairs of [label, value] */
70
+ fontSizes: [string, string][];
71
+ /** Whether there are any font families to display */
72
+ hasFontFamily: boolean;
73
+ /** All weight keys available for filter state initialization */
74
+ allWeightKeys: string[];
75
+ /** All size keys available for filter state initialization */
76
+ allSizeKeys: string[];
77
+ }
78
+ /**
79
+ * Context data for rendering the spacing section.
80
+ */
81
+ interface SpacingContext {
82
+ /** Spacing value entries as pairs of [label, value] */
83
+ entries: [string, string][];
84
+ /** Whether there are any spacing values to display */
85
+ hasSpacing: boolean;
86
+ /** The maximum numeric value in the entries, used for bar chart scaling */
87
+ maxValue: number;
88
+ }
89
+ /**
90
+ * Context data for rendering the shadows section.
91
+ */
92
+ interface ShadowsContext {
93
+ /** Shadow value entries as pairs of [label, value] */
94
+ entries: [string, string][];
95
+ /** Whether there are any shadow values to display */
96
+ hasShadows: boolean;
97
+ }
98
+ /**
99
+ * Context data for rendering the border radius section.
100
+ */
101
+ interface RadiusContext {
102
+ /** Border radius entries as pairs of [label, value] */
103
+ entries: [string, string][];
104
+ /** Whether there are any border radius values to display */
105
+ hasRadius: boolean;
106
+ }
107
+ /**
108
+ * Main context for theme template rendering, combining all section contexts and global settings.
109
+ */
110
+ interface DesignSystemData {
111
+ /** List of section names that are currently enabled */
112
+ enabledSections: string[];
113
+ /** Whether to show only custom values, hiding default Tailwind tokens */
114
+ showOnlyCustom: boolean;
115
+ /** Default text to use for typography samples */
116
+ defaultSampleText: string;
117
+ /** Whether to use optimized React components for rendering */
118
+ useReactComponents: boolean;
119
+ /** Whether to force generation of a single documentation story instead of individual ones */
120
+ forceSingleDoc: boolean;
121
+ /** The sanitized export name when in single-story mode */
122
+ exportName?: string;
123
+ /** Context for the colors documentation section */
124
+ colors: ColorsContext;
125
+ /** Context for the typography documentation section */
126
+ typography: TypographyContext;
127
+ /** Optional context for the spacing documentation section */
128
+ spacing?: SpacingContext;
129
+ /** Optional context for the shadows documentation section */
130
+ shadows?: ShadowsContext;
131
+ /** Optional context for the border radius documentation section */
132
+ borderRadius?: RadiusContext;
133
+ }
134
+
135
+ interface ColorSectionProps {
136
+ /** Custom/extended colors from user's Tailwind config */
137
+ customColors: ColorData[];
138
+ /** Built-in Tailwind colors */
139
+ builtInColors: ColorData[];
140
+ /** Whether to show only custom colors */
141
+ showOnlyCustom: boolean;
142
+ }
143
+ /**
144
+ * Renders a color palette section with search filtering.
145
+ */
146
+ declare function ColorSection({ customColors, builtInColors, showOnlyCustom, }: ColorSectionProps): JSX.Element;
147
+ /**
148
+ * Full page wrapper for Colors story.
149
+ */
150
+ interface ColorsPageProps extends ColorSectionProps {
151
+ }
152
+ declare function ColorsPage(props: ColorsPageProps): JSX.Element;
153
+
154
+ /**
155
+ * RadiusSection - Renders border radius values with preview cards.
156
+ */
157
+ interface RadiusSectionProps {
158
+ /** Border radius entries: [label, value][] */
159
+ entries: [string, string][];
160
+ }
161
+ /**
162
+ * Renders border radius values with visual preview cards.
163
+ */
164
+ declare function RadiusSection({ entries }: RadiusSectionProps): JSX.Element;
165
+ /**
166
+ * Full page wrapper for Border Radius story.
167
+ */
168
+ interface RadiusPageProps extends RadiusSectionProps {
169
+ }
170
+ declare function RadiusPage(props: RadiusPageProps): JSX.Element;
171
+
172
+ /**
173
+ * ShadowsSection - Renders shadow values with preview cards.
174
+ */
175
+ interface ShadowsSectionProps {
176
+ /** Shadow value entries: [label, value][] */
177
+ entries: [string, string][];
178
+ }
179
+ /**
180
+ * Renders shadow values with visual preview cards.
181
+ */
182
+ declare function ShadowsSection({ entries }: ShadowsSectionProps): JSX.Element;
183
+ /**
184
+ * Full page wrapper for Shadows story.
185
+ */
186
+ interface ShadowsPageProps extends ShadowsSectionProps {
187
+ }
188
+ declare function ShadowsPage(props: ShadowsPageProps): JSX.Element;
189
+
190
+ /**
191
+ * SpacingSection - Renders spacing values with visual bars.
192
+ */
193
+ interface SpacingSectionProps {
194
+ /** Spacing value entries: [label, value][] */
195
+ entries: [string, string][];
196
+ /** Maximum numeric value (for bar scaling) */
197
+ maxValue: number;
198
+ }
199
+ /**
200
+ * Renders spacing values with visual bars showing relative sizes.
201
+ */
202
+ declare function SpacingSection({ entries }: SpacingSectionProps): JSX.Element;
203
+ /**
204
+ * Full page wrapper for Spacing story.
205
+ */
206
+ interface SpacingPageProps extends SpacingSectionProps {
207
+ }
208
+ declare function SpacingPage(props: SpacingPageProps): JSX.Element;
209
+
210
+ interface ThemeLayoutProps {
211
+ /** Title for the page */
212
+ title: string;
213
+ /** Child components */
214
+ children: ReactNode;
215
+ }
216
+ /**
217
+ * Wrapper component that provides Storybook theming and common layout.
218
+ * Used as the decorator for theme stories.
219
+ */
220
+ declare function ThemeLayout({ title, children }: ThemeLayoutProps): JSX.Element;
221
+ /**
222
+ * Storybook decorator function that wraps stories with ThemeLayout.
223
+ */
224
+ declare function themeDecorator(Story: react__default.ComponentType): JSX.Element;
225
+
226
+ /**
227
+ * TypographySection - Renders typography preview with weight/size filters.
228
+ */
229
+ interface TypographySectionProps {
230
+ /** Custom font families */
231
+ customFamilies: [string, string][];
232
+ /** Built-in font families (sans, serif, mono) */
233
+ builtInFamilies: [string, string][];
234
+ /** Font weight definitions: [label, value][] */
235
+ fontWeights: [string, string][];
236
+ /** Font size definitions: [label, value][] */
237
+ fontSizes: [string, string][];
238
+ /** All weight keys for initial filter state */
239
+ allWeightKeys: string[];
240
+ /** All size keys for initial filter state */
241
+ allSizeKeys: string[];
242
+ /** Default sample text for typography preview */
243
+ defaultSampleText: string;
244
+ /** Whether to show only custom fonts */
245
+ showOnlyCustom: boolean;
246
+ }
247
+ /**
248
+ * Renders typography section with weight/size filter controls.
249
+ */
250
+ declare function TypographySection({ customFamilies, builtInFamilies, fontWeights, fontSizes, allWeightKeys, allSizeKeys, defaultSampleText, showOnlyCustom, }: TypographySectionProps): JSX.Element;
251
+ /**
252
+ * Full page wrapper for Typography story.
253
+ */
254
+ interface TypographyPageProps extends TypographySectionProps {
255
+ }
256
+ declare function TypographyPage(props: TypographyPageProps): JSX.Element;
257
+
258
+ export { ColorSection as C, type DesignSystemData as D, type NormalizedAddonOptions as N, RadiusPage as R, ShadowsPage as S, ThemeLayout as T, ColorsPage as a, RadiusSection as b, ShadowsSection as c, SpacingPage as d, SpacingSection as e, TypographyPage as f, TypographySection as g, type ColorData as h, type ColorsContext as i, type TypographyContext as j, type SpacingContext as k, type ShadowsContext as l, type RadiusContext as m, type ColorSectionProps as n, type ColorsPageProps as o, type RadiusPageProps as p, type RadiusSectionProps as q, type ShadowsPageProps as r, type ShadowsSectionProps as s, themeDecorator as t, type SpacingPageProps as u, type SpacingSectionProps as v, type ThemeLayoutProps as w, type TypographyPageProps as x, type TypographySectionProps as y };
@@ -0,0 +1,258 @@
1
+ import { J as JSX } from './jsx-runtime.d-kG9JzmQF.cjs';
2
+ import { d as NormalizedSection, e as TemplateConfig } from './types-BVOYHsBN.cjs';
3
+ import react__default, { ReactNode } from 'react';
4
+
5
+ /**
6
+ * Normalized configuration for the Design System Addon.
7
+ * This is the internal representation of the options after validation and defaults.
8
+ */
9
+ interface NormalizedAddonOptions {
10
+ /** The validated Tailwind config path */
11
+ tailwindConfig: string;
12
+ /** The base sidebar group name (e.g., "Design System/") */
13
+ sidebarGroup: string;
14
+ /** The list of enabled and normalized primitive sections */
15
+ sections: NormalizedSection[];
16
+ /** Optional configuration for forcing all primitives into a single document */
17
+ forceSingleDoc?: NormalizedSection;
18
+ /** Whether to hide default Tailwind values */
19
+ showOnlyCustom: boolean;
20
+ /** Typography configuration */
21
+ typography?: {
22
+ example?: string;
23
+ };
24
+ /** Template engine configuration */
25
+ templates?: TemplateConfig;
26
+ }
27
+ /**
28
+ * Represents a single color definition in the theme.
29
+ */
30
+ interface ColorData {
31
+ /** The base name of the color (e.g., 'blue') */
32
+ baseName: string;
33
+ /** A record of shades where key is the shade level (e.g., '500') and value is the hex code */
34
+ shades: Record<string, string>;
35
+ /** A descriptive subtitle for the color group */
36
+ subtitle: string;
37
+ /** Whether this color is a custom definition (not in base Tailwind) */
38
+ isCustom: boolean;
39
+ /** Whether this color extends an existing Tailwind color */
40
+ isExtended: boolean;
41
+ /** Whether this is a default Tailwind color */
42
+ isDefault: boolean;
43
+ }
44
+ /**
45
+ * Context data for rendering the colors section.
46
+ */
47
+ interface ColorsContext {
48
+ /** All color definitions */
49
+ colors: ColorData[];
50
+ /** Colors marked as custom/extended */
51
+ customColors: ColorData[];
52
+ /** Colors from Tailwind defaults */
53
+ builtInColors: ColorData[];
54
+ /** Whether there are any colors to display */
55
+ hasColors: boolean;
56
+ }
57
+ /**
58
+ * Context data for rendering the typography section.
59
+ */
60
+ interface TypographyContext {
61
+ /** Font family definitions as pairs of [label, fontFamily] */
62
+ fontFamilies: [string, string][];
63
+ /** Custom font families defined in the theme */
64
+ customFamilies: [string, string][];
65
+ /** Standard Tailwind built-in font families (sans, serif, mono) */
66
+ builtInFamilies: [string, string][];
67
+ /** Font weight definitions as pairs of [label, value] */
68
+ fontWeights: [string, string][];
69
+ /** Font size definitions as pairs of [label, value] */
70
+ fontSizes: [string, string][];
71
+ /** Whether there are any font families to display */
72
+ hasFontFamily: boolean;
73
+ /** All weight keys available for filter state initialization */
74
+ allWeightKeys: string[];
75
+ /** All size keys available for filter state initialization */
76
+ allSizeKeys: string[];
77
+ }
78
+ /**
79
+ * Context data for rendering the spacing section.
80
+ */
81
+ interface SpacingContext {
82
+ /** Spacing value entries as pairs of [label, value] */
83
+ entries: [string, string][];
84
+ /** Whether there are any spacing values to display */
85
+ hasSpacing: boolean;
86
+ /** The maximum numeric value in the entries, used for bar chart scaling */
87
+ maxValue: number;
88
+ }
89
+ /**
90
+ * Context data for rendering the shadows section.
91
+ */
92
+ interface ShadowsContext {
93
+ /** Shadow value entries as pairs of [label, value] */
94
+ entries: [string, string][];
95
+ /** Whether there are any shadow values to display */
96
+ hasShadows: boolean;
97
+ }
98
+ /**
99
+ * Context data for rendering the border radius section.
100
+ */
101
+ interface RadiusContext {
102
+ /** Border radius entries as pairs of [label, value] */
103
+ entries: [string, string][];
104
+ /** Whether there are any border radius values to display */
105
+ hasRadius: boolean;
106
+ }
107
+ /**
108
+ * Main context for theme template rendering, combining all section contexts and global settings.
109
+ */
110
+ interface DesignSystemData {
111
+ /** List of section names that are currently enabled */
112
+ enabledSections: string[];
113
+ /** Whether to show only custom values, hiding default Tailwind tokens */
114
+ showOnlyCustom: boolean;
115
+ /** Default text to use for typography samples */
116
+ defaultSampleText: string;
117
+ /** Whether to use optimized React components for rendering */
118
+ useReactComponents: boolean;
119
+ /** Whether to force generation of a single documentation story instead of individual ones */
120
+ forceSingleDoc: boolean;
121
+ /** The sanitized export name when in single-story mode */
122
+ exportName?: string;
123
+ /** Context for the colors documentation section */
124
+ colors: ColorsContext;
125
+ /** Context for the typography documentation section */
126
+ typography: TypographyContext;
127
+ /** Optional context for the spacing documentation section */
128
+ spacing?: SpacingContext;
129
+ /** Optional context for the shadows documentation section */
130
+ shadows?: ShadowsContext;
131
+ /** Optional context for the border radius documentation section */
132
+ borderRadius?: RadiusContext;
133
+ }
134
+
135
+ interface ColorSectionProps {
136
+ /** Custom/extended colors from user's Tailwind config */
137
+ customColors: ColorData[];
138
+ /** Built-in Tailwind colors */
139
+ builtInColors: ColorData[];
140
+ /** Whether to show only custom colors */
141
+ showOnlyCustom: boolean;
142
+ }
143
+ /**
144
+ * Renders a color palette section with search filtering.
145
+ */
146
+ declare function ColorSection({ customColors, builtInColors, showOnlyCustom, }: ColorSectionProps): JSX.Element;
147
+ /**
148
+ * Full page wrapper for Colors story.
149
+ */
150
+ interface ColorsPageProps extends ColorSectionProps {
151
+ }
152
+ declare function ColorsPage(props: ColorsPageProps): JSX.Element;
153
+
154
+ /**
155
+ * RadiusSection - Renders border radius values with preview cards.
156
+ */
157
+ interface RadiusSectionProps {
158
+ /** Border radius entries: [label, value][] */
159
+ entries: [string, string][];
160
+ }
161
+ /**
162
+ * Renders border radius values with visual preview cards.
163
+ */
164
+ declare function RadiusSection({ entries }: RadiusSectionProps): JSX.Element;
165
+ /**
166
+ * Full page wrapper for Border Radius story.
167
+ */
168
+ interface RadiusPageProps extends RadiusSectionProps {
169
+ }
170
+ declare function RadiusPage(props: RadiusPageProps): JSX.Element;
171
+
172
+ /**
173
+ * ShadowsSection - Renders shadow values with preview cards.
174
+ */
175
+ interface ShadowsSectionProps {
176
+ /** Shadow value entries: [label, value][] */
177
+ entries: [string, string][];
178
+ }
179
+ /**
180
+ * Renders shadow values with visual preview cards.
181
+ */
182
+ declare function ShadowsSection({ entries }: ShadowsSectionProps): JSX.Element;
183
+ /**
184
+ * Full page wrapper for Shadows story.
185
+ */
186
+ interface ShadowsPageProps extends ShadowsSectionProps {
187
+ }
188
+ declare function ShadowsPage(props: ShadowsPageProps): JSX.Element;
189
+
190
+ /**
191
+ * SpacingSection - Renders spacing values with visual bars.
192
+ */
193
+ interface SpacingSectionProps {
194
+ /** Spacing value entries: [label, value][] */
195
+ entries: [string, string][];
196
+ /** Maximum numeric value (for bar scaling) */
197
+ maxValue: number;
198
+ }
199
+ /**
200
+ * Renders spacing values with visual bars showing relative sizes.
201
+ */
202
+ declare function SpacingSection({ entries }: SpacingSectionProps): JSX.Element;
203
+ /**
204
+ * Full page wrapper for Spacing story.
205
+ */
206
+ interface SpacingPageProps extends SpacingSectionProps {
207
+ }
208
+ declare function SpacingPage(props: SpacingPageProps): JSX.Element;
209
+
210
+ interface ThemeLayoutProps {
211
+ /** Title for the page */
212
+ title: string;
213
+ /** Child components */
214
+ children: ReactNode;
215
+ }
216
+ /**
217
+ * Wrapper component that provides Storybook theming and common layout.
218
+ * Used as the decorator for theme stories.
219
+ */
220
+ declare function ThemeLayout({ title, children }: ThemeLayoutProps): JSX.Element;
221
+ /**
222
+ * Storybook decorator function that wraps stories with ThemeLayout.
223
+ */
224
+ declare function themeDecorator(Story: react__default.ComponentType): JSX.Element;
225
+
226
+ /**
227
+ * TypographySection - Renders typography preview with weight/size filters.
228
+ */
229
+ interface TypographySectionProps {
230
+ /** Custom font families */
231
+ customFamilies: [string, string][];
232
+ /** Built-in font families (sans, serif, mono) */
233
+ builtInFamilies: [string, string][];
234
+ /** Font weight definitions: [label, value][] */
235
+ fontWeights: [string, string][];
236
+ /** Font size definitions: [label, value][] */
237
+ fontSizes: [string, string][];
238
+ /** All weight keys for initial filter state */
239
+ allWeightKeys: string[];
240
+ /** All size keys for initial filter state */
241
+ allSizeKeys: string[];
242
+ /** Default sample text for typography preview */
243
+ defaultSampleText: string;
244
+ /** Whether to show only custom fonts */
245
+ showOnlyCustom: boolean;
246
+ }
247
+ /**
248
+ * Renders typography section with weight/size filter controls.
249
+ */
250
+ declare function TypographySection({ customFamilies, builtInFamilies, fontWeights, fontSizes, allWeightKeys, allSizeKeys, defaultSampleText, showOnlyCustom, }: TypographySectionProps): JSX.Element;
251
+ /**
252
+ * Full page wrapper for Typography story.
253
+ */
254
+ interface TypographyPageProps extends TypographySectionProps {
255
+ }
256
+ declare function TypographyPage(props: TypographyPageProps): JSX.Element;
257
+
258
+ export { ColorSection as C, type DesignSystemData as D, type NormalizedAddonOptions as N, RadiusPage as R, ShadowsPage as S, ThemeLayout as T, ColorsPage as a, RadiusSection as b, ShadowsSection as c, SpacingPage as d, SpacingSection as e, TypographyPage as f, TypographySection as g, type ColorData as h, type ColorsContext as i, type TypographyContext as j, type SpacingContext as k, type ShadowsContext as l, type RadiusContext as m, type ColorSectionProps as n, type ColorsPageProps as o, type RadiusPageProps as p, type RadiusSectionProps as q, type ShadowsPageProps as r, type ShadowsSectionProps as s, themeDecorator as t, type SpacingPageProps as u, type SpacingSectionProps as v, type ThemeLayoutProps as w, type TypographyPageProps as x, type TypographySectionProps as y };