@classic-homes/theme-mcp 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +3844 -450
- package/dist/cli.js.map +1 -1
- package/dist/index.js +3844 -450
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -107,6 +107,59 @@ var component_catalog_default = {
|
|
|
107
107
|
"Card"
|
|
108
108
|
]
|
|
109
109
|
},
|
|
110
|
+
{
|
|
111
|
+
name: "AlertDescription",
|
|
112
|
+
description: "Main content text component for Alert messages",
|
|
113
|
+
category: "feedback",
|
|
114
|
+
importPath: "@classic-homes/theme-svelte",
|
|
115
|
+
props: [
|
|
116
|
+
{
|
|
117
|
+
name: "class",
|
|
118
|
+
type: "string",
|
|
119
|
+
required: false,
|
|
120
|
+
description: "Additional CSS classes"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
variants: [],
|
|
124
|
+
slots: [
|
|
125
|
+
{
|
|
126
|
+
name: "children",
|
|
127
|
+
description: "Main content",
|
|
128
|
+
required: false
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
events: [],
|
|
132
|
+
examples: [
|
|
133
|
+
{
|
|
134
|
+
title: "Basic Usage",
|
|
135
|
+
code: "<Alert>\n <AlertTitle>Notice</AlertTitle>\n <AlertDescription>This is the alert message content.</AlertDescription>\n</Alert>"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
title: "Simple Message",
|
|
139
|
+
code: "<AlertDescription>Your session will expire in 5 minutes.</AlertDescription>"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
title: "With Link",
|
|
143
|
+
code: '<AlertDescription>\n Your account needs verification.\n <a href="/verify" class="underline font-medium">Verify now</a>\n</AlertDescription>'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
title: "Error List",
|
|
147
|
+
code: '<AlertDescription>\n <ul class="list-disc pl-4 mt-2">\n <li>Email is required</li>\n <li>Password must be at least 8 characters</li>\n </ul>\n</AlertDescription>'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
title: "Rich Content",
|
|
151
|
+
code: '<AlertDescription>\n <p>Your order #12345 has been placed successfully.</p>\n <a href="/orders/12345" class="underline font-medium mt-2 inline-block"> View order details </a>\n</AlertDescription>'
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
title: "Without Title",
|
|
155
|
+
code: '<Alert variant="info">\n <AlertDescription>Pro tip: Press Ctrl+K to open the command palette.</AlertDescription>\n</Alert>'
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
relatedComponents: [
|
|
159
|
+
"Alert",
|
|
160
|
+
"AlertTitle"
|
|
161
|
+
]
|
|
162
|
+
},
|
|
110
163
|
{
|
|
111
164
|
name: "AlertDialog",
|
|
112
165
|
description: "Modal dialog for confirmations and important actions",
|
|
@@ -238,6 +291,55 @@ var component_catalog_default = {
|
|
|
238
291
|
"DropdownMenu"
|
|
239
292
|
]
|
|
240
293
|
},
|
|
294
|
+
{
|
|
295
|
+
name: "AlertTitle",
|
|
296
|
+
description: "Bold heading component for Alert messages",
|
|
297
|
+
category: "feedback",
|
|
298
|
+
importPath: "@classic-homes/theme-svelte",
|
|
299
|
+
props: [
|
|
300
|
+
{
|
|
301
|
+
name: "class",
|
|
302
|
+
type: "string",
|
|
303
|
+
required: false,
|
|
304
|
+
description: "Additional CSS classes"
|
|
305
|
+
}
|
|
306
|
+
],
|
|
307
|
+
variants: [],
|
|
308
|
+
slots: [
|
|
309
|
+
{
|
|
310
|
+
name: "children",
|
|
311
|
+
description: "Main content",
|
|
312
|
+
required: false
|
|
313
|
+
}
|
|
314
|
+
],
|
|
315
|
+
events: [],
|
|
316
|
+
examples: [
|
|
317
|
+
{
|
|
318
|
+
title: "Basic Usage",
|
|
319
|
+
code: "<Alert>\n <AlertTitle>Heads up!</AlertTitle>\n <AlertDescription>This is an important message.</AlertDescription>\n</Alert>"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
title: "Success Alert",
|
|
323
|
+
code: '<Alert variant="success">\n <AlertTitle>Success!</AlertTitle>\n <AlertDescription>Your changes have been saved.</AlertDescription>\n</Alert>'
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
title: "Error Alert",
|
|
327
|
+
code: '<Alert variant="error">\n <AlertTitle>Error</AlertTitle>\n <AlertDescription>Something went wrong. Please try again.</AlertDescription>\n</Alert>'
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
title: "With Icon",
|
|
331
|
+
code: '<Alert variant="info">\n <Icon name="info" class="h-4 w-4" />\n <AlertTitle>Did you know?</AlertTitle>\n <AlertDescription>You can use keyboard shortcuts.</AlertDescription>\n</Alert>'
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
title: "Custom Styling",
|
|
335
|
+
code: '<AlertTitle class="text-lg">Important Notice</AlertTitle>'
|
|
336
|
+
}
|
|
337
|
+
],
|
|
338
|
+
relatedComponents: [
|
|
339
|
+
"Alert",
|
|
340
|
+
"AlertDescription"
|
|
341
|
+
]
|
|
342
|
+
},
|
|
241
343
|
{
|
|
242
344
|
name: "AppShell",
|
|
243
345
|
description: "Base wrapper component for applications with accessibility features",
|
|
@@ -311,8 +413,93 @@ var component_catalog_default = {
|
|
|
311
413
|
description: "Line chart with gradient fill and stacking support",
|
|
312
414
|
category: "chart",
|
|
313
415
|
importPath: "@classic-homes/charts-svelte",
|
|
314
|
-
props: [
|
|
315
|
-
|
|
416
|
+
props: [
|
|
417
|
+
{
|
|
418
|
+
name: "data",
|
|
419
|
+
type: "AreaChartData",
|
|
420
|
+
required: true,
|
|
421
|
+
description: "Chart data with categories and series"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
name: "smooth",
|
|
425
|
+
type: "boolean",
|
|
426
|
+
default: "false",
|
|
427
|
+
required: false,
|
|
428
|
+
description: "Use smooth curved lines"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
name: "stacked",
|
|
432
|
+
type: "boolean",
|
|
433
|
+
default: "false",
|
|
434
|
+
required: false,
|
|
435
|
+
description: "Stack areas to show total composition"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
name: "gradient",
|
|
439
|
+
type: "boolean",
|
|
440
|
+
default: "false",
|
|
441
|
+
required: false,
|
|
442
|
+
description: "Apply gradient fill to areas"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
name: "onClick",
|
|
446
|
+
type: "(params: DataPointEventParams) => void",
|
|
447
|
+
required: false,
|
|
448
|
+
description: "Callback when clicked"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
name: "title",
|
|
452
|
+
type: "string",
|
|
453
|
+
required: true,
|
|
454
|
+
description: "Chart title for accessibility"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
name: "height",
|
|
458
|
+
type: "number | string",
|
|
459
|
+
default: "400",
|
|
460
|
+
required: false,
|
|
461
|
+
description: "Chart height"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: "theme",
|
|
465
|
+
type: "'light' | 'dark' | 'auto'",
|
|
466
|
+
default: "'auto'",
|
|
467
|
+
required: false,
|
|
468
|
+
description: "Theme preference"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
name: "showLegend",
|
|
472
|
+
type: "boolean",
|
|
473
|
+
default: "true",
|
|
474
|
+
required: false,
|
|
475
|
+
description: "Show chart legend"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
name: "showTooltip",
|
|
479
|
+
type: "boolean",
|
|
480
|
+
default: "true",
|
|
481
|
+
required: false,
|
|
482
|
+
description: "Show tooltip on hover"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
name: "showGrid",
|
|
486
|
+
type: "boolean",
|
|
487
|
+
default: "true",
|
|
488
|
+
required: false,
|
|
489
|
+
description: "Show grid lines"
|
|
490
|
+
}
|
|
491
|
+
],
|
|
492
|
+
variants: [
|
|
493
|
+
{
|
|
494
|
+
name: "theme",
|
|
495
|
+
values: [
|
|
496
|
+
"light",
|
|
497
|
+
"dark",
|
|
498
|
+
"auto"
|
|
499
|
+
],
|
|
500
|
+
default: "auto"
|
|
501
|
+
}
|
|
502
|
+
],
|
|
316
503
|
slots: [],
|
|
317
504
|
events: [],
|
|
318
505
|
examples: [
|
|
@@ -620,6 +807,117 @@ var component_catalog_default = {
|
|
|
620
807
|
"Card"
|
|
621
808
|
]
|
|
622
809
|
},
|
|
810
|
+
{
|
|
811
|
+
name: "AvatarFallback",
|
|
812
|
+
description: "Fallback content displayed when Avatar image is unavailable",
|
|
813
|
+
category: "core",
|
|
814
|
+
importPath: "@classic-homes/theme-svelte",
|
|
815
|
+
props: [
|
|
816
|
+
{
|
|
817
|
+
name: "class",
|
|
818
|
+
type: "string",
|
|
819
|
+
required: false,
|
|
820
|
+
description: "Additional CSS classes"
|
|
821
|
+
}
|
|
822
|
+
],
|
|
823
|
+
variants: [],
|
|
824
|
+
slots: [
|
|
825
|
+
{
|
|
826
|
+
name: "children",
|
|
827
|
+
description: "Main content",
|
|
828
|
+
required: false
|
|
829
|
+
}
|
|
830
|
+
],
|
|
831
|
+
events: [],
|
|
832
|
+
examples: [
|
|
833
|
+
{
|
|
834
|
+
title: "Basic Usage",
|
|
835
|
+
code: '<Avatar>\n <AvatarImage src="/user.jpg" alt="John Doe" />\n <AvatarFallback>JD</AvatarFallback>\n</Avatar>'
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
title: "Initials",
|
|
839
|
+
code: "<Avatar>\n <AvatarFallback>AB</AvatarFallback>\n</Avatar>"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
title: "Single Letter",
|
|
843
|
+
code: "<Avatar>\n <AvatarFallback>J</AvatarFallback>\n</Avatar>"
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
title: "With Icon",
|
|
847
|
+
code: '<Avatar>\n <AvatarFallback>\n <Icon name="user" class="h-4 w-4" />\n </AvatarFallback>\n</Avatar>'
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
title: "Custom Styling",
|
|
851
|
+
code: '<Avatar>\n <AvatarFallback class="bg-primary text-primary-foreground">AD</AvatarFallback>\n</Avatar>'
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
title: "As Placeholder",
|
|
855
|
+
description: "When no image is available:",
|
|
856
|
+
code: "<Avatar>\n <AvatarFallback>?</AvatarFallback>\n</Avatar>"
|
|
857
|
+
}
|
|
858
|
+
],
|
|
859
|
+
relatedComponents: [
|
|
860
|
+
"Avatar",
|
|
861
|
+
"AvatarImage"
|
|
862
|
+
]
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
name: "AvatarImage",
|
|
866
|
+
description: "Image component for displaying user profile pictures in Avatars",
|
|
867
|
+
category: "core",
|
|
868
|
+
importPath: "@classic-homes/theme-svelte",
|
|
869
|
+
props: [
|
|
870
|
+
{
|
|
871
|
+
name: "src",
|
|
872
|
+
type: "string",
|
|
873
|
+
required: false,
|
|
874
|
+
description: "Image source URL (required)"
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
name: "alt",
|
|
878
|
+
type: "string",
|
|
879
|
+
required: false,
|
|
880
|
+
description: "Alt text for accessibility"
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
name: "class",
|
|
884
|
+
type: "string",
|
|
885
|
+
required: false,
|
|
886
|
+
description: "Additional CSS classes"
|
|
887
|
+
}
|
|
888
|
+
],
|
|
889
|
+
variants: [],
|
|
890
|
+
slots: [
|
|
891
|
+
{
|
|
892
|
+
name: "children",
|
|
893
|
+
description: "Main content",
|
|
894
|
+
required: false
|
|
895
|
+
}
|
|
896
|
+
],
|
|
897
|
+
events: [],
|
|
898
|
+
examples: [
|
|
899
|
+
{
|
|
900
|
+
title: "Basic Usage",
|
|
901
|
+
code: '<Avatar>\n <AvatarImage src="/user-photo.jpg" alt="John Doe" />\n <AvatarFallback>JD</AvatarFallback>\n</Avatar>'
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
title: "With Fallback",
|
|
905
|
+
code: '<Avatar>\n <AvatarImage src="/avatar.jpg" alt="Jane Smith" />\n <AvatarFallback>JS</AvatarFallback>\n</Avatar>'
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
title: "Different Sizes",
|
|
909
|
+
code: '<Avatar size="sm">\n <AvatarImage src="/small.jpg" alt="Small avatar" />\n</Avatar>\n\n<Avatar size="lg">\n <AvatarImage src="/large.jpg" alt="Large avatar" />\n</Avatar>'
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
title: "External Image",
|
|
913
|
+
code: '<Avatar>\n <AvatarImage src="https://avatars.githubusercontent.com/u/123" alt="GitHub user" />\n <AvatarFallback>GH</AvatarFallback>\n</Avatar>'
|
|
914
|
+
}
|
|
915
|
+
],
|
|
916
|
+
relatedComponents: [
|
|
917
|
+
"Avatar",
|
|
918
|
+
"AvatarFallback"
|
|
919
|
+
]
|
|
920
|
+
},
|
|
623
921
|
{
|
|
624
922
|
name: "Badge",
|
|
625
923
|
description: "Small label component for status indicators and categorization",
|
|
@@ -770,45 +1068,144 @@ var component_catalog_default = {
|
|
|
770
1068
|
description: "Compare categories with vertical or horizontal bars",
|
|
771
1069
|
category: "chart",
|
|
772
1070
|
importPath: "@classic-homes/charts-svelte",
|
|
773
|
-
props: [
|
|
774
|
-
variants: [],
|
|
775
|
-
slots: [],
|
|
776
|
-
events: [],
|
|
777
|
-
examples: [
|
|
1071
|
+
props: [
|
|
778
1072
|
{
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
const data = {
|
|
784
|
-
categories: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
|
|
785
|
-
series: [
|
|
786
|
-
{ name: 'Sales', data: [320, 332, 301, 334, 390] },
|
|
787
|
-
{ name: 'Returns', data: [120, 132, 101, 134, 90] },
|
|
788
|
-
],
|
|
789
|
-
};
|
|
790
|
-
</script>
|
|
791
|
-
|
|
792
|
-
<BarChart title="Weekly Sales" {data} height={400} />`
|
|
1073
|
+
name: "data",
|
|
1074
|
+
type: "BarChartData",
|
|
1075
|
+
required: true,
|
|
1076
|
+
description: "Chart data with categories and series"
|
|
793
1077
|
},
|
|
794
1078
|
{
|
|
795
|
-
|
|
796
|
-
|
|
1079
|
+
name: "orientation",
|
|
1080
|
+
type: "'vertical' | 'horizontal'",
|
|
1081
|
+
default: "'vertical'",
|
|
1082
|
+
required: false,
|
|
1083
|
+
description: "Bar orientation"
|
|
797
1084
|
},
|
|
798
1085
|
{
|
|
799
|
-
|
|
800
|
-
|
|
1086
|
+
name: "stacked",
|
|
1087
|
+
type: "boolean",
|
|
1088
|
+
default: "false",
|
|
1089
|
+
required: false,
|
|
1090
|
+
description: "Stack bars to show composition"
|
|
801
1091
|
},
|
|
802
1092
|
{
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
1093
|
+
name: "showValues",
|
|
1094
|
+
type: "boolean",
|
|
1095
|
+
default: "false",
|
|
1096
|
+
required: false,
|
|
1097
|
+
description: "Show value labels on bars"
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
name: "onClick",
|
|
1101
|
+
type: "(params: DataPointEventParams) => void",
|
|
1102
|
+
required: false,
|
|
1103
|
+
description: "Callback when a bar is clicked"
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
name: "title",
|
|
1107
|
+
type: "string",
|
|
1108
|
+
required: true,
|
|
1109
|
+
description: "Chart title for accessibility"
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
name: "description",
|
|
1113
|
+
type: "string",
|
|
1114
|
+
required: false,
|
|
1115
|
+
description: "Description for screen readers"
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
name: "height",
|
|
1119
|
+
type: "number | string",
|
|
1120
|
+
default: "400",
|
|
1121
|
+
required: false,
|
|
1122
|
+
description: "Chart height"
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
name: "theme",
|
|
1126
|
+
type: "'light' | 'dark' | 'auto'",
|
|
1127
|
+
default: "'auto'",
|
|
1128
|
+
required: false,
|
|
1129
|
+
description: "Theme preference"
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
name: "showLegend",
|
|
1133
|
+
type: "boolean",
|
|
1134
|
+
default: "true",
|
|
1135
|
+
required: false,
|
|
1136
|
+
description: "Show chart legend"
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
name: "showTooltip",
|
|
1140
|
+
type: "boolean",
|
|
1141
|
+
default: "true",
|
|
1142
|
+
required: false,
|
|
1143
|
+
description: "Show tooltip on hover"
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
name: "showGrid",
|
|
1147
|
+
type: "boolean",
|
|
1148
|
+
default: "true",
|
|
1149
|
+
required: false,
|
|
1150
|
+
description: "Show grid lines"
|
|
1151
|
+
}
|
|
1152
|
+
],
|
|
1153
|
+
variants: [
|
|
1154
|
+
{
|
|
1155
|
+
name: "orientation",
|
|
1156
|
+
values: [
|
|
1157
|
+
"vertical",
|
|
1158
|
+
"horizontal"
|
|
1159
|
+
],
|
|
1160
|
+
default: "vertical"
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
name: "theme",
|
|
1164
|
+
values: [
|
|
1165
|
+
"light",
|
|
1166
|
+
"dark",
|
|
1167
|
+
"auto"
|
|
1168
|
+
],
|
|
1169
|
+
default: "auto"
|
|
1170
|
+
}
|
|
1171
|
+
],
|
|
1172
|
+
slots: [],
|
|
1173
|
+
events: [],
|
|
1174
|
+
examples: [
|
|
1175
|
+
{
|
|
1176
|
+
title: "Basic Usage",
|
|
1177
|
+
code: `<script>
|
|
1178
|
+
import { BarChart } from '@classic-homes/charts-svelte';
|
|
1179
|
+
|
|
1180
|
+
const data = {
|
|
1181
|
+
categories: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
|
|
1182
|
+
series: [
|
|
1183
|
+
{ name: 'Sales', data: [320, 332, 301, 334, 390] },
|
|
1184
|
+
{ name: 'Returns', data: [120, 132, 101, 134, 90] },
|
|
1185
|
+
],
|
|
1186
|
+
};
|
|
1187
|
+
</script>
|
|
1188
|
+
|
|
1189
|
+
<BarChart title="Weekly Sales" {data} height={400} />`
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
title: "Horizontal Bar Chart",
|
|
1193
|
+
code: '<BarChart title="Sales by Region" {data} orientation="horizontal" height={400} />'
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
title: "Stacked Bar Chart",
|
|
1197
|
+
code: '<BarChart title="Revenue Breakdown" {data} stacked height={400} />'
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
title: "With Value Labels",
|
|
1201
|
+
code: '<BarChart title="Monthly Performance" {data} showValues height={400} />'
|
|
1202
|
+
}
|
|
1203
|
+
],
|
|
1204
|
+
relatedComponents: [
|
|
1205
|
+
"LineChart",
|
|
1206
|
+
"FunnelChart"
|
|
1207
|
+
]
|
|
1208
|
+
},
|
|
812
1209
|
{
|
|
813
1210
|
name: "Button",
|
|
814
1211
|
description: "Clickable button component with multiple variants, sizes, and loading states",
|
|
@@ -984,8 +1381,72 @@ var component_catalog_default = {
|
|
|
984
1381
|
description: "Financial OHLC data with volume bars",
|
|
985
1382
|
category: "chart",
|
|
986
1383
|
importPath: "@classic-homes/charts-svelte",
|
|
987
|
-
props: [
|
|
988
|
-
|
|
1384
|
+
props: [
|
|
1385
|
+
{
|
|
1386
|
+
name: "data",
|
|
1387
|
+
type: "CandlestickData",
|
|
1388
|
+
required: true,
|
|
1389
|
+
description: "OHLC data with optional volume"
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
name: "showVolume",
|
|
1393
|
+
type: "boolean",
|
|
1394
|
+
default: "false",
|
|
1395
|
+
required: false,
|
|
1396
|
+
description: "Display volume bars below chart"
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
name: "onClick",
|
|
1400
|
+
type: "(params: CandlestickEventParams) => void",
|
|
1401
|
+
required: false,
|
|
1402
|
+
description: "Callback when clicked"
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
name: "title",
|
|
1406
|
+
type: "string",
|
|
1407
|
+
required: true,
|
|
1408
|
+
description: "Chart title for accessibility"
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
name: "height",
|
|
1412
|
+
type: "number | string",
|
|
1413
|
+
default: "400",
|
|
1414
|
+
required: false,
|
|
1415
|
+
description: "Chart height"
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
name: "theme",
|
|
1419
|
+
type: "'light' | 'dark' | 'auto'",
|
|
1420
|
+
default: "'auto'",
|
|
1421
|
+
required: false,
|
|
1422
|
+
description: "Theme preference"
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
name: "showTooltip",
|
|
1426
|
+
type: "boolean",
|
|
1427
|
+
default: "true",
|
|
1428
|
+
required: false,
|
|
1429
|
+
description: "Show tooltip on hover"
|
|
1430
|
+
},
|
|
1431
|
+
{
|
|
1432
|
+
name: "showGrid",
|
|
1433
|
+
type: "boolean",
|
|
1434
|
+
default: "true",
|
|
1435
|
+
required: false,
|
|
1436
|
+
description: "Show grid lines"
|
|
1437
|
+
}
|
|
1438
|
+
],
|
|
1439
|
+
variants: [
|
|
1440
|
+
{
|
|
1441
|
+
name: "theme",
|
|
1442
|
+
values: [
|
|
1443
|
+
"light",
|
|
1444
|
+
"dark",
|
|
1445
|
+
"auto"
|
|
1446
|
+
],
|
|
1447
|
+
default: "auto"
|
|
1448
|
+
}
|
|
1449
|
+
],
|
|
989
1450
|
slots: [],
|
|
990
1451
|
events: [],
|
|
991
1452
|
examples: [
|
|
@@ -1101,61 +1562,113 @@ var component_catalog_default = {
|
|
|
1101
1562
|
]
|
|
1102
1563
|
},
|
|
1103
1564
|
{
|
|
1104
|
-
name: "
|
|
1105
|
-
description: "
|
|
1106
|
-
category: "
|
|
1565
|
+
name: "CardContent",
|
|
1566
|
+
description: "Main content area container for Card components",
|
|
1567
|
+
category: "layout",
|
|
1107
1568
|
importPath: "@classic-homes/theme-svelte",
|
|
1108
1569
|
props: [
|
|
1109
1570
|
{
|
|
1110
|
-
name: "
|
|
1111
|
-
type: "
|
|
1112
|
-
default: "false",
|
|
1571
|
+
name: "class",
|
|
1572
|
+
type: "string",
|
|
1113
1573
|
required: false,
|
|
1114
|
-
description: "
|
|
1574
|
+
description: "Additional CSS classes"
|
|
1575
|
+
}
|
|
1576
|
+
],
|
|
1577
|
+
variants: [],
|
|
1578
|
+
slots: [
|
|
1579
|
+
{
|
|
1580
|
+
name: "children",
|
|
1581
|
+
description: "Main content",
|
|
1582
|
+
required: false
|
|
1583
|
+
}
|
|
1584
|
+
],
|
|
1585
|
+
events: [],
|
|
1586
|
+
examples: [
|
|
1587
|
+
{
|
|
1588
|
+
title: "Basic Usage",
|
|
1589
|
+
code: "<Card>\n <CardContent>\n <p>This is the main content of the card.</p>\n </CardContent>\n</Card>"
|
|
1115
1590
|
},
|
|
1116
1591
|
{
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
default: "false",
|
|
1120
|
-
required: false,
|
|
1121
|
-
description: "Disables the checkbox"
|
|
1592
|
+
title: "With Header",
|
|
1593
|
+
code: "<Card>\n <CardHeader>\n <CardTitle>Settings</CardTitle>\n </CardHeader>\n <CardContent>\n <p>Adjust your preferences below.</p>\n </CardContent>\n</Card>"
|
|
1122
1594
|
},
|
|
1123
1595
|
{
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
required: false,
|
|
1128
|
-
description: "Marks as required"
|
|
1596
|
+
title: "Standalone Content",
|
|
1597
|
+
description: "When using without a header, add top padding:",
|
|
1598
|
+
code: '<Card>\n <CardContent class="pt-6">\n <p>Simple card with just content.</p>\n </CardContent>\n</Card>'
|
|
1129
1599
|
},
|
|
1130
1600
|
{
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
required: false,
|
|
1134
|
-
description: "Name attribute for forms"
|
|
1601
|
+
title: "With Form Elements",
|
|
1602
|
+
code: '<CardContent>\n <div class="space-y-4">\n <FormField label="Email" name="email" />\n <FormField label="Password" name="password" type="password" />\n </div>\n</CardContent>'
|
|
1135
1603
|
},
|
|
1136
1604
|
{
|
|
1137
|
-
|
|
1605
|
+
title: "Rich Content",
|
|
1606
|
+
code: '<CardContent>\n <div class="flex items-center gap-4">\n <Avatar>\n <AvatarImage src="/user.jpg" alt="User" />\n <AvatarFallback>JD</AvatarFallback>\n </Avatar>\n <div>\n <p class="font-medium">John Doe</p>\n <p class="text-sm text-muted-foreground">Developer</p>\n </div>\n </div>\n</CardContent>'
|
|
1607
|
+
}
|
|
1608
|
+
],
|
|
1609
|
+
relatedComponents: [
|
|
1610
|
+
"Card",
|
|
1611
|
+
"CardHeader",
|
|
1612
|
+
"CardFooter"
|
|
1613
|
+
]
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
name: "CardDescription",
|
|
1617
|
+
description: "Secondary text component for Card headers",
|
|
1618
|
+
category: "layout",
|
|
1619
|
+
importPath: "@classic-homes/theme-svelte",
|
|
1620
|
+
props: [
|
|
1621
|
+
{
|
|
1622
|
+
name: "class",
|
|
1138
1623
|
type: "string",
|
|
1139
1624
|
required: false,
|
|
1140
|
-
description: "
|
|
1625
|
+
description: "Additional CSS classes"
|
|
1626
|
+
}
|
|
1627
|
+
],
|
|
1628
|
+
variants: [],
|
|
1629
|
+
slots: [
|
|
1630
|
+
{
|
|
1631
|
+
name: "children",
|
|
1632
|
+
description: "Main content",
|
|
1633
|
+
required: false
|
|
1634
|
+
}
|
|
1635
|
+
],
|
|
1636
|
+
events: [],
|
|
1637
|
+
examples: [
|
|
1638
|
+
{
|
|
1639
|
+
title: "Basic Usage",
|
|
1640
|
+
code: "<Card>\n <CardHeader>\n <CardTitle>Card Title</CardTitle>\n <CardDescription>This is a description of the card content.</CardDescription>\n </CardHeader>\n</Card>"
|
|
1141
1641
|
},
|
|
1142
1642
|
{
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1643
|
+
title: "Descriptive Text",
|
|
1644
|
+
code: "<CardDescription>\n Configure your notification preferences and choose how you want to be contacted.\n</CardDescription>"
|
|
1645
|
+
},
|
|
1646
|
+
{
|
|
1647
|
+
title: "With Custom Styling",
|
|
1648
|
+
code: '<CardDescription class="text-xs">Last updated 2 hours ago</CardDescription>'
|
|
1147
1649
|
},
|
|
1650
|
+
{
|
|
1651
|
+
title: "Multiple Lines",
|
|
1652
|
+
code: "<CardDescription>\n Your subscription includes unlimited access to all premium features. Upgrade anytime to unlock\n more.\n</CardDescription>"
|
|
1653
|
+
}
|
|
1654
|
+
],
|
|
1655
|
+
relatedComponents: [
|
|
1656
|
+
"Card",
|
|
1657
|
+
"CardHeader",
|
|
1658
|
+
"CardTitle"
|
|
1659
|
+
]
|
|
1660
|
+
},
|
|
1661
|
+
{
|
|
1662
|
+
name: "CardFooter",
|
|
1663
|
+
description: "Footer section container for Card action buttons",
|
|
1664
|
+
category: "layout",
|
|
1665
|
+
importPath: "@classic-homes/theme-svelte",
|
|
1666
|
+
props: [
|
|
1148
1667
|
{
|
|
1149
1668
|
name: "class",
|
|
1150
1669
|
type: "string",
|
|
1151
1670
|
required: false,
|
|
1152
1671
|
description: "Additional CSS classes"
|
|
1153
|
-
},
|
|
1154
|
-
{
|
|
1155
|
-
name: "onCheckedChange",
|
|
1156
|
-
type: "(checked: boolean) => void",
|
|
1157
|
-
required: false,
|
|
1158
|
-
description: "Callback when checked state changes"
|
|
1159
1672
|
}
|
|
1160
1673
|
],
|
|
1161
1674
|
variants: [],
|
|
@@ -1170,47 +1683,663 @@ var component_catalog_default = {
|
|
|
1170
1683
|
examples: [
|
|
1171
1684
|
{
|
|
1172
1685
|
title: "Basic Usage",
|
|
1173
|
-
code: "<
|
|
1686
|
+
code: "<Card>\n <CardContent>\n <p>Card content here.</p>\n </CardContent>\n <CardFooter>\n <Button>Save Changes</Button>\n </CardFooter>\n</Card>"
|
|
1174
1687
|
},
|
|
1175
1688
|
{
|
|
1176
|
-
title: "
|
|
1177
|
-
code: "<
|
|
1689
|
+
title: "Multiple Actions",
|
|
1690
|
+
code: '<CardFooter class="gap-2">\n <Button variant="outline">Cancel</Button>\n <Button>Save</Button>\n</CardFooter>'
|
|
1178
1691
|
},
|
|
1179
1692
|
{
|
|
1180
|
-
title: "
|
|
1181
|
-
code:
|
|
1693
|
+
title: "Right-Aligned Actions",
|
|
1694
|
+
code: '<CardFooter class="justify-end gap-2">\n <Button variant="ghost">Skip</Button>\n <Button>Continue</Button>\n</CardFooter>'
|
|
1182
1695
|
},
|
|
1183
1696
|
{
|
|
1184
|
-
title: "
|
|
1185
|
-
code: '<
|
|
1697
|
+
title: "Space Between",
|
|
1698
|
+
code: '<CardFooter class="justify-between">\n <Button variant="ghost">Back</Button>\n <Button>Next</Button>\n</CardFooter>'
|
|
1186
1699
|
},
|
|
1187
1700
|
{
|
|
1188
|
-
title: "
|
|
1189
|
-
code: '<
|
|
1701
|
+
title: "Full-Width Button",
|
|
1702
|
+
code: '<CardFooter>\n <Button class="w-full">Get Started</Button>\n</CardFooter>'
|
|
1190
1703
|
},
|
|
1191
1704
|
{
|
|
1192
|
-
title: "
|
|
1193
|
-
code:
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1705
|
+
title: "With Summary Text",
|
|
1706
|
+
code: '<CardFooter class="justify-between">\n <span class="text-sm text-muted-foreground">2 items selected</span>\n <Button size="sm">Delete Selected</Button>\n</CardFooter>'
|
|
1707
|
+
}
|
|
1708
|
+
],
|
|
1709
|
+
relatedComponents: [
|
|
1710
|
+
"Card",
|
|
1711
|
+
"CardContent",
|
|
1712
|
+
"Button"
|
|
1713
|
+
]
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
name: "CardHeader",
|
|
1717
|
+
description: "Header section container for Card components with title and description",
|
|
1718
|
+
category: "layout",
|
|
1719
|
+
importPath: "@classic-homes/theme-svelte",
|
|
1720
|
+
props: [
|
|
1721
|
+
{
|
|
1722
|
+
name: "variant",
|
|
1723
|
+
type: "'default' | 'compact' | 'bordered' | 'shaded'",
|
|
1724
|
+
default: "'default'",
|
|
1725
|
+
required: false,
|
|
1726
|
+
description: "Header style variant"
|
|
1727
|
+
},
|
|
1728
|
+
{
|
|
1729
|
+
name: "class",
|
|
1730
|
+
type: "string",
|
|
1731
|
+
required: false,
|
|
1732
|
+
description: "Additional CSS classes"
|
|
1733
|
+
}
|
|
1734
|
+
],
|
|
1735
|
+
variants: [
|
|
1736
|
+
{
|
|
1737
|
+
name: "variant",
|
|
1738
|
+
values: [
|
|
1739
|
+
"default",
|
|
1740
|
+
"compact",
|
|
1741
|
+
"bordered",
|
|
1742
|
+
"shaded"
|
|
1743
|
+
],
|
|
1744
|
+
default: "default"
|
|
1745
|
+
}
|
|
1746
|
+
],
|
|
1747
|
+
slots: [
|
|
1748
|
+
{
|
|
1749
|
+
name: "children",
|
|
1750
|
+
description: "Main content",
|
|
1751
|
+
required: false
|
|
1752
|
+
}
|
|
1753
|
+
],
|
|
1754
|
+
events: [],
|
|
1755
|
+
examples: [
|
|
1756
|
+
{
|
|
1757
|
+
title: "Basic Usage",
|
|
1758
|
+
code: "<Card>\n <CardHeader>\n <CardTitle>Card Title</CardTitle>\n <CardDescription>Card description text</CardDescription>\n </CardHeader>\n</Card>"
|
|
1759
|
+
},
|
|
1760
|
+
{
|
|
1761
|
+
title: "Default",
|
|
1762
|
+
description: "Standard padding (p-6):",
|
|
1763
|
+
code: '<CardHeader variant="default">\n <CardTitle>Default Header</CardTitle>\n</CardHeader>'
|
|
1764
|
+
},
|
|
1765
|
+
{
|
|
1766
|
+
title: "Compact",
|
|
1767
|
+
description: "Reduced padding (p-4):",
|
|
1768
|
+
code: '<CardHeader variant="compact">\n <CardTitle>Compact Header</CardTitle>\n</CardHeader>'
|
|
1769
|
+
},
|
|
1770
|
+
{
|
|
1771
|
+
title: "Bordered",
|
|
1772
|
+
description: "Header with bottom border:",
|
|
1773
|
+
code: '<CardHeader variant="bordered">\n <CardTitle>Bordered Header</CardTitle>\n</CardHeader>'
|
|
1774
|
+
},
|
|
1775
|
+
{
|
|
1776
|
+
title: "Shaded",
|
|
1777
|
+
description: "Header with muted background:",
|
|
1778
|
+
code: '<CardHeader variant="shaded">\n <CardTitle>Shaded Header</CardTitle>\n</CardHeader>'
|
|
1779
|
+
}
|
|
1780
|
+
],
|
|
1781
|
+
relatedComponents: [
|
|
1782
|
+
"Card",
|
|
1783
|
+
"CardTitle",
|
|
1784
|
+
"CardDescription"
|
|
1785
|
+
]
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
name: "CardTitle",
|
|
1789
|
+
description: "Title heading component for Card headers",
|
|
1790
|
+
category: "layout",
|
|
1791
|
+
importPath: "@classic-homes/theme-svelte",
|
|
1792
|
+
props: [
|
|
1793
|
+
{
|
|
1794
|
+
name: "class",
|
|
1795
|
+
type: "string",
|
|
1796
|
+
required: false,
|
|
1797
|
+
description: "Additional CSS classes"
|
|
1798
|
+
}
|
|
1799
|
+
],
|
|
1800
|
+
variants: [],
|
|
1801
|
+
slots: [
|
|
1802
|
+
{
|
|
1803
|
+
name: "children",
|
|
1804
|
+
description: "Main content",
|
|
1805
|
+
required: false
|
|
1806
|
+
}
|
|
1807
|
+
],
|
|
1808
|
+
events: [],
|
|
1809
|
+
examples: [
|
|
1810
|
+
{
|
|
1811
|
+
title: "Basic Usage",
|
|
1812
|
+
code: "<Card>\n <CardHeader>\n <CardTitle>Card Title</CardTitle>\n </CardHeader>\n</Card>"
|
|
1813
|
+
},
|
|
1814
|
+
{
|
|
1815
|
+
title: "With Description",
|
|
1816
|
+
code: "<CardHeader>\n <CardTitle>Account Settings</CardTitle>\n <CardDescription>Manage your account preferences</CardDescription>\n</CardHeader>"
|
|
1817
|
+
},
|
|
1818
|
+
{
|
|
1819
|
+
title: "Custom Styling",
|
|
1820
|
+
code: '<CardTitle class="text-primary">Featured Title</CardTitle>'
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
title: "In Stats Card",
|
|
1824
|
+
code: '<CardHeader class="flex-row items-center justify-between pb-2">\n <CardTitle class="text-sm font-medium">Total Revenue</CardTitle>\n <Icon name="dollar" class="h-4 w-4 text-muted-foreground" />\n</CardHeader>'
|
|
1825
|
+
}
|
|
1826
|
+
],
|
|
1827
|
+
relatedComponents: [
|
|
1828
|
+
"Card",
|
|
1829
|
+
"CardHeader",
|
|
1830
|
+
"CardDescription"
|
|
1831
|
+
]
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
name: "ChartContainer",
|
|
1835
|
+
description: "Base wrapper component for charts with loading, error, and empty states",
|
|
1836
|
+
category: "chart",
|
|
1837
|
+
importPath: "@classic-homes/charts-svelte",
|
|
1838
|
+
props: [
|
|
1839
|
+
{
|
|
1840
|
+
name: "title",
|
|
1841
|
+
type: "string",
|
|
1842
|
+
required: true,
|
|
1843
|
+
description: "Chart title for accessibility (aria-label)"
|
|
1844
|
+
},
|
|
1845
|
+
{
|
|
1846
|
+
name: "description",
|
|
1847
|
+
type: "string",
|
|
1848
|
+
required: false,
|
|
1849
|
+
description: "Chart description for screen readers"
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
name: "height",
|
|
1853
|
+
type: "number | string",
|
|
1854
|
+
default: "400",
|
|
1855
|
+
required: false,
|
|
1856
|
+
description: "Chart container height"
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
name: "loading",
|
|
1860
|
+
type: "boolean",
|
|
1861
|
+
default: "false",
|
|
1862
|
+
required: false,
|
|
1863
|
+
description: "Show loading skeleton"
|
|
1864
|
+
},
|
|
1865
|
+
{
|
|
1866
|
+
name: "error",
|
|
1867
|
+
type: "string | null",
|
|
1868
|
+
required: false,
|
|
1869
|
+
description: "Error message to display"
|
|
1870
|
+
},
|
|
1871
|
+
{
|
|
1872
|
+
name: "empty",
|
|
1873
|
+
type: "boolean",
|
|
1874
|
+
default: "false",
|
|
1875
|
+
required: false,
|
|
1876
|
+
description: "Show empty state"
|
|
1877
|
+
},
|
|
1878
|
+
{
|
|
1879
|
+
name: "emptyMessage",
|
|
1880
|
+
type: "string",
|
|
1881
|
+
default: "'No data available'",
|
|
1882
|
+
required: false,
|
|
1883
|
+
description: "Custom empty state message"
|
|
1884
|
+
},
|
|
1885
|
+
{
|
|
1886
|
+
name: "onRetry",
|
|
1887
|
+
type: "() => void",
|
|
1888
|
+
required: false,
|
|
1889
|
+
description: "Callback for retry button in error state"
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
name: "class",
|
|
1893
|
+
type: "string",
|
|
1894
|
+
required: false,
|
|
1895
|
+
description: "Additional CSS classes for chart area"
|
|
1896
|
+
},
|
|
1897
|
+
{
|
|
1898
|
+
name: "wrapperClass",
|
|
1899
|
+
type: "string",
|
|
1900
|
+
required: false,
|
|
1901
|
+
description: "Additional CSS classes for outer wrapper"
|
|
1902
|
+
}
|
|
1903
|
+
],
|
|
1904
|
+
variants: [],
|
|
1905
|
+
slots: [],
|
|
1906
|
+
events: [],
|
|
1907
|
+
examples: [
|
|
1908
|
+
{
|
|
1909
|
+
title: "Basic Usage",
|
|
1910
|
+
code: `<script>
|
|
1911
|
+
import { ChartContainer } from '@classic-homes/charts-svelte';
|
|
1912
|
+
</script>
|
|
1913
|
+
|
|
1914
|
+
<ChartContainer title="Sales Overview" height={400}>
|
|
1915
|
+
<!-- Your chart content here -->
|
|
1916
|
+
</ChartContainer>`
|
|
1917
|
+
},
|
|
1918
|
+
{
|
|
1919
|
+
title: "With Loading State",
|
|
1920
|
+
code: `<script>
|
|
1921
|
+
import { ChartContainer, LineChart } from '@classic-homes/charts-svelte';
|
|
1922
|
+
|
|
1923
|
+
let loading = $state(true);
|
|
1924
|
+
let data = $state(null);
|
|
1925
|
+
</script>
|
|
1926
|
+
|
|
1927
|
+
<ChartContainer title="Revenue" {loading}>
|
|
1928
|
+
{#if data}
|
|
1929
|
+
<LineChart {data} title="Revenue" />
|
|
1930
|
+
{/if}
|
|
1931
|
+
</ChartContainer>`
|
|
1932
|
+
},
|
|
1933
|
+
{
|
|
1934
|
+
title: "With Error State",
|
|
1935
|
+
code: `<script>
|
|
1936
|
+
import { ChartContainer, BarChart } from '@classic-homes/charts-svelte';
|
|
1937
|
+
|
|
1938
|
+
let error = $state(null);
|
|
1939
|
+
|
|
1940
|
+
async function fetchData() {
|
|
1941
|
+
try {
|
|
1942
|
+
// fetch data
|
|
1943
|
+
} catch (e) {
|
|
1944
|
+
error = e.message;
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
</script>
|
|
1948
|
+
|
|
1949
|
+
<ChartContainer title="Analytics" {error} onRetry={fetchData}>
|
|
1950
|
+
<BarChart {data} title="Analytics" />
|
|
1951
|
+
</ChartContainer>`
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
title: "With Empty State",
|
|
1955
|
+
code: `<script>
|
|
1956
|
+
import { ChartContainer, AreaChart } from '@classic-homes/charts-svelte';
|
|
1957
|
+
|
|
1958
|
+
let data = $state([]);
|
|
1959
|
+
</script>
|
|
1960
|
+
|
|
1961
|
+
<ChartContainer
|
|
1962
|
+
title="User Activity"
|
|
1963
|
+
empty={data.length === 0}
|
|
1964
|
+
emptyMessage="No activity recorded yet"
|
|
1965
|
+
>
|
|
1966
|
+
<AreaChart {data} title="User Activity" />
|
|
1967
|
+
</ChartContainer>`
|
|
1968
|
+
},
|
|
1969
|
+
{
|
|
1970
|
+
title: "Custom Styling",
|
|
1971
|
+
code: '<ChartContainer title="Dashboard Chart" wrapperClass="shadow-lg" class="p-4">\n <PieChart {data} title="Distribution" />\n</ChartContainer>'
|
|
1972
|
+
}
|
|
1973
|
+
],
|
|
1974
|
+
relatedComponents: [
|
|
1975
|
+
"ChartSkeleton",
|
|
1976
|
+
"ChartError",
|
|
1977
|
+
"ChartEmpty"
|
|
1978
|
+
]
|
|
1979
|
+
},
|
|
1980
|
+
{
|
|
1981
|
+
name: "ChartEmpty",
|
|
1982
|
+
description: "Empty state component displayed when chart has no data",
|
|
1983
|
+
category: "chart",
|
|
1984
|
+
importPath: "@classic-homes/charts-svelte",
|
|
1985
|
+
props: [
|
|
1986
|
+
{
|
|
1987
|
+
name: "message",
|
|
1988
|
+
type: "string",
|
|
1989
|
+
default: "'No data available'",
|
|
1990
|
+
required: false,
|
|
1991
|
+
description: "Empty state message"
|
|
1992
|
+
},
|
|
1993
|
+
{
|
|
1994
|
+
name: "height",
|
|
1995
|
+
type: "number | string",
|
|
1996
|
+
default: "400",
|
|
1997
|
+
required: false,
|
|
1998
|
+
description: "Component height"
|
|
1999
|
+
},
|
|
2000
|
+
{
|
|
2001
|
+
name: "class",
|
|
2002
|
+
type: "string",
|
|
2003
|
+
required: false,
|
|
2004
|
+
description: "Additional CSS classes"
|
|
2005
|
+
}
|
|
2006
|
+
],
|
|
2007
|
+
variants: [],
|
|
2008
|
+
slots: [],
|
|
2009
|
+
events: [],
|
|
2010
|
+
examples: [
|
|
2011
|
+
{
|
|
2012
|
+
title: "Basic Usage",
|
|
2013
|
+
code: "<script>\n import { ChartEmpty } from '@classic-homes/charts-svelte';\n</script>\n\n<ChartEmpty />"
|
|
2014
|
+
},
|
|
2015
|
+
{
|
|
2016
|
+
title: "Custom Message",
|
|
2017
|
+
code: '<ChartEmpty message="No sales data for this period" />'
|
|
2018
|
+
},
|
|
2019
|
+
{
|
|
2020
|
+
title: "Custom Height",
|
|
2021
|
+
code: '<ChartEmpty height={300} message="Start adding data to see your chart" />'
|
|
2022
|
+
},
|
|
2023
|
+
{
|
|
2024
|
+
title: "Conditional Rendering",
|
|
2025
|
+
code: `<script>
|
|
2026
|
+
import { ChartEmpty, LineChart } from '@classic-homes/charts-svelte';
|
|
2027
|
+
|
|
2028
|
+
let data = $state([]);
|
|
2029
|
+
</script>
|
|
2030
|
+
|
|
2031
|
+
{#if data.length === 0}
|
|
2032
|
+
<ChartEmpty message="No activity recorded" />
|
|
2033
|
+
{:else}
|
|
2034
|
+
<LineChart {data} title="Activity" />
|
|
2035
|
+
{/if}`
|
|
2036
|
+
},
|
|
2037
|
+
{
|
|
2038
|
+
title: "With Custom Styling",
|
|
2039
|
+
code: '<ChartEmpty message="No results found" class="rounded-xl bg-muted/30" height={250} />'
|
|
2040
|
+
}
|
|
2041
|
+
],
|
|
2042
|
+
relatedComponents: [
|
|
2043
|
+
"ChartContainer",
|
|
2044
|
+
"ChartError",
|
|
2045
|
+
"ChartSkeleton"
|
|
2046
|
+
]
|
|
2047
|
+
},
|
|
2048
|
+
{
|
|
2049
|
+
name: "ChartError",
|
|
2050
|
+
description: "Error state component for charts with optional retry functionality",
|
|
2051
|
+
category: "chart",
|
|
2052
|
+
importPath: "@classic-homes/charts-svelte",
|
|
2053
|
+
props: [
|
|
2054
|
+
{
|
|
2055
|
+
name: "message",
|
|
2056
|
+
type: "string",
|
|
2057
|
+
required: true,
|
|
2058
|
+
description: "Error message to display"
|
|
2059
|
+
},
|
|
2060
|
+
{
|
|
2061
|
+
name: "height",
|
|
2062
|
+
type: "number | string",
|
|
2063
|
+
default: "400",
|
|
2064
|
+
required: false,
|
|
2065
|
+
description: "Component height"
|
|
2066
|
+
},
|
|
2067
|
+
{
|
|
2068
|
+
name: "onRetry",
|
|
2069
|
+
type: "() => void",
|
|
2070
|
+
required: false,
|
|
2071
|
+
description: "Callback when retry button is clicked"
|
|
2072
|
+
},
|
|
2073
|
+
{
|
|
2074
|
+
name: "class",
|
|
2075
|
+
type: "string",
|
|
2076
|
+
required: false,
|
|
2077
|
+
description: "Additional CSS classes"
|
|
2078
|
+
}
|
|
2079
|
+
],
|
|
2080
|
+
variants: [],
|
|
2081
|
+
slots: [],
|
|
2082
|
+
events: [],
|
|
2083
|
+
examples: [
|
|
2084
|
+
{
|
|
2085
|
+
title: "Basic Usage",
|
|
2086
|
+
code: `<script>
|
|
2087
|
+
import { ChartError } from '@classic-homes/charts-svelte';
|
|
2088
|
+
</script>
|
|
2089
|
+
|
|
2090
|
+
<ChartError message="Failed to load chart data" />`
|
|
2091
|
+
},
|
|
2092
|
+
{
|
|
2093
|
+
title: "With Retry Button",
|
|
2094
|
+
code: `<script>
|
|
2095
|
+
import { ChartError } from '@classic-homes/charts-svelte';
|
|
2096
|
+
|
|
2097
|
+
async function fetchData() {
|
|
2098
|
+
// Retry logic
|
|
2099
|
+
}
|
|
2100
|
+
</script>
|
|
2101
|
+
|
|
2102
|
+
<ChartError message="Network error occurred" onRetry={fetchData} />`
|
|
2103
|
+
},
|
|
2104
|
+
{
|
|
2105
|
+
title: "Custom Height",
|
|
2106
|
+
code: '<ChartError message="Unable to process data" height={300} onRetry={handleRetry} />'
|
|
2107
|
+
},
|
|
2108
|
+
{
|
|
2109
|
+
title: "Conditional Error Handling",
|
|
2110
|
+
code: `<script>
|
|
2111
|
+
import { ChartError, BarChart } from '@classic-homes/charts-svelte';
|
|
2112
|
+
|
|
2113
|
+
let error = $state(null);
|
|
2114
|
+
let data = $state(null);
|
|
2115
|
+
|
|
2116
|
+
async function loadData() {
|
|
2117
|
+
try {
|
|
2118
|
+
error = null;
|
|
2119
|
+
data = await fetchChartData();
|
|
2120
|
+
} catch (e) {
|
|
2121
|
+
error = e.message;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
</script>
|
|
2125
|
+
|
|
2126
|
+
{#if error}
|
|
2127
|
+
<ChartError message={error} onRetry={loadData} />
|
|
2128
|
+
{:else if data}
|
|
2129
|
+
<BarChart {data} title="Sales" />
|
|
2130
|
+
{/if}`
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
title: "With Custom Styling",
|
|
2134
|
+
code: '<ChartError\n message="Service temporarily unavailable"\n class="rounded-xl"\n onRetry={() => location.reload()}\n/>'
|
|
2135
|
+
}
|
|
2136
|
+
],
|
|
2137
|
+
relatedComponents: [
|
|
2138
|
+
"ChartContainer",
|
|
2139
|
+
"ChartEmpty",
|
|
2140
|
+
"ChartSkeleton"
|
|
2141
|
+
]
|
|
2142
|
+
},
|
|
2143
|
+
{
|
|
2144
|
+
name: "ChartSkeleton",
|
|
2145
|
+
description: "Loading skeleton placeholder for charts with animated bars",
|
|
2146
|
+
category: "chart",
|
|
2147
|
+
importPath: "@classic-homes/charts-svelte",
|
|
2148
|
+
props: [
|
|
2149
|
+
{
|
|
2150
|
+
name: "height",
|
|
2151
|
+
type: "number | string",
|
|
2152
|
+
default: "400",
|
|
2153
|
+
required: false,
|
|
2154
|
+
description: "Skeleton height"
|
|
2155
|
+
},
|
|
2156
|
+
{
|
|
2157
|
+
name: "class",
|
|
2158
|
+
type: "string",
|
|
2159
|
+
required: false,
|
|
2160
|
+
description: "Additional CSS classes"
|
|
2161
|
+
}
|
|
2162
|
+
],
|
|
2163
|
+
variants: [],
|
|
2164
|
+
slots: [],
|
|
2165
|
+
events: [],
|
|
2166
|
+
examples: [
|
|
2167
|
+
{
|
|
2168
|
+
title: "Basic Usage",
|
|
2169
|
+
code: "<script>\n import { ChartSkeleton } from '@classic-homes/charts-svelte';\n</script>\n\n<ChartSkeleton />"
|
|
2170
|
+
},
|
|
2171
|
+
{
|
|
2172
|
+
title: "Custom Height",
|
|
2173
|
+
code: "<ChartSkeleton height={300} />"
|
|
2174
|
+
},
|
|
2175
|
+
{
|
|
2176
|
+
title: "With Custom Class",
|
|
2177
|
+
code: '<ChartSkeleton class="rounded-xl shadow-md" />'
|
|
2178
|
+
},
|
|
2179
|
+
{
|
|
2180
|
+
title: "Conditional Loading",
|
|
2181
|
+
code: `<script>
|
|
2182
|
+
import { ChartSkeleton, LineChart } from '@classic-homes/charts-svelte';
|
|
2183
|
+
|
|
2184
|
+
let loading = $state(true);
|
|
2185
|
+
let data = $state(null);
|
|
2186
|
+
|
|
2187
|
+
async function loadData() {
|
|
2188
|
+
loading = true;
|
|
2189
|
+
data = await fetchChartData();
|
|
2190
|
+
loading = false;
|
|
2191
|
+
}
|
|
2192
|
+
</script>
|
|
2193
|
+
|
|
2194
|
+
{#if loading}
|
|
2195
|
+
<ChartSkeleton height={400} />
|
|
2196
|
+
{:else}
|
|
2197
|
+
<LineChart {data} title="Revenue" />
|
|
2198
|
+
{/if}`
|
|
2199
|
+
},
|
|
2200
|
+
{
|
|
2201
|
+
title: "In Card",
|
|
2202
|
+
code: `<script>
|
|
2203
|
+
import { ChartSkeleton, AreaChart } from '@classic-homes/charts-svelte';
|
|
2204
|
+
import { Card, CardHeader, CardTitle, CardContent } from '@classic-homes/theme-svelte';
|
|
2205
|
+
</script>
|
|
2206
|
+
|
|
2207
|
+
<Card>
|
|
2208
|
+
<CardHeader>
|
|
2209
|
+
<CardTitle>Analytics</CardTitle>
|
|
2210
|
+
</CardHeader>
|
|
2211
|
+
<CardContent>
|
|
2212
|
+
{#if loading}
|
|
2213
|
+
<ChartSkeleton height={300} />
|
|
2214
|
+
{:else}
|
|
2215
|
+
<AreaChart {data} title="Monthly Users" />
|
|
2216
|
+
{/if}
|
|
2217
|
+
</CardContent>
|
|
2218
|
+
</Card>`
|
|
2219
|
+
},
|
|
2220
|
+
{
|
|
2221
|
+
title: "Multiple Skeletons",
|
|
2222
|
+
code: '<div class="grid grid-cols-2 gap-4">\n <ChartSkeleton height={250} />\n <ChartSkeleton height={250} />\n</div>'
|
|
2223
|
+
}
|
|
2224
|
+
],
|
|
2225
|
+
relatedComponents: [
|
|
2226
|
+
"ChartContainer",
|
|
2227
|
+
"ChartError",
|
|
2228
|
+
"ChartEmpty",
|
|
2229
|
+
"Skeleton"
|
|
2230
|
+
]
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
name: "Checkbox",
|
|
2234
|
+
description: "Checkbox input for boolean selections and multiple choice options",
|
|
2235
|
+
category: "form",
|
|
2236
|
+
importPath: "@classic-homes/theme-svelte",
|
|
2237
|
+
props: [
|
|
2238
|
+
{
|
|
2239
|
+
name: "checked",
|
|
2240
|
+
type: "boolean",
|
|
2241
|
+
default: "false",
|
|
2242
|
+
required: false,
|
|
2243
|
+
description: "Whether the checkbox is checked (bindable)"
|
|
2244
|
+
},
|
|
2245
|
+
{
|
|
2246
|
+
name: "disabled",
|
|
2247
|
+
type: "boolean",
|
|
2248
|
+
default: "false",
|
|
2249
|
+
required: false,
|
|
2250
|
+
description: "Disables the checkbox"
|
|
2251
|
+
},
|
|
2252
|
+
{
|
|
2253
|
+
name: "required",
|
|
2254
|
+
type: "boolean",
|
|
2255
|
+
default: "false",
|
|
2256
|
+
required: false,
|
|
2257
|
+
description: "Marks as required"
|
|
2258
|
+
},
|
|
2259
|
+
{
|
|
2260
|
+
name: "name",
|
|
2261
|
+
type: "string",
|
|
2262
|
+
required: false,
|
|
2263
|
+
description: "Name attribute for forms"
|
|
2264
|
+
},
|
|
2265
|
+
{
|
|
2266
|
+
name: "value",
|
|
2267
|
+
type: "string",
|
|
2268
|
+
required: false,
|
|
2269
|
+
description: "Value attribute for forms"
|
|
2270
|
+
},
|
|
2271
|
+
{
|
|
2272
|
+
name: "id",
|
|
2273
|
+
type: "string",
|
|
2274
|
+
required: false,
|
|
2275
|
+
description: "Element ID for label association"
|
|
2276
|
+
},
|
|
2277
|
+
{
|
|
2278
|
+
name: "class",
|
|
2279
|
+
type: "string",
|
|
2280
|
+
required: false,
|
|
2281
|
+
description: "Additional CSS classes"
|
|
2282
|
+
},
|
|
2283
|
+
{
|
|
2284
|
+
name: "onCheckedChange",
|
|
2285
|
+
type: "(checked: boolean) => void",
|
|
2286
|
+
required: false,
|
|
2287
|
+
description: "Callback when checked state changes"
|
|
2288
|
+
}
|
|
2289
|
+
],
|
|
2290
|
+
variants: [],
|
|
2291
|
+
slots: [
|
|
2292
|
+
{
|
|
2293
|
+
name: "children",
|
|
2294
|
+
description: "Main content",
|
|
2295
|
+
required: false
|
|
2296
|
+
}
|
|
2297
|
+
],
|
|
2298
|
+
events: [],
|
|
2299
|
+
examples: [
|
|
2300
|
+
{
|
|
2301
|
+
title: "Basic Usage",
|
|
2302
|
+
code: "<script>\n let checked = $state(false);\n</script>\n\n<Checkbox bind:checked />"
|
|
2303
|
+
},
|
|
2304
|
+
{
|
|
2305
|
+
title: "Checked",
|
|
2306
|
+
code: "<Checkbox checked />"
|
|
2307
|
+
},
|
|
2308
|
+
{
|
|
2309
|
+
title: "Disabled",
|
|
2310
|
+
code: "<Checkbox disabled />\n<Checkbox disabled checked />"
|
|
2311
|
+
},
|
|
2312
|
+
{
|
|
2313
|
+
title: "Required",
|
|
2314
|
+
code: '<Checkbox required id="required-checkbox" />'
|
|
2315
|
+
},
|
|
2316
|
+
{
|
|
2317
|
+
title: "Terms Agreement",
|
|
2318
|
+
code: '<script>\n let agreed = $state(false);\n</script>\n\n<div class="flex items-start gap-2">\n <Checkbox id="agree" bind:checked={agreed} class="mt-1" />\n <Label for="agree" class="leading-normal">\n I agree to the <a href="/terms" class="text-primary underline">Terms of Service</a>\n and <a href="/privacy" class="text-primary underline">Privacy Policy</a>\n </Label>\n</div>\n\n<Button disabled={!agreed}>Continue</Button>'
|
|
2319
|
+
},
|
|
2320
|
+
{
|
|
2321
|
+
title: "Feature Selection",
|
|
2322
|
+
code: `<script>
|
|
2323
|
+
let features = $state(['basic']);
|
|
2324
|
+
|
|
2325
|
+
function toggleFeature(feature: string) {
|
|
2326
|
+
if (features.includes(feature)) {
|
|
2327
|
+
features = features.filter((f) => f !== feature);
|
|
2328
|
+
} else {
|
|
2329
|
+
features = [...features, feature];
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
</script>
|
|
2333
|
+
|
|
2334
|
+
<div class="space-y-2">
|
|
2335
|
+
<div class="flex items-center gap-2">
|
|
2336
|
+
<Checkbox
|
|
2337
|
+
id="basic"
|
|
2338
|
+
checked={features.includes('basic')}
|
|
2339
|
+
onCheckedChange={() => toggleFeature('basic')}
|
|
2340
|
+
/>
|
|
2341
|
+
<Label for="basic">Basic features</Label>
|
|
2342
|
+
</div>
|
|
1214
2343
|
<div class="flex items-center gap-2">
|
|
1215
2344
|
<Checkbox
|
|
1216
2345
|
id="advanced"
|
|
@@ -1230,106 +2359,785 @@ var component_catalog_default = {
|
|
|
1230
2359
|
</div>`
|
|
1231
2360
|
},
|
|
1232
2361
|
{
|
|
1233
|
-
title: "Form Submission",
|
|
1234
|
-
code: '<form onsubmit={handleSubmit}>\n <Checkbox name="newsletter" value="subscribed" />\n <button type="submit">Submit</button>\n</form>'
|
|
2362
|
+
title: "Form Submission",
|
|
2363
|
+
code: '<form onsubmit={handleSubmit}>\n <Checkbox name="newsletter" value="subscribed" />\n <button type="submit">Submit</button>\n</form>'
|
|
2364
|
+
}
|
|
2365
|
+
],
|
|
2366
|
+
relatedComponents: [
|
|
2367
|
+
"Switch",
|
|
2368
|
+
"RadioGroup",
|
|
2369
|
+
"Label"
|
|
2370
|
+
]
|
|
2371
|
+
},
|
|
2372
|
+
{
|
|
2373
|
+
name: "Combobox",
|
|
2374
|
+
description: "Searchable select with async loading support",
|
|
2375
|
+
category: "form",
|
|
2376
|
+
importPath: "@classic-homes/theme-svelte",
|
|
2377
|
+
props: [
|
|
2378
|
+
{
|
|
2379
|
+
name: "value",
|
|
2380
|
+
type: "string",
|
|
2381
|
+
default: "''",
|
|
2382
|
+
required: false,
|
|
2383
|
+
description: "Current selected value (bindable)"
|
|
2384
|
+
},
|
|
2385
|
+
{
|
|
2386
|
+
name: "options",
|
|
2387
|
+
type: "SelectOption[]",
|
|
2388
|
+
default: "Required",
|
|
2389
|
+
required: false,
|
|
2390
|
+
description: "Array of options"
|
|
2391
|
+
},
|
|
2392
|
+
{
|
|
2393
|
+
name: "placeholder",
|
|
2394
|
+
type: "string",
|
|
2395
|
+
required: false,
|
|
2396
|
+
description: "Placeholder text"
|
|
2397
|
+
},
|
|
2398
|
+
{
|
|
2399
|
+
name: "emptyMessage",
|
|
2400
|
+
type: "string",
|
|
2401
|
+
default: "'No results found.'",
|
|
2402
|
+
required: false,
|
|
2403
|
+
description: "Message when no options match"
|
|
2404
|
+
},
|
|
2405
|
+
{
|
|
2406
|
+
name: "disabled",
|
|
2407
|
+
type: "boolean",
|
|
2408
|
+
default: "false",
|
|
2409
|
+
required: false,
|
|
2410
|
+
description: "Disables the combobox"
|
|
2411
|
+
},
|
|
2412
|
+
{
|
|
2413
|
+
name: "required",
|
|
2414
|
+
type: "boolean",
|
|
2415
|
+
default: "false",
|
|
2416
|
+
required: false,
|
|
2417
|
+
description: "Marks as required"
|
|
2418
|
+
},
|
|
2419
|
+
{
|
|
2420
|
+
name: "name",
|
|
2421
|
+
type: "string",
|
|
2422
|
+
required: false,
|
|
2423
|
+
description: "Name attribute for forms"
|
|
2424
|
+
},
|
|
2425
|
+
{
|
|
2426
|
+
name: "id",
|
|
2427
|
+
type: "string",
|
|
2428
|
+
required: false,
|
|
2429
|
+
description: "Element ID"
|
|
2430
|
+
},
|
|
2431
|
+
{
|
|
2432
|
+
name: "error",
|
|
2433
|
+
type: "string",
|
|
2434
|
+
required: false,
|
|
2435
|
+
description: "Error message"
|
|
2436
|
+
},
|
|
2437
|
+
{
|
|
2438
|
+
name: "loading",
|
|
2439
|
+
type: "boolean",
|
|
2440
|
+
default: "false",
|
|
2441
|
+
required: false,
|
|
2442
|
+
description: "Shows loading state"
|
|
2443
|
+
},
|
|
2444
|
+
{
|
|
2445
|
+
name: "debounceMs",
|
|
2446
|
+
type: "number",
|
|
2447
|
+
default: "300",
|
|
2448
|
+
required: false,
|
|
2449
|
+
description: "Debounce time for search"
|
|
2450
|
+
},
|
|
2451
|
+
{
|
|
2452
|
+
name: "onValueChange",
|
|
2453
|
+
type: "(value: string) => void",
|
|
2454
|
+
required: false,
|
|
2455
|
+
description: "Callback when value changes"
|
|
2456
|
+
},
|
|
2457
|
+
{
|
|
2458
|
+
name: "onSearch",
|
|
2459
|
+
type: "(query: string) => void",
|
|
2460
|
+
required: false,
|
|
2461
|
+
description: "Callback for search queries"
|
|
2462
|
+
}
|
|
2463
|
+
],
|
|
2464
|
+
variants: [],
|
|
2465
|
+
slots: [
|
|
2466
|
+
{
|
|
2467
|
+
name: "children",
|
|
2468
|
+
description: "Main content",
|
|
2469
|
+
required: false
|
|
2470
|
+
}
|
|
2471
|
+
],
|
|
2472
|
+
events: [],
|
|
2473
|
+
examples: [
|
|
2474
|
+
{
|
|
2475
|
+
title: "Basic Usage",
|
|
2476
|
+
code: `<script>
|
|
2477
|
+
let value = $state('');
|
|
2478
|
+
|
|
2479
|
+
const options = [
|
|
2480
|
+
{ value: 'apple', label: 'Apple' },
|
|
2481
|
+
{ value: 'banana', label: 'Banana' },
|
|
2482
|
+
{ value: 'orange', label: 'Orange' },
|
|
2483
|
+
];
|
|
2484
|
+
</script>
|
|
2485
|
+
|
|
2486
|
+
<Combobox {options} bind:value placeholder="Select a fruit..." />`
|
|
2487
|
+
},
|
|
2488
|
+
{
|
|
2489
|
+
title: "User Search",
|
|
2490
|
+
code: '<script>\n let selectedUser = $state(\'\');\n let users = $state([]);\n let loading = $state(false);\n\n async function searchUsers(query: string) {\n if (!query) {\n users = [];\n return;\n }\n loading = true;\n const response = await fetch(`/api/users?search=${query}`);\n users = await response.json();\n loading = false;\n }\n</script>\n\n<Combobox\n options={users}\n bind:value={selectedUser}\n onSearch={searchUsers}\n {loading}\n placeholder="Search users..."\n emptyMessage="No users found"\n/>'
|
|
2491
|
+
},
|
|
2492
|
+
{
|
|
2493
|
+
title: "Location Autocomplete",
|
|
2494
|
+
code: '<Combobox\n options={locations}\n bind:value\n onSearch={searchLocations}\n placeholder="Enter city or zip code..."\n emptyMessage="No locations found"\n/>'
|
|
2495
|
+
}
|
|
2496
|
+
],
|
|
2497
|
+
relatedComponents: [
|
|
2498
|
+
"Select",
|
|
2499
|
+
"MultiSelect"
|
|
2500
|
+
]
|
|
2501
|
+
},
|
|
2502
|
+
{
|
|
2503
|
+
name: "DashboardLayout",
|
|
2504
|
+
description: "Complete dashboard layout with responsive sidebar and header",
|
|
2505
|
+
category: "layout",
|
|
2506
|
+
importPath: "@classic-homes/theme-svelte",
|
|
2507
|
+
props: [
|
|
2508
|
+
{
|
|
2509
|
+
name: "navigation",
|
|
2510
|
+
type: "NavSection[]",
|
|
2511
|
+
required: false,
|
|
2512
|
+
description: "Navigation sections for sidebar"
|
|
2513
|
+
},
|
|
2514
|
+
{
|
|
2515
|
+
name: "user",
|
|
2516
|
+
type: "User",
|
|
2517
|
+
required: false,
|
|
2518
|
+
description: "Current user data"
|
|
2519
|
+
},
|
|
2520
|
+
{
|
|
2521
|
+
name: "appName",
|
|
2522
|
+
type: "string",
|
|
2523
|
+
default: "'Dashboard'",
|
|
2524
|
+
required: false,
|
|
2525
|
+
description: "Application name"
|
|
2526
|
+
},
|
|
2527
|
+
{
|
|
2528
|
+
name: "pageTitle",
|
|
2529
|
+
type: "string",
|
|
2530
|
+
required: false,
|
|
2531
|
+
description: "Page title in header"
|
|
2532
|
+
},
|
|
2533
|
+
{
|
|
2534
|
+
name: "backLink",
|
|
2535
|
+
type: "BackLink",
|
|
2536
|
+
required: false,
|
|
2537
|
+
description: "Back link at top of navigation"
|
|
2538
|
+
},
|
|
2539
|
+
{
|
|
2540
|
+
name: "sidebarVariant",
|
|
2541
|
+
type: "'light' | 'dark'",
|
|
2542
|
+
default: "'light'",
|
|
2543
|
+
required: false,
|
|
2544
|
+
description: "Sidebar visual variant"
|
|
2545
|
+
},
|
|
2546
|
+
{
|
|
2547
|
+
name: "sidebarCollapsed",
|
|
2548
|
+
type: "boolean",
|
|
2549
|
+
default: "false",
|
|
2550
|
+
required: false,
|
|
2551
|
+
description: "Initial collapsed state"
|
|
2552
|
+
},
|
|
2553
|
+
{
|
|
2554
|
+
name: "showHeader",
|
|
2555
|
+
type: "boolean",
|
|
2556
|
+
default: "true",
|
|
2557
|
+
required: false,
|
|
2558
|
+
description: "Whether to show header"
|
|
2559
|
+
},
|
|
2560
|
+
{
|
|
2561
|
+
name: "logo",
|
|
2562
|
+
type: "Snippet",
|
|
2563
|
+
required: false,
|
|
2564
|
+
description: "Custom logo"
|
|
2565
|
+
},
|
|
2566
|
+
{
|
|
2567
|
+
name: "icon",
|
|
2568
|
+
type: "Snippet<[NavItem]>",
|
|
2569
|
+
required: false,
|
|
2570
|
+
description: "Custom icon renderer"
|
|
2571
|
+
},
|
|
2572
|
+
{
|
|
2573
|
+
name: "quickLinks",
|
|
2574
|
+
type: "QuickLink[]",
|
|
2575
|
+
required: false,
|
|
2576
|
+
description: "Quick links at bottom"
|
|
2577
|
+
},
|
|
2578
|
+
{
|
|
2579
|
+
name: "quickLinksDisplay",
|
|
2580
|
+
type: "'list' | 'icons'",
|
|
2581
|
+
default: "'list'",
|
|
2582
|
+
required: false,
|
|
2583
|
+
description: "Quick links display mode"
|
|
2584
|
+
},
|
|
2585
|
+
{
|
|
2586
|
+
name: "onNavigate",
|
|
2587
|
+
type: "(item: NavItem) => void",
|
|
2588
|
+
required: false,
|
|
2589
|
+
description: "Navigation callback"
|
|
2590
|
+
},
|
|
2591
|
+
{
|
|
2592
|
+
name: "headerStart",
|
|
2593
|
+
type: "Snippet",
|
|
2594
|
+
required: false,
|
|
2595
|
+
description: "Content after toggle button"
|
|
2596
|
+
},
|
|
2597
|
+
{
|
|
2598
|
+
name: "headerEnd",
|
|
2599
|
+
type: "Snippet",
|
|
2600
|
+
required: false,
|
|
2601
|
+
description: "Content at end of header"
|
|
2602
|
+
},
|
|
2603
|
+
{
|
|
2604
|
+
name: "userMenu",
|
|
2605
|
+
type: "Snippet<[User]>",
|
|
2606
|
+
required: false,
|
|
2607
|
+
description: "Custom user menu"
|
|
2608
|
+
},
|
|
2609
|
+
{
|
|
2610
|
+
name: "sidebarFooter",
|
|
2611
|
+
type: "Snippet",
|
|
2612
|
+
required: false,
|
|
2613
|
+
description: "Sidebar footer content"
|
|
2614
|
+
},
|
|
2615
|
+
{
|
|
2616
|
+
name: "expandedWidth",
|
|
2617
|
+
type: "number",
|
|
2618
|
+
default: "256",
|
|
2619
|
+
required: false,
|
|
2620
|
+
description: "Expanded sidebar width (px)"
|
|
2621
|
+
},
|
|
2622
|
+
{
|
|
2623
|
+
name: "collapsedWidth",
|
|
2624
|
+
type: "number",
|
|
2625
|
+
default: "64",
|
|
2626
|
+
required: false,
|
|
2627
|
+
description: "Collapsed sidebar width (px)"
|
|
2628
|
+
},
|
|
2629
|
+
{
|
|
2630
|
+
name: "searchable",
|
|
2631
|
+
type: "boolean",
|
|
2632
|
+
default: "false",
|
|
2633
|
+
required: false,
|
|
2634
|
+
description: "Enable navigation search"
|
|
2635
|
+
},
|
|
2636
|
+
{
|
|
2637
|
+
name: "searchPlaceholder",
|
|
2638
|
+
type: "string",
|
|
2639
|
+
default: "'Search...'",
|
|
2640
|
+
required: false,
|
|
2641
|
+
description: "Search input placeholder"
|
|
2642
|
+
},
|
|
2643
|
+
{
|
|
2644
|
+
name: "headerSearch",
|
|
2645
|
+
type: "HeaderSearchConfig",
|
|
2646
|
+
required: false,
|
|
2647
|
+
description: "Header search configuration"
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
name: "mobileBreakpoint",
|
|
2651
|
+
type: "'sm' | 'md' | 'lg'",
|
|
2652
|
+
default: "'lg'",
|
|
2653
|
+
required: false,
|
|
2654
|
+
description: "Mobile/desktop breakpoint"
|
|
2655
|
+
},
|
|
2656
|
+
{
|
|
2657
|
+
name: "children",
|
|
2658
|
+
type: "Snippet",
|
|
2659
|
+
required: false,
|
|
2660
|
+
description: "Main content"
|
|
2661
|
+
}
|
|
2662
|
+
],
|
|
2663
|
+
variants: [
|
|
2664
|
+
{
|
|
2665
|
+
name: "sidebarVariant",
|
|
2666
|
+
values: [
|
|
2667
|
+
"light",
|
|
2668
|
+
"dark"
|
|
2669
|
+
],
|
|
2670
|
+
default: "light"
|
|
2671
|
+
},
|
|
2672
|
+
{
|
|
2673
|
+
name: "quickLinksDisplay",
|
|
2674
|
+
values: [
|
|
2675
|
+
"list",
|
|
2676
|
+
"icons"
|
|
2677
|
+
],
|
|
2678
|
+
default: "list"
|
|
2679
|
+
},
|
|
2680
|
+
{
|
|
2681
|
+
name: "mobileBreakpoint",
|
|
2682
|
+
values: [
|
|
2683
|
+
"sm",
|
|
2684
|
+
"md",
|
|
2685
|
+
"lg"
|
|
2686
|
+
],
|
|
2687
|
+
default: "lg"
|
|
2688
|
+
}
|
|
2689
|
+
],
|
|
2690
|
+
slots: [
|
|
2691
|
+
{
|
|
2692
|
+
name: "children",
|
|
2693
|
+
description: "Main content",
|
|
2694
|
+
required: false
|
|
2695
|
+
}
|
|
2696
|
+
],
|
|
2697
|
+
events: [],
|
|
2698
|
+
examples: [
|
|
2699
|
+
{
|
|
2700
|
+
title: "Basic Usage",
|
|
2701
|
+
code: "<script>\n const navigation = [\n {\n id: 'main',\n title: 'Main',\n items: [\n { id: 'dashboard', name: 'Dashboard', href: '/dashboard', icon: 'home' },\n { id: 'projects', name: 'Projects', href: '/projects', icon: 'folder' },\n ],\n },\n ];\n</script>\n\n<DashboardLayout {navigation}>\n <h1>Dashboard Content</h1>\n</DashboardLayout>"
|
|
1235
2702
|
}
|
|
1236
2703
|
],
|
|
1237
2704
|
relatedComponents: [
|
|
1238
|
-
"
|
|
1239
|
-
"
|
|
1240
|
-
"
|
|
2705
|
+
"Sidebar",
|
|
2706
|
+
"Header",
|
|
2707
|
+
"AppShell"
|
|
1241
2708
|
]
|
|
1242
2709
|
},
|
|
1243
2710
|
{
|
|
1244
|
-
name: "
|
|
1245
|
-
description: "
|
|
1246
|
-
category: "
|
|
2711
|
+
name: "DataTable",
|
|
2712
|
+
description: "Powerful data table with TanStack Table - sorting, filtering, pagination, virtualization, and inline editing",
|
|
2713
|
+
category: "data",
|
|
1247
2714
|
importPath: "@classic-homes/theme-svelte",
|
|
1248
2715
|
props: [
|
|
1249
2716
|
{
|
|
1250
|
-
name: "
|
|
2717
|
+
name: "data",
|
|
2718
|
+
type: "T[]",
|
|
2719
|
+
required: false,
|
|
2720
|
+
description: "Array of data rows"
|
|
2721
|
+
},
|
|
2722
|
+
{
|
|
2723
|
+
name: "columns",
|
|
2724
|
+
type: "DataTableColumn<T>[]",
|
|
2725
|
+
required: false,
|
|
2726
|
+
description: "Column definitions"
|
|
2727
|
+
},
|
|
2728
|
+
{
|
|
2729
|
+
name: "loading",
|
|
2730
|
+
type: "boolean",
|
|
2731
|
+
default: "false",
|
|
2732
|
+
required: false,
|
|
2733
|
+
description: "Show loading state"
|
|
2734
|
+
},
|
|
2735
|
+
{
|
|
2736
|
+
name: "loadingRows",
|
|
2737
|
+
type: "number",
|
|
2738
|
+
default: "5",
|
|
2739
|
+
required: false,
|
|
2740
|
+
description: "Number of skeleton rows"
|
|
2741
|
+
},
|
|
2742
|
+
{
|
|
2743
|
+
name: "emptyMessage",
|
|
1251
2744
|
type: "string",
|
|
1252
|
-
default: "''",
|
|
2745
|
+
default: "'No data available'",
|
|
1253
2746
|
required: false,
|
|
1254
|
-
description: "
|
|
2747
|
+
description: "Empty state message"
|
|
1255
2748
|
},
|
|
1256
2749
|
{
|
|
1257
|
-
name: "
|
|
1258
|
-
type: "
|
|
1259
|
-
default: "Required",
|
|
2750
|
+
name: "sortColumn",
|
|
2751
|
+
type: "string",
|
|
1260
2752
|
required: false,
|
|
1261
|
-
description: "
|
|
2753
|
+
description: "Current sort column ID (bindable)"
|
|
2754
|
+
},
|
|
2755
|
+
{
|
|
2756
|
+
name: "sortDirection",
|
|
2757
|
+
type: "'asc' | 'desc'",
|
|
2758
|
+
default: "'asc'",
|
|
2759
|
+
required: false,
|
|
2760
|
+
description: "Sort direction (bindable)"
|
|
2761
|
+
},
|
|
2762
|
+
{
|
|
2763
|
+
name: "onSort",
|
|
2764
|
+
type: "(column: string, direction: 'asc' | 'desc') => void",
|
|
2765
|
+
required: false,
|
|
2766
|
+
description: "Sort callback"
|
|
2767
|
+
},
|
|
2768
|
+
{
|
|
2769
|
+
name: "onRowClick",
|
|
2770
|
+
type: "(row: T) => void",
|
|
2771
|
+
required: false,
|
|
2772
|
+
description: "Row click callback"
|
|
2773
|
+
},
|
|
2774
|
+
{
|
|
2775
|
+
name: "caption",
|
|
2776
|
+
type: "string",
|
|
2777
|
+
required: false,
|
|
2778
|
+
description: "Accessible caption"
|
|
2779
|
+
},
|
|
2780
|
+
{
|
|
2781
|
+
name: "row",
|
|
2782
|
+
type: "Snippet<[T, number]>",
|
|
2783
|
+
required: false,
|
|
2784
|
+
description: "Custom row renderer"
|
|
2785
|
+
},
|
|
2786
|
+
{
|
|
2787
|
+
name: "class",
|
|
2788
|
+
type: "string",
|
|
2789
|
+
required: false,
|
|
2790
|
+
description: "Additional classes"
|
|
2791
|
+
}
|
|
2792
|
+
],
|
|
2793
|
+
variants: [
|
|
2794
|
+
{
|
|
2795
|
+
name: "sortDirection",
|
|
2796
|
+
values: [
|
|
2797
|
+
"asc",
|
|
2798
|
+
"desc"
|
|
2799
|
+
],
|
|
2800
|
+
default: "asc"
|
|
2801
|
+
},
|
|
2802
|
+
{
|
|
2803
|
+
name: "onSort",
|
|
2804
|
+
values: [
|
|
2805
|
+
"asc",
|
|
2806
|
+
"desc"
|
|
2807
|
+
]
|
|
2808
|
+
}
|
|
2809
|
+
],
|
|
2810
|
+
slots: [
|
|
2811
|
+
{
|
|
2812
|
+
name: "children",
|
|
2813
|
+
description: "Main content",
|
|
2814
|
+
required: false
|
|
2815
|
+
}
|
|
2816
|
+
],
|
|
2817
|
+
events: [],
|
|
2818
|
+
examples: [
|
|
2819
|
+
{
|
|
2820
|
+
title: "Creating a TanStack Table",
|
|
2821
|
+
code: `<script lang="ts">
|
|
2822
|
+
import {
|
|
2823
|
+
createDataTable,
|
|
2824
|
+
type ColumnDef,
|
|
2825
|
+
type SortingState,
|
|
2826
|
+
type RowSelectionState,
|
|
2827
|
+
} from '@classic-homes/theme-svelte';
|
|
2828
|
+
|
|
2829
|
+
interface User {
|
|
2830
|
+
id: number;
|
|
2831
|
+
name: string;
|
|
2832
|
+
email: string;
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2835
|
+
// State
|
|
2836
|
+
let sorting = $state<SortingState>([]);
|
|
2837
|
+
let rowSelection = $state<RowSelectionState>({});
|
|
2838
|
+
|
|
2839
|
+
// Column definitions (TanStack Table format)
|
|
2840
|
+
const columns: ColumnDef<User>[] = [
|
|
2841
|
+
{ accessorKey: 'id', header: 'ID' },
|
|
2842
|
+
{ accessorKey: 'name', header: 'Name' },
|
|
2843
|
+
{ accessorKey: 'email', header: 'Email' },
|
|
2844
|
+
];
|
|
2845
|
+
|
|
2846
|
+
// Create table instance
|
|
2847
|
+
const tableApi = createDataTable<User>(() => ({
|
|
2848
|
+
data: users,
|
|
2849
|
+
columns,
|
|
2850
|
+
state: { sorting, rowSelection },
|
|
2851
|
+
onSortingChange: (updater) => {
|
|
2852
|
+
sorting = typeof updater === 'function' ? updater(sorting) : updater;
|
|
2853
|
+
},
|
|
2854
|
+
onRowSelectionChange: (updater) => {
|
|
2855
|
+
rowSelection = typeof updater === 'function' ? updater(rowSelection) : updater;
|
|
2856
|
+
},
|
|
2857
|
+
enableRowSelection: true,
|
|
2858
|
+
enableSorting: true,
|
|
2859
|
+
}));
|
|
2860
|
+
|
|
2861
|
+
const table = $derived(tableApi.instance);
|
|
2862
|
+
</script>`
|
|
2863
|
+
},
|
|
2864
|
+
{
|
|
2865
|
+
title: "Row Selection",
|
|
2866
|
+
description: "Enable checkbox selection for rows:",
|
|
2867
|
+
code: "<script>\n let rowSelection = $state<RowSelectionState>({});\n\n const tableApi = createDataTable<User>(() => ({\n data: users,\n columns,\n state: { rowSelection },\n onRowSelectionChange: (updater) => {\n rowSelection = typeof updater === 'function' ? updater(rowSelection) : updater;\n },\n enableRowSelection: true,\n enableMultiRowSelection: true, // Allow multiple selections\n }));\n</script>\n\n<!-- Render checkbox in header -->\n<th>\n <Checkbox\n checked={table.getIsAllRowsSelected()}\n indeterminate={table.getIsSomeRowsSelected()}\n onCheckedChange={(checked) => table.toggleAllRowsSelected(!!checked)}\n />\n</th>\n\n<!-- Render checkbox in each row -->\n{#each table.getRowModel().rows as row}\n <td>\n <Checkbox\n checked={row.getIsSelected()}\n onCheckedChange={(checked) => row.toggleSelected(!!checked)}\n />\n </td>\n{/each}"
|
|
2868
|
+
},
|
|
2869
|
+
{
|
|
2870
|
+
title: "Column Visibility",
|
|
2871
|
+
description: "Allow users to toggle column visibility:",
|
|
2872
|
+
code: "<script>\n let columnVisibility = $state<VisibilityState>({});\n\n const tableApi = createDataTable<User>(() => ({\n data: users,\n columns,\n state: { columnVisibility },\n onColumnVisibilityChange: (updater) => {\n columnVisibility = typeof updater === 'function' ? updater(columnVisibility) : updater;\n },\n enableHiding: true,\n }));\n</script>\n\n<!-- Use DataTableToolbar for built-in column visibility dropdown -->\n<DataTableToolbar {table} visibilityState={columnVisibility} />"
|
|
2873
|
+
},
|
|
2874
|
+
{
|
|
2875
|
+
title: "Global Search",
|
|
2876
|
+
description: "Filter across all columns:",
|
|
2877
|
+
code: "<script>\n let globalFilter = $state('');\n\n const tableApi = createDataTable<User>(() => ({\n data: users,\n columns,\n state: { globalFilter },\n onGlobalFilterChange: (updater) => {\n globalFilter = typeof updater === 'function' ? updater(globalFilter) : updater;\n },\n enableGlobalFilter: true,\n }));\n</script>\n\n<!-- DataTableToolbar includes a search input -->\n<DataTableToolbar {table} />"
|
|
2878
|
+
},
|
|
2879
|
+
{
|
|
2880
|
+
title: "Column Filters",
|
|
2881
|
+
description: "Filter individual columns with faceted filtering:",
|
|
2882
|
+
code: "<script>\n let columnFilters = $state<ColumnFiltersState>([]);\n\n const columns: ColumnDef<User>[] = [\n {\n accessorKey: 'role',\n header: 'Role',\n meta: {\n filterOptions: [\n { value: 'Admin', label: 'Admin' },\n { value: 'Editor', label: 'Editor' },\n { value: 'Viewer', label: 'Viewer' },\n ],\n },\n },\n ];\n\n const tableApi = createDataTable<User>(() => ({\n data: users,\n columns,\n state: { columnFilters },\n onColumnFiltersChange: (updater) => {\n columnFilters = typeof updater === 'function' ? updater(columnFilters) : updater;\n },\n enableColumnFilters: true,\n }));\n</script>\n\n<!-- DataTableToolbar renders filter badges for columns with filterOptions -->\n<DataTableToolbar {table} />"
|
|
2883
|
+
},
|
|
2884
|
+
{
|
|
2885
|
+
title: "Pagination",
|
|
2886
|
+
description: "Add pagination controls:",
|
|
2887
|
+
code: "<script>\n const tableApi = createDataTable<User>(() => ({\n data: users,\n columns,\n // Pagination is enabled by default\n }));\n</script>\n\n<!-- Table content -->\n<table>...</table>\n\n<!-- Pagination controls -->\n<DataTablePagination {table} />"
|
|
2888
|
+
},
|
|
2889
|
+
{
|
|
2890
|
+
title: "Virtualization",
|
|
2891
|
+
description: "Render thousands of rows efficiently:",
|
|
2892
|
+
code: '<script>\n const tableApi = createDataTable<User>(() => ({\n data: largeDataset, // 10,000+ rows\n columns,\n manualPagination: true, // Disable pagination for virtualization\n }));\n</script>\n\n<DataTableVirtual\n table={tableApi.instance}\n rowHeight={48}\n overscan={10}\n height="500px"\n onRowClick={(row) => console.log(row)}\n/>'
|
|
2893
|
+
},
|
|
2894
|
+
{
|
|
2895
|
+
title: "Inline Editing",
|
|
2896
|
+
description: "Enable double-click cell editing:",
|
|
2897
|
+
code: "<script>\n function handleCellEdit(rowId: string, columnId: string, value: unknown, row: User) {\n // Update your data source\n const index = users.findIndex((u) => u.id === row.id);\n if (index !== -1) {\n users[index] = { ...users[index], [columnId]: value };\n }\n }\n</script>\n\n{#each table.getRowModel().rows as row}\n <tr>\n {#each row.getVisibleCells() as cell}\n <td>\n <DataTableEditableCell {cell} row={row.original} onSave={handleCellEdit} />\n </td>\n {/each}\n </tr>\n{/each}"
|
|
2898
|
+
},
|
|
2899
|
+
{
|
|
2900
|
+
title: "User Management Table",
|
|
2901
|
+
code: "<script>\n const columns = [\n { id: 'name', header: 'Name', accessor: 'name', sortable: true },\n { id: 'email', header: 'Email', accessor: 'email', sortable: true },\n { id: 'role', header: 'Role', accessor: 'role' },\n {\n id: 'joined',\n header: 'Joined',\n accessor: 'createdAt',\n sortable: true,\n format: (v) => new Date(v).toLocaleDateString(),\n },\n ];\n</script>\n\n<DataTable\n data={users}\n {columns}\n caption=\"User management table\"\n onRowClick={(user) => goto(`/users/${user.id}`)}\n/>"
|
|
2902
|
+
},
|
|
2903
|
+
{
|
|
2904
|
+
title: "Product Inventory",
|
|
2905
|
+
code: "<script>\n const columns = [\n { id: 'sku', header: 'SKU', accessor: 'sku', width: '120px' },\n { id: 'name', header: 'Product', accessor: 'name', sortable: true },\n {\n id: 'stock',\n header: 'Stock',\n accessor: 'quantity',\n align: 'right',\n sortable: true,\n },\n {\n id: 'price',\n header: 'Price',\n accessor: 'price',\n align: 'right',\n format: (v) => `$${v.toFixed(2)}`,\n },\n ];\n</script>\n\n<DataTable data={products} {columns} emptyMessage=\"No products found\" />"
|
|
2906
|
+
}
|
|
2907
|
+
],
|
|
2908
|
+
relatedComponents: [
|
|
2909
|
+
"Skeleton",
|
|
2910
|
+
"Badge",
|
|
2911
|
+
"Button",
|
|
2912
|
+
"Checkbox"
|
|
2913
|
+
]
|
|
2914
|
+
},
|
|
2915
|
+
{
|
|
2916
|
+
name: "DataTableColumnFilter",
|
|
2917
|
+
description: "Per-column text filter input for filtering individual columns in data tables",
|
|
2918
|
+
category: "data",
|
|
2919
|
+
importPath: "@classic-homes/theme-svelte",
|
|
2920
|
+
props: [
|
|
2921
|
+
{
|
|
2922
|
+
name: "column",
|
|
2923
|
+
type: "Column<T, unknown>",
|
|
2924
|
+
default: "**required**",
|
|
2925
|
+
required: false,
|
|
2926
|
+
description: "The TanStack Table column to filter"
|
|
1262
2927
|
},
|
|
1263
2928
|
{
|
|
1264
2929
|
name: "placeholder",
|
|
1265
2930
|
type: "string",
|
|
2931
|
+
default: "'Filter {columnName}...'",
|
|
1266
2932
|
required: false,
|
|
1267
|
-
description: "Placeholder text"
|
|
2933
|
+
description: "Placeholder text for the input"
|
|
1268
2934
|
},
|
|
1269
2935
|
{
|
|
1270
|
-
name: "
|
|
2936
|
+
name: "debounceMs",
|
|
2937
|
+
type: "number",
|
|
2938
|
+
default: "300",
|
|
2939
|
+
required: false,
|
|
2940
|
+
description: "Debounce delay in milliseconds"
|
|
2941
|
+
},
|
|
2942
|
+
{
|
|
2943
|
+
name: "class",
|
|
1271
2944
|
type: "string",
|
|
1272
|
-
default: "'No results found.'",
|
|
1273
2945
|
required: false,
|
|
1274
|
-
description: "
|
|
2946
|
+
description: "Additional CSS classes"
|
|
2947
|
+
}
|
|
2948
|
+
],
|
|
2949
|
+
variants: [],
|
|
2950
|
+
slots: [
|
|
2951
|
+
{
|
|
2952
|
+
name: "children",
|
|
2953
|
+
description: "Main content",
|
|
2954
|
+
required: false
|
|
2955
|
+
}
|
|
2956
|
+
],
|
|
2957
|
+
events: [],
|
|
2958
|
+
examples: [
|
|
2959
|
+
{
|
|
2960
|
+
title: "Basic Usage",
|
|
2961
|
+
code: "<script>\n import { createDataTable, DataTableColumnFilter } from '@classic-homes/theme-svelte';\n\n let columnFilters = $state([]);\n\n const tableApi = createDataTable(() => ({\n data: users,\n columns,\n state: { columnFilters },\n onColumnFiltersChange: (updater) => {\n columnFilters = typeof updater === 'function' ? updater(columnFilters) : updater;\n },\n enableColumnFilters: true,\n }));\n\n const table = $derived(tableApi.instance);\n</script>\n\n<!-- Filter for the name column -->\n{#each table.getAllColumns() as column}\n {#if column.getCanFilter()}\n <DataTableColumnFilter {column} />\n {/if}\n{/each}"
|
|
1275
2962
|
},
|
|
1276
2963
|
{
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
2964
|
+
title: "Custom Placeholder",
|
|
2965
|
+
code: '<DataTableColumnFilter {column} placeholder="Search names..." />'
|
|
2966
|
+
},
|
|
2967
|
+
{
|
|
2968
|
+
title: "Faster Debounce",
|
|
2969
|
+
code: "<DataTableColumnFilter {column} debounceMs={150} />"
|
|
2970
|
+
},
|
|
2971
|
+
{
|
|
2972
|
+
title: "In Table Header",
|
|
2973
|
+
code: '<thead>\n <tr>\n {#each table.getHeaderGroups()[0].headers as header}\n <th>\n {header.column.columnDef.header}\n {#if header.column.getCanFilter()}\n <DataTableColumnFilter column={header.column} class="mt-1" />\n {/if}\n </th>\n {/each}\n </tr>\n</thead>'
|
|
2974
|
+
},
|
|
2975
|
+
{
|
|
2976
|
+
title: "Multiple Column Filters",
|
|
2977
|
+
code: '<div class="flex gap-2">\n {#each table.getAllColumns().filter((c) => c.getCanFilter()) as column}\n <DataTableColumnFilter {column} class="w-40" />\n {/each}\n</div>'
|
|
2978
|
+
}
|
|
2979
|
+
],
|
|
2980
|
+
relatedComponents: [
|
|
2981
|
+
"DataTable",
|
|
2982
|
+
"DataTableSearch",
|
|
2983
|
+
"DataTableFacetedFilter"
|
|
2984
|
+
]
|
|
2985
|
+
},
|
|
2986
|
+
{
|
|
2987
|
+
name: "DataTableColumnVisibility",
|
|
2988
|
+
description: "Dropdown component for toggling column visibility in data tables",
|
|
2989
|
+
category: "data",
|
|
2990
|
+
importPath: "@classic-homes/theme-svelte",
|
|
2991
|
+
props: [
|
|
2992
|
+
{
|
|
2993
|
+
name: "table",
|
|
2994
|
+
type: "Table<T>",
|
|
2995
|
+
default: "**required**",
|
|
2996
|
+
required: false,
|
|
2997
|
+
description: "The TanStack Table instance"
|
|
2998
|
+
},
|
|
2999
|
+
{
|
|
3000
|
+
name: "visibilityState",
|
|
3001
|
+
type: "VisibilityState",
|
|
3002
|
+
required: false,
|
|
3003
|
+
description: "Optional visibility state for reactivity"
|
|
3004
|
+
},
|
|
3005
|
+
{
|
|
3006
|
+
name: "class",
|
|
3007
|
+
type: "string",
|
|
3008
|
+
required: false,
|
|
3009
|
+
description: "Additional CSS classes"
|
|
3010
|
+
}
|
|
3011
|
+
],
|
|
3012
|
+
variants: [],
|
|
3013
|
+
slots: [
|
|
3014
|
+
{
|
|
3015
|
+
name: "children",
|
|
3016
|
+
description: "Main content",
|
|
3017
|
+
required: false
|
|
3018
|
+
}
|
|
3019
|
+
],
|
|
3020
|
+
events: [],
|
|
3021
|
+
examples: [
|
|
3022
|
+
{
|
|
3023
|
+
title: "Basic Usage",
|
|
3024
|
+
code: "<script>\n import { createDataTable, DataTableColumnVisibility } from '@classic-homes/theme-svelte';\n\n let columnVisibility = $state({});\n\n const tableApi = createDataTable(() => ({\n data: users,\n columns,\n state: { columnVisibility },\n onColumnVisibilityChange: (updater) => {\n columnVisibility = typeof updater === 'function' ? updater(columnVisibility) : updater;\n },\n enableHiding: true,\n }));\n\n const table = $derived(tableApi.instance);\n</script>\n\n<DataTableColumnVisibility {table} />"
|
|
3025
|
+
},
|
|
3026
|
+
{
|
|
3027
|
+
title: "With Controlled State",
|
|
3028
|
+
description: "Pass the visibility state for full reactivity:",
|
|
3029
|
+
code: "<script>\n let columnVisibility = $state({\n email: false, // Hide email column by default\n phone: false, // Hide phone column by default\n });\n</script>\n\n<DataTableColumnVisibility {table} visibilityState={columnVisibility} />"
|
|
3030
|
+
},
|
|
3031
|
+
{
|
|
3032
|
+
title: "In Toolbar",
|
|
3033
|
+
code: '<div class="flex items-center gap-2">\n <DataTableSearch {table} />\n <DataTableColumnVisibility {table} />\n</div>'
|
|
3034
|
+
},
|
|
3035
|
+
{
|
|
3036
|
+
title: "Hide Specific Columns Initially",
|
|
3037
|
+
code: "<script>\n // Some columns hidden by default\n let columnVisibility = $state({\n createdAt: false,\n updatedAt: false,\n internalId: false,\n });\n\n const tableApi = createDataTable(() => ({\n data,\n columns,\n state: { columnVisibility },\n onColumnVisibilityChange: (updater) => {\n columnVisibility = typeof updater === 'function' ? updater(columnVisibility) : updater;\n },\n enableHiding: true,\n }));\n</script>\n\n<DataTableColumnVisibility {table} visibilityState={columnVisibility} />"
|
|
3038
|
+
}
|
|
3039
|
+
],
|
|
3040
|
+
relatedComponents: [
|
|
3041
|
+
"DataTable",
|
|
3042
|
+
"DataTableToolbar",
|
|
3043
|
+
"DropdownMenu"
|
|
3044
|
+
]
|
|
3045
|
+
},
|
|
3046
|
+
{
|
|
3047
|
+
name: "DataTableEditableCell",
|
|
3048
|
+
description: "Inline editable cell component for data tables with double-click editing",
|
|
3049
|
+
category: "data",
|
|
3050
|
+
importPath: "@classic-homes/theme-svelte",
|
|
3051
|
+
props: [
|
|
3052
|
+
{
|
|
3053
|
+
name: "cell",
|
|
3054
|
+
type: "Cell<T, unknown>",
|
|
3055
|
+
default: "**required**",
|
|
1280
3056
|
required: false,
|
|
1281
|
-
description: "
|
|
3057
|
+
description: "The TanStack Table cell to render"
|
|
1282
3058
|
},
|
|
1283
3059
|
{
|
|
1284
|
-
name: "
|
|
1285
|
-
type: "
|
|
1286
|
-
default: "
|
|
3060
|
+
name: "row",
|
|
3061
|
+
type: "T",
|
|
3062
|
+
default: "**required**",
|
|
1287
3063
|
required: false,
|
|
1288
|
-
description: "
|
|
3064
|
+
description: "The row data object"
|
|
1289
3065
|
},
|
|
1290
3066
|
{
|
|
1291
|
-
name: "
|
|
1292
|
-
type: "string",
|
|
3067
|
+
name: "onSave",
|
|
3068
|
+
type: "(rowId: string, columnId: string, value: unknown, row: T) => void",
|
|
3069
|
+
default: "**required**",
|
|
1293
3070
|
required: false,
|
|
1294
|
-
description: "
|
|
3071
|
+
description: "Callback when cell value is saved"
|
|
1295
3072
|
},
|
|
1296
3073
|
{
|
|
1297
|
-
name: "
|
|
3074
|
+
name: "class",
|
|
1298
3075
|
type: "string",
|
|
1299
3076
|
required: false,
|
|
1300
|
-
description: "
|
|
3077
|
+
description: "Additional CSS classes"
|
|
3078
|
+
}
|
|
3079
|
+
],
|
|
3080
|
+
variants: [],
|
|
3081
|
+
slots: [
|
|
3082
|
+
{
|
|
3083
|
+
name: "children",
|
|
3084
|
+
description: "Main content",
|
|
3085
|
+
required: false
|
|
3086
|
+
}
|
|
3087
|
+
],
|
|
3088
|
+
events: [],
|
|
3089
|
+
examples: [
|
|
3090
|
+
{
|
|
3091
|
+
title: "Basic Usage",
|
|
3092
|
+
code: "<script>\n import { createDataTable, DataTableEditableCell } from '@classic-homes/theme-svelte';\n\n function handleCellEdit(rowId, columnId, value, row) {\n // Update your data source\n const index = users.findIndex((u) => u.id === row.id);\n if (index !== -1) {\n users[index] = { ...users[index], [columnId]: value };\n }\n }\n\n const columns = [\n {\n accessorKey: 'name',\n header: 'Name',\n meta: { enableEditing: true },\n },\n {\n accessorKey: 'email',\n header: 'Email',\n meta: { enableEditing: true },\n },\n ];\n\n const tableApi = createDataTable(() => ({ data: users, columns }));\n const table = $derived(tableApi.instance);\n</script>\n\n{#each table.getRowModel().rows as row}\n <tr>\n {#each row.getVisibleCells() as cell}\n <td>\n <DataTableEditableCell {cell} row={row.original} onSave={handleCellEdit} />\n </td>\n {/each}\n </tr>\n{/each}"
|
|
1301
3093
|
},
|
|
1302
3094
|
{
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
description: "Error message"
|
|
3095
|
+
title: "With Custom Formatting",
|
|
3096
|
+
description: "Cells can have custom display formatting while editing the raw value:",
|
|
3097
|
+
code: "<script>\n const columns = [\n {\n accessorKey: 'price',\n header: 'Price',\n meta: {\n enableEditing: true,\n format: (value) => `$${Number(value).toFixed(2)}`,\n },\n },\n ];\n</script>"
|
|
1307
3098
|
},
|
|
1308
3099
|
{
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
3100
|
+
title: "Async Save Handler",
|
|
3101
|
+
code: "<script>\n async function handleCellEdit(rowId, columnId, value, row) {\n try {\n await api.updateUser(row.id, { [columnId]: value });\n // Update local state after successful save\n users = users.map((u) => (u.id === row.id ? { ...u, [columnId]: value } : u));\n } catch (error) {\n console.error('Failed to save:', error);\n // Optionally show error toast\n }\n }\n</script>"
|
|
3102
|
+
}
|
|
3103
|
+
],
|
|
3104
|
+
relatedComponents: [
|
|
3105
|
+
"DataTable",
|
|
3106
|
+
"FlexRender"
|
|
3107
|
+
]
|
|
3108
|
+
},
|
|
3109
|
+
{
|
|
3110
|
+
name: "DataTableFacetedFilter",
|
|
3111
|
+
description: "Multi-select dropdown filter for categorical columns in data tables",
|
|
3112
|
+
category: "data",
|
|
3113
|
+
importPath: "@classic-homes/theme-svelte",
|
|
3114
|
+
props: [
|
|
3115
|
+
{
|
|
3116
|
+
name: "column",
|
|
3117
|
+
type: "Column<T, unknown>",
|
|
3118
|
+
default: "**required**",
|
|
1312
3119
|
required: false,
|
|
1313
|
-
description: "
|
|
3120
|
+
description: "The TanStack Table column to filter"
|
|
1314
3121
|
},
|
|
1315
3122
|
{
|
|
1316
|
-
name: "
|
|
1317
|
-
type: "
|
|
1318
|
-
default: "
|
|
3123
|
+
name: "title",
|
|
3124
|
+
type: "string",
|
|
3125
|
+
default: "**required**",
|
|
1319
3126
|
required: false,
|
|
1320
|
-
description: "
|
|
3127
|
+
description: "Title displayed on the filter button"
|
|
1321
3128
|
},
|
|
1322
3129
|
{
|
|
1323
|
-
name: "
|
|
1324
|
-
type: "
|
|
3130
|
+
name: "options",
|
|
3131
|
+
type: "FilterOption[]",
|
|
3132
|
+
default: "**required**",
|
|
1325
3133
|
required: false,
|
|
1326
|
-
description: "
|
|
3134
|
+
description: "Available filter options"
|
|
1327
3135
|
},
|
|
1328
3136
|
{
|
|
1329
|
-
name: "
|
|
1330
|
-
type: "
|
|
3137
|
+
name: "class",
|
|
3138
|
+
type: "string",
|
|
1331
3139
|
required: false,
|
|
1332
|
-
description: "
|
|
3140
|
+
description: "Additional CSS classes"
|
|
1333
3141
|
}
|
|
1334
3142
|
],
|
|
1335
3143
|
variants: [],
|
|
@@ -1345,219 +3153,316 @@ var component_catalog_default = {
|
|
|
1345
3153
|
{
|
|
1346
3154
|
title: "Basic Usage",
|
|
1347
3155
|
code: `<script>
|
|
1348
|
-
|
|
3156
|
+
import { createDataTable, DataTableFacetedFilter } from '@classic-homes/theme-svelte';
|
|
1349
3157
|
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
3158
|
+
let columnFilters = $state([]);
|
|
3159
|
+
|
|
3160
|
+
const tableApi = createDataTable(() => ({
|
|
3161
|
+
data: users,
|
|
3162
|
+
columns,
|
|
3163
|
+
state: { columnFilters },
|
|
3164
|
+
onColumnFiltersChange: (updater) => {
|
|
3165
|
+
columnFilters = typeof updater === 'function' ? updater(columnFilters) : updater;
|
|
3166
|
+
},
|
|
3167
|
+
enableColumnFilters: true,
|
|
3168
|
+
}));
|
|
3169
|
+
|
|
3170
|
+
const table = $derived(tableApi.instance);
|
|
3171
|
+
const statusColumn = $derived(table.getColumn('status'));
|
|
1355
3172
|
</script>
|
|
1356
3173
|
|
|
1357
|
-
<
|
|
3174
|
+
<DataTableFacetedFilter
|
|
3175
|
+
column={statusColumn}
|
|
3176
|
+
title="Status"
|
|
3177
|
+
options={[
|
|
3178
|
+
{ value: 'active', label: 'Active' },
|
|
3179
|
+
{ value: 'inactive', label: 'Inactive' },
|
|
3180
|
+
{ value: 'pending', label: 'Pending' },
|
|
3181
|
+
]}
|
|
3182
|
+
/>`
|
|
1358
3183
|
},
|
|
1359
3184
|
{
|
|
1360
|
-
title: "
|
|
1361
|
-
|
|
3185
|
+
title: "With Counts",
|
|
3186
|
+
description: "Display the count of items for each option:",
|
|
3187
|
+
code: `<script>
|
|
3188
|
+
// Calculate counts from your data
|
|
3189
|
+
const statusCounts = $derived.by(() => {
|
|
3190
|
+
const counts = { active: 0, inactive: 0, pending: 0 };
|
|
3191
|
+
users.forEach((u) => counts[u.status]++);
|
|
3192
|
+
return counts;
|
|
3193
|
+
});
|
|
3194
|
+
|
|
3195
|
+
const statusOptions = $derived([
|
|
3196
|
+
{ value: 'active', label: 'Active', count: statusCounts.active },
|
|
3197
|
+
{ value: 'inactive', label: 'Inactive', count: statusCounts.inactive },
|
|
3198
|
+
{ value: 'pending', label: 'Pending', count: statusCounts.pending },
|
|
3199
|
+
]);
|
|
3200
|
+
</script>
|
|
3201
|
+
|
|
3202
|
+
<DataTableFacetedFilter column={statusColumn} title="Status" options={statusOptions} />`
|
|
1362
3203
|
},
|
|
1363
3204
|
{
|
|
1364
|
-
title: "
|
|
1365
|
-
code:
|
|
3205
|
+
title: "Multiple Filters",
|
|
3206
|
+
code: `<div class="flex gap-2">
|
|
3207
|
+
<DataTableFacetedFilter
|
|
3208
|
+
column={table.getColumn('status')}
|
|
3209
|
+
title="Status"
|
|
3210
|
+
options={statusOptions}
|
|
3211
|
+
/>
|
|
3212
|
+
<DataTableFacetedFilter column={table.getColumn('role')} title="Role" options={roleOptions} />
|
|
3213
|
+
<DataTableFacetedFilter
|
|
3214
|
+
column={table.getColumn('department')}
|
|
3215
|
+
title="Department"
|
|
3216
|
+
options={departmentOptions}
|
|
3217
|
+
/>
|
|
3218
|
+
</div>`
|
|
3219
|
+
},
|
|
3220
|
+
{
|
|
3221
|
+
title: "In DataTableToolbar",
|
|
3222
|
+
code: `<DataTableToolbar {table}>
|
|
3223
|
+
{#snippet filters()}
|
|
3224
|
+
<DataTableFacetedFilter
|
|
3225
|
+
column={table.getColumn('status')}
|
|
3226
|
+
title="Status"
|
|
3227
|
+
options={statusOptions}
|
|
3228
|
+
/>
|
|
3229
|
+
<DataTableFacetedFilter
|
|
3230
|
+
column={table.getColumn('priority')}
|
|
3231
|
+
title="Priority"
|
|
3232
|
+
options={priorityOptions}
|
|
3233
|
+
/>
|
|
3234
|
+
{/snippet}
|
|
3235
|
+
</DataTableToolbar>`
|
|
3236
|
+
},
|
|
3237
|
+
{
|
|
3238
|
+
title: "Dynamic Options from Data",
|
|
3239
|
+
code: `<script>
|
|
3240
|
+
// Extract unique values from data
|
|
3241
|
+
const uniqueStatuses = $derived(
|
|
3242
|
+
[...new Set(users.map((u) => u.status))].map((status) => ({
|
|
3243
|
+
value: status,
|
|
3244
|
+
label: status.charAt(0).toUpperCase() + status.slice(1),
|
|
3245
|
+
count: users.filter((u) => u.status === status).length,
|
|
3246
|
+
}))
|
|
3247
|
+
);
|
|
3248
|
+
</script>
|
|
3249
|
+
|
|
3250
|
+
<DataTableFacetedFilter
|
|
3251
|
+
column={table.getColumn('status')}
|
|
3252
|
+
title="Status"
|
|
3253
|
+
options={uniqueStatuses}
|
|
3254
|
+
/>`
|
|
1366
3255
|
}
|
|
1367
3256
|
],
|
|
1368
3257
|
relatedComponents: [
|
|
1369
|
-
"
|
|
1370
|
-
"
|
|
3258
|
+
"DataTable",
|
|
3259
|
+
"DataTableToolbar",
|
|
3260
|
+
"DataTableColumnFilter"
|
|
1371
3261
|
]
|
|
1372
3262
|
},
|
|
1373
3263
|
{
|
|
1374
|
-
name: "
|
|
1375
|
-
description: "
|
|
1376
|
-
category: "
|
|
3264
|
+
name: "DataTablePagination",
|
|
3265
|
+
description: "Pagination controls for TanStack Table with page navigation and rows per page selector",
|
|
3266
|
+
category: "data",
|
|
1377
3267
|
importPath: "@classic-homes/theme-svelte",
|
|
1378
3268
|
props: [
|
|
1379
3269
|
{
|
|
1380
|
-
name: "
|
|
1381
|
-
type: "
|
|
3270
|
+
name: "table",
|
|
3271
|
+
type: "Table<T>",
|
|
3272
|
+
default: "**required**",
|
|
1382
3273
|
required: false,
|
|
1383
|
-
description: "
|
|
3274
|
+
description: "The TanStack Table instance"
|
|
1384
3275
|
},
|
|
1385
3276
|
{
|
|
1386
|
-
name: "
|
|
1387
|
-
type: "
|
|
3277
|
+
name: "pageSizeOptions",
|
|
3278
|
+
type: "number[]",
|
|
3279
|
+
default: "[10, 25, 50, 100]",
|
|
1388
3280
|
required: false,
|
|
1389
|
-
description: "
|
|
3281
|
+
description: "Available page size options"
|
|
1390
3282
|
},
|
|
1391
3283
|
{
|
|
1392
|
-
name: "
|
|
1393
|
-
type: "
|
|
1394
|
-
default: "
|
|
3284
|
+
name: "showSelectedCount",
|
|
3285
|
+
type: "boolean",
|
|
3286
|
+
default: "true",
|
|
1395
3287
|
required: false,
|
|
1396
|
-
description: "
|
|
3288
|
+
description: "Show selected row count when rows are selected"
|
|
1397
3289
|
},
|
|
1398
3290
|
{
|
|
1399
|
-
name: "
|
|
3291
|
+
name: "class",
|
|
1400
3292
|
type: "string",
|
|
1401
3293
|
required: false,
|
|
1402
|
-
description: "
|
|
1403
|
-
}
|
|
3294
|
+
description: "Additional CSS classes"
|
|
3295
|
+
}
|
|
3296
|
+
],
|
|
3297
|
+
variants: [],
|
|
3298
|
+
slots: [
|
|
1404
3299
|
{
|
|
1405
|
-
name: "
|
|
1406
|
-
|
|
1407
|
-
required: false
|
|
1408
|
-
|
|
1409
|
-
|
|
3300
|
+
name: "children",
|
|
3301
|
+
description: "Main content",
|
|
3302
|
+
required: false
|
|
3303
|
+
}
|
|
3304
|
+
],
|
|
3305
|
+
events: [],
|
|
3306
|
+
examples: [
|
|
1410
3307
|
{
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
default: "'light'",
|
|
1414
|
-
required: false,
|
|
1415
|
-
description: "Sidebar visual variant"
|
|
3308
|
+
title: "Basic Usage",
|
|
3309
|
+
code: "<script>\n import { createDataTable, DataTablePagination } from '@classic-homes/theme-svelte';\n\n const tableApi = createDataTable(() => ({\n data: users,\n columns,\n }));\n\n const table = $derived(tableApi.instance);\n</script>\n\n<table>...</table>\n<DataTablePagination {table} />"
|
|
1416
3310
|
},
|
|
1417
3311
|
{
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
default: "false",
|
|
1421
|
-
required: false,
|
|
1422
|
-
description: "Initial collapsed state"
|
|
3312
|
+
title: "Custom Page Sizes",
|
|
3313
|
+
code: "<DataTablePagination {table} pageSizeOptions={[5, 10, 20, 50]} />"
|
|
1423
3314
|
},
|
|
1424
3315
|
{
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
default: "true",
|
|
1428
|
-
required: false,
|
|
1429
|
-
description: "Whether to show header"
|
|
3316
|
+
title: "Hide Selected Count",
|
|
3317
|
+
code: "<DataTablePagination {table} showSelectedCount={false} />"
|
|
1430
3318
|
},
|
|
1431
3319
|
{
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
3320
|
+
title: "With Custom Styling",
|
|
3321
|
+
code: '<DataTablePagination {table} class="border-t pt-4" />'
|
|
3322
|
+
}
|
|
3323
|
+
],
|
|
3324
|
+
relatedComponents: [
|
|
3325
|
+
"DataTable",
|
|
3326
|
+
"DataTableToolbar"
|
|
3327
|
+
]
|
|
3328
|
+
},
|
|
3329
|
+
{
|
|
3330
|
+
name: "DataTableSearch",
|
|
3331
|
+
description: "Global search input component for filtering all columns in a data table",
|
|
3332
|
+
category: "data",
|
|
3333
|
+
importPath: "@classic-homes/theme-svelte",
|
|
3334
|
+
props: [
|
|
1437
3335
|
{
|
|
1438
|
-
name: "
|
|
1439
|
-
type: "
|
|
3336
|
+
name: "table",
|
|
3337
|
+
type: "Table<T>",
|
|
3338
|
+
default: "**required**",
|
|
1440
3339
|
required: false,
|
|
1441
|
-
description: "
|
|
3340
|
+
description: "The TanStack Table instance"
|
|
1442
3341
|
},
|
|
1443
3342
|
{
|
|
1444
|
-
name: "
|
|
1445
|
-
type: "
|
|
3343
|
+
name: "placeholder",
|
|
3344
|
+
type: "string",
|
|
3345
|
+
default: "'Search...'",
|
|
1446
3346
|
required: false,
|
|
1447
|
-
description: "
|
|
3347
|
+
description: "Placeholder text for the input"
|
|
1448
3348
|
},
|
|
1449
3349
|
{
|
|
1450
|
-
name: "
|
|
1451
|
-
type: "
|
|
1452
|
-
default: "
|
|
3350
|
+
name: "debounceMs",
|
|
3351
|
+
type: "number",
|
|
3352
|
+
default: "300",
|
|
1453
3353
|
required: false,
|
|
1454
|
-
description: "
|
|
3354
|
+
description: "Debounce delay in milliseconds"
|
|
1455
3355
|
},
|
|
1456
3356
|
{
|
|
1457
|
-
name: "
|
|
1458
|
-
type: "
|
|
3357
|
+
name: "class",
|
|
3358
|
+
type: "string",
|
|
1459
3359
|
required: false,
|
|
1460
|
-
description: "
|
|
1461
|
-
}
|
|
3360
|
+
description: "Additional CSS classes"
|
|
3361
|
+
}
|
|
3362
|
+
],
|
|
3363
|
+
variants: [],
|
|
3364
|
+
slots: [
|
|
1462
3365
|
{
|
|
1463
|
-
name: "
|
|
1464
|
-
|
|
1465
|
-
required: false
|
|
1466
|
-
|
|
3366
|
+
name: "children",
|
|
3367
|
+
description: "Main content",
|
|
3368
|
+
required: false
|
|
3369
|
+
}
|
|
3370
|
+
],
|
|
3371
|
+
events: [],
|
|
3372
|
+
examples: [
|
|
3373
|
+
{
|
|
3374
|
+
title: "Basic Usage",
|
|
3375
|
+
code: "<script>\n import { createDataTable, DataTableSearch } from '@classic-homes/theme-svelte';\n\n let globalFilter = $state('');\n\n const tableApi = createDataTable(() => ({\n data: users,\n columns,\n state: { globalFilter },\n onGlobalFilterChange: (updater) => {\n globalFilter = typeof updater === 'function' ? updater(globalFilter) : updater;\n },\n enableGlobalFilter: true,\n }));\n\n const table = $derived(tableApi.instance);\n</script>\n\n<DataTableSearch {table} /><table>...</table>"
|
|
1467
3376
|
},
|
|
1468
3377
|
{
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
required: false,
|
|
1472
|
-
description: "Content at end of header"
|
|
3378
|
+
title: "Custom Placeholder",
|
|
3379
|
+
code: '<DataTableSearch {table} placeholder="Search users by name or email..." />'
|
|
1473
3380
|
},
|
|
1474
3381
|
{
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
description: "Custom user menu"
|
|
3382
|
+
title: "Faster Debounce",
|
|
3383
|
+
description: "For more responsive filtering:",
|
|
3384
|
+
code: "<DataTableSearch {table} debounceMs={150} />"
|
|
1479
3385
|
},
|
|
1480
3386
|
{
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
description: "Sidebar footer content"
|
|
3387
|
+
title: "No Debounce",
|
|
3388
|
+
description: "For immediate filtering (smaller datasets):",
|
|
3389
|
+
code: "<DataTableSearch {table} debounceMs={0} />"
|
|
1485
3390
|
},
|
|
1486
3391
|
{
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
default: "256",
|
|
1490
|
-
required: false,
|
|
1491
|
-
description: "Expanded sidebar width (px)"
|
|
3392
|
+
title: "Custom Width",
|
|
3393
|
+
code: '<DataTableSearch {table} class="w-[300px]" />'
|
|
1492
3394
|
},
|
|
1493
3395
|
{
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
3396
|
+
title: "In Custom Layout",
|
|
3397
|
+
code: '<div class="flex items-center gap-4">\n <DataTableSearch {table} class="flex-1" />\n <Button>Add User</Button>\n</div>'
|
|
3398
|
+
}
|
|
3399
|
+
],
|
|
3400
|
+
relatedComponents: [
|
|
3401
|
+
"DataTable",
|
|
3402
|
+
"DataTableToolbar",
|
|
3403
|
+
"DataTableColumnFilter"
|
|
3404
|
+
]
|
|
3405
|
+
},
|
|
3406
|
+
{
|
|
3407
|
+
name: "DataTableToolbar",
|
|
3408
|
+
description: "Combined toolbar component with search, filters, and column visibility controls",
|
|
3409
|
+
category: "data",
|
|
3410
|
+
importPath: "@classic-homes/theme-svelte",
|
|
3411
|
+
props: [
|
|
3412
|
+
{
|
|
3413
|
+
name: "table",
|
|
3414
|
+
type: "Table<T>",
|
|
3415
|
+
default: "**required**",
|
|
1497
3416
|
required: false,
|
|
1498
|
-
description: "
|
|
3417
|
+
description: "The TanStack Table instance"
|
|
1499
3418
|
},
|
|
1500
3419
|
{
|
|
1501
|
-
name: "
|
|
3420
|
+
name: "showSearch",
|
|
1502
3421
|
type: "boolean",
|
|
1503
|
-
default: "
|
|
3422
|
+
default: "true",
|
|
1504
3423
|
required: false,
|
|
1505
|
-
description: "
|
|
3424
|
+
description: "Show global search input"
|
|
1506
3425
|
},
|
|
1507
3426
|
{
|
|
1508
|
-
name: "
|
|
1509
|
-
type: "
|
|
1510
|
-
default: "
|
|
3427
|
+
name: "showColumnVisibility",
|
|
3428
|
+
type: "boolean",
|
|
3429
|
+
default: "true",
|
|
1511
3430
|
required: false,
|
|
1512
|
-
description: "
|
|
3431
|
+
description: "Show column visibility dropdown"
|
|
1513
3432
|
},
|
|
1514
3433
|
{
|
|
1515
|
-
name: "
|
|
1516
|
-
type: "
|
|
3434
|
+
name: "searchPlaceholder",
|
|
3435
|
+
type: "string",
|
|
3436
|
+
default: "'Search...'",
|
|
1517
3437
|
required: false,
|
|
1518
|
-
description: "
|
|
3438
|
+
description: "Placeholder text for search input"
|
|
1519
3439
|
},
|
|
1520
3440
|
{
|
|
1521
|
-
name: "
|
|
1522
|
-
type: "
|
|
1523
|
-
default: "'lg'",
|
|
3441
|
+
name: "visibilityState",
|
|
3442
|
+
type: "VisibilityState",
|
|
1524
3443
|
required: false,
|
|
1525
|
-
description: "
|
|
3444
|
+
description: "Optional visibility state for reactivity"
|
|
1526
3445
|
},
|
|
1527
3446
|
{
|
|
1528
|
-
name: "
|
|
3447
|
+
name: "filters",
|
|
1529
3448
|
type: "Snippet",
|
|
1530
3449
|
required: false,
|
|
1531
|
-
description: "
|
|
1532
|
-
}
|
|
1533
|
-
],
|
|
1534
|
-
variants: [
|
|
1535
|
-
{
|
|
1536
|
-
name: "sidebarVariant",
|
|
1537
|
-
values: [
|
|
1538
|
-
"light",
|
|
1539
|
-
"dark"
|
|
1540
|
-
],
|
|
1541
|
-
default: "light"
|
|
3450
|
+
description: "Custom filters slot"
|
|
1542
3451
|
},
|
|
1543
3452
|
{
|
|
1544
|
-
name: "
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
],
|
|
1549
|
-
default: "list"
|
|
3453
|
+
name: "actions",
|
|
3454
|
+
type: "Snippet",
|
|
3455
|
+
required: false,
|
|
3456
|
+
description: "Custom actions slot"
|
|
1550
3457
|
},
|
|
1551
3458
|
{
|
|
1552
|
-
name: "
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
"lg"
|
|
1557
|
-
],
|
|
1558
|
-
default: "lg"
|
|
3459
|
+
name: "class",
|
|
3460
|
+
type: "string",
|
|
3461
|
+
required: false,
|
|
3462
|
+
description: "Additional CSS classes"
|
|
1559
3463
|
}
|
|
1560
3464
|
],
|
|
3465
|
+
variants: [],
|
|
1561
3466
|
slots: [
|
|
1562
3467
|
{
|
|
1563
3468
|
name: "children",
|
|
@@ -1569,115 +3474,103 @@ var component_catalog_default = {
|
|
|
1569
3474
|
examples: [
|
|
1570
3475
|
{
|
|
1571
3476
|
title: "Basic Usage",
|
|
1572
|
-
code: "<script>\n
|
|
3477
|
+
code: "<script>\n import { createDataTable, DataTableToolbar } from '@classic-homes/theme-svelte';\n\n const tableApi = createDataTable(() => ({\n data: users,\n columns,\n enableGlobalFilter: true,\n }));\n\n const table = $derived(tableApi.instance);\n</script>\n\n<DataTableToolbar {table} /><table>...</table>"
|
|
3478
|
+
},
|
|
3479
|
+
{
|
|
3480
|
+
title: "Search Only",
|
|
3481
|
+
code: "<DataTableToolbar {table} showColumnVisibility={false} />"
|
|
3482
|
+
},
|
|
3483
|
+
{
|
|
3484
|
+
title: "Custom Placeholder",
|
|
3485
|
+
code: '<DataTableToolbar {table} searchPlaceholder="Search users..." />'
|
|
3486
|
+
},
|
|
3487
|
+
{
|
|
3488
|
+
title: "With Custom Filters",
|
|
3489
|
+
code: `<DataTableToolbar {table}>
|
|
3490
|
+
{#snippet filters()}
|
|
3491
|
+
<DataTableFacetedFilter
|
|
3492
|
+
{table}
|
|
3493
|
+
columnId="status"
|
|
3494
|
+
title="Status"
|
|
3495
|
+
options={[
|
|
3496
|
+
{ value: 'active', label: 'Active' },
|
|
3497
|
+
{ value: 'inactive', label: 'Inactive' },
|
|
3498
|
+
]}
|
|
3499
|
+
/>
|
|
3500
|
+
{/snippet}
|
|
3501
|
+
</DataTableToolbar>`
|
|
3502
|
+
},
|
|
3503
|
+
{
|
|
3504
|
+
title: "With Custom Actions",
|
|
3505
|
+
code: '<DataTableToolbar {table}>\n {#snippet actions()}\n <Button variant="outline" size="sm">Export</Button>\n {/snippet}\n</DataTableToolbar>'
|
|
3506
|
+
},
|
|
3507
|
+
{
|
|
3508
|
+
title: "Full Customization",
|
|
3509
|
+
code: '<DataTableToolbar {table} showSearch={true} showColumnVisibility={true}>\n {#snippet filters()}\n <DataTableFacetedFilter {table} columnId="role" title="Role" options={roleOptions} />\n <DataTableFacetedFilter {table} columnId="status" title="Status" options={statusOptions} />\n {/snippet}\n {#snippet actions()}\n <Button onclick={handleExport}>Export CSV</Button>\n <Button onclick={handleDelete} variant="destructive">Delete Selected</Button>\n {/snippet}\n</DataTableToolbar>'
|
|
1573
3510
|
}
|
|
1574
3511
|
],
|
|
1575
3512
|
relatedComponents: [
|
|
1576
|
-
"
|
|
1577
|
-
"
|
|
1578
|
-
"
|
|
3513
|
+
"DataTable",
|
|
3514
|
+
"DataTableSearch",
|
|
3515
|
+
"DataTableColumnVisibility",
|
|
3516
|
+
"DataTableFacetedFilter"
|
|
1579
3517
|
]
|
|
1580
3518
|
},
|
|
1581
3519
|
{
|
|
1582
|
-
name: "
|
|
1583
|
-
description: "
|
|
3520
|
+
name: "DataTableVirtual",
|
|
3521
|
+
description: "Virtualized table component for efficiently rendering large datasets with 10,000+ rows",
|
|
1584
3522
|
category: "data",
|
|
1585
3523
|
importPath: "@classic-homes/theme-svelte",
|
|
1586
3524
|
props: [
|
|
1587
3525
|
{
|
|
1588
|
-
name: "
|
|
1589
|
-
type: "T
|
|
1590
|
-
|
|
1591
|
-
description: "Array of data rows"
|
|
1592
|
-
},
|
|
1593
|
-
{
|
|
1594
|
-
name: "columns",
|
|
1595
|
-
type: "DataTableColumn<T>[]",
|
|
3526
|
+
name: "table",
|
|
3527
|
+
type: "Table<T>",
|
|
3528
|
+
default: "**required**",
|
|
1596
3529
|
required: false,
|
|
1597
|
-
description: "
|
|
3530
|
+
description: "The TanStack Table instance"
|
|
1598
3531
|
},
|
|
1599
3532
|
{
|
|
1600
|
-
name: "
|
|
1601
|
-
type: "
|
|
1602
|
-
default: "
|
|
3533
|
+
name: "rowHeight",
|
|
3534
|
+
type: "number",
|
|
3535
|
+
default: "48",
|
|
1603
3536
|
required: false,
|
|
1604
|
-
description: "
|
|
3537
|
+
description: "Height of each row in pixels (must be fixed)"
|
|
1605
3538
|
},
|
|
1606
3539
|
{
|
|
1607
|
-
name: "
|
|
3540
|
+
name: "overscan",
|
|
1608
3541
|
type: "number",
|
|
1609
3542
|
default: "5",
|
|
1610
3543
|
required: false,
|
|
1611
|
-
description: "Number of
|
|
1612
|
-
},
|
|
1613
|
-
{
|
|
1614
|
-
name: "emptyMessage",
|
|
1615
|
-
type: "string",
|
|
1616
|
-
default: "'No data available'",
|
|
1617
|
-
required: false,
|
|
1618
|
-
description: "Empty state message"
|
|
3544
|
+
description: "Number of rows to render outside visible area"
|
|
1619
3545
|
},
|
|
1620
3546
|
{
|
|
1621
|
-
name: "
|
|
3547
|
+
name: "height",
|
|
1622
3548
|
type: "string",
|
|
3549
|
+
default: "'500px'",
|
|
1623
3550
|
required: false,
|
|
1624
|
-
description: "
|
|
1625
|
-
},
|
|
1626
|
-
{
|
|
1627
|
-
name: "sortDirection",
|
|
1628
|
-
type: "'asc' | 'desc'",
|
|
1629
|
-
default: "'asc'",
|
|
1630
|
-
required: false,
|
|
1631
|
-
description: "Sort direction (bindable)"
|
|
1632
|
-
},
|
|
1633
|
-
{
|
|
1634
|
-
name: "onSort",
|
|
1635
|
-
type: "(column: string, direction: 'asc' | 'desc') => void",
|
|
1636
|
-
required: false,
|
|
1637
|
-
description: "Sort callback"
|
|
3551
|
+
description: "Height of the container (CSS value)"
|
|
1638
3552
|
},
|
|
1639
3553
|
{
|
|
1640
3554
|
name: "onRowClick",
|
|
1641
3555
|
type: "(row: T) => void",
|
|
1642
3556
|
required: false,
|
|
1643
|
-
description: "
|
|
1644
|
-
},
|
|
1645
|
-
{
|
|
1646
|
-
name: "caption",
|
|
1647
|
-
type: "string",
|
|
1648
|
-
required: false,
|
|
1649
|
-
description: "Accessible caption"
|
|
3557
|
+
description: "Callback when row is clicked"
|
|
1650
3558
|
},
|
|
1651
3559
|
{
|
|
1652
|
-
name: "
|
|
1653
|
-
type: "
|
|
3560
|
+
name: "enableRowSelection",
|
|
3561
|
+
type: "boolean",
|
|
3562
|
+
default: "false",
|
|
1654
3563
|
required: false,
|
|
1655
|
-
description: "
|
|
3564
|
+
description: "Enable row selection checkboxes"
|
|
1656
3565
|
},
|
|
1657
3566
|
{
|
|
1658
3567
|
name: "class",
|
|
1659
3568
|
type: "string",
|
|
1660
3569
|
required: false,
|
|
1661
|
-
description: "Additional classes"
|
|
1662
|
-
}
|
|
1663
|
-
],
|
|
1664
|
-
variants: [
|
|
1665
|
-
{
|
|
1666
|
-
name: "sortDirection",
|
|
1667
|
-
values: [
|
|
1668
|
-
"asc",
|
|
1669
|
-
"desc"
|
|
1670
|
-
],
|
|
1671
|
-
default: "asc"
|
|
1672
|
-
},
|
|
1673
|
-
{
|
|
1674
|
-
name: "onSort",
|
|
1675
|
-
values: [
|
|
1676
|
-
"asc",
|
|
1677
|
-
"desc"
|
|
1678
|
-
]
|
|
3570
|
+
description: "Additional CSS classes"
|
|
1679
3571
|
}
|
|
1680
3572
|
],
|
|
3573
|
+
variants: [],
|
|
1681
3574
|
slots: [
|
|
1682
3575
|
{
|
|
1683
3576
|
name: "children",
|
|
@@ -1689,21 +3582,60 @@ var component_catalog_default = {
|
|
|
1689
3582
|
examples: [
|
|
1690
3583
|
{
|
|
1691
3584
|
title: "Basic Usage",
|
|
1692
|
-
code:
|
|
3585
|
+
code: `<script>
|
|
3586
|
+
import { createDataTable, DataTableVirtual } from '@classic-homes/theme-svelte';
|
|
3587
|
+
|
|
3588
|
+
const tableApi = createDataTable(() => ({
|
|
3589
|
+
data: largeDataset, // 10,000+ rows
|
|
3590
|
+
columns,
|
|
3591
|
+
manualPagination: true, // Disable pagination for virtualization
|
|
3592
|
+
}));
|
|
3593
|
+
|
|
3594
|
+
const table = $derived(tableApi.instance);
|
|
3595
|
+
</script>
|
|
3596
|
+
|
|
3597
|
+
<DataTableVirtual {table} height="600px" />`
|
|
1693
3598
|
},
|
|
1694
3599
|
{
|
|
1695
|
-
title: "
|
|
1696
|
-
code:
|
|
3600
|
+
title: "Custom Row Height",
|
|
3601
|
+
code: '<DataTableVirtual {table} rowHeight={64} height="600px" />'
|
|
1697
3602
|
},
|
|
1698
3603
|
{
|
|
1699
|
-
title: "
|
|
1700
|
-
|
|
3604
|
+
title: "With More Overscan",
|
|
3605
|
+
description: "For smoother scrolling, increase the overscan:",
|
|
3606
|
+
code: '<DataTableVirtual {table} overscan={10} height="600px" />'
|
|
3607
|
+
},
|
|
3608
|
+
{
|
|
3609
|
+
title: "With Row Click Handler",
|
|
3610
|
+
code: '<DataTableVirtual {table} height="600px" onRowClick={(row) => goto(`/users/${row.id}`)} />'
|
|
3611
|
+
},
|
|
3612
|
+
{
|
|
3613
|
+
title: "With Row Selection",
|
|
3614
|
+
code: `<script>
|
|
3615
|
+
let rowSelection = $state({});
|
|
3616
|
+
|
|
3617
|
+
const tableApi = createDataTable(() => ({
|
|
3618
|
+
data: largeDataset,
|
|
3619
|
+
columns,
|
|
3620
|
+
state: { rowSelection },
|
|
3621
|
+
onRowSelectionChange: (updater) => {
|
|
3622
|
+
rowSelection = typeof updater === 'function' ? updater(rowSelection) : updater;
|
|
3623
|
+
},
|
|
3624
|
+
enableRowSelection: true,
|
|
3625
|
+
manualPagination: true,
|
|
3626
|
+
}));
|
|
3627
|
+
</script>
|
|
3628
|
+
|
|
3629
|
+
<DataTableVirtual {table} enableRowSelection height="600px" />`
|
|
3630
|
+
},
|
|
3631
|
+
{
|
|
3632
|
+
title: "Full Height Container",
|
|
3633
|
+
code: '<div class="flex-1 min-h-0">\n <DataTableVirtual {table} height="100%" />\n</div>'
|
|
1701
3634
|
}
|
|
1702
3635
|
],
|
|
1703
3636
|
relatedComponents: [
|
|
1704
|
-
"
|
|
1705
|
-
"
|
|
1706
|
-
"Button"
|
|
3637
|
+
"DataTable",
|
|
3638
|
+
"DataTablePagination"
|
|
1707
3639
|
]
|
|
1708
3640
|
},
|
|
1709
3641
|
{
|
|
@@ -1896,8 +3828,106 @@ var component_catalog_default = {
|
|
|
1896
3828
|
description: "Pie chart variant with center labels for key metrics",
|
|
1897
3829
|
category: "chart",
|
|
1898
3830
|
importPath: "@classic-homes/charts-svelte",
|
|
1899
|
-
props: [
|
|
1900
|
-
|
|
3831
|
+
props: [
|
|
3832
|
+
{
|
|
3833
|
+
name: "data",
|
|
3834
|
+
type: "PieSliceData[]",
|
|
3835
|
+
required: true,
|
|
3836
|
+
description: "Array of slice data"
|
|
3837
|
+
},
|
|
3838
|
+
{
|
|
3839
|
+
name: "showLabels",
|
|
3840
|
+
type: "boolean",
|
|
3841
|
+
default: "false",
|
|
3842
|
+
required: false,
|
|
3843
|
+
description: "Show labels on slices"
|
|
3844
|
+
},
|
|
3845
|
+
{
|
|
3846
|
+
name: "labelPosition",
|
|
3847
|
+
type: "'inside' | 'outside'",
|
|
3848
|
+
default: "'outside'",
|
|
3849
|
+
required: false,
|
|
3850
|
+
description: "Position of labels"
|
|
3851
|
+
},
|
|
3852
|
+
{
|
|
3853
|
+
name: "innerRadius",
|
|
3854
|
+
type: "number | string",
|
|
3855
|
+
default: "'50%'",
|
|
3856
|
+
required: false,
|
|
3857
|
+
description: "Inner radius for donut hole"
|
|
3858
|
+
},
|
|
3859
|
+
{
|
|
3860
|
+
name: "centerLabel",
|
|
3861
|
+
type: "string",
|
|
3862
|
+
required: false,
|
|
3863
|
+
description: "Text label in the center"
|
|
3864
|
+
},
|
|
3865
|
+
{
|
|
3866
|
+
name: "centerValue",
|
|
3867
|
+
type: "string | number",
|
|
3868
|
+
required: false,
|
|
3869
|
+
description: "Value displayed in the center"
|
|
3870
|
+
},
|
|
3871
|
+
{
|
|
3872
|
+
name: "onClick",
|
|
3873
|
+
type: "(params: SliceEventParams) => void",
|
|
3874
|
+
required: false,
|
|
3875
|
+
description: "Callback when clicked"
|
|
3876
|
+
},
|
|
3877
|
+
{
|
|
3878
|
+
name: "title",
|
|
3879
|
+
type: "string",
|
|
3880
|
+
required: true,
|
|
3881
|
+
description: "Chart title for accessibility"
|
|
3882
|
+
},
|
|
3883
|
+
{
|
|
3884
|
+
name: "height",
|
|
3885
|
+
type: "number | string",
|
|
3886
|
+
default: "400",
|
|
3887
|
+
required: false,
|
|
3888
|
+
description: "Chart height"
|
|
3889
|
+
},
|
|
3890
|
+
{
|
|
3891
|
+
name: "theme",
|
|
3892
|
+
type: "'light' | 'dark' | 'auto'",
|
|
3893
|
+
default: "'auto'",
|
|
3894
|
+
required: false,
|
|
3895
|
+
description: "Theme preference"
|
|
3896
|
+
},
|
|
3897
|
+
{
|
|
3898
|
+
name: "showLegend",
|
|
3899
|
+
type: "boolean",
|
|
3900
|
+
default: "true",
|
|
3901
|
+
required: false,
|
|
3902
|
+
description: "Show chart legend"
|
|
3903
|
+
},
|
|
3904
|
+
{
|
|
3905
|
+
name: "showTooltip",
|
|
3906
|
+
type: "boolean",
|
|
3907
|
+
default: "true",
|
|
3908
|
+
required: false,
|
|
3909
|
+
description: "Show tooltip on hover"
|
|
3910
|
+
}
|
|
3911
|
+
],
|
|
3912
|
+
variants: [
|
|
3913
|
+
{
|
|
3914
|
+
name: "labelPosition",
|
|
3915
|
+
values: [
|
|
3916
|
+
"inside",
|
|
3917
|
+
"outside"
|
|
3918
|
+
],
|
|
3919
|
+
default: "outside"
|
|
3920
|
+
},
|
|
3921
|
+
{
|
|
3922
|
+
name: "theme",
|
|
3923
|
+
values: [
|
|
3924
|
+
"light",
|
|
3925
|
+
"dark",
|
|
3926
|
+
"auto"
|
|
3927
|
+
],
|
|
3928
|
+
default: "auto"
|
|
3929
|
+
}
|
|
3930
|
+
],
|
|
1901
3931
|
slots: [],
|
|
1902
3932
|
events: [],
|
|
1903
3933
|
examples: [
|
|
@@ -2345,18 +4375,81 @@ var component_catalog_default = {
|
|
|
2345
4375
|
code: '<FileUpload\n accept="image/*"\n maxSize={2 * 1024 * 1024}\n bind:files={avatar}\n onUpload={uploadAvatar}\n/>'
|
|
2346
4376
|
},
|
|
2347
4377
|
{
|
|
2348
|
-
title: "Document Upload",
|
|
2349
|
-
code: '<FileUpload\n accept=".pdf,.doc,.docx"\n multiple\n maxFiles={10}\n maxSize={10 * 1024 * 1024}\n bind:files={documents}\n onUpload={uploadDocument}\n/>'
|
|
4378
|
+
title: "Document Upload",
|
|
4379
|
+
code: '<FileUpload\n accept=".pdf,.doc,.docx"\n multiple\n maxFiles={10}\n maxSize={10 * 1024 * 1024}\n bind:files={documents}\n onUpload={uploadDocument}\n/>'
|
|
4380
|
+
},
|
|
4381
|
+
{
|
|
4382
|
+
title: "With Progress",
|
|
4383
|
+
description: "Files show upload progress:",
|
|
4384
|
+
code: "<FileUpload\n bind:files\n onUpload={async (file) => {\n // Upload with progress tracking\n return await uploadWithProgress(file, (progress) => {\n // Progress updates automatically\n });\n }}\n/>"
|
|
4385
|
+
}
|
|
4386
|
+
],
|
|
4387
|
+
relatedComponents: [
|
|
4388
|
+
"Input",
|
|
4389
|
+
"Button"
|
|
4390
|
+
]
|
|
4391
|
+
},
|
|
4392
|
+
{
|
|
4393
|
+
name: "FlexRender",
|
|
4394
|
+
description: "Dynamic content renderer for TanStack Table cells and headers",
|
|
4395
|
+
category: "data",
|
|
4396
|
+
importPath: "@classic-homes/theme-svelte",
|
|
4397
|
+
props: [
|
|
4398
|
+
{
|
|
4399
|
+
name: "content",
|
|
4400
|
+
type: "unknown",
|
|
4401
|
+
default: "**required**",
|
|
4402
|
+
required: false,
|
|
4403
|
+
description: "Content to render (string, component, or function)"
|
|
4404
|
+
},
|
|
4405
|
+
{
|
|
4406
|
+
name: "props",
|
|
4407
|
+
type: "TProps",
|
|
4408
|
+
default: "**required**",
|
|
4409
|
+
required: false,
|
|
4410
|
+
description: "Props to pass to component or function"
|
|
4411
|
+
},
|
|
4412
|
+
{
|
|
4413
|
+
name: "asComponent",
|
|
4414
|
+
type: "boolean",
|
|
4415
|
+
default: "false",
|
|
4416
|
+
required: false,
|
|
4417
|
+
description: "Explicitly mark content as a Svelte component"
|
|
4418
|
+
}
|
|
4419
|
+
],
|
|
4420
|
+
variants: [],
|
|
4421
|
+
slots: [
|
|
4422
|
+
{
|
|
4423
|
+
name: "children",
|
|
4424
|
+
description: "Main content",
|
|
4425
|
+
required: false
|
|
4426
|
+
}
|
|
4427
|
+
],
|
|
4428
|
+
events: [],
|
|
4429
|
+
examples: [
|
|
4430
|
+
{
|
|
4431
|
+
title: "Basic Usage",
|
|
4432
|
+
code: "<script>\n import { createDataTable, FlexRender } from '@classic-homes/theme-svelte';\n\n const tableApi = createDataTable(() => ({ data: users, columns }));\n const table = $derived(tableApi.instance);\n</script>\n\n<table>\n <thead>\n {#each table.getHeaderGroups() as headerGroup}\n <tr>\n {#each headerGroup.headers as header}\n <th>\n <FlexRender content={header.column.columnDef.header} props={header.getContext()} />\n </th>\n {/each}\n </tr>\n {/each}\n </thead>\n <tbody>\n {#each table.getRowModel().rows as row}\n <tr>\n {#each row.getVisibleCells() as cell}\n <td>\n <FlexRender content={cell.column.columnDef.cell} props={cell.getContext()} />\n </td>\n {/each}\n </tr>\n {/each}\n </tbody>\n</table>"
|
|
2350
4433
|
},
|
|
2351
4434
|
{
|
|
2352
|
-
title: "With
|
|
2353
|
-
|
|
2354
|
-
|
|
4435
|
+
title: "With Custom Cell Component",
|
|
4436
|
+
code: `<!-- StatusBadge.svelte -->
|
|
4437
|
+
<script lang="ts">
|
|
4438
|
+
import type { CellContext } from '@classic-homes/theme-svelte';
|
|
4439
|
+
import Badge from './Badge.svelte';
|
|
4440
|
+
|
|
4441
|
+
let { getValue }: CellContext<User, string> = $props();
|
|
4442
|
+
const status = $derived(getValue());
|
|
4443
|
+
</script>
|
|
4444
|
+
|
|
4445
|
+
<Badge variant={status === 'active' ? 'success' : 'secondary'}>
|
|
4446
|
+
{status}
|
|
4447
|
+
</Badge>`
|
|
2355
4448
|
}
|
|
2356
4449
|
],
|
|
2357
4450
|
relatedComponents: [
|
|
2358
|
-
"
|
|
2359
|
-
"
|
|
4451
|
+
"DataTable",
|
|
4452
|
+
"DataTableEditableCell"
|
|
2360
4453
|
]
|
|
2361
4454
|
},
|
|
2362
4455
|
{
|
|
@@ -2914,8 +5007,103 @@ var component_catalog_default = {
|
|
|
2914
5007
|
description: "Visualize conversion rates and process flows",
|
|
2915
5008
|
category: "chart",
|
|
2916
5009
|
importPath: "@classic-homes/charts-svelte",
|
|
2917
|
-
props: [
|
|
2918
|
-
|
|
5010
|
+
props: [
|
|
5011
|
+
{
|
|
5012
|
+
name: "data",
|
|
5013
|
+
type: "FunnelSliceData[]",
|
|
5014
|
+
required: true,
|
|
5015
|
+
description: "Array of funnel stages"
|
|
5016
|
+
},
|
|
5017
|
+
{
|
|
5018
|
+
name: "sort",
|
|
5019
|
+
type: "'ascending' | 'descending' | 'none'",
|
|
5020
|
+
default: "'descending'",
|
|
5021
|
+
required: false,
|
|
5022
|
+
description: "Sort order"
|
|
5023
|
+
},
|
|
5024
|
+
{
|
|
5025
|
+
name: "orientation",
|
|
5026
|
+
type: "'vertical' | 'horizontal'",
|
|
5027
|
+
default: "'vertical'",
|
|
5028
|
+
required: false,
|
|
5029
|
+
description: "Funnel orientation"
|
|
5030
|
+
},
|
|
5031
|
+
{
|
|
5032
|
+
name: "showLabels",
|
|
5033
|
+
type: "boolean",
|
|
5034
|
+
default: "true",
|
|
5035
|
+
required: false,
|
|
5036
|
+
description: "Show value labels"
|
|
5037
|
+
},
|
|
5038
|
+
{
|
|
5039
|
+
name: "onClick",
|
|
5040
|
+
type: "(params: SliceEventParams) => void",
|
|
5041
|
+
required: false,
|
|
5042
|
+
description: "Callback when clicked"
|
|
5043
|
+
},
|
|
5044
|
+
{
|
|
5045
|
+
name: "title",
|
|
5046
|
+
type: "string",
|
|
5047
|
+
required: true,
|
|
5048
|
+
description: "Chart title for accessibility"
|
|
5049
|
+
},
|
|
5050
|
+
{
|
|
5051
|
+
name: "height",
|
|
5052
|
+
type: "number | string",
|
|
5053
|
+
default: "400",
|
|
5054
|
+
required: false,
|
|
5055
|
+
description: "Chart height"
|
|
5056
|
+
},
|
|
5057
|
+
{
|
|
5058
|
+
name: "theme",
|
|
5059
|
+
type: "'light' | 'dark' | 'auto'",
|
|
5060
|
+
default: "'auto'",
|
|
5061
|
+
required: false,
|
|
5062
|
+
description: "Theme preference"
|
|
5063
|
+
},
|
|
5064
|
+
{
|
|
5065
|
+
name: "showLegend",
|
|
5066
|
+
type: "boolean",
|
|
5067
|
+
default: "true",
|
|
5068
|
+
required: false,
|
|
5069
|
+
description: "Show chart legend"
|
|
5070
|
+
},
|
|
5071
|
+
{
|
|
5072
|
+
name: "showTooltip",
|
|
5073
|
+
type: "boolean",
|
|
5074
|
+
default: "true",
|
|
5075
|
+
required: false,
|
|
5076
|
+
description: "Show tooltip on hover"
|
|
5077
|
+
}
|
|
5078
|
+
],
|
|
5079
|
+
variants: [
|
|
5080
|
+
{
|
|
5081
|
+
name: "sort",
|
|
5082
|
+
values: [
|
|
5083
|
+
"ascending",
|
|
5084
|
+
"descending",
|
|
5085
|
+
"none"
|
|
5086
|
+
],
|
|
5087
|
+
default: "descending"
|
|
5088
|
+
},
|
|
5089
|
+
{
|
|
5090
|
+
name: "orientation",
|
|
5091
|
+
values: [
|
|
5092
|
+
"vertical",
|
|
5093
|
+
"horizontal"
|
|
5094
|
+
],
|
|
5095
|
+
default: "vertical"
|
|
5096
|
+
},
|
|
5097
|
+
{
|
|
5098
|
+
name: "theme",
|
|
5099
|
+
values: [
|
|
5100
|
+
"light",
|
|
5101
|
+
"dark",
|
|
5102
|
+
"auto"
|
|
5103
|
+
],
|
|
5104
|
+
default: "auto"
|
|
5105
|
+
}
|
|
5106
|
+
],
|
|
2919
5107
|
slots: [],
|
|
2920
5108
|
events: [],
|
|
2921
5109
|
examples: [
|
|
@@ -2964,8 +5152,86 @@ var component_catalog_default = {
|
|
|
2964
5152
|
description: "Display single value metrics with progress indicator",
|
|
2965
5153
|
category: "chart",
|
|
2966
5154
|
importPath: "@classic-homes/charts-svelte",
|
|
2967
|
-
props: [
|
|
2968
|
-
|
|
5155
|
+
props: [
|
|
5156
|
+
{
|
|
5157
|
+
name: "value",
|
|
5158
|
+
type: "number",
|
|
5159
|
+
required: true,
|
|
5160
|
+
description: "Current value to display"
|
|
5161
|
+
},
|
|
5162
|
+
{
|
|
5163
|
+
name: "min",
|
|
5164
|
+
type: "number",
|
|
5165
|
+
default: "0",
|
|
5166
|
+
required: false,
|
|
5167
|
+
description: "Minimum value of the gauge"
|
|
5168
|
+
},
|
|
5169
|
+
{
|
|
5170
|
+
name: "max",
|
|
5171
|
+
type: "number",
|
|
5172
|
+
default: "100",
|
|
5173
|
+
required: false,
|
|
5174
|
+
description: "Maximum value of the gauge"
|
|
5175
|
+
},
|
|
5176
|
+
{
|
|
5177
|
+
name: "splitNumber",
|
|
5178
|
+
type: "number",
|
|
5179
|
+
default: "10",
|
|
5180
|
+
required: false,
|
|
5181
|
+
description: "Number of tick divisions"
|
|
5182
|
+
},
|
|
5183
|
+
{
|
|
5184
|
+
name: "showProgress",
|
|
5185
|
+
type: "boolean",
|
|
5186
|
+
default: "false",
|
|
5187
|
+
required: false,
|
|
5188
|
+
description: "Show colored progress arc"
|
|
5189
|
+
},
|
|
5190
|
+
{
|
|
5191
|
+
name: "formatValue",
|
|
5192
|
+
type: "(value: number) => string",
|
|
5193
|
+
required: false,
|
|
5194
|
+
description: "Custom value formatter"
|
|
5195
|
+
},
|
|
5196
|
+
{
|
|
5197
|
+
name: "title",
|
|
5198
|
+
type: "string",
|
|
5199
|
+
required: true,
|
|
5200
|
+
description: "Chart title for accessibility"
|
|
5201
|
+
},
|
|
5202
|
+
{
|
|
5203
|
+
name: "height",
|
|
5204
|
+
type: "number | string",
|
|
5205
|
+
default: "400",
|
|
5206
|
+
required: false,
|
|
5207
|
+
description: "Chart height"
|
|
5208
|
+
},
|
|
5209
|
+
{
|
|
5210
|
+
name: "theme",
|
|
5211
|
+
type: "'light' | 'dark' | 'auto'",
|
|
5212
|
+
default: "'auto'",
|
|
5213
|
+
required: false,
|
|
5214
|
+
description: "Theme preference"
|
|
5215
|
+
},
|
|
5216
|
+
{
|
|
5217
|
+
name: "animation",
|
|
5218
|
+
type: "boolean",
|
|
5219
|
+
default: "true",
|
|
5220
|
+
required: false,
|
|
5221
|
+
description: "Enable/disable animations"
|
|
5222
|
+
}
|
|
5223
|
+
],
|
|
5224
|
+
variants: [
|
|
5225
|
+
{
|
|
5226
|
+
name: "theme",
|
|
5227
|
+
values: [
|
|
5228
|
+
"light",
|
|
5229
|
+
"dark",
|
|
5230
|
+
"auto"
|
|
5231
|
+
],
|
|
5232
|
+
default: "auto"
|
|
5233
|
+
}
|
|
5234
|
+
],
|
|
2969
5235
|
slots: [],
|
|
2970
5236
|
events: [],
|
|
2971
5237
|
examples: [
|
|
@@ -3134,13 +5400,165 @@ var component_catalog_default = {
|
|
|
3134
5400
|
default: "lg"
|
|
3135
5401
|
},
|
|
3136
5402
|
{
|
|
3137
|
-
name: "maxWidth",
|
|
5403
|
+
name: "maxWidth",
|
|
5404
|
+
values: [
|
|
5405
|
+
"none",
|
|
5406
|
+
"sm",
|
|
5407
|
+
"7xl"
|
|
5408
|
+
],
|
|
5409
|
+
default: "none"
|
|
5410
|
+
}
|
|
5411
|
+
],
|
|
5412
|
+
slots: [
|
|
5413
|
+
{
|
|
5414
|
+
name: "children",
|
|
5415
|
+
description: "Main content",
|
|
5416
|
+
required: false
|
|
5417
|
+
}
|
|
5418
|
+
],
|
|
5419
|
+
events: [],
|
|
5420
|
+
examples: [
|
|
5421
|
+
{
|
|
5422
|
+
title: "Basic Usage",
|
|
5423
|
+
code: '<Header title="Dashboard" />'
|
|
5424
|
+
},
|
|
5425
|
+
{
|
|
5426
|
+
title: "E-commerce Header",
|
|
5427
|
+
code: '<Header backdropBlur elevated maxWidth="7xl">\n {#snippet start()}\n <a href="/" class="font-bold text-xl">Store</a>\n {/snippet}\n\n {#snippet nav()}\n <a href="/products">Products</a>\n <a href="/categories">Categories</a>\n <a href="/deals">Deals</a>\n {/snippet}\n\n {#snippet end()}\n <Button variant="ghost" size="icon">\n <SearchIcon />\n </Button>\n <Button variant="ghost" size="icon">\n <CartIcon />\n <Badge class="absolute -top-1 -right-1">3</Badge>\n </Button>\n <Button variant="ghost" size="icon">\n <UserIcon />\n </Button>\n {/snippet}\n</Header>'
|
|
5428
|
+
},
|
|
5429
|
+
{
|
|
5430
|
+
title: "Admin Header",
|
|
5431
|
+
code: '<Header\n showCollapseButton\n sidebarCollapsed={!sidebarOpen}\n onCollapseClick={() => (sidebarOpen = !sidebarOpen)}\n title="Admin Panel"\n>\n {#snippet end()}\n <div class="flex items-center gap-4">\n <Badge variant="outline">v2.1.0</Badge>\n <Button variant="ghost" size="icon">\n <SettingsIcon />\n </Button>\n <DropdownMenu>\n <DropdownMenu.Trigger>\n <Avatar>AD</Avatar>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content>\n <DropdownMenu.Item>Profile</DropdownMenu.Item>\n <DropdownMenu.Item>Settings</DropdownMenu.Item>\n <DropdownMenu.Separator />\n <DropdownMenu.Item>Log out</DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu>\n </div>\n {/snippet}\n</Header>'
|
|
5432
|
+
}
|
|
5433
|
+
],
|
|
5434
|
+
relatedComponents: [
|
|
5435
|
+
"Sidebar",
|
|
5436
|
+
"DashboardLayout",
|
|
5437
|
+
"PublicLayout"
|
|
5438
|
+
]
|
|
5439
|
+
},
|
|
5440
|
+
{
|
|
5441
|
+
name: "HeaderSearch",
|
|
5442
|
+
description: "Docusaurus-style search component with modal dialog and keyboard navigation",
|
|
5443
|
+
category: "navigation",
|
|
5444
|
+
importPath: "@classic-homes/theme-svelte",
|
|
5445
|
+
props: [
|
|
5446
|
+
{
|
|
5447
|
+
name: "enabled",
|
|
5448
|
+
type: "boolean",
|
|
5449
|
+
default: "true",
|
|
5450
|
+
required: false,
|
|
5451
|
+
description: "Whether search is visible"
|
|
5452
|
+
},
|
|
5453
|
+
{
|
|
5454
|
+
name: "placeholder",
|
|
5455
|
+
type: "string",
|
|
5456
|
+
default: "'Search...'",
|
|
5457
|
+
required: false,
|
|
5458
|
+
description: "Placeholder text"
|
|
5459
|
+
},
|
|
5460
|
+
{
|
|
5461
|
+
name: "onSearch",
|
|
5462
|
+
type: "(query: string) => void",
|
|
5463
|
+
required: false,
|
|
5464
|
+
description: "Search callback (debounced 200ms)"
|
|
5465
|
+
},
|
|
5466
|
+
{
|
|
5467
|
+
name: "onSelect",
|
|
5468
|
+
type: "(item: SearchResultItem) => void",
|
|
5469
|
+
required: false,
|
|
5470
|
+
description: "Selection callback"
|
|
5471
|
+
},
|
|
5472
|
+
{
|
|
5473
|
+
name: "onOpenChange",
|
|
5474
|
+
type: "(open: boolean) => void",
|
|
5475
|
+
required: false,
|
|
5476
|
+
description: "Dialog open/close callback"
|
|
5477
|
+
},
|
|
5478
|
+
{
|
|
5479
|
+
name: "results",
|
|
5480
|
+
type: "SearchResultItem[] | SearchResultGroup[]",
|
|
5481
|
+
default: "[]",
|
|
5482
|
+
required: false,
|
|
5483
|
+
description: "Search results to display"
|
|
5484
|
+
},
|
|
5485
|
+
{
|
|
5486
|
+
name: "loading",
|
|
5487
|
+
type: "boolean",
|
|
5488
|
+
default: "false",
|
|
5489
|
+
required: false,
|
|
5490
|
+
description: "Loading state"
|
|
5491
|
+
},
|
|
5492
|
+
{
|
|
5493
|
+
name: "emptyMessage",
|
|
5494
|
+
type: "string",
|
|
5495
|
+
default: "'No results found.'",
|
|
5496
|
+
required: false,
|
|
5497
|
+
description: "Empty state message"
|
|
5498
|
+
},
|
|
5499
|
+
{
|
|
5500
|
+
name: "enableShortcut",
|
|
5501
|
+
type: "boolean",
|
|
5502
|
+
default: "true",
|
|
5503
|
+
required: false,
|
|
5504
|
+
description: "Enable Cmd/Ctrl+K shortcut"
|
|
5505
|
+
},
|
|
5506
|
+
{
|
|
5507
|
+
name: "shortcutKey",
|
|
5508
|
+
type: "string",
|
|
5509
|
+
default: "'k'",
|
|
5510
|
+
required: false,
|
|
5511
|
+
description: "Custom shortcut key"
|
|
5512
|
+
},
|
|
5513
|
+
{
|
|
5514
|
+
name: "variant",
|
|
5515
|
+
type: "'default' | 'icon'",
|
|
5516
|
+
default: "'default'",
|
|
5517
|
+
required: false,
|
|
5518
|
+
description: "Trigger button style"
|
|
5519
|
+
},
|
|
5520
|
+
{
|
|
5521
|
+
name: "size",
|
|
5522
|
+
type: "'sm' | 'md'",
|
|
5523
|
+
default: "'md'",
|
|
5524
|
+
required: false,
|
|
5525
|
+
description: "Trigger button size"
|
|
5526
|
+
},
|
|
5527
|
+
{
|
|
5528
|
+
name: "renderResult",
|
|
5529
|
+
type: "Snippet<[item, isSelected]>",
|
|
5530
|
+
required: false,
|
|
5531
|
+
description: "Custom result renderer"
|
|
5532
|
+
},
|
|
5533
|
+
{
|
|
5534
|
+
name: "renderEmpty",
|
|
5535
|
+
type: "Snippet",
|
|
5536
|
+
required: false,
|
|
5537
|
+
description: "Custom empty state renderer"
|
|
5538
|
+
},
|
|
5539
|
+
{
|
|
5540
|
+
name: "class",
|
|
5541
|
+
type: "string",
|
|
5542
|
+
required: false,
|
|
5543
|
+
description: "Additional classes for trigger"
|
|
5544
|
+
}
|
|
5545
|
+
],
|
|
5546
|
+
variants: [
|
|
5547
|
+
{
|
|
5548
|
+
name: "variant",
|
|
5549
|
+
values: [
|
|
5550
|
+
"default",
|
|
5551
|
+
"icon"
|
|
5552
|
+
],
|
|
5553
|
+
default: "default"
|
|
5554
|
+
},
|
|
5555
|
+
{
|
|
5556
|
+
name: "size",
|
|
3138
5557
|
values: [
|
|
3139
|
-
"none",
|
|
3140
5558
|
"sm",
|
|
3141
|
-
"
|
|
5559
|
+
"md"
|
|
3142
5560
|
],
|
|
3143
|
-
default: "
|
|
5561
|
+
default: "md"
|
|
3144
5562
|
}
|
|
3145
5563
|
],
|
|
3146
5564
|
slots: [
|
|
@@ -3154,21 +5572,38 @@ var component_catalog_default = {
|
|
|
3154
5572
|
examples: [
|
|
3155
5573
|
{
|
|
3156
5574
|
title: "Basic Usage",
|
|
3157
|
-
code: '<
|
|
5575
|
+
code: '<script>\n let results: SearchResultItem[] = $state([]);\n let loading = $state(false);\n\n async function handleSearch(query: string) {\n loading = true;\n results = await fetchSearchResults(query);\n loading = false;\n }\n\n function handleSelect(item: SearchResultItem) {\n goto(item.href);\n }\n</script>\n\n<HeaderSearch\n enabled={true}\n placeholder="Search..."\n onSearch={handleSearch}\n onSelect={handleSelect}\n {results}\n {loading}\n/>'
|
|
3158
5576
|
},
|
|
3159
5577
|
{
|
|
3160
|
-
title: "
|
|
3161
|
-
|
|
5578
|
+
title: "Default",
|
|
5579
|
+
description: "Full search box with placeholder and keyboard shortcut hint:",
|
|
5580
|
+
code: '<HeaderSearch variant="default" />'
|
|
3162
5581
|
},
|
|
3163
5582
|
{
|
|
3164
|
-
title: "
|
|
3165
|
-
|
|
5583
|
+
title: "Icon",
|
|
5584
|
+
description: "Compact icon-only button:",
|
|
5585
|
+
code: '<HeaderSearch variant="icon" />'
|
|
5586
|
+
},
|
|
5587
|
+
{
|
|
5588
|
+
title: "In Header",
|
|
5589
|
+
code: '<Header>\n <div slot="actions">\n <HeaderSearch onSearch={handleSearch} onSelect={handleSelect} {results} />\n </div>\n</Header>'
|
|
5590
|
+
},
|
|
5591
|
+
{
|
|
5592
|
+
title: "Grouped Results",
|
|
5593
|
+
code: "<script>\n const groupedResults = [\n {\n title: 'Components',\n items: [\n { id: '1', title: 'Button', href: '/docs/button' },\n { id: '2', title: 'Card', href: '/docs/card' },\n ],\n },\n {\n title: 'Guides',\n items: [{ id: '3', title: 'Getting Started', href: '/guides/start' }],\n },\n ];\n</script>\n\n<HeaderSearch results={groupedResults} />"
|
|
5594
|
+
},
|
|
5595
|
+
{
|
|
5596
|
+
title: "Custom Result Rendering",
|
|
5597
|
+
code: '<HeaderSearch {results}>\n {#snippet renderResult(item, isSelected)}\n <div class="flex items-center gap-2">\n <Icon name={item.icon} />\n <span>{item.title}</span>\n {#if item.badge}\n <Badge>{item.badge}</Badge>\n {/if}\n </div>\n {/snippet}\n</HeaderSearch>'
|
|
5598
|
+
},
|
|
5599
|
+
{
|
|
5600
|
+
title: "Custom Empty State",
|
|
5601
|
+
code: '<HeaderSearch {results}>\n {#snippet renderEmpty()}\n <div class="text-center py-8">\n <Icon name="search" class="h-8 w-8 mx-auto mb-2 text-muted-foreground" />\n <p>No results found</p>\n <a href="/help" class="text-primary">Need help?</a>\n </div>\n {/snippet}\n</HeaderSearch>'
|
|
3166
5602
|
}
|
|
3167
5603
|
],
|
|
3168
5604
|
relatedComponents: [
|
|
3169
|
-
"
|
|
3170
|
-
"
|
|
3171
|
-
"PublicLayout"
|
|
5605
|
+
"Header",
|
|
5606
|
+
"Dialog"
|
|
3172
5607
|
]
|
|
3173
5608
|
},
|
|
3174
5609
|
{
|
|
@@ -3176,8 +5611,77 @@ var component_catalog_default = {
|
|
|
3176
5611
|
description: "Matrix data visualization with color intensity",
|
|
3177
5612
|
category: "chart",
|
|
3178
5613
|
importPath: "@classic-homes/charts-svelte",
|
|
3179
|
-
props: [
|
|
3180
|
-
|
|
5614
|
+
props: [
|
|
5615
|
+
{
|
|
5616
|
+
name: "data",
|
|
5617
|
+
type: "HeatmapData",
|
|
5618
|
+
required: true,
|
|
5619
|
+
description: "Matrix data with coordinates and values"
|
|
5620
|
+
},
|
|
5621
|
+
{
|
|
5622
|
+
name: "xAxis",
|
|
5623
|
+
type: "string[]",
|
|
5624
|
+
required: true,
|
|
5625
|
+
description: "X-axis labels"
|
|
5626
|
+
},
|
|
5627
|
+
{
|
|
5628
|
+
name: "yAxis",
|
|
5629
|
+
type: "string[]",
|
|
5630
|
+
required: true,
|
|
5631
|
+
description: "Y-axis labels"
|
|
5632
|
+
},
|
|
5633
|
+
{
|
|
5634
|
+
name: "showValues",
|
|
5635
|
+
type: "boolean",
|
|
5636
|
+
default: "false",
|
|
5637
|
+
required: false,
|
|
5638
|
+
description: "Display values in cells"
|
|
5639
|
+
},
|
|
5640
|
+
{
|
|
5641
|
+
name: "onClick",
|
|
5642
|
+
type: "(params: HeatmapEventParams) => void",
|
|
5643
|
+
required: false,
|
|
5644
|
+
description: "Callback when clicked"
|
|
5645
|
+
},
|
|
5646
|
+
{
|
|
5647
|
+
name: "title",
|
|
5648
|
+
type: "string",
|
|
5649
|
+
required: true,
|
|
5650
|
+
description: "Chart title for accessibility"
|
|
5651
|
+
},
|
|
5652
|
+
{
|
|
5653
|
+
name: "height",
|
|
5654
|
+
type: "number | string",
|
|
5655
|
+
default: "400",
|
|
5656
|
+
required: false,
|
|
5657
|
+
description: "Chart height"
|
|
5658
|
+
},
|
|
5659
|
+
{
|
|
5660
|
+
name: "theme",
|
|
5661
|
+
type: "'light' | 'dark' | 'auto'",
|
|
5662
|
+
default: "'auto'",
|
|
5663
|
+
required: false,
|
|
5664
|
+
description: "Theme preference"
|
|
5665
|
+
},
|
|
5666
|
+
{
|
|
5667
|
+
name: "showTooltip",
|
|
5668
|
+
type: "boolean",
|
|
5669
|
+
default: "true",
|
|
5670
|
+
required: false,
|
|
5671
|
+
description: "Show tooltip on hover"
|
|
5672
|
+
}
|
|
5673
|
+
],
|
|
5674
|
+
variants: [
|
|
5675
|
+
{
|
|
5676
|
+
name: "theme",
|
|
5677
|
+
values: [
|
|
5678
|
+
"light",
|
|
5679
|
+
"dark",
|
|
5680
|
+
"auto"
|
|
5681
|
+
],
|
|
5682
|
+
default: "auto"
|
|
5683
|
+
}
|
|
5684
|
+
],
|
|
3181
5685
|
slots: [],
|
|
3182
5686
|
events: [],
|
|
3183
5687
|
examples: [
|
|
@@ -3630,8 +6134,138 @@ var component_catalog_default = {
|
|
|
3630
6134
|
description: "Display trends over time with smooth curves and area fill options",
|
|
3631
6135
|
category: "chart",
|
|
3632
6136
|
importPath: "@classic-homes/charts-svelte",
|
|
3633
|
-
props: [
|
|
3634
|
-
|
|
6137
|
+
props: [
|
|
6138
|
+
{
|
|
6139
|
+
name: "data",
|
|
6140
|
+
type: "LineChartData",
|
|
6141
|
+
required: true,
|
|
6142
|
+
description: "Chart data with categories and series"
|
|
6143
|
+
},
|
|
6144
|
+
{
|
|
6145
|
+
name: "smooth",
|
|
6146
|
+
type: "boolean",
|
|
6147
|
+
default: "false",
|
|
6148
|
+
required: false,
|
|
6149
|
+
description: "Use smooth curved lines instead of straight segments"
|
|
6150
|
+
},
|
|
6151
|
+
{
|
|
6152
|
+
name: "areaFilled",
|
|
6153
|
+
type: "boolean",
|
|
6154
|
+
default: "false",
|
|
6155
|
+
required: false,
|
|
6156
|
+
description: "Fill the area under the line"
|
|
6157
|
+
},
|
|
6158
|
+
{
|
|
6159
|
+
name: "showDataPoints",
|
|
6160
|
+
type: "boolean",
|
|
6161
|
+
default: "false",
|
|
6162
|
+
required: false,
|
|
6163
|
+
description: "Show data point markers on the line"
|
|
6164
|
+
},
|
|
6165
|
+
{
|
|
6166
|
+
name: "stacked",
|
|
6167
|
+
type: "boolean",
|
|
6168
|
+
default: "false",
|
|
6169
|
+
required: false,
|
|
6170
|
+
description: "Stack multiple series on top of each other"
|
|
6171
|
+
},
|
|
6172
|
+
{
|
|
6173
|
+
name: "onClick",
|
|
6174
|
+
type: "(params: DataPointEventParams) => void",
|
|
6175
|
+
required: false,
|
|
6176
|
+
description: "Callback when a data point is clicked"
|
|
6177
|
+
},
|
|
6178
|
+
{
|
|
6179
|
+
name: "onHover",
|
|
6180
|
+
type: "(params: DataPointEventParams) => void",
|
|
6181
|
+
required: false,
|
|
6182
|
+
description: "Callback when hovering over a data point"
|
|
6183
|
+
},
|
|
6184
|
+
{
|
|
6185
|
+
name: "title",
|
|
6186
|
+
type: "string",
|
|
6187
|
+
required: true,
|
|
6188
|
+
description: "Chart title for accessibility (aria-label)"
|
|
6189
|
+
},
|
|
6190
|
+
{
|
|
6191
|
+
name: "description",
|
|
6192
|
+
type: "string",
|
|
6193
|
+
required: false,
|
|
6194
|
+
description: "Optional description for screen readers"
|
|
6195
|
+
},
|
|
6196
|
+
{
|
|
6197
|
+
name: "height",
|
|
6198
|
+
type: "number | string",
|
|
6199
|
+
default: "400",
|
|
6200
|
+
required: false,
|
|
6201
|
+
description: "Chart height in pixels or CSS value"
|
|
6202
|
+
},
|
|
6203
|
+
{
|
|
6204
|
+
name: "loading",
|
|
6205
|
+
type: "boolean",
|
|
6206
|
+
default: "false",
|
|
6207
|
+
required: false,
|
|
6208
|
+
description: "Show loading skeleton"
|
|
6209
|
+
},
|
|
6210
|
+
{
|
|
6211
|
+
name: "error",
|
|
6212
|
+
type: "string | null",
|
|
6213
|
+
required: false,
|
|
6214
|
+
description: "Error message to display"
|
|
6215
|
+
},
|
|
6216
|
+
{
|
|
6217
|
+
name: "theme",
|
|
6218
|
+
type: "'light' | 'dark' | 'auto'",
|
|
6219
|
+
default: "'auto'",
|
|
6220
|
+
required: false,
|
|
6221
|
+
description: "Theme preference"
|
|
6222
|
+
},
|
|
6223
|
+
{
|
|
6224
|
+
name: "animation",
|
|
6225
|
+
type: "boolean",
|
|
6226
|
+
default: "true",
|
|
6227
|
+
required: false,
|
|
6228
|
+
description: "Enable/disable animations"
|
|
6229
|
+
},
|
|
6230
|
+
{
|
|
6231
|
+
name: "showLegend",
|
|
6232
|
+
type: "boolean",
|
|
6233
|
+
default: "true",
|
|
6234
|
+
required: false,
|
|
6235
|
+
description: "Show chart legend"
|
|
6236
|
+
},
|
|
6237
|
+
{
|
|
6238
|
+
name: "showTooltip",
|
|
6239
|
+
type: "boolean",
|
|
6240
|
+
default: "true",
|
|
6241
|
+
required: false,
|
|
6242
|
+
description: "Show tooltip on hover"
|
|
6243
|
+
},
|
|
6244
|
+
{
|
|
6245
|
+
name: "showGrid",
|
|
6246
|
+
type: "boolean",
|
|
6247
|
+
default: "true",
|
|
6248
|
+
required: false,
|
|
6249
|
+
description: "Show grid lines"
|
|
6250
|
+
},
|
|
6251
|
+
{
|
|
6252
|
+
name: "class",
|
|
6253
|
+
type: "string",
|
|
6254
|
+
required: false,
|
|
6255
|
+
description: "Custom CSS class"
|
|
6256
|
+
}
|
|
6257
|
+
],
|
|
6258
|
+
variants: [
|
|
6259
|
+
{
|
|
6260
|
+
name: "theme",
|
|
6261
|
+
values: [
|
|
6262
|
+
"light",
|
|
6263
|
+
"dark",
|
|
6264
|
+
"auto"
|
|
6265
|
+
],
|
|
6266
|
+
default: "auto"
|
|
6267
|
+
}
|
|
6268
|
+
],
|
|
3635
6269
|
slots: [],
|
|
3636
6270
|
events: [],
|
|
3637
6271
|
examples: [
|
|
@@ -4002,29 +6636,137 @@ var component_catalog_default = {
|
|
|
4002
6636
|
description: "Disables the select"
|
|
4003
6637
|
},
|
|
4004
6638
|
{
|
|
4005
|
-
name: "required",
|
|
4006
|
-
type: "boolean",
|
|
4007
|
-
default: "false",
|
|
4008
|
-
required: false,
|
|
4009
|
-
description: "Marks as required"
|
|
6639
|
+
name: "required",
|
|
6640
|
+
type: "boolean",
|
|
6641
|
+
default: "false",
|
|
6642
|
+
required: false,
|
|
6643
|
+
description: "Marks as required"
|
|
6644
|
+
},
|
|
6645
|
+
{
|
|
6646
|
+
name: "maxItems",
|
|
6647
|
+
type: "number",
|
|
6648
|
+
required: false,
|
|
6649
|
+
description: "Maximum selections allowed"
|
|
6650
|
+
},
|
|
6651
|
+
{
|
|
6652
|
+
name: "error",
|
|
6653
|
+
type: "string",
|
|
6654
|
+
required: false,
|
|
6655
|
+
description: "Error message"
|
|
6656
|
+
},
|
|
6657
|
+
{
|
|
6658
|
+
name: "onValueChange",
|
|
6659
|
+
type: "(value: string[]) => void",
|
|
6660
|
+
required: false,
|
|
6661
|
+
description: "Callback when value changes"
|
|
6662
|
+
}
|
|
6663
|
+
],
|
|
6664
|
+
variants: [],
|
|
6665
|
+
slots: [
|
|
6666
|
+
{
|
|
6667
|
+
name: "children",
|
|
6668
|
+
description: "Main content",
|
|
6669
|
+
required: false
|
|
6670
|
+
}
|
|
6671
|
+
],
|
|
6672
|
+
events: [],
|
|
6673
|
+
examples: [
|
|
6674
|
+
{
|
|
6675
|
+
title: "Basic Usage",
|
|
6676
|
+
code: `<script>
|
|
6677
|
+
let selected = $state([]);
|
|
6678
|
+
|
|
6679
|
+
const options = [
|
|
6680
|
+
{ value: 'react', label: 'React' },
|
|
6681
|
+
{ value: 'svelte', label: 'Svelte' },
|
|
6682
|
+
{ value: 'vue', label: 'Vue' },
|
|
6683
|
+
{ value: 'angular', label: 'Angular' },
|
|
6684
|
+
];
|
|
6685
|
+
</script>
|
|
6686
|
+
|
|
6687
|
+
<MultiSelect {options} bind:value={selected} placeholder="Select frameworks..." />`
|
|
6688
|
+
},
|
|
6689
|
+
{
|
|
6690
|
+
title: "Tag Selector",
|
|
6691
|
+
code: `<script>
|
|
6692
|
+
let tags = $state([]);
|
|
6693
|
+
const tagOptions = [
|
|
6694
|
+
{ value: 'urgent', label: 'Urgent' },
|
|
6695
|
+
{ value: 'bug', label: 'Bug' },
|
|
6696
|
+
{ value: 'feature', label: 'Feature' },
|
|
6697
|
+
{ value: 'docs', label: 'Documentation' },
|
|
6698
|
+
];
|
|
6699
|
+
</script>
|
|
6700
|
+
|
|
6701
|
+
<MultiSelect label="Tags" options={tagOptions} bind:value={tags} placeholder="Add tags..." />`
|
|
6702
|
+
},
|
|
6703
|
+
{
|
|
6704
|
+
title: "Team Members",
|
|
6705
|
+
code: '<MultiSelect\n label="Assign to"\n options={teamMembers}\n bind:value={assignees}\n maxItems={5}\n placeholder="Select team members..."\n/>'
|
|
6706
|
+
}
|
|
6707
|
+
],
|
|
6708
|
+
relatedComponents: [
|
|
6709
|
+
"Select",
|
|
6710
|
+
"Combobox",
|
|
6711
|
+
"Checkbox"
|
|
6712
|
+
]
|
|
6713
|
+
},
|
|
6714
|
+
{
|
|
6715
|
+
name: "NoticeBanner",
|
|
6716
|
+
description: "Banner component for displaying scheduled, dismissible announcements",
|
|
6717
|
+
category: "feedback",
|
|
6718
|
+
importPath: "@classic-homes/theme-svelte",
|
|
6719
|
+
props: [
|
|
6720
|
+
{
|
|
6721
|
+
name: "class",
|
|
6722
|
+
type: "string",
|
|
6723
|
+
required: false,
|
|
6724
|
+
description: "Additional CSS classes"
|
|
6725
|
+
}
|
|
6726
|
+
],
|
|
6727
|
+
variants: [],
|
|
6728
|
+
slots: [
|
|
6729
|
+
{
|
|
6730
|
+
name: "children",
|
|
6731
|
+
description: "Main content",
|
|
6732
|
+
required: false
|
|
6733
|
+
}
|
|
6734
|
+
],
|
|
6735
|
+
events: [],
|
|
6736
|
+
examples: [
|
|
6737
|
+
{
|
|
6738
|
+
title: "Maintenance Notice",
|
|
6739
|
+
code: "<script>\n const notices = [\n {\n id: 'maintenance',\n title: 'Scheduled Maintenance',\n message: 'The system will be unavailable on Sunday 2-4 AM EST.',\n variant: 'warning',\n location: 'banner',\n dismissible: true,\n startDate: '2025-01-15',\n endDate: '2025-01-20',\n },\n ];\n\n initializeNotices(notices);\n</script>\n\n<NoticeBanner />"
|
|
4010
6740
|
},
|
|
4011
6741
|
{
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
required: false,
|
|
4015
|
-
description: "Maximum selections allowed"
|
|
6742
|
+
title: "With Link",
|
|
6743
|
+
code: "<script>\n const notices = [\n {\n id: 'new-feature',\n message: 'Check out our new dashboard features!',\n variant: 'info',\n location: 'banner',\n link: {\n text: 'Learn more',\n href: '/whats-new',\n },\n },\n ];\n</script>\n\n<NoticeBanner />"
|
|
4016
6744
|
},
|
|
4017
6745
|
{
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
required: false,
|
|
4021
|
-
description: "Error message"
|
|
6746
|
+
title: "Page-Specific Notice",
|
|
6747
|
+
code: "<script>\n const notices = [\n {\n id: 'billing-update',\n message: 'Your payment method will expire soon.',\n variant: 'warning',\n location: 'banner',\n pages: ['/settings', '/billing'],\n },\n ];\n\n initializeNotices(notices);\n setCurrentPath('/billing'); // Notice will show\n</script>\n\n<NoticeBanner />"
|
|
4022
6748
|
},
|
|
4023
6749
|
{
|
|
4024
|
-
|
|
4025
|
-
|
|
6750
|
+
title: "In Layout",
|
|
6751
|
+
code: "<!-- +layout.svelte -->\n<NoticeBanner />\n\n<main>\n <slot />\n</main>"
|
|
6752
|
+
}
|
|
6753
|
+
],
|
|
6754
|
+
relatedComponents: [
|
|
6755
|
+
"NoticeCard",
|
|
6756
|
+
"Alert"
|
|
6757
|
+
]
|
|
6758
|
+
},
|
|
6759
|
+
{
|
|
6760
|
+
name: "NoticeCard",
|
|
6761
|
+
description: "Card-style component for displaying inline scheduled announcements",
|
|
6762
|
+
category: "feedback",
|
|
6763
|
+
importPath: "@classic-homes/theme-svelte",
|
|
6764
|
+
props: [
|
|
6765
|
+
{
|
|
6766
|
+
name: "class",
|
|
6767
|
+
type: "string",
|
|
4026
6768
|
required: false,
|
|
4027
|
-
description: "
|
|
6769
|
+
description: "Additional CSS classes"
|
|
4028
6770
|
}
|
|
4029
6771
|
],
|
|
4030
6772
|
variants: [],
|
|
@@ -4039,42 +6781,62 @@ var component_catalog_default = {
|
|
|
4039
6781
|
examples: [
|
|
4040
6782
|
{
|
|
4041
6783
|
title: "Basic Usage",
|
|
6784
|
+
code: "<script>\n import { NoticeCard, initializeNotices, setCurrentPath } from '@classic-homes/theme-svelte';\n\n const notices = [\n {\n id: 'welcome',\n title: 'Welcome!',\n message: 'Thanks for signing up. Complete your profile to get started.',\n variant: 'info',\n location: 'card',\n dismissible: true,\n },\n ];\n\n initializeNotices(notices);\n setCurrentPath('/dashboard');\n</script>\n\n<NoticeCard />"
|
|
6785
|
+
},
|
|
6786
|
+
{
|
|
6787
|
+
title: "Welcome Message",
|
|
6788
|
+
code: "<script>\n const notices = [\n {\n id: 'onboarding',\n title: 'Complete Your Profile',\n message: 'Add a photo and bio to help others recognize you.',\n variant: 'info',\n location: 'card',\n link: {\n text: 'Edit profile',\n href: '/settings/profile',\n },\n },\n ];\n</script>\n\n<NoticeCard />"
|
|
6789
|
+
},
|
|
6790
|
+
{
|
|
6791
|
+
title: "Feature Announcement",
|
|
4042
6792
|
code: `<script>
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
6793
|
+
const notices = [
|
|
6794
|
+
{
|
|
6795
|
+
id: 'new-charts',
|
|
6796
|
+
title: 'New Charts Available',
|
|
6797
|
+
message: "We've added 5 new chart types to your dashboard.",
|
|
6798
|
+
variant: 'success',
|
|
6799
|
+
location: 'card',
|
|
6800
|
+
startDate: '2025-01-01',
|
|
6801
|
+
endDate: '2025-01-31',
|
|
6802
|
+
},
|
|
4050
6803
|
];
|
|
4051
6804
|
</script>
|
|
4052
6805
|
|
|
4053
|
-
<
|
|
6806
|
+
<NoticeCard />`
|
|
4054
6807
|
},
|
|
4055
6808
|
{
|
|
4056
|
-
title: "
|
|
6809
|
+
title: "Warning Notice",
|
|
4057
6810
|
code: `<script>
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
6811
|
+
const notices = [
|
|
6812
|
+
{
|
|
6813
|
+
id: 'storage-limit',
|
|
6814
|
+
message: "You're approaching your storage limit. Upgrade to continue uploading.",
|
|
6815
|
+
variant: 'warning',
|
|
6816
|
+
location: 'card',
|
|
6817
|
+
pages: ['/dashboard', '/files'],
|
|
6818
|
+
link: {
|
|
6819
|
+
text: 'Upgrade plan',
|
|
6820
|
+
href: '/billing/upgrade',
|
|
6821
|
+
},
|
|
6822
|
+
},
|
|
4064
6823
|
];
|
|
4065
6824
|
</script>
|
|
4066
6825
|
|
|
4067
|
-
<
|
|
6826
|
+
<NoticeCard />`
|
|
4068
6827
|
},
|
|
4069
6828
|
{
|
|
4070
|
-
title: "
|
|
4071
|
-
code: '<
|
|
6829
|
+
title: "In Page Content",
|
|
6830
|
+
code: '<div class="space-y-4">\n <NoticeCard />\n\n <Card>\n <CardHeader>\n <CardTitle>Dashboard</CardTitle>\n </CardHeader>\n <CardContent>\n <!-- Main content -->\n </CardContent>\n </Card>\n</div>'
|
|
6831
|
+
},
|
|
6832
|
+
{
|
|
6833
|
+
title: "Custom Styling",
|
|
6834
|
+
code: '<NoticeCard class="mb-6" />'
|
|
4072
6835
|
}
|
|
4073
6836
|
],
|
|
4074
6837
|
relatedComponents: [
|
|
4075
|
-
"
|
|
4076
|
-
"
|
|
4077
|
-
"Checkbox"
|
|
6838
|
+
"NoticeBanner",
|
|
6839
|
+
"Alert"
|
|
4078
6840
|
]
|
|
4079
6841
|
},
|
|
4080
6842
|
{
|
|
@@ -4418,8 +7180,94 @@ var component_catalog_default = {
|
|
|
4418
7180
|
description: "Show proportional data with interactive labels",
|
|
4419
7181
|
category: "chart",
|
|
4420
7182
|
importPath: "@classic-homes/charts-svelte",
|
|
4421
|
-
props: [
|
|
4422
|
-
|
|
7183
|
+
props: [
|
|
7184
|
+
{
|
|
7185
|
+
name: "data",
|
|
7186
|
+
type: "PieSliceData[]",
|
|
7187
|
+
required: true,
|
|
7188
|
+
description: "Array of slice data with name and value"
|
|
7189
|
+
},
|
|
7190
|
+
{
|
|
7191
|
+
name: "showLabels",
|
|
7192
|
+
type: "boolean",
|
|
7193
|
+
default: "false",
|
|
7194
|
+
required: false,
|
|
7195
|
+
description: "Show labels on slices"
|
|
7196
|
+
},
|
|
7197
|
+
{
|
|
7198
|
+
name: "labelPosition",
|
|
7199
|
+
type: "'inside' | 'outside'",
|
|
7200
|
+
default: "'outside'",
|
|
7201
|
+
required: false,
|
|
7202
|
+
description: "Position of slice labels"
|
|
7203
|
+
},
|
|
7204
|
+
{
|
|
7205
|
+
name: "innerRadius",
|
|
7206
|
+
type: "number | string",
|
|
7207
|
+
default: "0",
|
|
7208
|
+
required: false,
|
|
7209
|
+
description: "Inner radius (0 for solid pie)"
|
|
7210
|
+
},
|
|
7211
|
+
{
|
|
7212
|
+
name: "onClick",
|
|
7213
|
+
type: "(params: SliceEventParams) => void",
|
|
7214
|
+
required: false,
|
|
7215
|
+
description: "Callback when a slice is clicked"
|
|
7216
|
+
},
|
|
7217
|
+
{
|
|
7218
|
+
name: "title",
|
|
7219
|
+
type: "string",
|
|
7220
|
+
required: true,
|
|
7221
|
+
description: "Chart title for accessibility"
|
|
7222
|
+
},
|
|
7223
|
+
{
|
|
7224
|
+
name: "height",
|
|
7225
|
+
type: "number | string",
|
|
7226
|
+
default: "400",
|
|
7227
|
+
required: false,
|
|
7228
|
+
description: "Chart height"
|
|
7229
|
+
},
|
|
7230
|
+
{
|
|
7231
|
+
name: "theme",
|
|
7232
|
+
type: "'light' | 'dark' | 'auto'",
|
|
7233
|
+
default: "'auto'",
|
|
7234
|
+
required: false,
|
|
7235
|
+
description: "Theme preference"
|
|
7236
|
+
},
|
|
7237
|
+
{
|
|
7238
|
+
name: "showLegend",
|
|
7239
|
+
type: "boolean",
|
|
7240
|
+
default: "true",
|
|
7241
|
+
required: false,
|
|
7242
|
+
description: "Show chart legend"
|
|
7243
|
+
},
|
|
7244
|
+
{
|
|
7245
|
+
name: "showTooltip",
|
|
7246
|
+
type: "boolean",
|
|
7247
|
+
default: "true",
|
|
7248
|
+
required: false,
|
|
7249
|
+
description: "Show tooltip on hover"
|
|
7250
|
+
}
|
|
7251
|
+
],
|
|
7252
|
+
variants: [
|
|
7253
|
+
{
|
|
7254
|
+
name: "labelPosition",
|
|
7255
|
+
values: [
|
|
7256
|
+
"inside",
|
|
7257
|
+
"outside"
|
|
7258
|
+
],
|
|
7259
|
+
default: "outside"
|
|
7260
|
+
},
|
|
7261
|
+
{
|
|
7262
|
+
name: "theme",
|
|
7263
|
+
values: [
|
|
7264
|
+
"light",
|
|
7265
|
+
"dark",
|
|
7266
|
+
"auto"
|
|
7267
|
+
],
|
|
7268
|
+
default: "auto"
|
|
7269
|
+
}
|
|
7270
|
+
],
|
|
4423
7271
|
slots: [],
|
|
4424
7272
|
events: [],
|
|
4425
7273
|
examples: [
|
|
@@ -4599,19 +7447,210 @@ var component_catalog_default = {
|
|
|
4599
7447
|
</PublicLayout>`
|
|
4600
7448
|
}
|
|
4601
7449
|
],
|
|
4602
|
-
relatedComponents: [
|
|
4603
|
-
"Header",
|
|
4604
|
-
"Footer",
|
|
4605
|
-
"DashboardLayout"
|
|
4606
|
-
]
|
|
4607
|
-
},
|
|
4608
|
-
{
|
|
4609
|
-
name: "
|
|
4610
|
-
description: "
|
|
4611
|
-
category: "
|
|
4612
|
-
importPath: "@classic-homes/
|
|
4613
|
-
props: [
|
|
4614
|
-
|
|
7450
|
+
relatedComponents: [
|
|
7451
|
+
"Header",
|
|
7452
|
+
"Footer",
|
|
7453
|
+
"DashboardLayout"
|
|
7454
|
+
]
|
|
7455
|
+
},
|
|
7456
|
+
{
|
|
7457
|
+
name: "QuickLinks",
|
|
7458
|
+
description: "Quick navigation links component for sidebars",
|
|
7459
|
+
category: "navigation",
|
|
7460
|
+
importPath: "@classic-homes/theme-svelte",
|
|
7461
|
+
props: [
|
|
7462
|
+
{
|
|
7463
|
+
name: "links",
|
|
7464
|
+
type: "QuickLink[]",
|
|
7465
|
+
required: false,
|
|
7466
|
+
description: "Array of quick link items (required)"
|
|
7467
|
+
},
|
|
7468
|
+
{
|
|
7469
|
+
name: "display",
|
|
7470
|
+
type: "'list' | 'icons'",
|
|
7471
|
+
default: "'list'",
|
|
7472
|
+
required: false,
|
|
7473
|
+
description: "Display mode"
|
|
7474
|
+
},
|
|
7475
|
+
{
|
|
7476
|
+
name: "variant",
|
|
7477
|
+
type: "'light' | 'dark'",
|
|
7478
|
+
default: "'light'",
|
|
7479
|
+
required: false,
|
|
7480
|
+
description: "Visual variant"
|
|
7481
|
+
},
|
|
7482
|
+
{
|
|
7483
|
+
name: "icon",
|
|
7484
|
+
type: "Snippet<[QuickLink]>",
|
|
7485
|
+
required: false,
|
|
7486
|
+
description: "Custom icon renderer"
|
|
7487
|
+
},
|
|
7488
|
+
{
|
|
7489
|
+
name: "ariaLabel",
|
|
7490
|
+
type: "string",
|
|
7491
|
+
default: "'Quick links'",
|
|
7492
|
+
required: false,
|
|
7493
|
+
description: "Accessible navigation label"
|
|
7494
|
+
},
|
|
7495
|
+
{
|
|
7496
|
+
name: "class",
|
|
7497
|
+
type: "string",
|
|
7498
|
+
required: false,
|
|
7499
|
+
description: "Additional CSS classes"
|
|
7500
|
+
}
|
|
7501
|
+
],
|
|
7502
|
+
variants: [
|
|
7503
|
+
{
|
|
7504
|
+
name: "display",
|
|
7505
|
+
values: [
|
|
7506
|
+
"list",
|
|
7507
|
+
"icons"
|
|
7508
|
+
],
|
|
7509
|
+
default: "list"
|
|
7510
|
+
},
|
|
7511
|
+
{
|
|
7512
|
+
name: "variant",
|
|
7513
|
+
values: [
|
|
7514
|
+
"light",
|
|
7515
|
+
"dark"
|
|
7516
|
+
],
|
|
7517
|
+
default: "light"
|
|
7518
|
+
}
|
|
7519
|
+
],
|
|
7520
|
+
slots: [
|
|
7521
|
+
{
|
|
7522
|
+
name: "children",
|
|
7523
|
+
description: "Main content",
|
|
7524
|
+
required: false
|
|
7525
|
+
}
|
|
7526
|
+
],
|
|
7527
|
+
events: [],
|
|
7528
|
+
examples: [
|
|
7529
|
+
{
|
|
7530
|
+
title: "Basic Usage",
|
|
7531
|
+
code: "<script>\n const links: QuickLink[] = [\n { id: 'docs', label: 'Documentation', href: '/docs', icon: 'book' },\n { id: 'support', label: 'Support', href: '/support', icon: 'help' },\n { id: 'github', label: 'GitHub', href: 'https://github.com', icon: 'github', external: true },\n ];\n</script>\n\n<QuickLinks {links} />"
|
|
7532
|
+
},
|
|
7533
|
+
{
|
|
7534
|
+
title: "List Mode (Default)",
|
|
7535
|
+
description: "Shows icons with labels stacked vertically:",
|
|
7536
|
+
code: '<QuickLinks {links} display="list" />'
|
|
7537
|
+
},
|
|
7538
|
+
{
|
|
7539
|
+
title: "Icons Mode",
|
|
7540
|
+
description: "Shows only icons, centered:",
|
|
7541
|
+
code: '<QuickLinks {links} display="icons" />'
|
|
7542
|
+
},
|
|
7543
|
+
{
|
|
7544
|
+
title: "Light (Default)",
|
|
7545
|
+
description: "For light backgrounds:",
|
|
7546
|
+
code: '<QuickLinks {links} variant="light" />'
|
|
7547
|
+
},
|
|
7548
|
+
{
|
|
7549
|
+
title: "Dark",
|
|
7550
|
+
description: "For dark sidebars:",
|
|
7551
|
+
code: '<QuickLinks {links} variant="dark" />'
|
|
7552
|
+
},
|
|
7553
|
+
{
|
|
7554
|
+
title: "With Badges",
|
|
7555
|
+
code: "<script>\n const links = [\n { id: 'inbox', label: 'Inbox', href: '/inbox', icon: 'mail', badge: 5 },\n { id: 'tasks', label: 'Tasks', href: '/tasks', icon: 'check', badge: '3 new' },\n ];\n</script>\n\n<QuickLinks {links} />"
|
|
7556
|
+
},
|
|
7557
|
+
{
|
|
7558
|
+
title: "External Links",
|
|
7559
|
+
code: "<script>\n const links = [{ id: 'docs', label: 'Docs', href: 'https://docs.example.com', external: true }];\n</script>\n\n<QuickLinks {links} />"
|
|
7560
|
+
},
|
|
7561
|
+
{
|
|
7562
|
+
title: "Custom Icons",
|
|
7563
|
+
code: '<QuickLinks {links}>\n {#snippet icon(link)}\n <Icon name={link.icon} class="h-5 w-5" />\n {/snippet}\n</QuickLinks>'
|
|
7564
|
+
},
|
|
7565
|
+
{
|
|
7566
|
+
title: "In Sidebar",
|
|
7567
|
+
code: '<Sidebar>\n <!-- Main navigation -->\n <div slot="footer">\n <QuickLinks {links} display="icons" variant="dark" />\n </div>\n</Sidebar>'
|
|
7568
|
+
}
|
|
7569
|
+
],
|
|
7570
|
+
relatedComponents: [
|
|
7571
|
+
"Sidebar",
|
|
7572
|
+
"DashboardLayout"
|
|
7573
|
+
]
|
|
7574
|
+
},
|
|
7575
|
+
{
|
|
7576
|
+
name: "RadarChart",
|
|
7577
|
+
description: "Multi-dimensional comparison across categories",
|
|
7578
|
+
category: "chart",
|
|
7579
|
+
importPath: "@classic-homes/charts-svelte",
|
|
7580
|
+
props: [
|
|
7581
|
+
{
|
|
7582
|
+
name: "data",
|
|
7583
|
+
type: "RadarChartData",
|
|
7584
|
+
required: true,
|
|
7585
|
+
description: "Chart data with series values"
|
|
7586
|
+
},
|
|
7587
|
+
{
|
|
7588
|
+
name: "indicators",
|
|
7589
|
+
type: "RadarIndicator[]",
|
|
7590
|
+
required: true,
|
|
7591
|
+
description: "Dimension definitions"
|
|
7592
|
+
},
|
|
7593
|
+
{
|
|
7594
|
+
name: "shape",
|
|
7595
|
+
type: "'polygon' | 'circle'",
|
|
7596
|
+
default: "'polygon'",
|
|
7597
|
+
required: false,
|
|
7598
|
+
description: "Shape of the radar grid"
|
|
7599
|
+
},
|
|
7600
|
+
{
|
|
7601
|
+
name: "title",
|
|
7602
|
+
type: "string",
|
|
7603
|
+
required: true,
|
|
7604
|
+
description: "Chart title for accessibility"
|
|
7605
|
+
},
|
|
7606
|
+
{
|
|
7607
|
+
name: "height",
|
|
7608
|
+
type: "number | string",
|
|
7609
|
+
default: "400",
|
|
7610
|
+
required: false,
|
|
7611
|
+
description: "Chart height"
|
|
7612
|
+
},
|
|
7613
|
+
{
|
|
7614
|
+
name: "theme",
|
|
7615
|
+
type: "'light' | 'dark' | 'auto'",
|
|
7616
|
+
default: "'auto'",
|
|
7617
|
+
required: false,
|
|
7618
|
+
description: "Theme preference"
|
|
7619
|
+
},
|
|
7620
|
+
{
|
|
7621
|
+
name: "showLegend",
|
|
7622
|
+
type: "boolean",
|
|
7623
|
+
default: "true",
|
|
7624
|
+
required: false,
|
|
7625
|
+
description: "Show chart legend"
|
|
7626
|
+
},
|
|
7627
|
+
{
|
|
7628
|
+
name: "showTooltip",
|
|
7629
|
+
type: "boolean",
|
|
7630
|
+
default: "true",
|
|
7631
|
+
required: false,
|
|
7632
|
+
description: "Show tooltip on hover"
|
|
7633
|
+
}
|
|
7634
|
+
],
|
|
7635
|
+
variants: [
|
|
7636
|
+
{
|
|
7637
|
+
name: "shape",
|
|
7638
|
+
values: [
|
|
7639
|
+
"polygon",
|
|
7640
|
+
"circle"
|
|
7641
|
+
],
|
|
7642
|
+
default: "polygon"
|
|
7643
|
+
},
|
|
7644
|
+
{
|
|
7645
|
+
name: "theme",
|
|
7646
|
+
values: [
|
|
7647
|
+
"light",
|
|
7648
|
+
"dark",
|
|
7649
|
+
"auto"
|
|
7650
|
+
],
|
|
7651
|
+
default: "auto"
|
|
7652
|
+
}
|
|
7653
|
+
],
|
|
4615
7654
|
slots: [],
|
|
4616
7655
|
events: [],
|
|
4617
7656
|
examples: [
|
|
@@ -4853,8 +7892,73 @@ var component_catalog_default = {
|
|
|
4853
7892
|
description: "Flow relationships between entities",
|
|
4854
7893
|
category: "chart",
|
|
4855
7894
|
importPath: "@classic-homes/charts-svelte",
|
|
4856
|
-
props: [
|
|
4857
|
-
|
|
7895
|
+
props: [
|
|
7896
|
+
{
|
|
7897
|
+
name: "data",
|
|
7898
|
+
type: "SankeyData",
|
|
7899
|
+
required: true,
|
|
7900
|
+
description: "Nodes and links defining the flow"
|
|
7901
|
+
},
|
|
7902
|
+
{
|
|
7903
|
+
name: "orient",
|
|
7904
|
+
type: "'horizontal' | 'vertical'",
|
|
7905
|
+
default: "'horizontal'",
|
|
7906
|
+
required: false,
|
|
7907
|
+
description: "Flow direction"
|
|
7908
|
+
},
|
|
7909
|
+
{
|
|
7910
|
+
name: "onClick",
|
|
7911
|
+
type: "(params: SankeyEventParams) => void",
|
|
7912
|
+
required: false,
|
|
7913
|
+
description: "Callback when clicked"
|
|
7914
|
+
},
|
|
7915
|
+
{
|
|
7916
|
+
name: "title",
|
|
7917
|
+
type: "string",
|
|
7918
|
+
required: true,
|
|
7919
|
+
description: "Chart title for accessibility"
|
|
7920
|
+
},
|
|
7921
|
+
{
|
|
7922
|
+
name: "height",
|
|
7923
|
+
type: "number | string",
|
|
7924
|
+
default: "400",
|
|
7925
|
+
required: false,
|
|
7926
|
+
description: "Chart height"
|
|
7927
|
+
},
|
|
7928
|
+
{
|
|
7929
|
+
name: "theme",
|
|
7930
|
+
type: "'light' | 'dark' | 'auto'",
|
|
7931
|
+
default: "'auto'",
|
|
7932
|
+
required: false,
|
|
7933
|
+
description: "Theme preference"
|
|
7934
|
+
},
|
|
7935
|
+
{
|
|
7936
|
+
name: "showTooltip",
|
|
7937
|
+
type: "boolean",
|
|
7938
|
+
default: "true",
|
|
7939
|
+
required: false,
|
|
7940
|
+
description: "Show tooltip on hover"
|
|
7941
|
+
}
|
|
7942
|
+
],
|
|
7943
|
+
variants: [
|
|
7944
|
+
{
|
|
7945
|
+
name: "orient",
|
|
7946
|
+
values: [
|
|
7947
|
+
"horizontal",
|
|
7948
|
+
"vertical"
|
|
7949
|
+
],
|
|
7950
|
+
default: "horizontal"
|
|
7951
|
+
},
|
|
7952
|
+
{
|
|
7953
|
+
name: "theme",
|
|
7954
|
+
values: [
|
|
7955
|
+
"light",
|
|
7956
|
+
"dark",
|
|
7957
|
+
"auto"
|
|
7958
|
+
],
|
|
7959
|
+
default: "auto"
|
|
7960
|
+
}
|
|
7961
|
+
],
|
|
4858
7962
|
slots: [],
|
|
4859
7963
|
events: [],
|
|
4860
7964
|
examples: [
|
|
@@ -4937,8 +8041,79 @@ var component_catalog_default = {
|
|
|
4937
8041
|
description: "Visualize X/Y relationships with optional trend lines",
|
|
4938
8042
|
category: "chart",
|
|
4939
8043
|
importPath: "@classic-homes/charts-svelte",
|
|
4940
|
-
props: [
|
|
4941
|
-
|
|
8044
|
+
props: [
|
|
8045
|
+
{
|
|
8046
|
+
name: "data",
|
|
8047
|
+
type: "ScatterChartData",
|
|
8048
|
+
required: true,
|
|
8049
|
+
description: "Chart data with coordinate pairs"
|
|
8050
|
+
},
|
|
8051
|
+
{
|
|
8052
|
+
name: "showTrendLine",
|
|
8053
|
+
type: "boolean",
|
|
8054
|
+
default: "false",
|
|
8055
|
+
required: false,
|
|
8056
|
+
description: "Display regression/trend line"
|
|
8057
|
+
},
|
|
8058
|
+
{
|
|
8059
|
+
name: "symbolSize",
|
|
8060
|
+
type: "number | ((value: number[]) => number)",
|
|
8061
|
+
default: "10",
|
|
8062
|
+
required: false,
|
|
8063
|
+
description: "Point size (fixed or dynamic)"
|
|
8064
|
+
},
|
|
8065
|
+
{
|
|
8066
|
+
name: "onClick",
|
|
8067
|
+
type: "(params: DataPointEventParams) => void",
|
|
8068
|
+
required: false,
|
|
8069
|
+
description: "Callback when clicked"
|
|
8070
|
+
},
|
|
8071
|
+
{
|
|
8072
|
+
name: "title",
|
|
8073
|
+
type: "string",
|
|
8074
|
+
required: true,
|
|
8075
|
+
description: "Chart title for accessibility"
|
|
8076
|
+
},
|
|
8077
|
+
{
|
|
8078
|
+
name: "height",
|
|
8079
|
+
type: "number | string",
|
|
8080
|
+
default: "400",
|
|
8081
|
+
required: false,
|
|
8082
|
+
description: "Chart height"
|
|
8083
|
+
},
|
|
8084
|
+
{
|
|
8085
|
+
name: "theme",
|
|
8086
|
+
type: "'light' | 'dark' | 'auto'",
|
|
8087
|
+
default: "'auto'",
|
|
8088
|
+
required: false,
|
|
8089
|
+
description: "Theme preference"
|
|
8090
|
+
},
|
|
8091
|
+
{
|
|
8092
|
+
name: "showLegend",
|
|
8093
|
+
type: "boolean",
|
|
8094
|
+
default: "true",
|
|
8095
|
+
required: false,
|
|
8096
|
+
description: "Show chart legend"
|
|
8097
|
+
},
|
|
8098
|
+
{
|
|
8099
|
+
name: "showTooltip",
|
|
8100
|
+
type: "boolean",
|
|
8101
|
+
default: "true",
|
|
8102
|
+
required: false,
|
|
8103
|
+
description: "Show tooltip on hover"
|
|
8104
|
+
}
|
|
8105
|
+
],
|
|
8106
|
+
variants: [
|
|
8107
|
+
{
|
|
8108
|
+
name: "theme",
|
|
8109
|
+
values: [
|
|
8110
|
+
"light",
|
|
8111
|
+
"dark",
|
|
8112
|
+
"auto"
|
|
8113
|
+
],
|
|
8114
|
+
default: "auto"
|
|
8115
|
+
}
|
|
8116
|
+
],
|
|
4942
8117
|
slots: [],
|
|
4943
8118
|
events: [],
|
|
4944
8119
|
examples: [
|
|
@@ -6127,6 +9302,74 @@ var component_catalog_default = {
|
|
|
6127
9302
|
"Label"
|
|
6128
9303
|
]
|
|
6129
9304
|
},
|
|
9305
|
+
{
|
|
9306
|
+
name: "TabPanel",
|
|
9307
|
+
description: "Content panel component for Tabs navigation",
|
|
9308
|
+
category: "layout",
|
|
9309
|
+
importPath: "@classic-homes/theme-svelte",
|
|
9310
|
+
props: [
|
|
9311
|
+
{
|
|
9312
|
+
name: "value",
|
|
9313
|
+
type: "string",
|
|
9314
|
+
required: false,
|
|
9315
|
+
description: "Tab ID this panel belongs to (required)"
|
|
9316
|
+
},
|
|
9317
|
+
{
|
|
9318
|
+
name: "class",
|
|
9319
|
+
type: "string",
|
|
9320
|
+
required: false,
|
|
9321
|
+
description: "Additional CSS classes"
|
|
9322
|
+
}
|
|
9323
|
+
],
|
|
9324
|
+
variants: [],
|
|
9325
|
+
slots: [
|
|
9326
|
+
{
|
|
9327
|
+
name: "children",
|
|
9328
|
+
description: "Main content",
|
|
9329
|
+
required: false
|
|
9330
|
+
}
|
|
9331
|
+
],
|
|
9332
|
+
events: [],
|
|
9333
|
+
examples: [
|
|
9334
|
+
{
|
|
9335
|
+
title: "Basic Usage",
|
|
9336
|
+
code: `<script>
|
|
9337
|
+
const tabs = [
|
|
9338
|
+
{ id: 'account', label: 'Account' },
|
|
9339
|
+
{ id: 'password', label: 'Password' },
|
|
9340
|
+
{ id: 'notifications', label: 'Notifications' },
|
|
9341
|
+
];
|
|
9342
|
+
</script>
|
|
9343
|
+
|
|
9344
|
+
<Tabs {tabs} defaultValue="account">
|
|
9345
|
+
<TabPanel value="account">
|
|
9346
|
+
<p>Account settings content here.</p>
|
|
9347
|
+
</TabPanel>
|
|
9348
|
+
<TabPanel value="password">
|
|
9349
|
+
<p>Password settings content here.</p>
|
|
9350
|
+
</TabPanel>
|
|
9351
|
+
<TabPanel value="notifications">
|
|
9352
|
+
<p>Notification settings content here.</p>
|
|
9353
|
+
</TabPanel>
|
|
9354
|
+
</Tabs>`
|
|
9355
|
+
},
|
|
9356
|
+
{
|
|
9357
|
+
title: "With Forms",
|
|
9358
|
+
code: '<TabPanel value="profile">\n <form class="space-y-4">\n <FormField label="Name" name="name" />\n <FormField label="Email" name="email" type="email" />\n <Button type="submit">Save Changes</Button>\n </form>\n</TabPanel>'
|
|
9359
|
+
},
|
|
9360
|
+
{
|
|
9361
|
+
title: "With Cards",
|
|
9362
|
+
code: '<TabPanel value="billing">\n <div class="grid gap-4 md:grid-cols-2">\n <Card>\n <CardHeader>\n <CardTitle>Current Plan</CardTitle>\n </CardHeader>\n <CardContent>Pro - $29/month</CardContent>\n </Card>\n <Card>\n <CardHeader>\n <CardTitle>Payment Method</CardTitle>\n </CardHeader>\n <CardContent>Visa ending in 4242</CardContent>\n </Card>\n </div>\n</TabPanel>'
|
|
9363
|
+
},
|
|
9364
|
+
{
|
|
9365
|
+
title: "Custom Styling",
|
|
9366
|
+
code: '<TabPanel value="settings" class="p-6 bg-muted rounded-lg">\n <h3 class="font-semibold mb-4">Advanced Settings</h3>\n <!-- Content -->\n</TabPanel>'
|
|
9367
|
+
}
|
|
9368
|
+
],
|
|
9369
|
+
relatedComponents: [
|
|
9370
|
+
"Tabs"
|
|
9371
|
+
]
|
|
9372
|
+
},
|
|
6130
9373
|
{
|
|
6131
9374
|
name: "Tabs",
|
|
6132
9375
|
description: "Tabbed interface for organizing content",
|
|
@@ -6523,6 +9766,75 @@ var component_catalog_default = {
|
|
|
6523
9766
|
"Dialog"
|
|
6524
9767
|
]
|
|
6525
9768
|
},
|
|
9769
|
+
{
|
|
9770
|
+
name: "ToastContainer",
|
|
9771
|
+
description: "Container component for displaying toast notifications",
|
|
9772
|
+
category: "feedback",
|
|
9773
|
+
importPath: "@classic-homes/theme-svelte",
|
|
9774
|
+
props: [
|
|
9775
|
+
{
|
|
9776
|
+
name: "position",
|
|
9777
|
+
type: "'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center'",
|
|
9778
|
+
default: "'bottom-right'",
|
|
9779
|
+
required: false,
|
|
9780
|
+
description: "Position on screen"
|
|
9781
|
+
},
|
|
9782
|
+
{
|
|
9783
|
+
name: "class",
|
|
9784
|
+
type: "string",
|
|
9785
|
+
required: false,
|
|
9786
|
+
description: "Additional CSS classes"
|
|
9787
|
+
}
|
|
9788
|
+
],
|
|
9789
|
+
variants: [
|
|
9790
|
+
{
|
|
9791
|
+
name: "position",
|
|
9792
|
+
values: [
|
|
9793
|
+
"top-left",
|
|
9794
|
+
"top-right",
|
|
9795
|
+
"top-center",
|
|
9796
|
+
"bottom-left",
|
|
9797
|
+
"bottom-right",
|
|
9798
|
+
"bottom-center"
|
|
9799
|
+
],
|
|
9800
|
+
default: "bottom-right"
|
|
9801
|
+
}
|
|
9802
|
+
],
|
|
9803
|
+
slots: [
|
|
9804
|
+
{
|
|
9805
|
+
name: "children",
|
|
9806
|
+
description: "Main content",
|
|
9807
|
+
required: false
|
|
9808
|
+
}
|
|
9809
|
+
],
|
|
9810
|
+
events: [],
|
|
9811
|
+
examples: [
|
|
9812
|
+
{
|
|
9813
|
+
title: "Bottom Right (Default)",
|
|
9814
|
+
code: '<ToastContainer position="bottom-right" />'
|
|
9815
|
+
},
|
|
9816
|
+
{
|
|
9817
|
+
title: "Top Right",
|
|
9818
|
+
code: '<ToastContainer position="top-right" />'
|
|
9819
|
+
},
|
|
9820
|
+
{
|
|
9821
|
+
title: "Top Center",
|
|
9822
|
+
code: '<ToastContainer position="top-center" />'
|
|
9823
|
+
},
|
|
9824
|
+
{
|
|
9825
|
+
title: "Bottom Center",
|
|
9826
|
+
code: '<ToastContainer position="bottom-center" />'
|
|
9827
|
+
},
|
|
9828
|
+
{
|
|
9829
|
+
title: "Custom Position",
|
|
9830
|
+
code: '<ToastContainer position="top-center" class="mt-16" />'
|
|
9831
|
+
}
|
|
9832
|
+
],
|
|
9833
|
+
relatedComponents: [
|
|
9834
|
+
"Toast",
|
|
9835
|
+
"AppShell"
|
|
9836
|
+
]
|
|
9837
|
+
},
|
|
6526
9838
|
{
|
|
6527
9839
|
name: "Tooltip",
|
|
6528
9840
|
description: "Contextual information displayed on hover",
|
|
@@ -6640,8 +9952,64 @@ var component_catalog_default = {
|
|
|
6640
9952
|
description: "Hierarchical data as nested rectangles",
|
|
6641
9953
|
category: "chart",
|
|
6642
9954
|
importPath: "@classic-homes/charts-svelte",
|
|
6643
|
-
props: [
|
|
6644
|
-
|
|
9955
|
+
props: [
|
|
9956
|
+
{
|
|
9957
|
+
name: "data",
|
|
9958
|
+
type: "TreemapNode[]",
|
|
9959
|
+
required: true,
|
|
9960
|
+
description: "Hierarchical tree data"
|
|
9961
|
+
},
|
|
9962
|
+
{
|
|
9963
|
+
name: "levels",
|
|
9964
|
+
type: "TreemapLevel[]",
|
|
9965
|
+
required: false,
|
|
9966
|
+
description: "Visual configuration for each level"
|
|
9967
|
+
},
|
|
9968
|
+
{
|
|
9969
|
+
name: "onClick",
|
|
9970
|
+
type: "(params: TreemapEventParams) => void",
|
|
9971
|
+
required: false,
|
|
9972
|
+
description: "Callback when clicked"
|
|
9973
|
+
},
|
|
9974
|
+
{
|
|
9975
|
+
name: "title",
|
|
9976
|
+
type: "string",
|
|
9977
|
+
required: true,
|
|
9978
|
+
description: "Chart title for accessibility"
|
|
9979
|
+
},
|
|
9980
|
+
{
|
|
9981
|
+
name: "height",
|
|
9982
|
+
type: "number | string",
|
|
9983
|
+
default: "400",
|
|
9984
|
+
required: false,
|
|
9985
|
+
description: "Chart height"
|
|
9986
|
+
},
|
|
9987
|
+
{
|
|
9988
|
+
name: "theme",
|
|
9989
|
+
type: "'light' | 'dark' | 'auto'",
|
|
9990
|
+
default: "'auto'",
|
|
9991
|
+
required: false,
|
|
9992
|
+
description: "Theme preference"
|
|
9993
|
+
},
|
|
9994
|
+
{
|
|
9995
|
+
name: "showTooltip",
|
|
9996
|
+
type: "boolean",
|
|
9997
|
+
default: "true",
|
|
9998
|
+
required: false,
|
|
9999
|
+
description: "Show tooltip on hover"
|
|
10000
|
+
}
|
|
10001
|
+
],
|
|
10002
|
+
variants: [
|
|
10003
|
+
{
|
|
10004
|
+
name: "theme",
|
|
10005
|
+
values: [
|
|
10006
|
+
"light",
|
|
10007
|
+
"dark",
|
|
10008
|
+
"auto"
|
|
10009
|
+
],
|
|
10010
|
+
default: "auto"
|
|
10011
|
+
}
|
|
10012
|
+
],
|
|
6645
10013
|
slots: [],
|
|
6646
10014
|
events: [],
|
|
6647
10015
|
examples: [
|
|
@@ -7783,18 +11151,44 @@ function registerSearchComponentsTool(server) {
|
|
|
7783
11151
|
SearchComponentsSchema.shape,
|
|
7784
11152
|
async (params) => {
|
|
7785
11153
|
const { query, category, limit } = SearchComponentsSchema.parse(params);
|
|
7786
|
-
const queryLower = query.toLowerCase();
|
|
11154
|
+
const queryLower = query.toLowerCase().trim();
|
|
11155
|
+
const isListAll = queryLower === "*" || queryLower === "all" || queryLower === "" || queryLower === "list" || queryLower === "list all";
|
|
11156
|
+
const queryWords = queryLower.split(/\s+/).filter((word) => word.length > 0);
|
|
7787
11157
|
const results = catalog2.components.filter((component) => {
|
|
7788
11158
|
if (category && component.category !== category) {
|
|
7789
11159
|
return false;
|
|
7790
11160
|
}
|
|
11161
|
+
if (isListAll) {
|
|
11162
|
+
return true;
|
|
11163
|
+
}
|
|
7791
11164
|
const searchableText = [
|
|
7792
11165
|
component.name,
|
|
7793
11166
|
component.description,
|
|
7794
11167
|
...component.props.map((p) => p.name),
|
|
7795
|
-
...component.
|
|
11168
|
+
...component.props.map((p) => p.description),
|
|
11169
|
+
...component.relatedComponents,
|
|
11170
|
+
component.category
|
|
7796
11171
|
].join(" ").toLowerCase();
|
|
11172
|
+
if (queryWords.length > 1) {
|
|
11173
|
+
return queryWords.some((word) => searchableText.includes(word));
|
|
11174
|
+
}
|
|
7797
11175
|
return searchableText.includes(queryLower);
|
|
11176
|
+
}).sort((a, b) => {
|
|
11177
|
+
const aNameLower = a.name.toLowerCase();
|
|
11178
|
+
const bNameLower = b.name.toLowerCase();
|
|
11179
|
+
const aExactMatch = queryWords.some((word) => aNameLower === word);
|
|
11180
|
+
const bExactMatch = queryWords.some((word) => bNameLower === word);
|
|
11181
|
+
if (aExactMatch && !bExactMatch) return -1;
|
|
11182
|
+
if (bExactMatch && !aExactMatch) return 1;
|
|
11183
|
+
const aStartsWith = queryWords.some((word) => aNameLower.startsWith(word));
|
|
11184
|
+
const bStartsWith = queryWords.some((word) => bNameLower.startsWith(word));
|
|
11185
|
+
if (aStartsWith && !bStartsWith) return -1;
|
|
11186
|
+
if (bStartsWith && !aStartsWith) return 1;
|
|
11187
|
+
const aContains = queryWords.some((word) => aNameLower.includes(word));
|
|
11188
|
+
const bContains = queryWords.some((word) => bNameLower.includes(word));
|
|
11189
|
+
if (aContains && !bContains) return -1;
|
|
11190
|
+
if (bContains && !aContains) return 1;
|
|
11191
|
+
return aNameLower.localeCompare(bNameLower);
|
|
7798
11192
|
}).slice(0, limit).map((c) => ({
|
|
7799
11193
|
name: c.name,
|
|
7800
11194
|
category: c.category,
|