@dalexto/lexsys-registry 0.0.3 → 0.0.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/README.md +3 -2
- package/dist/index.js +64 -82
- package/dist/items/dashboard-shell.d.ts +1 -1
- package/dist/items/index.d.ts +1 -0
- package/dist/items/table.d.ts +7 -0
- package/dist/registry-composition-imports.d.ts +9 -0
- package/dist/registry.types.d.ts +0 -1
- package/dist/validate-registry-template-imports.d.ts +2 -2
- package/package.json +1 -1
- package/templates/blocks/AuthForm/AuthForm.tsx +2 -2
- package/templates/blocks/AuthForm/AuthForm.types.ts +3 -3
- package/templates/blocks/CommandPalette/CommandPalette.tsx +4 -4
- package/templates/blocks/CommandPalette/CommandPalette.types.ts +2 -2
- package/templates/blocks/FormField/FormField.tsx +1 -1
- package/templates/blocks/FormField/FormField.types.ts +1 -1
- package/templates/blocks/SettingsPanel/SettingsPanel.tsx +1 -1
- package/templates/blocks/SettingsPanel/SettingsPanel.types.ts +1 -1
- package/templates/blocks/Sidebar/Sidebar.tsx +3 -3
- package/templates/blocks/Sidebar/Sidebar.types.ts +1 -1
- package/templates/primitives/Table/Table.tsx +121 -0
- package/templates/primitives/Table/Table.types.ts +68 -0
- package/templates/primitives/Table/Table.variants.ts +51 -0
- package/templates/styles/tokens.css +18 -0
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
**Type:** Package README
|
|
5
5
|
**Source of truth for:** Package role, public exports, item structure, template sync
|
|
6
6
|
**Verified against:** `packages/registry/src/`
|
|
7
|
+
**Last reviewed:** 2026-05-30
|
|
7
8
|
|
|
8
9
|
---
|
|
9
10
|
|
|
@@ -51,7 +52,7 @@ Templates are resolved via the `./templates/*` export path, not the `.` entry:
|
|
|
51
52
|
|
|
52
53
|
```ts
|
|
53
54
|
import.meta
|
|
54
|
-
.resolve("@dalexto/lexsys-registry/templates/
|
|
55
|
+
.resolve("@dalexto/lexsys-registry/templates/primitives/Button/Button.tsx")
|
|
55
56
|
```
|
|
56
57
|
|
|
57
58
|
---
|
|
@@ -66,7 +67,7 @@ Each item in `src/items/` declares the full install contract (required fields, o
|
|
|
66
67
|
|
|
67
68
|
Installable templates live under `packages/registry/templates/` — component files, shared utilities, and token CSS styles. Component templates are synced from `packages/ui/src/components`; style templates from `@dalexto/lexsys-tokens` via `generate:styles`. Templates MUST NOT be manually edited.
|
|
68
69
|
|
|
69
|
-
Template sync rules,
|
|
70
|
+
Template sync rules, item reconcile policy, import transforms, and drift validation: [docs/reference/registry/REGISTRY.md](../../docs/reference/registry/REGISTRY.md).
|
|
70
71
|
|
|
71
72
|
---
|
|
72
73
|
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,6 @@ var getInstallLayer = (item) => {
|
|
|
20
20
|
var accordionRegistryItem = {
|
|
21
21
|
name: "accordion",
|
|
22
22
|
canonicalName: "Accordion",
|
|
23
|
-
version: "0.0.1",
|
|
24
23
|
type: "component",
|
|
25
24
|
category: "data-display",
|
|
26
25
|
aliases: ["collapse"],
|
|
@@ -56,7 +55,6 @@ var accordionRegistryItem = {
|
|
|
56
55
|
var alertDialogRegistryItem = {
|
|
57
56
|
name: "alert-dialog",
|
|
58
57
|
canonicalName: "AlertDialog",
|
|
59
|
-
version: "0.0.1",
|
|
60
58
|
type: "component",
|
|
61
59
|
category: "overlays",
|
|
62
60
|
aliases: [],
|
|
@@ -79,8 +77,8 @@ var alertDialogRegistryItem = {
|
|
|
79
77
|
dependencies: [
|
|
80
78
|
"@base-ui/react",
|
|
81
79
|
"class-variance-authority",
|
|
82
|
-
"lucide-react",
|
|
83
80
|
"clsx",
|
|
81
|
+
"lucide-react",
|
|
84
82
|
"tailwind-merge"
|
|
85
83
|
],
|
|
86
84
|
registryDependencies: [],
|
|
@@ -93,7 +91,6 @@ var alertDialogRegistryItem = {
|
|
|
93
91
|
var alertRegistryItem = {
|
|
94
92
|
name: "alert",
|
|
95
93
|
canonicalName: "Alert",
|
|
96
|
-
version: "0.0.1",
|
|
97
94
|
type: "component",
|
|
98
95
|
category: "feedback",
|
|
99
96
|
aliases: ["notice", "message"],
|
|
@@ -124,7 +121,6 @@ var alertRegistryItem = {
|
|
|
124
121
|
var avatarRegistryItem = {
|
|
125
122
|
name: "avatar",
|
|
126
123
|
canonicalName: "Avatar",
|
|
127
|
-
version: "0.0.1",
|
|
128
124
|
type: "component",
|
|
129
125
|
category: "data-display",
|
|
130
126
|
aliases: [],
|
|
@@ -160,7 +156,6 @@ var avatarRegistryItem = {
|
|
|
160
156
|
var badgeRegistryItem = {
|
|
161
157
|
name: "badge",
|
|
162
158
|
canonicalName: "Badge",
|
|
163
|
-
version: "0.0.1",
|
|
164
159
|
type: "component",
|
|
165
160
|
category: "data-display",
|
|
166
161
|
aliases: ["tag", "label"],
|
|
@@ -191,7 +186,6 @@ var badgeRegistryItem = {
|
|
|
191
186
|
var buttonRegistryItem = {
|
|
192
187
|
name: "button",
|
|
193
188
|
canonicalName: "Button",
|
|
194
|
-
version: "0.0.1",
|
|
195
189
|
type: "component",
|
|
196
190
|
category: "actions",
|
|
197
191
|
aliases: ["btn"],
|
|
@@ -227,7 +221,6 @@ var buttonRegistryItem = {
|
|
|
227
221
|
var cardRegistryItem = {
|
|
228
222
|
name: "card",
|
|
229
223
|
canonicalName: "Card",
|
|
230
|
-
version: "0.0.1",
|
|
231
224
|
type: "component",
|
|
232
225
|
category: "layout",
|
|
233
226
|
aliases: ["panel", "surface"],
|
|
@@ -258,7 +251,6 @@ var cardRegistryItem = {
|
|
|
258
251
|
var checkboxRegistryItem = {
|
|
259
252
|
name: "checkbox",
|
|
260
253
|
canonicalName: "Checkbox",
|
|
261
|
-
version: "0.0.2",
|
|
262
254
|
type: "component",
|
|
263
255
|
category: "forms",
|
|
264
256
|
aliases: ["check"],
|
|
@@ -294,7 +286,6 @@ var checkboxRegistryItem = {
|
|
|
294
286
|
var collapsibleRegistryItem = {
|
|
295
287
|
name: "collapsible",
|
|
296
288
|
canonicalName: "Collapsible",
|
|
297
|
-
version: "0.0.1",
|
|
298
289
|
type: "component",
|
|
299
290
|
category: "layout",
|
|
300
291
|
aliases: [],
|
|
@@ -317,8 +308,8 @@ var collapsibleRegistryItem = {
|
|
|
317
308
|
dependencies: [
|
|
318
309
|
"@base-ui/react",
|
|
319
310
|
"class-variance-authority",
|
|
320
|
-
"lucide-react",
|
|
321
311
|
"clsx",
|
|
312
|
+
"lucide-react",
|
|
322
313
|
"tailwind-merge"
|
|
323
314
|
],
|
|
324
315
|
registryDependencies: [],
|
|
@@ -331,7 +322,6 @@ var collapsibleRegistryItem = {
|
|
|
331
322
|
var contextMenuRegistryItem = {
|
|
332
323
|
name: "context-menu",
|
|
333
324
|
canonicalName: "ContextMenu",
|
|
334
|
-
version: "0.0.1",
|
|
335
325
|
type: "component",
|
|
336
326
|
category: "overlays",
|
|
337
327
|
aliases: [],
|
|
@@ -354,8 +344,8 @@ var contextMenuRegistryItem = {
|
|
|
354
344
|
dependencies: [
|
|
355
345
|
"@base-ui/react",
|
|
356
346
|
"class-variance-authority",
|
|
357
|
-
"lucide-react",
|
|
358
347
|
"clsx",
|
|
348
|
+
"lucide-react",
|
|
359
349
|
"tailwind-merge"
|
|
360
350
|
],
|
|
361
351
|
registryDependencies: [],
|
|
@@ -368,7 +358,6 @@ var contextMenuRegistryItem = {
|
|
|
368
358
|
var dialogRegistryItem = {
|
|
369
359
|
name: "dialog",
|
|
370
360
|
canonicalName: "Dialog",
|
|
371
|
-
version: "0.0.1",
|
|
372
361
|
type: "component",
|
|
373
362
|
category: "overlays",
|
|
374
363
|
aliases: [],
|
|
@@ -391,8 +380,8 @@ var dialogRegistryItem = {
|
|
|
391
380
|
dependencies: [
|
|
392
381
|
"@base-ui/react",
|
|
393
382
|
"class-variance-authority",
|
|
394
|
-
"lucide-react",
|
|
395
383
|
"clsx",
|
|
384
|
+
"lucide-react",
|
|
396
385
|
"tailwind-merge"
|
|
397
386
|
],
|
|
398
387
|
registryDependencies: [],
|
|
@@ -405,7 +394,6 @@ var dialogRegistryItem = {
|
|
|
405
394
|
var drawerRegistryItem = {
|
|
406
395
|
name: "drawer",
|
|
407
396
|
canonicalName: "Drawer",
|
|
408
|
-
version: "0.0.2",
|
|
409
397
|
type: "component",
|
|
410
398
|
category: "overlays",
|
|
411
399
|
aliases: [],
|
|
@@ -428,8 +416,8 @@ var drawerRegistryItem = {
|
|
|
428
416
|
dependencies: [
|
|
429
417
|
"@base-ui/react",
|
|
430
418
|
"class-variance-authority",
|
|
431
|
-
"lucide-react",
|
|
432
419
|
"clsx",
|
|
420
|
+
"lucide-react",
|
|
433
421
|
"tailwind-merge"
|
|
434
422
|
],
|
|
435
423
|
registryDependencies: [],
|
|
@@ -442,7 +430,6 @@ var drawerRegistryItem = {
|
|
|
442
430
|
var fieldRegistryItem = {
|
|
443
431
|
name: "field",
|
|
444
432
|
canonicalName: "Field",
|
|
445
|
-
version: "0.0.1",
|
|
446
433
|
type: "component",
|
|
447
434
|
category: "forms",
|
|
448
435
|
aliases: [],
|
|
@@ -478,7 +465,6 @@ var fieldRegistryItem = {
|
|
|
478
465
|
var fieldsetRegistryItem = {
|
|
479
466
|
name: "fieldset",
|
|
480
467
|
canonicalName: "Fieldset",
|
|
481
|
-
version: "0.0.1",
|
|
482
468
|
type: "component",
|
|
483
469
|
category: "forms",
|
|
484
470
|
aliases: [],
|
|
@@ -514,7 +500,6 @@ var fieldsetRegistryItem = {
|
|
|
514
500
|
var formRegistryItem = {
|
|
515
501
|
name: "form",
|
|
516
502
|
canonicalName: "Form",
|
|
517
|
-
version: "0.0.1",
|
|
518
503
|
type: "component",
|
|
519
504
|
category: "forms",
|
|
520
505
|
aliases: [],
|
|
@@ -550,7 +535,6 @@ var formRegistryItem = {
|
|
|
550
535
|
var inputRegistryItem = {
|
|
551
536
|
name: "input",
|
|
552
537
|
canonicalName: "Input",
|
|
553
|
-
version: "0.0.1",
|
|
554
538
|
type: "component",
|
|
555
539
|
category: "forms",
|
|
556
540
|
aliases: ["ipt"],
|
|
@@ -586,7 +570,6 @@ var inputRegistryItem = {
|
|
|
586
570
|
var menuRegistryItem = {
|
|
587
571
|
name: "menu",
|
|
588
572
|
canonicalName: "Menu",
|
|
589
|
-
version: "0.0.2",
|
|
590
573
|
type: "component",
|
|
591
574
|
category: "overlays",
|
|
592
575
|
aliases: [],
|
|
@@ -609,8 +592,8 @@ var menuRegistryItem = {
|
|
|
609
592
|
dependencies: [
|
|
610
593
|
"@base-ui/react",
|
|
611
594
|
"class-variance-authority",
|
|
612
|
-
"lucide-react",
|
|
613
595
|
"clsx",
|
|
596
|
+
"lucide-react",
|
|
614
597
|
"tailwind-merge"
|
|
615
598
|
],
|
|
616
599
|
registryDependencies: [],
|
|
@@ -623,7 +606,6 @@ var menuRegistryItem = {
|
|
|
623
606
|
var menubarRegistryItem = {
|
|
624
607
|
name: "menubar",
|
|
625
608
|
canonicalName: "Menubar",
|
|
626
|
-
version: "0.0.1",
|
|
627
609
|
type: "component",
|
|
628
610
|
category: "overlays",
|
|
629
611
|
aliases: [],
|
|
@@ -659,7 +641,6 @@ var menubarRegistryItem = {
|
|
|
659
641
|
var meterRegistryItem = {
|
|
660
642
|
name: "meter",
|
|
661
643
|
canonicalName: "Meter",
|
|
662
|
-
version: "0.0.1",
|
|
663
644
|
type: "component",
|
|
664
645
|
category: "data-display",
|
|
665
646
|
aliases: [],
|
|
@@ -695,7 +676,6 @@ var meterRegistryItem = {
|
|
|
695
676
|
var numberFieldRegistryItem = {
|
|
696
677
|
name: "number-field",
|
|
697
678
|
canonicalName: "NumberField",
|
|
698
|
-
version: "0.0.1",
|
|
699
679
|
type: "component",
|
|
700
680
|
category: "forms",
|
|
701
681
|
aliases: [],
|
|
@@ -731,7 +711,6 @@ var numberFieldRegistryItem = {
|
|
|
731
711
|
var navigationMenuRegistryItem = {
|
|
732
712
|
name: "navigation-menu",
|
|
733
713
|
canonicalName: "NavigationMenu",
|
|
734
|
-
version: "0.0.1",
|
|
735
714
|
type: "component",
|
|
736
715
|
category: "overlays",
|
|
737
716
|
aliases: [],
|
|
@@ -754,8 +733,8 @@ var navigationMenuRegistryItem = {
|
|
|
754
733
|
dependencies: [
|
|
755
734
|
"@base-ui/react",
|
|
756
735
|
"class-variance-authority",
|
|
757
|
-
"lucide-react",
|
|
758
736
|
"clsx",
|
|
737
|
+
"lucide-react",
|
|
759
738
|
"tailwind-merge"
|
|
760
739
|
],
|
|
761
740
|
registryDependencies: [],
|
|
@@ -768,7 +747,6 @@ var navigationMenuRegistryItem = {
|
|
|
768
747
|
var popoverRegistryItem = {
|
|
769
748
|
name: "popover",
|
|
770
749
|
canonicalName: "Popover",
|
|
771
|
-
version: "0.0.1",
|
|
772
750
|
type: "component",
|
|
773
751
|
category: "overlays",
|
|
774
752
|
aliases: [],
|
|
@@ -791,8 +769,8 @@ var popoverRegistryItem = {
|
|
|
791
769
|
dependencies: [
|
|
792
770
|
"@base-ui/react",
|
|
793
771
|
"class-variance-authority",
|
|
794
|
-
"lucide-react",
|
|
795
772
|
"clsx",
|
|
773
|
+
"lucide-react",
|
|
796
774
|
"tailwind-merge"
|
|
797
775
|
],
|
|
798
776
|
registryDependencies: [],
|
|
@@ -805,7 +783,6 @@ var popoverRegistryItem = {
|
|
|
805
783
|
var previewCardRegistryItem = {
|
|
806
784
|
name: "preview-card",
|
|
807
785
|
canonicalName: "PreviewCard",
|
|
808
|
-
version: "0.0.1",
|
|
809
786
|
type: "component",
|
|
810
787
|
category: "overlays",
|
|
811
788
|
aliases: [],
|
|
@@ -841,7 +818,6 @@ var previewCardRegistryItem = {
|
|
|
841
818
|
var progressRegistryItem = {
|
|
842
819
|
name: "progress",
|
|
843
820
|
canonicalName: "Progress",
|
|
844
|
-
version: "0.0.2",
|
|
845
821
|
type: "component",
|
|
846
822
|
category: "feedback",
|
|
847
823
|
aliases: ["progress-bar"],
|
|
@@ -877,7 +853,6 @@ var progressRegistryItem = {
|
|
|
877
853
|
var radioGroupRegistryItem = {
|
|
878
854
|
name: "radio-group",
|
|
879
855
|
canonicalName: "RadioGroup",
|
|
880
|
-
version: "0.0.1",
|
|
881
856
|
type: "component",
|
|
882
857
|
category: "forms",
|
|
883
858
|
aliases: ["radio"],
|
|
@@ -913,7 +888,6 @@ var radioGroupRegistryItem = {
|
|
|
913
888
|
var selectRegistryItem = {
|
|
914
889
|
name: "select",
|
|
915
890
|
canonicalName: "Select",
|
|
916
|
-
version: "0.0.1",
|
|
917
891
|
type: "component",
|
|
918
892
|
category: "forms",
|
|
919
893
|
aliases: [],
|
|
@@ -936,8 +910,8 @@ var selectRegistryItem = {
|
|
|
936
910
|
dependencies: [
|
|
937
911
|
"@base-ui/react",
|
|
938
912
|
"class-variance-authority",
|
|
939
|
-
"lucide-react",
|
|
940
913
|
"clsx",
|
|
914
|
+
"lucide-react",
|
|
941
915
|
"tailwind-merge"
|
|
942
916
|
],
|
|
943
917
|
registryDependencies: [],
|
|
@@ -950,7 +924,6 @@ var selectRegistryItem = {
|
|
|
950
924
|
var separatorRegistryItem = {
|
|
951
925
|
name: "separator",
|
|
952
926
|
canonicalName: "Separator",
|
|
953
|
-
version: "0.0.1",
|
|
954
927
|
type: "component",
|
|
955
928
|
category: "layout",
|
|
956
929
|
aliases: ["divider"],
|
|
@@ -986,7 +959,6 @@ var separatorRegistryItem = {
|
|
|
986
959
|
var sliderRegistryItem = {
|
|
987
960
|
name: "slider",
|
|
988
961
|
canonicalName: "Slider",
|
|
989
|
-
version: "0.0.2",
|
|
990
962
|
type: "component",
|
|
991
963
|
category: "forms",
|
|
992
964
|
aliases: ["range"],
|
|
@@ -1006,12 +978,7 @@ var sliderRegistryItem = {
|
|
|
1006
978
|
path: "primitives/Slider/Slider.variants.ts"
|
|
1007
979
|
}
|
|
1008
980
|
],
|
|
1009
|
-
dependencies: [
|
|
1010
|
-
"@base-ui/react",
|
|
1011
|
-
"class-variance-authority",
|
|
1012
|
-
"clsx",
|
|
1013
|
-
"tailwind-merge"
|
|
1014
|
-
],
|
|
981
|
+
dependencies: ["@base-ui/react", "clsx", "tailwind-merge"],
|
|
1015
982
|
registryDependencies: [],
|
|
1016
983
|
utilities: ["cn"],
|
|
1017
984
|
styles: ["theme"],
|
|
@@ -1022,7 +989,6 @@ var sliderRegistryItem = {
|
|
|
1022
989
|
var switchRegistryItem = {
|
|
1023
990
|
name: "switch",
|
|
1024
991
|
canonicalName: "Switch",
|
|
1025
|
-
version: "0.0.2",
|
|
1026
992
|
type: "component",
|
|
1027
993
|
category: "forms",
|
|
1028
994
|
aliases: ["toggle-switch"],
|
|
@@ -1054,11 +1020,40 @@ var switchRegistryItem = {
|
|
|
1054
1020
|
target: "src/components/ui/Switch"
|
|
1055
1021
|
};
|
|
1056
1022
|
|
|
1023
|
+
// src/items/table.ts
|
|
1024
|
+
var tableRegistryItem = {
|
|
1025
|
+
name: "table",
|
|
1026
|
+
canonicalName: "Table",
|
|
1027
|
+
type: "component",
|
|
1028
|
+
category: "data-display",
|
|
1029
|
+
aliases: [],
|
|
1030
|
+
files: [
|
|
1031
|
+
"primitives/Table/Table.tsx",
|
|
1032
|
+
"primitives/Table/Table.types.ts",
|
|
1033
|
+
"primitives/Table/Table.variants.ts"
|
|
1034
|
+
],
|
|
1035
|
+
remoteFiles: [
|
|
1036
|
+
{
|
|
1037
|
+
path: "primitives/Table/Table.tsx"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
path: "primitives/Table/Table.types.ts"
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
path: "primitives/Table/Table.variants.ts"
|
|
1044
|
+
}
|
|
1045
|
+
],
|
|
1046
|
+
dependencies: ["class-variance-authority", "clsx", "tailwind-merge"],
|
|
1047
|
+
registryDependencies: [],
|
|
1048
|
+
utilities: ["cn"],
|
|
1049
|
+
styles: ["theme"],
|
|
1050
|
+
target: "src/components/ui/Table"
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1057
1053
|
// src/items/tabs.ts
|
|
1058
1054
|
var tabsRegistryItem = {
|
|
1059
1055
|
name: "tabs",
|
|
1060
1056
|
canonicalName: "Tabs",
|
|
1061
|
-
version: "0.0.1",
|
|
1062
1057
|
type: "component",
|
|
1063
1058
|
category: "navigation",
|
|
1064
1059
|
aliases: ["tab"],
|
|
@@ -1094,7 +1089,6 @@ var tabsRegistryItem = {
|
|
|
1094
1089
|
var textareaRegistryItem = {
|
|
1095
1090
|
name: "textarea",
|
|
1096
1091
|
canonicalName: "Textarea",
|
|
1097
|
-
version: "0.0.1",
|
|
1098
1092
|
type: "component",
|
|
1099
1093
|
category: "forms",
|
|
1100
1094
|
aliases: [],
|
|
@@ -1130,7 +1124,6 @@ var textareaRegistryItem = {
|
|
|
1130
1124
|
var toastRegistryItem = {
|
|
1131
1125
|
name: "toast",
|
|
1132
1126
|
canonicalName: "Toast",
|
|
1133
|
-
version: "0.0.1",
|
|
1134
1127
|
type: "component",
|
|
1135
1128
|
category: "feedback",
|
|
1136
1129
|
aliases: [],
|
|
@@ -1153,8 +1146,8 @@ var toastRegistryItem = {
|
|
|
1153
1146
|
dependencies: [
|
|
1154
1147
|
"@base-ui/react",
|
|
1155
1148
|
"class-variance-authority",
|
|
1156
|
-
"lucide-react",
|
|
1157
1149
|
"clsx",
|
|
1150
|
+
"lucide-react",
|
|
1158
1151
|
"tailwind-merge"
|
|
1159
1152
|
],
|
|
1160
1153
|
registryDependencies: [],
|
|
@@ -1167,7 +1160,6 @@ var toastRegistryItem = {
|
|
|
1167
1160
|
var toggleGroupRegistryItem = {
|
|
1168
1161
|
name: "toggle-group",
|
|
1169
1162
|
canonicalName: "ToggleGroup",
|
|
1170
|
-
version: "0.0.1",
|
|
1171
1163
|
type: "component",
|
|
1172
1164
|
category: "actions",
|
|
1173
1165
|
aliases: [],
|
|
@@ -1203,7 +1195,6 @@ var toggleGroupRegistryItem = {
|
|
|
1203
1195
|
var toggleRegistryItem = {
|
|
1204
1196
|
name: "toggle",
|
|
1205
1197
|
canonicalName: "Toggle",
|
|
1206
|
-
version: "0.0.1",
|
|
1207
1198
|
type: "component",
|
|
1208
1199
|
category: "actions",
|
|
1209
1200
|
aliases: ["toggle-button"],
|
|
@@ -1239,7 +1230,6 @@ var toggleRegistryItem = {
|
|
|
1239
1230
|
var toolbarRegistryItem = {
|
|
1240
1231
|
name: "toolbar",
|
|
1241
1232
|
canonicalName: "Toolbar",
|
|
1242
|
-
version: "0.0.1",
|
|
1243
1233
|
type: "component",
|
|
1244
1234
|
category: "layout",
|
|
1245
1235
|
aliases: [],
|
|
@@ -1275,7 +1265,6 @@ var toolbarRegistryItem = {
|
|
|
1275
1265
|
var tooltipRegistryItem = {
|
|
1276
1266
|
name: "tooltip",
|
|
1277
1267
|
canonicalName: "Tooltip",
|
|
1278
|
-
version: "0.0.1",
|
|
1279
1268
|
type: "component",
|
|
1280
1269
|
category: "overlays",
|
|
1281
1270
|
aliases: ["hint"],
|
|
@@ -1311,7 +1300,6 @@ var tooltipRegistryItem = {
|
|
|
1311
1300
|
var scrollAreaRegistryItem = {
|
|
1312
1301
|
name: "scroll-area",
|
|
1313
1302
|
canonicalName: "ScrollArea",
|
|
1314
|
-
version: "0.0.1",
|
|
1315
1303
|
type: "component",
|
|
1316
1304
|
category: "layout",
|
|
1317
1305
|
aliases: ["scroll"],
|
|
@@ -1347,7 +1335,6 @@ var scrollAreaRegistryItem = {
|
|
|
1347
1335
|
var dashboardShellRegistryItem = {
|
|
1348
1336
|
name: "dashboard-shell",
|
|
1349
1337
|
canonicalName: "DashboardShell",
|
|
1350
|
-
version: "0.0.2",
|
|
1351
1338
|
type: "block",
|
|
1352
1339
|
category: "layout",
|
|
1353
1340
|
aliases: ["dashboard-template"],
|
|
@@ -1356,7 +1343,7 @@ var dashboardShellRegistryItem = {
|
|
|
1356
1343
|
"templates/DashboardShell/DashboardShell.types.ts",
|
|
1357
1344
|
"templates/DashboardShell/DashboardShell.variants.ts"
|
|
1358
1345
|
],
|
|
1359
|
-
dependencies: ["
|
|
1346
|
+
dependencies: ["clsx", "tailwind-merge"],
|
|
1360
1347
|
registryDependencies: [],
|
|
1361
1348
|
utilities: ["cn"],
|
|
1362
1349
|
styles: ["theme"],
|
|
@@ -1367,7 +1354,6 @@ var dashboardShellRegistryItem = {
|
|
|
1367
1354
|
var formFieldRegistryItem = {
|
|
1368
1355
|
name: "form-field",
|
|
1369
1356
|
canonicalName: "FormField",
|
|
1370
|
-
version: "0.0.2",
|
|
1371
1357
|
type: "block",
|
|
1372
1358
|
category: "blocks",
|
|
1373
1359
|
aliases: [],
|
|
@@ -1376,7 +1362,7 @@ var formFieldRegistryItem = {
|
|
|
1376
1362
|
"blocks/FormField/FormField.types.ts",
|
|
1377
1363
|
"blocks/FormField/FormField.variants.ts"
|
|
1378
1364
|
],
|
|
1379
|
-
dependencies: ["
|
|
1365
|
+
dependencies: ["clsx", "tailwind-merge"],
|
|
1380
1366
|
registryDependencies: ["field"],
|
|
1381
1367
|
utilities: ["cn"],
|
|
1382
1368
|
styles: ["theme"],
|
|
@@ -1387,7 +1373,6 @@ var formFieldRegistryItem = {
|
|
|
1387
1373
|
var settingsPanelRegistryItem = {
|
|
1388
1374
|
name: "settings-panel",
|
|
1389
1375
|
canonicalName: "SettingsPanel",
|
|
1390
|
-
version: "0.0.2",
|
|
1391
1376
|
type: "block",
|
|
1392
1377
|
category: "blocks",
|
|
1393
1378
|
aliases: ["settings-section"],
|
|
@@ -1396,7 +1381,7 @@ var settingsPanelRegistryItem = {
|
|
|
1396
1381
|
"blocks/SettingsPanel/SettingsPanel.types.ts",
|
|
1397
1382
|
"blocks/SettingsPanel/SettingsPanel.variants.ts"
|
|
1398
1383
|
],
|
|
1399
|
-
dependencies: ["
|
|
1384
|
+
dependencies: ["clsx", "tailwind-merge"],
|
|
1400
1385
|
registryDependencies: ["card"],
|
|
1401
1386
|
utilities: ["cn"],
|
|
1402
1387
|
styles: ["theme"],
|
|
@@ -1407,7 +1392,6 @@ var settingsPanelRegistryItem = {
|
|
|
1407
1392
|
var sidebarRegistryItem = {
|
|
1408
1393
|
name: "sidebar",
|
|
1409
1394
|
canonicalName: "Sidebar",
|
|
1410
|
-
version: "0.0.2",
|
|
1411
1395
|
type: "block",
|
|
1412
1396
|
category: "blocks",
|
|
1413
1397
|
aliases: [],
|
|
@@ -1416,7 +1400,7 @@ var sidebarRegistryItem = {
|
|
|
1416
1400
|
"blocks/Sidebar/Sidebar.types.ts",
|
|
1417
1401
|
"blocks/Sidebar/Sidebar.variants.ts"
|
|
1418
1402
|
],
|
|
1419
|
-
dependencies: ["
|
|
1403
|
+
dependencies: ["clsx", "tailwind-merge"],
|
|
1420
1404
|
registryDependencies: ["button", "drawer", "scroll-area"],
|
|
1421
1405
|
utilities: ["cn"],
|
|
1422
1406
|
styles: ["theme"],
|
|
@@ -1427,7 +1411,6 @@ var sidebarRegistryItem = {
|
|
|
1427
1411
|
var autocompleteRegistryItem = {
|
|
1428
1412
|
name: "autocomplete",
|
|
1429
1413
|
canonicalName: "Autocomplete",
|
|
1430
|
-
version: "0.0.2",
|
|
1431
1414
|
type: "component",
|
|
1432
1415
|
category: "forms",
|
|
1433
1416
|
aliases: [],
|
|
@@ -1450,8 +1433,8 @@ var autocompleteRegistryItem = {
|
|
|
1450
1433
|
dependencies: [
|
|
1451
1434
|
"@base-ui/react",
|
|
1452
1435
|
"class-variance-authority",
|
|
1453
|
-
"lucide-react",
|
|
1454
1436
|
"clsx",
|
|
1437
|
+
"lucide-react",
|
|
1455
1438
|
"tailwind-merge"
|
|
1456
1439
|
],
|
|
1457
1440
|
registryDependencies: [],
|
|
@@ -1464,7 +1447,6 @@ var autocompleteRegistryItem = {
|
|
|
1464
1447
|
var checkboxGroupRegistryItem = {
|
|
1465
1448
|
name: "checkbox-group",
|
|
1466
1449
|
canonicalName: "CheckboxGroup",
|
|
1467
|
-
version: "0.0.1",
|
|
1468
1450
|
type: "component",
|
|
1469
1451
|
category: "forms",
|
|
1470
1452
|
aliases: [],
|
|
@@ -1500,7 +1482,6 @@ var checkboxGroupRegistryItem = {
|
|
|
1500
1482
|
var comboboxRegistryItem = {
|
|
1501
1483
|
name: "combobox",
|
|
1502
1484
|
canonicalName: "Combobox",
|
|
1503
|
-
version: "0.0.2",
|
|
1504
1485
|
type: "component",
|
|
1505
1486
|
category: "forms",
|
|
1506
1487
|
aliases: [],
|
|
@@ -1523,8 +1504,8 @@ var comboboxRegistryItem = {
|
|
|
1523
1504
|
dependencies: [
|
|
1524
1505
|
"@base-ui/react",
|
|
1525
1506
|
"class-variance-authority",
|
|
1526
|
-
"lucide-react",
|
|
1527
1507
|
"clsx",
|
|
1508
|
+
"lucide-react",
|
|
1528
1509
|
"tailwind-merge"
|
|
1529
1510
|
],
|
|
1530
1511
|
registryDependencies: [],
|
|
@@ -1537,7 +1518,6 @@ var comboboxRegistryItem = {
|
|
|
1537
1518
|
var authFormRegistryItem = {
|
|
1538
1519
|
name: "auth-form",
|
|
1539
1520
|
canonicalName: "AuthForm",
|
|
1540
|
-
version: "0.0.2",
|
|
1541
1521
|
type: "block",
|
|
1542
1522
|
category: "blocks",
|
|
1543
1523
|
aliases: ["login-form"],
|
|
@@ -1546,8 +1526,8 @@ var authFormRegistryItem = {
|
|
|
1546
1526
|
"blocks/AuthForm/AuthForm.types.ts",
|
|
1547
1527
|
"blocks/AuthForm/AuthForm.variants.ts"
|
|
1548
1528
|
],
|
|
1549
|
-
dependencies: ["
|
|
1550
|
-
registryDependencies: ["
|
|
1529
|
+
dependencies: ["clsx", "tailwind-merge"],
|
|
1530
|
+
registryDependencies: ["button", "card"],
|
|
1551
1531
|
utilities: ["cn"],
|
|
1552
1532
|
styles: ["theme"],
|
|
1553
1533
|
target: "src/components/ui/AuthForm"
|
|
@@ -1557,7 +1537,6 @@ var authFormRegistryItem = {
|
|
|
1557
1537
|
var commandPaletteRegistryItem = {
|
|
1558
1538
|
name: "command-palette",
|
|
1559
1539
|
canonicalName: "CommandPalette",
|
|
1560
|
-
version: "0.0.2",
|
|
1561
1540
|
type: "block",
|
|
1562
1541
|
category: "blocks",
|
|
1563
1542
|
aliases: ["command-menu", "kbar"],
|
|
@@ -1566,7 +1545,7 @@ var commandPaletteRegistryItem = {
|
|
|
1566
1545
|
"blocks/CommandPalette/CommandPalette.types.ts",
|
|
1567
1546
|
"blocks/CommandPalette/CommandPalette.variants.ts"
|
|
1568
1547
|
],
|
|
1569
|
-
dependencies: ["
|
|
1548
|
+
dependencies: ["clsx", "tailwind-merge"],
|
|
1570
1549
|
registryDependencies: ["dialog", "input", "scroll-area", "separator"],
|
|
1571
1550
|
utilities: ["cn"],
|
|
1572
1551
|
styles: ["theme"],
|
|
@@ -1577,7 +1556,6 @@ var commandPaletteRegistryItem = {
|
|
|
1577
1556
|
var otpFieldRegistryItem = {
|
|
1578
1557
|
name: "otp-field",
|
|
1579
1558
|
canonicalName: "OtpField",
|
|
1580
|
-
version: "0.0.1",
|
|
1581
1559
|
type: "component",
|
|
1582
1560
|
category: "forms",
|
|
1583
1561
|
aliases: [],
|
|
@@ -1613,7 +1591,6 @@ var otpFieldRegistryItem = {
|
|
|
1613
1591
|
var emptyRegistryItem = {
|
|
1614
1592
|
name: "empty",
|
|
1615
1593
|
canonicalName: "Empty",
|
|
1616
|
-
version: "0.0.3",
|
|
1617
1594
|
type: "block",
|
|
1618
1595
|
category: "layout",
|
|
1619
1596
|
aliases: ["empty-state"],
|
|
@@ -1660,6 +1637,7 @@ var registryItems = [
|
|
|
1660
1637
|
separatorRegistryItem,
|
|
1661
1638
|
sliderRegistryItem,
|
|
1662
1639
|
switchRegistryItem,
|
|
1640
|
+
tableRegistryItem,
|
|
1663
1641
|
tabsRegistryItem,
|
|
1664
1642
|
textareaRegistryItem,
|
|
1665
1643
|
toastRegistryItem,
|
|
@@ -1727,9 +1705,6 @@ var validateRegistryItem = (item) => {
|
|
|
1727
1705
|
if (isEmpty(item.canonicalName)) {
|
|
1728
1706
|
throw new Error(`Registry item "${item.name}" has invalid 'canonicalName'`);
|
|
1729
1707
|
}
|
|
1730
|
-
if (isEmpty(item.version)) {
|
|
1731
|
-
throw new Error(`Registry item "${item.name}" has invalid 'version'`);
|
|
1732
|
-
}
|
|
1733
1708
|
if (!item.files || !item.files.length) {
|
|
1734
1709
|
throw new Error(
|
|
1735
1710
|
`Registry item "${item.name}" must define at least one file`
|
|
@@ -1886,18 +1861,25 @@ var validateRegistryComposition = (items) => {
|
|
|
1886
1861
|
return errors;
|
|
1887
1862
|
};
|
|
1888
1863
|
|
|
1889
|
-
// src/
|
|
1890
|
-
var
|
|
1864
|
+
// src/registry-composition-imports.ts
|
|
1865
|
+
var COMPOSITION_IMPORT_PATTERNS = [
|
|
1866
|
+
/from "\.\.\/\.\.\/(primitives|blocks|templates)\/([A-Za-z0-9]+)\//g,
|
|
1867
|
+
/from "@\/components\/(primitives|blocks|templates)\/([A-Za-z0-9]+)/g
|
|
1868
|
+
];
|
|
1891
1869
|
var toRegistryItemName = (canonicalName) => {
|
|
1892
1870
|
return canonicalName.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1893
1871
|
};
|
|
1894
1872
|
var extractRegistryCompositionImports = (source) => {
|
|
1895
1873
|
const names = /* @__PURE__ */ new Set();
|
|
1896
|
-
for (const
|
|
1897
|
-
|
|
1874
|
+
for (const pattern of COMPOSITION_IMPORT_PATTERNS) {
|
|
1875
|
+
for (const match of source.matchAll(pattern)) {
|
|
1876
|
+
names.add(toRegistryItemName(match[2]));
|
|
1877
|
+
}
|
|
1898
1878
|
}
|
|
1899
|
-
return [...names];
|
|
1879
|
+
return [...names].sort((a, b) => a.localeCompare(b));
|
|
1900
1880
|
};
|
|
1881
|
+
|
|
1882
|
+
// src/validate-registry-template-imports.ts
|
|
1901
1883
|
var validateRegistryTemplateImports = (items, readTemplate) => {
|
|
1902
1884
|
const errors = [];
|
|
1903
1885
|
const itemsByName = new Map(items.map((item) => [item.name, item]));
|
|
@@ -2182,4 +2164,4 @@ var registryManifest = {
|
|
|
2182
2164
|
utilities: registryUtilities
|
|
2183
2165
|
};
|
|
2184
2166
|
|
|
2185
|
-
export { accordionRegistryItem, alertDialogRegistryItem, alertRegistryItem, authFormRegistryItem, autocompleteRegistryItem, avatarRegistryItem, badgeRegistryItem, buttonRegistryItem, cardRegistryItem, checkboxGroupRegistryItem, checkboxRegistryItem, cnRegistryUtility, collapsibleRegistryItem, comboboxRegistryItem, commandPaletteRegistryItem, contextMenuRegistryItem, dashboardShellRegistryItem, dialogRegistryItem, drawerRegistryItem, emptyRegistryItem, fieldRegistryItem, fieldsetRegistryItem, formFieldRegistryItem, formRegistryItem, getInstallLayer, inputRegistryItem, menuRegistryItem, menubarRegistryItem, meterRegistryItem, navigationMenuRegistryItem, numberFieldRegistryItem, otpFieldRegistryItem, popoverRegistryItem, previewCardRegistryItem, progressRegistryItem, radioGroupRegistryItem, registryItems, registryManifest, registryStyles, registryUtilities, registryVersion, scrollAreaRegistryItem, selectRegistryItem, separatorRegistryItem, settingsPanelRegistryItem, sidebarRegistryItem, sliderRegistryItem, switchRegistryItem, tabsRegistryItem, textareaRegistryItem, themeRegistryStyle, toastRegistryItem, toggleGroupRegistryItem, toggleRegistryItem, toolbarRegistryItem, tooltipRegistryItem, validateRegistry, validateRegistryItem };
|
|
2167
|
+
export { accordionRegistryItem, alertDialogRegistryItem, alertRegistryItem, authFormRegistryItem, autocompleteRegistryItem, avatarRegistryItem, badgeRegistryItem, buttonRegistryItem, cardRegistryItem, checkboxGroupRegistryItem, checkboxRegistryItem, cnRegistryUtility, collapsibleRegistryItem, comboboxRegistryItem, commandPaletteRegistryItem, contextMenuRegistryItem, dashboardShellRegistryItem, dialogRegistryItem, drawerRegistryItem, emptyRegistryItem, fieldRegistryItem, fieldsetRegistryItem, formFieldRegistryItem, formRegistryItem, getInstallLayer, inputRegistryItem, menuRegistryItem, menubarRegistryItem, meterRegistryItem, navigationMenuRegistryItem, numberFieldRegistryItem, otpFieldRegistryItem, popoverRegistryItem, previewCardRegistryItem, progressRegistryItem, radioGroupRegistryItem, registryItems, registryManifest, registryStyles, registryUtilities, registryVersion, scrollAreaRegistryItem, selectRegistryItem, separatorRegistryItem, settingsPanelRegistryItem, sidebarRegistryItem, sliderRegistryItem, switchRegistryItem, tableRegistryItem, tabsRegistryItem, textareaRegistryItem, themeRegistryStyle, toastRegistryItem, toggleGroupRegistryItem, toggleRegistryItem, toolbarRegistryItem, tooltipRegistryItem, validateRegistry, validateRegistryItem };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dashboard-shell.ts
|
|
3
3
|
*
|
|
4
|
-
* Registry metadata for the DashboardShell
|
|
4
|
+
* Registry metadata for the DashboardShell block.
|
|
5
5
|
*/
|
|
6
6
|
import type { RegistryItem } from "../registry.types.js";
|
|
7
7
|
export declare const dashboardShellRegistryItem: RegistryItem;
|
package/dist/items/index.d.ts
CHANGED
|
@@ -47,4 +47,5 @@ export { authFormRegistryItem } from "./auth-form.js";
|
|
|
47
47
|
export { commandPaletteRegistryItem } from "./command-palette.js";
|
|
48
48
|
export { otpFieldRegistryItem } from "./otp-field.js";
|
|
49
49
|
export { emptyRegistryItem } from "./empty.js";
|
|
50
|
+
export { tableRegistryItem } from "./table.js";
|
|
50
51
|
export declare const registryItems: RegistryItem[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* registry-composition-imports.ts
|
|
3
|
+
*
|
|
4
|
+
* Infer registry item names from composition imports in template sources.
|
|
5
|
+
* Keep in sync with scripts/lib/registry-composition-imports.mjs.
|
|
6
|
+
*/
|
|
7
|
+
export declare const toRegistryItemName: (canonicalName: string) => string;
|
|
8
|
+
export declare const extractRegistryCompositionImports: (source: string) => string[];
|
|
9
|
+
export declare const getRegistryDependenciesFromTemplateContents: (templateContents: string[]) => string[];
|
package/dist/registry.types.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ export type RegistryItemCategory = "actions" | "forms" | "overlays" | "navigatio
|
|
|
26
26
|
export interface RegistryItem {
|
|
27
27
|
name: string;
|
|
28
28
|
canonicalName: string;
|
|
29
|
-
version: string;
|
|
30
29
|
type: RegistryItemType;
|
|
31
30
|
category: RegistryItemCategory;
|
|
32
31
|
aliases: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { extractRegistryCompositionImports, toRegistryItemName } from "./registry-composition-imports.js";
|
|
1
2
|
import type { RegistryItem } from "./registry.types.js";
|
|
2
|
-
export
|
|
3
|
-
export declare const extractRegistryCompositionImports: (source: string) => string[];
|
|
3
|
+
export { extractRegistryCompositionImports, toRegistryItemName };
|
|
4
4
|
export declare const validateRegistryTemplateImports: (items: RegistryItem[], readTemplate: (templatePath: string) => string) => string[];
|
package/package.json
CHANGED
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
CardContent,
|
|
11
11
|
CardFooter,
|
|
12
12
|
CardHeader,
|
|
13
|
-
} from "
|
|
14
|
-
import { Button } from "
|
|
13
|
+
} from "@/components/primitives/Card"
|
|
14
|
+
import { Button } from "@/components/primitives/Button"
|
|
15
15
|
import type {
|
|
16
16
|
AuthFormContentProps,
|
|
17
17
|
AuthFormFooterProps,
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { FormEventHandler, ReactNode, Ref } from "react"
|
|
8
|
-
import type { CardProps } from "
|
|
9
|
-
import type { ButtonProps } from "
|
|
8
|
+
import type { CardProps } from "@/components/primitives/Card"
|
|
9
|
+
import type { ButtonProps } from "@/components/primitives/Button"
|
|
10
10
|
import type {
|
|
11
11
|
CardContentProps,
|
|
12
12
|
CardFooterProps,
|
|
13
13
|
CardHeaderProps,
|
|
14
|
-
} from "
|
|
14
|
+
} from "@/components/primitives/Card"
|
|
15
15
|
|
|
16
16
|
export interface AuthFormProps extends Omit<
|
|
17
17
|
CardProps,
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
DialogPortal,
|
|
13
13
|
DialogTitle,
|
|
14
14
|
DialogViewport,
|
|
15
|
-
} from "
|
|
16
|
-
import { Input } from "
|
|
17
|
-
import { Separator } from "
|
|
15
|
+
} from "@/components/primitives/Dialog"
|
|
16
|
+
import { Input } from "@/components/primitives/Input"
|
|
17
|
+
import { Separator } from "@/components/primitives/Separator"
|
|
18
18
|
import {
|
|
19
19
|
ScrollArea,
|
|
20
20
|
ScrollAreaContent,
|
|
21
21
|
ScrollAreaViewport,
|
|
22
|
-
} from "
|
|
22
|
+
} from "@/components/primitives/ScrollArea"
|
|
23
23
|
import type {
|
|
24
24
|
CommandPaletteContentProps,
|
|
25
25
|
CommandPaletteDescriptionProps,
|
|
@@ -10,8 +10,8 @@ import type {
|
|
|
10
10
|
ReactNode,
|
|
11
11
|
Ref,
|
|
12
12
|
} from "react"
|
|
13
|
-
import type { DialogProps } from "
|
|
14
|
-
import type { InputProps } from "
|
|
13
|
+
import type { DialogProps } from "@/components/primitives/Dialog"
|
|
14
|
+
import type { InputProps } from "@/components/primitives/Input"
|
|
15
15
|
|
|
16
16
|
export interface CommandPaletteProps extends DialogProps {
|
|
17
17
|
children?: ReactNode
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
CardHeaderProps,
|
|
13
13
|
CardProps,
|
|
14
14
|
CardTitleProps,
|
|
15
|
-
} from "
|
|
15
|
+
} from "@/components/primitives/Card"
|
|
16
16
|
|
|
17
17
|
export interface SettingsPanelProps extends Omit<CardProps, "children"> {
|
|
18
18
|
ref?: Ref<HTMLDivElement>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { createContext, useContext } from "react"
|
|
8
|
-
import { Button } from "
|
|
8
|
+
import { Button } from "@/components/primitives/Button"
|
|
9
9
|
import {
|
|
10
10
|
Drawer,
|
|
11
11
|
DrawerBackdrop,
|
|
@@ -17,12 +17,12 @@ import {
|
|
|
17
17
|
DrawerTitle,
|
|
18
18
|
DrawerTrigger,
|
|
19
19
|
DrawerViewport,
|
|
20
|
-
} from "
|
|
20
|
+
} from "@/components/primitives/Drawer"
|
|
21
21
|
import {
|
|
22
22
|
ScrollArea,
|
|
23
23
|
ScrollAreaContent,
|
|
24
24
|
ScrollAreaViewport,
|
|
25
|
-
} from "
|
|
25
|
+
} from "@/components/primitives/ScrollArea"
|
|
26
26
|
import type {
|
|
27
27
|
SidebarContentProps,
|
|
28
28
|
SidebarFooterProps,
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
ReactNode,
|
|
13
13
|
Ref,
|
|
14
14
|
} from "react"
|
|
15
|
-
import type { ButtonProps } from "
|
|
15
|
+
import type { ButtonProps } from "@/components/primitives/Button"
|
|
16
16
|
|
|
17
17
|
export interface SidebarProps extends HTMLAttributes<HTMLElement> {
|
|
18
18
|
ref?: Ref<HTMLElement>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table.tsx
|
|
3
|
+
*
|
|
4
|
+
* Reference Table component implementation.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
TableBodyProps,
|
|
9
|
+
TableCaptionProps,
|
|
10
|
+
TableCellProps,
|
|
11
|
+
TableFooterProps,
|
|
12
|
+
TableHeadProps,
|
|
13
|
+
TableHeaderProps,
|
|
14
|
+
TableProps,
|
|
15
|
+
TableRowProps,
|
|
16
|
+
} from "./Table.types"
|
|
17
|
+
import {
|
|
18
|
+
tableBodyClassName,
|
|
19
|
+
tableCaptionClassName,
|
|
20
|
+
tableCellClassName,
|
|
21
|
+
tableFooterClassName,
|
|
22
|
+
tableHeadClassName,
|
|
23
|
+
tableHeaderClassName,
|
|
24
|
+
tableRowClassName,
|
|
25
|
+
tableVariants,
|
|
26
|
+
tableWrapperClassName,
|
|
27
|
+
} from "./Table.variants"
|
|
28
|
+
import { cn } from "@/lib/utils"
|
|
29
|
+
|
|
30
|
+
const Table = ({ ref, variant, className, ...props }: TableProps) => {
|
|
31
|
+
return (
|
|
32
|
+
<div className={tableWrapperClassName}>
|
|
33
|
+
<table
|
|
34
|
+
ref={ref}
|
|
35
|
+
className={cn(tableVariants({ variant }), className)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
Table.displayName = "Table"
|
|
43
|
+
|
|
44
|
+
const TableHeader = ({ ref, className, ...props }: TableHeaderProps) => {
|
|
45
|
+
return (
|
|
46
|
+
<thead
|
|
47
|
+
ref={ref}
|
|
48
|
+
className={cn(tableHeaderClassName, className)}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
TableHeader.displayName = "TableHeader"
|
|
55
|
+
|
|
56
|
+
const TableBody = ({ ref, className, ...props }: TableBodyProps) => {
|
|
57
|
+
return (
|
|
58
|
+
<tbody ref={ref} className={cn(tableBodyClassName, className)} {...props} />
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
TableBody.displayName = "TableBody"
|
|
63
|
+
|
|
64
|
+
const TableFooter = ({ ref, className, ...props }: TableFooterProps) => {
|
|
65
|
+
return (
|
|
66
|
+
<tfoot
|
|
67
|
+
ref={ref}
|
|
68
|
+
className={cn(tableFooterClassName, className)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
TableFooter.displayName = "TableFooter"
|
|
75
|
+
|
|
76
|
+
const TableRow = ({ ref, className, ...props }: TableRowProps) => {
|
|
77
|
+
return (
|
|
78
|
+
<tr ref={ref} className={cn(tableRowClassName, className)} {...props} />
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
TableRow.displayName = "TableRow"
|
|
83
|
+
|
|
84
|
+
const TableHead = ({ ref, className, ...props }: TableHeadProps) => {
|
|
85
|
+
return (
|
|
86
|
+
<th ref={ref} className={cn(tableHeadClassName, className)} {...props} />
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
TableHead.displayName = "TableHead"
|
|
91
|
+
|
|
92
|
+
const TableCell = ({ ref, className, ...props }: TableCellProps) => {
|
|
93
|
+
return (
|
|
94
|
+
<td ref={ref} className={cn(tableCellClassName, className)} {...props} />
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
TableCell.displayName = "TableCell"
|
|
99
|
+
|
|
100
|
+
const TableCaption = ({ ref, className, ...props }: TableCaptionProps) => {
|
|
101
|
+
return (
|
|
102
|
+
<caption
|
|
103
|
+
ref={ref}
|
|
104
|
+
className={cn(tableCaptionClassName, className)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
TableCaption.displayName = "TableCaption"
|
|
111
|
+
|
|
112
|
+
export {
|
|
113
|
+
Table,
|
|
114
|
+
TableHeader,
|
|
115
|
+
TableBody,
|
|
116
|
+
TableFooter,
|
|
117
|
+
TableHead,
|
|
118
|
+
TableRow,
|
|
119
|
+
TableCell,
|
|
120
|
+
TableCaption,
|
|
121
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Ref } from "react"
|
|
2
|
+
/**
|
|
3
|
+
* Table.types.ts
|
|
4
|
+
*
|
|
5
|
+
* Public and internal types for Table component.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type {
|
|
9
|
+
HTMLAttributes,
|
|
10
|
+
TableHTMLAttributes,
|
|
11
|
+
TdHTMLAttributes,
|
|
12
|
+
ThHTMLAttributes,
|
|
13
|
+
} from "react"
|
|
14
|
+
|
|
15
|
+
export type TableVariant = "default" | "striped" | "bordered"
|
|
16
|
+
|
|
17
|
+
export interface TableProps extends Omit<
|
|
18
|
+
TableHTMLAttributes<HTMLTableElement>,
|
|
19
|
+
"className"
|
|
20
|
+
> {
|
|
21
|
+
ref?: Ref<HTMLTableElement>
|
|
22
|
+
variant?: TableVariant
|
|
23
|
+
className?: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface TableSectionProps extends Omit<
|
|
27
|
+
HTMLAttributes<HTMLTableSectionElement>,
|
|
28
|
+
"className"
|
|
29
|
+
> {
|
|
30
|
+
ref?: Ref<HTMLTableSectionElement>
|
|
31
|
+
className?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type TableHeaderProps = TableSectionProps
|
|
35
|
+
export type TableBodyProps = TableSectionProps
|
|
36
|
+
export type TableFooterProps = TableSectionProps
|
|
37
|
+
|
|
38
|
+
export interface TableRowProps extends Omit<
|
|
39
|
+
HTMLAttributes<HTMLTableRowElement>,
|
|
40
|
+
"className"
|
|
41
|
+
> {
|
|
42
|
+
ref?: Ref<HTMLTableRowElement>
|
|
43
|
+
className?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface TableHeadProps extends Omit<
|
|
47
|
+
ThHTMLAttributes<HTMLTableCellElement>,
|
|
48
|
+
"className"
|
|
49
|
+
> {
|
|
50
|
+
ref?: Ref<HTMLTableCellElement>
|
|
51
|
+
className?: string
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface TableCellProps extends Omit<
|
|
55
|
+
TdHTMLAttributes<HTMLTableCellElement>,
|
|
56
|
+
"className"
|
|
57
|
+
> {
|
|
58
|
+
ref?: Ref<HTMLTableCellElement>
|
|
59
|
+
className?: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface TableCaptionProps extends Omit<
|
|
63
|
+
HTMLAttributes<HTMLTableCaptionElement>,
|
|
64
|
+
"className"
|
|
65
|
+
> {
|
|
66
|
+
ref?: Ref<HTMLTableCaptionElement>
|
|
67
|
+
className?: string
|
|
68
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table.variants.ts
|
|
3
|
+
*
|
|
4
|
+
* Defines Table visual slots using class composition.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { cva } from "class-variance-authority"
|
|
8
|
+
|
|
9
|
+
export const tableVariants = cva(
|
|
10
|
+
[
|
|
11
|
+
"w-full caption-bottom border-collapse text-(length:--lex-table-cell-font-size)",
|
|
12
|
+
"text-(--lex-table-foreground)",
|
|
13
|
+
].join(" "),
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: "",
|
|
18
|
+
striped:
|
|
19
|
+
"[&_tbody_tr:nth-child(even)]:bg-(--lex-table-row-striped-background)",
|
|
20
|
+
bordered:
|
|
21
|
+
"border border-(--lex-table-border-color) [&_th]:border [&_td]:border [&_th]:border-(--lex-table-border-color) [&_td]:border-(--lex-table-border-color)",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
export const tableWrapperClassName = "relative w-full overflow-x-auto"
|
|
31
|
+
|
|
32
|
+
export const tableCaptionClassName =
|
|
33
|
+
"mt-(--lex-table-cell-padding-y) text-(length:--lex-table-caption-font-size) leading-(--lex-table-caption-font-line-height) text-(--lex-table-caption-foreground)"
|
|
34
|
+
|
|
35
|
+
export const tableHeaderClassName =
|
|
36
|
+
"[&_tr]:border-b [&_tr]:border-(--lex-table-border-color)"
|
|
37
|
+
|
|
38
|
+
export const tableBodyClassName =
|
|
39
|
+
"[&_tr:last-child]:border-0 [&_tr]:border-b [&_tr]:border-(--lex-table-border-color)"
|
|
40
|
+
|
|
41
|
+
export const tableFooterClassName =
|
|
42
|
+
"border-t border-(--lex-table-border-color) bg-(--lex-table-footer-background) font-medium [&_tr]:last:border-b-0"
|
|
43
|
+
|
|
44
|
+
export const tableRowClassName =
|
|
45
|
+
"border-b border-(--lex-table-border-color) transition-colors hover:bg-(--lex-table-head-background)/50 data-[state=selected]:bg-(--lex-table-head-background)"
|
|
46
|
+
|
|
47
|
+
export const tableHeadClassName =
|
|
48
|
+
"h-10 px-(--lex-table-cell-padding-x) py-(--lex-table-cell-padding-y) text-left align-middle font-(--lex-table-head-font-weight) text-(length:--lex-table-head-font-size) leading-(--lex-table-head-font-line-height) text-(--lex-table-head-foreground) [&:has([role=checkbox])]:pr-0"
|
|
49
|
+
|
|
50
|
+
export const tableCellClassName =
|
|
51
|
+
"px-(--lex-table-cell-padding-x) py-(--lex-table-cell-padding-y) align-middle leading-(--lex-table-cell-font-line-height) [&:has([role=checkbox])]:pr-0"
|
|
@@ -1324,6 +1324,24 @@
|
|
|
1324
1324
|
--lex-switch-focus-ring-offset: var(--lex-outline-offset-focus);
|
|
1325
1325
|
--lex-switch-transition-duration: var(--lex-duration-control);
|
|
1326
1326
|
--lex-switch-transition-easing: var(--lex-easing-control);
|
|
1327
|
+
--lex-table-background: var(--lex-color-background-surface);
|
|
1328
|
+
--lex-table-foreground: var(--lex-color-text-primary);
|
|
1329
|
+
--lex-table-border-color: var(--lex-border-default);
|
|
1330
|
+
--lex-table-caption-foreground: var(--lex-color-text-secondary);
|
|
1331
|
+
--lex-table-caption-font-size: var(--lex-typography-body-sm-font-size);
|
|
1332
|
+
--lex-table-caption-font-line-height: var(--lex-typography-body-sm-line-height);
|
|
1333
|
+
--lex-table-head-background: var(--lex-color-background-subtle);
|
|
1334
|
+
--lex-table-head-foreground: var(--lex-color-text-primary);
|
|
1335
|
+
--lex-table-head-font-size: var(--lex-typography-body-sm-font-size);
|
|
1336
|
+
--lex-table-head-font-weight: var(--lex-typography-body-sm-font-weight);
|
|
1337
|
+
--lex-table-head-font-line-height: var(--lex-typography-body-sm-line-height);
|
|
1338
|
+
--lex-table-cell-font-size: var(--lex-typography-body-sm-font-size);
|
|
1339
|
+
--lex-table-cell-font-line-height: var(--lex-typography-body-sm-line-height);
|
|
1340
|
+
--lex-table-cell-padding-x: var(--lex-space-surface-md);
|
|
1341
|
+
--lex-table-cell-padding-y: var(--lex-space-surface-sm);
|
|
1342
|
+
--lex-table-row-striped-background: var(--lex-color-background-subtle);
|
|
1343
|
+
--lex-table-footer-background: var(--lex-color-background-subtle);
|
|
1344
|
+
--lex-table-footer-foreground: var(--lex-color-text-secondary);
|
|
1327
1345
|
--lex-tabs-gap: var(--lex-space-control-gap-lg);
|
|
1328
1346
|
--lex-tabs-list-background: var(--lex-color-background-subtle);
|
|
1329
1347
|
--lex-tabs-list-radius: var(--lex-radius-control);
|