@soroush.tech/design-system 2.0.0-rc.1 → 2.0.0-rc.2
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 +17 -1
- package/dist/AppBar.d.cts +1 -3
- package/dist/AppBar.d.mts +1 -3
- package/dist/Avatar.cjs +1 -1
- package/dist/Avatar.d.cts +1 -3
- package/dist/Avatar.d.mts +1 -3
- package/dist/Avatar.mjs +1 -1
- package/dist/Backdrop.d.cts +1 -1
- package/dist/Backdrop.d.mts +1 -1
- package/dist/Breadcrumbs.cjs +132 -0
- package/dist/Breadcrumbs.d.cts +40 -0
- package/dist/Breadcrumbs.d.mts +40 -0
- package/dist/Breadcrumbs.mjs +131 -0
- package/dist/Button.cjs +1 -1
- package/dist/Button.d.cts +1 -1
- package/dist/Button.d.mts +1 -1
- package/dist/Button.mjs +1 -1
- package/dist/ButtonGroup.d.cts +1 -1
- package/dist/ButtonGroup.d.mts +1 -1
- package/dist/Card.cjs +3 -3
- package/dist/Card.d.cts +4 -3
- package/dist/Card.d.mts +4 -3
- package/dist/Card.mjs +3 -3
- package/dist/Checkbox.d.cts +1 -2
- package/dist/Checkbox.d.mts +1 -2
- package/dist/CircularProgress.d.cts +2 -3
- package/dist/CircularProgress.d.mts +2 -3
- package/dist/Drawer.d.cts +3 -2
- package/dist/Drawer.d.mts +3 -2
- package/dist/Flex.d.cts +1 -1
- package/dist/Flex.d.mts +1 -1
- package/dist/Form.d.cts +1 -1
- package/dist/Form.d.mts +1 -1
- package/dist/FormControl.cjs +1 -1
- package/dist/FormControl.d.cts +1 -2
- package/dist/FormControl.d.mts +1 -2
- package/dist/FormControl.mjs +1 -1
- package/dist/FormHelperText.d.cts +1 -1
- package/dist/FormHelperText.d.mts +1 -1
- package/dist/FormLabel.d.cts +1 -1
- package/dist/FormLabel.d.mts +1 -1
- package/dist/Grid.d.cts +1 -3
- package/dist/Grid.d.mts +1 -3
- package/dist/{Icon-CI6q2Eyi.cjs → Icon-Cvuhp9ek.cjs} +12 -2
- package/dist/{Icon-CH3asUJu.mjs → Icon-DlheCTJb.mjs} +12 -2
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.d.cts +1 -1
- package/dist/Icon.d.mts +1 -1
- package/dist/Icon.mjs +1 -1
- package/dist/Image.d.cts +1 -2
- package/dist/Image.d.mts +1 -2
- package/dist/LinearProgress.d.cts +2 -3
- package/dist/LinearProgress.d.mts +2 -3
- package/dist/Link.cjs +1 -1
- package/dist/Link.d.cts +1 -1
- package/dist/Link.d.mts +1 -1
- package/dist/Link.mjs +1 -1
- package/dist/Menu/ContextMenu.cjs +146 -0
- package/dist/Menu/ContextMenu.d.cts +52 -0
- package/dist/Menu/ContextMenu.d.mts +52 -0
- package/dist/Menu/ContextMenu.mjs +145 -0
- package/dist/Menu/Menu.cjs +3 -0
- package/dist/Menu/Menu.d.cts +2 -0
- package/dist/Menu/Menu.d.mts +2 -0
- package/dist/Menu/Menu.mjs +2 -0
- package/dist/Menu/MenuDivider.cjs +29 -0
- package/dist/Menu/MenuDivider.d.cts +12 -0
- package/dist/Menu/MenuDivider.d.mts +12 -0
- package/dist/Menu/MenuDivider.mjs +28 -0
- package/dist/Menu/MenuItems.cjs +29 -0
- package/dist/Menu/MenuItems.d.cts +2 -0
- package/dist/Menu/MenuItems.d.mts +2 -0
- package/dist/Menu/MenuItems.mjs +28 -0
- package/dist/Menu/MenuList.cjs +3 -0
- package/dist/Menu/MenuList.d.cts +38 -0
- package/dist/Menu/MenuList.d.mts +38 -0
- package/dist/Menu/MenuList.mjs +2 -0
- package/dist/Menu-BkKPTOfh.cjs +172 -0
- package/dist/Menu-tECbAEFj.mjs +167 -0
- package/dist/Menu.cjs +13 -0
- package/dist/Menu.d.cts +7 -0
- package/dist/Menu.d.mts +7 -0
- package/dist/Menu.mjs +6 -0
- package/dist/MenuItem-BR7ingQx.mjs +654 -0
- package/dist/MenuItem-CfdN4axw.cjs +684 -0
- package/dist/MenuItem.cjs +2 -148
- package/dist/MenuItem.d.cts +2 -52
- package/dist/MenuItem.d.mts +2 -52
- package/dist/MenuItem.mjs +1 -147
- package/dist/MenuList-B7msJ1IG.mjs +187 -0
- package/dist/MenuList-D4imLXAa.cjs +223 -0
- package/dist/MenuListContext-Dml16k0X.d.mts +21 -0
- package/dist/MenuListContext-vujGcRk9.d.cts +21 -0
- package/dist/Modal.d.cts +1 -1
- package/dist/Modal.d.mts +1 -1
- package/dist/NativeSelect.cjs +2 -2
- package/dist/NativeSelect.d.cts +2 -3
- package/dist/NativeSelect.d.mts +2 -3
- package/dist/NativeSelect.mjs +2 -2
- package/dist/Pagination/PaginationItem.cjs +1 -1
- package/dist/Pagination/PaginationItem.d.cts +1 -1
- package/dist/Pagination/PaginationItem.d.mts +1 -1
- package/dist/Pagination/PaginationItem.mjs +1 -1
- package/dist/Pagination.d.cts +2 -2
- package/dist/Pagination.d.mts +2 -2
- package/dist/Paper.cjs +1 -1
- package/dist/Paper.d.cts +2 -1
- package/dist/Paper.d.mts +2 -1
- package/dist/Paper.mjs +1 -1
- package/dist/{Popover-TpwRSORC.cjs → Popover-CiZfgiKE.cjs} +5 -125
- package/dist/Popover-QjM5Z1CR.mjs +133 -0
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.d.cts +6 -7
- package/dist/Popover.d.mts +6 -7
- package/dist/Popover.mjs +1 -1
- package/dist/Pressable.cjs +1 -1
- package/dist/Pressable.d.cts +1 -1
- package/dist/Pressable.d.mts +1 -1
- package/dist/Pressable.mjs +1 -1
- package/dist/Quote.d.cts +2 -3
- package/dist/Quote.d.mts +2 -3
- package/dist/Radio.d.cts +1 -2
- package/dist/Radio.d.mts +1 -2
- package/dist/Select.cjs +3 -3
- package/dist/Select.d.cts +2 -3
- package/dist/Select.d.mts +2 -3
- package/dist/Select.mjs +3 -3
- package/dist/Sidebar/Sidebar.d.cts +1 -1
- package/dist/Sidebar/Sidebar.d.mts +1 -1
- package/dist/Sidebar/SidebarItem.cjs +1 -1
- package/dist/Sidebar/SidebarItem.d.cts +3 -4
- package/dist/Sidebar/SidebarItem.d.mts +3 -4
- package/dist/Sidebar/SidebarItem.mjs +1 -1
- package/dist/Skeleton.d.cts +1 -2
- package/dist/Skeleton.d.mts +1 -2
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.d.cts +1 -2
- package/dist/Switch.d.mts +1 -2
- package/dist/Switch.mjs +1 -1
- package/dist/Table/Table.d.cts +2 -3
- package/dist/Table/Table.d.mts +2 -3
- package/dist/Table/TableBody.d.cts +1 -2
- package/dist/Table/TableBody.d.mts +1 -2
- package/dist/Table/TableCell.d.cts +1 -1
- package/dist/Table/TableCell.d.mts +1 -1
- package/dist/Table/TableContainer.d.cts +1 -3
- package/dist/Table/TableContainer.d.mts +1 -3
- package/dist/Table/TableControl.d.cts +1 -1
- package/dist/Table/TableControl.d.mts +1 -1
- package/dist/Table/TableFooter.d.cts +1 -2
- package/dist/Table/TableFooter.d.mts +1 -2
- package/dist/Table/TableHead.d.cts +1 -2
- package/dist/Table/TableHead.d.mts +1 -2
- package/dist/Table/TablePagination.d.cts +2 -2
- package/dist/Table/TablePagination.d.mts +2 -2
- package/dist/Table/TablePaginationActions.cjs +1 -1
- package/dist/Table/TablePaginationActions.d.cts +1 -1
- package/dist/Table/TablePaginationActions.d.mts +1 -1
- package/dist/Table/TablePaginationActions.mjs +1 -1
- package/dist/Table/TableRow.d.cts +1 -2
- package/dist/Table/TableRow.d.mts +1 -2
- package/dist/Table/TableSortLabel.cjs +1 -1
- package/dist/Table/TableSortLabel.d.cts +1 -1
- package/dist/Table/TableSortLabel.d.mts +1 -1
- package/dist/Table/TableSortLabel.mjs +1 -1
- package/dist/Table/hooks.d.cts +1 -1
- package/dist/Table/hooks.d.mts +1 -1
- package/dist/Table.d.cts +5 -5
- package/dist/Table.d.mts +5 -5
- package/dist/{TableContext-BeCxbtHH.d.cts → TableContext-6PgGpUzM.d.mts} +1 -1
- package/dist/{TableContext-BiRiYkVZ.d.mts → TableContext-CBGk-Lh8.d.cts} +1 -1
- package/dist/Tabs/Tab.cjs +306 -0
- package/dist/Tabs/Tab.d.cts +62 -0
- package/dist/Tabs/Tab.d.mts +62 -0
- package/dist/Tabs/Tab.mjs +305 -0
- package/dist/Tabs/TabContext.cjs +34 -0
- package/dist/Tabs/TabContext.d.cts +20 -0
- package/dist/Tabs/TabContext.d.mts +20 -0
- package/dist/Tabs/TabContext.mjs +33 -0
- package/dist/Tabs/TabList.cjs +31 -0
- package/dist/Tabs/TabList.d.cts +11 -0
- package/dist/Tabs/TabList.d.mts +11 -0
- package/dist/Tabs/TabList.mjs +30 -0
- package/dist/Tabs/TabPanel.cjs +40 -0
- package/dist/Tabs/TabPanel.d.cts +27 -0
- package/dist/Tabs/TabPanel.d.mts +27 -0
- package/dist/Tabs/TabPanel.mjs +38 -0
- package/dist/Tabs/TabScrollButton.cjs +93 -0
- package/dist/Tabs/TabScrollButton.d.cts +2 -0
- package/dist/Tabs/TabScrollButton.d.mts +2 -0
- package/dist/Tabs/TabScrollButton.mjs +91 -0
- package/dist/Tabs/Tabs.cjs +3 -0
- package/dist/Tabs/Tabs.d.cts +3 -0
- package/dist/Tabs/Tabs.d.mts +3 -0
- package/dist/Tabs/Tabs.mjs +2 -0
- package/dist/Tabs-D_wkX-Jb.cjs +645 -0
- package/dist/Tabs-YfCUbkQV.mjs +633 -0
- package/dist/Tabs.cjs +13 -0
- package/dist/Tabs.d.cts +8 -0
- package/dist/Tabs.d.mts +8 -0
- package/dist/Tabs.mjs +7 -0
- package/dist/TabsContext-C2agsLBN.d.cts +6 -0
- package/dist/TabsContext-DqyxdmGW.d.mts +6 -0
- package/dist/TabsValueContext-D40zGCpE.cjs +19 -0
- package/dist/TabsValueContext-DvL3inf7.mjs +8 -0
- package/dist/TextInput.cjs +1 -1
- package/dist/TextInput.d.cts +1 -2
- package/dist/TextInput.d.mts +1 -2
- package/dist/TextInput.mjs +1 -1
- package/dist/ToggleButton/ToggleButton.cjs +1 -1
- package/dist/ToggleButton/ToggleButton.d.cts +1 -1
- package/dist/ToggleButton/ToggleButton.d.mts +1 -1
- package/dist/ToggleButton/ToggleButton.mjs +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.cjs +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.cts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.mts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.mjs +1 -1
- package/dist/Typography.cjs +1 -1
- package/dist/Typography.d.cts +2 -2
- package/dist/Typography.d.mts +2 -2
- package/dist/Typography.mjs +1 -1
- package/dist/View.d.cts +1 -1
- package/dist/View.d.mts +1 -1
- package/dist/catalog.cjs +4110 -0
- package/dist/catalog.d.cts +90 -0
- package/dist/catalog.d.mts +90 -0
- package/dist/catalog.mjs +4109 -0
- package/dist/computePopoverPosition-BIprs_xo.mjs +123 -0
- package/dist/computePopoverPosition-DiyEOHnU.cjs +128 -0
- package/dist/dividerLine-BNljcGlv.cjs +66 -0
- package/dist/dividerLine-FahY-M6_.mjs +31 -0
- package/dist/engine.d.cts +1 -1
- package/dist/engine.d.mts +1 -1
- package/dist/index-B3LIhqHR.d.cts +98 -0
- package/dist/{index-DbEnSf2m.d.cts → index-B8DNxyEw.d.mts} +3 -4
- package/dist/{index-CxUsrlg1.d.cts → index-BCnKYNlZ.d.cts} +1 -2
- package/dist/{index-BUoVTCqX.d.mts → index-BFruxTHv.d.cts} +2 -3
- package/dist/{index-BSqet8aO.d.cts → index-BSA6SKao.d.mts} +2 -3
- package/dist/{index-CrN4MSUF.d.cts → index-BVPrG1L0.d.mts} +1 -1
- package/dist/{index-Celm-8iN.d.cts → index-BbgFYfX_.d.mts} +3 -4
- package/dist/{index-B78VkB0-.d.cts → index-Bhdn4KTy.d.cts} +2 -3
- package/dist/{index-Chg6pSrr.d.mts → index-BiVvxOvj.d.cts} +3 -4
- package/dist/index-BjPX49XA.d.mts +34 -0
- package/dist/{index-BB-dLv5V.d.mts → index-BjfPEP_5.d.cts} +3 -4
- package/dist/{index-Bid71KeF.d.cts → index-BlLH6rlE.d.cts} +2 -2
- package/dist/{index-Ctqajtac.d.cts → index-BqpS_Huq.d.mts} +12 -4
- package/dist/{index-BhibLnZ0.d.cts → index-Bxd9NOWb.d.mts} +2 -3
- package/dist/index-C3KrFPCj.d.mts +35 -0
- package/dist/{themes-RX2UX5gD.d.mts → index-CVNJEUwJ.d.mts} +217 -8
- package/dist/index-CWnbCxgw.d.cts +72 -0
- package/dist/index-Cj5Rhh_9.d.mts +72 -0
- package/dist/index-CoEqjFYn.d.mts +98 -0
- package/dist/{index-S-ClM6WM.d.mts → index-CrIxI8Na.d.mts} +2 -2
- package/dist/index-DBteSahY.d.cts +1 -0
- package/dist/index-DCmH5f9I.d.cts +72 -0
- package/dist/{index-VOsBSWEu.d.mts → index-DDJuUfL5.d.cts} +1 -1
- package/dist/{index-DdqdSOct.d.cts → index-DIC7HKpP.d.mts} +2 -3
- package/dist/{index-BfZuh9c2.d.mts → index-DJCpnTH3.d.mts} +2 -3
- package/dist/index-DQcnJ5H4.d.cts +35 -0
- package/dist/{index-DNwF3DUX.d.cts → index-DXhMkjQ6.d.cts} +2 -3
- package/dist/index-DckSub2J.d.mts +72 -0
- package/dist/{index-nc4Sxiy9.d.mts → index-DeDxYlSQ.d.mts} +2 -3
- package/dist/{themes-Kbk9h5cN.d.cts → index-DmJ7yWWi.d.cts} +214 -5
- package/dist/{index-Wnv6jCR3.d.mts → index-DqjXDutI.d.mts} +1 -2
- package/dist/{index-GpnmW6vu.d.mts → index-DrVYWt-X.d.mts} +1 -2
- package/dist/{index-Belxmt1X.d.cts → index-DuVNRXP4.d.cts} +1 -2
- package/dist/{index-smqjMLAZ.d.mts → index-IdMqR82e.d.cts} +2 -3
- package/dist/{index-DXvQ-JVZ.d.mts → index-XxydXX8l.d.cts} +2 -3
- package/dist/index-_G1osn09.d.mts +1 -0
- package/dist/index-gnh-Oe0n.d.cts +34 -0
- package/dist/{index-DO9J-Fla.d.mts → index-qlfNErNd.d.cts} +12 -4
- package/dist/index.d.cts +1 -2
- package/dist/index.d.mts +1 -2
- package/dist/style.cjs +1 -1
- package/dist/style.d.cts +2 -2
- package/dist/style.d.mts +2 -2
- package/dist/style.mjs +1 -1
- package/dist/surfaceSystem-BGQBoXv_.cjs +38 -0
- package/dist/surfaceSystem-D8TbmKy3.mjs +21 -0
- package/dist/theme-BxXuXRgQ.cjs +137 -0
- package/dist/theme-Z9_QludW.mjs +102 -0
- package/dist/theme.cjs +25 -24
- package/dist/theme.d.cts +3 -3
- package/dist/theme.d.mts +3 -3
- package/dist/theme.mjs +2 -1
- package/dist/{theme-CDVxig_g.mjs → themes-L-dE7_ck.mjs} +10 -110
- package/dist/{theme-BXlAP3xf.cjs → themes-gd6tcmqS.cjs} +0 -136
- package/dist/{useTablePagination-COTiNH_8.d.mts → useTablePagination-C5VKtqDp.d.cts} +1 -1
- package/dist/{useTablePagination-WFkaUZu8.d.cts → useTablePagination-C6LSlt3w.d.mts} +1 -1
- package/package.json +43 -2
- package/dist/Popover-DwnSLpp1.mjs +0 -253
- package/dist/index-B_dKjEDR.d.mts +0 -23
- package/dist/index-C1WqEDtQ.d.mts +0 -69
- package/dist/index-CA7HnbtH.d.cts +0 -21
- package/dist/index-CKZaErxJ.d.mts +0 -21
- package/dist/index-DBUwu65Z.d.cts +0 -69
- package/dist/index-DzQJSYIh.d.cts +0 -23
- package/dist/index-cuv3o-L7.d.mts +0 -34
- package/dist/index-nB94D7UM.d.cts +0 -34
package/dist/catalog.mjs
ADDED
|
@@ -0,0 +1,4109 @@
|
|
|
1
|
+
import { n as baseTheme } from "./themes-L-dE7_ck.mjs";
|
|
2
|
+
import { background, border, color, flexbox, grid, layout, position, shadow, space, typography } from "@soroush.tech/styled-system";
|
|
3
|
+
//#region ../docs-content/src/kebabCase.ts
|
|
4
|
+
/** PascalCase or camelCase to kebab-case: `TextInput` -> `text-input`. */
|
|
5
|
+
const kebabCase = (name) => name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ../docs-content/src/registry.ts
|
|
8
|
+
/** `nested` marks container folders whose README sits one level down (Table/Table/README.md). */
|
|
9
|
+
const component = (name, nested = false, pkg = "design-system") => ({
|
|
10
|
+
pkg,
|
|
11
|
+
name,
|
|
12
|
+
slug: kebabCase(name),
|
|
13
|
+
readmePath: nested ? `${name}/${name}/README.md` : `${name}/README.md`
|
|
14
|
+
});
|
|
15
|
+
const markdownComponent = (name) => component(name, false, "markdown");
|
|
16
|
+
/**
|
|
17
|
+
* The component taxonomy of the design-system README's inventory, driving the docs
|
|
18
|
+
* sidebar, the components index grid, and the MCP server's component tools.
|
|
19
|
+
* `registry.test.ts` guards it against the actual README files on disk.
|
|
20
|
+
*/
|
|
21
|
+
const componentCategories = [
|
|
22
|
+
{
|
|
23
|
+
label: "Layout & surfaces",
|
|
24
|
+
items: [
|
|
25
|
+
component("View"),
|
|
26
|
+
component("Flex"),
|
|
27
|
+
component("Grid"),
|
|
28
|
+
component("Paper"),
|
|
29
|
+
component("Card"),
|
|
30
|
+
component("Quote"),
|
|
31
|
+
component("AppBar"),
|
|
32
|
+
component("Drawer"),
|
|
33
|
+
component("Sidebar", true)
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "Content & data display",
|
|
38
|
+
items: [
|
|
39
|
+
component("Typography"),
|
|
40
|
+
component("Link"),
|
|
41
|
+
component("Icon"),
|
|
42
|
+
component("Image"),
|
|
43
|
+
component("Avatar"),
|
|
44
|
+
component("Table", true)
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: "Inputs & forms",
|
|
49
|
+
items: [
|
|
50
|
+
component("Button"),
|
|
51
|
+
component("ButtonGroup"),
|
|
52
|
+
component("ToggleButton", true),
|
|
53
|
+
component("TextInput"),
|
|
54
|
+
component("Checkbox"),
|
|
55
|
+
component("Radio"),
|
|
56
|
+
component("Switch"),
|
|
57
|
+
component("NativeSelect"),
|
|
58
|
+
component("Select"),
|
|
59
|
+
component("MenuItem"),
|
|
60
|
+
component("Form"),
|
|
61
|
+
component("FormControl"),
|
|
62
|
+
component("FormLabel"),
|
|
63
|
+
component("FormHelperText"),
|
|
64
|
+
component("Pagination")
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: "Navigation & menus",
|
|
69
|
+
items: [
|
|
70
|
+
component("Breadcrumbs"),
|
|
71
|
+
component("Menu", true),
|
|
72
|
+
component("Tabs", true)
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: "Feedback",
|
|
77
|
+
items: [
|
|
78
|
+
component("CircularProgress"),
|
|
79
|
+
component("LinearProgress"),
|
|
80
|
+
component("Skeleton"),
|
|
81
|
+
component("Backdrop")
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: "Overlay & behavior",
|
|
86
|
+
items: [
|
|
87
|
+
component("Portal"),
|
|
88
|
+
component("FocusTrap"),
|
|
89
|
+
component("Modal"),
|
|
90
|
+
component("Popover"),
|
|
91
|
+
component("Pressable")
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
];
|
|
95
|
+
const allComponents = componentCategories.flatMap((category) => category.items);
|
|
96
|
+
/** Every family member, in its family's order. */
|
|
97
|
+
const memberComponents = Object.entries({
|
|
98
|
+
Menu: [
|
|
99
|
+
"ContextMenu",
|
|
100
|
+
"MenuDivider",
|
|
101
|
+
"MenuItems",
|
|
102
|
+
"MenuList"
|
|
103
|
+
],
|
|
104
|
+
Pagination: ["PaginationItem"],
|
|
105
|
+
Sidebar: ["SidebarItem"],
|
|
106
|
+
Table: [
|
|
107
|
+
"TableBody",
|
|
108
|
+
"TableCell",
|
|
109
|
+
"TableContainer",
|
|
110
|
+
"TableControl",
|
|
111
|
+
"TableFooter",
|
|
112
|
+
"TableHead",
|
|
113
|
+
"TablePagination",
|
|
114
|
+
"TablePaginationActions",
|
|
115
|
+
"TableRow",
|
|
116
|
+
"TableSortLabel"
|
|
117
|
+
],
|
|
118
|
+
Tabs: [
|
|
119
|
+
"Tab",
|
|
120
|
+
"TabContext",
|
|
121
|
+
"TabList",
|
|
122
|
+
"TabPanel",
|
|
123
|
+
"TabScrollButton"
|
|
124
|
+
],
|
|
125
|
+
ToggleButton: ["ToggleButtonGroup"]
|
|
126
|
+
}).flatMap(([family, names]) => names.map((name) => ({
|
|
127
|
+
pkg: "design-system",
|
|
128
|
+
name,
|
|
129
|
+
slug: kebabCase(name),
|
|
130
|
+
readmePath: `${family}/${name}/README.md`,
|
|
131
|
+
family
|
|
132
|
+
})));
|
|
133
|
+
/** A family's members; none for a component that isn't one. */
|
|
134
|
+
const membersOf = (item) => memberComponents.filter((member) => member.family === item.name);
|
|
135
|
+
/** The markdown package's component library - flat, no categories. */
|
|
136
|
+
const markdownComponents = [
|
|
137
|
+
markdownComponent("Preview"),
|
|
138
|
+
markdownComponent("Editor"),
|
|
139
|
+
markdownComponent("LiveEdit"),
|
|
140
|
+
markdownComponent("Control"),
|
|
141
|
+
markdownComponent("Toolbar"),
|
|
142
|
+
markdownComponent("CodeBlock"),
|
|
143
|
+
markdownComponent("Mermaid")
|
|
144
|
+
];
|
|
145
|
+
/** Every documented component, family members included, across packages. Slugs are globally unique. */
|
|
146
|
+
const allDocComponents = [...allComponents.flatMap((item) => [item, ...membersOf(item)]), ...markdownComponents];
|
|
147
|
+
new Map(allDocComponents.map((item) => [item.slug, item]));
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/catalog/defineCatalogEntry.ts
|
|
150
|
+
/**
|
|
151
|
+
* Types a component's catalog entry against its props: `defineCatalogEntry<ButtonProps>()({
|
|
152
|
+
* ... })`. Curried, so the props are named and the entry is still inferred.
|
|
153
|
+
*/
|
|
154
|
+
const defineCatalogEntry = () => (entry) => entry;
|
|
155
|
+
/** A nested node, for brevity: `node('MenuItem', { value: 'web' }, ['Web'])`. */
|
|
156
|
+
const node = (component, props = {}, children = []) => ({
|
|
157
|
+
component,
|
|
158
|
+
props,
|
|
159
|
+
children
|
|
160
|
+
});
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/AppBar/AppBar.catalog.ts
|
|
163
|
+
const appBarPositionValues = [
|
|
164
|
+
"static",
|
|
165
|
+
"relative",
|
|
166
|
+
"absolute",
|
|
167
|
+
"fixed",
|
|
168
|
+
"sticky"
|
|
169
|
+
];
|
|
170
|
+
const pictured$2 = [
|
|
171
|
+
"paper",
|
|
172
|
+
"primary",
|
|
173
|
+
"secondary",
|
|
174
|
+
"modal"
|
|
175
|
+
];
|
|
176
|
+
const colorLabels$5 = {
|
|
177
|
+
paper: "Paper",
|
|
178
|
+
primary: "Primary",
|
|
179
|
+
secondary: "Secondary",
|
|
180
|
+
modal: "Modal"
|
|
181
|
+
};
|
|
182
|
+
const appBarCatalog = defineCatalogEntry()({
|
|
183
|
+
summary: "A full-width header bar for an app title, navigation and actions.",
|
|
184
|
+
isPlaceable: true,
|
|
185
|
+
example: {
|
|
186
|
+
component: "AppBar",
|
|
187
|
+
props: { color: "paper" },
|
|
188
|
+
children: ["Application Header"]
|
|
189
|
+
},
|
|
190
|
+
variants: pictured$2.map((color) => ({
|
|
191
|
+
name: color,
|
|
192
|
+
label: colorLabels$5[color],
|
|
193
|
+
example: {
|
|
194
|
+
component: "AppBar",
|
|
195
|
+
props: { color },
|
|
196
|
+
children: ["Application Header"]
|
|
197
|
+
}
|
|
198
|
+
})),
|
|
199
|
+
options: {
|
|
200
|
+
color: { scale: "background" },
|
|
201
|
+
size: {
|
|
202
|
+
scale: "sizes",
|
|
203
|
+
default: "md"
|
|
204
|
+
},
|
|
205
|
+
elevation: {
|
|
206
|
+
values: [
|
|
207
|
+
0,
|
|
208
|
+
4,
|
|
209
|
+
8,
|
|
210
|
+
12,
|
|
211
|
+
16,
|
|
212
|
+
24
|
|
213
|
+
],
|
|
214
|
+
default: 4
|
|
215
|
+
},
|
|
216
|
+
position: {
|
|
217
|
+
values: appBarPositionValues,
|
|
218
|
+
default: "static"
|
|
219
|
+
},
|
|
220
|
+
blur: {
|
|
221
|
+
values: [true, false],
|
|
222
|
+
default: false
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
content: { children: "children" },
|
|
226
|
+
preview: { width: 480 }
|
|
227
|
+
});
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/Avatar/Avatar.catalog.ts
|
|
230
|
+
const avatarVariantValues = [
|
|
231
|
+
"circular",
|
|
232
|
+
"rounded",
|
|
233
|
+
"square"
|
|
234
|
+
];
|
|
235
|
+
const variantLabels$16 = {
|
|
236
|
+
circular: "Circular",
|
|
237
|
+
rounded: "Rounded",
|
|
238
|
+
square: "Square"
|
|
239
|
+
};
|
|
240
|
+
const initials = {
|
|
241
|
+
size: "md",
|
|
242
|
+
bg: "secondary"
|
|
243
|
+
};
|
|
244
|
+
const avatarCatalog = defineCatalogEntry()({
|
|
245
|
+
summary: "A person or entity shown as an image, or as initials when there is no image.",
|
|
246
|
+
isPlaceable: true,
|
|
247
|
+
example: {
|
|
248
|
+
component: "Avatar",
|
|
249
|
+
props: {
|
|
250
|
+
...initials,
|
|
251
|
+
variant: "circular"
|
|
252
|
+
},
|
|
253
|
+
children: ["MS"]
|
|
254
|
+
},
|
|
255
|
+
variants: avatarVariantValues.map((variant) => ({
|
|
256
|
+
name: variant,
|
|
257
|
+
label: variantLabels$16[variant],
|
|
258
|
+
example: {
|
|
259
|
+
component: "Avatar",
|
|
260
|
+
props: {
|
|
261
|
+
...initials,
|
|
262
|
+
variant
|
|
263
|
+
},
|
|
264
|
+
children: ["MS"]
|
|
265
|
+
}
|
|
266
|
+
})),
|
|
267
|
+
options: {
|
|
268
|
+
variant: {
|
|
269
|
+
values: avatarVariantValues,
|
|
270
|
+
default: "circular"
|
|
271
|
+
},
|
|
272
|
+
size: {
|
|
273
|
+
scale: "avatar",
|
|
274
|
+
default: "md"
|
|
275
|
+
},
|
|
276
|
+
bg: { scale: "background" },
|
|
277
|
+
ring: {
|
|
278
|
+
values: [true, false],
|
|
279
|
+
default: false
|
|
280
|
+
},
|
|
281
|
+
ringColor: {
|
|
282
|
+
scale: "border",
|
|
283
|
+
default: "primary"
|
|
284
|
+
},
|
|
285
|
+
ringWidth: {
|
|
286
|
+
scale: "borderWidths",
|
|
287
|
+
default: "thin"
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
content: { children: "children" }
|
|
291
|
+
});
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region src/Backdrop/Backdrop.catalog.ts
|
|
294
|
+
const backdropCatalog = defineCatalogEntry()({
|
|
295
|
+
summary: "The dimmed full-viewport scrim a modal draws behind its content.",
|
|
296
|
+
isPlaceable: false,
|
|
297
|
+
example: {
|
|
298
|
+
component: "Backdrop",
|
|
299
|
+
props: {},
|
|
300
|
+
children: []
|
|
301
|
+
},
|
|
302
|
+
variants: [],
|
|
303
|
+
options: { bg: {
|
|
304
|
+
scale: "background",
|
|
305
|
+
default: "backdrop"
|
|
306
|
+
} },
|
|
307
|
+
content: {},
|
|
308
|
+
preview: {
|
|
309
|
+
width: 320,
|
|
310
|
+
height: 200
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/Breadcrumbs/Breadcrumbs.catalog.ts
|
|
315
|
+
const breadcrumbsSeparatorValues = [
|
|
316
|
+
"/",
|
|
317
|
+
"›",
|
|
318
|
+
"-",
|
|
319
|
+
"·"
|
|
320
|
+
];
|
|
321
|
+
const crumbs = [
|
|
322
|
+
node("Link", {
|
|
323
|
+
href: "#",
|
|
324
|
+
underline: "hover",
|
|
325
|
+
color: "inherit"
|
|
326
|
+
}, ["Home"]),
|
|
327
|
+
node("Link", {
|
|
328
|
+
href: "#",
|
|
329
|
+
underline: "hover",
|
|
330
|
+
color: "inherit"
|
|
331
|
+
}, ["Catalog"]),
|
|
332
|
+
node("Typography", {
|
|
333
|
+
color: "primary",
|
|
334
|
+
"aria-current": "page"
|
|
335
|
+
}, ["Accessories"])
|
|
336
|
+
];
|
|
337
|
+
const breadcrumbsCatalog = defineCatalogEntry()({
|
|
338
|
+
summary: "The trail of links from a site's root to the current page.",
|
|
339
|
+
isPlaceable: true,
|
|
340
|
+
example: {
|
|
341
|
+
component: "Breadcrumbs",
|
|
342
|
+
props: {
|
|
343
|
+
"aria-label": "Breadcrumb",
|
|
344
|
+
expandLabel: "Show path"
|
|
345
|
+
},
|
|
346
|
+
children: crumbs
|
|
347
|
+
},
|
|
348
|
+
variants: breadcrumbsSeparatorValues.map((separator) => ({
|
|
349
|
+
name: separator,
|
|
350
|
+
label: `Separated by ${separator}`,
|
|
351
|
+
example: {
|
|
352
|
+
component: "Breadcrumbs",
|
|
353
|
+
props: {
|
|
354
|
+
"aria-label": "Breadcrumb",
|
|
355
|
+
separator
|
|
356
|
+
},
|
|
357
|
+
children: crumbs
|
|
358
|
+
}
|
|
359
|
+
})),
|
|
360
|
+
options: {
|
|
361
|
+
separator: {
|
|
362
|
+
values: breadcrumbsSeparatorValues,
|
|
363
|
+
default: "/"
|
|
364
|
+
},
|
|
365
|
+
maxItems: {
|
|
366
|
+
values: [
|
|
367
|
+
2,
|
|
368
|
+
3,
|
|
369
|
+
4,
|
|
370
|
+
8
|
|
371
|
+
],
|
|
372
|
+
default: 8
|
|
373
|
+
},
|
|
374
|
+
itemsBeforeCollapse: {
|
|
375
|
+
values: [
|
|
376
|
+
0,
|
|
377
|
+
1,
|
|
378
|
+
2
|
|
379
|
+
],
|
|
380
|
+
default: 1
|
|
381
|
+
},
|
|
382
|
+
itemsAfterCollapse: {
|
|
383
|
+
values: [1, 2],
|
|
384
|
+
default: 1
|
|
385
|
+
},
|
|
386
|
+
color: {
|
|
387
|
+
scale: "text",
|
|
388
|
+
default: "secondary"
|
|
389
|
+
},
|
|
390
|
+
typography: {
|
|
391
|
+
scale: "typography",
|
|
392
|
+
default: "body1"
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
content: { children: "children" }
|
|
396
|
+
});
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region src/Button/Button.catalog.ts
|
|
399
|
+
const buttonVariantValues = [
|
|
400
|
+
"contained",
|
|
401
|
+
"outlined",
|
|
402
|
+
"text"
|
|
403
|
+
];
|
|
404
|
+
const buttonShapeValues = [
|
|
405
|
+
"square",
|
|
406
|
+
"rounded",
|
|
407
|
+
"pill"
|
|
408
|
+
];
|
|
409
|
+
const buttonLoadingPositionValues = [
|
|
410
|
+
"start",
|
|
411
|
+
"end",
|
|
412
|
+
"center"
|
|
413
|
+
];
|
|
414
|
+
const variantLabels$15 = {
|
|
415
|
+
contained: "Contained",
|
|
416
|
+
outlined: "Outlined",
|
|
417
|
+
text: "Text"
|
|
418
|
+
};
|
|
419
|
+
const buttonCatalog = defineCatalogEntry()({
|
|
420
|
+
summary: "An action - filled, stroked or plain, in any palette color, or a link with `href`.",
|
|
421
|
+
isPlaceable: true,
|
|
422
|
+
example: {
|
|
423
|
+
component: "Button",
|
|
424
|
+
props: { variant: "contained" },
|
|
425
|
+
children: ["Button"]
|
|
426
|
+
},
|
|
427
|
+
variants: buttonVariantValues.map((variant) => ({
|
|
428
|
+
name: variant,
|
|
429
|
+
label: variantLabels$15[variant],
|
|
430
|
+
example: {
|
|
431
|
+
component: "Button",
|
|
432
|
+
props: { variant },
|
|
433
|
+
children: ["Button"]
|
|
434
|
+
}
|
|
435
|
+
})),
|
|
436
|
+
options: {
|
|
437
|
+
variant: {
|
|
438
|
+
values: buttonVariantValues,
|
|
439
|
+
default: "contained"
|
|
440
|
+
},
|
|
441
|
+
color: {
|
|
442
|
+
scale: "palette",
|
|
443
|
+
default: "primary"
|
|
444
|
+
},
|
|
445
|
+
size: {
|
|
446
|
+
scale: "sizes",
|
|
447
|
+
default: "md"
|
|
448
|
+
},
|
|
449
|
+
shape: {
|
|
450
|
+
values: buttonShapeValues,
|
|
451
|
+
default: "square"
|
|
452
|
+
},
|
|
453
|
+
fullWidth: {
|
|
454
|
+
values: [true, false],
|
|
455
|
+
default: false
|
|
456
|
+
},
|
|
457
|
+
disabled: {
|
|
458
|
+
values: [true, false],
|
|
459
|
+
default: false
|
|
460
|
+
},
|
|
461
|
+
loading: {
|
|
462
|
+
values: [true, false],
|
|
463
|
+
default: false
|
|
464
|
+
},
|
|
465
|
+
loadingPosition: {
|
|
466
|
+
values: buttonLoadingPositionValues,
|
|
467
|
+
default: "center"
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
content: {
|
|
471
|
+
children: "children",
|
|
472
|
+
startIcon: "child",
|
|
473
|
+
endIcon: "child",
|
|
474
|
+
loadingIndicator: "child"
|
|
475
|
+
},
|
|
476
|
+
domEvents: ["onClick"]
|
|
477
|
+
});
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region src/ButtonGroup/ButtonGroup.catalog.ts
|
|
480
|
+
const buttonGroupVariantValues = [
|
|
481
|
+
"contained",
|
|
482
|
+
"outlined",
|
|
483
|
+
"text"
|
|
484
|
+
];
|
|
485
|
+
const buttonGroupOrientationValues = ["horizontal", "vertical"];
|
|
486
|
+
const variantLabels$14 = {
|
|
487
|
+
contained: "Contained",
|
|
488
|
+
outlined: "Outlined",
|
|
489
|
+
text: "Text"
|
|
490
|
+
};
|
|
491
|
+
const buttons = [
|
|
492
|
+
node("Button", {}, ["One"]),
|
|
493
|
+
node("Button", {}, ["Two"]),
|
|
494
|
+
node("Button", {}, ["Three"])
|
|
495
|
+
];
|
|
496
|
+
const buttonGroupCatalog = defineCatalogEntry()({
|
|
497
|
+
summary: "A row or column of related buttons joined into one cluster that share a style.",
|
|
498
|
+
isPlaceable: true,
|
|
499
|
+
example: {
|
|
500
|
+
component: "ButtonGroup",
|
|
501
|
+
props: { "aria-label": "Basic button group" },
|
|
502
|
+
children: buttons
|
|
503
|
+
},
|
|
504
|
+
variants: buttonGroupVariantValues.map((variant) => ({
|
|
505
|
+
name: variant,
|
|
506
|
+
label: variantLabels$14[variant],
|
|
507
|
+
example: {
|
|
508
|
+
component: "ButtonGroup",
|
|
509
|
+
props: {
|
|
510
|
+
variant,
|
|
511
|
+
"aria-label": "Basic button group"
|
|
512
|
+
},
|
|
513
|
+
children: buttons
|
|
514
|
+
}
|
|
515
|
+
})),
|
|
516
|
+
options: {
|
|
517
|
+
variant: {
|
|
518
|
+
values: buttonGroupVariantValues,
|
|
519
|
+
default: "outlined"
|
|
520
|
+
},
|
|
521
|
+
color: {
|
|
522
|
+
scale: "palette",
|
|
523
|
+
default: "primary"
|
|
524
|
+
},
|
|
525
|
+
size: {
|
|
526
|
+
scale: "sizes",
|
|
527
|
+
default: "md"
|
|
528
|
+
},
|
|
529
|
+
orientation: {
|
|
530
|
+
values: buttonGroupOrientationValues,
|
|
531
|
+
default: "horizontal"
|
|
532
|
+
},
|
|
533
|
+
borderRadius: {
|
|
534
|
+
scale: "radii",
|
|
535
|
+
default: "md"
|
|
536
|
+
},
|
|
537
|
+
disabled: {
|
|
538
|
+
values: [true, false],
|
|
539
|
+
default: false
|
|
540
|
+
},
|
|
541
|
+
fullWidth: {
|
|
542
|
+
values: [true, false],
|
|
543
|
+
default: false
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
content: { children: "children" }
|
|
547
|
+
});
|
|
548
|
+
//#endregion
|
|
549
|
+
//#region src/Card/Card.catalog.ts
|
|
550
|
+
const cardVariantValues = [
|
|
551
|
+
"paper",
|
|
552
|
+
"bracketBox",
|
|
553
|
+
"interactive"
|
|
554
|
+
];
|
|
555
|
+
const variantLabels$13 = {
|
|
556
|
+
paper: "Paper",
|
|
557
|
+
bracketBox: "Bracket box",
|
|
558
|
+
interactive: "Interactive"
|
|
559
|
+
};
|
|
560
|
+
const content$2 = {
|
|
561
|
+
title: "Component",
|
|
562
|
+
caption: "A flexible card surface with paper and bracketBox variants.",
|
|
563
|
+
p: 3
|
|
564
|
+
};
|
|
565
|
+
const cardCatalog = defineCatalogEntry()({
|
|
566
|
+
summary: "A surface with an optional icon, title and caption over its own content.",
|
|
567
|
+
isPlaceable: true,
|
|
568
|
+
example: {
|
|
569
|
+
component: "Card",
|
|
570
|
+
props: content$2,
|
|
571
|
+
children: []
|
|
572
|
+
},
|
|
573
|
+
variants: cardVariantValues.map((variant) => ({
|
|
574
|
+
name: variant,
|
|
575
|
+
label: variantLabels$13[variant],
|
|
576
|
+
example: {
|
|
577
|
+
component: "Card",
|
|
578
|
+
props: {
|
|
579
|
+
...content$2,
|
|
580
|
+
variant
|
|
581
|
+
},
|
|
582
|
+
children: []
|
|
583
|
+
}
|
|
584
|
+
})),
|
|
585
|
+
options: {
|
|
586
|
+
variant: {
|
|
587
|
+
values: cardVariantValues,
|
|
588
|
+
default: "paper"
|
|
589
|
+
},
|
|
590
|
+
elevation: {
|
|
591
|
+
values: [
|
|
592
|
+
0,
|
|
593
|
+
1,
|
|
594
|
+
2,
|
|
595
|
+
4,
|
|
596
|
+
8,
|
|
597
|
+
16,
|
|
598
|
+
24
|
|
599
|
+
],
|
|
600
|
+
default: 1
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
content: {
|
|
604
|
+
children: "children",
|
|
605
|
+
title: "text",
|
|
606
|
+
caption: "text"
|
|
607
|
+
},
|
|
608
|
+
preview: { width: 280 }
|
|
609
|
+
});
|
|
610
|
+
//#endregion
|
|
611
|
+
//#region src/Checkbox/Checkbox.catalog.ts
|
|
612
|
+
const colorLabels$4 = {
|
|
613
|
+
default: "Default",
|
|
614
|
+
primary: "Primary",
|
|
615
|
+
secondary: "Secondary",
|
|
616
|
+
success: "Success",
|
|
617
|
+
error: "Error",
|
|
618
|
+
info: "Info",
|
|
619
|
+
warning: "Warning"
|
|
620
|
+
};
|
|
621
|
+
const colors$3 = Object.keys(colorLabels$4);
|
|
622
|
+
const checkboxCatalog = defineCatalogEntry()({
|
|
623
|
+
summary: "A box that is checked or not, with an optional label and an indeterminate state.",
|
|
624
|
+
isPlaceable: true,
|
|
625
|
+
example: {
|
|
626
|
+
component: "Checkbox",
|
|
627
|
+
props: {},
|
|
628
|
+
children: ["Accept terms and conditions"]
|
|
629
|
+
},
|
|
630
|
+
variants: colors$3.map((color) => ({
|
|
631
|
+
name: color,
|
|
632
|
+
label: colorLabels$4[color],
|
|
633
|
+
example: {
|
|
634
|
+
component: "Checkbox",
|
|
635
|
+
props: {
|
|
636
|
+
color,
|
|
637
|
+
checked: true
|
|
638
|
+
},
|
|
639
|
+
children: ["Accept terms and conditions"]
|
|
640
|
+
}
|
|
641
|
+
})),
|
|
642
|
+
options: {
|
|
643
|
+
color: {
|
|
644
|
+
scale: "palette",
|
|
645
|
+
default: "default"
|
|
646
|
+
},
|
|
647
|
+
size: {
|
|
648
|
+
scale: "sizes",
|
|
649
|
+
default: "md"
|
|
650
|
+
},
|
|
651
|
+
indeterminate: {
|
|
652
|
+
values: [true, false],
|
|
653
|
+
default: false
|
|
654
|
+
},
|
|
655
|
+
disabled: {
|
|
656
|
+
values: [true, false],
|
|
657
|
+
default: false
|
|
658
|
+
},
|
|
659
|
+
required: {
|
|
660
|
+
values: [true, false],
|
|
661
|
+
default: false
|
|
662
|
+
},
|
|
663
|
+
fullWidth: {
|
|
664
|
+
values: [true, false],
|
|
665
|
+
default: false
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
content: {
|
|
669
|
+
children: "children",
|
|
670
|
+
icon: "child",
|
|
671
|
+
checkedIcon: "child"
|
|
672
|
+
},
|
|
673
|
+
twoWay: {
|
|
674
|
+
prop: "checked",
|
|
675
|
+
event: "onChange",
|
|
676
|
+
read: "target.checked"
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
//#endregion
|
|
680
|
+
//#region src/Menu/ContextMenu/ContextMenu.catalog.ts
|
|
681
|
+
const contextMenuCatalog = defineCatalogEntry()({
|
|
682
|
+
summary: "A `MenuList` opened by a right-click over its `target`, at the pointer.",
|
|
683
|
+
isPlaceable: false,
|
|
684
|
+
example: {
|
|
685
|
+
component: "ContextMenu",
|
|
686
|
+
props: { "aria-label": "Canvas" },
|
|
687
|
+
children: [
|
|
688
|
+
node("MenuItem", {
|
|
689
|
+
value: "cut",
|
|
690
|
+
shortcut: "Control+X"
|
|
691
|
+
}, ["Cut"]),
|
|
692
|
+
node("MenuItem", {
|
|
693
|
+
value: "copy",
|
|
694
|
+
shortcut: "Control+C"
|
|
695
|
+
}, ["Copy"]),
|
|
696
|
+
node("MenuItem", {
|
|
697
|
+
value: "paste",
|
|
698
|
+
shortcut: "Control+V",
|
|
699
|
+
disabled: true,
|
|
700
|
+
note: "The clipboard is empty"
|
|
701
|
+
}, ["Paste"])
|
|
702
|
+
]
|
|
703
|
+
},
|
|
704
|
+
variants: [],
|
|
705
|
+
options: {
|
|
706
|
+
color: {
|
|
707
|
+
scale: "palette",
|
|
708
|
+
default: "primary"
|
|
709
|
+
},
|
|
710
|
+
textColor: { scale: "text" },
|
|
711
|
+
size: {
|
|
712
|
+
scale: "sizes",
|
|
713
|
+
default: "md"
|
|
714
|
+
},
|
|
715
|
+
dense: {
|
|
716
|
+
values: [true, false],
|
|
717
|
+
default: false
|
|
718
|
+
},
|
|
719
|
+
elevation: {
|
|
720
|
+
values: [
|
|
721
|
+
0,
|
|
722
|
+
1,
|
|
723
|
+
2,
|
|
724
|
+
4,
|
|
725
|
+
8,
|
|
726
|
+
16,
|
|
727
|
+
24
|
|
728
|
+
],
|
|
729
|
+
default: 8
|
|
730
|
+
},
|
|
731
|
+
layer: { scale: "zOrder" },
|
|
732
|
+
marginThreshold: { scale: "space" }
|
|
733
|
+
},
|
|
734
|
+
content: {
|
|
735
|
+
children: "children",
|
|
736
|
+
target: "child",
|
|
737
|
+
emptyLabel: "text",
|
|
738
|
+
items: "none"
|
|
739
|
+
},
|
|
740
|
+
domEvents: ["onSelect", "onClose"]
|
|
741
|
+
});
|
|
742
|
+
//#endregion
|
|
743
|
+
//#region src/CircularProgress/CircularProgress.catalog.ts
|
|
744
|
+
const circularProgressVariantValues = ["indeterminate", "determinate"];
|
|
745
|
+
const circularProgressEasingValues = [
|
|
746
|
+
"linear",
|
|
747
|
+
"ease",
|
|
748
|
+
"ease-in",
|
|
749
|
+
"ease-out",
|
|
750
|
+
"ease-in-out"
|
|
751
|
+
];
|
|
752
|
+
const variantLabels$12 = {
|
|
753
|
+
indeterminate: "Indeterminate",
|
|
754
|
+
determinate: "Determinate"
|
|
755
|
+
};
|
|
756
|
+
const variantProps$1 = {
|
|
757
|
+
indeterminate: { variant: "indeterminate" },
|
|
758
|
+
determinate: {
|
|
759
|
+
variant: "determinate",
|
|
760
|
+
value: 70
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
const circularProgressCatalog = defineCatalogEntry()({
|
|
764
|
+
summary: "A circular loading indicator - a looping spinner, or an arc that shows a `value`.",
|
|
765
|
+
isPlaceable: true,
|
|
766
|
+
example: {
|
|
767
|
+
component: "CircularProgress",
|
|
768
|
+
props: {
|
|
769
|
+
variant: "indeterminate",
|
|
770
|
+
color: "primary",
|
|
771
|
+
size: 40
|
|
772
|
+
},
|
|
773
|
+
children: []
|
|
774
|
+
},
|
|
775
|
+
variants: circularProgressVariantValues.map((variant) => ({
|
|
776
|
+
name: variant,
|
|
777
|
+
label: variantLabels$12[variant],
|
|
778
|
+
example: {
|
|
779
|
+
component: "CircularProgress",
|
|
780
|
+
props: {
|
|
781
|
+
...variantProps$1[variant],
|
|
782
|
+
color: "primary",
|
|
783
|
+
size: 40
|
|
784
|
+
},
|
|
785
|
+
children: []
|
|
786
|
+
}
|
|
787
|
+
})),
|
|
788
|
+
options: {
|
|
789
|
+
variant: {
|
|
790
|
+
values: circularProgressVariantValues,
|
|
791
|
+
default: "indeterminate"
|
|
792
|
+
},
|
|
793
|
+
color: {
|
|
794
|
+
scale: "palette",
|
|
795
|
+
default: "primary"
|
|
796
|
+
},
|
|
797
|
+
size: { default: 40 },
|
|
798
|
+
thickness: { default: 3.6 },
|
|
799
|
+
min: { default: 0 },
|
|
800
|
+
max: { default: 100 },
|
|
801
|
+
disableShrink: {
|
|
802
|
+
values: [true, false],
|
|
803
|
+
default: false
|
|
804
|
+
},
|
|
805
|
+
spinning: {
|
|
806
|
+
values: [true, false],
|
|
807
|
+
default: false
|
|
808
|
+
},
|
|
809
|
+
easing: {
|
|
810
|
+
values: circularProgressEasingValues,
|
|
811
|
+
default: "linear"
|
|
812
|
+
},
|
|
813
|
+
showTrack: {
|
|
814
|
+
values: [true, false],
|
|
815
|
+
default: false
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
content: {}
|
|
819
|
+
});
|
|
820
|
+
//#endregion
|
|
821
|
+
//#region src/Drawer/Drawer.catalog.ts
|
|
822
|
+
const drawerAnchorValues = [
|
|
823
|
+
"left",
|
|
824
|
+
"right",
|
|
825
|
+
"top",
|
|
826
|
+
"bottom"
|
|
827
|
+
];
|
|
828
|
+
const anchorLabels = {
|
|
829
|
+
left: "Left",
|
|
830
|
+
right: "Right",
|
|
831
|
+
top: "Top",
|
|
832
|
+
bottom: "Bottom"
|
|
833
|
+
};
|
|
834
|
+
const body = (anchor) => [node("Flex", {
|
|
835
|
+
flexDirection: "column",
|
|
836
|
+
gap: 3,
|
|
837
|
+
p: 4,
|
|
838
|
+
width: anchor === "top" || anchor === "bottom" ? "100%" : "260px"
|
|
839
|
+
}, [node("Typography", {
|
|
840
|
+
variant: "h6",
|
|
841
|
+
m: 0
|
|
842
|
+
}, ["Drawer"]), node("Typography", {
|
|
843
|
+
variant: "body2",
|
|
844
|
+
color: "secondary",
|
|
845
|
+
m: 0
|
|
846
|
+
}, ["Press Escape or click outside to close."])])];
|
|
847
|
+
const drawerCatalog = defineCatalogEntry()({
|
|
848
|
+
summary: "A panel that slides in from a screen edge, opened by a `DrawerToggle` with the same `id`.",
|
|
849
|
+
isPlaceable: true,
|
|
850
|
+
example: {
|
|
851
|
+
component: "Drawer",
|
|
852
|
+
props: {
|
|
853
|
+
id: "drawer",
|
|
854
|
+
isOpen: true,
|
|
855
|
+
anchor: "left"
|
|
856
|
+
},
|
|
857
|
+
children: body("left")
|
|
858
|
+
},
|
|
859
|
+
variants: drawerAnchorValues.map((anchor) => ({
|
|
860
|
+
name: anchor,
|
|
861
|
+
label: anchorLabels[anchor],
|
|
862
|
+
example: {
|
|
863
|
+
component: "Drawer",
|
|
864
|
+
props: {
|
|
865
|
+
id: "drawer",
|
|
866
|
+
isOpen: true,
|
|
867
|
+
anchor
|
|
868
|
+
},
|
|
869
|
+
children: body(anchor)
|
|
870
|
+
}
|
|
871
|
+
})),
|
|
872
|
+
options: {
|
|
873
|
+
anchor: {
|
|
874
|
+
values: drawerAnchorValues,
|
|
875
|
+
default: "left"
|
|
876
|
+
},
|
|
877
|
+
elevation: {
|
|
878
|
+
values: [
|
|
879
|
+
0,
|
|
880
|
+
1,
|
|
881
|
+
2,
|
|
882
|
+
4,
|
|
883
|
+
8,
|
|
884
|
+
16,
|
|
885
|
+
24
|
|
886
|
+
],
|
|
887
|
+
default: 16
|
|
888
|
+
},
|
|
889
|
+
transitionDuration: { default: 225 },
|
|
890
|
+
hasBackdrop: {
|
|
891
|
+
values: [true, false],
|
|
892
|
+
default: true
|
|
893
|
+
},
|
|
894
|
+
shouldLockScroll: {
|
|
895
|
+
values: [true, false],
|
|
896
|
+
default: true
|
|
897
|
+
},
|
|
898
|
+
shouldAutoFocus: {
|
|
899
|
+
values: [true, false],
|
|
900
|
+
default: true
|
|
901
|
+
},
|
|
902
|
+
shouldTrapFocus: {
|
|
903
|
+
values: [true, false],
|
|
904
|
+
default: true
|
|
905
|
+
},
|
|
906
|
+
shouldRestoreFocus: {
|
|
907
|
+
values: [true, false],
|
|
908
|
+
default: true
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
content: { children: "children" },
|
|
912
|
+
domEvents: ["onClose"],
|
|
913
|
+
preview: {
|
|
914
|
+
width: 480,
|
|
915
|
+
height: 320
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
const drawerToggleCatalog = defineCatalogEntry()({
|
|
919
|
+
summary: "The button that opens, closes or toggles the `Drawer` whose `id` it names in `drawer`.",
|
|
920
|
+
isPlaceable: false,
|
|
921
|
+
example: {
|
|
922
|
+
component: "DrawerToggle",
|
|
923
|
+
props: {
|
|
924
|
+
drawer: "drawer",
|
|
925
|
+
action: "toggle"
|
|
926
|
+
},
|
|
927
|
+
children: ["Open drawer"]
|
|
928
|
+
},
|
|
929
|
+
variants: [],
|
|
930
|
+
options: {
|
|
931
|
+
action: {
|
|
932
|
+
values: [
|
|
933
|
+
"toggle",
|
|
934
|
+
"show",
|
|
935
|
+
"hide"
|
|
936
|
+
],
|
|
937
|
+
default: "toggle"
|
|
938
|
+
},
|
|
939
|
+
variant: {
|
|
940
|
+
values: [
|
|
941
|
+
"contained",
|
|
942
|
+
"outlined",
|
|
943
|
+
"text"
|
|
944
|
+
],
|
|
945
|
+
default: "contained"
|
|
946
|
+
},
|
|
947
|
+
color: {
|
|
948
|
+
scale: "palette",
|
|
949
|
+
default: "primary"
|
|
950
|
+
},
|
|
951
|
+
size: {
|
|
952
|
+
scale: "sizes",
|
|
953
|
+
default: "md"
|
|
954
|
+
},
|
|
955
|
+
disabled: {
|
|
956
|
+
values: [true, false],
|
|
957
|
+
default: false
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
content: {
|
|
961
|
+
children: "children",
|
|
962
|
+
startIcon: "child",
|
|
963
|
+
endIcon: "child",
|
|
964
|
+
loadingIndicator: "child"
|
|
965
|
+
},
|
|
966
|
+
domEvents: ["onClick"]
|
|
967
|
+
});
|
|
968
|
+
//#endregion
|
|
969
|
+
//#region src/Flex/Flex.catalog.ts
|
|
970
|
+
const flexDirectionValues = [
|
|
971
|
+
"row",
|
|
972
|
+
"row-reverse",
|
|
973
|
+
"column",
|
|
974
|
+
"column-reverse"
|
|
975
|
+
];
|
|
976
|
+
const flexJustifyContentValues = [
|
|
977
|
+
"flex-start",
|
|
978
|
+
"flex-end",
|
|
979
|
+
"center",
|
|
980
|
+
"space-between",
|
|
981
|
+
"space-around",
|
|
982
|
+
"space-evenly"
|
|
983
|
+
];
|
|
984
|
+
const flexAlignItemsValues = [
|
|
985
|
+
"stretch",
|
|
986
|
+
"flex-start",
|
|
987
|
+
"flex-end",
|
|
988
|
+
"center",
|
|
989
|
+
"baseline"
|
|
990
|
+
];
|
|
991
|
+
const flexAlignContentValues = [
|
|
992
|
+
"normal",
|
|
993
|
+
"flex-start",
|
|
994
|
+
"flex-end",
|
|
995
|
+
"center",
|
|
996
|
+
"stretch",
|
|
997
|
+
"space-between",
|
|
998
|
+
"space-around",
|
|
999
|
+
"space-evenly"
|
|
1000
|
+
];
|
|
1001
|
+
const flexWrapValues = [
|
|
1002
|
+
"nowrap",
|
|
1003
|
+
"wrap",
|
|
1004
|
+
"wrap-reverse"
|
|
1005
|
+
];
|
|
1006
|
+
const box = {
|
|
1007
|
+
gap: 2,
|
|
1008
|
+
p: 2,
|
|
1009
|
+
width: "360px",
|
|
1010
|
+
height: "280px",
|
|
1011
|
+
bg: "secondary",
|
|
1012
|
+
borderRadius: "sm"
|
|
1013
|
+
};
|
|
1014
|
+
const items$1 = [
|
|
1015
|
+
"A",
|
|
1016
|
+
"B",
|
|
1017
|
+
"C"
|
|
1018
|
+
].map((label) => node("View", {
|
|
1019
|
+
p: 2,
|
|
1020
|
+
bg: "primary",
|
|
1021
|
+
borderRadius: "sm"
|
|
1022
|
+
}, [label]));
|
|
1023
|
+
const directions = {
|
|
1024
|
+
column: "Column",
|
|
1025
|
+
row: "Row"
|
|
1026
|
+
};
|
|
1027
|
+
const flexCatalog = defineCatalogEntry()({
|
|
1028
|
+
summary: "A flexbox container that lays its children out in a column or a row.",
|
|
1029
|
+
isPlaceable: true,
|
|
1030
|
+
example: {
|
|
1031
|
+
component: "Flex",
|
|
1032
|
+
props: {
|
|
1033
|
+
...box,
|
|
1034
|
+
flexDirection: "column"
|
|
1035
|
+
},
|
|
1036
|
+
children: items$1
|
|
1037
|
+
},
|
|
1038
|
+
variants: ["column", "row"].map((flexDirection) => ({
|
|
1039
|
+
name: flexDirection,
|
|
1040
|
+
label: directions[flexDirection],
|
|
1041
|
+
example: {
|
|
1042
|
+
component: "Flex",
|
|
1043
|
+
props: {
|
|
1044
|
+
...box,
|
|
1045
|
+
flexDirection
|
|
1046
|
+
},
|
|
1047
|
+
children: items$1
|
|
1048
|
+
}
|
|
1049
|
+
})),
|
|
1050
|
+
options: {
|
|
1051
|
+
flexDirection: {
|
|
1052
|
+
values: flexDirectionValues,
|
|
1053
|
+
default: "column"
|
|
1054
|
+
},
|
|
1055
|
+
justifyContent: { values: flexJustifyContentValues },
|
|
1056
|
+
alignItems: { values: flexAlignItemsValues },
|
|
1057
|
+
alignContent: { values: flexAlignContentValues },
|
|
1058
|
+
flexWrap: {
|
|
1059
|
+
values: flexWrapValues,
|
|
1060
|
+
default: "nowrap"
|
|
1061
|
+
},
|
|
1062
|
+
gap: { scale: "space" },
|
|
1063
|
+
bg: { scale: "background" }
|
|
1064
|
+
},
|
|
1065
|
+
content: { children: "children" }
|
|
1066
|
+
});
|
|
1067
|
+
//#endregion
|
|
1068
|
+
//#region src/FocusTrap/FocusTrap.catalog.ts
|
|
1069
|
+
const focusTrapCatalog = defineCatalogEntry()({
|
|
1070
|
+
summary: "Keeps keyboard focus within its children while it is enabled.",
|
|
1071
|
+
isPlaceable: false,
|
|
1072
|
+
example: {
|
|
1073
|
+
component: "FocusTrap",
|
|
1074
|
+
props: { isEnabled: true },
|
|
1075
|
+
children: [node("View", { p: 3 }, ["Trapped content"])]
|
|
1076
|
+
},
|
|
1077
|
+
variants: [],
|
|
1078
|
+
options: {
|
|
1079
|
+
isEnabled: {
|
|
1080
|
+
values: [true, false],
|
|
1081
|
+
default: true
|
|
1082
|
+
},
|
|
1083
|
+
shouldAutoFocus: {
|
|
1084
|
+
values: [true, false],
|
|
1085
|
+
default: true
|
|
1086
|
+
},
|
|
1087
|
+
shouldTrapFocus: {
|
|
1088
|
+
values: [true, false],
|
|
1089
|
+
default: true
|
|
1090
|
+
},
|
|
1091
|
+
shouldEnforceFocus: {
|
|
1092
|
+
values: [true, false],
|
|
1093
|
+
default: true
|
|
1094
|
+
},
|
|
1095
|
+
shouldRestoreFocus: {
|
|
1096
|
+
values: [true, false],
|
|
1097
|
+
default: true
|
|
1098
|
+
}
|
|
1099
|
+
},
|
|
1100
|
+
content: { children: "children" }
|
|
1101
|
+
});
|
|
1102
|
+
//#endregion
|
|
1103
|
+
//#region src/Form/Form.catalog.ts
|
|
1104
|
+
const nameField = node("FormControl", {}, [node("Flex", {
|
|
1105
|
+
flexDirection: "column",
|
|
1106
|
+
gap: 1,
|
|
1107
|
+
alignItems: "flex-start"
|
|
1108
|
+
}, [node("FormLabel", {}, ["Name"]), node("TextInput", {
|
|
1109
|
+
variant: "outlined",
|
|
1110
|
+
placeholder: "John Smith"
|
|
1111
|
+
})])]);
|
|
1112
|
+
const formCatalog = defineCatalogEntry()({
|
|
1113
|
+
summary: "A `<form>` that gives every field inside it a default size, color and state.",
|
|
1114
|
+
isPlaceable: false,
|
|
1115
|
+
example: {
|
|
1116
|
+
component: "Form",
|
|
1117
|
+
props: { fullWidth: true },
|
|
1118
|
+
children: [node("Flex", {
|
|
1119
|
+
flexDirection: "column",
|
|
1120
|
+
gap: 4,
|
|
1121
|
+
alignItems: "flex-start"
|
|
1122
|
+
}, [nameField, node("Button", { type: "submit" }, ["Submit"])])]
|
|
1123
|
+
},
|
|
1124
|
+
variants: [],
|
|
1125
|
+
options: {
|
|
1126
|
+
size: {
|
|
1127
|
+
scale: "sizes",
|
|
1128
|
+
default: "md"
|
|
1129
|
+
},
|
|
1130
|
+
color: {
|
|
1131
|
+
scale: "palette",
|
|
1132
|
+
default: "primary"
|
|
1133
|
+
},
|
|
1134
|
+
textColor: { scale: "text" },
|
|
1135
|
+
disabled: {
|
|
1136
|
+
values: [true, false],
|
|
1137
|
+
default: false
|
|
1138
|
+
},
|
|
1139
|
+
fullWidth: {
|
|
1140
|
+
values: [true, false],
|
|
1141
|
+
default: false
|
|
1142
|
+
},
|
|
1143
|
+
noValidate: {
|
|
1144
|
+
values: [true, false],
|
|
1145
|
+
default: false
|
|
1146
|
+
}
|
|
1147
|
+
},
|
|
1148
|
+
content: { children: "children" },
|
|
1149
|
+
domEvents: ["onSubmit"],
|
|
1150
|
+
preview: { width: 360 }
|
|
1151
|
+
});
|
|
1152
|
+
//#endregion
|
|
1153
|
+
//#region src/FormControl/FormControl.catalog.ts
|
|
1154
|
+
const formControlCatalog = defineCatalogEntry()({
|
|
1155
|
+
summary: "One form field - a label, a control and helper text, wired together by a shared id.",
|
|
1156
|
+
isPlaceable: true,
|
|
1157
|
+
example: {
|
|
1158
|
+
component: "FormControl",
|
|
1159
|
+
props: {
|
|
1160
|
+
required: true,
|
|
1161
|
+
fullWidth: true
|
|
1162
|
+
},
|
|
1163
|
+
children: [node("Flex", {
|
|
1164
|
+
flexDirection: "column",
|
|
1165
|
+
gap: 1,
|
|
1166
|
+
alignItems: "flex-start"
|
|
1167
|
+
}, [
|
|
1168
|
+
node("FormLabel", {}, ["Email"]),
|
|
1169
|
+
node("TextInput", {
|
|
1170
|
+
variant: "outlined",
|
|
1171
|
+
placeholder: "me@example.com"
|
|
1172
|
+
}),
|
|
1173
|
+
node("FormHelperText", {}, ["We'll never share it."])
|
|
1174
|
+
])]
|
|
1175
|
+
},
|
|
1176
|
+
variants: [],
|
|
1177
|
+
options: {
|
|
1178
|
+
error: {
|
|
1179
|
+
values: [true, false],
|
|
1180
|
+
default: false
|
|
1181
|
+
},
|
|
1182
|
+
disabled: {
|
|
1183
|
+
values: [true, false],
|
|
1184
|
+
default: false
|
|
1185
|
+
},
|
|
1186
|
+
required: {
|
|
1187
|
+
values: [true, false],
|
|
1188
|
+
default: false
|
|
1189
|
+
},
|
|
1190
|
+
fullWidth: {
|
|
1191
|
+
values: [true, false],
|
|
1192
|
+
default: false
|
|
1193
|
+
},
|
|
1194
|
+
size: {
|
|
1195
|
+
scale: "sizes",
|
|
1196
|
+
default: "md"
|
|
1197
|
+
},
|
|
1198
|
+
color: {
|
|
1199
|
+
scale: "palette",
|
|
1200
|
+
default: "primary"
|
|
1201
|
+
},
|
|
1202
|
+
textColor: { scale: "text" }
|
|
1203
|
+
},
|
|
1204
|
+
content: { children: "children" },
|
|
1205
|
+
preview: { width: 320 }
|
|
1206
|
+
});
|
|
1207
|
+
//#endregion
|
|
1208
|
+
//#region src/FormHelperText/FormHelperText.catalog.ts
|
|
1209
|
+
const formHelperTextCatalog = defineCatalogEntry()({
|
|
1210
|
+
summary: "Hint or error text under a field, read by assistive tech as the control's description.",
|
|
1211
|
+
isPlaceable: false,
|
|
1212
|
+
example: {
|
|
1213
|
+
component: "FormHelperText",
|
|
1214
|
+
props: {},
|
|
1215
|
+
children: ["We'll never share it."]
|
|
1216
|
+
},
|
|
1217
|
+
variants: [],
|
|
1218
|
+
options: {
|
|
1219
|
+
error: {
|
|
1220
|
+
values: [true, false],
|
|
1221
|
+
default: false
|
|
1222
|
+
},
|
|
1223
|
+
color: {
|
|
1224
|
+
scale: "text",
|
|
1225
|
+
default: "secondary"
|
|
1226
|
+
}
|
|
1227
|
+
},
|
|
1228
|
+
content: { children: "children" }
|
|
1229
|
+
});
|
|
1230
|
+
//#endregion
|
|
1231
|
+
//#region src/FormLabel/FormLabel.catalog.ts
|
|
1232
|
+
const formLabelCatalog = defineCatalogEntry()({
|
|
1233
|
+
summary: "A field's label, linked to its control - and marked required - through `FormControl`.",
|
|
1234
|
+
isPlaceable: false,
|
|
1235
|
+
example: {
|
|
1236
|
+
component: "FormLabel",
|
|
1237
|
+
props: {},
|
|
1238
|
+
children: ["Email"]
|
|
1239
|
+
},
|
|
1240
|
+
variants: [],
|
|
1241
|
+
options: {
|
|
1242
|
+
required: {
|
|
1243
|
+
values: [true, false],
|
|
1244
|
+
default: false
|
|
1245
|
+
},
|
|
1246
|
+
color: { scale: "text" }
|
|
1247
|
+
},
|
|
1248
|
+
content: { children: "children" }
|
|
1249
|
+
});
|
|
1250
|
+
//#endregion
|
|
1251
|
+
//#region src/Grid/Grid.catalog.ts
|
|
1252
|
+
const gridAutoFlowValues = [
|
|
1253
|
+
"row",
|
|
1254
|
+
"column",
|
|
1255
|
+
"dense",
|
|
1256
|
+
"row dense",
|
|
1257
|
+
"column dense"
|
|
1258
|
+
];
|
|
1259
|
+
const gridJustifyContentValues = [
|
|
1260
|
+
"normal",
|
|
1261
|
+
"start",
|
|
1262
|
+
"end",
|
|
1263
|
+
"center",
|
|
1264
|
+
"stretch",
|
|
1265
|
+
"space-between",
|
|
1266
|
+
"space-around",
|
|
1267
|
+
"space-evenly"
|
|
1268
|
+
];
|
|
1269
|
+
const gridAlignItemsValues = [
|
|
1270
|
+
"normal",
|
|
1271
|
+
"start",
|
|
1272
|
+
"end",
|
|
1273
|
+
"center",
|
|
1274
|
+
"stretch",
|
|
1275
|
+
"baseline"
|
|
1276
|
+
];
|
|
1277
|
+
const gridAlignContentValues = [
|
|
1278
|
+
"normal",
|
|
1279
|
+
"start",
|
|
1280
|
+
"end",
|
|
1281
|
+
"center",
|
|
1282
|
+
"stretch",
|
|
1283
|
+
"space-between",
|
|
1284
|
+
"space-around",
|
|
1285
|
+
"space-evenly"
|
|
1286
|
+
];
|
|
1287
|
+
const gridJustifyItemsValues = [
|
|
1288
|
+
"normal",
|
|
1289
|
+
"start",
|
|
1290
|
+
"end",
|
|
1291
|
+
"center",
|
|
1292
|
+
"stretch"
|
|
1293
|
+
];
|
|
1294
|
+
const cells = [
|
|
1295
|
+
"A",
|
|
1296
|
+
"B",
|
|
1297
|
+
"C",
|
|
1298
|
+
"D"
|
|
1299
|
+
].map((label) => node("Flex", {
|
|
1300
|
+
p: 2,
|
|
1301
|
+
bg: "secondary",
|
|
1302
|
+
borderRadius: "sm",
|
|
1303
|
+
alignItems: "center",
|
|
1304
|
+
justifyContent: "center"
|
|
1305
|
+
}, [label]));
|
|
1306
|
+
const gridCatalog = defineCatalogEntry()({
|
|
1307
|
+
summary: "A CSS grid container - columns and rows from raw track strings, gaps from the theme.",
|
|
1308
|
+
isPlaceable: true,
|
|
1309
|
+
example: {
|
|
1310
|
+
component: "Grid",
|
|
1311
|
+
props: {
|
|
1312
|
+
gridTemplateColumns: "1fr 1fr",
|
|
1313
|
+
gap: 2
|
|
1314
|
+
},
|
|
1315
|
+
children: cells
|
|
1316
|
+
},
|
|
1317
|
+
variants: [],
|
|
1318
|
+
options: {
|
|
1319
|
+
gridAutoFlow: {
|
|
1320
|
+
values: gridAutoFlowValues,
|
|
1321
|
+
default: "row"
|
|
1322
|
+
},
|
|
1323
|
+
justifyContent: { values: gridJustifyContentValues },
|
|
1324
|
+
alignItems: { values: gridAlignItemsValues },
|
|
1325
|
+
alignContent: { values: gridAlignContentValues },
|
|
1326
|
+
justifyItems: { values: gridJustifyItemsValues },
|
|
1327
|
+
gap: { scale: "space" },
|
|
1328
|
+
columnGap: { scale: "space" },
|
|
1329
|
+
rowGap: { scale: "space" }
|
|
1330
|
+
},
|
|
1331
|
+
content: { children: "children" },
|
|
1332
|
+
preview: { width: 320 }
|
|
1333
|
+
});
|
|
1334
|
+
//#endregion
|
|
1335
|
+
//#region src/Icon/Icon.catalog.ts
|
|
1336
|
+
const iconNameValues = [
|
|
1337
|
+
"hub",
|
|
1338
|
+
"code",
|
|
1339
|
+
"terminal",
|
|
1340
|
+
"database",
|
|
1341
|
+
"psychology",
|
|
1342
|
+
"smart_toy",
|
|
1343
|
+
"account_tree",
|
|
1344
|
+
"analytics",
|
|
1345
|
+
"check",
|
|
1346
|
+
"close",
|
|
1347
|
+
"menu",
|
|
1348
|
+
"warning"
|
|
1349
|
+
];
|
|
1350
|
+
const pictured$1 = [
|
|
1351
|
+
"primary",
|
|
1352
|
+
"secondary",
|
|
1353
|
+
"initial"
|
|
1354
|
+
];
|
|
1355
|
+
const colorLabels$3 = {
|
|
1356
|
+
primary: "Primary",
|
|
1357
|
+
secondary: "Secondary",
|
|
1358
|
+
initial: "Initial"
|
|
1359
|
+
};
|
|
1360
|
+
const iconCatalog = defineCatalogEntry()({
|
|
1361
|
+
summary: "A square SVG icon from the registry, colored from the theme text tokens.",
|
|
1362
|
+
isPlaceable: true,
|
|
1363
|
+
example: {
|
|
1364
|
+
component: "Icon",
|
|
1365
|
+
props: {
|
|
1366
|
+
name: "hub",
|
|
1367
|
+
color: "primary",
|
|
1368
|
+
size: "3rem"
|
|
1369
|
+
},
|
|
1370
|
+
children: []
|
|
1371
|
+
},
|
|
1372
|
+
variants: pictured$1.map((color) => ({
|
|
1373
|
+
name: color,
|
|
1374
|
+
label: colorLabels$3[color],
|
|
1375
|
+
example: {
|
|
1376
|
+
component: "Icon",
|
|
1377
|
+
props: {
|
|
1378
|
+
name: "hub",
|
|
1379
|
+
color,
|
|
1380
|
+
size: "3rem"
|
|
1381
|
+
},
|
|
1382
|
+
children: []
|
|
1383
|
+
}
|
|
1384
|
+
})),
|
|
1385
|
+
options: {
|
|
1386
|
+
name: { values: iconNameValues },
|
|
1387
|
+
color: {
|
|
1388
|
+
scale: "text",
|
|
1389
|
+
default: "primary"
|
|
1390
|
+
},
|
|
1391
|
+
size: { default: "1.5rem" }
|
|
1392
|
+
},
|
|
1393
|
+
content: {}
|
|
1394
|
+
});
|
|
1395
|
+
//#endregion
|
|
1396
|
+
//#region src/Image/Image.catalog.ts
|
|
1397
|
+
const imageObjectFitValues = [
|
|
1398
|
+
"cover",
|
|
1399
|
+
"contain",
|
|
1400
|
+
"fill",
|
|
1401
|
+
"none",
|
|
1402
|
+
"scale-down"
|
|
1403
|
+
];
|
|
1404
|
+
const fitLabels = {
|
|
1405
|
+
cover: "Cover",
|
|
1406
|
+
contain: "Contain",
|
|
1407
|
+
fill: "Fill",
|
|
1408
|
+
none: "None",
|
|
1409
|
+
"scale-down": "Scale down"
|
|
1410
|
+
};
|
|
1411
|
+
const picture = {
|
|
1412
|
+
src: "/soroush.svg",
|
|
1413
|
+
alt: "Logo",
|
|
1414
|
+
width: "200px",
|
|
1415
|
+
height: "200px"
|
|
1416
|
+
};
|
|
1417
|
+
const imageCatalog = defineCatalogEntry()({
|
|
1418
|
+
summary: "An image with an optional fallback source, sized and fitted through props.",
|
|
1419
|
+
isPlaceable: true,
|
|
1420
|
+
example: {
|
|
1421
|
+
component: "Image",
|
|
1422
|
+
props: {
|
|
1423
|
+
...picture,
|
|
1424
|
+
objectFit: "contain"
|
|
1425
|
+
},
|
|
1426
|
+
children: []
|
|
1427
|
+
},
|
|
1428
|
+
variants: imageObjectFitValues.map((objectFit) => ({
|
|
1429
|
+
name: objectFit,
|
|
1430
|
+
label: fitLabels[objectFit],
|
|
1431
|
+
example: {
|
|
1432
|
+
component: "Image",
|
|
1433
|
+
props: {
|
|
1434
|
+
...picture,
|
|
1435
|
+
objectFit
|
|
1436
|
+
},
|
|
1437
|
+
children: []
|
|
1438
|
+
}
|
|
1439
|
+
})),
|
|
1440
|
+
options: {
|
|
1441
|
+
objectFit: { values: imageObjectFitValues },
|
|
1442
|
+
borderRadius: { scale: "radii" }
|
|
1443
|
+
},
|
|
1444
|
+
content: {}
|
|
1445
|
+
});
|
|
1446
|
+
//#endregion
|
|
1447
|
+
//#region src/LinearProgress/LinearProgress.catalog.ts
|
|
1448
|
+
const linearProgressVariantValues = [
|
|
1449
|
+
"indeterminate",
|
|
1450
|
+
"determinate",
|
|
1451
|
+
"query"
|
|
1452
|
+
];
|
|
1453
|
+
const linearProgressEasingValues = [
|
|
1454
|
+
"linear",
|
|
1455
|
+
"ease",
|
|
1456
|
+
"ease-in",
|
|
1457
|
+
"ease-out",
|
|
1458
|
+
"ease-in-out"
|
|
1459
|
+
];
|
|
1460
|
+
const variantLabels$11 = {
|
|
1461
|
+
indeterminate: "Indeterminate",
|
|
1462
|
+
determinate: "Determinate",
|
|
1463
|
+
query: "Query"
|
|
1464
|
+
};
|
|
1465
|
+
const variantProps = {
|
|
1466
|
+
indeterminate: { variant: "indeterminate" },
|
|
1467
|
+
determinate: {
|
|
1468
|
+
variant: "determinate",
|
|
1469
|
+
value: 70
|
|
1470
|
+
},
|
|
1471
|
+
query: { variant: "query" }
|
|
1472
|
+
};
|
|
1473
|
+
const linearProgressCatalog = defineCatalogEntry()({
|
|
1474
|
+
summary: "A horizontal loading bar - looping, driven by a `value`, or with a buffer behind it.",
|
|
1475
|
+
isPlaceable: true,
|
|
1476
|
+
example: {
|
|
1477
|
+
component: "LinearProgress",
|
|
1478
|
+
props: {
|
|
1479
|
+
variant: "indeterminate",
|
|
1480
|
+
color: "primary"
|
|
1481
|
+
},
|
|
1482
|
+
children: []
|
|
1483
|
+
},
|
|
1484
|
+
variants: linearProgressVariantValues.map((variant) => ({
|
|
1485
|
+
name: variant,
|
|
1486
|
+
label: variantLabels$11[variant],
|
|
1487
|
+
example: {
|
|
1488
|
+
component: "LinearProgress",
|
|
1489
|
+
props: {
|
|
1490
|
+
...variantProps[variant],
|
|
1491
|
+
color: "primary"
|
|
1492
|
+
},
|
|
1493
|
+
children: []
|
|
1494
|
+
}
|
|
1495
|
+
})),
|
|
1496
|
+
options: {
|
|
1497
|
+
variant: {
|
|
1498
|
+
values: linearProgressVariantValues,
|
|
1499
|
+
default: "indeterminate"
|
|
1500
|
+
},
|
|
1501
|
+
color: {
|
|
1502
|
+
scale: "palette",
|
|
1503
|
+
default: "primary"
|
|
1504
|
+
},
|
|
1505
|
+
thickness: { default: 4 },
|
|
1506
|
+
buffer: {
|
|
1507
|
+
values: [true, false],
|
|
1508
|
+
default: false
|
|
1509
|
+
},
|
|
1510
|
+
min: { default: 0 },
|
|
1511
|
+
max: { default: 100 },
|
|
1512
|
+
spinning: {
|
|
1513
|
+
values: [true, false],
|
|
1514
|
+
default: false
|
|
1515
|
+
},
|
|
1516
|
+
easing: {
|
|
1517
|
+
values: linearProgressEasingValues,
|
|
1518
|
+
default: "linear"
|
|
1519
|
+
},
|
|
1520
|
+
showTrack: {
|
|
1521
|
+
values: [true, false],
|
|
1522
|
+
default: true
|
|
1523
|
+
},
|
|
1524
|
+
round: {
|
|
1525
|
+
values: [true, false],
|
|
1526
|
+
default: false
|
|
1527
|
+
}
|
|
1528
|
+
},
|
|
1529
|
+
content: {},
|
|
1530
|
+
preview: { width: 240 }
|
|
1531
|
+
});
|
|
1532
|
+
//#endregion
|
|
1533
|
+
//#region src/Link/Link.catalog.ts
|
|
1534
|
+
const linkUnderlineValues = [
|
|
1535
|
+
"always",
|
|
1536
|
+
"hover",
|
|
1537
|
+
"none"
|
|
1538
|
+
];
|
|
1539
|
+
const linkTargetValues = [
|
|
1540
|
+
"_self",
|
|
1541
|
+
"_blank",
|
|
1542
|
+
"_parent",
|
|
1543
|
+
"_top",
|
|
1544
|
+
"_unfencedTop"
|
|
1545
|
+
];
|
|
1546
|
+
const underlineLabels = {
|
|
1547
|
+
always: "Underlined",
|
|
1548
|
+
hover: "Underline on hover",
|
|
1549
|
+
none: "No underline"
|
|
1550
|
+
};
|
|
1551
|
+
const label = "Visit the design system docs";
|
|
1552
|
+
const linkCatalog = defineCatalogEntry()({
|
|
1553
|
+
summary: "A text link to a URL, underlined always, on hover or never.",
|
|
1554
|
+
isPlaceable: true,
|
|
1555
|
+
example: {
|
|
1556
|
+
component: "Link",
|
|
1557
|
+
props: { href: "#" },
|
|
1558
|
+
children: [label]
|
|
1559
|
+
},
|
|
1560
|
+
variants: linkUnderlineValues.map((underline) => ({
|
|
1561
|
+
name: underline,
|
|
1562
|
+
label: underlineLabels[underline],
|
|
1563
|
+
example: {
|
|
1564
|
+
component: "Link",
|
|
1565
|
+
props: {
|
|
1566
|
+
href: "#",
|
|
1567
|
+
underline
|
|
1568
|
+
},
|
|
1569
|
+
children: [label]
|
|
1570
|
+
}
|
|
1571
|
+
})),
|
|
1572
|
+
options: {
|
|
1573
|
+
underline: {
|
|
1574
|
+
values: linkUnderlineValues,
|
|
1575
|
+
default: "always"
|
|
1576
|
+
},
|
|
1577
|
+
color: {
|
|
1578
|
+
scale: "text",
|
|
1579
|
+
default: "primary"
|
|
1580
|
+
},
|
|
1581
|
+
variant: {
|
|
1582
|
+
scale: "typography",
|
|
1583
|
+
default: "inherit"
|
|
1584
|
+
},
|
|
1585
|
+
target: {
|
|
1586
|
+
values: linkTargetValues,
|
|
1587
|
+
default: "_self"
|
|
1588
|
+
}
|
|
1589
|
+
},
|
|
1590
|
+
content: { children: "children" },
|
|
1591
|
+
domEvents: ["onClick"]
|
|
1592
|
+
});
|
|
1593
|
+
const menuCatalog = defineCatalogEntry()({
|
|
1594
|
+
summary: "A trigger and the `MenuList` of commands it opens - not modal, placed by the trigger.",
|
|
1595
|
+
isPlaceable: false,
|
|
1596
|
+
example: {
|
|
1597
|
+
component: "Menu",
|
|
1598
|
+
props: {},
|
|
1599
|
+
children: [
|
|
1600
|
+
node("MenuItem", { value: "new" }, ["New branch..."]),
|
|
1601
|
+
node("MenuItem", {
|
|
1602
|
+
value: "checkout",
|
|
1603
|
+
disabled: true,
|
|
1604
|
+
note: "Coming later"
|
|
1605
|
+
}, ["Checkout tag or revision..."]),
|
|
1606
|
+
node("MenuDivider"),
|
|
1607
|
+
node("MenuItem", { value: "rename" }, ["Rename..."]),
|
|
1608
|
+
node("MenuItem", { value: "delete" }, ["Delete"])
|
|
1609
|
+
]
|
|
1610
|
+
},
|
|
1611
|
+
variants: [],
|
|
1612
|
+
options: {
|
|
1613
|
+
align: {
|
|
1614
|
+
values: ["start", "end"],
|
|
1615
|
+
default: "start"
|
|
1616
|
+
},
|
|
1617
|
+
color: {
|
|
1618
|
+
scale: "palette",
|
|
1619
|
+
default: "primary"
|
|
1620
|
+
},
|
|
1621
|
+
textColor: { scale: "text" },
|
|
1622
|
+
size: {
|
|
1623
|
+
scale: "sizes",
|
|
1624
|
+
default: "md"
|
|
1625
|
+
},
|
|
1626
|
+
dense: {
|
|
1627
|
+
values: [true, false],
|
|
1628
|
+
default: false
|
|
1629
|
+
},
|
|
1630
|
+
elevation: {
|
|
1631
|
+
values: [
|
|
1632
|
+
0,
|
|
1633
|
+
1,
|
|
1634
|
+
2,
|
|
1635
|
+
4,
|
|
1636
|
+
8,
|
|
1637
|
+
16,
|
|
1638
|
+
24
|
|
1639
|
+
],
|
|
1640
|
+
default: 8
|
|
1641
|
+
},
|
|
1642
|
+
layer: { scale: "zOrder" },
|
|
1643
|
+
marginThreshold: { scale: "space" },
|
|
1644
|
+
defaultOpen: {
|
|
1645
|
+
values: [true, false],
|
|
1646
|
+
default: false
|
|
1647
|
+
}
|
|
1648
|
+
},
|
|
1649
|
+
content: {
|
|
1650
|
+
children: "children",
|
|
1651
|
+
trigger: "child",
|
|
1652
|
+
emptyLabel: "text",
|
|
1653
|
+
items: "none"
|
|
1654
|
+
},
|
|
1655
|
+
domEvents: ["onSelect", "onClose"]
|
|
1656
|
+
});
|
|
1657
|
+
//#endregion
|
|
1658
|
+
//#region src/Menu/MenuDivider/MenuDivider.catalog.ts
|
|
1659
|
+
const menuDividerCatalog = defineCatalogEntry()({
|
|
1660
|
+
summary: "A line between groups of rows in a `MenuList`.",
|
|
1661
|
+
isPlaceable: false,
|
|
1662
|
+
example: {
|
|
1663
|
+
component: "MenuDivider",
|
|
1664
|
+
props: {},
|
|
1665
|
+
children: []
|
|
1666
|
+
},
|
|
1667
|
+
variants: [],
|
|
1668
|
+
options: {},
|
|
1669
|
+
content: {}
|
|
1670
|
+
});
|
|
1671
|
+
const menuItemCatalog = defineCatalogEntry()({
|
|
1672
|
+
summary: "One row - an option of a `Select`'s list, or a command of a `MenuList` with an icon, a shortcut and a submenu.",
|
|
1673
|
+
isPlaceable: false,
|
|
1674
|
+
example: {
|
|
1675
|
+
component: "MenuItem",
|
|
1676
|
+
props: { value: "web" },
|
|
1677
|
+
children: ["Web"]
|
|
1678
|
+
},
|
|
1679
|
+
variants: [],
|
|
1680
|
+
options: {
|
|
1681
|
+
role: {
|
|
1682
|
+
values: [
|
|
1683
|
+
"menuitem",
|
|
1684
|
+
"menuitemradio",
|
|
1685
|
+
"menuitemcheckbox"
|
|
1686
|
+
],
|
|
1687
|
+
default: "menuitem"
|
|
1688
|
+
},
|
|
1689
|
+
color: {
|
|
1690
|
+
scale: "palette",
|
|
1691
|
+
default: "primary"
|
|
1692
|
+
},
|
|
1693
|
+
textColor: { scale: "text" },
|
|
1694
|
+
size: {
|
|
1695
|
+
scale: "sizes",
|
|
1696
|
+
default: "md"
|
|
1697
|
+
},
|
|
1698
|
+
disabled: {
|
|
1699
|
+
values: [true, false],
|
|
1700
|
+
default: false
|
|
1701
|
+
},
|
|
1702
|
+
selected: {
|
|
1703
|
+
values: [true, false],
|
|
1704
|
+
default: false
|
|
1705
|
+
},
|
|
1706
|
+
highlighted: {
|
|
1707
|
+
values: [true, false],
|
|
1708
|
+
default: false
|
|
1709
|
+
},
|
|
1710
|
+
multiple: {
|
|
1711
|
+
values: [true, false],
|
|
1712
|
+
default: false
|
|
1713
|
+
},
|
|
1714
|
+
dense: {
|
|
1715
|
+
values: [true, false],
|
|
1716
|
+
default: false
|
|
1717
|
+
},
|
|
1718
|
+
disableGutters: {
|
|
1719
|
+
values: [true, false],
|
|
1720
|
+
default: false
|
|
1721
|
+
},
|
|
1722
|
+
divider: {
|
|
1723
|
+
values: [true, false],
|
|
1724
|
+
default: false
|
|
1725
|
+
}
|
|
1726
|
+
},
|
|
1727
|
+
content: {
|
|
1728
|
+
children: "children",
|
|
1729
|
+
startIcon: "child",
|
|
1730
|
+
shortcut: "text",
|
|
1731
|
+
note: "text",
|
|
1732
|
+
submenu: "children"
|
|
1733
|
+
},
|
|
1734
|
+
domEvents: ["onClick"]
|
|
1735
|
+
});
|
|
1736
|
+
//#endregion
|
|
1737
|
+
//#region src/Menu/MenuItems/MenuItems.catalog.ts
|
|
1738
|
+
const menuItemsCatalog = defineCatalogEntry()({
|
|
1739
|
+
summary: "A `MenuList`'s rows from data - rows, dividers and submenus as entries.",
|
|
1740
|
+
isPlaceable: false,
|
|
1741
|
+
example: {
|
|
1742
|
+
component: "MenuItems",
|
|
1743
|
+
props: {},
|
|
1744
|
+
children: []
|
|
1745
|
+
},
|
|
1746
|
+
variants: [],
|
|
1747
|
+
options: {},
|
|
1748
|
+
content: {}
|
|
1749
|
+
});
|
|
1750
|
+
//#endregion
|
|
1751
|
+
//#region src/Menu/MenuList/MenuList.catalog.ts
|
|
1752
|
+
const menuListCatalog = defineCatalogEntry()({
|
|
1753
|
+
summary: "A `role=\"menu\"` list of `MenuItem` commands that owns the keyboard.",
|
|
1754
|
+
isPlaceable: true,
|
|
1755
|
+
example: {
|
|
1756
|
+
component: "MenuList",
|
|
1757
|
+
props: { "aria-label": "Branch" },
|
|
1758
|
+
children: [
|
|
1759
|
+
node("MenuItem", { value: "new" }, ["New branch..."]),
|
|
1760
|
+
node("MenuItem", {
|
|
1761
|
+
value: "checkout",
|
|
1762
|
+
disabled: true,
|
|
1763
|
+
note: "Coming later"
|
|
1764
|
+
}, ["Checkout tag or revision..."]),
|
|
1765
|
+
node("MenuDivider"),
|
|
1766
|
+
node("MenuItem", { value: "rename" }, ["Rename..."]),
|
|
1767
|
+
node("MenuItem", { value: "delete" }, ["Delete"])
|
|
1768
|
+
]
|
|
1769
|
+
},
|
|
1770
|
+
variants: [],
|
|
1771
|
+
options: {
|
|
1772
|
+
color: {
|
|
1773
|
+
scale: "palette",
|
|
1774
|
+
default: "primary"
|
|
1775
|
+
},
|
|
1776
|
+
textColor: { scale: "text" },
|
|
1777
|
+
size: {
|
|
1778
|
+
scale: "sizes",
|
|
1779
|
+
default: "md"
|
|
1780
|
+
},
|
|
1781
|
+
dense: {
|
|
1782
|
+
values: [true, false],
|
|
1783
|
+
default: false
|
|
1784
|
+
},
|
|
1785
|
+
shouldWrap: {
|
|
1786
|
+
values: [true, false],
|
|
1787
|
+
default: true
|
|
1788
|
+
},
|
|
1789
|
+
shouldAutoFocus: {
|
|
1790
|
+
values: [true, false],
|
|
1791
|
+
default: false
|
|
1792
|
+
}
|
|
1793
|
+
},
|
|
1794
|
+
content: { children: "children" },
|
|
1795
|
+
domEvents: ["onSelect"],
|
|
1796
|
+
preview: { width: 220 }
|
|
1797
|
+
});
|
|
1798
|
+
//#endregion
|
|
1799
|
+
//#region src/Modal/Modal.catalog.ts
|
|
1800
|
+
const modalScrollValues = ["paper", "body"];
|
|
1801
|
+
const dialog = node("Paper", {
|
|
1802
|
+
role: "dialog",
|
|
1803
|
+
"aria-modal": "true",
|
|
1804
|
+
"aria-label": "Example dialog",
|
|
1805
|
+
p: 4,
|
|
1806
|
+
width: "320px"
|
|
1807
|
+
}, [node("Flex", {
|
|
1808
|
+
flexDirection: "column",
|
|
1809
|
+
gap: 3
|
|
1810
|
+
}, [node("Typography", {
|
|
1811
|
+
variant: "h5",
|
|
1812
|
+
m: 0
|
|
1813
|
+
}, ["Modal title"]), node("Typography", {
|
|
1814
|
+
variant: "body2",
|
|
1815
|
+
color: "secondary",
|
|
1816
|
+
m: 0
|
|
1817
|
+
}, ["Press Escape or click the backdrop to close."])])]);
|
|
1818
|
+
const modalCatalog = defineCatalogEntry()({
|
|
1819
|
+
summary: "An overlay that dims the page, holds focus inside its content and closes on Escape or a backdrop click.",
|
|
1820
|
+
isPlaceable: true,
|
|
1821
|
+
example: {
|
|
1822
|
+
component: "Modal",
|
|
1823
|
+
props: { isOpen: true },
|
|
1824
|
+
children: [dialog]
|
|
1825
|
+
},
|
|
1826
|
+
variants: [],
|
|
1827
|
+
options: {
|
|
1828
|
+
isOpen: { values: [true, false] },
|
|
1829
|
+
scroll: {
|
|
1830
|
+
values: modalScrollValues,
|
|
1831
|
+
default: "paper"
|
|
1832
|
+
},
|
|
1833
|
+
layer: {
|
|
1834
|
+
scale: "zOrder",
|
|
1835
|
+
default: "modal"
|
|
1836
|
+
},
|
|
1837
|
+
hasBackdrop: {
|
|
1838
|
+
values: [true, false],
|
|
1839
|
+
default: true
|
|
1840
|
+
},
|
|
1841
|
+
shouldKeepMounted: {
|
|
1842
|
+
values: [true, false],
|
|
1843
|
+
default: false
|
|
1844
|
+
},
|
|
1845
|
+
shouldUsePortal: {
|
|
1846
|
+
values: [true, false],
|
|
1847
|
+
default: true
|
|
1848
|
+
},
|
|
1849
|
+
shouldLockScroll: {
|
|
1850
|
+
values: [true, false],
|
|
1851
|
+
default: true
|
|
1852
|
+
},
|
|
1853
|
+
disableAriaHidden: {
|
|
1854
|
+
values: [true, false],
|
|
1855
|
+
default: false
|
|
1856
|
+
},
|
|
1857
|
+
shouldAutoFocus: {
|
|
1858
|
+
values: [true, false],
|
|
1859
|
+
default: true
|
|
1860
|
+
},
|
|
1861
|
+
shouldTrapFocus: {
|
|
1862
|
+
values: [true, false],
|
|
1863
|
+
default: true
|
|
1864
|
+
},
|
|
1865
|
+
shouldEnforceFocus: {
|
|
1866
|
+
values: [true, false],
|
|
1867
|
+
default: true
|
|
1868
|
+
},
|
|
1869
|
+
shouldRestoreFocus: {
|
|
1870
|
+
values: [true, false],
|
|
1871
|
+
default: true
|
|
1872
|
+
}
|
|
1873
|
+
},
|
|
1874
|
+
content: { children: "children" },
|
|
1875
|
+
domEvents: ["onClose"],
|
|
1876
|
+
preview: {
|
|
1877
|
+
width: 480,
|
|
1878
|
+
height: 320
|
|
1879
|
+
}
|
|
1880
|
+
});
|
|
1881
|
+
//#endregion
|
|
1882
|
+
//#region src/NativeSelect/NativeSelect.catalog.ts
|
|
1883
|
+
const nativeSelectVariantValues = [
|
|
1884
|
+
"default",
|
|
1885
|
+
"outlined",
|
|
1886
|
+
"text",
|
|
1887
|
+
"underline"
|
|
1888
|
+
];
|
|
1889
|
+
const variantLabels$10 = {
|
|
1890
|
+
default: "Filled",
|
|
1891
|
+
outlined: "Outlined",
|
|
1892
|
+
text: "Text",
|
|
1893
|
+
underline: "Underline"
|
|
1894
|
+
};
|
|
1895
|
+
const platforms$2 = [
|
|
1896
|
+
{
|
|
1897
|
+
label: "Web",
|
|
1898
|
+
value: "web"
|
|
1899
|
+
},
|
|
1900
|
+
{
|
|
1901
|
+
label: "Android",
|
|
1902
|
+
value: "android"
|
|
1903
|
+
},
|
|
1904
|
+
{
|
|
1905
|
+
label: "iOS",
|
|
1906
|
+
value: "ios"
|
|
1907
|
+
}
|
|
1908
|
+
];
|
|
1909
|
+
const nativeSelectCatalog = defineCatalogEntry()({
|
|
1910
|
+
summary: "The platform select picker, its choices given as an `options` list of labels and values.",
|
|
1911
|
+
isPlaceable: true,
|
|
1912
|
+
example: {
|
|
1913
|
+
component: "NativeSelect",
|
|
1914
|
+
props: {
|
|
1915
|
+
options: platforms$2,
|
|
1916
|
+
placeholder: "Pick a platform",
|
|
1917
|
+
variant: "outlined"
|
|
1918
|
+
},
|
|
1919
|
+
children: []
|
|
1920
|
+
},
|
|
1921
|
+
variants: nativeSelectVariantValues.map((variant) => ({
|
|
1922
|
+
name: variant,
|
|
1923
|
+
label: variantLabels$10[variant],
|
|
1924
|
+
example: {
|
|
1925
|
+
component: "NativeSelect",
|
|
1926
|
+
props: {
|
|
1927
|
+
options: platforms$2,
|
|
1928
|
+
placeholder: "Pick a platform",
|
|
1929
|
+
variant
|
|
1930
|
+
},
|
|
1931
|
+
children: []
|
|
1932
|
+
}
|
|
1933
|
+
})),
|
|
1934
|
+
options: {
|
|
1935
|
+
variant: {
|
|
1936
|
+
values: nativeSelectVariantValues,
|
|
1937
|
+
default: "default"
|
|
1938
|
+
},
|
|
1939
|
+
color: {
|
|
1940
|
+
scale: "palette",
|
|
1941
|
+
default: "primary"
|
|
1942
|
+
},
|
|
1943
|
+
textColor: {
|
|
1944
|
+
scale: "text",
|
|
1945
|
+
default: "primary"
|
|
1946
|
+
},
|
|
1947
|
+
bg: {
|
|
1948
|
+
scale: "background",
|
|
1949
|
+
default: "terminal"
|
|
1950
|
+
},
|
|
1951
|
+
size: {
|
|
1952
|
+
scale: "sizes",
|
|
1953
|
+
default: "md"
|
|
1954
|
+
},
|
|
1955
|
+
borderRadius: { scale: "radii" },
|
|
1956
|
+
disabled: {
|
|
1957
|
+
values: [true, false],
|
|
1958
|
+
default: false
|
|
1959
|
+
},
|
|
1960
|
+
error: {
|
|
1961
|
+
values: [true, false],
|
|
1962
|
+
default: false
|
|
1963
|
+
},
|
|
1964
|
+
required: {
|
|
1965
|
+
values: [true, false],
|
|
1966
|
+
default: false
|
|
1967
|
+
},
|
|
1968
|
+
fullWidth: {
|
|
1969
|
+
values: [true, false],
|
|
1970
|
+
default: false
|
|
1971
|
+
}
|
|
1972
|
+
},
|
|
1973
|
+
content: { placeholder: "text" },
|
|
1974
|
+
twoWay: {
|
|
1975
|
+
prop: "value",
|
|
1976
|
+
event: "onChange",
|
|
1977
|
+
read: "argument"
|
|
1978
|
+
},
|
|
1979
|
+
preview: { width: 220 }
|
|
1980
|
+
});
|
|
1981
|
+
//#endregion
|
|
1982
|
+
//#region src/Pagination/Pagination.catalog.ts
|
|
1983
|
+
const paginationVariantValues = ["text", "outlined"];
|
|
1984
|
+
const paginationShapeValues = ["circular", "rounded"];
|
|
1985
|
+
const variantLabels$9 = {
|
|
1986
|
+
text: "Text",
|
|
1987
|
+
outlined: "Outlined"
|
|
1988
|
+
};
|
|
1989
|
+
const paginationCatalog = defineCatalogEntry()({
|
|
1990
|
+
summary: "Page numbers with previous and next controls, for moving through paged content.",
|
|
1991
|
+
isPlaceable: true,
|
|
1992
|
+
example: {
|
|
1993
|
+
component: "Pagination",
|
|
1994
|
+
props: { count: 10 },
|
|
1995
|
+
children: []
|
|
1996
|
+
},
|
|
1997
|
+
variants: paginationVariantValues.map((variant) => ({
|
|
1998
|
+
name: variant,
|
|
1999
|
+
label: variantLabels$9[variant],
|
|
2000
|
+
example: {
|
|
2001
|
+
component: "Pagination",
|
|
2002
|
+
props: {
|
|
2003
|
+
count: 10,
|
|
2004
|
+
variant
|
|
2005
|
+
},
|
|
2006
|
+
children: []
|
|
2007
|
+
}
|
|
2008
|
+
})),
|
|
2009
|
+
options: {
|
|
2010
|
+
variant: {
|
|
2011
|
+
values: paginationVariantValues,
|
|
2012
|
+
default: "text"
|
|
2013
|
+
},
|
|
2014
|
+
shape: {
|
|
2015
|
+
values: paginationShapeValues,
|
|
2016
|
+
default: "circular"
|
|
2017
|
+
},
|
|
2018
|
+
color: {
|
|
2019
|
+
scale: "palette",
|
|
2020
|
+
default: "primary"
|
|
2021
|
+
},
|
|
2022
|
+
size: {
|
|
2023
|
+
scale: "sizes",
|
|
2024
|
+
default: "md"
|
|
2025
|
+
},
|
|
2026
|
+
disabled: {
|
|
2027
|
+
values: [true, false],
|
|
2028
|
+
default: false
|
|
2029
|
+
},
|
|
2030
|
+
shouldShowFirstButton: {
|
|
2031
|
+
values: [true, false],
|
|
2032
|
+
default: false
|
|
2033
|
+
},
|
|
2034
|
+
shouldShowLastButton: {
|
|
2035
|
+
values: [true, false],
|
|
2036
|
+
default: false
|
|
2037
|
+
},
|
|
2038
|
+
shouldHidePrevButton: {
|
|
2039
|
+
values: [true, false],
|
|
2040
|
+
default: false
|
|
2041
|
+
},
|
|
2042
|
+
shouldHideNextButton: {
|
|
2043
|
+
values: [true, false],
|
|
2044
|
+
default: false
|
|
2045
|
+
}
|
|
2046
|
+
},
|
|
2047
|
+
content: { getItemAriaLabel: "none" },
|
|
2048
|
+
twoWay: {
|
|
2049
|
+
prop: "page",
|
|
2050
|
+
event: "onChange",
|
|
2051
|
+
read: "argument"
|
|
2052
|
+
}
|
|
2053
|
+
});
|
|
2054
|
+
const paginationItemCatalog = defineCatalogEntry()({
|
|
2055
|
+
summary: "One item of a `Pagination` - a page number, a previous/next/first/last control or an ellipsis.",
|
|
2056
|
+
isPlaceable: false,
|
|
2057
|
+
example: {
|
|
2058
|
+
component: "PaginationItem",
|
|
2059
|
+
props: {
|
|
2060
|
+
type: "page",
|
|
2061
|
+
page: 1
|
|
2062
|
+
},
|
|
2063
|
+
children: []
|
|
2064
|
+
},
|
|
2065
|
+
variants: [],
|
|
2066
|
+
options: {
|
|
2067
|
+
type: {
|
|
2068
|
+
values: [
|
|
2069
|
+
"page",
|
|
2070
|
+
"first",
|
|
2071
|
+
"previous",
|
|
2072
|
+
"next",
|
|
2073
|
+
"last",
|
|
2074
|
+
"start-ellipsis",
|
|
2075
|
+
"end-ellipsis"
|
|
2076
|
+
],
|
|
2077
|
+
default: "page"
|
|
2078
|
+
},
|
|
2079
|
+
isSelected: {
|
|
2080
|
+
values: [true, false],
|
|
2081
|
+
default: false
|
|
2082
|
+
},
|
|
2083
|
+
variant: {
|
|
2084
|
+
values: ["text", "outlined"],
|
|
2085
|
+
default: "text"
|
|
2086
|
+
},
|
|
2087
|
+
shape: {
|
|
2088
|
+
values: ["circular", "rounded"],
|
|
2089
|
+
default: "circular"
|
|
2090
|
+
},
|
|
2091
|
+
color: {
|
|
2092
|
+
scale: "palette",
|
|
2093
|
+
default: "primary"
|
|
2094
|
+
},
|
|
2095
|
+
size: {
|
|
2096
|
+
scale: "sizes",
|
|
2097
|
+
default: "md"
|
|
2098
|
+
},
|
|
2099
|
+
disabled: {
|
|
2100
|
+
values: [true, false],
|
|
2101
|
+
default: false
|
|
2102
|
+
}
|
|
2103
|
+
},
|
|
2104
|
+
content: { page: "text" },
|
|
2105
|
+
domEvents: ["onClick"]
|
|
2106
|
+
});
|
|
2107
|
+
//#endregion
|
|
2108
|
+
//#region src/Paper/Paper.catalog.ts
|
|
2109
|
+
const paperCatalog = defineCatalogEntry()({
|
|
2110
|
+
summary: "A plain raised surface with a theme shadow, background and radius.",
|
|
2111
|
+
isPlaceable: true,
|
|
2112
|
+
example: {
|
|
2113
|
+
component: "Paper",
|
|
2114
|
+
props: {
|
|
2115
|
+
elevation: 1,
|
|
2116
|
+
p: 3,
|
|
2117
|
+
width: "320px"
|
|
2118
|
+
},
|
|
2119
|
+
children: ["A surface with default elevation, background, and border radius."]
|
|
2120
|
+
},
|
|
2121
|
+
variants: [],
|
|
2122
|
+
options: {
|
|
2123
|
+
elevation: {
|
|
2124
|
+
values: [
|
|
2125
|
+
0,
|
|
2126
|
+
1,
|
|
2127
|
+
2,
|
|
2128
|
+
4,
|
|
2129
|
+
8,
|
|
2130
|
+
16,
|
|
2131
|
+
24
|
|
2132
|
+
],
|
|
2133
|
+
default: 1
|
|
2134
|
+
},
|
|
2135
|
+
bg: {
|
|
2136
|
+
scale: "background",
|
|
2137
|
+
default: "paper"
|
|
2138
|
+
},
|
|
2139
|
+
borderRadius: {
|
|
2140
|
+
scale: "radii",
|
|
2141
|
+
default: "sq"
|
|
2142
|
+
},
|
|
2143
|
+
borderColor: { scale: "border" },
|
|
2144
|
+
borderWidth: { scale: "borderWidths" },
|
|
2145
|
+
p: {
|
|
2146
|
+
scale: "space",
|
|
2147
|
+
default: 2
|
|
2148
|
+
}
|
|
2149
|
+
},
|
|
2150
|
+
content: { children: "children" }
|
|
2151
|
+
});
|
|
2152
|
+
const popoverCatalog = defineCatalogEntry()({
|
|
2153
|
+
summary: "A surface shown next to an anchor element, closed on Escape or a click outside.",
|
|
2154
|
+
isPlaceable: false,
|
|
2155
|
+
example: {
|
|
2156
|
+
component: "Popover",
|
|
2157
|
+
props: { open: false },
|
|
2158
|
+
children: [node("View", { p: 3 }, [node("Typography", { variant: "body2" }, ["Popover content"])])]
|
|
2159
|
+
},
|
|
2160
|
+
variants: [],
|
|
2161
|
+
options: {
|
|
2162
|
+
open: { values: [true, false] },
|
|
2163
|
+
anchorReference: {
|
|
2164
|
+
values: [
|
|
2165
|
+
"anchorEl",
|
|
2166
|
+
"anchorPosition",
|
|
2167
|
+
"none"
|
|
2168
|
+
],
|
|
2169
|
+
default: "anchorEl"
|
|
2170
|
+
},
|
|
2171
|
+
elevation: {
|
|
2172
|
+
values: [
|
|
2173
|
+
0,
|
|
2174
|
+
1,
|
|
2175
|
+
2,
|
|
2176
|
+
4,
|
|
2177
|
+
8,
|
|
2178
|
+
16,
|
|
2179
|
+
24
|
|
2180
|
+
],
|
|
2181
|
+
default: 8
|
|
2182
|
+
},
|
|
2183
|
+
marginThreshold: {
|
|
2184
|
+
scale: "space",
|
|
2185
|
+
default: 2
|
|
2186
|
+
},
|
|
2187
|
+
layer: {
|
|
2188
|
+
scale: "zOrder",
|
|
2189
|
+
default: "modal"
|
|
2190
|
+
},
|
|
2191
|
+
hasBackdrop: {
|
|
2192
|
+
values: [true, false],
|
|
2193
|
+
default: false
|
|
2194
|
+
},
|
|
2195
|
+
disableScrollLock: {
|
|
2196
|
+
values: [true, false],
|
|
2197
|
+
default: false
|
|
2198
|
+
},
|
|
2199
|
+
disableAriaHidden: {
|
|
2200
|
+
values: [true, false],
|
|
2201
|
+
default: false
|
|
2202
|
+
},
|
|
2203
|
+
shouldAutoFocus: {
|
|
2204
|
+
values: [true, false],
|
|
2205
|
+
default: true
|
|
2206
|
+
},
|
|
2207
|
+
shouldTrapFocus: {
|
|
2208
|
+
values: [true, false],
|
|
2209
|
+
default: true
|
|
2210
|
+
},
|
|
2211
|
+
shouldEnforceFocus: {
|
|
2212
|
+
values: [true, false],
|
|
2213
|
+
default: true
|
|
2214
|
+
},
|
|
2215
|
+
shouldRestoreFocus: {
|
|
2216
|
+
values: [true, false],
|
|
2217
|
+
default: true
|
|
2218
|
+
},
|
|
2219
|
+
shouldKeepMounted: {
|
|
2220
|
+
values: [true, false],
|
|
2221
|
+
default: false
|
|
2222
|
+
}
|
|
2223
|
+
},
|
|
2224
|
+
content: { children: "children" },
|
|
2225
|
+
domEvents: ["onClose"]
|
|
2226
|
+
});
|
|
2227
|
+
//#endregion
|
|
2228
|
+
//#region src/Portal/Portal.catalog.ts
|
|
2229
|
+
const portalCatalog = defineCatalogEntry()({
|
|
2230
|
+
summary: "Renders its children into another DOM node - the document body by default.",
|
|
2231
|
+
isPlaceable: false,
|
|
2232
|
+
example: {
|
|
2233
|
+
component: "Portal",
|
|
2234
|
+
props: {},
|
|
2235
|
+
children: [node("View", { p: 3 }, ["Portaled content"])]
|
|
2236
|
+
},
|
|
2237
|
+
variants: [],
|
|
2238
|
+
options: {},
|
|
2239
|
+
content: { children: "children" }
|
|
2240
|
+
});
|
|
2241
|
+
const pressableCatalog = defineCatalogEntry()({
|
|
2242
|
+
summary: "An unstyled clickable surface - button semantics around any content, with no looks of its own.",
|
|
2243
|
+
isPlaceable: true,
|
|
2244
|
+
example: {
|
|
2245
|
+
component: "Pressable",
|
|
2246
|
+
props: {},
|
|
2247
|
+
children: ["Press me"]
|
|
2248
|
+
},
|
|
2249
|
+
variants: [],
|
|
2250
|
+
options: {
|
|
2251
|
+
as: {
|
|
2252
|
+
values: [
|
|
2253
|
+
"div",
|
|
2254
|
+
"button",
|
|
2255
|
+
"span"
|
|
2256
|
+
],
|
|
2257
|
+
default: "div"
|
|
2258
|
+
},
|
|
2259
|
+
feedback: {
|
|
2260
|
+
values: [
|
|
2261
|
+
"none",
|
|
2262
|
+
"opacity",
|
|
2263
|
+
"highlight"
|
|
2264
|
+
],
|
|
2265
|
+
default: "none"
|
|
2266
|
+
},
|
|
2267
|
+
color: {
|
|
2268
|
+
scale: "palette",
|
|
2269
|
+
default: "primary"
|
|
2270
|
+
},
|
|
2271
|
+
activeOpacity: { default: .7 },
|
|
2272
|
+
disabled: {
|
|
2273
|
+
values: [true, false],
|
|
2274
|
+
default: false
|
|
2275
|
+
},
|
|
2276
|
+
borderRadius: { scale: "radii" }
|
|
2277
|
+
},
|
|
2278
|
+
content: { children: "children" },
|
|
2279
|
+
domEvents: ["onClick"]
|
|
2280
|
+
});
|
|
2281
|
+
//#endregion
|
|
2282
|
+
//#region src/Quote/Quote.catalog.ts
|
|
2283
|
+
const quoteCatalog = defineCatalogEntry()({
|
|
2284
|
+
summary: "A block set off by a primary left border, for quotes and terminal readouts.",
|
|
2285
|
+
isPlaceable: true,
|
|
2286
|
+
example: {
|
|
2287
|
+
component: "Quote",
|
|
2288
|
+
props: {
|
|
2289
|
+
bg: "terminal",
|
|
2290
|
+
p: 3
|
|
2291
|
+
},
|
|
2292
|
+
children: [node("Typography", {
|
|
2293
|
+
variant: "body1",
|
|
2294
|
+
color: "secondary",
|
|
2295
|
+
m: 0
|
|
2296
|
+
}, ["A View with a 2px primary left border - for terminal readouts and markdown blockquotes."])]
|
|
2297
|
+
},
|
|
2298
|
+
variants: [],
|
|
2299
|
+
options: {
|
|
2300
|
+
bg: { scale: "background" },
|
|
2301
|
+
borderRadius: { scale: "radii" }
|
|
2302
|
+
},
|
|
2303
|
+
content: { children: "children" },
|
|
2304
|
+
preview: { width: 360 }
|
|
2305
|
+
});
|
|
2306
|
+
//#endregion
|
|
2307
|
+
//#region src/Radio/Radio.catalog.ts
|
|
2308
|
+
const colorLabels$2 = {
|
|
2309
|
+
default: "Default",
|
|
2310
|
+
primary: "Primary",
|
|
2311
|
+
secondary: "Secondary",
|
|
2312
|
+
success: "Success",
|
|
2313
|
+
error: "Error",
|
|
2314
|
+
info: "Info",
|
|
2315
|
+
warning: "Warning"
|
|
2316
|
+
};
|
|
2317
|
+
const colors$2 = Object.keys(colorLabels$2);
|
|
2318
|
+
const radioCatalog = defineCatalogEntry()({
|
|
2319
|
+
summary: "One choice of a set - radios that share a `name` allow only one to be selected.",
|
|
2320
|
+
isPlaceable: true,
|
|
2321
|
+
example: {
|
|
2322
|
+
component: "Radio",
|
|
2323
|
+
props: {
|
|
2324
|
+
name: "option",
|
|
2325
|
+
value: "a"
|
|
2326
|
+
},
|
|
2327
|
+
children: ["Option A"]
|
|
2328
|
+
},
|
|
2329
|
+
variants: colors$2.map((color) => ({
|
|
2330
|
+
name: color,
|
|
2331
|
+
label: colorLabels$2[color],
|
|
2332
|
+
example: {
|
|
2333
|
+
component: "Radio",
|
|
2334
|
+
props: {
|
|
2335
|
+
name: "option",
|
|
2336
|
+
value: "a",
|
|
2337
|
+
color,
|
|
2338
|
+
checked: true
|
|
2339
|
+
},
|
|
2340
|
+
children: ["Option A"]
|
|
2341
|
+
}
|
|
2342
|
+
})),
|
|
2343
|
+
options: {
|
|
2344
|
+
color: {
|
|
2345
|
+
scale: "palette",
|
|
2346
|
+
default: "default"
|
|
2347
|
+
},
|
|
2348
|
+
size: {
|
|
2349
|
+
scale: "sizes",
|
|
2350
|
+
default: "md"
|
|
2351
|
+
},
|
|
2352
|
+
disabled: {
|
|
2353
|
+
values: [true, false],
|
|
2354
|
+
default: false
|
|
2355
|
+
},
|
|
2356
|
+
required: {
|
|
2357
|
+
values: [true, false],
|
|
2358
|
+
default: false
|
|
2359
|
+
}
|
|
2360
|
+
},
|
|
2361
|
+
content: {
|
|
2362
|
+
children: "children",
|
|
2363
|
+
icon: "child",
|
|
2364
|
+
checkedIcon: "child"
|
|
2365
|
+
},
|
|
2366
|
+
twoWay: {
|
|
2367
|
+
prop: "checked",
|
|
2368
|
+
event: "onChange",
|
|
2369
|
+
read: "target.checked"
|
|
2370
|
+
}
|
|
2371
|
+
});
|
|
2372
|
+
//#endregion
|
|
2373
|
+
//#region src/Select/Select.catalog.ts
|
|
2374
|
+
const selectVariantValues = [
|
|
2375
|
+
"default",
|
|
2376
|
+
"outlined",
|
|
2377
|
+
"text",
|
|
2378
|
+
"underline"
|
|
2379
|
+
];
|
|
2380
|
+
const variantLabels$8 = {
|
|
2381
|
+
default: "Filled",
|
|
2382
|
+
outlined: "Outlined",
|
|
2383
|
+
text: "Text",
|
|
2384
|
+
underline: "Underline"
|
|
2385
|
+
};
|
|
2386
|
+
const platforms$1 = [
|
|
2387
|
+
node("MenuItem", { value: "web" }, ["Web"]),
|
|
2388
|
+
node("MenuItem", { value: "android" }, ["Android"]),
|
|
2389
|
+
node("MenuItem", { value: "ios" }, ["iOS"])
|
|
2390
|
+
];
|
|
2391
|
+
const selectCatalog = defineCatalogEntry()({
|
|
2392
|
+
summary: "The select to use - a custom listbox of `MenuItem` options, or `native` for the platform picker.",
|
|
2393
|
+
isPlaceable: true,
|
|
2394
|
+
example: {
|
|
2395
|
+
component: "Select",
|
|
2396
|
+
props: {
|
|
2397
|
+
placeholder: "Pick a platform",
|
|
2398
|
+
variant: "outlined"
|
|
2399
|
+
},
|
|
2400
|
+
children: platforms$1
|
|
2401
|
+
},
|
|
2402
|
+
variants: selectVariantValues.map((variant) => ({
|
|
2403
|
+
name: variant,
|
|
2404
|
+
label: variantLabels$8[variant],
|
|
2405
|
+
example: {
|
|
2406
|
+
component: "Select",
|
|
2407
|
+
props: {
|
|
2408
|
+
placeholder: "Pick a platform",
|
|
2409
|
+
variant
|
|
2410
|
+
},
|
|
2411
|
+
children: platforms$1
|
|
2412
|
+
}
|
|
2413
|
+
})),
|
|
2414
|
+
options: {
|
|
2415
|
+
variant: {
|
|
2416
|
+
values: selectVariantValues,
|
|
2417
|
+
default: "default"
|
|
2418
|
+
},
|
|
2419
|
+
color: {
|
|
2420
|
+
scale: "palette",
|
|
2421
|
+
default: "primary"
|
|
2422
|
+
},
|
|
2423
|
+
textColor: { scale: "text" },
|
|
2424
|
+
bg: { scale: "background" },
|
|
2425
|
+
size: {
|
|
2426
|
+
scale: "sizes",
|
|
2427
|
+
default: "md"
|
|
2428
|
+
},
|
|
2429
|
+
borderRadius: { scale: "radii" },
|
|
2430
|
+
native: {
|
|
2431
|
+
values: [true, false],
|
|
2432
|
+
default: false
|
|
2433
|
+
},
|
|
2434
|
+
multiple: {
|
|
2435
|
+
values: [true, false],
|
|
2436
|
+
default: false
|
|
2437
|
+
},
|
|
2438
|
+
disabled: {
|
|
2439
|
+
values: [true, false],
|
|
2440
|
+
default: false
|
|
2441
|
+
},
|
|
2442
|
+
error: {
|
|
2443
|
+
values: [true, false],
|
|
2444
|
+
default: false
|
|
2445
|
+
},
|
|
2446
|
+
required: {
|
|
2447
|
+
values: [true, false],
|
|
2448
|
+
default: false
|
|
2449
|
+
},
|
|
2450
|
+
fullWidth: {
|
|
2451
|
+
values: [true, false],
|
|
2452
|
+
default: false
|
|
2453
|
+
}
|
|
2454
|
+
},
|
|
2455
|
+
content: {
|
|
2456
|
+
children: "children",
|
|
2457
|
+
placeholder: "text",
|
|
2458
|
+
renderValue: "none"
|
|
2459
|
+
},
|
|
2460
|
+
twoWay: {
|
|
2461
|
+
prop: "value",
|
|
2462
|
+
event: "onChange",
|
|
2463
|
+
read: "argument"
|
|
2464
|
+
},
|
|
2465
|
+
preview: { width: 220 }
|
|
2466
|
+
});
|
|
2467
|
+
//#endregion
|
|
2468
|
+
//#region src/Sidebar/Sidebar/Sidebar.catalog.ts
|
|
2469
|
+
const sidebarAnchorValues = ["left", "right"];
|
|
2470
|
+
const sidebarVariantValues = [
|
|
2471
|
+
"text",
|
|
2472
|
+
"outlined",
|
|
2473
|
+
"plain"
|
|
2474
|
+
];
|
|
2475
|
+
const variantLabels$7 = {
|
|
2476
|
+
text: "Text",
|
|
2477
|
+
outlined: "Outlined",
|
|
2478
|
+
plain: "Plain"
|
|
2479
|
+
};
|
|
2480
|
+
const items = [
|
|
2481
|
+
node("SidebarItem", {
|
|
2482
|
+
icon: "folder",
|
|
2483
|
+
label: "Directory",
|
|
2484
|
+
isSelected: true
|
|
2485
|
+
}),
|
|
2486
|
+
node("SidebarItem", {
|
|
2487
|
+
icon: "history",
|
|
2488
|
+
label: "Gist history"
|
|
2489
|
+
}),
|
|
2490
|
+
node("SidebarItem", {
|
|
2491
|
+
icon: "edit_note",
|
|
2492
|
+
label: "Drafts"
|
|
2493
|
+
}),
|
|
2494
|
+
node("SidebarItem", {
|
|
2495
|
+
icon: "terminal",
|
|
2496
|
+
label: "Terminal console"
|
|
2497
|
+
})
|
|
2498
|
+
];
|
|
2499
|
+
const content$1 = {
|
|
2500
|
+
isOpen: false,
|
|
2501
|
+
anchor: "left",
|
|
2502
|
+
"aria-label": "Editor panels"
|
|
2503
|
+
};
|
|
2504
|
+
const sidebarCatalog = defineCatalogEntry()({
|
|
2505
|
+
summary: "A collapsible navigation rail of `SidebarItem`s - icons only when closed, icons and labels when open.",
|
|
2506
|
+
isPlaceable: true,
|
|
2507
|
+
example: {
|
|
2508
|
+
component: "Sidebar",
|
|
2509
|
+
props: content$1,
|
|
2510
|
+
children: items
|
|
2511
|
+
},
|
|
2512
|
+
variants: sidebarVariantValues.map((variant) => ({
|
|
2513
|
+
name: variant,
|
|
2514
|
+
label: variantLabels$7[variant],
|
|
2515
|
+
example: {
|
|
2516
|
+
component: "Sidebar",
|
|
2517
|
+
props: {
|
|
2518
|
+
...content$1,
|
|
2519
|
+
variant
|
|
2520
|
+
},
|
|
2521
|
+
children: items
|
|
2522
|
+
}
|
|
2523
|
+
})),
|
|
2524
|
+
options: {
|
|
2525
|
+
isOpen: { values: [true, false] },
|
|
2526
|
+
anchor: {
|
|
2527
|
+
values: sidebarAnchorValues,
|
|
2528
|
+
default: "left"
|
|
2529
|
+
},
|
|
2530
|
+
variant: {
|
|
2531
|
+
values: sidebarVariantValues,
|
|
2532
|
+
default: "text"
|
|
2533
|
+
},
|
|
2534
|
+
expandedWidth: { default: "14rem" },
|
|
2535
|
+
collapsedWidth: { default: "3.5rem" },
|
|
2536
|
+
hasPanel: {
|
|
2537
|
+
values: [true, false],
|
|
2538
|
+
default: false
|
|
2539
|
+
},
|
|
2540
|
+
panelWidth: { default: "18rem" },
|
|
2541
|
+
bg: { scale: "background" }
|
|
2542
|
+
},
|
|
2543
|
+
content: { children: "children" }
|
|
2544
|
+
});
|
|
2545
|
+
//#endregion
|
|
2546
|
+
//#region src/Sidebar/SidebarItem/SidebarItem.catalog.ts
|
|
2547
|
+
const sidebarItemVariantValues = [
|
|
2548
|
+
"text",
|
|
2549
|
+
"outlined",
|
|
2550
|
+
"plain"
|
|
2551
|
+
];
|
|
2552
|
+
const variantLabels$6 = {
|
|
2553
|
+
text: "Text",
|
|
2554
|
+
outlined: "Outlined",
|
|
2555
|
+
plain: "Plain"
|
|
2556
|
+
};
|
|
2557
|
+
const content = {
|
|
2558
|
+
icon: "folder",
|
|
2559
|
+
label: "Directory"
|
|
2560
|
+
};
|
|
2561
|
+
const sidebarItemCatalog = defineCatalogEntry()({
|
|
2562
|
+
summary: "One entry of a `Sidebar` - an icon, with its label shown while the rail is open.",
|
|
2563
|
+
isPlaceable: false,
|
|
2564
|
+
example: {
|
|
2565
|
+
component: "SidebarItem",
|
|
2566
|
+
props: {
|
|
2567
|
+
...content,
|
|
2568
|
+
variant: "text"
|
|
2569
|
+
},
|
|
2570
|
+
children: []
|
|
2571
|
+
},
|
|
2572
|
+
variants: sidebarItemVariantValues.map((variant) => ({
|
|
2573
|
+
name: variant,
|
|
2574
|
+
label: variantLabels$6[variant],
|
|
2575
|
+
example: {
|
|
2576
|
+
component: "SidebarItem",
|
|
2577
|
+
props: {
|
|
2578
|
+
...content,
|
|
2579
|
+
variant
|
|
2580
|
+
},
|
|
2581
|
+
children: []
|
|
2582
|
+
}
|
|
2583
|
+
})),
|
|
2584
|
+
options: {
|
|
2585
|
+
variant: {
|
|
2586
|
+
values: sidebarItemVariantValues,
|
|
2587
|
+
default: "text"
|
|
2588
|
+
},
|
|
2589
|
+
size: {
|
|
2590
|
+
scale: "sizes",
|
|
2591
|
+
default: "sm"
|
|
2592
|
+
},
|
|
2593
|
+
color: {
|
|
2594
|
+
scale: "palette",
|
|
2595
|
+
default: "primary"
|
|
2596
|
+
},
|
|
2597
|
+
isSelected: {
|
|
2598
|
+
values: [true, false],
|
|
2599
|
+
default: false
|
|
2600
|
+
},
|
|
2601
|
+
disabled: {
|
|
2602
|
+
values: [true, false],
|
|
2603
|
+
default: false
|
|
2604
|
+
}
|
|
2605
|
+
},
|
|
2606
|
+
content: {
|
|
2607
|
+
children: "children",
|
|
2608
|
+
label: "text"
|
|
2609
|
+
},
|
|
2610
|
+
domEvents: ["onSelect", "onClick"]
|
|
2611
|
+
});
|
|
2612
|
+
//#endregion
|
|
2613
|
+
//#region src/Skeleton/Skeleton.catalog.ts
|
|
2614
|
+
const skeletonVariantValues = [
|
|
2615
|
+
"text",
|
|
2616
|
+
"circular",
|
|
2617
|
+
"rectangular"
|
|
2618
|
+
];
|
|
2619
|
+
const skeletonAnimationValues = [
|
|
2620
|
+
"pulse",
|
|
2621
|
+
"wave",
|
|
2622
|
+
false
|
|
2623
|
+
];
|
|
2624
|
+
const variantLabels$5 = {
|
|
2625
|
+
text: "Text",
|
|
2626
|
+
circular: "Circular",
|
|
2627
|
+
rectangular: "Rectangular"
|
|
2628
|
+
};
|
|
2629
|
+
const shapes = {
|
|
2630
|
+
text: { width: 240 },
|
|
2631
|
+
circular: {
|
|
2632
|
+
width: 64,
|
|
2633
|
+
height: 64
|
|
2634
|
+
},
|
|
2635
|
+
rectangular: {
|
|
2636
|
+
width: 240,
|
|
2637
|
+
height: 64
|
|
2638
|
+
}
|
|
2639
|
+
};
|
|
2640
|
+
const skeletonCatalog = defineCatalogEntry()({
|
|
2641
|
+
summary: "A placeholder shape shown while content loads - a text line, a circle or a block.",
|
|
2642
|
+
isPlaceable: true,
|
|
2643
|
+
example: {
|
|
2644
|
+
component: "Skeleton",
|
|
2645
|
+
props: {
|
|
2646
|
+
variant: "text",
|
|
2647
|
+
animation: "pulse",
|
|
2648
|
+
width: 240
|
|
2649
|
+
},
|
|
2650
|
+
children: []
|
|
2651
|
+
},
|
|
2652
|
+
variants: skeletonVariantValues.map((variant) => ({
|
|
2653
|
+
name: variant,
|
|
2654
|
+
label: variantLabels$5[variant],
|
|
2655
|
+
example: {
|
|
2656
|
+
component: "Skeleton",
|
|
2657
|
+
props: {
|
|
2658
|
+
variant,
|
|
2659
|
+
...shapes[variant]
|
|
2660
|
+
},
|
|
2661
|
+
children: []
|
|
2662
|
+
}
|
|
2663
|
+
})),
|
|
2664
|
+
options: {
|
|
2665
|
+
variant: {
|
|
2666
|
+
values: skeletonVariantValues,
|
|
2667
|
+
default: "text"
|
|
2668
|
+
},
|
|
2669
|
+
animation: {
|
|
2670
|
+
values: skeletonAnimationValues,
|
|
2671
|
+
default: "pulse"
|
|
2672
|
+
},
|
|
2673
|
+
borderRadius: { scale: "radii" }
|
|
2674
|
+
},
|
|
2675
|
+
content: { children: "children" },
|
|
2676
|
+
preview: {
|
|
2677
|
+
width: 280,
|
|
2678
|
+
height: 80
|
|
2679
|
+
}
|
|
2680
|
+
});
|
|
2681
|
+
//#endregion
|
|
2682
|
+
//#region src/Switch/Switch.catalog.ts
|
|
2683
|
+
const switchVariantValues = ["outside", "inside"];
|
|
2684
|
+
const switchEdgeValues = [
|
|
2685
|
+
"start",
|
|
2686
|
+
"end",
|
|
2687
|
+
false
|
|
2688
|
+
];
|
|
2689
|
+
const variantLabels$4 = {
|
|
2690
|
+
outside: "Outside thumb",
|
|
2691
|
+
inside: "Inside thumb"
|
|
2692
|
+
};
|
|
2693
|
+
const switchCatalog = defineCatalogEntry()({
|
|
2694
|
+
summary: "An on/off toggle with an optional label, its thumb over or inside the track.",
|
|
2695
|
+
isPlaceable: true,
|
|
2696
|
+
example: {
|
|
2697
|
+
component: "Switch",
|
|
2698
|
+
props: {},
|
|
2699
|
+
children: ["Enable dark mode"]
|
|
2700
|
+
},
|
|
2701
|
+
variants: switchVariantValues.map((variant) => ({
|
|
2702
|
+
name: variant,
|
|
2703
|
+
label: variantLabels$4[variant],
|
|
2704
|
+
example: {
|
|
2705
|
+
component: "Switch",
|
|
2706
|
+
props: { variant },
|
|
2707
|
+
children: ["Enable dark mode"]
|
|
2708
|
+
}
|
|
2709
|
+
})),
|
|
2710
|
+
options: {
|
|
2711
|
+
variant: {
|
|
2712
|
+
values: switchVariantValues,
|
|
2713
|
+
default: "outside"
|
|
2714
|
+
},
|
|
2715
|
+
color: {
|
|
2716
|
+
scale: "palette",
|
|
2717
|
+
default: "default"
|
|
2718
|
+
},
|
|
2719
|
+
bg: {
|
|
2720
|
+
scale: "background",
|
|
2721
|
+
default: "default"
|
|
2722
|
+
},
|
|
2723
|
+
size: {
|
|
2724
|
+
scale: "sizes",
|
|
2725
|
+
default: "md"
|
|
2726
|
+
},
|
|
2727
|
+
marked: {
|
|
2728
|
+
values: [true, false],
|
|
2729
|
+
default: false
|
|
2730
|
+
},
|
|
2731
|
+
edge: {
|
|
2732
|
+
values: switchEdgeValues,
|
|
2733
|
+
default: false
|
|
2734
|
+
},
|
|
2735
|
+
disabled: {
|
|
2736
|
+
values: [true, false],
|
|
2737
|
+
default: false
|
|
2738
|
+
},
|
|
2739
|
+
required: {
|
|
2740
|
+
values: [true, false],
|
|
2741
|
+
default: false
|
|
2742
|
+
}
|
|
2743
|
+
},
|
|
2744
|
+
content: {
|
|
2745
|
+
children: "children",
|
|
2746
|
+
icon: "child",
|
|
2747
|
+
checkedIcon: "child"
|
|
2748
|
+
},
|
|
2749
|
+
twoWay: {
|
|
2750
|
+
prop: "checked",
|
|
2751
|
+
event: "onChange",
|
|
2752
|
+
read: "target.checked"
|
|
2753
|
+
}
|
|
2754
|
+
});
|
|
2755
|
+
//#endregion
|
|
2756
|
+
//#region src/Tabs/TabPanel/TabPanel.catalog.ts
|
|
2757
|
+
const tabPanelCatalog = defineCatalogEntry()({
|
|
2758
|
+
summary: "The content a tab shows - inside a `TabContext`, shown while its tab is selected.",
|
|
2759
|
+
isPlaceable: false,
|
|
2760
|
+
example: {
|
|
2761
|
+
component: "TabPanel",
|
|
2762
|
+
props: { value: "layers" },
|
|
2763
|
+
children: [node("Typography", {}, ["Layers of the page."])]
|
|
2764
|
+
},
|
|
2765
|
+
variants: [],
|
|
2766
|
+
options: {
|
|
2767
|
+
shouldKeepMounted: {
|
|
2768
|
+
values: [true, false],
|
|
2769
|
+
default: false
|
|
2770
|
+
},
|
|
2771
|
+
bg: { scale: "background" },
|
|
2772
|
+
borderRadius: { scale: "radii" }
|
|
2773
|
+
},
|
|
2774
|
+
content: { children: "children" }
|
|
2775
|
+
});
|
|
2776
|
+
const tabCatalog = defineCatalogEntry()({
|
|
2777
|
+
summary: "One tab of a `Tabs` row - a label, an icon on any side, and an optional close button.",
|
|
2778
|
+
isPlaceable: false,
|
|
2779
|
+
example: {
|
|
2780
|
+
component: "Tab",
|
|
2781
|
+
props: {
|
|
2782
|
+
value: "canvas",
|
|
2783
|
+
label: "Canvas"
|
|
2784
|
+
},
|
|
2785
|
+
children: []
|
|
2786
|
+
},
|
|
2787
|
+
variants: [],
|
|
2788
|
+
options: {
|
|
2789
|
+
disabled: {
|
|
2790
|
+
values: [true, false],
|
|
2791
|
+
default: false
|
|
2792
|
+
},
|
|
2793
|
+
isWrapped: {
|
|
2794
|
+
values: [true, false],
|
|
2795
|
+
default: false
|
|
2796
|
+
},
|
|
2797
|
+
iconPosition: {
|
|
2798
|
+
values: [
|
|
2799
|
+
"top",
|
|
2800
|
+
"start",
|
|
2801
|
+
"end",
|
|
2802
|
+
"bottom"
|
|
2803
|
+
],
|
|
2804
|
+
default: "top"
|
|
2805
|
+
},
|
|
2806
|
+
color: { scale: "palette" },
|
|
2807
|
+
textColor: { scale: "text" },
|
|
2808
|
+
size: { scale: "sizes" },
|
|
2809
|
+
bg: { scale: "background" },
|
|
2810
|
+
selectedBg: { scale: "background" },
|
|
2811
|
+
borderRadius: { scale: "radii" }
|
|
2812
|
+
},
|
|
2813
|
+
content: {
|
|
2814
|
+
label: "text",
|
|
2815
|
+
icon: "child",
|
|
2816
|
+
secondaryAction: "child"
|
|
2817
|
+
},
|
|
2818
|
+
domEvents: ["onClick"]
|
|
2819
|
+
});
|
|
2820
|
+
//#endregion
|
|
2821
|
+
//#region src/Tabs/Tabs/Tabs.catalog.ts
|
|
2822
|
+
const tabsVariantValues = [
|
|
2823
|
+
"underline",
|
|
2824
|
+
"boxed",
|
|
2825
|
+
"enclosed"
|
|
2826
|
+
];
|
|
2827
|
+
const tabsOrientationValues = ["horizontal", "vertical"];
|
|
2828
|
+
const tabsOverflowBehaviorValues = [
|
|
2829
|
+
"scroll",
|
|
2830
|
+
"menu",
|
|
2831
|
+
"none"
|
|
2832
|
+
];
|
|
2833
|
+
const tabsScrollButtonsValues = [
|
|
2834
|
+
"auto",
|
|
2835
|
+
"always",
|
|
2836
|
+
"never"
|
|
2837
|
+
];
|
|
2838
|
+
const variantLabels$3 = {
|
|
2839
|
+
underline: "Underline",
|
|
2840
|
+
boxed: "Boxed",
|
|
2841
|
+
enclosed: "Enclosed"
|
|
2842
|
+
};
|
|
2843
|
+
const views = [
|
|
2844
|
+
node("Tab", {
|
|
2845
|
+
value: "canvas",
|
|
2846
|
+
label: "Canvas"
|
|
2847
|
+
}),
|
|
2848
|
+
node("Tab", {
|
|
2849
|
+
value: "system",
|
|
2850
|
+
label: "Design system"
|
|
2851
|
+
}),
|
|
2852
|
+
node("Tab", {
|
|
2853
|
+
value: "common",
|
|
2854
|
+
label: "Common components"
|
|
2855
|
+
})
|
|
2856
|
+
];
|
|
2857
|
+
const tabsCatalog = defineCatalogEntry()({
|
|
2858
|
+
summary: "A row of `Tab`s - a tablist, or with `as=\"nav\"` a navigation.",
|
|
2859
|
+
isPlaceable: true,
|
|
2860
|
+
example: {
|
|
2861
|
+
component: "Tabs",
|
|
2862
|
+
props: {
|
|
2863
|
+
defaultValue: "canvas",
|
|
2864
|
+
"aria-label": "Views"
|
|
2865
|
+
},
|
|
2866
|
+
children: views
|
|
2867
|
+
},
|
|
2868
|
+
variants: tabsVariantValues.map((variant) => ({
|
|
2869
|
+
name: variant,
|
|
2870
|
+
label: variantLabels$3[variant],
|
|
2871
|
+
example: {
|
|
2872
|
+
component: "Tabs",
|
|
2873
|
+
props: {
|
|
2874
|
+
defaultValue: "canvas",
|
|
2875
|
+
variant,
|
|
2876
|
+
"aria-label": "Views"
|
|
2877
|
+
},
|
|
2878
|
+
children: views
|
|
2879
|
+
}
|
|
2880
|
+
})),
|
|
2881
|
+
options: {
|
|
2882
|
+
variant: {
|
|
2883
|
+
values: tabsVariantValues,
|
|
2884
|
+
default: "underline"
|
|
2885
|
+
},
|
|
2886
|
+
orientation: {
|
|
2887
|
+
values: tabsOrientationValues,
|
|
2888
|
+
default: "horizontal"
|
|
2889
|
+
},
|
|
2890
|
+
as: {
|
|
2891
|
+
values: ["div", "nav"],
|
|
2892
|
+
default: "div"
|
|
2893
|
+
},
|
|
2894
|
+
color: {
|
|
2895
|
+
scale: "palette",
|
|
2896
|
+
default: "primary"
|
|
2897
|
+
},
|
|
2898
|
+
textColor: { scale: "text" },
|
|
2899
|
+
size: {
|
|
2900
|
+
scale: "sizes",
|
|
2901
|
+
default: "md"
|
|
2902
|
+
},
|
|
2903
|
+
fullWidth: {
|
|
2904
|
+
values: [true, false],
|
|
2905
|
+
default: false
|
|
2906
|
+
},
|
|
2907
|
+
isCentered: {
|
|
2908
|
+
values: [true, false],
|
|
2909
|
+
default: false
|
|
2910
|
+
},
|
|
2911
|
+
shouldSelectOnFocus: {
|
|
2912
|
+
values: [true, false],
|
|
2913
|
+
default: false
|
|
2914
|
+
},
|
|
2915
|
+
overflowBehavior: {
|
|
2916
|
+
values: tabsOverflowBehaviorValues,
|
|
2917
|
+
default: "none"
|
|
2918
|
+
},
|
|
2919
|
+
scrollButtons: {
|
|
2920
|
+
values: tabsScrollButtonsValues,
|
|
2921
|
+
default: "auto"
|
|
2922
|
+
},
|
|
2923
|
+
shouldShowScrollButtonsOnMobile: {
|
|
2924
|
+
values: [true, false],
|
|
2925
|
+
default: false
|
|
2926
|
+
},
|
|
2927
|
+
hasVisibleScrollbar: {
|
|
2928
|
+
values: [true, false],
|
|
2929
|
+
default: false
|
|
2930
|
+
},
|
|
2931
|
+
hasDivider: { values: [true, false] },
|
|
2932
|
+
bg: { scale: "background" },
|
|
2933
|
+
selectedBg: { scale: "background" }
|
|
2934
|
+
},
|
|
2935
|
+
content: {
|
|
2936
|
+
children: "children",
|
|
2937
|
+
startContent: "children",
|
|
2938
|
+
endContent: "children",
|
|
2939
|
+
slots: "none"
|
|
2940
|
+
},
|
|
2941
|
+
twoWay: {
|
|
2942
|
+
prop: "value",
|
|
2943
|
+
event: "onChange",
|
|
2944
|
+
read: "argument"
|
|
2945
|
+
},
|
|
2946
|
+
domEvents: ["onTabClose"],
|
|
2947
|
+
preview: { width: 360 }
|
|
2948
|
+
});
|
|
2949
|
+
//#endregion
|
|
2950
|
+
//#region src/Tabs/TabContext/TabContext.catalog.ts
|
|
2951
|
+
const tabContextCatalog = defineCatalogEntry()({
|
|
2952
|
+
summary: "Holds the selected value for a `TabList` and the `TabPanel`s beside it, wherever they sit.",
|
|
2953
|
+
isPlaceable: false,
|
|
2954
|
+
example: {
|
|
2955
|
+
component: "TabContext",
|
|
2956
|
+
props: { defaultValue: "layers" },
|
|
2957
|
+
children: [
|
|
2958
|
+
node("TabList", { "aria-label": "Left panel" }, [node("Tab", {
|
|
2959
|
+
value: "layers",
|
|
2960
|
+
label: "Layers"
|
|
2961
|
+
}), node("Tab", {
|
|
2962
|
+
value: "assets",
|
|
2963
|
+
label: "Assets"
|
|
2964
|
+
})]),
|
|
2965
|
+
node("TabPanel", {
|
|
2966
|
+
value: "layers",
|
|
2967
|
+
p: 2
|
|
2968
|
+
}, [node("Typography", {}, ["Layers of the page."])]),
|
|
2969
|
+
node("TabPanel", {
|
|
2970
|
+
value: "assets",
|
|
2971
|
+
p: 2
|
|
2972
|
+
}, [node("Typography", {}, ["The page's assets."])])
|
|
2973
|
+
]
|
|
2974
|
+
},
|
|
2975
|
+
variants: [],
|
|
2976
|
+
options: {},
|
|
2977
|
+
content: { children: "children" },
|
|
2978
|
+
twoWay: {
|
|
2979
|
+
prop: "value",
|
|
2980
|
+
event: "onChange",
|
|
2981
|
+
read: "argument"
|
|
2982
|
+
}
|
|
2983
|
+
});
|
|
2984
|
+
//#endregion
|
|
2985
|
+
//#region src/Tabs/TabList/TabList.catalog.ts
|
|
2986
|
+
const tabListCatalog = defineCatalogEntry()({
|
|
2987
|
+
summary: "The `Tabs` of a `TabContext` - it shows the context's value and links each tab to its panel.",
|
|
2988
|
+
isPlaceable: false,
|
|
2989
|
+
example: {
|
|
2990
|
+
component: "TabList",
|
|
2991
|
+
props: { "aria-label": "Left panel" },
|
|
2992
|
+
children: [node("Tab", {
|
|
2993
|
+
value: "layers",
|
|
2994
|
+
label: "Layers"
|
|
2995
|
+
}), node("Tab", {
|
|
2996
|
+
value: "assets",
|
|
2997
|
+
label: "Assets"
|
|
2998
|
+
})]
|
|
2999
|
+
},
|
|
3000
|
+
variants: [],
|
|
3001
|
+
options: {},
|
|
3002
|
+
content: {
|
|
3003
|
+
children: "children",
|
|
3004
|
+
startContent: "children",
|
|
3005
|
+
endContent: "children"
|
|
3006
|
+
},
|
|
3007
|
+
domEvents: ["onChange", "onTabClose"]
|
|
3008
|
+
});
|
|
3009
|
+
const tabScrollButtonCatalog = defineCatalogEntry()({
|
|
3010
|
+
summary: "The button that scrolls a row of tabs - a `Tabs` shows one at each end while they overflow.",
|
|
3011
|
+
isPlaceable: false,
|
|
3012
|
+
example: {
|
|
3013
|
+
component: "TabScrollButton",
|
|
3014
|
+
props: { direction: "end" },
|
|
3015
|
+
children: []
|
|
3016
|
+
},
|
|
3017
|
+
variants: [],
|
|
3018
|
+
options: {
|
|
3019
|
+
direction: { values: ["start", "end"] },
|
|
3020
|
+
orientation: {
|
|
3021
|
+
values: ["horizontal", "vertical"],
|
|
3022
|
+
default: "horizontal"
|
|
3023
|
+
},
|
|
3024
|
+
disabled: {
|
|
3025
|
+
values: [true, false],
|
|
3026
|
+
default: false
|
|
3027
|
+
},
|
|
3028
|
+
isHidden: {
|
|
3029
|
+
values: [true, false],
|
|
3030
|
+
default: false
|
|
3031
|
+
},
|
|
3032
|
+
color: { scale: "palette" },
|
|
3033
|
+
textColor: { scale: "text" }
|
|
3034
|
+
},
|
|
3035
|
+
content: { children: "children" },
|
|
3036
|
+
domEvents: ["onClick"]
|
|
3037
|
+
});
|
|
3038
|
+
//#endregion
|
|
3039
|
+
//#region src/Table/Table/Table.catalog.ts
|
|
3040
|
+
const tableSizeValues = [
|
|
3041
|
+
"sm",
|
|
3042
|
+
"md",
|
|
3043
|
+
"lg"
|
|
3044
|
+
];
|
|
3045
|
+
const tableCellPaddingValues = ["normal", "none"];
|
|
3046
|
+
const tableAlignValues = [
|
|
3047
|
+
"left",
|
|
3048
|
+
"right",
|
|
3049
|
+
"center",
|
|
3050
|
+
"justify"
|
|
3051
|
+
];
|
|
3052
|
+
const sizeLabels = {
|
|
3053
|
+
sm: "Dense",
|
|
3054
|
+
md: "Default",
|
|
3055
|
+
lg: "Roomy"
|
|
3056
|
+
};
|
|
3057
|
+
const deployments = [node("TableHead", {}, [node("TableRow", {}, [
|
|
3058
|
+
node("TableCell", {}, ["Service"]),
|
|
3059
|
+
node("TableCell", {}, ["Region"]),
|
|
3060
|
+
node("TableCell", { align: "right" }, ["Latency (ms)"])
|
|
3061
|
+
])]), node("TableBody", {}, [node("TableRow", { isHoverable: true }, [
|
|
3062
|
+
node("TableCell", {}, ["web"]),
|
|
3063
|
+
node("TableCell", {}, ["fra1"]),
|
|
3064
|
+
node("TableCell", { align: "right" }, ["42"])
|
|
3065
|
+
]), node("TableRow", { isHoverable: true }, [
|
|
3066
|
+
node("TableCell", {}, ["api"]),
|
|
3067
|
+
node("TableCell", {}, ["fra1"]),
|
|
3068
|
+
node("TableCell", { align: "right" }, ["87"])
|
|
3069
|
+
])])];
|
|
3070
|
+
const tableCatalog = defineCatalogEntry()({
|
|
3071
|
+
summary: "A data table - `TableHead`, `TableBody` and `TableFooter` sections of `TableRow`s and `TableCell`s, with density and padding set once for every cell.",
|
|
3072
|
+
isPlaceable: true,
|
|
3073
|
+
example: {
|
|
3074
|
+
component: "Table",
|
|
3075
|
+
props: {},
|
|
3076
|
+
children: deployments
|
|
3077
|
+
},
|
|
3078
|
+
variants: tableSizeValues.map((size) => ({
|
|
3079
|
+
name: size,
|
|
3080
|
+
label: sizeLabels[size],
|
|
3081
|
+
example: {
|
|
3082
|
+
component: "Table",
|
|
3083
|
+
props: { size },
|
|
3084
|
+
children: deployments
|
|
3085
|
+
}
|
|
3086
|
+
})),
|
|
3087
|
+
options: {
|
|
3088
|
+
size: {
|
|
3089
|
+
scale: "sizes",
|
|
3090
|
+
default: "md"
|
|
3091
|
+
},
|
|
3092
|
+
cellPadding: {
|
|
3093
|
+
values: tableCellPaddingValues,
|
|
3094
|
+
default: "normal"
|
|
3095
|
+
},
|
|
3096
|
+
align: { values: tableAlignValues },
|
|
3097
|
+
color: { scale: "palette" },
|
|
3098
|
+
bg: { scale: "background" },
|
|
3099
|
+
borderColor: {
|
|
3100
|
+
scale: "border",
|
|
3101
|
+
default: "light"
|
|
3102
|
+
},
|
|
3103
|
+
borderRadius: { scale: "radii" },
|
|
3104
|
+
hasStickyHeader: {
|
|
3105
|
+
values: [true, false],
|
|
3106
|
+
default: false
|
|
3107
|
+
},
|
|
3108
|
+
shouldHideSortIcon: {
|
|
3109
|
+
values: [true, false],
|
|
3110
|
+
default: true
|
|
3111
|
+
},
|
|
3112
|
+
hasEllipsis: {
|
|
3113
|
+
values: [true, false],
|
|
3114
|
+
default: false
|
|
3115
|
+
}
|
|
3116
|
+
},
|
|
3117
|
+
content: { children: "children" },
|
|
3118
|
+
preview: { width: 360 }
|
|
3119
|
+
});
|
|
3120
|
+
//#endregion
|
|
3121
|
+
//#region src/Table/TableBody/TableBody.catalog.ts
|
|
3122
|
+
const tableBodyCatalog = defineCatalogEntry()({
|
|
3123
|
+
summary: "The body section of a `Table` - its data rows, with cells rendered as `<td>`.",
|
|
3124
|
+
isPlaceable: false,
|
|
3125
|
+
example: {
|
|
3126
|
+
component: "TableBody",
|
|
3127
|
+
props: {},
|
|
3128
|
+
children: [node("TableRow", { isHoverable: true }, [
|
|
3129
|
+
node("TableCell", {}, ["web"]),
|
|
3130
|
+
node("TableCell", {}, ["fra1"]),
|
|
3131
|
+
node("TableCell", { align: "right" }, ["42"])
|
|
3132
|
+
]), node("TableRow", { isHoverable: true }, [
|
|
3133
|
+
node("TableCell", {}, ["api"]),
|
|
3134
|
+
node("TableCell", {}, ["fra1"]),
|
|
3135
|
+
node("TableCell", { align: "right" }, ["87"])
|
|
3136
|
+
])]
|
|
3137
|
+
},
|
|
3138
|
+
variants: [],
|
|
3139
|
+
options: {
|
|
3140
|
+
color: { scale: "text" },
|
|
3141
|
+
bg: { scale: "background" },
|
|
3142
|
+
borderColor: { scale: "border" }
|
|
3143
|
+
},
|
|
3144
|
+
content: { children: "children" }
|
|
3145
|
+
});
|
|
3146
|
+
//#endregion
|
|
3147
|
+
//#region src/Table/TableCell/TableCell.catalog.ts
|
|
3148
|
+
const tableCellVariantValues = [
|
|
3149
|
+
"head",
|
|
3150
|
+
"body",
|
|
3151
|
+
"footer"
|
|
3152
|
+
];
|
|
3153
|
+
const tableCellAlignValues = [
|
|
3154
|
+
"inherit",
|
|
3155
|
+
"left",
|
|
3156
|
+
"right",
|
|
3157
|
+
"center",
|
|
3158
|
+
"justify"
|
|
3159
|
+
];
|
|
3160
|
+
const tableCellSortDirectionValues = ["asc", "desc"];
|
|
3161
|
+
const cellPaddingValues$1 = ["normal", "none"];
|
|
3162
|
+
const variantLabels$2 = {
|
|
3163
|
+
head: "Head",
|
|
3164
|
+
body: "Body",
|
|
3165
|
+
footer: "Footer"
|
|
3166
|
+
};
|
|
3167
|
+
const tableCellCatalog = defineCatalogEntry()({
|
|
3168
|
+
summary: "One cell of a `TableRow` - a header `<th>` or a data `<td>`, taken from its section unless `variant` says otherwise.",
|
|
3169
|
+
isPlaceable: false,
|
|
3170
|
+
example: {
|
|
3171
|
+
component: "TableCell",
|
|
3172
|
+
props: {},
|
|
3173
|
+
children: ["web"]
|
|
3174
|
+
},
|
|
3175
|
+
variants: tableCellVariantValues.map((variant) => ({
|
|
3176
|
+
name: variant,
|
|
3177
|
+
label: variantLabels$2[variant],
|
|
3178
|
+
example: {
|
|
3179
|
+
component: "TableCell",
|
|
3180
|
+
props: { variant },
|
|
3181
|
+
children: ["web"]
|
|
3182
|
+
}
|
|
3183
|
+
})),
|
|
3184
|
+
options: {
|
|
3185
|
+
variant: { values: tableCellVariantValues },
|
|
3186
|
+
align: {
|
|
3187
|
+
values: tableCellAlignValues,
|
|
3188
|
+
default: "inherit"
|
|
3189
|
+
},
|
|
3190
|
+
size: { scale: "sizes" },
|
|
3191
|
+
cellPadding: { values: cellPaddingValues$1 },
|
|
3192
|
+
sortDirection: { values: tableCellSortDirectionValues },
|
|
3193
|
+
hasEllipsis: { values: [true, false] },
|
|
3194
|
+
color: { scale: "text" },
|
|
3195
|
+
bg: { scale: "background" },
|
|
3196
|
+
borderColor: { scale: "border" }
|
|
3197
|
+
},
|
|
3198
|
+
content: { children: "children" }
|
|
3199
|
+
});
|
|
3200
|
+
//#endregion
|
|
3201
|
+
//#region src/Table/TableContainer/TableContainer.catalog.ts
|
|
3202
|
+
const tableContainerCatalog = defineCatalogEntry()({
|
|
3203
|
+
summary: "A scroll wrapper for a `Table` - a wide table scrolls sideways inside it, and a bounded height lets `hasStickyHeader` stick.",
|
|
3204
|
+
isPlaceable: false,
|
|
3205
|
+
example: {
|
|
3206
|
+
component: "TableContainer",
|
|
3207
|
+
props: {},
|
|
3208
|
+
children: [node("Table", {}, [node("TableHead", {}, [node("TableRow", {}, [
|
|
3209
|
+
node("TableCell", {}, ["Service"]),
|
|
3210
|
+
node("TableCell", {}, ["Region"]),
|
|
3211
|
+
node("TableCell", { align: "right" }, ["Latency (ms)"])
|
|
3212
|
+
])]), node("TableBody", {}, [node("TableRow", {}, [
|
|
3213
|
+
node("TableCell", {}, ["web"]),
|
|
3214
|
+
node("TableCell", {}, ["fra1"]),
|
|
3215
|
+
node("TableCell", { align: "right" }, ["42"])
|
|
3216
|
+
]), node("TableRow", {}, [
|
|
3217
|
+
node("TableCell", {}, ["api"]),
|
|
3218
|
+
node("TableCell", {}, ["fra1"]),
|
|
3219
|
+
node("TableCell", { align: "right" }, ["87"])
|
|
3220
|
+
])])])]
|
|
3221
|
+
},
|
|
3222
|
+
variants: [],
|
|
3223
|
+
options: {
|
|
3224
|
+
bg: { scale: "background" },
|
|
3225
|
+
borderColor: { scale: "border" },
|
|
3226
|
+
borderWidth: { scale: "borderWidths" },
|
|
3227
|
+
borderRadius: { scale: "radii" }
|
|
3228
|
+
},
|
|
3229
|
+
content: { children: "children" },
|
|
3230
|
+
preview: { width: 360 }
|
|
3231
|
+
});
|
|
3232
|
+
//#endregion
|
|
3233
|
+
//#region src/Table/TableControl/TableControl.catalog.ts
|
|
3234
|
+
const tableControlCatalog = defineCatalogEntry()({
|
|
3235
|
+
summary: "Renders the visible rows of a dataset inside `TableBody` - sorted by `useTableSort` and sliced by `useTablePagination`, through a row render function.",
|
|
3236
|
+
isPlaceable: false,
|
|
3237
|
+
example: {
|
|
3238
|
+
component: "TableControl",
|
|
3239
|
+
props: {},
|
|
3240
|
+
children: []
|
|
3241
|
+
},
|
|
3242
|
+
variants: [],
|
|
3243
|
+
options: {},
|
|
3244
|
+
content: { children: "none" }
|
|
3245
|
+
});
|
|
3246
|
+
//#endregion
|
|
3247
|
+
//#region src/Table/TableFooter/TableFooter.catalog.ts
|
|
3248
|
+
const tableFooterCatalog = defineCatalogEntry()({
|
|
3249
|
+
summary: "The footer section of a `Table` - totals or a `TablePagination` row below the body.",
|
|
3250
|
+
isPlaceable: false,
|
|
3251
|
+
example: {
|
|
3252
|
+
component: "TableFooter",
|
|
3253
|
+
props: {},
|
|
3254
|
+
children: [node("TableRow", {}, [node("TableCell", { colSpan: 2 }, ["Total services"]), node("TableCell", { align: "right" }, ["3"])])]
|
|
3255
|
+
},
|
|
3256
|
+
variants: [],
|
|
3257
|
+
options: {
|
|
3258
|
+
color: { scale: "text" },
|
|
3259
|
+
bg: { scale: "background" },
|
|
3260
|
+
borderColor: { scale: "border" }
|
|
3261
|
+
},
|
|
3262
|
+
content: { children: "children" }
|
|
3263
|
+
});
|
|
3264
|
+
//#endregion
|
|
3265
|
+
//#region src/Table/TableHead/TableHead.catalog.ts
|
|
3266
|
+
const tableHeadCatalog = defineCatalogEntry()({
|
|
3267
|
+
summary: "The header section of a `Table` - its column-title row, with cells rendered as `<th scope=\"col\">`.",
|
|
3268
|
+
isPlaceable: false,
|
|
3269
|
+
example: {
|
|
3270
|
+
component: "TableHead",
|
|
3271
|
+
props: {},
|
|
3272
|
+
children: [node("TableRow", {}, [
|
|
3273
|
+
node("TableCell", {}, ["Service"]),
|
|
3274
|
+
node("TableCell", {}, ["Region"]),
|
|
3275
|
+
node("TableCell", { align: "right" }, ["Latency (ms)"])
|
|
3276
|
+
])]
|
|
3277
|
+
},
|
|
3278
|
+
variants: [],
|
|
3279
|
+
options: {
|
|
3280
|
+
color: { scale: "text" },
|
|
3281
|
+
bg: { scale: "background" },
|
|
3282
|
+
borderColor: { scale: "border" }
|
|
3283
|
+
},
|
|
3284
|
+
content: { children: "children" }
|
|
3285
|
+
});
|
|
3286
|
+
const tablePaginationCatalog = defineCatalogEntry()({
|
|
3287
|
+
summary: "A pagination cell for `TableFooter > TableRow` - a rows-per-page picker, the shown range and previous/next buttons for a controlled page.",
|
|
3288
|
+
isPlaceable: false,
|
|
3289
|
+
example: {
|
|
3290
|
+
component: "TablePagination",
|
|
3291
|
+
props: {
|
|
3292
|
+
count: 100,
|
|
3293
|
+
page: 2,
|
|
3294
|
+
rowsPerPage: 10
|
|
3295
|
+
},
|
|
3296
|
+
children: []
|
|
3297
|
+
},
|
|
3298
|
+
variants: [],
|
|
3299
|
+
options: {
|
|
3300
|
+
disabled: {
|
|
3301
|
+
values: [true, false],
|
|
3302
|
+
default: false
|
|
3303
|
+
},
|
|
3304
|
+
shouldShowFirstButton: {
|
|
3305
|
+
values: [true, false],
|
|
3306
|
+
default: false
|
|
3307
|
+
},
|
|
3308
|
+
shouldShowLastButton: {
|
|
3309
|
+
values: [true, false],
|
|
3310
|
+
default: false
|
|
3311
|
+
},
|
|
3312
|
+
size: { scale: "sizes" },
|
|
3313
|
+
cellPadding: { values: ["normal", "none"] },
|
|
3314
|
+
color: { scale: "text" },
|
|
3315
|
+
bg: { scale: "background" }
|
|
3316
|
+
},
|
|
3317
|
+
content: {
|
|
3318
|
+
rowsPerPageLabel: "text",
|
|
3319
|
+
displayedRowsLabel: "none"
|
|
3320
|
+
},
|
|
3321
|
+
twoWay: {
|
|
3322
|
+
prop: "page",
|
|
3323
|
+
event: "onPageChange",
|
|
3324
|
+
read: "argument"
|
|
3325
|
+
},
|
|
3326
|
+
preview: { width: 480 }
|
|
3327
|
+
});
|
|
3328
|
+
//#endregion
|
|
3329
|
+
//#region src/Table/TablePaginationActions/TablePaginationActions.catalog.ts
|
|
3330
|
+
const tablePaginationActionsCatalog = defineCatalogEntry()({
|
|
3331
|
+
summary: "The first, previous, next and last page buttons inside `TablePagination`, disabled at the bounds of `count`.",
|
|
3332
|
+
isPlaceable: false,
|
|
3333
|
+
example: {
|
|
3334
|
+
component: "TablePaginationActions",
|
|
3335
|
+
props: {
|
|
3336
|
+
count: 100,
|
|
3337
|
+
page: 2,
|
|
3338
|
+
rowsPerPage: 10
|
|
3339
|
+
},
|
|
3340
|
+
children: []
|
|
3341
|
+
},
|
|
3342
|
+
variants: [],
|
|
3343
|
+
options: {
|
|
3344
|
+
size: {
|
|
3345
|
+
scale: "sizes",
|
|
3346
|
+
default: "sm"
|
|
3347
|
+
},
|
|
3348
|
+
disabled: {
|
|
3349
|
+
values: [true, false],
|
|
3350
|
+
default: false
|
|
3351
|
+
},
|
|
3352
|
+
shouldShowFirstButton: {
|
|
3353
|
+
values: [true, false],
|
|
3354
|
+
default: false
|
|
3355
|
+
},
|
|
3356
|
+
shouldShowLastButton: {
|
|
3357
|
+
values: [true, false],
|
|
3358
|
+
default: false
|
|
3359
|
+
}
|
|
3360
|
+
},
|
|
3361
|
+
content: {},
|
|
3362
|
+
twoWay: {
|
|
3363
|
+
prop: "page",
|
|
3364
|
+
event: "onPageChange",
|
|
3365
|
+
read: "argument"
|
|
3366
|
+
}
|
|
3367
|
+
});
|
|
3368
|
+
//#endregion
|
|
3369
|
+
//#region src/Table/TableRow/TableRow.catalog.ts
|
|
3370
|
+
const tableRowCatalog = defineCatalogEntry()({
|
|
3371
|
+
summary: "One row of a `Table` section - its `TableCell`s, optionally shaded on hover or when selected.",
|
|
3372
|
+
isPlaceable: false,
|
|
3373
|
+
example: {
|
|
3374
|
+
component: "TableRow",
|
|
3375
|
+
props: { isHoverable: true },
|
|
3376
|
+
children: [
|
|
3377
|
+
node("TableCell", {}, ["web"]),
|
|
3378
|
+
node("TableCell", {}, ["fra1"]),
|
|
3379
|
+
node("TableCell", { align: "right" }, ["42"])
|
|
3380
|
+
]
|
|
3381
|
+
},
|
|
3382
|
+
variants: [],
|
|
3383
|
+
options: {
|
|
3384
|
+
color: {
|
|
3385
|
+
scale: "palette",
|
|
3386
|
+
default: "primary"
|
|
3387
|
+
},
|
|
3388
|
+
bg: { scale: "background" },
|
|
3389
|
+
borderColor: { scale: "border" },
|
|
3390
|
+
isHoverable: {
|
|
3391
|
+
values: [true, false],
|
|
3392
|
+
default: false
|
|
3393
|
+
},
|
|
3394
|
+
isSelected: {
|
|
3395
|
+
values: [true, false],
|
|
3396
|
+
default: false
|
|
3397
|
+
}
|
|
3398
|
+
},
|
|
3399
|
+
content: { children: "children" },
|
|
3400
|
+
domEvents: ["onClick"]
|
|
3401
|
+
});
|
|
3402
|
+
const tableSortLabelCatalog = defineCatalogEntry()({
|
|
3403
|
+
summary: "A sortable column title for a header `TableCell` - a button with an arrow showing the sort direction.",
|
|
3404
|
+
isPlaceable: false,
|
|
3405
|
+
example: {
|
|
3406
|
+
component: "TableSortLabel",
|
|
3407
|
+
props: {
|
|
3408
|
+
isActive: true,
|
|
3409
|
+
direction: "asc"
|
|
3410
|
+
},
|
|
3411
|
+
children: ["Name"]
|
|
3412
|
+
},
|
|
3413
|
+
variants: [],
|
|
3414
|
+
options: {
|
|
3415
|
+
isActive: {
|
|
3416
|
+
values: [true, false],
|
|
3417
|
+
default: false
|
|
3418
|
+
},
|
|
3419
|
+
direction: {
|
|
3420
|
+
values: ["asc", "desc"],
|
|
3421
|
+
default: "asc"
|
|
3422
|
+
},
|
|
3423
|
+
shouldHideSortIcon: {
|
|
3424
|
+
values: [true, false],
|
|
3425
|
+
default: true
|
|
3426
|
+
}
|
|
3427
|
+
},
|
|
3428
|
+
content: { children: "children" },
|
|
3429
|
+
domEvents: ["onClick"]
|
|
3430
|
+
});
|
|
3431
|
+
//#endregion
|
|
3432
|
+
//#region src/TextInput/TextInput.catalog.ts
|
|
3433
|
+
const textInputVariantValues = [
|
|
3434
|
+
"default",
|
|
3435
|
+
"outlined",
|
|
3436
|
+
"text",
|
|
3437
|
+
"underline"
|
|
3438
|
+
];
|
|
3439
|
+
const variantLabels$1 = {
|
|
3440
|
+
default: "Filled",
|
|
3441
|
+
outlined: "Outlined",
|
|
3442
|
+
text: "Text",
|
|
3443
|
+
underline: "Underline"
|
|
3444
|
+
};
|
|
3445
|
+
const textInputCatalog = defineCatalogEntry()({
|
|
3446
|
+
summary: "A text field - one line, or a `multiline` textarea that can grow with its content.",
|
|
3447
|
+
isPlaceable: true,
|
|
3448
|
+
example: {
|
|
3449
|
+
component: "TextInput",
|
|
3450
|
+
props: { placeholder: "Enter a value..." },
|
|
3451
|
+
children: []
|
|
3452
|
+
},
|
|
3453
|
+
variants: textInputVariantValues.map((variant) => ({
|
|
3454
|
+
name: variant,
|
|
3455
|
+
label: variantLabels$1[variant],
|
|
3456
|
+
example: {
|
|
3457
|
+
component: "TextInput",
|
|
3458
|
+
props: {
|
|
3459
|
+
placeholder: "Enter a value...",
|
|
3460
|
+
variant
|
|
3461
|
+
},
|
|
3462
|
+
children: []
|
|
3463
|
+
}
|
|
3464
|
+
})),
|
|
3465
|
+
options: {
|
|
3466
|
+
variant: {
|
|
3467
|
+
values: textInputVariantValues,
|
|
3468
|
+
default: "default"
|
|
3469
|
+
},
|
|
3470
|
+
color: {
|
|
3471
|
+
scale: "palette",
|
|
3472
|
+
default: "primary"
|
|
3473
|
+
},
|
|
3474
|
+
textColor: {
|
|
3475
|
+
scale: "text",
|
|
3476
|
+
default: "primary"
|
|
3477
|
+
},
|
|
3478
|
+
size: {
|
|
3479
|
+
scale: "sizes",
|
|
3480
|
+
default: "md"
|
|
3481
|
+
},
|
|
3482
|
+
borderRadius: { scale: "radii" },
|
|
3483
|
+
disabled: {
|
|
3484
|
+
values: [true, false],
|
|
3485
|
+
default: false
|
|
3486
|
+
},
|
|
3487
|
+
error: {
|
|
3488
|
+
values: [true, false],
|
|
3489
|
+
default: false
|
|
3490
|
+
},
|
|
3491
|
+
readOnly: {
|
|
3492
|
+
values: [true, false],
|
|
3493
|
+
default: false
|
|
3494
|
+
},
|
|
3495
|
+
required: {
|
|
3496
|
+
values: [true, false],
|
|
3497
|
+
default: false
|
|
3498
|
+
},
|
|
3499
|
+
fullWidth: {
|
|
3500
|
+
values: [true, false],
|
|
3501
|
+
default: false
|
|
3502
|
+
},
|
|
3503
|
+
multiline: {
|
|
3504
|
+
values: [true, false],
|
|
3505
|
+
default: false
|
|
3506
|
+
},
|
|
3507
|
+
resize: {
|
|
3508
|
+
values: [true, false],
|
|
3509
|
+
default: false
|
|
3510
|
+
}
|
|
3511
|
+
},
|
|
3512
|
+
content: { placeholder: "text" },
|
|
3513
|
+
twoWay: {
|
|
3514
|
+
prop: "value",
|
|
3515
|
+
event: "onChange",
|
|
3516
|
+
read: "target.value"
|
|
3517
|
+
}
|
|
3518
|
+
});
|
|
3519
|
+
//#endregion
|
|
3520
|
+
//#region src/ToggleButton/ToggleButton/ToggleButton.catalog.ts
|
|
3521
|
+
const colorLabels$1 = {
|
|
3522
|
+
default: "Default",
|
|
3523
|
+
primary: "Primary",
|
|
3524
|
+
secondary: "Secondary",
|
|
3525
|
+
success: "Success",
|
|
3526
|
+
error: "Error",
|
|
3527
|
+
info: "Info",
|
|
3528
|
+
warning: "Warning"
|
|
3529
|
+
};
|
|
3530
|
+
const colors$1 = Object.keys(colorLabels$1);
|
|
3531
|
+
const toggleButtonCatalog = defineCatalogEntry()({
|
|
3532
|
+
summary: "A button that stays pressed or not - on its own, or one choice of a `ToggleButtonGroup`.",
|
|
3533
|
+
isPlaceable: true,
|
|
3534
|
+
example: {
|
|
3535
|
+
component: "ToggleButton",
|
|
3536
|
+
props: { value: "check" },
|
|
3537
|
+
children: ["Check"]
|
|
3538
|
+
},
|
|
3539
|
+
variants: colors$1.map((color) => ({
|
|
3540
|
+
name: color,
|
|
3541
|
+
label: colorLabels$1[color],
|
|
3542
|
+
example: {
|
|
3543
|
+
component: "ToggleButton",
|
|
3544
|
+
props: {
|
|
3545
|
+
value: "check",
|
|
3546
|
+
color,
|
|
3547
|
+
isSelected: true
|
|
3548
|
+
},
|
|
3549
|
+
children: ["Check"]
|
|
3550
|
+
}
|
|
3551
|
+
})),
|
|
3552
|
+
options: {
|
|
3553
|
+
color: {
|
|
3554
|
+
scale: "palette",
|
|
3555
|
+
default: "default"
|
|
3556
|
+
},
|
|
3557
|
+
size: {
|
|
3558
|
+
scale: "sizes",
|
|
3559
|
+
default: "md"
|
|
3560
|
+
},
|
|
3561
|
+
isSelected: { values: [true, false] },
|
|
3562
|
+
fullWidth: {
|
|
3563
|
+
values: [true, false],
|
|
3564
|
+
default: false
|
|
3565
|
+
},
|
|
3566
|
+
disabled: {
|
|
3567
|
+
values: [true, false],
|
|
3568
|
+
default: false
|
|
3569
|
+
},
|
|
3570
|
+
loading: {
|
|
3571
|
+
values: [true, false],
|
|
3572
|
+
default: false
|
|
3573
|
+
}
|
|
3574
|
+
},
|
|
3575
|
+
content: {
|
|
3576
|
+
children: "children",
|
|
3577
|
+
startIcon: "child",
|
|
3578
|
+
endIcon: "child",
|
|
3579
|
+
loadingIndicator: "child"
|
|
3580
|
+
},
|
|
3581
|
+
domEvents: ["onClick", "onChange"]
|
|
3582
|
+
});
|
|
3583
|
+
//#endregion
|
|
3584
|
+
//#region src/ToggleButton/ToggleButtonGroup/ToggleButtonGroup.catalog.ts
|
|
3585
|
+
const toggleButtonGroupOrientationValues = ["horizontal", "vertical"];
|
|
3586
|
+
const colorLabels = {
|
|
3587
|
+
default: "Default",
|
|
3588
|
+
primary: "Primary",
|
|
3589
|
+
secondary: "Secondary",
|
|
3590
|
+
success: "Success",
|
|
3591
|
+
error: "Error",
|
|
3592
|
+
info: "Info",
|
|
3593
|
+
warning: "Warning"
|
|
3594
|
+
};
|
|
3595
|
+
const colors = Object.keys(colorLabels);
|
|
3596
|
+
const platforms = [
|
|
3597
|
+
node("ToggleButton", { value: "web" }, ["Web"]),
|
|
3598
|
+
node("ToggleButton", { value: "android" }, ["Android"]),
|
|
3599
|
+
node("ToggleButton", { value: "ios" }, ["iOS"])
|
|
3600
|
+
];
|
|
3601
|
+
const props = {
|
|
3602
|
+
isExclusive: true,
|
|
3603
|
+
value: "web",
|
|
3604
|
+
"aria-label": "Platform"
|
|
3605
|
+
};
|
|
3606
|
+
const toggleButtonGroupCatalog = defineCatalogEntry()({
|
|
3607
|
+
summary: "A joined row of `ToggleButton`s where one (`isExclusive`) or several values can be selected.",
|
|
3608
|
+
isPlaceable: true,
|
|
3609
|
+
example: {
|
|
3610
|
+
component: "ToggleButtonGroup",
|
|
3611
|
+
props: {
|
|
3612
|
+
...props,
|
|
3613
|
+
color: "primary"
|
|
3614
|
+
},
|
|
3615
|
+
children: platforms
|
|
3616
|
+
},
|
|
3617
|
+
variants: colors.map((color) => ({
|
|
3618
|
+
name: color,
|
|
3619
|
+
label: colorLabels[color],
|
|
3620
|
+
example: {
|
|
3621
|
+
component: "ToggleButtonGroup",
|
|
3622
|
+
props: {
|
|
3623
|
+
...props,
|
|
3624
|
+
color
|
|
3625
|
+
},
|
|
3626
|
+
children: platforms
|
|
3627
|
+
}
|
|
3628
|
+
})),
|
|
3629
|
+
options: {
|
|
3630
|
+
isExclusive: {
|
|
3631
|
+
values: [true, false],
|
|
3632
|
+
default: false
|
|
3633
|
+
},
|
|
3634
|
+
color: {
|
|
3635
|
+
scale: "palette",
|
|
3636
|
+
default: "default"
|
|
3637
|
+
},
|
|
3638
|
+
size: {
|
|
3639
|
+
scale: "sizes",
|
|
3640
|
+
default: "md"
|
|
3641
|
+
},
|
|
3642
|
+
orientation: {
|
|
3643
|
+
values: toggleButtonGroupOrientationValues,
|
|
3644
|
+
default: "horizontal"
|
|
3645
|
+
},
|
|
3646
|
+
borderRadius: {
|
|
3647
|
+
scale: "radii",
|
|
3648
|
+
default: "md"
|
|
3649
|
+
},
|
|
3650
|
+
disabled: {
|
|
3651
|
+
values: [true, false],
|
|
3652
|
+
default: false
|
|
3653
|
+
},
|
|
3654
|
+
fullWidth: {
|
|
3655
|
+
values: [true, false],
|
|
3656
|
+
default: false
|
|
3657
|
+
}
|
|
3658
|
+
},
|
|
3659
|
+
content: { children: "children" },
|
|
3660
|
+
twoWay: {
|
|
3661
|
+
prop: "value",
|
|
3662
|
+
event: "onChange",
|
|
3663
|
+
read: "argument"
|
|
3664
|
+
}
|
|
3665
|
+
});
|
|
3666
|
+
//#endregion
|
|
3667
|
+
//#region src/Typography/Typography.catalog.ts
|
|
3668
|
+
const typographyAlignValues = [
|
|
3669
|
+
"left",
|
|
3670
|
+
"center",
|
|
3671
|
+
"right",
|
|
3672
|
+
"justify",
|
|
3673
|
+
"inherit"
|
|
3674
|
+
];
|
|
3675
|
+
const pictured = [
|
|
3676
|
+
"h1",
|
|
3677
|
+
"h2",
|
|
3678
|
+
"h3",
|
|
3679
|
+
"h4",
|
|
3680
|
+
"h5",
|
|
3681
|
+
"h6",
|
|
3682
|
+
"subtitle1",
|
|
3683
|
+
"subtitle2",
|
|
3684
|
+
"body1",
|
|
3685
|
+
"body2",
|
|
3686
|
+
"caption",
|
|
3687
|
+
"overline",
|
|
3688
|
+
"button"
|
|
3689
|
+
];
|
|
3690
|
+
const variantLabels = {
|
|
3691
|
+
h1: "Heading 1",
|
|
3692
|
+
h2: "Heading 2",
|
|
3693
|
+
h3: "Heading 3",
|
|
3694
|
+
h4: "Heading 4",
|
|
3695
|
+
h5: "Heading 5",
|
|
3696
|
+
h6: "Heading 6",
|
|
3697
|
+
subtitle1: "Subtitle 1",
|
|
3698
|
+
subtitle2: "Subtitle 2",
|
|
3699
|
+
body1: "Body 1",
|
|
3700
|
+
body2: "Body 2",
|
|
3701
|
+
caption: "Caption",
|
|
3702
|
+
overline: "Overline",
|
|
3703
|
+
button: "Button"
|
|
3704
|
+
};
|
|
3705
|
+
const typographyCatalog = defineCatalogEntry()({
|
|
3706
|
+
summary: "Text in one of the theme typography variants, rendered as its semantic element.",
|
|
3707
|
+
isPlaceable: true,
|
|
3708
|
+
example: {
|
|
3709
|
+
component: "Typography",
|
|
3710
|
+
props: { variant: "body1" },
|
|
3711
|
+
children: ["Great products are built through clarity, consistency, and attention to detail."]
|
|
3712
|
+
},
|
|
3713
|
+
variants: pictured.map((variant) => ({
|
|
3714
|
+
name: variant,
|
|
3715
|
+
label: variantLabels[variant],
|
|
3716
|
+
example: {
|
|
3717
|
+
component: "Typography",
|
|
3718
|
+
props: { variant },
|
|
3719
|
+
children: ["The quick brown fox"]
|
|
3720
|
+
}
|
|
3721
|
+
})),
|
|
3722
|
+
options: {
|
|
3723
|
+
variant: {
|
|
3724
|
+
scale: "typography",
|
|
3725
|
+
default: "body1"
|
|
3726
|
+
},
|
|
3727
|
+
color: { scale: "text" },
|
|
3728
|
+
bg: { scale: "background" },
|
|
3729
|
+
align: { values: typographyAlignValues },
|
|
3730
|
+
gutterBottom: {
|
|
3731
|
+
values: [true, false],
|
|
3732
|
+
default: false
|
|
3733
|
+
},
|
|
3734
|
+
noWrap: {
|
|
3735
|
+
values: [true, false],
|
|
3736
|
+
default: false
|
|
3737
|
+
}
|
|
3738
|
+
},
|
|
3739
|
+
content: { children: "children" }
|
|
3740
|
+
});
|
|
3741
|
+
//#endregion
|
|
3742
|
+
//#region src/View/View.catalog.ts
|
|
3743
|
+
const viewCatalog = defineCatalogEntry()({
|
|
3744
|
+
summary: "The base box - a div styled through theme tokens for space, color, borders and position.",
|
|
3745
|
+
isPlaceable: true,
|
|
3746
|
+
example: {
|
|
3747
|
+
component: "View",
|
|
3748
|
+
props: {},
|
|
3749
|
+
children: ["View content"]
|
|
3750
|
+
},
|
|
3751
|
+
variants: [],
|
|
3752
|
+
options: {
|
|
3753
|
+
bg: { scale: "background" },
|
|
3754
|
+
borderColor: { scale: "border" },
|
|
3755
|
+
borderWidth: { scale: "borderWidths" },
|
|
3756
|
+
borderRadius: { scale: "radii" }
|
|
3757
|
+
},
|
|
3758
|
+
content: { children: "children" }
|
|
3759
|
+
});
|
|
3760
|
+
//#endregion
|
|
3761
|
+
//#region src/catalog/sources.ts
|
|
3762
|
+
/** Every component, keyed by its export name. */
|
|
3763
|
+
const catalogSources = {
|
|
3764
|
+
AppBar: {
|
|
3765
|
+
entry: appBarCatalog,
|
|
3766
|
+
folder: "AppBar"
|
|
3767
|
+
},
|
|
3768
|
+
Avatar: {
|
|
3769
|
+
entry: avatarCatalog,
|
|
3770
|
+
folder: "Avatar"
|
|
3771
|
+
},
|
|
3772
|
+
Backdrop: {
|
|
3773
|
+
entry: backdropCatalog,
|
|
3774
|
+
folder: "Backdrop"
|
|
3775
|
+
},
|
|
3776
|
+
Breadcrumbs: {
|
|
3777
|
+
entry: breadcrumbsCatalog,
|
|
3778
|
+
folder: "Breadcrumbs"
|
|
3779
|
+
},
|
|
3780
|
+
Button: {
|
|
3781
|
+
entry: buttonCatalog,
|
|
3782
|
+
folder: "Button"
|
|
3783
|
+
},
|
|
3784
|
+
ButtonGroup: {
|
|
3785
|
+
entry: buttonGroupCatalog,
|
|
3786
|
+
folder: "ButtonGroup"
|
|
3787
|
+
},
|
|
3788
|
+
Card: {
|
|
3789
|
+
entry: cardCatalog,
|
|
3790
|
+
folder: "Card"
|
|
3791
|
+
},
|
|
3792
|
+
Checkbox: {
|
|
3793
|
+
entry: checkboxCatalog,
|
|
3794
|
+
folder: "Checkbox"
|
|
3795
|
+
},
|
|
3796
|
+
ContextMenu: {
|
|
3797
|
+
entry: contextMenuCatalog,
|
|
3798
|
+
folder: "Menu",
|
|
3799
|
+
family: "Menu"
|
|
3800
|
+
},
|
|
3801
|
+
CircularProgress: {
|
|
3802
|
+
entry: circularProgressCatalog,
|
|
3803
|
+
folder: "CircularProgress"
|
|
3804
|
+
},
|
|
3805
|
+
Drawer: {
|
|
3806
|
+
entry: drawerCatalog,
|
|
3807
|
+
folder: "Drawer"
|
|
3808
|
+
},
|
|
3809
|
+
DrawerToggle: {
|
|
3810
|
+
entry: drawerToggleCatalog,
|
|
3811
|
+
folder: "Drawer",
|
|
3812
|
+
family: "Drawer"
|
|
3813
|
+
},
|
|
3814
|
+
Flex: {
|
|
3815
|
+
entry: flexCatalog,
|
|
3816
|
+
folder: "Flex"
|
|
3817
|
+
},
|
|
3818
|
+
FocusTrap: {
|
|
3819
|
+
entry: focusTrapCatalog,
|
|
3820
|
+
folder: "FocusTrap"
|
|
3821
|
+
},
|
|
3822
|
+
Form: {
|
|
3823
|
+
entry: formCatalog,
|
|
3824
|
+
folder: "Form"
|
|
3825
|
+
},
|
|
3826
|
+
FormControl: {
|
|
3827
|
+
entry: formControlCatalog,
|
|
3828
|
+
folder: "FormControl"
|
|
3829
|
+
},
|
|
3830
|
+
FormHelperText: {
|
|
3831
|
+
entry: formHelperTextCatalog,
|
|
3832
|
+
folder: "FormHelperText"
|
|
3833
|
+
},
|
|
3834
|
+
FormLabel: {
|
|
3835
|
+
entry: formLabelCatalog,
|
|
3836
|
+
folder: "FormLabel"
|
|
3837
|
+
},
|
|
3838
|
+
Grid: {
|
|
3839
|
+
entry: gridCatalog,
|
|
3840
|
+
folder: "Grid"
|
|
3841
|
+
},
|
|
3842
|
+
Icon: {
|
|
3843
|
+
entry: iconCatalog,
|
|
3844
|
+
folder: "Icon"
|
|
3845
|
+
},
|
|
3846
|
+
Image: {
|
|
3847
|
+
entry: imageCatalog,
|
|
3848
|
+
folder: "Image"
|
|
3849
|
+
},
|
|
3850
|
+
LinearProgress: {
|
|
3851
|
+
entry: linearProgressCatalog,
|
|
3852
|
+
folder: "LinearProgress"
|
|
3853
|
+
},
|
|
3854
|
+
Link: {
|
|
3855
|
+
entry: linkCatalog,
|
|
3856
|
+
folder: "Link"
|
|
3857
|
+
},
|
|
3858
|
+
Menu: {
|
|
3859
|
+
entry: menuCatalog,
|
|
3860
|
+
folder: "Menu"
|
|
3861
|
+
},
|
|
3862
|
+
MenuDivider: {
|
|
3863
|
+
entry: menuDividerCatalog,
|
|
3864
|
+
folder: "Menu",
|
|
3865
|
+
family: "Menu"
|
|
3866
|
+
},
|
|
3867
|
+
MenuItem: {
|
|
3868
|
+
entry: menuItemCatalog,
|
|
3869
|
+
folder: "MenuItem"
|
|
3870
|
+
},
|
|
3871
|
+
MenuItems: {
|
|
3872
|
+
entry: menuItemsCatalog,
|
|
3873
|
+
folder: "Menu",
|
|
3874
|
+
family: "Menu"
|
|
3875
|
+
},
|
|
3876
|
+
MenuList: {
|
|
3877
|
+
entry: menuListCatalog,
|
|
3878
|
+
folder: "Menu",
|
|
3879
|
+
family: "Menu"
|
|
3880
|
+
},
|
|
3881
|
+
Modal: {
|
|
3882
|
+
entry: modalCatalog,
|
|
3883
|
+
folder: "Modal"
|
|
3884
|
+
},
|
|
3885
|
+
NativeSelect: {
|
|
3886
|
+
entry: nativeSelectCatalog,
|
|
3887
|
+
folder: "NativeSelect"
|
|
3888
|
+
},
|
|
3889
|
+
Pagination: {
|
|
3890
|
+
entry: paginationCatalog,
|
|
3891
|
+
folder: "Pagination"
|
|
3892
|
+
},
|
|
3893
|
+
PaginationItem: {
|
|
3894
|
+
entry: paginationItemCatalog,
|
|
3895
|
+
folder: "Pagination",
|
|
3896
|
+
family: "Pagination"
|
|
3897
|
+
},
|
|
3898
|
+
Paper: {
|
|
3899
|
+
entry: paperCatalog,
|
|
3900
|
+
folder: "Paper"
|
|
3901
|
+
},
|
|
3902
|
+
Popover: {
|
|
3903
|
+
entry: popoverCatalog,
|
|
3904
|
+
folder: "Popover"
|
|
3905
|
+
},
|
|
3906
|
+
Portal: {
|
|
3907
|
+
entry: portalCatalog,
|
|
3908
|
+
folder: "Portal"
|
|
3909
|
+
},
|
|
3910
|
+
Pressable: {
|
|
3911
|
+
entry: pressableCatalog,
|
|
3912
|
+
folder: "Pressable"
|
|
3913
|
+
},
|
|
3914
|
+
Quote: {
|
|
3915
|
+
entry: quoteCatalog,
|
|
3916
|
+
folder: "Quote"
|
|
3917
|
+
},
|
|
3918
|
+
Radio: {
|
|
3919
|
+
entry: radioCatalog,
|
|
3920
|
+
folder: "Radio"
|
|
3921
|
+
},
|
|
3922
|
+
Select: {
|
|
3923
|
+
entry: selectCatalog,
|
|
3924
|
+
folder: "Select"
|
|
3925
|
+
},
|
|
3926
|
+
Sidebar: {
|
|
3927
|
+
entry: sidebarCatalog,
|
|
3928
|
+
folder: "Sidebar"
|
|
3929
|
+
},
|
|
3930
|
+
SidebarItem: {
|
|
3931
|
+
entry: sidebarItemCatalog,
|
|
3932
|
+
folder: "Sidebar",
|
|
3933
|
+
family: "Sidebar"
|
|
3934
|
+
},
|
|
3935
|
+
Skeleton: {
|
|
3936
|
+
entry: skeletonCatalog,
|
|
3937
|
+
folder: "Skeleton"
|
|
3938
|
+
},
|
|
3939
|
+
Switch: {
|
|
3940
|
+
entry: switchCatalog,
|
|
3941
|
+
folder: "Switch"
|
|
3942
|
+
},
|
|
3943
|
+
Tab: {
|
|
3944
|
+
entry: tabCatalog,
|
|
3945
|
+
folder: "Tabs",
|
|
3946
|
+
family: "Tabs"
|
|
3947
|
+
},
|
|
3948
|
+
TabPanel: {
|
|
3949
|
+
entry: tabPanelCatalog,
|
|
3950
|
+
folder: "Tabs",
|
|
3951
|
+
family: "Tabs"
|
|
3952
|
+
},
|
|
3953
|
+
Tabs: {
|
|
3954
|
+
entry: tabsCatalog,
|
|
3955
|
+
folder: "Tabs"
|
|
3956
|
+
},
|
|
3957
|
+
TabContext: {
|
|
3958
|
+
entry: tabContextCatalog,
|
|
3959
|
+
folder: "Tabs",
|
|
3960
|
+
family: "Tabs"
|
|
3961
|
+
},
|
|
3962
|
+
TabList: {
|
|
3963
|
+
entry: tabListCatalog,
|
|
3964
|
+
folder: "Tabs",
|
|
3965
|
+
family: "Tabs"
|
|
3966
|
+
},
|
|
3967
|
+
TabScrollButton: {
|
|
3968
|
+
entry: tabScrollButtonCatalog,
|
|
3969
|
+
folder: "Tabs",
|
|
3970
|
+
family: "Tabs"
|
|
3971
|
+
},
|
|
3972
|
+
Table: {
|
|
3973
|
+
entry: tableCatalog,
|
|
3974
|
+
folder: "Table"
|
|
3975
|
+
},
|
|
3976
|
+
TableBody: {
|
|
3977
|
+
entry: tableBodyCatalog,
|
|
3978
|
+
folder: "Table",
|
|
3979
|
+
family: "Table"
|
|
3980
|
+
},
|
|
3981
|
+
TableCell: {
|
|
3982
|
+
entry: tableCellCatalog,
|
|
3983
|
+
folder: "Table",
|
|
3984
|
+
family: "Table"
|
|
3985
|
+
},
|
|
3986
|
+
TableContainer: {
|
|
3987
|
+
entry: tableContainerCatalog,
|
|
3988
|
+
folder: "Table",
|
|
3989
|
+
family: "Table"
|
|
3990
|
+
},
|
|
3991
|
+
TableControl: {
|
|
3992
|
+
entry: tableControlCatalog,
|
|
3993
|
+
folder: "Table",
|
|
3994
|
+
family: "Table"
|
|
3995
|
+
},
|
|
3996
|
+
TableFooter: {
|
|
3997
|
+
entry: tableFooterCatalog,
|
|
3998
|
+
folder: "Table",
|
|
3999
|
+
family: "Table"
|
|
4000
|
+
},
|
|
4001
|
+
TableHead: {
|
|
4002
|
+
entry: tableHeadCatalog,
|
|
4003
|
+
folder: "Table",
|
|
4004
|
+
family: "Table"
|
|
4005
|
+
},
|
|
4006
|
+
TablePagination: {
|
|
4007
|
+
entry: tablePaginationCatalog,
|
|
4008
|
+
folder: "Table",
|
|
4009
|
+
family: "Table"
|
|
4010
|
+
},
|
|
4011
|
+
TablePaginationActions: {
|
|
4012
|
+
entry: tablePaginationActionsCatalog,
|
|
4013
|
+
folder: "Table",
|
|
4014
|
+
family: "Table"
|
|
4015
|
+
},
|
|
4016
|
+
TableRow: {
|
|
4017
|
+
entry: tableRowCatalog,
|
|
4018
|
+
folder: "Table",
|
|
4019
|
+
family: "Table"
|
|
4020
|
+
},
|
|
4021
|
+
TableSortLabel: {
|
|
4022
|
+
entry: tableSortLabelCatalog,
|
|
4023
|
+
folder: "Table",
|
|
4024
|
+
family: "Table"
|
|
4025
|
+
},
|
|
4026
|
+
TextInput: {
|
|
4027
|
+
entry: textInputCatalog,
|
|
4028
|
+
folder: "TextInput"
|
|
4029
|
+
},
|
|
4030
|
+
ToggleButton: {
|
|
4031
|
+
entry: toggleButtonCatalog,
|
|
4032
|
+
folder: "ToggleButton"
|
|
4033
|
+
},
|
|
4034
|
+
ToggleButtonGroup: {
|
|
4035
|
+
entry: toggleButtonGroupCatalog,
|
|
4036
|
+
folder: "ToggleButton",
|
|
4037
|
+
family: "ToggleButton"
|
|
4038
|
+
},
|
|
4039
|
+
Typography: {
|
|
4040
|
+
entry: typographyCatalog,
|
|
4041
|
+
folder: "Typography"
|
|
4042
|
+
},
|
|
4043
|
+
View: {
|
|
4044
|
+
entry: viewCatalog,
|
|
4045
|
+
folder: "View"
|
|
4046
|
+
}
|
|
4047
|
+
};
|
|
4048
|
+
//#endregion
|
|
4049
|
+
//#region src/catalog/styleScales.ts
|
|
4050
|
+
const DESIGN_SYSTEM_SCALES = {
|
|
4051
|
+
color: "text",
|
|
4052
|
+
bg: "background",
|
|
4053
|
+
backgroundColor: "background",
|
|
4054
|
+
borderColor: "border"
|
|
4055
|
+
};
|
|
4056
|
+
const parsers = [
|
|
4057
|
+
space,
|
|
4058
|
+
layout,
|
|
4059
|
+
typography,
|
|
4060
|
+
color,
|
|
4061
|
+
border,
|
|
4062
|
+
flexbox,
|
|
4063
|
+
position,
|
|
4064
|
+
background,
|
|
4065
|
+
shadow,
|
|
4066
|
+
grid
|
|
4067
|
+
];
|
|
4068
|
+
/**
|
|
4069
|
+
* Each styled-system prop that resolves against a theme scale, and that scale - read from
|
|
4070
|
+
* the parsers' own configs, so it can't drift from what the props do. A parser's scale the
|
|
4071
|
+
* theme doesn't have (`display`, `overflow`) is left out: there are no values to offer.
|
|
4072
|
+
*/
|
|
4073
|
+
function readStyleScales() {
|
|
4074
|
+
const scales = {};
|
|
4075
|
+
for (const parser of parsers) for (const [prop, config] of Object.entries(parser.config)) {
|
|
4076
|
+
const { scale } = config;
|
|
4077
|
+
if (scale && scale in baseTheme) scales[prop] = scale;
|
|
4078
|
+
}
|
|
4079
|
+
return {
|
|
4080
|
+
...scales,
|
|
4081
|
+
...DESIGN_SYSTEM_SCALES
|
|
4082
|
+
};
|
|
4083
|
+
}
|
|
4084
|
+
//#endregion
|
|
4085
|
+
//#region src/catalog/index.ts
|
|
4086
|
+
const designSystemCategories = componentCategories.map((category) => ({
|
|
4087
|
+
label: category.label,
|
|
4088
|
+
components: category.items.filter((item) => item.pkg === "design-system").map((item) => item.name)
|
|
4089
|
+
}));
|
|
4090
|
+
const categoryOf = (name) => designSystemCategories.find((category) => category.components.includes(name)).label;
|
|
4091
|
+
const components = Object.fromEntries(Object.entries(catalogSources).map(([name, { entry, folder, family }]) => [name, {
|
|
4092
|
+
...entry,
|
|
4093
|
+
name,
|
|
4094
|
+
module: `@soroush.tech/design-system/${folder}`,
|
|
4095
|
+
category: categoryOf(family ?? name)
|
|
4096
|
+
}]));
|
|
4097
|
+
/**
|
|
4098
|
+
* @description Every component of the design system as data a tool can read - its
|
|
4099
|
+
* category, where it is imported from, what a freshly placed one is, its looks as
|
|
4100
|
+
* pictures, the props a picker offers and their theme scales, and how its node props and
|
|
4101
|
+
* two-way props are written. Pure data: it loads in Node with no DOM, React or Emotion.
|
|
4102
|
+
*/
|
|
4103
|
+
const catalog = {
|
|
4104
|
+
categories: designSystemCategories,
|
|
4105
|
+
styleScales: readStyleScales(),
|
|
4106
|
+
components
|
|
4107
|
+
};
|
|
4108
|
+
//#endregion
|
|
4109
|
+
export { catalog };
|