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