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
@@ -0,0 +1,963 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var theming = require('storybook/theming');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ // src/addon/components/primitives/ColorSection.tsx
8
+ var Wrapper = theming.styled.div(({ theme }) => ({
9
+ background: theme.background.content,
10
+ display: "flex",
11
+ flexDirection: "row-reverse",
12
+ justifyContent: "center",
13
+ padding: "4rem 20px",
14
+ minHeight: "100vh",
15
+ boxSizing: "border-box",
16
+ gap: "3rem",
17
+ "@media (min-width: 600px)": {}
18
+ }));
19
+ var Container = theming.styled.div(() => ({
20
+ maxWidth: "1000px",
21
+ width: "100%",
22
+ minWidth: "0px"
23
+ }));
24
+ var Title = theming.styled.h1(({ theme }) => ({
25
+ fontFamily: theme.typography.fonts.base,
26
+ WebkitFontSmoothing: "antialiased",
27
+ MozOsxFontSmoothing: "grayscale",
28
+ WebkitTapHighlightColor: "rgba(0, 0, 0, 0)",
29
+ WebkitOverflowScrolling: "touch",
30
+ margin: "20px 0 8px",
31
+ padding: 0,
32
+ cursor: "text",
33
+ position: "relative",
34
+ color: theme.textColor,
35
+ "&:first-of-type": {
36
+ marginTop: 0,
37
+ paddingTop: 0
38
+ },
39
+ "&:hover a.anchor": {
40
+ textDecoration: "none"
41
+ },
42
+ "& code": {
43
+ fontSize: "inherit"
44
+ },
45
+ fontSize: `${theme.typography.size.l1}px`,
46
+ fontWeight: theme.typography.weight.bold
47
+ }));
48
+ var SectionHeader = theming.styled.h2(() => ({
49
+ fontFamily: "inherit",
50
+ fontSize: "1.25rem",
51
+ fontWeight: 600,
52
+ marginTop: "0",
53
+ marginBottom: "1rem"
54
+ }));
55
+ var NoneDetectedText = theming.styled.div(({ theme }) => ({
56
+ color: theme.textColor,
57
+ fontStyle: "italic",
58
+ fontFamily: theme.typography.fonts.base,
59
+ fontSize: theme.typography.size.s2,
60
+ lineHeight: "24px",
61
+ margin: "0",
62
+ WebkitFontSmoothing: "antialiased",
63
+ MozOsxFontSmoothing: "grayscale",
64
+ WebkitTapHighlightColor: "rgba(0, 0, 0, 0)",
65
+ WebkitOverflowScrolling: "touch"
66
+ }));
67
+ var HorizontalRule = theming.styled.div(({ theme }) => ({
68
+ border: "0 none",
69
+ borderTop: `1px solid ${theme.appBorderColor}`,
70
+ height: 4,
71
+ paddingBottom: "30px",
72
+ marginTop: "30px"
73
+ }));
74
+ var FontHeaderSection = theming.styled.div(({ theme }) => ({
75
+ fontFamily: theme.typography.fonts.base,
76
+ fontSize: `${theme.typography.size.s3}px`,
77
+ color: theme.textColor,
78
+ margin: 0,
79
+ padding: 0,
80
+ WebkitFontSmoothing: "antialiased",
81
+ MozOsxFontSmoothing: "grayscale",
82
+ WebkitTapHighlightColor: "rgba(0, 0, 0, 0)",
83
+ WebkitOverflowScrolling: "touch",
84
+ marginBottom: "20px"
85
+ }));
86
+ var TypefaceWrapper = theming.styled.div({
87
+ display: "grid",
88
+ gridTemplateColumns: "minmax(200px, 1fr) 2fr",
89
+ gap: "40px",
90
+ marginBottom: "40px",
91
+ "@media (max-width: 600px)": {
92
+ gridTemplateColumns: "1fr"
93
+ }
94
+ });
95
+ var ControlsBar = theming.styled.div({
96
+ display: "flex",
97
+ gap: "16px",
98
+ marginBottom: "32px",
99
+ flexWrap: "wrap",
100
+ alignItems: "center"
101
+ });
102
+ var FiltersWrapper = theming.styled.div({
103
+ display: "flex",
104
+ gap: "8px",
105
+ alignItems: "center",
106
+ flexWrap: "nowrap"
107
+ });
108
+ var SearchInput = theming.styled.input(({ theme }) => ({
109
+ flex: "1 1",
110
+ width: "300px",
111
+ padding: "10px 14px",
112
+ fontSize: "14px",
113
+ border: `1px solid ${theme.appBorderColor}`,
114
+ borderRadius: "6px",
115
+ color: theme.textColor,
116
+ background: theme.background.content,
117
+ outline: "none",
118
+ transition: "border-color 0.2s, box-shadow 0.2s",
119
+ "&:focus": {
120
+ borderColor: theme.color.secondary,
121
+ boxShadow: `0 0 0 2px ${theme.color.secondary}22`
122
+ },
123
+ "&::placeholder": {
124
+ color: theme.textColor,
125
+ opacity: 0.5
126
+ }
127
+ }));
128
+ var FilterGroup = theming.styled.div(({ theme }) => ({
129
+ display: "flex",
130
+ alignItems: "center",
131
+ gap: "6px",
132
+ padding: "6px 10px",
133
+ border: `1px solid ${theme.appBorderColor}`,
134
+ borderRadius: "6px",
135
+ background: theme.background.content
136
+ }));
137
+ var FilterLabel = theming.styled.label(({ theme }) => ({
138
+ fontFamily: theme.typography.fonts.base,
139
+ fontSize: "12px",
140
+ color: theme.textColor,
141
+ opacity: 0.6,
142
+ textTransform: "uppercase",
143
+ letterSpacing: "0.5px",
144
+ marginRight: "4px"
145
+ }));
146
+ var FilterChip = theming.styled.button(({ theme }) => ({
147
+ display: "inline-flex",
148
+ alignItems: "center",
149
+ padding: "4px 10px",
150
+ fontSize: "12px",
151
+ fontWeight: 500,
152
+ border: "none",
153
+ borderRadius: "4px",
154
+ cursor: "pointer",
155
+ background: "transparent",
156
+ color: theme.textColor,
157
+ opacity: 0.6,
158
+ transition: "all 0.15s",
159
+ '&[data-active="true"]': {
160
+ background: theme.color.secondary,
161
+ color: "#fff",
162
+ opacity: 1
163
+ },
164
+ '&:hover:not([data-active="true"])': {
165
+ opacity: 0.9,
166
+ background: theme.background.hoverable
167
+ }
168
+ }));
169
+ var SampleTextInput = theming.styled.input(({ theme }) => ({
170
+ flex: "1 1 250px",
171
+ width: "500px",
172
+ minWidth: "250px",
173
+ padding: "10px 14px",
174
+ fontSize: "14px",
175
+ border: `1px solid ${theme.appBorderColor}`,
176
+ borderRadius: "6px",
177
+ color: theme.textColor,
178
+ background: theme.background.content,
179
+ outline: "none",
180
+ transition: "border-color 0.2s, box-shadow 0.2s",
181
+ "&:focus": {
182
+ borderColor: theme.color.secondary,
183
+ boxShadow: `0 0 0 2px ${theme.color.secondary}22`
184
+ },
185
+ "&::placeholder": {
186
+ color: theme.textColor,
187
+ opacity: 0.5
188
+ }
189
+ }));
190
+ var WeightColumn = theming.styled.div({
191
+ display: "flex",
192
+ flexDirection: "column",
193
+ gap: "10px"
194
+ });
195
+ var SizeColumn = theming.styled.div({
196
+ display: "flex",
197
+ flexDirection: "column",
198
+ gap: "15px"
199
+ });
200
+ var SizeRow = theming.styled.div({
201
+ display: "flex",
202
+ flexDirection: "column",
203
+ gap: "5px"
204
+ });
205
+ var SizeInfo = theming.styled.div(({ theme }) => ({
206
+ fontSize: "12px",
207
+ color: theme.textColor,
208
+ opacity: 0.7,
209
+ fontFamily: theme.typography.fonts.base
210
+ }));
211
+ var SpacingGrid = theming.styled.div({
212
+ display: "flex",
213
+ flexDirection: "column",
214
+ gap: "8px"
215
+ });
216
+ var SpacingRow = theming.styled.div(({ theme }) => ({
217
+ display: "grid",
218
+ gridTemplateColumns: "80px 80px 1fr 120px",
219
+ alignItems: "center",
220
+ gap: "16px",
221
+ padding: "8px 0",
222
+ borderBottom: `1px solid ${theme.appBorderColor}`,
223
+ fontFamily: theme.typography.fonts.base,
224
+ fontSize: "14px"
225
+ }));
226
+ var SpacingBar = theming.styled.div(({ theme }) => ({
227
+ height: "16px",
228
+ background: theme.color.secondary,
229
+ borderRadius: "2px",
230
+ transition: "width 0.2s ease"
231
+ }));
232
+ var SpacingLabel = theming.styled.span(({ theme }) => ({
233
+ fontWeight: 600,
234
+ color: theme.textColor
235
+ }));
236
+ var SpacingValue = theming.styled.span(({ theme }) => ({
237
+ color: theme.textColor,
238
+ opacity: 0.7,
239
+ fontFamily: theme.typography.fonts.mono,
240
+ fontSize: "12px"
241
+ }));
242
+ var ShadowsGrid = theming.styled.div({
243
+ display: "grid",
244
+ gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))",
245
+ gap: "24px"
246
+ });
247
+ var ShadowCard = theming.styled.div(({ theme }) => ({
248
+ background: theme.background.content,
249
+ borderRadius: "8px",
250
+ padding: "24px",
251
+ display: "flex",
252
+ flexDirection: "column",
253
+ alignItems: "center",
254
+ gap: "16px"
255
+ }));
256
+ var ShadowPreview = theming.styled.div(({ theme }) => ({
257
+ width: "100px",
258
+ height: "100px",
259
+ background: theme.background.app,
260
+ borderRadius: "8px"
261
+ }));
262
+ var ShadowLabel = theming.styled.div(({ theme }) => ({
263
+ fontFamily: theme.typography.fonts.base,
264
+ fontWeight: 600,
265
+ color: theme.textColor,
266
+ fontSize: "14px"
267
+ }));
268
+ var ShadowValue = theming.styled.div(({ theme }) => ({
269
+ fontFamily: theme.typography.fonts.mono,
270
+ fontSize: "11px",
271
+ color: theme.textColor,
272
+ opacity: 0.7,
273
+ textAlign: "center",
274
+ wordBreak: "break-word",
275
+ maxWidth: "180px"
276
+ }));
277
+ var RadiusGrid = theming.styled.div({
278
+ display: "grid",
279
+ gridTemplateColumns: "repeat(auto-fill, minmax(140px, 1fr))",
280
+ gap: "24px"
281
+ });
282
+ var RadiusCard = theming.styled.div(() => ({
283
+ display: "flex",
284
+ flexDirection: "column",
285
+ alignItems: "center",
286
+ gap: "12px"
287
+ }));
288
+ var RadiusPreview = theming.styled.div(({ theme }) => ({
289
+ width: "80px",
290
+ height: "80px",
291
+ background: theme.color.secondary
292
+ }));
293
+ var RadiusLabel = theming.styled.div(({ theme }) => ({
294
+ fontFamily: theme.typography.fonts.base,
295
+ fontWeight: 600,
296
+ color: theme.textColor,
297
+ fontSize: "14px"
298
+ }));
299
+ var RadiusValue = theming.styled.div(({ theme }) => ({
300
+ fontFamily: theme.typography.fonts.mono,
301
+ fontSize: "12px",
302
+ opacity: 0.7
303
+ }));
304
+ var PaletteGrid = theming.styled.div({
305
+ display: "flex",
306
+ flexDirection: "column",
307
+ gap: "32px"
308
+ });
309
+ var PaletteCard = theming.styled.div({
310
+ display: "flex",
311
+ flexDirection: "column",
312
+ gap: "12px",
313
+ width: "100%"
314
+ });
315
+ var PaletteHeader = theming.styled.div({
316
+ display: "flex",
317
+ flexDirection: "column",
318
+ marginBottom: "8px"
319
+ });
320
+ var PaletteTitle = theming.styled.div(({ theme }) => ({
321
+ fontFamily: theme.typography.fonts.base,
322
+ fontSize: "16px",
323
+ fontWeight: 700,
324
+ color: theme.textColor
325
+ }));
326
+ var PaletteSubtitle = theming.styled.div(({ theme }) => ({
327
+ fontFamily: theme.typography.fonts.base,
328
+ fontSize: "13px",
329
+ color: theme.textColor,
330
+ opacity: 0.7,
331
+ marginTop: "4px"
332
+ }));
333
+ var SwatchGrid = theming.styled.div({
334
+ display: "flex",
335
+ flexWrap: "wrap",
336
+ gap: "0",
337
+ borderRadius: "8px",
338
+ overflow: "hidden",
339
+ boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"
340
+ });
341
+ var SwatchWrapper = theming.styled.div({
342
+ display: "flex",
343
+ flexDirection: "column",
344
+ flex: "1 1 0px",
345
+ minWidth: "80px"
346
+ });
347
+ var SwatchColor = theming.styled.div(({ color }) => ({
348
+ height: "64px",
349
+ width: "100%",
350
+ backgroundColor: color,
351
+ position: "relative"
352
+ }));
353
+ var SwatchInfo = theming.styled.div(({ theme }) => ({
354
+ padding: "8px 12px",
355
+ backgroundColor: theme.background.content,
356
+ borderTop: "none",
357
+ display: "flex",
358
+ flexDirection: "column",
359
+ gap: "2px"
360
+ }));
361
+ var SwatchLabel = theming.styled.div(({ theme }) => ({
362
+ fontFamily: theme.typography.fonts.base,
363
+ fontSize: "12px",
364
+ fontWeight: 600,
365
+ color: theme.textColor,
366
+ whiteSpace: "nowrap",
367
+ overflow: "hidden",
368
+ textOverflow: "ellipsis"
369
+ }));
370
+ var SwatchValue = theming.styled.div(({ theme }) => ({
371
+ fontFamily: theme.typography.fonts.mono,
372
+ fontSize: "11px",
373
+ color: theme.textColor,
374
+ opacity: 0.6,
375
+ whiteSpace: "nowrap",
376
+ overflow: "hidden",
377
+ textOverflow: "ellipsis",
378
+ textTransform: "uppercase"
379
+ }));
380
+ function ColorSection({
381
+ customColors,
382
+ builtInColors,
383
+ showOnlyCustom
384
+ }) {
385
+ const [searchTerm, setSearchTerm] = react.useState("");
386
+ const hasColors = customColors.length > 0 || builtInColors.length > 0;
387
+ const filteredCustomColors = react.useMemo(() => {
388
+ if (!searchTerm) {
389
+ return customColors;
390
+ }
391
+ const lowerCaseSearchTerm = searchTerm.toLowerCase();
392
+ return customColors.filter(
393
+ (color) => color.baseName.toLowerCase().includes(lowerCaseSearchTerm) || color.subtitle.toLowerCase().includes(lowerCaseSearchTerm)
394
+ );
395
+ }, [customColors, searchTerm]);
396
+ const filteredBuiltInColors = react.useMemo(() => {
397
+ if (!searchTerm) {
398
+ return builtInColors;
399
+ }
400
+ const lowerCaseSearchTerm = searchTerm.toLowerCase();
401
+ return builtInColors.filter(
402
+ (color) => color.baseName.toLowerCase().includes(lowerCaseSearchTerm) || color.subtitle.toLowerCase().includes(lowerCaseSearchTerm)
403
+ );
404
+ }, [builtInColors, searchTerm]);
405
+ if (!hasColors) {
406
+ return /* @__PURE__ */ jsxRuntime.jsx(NoneDetectedText, { children: "No colors detected. To see a color, add it to your Tailwind configuration, or ensure Tailwind's defaults are not being overridden." });
407
+ }
408
+ if (showOnlyCustom) {
409
+ if (customColors.length === 0) {
410
+ return /* @__PURE__ */ jsxRuntime.jsx(NoneDetectedText, { children: "No custom colors detected. Define custom colors in your Tailwind configuration to see them here." });
411
+ }
412
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
413
+ /* @__PURE__ */ jsxRuntime.jsx(ControlsBar, { children: /* @__PURE__ */ jsxRuntime.jsx(
414
+ SearchInput,
415
+ {
416
+ value: searchTerm,
417
+ onChange: (e) => setSearchTerm(e.target.value),
418
+ placeholder: "Search colors..."
419
+ }
420
+ ) }),
421
+ /* @__PURE__ */ jsxRuntime.jsx(PaletteGrid, { children: filteredCustomColors.map((color) => /* @__PURE__ */ jsxRuntime.jsxs(PaletteCard, { children: [
422
+ /* @__PURE__ */ jsxRuntime.jsxs(PaletteHeader, { children: [
423
+ /* @__PURE__ */ jsxRuntime.jsx(PaletteTitle, { children: color.baseName }),
424
+ color.subtitle && /* @__PURE__ */ jsxRuntime.jsx(PaletteSubtitle, { children: color.subtitle })
425
+ ] }),
426
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchGrid, { children: Object.entries(color.shades).map(([shade, value]) => /* @__PURE__ */ jsxRuntime.jsxs(SwatchWrapper, { children: [
427
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchColor, { color: value }),
428
+ /* @__PURE__ */ jsxRuntime.jsxs(SwatchInfo, { children: [
429
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchLabel, { children: shade }),
430
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchValue, { children: value })
431
+ ] })
432
+ ] }, shade)) })
433
+ ] }, color.baseName)) })
434
+ ] });
435
+ }
436
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
437
+ /* @__PURE__ */ jsxRuntime.jsx(ControlsBar, { children: /* @__PURE__ */ jsxRuntime.jsx(
438
+ SearchInput,
439
+ {
440
+ value: searchTerm,
441
+ onChange: (e) => setSearchTerm(e.target.value),
442
+ placeholder: "Search colors..."
443
+ }
444
+ ) }),
445
+ customColors.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
446
+ /* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { children: "Design System" }),
447
+ /* @__PURE__ */ jsxRuntime.jsx(PaletteGrid, { children: filteredCustomColors.map((color) => /* @__PURE__ */ jsxRuntime.jsxs(PaletteCard, { children: [
448
+ /* @__PURE__ */ jsxRuntime.jsxs(PaletteHeader, { children: [
449
+ /* @__PURE__ */ jsxRuntime.jsx(PaletteTitle, { children: color.baseName }),
450
+ color.subtitle && /* @__PURE__ */ jsxRuntime.jsx(PaletteSubtitle, { children: color.subtitle })
451
+ ] }),
452
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchGrid, { children: Object.entries(color.shades).map(([shade, value]) => /* @__PURE__ */ jsxRuntime.jsxs(SwatchWrapper, { children: [
453
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchColor, { color: value }),
454
+ /* @__PURE__ */ jsxRuntime.jsxs(SwatchInfo, { children: [
455
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchLabel, { children: shade }),
456
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchValue, { children: value })
457
+ ] })
458
+ ] }, shade)) })
459
+ ] }, color.baseName)) }),
460
+ builtInColors.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(HorizontalRule, {})
461
+ ] }),
462
+ builtInColors.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
463
+ /* @__PURE__ */ jsxRuntime.jsx(
464
+ SectionHeader,
465
+ {
466
+ style: {
467
+ marginTop: customColors.length > 0 ? "2rem" : "0"
468
+ },
469
+ children: "Tailwind Built-ins"
470
+ }
471
+ ),
472
+ /* @__PURE__ */ jsxRuntime.jsx(PaletteGrid, { children: filteredBuiltInColors.map((color) => /* @__PURE__ */ jsxRuntime.jsxs(PaletteCard, { children: [
473
+ /* @__PURE__ */ jsxRuntime.jsxs(PaletteHeader, { children: [
474
+ /* @__PURE__ */ jsxRuntime.jsx(PaletteTitle, { children: color.baseName }),
475
+ color.subtitle && /* @__PURE__ */ jsxRuntime.jsx(PaletteSubtitle, { children: color.subtitle })
476
+ ] }),
477
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchGrid, { children: Object.entries(color.shades).map(([shade, value]) => /* @__PURE__ */ jsxRuntime.jsxs(SwatchWrapper, { children: [
478
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchColor, { color: value }),
479
+ /* @__PURE__ */ jsxRuntime.jsxs(SwatchInfo, { children: [
480
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchLabel, { children: shade }),
481
+ /* @__PURE__ */ jsxRuntime.jsx(SwatchValue, { children: value })
482
+ ] })
483
+ ] }, shade)) })
484
+ ] }, color.baseName)) })
485
+ ] })
486
+ ] });
487
+ }
488
+ function ColorsPage(props) {
489
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
490
+ /* @__PURE__ */ jsxRuntime.jsx(Title, { children: "Colors" }),
491
+ /* @__PURE__ */ jsxRuntime.jsx(ColorSection, { ...props })
492
+ ] }) });
493
+ }
494
+ function RadiusSection({ entries }) {
495
+ if (entries.length === 0) {
496
+ return /* @__PURE__ */ jsxRuntime.jsx(NoneDetectedText, { children: "No border radius values detected. Add borderRadius values to your Tailwind configuration to see them here." });
497
+ }
498
+ return /* @__PURE__ */ jsxRuntime.jsx(RadiusGrid, { children: entries.map(([label, value]) => /* @__PURE__ */ jsxRuntime.jsxs(RadiusCard, { children: [
499
+ /* @__PURE__ */ jsxRuntime.jsx(
500
+ RadiusPreview,
501
+ {
502
+ style: { borderRadius: value },
503
+ title: `Border radius: ${label}`
504
+ }
505
+ ),
506
+ /* @__PURE__ */ jsxRuntime.jsx(RadiusLabel, { children: label === "DEFAULT" ? "rounded" : `rounded-${label}` }),
507
+ /* @__PURE__ */ jsxRuntime.jsx(RadiusValue, { children: value })
508
+ ] }, label)) });
509
+ }
510
+ function RadiusPage(props) {
511
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
512
+ /* @__PURE__ */ jsxRuntime.jsx(Title, { children: "Border Radius" }),
513
+ /* @__PURE__ */ jsxRuntime.jsx("br", {}),
514
+ /* @__PURE__ */ jsxRuntime.jsx(RadiusSection, { ...props })
515
+ ] }) });
516
+ }
517
+ function ShadowsSection({ entries }) {
518
+ if (entries.length === 0) {
519
+ return /* @__PURE__ */ jsxRuntime.jsx(NoneDetectedText, { children: "No shadow values detected. Add boxShadow values to your Tailwind configuration to see them here." });
520
+ }
521
+ return /* @__PURE__ */ jsxRuntime.jsx(ShadowsGrid, { children: entries.map(([label, value]) => /* @__PURE__ */ jsxRuntime.jsxs(ShadowCard, { children: [
522
+ /* @__PURE__ */ jsxRuntime.jsx(
523
+ ShadowPreview,
524
+ {
525
+ style: { boxShadow: value },
526
+ title: `Shadow: ${label}`
527
+ }
528
+ ),
529
+ /* @__PURE__ */ jsxRuntime.jsx(ShadowLabel, { children: label === "DEFAULT" ? "shadow" : `shadow-${label}` }),
530
+ /* @__PURE__ */ jsxRuntime.jsx(ShadowValue, { title: value, children: value === "none" ? "none" : value.length > 50 ? `${value.substring(0, 47)}...` : value })
531
+ ] }, label)) });
532
+ }
533
+ function ShadowsPage(props) {
534
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
535
+ /* @__PURE__ */ jsxRuntime.jsx(Title, { children: "Shadows" }),
536
+ /* @__PURE__ */ jsxRuntime.jsx("br", {}),
537
+ /* @__PURE__ */ jsxRuntime.jsx(ShadowsSection, { ...props })
538
+ ] }) });
539
+ }
540
+ function SpacingSection({ entries }) {
541
+ if (entries.length === 0) {
542
+ return /* @__PURE__ */ jsxRuntime.jsx(NoneDetectedText, { children: "No spacing values detected. Add spacing values to your Tailwind configuration to see them here." });
543
+ }
544
+ return /* @__PURE__ */ jsxRuntime.jsx(SpacingGrid, { children: entries.map(([label, value]) => {
545
+ return /* @__PURE__ */ jsxRuntime.jsxs(SpacingRow, { children: [
546
+ /* @__PURE__ */ jsxRuntime.jsx(SpacingLabel, { children: label }),
547
+ /* @__PURE__ */ jsxRuntime.jsx(SpacingValue, { children: value }),
548
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "100%", overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx(
549
+ SpacingBar,
550
+ {
551
+ style: { width: value },
552
+ title: `${label}: ${value}`
553
+ }
554
+ ) }),
555
+ /* @__PURE__ */ jsxRuntime.jsxs(SpacingValue, { children: [
556
+ "--spacing-",
557
+ label
558
+ ] })
559
+ ] }, label);
560
+ }) });
561
+ }
562
+ function SpacingPage(props) {
563
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
564
+ /* @__PURE__ */ jsxRuntime.jsx(Title, { children: "Spacing" }),
565
+ /* @__PURE__ */ jsxRuntime.jsx("br", {}),
566
+ /* @__PURE__ */ jsxRuntime.jsx(SpacingSection, { ...props })
567
+ ] }) });
568
+ }
569
+ var getTheme = () => {
570
+ const base = theming.ensure(theming.themes.light);
571
+ return {
572
+ ...base,
573
+ typography: {
574
+ ...base.typography || {},
575
+ fonts: {
576
+ base: '"Nunito Sans", -apple-system, ".SFNSText-Regular", "San Francisco", BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif',
577
+ mono: 'ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace',
578
+ ...base.typography?.fonts || {}
579
+ },
580
+ weight: {
581
+ regular: 400,
582
+ bold: 700,
583
+ ...base.typography?.weight || {}
584
+ },
585
+ size: {
586
+ s1: 12,
587
+ s2: 14,
588
+ s3: 16,
589
+ m1: 20,
590
+ m2: 24,
591
+ m3: 28,
592
+ l1: 32,
593
+ l2: 40,
594
+ l3: 48,
595
+ ...base.typography?.size || {}
596
+ }
597
+ },
598
+ background: {
599
+ content: "#ffffff",
600
+ app: "#f6f9fc",
601
+ hoverable: "rgba(0,0,0,0.05)",
602
+ ...base.background || {}
603
+ },
604
+ color: {
605
+ secondary: "#029CFD",
606
+ ...base.color || {},
607
+ defaultText: base.textColor || "#333333"
608
+ },
609
+ textColor: base.textColor || "#333333",
610
+ appBorderColor: base.appBorderColor || "rgba(0,0,0,0.1)"
611
+ };
612
+ };
613
+ function ThemeLayout({ title, children }) {
614
+ console.log("ThemeLayout: mounting", { title });
615
+ try {
616
+ const theme = getTheme();
617
+ console.log("ThemeLayout: generated theme", {
618
+ hasTypography: !!theme.typography,
619
+ hasFonts: !!theme.typography?.fonts,
620
+ fonts: theme.typography?.fonts
621
+ });
622
+ return /* @__PURE__ */ jsxRuntime.jsx(theming.ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
623
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { style: { fontSize: "32px", marginTop: 0, marginBottom: "8px" }, children: title }),
624
+ children
625
+ ] }) }) });
626
+ } catch (e) {
627
+ console.error("ThemeLayout: error generating theme", e);
628
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
629
+ "Error loading theme: ",
630
+ e.message
631
+ ] });
632
+ }
633
+ }
634
+ function themeDecorator(Story) {
635
+ const theme = getTheme();
636
+ return /* @__PURE__ */ jsxRuntime.jsx(theming.ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsx(Story, {}) });
637
+ }
638
+ function FontFamilyPreview({
639
+ families,
640
+ fontWeights,
641
+ fontSizes,
642
+ selectedWeights,
643
+ selectedSizes,
644
+ sampleText,
645
+ searchTerm,
646
+ showDivider = false
647
+ }) {
648
+ const filteredWeights = fontWeights.filter(
649
+ ([w]) => selectedWeights.includes(w)
650
+ );
651
+ const filteredSizes = fontSizes.filter(([s]) => selectedSizes.includes(s));
652
+ const filteredFamilies = react.useMemo(() => {
653
+ if (!searchTerm.trim()) return families;
654
+ const term = searchTerm.toLowerCase();
655
+ return families.filter(
656
+ ([label, fontFamily]) => label.toLowerCase().includes(term) || fontFamily.toLowerCase().includes(term)
657
+ );
658
+ }, [families, searchTerm]);
659
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: filteredFamilies.map(([label, fontFamily], familyIndex) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "60px" }, children: [
660
+ /* @__PURE__ */ jsxRuntime.jsxs(FontHeaderSection, { children: [
661
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: "20px", marginBottom: "8px" }, children: [
662
+ /* @__PURE__ */ jsxRuntime.jsx("b", { children: "Class name: " }),
663
+ label
664
+ ] }),
665
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: "20px", opacity: 0.8 }, children: [
666
+ /* @__PURE__ */ jsxRuntime.jsx("b", { children: "Font Family: " }),
667
+ fontFamily
668
+ ] })
669
+ ] }),
670
+ /* @__PURE__ */ jsxRuntime.jsxs(TypefaceWrapper, { children: [
671
+ /* @__PURE__ */ jsxRuntime.jsx(WeightColumn, { children: filteredWeights.map(([weightLabel, weightValue]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "20px" }, children: [
672
+ /* @__PURE__ */ jsxRuntime.jsx(
673
+ "div",
674
+ {
675
+ style: {
676
+ fontFamily,
677
+ fontWeight: weightValue,
678
+ fontSize: "36px",
679
+ marginBottom: "4px"
680
+ },
681
+ children: sampleText
682
+ }
683
+ ),
684
+ /* @__PURE__ */ jsxRuntime.jsxs(SizeInfo, { children: [
685
+ weightValue,
686
+ " (",
687
+ weightLabel,
688
+ ")"
689
+ ] })
690
+ ] }, weightLabel)) }),
691
+ /* @__PURE__ */ jsxRuntime.jsx(SizeColumn, { children: filteredSizes.map(([sizeLabel, sizeValue]) => /* @__PURE__ */ jsxRuntime.jsxs(SizeRow, { children: [
692
+ /* @__PURE__ */ jsxRuntime.jsxs(SizeInfo, { children: [
693
+ "text-",
694
+ sizeLabel,
695
+ " - ",
696
+ sizeValue
697
+ ] }),
698
+ /* @__PURE__ */ jsxRuntime.jsx(
699
+ "div",
700
+ {
701
+ style: {
702
+ fontFamily,
703
+ fontSize: sizeValue,
704
+ lineHeight: 1.2
705
+ },
706
+ children: sampleText
707
+ }
708
+ )
709
+ ] }, sizeLabel)) })
710
+ ] }),
711
+ showDivider && familyIndex < filteredFamilies.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(HorizontalRule, {})
712
+ ] }, label)) });
713
+ }
714
+ function TypographySection({
715
+ customFamilies,
716
+ builtInFamilies,
717
+ fontWeights,
718
+ fontSizes,
719
+ allWeightKeys,
720
+ allSizeKeys,
721
+ defaultSampleText,
722
+ showOnlyCustom
723
+ }) {
724
+ const [sampleText, setSampleText] = react.useState(defaultSampleText);
725
+ const [searchTerm, setSearchTerm] = react.useState("");
726
+ const [selectedWeights, setSelectedWeights] = react.useState(allWeightKeys);
727
+ const [selectedSizes, setSelectedSizes] = react.useState(allSizeKeys);
728
+ const hasFontFamily = customFamilies.length > 0 || builtInFamilies.length > 0;
729
+ const toggleWeight = (w) => {
730
+ if (selectedWeights.includes(w)) {
731
+ setSelectedWeights(selectedWeights.filter((i) => i !== w));
732
+ } else {
733
+ setSelectedWeights([...selectedWeights, w]);
734
+ }
735
+ };
736
+ const toggleSize = (s) => {
737
+ if (selectedSizes.includes(s)) {
738
+ setSelectedSizes(selectedSizes.filter((i) => i !== s));
739
+ } else {
740
+ setSelectedSizes([...selectedSizes, s]);
741
+ }
742
+ };
743
+ if (!hasFontFamily) {
744
+ return /* @__PURE__ */ jsxRuntime.jsx(NoneDetectedText, { children: "No font families detected. To see typography, add a font family to your Tailwind configuration, or ensure Tailwind's defaults are not being overridden." });
745
+ }
746
+ if (showOnlyCustom) {
747
+ if (customFamilies.length === 0) {
748
+ return /* @__PURE__ */ jsxRuntime.jsx(NoneDetectedText, { children: "No custom font families detected. Define custom fonts in your Tailwind configuration to see them here." });
749
+ }
750
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
751
+ /* @__PURE__ */ jsxRuntime.jsxs(ControlsBar, { children: [
752
+ /* @__PURE__ */ jsxRuntime.jsx(FilterLabel, { htmlFor: "sample-text", children: "Sample Text" }),
753
+ /* @__PURE__ */ jsxRuntime.jsx(
754
+ SampleTextInput,
755
+ {
756
+ id: "sample-text",
757
+ value: sampleText,
758
+ onChange: (e) => setSampleText(e.target.value),
759
+ placeholder: "Type to preview..."
760
+ }
761
+ ),
762
+ /* @__PURE__ */ jsxRuntime.jsx(FilterLabel, { htmlFor: "search-fonts", children: "Search" }),
763
+ /* @__PURE__ */ jsxRuntime.jsx(
764
+ SearchInput,
765
+ {
766
+ id: "search-fonts",
767
+ value: searchTerm,
768
+ onChange: (e) => setSearchTerm(e.target.value),
769
+ placeholder: "Search fonts..."
770
+ }
771
+ ),
772
+ /* @__PURE__ */ jsxRuntime.jsxs(FiltersWrapper, { children: [
773
+ /* @__PURE__ */ jsxRuntime.jsxs(FilterGroup, { children: [
774
+ /* @__PURE__ */ jsxRuntime.jsx(FilterLabel, { children: "Weights" }),
775
+ allWeightKeys.map((w) => /* @__PURE__ */ jsxRuntime.jsx(
776
+ FilterChip,
777
+ {
778
+ "data-active": selectedWeights.includes(w),
779
+ onClick: () => toggleWeight(w),
780
+ children: w
781
+ },
782
+ w
783
+ ))
784
+ ] }),
785
+ /* @__PURE__ */ jsxRuntime.jsxs(FilterGroup, { children: [
786
+ /* @__PURE__ */ jsxRuntime.jsx(FilterLabel, { children: "Sizes" }),
787
+ allSizeKeys.map((s) => /* @__PURE__ */ jsxRuntime.jsx(
788
+ FilterChip,
789
+ {
790
+ "data-active": selectedSizes.includes(s),
791
+ onClick: () => toggleSize(s),
792
+ children: s
793
+ },
794
+ s
795
+ ))
796
+ ] })
797
+ ] })
798
+ ] }),
799
+ /* @__PURE__ */ jsxRuntime.jsx(
800
+ FontFamilyPreview,
801
+ {
802
+ families: customFamilies,
803
+ fontWeights,
804
+ fontSizes,
805
+ selectedWeights,
806
+ selectedSizes,
807
+ sampleText,
808
+ searchTerm,
809
+ showDivider: true
810
+ }
811
+ )
812
+ ] });
813
+ }
814
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
815
+ /* @__PURE__ */ jsxRuntime.jsxs(ControlsBar, { style: { marginTop: "2rem" }, children: [
816
+ /* @__PURE__ */ jsxRuntime.jsx(FilterLabel, { htmlFor: "sample-text", children: "Sample Text" }),
817
+ /* @__PURE__ */ jsxRuntime.jsx(
818
+ SampleTextInput,
819
+ {
820
+ id: "sample-text",
821
+ value: sampleText,
822
+ onChange: (e) => setSampleText(e.target.value),
823
+ placeholder: "Type to preview..."
824
+ }
825
+ ),
826
+ /* @__PURE__ */ jsxRuntime.jsx(FilterLabel, { htmlFor: "search-fonts", children: "Search" }),
827
+ /* @__PURE__ */ jsxRuntime.jsx(
828
+ SearchInput,
829
+ {
830
+ id: "search-fonts",
831
+ value: searchTerm,
832
+ onChange: (e) => setSearchTerm(e.target.value),
833
+ placeholder: "Search fonts..."
834
+ }
835
+ ),
836
+ /* @__PURE__ */ jsxRuntime.jsxs(FiltersWrapper, { children: [
837
+ /* @__PURE__ */ jsxRuntime.jsxs(FilterGroup, { children: [
838
+ /* @__PURE__ */ jsxRuntime.jsx(FilterLabel, { children: "Weights" }),
839
+ allWeightKeys.map((w) => /* @__PURE__ */ jsxRuntime.jsx(
840
+ FilterChip,
841
+ {
842
+ "data-active": selectedWeights.includes(w),
843
+ onClick: () => toggleWeight(w),
844
+ children: w
845
+ },
846
+ w
847
+ ))
848
+ ] }),
849
+ /* @__PURE__ */ jsxRuntime.jsxs(FilterGroup, { children: [
850
+ /* @__PURE__ */ jsxRuntime.jsx(FilterLabel, { children: "Sizes" }),
851
+ allSizeKeys.map((s) => /* @__PURE__ */ jsxRuntime.jsx(
852
+ FilterChip,
853
+ {
854
+ "data-active": selectedSizes.includes(s),
855
+ onClick: () => toggleSize(s),
856
+ children: s
857
+ },
858
+ s
859
+ ))
860
+ ] })
861
+ ] })
862
+ ] }),
863
+ customFamilies.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
864
+ /* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { children: "Design System" }),
865
+ /* @__PURE__ */ jsxRuntime.jsx(
866
+ FontFamilyPreview,
867
+ {
868
+ families: customFamilies,
869
+ fontWeights,
870
+ fontSizes,
871
+ selectedWeights,
872
+ selectedSizes,
873
+ sampleText,
874
+ searchTerm,
875
+ showDivider: true
876
+ }
877
+ ),
878
+ builtInFamilies.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(HorizontalRule, {})
879
+ ] }),
880
+ builtInFamilies.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
881
+ /* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { children: "Tailwind Built-ins" }),
882
+ /* @__PURE__ */ jsxRuntime.jsx(
883
+ FontFamilyPreview,
884
+ {
885
+ families: builtInFamilies,
886
+ fontWeights,
887
+ fontSizes,
888
+ selectedWeights,
889
+ selectedSizes,
890
+ sampleText,
891
+ searchTerm,
892
+ showDivider: true
893
+ }
894
+ )
895
+ ] })
896
+ ] });
897
+ }
898
+ function TypographyPage(props) {
899
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
900
+ /* @__PURE__ */ jsxRuntime.jsx(Title, { children: "Typography" }),
901
+ /* @__PURE__ */ jsxRuntime.jsx(TypographySection, { ...props })
902
+ ] }) });
903
+ }
904
+
905
+ exports.ColorSection = ColorSection;
906
+ exports.ColorsPage = ColorsPage;
907
+ exports.Container = Container;
908
+ exports.ControlsBar = ControlsBar;
909
+ exports.FilterChip = FilterChip;
910
+ exports.FilterGroup = FilterGroup;
911
+ exports.FilterLabel = FilterLabel;
912
+ exports.FiltersWrapper = FiltersWrapper;
913
+ exports.FontHeaderSection = FontHeaderSection;
914
+ exports.HorizontalRule = HorizontalRule;
915
+ exports.NoneDetectedText = NoneDetectedText;
916
+ exports.PaletteCard = PaletteCard;
917
+ exports.PaletteGrid = PaletteGrid;
918
+ exports.PaletteHeader = PaletteHeader;
919
+ exports.PaletteSubtitle = PaletteSubtitle;
920
+ exports.PaletteTitle = PaletteTitle;
921
+ exports.RadiusCard = RadiusCard;
922
+ exports.RadiusGrid = RadiusGrid;
923
+ exports.RadiusLabel = RadiusLabel;
924
+ exports.RadiusPage = RadiusPage;
925
+ exports.RadiusPreview = RadiusPreview;
926
+ exports.RadiusSection = RadiusSection;
927
+ exports.RadiusValue = RadiusValue;
928
+ exports.SampleTextInput = SampleTextInput;
929
+ exports.SearchInput = SearchInput;
930
+ exports.SectionHeader = SectionHeader;
931
+ exports.ShadowCard = ShadowCard;
932
+ exports.ShadowLabel = ShadowLabel;
933
+ exports.ShadowPreview = ShadowPreview;
934
+ exports.ShadowValue = ShadowValue;
935
+ exports.ShadowsGrid = ShadowsGrid;
936
+ exports.ShadowsPage = ShadowsPage;
937
+ exports.ShadowsSection = ShadowsSection;
938
+ exports.SizeColumn = SizeColumn;
939
+ exports.SizeInfo = SizeInfo;
940
+ exports.SizeRow = SizeRow;
941
+ exports.SpacingBar = SpacingBar;
942
+ exports.SpacingGrid = SpacingGrid;
943
+ exports.SpacingLabel = SpacingLabel;
944
+ exports.SpacingPage = SpacingPage;
945
+ exports.SpacingRow = SpacingRow;
946
+ exports.SpacingSection = SpacingSection;
947
+ exports.SpacingValue = SpacingValue;
948
+ exports.SwatchColor = SwatchColor;
949
+ exports.SwatchGrid = SwatchGrid;
950
+ exports.SwatchInfo = SwatchInfo;
951
+ exports.SwatchLabel = SwatchLabel;
952
+ exports.SwatchValue = SwatchValue;
953
+ exports.SwatchWrapper = SwatchWrapper;
954
+ exports.ThemeLayout = ThemeLayout;
955
+ exports.Title = Title;
956
+ exports.TypefaceWrapper = TypefaceWrapper;
957
+ exports.TypographyPage = TypographyPage;
958
+ exports.TypographySection = TypographySection;
959
+ exports.WeightColumn = WeightColumn;
960
+ exports.Wrapper = Wrapper;
961
+ exports.themeDecorator = themeDecorator;
962
+ //# sourceMappingURL=index.cjs.map
963
+ //# sourceMappingURL=index.cjs.map