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,604 @@
1
+ import { useState, useMemo } from 'react';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import { styled } from 'storybook/theming';
4
+
5
+ // src/addon/components/assets/AssetSection.tsx
6
+ function CheckerboardIcon() {
7
+ return /* @__PURE__ */ jsxs(
8
+ "svg",
9
+ {
10
+ viewBox: "0 0 16 16",
11
+ fill: "currentColor",
12
+ role: "img",
13
+ "aria-label": "Checkerboard background",
14
+ children: [
15
+ /* @__PURE__ */ jsx("title", { children: "Checkerboard background" }),
16
+ /* @__PURE__ */ jsx("path", { d: "M0 0h4v4H0V0zm4 4h4v4H4V4zm4-4h4v4H8V0zm4 4h4v4h-4V4zM0 8h4v4H0V8zm8 0h4v4H8V8zm-4 4h4v4H4v-4zm8 0h4v4h-4v-4z" })
17
+ ]
18
+ }
19
+ );
20
+ }
21
+ function InverseIcon() {
22
+ return /* @__PURE__ */ jsxs(
23
+ "svg",
24
+ {
25
+ viewBox: "0 0 16 16",
26
+ fill: "currentColor",
27
+ role: "img",
28
+ "aria-label": "Inverse background",
29
+ children: [
30
+ /* @__PURE__ */ jsx("title", { children: "Inverse background" }),
31
+ /* @__PURE__ */ jsx(
32
+ "circle",
33
+ {
34
+ cx: "8",
35
+ cy: "8",
36
+ r: "7",
37
+ fill: "none",
38
+ stroke: "currentColor",
39
+ strokeWidth: "1.5"
40
+ }
41
+ ),
42
+ /* @__PURE__ */ jsx("path", { d: "M8 1a7 7 0 0 1 0 14V1z" })
43
+ ]
44
+ }
45
+ );
46
+ }
47
+ function ResetIcon() {
48
+ return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", fill: "currentColor", role: "img", "aria-label": "Reset", children: [
49
+ /* @__PURE__ */ jsx("title", { children: "Reset" }),
50
+ /* @__PURE__ */ jsx("path", { d: "M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z" }),
51
+ /* @__PURE__ */ jsx("path", { d: "M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z" })
52
+ ] });
53
+ }
54
+ var Wrapper = styled.div(({ theme }) => ({
55
+ background: theme.background?.content || "#ffffff",
56
+ minHeight: "100vh",
57
+ padding: "40px 20px",
58
+ boxSizing: "border-box"
59
+ }));
60
+ var Container = styled.div({
61
+ maxWidth: "1200px",
62
+ margin: "0 auto"
63
+ });
64
+ var Title = styled.h1(({ theme }) => ({
65
+ fontFamily: theme.typography?.fonts?.base || "sans-serif",
66
+ fontSize: "32px",
67
+ fontWeight: 700,
68
+ color: theme.color?.defaultText || "#333333",
69
+ marginBottom: "8px",
70
+ marginTop: 0
71
+ }));
72
+ var Description = styled.p(({ theme }) => ({
73
+ fontFamily: theme.typography?.fonts?.base || "sans-serif",
74
+ fontSize: "16px",
75
+ color: theme.color?.defaultText || "#333333",
76
+ opacity: 0.8,
77
+ marginBottom: "24px",
78
+ marginTop: 0
79
+ }));
80
+ var ControlsBar = styled.div({
81
+ display: "flex",
82
+ gap: "16px",
83
+ marginBottom: "32px",
84
+ flexWrap: "wrap",
85
+ alignItems: "center"
86
+ });
87
+ var SearchInput = styled.input(({ theme }) => ({
88
+ flex: "1 1 300px",
89
+ maxWidth: "400px",
90
+ padding: "10px 14px",
91
+ fontSize: "14px",
92
+ border: `1px solid ${theme.appBorderColor || "#eaeaea"}`,
93
+ borderRadius: "6px",
94
+ color: theme.color?.defaultText || "#333333",
95
+ background: theme.background?.content || "#ffffff",
96
+ outline: "none",
97
+ transition: "border-color 0.2s, box-shadow 0.2s",
98
+ "&:focus": {
99
+ borderColor: theme.color?.secondary || "#0271b6",
100
+ boxShadow: `0 0 0 2px ${theme.color?.secondary || "#0271b6"}22`
101
+ },
102
+ "&::placeholder": {
103
+ color: theme.color?.defaultText || "#333333",
104
+ opacity: 0.5
105
+ }
106
+ }));
107
+ var VariantToggle = styled.button(({ theme }) => ({
108
+ padding: "10px 16px",
109
+ fontSize: "14px",
110
+ fontWeight: 500,
111
+ border: `1px solid ${theme.appBorderColor || "#eaeaea"}`,
112
+ borderRadius: "6px",
113
+ cursor: "pointer",
114
+ background: theme.background?.content || "#ffffff",
115
+ color: theme.color?.defaultText || "#333333",
116
+ transition: "all 0.2s",
117
+ "&:hover": {
118
+ borderColor: theme.color?.secondary || "#0271b6",
119
+ background: theme.background?.hoverable || "#f5f5f5"
120
+ }
121
+ }));
122
+ var BackgroundControls = styled.div({
123
+ display: "flex",
124
+ alignItems: "center",
125
+ gap: "12px",
126
+ marginLeft: "auto"
127
+ });
128
+ var BackgroundToggle = styled.div(({ theme }) => ({
129
+ display: "flex",
130
+ alignItems: "center",
131
+ gap: "6px",
132
+ padding: "4px",
133
+ border: `1px solid ${theme.appBorderColor || "#eaeaea"}`,
134
+ borderRadius: "6px",
135
+ background: theme.background?.content || "#ffffff"
136
+ }));
137
+ var ToggleOption = styled.button(({ theme }) => ({
138
+ display: "flex",
139
+ alignItems: "center",
140
+ justifyContent: "center",
141
+ width: "28px",
142
+ height: "28px",
143
+ border: "none",
144
+ borderRadius: "4px",
145
+ cursor: "pointer",
146
+ background: "transparent",
147
+ color: theme.color?.defaultText || "#333333",
148
+ opacity: 0.5,
149
+ transition: "all 0.15s",
150
+ '&[data-active="true"]': {
151
+ background: theme.color?.secondary || "#0271b6",
152
+ color: "#fff",
153
+ opacity: 1
154
+ },
155
+ '&:hover:not([data-active="true"])': {
156
+ opacity: 0.8,
157
+ background: theme.background?.hoverable || "#f5f5f5"
158
+ },
159
+ "& svg": {
160
+ width: "16px",
161
+ height: "16px"
162
+ }
163
+ }));
164
+ var ColorPickerGroup = styled.div(({ theme }) => ({
165
+ display: "flex",
166
+ alignItems: "center",
167
+ gap: "4px",
168
+ padding: "4px 6px",
169
+ border: `1px solid ${theme.appBorderColor || "#eaeaea"}`,
170
+ borderRadius: "6px",
171
+ background: theme.background?.content || "#ffffff",
172
+ transition: "border-color 0.2s",
173
+ "&:focus-within": {
174
+ borderColor: theme.color?.secondary || "#0271b6"
175
+ }
176
+ }));
177
+ var ColorLabel = styled.span(({ theme }) => ({
178
+ fontFamily: theme.typography?.fonts?.base || "sans-serif",
179
+ fontSize: "11px",
180
+ color: theme.color?.defaultText || "#333333",
181
+ opacity: 0.6,
182
+ textTransform: "uppercase",
183
+ letterSpacing: "0.5px"
184
+ }));
185
+ var ColorInput = styled.input({
186
+ width: "24px",
187
+ height: "24px",
188
+ padding: 0,
189
+ border: "none",
190
+ borderRadius: "4px",
191
+ cursor: "pointer",
192
+ background: "transparent",
193
+ "&::-webkit-color-swatch-wrapper": {
194
+ padding: 0
195
+ },
196
+ "&::-webkit-color-swatch": {
197
+ border: "none",
198
+ borderRadius: "4px"
199
+ },
200
+ "&::-moz-color-swatch": {
201
+ border: "none",
202
+ borderRadius: "4px"
203
+ }
204
+ });
205
+ var ResetButton = styled.button(({ theme }) => ({
206
+ display: "flex",
207
+ alignItems: "center",
208
+ justifyContent: "center",
209
+ width: "20px",
210
+ height: "20px",
211
+ padding: 0,
212
+ border: "none",
213
+ borderRadius: "4px",
214
+ cursor: "pointer",
215
+ background: "transparent",
216
+ color: theme.color?.defaultText || "#333333",
217
+ opacity: 0.4,
218
+ transition: "all 0.15s",
219
+ "&:hover": {
220
+ opacity: 1,
221
+ background: theme.background?.hoverable || "#f5f5f5"
222
+ },
223
+ "& svg": {
224
+ width: "12px",
225
+ height: "12px"
226
+ }
227
+ }));
228
+ var AssetCard = styled.div(({ theme }) => ({
229
+ display: "flex",
230
+ flexDirection: "column",
231
+ alignItems: "center",
232
+ padding: "16px",
233
+ borderRadius: "8px",
234
+ border: `1px solid ${theme.appBorderColor || "#eaeaea"}`,
235
+ background: theme.background?.content || "#ffffff",
236
+ transition: "all 0.2s",
237
+ cursor: "pointer",
238
+ "&:hover": {
239
+ borderColor: theme.color?.secondary || "#0271b6",
240
+ boxShadow: "0 4px 12px rgba(0,0,0,0.1)"
241
+ }
242
+ }));
243
+ var AssetPreview = styled.div({
244
+ width: "var(--preview-size, 200px)",
245
+ height: "var(--preview-size, 200px)",
246
+ display: "flex",
247
+ alignItems: "center",
248
+ justifyContent: "center",
249
+ marginBottom: "12px",
250
+ borderRadius: "4px"
251
+ });
252
+ var AssetImage = styled.img({
253
+ maxWidth: "100%",
254
+ maxHeight: "100%",
255
+ objectFit: "contain"
256
+ });
257
+ var AssetName = styled.div(({ theme }) => ({
258
+ fontFamily: theme.typography?.fonts?.base || "sans-serif",
259
+ fontSize: "13px",
260
+ fontWeight: 500,
261
+ color: theme.color?.defaultText || "#333333",
262
+ textAlign: "center",
263
+ wordBreak: "break-word",
264
+ lineHeight: 1.3
265
+ }));
266
+ var AssetFilename = styled.div(({ theme }) => ({
267
+ fontFamily: theme.typography?.fonts?.mono || "monospace",
268
+ fontSize: "11px",
269
+ color: theme.color?.defaultText || "#333333",
270
+ opacity: 0.6,
271
+ textAlign: "center",
272
+ marginTop: "4px"
273
+ }));
274
+ var CopyButtons = styled.div({
275
+ display: "flex",
276
+ gap: "8px",
277
+ marginTop: "8px",
278
+ opacity: 0,
279
+ transition: "opacity 0.2s",
280
+ ".asset-card:hover &": {
281
+ opacity: 1
282
+ }
283
+ });
284
+ var CopyButton = styled.button(({ theme }) => ({
285
+ padding: "4px 8px",
286
+ fontSize: "11px",
287
+ border: `1px solid ${theme.appBorderColor || "#eaeaea"}`,
288
+ borderRadius: "4px",
289
+ cursor: "pointer",
290
+ background: theme.background?.content || "#ffffff",
291
+ color: theme.color?.defaultText || "#333333",
292
+ transition: "all 0.15s",
293
+ "&:hover": {
294
+ background: theme.color?.secondary || "#0271b6",
295
+ color: "#fff",
296
+ borderColor: theme.color?.secondary || "#0271b6"
297
+ }
298
+ }));
299
+ var NoResults = styled.div(({ theme }) => ({
300
+ fontFamily: theme.typography?.fonts?.base || "sans-serif",
301
+ fontSize: "16px",
302
+ color: theme.color?.defaultText || "#333333",
303
+ opacity: 0.6,
304
+ textAlign: "center",
305
+ padding: "60px 20px"
306
+ }));
307
+ var FolderSection = styled.div({
308
+ marginBottom: "48px"
309
+ });
310
+ var FolderTitle = styled.h2(({ theme }) => ({
311
+ fontFamily: theme.typography?.fonts?.base || "sans-serif",
312
+ fontSize: "20px",
313
+ fontWeight: 600,
314
+ color: theme.color?.defaultText || "#333333",
315
+ marginBottom: "16px",
316
+ marginTop: 0,
317
+ paddingBottom: "8px",
318
+ borderBottom: `1px solid ${theme.appBorderColor || "#eaeaea"}`
319
+ }));
320
+ var Toast = styled.div(({ theme }) => ({
321
+ position: "fixed",
322
+ bottom: "24px",
323
+ right: "24px",
324
+ padding: "12px 20px",
325
+ background: theme.color?.positive || "#44bb44",
326
+ color: "#fff",
327
+ borderRadius: "8px",
328
+ fontSize: "14px",
329
+ fontWeight: 500,
330
+ boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
331
+ zIndex: 1e3,
332
+ animation: "fadeInUp 0.3s ease"
333
+ }));
334
+ function AssetSection({
335
+ title,
336
+ description,
337
+ assets,
338
+ groupByFolder,
339
+ variants,
340
+ copy,
341
+ display,
342
+ storageKeyPrefix
343
+ }) {
344
+ const DEFAULT_LIGHT_BG = "#eeeeee";
345
+ const DEFAULT_DARK_BG = "#181818";
346
+ const STORAGE_KEY_LIGHT = `${storageKeyPrefix}-light`;
347
+ const STORAGE_KEY_DARK = `${storageKeyPrefix}-dark`;
348
+ const STORAGE_KEY_MODE = `${storageKeyPrefix}-mode`;
349
+ const getStoredValue = (key, defaultValue) => {
350
+ try {
351
+ const stored = localStorage.getItem(key);
352
+ return stored !== null ? stored : defaultValue;
353
+ } catch {
354
+ return defaultValue;
355
+ }
356
+ };
357
+ const setStoredValue = (key, value) => {
358
+ try {
359
+ localStorage.setItem(key, value);
360
+ } catch {
361
+ }
362
+ };
363
+ const removeStoredValue = (key) => {
364
+ try {
365
+ localStorage.removeItem(key);
366
+ } catch {
367
+ }
368
+ };
369
+ const [searchTerm, setSearchTerm] = useState("");
370
+ const [currentVariant, setCurrentVariant] = useState(variants.defaultVariant);
371
+ const [toastMessage, setToastMessage] = useState(null);
372
+ const [bgMode, setBgMode] = useState(
373
+ () => getStoredValue(STORAGE_KEY_MODE, "checkered")
374
+ );
375
+ const [lightBgColor, setLightBgColor] = useState(
376
+ () => getStoredValue(STORAGE_KEY_LIGHT, DEFAULT_LIGHT_BG)
377
+ );
378
+ const [darkBgColor, setDarkBgColor] = useState(
379
+ () => getStoredValue(STORAGE_KEY_DARK, DEFAULT_DARK_BG)
380
+ );
381
+ const handleBgModeChange = (mode) => {
382
+ setBgMode(mode);
383
+ setStoredValue(STORAGE_KEY_MODE, mode);
384
+ };
385
+ const handleLightBgChange = (color) => {
386
+ setLightBgColor(color);
387
+ setStoredValue(STORAGE_KEY_LIGHT, color);
388
+ };
389
+ const handleDarkBgChange = (color) => {
390
+ setDarkBgColor(color);
391
+ setStoredValue(STORAGE_KEY_DARK, color);
392
+ };
393
+ const resetLightBg = () => {
394
+ setLightBgColor(DEFAULT_LIGHT_BG);
395
+ removeStoredValue(STORAGE_KEY_LIGHT);
396
+ };
397
+ const resetDarkBg = () => {
398
+ setDarkBgColor(DEFAULT_DARK_BG);
399
+ removeStoredValue(STORAGE_KEY_DARK);
400
+ };
401
+ const isLightVariant = currentVariant === "light";
402
+ const getPreviewBackground = () => {
403
+ if (bgMode === "checkered") {
404
+ return "repeating-conic-gradient(#e0e0e0 0% 25%, #ffffff 0% 50%) 50% / 16px 16px";
405
+ }
406
+ return isLightVariant ? darkBgColor : lightBgColor;
407
+ };
408
+ const showToast = (message) => {
409
+ setToastMessage(message);
410
+ setTimeout(() => setToastMessage(null), 2e3);
411
+ };
412
+ const copyToClipboard = (text, type) => {
413
+ navigator.clipboard.writeText(text).then(() => {
414
+ showToast(`${type} copied to clipboard!`);
415
+ });
416
+ };
417
+ const getImportPath = (asset) => {
418
+ if (!copy.import) return "";
419
+ return copy.import.replace(/\{\{name\}\}/g, asset.id).replace(/\{\{ext\}\}/g, asset.ext).replace(/\{\{path\}\}/g, asset.relativePath).replace(/\{\{basename\}\}/g, `${asset.filename}.${asset.ext}`);
420
+ };
421
+ const getComponentUsage = (asset) => {
422
+ if (!copy.component) return "";
423
+ return copy.component.replace(/\{\{name\}\}/g, asset.id).replace(/\{\{ext\}\}/g, asset.ext).replace(/\{\{path\}\}/g, asset.relativePath).replace(/\{\{basename\}\}/g, `${asset.filename}.${asset.ext}`);
424
+ };
425
+ const filteredAssets = useMemo(() => {
426
+ if (!searchTerm.trim()) return assets;
427
+ const term = searchTerm.toLowerCase();
428
+ return assets.filter(
429
+ (asset) => asset.name.toLowerCase().includes(term) || asset.filename.toLowerCase().includes(term)
430
+ );
431
+ }, [assets, searchTerm]);
432
+ const groupedAssets = useMemo(() => {
433
+ if (!groupByFolder) return /* @__PURE__ */ new Map();
434
+ const groups = /* @__PURE__ */ new Map();
435
+ for (const asset of filteredAssets) {
436
+ const folder = asset.folder || "root";
437
+ if (!groups.has(folder)) {
438
+ groups.set(folder, []);
439
+ }
440
+ groups.get(folder).push(asset);
441
+ }
442
+ return groups;
443
+ }, [filteredAssets, groupByFolder]);
444
+ const renderAsset = (asset) => {
445
+ const imageSrc = currentVariant === "dark" && asset.variants.dark ? asset.variants.dark : asset.variants.light;
446
+ const hasCopyAction = copy.import || copy.component;
447
+ const copyType = copy.import ? "Import" : "Component";
448
+ const copyText = copy.import ? getImportPath(asset) : getComponentUsage(asset);
449
+ return /* @__PURE__ */ jsxs(
450
+ AssetCard,
451
+ {
452
+ className: "asset-card",
453
+ onClick: () => hasCopyAction && copyToClipboard(copyText, copyType),
454
+ children: [
455
+ /* @__PURE__ */ jsx(
456
+ AssetPreview,
457
+ {
458
+ style: {
459
+ width: `${display.previewSize}px`,
460
+ height: `${display.previewSize}px`,
461
+ background: getPreviewBackground()
462
+ },
463
+ children: /* @__PURE__ */ jsx(AssetImage, { src: imageSrc, alt: asset.name })
464
+ }
465
+ ),
466
+ /* @__PURE__ */ jsx(AssetName, { children: asset.name }),
467
+ display.showFilename && /* @__PURE__ */ jsxs(AssetFilename, { children: [
468
+ asset.filename,
469
+ ".",
470
+ asset.ext
471
+ ] }),
472
+ hasCopyAction && /* @__PURE__ */ jsx(CopyButtons, { children: /* @__PURE__ */ jsx(
473
+ CopyButton,
474
+ {
475
+ onClick: (e) => {
476
+ e.stopPropagation();
477
+ copyToClipboard(copyText, copyType);
478
+ },
479
+ children: copyType
480
+ }
481
+ ) })
482
+ ]
483
+ },
484
+ asset.id
485
+ );
486
+ };
487
+ const renderGroupedAssets = () => {
488
+ const entries = Array.from(groupedAssets.entries());
489
+ return entries.map(([folder, assets2]) => /* @__PURE__ */ jsxs(FolderSection, { children: [
490
+ /* @__PURE__ */ jsx(FolderTitle, { children: folder === "root" ? "Root" : folder }),
491
+ /* @__PURE__ */ jsx(
492
+ "div",
493
+ {
494
+ style: {
495
+ display: "grid",
496
+ gridTemplateColumns: `repeat(auto-fill, minmax(${display.previewSize + 40}px, 1fr))`,
497
+ gap: "24px"
498
+ },
499
+ children: assets2.map(renderAsset)
500
+ }
501
+ )
502
+ ] }, folder));
503
+ };
504
+ return /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsxs(Container, { children: [
505
+ /* @__PURE__ */ jsx(Title, { children: title }),
506
+ description && /* @__PURE__ */ jsx(Description, { children: description }),
507
+ /* @__PURE__ */ jsxs(ControlsBar, { children: [
508
+ /* @__PURE__ */ jsx(
509
+ SearchInput,
510
+ {
511
+ value: searchTerm,
512
+ onChange: (e) => setSearchTerm(e.target.value),
513
+ placeholder: `Search ${title.toLowerCase()}...`
514
+ }
515
+ ),
516
+ variants.enabled && /* @__PURE__ */ jsx(
517
+ VariantToggle,
518
+ {
519
+ onClick: () => setCurrentVariant((v) => v === "light" ? "dark" : "light"),
520
+ children: currentVariant === "light" ? "Light" : "Dark"
521
+ }
522
+ ),
523
+ /* @__PURE__ */ jsxs(BackgroundControls, { children: [
524
+ /* @__PURE__ */ jsxs(BackgroundToggle, { children: [
525
+ /* @__PURE__ */ jsx(
526
+ ToggleOption,
527
+ {
528
+ "data-active": bgMode === "inverse",
529
+ onClick: () => handleBgModeChange("inverse"),
530
+ title: "Inverse background",
531
+ children: /* @__PURE__ */ jsx(InverseIcon, {})
532
+ }
533
+ ),
534
+ /* @__PURE__ */ jsx(
535
+ ToggleOption,
536
+ {
537
+ "data-active": bgMode === "checkered",
538
+ onClick: () => handleBgModeChange("checkered"),
539
+ title: "Checkered background",
540
+ children: /* @__PURE__ */ jsx(CheckerboardIcon, {})
541
+ }
542
+ )
543
+ ] }),
544
+ bgMode === "inverse" && /* @__PURE__ */ jsxs(Fragment, { children: [
545
+ /* @__PURE__ */ jsxs(ColorPickerGroup, { children: [
546
+ /* @__PURE__ */ jsx(ColorLabel, { children: "Light" }),
547
+ /* @__PURE__ */ jsx(
548
+ ColorInput,
549
+ {
550
+ type: "color",
551
+ value: lightBgColor,
552
+ onChange: (e) => handleLightBgChange(e.target.value),
553
+ title: "Background for dark illustrations"
554
+ }
555
+ ),
556
+ lightBgColor !== DEFAULT_LIGHT_BG && /* @__PURE__ */ jsx(
557
+ ResetButton,
558
+ {
559
+ onClick: resetLightBg,
560
+ title: "Reset to default",
561
+ children: /* @__PURE__ */ jsx(ResetIcon, {})
562
+ }
563
+ )
564
+ ] }),
565
+ /* @__PURE__ */ jsxs(ColorPickerGroup, { children: [
566
+ /* @__PURE__ */ jsx(ColorLabel, { children: "Dark" }),
567
+ /* @__PURE__ */ jsx(
568
+ ColorInput,
569
+ {
570
+ type: "color",
571
+ value: darkBgColor,
572
+ onChange: (e) => handleDarkBgChange(e.target.value),
573
+ title: "Background for light illustrations"
574
+ }
575
+ ),
576
+ darkBgColor !== DEFAULT_DARK_BG && /* @__PURE__ */ jsx(ResetButton, { onClick: resetDarkBg, title: "Reset to default", children: /* @__PURE__ */ jsx(ResetIcon, {}) })
577
+ ] })
578
+ ] })
579
+ ] })
580
+ ] }),
581
+ filteredAssets.length === 0 ? /* @__PURE__ */ jsxs(NoResults, { children: [
582
+ "No ",
583
+ title.toLowerCase(),
584
+ ' found matching "',
585
+ searchTerm,
586
+ '"'
587
+ ] }) : groupByFolder ? renderGroupedAssets() : /* @__PURE__ */ jsx(
588
+ "div",
589
+ {
590
+ style: {
591
+ display: "grid",
592
+ gridTemplateColumns: `repeat(auto-fill, minmax(${display.previewSize + 40}px, 1fr))`,
593
+ gap: "24px"
594
+ },
595
+ children: filteredAssets.map(renderAsset)
596
+ }
597
+ ),
598
+ toastMessage && /* @__PURE__ */ jsx(Toast, { children: toastMessage })
599
+ ] }) });
600
+ }
601
+
602
+ export { AssetCard, AssetFilename, AssetImage, AssetName, AssetPreview, AssetSection, BackgroundControls, BackgroundToggle, CheckerboardIcon, ColorInput, ColorLabel, ColorPickerGroup, Container, ControlsBar, CopyButton, CopyButtons, Description, FolderSection, FolderTitle, InverseIcon, NoResults, ResetButton, ResetIcon, SearchInput, Title, Toast, ToggleOption, VariantToggle, Wrapper };
603
+ //# sourceMappingURL=index.js.map
604
+ //# sourceMappingURL=index.js.map