@gild-ui/core 0.0.0 → 0.1.0-alpha.1

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.
@@ -0,0 +1,1198 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_View = require("./View-DOvf12An.cjs");
3
+ // src/catalog/categories.ts
4
+ /** The docs' categories, in their order, each with the components it lists. */
5
+ const categories = [
6
+ {
7
+ label: "Layout & surfaces",
8
+ components: [
9
+ "ScrollArea",
10
+ "View",
11
+ "Flex",
12
+ "Grid",
13
+ "Paper",
14
+ "Card",
15
+ "Quote",
16
+ "AppBar",
17
+ "Drawer",
18
+ "Sidebar"
19
+ ]
20
+ },
21
+ {
22
+ label: "Content & data display",
23
+ components: [
24
+ "Typography",
25
+ "Link",
26
+ "Icon",
27
+ "Image",
28
+ "Avatar",
29
+ "Table",
30
+ "Accordion"
31
+ ]
32
+ },
33
+ {
34
+ label: "Inputs & forms",
35
+ components: [
36
+ "Autocomplete",
37
+ "Fab",
38
+ "Button",
39
+ "ButtonGroup",
40
+ "ToggleButton",
41
+ "TextInput",
42
+ "Checkbox",
43
+ "Radio",
44
+ "Rating",
45
+ "NumberInput",
46
+ "RangeInput",
47
+ "TransferList",
48
+ "Switch",
49
+ "NativeSelect",
50
+ "Select",
51
+ "MenuItem",
52
+ "Form",
53
+ "FormControl",
54
+ "FormLabel",
55
+ "FormHelperText",
56
+ "Pagination"
57
+ ]
58
+ },
59
+ {
60
+ label: "Navigation & menus",
61
+ components: [
62
+ "Breadcrumbs",
63
+ "Menu",
64
+ "NavTree",
65
+ "Tabs"
66
+ ]
67
+ },
68
+ {
69
+ label: "Feedback",
70
+ components: [
71
+ "FabMenu",
72
+ "Snackbar",
73
+ "Alert",
74
+ "Badge",
75
+ "Chip",
76
+ "CircularProgress",
77
+ "LinearProgress",
78
+ "Skeleton",
79
+ "Backdrop"
80
+ ]
81
+ },
82
+ {
83
+ label: "Transitions",
84
+ components: [
85
+ "Collapse",
86
+ "Fade",
87
+ "Grow",
88
+ "Slide",
89
+ "Zoom"
90
+ ]
91
+ },
92
+ {
93
+ label: "Overlay & behavior",
94
+ components: [
95
+ "Tooltip",
96
+ "Portal",
97
+ "FocusTrap",
98
+ "Modal",
99
+ "Popover",
100
+ "Pressable"
101
+ ]
102
+ }
103
+ ];
104
+ // src/catalog/sources.ts
105
+ /** Every component, keyed by its export name. */
106
+ const catalogSources = {
107
+ Accordion: {
108
+ entry: require_View.accordionCatalog,
109
+ subpath: "Accordion"
110
+ },
111
+ AccordionActions: {
112
+ entry: require_View.accordionActionsCatalog,
113
+ subpath: "Accordion",
114
+ family: "Accordion"
115
+ },
116
+ AccordionDetails: {
117
+ entry: require_View.accordionDetailsCatalog,
118
+ subpath: "Accordion",
119
+ family: "Accordion"
120
+ },
121
+ AccordionGroup: {
122
+ entry: require_View.accordionGroupCatalog,
123
+ subpath: "Accordion",
124
+ family: "Accordion"
125
+ },
126
+ AccordionSummary: {
127
+ entry: require_View.accordionSummaryCatalog,
128
+ subpath: "Accordion",
129
+ family: "Accordion"
130
+ },
131
+ Chip: {
132
+ entry: require_View.chipCatalog,
133
+ subpath: "Chip"
134
+ },
135
+ Badge: {
136
+ entry: require_View.badgeCatalog,
137
+ subpath: "Badge"
138
+ },
139
+ Alert: {
140
+ entry: require_View.alertCatalog,
141
+ subpath: "Alert"
142
+ },
143
+ AlertTitle: {
144
+ entry: require_View.alertTitleCatalog,
145
+ subpath: "Alert",
146
+ family: "Alert"
147
+ },
148
+ Fab: {
149
+ entry: require_View.fabCatalog,
150
+ subpath: "Fab"
151
+ },
152
+ Snackbar: {
153
+ entry: require_View.snackbarCatalog,
154
+ subpath: "Snackbar"
155
+ },
156
+ Tooltip: {
157
+ entry: require_View.tooltipCatalog,
158
+ subpath: "Tooltip"
159
+ },
160
+ Autocomplete: {
161
+ entry: require_View.autocompleteCatalog,
162
+ subpath: "Autocomplete"
163
+ },
164
+ ScrollArea: {
165
+ entry: require_View.scrollAreaCatalog,
166
+ subpath: "ScrollArea"
167
+ },
168
+ FabMenu: {
169
+ entry: require_View.fabMenuCatalog,
170
+ subpath: "FabMenu"
171
+ },
172
+ FabMenuItem: {
173
+ entry: require_View.fabMenuItemCatalog,
174
+ subpath: "FabMenu",
175
+ family: "FabMenu"
176
+ },
177
+ NavTree: {
178
+ entry: require_View.navTreeCatalog,
179
+ subpath: "NavTree"
180
+ },
181
+ NavGroup: {
182
+ entry: require_View.navGroupCatalog,
183
+ subpath: "NavTree",
184
+ family: "NavTree"
185
+ },
186
+ NavLink: {
187
+ entry: require_View.navLinkCatalog,
188
+ subpath: "NavTree",
189
+ family: "NavTree"
190
+ },
191
+ AppBar: {
192
+ entry: require_View.appBarCatalog,
193
+ subpath: "AppBar"
194
+ },
195
+ Avatar: {
196
+ entry: require_View.avatarCatalog,
197
+ subpath: "Avatar"
198
+ },
199
+ Backdrop: {
200
+ entry: require_View.backdropCatalog,
201
+ subpath: "Backdrop"
202
+ },
203
+ Breadcrumbs: {
204
+ entry: require_View.breadcrumbsCatalog,
205
+ subpath: "Breadcrumbs"
206
+ },
207
+ Button: {
208
+ entry: require_View.buttonCatalog,
209
+ subpath: "Button"
210
+ },
211
+ ButtonGroup: {
212
+ entry: require_View.buttonGroupCatalog,
213
+ subpath: "ButtonGroup"
214
+ },
215
+ Card: {
216
+ entry: require_View.cardCatalog,
217
+ subpath: "Card"
218
+ },
219
+ Checkbox: {
220
+ entry: require_View.checkboxCatalog,
221
+ subpath: "Checkbox"
222
+ },
223
+ Collapse: {
224
+ entry: require_View.collapseCatalog,
225
+ subpath: "Collapse"
226
+ },
227
+ Fade: {
228
+ entry: require_View.fadeCatalog,
229
+ subpath: "Fade"
230
+ },
231
+ Grow: {
232
+ entry: require_View.growCatalog,
233
+ subpath: "Grow"
234
+ },
235
+ Slide: {
236
+ entry: require_View.slideCatalog,
237
+ subpath: "Slide"
238
+ },
239
+ Zoom: {
240
+ entry: require_View.zoomCatalog,
241
+ subpath: "Zoom"
242
+ },
243
+ ContextMenu: {
244
+ entry: require_View.contextMenuCatalog,
245
+ subpath: "Menu",
246
+ family: "Menu"
247
+ },
248
+ CircularProgress: {
249
+ entry: require_View.circularProgressCatalog,
250
+ subpath: "CircularProgress"
251
+ },
252
+ Drawer: {
253
+ entry: require_View.drawerCatalog,
254
+ subpath: "Drawer"
255
+ },
256
+ DrawerToggle: {
257
+ entry: require_View.drawerToggleCatalog,
258
+ subpath: "Drawer",
259
+ family: "Drawer"
260
+ },
261
+ Flex: {
262
+ entry: require_View.flexCatalog,
263
+ subpath: "Flex"
264
+ },
265
+ FocusTrap: {
266
+ entry: require_View.focusTrapCatalog,
267
+ subpath: "FocusTrap"
268
+ },
269
+ Form: {
270
+ entry: require_View.formCatalog,
271
+ subpath: "Form"
272
+ },
273
+ FormControl: {
274
+ entry: require_View.formControlCatalog,
275
+ subpath: "FormControl"
276
+ },
277
+ FormHelperText: {
278
+ entry: require_View.formHelperTextCatalog,
279
+ subpath: "FormHelperText"
280
+ },
281
+ FormLabel: {
282
+ entry: require_View.formLabelCatalog,
283
+ subpath: "FormLabel"
284
+ },
285
+ Grid: {
286
+ entry: require_View.gridCatalog,
287
+ subpath: "Grid"
288
+ },
289
+ Icon: {
290
+ entry: require_View.iconCatalog,
291
+ subpath: "Icon"
292
+ },
293
+ Image: {
294
+ entry: require_View.imageCatalog,
295
+ subpath: "Image"
296
+ },
297
+ RangeInput: {
298
+ entry: require_View.rangeInputCatalog,
299
+ subpath: "RangeInput"
300
+ },
301
+ LinearProgress: {
302
+ entry: require_View.linearProgressCatalog,
303
+ subpath: "LinearProgress"
304
+ },
305
+ Link: {
306
+ entry: require_View.linkCatalog,
307
+ subpath: "Link"
308
+ },
309
+ Menu: {
310
+ entry: require_View.menuCatalog,
311
+ subpath: "Menu"
312
+ },
313
+ MenuDivider: {
314
+ entry: require_View.menuDividerCatalog,
315
+ subpath: "Menu",
316
+ family: "Menu"
317
+ },
318
+ MenuItem: {
319
+ entry: require_View.menuItemCatalog,
320
+ subpath: "MenuItem"
321
+ },
322
+ MenuItems: {
323
+ entry: require_View.menuItemsCatalog,
324
+ subpath: "Menu",
325
+ family: "Menu"
326
+ },
327
+ MenuList: {
328
+ entry: require_View.menuListCatalog,
329
+ subpath: "Menu",
330
+ family: "Menu"
331
+ },
332
+ Modal: {
333
+ entry: require_View.modalCatalog,
334
+ subpath: "Modal"
335
+ },
336
+ NativeSelect: {
337
+ entry: require_View.nativeSelectCatalog,
338
+ subpath: "NativeSelect"
339
+ },
340
+ NumberInput: {
341
+ entry: require_View.numberInputCatalog,
342
+ subpath: "NumberInput"
343
+ },
344
+ Pagination: {
345
+ entry: require_View.paginationCatalog,
346
+ subpath: "Pagination"
347
+ },
348
+ PaginationItem: {
349
+ entry: require_View.paginationItemCatalog,
350
+ subpath: "Pagination",
351
+ family: "Pagination"
352
+ },
353
+ Paper: {
354
+ entry: require_View.paperCatalog,
355
+ subpath: "Paper"
356
+ },
357
+ Popover: {
358
+ entry: require_View.popoverCatalog,
359
+ subpath: "Popover"
360
+ },
361
+ Portal: {
362
+ entry: require_View.portalCatalog,
363
+ subpath: "Portal"
364
+ },
365
+ Pressable: {
366
+ entry: require_View.pressableCatalog,
367
+ subpath: "Pressable"
368
+ },
369
+ Quote: {
370
+ entry: require_View.quoteCatalog,
371
+ subpath: "Quote"
372
+ },
373
+ Radio: {
374
+ entry: require_View.radioCatalog,
375
+ subpath: "Radio"
376
+ },
377
+ Rating: {
378
+ entry: require_View.ratingCatalog,
379
+ subpath: "Rating"
380
+ },
381
+ Select: {
382
+ entry: require_View.selectCatalog,
383
+ subpath: "Select"
384
+ },
385
+ Sidebar: {
386
+ entry: require_View.sidebarCatalog,
387
+ subpath: "Sidebar"
388
+ },
389
+ SidebarItem: {
390
+ entry: require_View.sidebarItemCatalog,
391
+ subpath: "Sidebar",
392
+ family: "Sidebar"
393
+ },
394
+ Skeleton: {
395
+ entry: require_View.skeletonCatalog,
396
+ subpath: "Skeleton"
397
+ },
398
+ Switch: {
399
+ entry: require_View.switchCatalog,
400
+ subpath: "Switch"
401
+ },
402
+ Tab: {
403
+ entry: require_View.tabCatalog,
404
+ subpath: "Tabs",
405
+ family: "Tabs"
406
+ },
407
+ TabPanel: {
408
+ entry: require_View.tabPanelCatalog,
409
+ subpath: "Tabs",
410
+ family: "Tabs"
411
+ },
412
+ Tabs: {
413
+ entry: require_View.tabsCatalog,
414
+ subpath: "Tabs"
415
+ },
416
+ TabContext: {
417
+ entry: require_View.tabContextCatalog,
418
+ subpath: "Tabs",
419
+ family: "Tabs"
420
+ },
421
+ TabList: {
422
+ entry: require_View.tabListCatalog,
423
+ subpath: "Tabs",
424
+ family: "Tabs"
425
+ },
426
+ TabScrollButton: {
427
+ entry: require_View.tabScrollButtonCatalog,
428
+ subpath: "Tabs",
429
+ family: "Tabs"
430
+ },
431
+ Table: {
432
+ entry: require_View.tableCatalog,
433
+ subpath: "Table"
434
+ },
435
+ TableBody: {
436
+ entry: require_View.tableBodyCatalog,
437
+ subpath: "Table",
438
+ family: "Table"
439
+ },
440
+ TableCell: {
441
+ entry: require_View.tableCellCatalog,
442
+ subpath: "Table",
443
+ family: "Table"
444
+ },
445
+ TableContainer: {
446
+ entry: require_View.tableContainerCatalog,
447
+ subpath: "Table",
448
+ family: "Table"
449
+ },
450
+ TableControl: {
451
+ entry: require_View.tableControlCatalog,
452
+ subpath: "Table",
453
+ family: "Table"
454
+ },
455
+ TableFooter: {
456
+ entry: require_View.tableFooterCatalog,
457
+ subpath: "Table",
458
+ family: "Table"
459
+ },
460
+ TableHead: {
461
+ entry: require_View.tableHeadCatalog,
462
+ subpath: "Table",
463
+ family: "Table"
464
+ },
465
+ TablePagination: {
466
+ entry: require_View.tablePaginationCatalog,
467
+ subpath: "Table",
468
+ family: "Table"
469
+ },
470
+ TablePaginationActions: {
471
+ entry: require_View.tablePaginationActionsCatalog,
472
+ subpath: "Table",
473
+ family: "Table"
474
+ },
475
+ TableRow: {
476
+ entry: require_View.tableRowCatalog,
477
+ subpath: "Table",
478
+ family: "Table"
479
+ },
480
+ TableSortLabel: {
481
+ entry: require_View.tableSortLabelCatalog,
482
+ subpath: "Table",
483
+ family: "Table"
484
+ },
485
+ TextInput: {
486
+ entry: require_View.textInputCatalog,
487
+ subpath: "TextInput"
488
+ },
489
+ ToggleButton: {
490
+ entry: require_View.toggleButtonCatalog,
491
+ subpath: "ToggleButton"
492
+ },
493
+ ToggleButtonGroup: {
494
+ entry: require_View.toggleButtonGroupCatalog,
495
+ subpath: "ToggleButton",
496
+ family: "ToggleButton"
497
+ },
498
+ TransferList: {
499
+ entry: require_View.transferListCatalog,
500
+ subpath: "TransferList"
501
+ },
502
+ Typography: {
503
+ entry: require_View.typographyCatalog,
504
+ subpath: "Typography"
505
+ },
506
+ View: {
507
+ entry: require_View.viewCatalog,
508
+ subpath: "View"
509
+ }
510
+ };
511
+ // src/catalog/styleScales.ts
512
+ /**
513
+ * Each styled-system prop that resolves against a theme scale, and that scale: `p` to `space`,
514
+ * `borderRadius` to `radii`. The design system's own `color` and `bg` come last, as they
515
+ * read `theme.text` and `theme.background`.
516
+ */
517
+ const styleScales = {
518
+ margin: "space",
519
+ marginTop: "space",
520
+ marginRight: "space",
521
+ marginBottom: "space",
522
+ marginLeft: "space",
523
+ marginX: "space",
524
+ marginY: "space",
525
+ m: "space",
526
+ mt: "space",
527
+ mr: "space",
528
+ mb: "space",
529
+ ml: "space",
530
+ mx: "space",
531
+ my: "space",
532
+ padding: "space",
533
+ paddingTop: "space",
534
+ paddingRight: "space",
535
+ paddingBottom: "space",
536
+ paddingLeft: "space",
537
+ paddingX: "space",
538
+ paddingY: "space",
539
+ p: "space",
540
+ pt: "space",
541
+ pr: "space",
542
+ pb: "space",
543
+ pl: "space",
544
+ px: "space",
545
+ py: "space",
546
+ gap: "space",
547
+ rowGap: "space",
548
+ columnGap: "space",
549
+ width: "sizes",
550
+ height: "sizes",
551
+ minWidth: "sizes",
552
+ minHeight: "sizes",
553
+ maxWidth: "sizes",
554
+ maxHeight: "sizes",
555
+ size: "sizes",
556
+ fontFamily: "fonts",
557
+ fontSize: "fontSizes",
558
+ fontWeight: "fontWeights",
559
+ lineHeight: "lineHeights",
560
+ letterSpacing: "letterSpacings",
561
+ borderWidth: "borderWidths",
562
+ borderRadius: "radii",
563
+ borderTopLeftRadius: "radii",
564
+ borderTopRightRadius: "radii",
565
+ borderBottomLeftRadius: "radii",
566
+ borderBottomRightRadius: "radii",
567
+ borderTopWidth: "borderWidths",
568
+ borderBottomWidth: "borderWidths",
569
+ borderLeftWidth: "borderWidths",
570
+ borderRightWidth: "borderWidths",
571
+ top: "space",
572
+ right: "space",
573
+ bottom: "space",
574
+ left: "space",
575
+ background: "background",
576
+ boxShadow: "shadows",
577
+ textShadow: "shadows",
578
+ gridGap: "space",
579
+ gridColumnGap: "space",
580
+ gridRowGap: "space",
581
+ color: "text",
582
+ bg: "background",
583
+ backgroundColor: "background",
584
+ borderColor: "border"
585
+ };
586
+ // src/catalog/themeComponents.ts
587
+ /**
588
+ * What a component's `theme.components` entry may name: its slots, and the fields of its owner state
589
+ * (its props, as resolved) - left out when the component's owner state is open.
590
+ */
591
+ const themeComponents = {
592
+ Accordion: {
593
+ slots: ["root", "region"],
594
+ ownerState: [
595
+ "hasGutters",
596
+ "borderRadius",
597
+ "bg",
598
+ "textColor"
599
+ ]
600
+ },
601
+ AccordionActions: { slots: ["root"] },
602
+ AccordionDetails: { slots: ["root"] },
603
+ AccordionGroup: {
604
+ slots: ["root"],
605
+ ownerState: ["isExclusive", "variant"]
606
+ },
607
+ AccordionSummary: {
608
+ slots: [
609
+ "root",
610
+ "button",
611
+ "content",
612
+ "icon"
613
+ ],
614
+ ownerState: ["headingLevel"]
615
+ },
616
+ Alert: {
617
+ slots: [
618
+ "root",
619
+ "icon",
620
+ "message",
621
+ "action",
622
+ "closeButton"
623
+ ],
624
+ ownerState: [
625
+ "severity",
626
+ "variant",
627
+ "closeLabel",
628
+ "role",
629
+ "borderRadius"
630
+ ]
631
+ },
632
+ AlertTitle: { slots: ["root"] },
633
+ AppBar: { slots: ["root"] },
634
+ Autocomplete: {
635
+ slots: [
636
+ "root",
637
+ "tags",
638
+ "input",
639
+ "clearIndicator",
640
+ "popupIndicator",
641
+ "popup",
642
+ "listbox",
643
+ "group",
644
+ "groupLabel",
645
+ "groupItems",
646
+ "option",
647
+ "status"
648
+ ],
649
+ ownerState: [
650
+ "borderRadius",
651
+ "bg",
652
+ "textColor",
653
+ "variant",
654
+ "size",
655
+ "color",
656
+ "shouldAllowFreeText",
657
+ "layer",
658
+ "clearLabel",
659
+ "openLabel",
660
+ "closeLabel",
661
+ "loadingText",
662
+ "noOptionsText"
663
+ ]
664
+ },
665
+ Avatar: { slots: ["root", "img"] },
666
+ Backdrop: { slots: ["root"] },
667
+ Badge: {
668
+ slots: [
669
+ "root",
670
+ "badge",
671
+ "label"
672
+ ],
673
+ ownerState: [
674
+ "max",
675
+ "variant",
676
+ "color",
677
+ "anchorOrigin",
678
+ "overlap"
679
+ ]
680
+ },
681
+ Breadcrumbs: {
682
+ slots: [
683
+ "root",
684
+ "list",
685
+ "item",
686
+ "separator",
687
+ "collapsed",
688
+ "collapsedIcon"
689
+ ],
690
+ ownerState: [
691
+ "separator",
692
+ "maxItems",
693
+ "itemsBeforeCollapse",
694
+ "itemsAfterCollapse",
695
+ "expandLabel",
696
+ "color"
697
+ ]
698
+ },
699
+ Button: {
700
+ slots: [
701
+ "root",
702
+ "label",
703
+ "icon",
704
+ "loader"
705
+ ],
706
+ ownerState: [
707
+ "variant",
708
+ "color",
709
+ "size",
710
+ "shape",
711
+ "fullWidth",
712
+ "disabled"
713
+ ]
714
+ },
715
+ ButtonGroup: { slots: ["root"] },
716
+ Card: {
717
+ slots: [
718
+ "root",
719
+ "title",
720
+ "caption",
721
+ "icon"
722
+ ],
723
+ ownerState: [
724
+ "variant",
725
+ "titleProps",
726
+ "captionProps",
727
+ "iconProps"
728
+ ]
729
+ },
730
+ Checkbox: { slots: [
731
+ "root",
732
+ "input",
733
+ "icon",
734
+ "label"
735
+ ] },
736
+ Chip: {
737
+ slots: [
738
+ "root",
739
+ "body",
740
+ "label",
741
+ "icon",
742
+ "avatar",
743
+ "deleteIcon"
744
+ ],
745
+ ownerState: [
746
+ "variant",
747
+ "color",
748
+ "size",
749
+ "shape",
750
+ "borderRadius",
751
+ "deleteLabel"
752
+ ]
753
+ },
754
+ CircularProgress: { slots: [
755
+ "root",
756
+ "track",
757
+ "circle"
758
+ ] },
759
+ Collapse: {
760
+ slots: [
761
+ "root",
762
+ "wrapper",
763
+ "inner"
764
+ ],
765
+ ownerState: [
766
+ "orientation",
767
+ "collapsedSize",
768
+ "timeout",
769
+ "easing",
770
+ "shouldAppear"
771
+ ]
772
+ },
773
+ ContextMenu: { slots: [
774
+ "root",
775
+ "paper",
776
+ "list"
777
+ ] },
778
+ Drawer: { slots: ["root"] },
779
+ Fab: {
780
+ slots: [
781
+ "root",
782
+ "label",
783
+ "labelText"
784
+ ],
785
+ ownerState: [
786
+ "variant",
787
+ "color",
788
+ "size"
789
+ ]
790
+ },
791
+ FabMenu: {
792
+ slots: ["root", "list"],
793
+ ownerState: [
794
+ "direction",
795
+ "align",
796
+ "color",
797
+ "size"
798
+ ]
799
+ },
800
+ Flex: { slots: ["root"] },
801
+ FocusTrap: { slots: ["root"] },
802
+ Form: { slots: ["root"] },
803
+ FormControl: { slots: ["root"] },
804
+ FormHelperText: { slots: ["root"] },
805
+ FormLabel: { slots: ["root"] },
806
+ Grid: { slots: ["root"] },
807
+ Icon: { slots: ["root"] },
808
+ Image: { slots: ["root"] },
809
+ LinearProgress: { slots: [
810
+ "root",
811
+ "track",
812
+ "dash",
813
+ "bar",
814
+ "traveler",
815
+ "segment",
816
+ "secondaryBar"
817
+ ] },
818
+ Link: { slots: ["root"] },
819
+ Menu: {
820
+ slots: [
821
+ "root",
822
+ "paper",
823
+ "list"
824
+ ],
825
+ ownerState: [
826
+ "align",
827
+ "borderRadius",
828
+ "marginThreshold",
829
+ "elevation",
830
+ "layer",
831
+ "color",
832
+ "textColor",
833
+ "size",
834
+ "dense"
835
+ ]
836
+ },
837
+ MenuDivider: { slots: ["root"] },
838
+ MenuItem: {
839
+ slots: [
840
+ "root",
841
+ "check",
842
+ "startIcon",
843
+ "label",
844
+ "shortcut",
845
+ "submenuIcon",
846
+ "entry",
847
+ "secondaryAction"
848
+ ],
849
+ ownerState: [
850
+ "color",
851
+ "textColor",
852
+ "size",
853
+ "dense"
854
+ ]
855
+ },
856
+ MenuList: {
857
+ slots: ["root"],
858
+ ownerState: [
859
+ "color",
860
+ "textColor",
861
+ "size",
862
+ "dense",
863
+ "shouldWrap"
864
+ ]
865
+ },
866
+ Modal: { slots: ["root"] },
867
+ NativeSelect: { slots: [
868
+ "root",
869
+ "select",
870
+ "icon"
871
+ ] },
872
+ NavGroup: { slots: [
873
+ "root",
874
+ "label",
875
+ "list"
876
+ ] },
877
+ NavLink: { slots: [
878
+ "root",
879
+ "label",
880
+ "note"
881
+ ] },
882
+ NavTree: { slots: ["root"] },
883
+ NumberInput: {
884
+ slots: [
885
+ "root",
886
+ "input",
887
+ "content",
888
+ "spinButtons",
889
+ "increment",
890
+ "decrement"
891
+ ],
892
+ ownerState: [
893
+ "variant",
894
+ "size",
895
+ "color",
896
+ "spinButtons",
897
+ "step",
898
+ "smallStep",
899
+ "largeStep",
900
+ "shouldSnapOnStep",
901
+ "shouldScrubOnWheel",
902
+ "incrementLabel",
903
+ "decrementLabel"
904
+ ]
905
+ },
906
+ Pagination: { slots: ["root", "list"] },
907
+ PaginationItem: { slots: ["root", "ellipsis"] },
908
+ Paper: { slots: ["root"] },
909
+ Popover: { slots: ["root", "positioner"] },
910
+ Pressable: {
911
+ slots: ["root"],
912
+ ownerState: [
913
+ "feedback",
914
+ "color",
915
+ "activeOpacity"
916
+ ]
917
+ },
918
+ Quote: { slots: ["root"] },
919
+ Radio: { slots: [
920
+ "root",
921
+ "input",
922
+ "icon",
923
+ "label"
924
+ ] },
925
+ RangeInput: {
926
+ slots: [
927
+ "root",
928
+ "rail",
929
+ "track",
930
+ "thumb",
931
+ "mark",
932
+ "markLabel",
933
+ "valueLabel",
934
+ "input"
935
+ ],
936
+ ownerState: [
937
+ "size",
938
+ "color",
939
+ "orientation",
940
+ "track",
941
+ "step",
942
+ "shiftStep",
943
+ "valueLabel",
944
+ "shouldSwapThumbs"
945
+ ]
946
+ },
947
+ Rating: {
948
+ slots: [
949
+ "root",
950
+ "item",
951
+ "icon",
952
+ "decimal",
953
+ "input",
954
+ "text",
955
+ "emptyLabel"
956
+ ],
957
+ ownerState: [
958
+ "max",
959
+ "precision",
960
+ "highlightSelectedOnly",
961
+ "size",
962
+ "color"
963
+ ]
964
+ },
965
+ ScrollArea: {
966
+ slots: [
967
+ "root",
968
+ "viewport",
969
+ "track",
970
+ "thumb"
971
+ ],
972
+ ownerState: ["axes"]
973
+ },
974
+ Select: { slots: [
975
+ "root",
976
+ "value",
977
+ "valueArea",
978
+ "valueGhost",
979
+ "listbox"
980
+ ] },
981
+ Sidebar: { slots: [
982
+ "root",
983
+ "rail",
984
+ "panel"
985
+ ] },
986
+ SidebarItem: { slots: ["root", "pill"] },
987
+ Skeleton: { slots: ["root", "content"] },
988
+ Snackbar: {
989
+ slots: [
990
+ "root",
991
+ "content",
992
+ "message",
993
+ "action"
994
+ ],
995
+ ownerState: [
996
+ "anchorOrigin",
997
+ "autoHideDuration",
998
+ "resumeHideDuration",
999
+ "layer",
1000
+ "shape",
1001
+ "borderRadius",
1002
+ "bg",
1003
+ "textColor"
1004
+ ]
1005
+ },
1006
+ Switch: { slots: [
1007
+ "root",
1008
+ "input",
1009
+ "track",
1010
+ "thumb",
1011
+ "label"
1012
+ ] },
1013
+ Tab: {
1014
+ slots: [
1015
+ "root",
1016
+ "label",
1017
+ "icon",
1018
+ "secondaryAction",
1019
+ "close"
1020
+ ],
1021
+ ownerState: [
1022
+ "isWrapped",
1023
+ "bg",
1024
+ "borderRadius",
1025
+ "color",
1026
+ "textColor",
1027
+ "size",
1028
+ "selectedBg"
1029
+ ]
1030
+ },
1031
+ TabPanel: {
1032
+ slots: ["root"],
1033
+ ownerState: ["shouldKeepMounted"]
1034
+ },
1035
+ TabScrollButton: {
1036
+ slots: ["root"],
1037
+ ownerState: ["color", "textColor"]
1038
+ },
1039
+ Table: { slots: ["root"] },
1040
+ TableBody: { slots: ["root"] },
1041
+ TableCell: { slots: ["root"] },
1042
+ TableContainer: { slots: ["root"] },
1043
+ TableFooter: { slots: ["root"] },
1044
+ TableHead: { slots: ["root"] },
1045
+ TablePagination: { slots: ["root"] },
1046
+ TablePaginationActions: { slots: ["root"] },
1047
+ TableRow: { slots: ["root"] },
1048
+ TableSortLabel: { slots: ["root", "icon"] },
1049
+ Tabs: {
1050
+ slots: [
1051
+ "root",
1052
+ "list",
1053
+ "indicator",
1054
+ "startContent",
1055
+ "endContent",
1056
+ "scrollButton",
1057
+ "overflowButton",
1058
+ "overflowClose"
1059
+ ],
1060
+ ownerState: [
1061
+ "variant",
1062
+ "color",
1063
+ "size",
1064
+ "orientation",
1065
+ "fullWidth",
1066
+ "hasDivider",
1067
+ "selectedBg"
1068
+ ]
1069
+ },
1070
+ TextInput: { slots: ["root", "input"] },
1071
+ ToggleButton: { slots: ["root"] },
1072
+ ToggleButtonGroup: { slots: ["root"] },
1073
+ Tooltip: {
1074
+ slots: ["root", "arrow"],
1075
+ ownerState: [
1076
+ "borderRadius",
1077
+ "bg",
1078
+ "textColor",
1079
+ "placement",
1080
+ "hasArrow",
1081
+ "enterDelay",
1082
+ "leaveDelay",
1083
+ "enterTouchDelay",
1084
+ "leaveTouchDelay",
1085
+ "shouldDescribeChild",
1086
+ "isDescriptionPersistent",
1087
+ "isInteractive",
1088
+ "shouldWrapDisabledChild",
1089
+ "skipDelayDuration",
1090
+ "shouldOpenOnHover",
1091
+ "shouldOpenOnFocus",
1092
+ "shouldOpenOnTouch",
1093
+ "layer"
1094
+ ]
1095
+ },
1096
+ TransferList: {
1097
+ slots: [
1098
+ "root",
1099
+ "list",
1100
+ "header",
1101
+ "title",
1102
+ "count",
1103
+ "items",
1104
+ "item",
1105
+ "controls",
1106
+ "icon"
1107
+ ],
1108
+ ownerState: [
1109
+ "size",
1110
+ "color",
1111
+ "shouldShowMoveAll",
1112
+ "hasSelectAll",
1113
+ "moveAllRightLabel",
1114
+ "moveRightLabel",
1115
+ "moveLeftLabel",
1116
+ "moveAllLeftLabel"
1117
+ ]
1118
+ },
1119
+ Typography: { slots: ["root"] },
1120
+ View: { slots: ["root"] }
1121
+ };
1122
+ // src/catalog/validateThemeComponents.ts
1123
+ const isRecord = (value) => typeof value === "object" && value !== null;
1124
+ const list = (names) => names.join(", ");
1125
+ const checkSlots = (name, known, styleOverrides, report) => {
1126
+ if (!isRecord(styleOverrides)) return;
1127
+ for (const slot of Object.keys(styleOverrides)) if (!known.slots.includes(slot)) report(`components.${name}.styleOverrides.${slot}`, `is not a slot of ${name} (${list(known.slots)})`);
1128
+ };
1129
+ /** Whether one of the theme's own looks sets `prop` to `value`: a value the catalog cannot list. */
1130
+ const isDefinedByLook = (looks, prop, value) => looks.some((look) => isRecord(look) && isRecord(look.props) && look.props[prop] === value);
1131
+ const checkDefaults = (where, defaultProps, looks, values, notAProp, report) => {
1132
+ if (!isRecord(defaultProps)) return;
1133
+ for (const [prop, value] of Object.entries(defaultProps)) {
1134
+ const path = `${where}.defaultProps.${prop}`;
1135
+ notAProp(path, prop);
1136
+ const listed = values[prop]?.values;
1137
+ if (listed && !isDefinedByLook(looks, prop, value) && !listed.includes(value)) report(path, `is ${JSON.stringify(value)}, not one of ${list(listed)}`);
1138
+ }
1139
+ };
1140
+ const checkLooks = (where, looks, notAProp) => {
1141
+ looks.forEach((look, index) => {
1142
+ if (isRecord(look) && isRecord(look.props)) for (const prop of Object.keys(look.props)) notAProp(`${where}.variants[${index}].props.${prop}`, prop);
1143
+ });
1144
+ };
1145
+ const checkComponent = (name, known, config, report) => {
1146
+ const where = `components.${name}`;
1147
+ const options = catalogSources[name].entry.options;
1148
+ const props = known.ownerState && [...known.ownerState, ...Object.keys(options)];
1149
+ const notAProp = (path, prop) => {
1150
+ if (props && !props.includes(prop)) report(path, `is not a prop of ${name} (${list(props)})`);
1151
+ };
1152
+ checkSlots(name, known, config.styleOverrides, report);
1153
+ const looks = Array.isArray(config.variants) ? config.variants : [];
1154
+ checkDefaults(where, config.defaultProps, looks, options, notAProp, report);
1155
+ checkLooks(where, looks, notAProp);
1156
+ };
1157
+ /**
1158
+ * Checks a theme's `components` against the catalog, for a mistake the types cannot see (a theme
1159
+ * whose types were cast away, plain JavaScript, a theme read from a file): a component the design
1160
+ * system lacks, a slot a component has not, a default prop or a look's prop the component does not
1161
+ * take, and a default value outside the values the catalog lists for that prop. It returns the
1162
+ * problems; it never throws and never changes `components`.
1163
+ */
1164
+ const validateThemeComponents = (components) => {
1165
+ const problems = [];
1166
+ const report = (path, message) => problems.push({
1167
+ path,
1168
+ message: `${path} ${message}`
1169
+ });
1170
+ if (!isRecord(components)) return problems;
1171
+ for (const [name, config] of Object.entries(components)) {
1172
+ const known = themeComponents[name];
1173
+ if (!known) report(`components.${name}`, `is not a component (${list(Object.keys(themeComponents))})`);
1174
+ else if (isRecord(config)) checkComponent(name, known, config, report);
1175
+ }
1176
+ return problems;
1177
+ };
1178
+ // src/catalog/index.ts
1179
+ const categoryOf = (name) => categories.find((category) => category.components.includes(name)).label;
1180
+ /**
1181
+ * @description Every component of the design system as data a tool can read - its
1182
+ * category, the subpath it is imported from, what a freshly placed one is, its looks as
1183
+ * pictures, the props a picker offers and their theme scales, and how its node props and
1184
+ * two-way props are written. Pure data: it loads in Node with no DOM and no framework.
1185
+ */
1186
+ const catalog = {
1187
+ categories,
1188
+ styleScales,
1189
+ components: Object.fromEntries(Object.entries(catalogSources).map(([name, { entry, subpath, family }]) => [name, {
1190
+ ...entry,
1191
+ name,
1192
+ subpath,
1193
+ category: categoryOf(family ?? name),
1194
+ ...themeComponents[name]
1195
+ }]))
1196
+ };
1197
+ exports.catalog = catalog;
1198
+ exports.validateThemeComponents = validateThemeComponents;