@cerberus-design/react 0.8.0 → 0.8.1

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 (378) hide show
  1. package/build/legacy/{_tsup-dts-rollup.d.ts → _tsup-dts-rollup.d.cts} +207 -5
  2. package/build/legacy/aria-helpers/nav-menu.aria.cjs +36 -0
  3. package/build/legacy/aria-helpers/nav-menu.aria.cjs.map +1 -0
  4. package/build/legacy/aria-helpers/tabs.aria.cjs +100 -0
  5. package/build/legacy/aria-helpers/tabs.aria.cjs.map +1 -0
  6. package/build/legacy/aria-helpers/trap-focus.aria.cjs +54 -0
  7. package/build/legacy/aria-helpers/trap-focus.aria.cjs.map +1 -0
  8. package/build/legacy/components/Button.cjs +50 -0
  9. package/build/legacy/components/Button.cjs.map +1 -0
  10. package/build/legacy/components/Checkbox.cjs +157 -0
  11. package/build/legacy/components/Checkbox.cjs.map +1 -0
  12. package/build/legacy/components/Droppable.cjs +54 -0
  13. package/build/legacy/components/Droppable.cjs.map +1 -0
  14. package/build/legacy/components/FeatureFlag.cjs +63 -0
  15. package/build/legacy/components/FeatureFlag.cjs.map +1 -0
  16. package/build/legacy/components/FieldMessage.cjs +59 -0
  17. package/build/legacy/components/FieldMessage.cjs.map +1 -0
  18. package/build/legacy/components/FileStatus.cjs +390 -0
  19. package/build/legacy/components/FileStatus.cjs.map +1 -0
  20. package/build/legacy/components/FileUploader.cjs +159 -0
  21. package/build/legacy/components/FileUploader.cjs.map +1 -0
  22. package/build/legacy/components/IconButton.cjs +53 -0
  23. package/build/legacy/components/IconButton.cjs.map +1 -0
  24. package/build/legacy/components/Input.cjs +145 -0
  25. package/build/legacy/components/Input.cjs.map +1 -0
  26. package/build/legacy/components/Label.cjs +93 -0
  27. package/build/legacy/components/Label.cjs.map +1 -0
  28. package/build/legacy/components/Modal.cjs +45 -0
  29. package/build/legacy/components/Modal.cjs.map +1 -0
  30. package/build/legacy/components/ModalDescription.cjs +36 -0
  31. package/build/legacy/components/ModalDescription.cjs.map +1 -0
  32. package/build/legacy/components/ModalHeader.cjs +49 -0
  33. package/build/legacy/components/ModalHeader.cjs.map +1 -0
  34. package/build/legacy/components/ModalHeading.cjs +36 -0
  35. package/build/legacy/components/ModalHeading.cjs.map +1 -0
  36. package/build/legacy/components/ModalIcon.cjs +51 -0
  37. package/build/legacy/components/ModalIcon.cjs.map +1 -0
  38. package/build/legacy/components/NavMenuLink.cjs +81 -0
  39. package/build/legacy/components/NavMenuLink.cjs.map +1 -0
  40. package/build/legacy/components/NavMenuList.cjs +131 -0
  41. package/build/legacy/components/NavMenuList.cjs.map +1 -0
  42. package/build/legacy/components/NavMenuTrigger.cjs +128 -0
  43. package/build/legacy/components/NavMenuTrigger.cjs.map +1 -0
  44. package/build/legacy/components/Notification.cjs +181 -0
  45. package/build/legacy/components/Notification.cjs.map +1 -0
  46. package/build/legacy/components/NotificationDescription.cjs +44 -0
  47. package/build/legacy/components/NotificationDescription.cjs.map +1 -0
  48. package/build/legacy/components/NotificationHeading.cjs +38 -0
  49. package/build/legacy/components/NotificationHeading.cjs.map +1 -0
  50. package/build/legacy/components/Portal.cjs +35 -0
  51. package/build/legacy/components/Portal.cjs.map +1 -0
  52. package/build/legacy/components/ProgressBar.cjs +61 -0
  53. package/build/legacy/components/ProgressBar.cjs.map +1 -0
  54. package/build/legacy/components/Radio.cjs +68 -0
  55. package/build/legacy/components/Radio.cjs.map +1 -0
  56. package/build/legacy/components/Select.cjs +170 -0
  57. package/build/legacy/components/Select.cjs.map +1 -0
  58. package/build/legacy/components/Show.cjs +40 -0
  59. package/build/legacy/components/Show.cjs.map +1 -0
  60. package/build/legacy/components/Tab.cjs +135 -0
  61. package/build/legacy/components/Tab.cjs.map +1 -0
  62. package/build/legacy/components/TabList.cjs +68 -0
  63. package/build/legacy/components/TabList.cjs.map +1 -0
  64. package/build/legacy/components/TabPanel.cjs +76 -0
  65. package/build/legacy/components/TabPanel.cjs.map +1 -0
  66. package/build/legacy/components/Table.cjs +53 -0
  67. package/build/legacy/components/Table.cjs.map +1 -0
  68. package/build/legacy/components/Tag.cjs +91 -0
  69. package/build/legacy/components/Tag.cjs.map +1 -0
  70. package/build/legacy/components/Tbody.cjs +48 -0
  71. package/build/legacy/components/Tbody.cjs.map +1 -0
  72. package/build/legacy/components/Td.cjs +48 -0
  73. package/build/legacy/components/Td.cjs.map +1 -0
  74. package/build/legacy/components/Textarea.cjs +71 -0
  75. package/build/legacy/components/Textarea.cjs.map +1 -0
  76. package/build/legacy/components/Th.cjs +80 -0
  77. package/build/legacy/components/Th.cjs.map +1 -0
  78. package/build/legacy/components/Thead.cjs +36 -0
  79. package/build/legacy/components/Thead.cjs.map +1 -0
  80. package/build/legacy/components/Toggle.cjs +151 -0
  81. package/build/legacy/components/Toggle.cjs.map +1 -0
  82. package/build/legacy/config/cerbIcons.cjs +88 -0
  83. package/build/legacy/config/cerbIcons.cjs.map +1 -0
  84. package/build/legacy/config/defineIcons.cjs +110 -0
  85. package/build/legacy/config/defineIcons.cjs.map +1 -0
  86. package/build/legacy/config/icons/checkbox.icons.cjs +67 -0
  87. package/build/legacy/config/icons/checkbox.icons.cjs.map +1 -0
  88. package/build/legacy/context/confirm-modal.cjs +371 -0
  89. package/build/legacy/context/confirm-modal.cjs.map +1 -0
  90. package/build/legacy/context/feature-flags.cjs +48 -0
  91. package/build/legacy/context/feature-flags.cjs.map +1 -0
  92. package/build/legacy/context/field.cjs +55 -0
  93. package/build/legacy/context/field.cjs.map +1 -0
  94. package/build/legacy/context/navMenu.cjs +70 -0
  95. package/build/legacy/context/navMenu.cjs.map +1 -0
  96. package/build/legacy/context/notification-center.cjs +347 -0
  97. package/build/legacy/context/notification-center.cjs.map +1 -0
  98. package/build/legacy/context/prompt-modal.cjs +508 -0
  99. package/build/legacy/context/prompt-modal.cjs.map +1 -0
  100. package/build/legacy/context/tabs.cjs +78 -0
  101. package/build/legacy/context/tabs.cjs.map +1 -0
  102. package/build/legacy/context/theme.cjs +104 -0
  103. package/build/legacy/context/theme.cjs.map +1 -0
  104. package/build/legacy/hooks/useModal.cjs +50 -0
  105. package/build/legacy/hooks/useModal.cjs.map +1 -0
  106. package/build/legacy/hooks/useTheme.cjs +87 -0
  107. package/build/legacy/hooks/useTheme.cjs.map +1 -0
  108. package/build/legacy/hooks/useToggle.cjs +47 -0
  109. package/build/legacy/hooks/useToggle.cjs.map +1 -0
  110. package/build/legacy/index.cjs +2165 -0
  111. package/build/legacy/index.cjs.map +1 -0
  112. package/build/legacy/types.cjs +19 -0
  113. package/build/legacy/types.cjs.map +1 -0
  114. package/build/modern/_tsup-dts-rollup.d.ts +207 -5
  115. package/build/{legacy/chunk-JJGZRBIR.js → modern/chunk-2FK7NR7Y.js} +8 -7
  116. package/build/{legacy/chunk-JJGZRBIR.js.map → modern/chunk-2FK7NR7Y.js.map} +1 -1
  117. package/build/modern/chunk-4FD33RTW.js +56 -0
  118. package/build/modern/chunk-4FD33RTW.js.map +1 -0
  119. package/build/modern/{chunk-XB4ZRAH4.js → chunk-53QBTZZF.js} +5 -5
  120. package/build/modern/{chunk-BEYPMC73.js → chunk-5WVXIAG2.js} +2 -2
  121. package/build/modern/chunk-7NX4RGDB.js +218 -0
  122. package/build/modern/chunk-7NX4RGDB.js.map +1 -0
  123. package/build/modern/chunk-CP7OUC2Q.js +42 -0
  124. package/build/modern/chunk-CP7OUC2Q.js.map +1 -0
  125. package/build/modern/{chunk-4N2L357B.js → chunk-EJIMJWPB.js} +2 -2
  126. package/build/{legacy/chunk-GVNPFXKL.js → modern/chunk-GUECLKHY.js} +18 -1
  127. package/build/modern/chunk-GUECLKHY.js.map +1 -0
  128. package/build/modern/{chunk-Y5IY7O23.js → chunk-GZY6CH7D.js} +5 -5
  129. package/build/{legacy/chunk-IL5ELPTT.js → modern/chunk-ID3XWGLY.js} +2 -2
  130. package/build/modern/chunk-RHG26FYL.js +68 -0
  131. package/build/modern/chunk-RHG26FYL.js.map +1 -0
  132. package/build/modern/{chunk-LTDNZRUY.js → chunk-S6CMAXQF.js} +10 -10
  133. package/build/modern/{chunk-IOG6XIR5.js → chunk-TF3HRELU.js} +3 -3
  134. package/build/modern/{chunk-IOG6XIR5.js.map → chunk-TF3HRELU.js.map} +1 -1
  135. package/build/modern/chunk-TYTEREKZ.js +39 -0
  136. package/build/modern/chunk-TYTEREKZ.js.map +1 -0
  137. package/build/{legacy/chunk-JJP2TFTU.js → modern/chunk-VCR5C6Q3.js} +1 -1
  138. package/build/modern/chunk-VCR5C6Q3.js.map +1 -0
  139. package/build/modern/{chunk-QO2UXGW4.js → chunk-VPWBSZAR.js} +2 -2
  140. package/build/modern/components/Checkbox.js +13 -0
  141. package/build/modern/components/FileStatus.js +17 -0
  142. package/build/modern/components/FileUploader.js +4 -3
  143. package/build/modern/components/Input.js +5 -4
  144. package/build/modern/components/Label.js +2 -2
  145. package/build/modern/components/ModalIcon.js +1 -1
  146. package/build/modern/components/Notification.js +4 -3
  147. package/build/modern/components/ProgressBar.js +7 -0
  148. package/build/modern/components/Select.js +15 -0
  149. package/build/modern/components/Toggle.js +4 -3
  150. package/build/modern/config/cerbIcons.js +2 -1
  151. package/build/modern/config/defineIcons.js +3 -2
  152. package/build/modern/config/icons/checkbox.icons.js +9 -0
  153. package/build/modern/context/confirm-modal.js +5 -4
  154. package/build/modern/context/notification-center.js +5 -4
  155. package/build/modern/context/prompt-modal.js +8 -7
  156. package/build/modern/index.js +59 -38
  157. package/build/modern/index.js.map +1 -1
  158. package/package.json +6 -6
  159. package/src/components/Checkbox.tsx +76 -0
  160. package/src/components/FileStatus.tsx +246 -0
  161. package/src/components/FileUploader.tsx +1 -1
  162. package/src/components/Label.tsx +3 -2
  163. package/src/components/ModalIcon.tsx +2 -2
  164. package/src/components/ProgressBar.tsx +61 -0
  165. package/src/components/Select.tsx +96 -0
  166. package/src/config/cerbIcons.ts +20 -0
  167. package/src/config/icons/checkbox.icons.tsx +49 -0
  168. package/src/index.ts +4 -0
  169. package/build/legacy/aria-helpers/nav-menu.aria.js +0 -7
  170. package/build/legacy/aria-helpers/tabs.aria.js +0 -9
  171. package/build/legacy/aria-helpers/trap-focus.aria.js +0 -7
  172. package/build/legacy/chunk-2UFNQM55.js +0 -21
  173. package/build/legacy/chunk-2UFNQM55.js.map +0 -1
  174. package/build/legacy/chunk-2VPKILZ6.js +0 -122
  175. package/build/legacy/chunk-2VPKILZ6.js.map +0 -1
  176. package/build/legacy/chunk-3C2DJSEE.js +0 -16
  177. package/build/legacy/chunk-3C2DJSEE.js.map +0 -1
  178. package/build/legacy/chunk-3GXISGPS.js +0 -47
  179. package/build/legacy/chunk-3GXISGPS.js.map +0 -1
  180. package/build/legacy/chunk-4CAT3FHV.js +0 -11
  181. package/build/legacy/chunk-4CAT3FHV.js.map +0 -1
  182. package/build/legacy/chunk-4M3EUP57.js +0 -22
  183. package/build/legacy/chunk-4M3EUP57.js.map +0 -1
  184. package/build/legacy/chunk-4M4LCQ43.js +0 -12
  185. package/build/legacy/chunk-4M4LCQ43.js.map +0 -1
  186. package/build/legacy/chunk-4O4QFF4S.js +0 -15
  187. package/build/legacy/chunk-4O4QFF4S.js.map +0 -1
  188. package/build/legacy/chunk-55J6XMHW.js +0 -1
  189. package/build/legacy/chunk-6DIGPXAD.js +0 -48
  190. package/build/legacy/chunk-6DIGPXAD.js.map +0 -1
  191. package/build/legacy/chunk-6F34A7NZ.js +0 -28
  192. package/build/legacy/chunk-6F34A7NZ.js.map +0 -1
  193. package/build/legacy/chunk-7VJOPJVX.js +0 -29
  194. package/build/legacy/chunk-7VJOPJVX.js.map +0 -1
  195. package/build/legacy/chunk-A5WYZVUR.js +0 -28
  196. package/build/legacy/chunk-A5WYZVUR.js.map +0 -1
  197. package/build/legacy/chunk-AAKIOHAX.js +0 -155
  198. package/build/legacy/chunk-AAKIOHAX.js.map +0 -1
  199. package/build/legacy/chunk-BEYPMC73.js +0 -27
  200. package/build/legacy/chunk-EVEEQRH6.js +0 -58
  201. package/build/legacy/chunk-EVEEQRH6.js.map +0 -1
  202. package/build/legacy/chunk-GKUDLVOV.js +0 -64
  203. package/build/legacy/chunk-GKUDLVOV.js.map +0 -1
  204. package/build/legacy/chunk-GVNPFXKL.js.map +0 -1
  205. package/build/legacy/chunk-HW76XVA3.js +0 -22
  206. package/build/legacy/chunk-HW76XVA3.js.map +0 -1
  207. package/build/legacy/chunk-ISPTI4GC.js +0 -32
  208. package/build/legacy/chunk-ISPTI4GC.js.map +0 -1
  209. package/build/legacy/chunk-JB7IQ2BM.js +0 -12
  210. package/build/legacy/chunk-JB7IQ2BM.js.map +0 -1
  211. package/build/legacy/chunk-JF76VIL3.js +0 -12
  212. package/build/legacy/chunk-JF76VIL3.js.map +0 -1
  213. package/build/legacy/chunk-JJP2TFTU.js.map +0 -1
  214. package/build/legacy/chunk-KESKDLX6.js +0 -30
  215. package/build/legacy/chunk-KESKDLX6.js.map +0 -1
  216. package/build/legacy/chunk-KF24CS4S.js +0 -58
  217. package/build/legacy/chunk-KF24CS4S.js.map +0 -1
  218. package/build/legacy/chunk-KJUCHZHV.js +0 -51
  219. package/build/legacy/chunk-KJUCHZHV.js.map +0 -1
  220. package/build/legacy/chunk-L46XIE3D.js +0 -208
  221. package/build/legacy/chunk-L46XIE3D.js.map +0 -1
  222. package/build/legacy/chunk-LF2QFS5S.js +0 -76
  223. package/build/legacy/chunk-N3FUF4TB.js +0 -12
  224. package/build/legacy/chunk-N3FUF4TB.js.map +0 -1
  225. package/build/legacy/chunk-NE5NHILF.js +0 -47
  226. package/build/legacy/chunk-NE5NHILF.js.map +0 -1
  227. package/build/legacy/chunk-PH64POOB.js +0 -33
  228. package/build/legacy/chunk-PH64POOB.js.map +0 -1
  229. package/build/legacy/chunk-PJ3744I6.js +0 -24
  230. package/build/legacy/chunk-PJ3744I6.js.map +0 -1
  231. package/build/legacy/chunk-PMCYXRAH.js +0 -86
  232. package/build/legacy/chunk-PMCYXRAH.js.map +0 -1
  233. package/build/legacy/chunk-QU7UV5DB.js +0 -25
  234. package/build/legacy/chunk-QU7UV5DB.js.map +0 -1
  235. package/build/legacy/chunk-RPZAPUCF.js +0 -81
  236. package/build/legacy/chunk-RPZAPUCF.js.map +0 -1
  237. package/build/legacy/chunk-SCQVXJBT.js +0 -22
  238. package/build/legacy/chunk-SCQVXJBT.js.map +0 -1
  239. package/build/legacy/chunk-SLHX5K6I.js +0 -29
  240. package/build/legacy/chunk-SLHX5K6I.js.map +0 -1
  241. package/build/legacy/chunk-SMCEFK6Q.js +0 -63
  242. package/build/legacy/chunk-SMCEFK6Q.js.map +0 -1
  243. package/build/legacy/chunk-SXXWC6UD.js +0 -83
  244. package/build/legacy/chunk-SXXWC6UD.js.map +0 -1
  245. package/build/legacy/chunk-TCO46FK7.js +0 -36
  246. package/build/legacy/chunk-TCO46FK7.js.map +0 -1
  247. package/build/legacy/chunk-TZNYJ3G7.js +0 -25
  248. package/build/legacy/chunk-TZNYJ3G7.js.map +0 -1
  249. package/build/legacy/chunk-U72VPIZA.js +0 -32
  250. package/build/legacy/chunk-U72VPIZA.js.map +0 -1
  251. package/build/legacy/chunk-VGHVH2T3.js +0 -24
  252. package/build/legacy/chunk-VGHVH2T3.js.map +0 -1
  253. package/build/legacy/chunk-VULPMZUW.js +0 -18
  254. package/build/legacy/chunk-VULPMZUW.js.map +0 -1
  255. package/build/legacy/chunk-XB4ZRAH4.js +0 -42
  256. package/build/legacy/chunk-XREC5IJE.js +0 -24
  257. package/build/legacy/chunk-XREC5IJE.js.map +0 -1
  258. package/build/legacy/chunk-ZAU4JVLL.js +0 -33
  259. package/build/legacy/chunk-ZAU4JVLL.js.map +0 -1
  260. package/build/legacy/components/Button.js +0 -7
  261. package/build/legacy/components/Droppable.js +0 -8
  262. package/build/legacy/components/Droppable.js.map +0 -1
  263. package/build/legacy/components/FeatureFlag.js +0 -10
  264. package/build/legacy/components/FeatureFlag.js.map +0 -1
  265. package/build/legacy/components/FieldMessage.js +0 -9
  266. package/build/legacy/components/FieldMessage.js.map +0 -1
  267. package/build/legacy/components/FileUploader.js +0 -11
  268. package/build/legacy/components/FileUploader.js.map +0 -1
  269. package/build/legacy/components/IconButton.js +0 -7
  270. package/build/legacy/components/IconButton.js.map +0 -1
  271. package/build/legacy/components/Input.js +0 -12
  272. package/build/legacy/components/Input.js.map +0 -1
  273. package/build/legacy/components/Label.js +0 -10
  274. package/build/legacy/components/Label.js.map +0 -1
  275. package/build/legacy/components/Modal.js +0 -7
  276. package/build/legacy/components/Modal.js.map +0 -1
  277. package/build/legacy/components/ModalDescription.js +0 -7
  278. package/build/legacy/components/ModalDescription.js.map +0 -1
  279. package/build/legacy/components/ModalHeader.js +0 -7
  280. package/build/legacy/components/ModalHeader.js.map +0 -1
  281. package/build/legacy/components/ModalHeading.js +0 -7
  282. package/build/legacy/components/ModalHeading.js.map +0 -1
  283. package/build/legacy/components/ModalIcon.js +0 -7
  284. package/build/legacy/components/ModalIcon.js.map +0 -1
  285. package/build/legacy/components/NavMenuLink.js +0 -8
  286. package/build/legacy/components/NavMenuLink.js.map +0 -1
  287. package/build/legacy/components/NavMenuList.js +0 -12
  288. package/build/legacy/components/NavMenuList.js.map +0 -1
  289. package/build/legacy/components/NavMenuTrigger.js +0 -11
  290. package/build/legacy/components/NavMenuTrigger.js.map +0 -1
  291. package/build/legacy/components/Notification.js +0 -11
  292. package/build/legacy/components/Notification.js.map +0 -1
  293. package/build/legacy/components/NotificationDescription.js +0 -7
  294. package/build/legacy/components/NotificationDescription.js.map +0 -1
  295. package/build/legacy/components/NotificationHeading.js +0 -7
  296. package/build/legacy/components/NotificationHeading.js.map +0 -1
  297. package/build/legacy/components/Portal.js +0 -7
  298. package/build/legacy/components/Portal.js.map +0 -1
  299. package/build/legacy/components/Radio.js +0 -9
  300. package/build/legacy/components/Radio.js.map +0 -1
  301. package/build/legacy/components/Show.js +0 -8
  302. package/build/legacy/components/Show.js.map +0 -1
  303. package/build/legacy/components/Tab.js +0 -10
  304. package/build/legacy/components/Tab.js.map +0 -1
  305. package/build/legacy/components/TabList.js +0 -9
  306. package/build/legacy/components/TabList.js.map +0 -1
  307. package/build/legacy/components/TabPanel.js +0 -10
  308. package/build/legacy/components/TabPanel.js.map +0 -1
  309. package/build/legacy/components/Table.js +0 -9
  310. package/build/legacy/components/Table.js.map +0 -1
  311. package/build/legacy/components/Tag.js +0 -8
  312. package/build/legacy/components/Tag.js.map +0 -1
  313. package/build/legacy/components/Tbody.js +0 -7
  314. package/build/legacy/components/Tbody.js.map +0 -1
  315. package/build/legacy/components/Td.js +0 -7
  316. package/build/legacy/components/Td.js.map +0 -1
  317. package/build/legacy/components/Textarea.js +0 -9
  318. package/build/legacy/components/Textarea.js.map +0 -1
  319. package/build/legacy/components/Th.js +0 -8
  320. package/build/legacy/components/Th.js.map +0 -1
  321. package/build/legacy/components/Thead.js +0 -7
  322. package/build/legacy/components/Thead.js.map +0 -1
  323. package/build/legacy/components/Toggle.js +0 -11
  324. package/build/legacy/components/Toggle.js.map +0 -1
  325. package/build/legacy/config/cerbIcons.js +0 -7
  326. package/build/legacy/config/cerbIcons.js.map +0 -1
  327. package/build/legacy/config/defineIcons.js +0 -10
  328. package/build/legacy/config/defineIcons.js.map +0 -1
  329. package/build/legacy/context/confirm-modal.js +0 -22
  330. package/build/legacy/context/confirm-modal.js.map +0 -1
  331. package/build/legacy/context/feature-flags.js +0 -10
  332. package/build/legacy/context/feature-flags.js.map +0 -1
  333. package/build/legacy/context/field.js +0 -10
  334. package/build/legacy/context/field.js.map +0 -1
  335. package/build/legacy/context/navMenu.js +0 -10
  336. package/build/legacy/context/navMenu.js.map +0 -1
  337. package/build/legacy/context/notification-center.js +0 -19
  338. package/build/legacy/context/notification-center.js.map +0 -1
  339. package/build/legacy/context/prompt-modal.js +0 -25
  340. package/build/legacy/context/prompt-modal.js.map +0 -1
  341. package/build/legacy/context/tabs.js +0 -12
  342. package/build/legacy/context/tabs.js.map +0 -1
  343. package/build/legacy/context/theme.js +0 -14
  344. package/build/legacy/context/theme.js.map +0 -1
  345. package/build/legacy/hooks/useModal.js +0 -8
  346. package/build/legacy/hooks/useModal.js.map +0 -1
  347. package/build/legacy/hooks/useTheme.js +0 -8
  348. package/build/legacy/hooks/useTheme.js.map +0 -1
  349. package/build/legacy/hooks/useToggle.js +0 -8
  350. package/build/legacy/hooks/useToggle.js.map +0 -1
  351. package/build/legacy/index.js +0 -226
  352. package/build/legacy/index.js.map +0 -1
  353. package/build/legacy/types.js +0 -2
  354. package/build/legacy/types.js.map +0 -1
  355. package/build/modern/chunk-4N2L357B.js.map +0 -1
  356. package/build/modern/chunk-BEYPMC73.js.map +0 -1
  357. package/build/modern/chunk-GVNPFXKL.js +0 -26
  358. package/build/modern/chunk-GVNPFXKL.js.map +0 -1
  359. package/build/modern/chunk-IL5ELPTT.js +0 -58
  360. package/build/modern/chunk-IL5ELPTT.js.map +0 -1
  361. package/build/modern/chunk-JJGZRBIR.js +0 -49
  362. package/build/modern/chunk-JJGZRBIR.js.map +0 -1
  363. package/build/modern/chunk-JJP2TFTU.js +0 -29
  364. package/build/modern/chunk-JJP2TFTU.js.map +0 -1
  365. package/build/modern/chunk-XB4ZRAH4.js.map +0 -1
  366. /package/build/legacy/{noExternals.d.ts → noExternals.d.cts} +0 -0
  367. /package/build/{legacy/chunk-XB4ZRAH4.js.map → modern/chunk-53QBTZZF.js.map} +0 -0
  368. /package/build/{legacy/chunk-BEYPMC73.js.map → modern/chunk-5WVXIAG2.js.map} +0 -0
  369. /package/build/{legacy/chunk-LF2QFS5S.js.map → modern/chunk-EJIMJWPB.js.map} +0 -0
  370. /package/build/modern/{chunk-Y5IY7O23.js.map → chunk-GZY6CH7D.js.map} +0 -0
  371. /package/build/{legacy/chunk-IL5ELPTT.js.map → modern/chunk-ID3XWGLY.js.map} +0 -0
  372. /package/build/modern/{chunk-LTDNZRUY.js.map → chunk-S6CMAXQF.js.map} +0 -0
  373. /package/build/modern/{chunk-QO2UXGW4.js.map → chunk-VPWBSZAR.js.map} +0 -0
  374. /package/build/{legacy/aria-helpers/nav-menu.aria.js.map → modern/components/Checkbox.js.map} +0 -0
  375. /package/build/{legacy/aria-helpers/tabs.aria.js.map → modern/components/FileStatus.js.map} +0 -0
  376. /package/build/{legacy/aria-helpers/trap-focus.aria.js.map → modern/components/ProgressBar.js.map} +0 -0
  377. /package/build/{legacy/chunk-55J6XMHW.js.map → modern/components/Select.js.map} +0 -0
  378. /package/build/{legacy/components/Button.js.map → modern/config/icons/checkbox.icons.js.map} +0 -0
@@ -1,27 +0,0 @@
1
- import {
2
- defaultIcons
3
- } from "./chunk-GVNPFXKL.js";
4
-
5
- // src/config/defineIcons.ts
6
- function _validateIconsProperties(icons) {
7
- if (!icons.invalid) {
8
- throw new Error(
9
- "The an invalid property must be defined in your custom icons library."
10
- );
11
- }
12
- }
13
- function defineIcons(icons) {
14
- _validateIconsProperties(icons);
15
- $cerberusIcons = {
16
- ...defaultIcons,
17
- ...icons
18
- };
19
- return $cerberusIcons;
20
- }
21
- var $cerberusIcons = defaultIcons;
22
-
23
- export {
24
- defineIcons,
25
- $cerberusIcons
26
- };
27
- //# sourceMappingURL=chunk-BEYPMC73.js.map
@@ -1,58 +0,0 @@
1
- import {
2
- Show
3
- } from "./chunk-4O4QFF4S.js";
4
-
5
- // src/components/Tag.tsx
6
- import { Close } from "@cerberus/icons";
7
- import { css, cx } from "@cerberus/styled-system/css";
8
- import { iconButton, tag } from "@cerberus/styled-system/recipes";
9
- import { jsx, jsxs } from "react/jsx-runtime";
10
- function Tag(props) {
11
- const { shape: initShape, gradient, onClick, usage, ...nativeProps } = props;
12
- const palette = (props == null ? void 0 : props.palette) ?? "page";
13
- const isClosable = Boolean(onClick);
14
- const shape = isClosable ? "pill" : initShape;
15
- const closableStyles = isClosable ? closableCss : "";
16
- return /* @__PURE__ */ jsxs(
17
- "span",
18
- {
19
- ...nativeProps,
20
- className: cx(
21
- nativeProps.className,
22
- tag({
23
- gradient,
24
- palette,
25
- shape,
26
- usage
27
- }),
28
- closableStyles
29
- ),
30
- children: [
31
- props.children,
32
- /* @__PURE__ */ jsx(Show, { when: isClosable, children: /* @__PURE__ */ jsx(
33
- "button",
34
- {
35
- "aria-label": "Close",
36
- className: iconButton({
37
- palette: "action",
38
- usage: "filled",
39
- size: "sm"
40
- }),
41
- onClick,
42
- children: /* @__PURE__ */ jsx(Close, {})
43
- }
44
- ) })
45
- ]
46
- }
47
- );
48
- }
49
- var closableCss = css({
50
- bgColor: "action.bg.active",
51
- color: "action.text.initial",
52
- paddingInlineEnd: "0"
53
- });
54
-
55
- export {
56
- Tag
57
- };
58
- //# sourceMappingURL=chunk-EVEEQRH6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Tag.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { Close } from '@cerberus/icons'\nimport { Show } from './Show'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { iconButton, tag } from '@cerberus/styled-system/recipes'\nimport type { RecipeVariantProps } from '@cerberus/styled-system/types'\n\n/**\n * This module contains the tag component.\n * @module\n */\n\nexport type TagRecipeProps = RecipeVariantProps<typeof tag>\n\nexport type StaticTagProps = HTMLAttributes<HTMLSpanElement> &\n TagRecipeProps & {\n onClick?: never\n }\n\nexport type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & {\n gradient?: never\n palette?: never\n onClick: () => void\n shape: 'pill'\n usage: 'filled'\n}\n\nexport type TagProps = StaticTagProps | ClickableTagProps\n\n/**\n * The Tag component is used to display a meta descriptions.\n * @definition [Tag docs](https://cerberus.digitalu.design/react/tags)\n * @example\n * ```tsx\n * <Tag>Tag</Tag>\n * ```\n */\nexport function Tag(props: PropsWithChildren<TagProps>): JSX.Element {\n const { shape: initShape, gradient, onClick, usage, ...nativeProps } = props\n const palette = props?.palette ?? 'page'\n const isClosable = Boolean(onClick)\n const shape = isClosable ? 'pill' : initShape\n const closableStyles = isClosable ? closableCss : ''\n\n return (\n <span\n {...nativeProps}\n className={cx(\n nativeProps.className,\n tag({\n gradient,\n palette,\n shape,\n usage,\n }),\n closableStyles,\n )}\n >\n {props.children}\n\n <Show when={isClosable}>\n <button\n aria-label=\"Close\"\n className={iconButton({\n palette: 'action',\n usage: 'filled',\n size: 'sm',\n })}\n onClick={onClick}\n >\n <Close />\n </button>\n </Show>\n </span>\n )\n}\n\nconst closableCss = css({\n bgColor: 'action.bg.active',\n color: 'action.text.initial',\n paddingInlineEnd: '0',\n})\n"],"mappings":";;;;;AACA,SAAS,aAAa;AAEtB,SAAS,KAAK,UAAU;AACxB,SAAS,YAAY,WAAW;AAyC5B,SAyBM,KAzBN;AARG,SAAS,IAAI,OAAiD;AACnE,QAAM,EAAE,OAAO,WAAW,UAAU,SAAS,OAAO,GAAG,YAAY,IAAI;AACvE,QAAM,WAAU,+BAAO,YAAW;AAClC,QAAM,aAAa,QAAQ,OAAO;AAClC,QAAM,QAAQ,aAAa,SAAS;AACpC,QAAM,iBAAiB,aAAa,cAAc;AAElD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,IAAI;AAAA,UACF;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,QACD;AAAA,MACF;AAAA,MAEC;AAAA,cAAM;AAAA,QAEP,oBAAC,QAAK,MAAM,YACV;AAAA,UAAC;AAAA;AAAA,YACC,cAAW;AAAA,YACX,WAAW,WAAW;AAAA,cACpB,SAAS;AAAA,cACT,OAAO;AAAA,cACP,MAAM;AAAA,YACR,CAAC;AAAA,YACD;AAAA,YAEA,8BAAC,SAAM;AAAA;AAAA,QACT,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAM,cAAc,IAAI;AAAA,EACtB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,kBAAkB;AACpB,CAAC;","names":[]}
@@ -1,64 +0,0 @@
1
- import {
2
- useTabsContext
3
- } from "./chunk-KF24CS4S.js";
4
-
5
- // src/aria-helpers/tabs.aria.ts
6
- import { useEffect, useState } from "react";
7
- function getNextIndex(index, length) {
8
- return index === length - 1 ? 0 : index + 1;
9
- }
10
- function getPrevIndex(index, length) {
11
- return index === 0 ? length - 1 : index - 1;
12
- }
13
- function useTabsKeyboardNavigation() {
14
- const { tabs } = useTabsContext();
15
- const [activeTab, setActiveTab] = useState(-1);
16
- useEffect(() => {
17
- const handleKeyDown = (event) => {
18
- const index = activeTab === -1 ? tabs.current.findIndex((tab) => tab.ariaSelected === "true") : activeTab;
19
- const nextIndex = getNextIndex(index, tabs.current.length);
20
- const prevIndex = getPrevIndex(index, tabs.current.length);
21
- if (index === -1) return;
22
- switch (event.key) {
23
- case "ArrowLeft":
24
- event.preventDefault();
25
- setActiveTab(prevIndex);
26
- tabs.current[prevIndex].focus();
27
- break;
28
- case "ArrowRight":
29
- event.preventDefault();
30
- setActiveTab(nextIndex);
31
- tabs.current[nextIndex].focus();
32
- break;
33
- case "Home":
34
- event.preventDefault();
35
- setActiveTab(0);
36
- tabs.current[0].focus();
37
- break;
38
- case "End":
39
- event.preventDefault();
40
- setActiveTab(tabs.current.length - 1);
41
- tabs.current[tabs.current.length - 1].focus();
42
- break;
43
- default:
44
- break;
45
- }
46
- };
47
- document.addEventListener("keydown", handleKeyDown);
48
- return () => {
49
- document.removeEventListener("keydown", handleKeyDown);
50
- };
51
- }, [activeTab, tabs.current]);
52
- return {
53
- ref: (tab) => {
54
- if (tab && !tabs.current.includes(tab)) {
55
- tabs.current.push(tab);
56
- }
57
- }
58
- };
59
- }
60
-
61
- export {
62
- useTabsKeyboardNavigation
63
- };
64
- //# sourceMappingURL=chunk-GKUDLVOV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/aria-helpers/tabs.aria.ts"],"sourcesContent":["'use client'\n\nimport { useEffect, useState } from 'react'\nimport { useTabsContext } from '../context/tabs'\n\nfunction getNextIndex(index: number, length: number) {\n return index === length - 1 ? 0 : index + 1\n}\n\nfunction getPrevIndex(index: number, length: number) {\n return index === 0 ? length - 1 : index - 1\n}\n\nexport function useTabsKeyboardNavigation() {\n const { tabs } = useTabsContext()\n const [activeTab, setActiveTab] = useState(-1)\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const index =\n activeTab === -1\n ? tabs.current.findIndex((tab) => tab.ariaSelected === 'true')\n : activeTab\n const nextIndex = getNextIndex(index, tabs.current.length)\n const prevIndex = getPrevIndex(index, tabs.current.length)\n\n // If the active tab is not found, do nothing\n if (index === -1) return\n\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault()\n setActiveTab(prevIndex)\n tabs.current[prevIndex].focus()\n break\n case 'ArrowRight':\n event.preventDefault()\n setActiveTab(nextIndex)\n tabs.current[nextIndex].focus()\n break\n case 'Home':\n event.preventDefault()\n setActiveTab(0)\n tabs.current[0].focus()\n break\n case 'End':\n event.preventDefault()\n setActiveTab(tabs.current.length - 1)\n tabs.current[tabs.current.length - 1].focus()\n break\n default:\n break\n }\n }\n\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [activeTab, tabs.current])\n\n return {\n ref: (tab: HTMLButtonElement) => {\n if (tab && !tabs.current.includes(tab)) {\n tabs.current.push(tab)\n }\n },\n }\n}\n"],"mappings":";;;;;AAEA,SAAS,WAAW,gBAAgB;AAGpC,SAAS,aAAa,OAAe,QAAgB;AACnD,SAAO,UAAU,SAAS,IAAI,IAAI,QAAQ;AAC5C;AAEA,SAAS,aAAa,OAAe,QAAgB;AACnD,SAAO,UAAU,IAAI,SAAS,IAAI,QAAQ;AAC5C;AAEO,SAAS,4BAA4B;AAC1C,QAAM,EAAE,KAAK,IAAI,eAAe;AAChC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,EAAE;AAE7C,YAAU,MAAM;AACd,UAAM,gBAAgB,CAAC,UAAyB;AAC9C,YAAM,QACJ,cAAc,KACV,KAAK,QAAQ,UAAU,CAAC,QAAQ,IAAI,iBAAiB,MAAM,IAC3D;AACN,YAAM,YAAY,aAAa,OAAO,KAAK,QAAQ,MAAM;AACzD,YAAM,YAAY,aAAa,OAAO,KAAK,QAAQ,MAAM;AAGzD,UAAI,UAAU,GAAI;AAElB,cAAQ,MAAM,KAAK;AAAA,QACjB,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAa,SAAS;AACtB,eAAK,QAAQ,SAAS,EAAE,MAAM;AAC9B;AAAA,QACF,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAa,SAAS;AACtB,eAAK,QAAQ,SAAS,EAAE,MAAM;AAC9B;AAAA,QACF,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAa,CAAC;AACd,eAAK,QAAQ,CAAC,EAAE,MAAM;AACtB;AAAA,QACF,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAa,KAAK,QAAQ,SAAS,CAAC;AACpC,eAAK,QAAQ,KAAK,QAAQ,SAAS,CAAC,EAAE,MAAM;AAC5C;AAAA,QACF;AACE;AAAA,MACJ;AAAA,IACF;AAEA,aAAS,iBAAiB,WAAW,aAAa;AAElD,WAAO,MAAM;AACX,eAAS,oBAAoB,WAAW,aAAa;AAAA,IACvD;AAAA,EACF,GAAG,CAAC,WAAW,KAAK,OAAO,CAAC;AAE5B,SAAO;AAAA,IACL,KAAK,CAAC,QAA2B;AAC/B,UAAI,OAAO,CAAC,KAAK,QAAQ,SAAS,GAAG,GAAG;AACtC,aAAK,QAAQ,KAAK,GAAG;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/config/cerbIcons.ts"],"sourcesContent":["import {\n Checkmark,\n CheckmarkFilled,\n CloudUpload,\n ErrorFilled,\n Information,\n InformationFilled,\n WarningFilled,\n type CarbonIconType,\n} from '@cerberus/icons'\nimport type { ElementType } from 'react'\n\nexport type IconType = CarbonIconType | ElementType\n\nexport interface DefinedIcons {\n confirmModal?: IconType\n promptModal?: IconType\n fileUploader?: IconType\n infoNotification?: IconType\n successNotification?: IconType\n warningNotification?: IconType\n dangerNotification?: IconType\n invalid: IconType\n toggleChecked?: IconType\n}\n\nexport const defaultIcons: DefinedIcons = {\n confirmModal: Information,\n promptModal: Information,\n fileUploader: CloudUpload,\n infoNotification: InformationFilled,\n successNotification: CheckmarkFilled,\n warningNotification: WarningFilled,\n dangerNotification: ErrorFilled,\n invalid: WarningFilled,\n toggleChecked: Checkmark,\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAiBA,IAAM,eAA6B;AAAA,EACxC,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,eAAe;AACjB;","names":[]}
@@ -1,22 +0,0 @@
1
- // src/components/NotificationDescription.tsx
2
- import { cx } from "@cerberus/styled-system/css";
3
- import {
4
- notification
5
- } from "@cerberus/styled-system/recipes";
6
- import { jsx } from "react/jsx-runtime";
7
- function NotificationDescription(props) {
8
- const { palette, ...nativeProps } = props;
9
- const styles = notification({ palette });
10
- return /* @__PURE__ */ jsx(
11
- "p",
12
- {
13
- className: cx(nativeProps.className, styles.description),
14
- ...nativeProps
15
- }
16
- );
17
- }
18
-
19
- export {
20
- NotificationDescription
21
- };
22
- //# sourceMappingURL=chunk-HW76XVA3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/NotificationDescription.tsx"],"sourcesContent":["/**\n * This module exports the NotificationDescription component.\n * @module\n */\n\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n notification,\n type NotificationVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport type { HTMLAttributes } from 'react'\n\nexport interface BaseNotificationDescriptionProps\n extends HTMLAttributes<HTMLParagraphElement> {}\nexport type NotificationDescriptionProps = BaseNotificationDescriptionProps &\n NotificationVariantProps\n\n/**\n * The NotificationDescription component is used to render the description of a notification.\n * @param props - The anything a HTMLParagraphElement can accept.\n */\nexport function NotificationDescription(props: NotificationDescriptionProps) {\n const { palette, ...nativeProps } = props\n const styles = notification({ palette })\n return (\n <p\n className={cx(nativeProps.className, styles.description)}\n {...nativeProps}\n />\n )\n}\n"],"mappings":";AAKA,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,OAEK;AAgBH;AAJG,SAAS,wBAAwB,OAAqC;AAC3E,QAAM,EAAE,SAAS,GAAG,YAAY,IAAI;AACpC,QAAM,SAAS,aAAa,EAAE,QAAQ,CAAC;AACvC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,YAAY,WAAW,OAAO,WAAW;AAAA,MACtD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
@@ -1,32 +0,0 @@
1
- import {
2
- useTabsContext
3
- } from "./chunk-KF24CS4S.js";
4
-
5
- // src/components/TabList.tsx
6
- import { cx } from "@cerberus/styled-system/css";
7
- import { hstack } from "@cerberus/styled-system/patterns";
8
- import { jsx } from "react/jsx-runtime";
9
- function TabList(props) {
10
- const { description, ...nativeProps } = props;
11
- const { id, styles } = useTabsContext();
12
- return /* @__PURE__ */ jsx(
13
- "div",
14
- {
15
- ...nativeProps,
16
- "aria-describedby": description,
17
- className: cx(
18
- nativeProps.className,
19
- hstack({
20
- gap: "0"
21
- }),
22
- styles.tabList
23
- ),
24
- id: id ?? nativeProps.id
25
- }
26
- );
27
- }
28
-
29
- export {
30
- TabList
31
- };
32
- //# sourceMappingURL=chunk-ISPTI4GC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/TabList.tsx"],"sourcesContent":["'use client'\n\nimport { cx } from '@cerberus/styled-system/css'\nimport { hstack } from '@cerberus/styled-system/patterns'\nimport type { HTMLAttributes, PropsWithChildren } from 'react'\nimport { useTabsContext } from '../context/tabs'\n\n/**\n * This module provides a TabList component.\n * @module\n */\n\nexport interface TabListProps extends HTMLAttributes<HTMLDivElement> {\n description: string\n}\n\n/**\n * The TabList component provides a container for tab elements.\n * @param description - a description of what the tab list contains\n * @example\n * ```tsx\n * <TabList description=\"Button details\">\n * <Tab id=\"overview\">Overview</Tab>\n * <Tab id=\"guidelines\">Guidelines</Tab>\n * </TabList>\n * ```\n */\nexport function TabList(props: PropsWithChildren<TabListProps>) {\n const { description, ...nativeProps } = props\n const { id, styles } = useTabsContext()\n\n return (\n <div\n {...nativeProps}\n aria-describedby={description}\n className={cx(\n nativeProps.className,\n hstack({\n gap: '0',\n }),\n styles.tabList,\n )}\n id={id ?? nativeProps.id}\n />\n )\n}\n"],"mappings":";;;;;AAEA,SAAS,UAAU;AACnB,SAAS,cAAc;AA6BnB;AALG,SAAS,QAAQ,OAAwC;AAC9D,QAAM,EAAE,aAAa,GAAG,YAAY,IAAI;AACxC,QAAM,EAAE,IAAI,OAAO,IAAI,eAAe;AAEtC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,oBAAkB;AAAA,MAClB,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,UACL,KAAK;AAAA,QACP,CAAC;AAAA,QACD,OAAO;AAAA,MACT;AAAA,MACA,IAAI,MAAM,YAAY;AAAA;AAAA,EACxB;AAEJ;","names":[]}
@@ -1,12 +0,0 @@
1
- // src/components/ModalHeading.tsx
2
- import { cx } from "@cerberus/styled-system/css";
3
- import { modal } from "@cerberus/styled-system/recipes";
4
- import { jsx } from "react/jsx-runtime";
5
- function ModalHeading(props) {
6
- return /* @__PURE__ */ jsx("p", { ...props, className: cx(props.className, modal().heading) });
7
- }
8
-
9
- export {
10
- ModalHeading
11
- };
12
- //# sourceMappingURL=chunk-JB7IQ2BM.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/ModalHeading.tsx"],"sourcesContent":["import { cx } from '@cerberus/styled-system/css'\nimport { modal } from '@cerberus/styled-system/recipes'\nimport type { HTMLAttributes } from 'react'\n\n/**\n * This module contains the ModalHeading component for a customizable modal.\n * @module\n */\n\nexport type ModalHeadingProps = HTMLAttributes<HTMLParagraphElement>\n\n/**\n * The ModalHeading component is a heading element for a customizable modal.\n * @example\n * ```tsx\n * <Modal>\n * <ModalHeading>Modal Heading</ModalHeading>\n * </Modal>\n * ```\n */\nexport function ModalHeading(props: ModalHeadingProps) {\n return <p {...props} className={cx(props.className, modal().heading)} />\n}\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,aAAa;AAoBb;AADF,SAAS,aAAa,OAA0B;AACrD,SAAO,oBAAC,OAAG,GAAG,OAAO,WAAW,GAAG,MAAM,WAAW,MAAM,EAAE,OAAO,GAAG;AACxE;","names":[]}
@@ -1,12 +0,0 @@
1
- // src/aria-helpers/nav-menu.aria.ts
2
- function createNavTriggerProps(values) {
3
- return {
4
- ["aria-controls"]: values.controls,
5
- ["aria-expanded"]: values.expanded ?? false
6
- };
7
- }
8
-
9
- export {
10
- createNavTriggerProps
11
- };
12
- //# sourceMappingURL=chunk-JF76VIL3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/aria-helpers/nav-menu.aria.ts"],"sourcesContent":["export interface NavTriggerAriaValues {\n controls: string\n expanded?: boolean\n}\n\ninterface NavTriggerAriaReturn {\n ['aria-controls']: string\n ['aria-expanded']: boolean\n}\n\nexport function createNavTriggerProps(\n values: NavTriggerAriaValues,\n): NavTriggerAriaReturn {\n return {\n ['aria-controls']: values.controls,\n ['aria-expanded']: values.expanded ?? false,\n }\n}\n"],"mappings":";AAUO,SAAS,sBACd,QACsB;AACtB,SAAO;AAAA,IACL,CAAC,eAAe,GAAG,OAAO;AAAA,IAC1B,CAAC,eAAe,GAAG,OAAO,YAAY;AAAA,EACxC;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/ModalIcon.tsx"],"sourcesContent":["import { cx } from '@cerberus/styled-system/css'\nimport { circle } from '@cerberus/styled-system/patterns'\nimport {\n modalIcon,\n type ModalIconVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport type { HTMLAttributes, PropsWithChildren } from 'react'\n\nexport type ModalIconBaseProps = HTMLAttributes<HTMLDivElement>\nexport type ModalIconProps = ModalIconBaseProps & ModalIconVariantProps\n\nexport function ModalIcon(props: PropsWithChildren<ModalIconProps>) {\n const { palette, ...nativeProps } = props\n return (\n <div\n {...nativeProps}\n className={cx(\n nativeProps.className,\n modalIcon({\n palette,\n }),\n circle(),\n )}\n >\n {props.children}\n </div>\n )\n}\n"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,OAEK;AASH;AAHG,SAAS,UAAU,OAA0C;AAClE,QAAM,EAAE,SAAS,GAAG,YAAY,IAAI;AACpC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW;AAAA,QACT,YAAY;AAAA,QACZ,UAAU;AAAA,UACR;AAAA,QACF,CAAC;AAAA,QACD,OAAO;AAAA,MACT;AAAA,MAEC,gBAAM;AAAA;AAAA,EACT;AAEJ;","names":[]}
@@ -1,30 +0,0 @@
1
- // src/aria-helpers/trap-focus.aria.ts
2
- function trapFocus(modalRef) {
3
- var _a;
4
- const focusableElements = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
5
- const focusable = Array.from(
6
- ((_a = modalRef.current) == null ? void 0 : _a.querySelectorAll(focusableElements)) ?? []
7
- );
8
- const firstFocusable = focusable[0];
9
- const lastFocusable = focusable[focusable.length - 1];
10
- return function handleKeyDown(event) {
11
- if (event.key === "Tab") {
12
- if (event.shiftKey) {
13
- if (document.activeElement === firstFocusable) {
14
- lastFocusable.focus();
15
- event.preventDefault();
16
- }
17
- } else {
18
- if (document.activeElement === lastFocusable) {
19
- firstFocusable.focus();
20
- event.preventDefault();
21
- }
22
- }
23
- }
24
- };
25
- }
26
-
27
- export {
28
- trapFocus
29
- };
30
- //# sourceMappingURL=chunk-KESKDLX6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/aria-helpers/trap-focus.aria.ts"],"sourcesContent":["import type { KeyboardEvent, KeyboardEventHandler, RefObject } from 'react'\n\nexport function trapFocus(\n modalRef: RefObject<HTMLDialogElement>,\n): KeyboardEventHandler<HTMLDialogElement> {\n const focusableElements =\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n const focusable = Array.from(\n modalRef.current?.querySelectorAll(focusableElements) ?? [],\n )\n const firstFocusable = focusable[0] as HTMLElement\n const lastFocusable = focusable[focusable.length - 1] as HTMLElement\n\n return function handleKeyDown(event: KeyboardEvent<HTMLDialogElement>) {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstFocusable) {\n lastFocusable.focus()\n event.preventDefault()\n }\n } else {\n if (document.activeElement === lastFocusable) {\n firstFocusable.focus()\n event.preventDefault()\n }\n }\n }\n }\n}\n"],"mappings":";AAEO,SAAS,UACd,UACyC;AAJ3C;AAKE,QAAM,oBACJ;AACF,QAAM,YAAY,MAAM;AAAA,MACtB,cAAS,YAAT,mBAAkB,iBAAiB,uBAAsB,CAAC;AAAA,EAC5D;AACA,QAAM,iBAAiB,UAAU,CAAC;AAClC,QAAM,gBAAgB,UAAU,UAAU,SAAS,CAAC;AAEpD,SAAO,SAAS,cAAc,OAAyC;AACrE,QAAI,MAAM,QAAQ,OAAO;AACvB,UAAI,MAAM,UAAU;AAClB,YAAI,SAAS,kBAAkB,gBAAgB;AAC7C,wBAAc,MAAM;AACpB,gBAAM,eAAe;AAAA,QACvB;AAAA,MACF,OAAO;AACL,YAAI,SAAS,kBAAkB,eAAe;AAC5C,yBAAe,MAAM;AACrB,gBAAM,eAAe;AAAA,QACvB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1,58 +0,0 @@
1
- // src/context/tabs.tsx
2
- import { tabs } from "@cerberus/styled-system/recipes";
3
- import {
4
- createContext,
5
- useContext,
6
- useEffect,
7
- useMemo,
8
- useRef,
9
- useState
10
- } from "react";
11
- import { jsx } from "react/jsx-runtime";
12
- var TabsContext = createContext(null);
13
- function Tabs(props) {
14
- const { cache, active, id, palette } = props;
15
- const [activeTab, setActiveTab] = useState(() => cache ? "" : active ?? "");
16
- const tabsList = useRef([]);
17
- const uuid = useMemo(() => {
18
- return id ? `cerberus-tabs-${id}` : "cerberus-tabs";
19
- }, [id]);
20
- const value = useMemo(
21
- () => ({
22
- tabs: tabsList,
23
- id: uuid,
24
- active: activeTab,
25
- styles: tabs({ palette }),
26
- onTabUpdate: setActiveTab
27
- }),
28
- [activeTab, setActiveTab, palette, uuid, tabsList]
29
- );
30
- useEffect(() => {
31
- if (cache) {
32
- const cachedTab = window.localStorage.getItem(uuid);
33
- setActiveTab(
34
- cache ? cachedTab || (props.active ?? "") : props.active ?? ""
35
- );
36
- }
37
- }, [cache, active, uuid]);
38
- useEffect(() => {
39
- if (cache && activeTab) {
40
- window.localStorage.setItem(uuid, activeTab);
41
- }
42
- }, [activeTab, cache]);
43
- return /* @__PURE__ */ jsx(TabsContext.Provider, { value, children: props.children });
44
- }
45
- function useTabsContext() {
46
- const context = useContext(TabsContext);
47
- if (!context) {
48
- throw new Error("useTabsContext must be used within a Tabs Provider.");
49
- }
50
- return context;
51
- }
52
-
53
- export {
54
- TabsContext,
55
- Tabs,
56
- useTabsContext
57
- };
58
- //# sourceMappingURL=chunk-KF24CS4S.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/context/tabs.tsx"],"sourcesContent":["'use client'\n\nimport { tabs, type TabsVariantProps } from '@cerberus/styled-system/recipes'\nimport type { Pretty } from '@cerberus/styled-system/types'\nimport {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type MutableRefObject,\n type PropsWithChildren,\n} from 'react'\n\n/**\n * This module provides a Tabs component and a hook to access its context.\n * @module\n */\n\nexport interface TabsContextValue {\n tabs: MutableRefObject<HTMLButtonElement[]>\n id: string\n active: string\n styles: Pretty<Record<'tabList' | 'tab' | 'tabPanel', string>>\n onTabUpdate: (active: string) => void\n}\n\nexport const TabsContext = createContext<TabsContextValue | null>(null)\n\nexport interface TabsProps {\n id?: string\n active?: string\n cache?: boolean\n}\n\n/**\n * The Tabs component provides a context to manage tab state.\n * @param id - the id of the tabs component,\n * @param active - the default active tab id,\n * @param cache - whether to cache the active tab state in local storage\n * @example\n * ```tsx\n * <Tabs cache>\n * <TabList description=\"Button details\">\n * <Tab id=\"overview\">Overview</Tab>\n * <Tab id=\"guidelines\">Guidelines</Tab>\n * </TabList>\n * <TabPanels>\n * <TabPanel id=\"overview\">Overview content</TabPanel>\n * <TabPanel id=\"guidelines\">Guidelines content</TabPanel>\n * </TabPanels>\n * </Tabs>\n * ```\n */\nexport function Tabs(\n props: PropsWithChildren<TabsProps & TabsVariantProps>,\n): JSX.Element {\n const { cache, active, id, palette } = props\n const [activeTab, setActiveTab] = useState(() => (cache ? '' : active ?? ''))\n const tabsList = useRef<HTMLButtonElement[]>([])\n const uuid = useMemo(() => {\n return id ? `cerberus-tabs-${id}` : 'cerberus-tabs'\n }, [id])\n\n const value = useMemo(\n () => ({\n tabs: tabsList,\n id: uuid,\n active: activeTab,\n styles: tabs({ palette }),\n onTabUpdate: setActiveTab,\n }),\n [activeTab, setActiveTab, palette, uuid, tabsList],\n )\n\n // Get the active tab from local storage\n useEffect(() => {\n if (cache) {\n const cachedTab = window.localStorage.getItem(uuid)\n setActiveTab(\n cache ? cachedTab || (props.active ?? '') : props.active ?? '',\n )\n }\n }, [cache, active, uuid])\n\n // Update the active tab in local storage\n useEffect(() => {\n if (cache && activeTab) {\n window.localStorage.setItem(uuid, activeTab)\n }\n }, [activeTab, cache])\n\n return (\n <TabsContext.Provider value={value}>{props.children}</TabsContext.Provider>\n )\n}\n\nexport function useTabsContext(): TabsContextValue {\n const context = useContext(TabsContext)\n if (!context) {\n throw new Error('useTabsContext must be used within a Tabs Provider.')\n }\n return context\n}\n"],"mappings":";AAEA,SAAS,YAAmC;AAE5C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAiFH;AAlEG,IAAM,cAAc,cAAuC,IAAI;AA2B/D,SAAS,KACd,OACa;AACb,QAAM,EAAE,OAAO,QAAQ,IAAI,QAAQ,IAAI;AACvC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,MAAO,QAAQ,KAAK,UAAU,EAAG;AAC5E,QAAM,WAAW,OAA4B,CAAC,CAAC;AAC/C,QAAM,OAAO,QAAQ,MAAM;AACzB,WAAO,KAAK,iBAAiB,EAAE,KAAK;AAAA,EACtC,GAAG,CAAC,EAAE,CAAC;AAEP,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,QAAQ;AAAA,MACR,QAAQ,KAAK,EAAE,QAAQ,CAAC;AAAA,MACxB,aAAa;AAAA,IACf;AAAA,IACA,CAAC,WAAW,cAAc,SAAS,MAAM,QAAQ;AAAA,EACnD;AAGA,YAAU,MAAM;AACd,QAAI,OAAO;AACT,YAAM,YAAY,OAAO,aAAa,QAAQ,IAAI;AAClD;AAAA,QACE,QAAQ,cAAc,MAAM,UAAU,MAAM,MAAM,UAAU;AAAA,MAC9D;AAAA,IACF;AAAA,EACF,GAAG,CAAC,OAAO,QAAQ,IAAI,CAAC;AAGxB,YAAU,MAAM;AACd,QAAI,SAAS,WAAW;AACtB,aAAO,aAAa,QAAQ,MAAM,SAAS;AAAA,IAC7C;AAAA,EACF,GAAG,CAAC,WAAW,KAAK,CAAC;AAErB,SACE,oBAAC,YAAY,UAAZ,EAAqB,OAAe,gBAAM,UAAS;AAExD;AAEO,SAAS,iBAAmC;AACjD,QAAM,UAAU,WAAW,WAAW;AACtC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,qDAAqD;AAAA,EACvE;AACA,SAAO;AACT;","names":[]}
@@ -1,51 +0,0 @@
1
- // src/context/navMenu.tsx
2
- import { css } from "@cerberus/styled-system/css";
3
- import {
4
- createContext,
5
- useCallback,
6
- useContext,
7
- useMemo,
8
- useRef,
9
- useState
10
- } from "react";
11
- import { jsx } from "react/jsx-runtime";
12
- var NavMenuContext = createContext(null);
13
- function NavMenu(props) {
14
- const triggerRef = useRef(null);
15
- const menuRef = useRef(null);
16
- const [expanded, setExpanded] = useState(false);
17
- const handleToggle = useCallback(() => {
18
- setExpanded((prev) => !prev);
19
- }, []);
20
- const value = useMemo(
21
- () => ({
22
- triggerRef,
23
- menuRef,
24
- expanded,
25
- onToggle: handleToggle
26
- }),
27
- [expanded, handleToggle]
28
- );
29
- return /* @__PURE__ */ jsx(NavMenuContext.Provider, { value, children: /* @__PURE__ */ jsx(
30
- "nav",
31
- {
32
- className: css({
33
- position: "relative"
34
- }),
35
- children: props.children
36
- }
37
- ) });
38
- }
39
- function useNavMenuContext() {
40
- const context = useContext(NavMenuContext);
41
- if (!context) {
42
- throw new Error("useNavMenuContext must be used within a NavMenu.");
43
- }
44
- return context;
45
- }
46
-
47
- export {
48
- NavMenu,
49
- useNavMenuContext
50
- };
51
- //# sourceMappingURL=chunk-KJUCHZHV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/context/navMenu.tsx"],"sourcesContent":["'use client'\n\nimport { css } from '@cerberus/styled-system/css'\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n type RefObject,\n} from 'react'\n\nexport type NavTriggerRef = RefObject<HTMLButtonElement>\nexport type NavMenuRef = RefObject<HTMLUListElement>\n\nexport interface NavMenuContextValue {\n triggerRef: NavTriggerRef | null\n menuRef: NavMenuRef | null\n expanded: boolean\n onToggle: () => void\n}\n\nconst NavMenuContext = createContext<NavMenuContextValue | null>(null)\n\nexport function NavMenu(props: PropsWithChildren): JSX.Element {\n const triggerRef = useRef<HTMLButtonElement>(null)\n const menuRef = useRef<HTMLUListElement>(null)\n const [expanded, setExpanded] = useState<boolean>(false)\n\n const handleToggle = useCallback(() => {\n setExpanded((prev) => !prev)\n }, [])\n\n const value = useMemo(\n () => ({\n triggerRef,\n menuRef,\n expanded,\n onToggle: handleToggle,\n }),\n [expanded, handleToggle],\n )\n\n return (\n <NavMenuContext.Provider value={value}>\n <nav\n className={css({\n position: 'relative',\n })}\n >\n {props.children}\n </nav>\n </NavMenuContext.Provider>\n )\n}\n\nexport function useNavMenuContext(): NavMenuContextValue {\n const context = useContext(NavMenuContext)\n if (!context) {\n throw new Error('useNavMenuContext must be used within a NavMenu.')\n }\n return context\n}\n"],"mappings":";AAEA,SAAS,WAAW;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAmCD;AAvBN,IAAM,iBAAiB,cAA0C,IAAI;AAE9D,SAAS,QAAQ,OAAuC;AAC7D,QAAM,aAAa,OAA0B,IAAI;AACjD,QAAM,UAAU,OAAyB,IAAI;AAC7C,QAAM,CAAC,UAAU,WAAW,IAAI,SAAkB,KAAK;AAEvD,QAAM,eAAe,YAAY,MAAM;AACrC,gBAAY,CAAC,SAAS,CAAC,IAAI;AAAA,EAC7B,GAAG,CAAC,CAAC;AAEL,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,IACZ;AAAA,IACA,CAAC,UAAU,YAAY;AAAA,EACzB;AAEA,SACE,oBAAC,eAAe,UAAf,EAAwB,OACvB;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,IAAI;AAAA,QACb,UAAU;AAAA,MACZ,CAAC;AAAA,MAEA,gBAAM;AAAA;AAAA,EACT,GACF;AAEJ;AAEO,SAAS,oBAAyC;AACvD,QAAM,UAAU,WAAW,cAAc;AACzC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,SAAO;AACT;","names":[]}
@@ -1,208 +0,0 @@
1
- import {
2
- Portal
3
- } from "./chunk-4CAT3FHV.js";
4
- import {
5
- Input
6
- } from "./chunk-XB4ZRAH4.js";
7
- import {
8
- Label
9
- } from "./chunk-JJGZRBIR.js";
10
- import {
11
- Modal
12
- } from "./chunk-2UFNQM55.js";
13
- import {
14
- ModalDescription
15
- } from "./chunk-4M4LCQ43.js";
16
- import {
17
- ModalHeader
18
- } from "./chunk-QU7UV5DB.js";
19
- import {
20
- ModalHeading
21
- } from "./chunk-JB7IQ2BM.js";
22
- import {
23
- ModalIcon
24
- } from "./chunk-JJP2TFTU.js";
25
- import {
26
- Button
27
- } from "./chunk-6F34A7NZ.js";
28
- import {
29
- Field
30
- } from "./chunk-ZAU4JVLL.js";
31
- import {
32
- Show
33
- } from "./chunk-4O4QFF4S.js";
34
- import {
35
- trapFocus
36
- } from "./chunk-KESKDLX6.js";
37
- import {
38
- $cerberusIcons
39
- } from "./chunk-BEYPMC73.js";
40
- import {
41
- useModal
42
- } from "./chunk-TZNYJ3G7.js";
43
-
44
- // src/context/prompt-modal.tsx
45
- import {
46
- createContext,
47
- useCallback,
48
- useContext,
49
- useMemo,
50
- useRef,
51
- useState
52
- } from "react";
53
- import { css } from "@cerberus/styled-system/css";
54
- import { hstack, vstack } from "@cerberus/styled-system/patterns";
55
- import { jsx, jsxs } from "react/jsx-runtime";
56
- var PromptModalContext = createContext(null);
57
- function PromptModal(props) {
58
- const { modalRef, show, close } = useModal();
59
- const resolveRef = useRef(null);
60
- const [content, setContent] = useState(null);
61
- const [inputValue, setInputValue] = useState("");
62
- const focusTrap = trapFocus(modalRef);
63
- const PromptIcon = $cerberusIcons.promptModal;
64
- const isValid = useMemo(
65
- () => inputValue === (content == null ? void 0 : content.key),
66
- [inputValue, content]
67
- );
68
- const palette = useMemo(
69
- () => (content == null ? void 0 : content.kind) === "destructive" ? "danger" : "action",
70
- [content]
71
- );
72
- const handleChange = useCallback(
73
- (e) => {
74
- setInputValue(e.currentTarget.value);
75
- },
76
- [content]
77
- );
78
- const handleChoice = useCallback(
79
- (e) => {
80
- var _a;
81
- const target = e.currentTarget;
82
- if (target.value === "true") {
83
- (_a = resolveRef.current) == null ? void 0 : _a.call(resolveRef, inputValue);
84
- }
85
- close();
86
- },
87
- [inputValue, close]
88
- );
89
- const handleShow = useCallback(
90
- (options) => {
91
- return new Promise((resolve) => {
92
- setContent({ ...options, kind: options.kind || "non-destructive" });
93
- show();
94
- resolveRef.current = resolve;
95
- });
96
- },
97
- [show]
98
- );
99
- const value = useMemo(
100
- () => ({
101
- show: handleShow
102
- }),
103
- [handleShow]
104
- );
105
- return /* @__PURE__ */ jsxs(PromptModalContext.Provider, { value, children: [
106
- props.children,
107
- /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsxs(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
108
- /* @__PURE__ */ jsxs(ModalHeader, { children: [
109
- /* @__PURE__ */ jsx(
110
- Show,
111
- {
112
- when: palette === "danger",
113
- fallback: /* @__PURE__ */ jsx(ModalIcon, { palette: "action", children: /* @__PURE__ */ jsx(PromptIcon, { size: 24 }) }),
114
- children: /* @__PURE__ */ jsx(ModalIcon, { palette: "danger", children: /* @__PURE__ */ jsx(PromptIcon, { size: 24 }) })
115
- }
116
- ),
117
- /* @__PURE__ */ jsx(ModalHeading, { children: content == null ? void 0 : content.heading }),
118
- /* @__PURE__ */ jsx(ModalDescription, { children: content == null ? void 0 : content.description })
119
- ] }),
120
- /* @__PURE__ */ jsx(
121
- "div",
122
- {
123
- className: vstack({
124
- alignItems: "flex-start",
125
- mt: "4",
126
- mb: "8"
127
- }),
128
- children: /* @__PURE__ */ jsxs(Field, { invalid: !isValid, children: [
129
- /* @__PURE__ */ jsxs(Label, { htmlFor: "confirm", size: "md", children: [
130
- "Type",
131
- /* @__PURE__ */ jsx(
132
- "strong",
133
- {
134
- className: css({
135
- textTransform: "uppercase"
136
- }),
137
- children: content == null ? void 0 : content.key
138
- }
139
- ),
140
- "to confirm"
141
- ] }),
142
- /* @__PURE__ */ jsx(
143
- Input,
144
- {
145
- id: "confirm",
146
- name: "confirm",
147
- onChange: handleChange,
148
- type: "text"
149
- }
150
- )
151
- ] })
152
- }
153
- ),
154
- /* @__PURE__ */ jsxs(
155
- "div",
156
- {
157
- className: hstack({
158
- justifyContent: "stretch",
159
- gap: "4"
160
- }),
161
- children: [
162
- /* @__PURE__ */ jsx(
163
- Button,
164
- {
165
- autoFocus: true,
166
- className: css({
167
- w: "1/2"
168
- }),
169
- disabled: !isValid,
170
- name: "confirm",
171
- onClick: handleChoice,
172
- palette,
173
- value: "true",
174
- children: content == null ? void 0 : content.actionText
175
- }
176
- ),
177
- /* @__PURE__ */ jsx(
178
- Button,
179
- {
180
- className: css({
181
- w: "1/2"
182
- }),
183
- name: "cancel",
184
- onClick: handleChoice,
185
- usage: "outlined",
186
- value: "false",
187
- children: content == null ? void 0 : content.cancelText
188
- }
189
- )
190
- ]
191
- }
192
- )
193
- ] }) })
194
- ] });
195
- }
196
- function usePromptModal() {
197
- const context = useContext(PromptModalContext);
198
- if (context === null) {
199
- throw new Error("usePromptModal must be used within a PromptModal Provider");
200
- }
201
- return context;
202
- }
203
-
204
- export {
205
- PromptModal,
206
- usePromptModal
207
- };
208
- //# sourceMappingURL=chunk-L46XIE3D.js.map