@cerberus-design/react 0.9.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.cts +811 -126
  2. package/build/legacy/aria-helpers/tabs.aria.cjs.map +1 -1
  3. package/build/legacy/components/Avatar.cjs.map +1 -1
  4. package/build/legacy/components/Button.cjs.map +1 -1
  5. package/build/legacy/components/Checkbox.cjs.map +1 -1
  6. package/build/legacy/components/CircularProgress.cjs +180 -0
  7. package/build/legacy/components/CircularProgress.cjs.map +1 -0
  8. package/build/legacy/components/Droppable.cjs.map +1 -1
  9. package/build/legacy/components/FeatureFlag.cjs.map +1 -1
  10. package/build/legacy/components/FieldMessage.cjs.map +1 -1
  11. package/build/legacy/components/FileStatus.cjs +75 -79
  12. package/build/legacy/components/FileStatus.cjs.map +1 -1
  13. package/build/legacy/components/FileUploader.cjs +1 -1
  14. package/build/legacy/components/FileUploader.cjs.map +1 -1
  15. package/build/legacy/components/IconButton.cjs.map +1 -1
  16. package/build/legacy/components/Input.cjs.map +1 -1
  17. package/build/legacy/components/Label.cjs.map +1 -1
  18. package/build/legacy/components/Modal.cjs.map +1 -1
  19. package/build/legacy/components/ModalDescription.cjs.map +1 -1
  20. package/build/legacy/components/ModalHeader.cjs.map +1 -1
  21. package/build/legacy/components/ModalHeading.cjs.map +1 -1
  22. package/build/legacy/components/NavMenuLink.cjs.map +1 -1
  23. package/build/legacy/components/NavMenuList.cjs.map +1 -1
  24. package/build/legacy/components/NavMenuTrigger.cjs.map +1 -1
  25. package/build/legacy/components/Notification.cjs.map +1 -1
  26. package/build/legacy/components/NotificationDescription.cjs.map +1 -1
  27. package/build/legacy/components/NotificationHeading.cjs.map +1 -1
  28. package/build/legacy/components/Portal.cjs.map +1 -1
  29. package/build/legacy/components/ProgressBar.cjs +1 -1
  30. package/build/legacy/components/ProgressBar.cjs.map +1 -1
  31. package/build/legacy/components/Radio.cjs.map +1 -1
  32. package/build/legacy/components/Select.cjs.map +1 -1
  33. package/build/legacy/components/Show.cjs.map +1 -1
  34. package/build/legacy/components/Spinner.cjs +104 -0
  35. package/build/legacy/components/Spinner.cjs.map +1 -0
  36. package/build/legacy/components/Tab.cjs.map +1 -1
  37. package/build/legacy/components/TabList.cjs.map +1 -1
  38. package/build/legacy/components/TabPanel.cjs.map +1 -1
  39. package/build/legacy/components/Table.cjs.map +1 -1
  40. package/build/legacy/components/Tag.cjs +70 -4
  41. package/build/legacy/components/Tag.cjs.map +1 -1
  42. package/build/legacy/components/Tbody.cjs.map +1 -1
  43. package/build/legacy/components/Td.cjs.map +1 -1
  44. package/build/legacy/components/Textarea.cjs.map +1 -1
  45. package/build/legacy/components/Th.cjs.map +1 -1
  46. package/build/legacy/components/Thead.cjs.map +1 -1
  47. package/build/legacy/components/Toggle.cjs.map +1 -1
  48. package/build/legacy/context/confirm-modal.cjs +2 -2
  49. package/build/legacy/context/confirm-modal.cjs.map +1 -1
  50. package/build/legacy/context/feature-flags.cjs.map +1 -1
  51. package/build/legacy/context/field.cjs.map +1 -1
  52. package/build/legacy/context/navMenu.cjs.map +1 -1
  53. package/build/legacy/context/notification-center.cjs +50 -10
  54. package/build/legacy/context/notification-center.cjs.map +1 -1
  55. package/build/legacy/context/prompt-modal.cjs +2 -2
  56. package/build/legacy/context/prompt-modal.cjs.map +1 -1
  57. package/build/legacy/context/tabs.cjs.map +1 -1
  58. package/build/legacy/context/theme.cjs +37 -23
  59. package/build/legacy/context/theme.cjs.map +1 -1
  60. package/build/legacy/hooks/useModal.cjs.map +1 -1
  61. package/build/legacy/hooks/useTheme.cjs +41 -32
  62. package/build/legacy/hooks/useTheme.cjs.map +1 -1
  63. package/build/legacy/hooks/useToggle.cjs.map +1 -1
  64. package/build/legacy/index.cjs +605 -316
  65. package/build/legacy/index.cjs.map +1 -1
  66. package/build/modern/_tsup-dts-rollup.d.ts +811 -126
  67. package/build/modern/aria-helpers/tabs.aria.js +2 -2
  68. package/build/modern/{chunk-DGJPW76I.js → chunk-2RPWSVRX.js} +13 -13
  69. package/build/modern/chunk-2RPWSVRX.js.map +1 -0
  70. package/build/modern/{chunk-JB7IQ2BM.js → chunk-2UXE5PDG.js} +1 -1
  71. package/build/modern/chunk-2UXE5PDG.js.map +1 -0
  72. package/build/modern/{chunk-4CAT3FHV.js → chunk-2VX52EEJ.js} +1 -1
  73. package/build/modern/chunk-2VX52EEJ.js.map +1 -0
  74. package/build/modern/chunk-3O6UTN3J.js +155 -0
  75. package/build/modern/chunk-3O6UTN3J.js.map +1 -0
  76. package/build/modern/{chunk-UN3OAW56.js → chunk-477G5ZEL.js} +2 -2
  77. package/build/modern/chunk-477G5ZEL.js.map +1 -0
  78. package/build/modern/{chunk-PMCYXRAH.js → chunk-5V5MBSM3.js} +3 -3
  79. package/build/modern/chunk-5V5MBSM3.js.map +1 -0
  80. package/build/modern/{chunk-3GXISGPS.js → chunk-7K6PZBHN.js} +2 -2
  81. package/build/modern/chunk-7K6PZBHN.js.map +1 -0
  82. package/build/modern/chunk-7SYJFI5E.js +80 -0
  83. package/build/modern/chunk-7SYJFI5E.js.map +1 -0
  84. package/build/modern/{chunk-ZCIJRM2X.js → chunk-AUAPBPGW.js} +5 -5
  85. package/build/modern/chunk-AUAPBPGW.js.map +1 -0
  86. package/build/modern/{chunk-A5WYZVUR.js → chunk-B4CVET74.js} +1 -1
  87. package/build/modern/chunk-B4CVET74.js.map +1 -0
  88. package/build/modern/{chunk-2UFNQM55.js → chunk-BE4EOU2P.js} +1 -1
  89. package/build/modern/{chunk-2UFNQM55.js.map → chunk-BE4EOU2P.js.map} +1 -1
  90. package/build/modern/{chunk-VULPMZUW.js → chunk-BIDE4IJG.js} +3 -3
  91. package/build/modern/chunk-BIDE4IJG.js.map +1 -0
  92. package/build/modern/{chunk-4O4QFF4S.js → chunk-BUVVRQLZ.js} +1 -1
  93. package/build/modern/chunk-BUVVRQLZ.js.map +1 -0
  94. package/build/modern/{chunk-4M3EUP57.js → chunk-CJFW36DZ.js} +1 -1
  95. package/build/modern/chunk-CJFW36DZ.js.map +1 -0
  96. package/build/modern/{chunk-T7TOXGZT.js → chunk-E6QFLLXH.js} +21 -21
  97. package/build/modern/chunk-E6QFLLXH.js.map +1 -0
  98. package/build/modern/chunk-EB37HRCN.js +31 -0
  99. package/build/modern/chunk-EB37HRCN.js.map +1 -0
  100. package/build/modern/chunk-EJOXOICK.js +75 -0
  101. package/build/modern/chunk-EJOXOICK.js.map +1 -0
  102. package/build/modern/{chunk-6F34A7NZ.js → chunk-EXGKZGML.js} +1 -1
  103. package/build/modern/chunk-EXGKZGML.js.map +1 -0
  104. package/build/modern/{chunk-ISPTI4GC.js → chunk-EZYCKM7R.js} +2 -2
  105. package/build/modern/chunk-EZYCKM7R.js.map +1 -0
  106. package/build/modern/{chunk-4YJOK7JJ.js → chunk-GMG3B34U.js} +2 -2
  107. package/build/modern/chunk-GMG3B34U.js.map +1 -0
  108. package/build/modern/{chunk-U72VPIZA.js → chunk-HHVQ6LCA.js} +3 -3
  109. package/build/modern/chunk-HHVQ6LCA.js.map +1 -0
  110. package/build/modern/{chunk-XREC5IJE.js → chunk-HPM2XRWT.js} +1 -1
  111. package/build/modern/chunk-HPM2XRWT.js.map +1 -0
  112. package/build/modern/{chunk-2FK7NR7Y.js → chunk-I35HMGJQ.js} +5 -5
  113. package/build/modern/chunk-I35HMGJQ.js.map +1 -0
  114. package/build/modern/{chunk-WWJRKSM5.js → chunk-ILZKQP6R.js} +16 -16
  115. package/build/modern/chunk-ILZKQP6R.js.map +1 -0
  116. package/build/modern/{chunk-GKUDLVOV.js → chunk-ITOIXNJS.js} +2 -2
  117. package/build/modern/{chunk-XOVQGPIE.js → chunk-JCGWTIR4.js} +4 -4
  118. package/build/modern/chunk-JCGWTIR4.js.map +1 -0
  119. package/build/modern/{chunk-TCO46FK7.js → chunk-JIJM6JFJ.js} +2 -2
  120. package/build/modern/chunk-JIJM6JFJ.js.map +1 -0
  121. package/build/modern/{chunk-VGHVH2T3.js → chunk-JWIJHSI6.js} +5 -3
  122. package/build/modern/chunk-JWIJHSI6.js.map +1 -0
  123. package/build/modern/{chunk-6DIGPXAD.js → chunk-KBBASJIY.js} +2 -2
  124. package/build/modern/chunk-KBBASJIY.js.map +1 -0
  125. package/build/modern/{chunk-SONHHNYQ.js → chunk-LFWAJ5DX.js} +3 -3
  126. package/build/modern/chunk-LFWAJ5DX.js.map +1 -0
  127. package/build/modern/{chunk-PH64POOB.js → chunk-LJYCFFX7.js} +2 -2
  128. package/build/modern/chunk-LJYCFFX7.js.map +1 -0
  129. package/build/modern/{chunk-O6WHVUEW.js → chunk-NUGDTZCL.js} +59 -19
  130. package/build/modern/chunk-NUGDTZCL.js.map +1 -0
  131. package/build/modern/{chunk-VRPAW76S.js → chunk-O6JYYVO7.js} +5 -5
  132. package/build/modern/chunk-O6JYYVO7.js.map +1 -0
  133. package/build/modern/{chunk-KJUCHZHV.js → chunk-O75QAT4Z.js} +1 -1
  134. package/build/modern/chunk-O75QAT4Z.js.map +1 -0
  135. package/build/modern/{chunk-C5HLLGME.js → chunk-OW62FLJ6.js} +1 -1
  136. package/build/modern/chunk-OW62FLJ6.js.map +1 -0
  137. package/build/modern/{chunk-RPZAPUCF.js → chunk-OWKN5IV7.js} +3 -3
  138. package/build/modern/chunk-OWKN5IV7.js.map +1 -0
  139. package/build/modern/{chunk-PJ3744I6.js → chunk-PKQTTFWA.js} +1 -1
  140. package/build/modern/chunk-PKQTTFWA.js.map +1 -0
  141. package/build/modern/{chunk-N3FUF4TB.js → chunk-PKY46RRA.js} +1 -1
  142. package/build/modern/chunk-PKY46RRA.js.map +1 -0
  143. package/build/modern/{chunk-4M4LCQ43.js → chunk-Q7BRMIBR.js} +1 -1
  144. package/build/modern/{chunk-4M4LCQ43.js.map → chunk-Q7BRMIBR.js.map} +1 -1
  145. package/build/modern/{chunk-QEA6N6TN.js → chunk-REO5GUNC.js} +1 -1
  146. package/build/modern/chunk-REO5GUNC.js.map +1 -0
  147. package/build/modern/{chunk-KF24CS4S.js → chunk-RIFQSCHT.js} +1 -1
  148. package/build/modern/chunk-RIFQSCHT.js.map +1 -0
  149. package/build/modern/{chunk-Z6IWNVPN.js → chunk-S7XGIQY6.js} +10 -4
  150. package/build/modern/chunk-S7XGIQY6.js.map +1 -0
  151. package/build/modern/{chunk-3C2DJSEE.js → chunk-SXIXDXG3.js} +1 -1
  152. package/build/modern/chunk-SXIXDXG3.js.map +1 -0
  153. package/build/modern/{chunk-7VJOPJVX.js → chunk-TKI2CKHH.js} +1 -1
  154. package/build/modern/chunk-TKI2CKHH.js.map +1 -0
  155. package/build/modern/{chunk-SLHX5K6I.js → chunk-UBJBMOG7.js} +4 -2
  156. package/build/modern/chunk-UBJBMOG7.js.map +1 -0
  157. package/build/modern/{chunk-ZAU4JVLL.js → chunk-UZDVOIW5.js} +1 -1
  158. package/build/modern/chunk-UZDVOIW5.js.map +1 -0
  159. package/build/modern/{chunk-QZ6NS6VN.js → chunk-VG46RHBJ.js} +1 -1
  160. package/build/modern/chunk-VG46RHBJ.js.map +1 -0
  161. package/build/modern/{chunk-QU7UV5DB.js → chunk-WLEX22KS.js} +1 -1
  162. package/build/modern/chunk-WLEX22KS.js.map +1 -0
  163. package/build/modern/{chunk-FMFKM2AB.js → chunk-WZOYPFUU.js} +5 -5
  164. package/build/modern/chunk-WZOYPFUU.js.map +1 -0
  165. package/build/modern/{chunk-HW76XVA3.js → chunk-XEW6TJJ4.js} +1 -1
  166. package/build/modern/chunk-XEW6TJJ4.js.map +1 -0
  167. package/build/modern/{chunk-TYTEREKZ.js → chunk-ZFK33MVD.js} +2 -2
  168. package/build/modern/chunk-ZFK33MVD.js.map +1 -0
  169. package/build/modern/components/Avatar.js +2 -2
  170. package/build/modern/components/Button.js +1 -1
  171. package/build/modern/components/Checkbox.js +3 -3
  172. package/build/modern/components/CircularProgress.js +8 -0
  173. package/build/modern/components/CircularProgress.js.map +1 -0
  174. package/build/modern/components/Droppable.js +1 -1
  175. package/build/modern/components/FeatureFlag.js +3 -3
  176. package/build/modern/components/FieldMessage.js +2 -2
  177. package/build/modern/components/FileStatus.js +7 -7
  178. package/build/modern/components/FileUploader.js +3 -3
  179. package/build/modern/components/IconButton.js +1 -1
  180. package/build/modern/components/Input.js +3 -3
  181. package/build/modern/components/Label.js +3 -3
  182. package/build/modern/components/Modal.js +1 -1
  183. package/build/modern/components/ModalDescription.js +1 -1
  184. package/build/modern/components/ModalHeader.js +1 -1
  185. package/build/modern/components/ModalHeading.js +1 -1
  186. package/build/modern/components/NavMenuLink.js +2 -2
  187. package/build/modern/components/NavMenuList.js +3 -3
  188. package/build/modern/components/NavMenuTrigger.js +3 -3
  189. package/build/modern/components/Notification.js +1 -1
  190. package/build/modern/components/NotificationDescription.js +1 -1
  191. package/build/modern/components/NotificationHeading.js +1 -1
  192. package/build/modern/components/Portal.js +1 -1
  193. package/build/modern/components/ProgressBar.js +1 -1
  194. package/build/modern/components/Radio.js +2 -2
  195. package/build/modern/components/Select.js +3 -3
  196. package/build/modern/components/Show.js +1 -1
  197. package/build/modern/components/Spinner.js +7 -0
  198. package/build/modern/components/Spinner.js.map +1 -0
  199. package/build/modern/components/Tab.js +3 -3
  200. package/build/modern/components/TabList.js +2 -2
  201. package/build/modern/components/TabPanel.js +3 -3
  202. package/build/modern/components/Table.js +1 -1
  203. package/build/modern/components/Tag.js +5 -2
  204. package/build/modern/components/Tbody.js +1 -1
  205. package/build/modern/components/Td.js +1 -1
  206. package/build/modern/components/Textarea.js +2 -2
  207. package/build/modern/components/Th.js +2 -2
  208. package/build/modern/components/Thead.js +1 -1
  209. package/build/modern/components/Toggle.js +2 -2
  210. package/build/modern/context/confirm-modal.js +10 -10
  211. package/build/modern/context/feature-flags.js +1 -1
  212. package/build/modern/context/field.js +1 -1
  213. package/build/modern/context/navMenu.js +1 -1
  214. package/build/modern/context/notification-center.js +7 -7
  215. package/build/modern/context/prompt-modal.js +13 -13
  216. package/build/modern/context/tabs.js +1 -1
  217. package/build/modern/context/theme.js +2 -5
  218. package/build/modern/hooks/useModal.js +1 -1
  219. package/build/modern/hooks/useTheme.js +5 -1
  220. package/build/modern/hooks/useToggle.js +1 -1
  221. package/build/modern/index.js +78 -68
  222. package/build/modern/index.js.map +1 -1
  223. package/package.json +3 -4
  224. package/src/components/Avatar.tsx +28 -1
  225. package/src/components/Button.tsx +1 -1
  226. package/src/components/Checkbox.tsx +11 -1
  227. package/src/components/CircularProgress.tsx +170 -0
  228. package/src/components/Droppable.tsx +13 -0
  229. package/src/components/FeatureFlag.tsx +7 -0
  230. package/src/components/FieldMessage.tsx +13 -6
  231. package/src/components/FileStatus.tsx +43 -16
  232. package/src/components/FileUploader.tsx +11 -1
  233. package/src/components/IconButton.tsx +15 -5
  234. package/src/components/Input.tsx +21 -4
  235. package/src/components/Label.tsx +13 -8
  236. package/src/components/Modal.tsx +8 -3
  237. package/src/components/ModalDescription.tsx +1 -0
  238. package/src/components/ModalHeader.tsx +1 -0
  239. package/src/components/ModalHeading.tsx +1 -0
  240. package/src/components/NavMenuLink.tsx +22 -0
  241. package/src/components/NavMenuList.tsx +37 -5
  242. package/src/components/NavMenuTrigger.tsx +13 -0
  243. package/src/components/Notification.tsx +13 -6
  244. package/src/components/NotificationDescription.tsx +8 -6
  245. package/src/components/NotificationHeading.tsx +8 -6
  246. package/src/components/Portal.tsx +9 -2
  247. package/src/components/ProgressBar.tsx +15 -5
  248. package/src/components/Radio.tsx +29 -0
  249. package/src/components/Select.tsx +17 -8
  250. package/src/components/Show.tsx +16 -5
  251. package/src/components/Spinner.tsx +82 -0
  252. package/src/components/Tab.tsx +13 -5
  253. package/src/components/TabList.tsx +5 -1
  254. package/src/components/TabPanel.tsx +7 -2
  255. package/src/components/Table.tsx +6 -3
  256. package/src/components/Tag.tsx +34 -7
  257. package/src/components/Tbody.tsx +7 -1
  258. package/src/components/Td.tsx +2 -1
  259. package/src/components/Textarea.tsx +9 -4
  260. package/src/components/Th.tsx +13 -1
  261. package/src/components/Thead.tsx +2 -1
  262. package/src/components/Toggle.tsx +35 -0
  263. package/src/context/confirm-modal.tsx +19 -2
  264. package/src/context/feature-flags.tsx +4 -1
  265. package/src/context/field.tsx +26 -0
  266. package/src/context/navMenu.tsx +25 -0
  267. package/src/context/notification-center.tsx +84 -12
  268. package/src/context/prompt-modal.tsx +41 -3
  269. package/src/context/tabs.tsx +31 -4
  270. package/src/context/theme.tsx +47 -10
  271. package/src/hooks/useModal.ts +14 -0
  272. package/src/hooks/useTheme.ts +66 -17
  273. package/src/hooks/useToggle.ts +22 -0
  274. package/src/index.ts +2 -0
  275. package/build/modern/chunk-2FK7NR7Y.js.map +0 -1
  276. package/build/modern/chunk-3C2DJSEE.js.map +0 -1
  277. package/build/modern/chunk-3GXISGPS.js.map +0 -1
  278. package/build/modern/chunk-4CAT3FHV.js.map +0 -1
  279. package/build/modern/chunk-4M3EUP57.js.map +0 -1
  280. package/build/modern/chunk-4O4QFF4S.js.map +0 -1
  281. package/build/modern/chunk-4YJOK7JJ.js.map +0 -1
  282. package/build/modern/chunk-6DIGPXAD.js.map +0 -1
  283. package/build/modern/chunk-6F34A7NZ.js.map +0 -1
  284. package/build/modern/chunk-7VJOPJVX.js.map +0 -1
  285. package/build/modern/chunk-A5WYZVUR.js.map +0 -1
  286. package/build/modern/chunk-C5HLLGME.js.map +0 -1
  287. package/build/modern/chunk-DGJPW76I.js.map +0 -1
  288. package/build/modern/chunk-FMFKM2AB.js.map +0 -1
  289. package/build/modern/chunk-HW76XVA3.js.map +0 -1
  290. package/build/modern/chunk-ISPTI4GC.js.map +0 -1
  291. package/build/modern/chunk-JB7IQ2BM.js.map +0 -1
  292. package/build/modern/chunk-KF24CS4S.js.map +0 -1
  293. package/build/modern/chunk-KJUCHZHV.js.map +0 -1
  294. package/build/modern/chunk-N3FUF4TB.js.map +0 -1
  295. package/build/modern/chunk-O6WHVUEW.js.map +0 -1
  296. package/build/modern/chunk-PH64POOB.js.map +0 -1
  297. package/build/modern/chunk-PJ3744I6.js.map +0 -1
  298. package/build/modern/chunk-PMCYXRAH.js.map +0 -1
  299. package/build/modern/chunk-QEA6N6TN.js.map +0 -1
  300. package/build/modern/chunk-QU7UV5DB.js.map +0 -1
  301. package/build/modern/chunk-QZ6NS6VN.js.map +0 -1
  302. package/build/modern/chunk-RPZAPUCF.js.map +0 -1
  303. package/build/modern/chunk-SLHX5K6I.js.map +0 -1
  304. package/build/modern/chunk-SONHHNYQ.js.map +0 -1
  305. package/build/modern/chunk-SXXWC6UD.js +0 -83
  306. package/build/modern/chunk-SXXWC6UD.js.map +0 -1
  307. package/build/modern/chunk-T7TOXGZT.js.map +0 -1
  308. package/build/modern/chunk-TCO46FK7.js.map +0 -1
  309. package/build/modern/chunk-TYTEREKZ.js.map +0 -1
  310. package/build/modern/chunk-U72VPIZA.js.map +0 -1
  311. package/build/modern/chunk-UN3OAW56.js.map +0 -1
  312. package/build/modern/chunk-VGHVH2T3.js.map +0 -1
  313. package/build/modern/chunk-VRPAW76S.js.map +0 -1
  314. package/build/modern/chunk-VULPMZUW.js.map +0 -1
  315. package/build/modern/chunk-WWJRKSM5.js.map +0 -1
  316. package/build/modern/chunk-XOVQGPIE.js.map +0 -1
  317. package/build/modern/chunk-XREC5IJE.js.map +0 -1
  318. package/build/modern/chunk-Z6IWNVPN.js.map +0 -1
  319. package/build/modern/chunk-ZAU4JVLL.js.map +0 -1
  320. package/build/modern/chunk-ZCIJRM2X.js.map +0 -1
  321. /package/build/modern/{chunk-GKUDLVOV.js.map → chunk-ITOIXNJS.js.map} +0 -0
@@ -6,8 +6,6 @@ import {
6
6
  type HTMLAttributes,
7
7
  type MouseEvent,
8
8
  } from 'react'
9
- import { ProgressBar } from './ProgressBar'
10
- import { IconButton } from './IconButton'
11
9
  import {
12
10
  fileStatus,
13
11
  type FileStatusVariantProps,
@@ -15,8 +13,10 @@ import {
15
13
  import { css, cx } from '@cerberus/styled-system/css'
16
14
  import { hstack, vstack } from '@cerberus/styled-system/patterns'
17
15
  import { $cerberusIcons } from '../config/defineIcons'
18
- import { FieldMessage } from './FieldMessage'
19
16
  import { Field } from '../context/field'
17
+ import { FieldMessage } from './FieldMessage'
18
+ import { ProgressBar, type ProgressBarProps } from './ProgressBar'
19
+ import { IconButton } from './IconButton'
20
20
  import { Avatar } from './Avatar'
21
21
 
22
22
  /**
@@ -24,13 +24,45 @@ import { Avatar } from './Avatar'
24
24
  * @module
25
25
  */
26
26
 
27
+ /**
28
+ * The available values of the fileStatus helper Object.
29
+ * @example
30
+ * ```tsx
31
+ * import { fileStatus } from '@cerberus/react'
32
+ * processStatus.TODO // 'todo'
33
+ * ```
34
+ */
27
35
  export type FileStatusKey = (typeof processStatus)[keyof typeof processStatus]
36
+
37
+ /**
38
+ * The actions that can be performed on a file.
39
+ */
28
40
  export type FileStatusActions = 'cancel' | 'retry' | 'delete'
29
41
  export interface FileBaseStatusProps
30
42
  extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick'> {
43
+ /**
44
+ * The name of the file.
45
+ */
31
46
  file: string
32
- now: number
47
+ /**
48
+ * The percentage of the file that has been processed.
49
+ */
50
+ now: ProgressBarProps['now']
51
+ /**
52
+ * The status of the file.
53
+ */
33
54
  status: processStatus
55
+ /**
56
+ * The action to perform on the file when a user clicks the
57
+ * button located at the end of the status card.
58
+ * @param status - The status of the file.
59
+ * @param e - The event object.
60
+ * @example
61
+ * ```tsx
62
+ * <FileStatus file="file.txt" now={0} status={processStatus.TODO} action={(status, e) => console.log(status, e)} />
63
+ * ```
64
+ * @default () => {}
65
+ */
34
66
  onClick: (status: FileStatusActions, e: MouseEvent<HTMLButtonElement>) => void
35
67
  }
36
68
  export type FileStatusProps = FileBaseStatusProps & FileStatusVariantProps
@@ -51,13 +83,8 @@ export const enum processStatus {
51
83
  }
52
84
 
53
85
  /**
54
- * This component displays the status of a file.
55
- * @param props - {
56
- * file: string,
57
- * now: number,
58
- * status: keyof typeof fileStatus,
59
- * action: (status: FileStatusActions, e: MouseEvent<HTMLButtonElement>) => void
60
- * }.
86
+ * A component that displays the status of a file during file processing.
87
+ * @see https://cerberus.digitalu.design/react/file-uploader
61
88
  * @example
62
89
  * ```tsx
63
90
  * <FileStatus file="file.txt" now={0} status={processStatus.TODO} action={(status, e) => console.log(status, e)} />
@@ -121,7 +148,7 @@ export function FileStatus(props: FileStatusProps) {
121
148
  {file}
122
149
  </small>
123
150
  <ProgressBar now={now} size="sm" />
124
- <Field invalid={modalIconPalette === 'red'}>
151
+ <Field invalid={modalIconPalette === 'hades-dark'}>
125
152
  <FieldMessage
126
153
  className={css({
127
154
  color: 'page.text.100',
@@ -233,12 +260,12 @@ function getModalIconPalette(status: FileStatusKey) {
233
260
  switch (status) {
234
261
  case processStatus.TODO:
235
262
  case processStatus.PROCESSING:
236
- return 'light-purple'
263
+ return 'charon-light'
237
264
  case processStatus.ERROR:
238
- return 'red'
265
+ return 'hades-dark'
239
266
  case processStatus.DONE:
240
- return 'green'
267
+ return 'thanatos-light'
241
268
  default:
242
- return 'light-purple'
269
+ return 'charon-light'
243
270
  }
244
271
  }
@@ -10,10 +10,20 @@ import { Avatar } from './Avatar'
10
10
 
11
11
  export interface FileUploaderProps
12
12
  extends InputHTMLAttributes<HTMLInputElement> {
13
+ /**
14
+ * The optional heading to display in the FileUploader component.
15
+ */
13
16
  heading?: string
17
+ /**
18
+ * The name of the file input element.
19
+ */
14
20
  name: string
15
21
  }
16
22
 
23
+ /**
24
+ * A component that allows the user to upload files.
25
+ * @see https://cerberus.digitalu.design/react/file-uploader
26
+ */
17
27
  export function FileUploader(props: FileUploaderProps) {
18
28
  const styles = fileUploader()
19
29
  const Icon = $cerberusIcons.fileUploader
@@ -29,7 +39,7 @@ export function FileUploader(props: FileUploaderProps) {
29
39
  >
30
40
  <div className={styles.icon}>
31
41
  <Avatar
32
- gradient="light-purple"
42
+ gradient="charon-light"
33
43
  ariaLabel=""
34
44
  icon={<Icon />}
35
45
  size="md"
@@ -1,6 +1,9 @@
1
1
  import type { ButtonHTMLAttributes } from 'react'
2
- import { cx, type RecipeVariantProps } from '@cerberus/styled-system/css'
3
- import { iconButton } from '@cerberus/styled-system/recipes'
2
+ import { cx } from '@cerberus/styled-system/css'
3
+ import {
4
+ iconButton,
5
+ type IconButtonVariantProps,
6
+ } from '@cerberus/styled-system/recipes'
4
7
  import type { Positions } from '../types'
5
8
 
6
9
  /**
@@ -10,15 +13,22 @@ import type { Positions } from '../types'
10
13
 
11
14
  export interface IconButtonRawProps
12
15
  extends ButtonHTMLAttributes<HTMLButtonElement> {
16
+ /**
17
+ * The aria-label attribute for the icon button.
18
+ */
13
19
  ariaLabel: string
20
+ /**
21
+ * The position of the tooltip relative to the icon button.
22
+ * @example 'top' | 'right' | 'bottom' | 'left'
23
+ * @default 'top'
24
+ */
14
25
  tooltipPosition?: Positions
15
26
  }
16
- export type IconButtonRecipeProps = RecipeVariantProps<typeof iconButton>
17
- export type IconButtonProps = IconButtonRawProps & IconButtonRecipeProps
27
+ export type IconButtonProps = IconButtonRawProps & IconButtonVariantProps
18
28
 
19
29
  /**
20
30
  * A component that allows the user to perform actions using an icon
21
- * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/IconButton.tsx
31
+ * @see https://cerberus.digitalu.design/react/icon-button
22
32
  */
23
33
  export function IconButton(props: IconButtonProps): JSX.Element {
24
34
  const { ariaLabel, palette, usage, size, ...nativeProps } = props
@@ -1,22 +1,39 @@
1
1
  'use client'
2
2
 
3
3
  import type { InputHTMLAttributes, ReactNode } from 'react'
4
- import { input } from '@cerberus/styled-system/recipes'
5
- import { cx, type RecipeVariantProps } from '@cerberus/styled-system/css'
4
+ import { input, type InputVariantProps } from '@cerberus/styled-system/recipes'
5
+ import { cx } from '@cerberus/styled-system/css'
6
6
  import { useFieldContext } from '../context/field'
7
7
  import { $cerberusIcons } from '../config/defineIcons'
8
8
  import { Show } from './Show'
9
9
 
10
- export type InputRecipeProps = RecipeVariantProps<typeof input>
11
10
  export interface InputBaseProps
12
11
  extends Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'size'> {
12
+ /**
13
+ * The id of the FieldMessage component used to describe the input. Required for accessibility.
14
+ */
13
15
  describedBy?: string
16
+ /**
17
+ * The unique identifier for the input element. Required for accessibility.
18
+ */
14
19
  id: string
20
+ /**
21
+ * An optional icon to display at the start of the input.
22
+ */
15
23
  startIcon?: ReactNode
24
+ /**
25
+ * An optional icon to display at the end of the input.
26
+ */
16
27
  endIcon?: ReactNode
17
28
  }
18
- export type InputProps = InputBaseProps & InputRecipeProps
29
+ export type InputProps = InputBaseProps & InputVariantProps
19
30
 
31
+ /**
32
+ * A component that allows the user to input text. Must be wrapped in a Field
33
+ * component to keep track of the state for entire group of elements related to
34
+ * the field.
35
+ * @see https://cerberus.digitalu.design/react/input
36
+ */
20
37
  export function Input(props: InputProps) {
21
38
  const { describedBy, size, startIcon, endIcon, ...nativeProps } = props
22
39
  const inputStyles = input({ size })
@@ -1,8 +1,8 @@
1
1
  'use client'
2
2
 
3
3
  import type { HTMLAttributes, PropsWithChildren } from 'react'
4
- import { label } from '@cerberus/styled-system/recipes'
5
- import { css, cx, type RecipeVariantProps } from '@cerberus/styled-system/css'
4
+ import { label, type LabelVariantProps } from '@cerberus/styled-system/recipes'
5
+ import { css, cx } from '@cerberus/styled-system/css'
6
6
  import { hstack } from '@cerberus/styled-system/patterns'
7
7
  import { useFieldContext } from '../context/field'
8
8
  import { Show } from './Show'
@@ -11,22 +11,27 @@ import { Show } from './Show'
11
11
  * This module contains the Label component.
12
12
  * @module
13
13
  */
14
-
15
- export type LabelRecipeProps = RecipeVariantProps<typeof label>
16
14
  export interface LabelBaseProps extends HTMLAttributes<HTMLLabelElement> {
15
+ /**
16
+ * The unique identifier for the input element. Required for accessibility.
17
+ */
17
18
  htmlFor: string
19
+ /**
20
+ * Used to hide the label from the UI while keeping it accessible to screen readers. Typically used for global search inputs that have no visible label.
21
+ */
18
22
  hidden?: boolean
19
23
  }
20
- export type LabelProps = LabelBaseProps & LabelRecipeProps
24
+ export type LabelProps = LabelBaseProps & LabelVariantProps
21
25
 
22
26
  /**
23
- * A screen ready friendly label component.
27
+ * A a11y compliant label component.
24
28
  * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)
25
- * @definition [Label docs](https://cerberus.digitalu.design/react/label)
29
+ * @see https://cerberus.digitalu.design/react/label
26
30
  * @example
27
31
  * ```tsx
28
32
  * <Field required>
29
- * <Label htmlFor="test">Test Label</Label>
33
+ * <Label htmlFor="search" hidden>Search everything</Label>
34
+ * <Input id="search" startIcon={Search} type="text" />
30
35
  * </Field>
31
36
  * ```
32
37
  */
@@ -23,14 +23,19 @@ function ModalEl(props: ModalProps, ref: ForwardedRef<HTMLDialogElement>) {
23
23
 
24
24
  /**
25
25
  * The Modal component is the root element for a customizable modal.
26
+ * @see https://cerberus.digitalu.design/react/modal
26
27
  * @example
27
28
  * ```tsx
28
29
  * const { modalRef } = useModal()
29
30
  *
30
31
  * <Modal ref={modalRef}>
31
- * <ModalIcon icon={$cerberusIcons.alert} />
32
- * <h2>Modal Heading</h2>
33
- * <p>Modal description</p>
32
+ * <Avatar icon={SomeIcon} />
33
+ * <ModalHeader>
34
+ * <ModalHeading>Modal Heading</ModalHeading>
35
+ * <ModalDescription>Modal description</ModalDescription>
36
+ * </ModalHeader>
37
+ *
38
+ * {props.children}
34
39
  * </Modal>
35
40
  * ```
36
41
  */
@@ -11,6 +11,7 @@ export type ModalDescriptionProps = HTMLAttributes<HTMLParagraphElement>
11
11
 
12
12
  /**
13
13
  * The ModalDescription component is a heading element for a customizable modal.
14
+ * @see https://cerberus.digitalu.design/react/modal
14
15
  * @example
15
16
  * ```tsx
16
17
  * <Modal>
@@ -11,6 +11,7 @@ export type ModalHeaderProps = HTMLAttributes<HTMLDivElement>
11
11
 
12
12
  /**
13
13
  * The ModalHeader component is a header element for a customizable modal.
14
+ * @see https://cerberus.digitalu.design/react/modal
14
15
  * @example
15
16
  * ```tsx
16
17
  * <Modal>
@@ -11,6 +11,7 @@ export type ModalHeadingProps = HTMLAttributes<HTMLParagraphElement>
11
11
 
12
12
  /**
13
13
  * The ModalHeading component is a heading element for a customizable modal.
14
+ * @see https://cerberus.digitalu.design/react/modal
14
15
  * @example
15
16
  * ```tsx
16
17
  * <Modal>
@@ -2,11 +2,33 @@ import type { AnchorHTMLAttributes, ElementType } from 'react'
2
2
  import { css, cx } from '@cerberus/styled-system/css'
3
3
  import { Show } from './Show'
4
4
 
5
+ /**
6
+ * This module contains the NavMenuLink component.
7
+ * @module
8
+ */
9
+
5
10
  export interface NavMenuLinkProps
6
11
  extends AnchorHTMLAttributes<HTMLAnchorElement> {
12
+ /**
13
+ * The element type to render as. Recommended to use for Next apps with the
14
+ * `Link` component.
15
+ */
7
16
  as?: ElementType
8
17
  }
9
18
 
19
+ /**
20
+ * The NavMenuLink component is a link element that is used within the NavMenu.
21
+ * @see https://cerberus.digitalu.design/react/nav-menu
22
+ * @example
23
+ * ```tsx
24
+ * <NavMenu>
25
+ * <NavMenuList id="nav-menu-list" position="bottom">
26
+ * <NavMenuLink href="/home">Home</NavMenuLink>
27
+ * <NavMenuLink href="/about">About</NavMenuLink>
28
+ * </NavMenuList>
29
+ * </NavMenu>
30
+ * ```
31
+ */
10
32
  export function NavMenuLink(props: NavMenuLinkProps): JSX.Element {
11
33
  const { as, ...nativeProps } = props
12
34
  const hasAs = Boolean(as)
@@ -7,13 +7,35 @@ import { useNavMenuContext } from '../context/navMenu'
7
7
  import type { Positions } from '../types'
8
8
  import { Show } from './Show'
9
9
 
10
+ /**
11
+ * This module contains the NavMenuList component.
12
+ * @module
13
+ */
14
+
10
15
  interface GetPositionResult {
16
+ /**
17
+ * The left position of the element.
18
+ */
11
19
  left: string
20
+ /**
21
+ * The right position of the element.
22
+ */
12
23
  right: string
24
+ /**
25
+ * The top position of the element.
26
+ */
13
27
  top: string
28
+ /**
29
+ * The bottom position of the element.
30
+ */
14
31
  bottom: string
15
32
  }
16
33
 
34
+ /**
35
+ * Returns the position of the NavMenuList based on the position prop.
36
+ * @param position - The position of the NavMenuList.
37
+ * @returns The position of the NavMenuList.
38
+ */
17
39
  export function getPosition(position: Positions): GetPositionResult {
18
40
  const defaultPositions = {
19
41
  left: 'auto',
@@ -67,21 +89,31 @@ const navListStyles = vstack({
67
89
  })
68
90
 
69
91
  export interface NavMenuListProps extends HTMLAttributes<HTMLUListElement> {
92
+ /**
93
+ * The unique identifier for the NavMenuList. Required for accessibility.
94
+ */
70
95
  id: string
96
+ /**
97
+ * The position of the NavMenuList.
98
+ * @type 'top' | 'right' | 'bottom' | 'left'
99
+ * @default 'bottom'
100
+ */
71
101
  position?: Positions
72
102
  }
73
103
 
74
104
  /**
75
105
  * A component that allows the user to display a menu of navigation links.
76
106
  * @definition [Disclosure Nav](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/)
77
- * @definition [NavMenu Docs](https://cerberus.digitalu.design/react/nav-menu)
107
+ * @see https://cerberus.digitalu.design/react/nav-menu
78
108
  *
79
109
  * @example
80
110
  * ```tsx
81
- * <NavMenuList id="nav-menu-list" position="bottom">
82
- * <NavMenuLink href="/home">Home</NavMenuLink>
83
- * <NavMenuLink href="/about">About</NavMenuLink>
84
- * </NavMenuList>
111
+ * <NavMenu>
112
+ * <NavMenuList id="nav-menu-list" position="bottom">
113
+ * <NavMenuLink href="/home">Home</NavMenuLink>
114
+ * <NavMenuLink href="/about">About</NavMenuLink>
115
+ * </NavMenuList>
116
+ * </NavMenu>
85
117
  * ```
86
118
  **/
87
119
  export function NavMenuList(props: NavMenuListProps): JSX.Element {
@@ -16,10 +16,23 @@ import { useNavMenuContext } from '../context/navMenu'
16
16
  import type { ButtonProps } from './Button'
17
17
  import { Show } from './Show'
18
18
 
19
+ /**
20
+ * This module contains the NavMenuTrigger component.
21
+ * @module
22
+ */
23
+
19
24
  export interface NavMenuTriggerProps
20
25
  extends ButtonHTMLAttributes<HTMLButtonElement>,
21
26
  ButtonProps,
22
27
  NavTriggerAriaValues {
28
+ /**
29
+ * The element type to render as. Recommended to use for an IconButton trigger vs a standard Button.
30
+ * @default 'button'
31
+ * @example
32
+ * ```tsx
33
+ * <NavMenuTrigger as={IconButton} href="/home" />
34
+ * ```
35
+ */
23
36
  as?: ElementType
24
37
  }
25
38
 
@@ -31,22 +31,29 @@ function MatchNotificationIcon(props: NotificationVariantProps) {
31
31
 
32
32
  export interface NotificationBaseProps
33
33
  extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'onClose'> {
34
+ /**
35
+ * The unique id of the notification. Required for the onClose callback.
36
+ */
34
37
  id: string
38
+ /**
39
+ * Called when the close button is clicked.
40
+ */
35
41
  onClose?: (e: MouseEvent<HTMLButtonElement>) => void
36
42
  }
37
43
  export type NotificationProps = NotificationBaseProps & NotificationVariantProps
38
44
 
39
45
  /**
40
- * The info notification component.
41
- * @param props - The component props.
42
- * @returns The info notification component.
46
+ * A static Notification component that displays a message to the user. This
47
+ * is typically only used when not utilizing the NotificationCenter.
48
+ * @see https://cerberus.digitalu.design/react/notification
49
+ * @memberof module:NotificationCenter
43
50
  * @example
44
51
  * ```tsx
45
52
  * <Notification id="info:1" open>
46
53
  * <NotificationHeading>Info Notification</NotificationHeading>
47
- * <NotificationDescription>
48
- * This is a description with a <a href="#">link</a> in the message.
49
- * </NotificationDescription>
54
+ * <NotificationDescription>
55
+ * This is a description with a <a href="#">link</a> in the message.
56
+ * </NotificationDescription>
50
57
  * </Notification>
51
58
  * ```
52
59
  */
@@ -1,8 +1,3 @@
1
- /**
2
- * This module exports the NotificationDescription component.
3
- * @module
4
- */
5
-
6
1
  import { cx } from '@cerberus/styled-system/css'
7
2
  import {
8
3
  notification,
@@ -10,13 +5,20 @@ import {
10
5
  } from '@cerberus/styled-system/recipes'
11
6
  import type { HTMLAttributes } from 'react'
12
7
 
8
+ /**
9
+ * This module exports the NotificationDescription component.
10
+ * @module
11
+ */
12
+
13
13
  export interface BaseNotificationDescriptionProps
14
14
  extends HTMLAttributes<HTMLParagraphElement> {}
15
15
  export type NotificationDescriptionProps = BaseNotificationDescriptionProps &
16
16
  NotificationVariantProps
17
17
 
18
18
  /**
19
- * The NotificationDescription component is used to render the description of a notification.
19
+ * Used to render the description of a notification.
20
+ * @see https://cerberus.digitalu.design/react/notification
21
+ * @memberof module:NotificationCenter
20
22
  * @param props - The anything a HTMLParagraphElement can accept.
21
23
  */
22
24
  export function NotificationDescription(props: NotificationDescriptionProps) {
@@ -1,8 +1,3 @@
1
- /**
2
- * This module exports the NotificationHeading component.
3
- * @module
4
- */
5
-
6
1
  import { cx } from '@cerberus/styled-system/css'
7
2
  import {
8
3
  notification,
@@ -10,13 +5,20 @@ import {
10
5
  } from '@cerberus/styled-system/recipes'
11
6
  import type { HTMLAttributes } from 'react'
12
7
 
8
+ /**
9
+ * This module exports the NotificationHeading component.
10
+ * @module
11
+ */
12
+
13
13
  export interface BaseNotificationHeadingProps
14
14
  extends HTMLAttributes<HTMLParagraphElement> {}
15
15
  export type NotificationHeadingProps = BaseNotificationHeadingProps &
16
16
  NotificationVariantProps
17
17
 
18
18
  /**
19
- * The NotificationHeading component is used to render the heading of a notification.
19
+ * Used to render the heading of a notification.
20
+ * @see https://cerberus.digitalu.design/react/notification
21
+ * @memberof module:NotificationCenter
20
22
  * @param props - The anything a HTMLParagraphElement can accept.
21
23
  */
22
24
  export function NotificationHeading(props: NotificationHeadingProps) {
@@ -7,14 +7,21 @@ import { createPortal } from 'react-dom'
7
7
  */
8
8
 
9
9
  export interface PortalProps {
10
+ /**
11
+ * The root container to render the children into.
12
+ * @default document.body
13
+ */
10
14
  container?: Element | DocumentFragment
15
+ /**
16
+ * An optional key to use for the Portal component.
17
+ */
11
18
  key?: null | string
12
19
  }
13
20
 
14
21
  /**
15
22
  * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.
16
- * @param container - The props for the Portal component.
17
- * @returns ReactPortal
23
+ * @see https://cerberus.digitalu.design/react/portal
24
+ * @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)
18
25
  */
19
26
  export function Portal(props: PropsWithChildren<PortalProps>) {
20
27
  const container = props.container || document.body
@@ -12,11 +12,23 @@ import type { HTMLAttributes } from 'react'
12
12
 
13
13
  export interface ProgressBarBaseProps extends HTMLAttributes<HTMLDivElement> {}
14
14
  export type NonIndeterminateProgressBarProps = {
15
+ /**
16
+ * The state of the progress bar.
17
+ */
15
18
  indeterminate?: never
19
+ /**
20
+ * The current value of the progress bar.
21
+ */
16
22
  now: number
17
23
  }
18
24
  export type IndeterminateProgressBarProps = {
19
- indeterminate: true
25
+ /**
26
+ * The state of the progress bar.
27
+ */
28
+ indeterminate?: true
29
+ /**
30
+ * The current value of the progress bar.
31
+ */
20
32
  now?: never
21
33
  }
22
34
  export type ProgressBarProps = ProgressBarBaseProps &
@@ -25,9 +37,7 @@ export type ProgressBarProps = ProgressBarBaseProps &
25
37
 
26
38
  /**
27
39
  * The ProgressBar component is used to display the progress of a task.
28
- * @param props - HTML div element attributes
29
- * @param props.now - The current value of the progress bar
30
- * @param props.indeterminate - Whether the progress bar is indeterminate
40
+ * @see https://cerberus.digitalu.design/react/progress-indicators
31
41
  * @example
32
42
  * ```tsx
33
43
  * <ProgressBar value={75} />
@@ -48,7 +58,7 @@ export function ProgressBar(props: ProgressBarProps) {
48
58
  aria-valuemax={100}
49
59
  aria-valuenow={indeterminate ? 0 : nowClamped}
50
60
  className={cx(nativeProps.className, styles.root)}
51
- role="meter"
61
+ role="progressbar"
52
62
  >
53
63
  <div
54
64
  {...(indeterminate && { 'data-indeterminate': true })}
@@ -7,13 +7,42 @@ import type { RecipeVariantProps } from '@cerberus/styled-system/types'
7
7
  import type { InputHTMLAttributes, PropsWithChildren } from 'react'
8
8
  import { useFieldContext } from '../context/field'
9
9
 
10
+ /**
11
+ * This module contains the Radio component.
12
+ * @module
13
+ */
14
+
10
15
  export type RadioRecipe = RecipeVariantProps<typeof radio>
11
16
  export interface RadioBaseProps
12
17
  extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
18
+ /**
19
+ * A unique identifier for the radio button. Required for accessibility.
20
+ */
13
21
  id: string
14
22
  }
15
23
  export type RadioProps = RadioBaseProps & RadioRecipe
16
24
 
25
+ /**
26
+ * The Radio component is used to allow users to select a single option from a list of options.
27
+ * @see https://cerberus.digitalu.design/react/radio
28
+ * @memberof module:Field
29
+ * @example
30
+ * ```tsx
31
+ * <Field>
32
+ * <fieldset name="fruit">
33
+ * <Radio id="radio-1" name="fruit" value="1">
34
+ * Option 1
35
+ * </Radio>
36
+ * <Radio id="radio-2" name="fruit" value="2">
37
+ * Option 2
38
+ * </Radio>
39
+ * <Radio id="radio-3" name="fruit" value="3">
40
+ * Option 3
41
+ * </Radio>
42
+ * </fieldset>
43
+ * </Field>
44
+ * ```
45
+ */
17
46
  export function Radio(props: PropsWithChildren<RadioProps>) {
18
47
  const { children, size, ...nativeProps } = props
19
48
  const { invalid, ...state } = useFieldContext()