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