@soroush.tech/design-system 2.0.0-rc.1 → 2.0.0-rc.3

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