@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
@@ -11,6 +11,7 @@ import { ButtonVariantProps } from '@cerberus/styled-system/recipes';
11
11
  import { CancelDrop } from '@dnd-kit/core';
12
12
  import { CarbonIconType } from '@cerberus/icons';
13
13
  import { ChangeEvent } from 'react';
14
+ import { CheckboxVariantProps } from '@cerberus/styled-system/recipes';
14
15
  import { ClientRect as ClientRect_2 } from '@dnd-kit/core';
15
16
  import { closestCenter } from '@dnd-kit/core';
16
17
  import { closestCorners } from '@dnd-kit/core';
@@ -53,6 +54,7 @@ import { DroppableContainers } from '@dnd-kit/core';
53
54
  import { DroppableMeasuring } from '@dnd-kit/core';
54
55
  import { ElementType } from 'react';
55
56
  import { fieldMessage } from '@cerberus/styled-system/recipes';
57
+ import { FileStatusVariantProps } from '@cerberus/styled-system/recipes';
56
58
  import { ForwardRefExoticComponent } from 'react';
57
59
  import { getClientRect } from '@dnd-kit/core';
58
60
  import { getFirstCollision } from '@dnd-kit/core';
@@ -82,6 +84,7 @@ import { MouseSensor } from '@dnd-kit/core';
82
84
  import { MouseSensorOptions } from '@dnd-kit/core';
83
85
  import { MutableRefObject } from 'react';
84
86
  import { NotificationVariantProps } from '@cerberus/styled-system/recipes';
87
+ import type { OptionHTMLAttributes } from 'react';
85
88
  import { Over } from '@dnd-kit/core';
86
89
  import { PointerActivationConstraint } from '@dnd-kit/core';
87
90
  import { PointerEventHandlers } from '@dnd-kit/core';
@@ -90,6 +93,7 @@ import { PointerSensorOptions } from '@dnd-kit/core';
90
93
  import { PointerSensorProps } from '@dnd-kit/core';
91
94
  import { pointerWithin } from '@dnd-kit/core';
92
95
  import type { Pretty } from '@cerberus/styled-system/types';
96
+ import { ProgressBarVariantProps } from '@cerberus/styled-system/recipes';
93
97
  import { PropsWithChildren } from 'react';
94
98
  import { radio } from '@cerberus/styled-system/recipes';
95
99
  import { ReactNode } from 'react';
@@ -100,6 +104,8 @@ import { rectIntersection } from '@dnd-kit/core';
100
104
  import { RefAttributes } from 'react';
101
105
  import { RefObject } from 'react';
102
106
  import { ScreenReaderInstructions } from '@dnd-kit/core';
107
+ import type { SelectHTMLAttributes } from 'react';
108
+ import { SelectVariantProps } from '@cerberus/styled-system/recipes';
103
109
  import { Sensor } from '@dnd-kit/core';
104
110
  import { SensorContext } from '@dnd-kit/core';
105
111
  import { SensorDescriptor } from '@dnd-kit/core';
@@ -109,6 +115,7 @@ import { SensorOptions } from '@dnd-kit/core';
109
115
  import { SensorProps } from '@dnd-kit/core';
110
116
  import { SensorResponse } from '@dnd-kit/core';
111
117
  import { Sensors } from '@dnd-kit/core';
118
+ import type { SVGProps } from 'react';
112
119
  import type { TableHTMLAttributes } from 'react';
113
120
  import { TabsVariantProps } from '@cerberus/styled-system/recipes';
114
121
  import { tag } from '@cerberus/styled-system/recipes';
@@ -178,6 +185,46 @@ export { ButtonProps as ButtonProps_alias_1 }
178
185
 
179
186
  export { CancelDrop }
180
187
 
188
+ /**
189
+ * Checkbox component
190
+ * @definition [ARIA Target Size](https://www.w3.org/WAI/WCAG21/Understanding/target-size.html#:~:text=Understanding%20SC%202.5.,%3ATarget%20Size%20(Level%20AAA)&text=The%20size%20of%20the%20target,Equivalent)
191
+ * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)
192
+ * @definition [Checkbox docs](https://cerberus.digitalu.design/react/checkbox)
193
+ * @example
194
+ * ```tsx
195
+ * <Field>
196
+ * <Checkbox id="legal" checked={checked.legal} onChange={handleChange} />
197
+ * </Field>
198
+ * ```
199
+ */
200
+ declare function Checkbox(props: CheckboxProps): JSX_2.Element;
201
+ export { Checkbox }
202
+ export { Checkbox as Checkbox_alias_1 }
203
+
204
+ /**
205
+ * This module contains substitute icons for the Checkbox component.
206
+ * @module
207
+ */
208
+ declare interface CheckboxIconProps extends SVGProps<SVGSVGElement> {
209
+ }
210
+
211
+ /**
212
+ * This module contains the Checkbox component.
213
+ * @module
214
+ */
215
+ declare type CheckboxProps = CheckboxVariantProps & Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'id'> & {
216
+ describedBy?: string;
217
+ id: string;
218
+ mixed?: boolean;
219
+ };
220
+ export { CheckboxProps }
221
+ export { CheckboxProps as CheckboxProps_alias_1 }
222
+
223
+ /**
224
+ * Checkmark icon for Checkbox component
225
+ */
226
+ export declare function CheckmarkIcon(props: CheckboxIconProps): JSX_2.Element;
227
+
181
228
  declare type ClickableTagProps = HTMLAttributes<HTMLSpanElement> & {
182
229
  gradient?: never;
183
230
  palette?: never;
@@ -272,14 +319,21 @@ export { DefaultThemes }
272
319
  export { DefaultThemes as DefaultThemes_alias_1 }
273
320
 
274
321
  export declare interface DefinedIcons {
322
+ checkbox?: IconType;
323
+ close?: IconType;
275
324
  confirmModal?: IconType;
325
+ delete?: IconType;
276
326
  promptModal?: IconType;
277
327
  fileUploader?: IconType;
328
+ indeterminate?: IconType;
278
329
  infoNotification?: IconType;
279
330
  successNotification?: IconType;
280
331
  warningNotification?: IconType;
281
332
  dangerNotification?: IconType;
282
333
  invalid: IconType;
334
+ invalidAlt?: IconType;
335
+ redo?: IconType;
336
+ selectArrow?: IconType;
283
337
  toggleChecked?: IconType;
284
338
  }
285
339
 
@@ -448,6 +502,48 @@ declare type FieldMessageRecipe = RecipeVariantProps<typeof fieldMessage>;
448
502
  export { FieldMessageRecipe }
449
503
  export { FieldMessageRecipe as FieldMessageRecipe_alias_1 }
450
504
 
505
+ declare interface FileBaseStatusProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick'> {
506
+ file: string;
507
+ now: number;
508
+ status: processStatus;
509
+ onClick: (status: FileStatusActions, e: MouseEvent_2<HTMLButtonElement>) => void;
510
+ }
511
+ export { FileBaseStatusProps }
512
+ export { FileBaseStatusProps as FileBaseStatusProps_alias_1 }
513
+
514
+ /**
515
+ * This component displays the status of a file.
516
+ * @param props - {
517
+ * file: string,
518
+ * now: number,
519
+ * status: keyof typeof fileStatus,
520
+ * action: (status: FileStatusActions, e: MouseEvent<HTMLButtonElement>) => void
521
+ * }.
522
+ * @example
523
+ * ```tsx
524
+ * <FileStatus file="file.txt" now={0} status={processStatus.TODO} action={(status, e) => console.log(status, e)} />
525
+ * ```
526
+ */
527
+ declare function FileStatus(props: FileStatusProps): JSX_2.Element;
528
+ export { FileStatus }
529
+ export { FileStatus as FileStatus_alias_1 }
530
+
531
+ declare type FileStatusActions = 'cancel' | 'retry' | 'delete';
532
+ export { FileStatusActions }
533
+ export { FileStatusActions as FileStatusActions_alias_1 }
534
+
535
+ /**
536
+ * This module contains the FileStatus component.
537
+ * @module
538
+ */
539
+ declare type FileStatusKey = (typeof processStatus)[keyof typeof processStatus];
540
+ export { FileStatusKey }
541
+ export { FileStatusKey as FileStatusKey_alias_1 }
542
+
543
+ declare type FileStatusProps = FileBaseStatusProps & FileStatusVariantProps;
544
+ export { FileStatusProps }
545
+ export { FileStatusProps as FileStatusProps_alias_1 }
546
+
451
547
  declare function FileUploader(props: FileUploaderProps): JSX_2.Element;
452
548
  export { FileUploader }
453
549
  export { FileUploader as FileUploader_alias_1 }
@@ -505,6 +601,21 @@ export { IconButtonRecipeProps as IconButtonRecipeProps_alias_1 }
505
601
 
506
602
  export declare type IconType = CarbonIconType | ElementType;
507
603
 
604
+ /**
605
+ * Indeterminate icon for Checkbox component
606
+ */
607
+ export declare function IndeterminateIcon(props: IndeterminateIconProps): JSX_2.Element;
608
+
609
+ declare interface IndeterminateIconProps extends SVGProps<SVGSVGElement> {
610
+ }
611
+
612
+ declare type IndeterminateProgressBarProps = {
613
+ indeterminate: true;
614
+ now?: never;
615
+ };
616
+ export { IndeterminateProgressBarProps }
617
+ export { IndeterminateProgressBarProps as IndeterminateProgressBarProps_alias_1 }
618
+
508
619
  declare function Input(props: InputProps): JSX_2.Element;
509
620
  export { Input }
510
621
  export { Input as Input_alias_1 }
@@ -664,11 +775,7 @@ declare function ModalIcon(props: PropsWithChildren<ModalIconProps>): JSX_2.Elem
664
775
  export { ModalIcon }
665
776
  export { ModalIcon as ModalIcon_alias_1 }
666
777
 
667
- declare type ModalIconBaseProps = HTMLAttributes<HTMLDivElement>;
668
- export { ModalIconBaseProps }
669
- export { ModalIconBaseProps as ModalIconBaseProps_alias_1 }
670
-
671
- declare type ModalIconProps = ModalIconBaseProps & ModalIconVariantProps;
778
+ declare type ModalIconProps = HTMLAttributes<HTMLDivElement> & ModalIconVariantProps;
672
779
  export { ModalIconProps }
673
780
  export { ModalIconProps as ModalIconProps_alias_1 }
674
781
 
@@ -781,6 +888,13 @@ declare type NavTriggerRef = RefObject<HTMLButtonElement>;
781
888
  export { NavTriggerRef }
782
889
  export { NavTriggerRef as NavTriggerRef_alias_1 }
783
890
 
891
+ declare type NonIndeterminateProgressBarProps = {
892
+ indeterminate?: never;
893
+ now: number;
894
+ };
895
+ export { NonIndeterminateProgressBarProps }
896
+ export { NonIndeterminateProgressBarProps as NonIndeterminateProgressBarProps_alias_1 }
897
+
784
898
  /**
785
899
  * The info notification component.
786
900
  * @param props - The component props.
@@ -884,6 +998,22 @@ declare interface NotifyOptions {
884
998
  export { NotifyOptions }
885
999
  export { NotifyOptions as NotifyOptions_alias_1 }
886
1000
 
1001
+ /**
1002
+ * Option component
1003
+ * props: OptionHTMLAttributes<HTMLOptionElement>
1004
+ * @example
1005
+ * ```tsx
1006
+ * <Option value="one">Option 1</Option>
1007
+ * ```
1008
+ */
1009
+ declare function Option_2(props: OptionProps): JSX_2.Element;
1010
+ export { Option_2 as Option }
1011
+ export { Option_2 as Option_alias_1 }
1012
+
1013
+ declare type OptionProps = OptionHTMLAttributes<HTMLOptionElement>;
1014
+ export { OptionProps }
1015
+ export { OptionProps as OptionProps_alias_1 }
1016
+
887
1017
  export { Over }
888
1018
 
889
1019
  export { PointerActivationConstraint }
@@ -922,6 +1052,50 @@ declare type Positions = 'top' | 'right' | 'bottom' | 'left';
922
1052
  export { Positions }
923
1053
  export { Positions as Positions_alias_1 }
924
1054
 
1055
+ /**
1056
+ * A helper object to represent the status of a file.
1057
+ * @example
1058
+ * ```tsx
1059
+ * import { fileStatus } from '@cerberus/react'
1060
+ * processStatus.TODO // 'todo'
1061
+ * ```
1062
+ */
1063
+ declare const enum processStatus {
1064
+ TODO = "todo",
1065
+ PROCESSING = "processing",
1066
+ DONE = "done",
1067
+ ERROR = "error"
1068
+ }
1069
+ export { processStatus }
1070
+ export { processStatus as processStatus_alias_1 }
1071
+
1072
+ /**
1073
+ * The ProgressBar component is used to display the progress of a task.
1074
+ * @param props - HTML div element attributes
1075
+ * @param props.now - The current value of the progress bar
1076
+ * @param props.indeterminate - Whether the progress bar is indeterminate
1077
+ * @example
1078
+ * ```tsx
1079
+ * <ProgressBar value={75} />
1080
+ * ```
1081
+ */
1082
+ declare function ProgressBar(props: ProgressBarProps): JSX_2.Element;
1083
+ export { ProgressBar }
1084
+ export { ProgressBar as ProgressBar_alias_1 }
1085
+
1086
+ /**
1087
+ * This module contains the ProgressBar component.
1088
+ * @module
1089
+ */
1090
+ declare interface ProgressBarBaseProps extends HTMLAttributes<HTMLDivElement> {
1091
+ }
1092
+ export { ProgressBarBaseProps }
1093
+ export { ProgressBarBaseProps as ProgressBarBaseProps_alias_1 }
1094
+
1095
+ declare type ProgressBarProps = ProgressBarBaseProps & ProgressBarVariantProps & (NonIndeterminateProgressBarProps | IndeterminateProgressBarProps);
1096
+ export { ProgressBarProps }
1097
+ export { ProgressBarProps as ProgressBarProps_alias_1 }
1098
+
925
1099
  /**
926
1100
  * Provides a prompt modal to the app.
927
1101
  * @example
@@ -989,6 +1163,34 @@ export { rectIntersection }
989
1163
 
990
1164
  export { ScreenReaderInstructions }
991
1165
 
1166
+ /**
1167
+ * Select component
1168
+ * props: SelectHTMLAttributes<HTMLSelectElement> & SelectVariantProps & { describedBy?: string }
1169
+ * @example
1170
+ * ```tsx
1171
+ * <Select describedby="help:fruit" id="fruit">
1172
+ * <Option value="">Choose option</Option>
1173
+ * <Option value="one">Option 1</Option>
1174
+ * <Option value="two">Option 2</Option>
1175
+ * <Option value="three">Option 3</Option>
1176
+ * </Select>
1177
+ * ```
1178
+ */
1179
+ declare function Select(props: SelectProps): JSX_2.Element;
1180
+ export { Select }
1181
+ export { Select as Select_alias_1 }
1182
+
1183
+ /**
1184
+ * This module contains the select components.
1185
+ * @module
1186
+ */
1187
+ declare type SelectProps = Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> & SelectVariantProps & {
1188
+ id: string;
1189
+ describedBy?: string;
1190
+ };
1191
+ export { SelectProps }
1192
+ export { SelectProps as SelectProps_alias_1 }
1193
+
992
1194
  export { Sensor }
993
1195
 
994
1196
  export { SensorContext }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/aria-helpers/nav-menu.aria.ts
21
+ var nav_menu_aria_exports = {};
22
+ __export(nav_menu_aria_exports, {
23
+ createNavTriggerProps: () => createNavTriggerProps
24
+ });
25
+ module.exports = __toCommonJS(nav_menu_aria_exports);
26
+ function createNavTriggerProps(values) {
27
+ return {
28
+ ["aria-controls"]: values.controls,
29
+ ["aria-expanded"]: values.expanded ?? false
30
+ };
31
+ }
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ createNavTriggerProps
35
+ });
36
+ //# sourceMappingURL=nav-menu.aria.cjs.map
@@ -0,0 +1 @@
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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,SAAS,sBACd,QACsB;AACtB,SAAO;AAAA,IACL,CAAC,eAAe,GAAG,OAAO;AAAA,IAC1B,CAAC,eAAe,GAAG,OAAO,YAAY;AAAA,EACxC;AACF;","names":[]}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/aria-helpers/tabs.aria.ts
22
+ var tabs_aria_exports = {};
23
+ __export(tabs_aria_exports, {
24
+ useTabsKeyboardNavigation: () => useTabsKeyboardNavigation
25
+ });
26
+ module.exports = __toCommonJS(tabs_aria_exports);
27
+ var import_react2 = require("react");
28
+
29
+ // src/context/tabs.tsx
30
+ var import_recipes = require("@cerberus/styled-system/recipes");
31
+ var import_react = require("react");
32
+ var import_jsx_runtime = require("react/jsx-runtime");
33
+ var TabsContext = (0, import_react.createContext)(null);
34
+ function useTabsContext() {
35
+ const context = (0, import_react.useContext)(TabsContext);
36
+ if (!context) {
37
+ throw new Error("useTabsContext must be used within a Tabs Provider.");
38
+ }
39
+ return context;
40
+ }
41
+
42
+ // src/aria-helpers/tabs.aria.ts
43
+ function getNextIndex(index, length) {
44
+ return index === length - 1 ? 0 : index + 1;
45
+ }
46
+ function getPrevIndex(index, length) {
47
+ return index === 0 ? length - 1 : index - 1;
48
+ }
49
+ function useTabsKeyboardNavigation() {
50
+ const { tabs: tabs2 } = useTabsContext();
51
+ const [activeTab, setActiveTab] = (0, import_react2.useState)(-1);
52
+ (0, import_react2.useEffect)(() => {
53
+ const handleKeyDown = (event) => {
54
+ const index = activeTab === -1 ? tabs2.current.findIndex((tab) => tab.ariaSelected === "true") : activeTab;
55
+ const nextIndex = getNextIndex(index, tabs2.current.length);
56
+ const prevIndex = getPrevIndex(index, tabs2.current.length);
57
+ if (index === -1) return;
58
+ switch (event.key) {
59
+ case "ArrowLeft":
60
+ event.preventDefault();
61
+ setActiveTab(prevIndex);
62
+ tabs2.current[prevIndex].focus();
63
+ break;
64
+ case "ArrowRight":
65
+ event.preventDefault();
66
+ setActiveTab(nextIndex);
67
+ tabs2.current[nextIndex].focus();
68
+ break;
69
+ case "Home":
70
+ event.preventDefault();
71
+ setActiveTab(0);
72
+ tabs2.current[0].focus();
73
+ break;
74
+ case "End":
75
+ event.preventDefault();
76
+ setActiveTab(tabs2.current.length - 1);
77
+ tabs2.current[tabs2.current.length - 1].focus();
78
+ break;
79
+ default:
80
+ break;
81
+ }
82
+ };
83
+ document.addEventListener("keydown", handleKeyDown);
84
+ return () => {
85
+ document.removeEventListener("keydown", handleKeyDown);
86
+ };
87
+ }, [activeTab, tabs2.current]);
88
+ return {
89
+ ref: (tab) => {
90
+ if (tab && !tabs2.current.includes(tab)) {
91
+ tabs2.current.push(tab);
92
+ }
93
+ }
94
+ };
95
+ }
96
+ // Annotate the CommonJS export names for ESM import in node:
97
+ 0 && (module.exports = {
98
+ useTabsKeyboardNavigation
99
+ });
100
+ //# sourceMappingURL=tabs.aria.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/aria-helpers/tabs.aria.ts","../../../src/context/tabs.tsx"],"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","'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":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,gBAAoC;;;ACApC,qBAA4C;AAE5C,mBASO;AAiFH;AAlEG,IAAM,kBAAc,4BAAuC,IAAI;AAsE/D,SAAS,iBAAmC;AACjD,QAAM,cAAU,yBAAW,WAAW;AACtC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,qDAAqD;AAAA,EACvE;AACA,SAAO;AACT;;;ADnGA,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,MAAAC,MAAK,IAAI,eAAe;AAChC,QAAM,CAAC,WAAW,YAAY,QAAI,wBAAS,EAAE;AAE7C,+BAAU,MAAM;AACd,UAAM,gBAAgB,CAAC,UAAyB;AAC9C,YAAM,QACJ,cAAc,KACVA,MAAK,QAAQ,UAAU,CAAC,QAAQ,IAAI,iBAAiB,MAAM,IAC3D;AACN,YAAM,YAAY,aAAa,OAAOA,MAAK,QAAQ,MAAM;AACzD,YAAM,YAAY,aAAa,OAAOA,MAAK,QAAQ,MAAM;AAGzD,UAAI,UAAU,GAAI;AAElB,cAAQ,MAAM,KAAK;AAAA,QACjB,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAa,SAAS;AACtB,UAAAA,MAAK,QAAQ,SAAS,EAAE,MAAM;AAC9B;AAAA,QACF,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAa,SAAS;AACtB,UAAAA,MAAK,QAAQ,SAAS,EAAE,MAAM;AAC9B;AAAA,QACF,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAa,CAAC;AACd,UAAAA,MAAK,QAAQ,CAAC,EAAE,MAAM;AACtB;AAAA,QACF,KAAK;AACH,gBAAM,eAAe;AACrB,uBAAaA,MAAK,QAAQ,SAAS,CAAC;AACpC,UAAAA,MAAK,QAAQA,MAAK,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,WAAWA,MAAK,OAAO,CAAC;AAE5B,SAAO;AAAA,IACL,KAAK,CAAC,QAA2B;AAC/B,UAAI,OAAO,CAACA,MAAK,QAAQ,SAAS,GAAG,GAAG;AACtC,QAAAA,MAAK,QAAQ,KAAK,GAAG;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AACF;","names":["import_react","tabs"]}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/aria-helpers/trap-focus.aria.ts
21
+ var trap_focus_aria_exports = {};
22
+ __export(trap_focus_aria_exports, {
23
+ trapFocus: () => trapFocus
24
+ });
25
+ module.exports = __toCommonJS(trap_focus_aria_exports);
26
+ function trapFocus(modalRef) {
27
+ var _a;
28
+ const focusableElements = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
29
+ const focusable = Array.from(
30
+ ((_a = modalRef.current) == null ? void 0 : _a.querySelectorAll(focusableElements)) ?? []
31
+ );
32
+ const firstFocusable = focusable[0];
33
+ const lastFocusable = focusable[focusable.length - 1];
34
+ return function handleKeyDown(event) {
35
+ if (event.key === "Tab") {
36
+ if (event.shiftKey) {
37
+ if (document.activeElement === firstFocusable) {
38
+ lastFocusable.focus();
39
+ event.preventDefault();
40
+ }
41
+ } else {
42
+ if (document.activeElement === lastFocusable) {
43
+ firstFocusable.focus();
44
+ event.preventDefault();
45
+ }
46
+ }
47
+ }
48
+ };
49
+ }
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ trapFocus
53
+ });
54
+ //# sourceMappingURL=trap-focus.aria.cjs.map
@@ -0,0 +1 @@
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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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":[]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/Button.tsx
21
+ var Button_exports = {};
22
+ __export(Button_exports, {
23
+ Button: () => Button
24
+ });
25
+ module.exports = __toCommonJS(Button_exports);
26
+ var import_css = require("@cerberus/styled-system/css");
27
+ var import_recipes = require("@cerberus/styled-system/recipes");
28
+ var import_jsx_runtime = require("react/jsx-runtime");
29
+ function Button(props) {
30
+ const { palette, usage, shape, ...nativeProps } = props;
31
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
32
+ "button",
33
+ {
34
+ ...nativeProps,
35
+ className: (0, import_css.cx)(
36
+ nativeProps.className,
37
+ (0, import_recipes.button)({
38
+ palette,
39
+ usage,
40
+ shape
41
+ })
42
+ )
43
+ }
44
+ );
45
+ }
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ Button
49
+ });
50
+ //# sourceMappingURL=Button.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n button,\n type ButtonVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n ButtonVariantProps\n\n/**\n * A component that allows the user to perform actions\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAmB;AACnB,qBAGO;AAiBH;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,eAAW;AAAA,QACT,YAAY;AAAA,YACZ,uBAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}