@soroush.tech/design-system 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +278 -0
  3. package/dist/AppBar.cjs +71 -0
  4. package/dist/AppBar.d.cts +23 -0
  5. package/dist/AppBar.d.mts +23 -0
  6. package/dist/AppBar.mjs +69 -0
  7. package/dist/Avatar.cjs +106 -0
  8. package/dist/Avatar.d.cts +28 -0
  9. package/dist/Avatar.d.mts +28 -0
  10. package/dist/Avatar.mjs +103 -0
  11. package/dist/Backdrop.cjs +26 -0
  12. package/dist/Backdrop.d.cts +10 -0
  13. package/dist/Backdrop.d.mts +10 -0
  14. package/dist/Backdrop.mjs +25 -0
  15. package/dist/Button.cjs +178 -0
  16. package/dist/Button.d.cts +2 -0
  17. package/dist/Button.d.mts +2 -0
  18. package/dist/Button.mjs +175 -0
  19. package/dist/ButtonGroup.cjs +110 -0
  20. package/dist/ButtonGroup.d.cts +2 -0
  21. package/dist/ButtonGroup.d.mts +2 -0
  22. package/dist/ButtonGroup.mjs +107 -0
  23. package/dist/ButtonGroupContext-DS-kl9lG.mjs +5 -0
  24. package/dist/ButtonGroupContext-NtkVeDVE.cjs +9 -0
  25. package/dist/Card.cjs +95 -0
  26. package/dist/Card.d.cts +18 -0
  27. package/dist/Card.d.mts +18 -0
  28. package/dist/Card.mjs +93 -0
  29. package/dist/Checkbox.cjs +192 -0
  30. package/dist/Checkbox.d.cts +2 -0
  31. package/dist/Checkbox.d.mts +2 -0
  32. package/dist/Checkbox.mjs +190 -0
  33. package/dist/CircularProgress.cjs +136 -0
  34. package/dist/CircularProgress.d.cts +34 -0
  35. package/dist/CircularProgress.d.mts +34 -0
  36. package/dist/CircularProgress.mjs +133 -0
  37. package/dist/CodeBlock.cjs +101 -0
  38. package/dist/CodeBlock.d.cts +2 -0
  39. package/dist/CodeBlock.d.mts +2 -0
  40. package/dist/CodeBlock.mjs +100 -0
  41. package/dist/Drawer.cjs +69 -0
  42. package/dist/Drawer.d.cts +22 -0
  43. package/dist/Drawer.d.mts +22 -0
  44. package/dist/Drawer.mjs +66 -0
  45. package/dist/Field.cjs +59 -0
  46. package/dist/Field.d.cts +36 -0
  47. package/dist/Field.d.mts +36 -0
  48. package/dist/Field.mjs +58 -0
  49. package/dist/Flex.cjs +21 -0
  50. package/dist/Flex.d.cts +2 -0
  51. package/dist/Flex.d.mts +2 -0
  52. package/dist/Flex.mjs +19 -0
  53. package/dist/FocusTrap.cjs +82 -0
  54. package/dist/FocusTrap.d.cts +24 -0
  55. package/dist/FocusTrap.d.mts +24 -0
  56. package/dist/FocusTrap.mjs +81 -0
  57. package/dist/Form.cjs +44 -0
  58. package/dist/Form.d.cts +41 -0
  59. package/dist/Form.d.mts +41 -0
  60. package/dist/Form.mjs +42 -0
  61. package/dist/FormContext-CRmRgDgu.cjs +10 -0
  62. package/dist/FormContext-_G3sxJyQ.mjs +6 -0
  63. package/dist/FormControl.cjs +84 -0
  64. package/dist/FormControl.d.cts +78 -0
  65. package/dist/FormControl.d.mts +78 -0
  66. package/dist/FormControl.mjs +81 -0
  67. package/dist/FormControlContext-CyxdOxdN.mjs +6 -0
  68. package/dist/FormControlContext-aeKTjRKY.cjs +10 -0
  69. package/dist/FormHelperText.cjs +40 -0
  70. package/dist/FormHelperText.d.cts +16 -0
  71. package/dist/FormHelperText.d.mts +16 -0
  72. package/dist/FormHelperText.mjs +39 -0
  73. package/dist/FormLabel.cjs +34 -0
  74. package/dist/FormLabel.d.cts +2 -0
  75. package/dist/FormLabel.d.mts +2 -0
  76. package/dist/FormLabel.mjs +33 -0
  77. package/dist/Grid.cjs +37 -0
  78. package/dist/Grid.d.cts +21 -0
  79. package/dist/Grid.d.mts +21 -0
  80. package/dist/Grid.mjs +32 -0
  81. package/dist/Icon-1YtNCUKo.cjs +755 -0
  82. package/dist/Icon-CAKRmFz3.mjs +742 -0
  83. package/dist/Icon.cjs +4 -0
  84. package/dist/Icon.d.cts +2 -0
  85. package/dist/Icon.d.mts +2 -0
  86. package/dist/Icon.mjs +2 -0
  87. package/dist/Image.cjs +82 -0
  88. package/dist/Image.d.cts +2 -0
  89. package/dist/Image.d.mts +2 -0
  90. package/dist/Image.mjs +80 -0
  91. package/dist/LinearProgress.cjs +217 -0
  92. package/dist/LinearProgress.d.cts +36 -0
  93. package/dist/LinearProgress.d.mts +36 -0
  94. package/dist/LinearProgress.mjs +214 -0
  95. package/dist/Link.cjs +64 -0
  96. package/dist/Link.d.cts +2 -0
  97. package/dist/Link.d.mts +2 -0
  98. package/dist/Link.mjs +62 -0
  99. package/dist/Markdown/Control.cjs +61 -0
  100. package/dist/Markdown/Control.d.cts +18 -0
  101. package/dist/Markdown/Control.d.mts +18 -0
  102. package/dist/Markdown/Control.mjs +60 -0
  103. package/dist/Markdown/Editor.cjs +130 -0
  104. package/dist/Markdown/Editor.d.cts +40 -0
  105. package/dist/Markdown/Editor.d.mts +40 -0
  106. package/dist/Markdown/Editor.mjs +128 -0
  107. package/dist/Markdown/Preview.cjs +241 -0
  108. package/dist/Markdown/Preview.d.cts +55 -0
  109. package/dist/Markdown/Preview.d.mts +55 -0
  110. package/dist/Markdown/Preview.mjs +236 -0
  111. package/dist/Markdown/Toolbar.cjs +4 -0
  112. package/dist/Markdown/Toolbar.d.cts +13 -0
  113. package/dist/Markdown/Toolbar.d.mts +13 -0
  114. package/dist/Markdown/Toolbar.mjs +2 -0
  115. package/dist/Markdown.cjs +13 -0
  116. package/dist/Markdown.d.cts +80 -0
  117. package/dist/Markdown.d.mts +80 -0
  118. package/dist/Markdown.mjs +6 -0
  119. package/dist/MarkdownContext-BN8A3W-J.mjs +11 -0
  120. package/dist/MarkdownContext-DSwjzpH8.cjs +22 -0
  121. package/dist/MenuItem.cjs +150 -0
  122. package/dist/MenuItem.d.cts +51 -0
  123. package/dist/MenuItem.d.mts +51 -0
  124. package/dist/MenuItem.mjs +147 -0
  125. package/dist/Modal-BDMPTSXv.cjs +351 -0
  126. package/dist/Modal-DR60peRg.mjs +327 -0
  127. package/dist/Modal.cjs +6 -0
  128. package/dist/Modal.d.cts +2 -0
  129. package/dist/Modal.d.mts +2 -0
  130. package/dist/Modal.mjs +2 -0
  131. package/dist/NativeSelect.cjs +189 -0
  132. package/dist/NativeSelect.d.cts +62 -0
  133. package/dist/NativeSelect.d.mts +62 -0
  134. package/dist/NativeSelect.mjs +186 -0
  135. package/dist/Pagination/PaginationItem.cjs +116 -0
  136. package/dist/Pagination/PaginationItem.d.cts +2 -0
  137. package/dist/Pagination/PaginationItem.d.mts +2 -0
  138. package/dist/Pagination/PaginationItem.mjs +114 -0
  139. package/dist/Pagination.cjs +134 -0
  140. package/dist/Pagination.d.cts +23 -0
  141. package/dist/Pagination.d.mts +23 -0
  142. package/dist/Pagination.mjs +130 -0
  143. package/dist/Paper.cjs +51 -0
  144. package/dist/Paper.d.cts +2 -0
  145. package/dist/Paper.d.mts +2 -0
  146. package/dist/Paper.mjs +48 -0
  147. package/dist/Popover-B61J7C79.mjs +252 -0
  148. package/dist/Popover-CRDLmywF.cjs +259 -0
  149. package/dist/Popover.cjs +3 -0
  150. package/dist/Popover.d.cts +84 -0
  151. package/dist/Popover.d.mts +84 -0
  152. package/dist/Popover.mjs +2 -0
  153. package/dist/Portal.cjs +20 -0
  154. package/dist/Portal.d.cts +18 -0
  155. package/dist/Portal.d.mts +18 -0
  156. package/dist/Portal.mjs +19 -0
  157. package/dist/Quote.cjs +11 -0
  158. package/dist/Quote.d.cts +2 -0
  159. package/dist/Quote.d.mts +2 -0
  160. package/dist/Quote.mjs +10 -0
  161. package/dist/Radio.cjs +143 -0
  162. package/dist/Radio.d.cts +38 -0
  163. package/dist/Radio.d.mts +38 -0
  164. package/dist/Radio.mjs +141 -0
  165. package/dist/Select.cjs +528 -0
  166. package/dist/Select.d.cts +68 -0
  167. package/dist/Select.d.mts +68 -0
  168. package/dist/Select.mjs +525 -0
  169. package/dist/Skeleton.cjs +82 -0
  170. package/dist/Skeleton.d.cts +21 -0
  171. package/dist/Skeleton.d.mts +21 -0
  172. package/dist/Skeleton.mjs +79 -0
  173. package/dist/Switch.cjs +332 -0
  174. package/dist/Switch.d.cts +40 -0
  175. package/dist/Switch.d.mts +40 -0
  176. package/dist/Switch.mjs +329 -0
  177. package/dist/Table/Table.cjs +65 -0
  178. package/dist/Table/Table.d.cts +2 -0
  179. package/dist/Table/Table.d.mts +2 -0
  180. package/dist/Table/Table.mjs +63 -0
  181. package/dist/Table/TableBody.cjs +42 -0
  182. package/dist/Table/TableBody.d.cts +2 -0
  183. package/dist/Table/TableBody.d.mts +2 -0
  184. package/dist/Table/TableBody.mjs +40 -0
  185. package/dist/Table/TableCell.cjs +93 -0
  186. package/dist/Table/TableCell.d.cts +2 -0
  187. package/dist/Table/TableCell.d.mts +2 -0
  188. package/dist/Table/TableCell.mjs +91 -0
  189. package/dist/Table/TableContainer.cjs +15 -0
  190. package/dist/Table/TableContainer.d.cts +2 -0
  191. package/dist/Table/TableContainer.d.mts +2 -0
  192. package/dist/Table/TableContainer.mjs +14 -0
  193. package/dist/Table/TableControl.cjs +42 -0
  194. package/dist/Table/TableControl.d.cts +2 -0
  195. package/dist/Table/TableControl.d.mts +2 -0
  196. package/dist/Table/TableControl.mjs +41 -0
  197. package/dist/Table/TableFooter.cjs +42 -0
  198. package/dist/Table/TableFooter.d.cts +2 -0
  199. package/dist/Table/TableFooter.d.mts +2 -0
  200. package/dist/Table/TableFooter.mjs +40 -0
  201. package/dist/Table/TableHead.cjs +42 -0
  202. package/dist/Table/TableHead.d.cts +2 -0
  203. package/dist/Table/TableHead.d.mts +2 -0
  204. package/dist/Table/TableHead.mjs +40 -0
  205. package/dist/Table/TablePagination.cjs +89 -0
  206. package/dist/Table/TablePagination.d.cts +2 -0
  207. package/dist/Table/TablePagination.d.mts +2 -0
  208. package/dist/Table/TablePagination.mjs +88 -0
  209. package/dist/Table/TablePaginationActions.cjs +65 -0
  210. package/dist/Table/TablePaginationActions.d.cts +2 -0
  211. package/dist/Table/TablePaginationActions.d.mts +2 -0
  212. package/dist/Table/TablePaginationActions.mjs +63 -0
  213. package/dist/Table/TableRow.cjs +56 -0
  214. package/dist/Table/TableRow.d.cts +2 -0
  215. package/dist/Table/TableRow.d.mts +2 -0
  216. package/dist/Table/TableRow.mjs +54 -0
  217. package/dist/Table/TableSortLabel.cjs +62 -0
  218. package/dist/Table/TableSortLabel.d.cts +2 -0
  219. package/dist/Table/TableSortLabel.d.mts +2 -0
  220. package/dist/Table/TableSortLabel.mjs +60 -0
  221. package/dist/Table/hooks.cjs +112 -0
  222. package/dist/Table/hooks.d.cts +3 -0
  223. package/dist/Table/hooks.d.mts +3 -0
  224. package/dist/Table/hooks.mjs +109 -0
  225. package/dist/Table.cjs +31 -0
  226. package/dist/Table.d.cts +16 -0
  227. package/dist/Table.d.mts +16 -0
  228. package/dist/Table.mjs +15 -0
  229. package/dist/TableContext-2qH7XYJB.d.cts +19 -0
  230. package/dist/TableContext-2qH7XYJB.d.mts +19 -0
  231. package/dist/TableContext-BRWPghAI.mjs +6 -0
  232. package/dist/TableContext-qqp35o8z.cjs +10 -0
  233. package/dist/TableSectionContext-meIG4lFZ.mjs +5 -0
  234. package/dist/TableSectionContext-pYlJ-duI.cjs +9 -0
  235. package/dist/TextInput-6o37Zddp.cjs +231 -0
  236. package/dist/TextInput-D_lHYJlL.mjs +224 -0
  237. package/dist/TextInput.cjs +3 -0
  238. package/dist/TextInput.d.cts +2 -0
  239. package/dist/TextInput.d.mts +2 -0
  240. package/dist/TextInput.mjs +2 -0
  241. package/dist/ThemeProvider.cjs +15 -0
  242. package/dist/ThemeProvider.d.cts +20 -0
  243. package/dist/ThemeProvider.d.mts +20 -0
  244. package/dist/ThemeProvider.mjs +14 -0
  245. package/dist/ToggleButton/ToggleButton.cjs +58 -0
  246. package/dist/ToggleButton/ToggleButton.d.cts +14 -0
  247. package/dist/ToggleButton/ToggleButton.d.mts +14 -0
  248. package/dist/ToggleButton/ToggleButton.mjs +56 -0
  249. package/dist/ToggleButton/ToggleButtonGroup.cjs +54 -0
  250. package/dist/ToggleButton/ToggleButtonGroup.d.cts +23 -0
  251. package/dist/ToggleButton/ToggleButtonGroup.d.mts +23 -0
  252. package/dist/ToggleButton/ToggleButtonGroup.mjs +52 -0
  253. package/dist/ToggleButton.cjs +7 -0
  254. package/dist/ToggleButton.d.cts +4 -0
  255. package/dist/ToggleButton.d.mts +4 -0
  256. package/dist/ToggleButton.mjs +4 -0
  257. package/dist/ToggleButtonGroupContext-CqD-Afho.d.cts +15 -0
  258. package/dist/ToggleButtonGroupContext-CqD-Afho.d.mts +15 -0
  259. package/dist/ToggleButtonGroupContext-DxIyy8ze.mjs +5 -0
  260. package/dist/ToggleButtonGroupContext-Ewc5Ixas.cjs +9 -0
  261. package/dist/Toolbar-B-W22Sk4.cjs +459 -0
  262. package/dist/Toolbar-KbR97iJS.mjs +448 -0
  263. package/dist/Typography.cjs +64 -0
  264. package/dist/Typography.d.cts +3 -0
  265. package/dist/Typography.d.mts +3 -0
  266. package/dist/Typography.mjs +61 -0
  267. package/dist/View.cjs +40 -0
  268. package/dist/View.d.cts +2 -0
  269. package/dist/View.d.mts +2 -0
  270. package/dist/View.mjs +38 -0
  271. package/dist/applyAction-B2B-hnP3.mjs +98 -0
  272. package/dist/applyAction-B2uVHxOE.cjs +103 -0
  273. package/dist/createTheme-Dts2F4R_.d.cts +21 -0
  274. package/dist/createTheme-Dts2F4R_.d.mts +21 -0
  275. package/dist/hooks/useCopyToClipboard.cjs +33 -0
  276. package/dist/hooks/useCopyToClipboard.d.cts +16 -0
  277. package/dist/hooks/useCopyToClipboard.d.mts +16 -0
  278. package/dist/hooks/useCopyToClipboard.mjs +31 -0
  279. package/dist/hooks.cjs +52 -0
  280. package/dist/hooks.d.cts +40 -0
  281. package/dist/hooks.d.mts +40 -0
  282. package/dist/hooks.mjs +41 -0
  283. package/dist/index-4rC2j7fR.d.cts +46 -0
  284. package/dist/index-8dzWTpFp.d.cts +24 -0
  285. package/dist/index-B1rCD6Oo.d.cts +17 -0
  286. package/dist/index-BH8jQOdF.d.mts +46 -0
  287. package/dist/index-BLRMuO_x.d.mts +24 -0
  288. package/dist/index-BLfFycfJ.d.mts +72 -0
  289. package/dist/index-BPrjvi7B.d.cts +13 -0
  290. package/dist/index-BX5-NfbX.d.cts +94 -0
  291. package/dist/index-Bihpwn75.d.cts +64 -0
  292. package/dist/index-BlfIbAMs.d.cts +45 -0
  293. package/dist/index-BnzUumAC2.d.mts +30 -0
  294. package/dist/index-BoqlPb3Z.d.mts +13 -0
  295. package/dist/index-BqVgv2B_.d.mts +42 -0
  296. package/dist/index-Bwi4kRpf.d.mts +79 -0
  297. package/dist/index-Bx24ZnOV.d.mts +43 -0
  298. package/dist/index-C-P_hipv.d.mts +21 -0
  299. package/dist/index-C0xMvDjL.d.mts +49 -0
  300. package/dist/index-C5_ciaeo.d.cts +79 -0
  301. package/dist/index-CDVnvjIE.d.cts +27 -0
  302. package/dist/index-CDcGTGR4.d.cts +21 -0
  303. package/dist/index-CEOZI-6L.d.mts +48 -0
  304. package/dist/index-CLU39rUS2.d.mts +30 -0
  305. package/dist/index-CM_KCTee.d.cts +48 -0
  306. package/dist/index-CT9uGKrs.d.cts +30 -0
  307. package/dist/index-CcYSvIJi.d.cts +21 -0
  308. package/dist/index-CdF_4ckE.d.mts +11 -0
  309. package/dist/index-CeYkEXU2.d.cts +68 -0
  310. package/dist/index-Cl_yBpzW2.d.mts +13 -0
  311. package/dist/index-Cv_UOfYx.d.mts +18 -0
  312. package/dist/index-CxSNNzBT2.d.mts +68 -0
  313. package/dist/index-CyZYXDn0.d.cts +42 -0
  314. package/dist/index-DASvoACZ.d.cts +49 -0
  315. package/dist/index-DBGE6yKw.d.mts +16 -0
  316. package/dist/index-DCQ2fsDu.d.mts +40 -0
  317. package/dist/index-DD2AVtiR.d.cts +16 -0
  318. package/dist/index-DE5PtzPn.d.mts +27 -0
  319. package/dist/index-DOPXpr2J.d.cts +43 -0
  320. package/dist/index-DSCMXFTn.d.cts +30 -0
  321. package/dist/index-DTkQSXQD.d.cts +11 -0
  322. package/dist/index-DeJWkpf9.d.cts +16 -0
  323. package/dist/index-DeiZHSwA.d.cts +12 -0
  324. package/dist/index-Des8BisQ.d.mts +12 -0
  325. package/dist/index-Dg8-CPOO.d.cts +18 -0
  326. package/dist/index-DgRS5Aqv.d.mts +16 -0
  327. package/dist/index-Dm9HfgV6.d.mts +63 -0
  328. package/dist/index-DmJIuQJj.d.mts +24 -0
  329. package/dist/index-Dp81rWM1.d.cts +72 -0
  330. package/dist/index-Dtzj8X58.d.cts +40 -0
  331. package/dist/index-DvW2eETV.d.mts +21 -0
  332. package/dist/index-Dy03o__A.d.mts +94 -0
  333. package/dist/index-FwTocqhP.d.cts +34 -0
  334. package/dist/index-GVsFY00r.d.cts +21 -0
  335. package/dist/index-Nqco3fsM.d.cts +13 -0
  336. package/dist/index-g-9DZ_KQ.d.cts +28 -0
  337. package/dist/index-g9EThkSg.d.mts +21 -0
  338. package/dist/index-kpk9e3xM2.d.mts +45 -0
  339. package/dist/index-pX7tBQdJ.d.mts +34 -0
  340. package/dist/index-u57CbuAU2.d.mts +28 -0
  341. package/dist/index-x80UG39F.d.cts +24 -0
  342. package/dist/index-z35LEYG8.d.mts +17 -0
  343. package/dist/index.cjs +68 -0
  344. package/dist/index.d.cts +4 -0
  345. package/dist/index.d.mts +4 -0
  346. package/dist/index.mjs +3 -0
  347. package/dist/inputVariantStyles-BBkkYQtE.cjs +32 -0
  348. package/dist/inputVariantStyles-CcqpGfuP.mjs +28 -0
  349. package/dist/rolldown-runtime-BBjsoOtd.mjs +27 -0
  350. package/dist/rolldown-runtime-DDXJien1.cjs +50 -0
  351. package/dist/src-BiocWFSR.cjs +60 -0
  352. package/dist/src-DcNT2aIK.mjs +49 -0
  353. package/dist/themeDefault-B-QjpGEO.cjs +16 -0
  354. package/dist/themeDefault-CjXaY3ok.mjs +11 -0
  355. package/dist/themes-D1SAp3SL.d.mts +500 -0
  356. package/dist/themes-D81JYbqm.d.cts +500 -0
  357. package/dist/themes.cjs +318 -0
  358. package/dist/themes.d.cts +3 -0
  359. package/dist/themes.d.mts +3 -0
  360. package/dist/themes.mjs +303 -0
  361. package/dist/useDefaultProps-Cb-5FNok.cjs +19 -0
  362. package/dist/useDefaultProps-CoApb4KT.mjs +14 -0
  363. package/dist/useTableSort--XMWjujs.d.cts +51 -0
  364. package/dist/useTableSort-CpDs4cGq.d.mts +51 -0
  365. package/dist/utils/styleCache.cjs +7 -0
  366. package/dist/utils/styleCache.d.cts +3 -0
  367. package/dist/utils/styleCache.d.mts +4 -0
  368. package/dist/utils/styleCache.mjs +5 -0
  369. package/dist/utils.cjs +65 -0
  370. package/dist/utils.d.cts +39 -0
  371. package/dist/utils.d.mts +39 -0
  372. package/dist/utils.mjs +58 -0
  373. package/package.json +125 -0
@@ -0,0 +1,51 @@
1
+ import { o as Theme } from "./index-Bihpwn75.cjs";
2
+ import { ElementType, ReactNode } from "react";
3
+ //#region src/MenuItem/MenuItem.d.ts
4
+ type MenuItemColor = keyof Theme['palette'];
5
+ type MenuItemSize = keyof Theme['sizes'];
6
+ type MenuItemTextColor = keyof Theme['text'];
7
+ interface MenuItemProps {
8
+ /** The value this option represents — reported to `Select`'s `onChange`. */
9
+ value: string | number;
10
+ /** The option label. */
11
+ children: ReactNode;
12
+ /** The element used for the root node — a tag name or a component. Default: `'li'`. */
13
+ as?: ElementType;
14
+ /** Disables the option — it cannot be highlighted or selected. */
15
+ disabled?: boolean;
16
+ /** Marks the option as the current selection. Injected by `Select`. */
17
+ selected?: boolean;
18
+ /** Marks the option as the keyboard-highlighted row. Injected by `Select`. */
19
+ highlighted?: boolean;
20
+ /** Reserves a leading checkmark slot for multi-select menus. Injected by `Select`. */
21
+ multiple?: boolean;
22
+ /** Accent color — resolves to `theme.palette[color]`. Injected by `Select`; the item's own value wins. Default: 'primary', overridable via `theme.defaults.color`. */
23
+ color?: MenuItemColor;
24
+ /** Base text color of the row — resolves against `theme.text`. When unset, falls back to the accent color's `main`. Injected by `Select`; the item's own value wins. */
25
+ textColor?: MenuItemTextColor;
26
+ /** Density token — resolves against `theme.sizes`. Injected by `Select`. Default: 'md', overridable via `theme.defaults.size`. */
27
+ size?: MenuItemSize;
28
+ /** Compact vertical padding, independent of `size`. Default: `false`. */
29
+ dense?: boolean;
30
+ /** Remove the left and right padding. Default: `false`. */
31
+ disableGutters?: boolean;
32
+ /** Add a 1px bottom border to separate the row. Default: `false`. */
33
+ divider?: boolean;
34
+ /** Focus the row on first mount, and whenever `autoFocus` flips from `false` to `true`. Default: `false`. */
35
+ autoFocus?: boolean;
36
+ /** Class applied only while the row has keyboard focus — a `:focus-visible` hook. */
37
+ focusVisibleClassName?: string;
38
+ /** Fired with `value` when the option is chosen. Injected by `Select`. */
39
+ onSelect?: (value: string | number) => void;
40
+ id?: string;
41
+ className?: string;
42
+ 'data-testid'?: string;
43
+ }
44
+ /**
45
+ * @description A single option row for `Select`'s listbox. Rendered as a semantic
46
+ * `<li role="option">` (override via `as`). Selection/highlight/density props are
47
+ * injected by `Select`; used on its own it renders a static, styled row.
48
+ */
49
+ declare function MenuItem({ value, children, as, disabled, selected, highlighted, multiple, color: colorProp, textColor, size: sizeProp, dense, disableGutters, divider, autoFocus, focusVisibleClassName, onSelect, id, className, 'data-testid': dataTestid }: Readonly<MenuItemProps>): import("react").JSX.Element;
50
+ //#endregion
51
+ export { MenuItem, MenuItemColor, MenuItemProps, MenuItemSize, MenuItemTextColor };
@@ -0,0 +1,51 @@
1
+ import { o as Theme } from "./index-Dm9HfgV6.mjs";
2
+ import { ElementType, ReactNode } from "react";
3
+ //#region src/MenuItem/MenuItem.d.ts
4
+ type MenuItemColor = keyof Theme['palette'];
5
+ type MenuItemSize = keyof Theme['sizes'];
6
+ type MenuItemTextColor = keyof Theme['text'];
7
+ interface MenuItemProps {
8
+ /** The value this option represents — reported to `Select`'s `onChange`. */
9
+ value: string | number;
10
+ /** The option label. */
11
+ children: ReactNode;
12
+ /** The element used for the root node — a tag name or a component. Default: `'li'`. */
13
+ as?: ElementType;
14
+ /** Disables the option — it cannot be highlighted or selected. */
15
+ disabled?: boolean;
16
+ /** Marks the option as the current selection. Injected by `Select`. */
17
+ selected?: boolean;
18
+ /** Marks the option as the keyboard-highlighted row. Injected by `Select`. */
19
+ highlighted?: boolean;
20
+ /** Reserves a leading checkmark slot for multi-select menus. Injected by `Select`. */
21
+ multiple?: boolean;
22
+ /** Accent color — resolves to `theme.palette[color]`. Injected by `Select`; the item's own value wins. Default: 'primary', overridable via `theme.defaults.color`. */
23
+ color?: MenuItemColor;
24
+ /** Base text color of the row — resolves against `theme.text`. When unset, falls back to the accent color's `main`. Injected by `Select`; the item's own value wins. */
25
+ textColor?: MenuItemTextColor;
26
+ /** Density token — resolves against `theme.sizes`. Injected by `Select`. Default: 'md', overridable via `theme.defaults.size`. */
27
+ size?: MenuItemSize;
28
+ /** Compact vertical padding, independent of `size`. Default: `false`. */
29
+ dense?: boolean;
30
+ /** Remove the left and right padding. Default: `false`. */
31
+ disableGutters?: boolean;
32
+ /** Add a 1px bottom border to separate the row. Default: `false`. */
33
+ divider?: boolean;
34
+ /** Focus the row on first mount, and whenever `autoFocus` flips from `false` to `true`. Default: `false`. */
35
+ autoFocus?: boolean;
36
+ /** Class applied only while the row has keyboard focus — a `:focus-visible` hook. */
37
+ focusVisibleClassName?: string;
38
+ /** Fired with `value` when the option is chosen. Injected by `Select`. */
39
+ onSelect?: (value: string | number) => void;
40
+ id?: string;
41
+ className?: string;
42
+ 'data-testid'?: string;
43
+ }
44
+ /**
45
+ * @description A single option row for `Select`'s listbox. Rendered as a semantic
46
+ * `<li role="option">` (override via `as`). Selection/highlight/density props are
47
+ * injected by `Select`; used on its own it renders a static, styled row.
48
+ */
49
+ declare function MenuItem({ value, children, as, disabled, selected, highlighted, multiple, color: colorProp, textColor, size: sizeProp, dense, disableGutters, divider, autoFocus, focusVisibleClassName, onSelect, id, className, 'data-testid': dataTestid }: Readonly<MenuItemProps>): import("react").JSX.Element;
50
+ //#endregion
51
+ export { MenuItem, MenuItemColor, MenuItemProps, MenuItemSize, MenuItemTextColor };
@@ -0,0 +1,147 @@
1
+ import { a as createShouldForwardProp, d as styled, l as src_exports, u as useTheme } from "./src-DcNT2aIK.mjs";
2
+ import { t as themeDefault } from "./themeDefault-CjXaY3ok.mjs";
3
+ import { t as Icon } from "./Icon-CAKRmFz3.mjs";
4
+ import { useEffect, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/MenuItem/MenuItem.tsx
7
+ const shouldForwardProp = createShouldForwardProp([
8
+ "color",
9
+ "textColor",
10
+ "sizeToken",
11
+ "selected",
12
+ "highlighted",
13
+ "disabled",
14
+ "dense",
15
+ "disableGutters",
16
+ "divider"
17
+ ]);
18
+ const baseStyle = ({ theme }) => ({
19
+ display: "flex",
20
+ alignItems: "center",
21
+ gap: theme.space[1],
22
+ cursor: "pointer",
23
+ fontFamily: theme.fonts.body,
24
+ lineHeight: theme.lineHeights.base,
25
+ listStyle: "none",
26
+ userSelect: "none",
27
+ whiteSpace: "nowrap",
28
+ transition: "background-color 0.12s ease",
29
+ outline: "none"
30
+ });
31
+ const sizeVariants = ({ theme, sizeToken, dense, disableGutters }) => {
32
+ const s = theme.sizes[sizeToken];
33
+ const verticalPadding = dense ? theme.space[.5] : void 0;
34
+ return {
35
+ paddingTop: verticalPadding ?? theme.space[s.paddingTop],
36
+ paddingBottom: verticalPadding ?? theme.space[s.paddingBottom],
37
+ paddingLeft: disableGutters ? 0 : theme.space[s.paddingLeft],
38
+ paddingRight: disableGutters ? 0 : theme.space[s.paddingRight],
39
+ fontSize: theme.fontSizes[s.fontSize]
40
+ };
41
+ };
42
+ const dividerStyle = ({ theme, divider }) => divider ? {
43
+ borderBottomWidth: theme.borderWidths.thin,
44
+ borderBottomStyle: "solid",
45
+ borderBottomColor: (0, src_exports.get)(theme, "border.light")
46
+ } : {};
47
+ const interactionStyles = ({ theme, color, textColor, selected, highlighted, disabled }) => {
48
+ const main = (0, src_exports.get)(theme, `palette.${color}.main`);
49
+ const hoverBg = `${main}1F`;
50
+ const selectedBg = `${main}29`;
51
+ const activeSelectedBg = `${main}3D`;
52
+ if (disabled) return {
53
+ color: (0, src_exports.get)(theme, "text.disabled"),
54
+ cursor: "not-allowed",
55
+ pointerEvents: "none"
56
+ };
57
+ const baseColor = textColor ? (0, src_exports.get)(theme, `text.${textColor}`) : main;
58
+ return {
59
+ color: selected ? main : baseColor,
60
+ backgroundColor: selected ? highlighted ? activeSelectedBg : selectedBg : highlighted ? hoverBg : "transparent",
61
+ "&:hover": { backgroundColor: selected ? activeSelectedBg : hoverBg }
62
+ };
63
+ };
64
+ const MenuItemRoot = styled("li", {
65
+ name: "MenuItem",
66
+ label: "MenuItem",
67
+ shouldForwardProp
68
+ })(baseStyle, sizeVariants, dividerStyle, interactionStyles);
69
+ const CheckSlot = styled("span", {
70
+ name: "MenuItem",
71
+ slot: "check",
72
+ label: "MenuItemCheck"
73
+ })({
74
+ display: "inline-flex",
75
+ width: "1.125rem",
76
+ flexShrink: 0
77
+ });
78
+ function isKeyboardFocus(element) {
79
+ try {
80
+ return element.matches(":focus-visible");
81
+ } catch {
82
+ return false;
83
+ }
84
+ }
85
+ /**
86
+ * @description A single option row for `Select`'s listbox. Rendered as a semantic
87
+ * `<li role="option">` (override via `as`). Selection/highlight/density props are
88
+ * injected by `Select`; used on its own it renders a static, styled row.
89
+ */
90
+ function MenuItem({ value, children, as, disabled = false, selected = false, highlighted = false, multiple = false, color: colorProp, textColor, size: sizeProp, dense = false, disableGutters = false, divider = false, autoFocus = false, focusVisibleClassName, onSelect, id, className, "data-testid": dataTestid }) {
91
+ const theme = useTheme();
92
+ const color = colorProp ?? themeDefault(theme, "color", "primary");
93
+ const size = sizeProp ?? themeDefault(theme, "size", "md");
94
+ const rootRef = useRef(null);
95
+ const [isFocusVisible, setIsFocusVisible] = useState(false);
96
+ useEffect(() => {
97
+ if (autoFocus) rootRef.current?.focus();
98
+ }, [autoFocus]);
99
+ const handleClick = () => {
100
+ if (!disabled) onSelect?.(value);
101
+ };
102
+ const handleMouseDown = (event) => {
103
+ event.preventDefault();
104
+ };
105
+ const handleFocus = (event) => {
106
+ if (focusVisibleClassName && isKeyboardFocus(event.currentTarget)) setIsFocusVisible(true);
107
+ };
108
+ const handleBlur = () => {
109
+ setIsFocusVisible(false);
110
+ };
111
+ const rootClassName = [className, isFocusVisible ? focusVisibleClassName : void 0].filter(Boolean).join(" ") || void 0;
112
+ return /* @__PURE__ */ jsxs(MenuItemRoot, {
113
+ as,
114
+ ref: rootRef,
115
+ id,
116
+ role: "option",
117
+ tabIndex: -1,
118
+ "aria-selected": selected,
119
+ "aria-disabled": disabled || void 0,
120
+ "data-value": value,
121
+ color,
122
+ textColor,
123
+ sizeToken: size,
124
+ selected,
125
+ highlighted,
126
+ disabled,
127
+ dense,
128
+ disableGutters,
129
+ divider,
130
+ className: rootClassName,
131
+ "data-testid": dataTestid,
132
+ onMouseDown: handleMouseDown,
133
+ onClick: handleClick,
134
+ onFocus: handleFocus,
135
+ onBlur: handleBlur,
136
+ children: [multiple && /* @__PURE__ */ jsx(CheckSlot, {
137
+ "aria-hidden": true,
138
+ children: selected && /* @__PURE__ */ jsx(Icon, {
139
+ name: "check",
140
+ size: "1.125rem",
141
+ color: "inherit"
142
+ })
143
+ }), children]
144
+ });
145
+ }
146
+ //#endregion
147
+ export { MenuItem };
@@ -0,0 +1,351 @@
1
+ const require_src = require("./src-BiocWFSR.cjs");
2
+ const require_View = require("./View.cjs");
3
+ const require_Backdrop = require("./Backdrop.cjs");
4
+ const require_Portal = require("./Portal.cjs");
5
+ const require_FocusTrap = require("./FocusTrap.cjs");
6
+ let react = require("react");
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
9
+ //#region src/utils/ownerDocument.ts
10
+ /**
11
+ * Returns the `Document` that owns the given node, falling back to the global
12
+ * `document`. Lets the modal logic work across iframes / portaled containers.
13
+ */
14
+ function ownerDocument(node) {
15
+ return node?.ownerDocument ?? document;
16
+ }
17
+ //#endregion
18
+ //#region src/utils/ownerWindow.ts
19
+ /**
20
+ * Returns the `Window` that owns the given node, falling back to the global
21
+ * `window`. Used to read viewport metrics for scroll-lock calculations.
22
+ */
23
+ function ownerWindow(node) {
24
+ return ownerDocument(node).defaultView ?? window;
25
+ }
26
+ //#endregion
27
+ //#region src/Modal/utils/getScrollbarSize.ts
28
+ /**
29
+ * Width of the vertical scrollbar for the given window, in pixels. Equal to the
30
+ * gap between the inner window width and the document's client width. Used to
31
+ * pad the container when scroll-lock hides the scrollbar, preventing layout jump.
32
+ */
33
+ function getScrollbarSize(win) {
34
+ const documentWidth = win.document.documentElement.clientWidth;
35
+ return Math.abs(win.innerWidth - documentWidth);
36
+ }
37
+ //#endregion
38
+ //#region src/Modal/ModalManager.ts
39
+ const ARIA_HIDDEN_FORBIDDEN_TAGS = /* @__PURE__ */ new Set([
40
+ "TEMPLATE",
41
+ "SCRIPT",
42
+ "STYLE",
43
+ "LINK",
44
+ "MAP",
45
+ "META",
46
+ "NOSCRIPT",
47
+ "PICTURE",
48
+ "COL",
49
+ "COLGROUP",
50
+ "PARAM",
51
+ "SLOT",
52
+ "SOURCE",
53
+ "TRACK"
54
+ ]);
55
+ function ariaHidden(element, hide) {
56
+ if (hide) element.setAttribute("aria-hidden", "true");
57
+ else element.removeAttribute("aria-hidden");
58
+ }
59
+ function isAriaHiddenForbidden(element) {
60
+ if (ARIA_HIDDEN_FORBIDDEN_TAGS.has(element.tagName)) return true;
61
+ return element.tagName === "INPUT" && element.getAttribute("type") === "hidden";
62
+ }
63
+ function ariaHiddenSiblings(container, mountElement, currentElement, hiddenSiblings, hide) {
64
+ const exclude = /* @__PURE__ */ new Set([
65
+ mountElement,
66
+ currentElement,
67
+ ...hiddenSiblings
68
+ ]);
69
+ Array.from(container.children).forEach((element) => {
70
+ if (!exclude.has(element) && !isAriaHiddenForbidden(element)) ariaHidden(element, hide);
71
+ });
72
+ }
73
+ function getHiddenSiblings(container) {
74
+ return Array.from(container.children).filter((element) => element.getAttribute("aria-hidden") === "true");
75
+ }
76
+ function isOverflowing(container) {
77
+ const doc = ownerDocument(container);
78
+ if (container === doc.body) return ownerWindow(container).innerWidth > doc.documentElement.clientWidth;
79
+ return container.scrollHeight > container.clientHeight;
80
+ }
81
+ function getPaddingRight(element) {
82
+ return Number.parseFloat(ownerWindow(element).getComputedStyle(element).paddingRight) || 0;
83
+ }
84
+ /**
85
+ * Locks scrolling on the container, padding it by the scrollbar width so hiding
86
+ * the scrollbar causes no horizontal layout shift. Returns a function that
87
+ * restores the exact prior inline styles.
88
+ */
89
+ function lockScroll(container) {
90
+ const restores = [];
91
+ const setStyle = (property, value) => {
92
+ const previous = container.style.getPropertyValue(property);
93
+ restores.push(() => {
94
+ if (previous) container.style.setProperty(property, previous);
95
+ else container.style.removeProperty(property);
96
+ });
97
+ container.style.setProperty(property, value);
98
+ };
99
+ if (isOverflowing(container)) {
100
+ const scrollbarSize = container === ownerDocument(container).body ? getScrollbarSize(ownerWindow(container)) : container.offsetWidth - container.clientWidth;
101
+ setStyle("padding-right", `${getPaddingRight(container) + scrollbarSize}px`);
102
+ }
103
+ setStyle("overflow", "hidden");
104
+ return () => restores.forEach((restore) => restore());
105
+ }
106
+ /**
107
+ * Tracks every open modal and the containers they live in. A single shared
108
+ * instance coordinates stacking (`isTopModal`), scroll-lock, and `aria-hidden`
109
+ * on background siblings so assistive tech only sees the active modal.
110
+ */
111
+ var ModalManager = class {
112
+ modals = [];
113
+ containers = [];
114
+ add(modal, container, disableAriaHidden = false) {
115
+ const existingIndex = this.modals.indexOf(modal);
116
+ if (existingIndex !== -1) return existingIndex;
117
+ const modalIndex = this.modals.length;
118
+ this.modals.push(modal);
119
+ ariaHidden(modal.modalRef, false);
120
+ const hiddenSiblings = getHiddenSiblings(container);
121
+ if (!disableAriaHidden) ariaHiddenSiblings(container, modal.mount, modal.modalRef, hiddenSiblings, true);
122
+ const containerState = this.containers.find((item) => item.container === container);
123
+ if (containerState) {
124
+ containerState.modals.push(modal);
125
+ if (!disableAriaHidden) containerState.ariaHiddenApplied = true;
126
+ return modalIndex;
127
+ }
128
+ this.containers.push({
129
+ container,
130
+ modals: [modal],
131
+ restore: null,
132
+ hiddenSiblings,
133
+ ariaHiddenApplied: !disableAriaHidden
134
+ });
135
+ return modalIndex;
136
+ }
137
+ mount(modal, props) {
138
+ const containerState = this.containers.find((item) => item.modals.includes(modal));
139
+ containerState.restore ??= props.disableScrollLock ? () => {} : lockScroll(containerState.container);
140
+ }
141
+ remove(modal, ariaHiddenState = true) {
142
+ const modalIndex = this.modals.indexOf(modal);
143
+ if (modalIndex === -1) return modalIndex;
144
+ const containerState = this.containers.find((item) => item.modals.includes(modal));
145
+ containerState.modals.splice(containerState.modals.indexOf(modal), 1);
146
+ this.modals.splice(modalIndex, 1);
147
+ if (containerState.modals.length === 0) {
148
+ if (containerState.restore) containerState.restore();
149
+ ariaHidden(modal.modalRef, ariaHiddenState);
150
+ if (containerState.ariaHiddenApplied) ariaHiddenSiblings(containerState.container, modal.mount, modal.modalRef, containerState.hiddenSiblings, false);
151
+ this.containers.splice(this.containers.indexOf(containerState), 1);
152
+ } else {
153
+ const nextTop = containerState.modals.at(-1);
154
+ ariaHidden(modal.modalRef, ariaHiddenState);
155
+ ariaHidden(nextTop.modalRef, false);
156
+ }
157
+ return modalIndex;
158
+ }
159
+ isTopModal(modal) {
160
+ return this.modals.at(-1) === modal;
161
+ }
162
+ };
163
+ //#endregion
164
+ //#region src/Modal/hooks/useEventCallback.ts
165
+ /**
166
+ * Returns a stable function identity that always calls the latest `fn`. Lets
167
+ * effects depend on the callback without re-running when the handler changes.
168
+ *
169
+ * Syncs the ref in `useEffect` (not `useLayoutEffect`) so it stays SSR-safe —
170
+ * the timing difference is irrelevant for the user-triggered handlers it wraps.
171
+ */
172
+ function useEventCallback(fn) {
173
+ const ref = (0, react.useRef)(fn);
174
+ (0, react.useEffect)(() => {
175
+ ref.current = fn;
176
+ });
177
+ return (0, react.useCallback)((...args) => ref.current(...args), []);
178
+ }
179
+ //#endregion
180
+ //#region src/Modal/hooks/useMergedRefs.ts
181
+ function assignRef(ref, value) {
182
+ if (typeof ref === "function") ref(value);
183
+ else if (ref) ref.current = value;
184
+ }
185
+ /**
186
+ * Merges two refs into a single stable ref callback so one DOM node can be
187
+ * tracked by both an internal ref and a forwarded `ref`. Returns `null` when
188
+ * both refs are absent, so React skips attaching a callback ref entirely.
189
+ */
190
+ function useMergedRefs(refA, refB) {
191
+ return (0, react.useMemo)(() => {
192
+ if (refA == null && refB == null) return null;
193
+ return (value) => {
194
+ assignRef(refA, value);
195
+ assignRef(refB, value);
196
+ };
197
+ }, [refA, refB]);
198
+ }
199
+ //#endregion
200
+ //#region src/Modal/useModal.ts
201
+ const modalManager = new ModalManager();
202
+ function getContainer(container) {
203
+ return typeof container === "function" ? container() : container ?? null;
204
+ }
205
+ function useModal(parameters) {
206
+ const { isOpen, onClose, container, disableScrollLock = false, disableAriaHidden = false, rootRef } = parameters;
207
+ const modal = (0, react.useRef)({});
208
+ const mountNodeRef = (0, react.useRef)(null);
209
+ const modalRef = (0, react.useRef)(null);
210
+ const handleRef = useMergedRefs(modalRef, rootRef);
211
+ const getModal = () => {
212
+ modal.current.modalRef = modalRef.current;
213
+ modal.current.mount = mountNodeRef.current;
214
+ return modal.current;
215
+ };
216
+ const handleOpen = useEventCallback(() => {
217
+ const resolvedContainer = getContainer(container) ?? ownerDocument(mountNodeRef.current).body;
218
+ modalManager.add(getModal(), resolvedContainer, disableAriaHidden);
219
+ modalManager.mount(getModal(), { disableScrollLock });
220
+ });
221
+ const isTopModal = useEventCallback(() => modalManager.isTopModal(getModal()));
222
+ const handlePortalRef = useEventCallback((node) => {
223
+ mountNodeRef.current = node;
224
+ });
225
+ const handleClose = useEventCallback(() => {
226
+ modalManager.remove(modal.current);
227
+ });
228
+ (0, react.useEffect)(() => {
229
+ if (!isOpen) return;
230
+ handleOpen();
231
+ return () => handleClose();
232
+ }, [
233
+ isOpen,
234
+ container,
235
+ disableScrollLock,
236
+ handleOpen,
237
+ handleClose
238
+ ]);
239
+ const createHandleKeyDown = (otherHandlers) => (event) => {
240
+ otherHandlers.onKeyDown?.(event);
241
+ if (event.key !== "Escape" || event.which === 229 || !isTopModal()) return;
242
+ event.stopPropagation();
243
+ onClose?.(event, "escapeKey");
244
+ };
245
+ const createHandleRootClick = (otherHandlers) => (event) => {
246
+ otherHandlers.onClick?.(event);
247
+ if (event.target !== event.currentTarget) return;
248
+ onClose?.(event, "backdropClick");
249
+ };
250
+ const getRootProps = (otherHandlers = {}) => {
251
+ return {
252
+ role: "presentation",
253
+ ...otherHandlers,
254
+ onKeyDown: createHandleKeyDown(otherHandlers),
255
+ onClick: createHandleRootClick(otherHandlers),
256
+ ref: handleRef
257
+ };
258
+ };
259
+ const getBackdropProps = (otherHandlers = {}) => {
260
+ return {
261
+ "aria-hidden": true,
262
+ ...otherHandlers,
263
+ open: isOpen
264
+ };
265
+ };
266
+ return {
267
+ getRootProps,
268
+ getBackdropProps,
269
+ rootRef: handleRef,
270
+ portalRef: handlePortalRef,
271
+ isTopModal
272
+ };
273
+ }
274
+ //#endregion
275
+ //#region src/Modal/Modal.tsx
276
+ const ModalRoot = require_src.styled(require_View.View, {
277
+ name: "Modal",
278
+ label: "Modal",
279
+ shouldForwardProp: (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)(["scroll", "layer"])
280
+ })(({ theme, scroll, layer }) => ({
281
+ position: "fixed",
282
+ inset: 0,
283
+ zIndex: theme.zOrder[layer],
284
+ display: "flex",
285
+ ...scroll === "paper" ? {
286
+ alignItems: "center",
287
+ justifyContent: "center"
288
+ } : {
289
+ flexDirection: "column",
290
+ overflowY: "auto",
291
+ "& > :not([aria-hidden=\"true\"])": { margin: "auto" }
292
+ }
293
+ }));
294
+ /**
295
+ * @description Accessible overlay primitive: portals its content, dims the page,
296
+ * traps focus, locks scroll, and closes on Escape or backdrop click. The base for
297
+ * higher-level overlays such as Drawer.
298
+ */
299
+ function Modal({ isOpen, children, onClose, hasBackdrop = true, shouldKeepMounted = false, shouldUsePortal = true, portalContainer, shouldLockScroll = true, disableAriaHidden = false, shouldAutoFocus = true, shouldTrapFocus = true, shouldEnforceFocus = true, shouldRestoreFocus = true, scroll = "paper", layer = "modal" }) {
300
+ const { getRootProps, getBackdropProps } = useModal({
301
+ isOpen,
302
+ onClose,
303
+ container: portalContainer,
304
+ disableScrollLock: !shouldLockScroll,
305
+ disableAriaHidden
306
+ });
307
+ if (!shouldKeepMounted && !isOpen) return null;
308
+ const { open: _open, ...backdropProps } = getBackdropProps();
309
+ const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ModalRoot, {
310
+ scroll,
311
+ layer,
312
+ ...getRootProps(),
313
+ children: [hasBackdrop ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Backdrop.Backdrop, { ...backdropProps }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FocusTrap.FocusTrap, {
314
+ isEnabled: isOpen,
315
+ shouldAutoFocus,
316
+ shouldTrapFocus,
317
+ shouldEnforceFocus,
318
+ shouldRestoreFocus,
319
+ children
320
+ })]
321
+ });
322
+ return shouldUsePortal ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Portal.Portal, {
323
+ container: portalContainer,
324
+ children: content
325
+ }) : content;
326
+ }
327
+ //#endregion
328
+ Object.defineProperty(exports, "Modal", {
329
+ enumerable: true,
330
+ get: function() {
331
+ return Modal;
332
+ }
333
+ });
334
+ Object.defineProperty(exports, "ModalManager", {
335
+ enumerable: true,
336
+ get: function() {
337
+ return ModalManager;
338
+ }
339
+ });
340
+ Object.defineProperty(exports, "ariaHidden", {
341
+ enumerable: true,
342
+ get: function() {
343
+ return ariaHidden;
344
+ }
345
+ });
346
+ Object.defineProperty(exports, "useModal", {
347
+ enumerable: true,
348
+ get: function() {
349
+ return useModal;
350
+ }
351
+ });