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