@cerberus-design/react 0.15.0 → 0.16.0-next-feeb186

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 (550) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.cts +1345 -319
  2. package/build/legacy/components/Accordion.cjs.map +1 -1
  3. package/build/legacy/components/AccordionItemGroup.cjs.map +1 -1
  4. package/build/legacy/components/DatePicker.client.cjs +63 -77
  5. package/build/legacy/components/DatePicker.client.cjs.map +1 -1
  6. package/build/legacy/components/FileStatus.cjs +126 -79
  7. package/build/legacy/components/FileStatus.cjs.map +1 -1
  8. package/build/legacy/components/Legend.cjs +10 -22
  9. package/build/legacy/components/Legend.cjs.map +1 -1
  10. package/build/legacy/components/button/button.cjs +154 -0
  11. package/build/legacy/components/button/button.cjs.map +1 -0
  12. package/build/legacy/components/button/index.cjs +163 -0
  13. package/build/legacy/components/button/index.cjs.map +1 -0
  14. package/build/legacy/components/button/parts.cjs +159 -0
  15. package/build/legacy/components/button/parts.cjs.map +1 -0
  16. package/build/legacy/components/checkbox/checkbox-icon.cjs +121 -0
  17. package/build/legacy/components/checkbox/checkbox-icon.cjs.map +1 -0
  18. package/build/legacy/components/checkbox/checkbox.cjs +165 -0
  19. package/build/legacy/components/checkbox/checkbox.cjs.map +1 -0
  20. package/build/legacy/components/checkbox/index.cjs +179 -0
  21. package/build/legacy/components/checkbox/index.cjs.map +1 -0
  22. package/build/legacy/components/checkbox/parts.cjs +89 -0
  23. package/build/legacy/components/checkbox/parts.cjs.map +1 -0
  24. package/build/legacy/components/checkbox/primitives.cjs +87 -0
  25. package/build/legacy/components/checkbox/primitives.cjs.map +1 -0
  26. package/build/legacy/components/cta-dialog/context.cjs +33 -0
  27. package/build/legacy/components/cta-dialog/context.cjs.map +1 -0
  28. package/build/legacy/components/cta-dialog/index.cjs +433 -0
  29. package/build/legacy/components/cta-dialog/index.cjs.map +1 -0
  30. package/build/legacy/{context/cta-modal.cjs → components/cta-dialog/provider.cjs} +175 -128
  31. package/build/legacy/components/cta-dialog/provider.cjs.map +1 -0
  32. package/build/legacy/components/cta-dialog/trigger-item.cjs +99 -0
  33. package/build/legacy/components/cta-dialog/trigger-item.cjs.map +1 -0
  34. package/build/legacy/components/cta-dialog/utils.cjs +47 -0
  35. package/build/legacy/components/cta-dialog/utils.cjs.map +1 -0
  36. package/build/legacy/components/{FieldMessage.cjs → deprecated/FieldMessage.cjs} +4 -17
  37. package/build/legacy/components/deprecated/FieldMessage.cjs.map +1 -0
  38. package/build/legacy/components/{FieldsetLabel.cjs → deprecated/FieldsetLabel.cjs} +1 -1
  39. package/build/legacy/components/deprecated/FieldsetLabel.cjs.map +1 -0
  40. package/build/legacy/components/{Textarea.cjs → deprecated/Label.cjs} +24 -36
  41. package/build/legacy/components/deprecated/Label.cjs.map +1 -0
  42. package/build/legacy/components/{Modal.cjs → deprecated/Modal.cjs} +1 -1
  43. package/build/legacy/components/deprecated/Modal.cjs.map +1 -0
  44. package/build/legacy/components/{ModalDescription.cjs → deprecated/ModalDescription.cjs} +1 -1
  45. package/build/legacy/components/deprecated/ModalDescription.cjs.map +1 -0
  46. package/build/legacy/components/{ModalHeader.cjs → deprecated/ModalHeader.cjs} +1 -1
  47. package/build/legacy/components/deprecated/ModalHeader.cjs.map +1 -0
  48. package/build/legacy/components/{ModalHeading.cjs → deprecated/ModalHeading.cjs} +1 -1
  49. package/build/legacy/components/deprecated/ModalHeading.cjs.map +1 -0
  50. package/build/legacy/components/{NavMenuLink.cjs → deprecated/NavMenuLink.cjs} +2 -2
  51. package/build/legacy/components/deprecated/NavMenuLink.cjs.map +1 -0
  52. package/build/legacy/components/{NavMenuList.cjs → deprecated/NavMenuList.cjs} +2 -2
  53. package/build/legacy/components/deprecated/NavMenuList.cjs.map +1 -0
  54. package/build/legacy/components/{NavMenuTrigger.cjs → deprecated/NavMenuTrigger.cjs} +2 -2
  55. package/build/legacy/components/deprecated/NavMenuTrigger.cjs.map +1 -0
  56. package/build/legacy/components/field/field.cjs +130 -0
  57. package/build/legacy/components/field/field.cjs.map +1 -0
  58. package/build/legacy/components/field/index.cjs +267 -0
  59. package/build/legacy/components/field/index.cjs.map +1 -0
  60. package/build/legacy/components/field/parts.cjs +188 -0
  61. package/build/legacy/components/field/parts.cjs.map +1 -0
  62. package/build/legacy/components/field/primitives.cjs +191 -0
  63. package/build/legacy/components/field/primitives.cjs.map +1 -0
  64. package/build/legacy/components/{Button.cjs → field/start-indicator.cjs} +14 -19
  65. package/build/legacy/components/field/start-indicator.cjs.map +1 -0
  66. package/build/legacy/components/field/status-indicator.cjs +78 -0
  67. package/build/legacy/components/field/status-indicator.cjs.map +1 -0
  68. package/build/legacy/components/fieldset/fieldset.cjs +116 -0
  69. package/build/legacy/components/fieldset/fieldset.cjs.map +1 -0
  70. package/build/legacy/components/fieldset/index.cjs +126 -0
  71. package/build/legacy/components/fieldset/index.cjs.map +1 -0
  72. package/build/legacy/components/fieldset/parts.cjs +80 -0
  73. package/build/legacy/components/fieldset/parts.cjs.map +1 -0
  74. package/build/legacy/components/fieldset/primitives.cjs +76 -0
  75. package/build/legacy/components/fieldset/primitives.cjs.map +1 -0
  76. package/build/legacy/components/for.cjs +37 -0
  77. package/build/legacy/components/for.cjs.map +1 -0
  78. package/build/legacy/components/radio/index.cjs +143 -0
  79. package/build/legacy/components/radio/index.cjs.map +1 -0
  80. package/build/legacy/components/radio/parts.cjs +113 -0
  81. package/build/legacy/components/radio/parts.cjs.map +1 -0
  82. package/build/legacy/components/radio/primitives.cjs +115 -0
  83. package/build/legacy/components/radio/primitives.cjs.map +1 -0
  84. package/build/legacy/components/radio/radio.cjs +82 -0
  85. package/build/legacy/components/radio/radio.cjs.map +1 -0
  86. package/build/legacy/components/select/index.cjs +265 -0
  87. package/build/legacy/components/select/index.cjs.map +1 -0
  88. package/build/legacy/components/select/option-group.cjs +60 -0
  89. package/build/legacy/components/select/option-group.cjs.map +1 -0
  90. package/build/legacy/components/select/parts.cjs +153 -0
  91. package/build/legacy/components/select/parts.cjs.map +1 -0
  92. package/build/legacy/components/select/primitives.cjs +167 -0
  93. package/build/legacy/components/select/primitives.cjs.map +1 -0
  94. package/build/legacy/components/select/select.cjs +212 -0
  95. package/build/legacy/components/select/select.cjs.map +1 -0
  96. package/build/legacy/components/switch/index.cjs +118 -0
  97. package/build/legacy/components/switch/index.cjs.map +1 -0
  98. package/build/legacy/components/switch/parts.cjs +75 -0
  99. package/build/legacy/components/switch/parts.cjs.map +1 -0
  100. package/build/legacy/components/switch/primitives.cjs +72 -0
  101. package/build/legacy/components/switch/primitives.cjs.map +1 -0
  102. package/build/legacy/components/{Fieldset.cjs → switch/switch-indicator.cjs} +17 -32
  103. package/build/legacy/components/switch/switch-indicator.cjs.map +1 -0
  104. package/build/legacy/components/switch/switch.cjs +106 -0
  105. package/build/legacy/components/switch/switch.cjs.map +1 -0
  106. package/build/legacy/components/toggle/index.cjs +45 -0
  107. package/build/legacy/components/toggle/index.cjs.map +1 -0
  108. package/build/legacy/components/toggle/parts.cjs +41 -0
  109. package/build/legacy/components/toggle/parts.cjs.map +1 -0
  110. package/build/legacy/components/toggle/primitives.cjs +35 -0
  111. package/build/legacy/components/toggle/primitives.cjs.map +1 -0
  112. package/build/legacy/config/types.cjs.map +1 -1
  113. package/build/legacy/context/confirm-modal.cjs +55 -45
  114. package/build/legacy/context/confirm-modal.cjs.map +1 -1
  115. package/build/legacy/context/field.cjs +23 -4
  116. package/build/legacy/context/field.cjs.map +1 -1
  117. package/build/legacy/context/notification-center.cjs +24 -16
  118. package/build/legacy/context/notification-center.cjs.map +1 -1
  119. package/build/legacy/context/prompt-modal.cjs +206 -194
  120. package/build/legacy/context/prompt-modal.cjs.map +1 -1
  121. package/build/legacy/hooks/useDate.cjs.map +1 -1
  122. package/build/legacy/hooks/useRootColors.cjs +0 -1
  123. package/build/legacy/hooks/useRootColors.cjs.map +1 -1
  124. package/build/legacy/hooks/useToggle.cjs.map +1 -1
  125. package/build/legacy/index.cjs +2023 -1466
  126. package/build/legacy/index.cjs.map +1 -1
  127. package/build/legacy/utils/index.cjs +22 -2
  128. package/build/legacy/utils/index.cjs.map +1 -1
  129. package/build/modern/_tsup-dts-rollup.d.ts +1345 -319
  130. package/build/modern/{chunk-PM7CWT3N.js → chunk-245SMQ45.js} +2 -2
  131. package/build/modern/chunk-245SMQ45.js.map +1 -0
  132. package/build/modern/chunk-2BIHLH4V.js +15 -0
  133. package/build/modern/chunk-2BIHLH4V.js.map +1 -0
  134. package/build/modern/chunk-2CVGNLIM.js +15 -0
  135. package/build/modern/chunk-2CVGNLIM.js.map +1 -0
  136. package/build/modern/{chunk-ISCJ542I.js → chunk-2HOUQ2DX.js} +2 -2
  137. package/build/modern/chunk-2LF3HPNA.js +1 -0
  138. package/build/modern/chunk-4LSTU6WU.js +8 -0
  139. package/build/modern/chunk-4LSTU6WU.js.map +1 -0
  140. package/build/modern/chunk-5RTNSVYU.js +88 -0
  141. package/build/modern/chunk-5RTNSVYU.js.map +1 -0
  142. package/build/modern/chunk-6I2FW4WI.js +33 -0
  143. package/build/modern/chunk-6I2FW4WI.js.map +1 -0
  144. package/build/modern/chunk-6ICNCCPD.js +47 -0
  145. package/build/modern/chunk-6ICNCCPD.js.map +1 -0
  146. package/build/modern/chunk-6KZVE4HC.js +52 -0
  147. package/build/modern/chunk-6KZVE4HC.js.map +1 -0
  148. package/build/modern/{chunk-25HMVHLT.js → chunk-7SU6FCTJ.js} +5 -5
  149. package/build/modern/chunk-7TQRTBUP.js +19 -0
  150. package/build/modern/chunk-7TQRTBUP.js.map +1 -0
  151. package/build/modern/{chunk-UZVQ4INR.js → chunk-AIJ75ENY.js} +2 -2
  152. package/build/modern/chunk-AIJ75ENY.js.map +1 -0
  153. package/build/modern/chunk-AO3GB72J.js +27 -0
  154. package/build/modern/chunk-AO3GB72J.js.map +1 -0
  155. package/build/modern/{chunk-NUMM4TNC.js → chunk-AUALRL3U.js} +2 -2
  156. package/build/modern/chunk-AUALRL3U.js.map +1 -0
  157. package/build/modern/{chunk-IGHMP4WA.js → chunk-AZRFYQO7.js} +1 -1
  158. package/build/modern/chunk-AZRFYQO7.js.map +1 -0
  159. package/build/modern/chunk-BL7G3577.js +29 -0
  160. package/build/modern/chunk-BL7G3577.js.map +1 -0
  161. package/build/modern/chunk-BPRF34DU.js +62 -0
  162. package/build/modern/chunk-BPRF34DU.js.map +1 -0
  163. package/build/modern/chunk-CAZ3EICD.js +16 -0
  164. package/build/modern/chunk-CAZ3EICD.js.map +1 -0
  165. package/build/modern/chunk-CIMY2U22.js +10 -0
  166. package/build/modern/chunk-CIMY2U22.js.map +1 -0
  167. package/build/modern/chunk-CNA2VKAH.js +43 -0
  168. package/build/modern/chunk-CNA2VKAH.js.map +1 -0
  169. package/build/modern/chunk-CYC2YUKU.js +1 -0
  170. package/build/modern/{chunk-PZAZKQMO.js → chunk-DRDNNRU3.js} +2 -2
  171. package/build/modern/chunk-DRDNNRU3.js.map +1 -0
  172. package/build/modern/{chunk-NJSETNRL.js → chunk-DXBZ3HMY.js} +2 -2
  173. package/build/modern/chunk-DXOKSZVQ.js +12 -0
  174. package/build/modern/chunk-DXOKSZVQ.js.map +1 -0
  175. package/build/modern/chunk-EL4MX2PG.js +22 -0
  176. package/build/modern/chunk-EL4MX2PG.js.map +1 -0
  177. package/build/modern/chunk-FBS7AX76.js +37 -0
  178. package/build/modern/chunk-FBS7AX76.js.map +1 -0
  179. package/build/modern/chunk-FUL2VRDU.js +25 -0
  180. package/build/modern/chunk-FUL2VRDU.js.map +1 -0
  181. package/build/modern/{chunk-BHB56M7S.js → chunk-H54FR7IP.js} +6 -6
  182. package/build/modern/chunk-H54FR7IP.js.map +1 -0
  183. package/build/modern/chunk-IASVL7CW.js +19 -0
  184. package/build/modern/chunk-IASVL7CW.js.map +1 -0
  185. package/build/modern/{chunk-REO5GUNC.js → chunk-ICTISECN.js} +1 -1
  186. package/build/modern/chunk-ICTISECN.js.map +1 -0
  187. package/build/modern/chunk-IDTAB2UJ.js +1 -0
  188. package/build/modern/chunk-IKDXADLX.js +1 -0
  189. package/build/modern/chunk-KQQPZJEI.js +21 -0
  190. package/build/modern/chunk-KQQPZJEI.js.map +1 -0
  191. package/build/modern/chunk-KWZ3CEG6.js +23 -0
  192. package/build/modern/chunk-KWZ3CEG6.js.map +1 -0
  193. package/build/modern/{chunk-JWIJHSI6.js → chunk-L7N24B6B.js} +3 -6
  194. package/build/modern/chunk-L7N24B6B.js.map +1 -0
  195. package/build/modern/chunk-LT62577B.js +23 -0
  196. package/build/modern/chunk-LT62577B.js.map +1 -0
  197. package/build/modern/chunk-LZWNHXRP.js +48 -0
  198. package/build/modern/chunk-LZWNHXRP.js.map +1 -0
  199. package/build/modern/{chunk-EDARV2EI.js → chunk-MISIUX63.js} +4 -4
  200. package/build/modern/chunk-MVO2GNUA.js +47 -0
  201. package/build/modern/chunk-MVO2GNUA.js.map +1 -0
  202. package/build/modern/{chunk-3BM6MZ4A.js → chunk-MWRO5QYD.js} +1 -1
  203. package/build/modern/chunk-MWRO5QYD.js.map +1 -0
  204. package/build/modern/{chunk-SD3OVTHT.js → chunk-O542MPR7.js} +40 -43
  205. package/build/modern/chunk-O542MPR7.js.map +1 -0
  206. package/build/modern/chunk-OGYMMATX.js +1 -0
  207. package/build/modern/chunk-OVHCXBBI.js +22 -0
  208. package/build/modern/chunk-OVHCXBBI.js.map +1 -0
  209. package/build/modern/chunk-PLHYOCY3.js +23 -0
  210. package/build/modern/chunk-PLHYOCY3.js.map +1 -0
  211. package/build/modern/{chunk-JIRW4XOJ.js → chunk-Q3I4H6EC.js} +2 -2
  212. package/build/modern/chunk-Q3I4H6EC.js.map +1 -0
  213. package/build/modern/chunk-QCBLRACK.js +133 -0
  214. package/build/modern/chunk-QCBLRACK.js.map +1 -0
  215. package/build/modern/{chunk-FGCO27TC.js → chunk-QEM3M4N3.js} +25 -34
  216. package/build/modern/chunk-QEM3M4N3.js.map +1 -0
  217. package/build/modern/{chunk-ILQW5VZT.js → chunk-RBNOEAWJ.js} +4 -7
  218. package/build/modern/chunk-RBNOEAWJ.js.map +1 -0
  219. package/build/modern/{chunk-YKKNWILF.js → chunk-RHCTPSKT.js} +2 -15
  220. package/build/modern/chunk-RHCTPSKT.js.map +1 -0
  221. package/build/modern/chunk-STLN7BMJ.js +22 -0
  222. package/build/modern/chunk-STLN7BMJ.js.map +1 -0
  223. package/build/modern/{chunk-7NN3SJ7W.js → chunk-SWX5JWZR.js} +2 -2
  224. package/build/modern/chunk-SWX5JWZR.js.map +1 -0
  225. package/build/modern/{chunk-GCQMH4QA.js → chunk-SXLPDPOZ.js} +4 -4
  226. package/build/modern/chunk-TIJAFPHQ.js +1 -0
  227. package/build/modern/chunk-TYPULJMJ.js +1 -0
  228. package/build/modern/chunk-UDY6USHW.js +1 -0
  229. package/build/modern/chunk-V4YYGGMH.js +1 -0
  230. package/build/modern/chunk-VSTOSLFS.js +100 -0
  231. package/build/modern/chunk-VSTOSLFS.js.map +1 -0
  232. package/build/modern/{chunk-ZL6ZITLA.js → chunk-WECB67DC.js} +2 -2
  233. package/build/modern/chunk-WECB67DC.js.map +1 -0
  234. package/build/modern/{chunk-BAWZBF5Q.js → chunk-WN7TJX6J.js} +2 -2
  235. package/build/modern/{chunk-RMVJK26W.js → chunk-XJQXHSH7.js} +1 -2
  236. package/build/modern/chunk-XJQXHSH7.js.map +1 -0
  237. package/build/modern/chunk-XTNGF4D6.js +41 -0
  238. package/build/modern/chunk-XTNGF4D6.js.map +1 -0
  239. package/build/modern/chunk-Y4ZEJ2EF.js +31 -0
  240. package/build/modern/chunk-Y4ZEJ2EF.js.map +1 -0
  241. package/build/modern/{chunk-WPVDQRRF.js → chunk-YOTXFCCC.js} +2 -2
  242. package/build/modern/chunk-YOTXFCCC.js.map +1 -0
  243. package/build/modern/chunk-Z3FDG263.js +53 -0
  244. package/build/modern/chunk-Z3FDG263.js.map +1 -0
  245. package/build/modern/{chunk-JAROS4Q3.js → chunk-Z4342DRO.js} +10 -10
  246. package/build/modern/chunk-Z4342DRO.js.map +1 -0
  247. package/build/modern/chunk-Z52R6ABJ.js +21 -0
  248. package/build/modern/chunk-Z52R6ABJ.js.map +1 -0
  249. package/build/modern/{chunk-O6LFWUHI.js → chunk-ZFFW5ELD.js} +10 -10
  250. package/build/modern/chunk-ZFFW5ELD.js.map +1 -0
  251. package/build/modern/components/Accordion.js +1 -1
  252. package/build/modern/components/AccordionItemGroup.js +3 -3
  253. package/build/modern/components/Admonition.client.js +3 -3
  254. package/build/modern/components/Admonition.js +4 -4
  255. package/build/modern/components/Avatar.js +2 -2
  256. package/build/modern/components/DatePicker.client.js +4 -3
  257. package/build/modern/components/FileStatus.js +11 -5
  258. package/build/modern/components/FileUploader.js +3 -3
  259. package/build/modern/components/Legend.js +1 -2
  260. package/build/modern/components/Tag.js +2 -2
  261. package/build/modern/components/button/button.js +12 -0
  262. package/build/modern/components/button/index.js +16 -0
  263. package/build/modern/components/button/parts.js +10 -0
  264. package/build/modern/components/checkbox/checkbox-icon.js +12 -0
  265. package/build/modern/components/checkbox/checkbox.js +13 -0
  266. package/build/modern/components/checkbox/index.js +30 -0
  267. package/build/modern/components/checkbox/parts.js +8 -0
  268. package/build/modern/components/checkbox/primitives.js +17 -0
  269. package/build/modern/components/cta-dialog/context.js +8 -0
  270. package/build/modern/components/cta-dialog/index.js +26 -0
  271. package/build/modern/components/cta-dialog/provider.js +22 -0
  272. package/build/modern/components/cta-dialog/provider.js.map +1 -0
  273. package/build/modern/components/cta-dialog/trigger-item.js +10 -0
  274. package/build/modern/components/cta-dialog/trigger-item.js.map +1 -0
  275. package/build/modern/components/cta-dialog/utils.js +7 -0
  276. package/build/modern/components/cta-dialog/utils.js.map +1 -0
  277. package/build/modern/components/deprecated/FieldMessage.js +8 -0
  278. package/build/modern/components/deprecated/FieldMessage.js.map +1 -0
  279. package/build/modern/components/deprecated/FieldsetLabel.js +7 -0
  280. package/build/modern/components/deprecated/FieldsetLabel.js.map +1 -0
  281. package/build/modern/components/deprecated/Label.js +17 -0
  282. package/build/modern/components/deprecated/Label.js.map +1 -0
  283. package/build/modern/components/deprecated/Modal.js +7 -0
  284. package/build/modern/components/deprecated/Modal.js.map +1 -0
  285. package/build/modern/components/deprecated/ModalDescription.js +7 -0
  286. package/build/modern/components/deprecated/ModalDescription.js.map +1 -0
  287. package/build/modern/components/deprecated/ModalHeader.js +7 -0
  288. package/build/modern/components/deprecated/ModalHeader.js.map +1 -0
  289. package/build/modern/components/deprecated/ModalHeading.js +7 -0
  290. package/build/modern/components/deprecated/ModalHeading.js.map +1 -0
  291. package/build/modern/components/deprecated/NavMenuLink.js +8 -0
  292. package/build/modern/components/deprecated/NavMenuLink.js.map +1 -0
  293. package/build/modern/components/deprecated/NavMenuList.js +12 -0
  294. package/build/modern/components/deprecated/NavMenuList.js.map +1 -0
  295. package/build/modern/components/deprecated/NavMenuTrigger.js +11 -0
  296. package/build/modern/components/deprecated/NavMenuTrigger.js.map +1 -0
  297. package/build/modern/components/field/field.js +14 -0
  298. package/build/modern/components/field/field.js.map +1 -0
  299. package/build/modern/components/field/index.js +44 -0
  300. package/build/modern/components/field/index.js.map +1 -0
  301. package/build/modern/components/field/parts.js +11 -0
  302. package/build/modern/components/field/parts.js.map +1 -0
  303. package/build/modern/components/field/primitives.js +26 -0
  304. package/build/modern/components/field/primitives.js.map +1 -0
  305. package/build/modern/components/field/start-indicator.js +7 -0
  306. package/build/modern/components/field/start-indicator.js.map +1 -0
  307. package/build/modern/components/field/status-indicator.js +9 -0
  308. package/build/modern/components/field/status-indicator.js.map +1 -0
  309. package/build/modern/components/fieldset/fieldset.js +11 -0
  310. package/build/modern/components/fieldset/fieldset.js.map +1 -0
  311. package/build/modern/components/fieldset/index.js +24 -0
  312. package/build/modern/components/fieldset/index.js.map +1 -0
  313. package/build/modern/components/fieldset/parts.js +8 -0
  314. package/build/modern/components/fieldset/parts.js.map +1 -0
  315. package/build/modern/components/fieldset/primitives.js +13 -0
  316. package/build/modern/components/fieldset/primitives.js.map +1 -0
  317. package/build/modern/components/for.js +7 -0
  318. package/build/modern/components/for.js.map +1 -0
  319. package/build/modern/components/radio/index.js +30 -0
  320. package/build/modern/components/radio/index.js.map +1 -0
  321. package/build/modern/components/radio/parts.js +8 -0
  322. package/build/modern/components/radio/parts.js.map +1 -0
  323. package/build/modern/components/radio/primitives.js +21 -0
  324. package/build/modern/components/radio/primitives.js.map +1 -0
  325. package/build/modern/components/radio/radio.js +8 -0
  326. package/build/modern/components/radio/radio.js.map +1 -0
  327. package/build/modern/components/select/index.js +57 -0
  328. package/build/modern/components/select/index.js.map +1 -0
  329. package/build/modern/components/select/option-group.js +10 -0
  330. package/build/modern/components/select/option-group.js.map +1 -0
  331. package/build/modern/components/select/parts.js +8 -0
  332. package/build/modern/components/select/parts.js.map +1 -0
  333. package/build/modern/components/select/primitives.js +37 -0
  334. package/build/modern/components/select/primitives.js.map +1 -0
  335. package/build/modern/components/select/select.js +15 -0
  336. package/build/modern/components/select/select.js.map +1 -0
  337. package/build/modern/components/switch/index.js +26 -0
  338. package/build/modern/components/switch/index.js.map +1 -0
  339. package/build/modern/components/switch/parts.js +8 -0
  340. package/build/modern/components/switch/parts.js.map +1 -0
  341. package/build/modern/components/switch/primitives.js +15 -0
  342. package/build/modern/components/switch/primitives.js.map +1 -0
  343. package/build/modern/components/switch/switch-indicator.js +9 -0
  344. package/build/modern/components/switch/switch-indicator.js.map +1 -0
  345. package/build/modern/components/switch/switch.js +11 -0
  346. package/build/modern/components/switch/switch.js.map +1 -0
  347. package/build/modern/components/toggle/index.js +14 -0
  348. package/build/modern/components/toggle/index.js.map +1 -0
  349. package/build/modern/components/toggle/parts.js +8 -0
  350. package/build/modern/components/toggle/parts.js.map +1 -0
  351. package/build/modern/components/toggle/primitives.js +9 -0
  352. package/build/modern/components/toggle/primitives.js.map +1 -0
  353. package/build/modern/context/confirm-modal.js +5 -4
  354. package/build/modern/context/field.js +34 -4
  355. package/build/modern/context/field.js.map +1 -1
  356. package/build/modern/context/notification-center.js +5 -4
  357. package/build/modern/context/prompt-modal.js +13 -7
  358. package/build/modern/hooks/useDate.js +1 -1
  359. package/build/modern/hooks/useRootColors.js +1 -1
  360. package/build/modern/hooks/useToggle.js +1 -1
  361. package/build/modern/index.js +304 -129
  362. package/build/modern/index.js.map +1 -1
  363. package/build/modern/utils/index.js +5 -3
  364. package/package.json +2 -2
  365. package/src/components/Accordion.tsx +1 -0
  366. package/src/components/DatePicker.client.tsx +3 -15
  367. package/src/components/FileStatus.tsx +4 -5
  368. package/src/components/Legend.tsx +5 -6
  369. package/src/components/button/button.tsx +77 -0
  370. package/src/components/button/index.ts +2 -0
  371. package/src/components/button/parts.ts +32 -0
  372. package/src/components/checkbox/checkbox-icon.tsx +39 -0
  373. package/src/components/checkbox/checkbox.tsx +42 -0
  374. package/src/components/checkbox/index.ts +3 -0
  375. package/src/components/checkbox/parts.ts +59 -0
  376. package/src/components/checkbox/primitives.tsx +104 -0
  377. package/src/components/cta-dialog/context.tsx +34 -0
  378. package/src/components/cta-dialog/index.ts +2 -0
  379. package/src/{context/cta-modal.tsx → components/cta-dialog/provider.tsx} +34 -68
  380. package/src/components/cta-dialog/trigger-item.tsx +53 -0
  381. package/src/components/cta-dialog/utils.ts +57 -0
  382. package/src/components/{FieldMessage.tsx → deprecated/FieldMessage.tsx} +2 -13
  383. package/src/components/deprecated/FieldsetLabel.tsx +32 -0
  384. package/src/components/deprecated/Label.tsx +24 -0
  385. package/src/components/{NavMenuLink.tsx → deprecated/NavMenuLink.tsx} +1 -1
  386. package/src/components/{NavMenuList.tsx → deprecated/NavMenuList.tsx} +3 -3
  387. package/src/components/{NavMenuTrigger.tsx → deprecated/NavMenuTrigger.tsx} +4 -4
  388. package/src/components/field/field.tsx +77 -0
  389. package/src/components/field/index.ts +5 -0
  390. package/src/components/field/parts.ts +77 -0
  391. package/src/components/field/primitives.tsx +204 -0
  392. package/src/components/field/start-indicator.tsx +23 -0
  393. package/src/components/field/status-indicator.tsx +58 -0
  394. package/src/components/fieldset/fieldset.tsx +55 -0
  395. package/src/components/fieldset/index.ts +3 -0
  396. package/src/components/fieldset/parts.ts +47 -0
  397. package/src/components/fieldset/primitives.tsx +79 -0
  398. package/src/components/for.tsx +38 -0
  399. package/src/components/radio/index.ts +3 -0
  400. package/src/components/radio/parts.ts +65 -0
  401. package/src/components/radio/primitives.tsx +123 -0
  402. package/src/components/radio/radio.tsx +35 -0
  403. package/src/components/select/index.ts +4 -0
  404. package/src/components/select/option-group.tsx +34 -0
  405. package/src/components/select/parts.ts +113 -0
  406. package/src/components/select/primitives.tsx +205 -0
  407. package/src/components/select/select.tsx +135 -0
  408. package/src/components/switch/index.ts +3 -0
  409. package/src/components/switch/parts.ts +53 -0
  410. package/src/components/switch/primitives.tsx +69 -0
  411. package/src/components/switch/switch-indicator.tsx +9 -0
  412. package/src/components/switch/switch.tsx +30 -0
  413. package/src/components/toggle/index.ts +2 -0
  414. package/src/components/toggle/parts.ts +32 -0
  415. package/src/components/toggle/primitives.tsx +17 -0
  416. package/src/config/types.ts +1 -0
  417. package/src/context/confirm-modal.tsx +1 -1
  418. package/src/context/field.tsx +6 -5
  419. package/src/context/notification-center.tsx +1 -1
  420. package/src/context/prompt-modal.tsx +16 -18
  421. package/src/hooks/useDate.ts +1 -7
  422. package/src/hooks/useRootColors.ts +0 -1
  423. package/src/hooks/useToggle.ts +1 -3
  424. package/src/index.ts +24 -24
  425. package/src/utils/index.ts +30 -0
  426. package/build/legacy/components/Button.cjs.map +0 -1
  427. package/build/legacy/components/Checkbox.cjs +0 -113
  428. package/build/legacy/components/Checkbox.cjs.map +0 -1
  429. package/build/legacy/components/FieldMessage.cjs.map +0 -1
  430. package/build/legacy/components/Fieldset.cjs.map +0 -1
  431. package/build/legacy/components/FieldsetLabel.cjs.map +0 -1
  432. package/build/legacy/components/Input.cjs +0 -95
  433. package/build/legacy/components/Input.cjs.map +0 -1
  434. package/build/legacy/components/Label.cjs +0 -93
  435. package/build/legacy/components/Label.cjs.map +0 -1
  436. package/build/legacy/components/Modal.cjs.map +0 -1
  437. package/build/legacy/components/ModalDescription.cjs.map +0 -1
  438. package/build/legacy/components/ModalHeader.cjs.map +0 -1
  439. package/build/legacy/components/ModalHeading.cjs.map +0 -1
  440. package/build/legacy/components/NavMenuLink.cjs.map +0 -1
  441. package/build/legacy/components/NavMenuList.cjs.map +0 -1
  442. package/build/legacy/components/NavMenuTrigger.cjs.map +0 -1
  443. package/build/legacy/components/Radio.cjs +0 -81
  444. package/build/legacy/components/Radio.cjs.map +0 -1
  445. package/build/legacy/components/Select.cjs +0 -120
  446. package/build/legacy/components/Select.cjs.map +0 -1
  447. package/build/legacy/components/Textarea.cjs.map +0 -1
  448. package/build/legacy/components/Toggle.cjs +0 -101
  449. package/build/legacy/components/Toggle.cjs.map +0 -1
  450. package/build/legacy/context/cta-modal.cjs.map +0 -1
  451. package/build/modern/chunk-3BM6MZ4A.js.map +0 -1
  452. package/build/modern/chunk-3ZDFQO25.js +0 -31
  453. package/build/modern/chunk-3ZDFQO25.js.map +0 -1
  454. package/build/modern/chunk-7NN3SJ7W.js.map +0 -1
  455. package/build/modern/chunk-BHB56M7S.js.map +0 -1
  456. package/build/modern/chunk-C5EHJUS5.js +0 -10
  457. package/build/modern/chunk-C5EHJUS5.js.map +0 -1
  458. package/build/modern/chunk-EXGKZGML.js +0 -28
  459. package/build/modern/chunk-EXGKZGML.js.map +0 -1
  460. package/build/modern/chunk-FGCO27TC.js.map +0 -1
  461. package/build/modern/chunk-FTPZHG6J.js +0 -46
  462. package/build/modern/chunk-FTPZHG6J.js.map +0 -1
  463. package/build/modern/chunk-IGHMP4WA.js.map +0 -1
  464. package/build/modern/chunk-ILQW5VZT.js.map +0 -1
  465. package/build/modern/chunk-JAROS4Q3.js.map +0 -1
  466. package/build/modern/chunk-JIJM6JFJ.js +0 -36
  467. package/build/modern/chunk-JIJM6JFJ.js.map +0 -1
  468. package/build/modern/chunk-JIRW4XOJ.js.map +0 -1
  469. package/build/modern/chunk-JWIJHSI6.js.map +0 -1
  470. package/build/modern/chunk-KKHL3ZO4.js +0 -69
  471. package/build/modern/chunk-KKHL3ZO4.js.map +0 -1
  472. package/build/modern/chunk-MZ3UCDUL.js +0 -43
  473. package/build/modern/chunk-MZ3UCDUL.js.map +0 -1
  474. package/build/modern/chunk-N24COMHJ.js +0 -63
  475. package/build/modern/chunk-N24COMHJ.js.map +0 -1
  476. package/build/modern/chunk-NMF2HYWO.js +0 -50
  477. package/build/modern/chunk-NMF2HYWO.js.map +0 -1
  478. package/build/modern/chunk-NUMM4TNC.js.map +0 -1
  479. package/build/modern/chunk-O6LFWUHI.js.map +0 -1
  480. package/build/modern/chunk-PM7CWT3N.js.map +0 -1
  481. package/build/modern/chunk-PZAZKQMO.js.map +0 -1
  482. package/build/modern/chunk-REO5GUNC.js.map +0 -1
  483. package/build/modern/chunk-RMVJK26W.js.map +0 -1
  484. package/build/modern/chunk-SD3OVTHT.js.map +0 -1
  485. package/build/modern/chunk-UZDVOIW5.js +0 -33
  486. package/build/modern/chunk-UZDVOIW5.js.map +0 -1
  487. package/build/modern/chunk-UZVQ4INR.js.map +0 -1
  488. package/build/modern/chunk-WPVDQRRF.js.map +0 -1
  489. package/build/modern/chunk-XQICKZH4.js +0 -59
  490. package/build/modern/chunk-XQICKZH4.js.map +0 -1
  491. package/build/modern/chunk-YKKNWILF.js.map +0 -1
  492. package/build/modern/chunk-ZL6ZITLA.js.map +0 -1
  493. package/build/modern/components/Button.js +0 -7
  494. package/build/modern/components/Checkbox.js +0 -11
  495. package/build/modern/components/FieldMessage.js +0 -9
  496. package/build/modern/components/Fieldset.js +0 -9
  497. package/build/modern/components/FieldsetLabel.js +0 -7
  498. package/build/modern/components/Input.js +0 -11
  499. package/build/modern/components/Label.js +0 -10
  500. package/build/modern/components/Modal.js +0 -7
  501. package/build/modern/components/ModalDescription.js +0 -7
  502. package/build/modern/components/ModalHeader.js +0 -7
  503. package/build/modern/components/ModalHeading.js +0 -7
  504. package/build/modern/components/NavMenuLink.js +0 -8
  505. package/build/modern/components/NavMenuList.js +0 -12
  506. package/build/modern/components/NavMenuTrigger.js +0 -11
  507. package/build/modern/components/Radio.js +0 -9
  508. package/build/modern/components/Select.js +0 -13
  509. package/build/modern/components/Textarea.js +0 -9
  510. package/build/modern/components/Toggle.js +0 -10
  511. package/build/modern/context/cta-modal.js +0 -18
  512. package/src/components/Button.tsx +0 -35
  513. package/src/components/Checkbox.tsx +0 -93
  514. package/src/components/Fieldset.tsx +0 -65
  515. package/src/components/FieldsetLabel.tsx +0 -59
  516. package/src/components/Input.tsx +0 -69
  517. package/src/components/Label.tsx +0 -69
  518. package/src/components/Radio.tsx +0 -73
  519. package/src/components/Select.tsx +0 -108
  520. package/src/components/Textarea.tsx +0 -52
  521. package/src/components/Toggle.tsx +0 -91
  522. /package/build/modern/{chunk-ISCJ542I.js.map → chunk-2HOUQ2DX.js.map} +0 -0
  523. /package/build/modern/{components/Button.js.map → chunk-2LF3HPNA.js.map} +0 -0
  524. /package/build/modern/{chunk-25HMVHLT.js.map → chunk-7SU6FCTJ.js.map} +0 -0
  525. /package/build/modern/{components/Checkbox.js.map → chunk-CYC2YUKU.js.map} +0 -0
  526. /package/build/modern/{chunk-NJSETNRL.js.map → chunk-DXBZ3HMY.js.map} +0 -0
  527. /package/build/modern/{components/FieldMessage.js.map → chunk-IDTAB2UJ.js.map} +0 -0
  528. /package/build/modern/{components/Fieldset.js.map → chunk-IKDXADLX.js.map} +0 -0
  529. /package/build/modern/{chunk-EDARV2EI.js.map → chunk-MISIUX63.js.map} +0 -0
  530. /package/build/modern/{components/FieldsetLabel.js.map → chunk-OGYMMATX.js.map} +0 -0
  531. /package/build/modern/{chunk-GCQMH4QA.js.map → chunk-SXLPDPOZ.js.map} +0 -0
  532. /package/build/modern/{components/Input.js.map → chunk-TIJAFPHQ.js.map} +0 -0
  533. /package/build/modern/{components/Label.js.map → chunk-TYPULJMJ.js.map} +0 -0
  534. /package/build/modern/{components/Modal.js.map → chunk-UDY6USHW.js.map} +0 -0
  535. /package/build/modern/{components/ModalDescription.js.map → chunk-V4YYGGMH.js.map} +0 -0
  536. /package/build/modern/{chunk-BAWZBF5Q.js.map → chunk-WN7TJX6J.js.map} +0 -0
  537. /package/build/modern/components/{ModalHeader.js.map → button/button.js.map} +0 -0
  538. /package/build/modern/components/{ModalHeading.js.map → button/index.js.map} +0 -0
  539. /package/build/modern/components/{NavMenuLink.js.map → button/parts.js.map} +0 -0
  540. /package/build/modern/components/{NavMenuList.js.map → checkbox/checkbox-icon.js.map} +0 -0
  541. /package/build/modern/components/{NavMenuTrigger.js.map → checkbox/checkbox.js.map} +0 -0
  542. /package/build/modern/components/{Radio.js.map → checkbox/index.js.map} +0 -0
  543. /package/build/modern/components/{Select.js.map → checkbox/parts.js.map} +0 -0
  544. /package/build/modern/components/{Textarea.js.map → checkbox/primitives.js.map} +0 -0
  545. /package/build/modern/components/{Toggle.js.map → cta-dialog/context.js.map} +0 -0
  546. /package/build/modern/{context/cta-modal.js.map → components/cta-dialog/index.js.map} +0 -0
  547. /package/src/components/{Modal.tsx → deprecated/Modal.tsx} +0 -0
  548. /package/src/components/{ModalDescription.tsx → deprecated/ModalDescription.tsx} +0 -0
  549. /package/src/components/{ModalHeader.tsx → deprecated/ModalHeader.tsx} +0 -0
  550. /package/src/components/{ModalHeading.tsx → deprecated/ModalHeading.tsx} +0 -0
@@ -1,93 +0,0 @@
1
- 'use client'
2
-
3
- import {
4
- checkbox,
5
- type CheckboxVariantProps,
6
- } from '@cerberus/styled-system/recipes'
7
- import { vstack } from '@cerberus/styled-system/patterns'
8
- import { cx } from '@cerberus/styled-system/css'
9
- import type { InputHTMLAttributes } from 'react'
10
- import { Show } from './Show'
11
- import { useFieldContext } from '../context/field'
12
- import { useCerberusContext } from '../context/cerberus'
13
-
14
- /**
15
- * This module contains the Checkbox component.
16
- * @module
17
- */
18
-
19
- export type CheckboxProps = CheckboxVariantProps &
20
- Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'id'> & {
21
- /**
22
- * The id of the FieldMessage element describing the Checkbox.
23
- */
24
- describedBy?: string
25
- /**
26
- * The unique identifier for the checkbox. Required for accessibility.
27
- */
28
- id: string
29
- /**
30
- * Used to display a mixed checked state.
31
- * @description [ARIA Mixed State](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/examples/checkbox-mixed/)
32
- */
33
- mixed?: boolean
34
- }
35
-
36
- /**
37
- * Checkbox component
38
- * @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)
39
- * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)
40
- * @see https://cerberus.digitalu.design/react/checkbox
41
- * @example
42
- * ```tsx
43
- * <Field>
44
- * <Checkbox id="legal" checked={checked.legal} onChange={handleChange} />
45
- * </Field>
46
- * ```
47
- */
48
- export function Checkbox(props: CheckboxProps) {
49
- const { describedBy, size, checked, mixed, ...nativeProps } = props
50
- const { invalid, ...fieldStates } = useFieldContext()
51
- const styles = checkbox({ size })
52
- const { icons } = useCerberusContext()
53
- const { checkbox: CheckIcon, indeterminate: IndeterminateIcon } = icons
54
-
55
- if (!CheckIcon) {
56
- throw new Error('The CerberusProvider is missing the checkbox icon.')
57
- }
58
- if (!IndeterminateIcon) {
59
- throw new Error('The CerberusProvider is missing the indeterminate icon.')
60
- }
61
-
62
- return (
63
- <div
64
- className={cx(
65
- styles.root,
66
- vstack({
67
- gap: '0',
68
- justify: 'center',
69
- }),
70
- )}
71
- >
72
- <input
73
- {...nativeProps}
74
- {...fieldStates}
75
- {...(describedBy && { 'aria-describedby': describedBy })}
76
- {...(invalid && { 'aria-invalid': true })}
77
- {...(mixed && { 'aria-checked': 'mixed' })}
78
- className={cx('peer', nativeProps.className, styles.input)}
79
- type="checkbox"
80
- />
81
- <Show when={checked && !mixed}>
82
- <span className={styles.icon}>
83
- <CheckIcon />
84
- </span>
85
- </Show>
86
- <Show when={mixed}>
87
- <span className={styles.icon}>
88
- <IndeterminateIcon />
89
- </span>
90
- </Show>
91
- </div>
92
- )
93
- }
@@ -1,65 +0,0 @@
1
- 'use client'
2
-
3
- import { css, cx } from '@cerberus/styled-system/css'
4
- import type { FieldsetHTMLAttributes } from 'react'
5
- import { useFieldContext } from '../context/field'
6
-
7
- /**
8
- * This module contains the Fieldset component.
9
- * @module Fieldset
10
- */
11
-
12
- export type FieldsetProps = FieldsetHTMLAttributes<HTMLFieldSetElement>
13
-
14
- /**
15
- * A component to group related elements in a form for accessibility.
16
- * @memberof Field
17
- * @see https://cerberus.digitalu.com/react/fieldset
18
- * @description [A11y Form Checklist](https://www.a11yproject.com/checklist/#forms)
19
- * @description [MDN Web Docs: Fieldset](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset)
20
- * @example
21
- * ```tsx
22
- * import { Fieldset, Legend, Field, Radio, Label } from '@cerberus/react'
23
- * import { Hstack } from '@cerberus/styled-system/jsx'
24
- *
25
- * function SomeForm() {
26
- * return (
27
- * <form>
28
- * <Fieldset>
29
- * <Legend>Do you like cats?</Legend>
30
- * <Hstack>
31
- * <Field>
32
- * <Radio id="yes" name="cats" value="yes" />
33
- * <Label htmlFor="yes">Yes</Label>
34
- * </Field>
35
- * </Hstack>
36
- * <Hstack>
37
- * <Field>
38
- * <Radio id="no" name="cats" value="no" />
39
- * <Label htmlFor="no">No</Label>
40
- * </Field>
41
- * </Hstack>
42
- * </Fieldset>
43
- * </form>
44
- * )
45
- * }
46
- */
47
- export function Fieldset(props: FieldsetProps) {
48
- const { invalid, ...formState } = useFieldContext()
49
-
50
- return (
51
- <fieldset
52
- {...props}
53
- {...formState}
54
- {...(invalid && { 'aria-invalid': true })}
55
- className={cx(
56
- props.className,
57
- css({
58
- border: 'none',
59
- pt: 2,
60
- margin: 0,
61
- }),
62
- )}
63
- />
64
- )
65
- }
@@ -1,59 +0,0 @@
1
- import { cx } from '@cerberus/styled-system/css'
2
- import { label, type LabelVariantProps } from '@cerberus/styled-system/recipes'
3
- import type { LabelProps } from './Label'
4
-
5
- /**
6
- * This module contains the FieldsetLabel component.
7
- * @module FieldsetLabel
8
- */
9
-
10
- export type FieldsetLabelProps = LabelProps & LabelVariantProps
11
-
12
- /**
13
- * Used for labeling inputs that are children of a Fieldset group.
14
- * @memberof Fieldset
15
- * @see https://cerberus.digitalu.design/react/fieldset
16
- * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)
17
- * @example
18
- * ```tsx
19
- * import { Fieldset, Legend, Field, Radio, Label } from '@cerberus/react'
20
- * import { Hstack } from '@cerberus/styled-system/jsx'
21
- *
22
- * function SomeForm() {
23
- * return (
24
- * <form>
25
- * <Fieldset>
26
- * <Legend>Do you like cats?</Legend>
27
- * <Hstack>
28
- * <Field>
29
- * <Radio id="yes" name="cats" value="yes" />
30
- * <FieldsetLabel htmlFor="yes">Yes</FieldsetLabel>
31
- * </Field>
32
- * </Hstack>
33
- * <Hstack>
34
- * <Field>
35
- * <Radio id="no" name="cats" value="no" />
36
- * <FieldsetLabel htmlFor="no">No</FieldsetLabel>
37
- * </Field>
38
- * </Hstack>
39
- * </Fieldset>
40
- * </form>
41
- * )
42
- * }
43
- * ```
44
- */
45
- export function FieldsetLabel(props: FieldsetLabelProps) {
46
- const { size, usage, ...nativeProps } = props
47
- return (
48
- <label
49
- {...nativeProps}
50
- className={cx(
51
- nativeProps.className,
52
- label({
53
- size,
54
- usage,
55
- }),
56
- )}
57
- />
58
- )
59
- }
@@ -1,69 +0,0 @@
1
- 'use client'
2
-
3
- import type { InputHTMLAttributes, ReactNode } from 'react'
4
- import { input, type InputVariantProps } from '@cerberus/styled-system/recipes'
5
- import { cx } from '@cerberus/styled-system/css'
6
- import { useFieldContext } from '../context/field'
7
- import { useCerberusContext } from '../context/cerberus'
8
- import { Show } from './Show'
9
-
10
- export interface InputBaseProps
11
- extends Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'size'> {
12
- /**
13
- * The id of the FieldMessage component used to describe the input. Required for accessibility.
14
- */
15
- describedBy?: string
16
- /**
17
- * The unique identifier for the input element. Required for accessibility.
18
- */
19
- id: string
20
- /**
21
- * An optional icon to display at the start of the input.
22
- */
23
- startIcon?: ReactNode
24
- /**
25
- * An optional icon to display at the end of the input.
26
- */
27
- endIcon?: ReactNode
28
- }
29
- export type InputProps = InputBaseProps & InputVariantProps
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
- */
37
- export function Input(props: InputProps) {
38
- const { describedBy, size, startIcon, endIcon, ...nativeProps } = props
39
- const inputStyles = input({ size })
40
- const { invalid, ...fieldStates } = useFieldContext()
41
- const hasEndIcon = Boolean(endIcon)
42
-
43
- const { icons } = useCerberusContext()
44
- const { invalid: InvalidIcon } = icons
45
-
46
- return (
47
- <div className={inputStyles.root}>
48
- <Show when={Boolean(startIcon)}>
49
- <span className={inputStyles.startIcon}>{startIcon}</span>
50
- </Show>
51
-
52
- <input
53
- {...nativeProps}
54
- {...fieldStates}
55
- {...(describedBy && { 'aria-describedby': describedBy })}
56
- {...(invalid && { 'aria-invalid': true })}
57
- data-start-icon={Boolean(startIcon)}
58
- className={cx('peer', nativeProps.className, inputStyles.input)}
59
- />
60
-
61
- <Show when={invalid}>
62
- <InvalidIcon className={inputStyles.icon} />
63
- </Show>
64
- <Show when={hasEndIcon && !invalid}>
65
- <span className={inputStyles.icon}>{endIcon}</span>
66
- </Show>
67
- </div>
68
- )
69
- }
@@ -1,69 +0,0 @@
1
- 'use client'
2
-
3
- import type { HTMLAttributes, PropsWithChildren } from 'react'
4
- import { label, type LabelVariantProps } from '@cerberus/styled-system/recipes'
5
- import { css, cx } from '@cerberus/styled-system/css'
6
- import { hstack } from '@cerberus/styled-system/patterns'
7
- import { useFieldContext } from '../context/field'
8
- import { Show } from './Show'
9
-
10
- /**
11
- * This module contains the Label component.
12
- * @module
13
- */
14
- export interface LabelBaseProps extends HTMLAttributes<HTMLLabelElement> {
15
- /**
16
- * The unique identifier for the input element. Required for accessibility.
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
- */
22
- hidden?: boolean
23
- }
24
- export type LabelProps = LabelBaseProps & LabelVariantProps
25
-
26
- /**
27
- * A a11y compliant label component.
28
- * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)
29
- * @see https://cerberus.digitalu.design/react/label
30
- * @example
31
- * ```tsx
32
- * <Field required>
33
- * <Label htmlFor="search" hidden>Search everything</Label>
34
- * <Input id="search" startIcon={Search} type="text" />
35
- * </Field>
36
- * ```
37
- */
38
- export function Label(props: PropsWithChildren<LabelProps>) {
39
- const { hidden, size, ...nativeProps } = props
40
- const { required, disabled } = useFieldContext()
41
- const usage = hidden ? 'hidden' : 'visible'
42
-
43
- return (
44
- <label
45
- {...nativeProps}
46
- {...(disabled && { 'data-disabled': true })}
47
- className={cx(
48
- nativeProps.className,
49
- label({ size, usage }),
50
- hstack({
51
- justify: 'space-between',
52
- w: 'full',
53
- }),
54
- )}
55
- >
56
- {props.children}
57
- <Show when={required}>
58
- <span
59
- className={css({
60
- color: 'page.text.100',
61
- fontSize: 'inherit',
62
- })}
63
- >
64
- (required)
65
- </span>
66
- </Show>
67
- </label>
68
- )
69
- }
@@ -1,73 +0,0 @@
1
- 'use client'
2
-
3
- import { cx } from '@cerberus/styled-system/css'
4
- import { hstack } from '@cerberus/styled-system/patterns'
5
- import { radio } from '@cerberus/styled-system/recipes'
6
- import type { RecipeVariantProps } from '@cerberus/styled-system/types'
7
- import type { InputHTMLAttributes, PropsWithChildren } from 'react'
8
- import { useFieldContext } from '../context/field'
9
-
10
- /**
11
- * This module contains the Radio component.
12
- * @module
13
- */
14
-
15
- export type RadioRecipe = RecipeVariantProps<typeof radio>
16
- export interface RadioBaseProps
17
- extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
18
- /**
19
- * A unique identifier for the radio button. Required for accessibility.
20
- */
21
- id: string
22
- }
23
- export type RadioProps = RadioBaseProps & RadioRecipe
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
- */
46
- export function Radio(props: PropsWithChildren<RadioProps>) {
47
- const { children, size, ...nativeProps } = props
48
- const { invalid, ...state } = useFieldContext()
49
- const styles = radio({ size })
50
-
51
- return (
52
- <div
53
- className={cx(
54
- 'group',
55
- hstack({
56
- gap: 'sm',
57
- }),
58
- styles.root,
59
- )}
60
- tabIndex={0}
61
- >
62
- <input
63
- {...nativeProps}
64
- {...state}
65
- {...(invalid && { 'aria-invalid': true })}
66
- className={cx(nativeProps.className, styles.input)}
67
- tabIndex={-1}
68
- type="radio"
69
- />
70
- {children}
71
- </div>
72
- )
73
- }
@@ -1,108 +0,0 @@
1
- 'use client'
2
-
3
- import { cx } from '@cerberus/styled-system/css'
4
- import { hstack } from '@cerberus/styled-system/patterns'
5
- import {
6
- select,
7
- type SelectVariantProps,
8
- } from '@cerberus/styled-system/recipes'
9
- import type { OptionHTMLAttributes, SelectHTMLAttributes } from 'react'
10
- import { useFieldContext } from '../context/field'
11
- import { useCerberusContext } from '../context/cerberus'
12
- import { Show } from './Show'
13
-
14
- /**
15
- * This module contains the select components.
16
- * @module
17
- */
18
-
19
- export type SelectProps = Omit<
20
- SelectHTMLAttributes<HTMLSelectElement>,
21
- 'size'
22
- > &
23
- SelectVariantProps & {
24
- /**
25
- * The unique id of the select element. Required for accessibility.
26
- */
27
- id: string
28
- /**
29
- * The id of the FieldMessage that describes the select element.
30
- */
31
- describedBy?: string
32
- }
33
-
34
- /**
35
- * Used to allow users to select a single option from a list of options.
36
- * @see https://cerberus.digitalu.design/react/select
37
- * @memberof module:Field
38
- * @example
39
- * ```tsx
40
- * <Field>
41
- * <Select describedby="help:fruit" id="fruit">
42
- * <Option value="">Choose option</Option>
43
- * <Option value="one">Option 1</Option>
44
- * <Option value="two">Option 2</Option>
45
- * <Option value="three">Option 3</Option>
46
- * </Select>
47
- * </Field>
48
- * ```
49
- */
50
- export function Select(props: SelectProps) {
51
- const { describedBy, size, ...nativeProps } = props
52
- const { invalid, ...fieldStates } = useFieldContext()
53
-
54
- const { icons } = useCerberusContext()
55
- const { invalid: InvalidIcon, selectArrow: SelectArrow } = icons
56
-
57
- const styles = select({
58
- size,
59
- })
60
-
61
- return (
62
- <div className={styles.root}>
63
- <select
64
- {...nativeProps}
65
- {...fieldStates}
66
- {...(describedBy && { 'aria-describedby': describedBy })}
67
- {...(invalid && { 'aria-invalid': true })}
68
- className={styles.input}
69
- />
70
- <span
71
- className={cx(
72
- styles.iconStack,
73
- hstack({
74
- gap: '2',
75
- }),
76
- )}
77
- >
78
- <Show when={invalid}>
79
- <span
80
- {...(invalid && { 'data-invalid': true })}
81
- className={styles.stateIcon}
82
- >
83
- <InvalidIcon />
84
- </span>
85
- </Show>
86
- <span className={styles.arrowIcon}>
87
- <SelectArrow />
88
- </span>
89
- </span>
90
- </div>
91
- )
92
- }
93
-
94
- // We only export this component for consistency with the other components
95
-
96
- export type OptionProps = OptionHTMLAttributes<HTMLOptionElement>
97
-
98
- /**
99
- * Option component
100
- * props: OptionHTMLAttributes<HTMLOptionElement>
101
- * @example
102
- * ```tsx
103
- * <Option value="one">Option 1</Option>
104
- * ```
105
- */
106
- export function Option(props: OptionProps) {
107
- return <option {...props} />
108
- }
@@ -1,52 +0,0 @@
1
- 'use client'
2
-
3
- import type { TextareaHTMLAttributes } from 'react'
4
- import { css, cx } from '@cerberus/styled-system/css'
5
- import { input, type InputVariantProps } from '@cerberus/styled-system/recipes'
6
- import { useFieldContext } from '../context/field'
7
-
8
- /**
9
- * This module contains the Textarea component.
10
- * @module
11
- */
12
-
13
- export interface TextareaBaseProps
14
- extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'id'> {
15
- /**
16
- * The ID of the FieldMessage that describes the textarea.
17
- */
18
- describedBy?: string
19
- /**
20
- * The unique id of the textarea.
21
- */
22
- id: string
23
- }
24
- export type TextareaProps = InputVariantProps & TextareaBaseProps
25
-
26
- /**
27
- * A component that allows the user to input large blocks of text.
28
- * @see https://cerberus.digitalu.design/react/textarea
29
- */
30
- export function Textarea(props: TextareaProps): JSX.Element {
31
- const { describedBy, ...nativeProps } = props
32
- const { invalid, ...fieldState } = useFieldContext()
33
-
34
- return (
35
- <textarea
36
- {...nativeProps}
37
- {...fieldState}
38
- {...(describedBy && { 'aria-describedby': describedBy })}
39
- {...(invalid && { 'aria-invalid': true })}
40
- className={cx(
41
- props.className,
42
- input().input,
43
- css({
44
- pxi: '2',
45
- py: '2',
46
- resize: 'vertical',
47
- }),
48
- )}
49
- rows={4}
50
- />
51
- )
52
- }
@@ -1,91 +0,0 @@
1
- 'use client'
2
-
3
- import { cx } from '@cerberus/styled-system/css'
4
- import { hstack, vstack } from '@cerberus/styled-system/patterns'
5
- import {
6
- toggle,
7
- type ToggleVariantProps,
8
- } from '@cerberus/styled-system/recipes'
9
- import type { InputHTMLAttributes } from 'react'
10
- import { useFieldContext } from '../context/field'
11
- import { useCerberusContext } from '../context/cerberus'
12
-
13
- /**
14
- * This module provides a toggle component.
15
- * @module
16
- */
17
-
18
- export type ToggleBase = Omit<
19
- InputHTMLAttributes<HTMLInputElement>,
20
- 'size' | 'id' | 'value'
21
- > & {
22
- /**
23
- * The FieldMessage providing context for the Toggle.
24
- */
25
- describedBy?: string
26
- /**
27
- * A unique identifier for the Toggle. Required for accessibility.
28
- */
29
- id: string
30
- /**
31
- * The value of the Toggle.
32
- */
33
- value: string
34
- }
35
- export type ToggleProps = ToggleBase & ToggleVariantProps
36
-
37
- /**
38
- * The Toggle component is used to switch between two states. Optionally
39
- * combine with the `useToggle` hook.
40
- * @see https://cerberus.digitalu.design/react/toggle
41
- * @example
42
- * ```tsx
43
- * const { checked, handleChange } = useToggle({ checked: 'toggle' })
44
- *
45
- * <Hstack justify="space-between" w="full">
46
- * <Field>
47
- * <Label htmlFor="toggle">Show notifications</Label>
48
- * <Toggle
49
- * checked={checked === 'toggle'}
50
- * id="toggle"
51
- * onChange={handleChange}
52
- * value="toggle"
53
- * />
54
- * </Field>
55
- * </Hstack>
56
- * ```
57
- */
58
- export function Toggle(props: ToggleProps) {
59
- const { size, describedBy, ...nativeProps } = props
60
- const styles = toggle({ size })
61
- const { invalid, ...state } = useFieldContext()
62
- const { icons } = useCerberusContext()
63
- const CheckedIcon = icons.toggleChecked
64
-
65
- return (
66
- <span
67
- className={cx('group', styles.track, hstack())}
68
- data-checked={props.checked || props.defaultChecked}
69
- >
70
- <input
71
- {...nativeProps}
72
- {...state}
73
- {...(describedBy && { 'aria-describedby': describedBy })}
74
- {...(invalid && { 'aria-invalid': true })}
75
- className={cx('peer', styles.input)}
76
- role="switch"
77
- type="checkbox"
78
- />
79
- <span
80
- className={cx(
81
- styles.thumb,
82
- vstack({
83
- justify: 'center',
84
- }),
85
- )}
86
- >
87
- <CheckedIcon />
88
- </span>
89
- </span>
90
- )
91
- }