@cerberus-design/react 0.15.0 → 0.16.0-next-4f6c716
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.
- package/build/legacy/_tsup-dts-rollup.d.cts +1329 -360
- package/build/legacy/components/Accordion.cjs.map +1 -1
- package/build/legacy/components/AccordionItemGroup.cjs.map +1 -1
- package/build/legacy/components/DatePicker.client.cjs +63 -77
- package/build/legacy/components/DatePicker.client.cjs.map +1 -1
- package/build/legacy/components/FileStatus.cjs +126 -79
- package/build/legacy/components/FileStatus.cjs.map +1 -1
- package/build/legacy/components/Legend.cjs +10 -22
- package/build/legacy/components/Legend.cjs.map +1 -1
- package/build/legacy/components/button/button.cjs +154 -0
- package/build/legacy/components/button/button.cjs.map +1 -0
- package/build/legacy/components/button/index.cjs +163 -0
- package/build/legacy/components/button/index.cjs.map +1 -0
- package/build/legacy/components/button/parts.cjs +159 -0
- package/build/legacy/components/button/parts.cjs.map +1 -0
- package/build/legacy/components/checkbox/checkbox-icon.cjs +121 -0
- package/build/legacy/components/checkbox/checkbox-icon.cjs.map +1 -0
- package/build/legacy/components/checkbox/checkbox.cjs +165 -0
- package/build/legacy/components/checkbox/checkbox.cjs.map +1 -0
- package/build/legacy/components/checkbox/index.cjs +179 -0
- package/build/legacy/components/checkbox/index.cjs.map +1 -0
- package/build/legacy/components/checkbox/parts.cjs +89 -0
- package/build/legacy/components/checkbox/parts.cjs.map +1 -0
- package/build/legacy/components/checkbox/primitives.cjs +87 -0
- package/build/legacy/components/checkbox/primitives.cjs.map +1 -0
- package/build/legacy/components/{FieldMessage.cjs → deprecated/FieldMessage.cjs} +4 -17
- package/build/legacy/components/deprecated/FieldMessage.cjs.map +1 -0
- package/build/legacy/components/{FieldsetLabel.cjs → deprecated/FieldsetLabel.cjs} +1 -1
- package/build/legacy/components/deprecated/FieldsetLabel.cjs.map +1 -0
- package/build/legacy/components/{Textarea.cjs → deprecated/Label.cjs} +24 -36
- package/build/legacy/components/deprecated/Label.cjs.map +1 -0
- package/build/legacy/components/{Modal.cjs → deprecated/Modal.cjs} +1 -1
- package/build/legacy/components/deprecated/Modal.cjs.map +1 -0
- package/build/legacy/components/{ModalDescription.cjs → deprecated/ModalDescription.cjs} +1 -1
- package/build/legacy/components/deprecated/ModalDescription.cjs.map +1 -0
- package/build/legacy/components/{ModalHeader.cjs → deprecated/ModalHeader.cjs} +1 -1
- package/build/legacy/components/deprecated/ModalHeader.cjs.map +1 -0
- package/build/legacy/components/{ModalHeading.cjs → deprecated/ModalHeading.cjs} +1 -1
- package/build/legacy/components/deprecated/ModalHeading.cjs.map +1 -0
- package/build/legacy/components/{NavMenuLink.cjs → deprecated/NavMenuLink.cjs} +2 -2
- package/build/legacy/components/deprecated/NavMenuLink.cjs.map +1 -0
- package/build/legacy/components/{NavMenuList.cjs → deprecated/NavMenuList.cjs} +2 -2
- package/build/legacy/components/deprecated/NavMenuList.cjs.map +1 -0
- package/build/legacy/components/{NavMenuTrigger.cjs → deprecated/NavMenuTrigger.cjs} +2 -2
- package/build/legacy/components/deprecated/NavMenuTrigger.cjs.map +1 -0
- package/build/legacy/components/field/field.cjs +130 -0
- package/build/legacy/components/field/field.cjs.map +1 -0
- package/build/legacy/components/field/index.cjs +267 -0
- package/build/legacy/components/field/index.cjs.map +1 -0
- package/build/legacy/components/field/parts.cjs +188 -0
- package/build/legacy/components/field/parts.cjs.map +1 -0
- package/build/legacy/components/field/primitives.cjs +191 -0
- package/build/legacy/components/field/primitives.cjs.map +1 -0
- package/build/legacy/components/{Button.cjs → field/start-indicator.cjs} +14 -19
- package/build/legacy/components/field/start-indicator.cjs.map +1 -0
- package/build/legacy/components/field/status-indicator.cjs +78 -0
- package/build/legacy/components/field/status-indicator.cjs.map +1 -0
- package/build/legacy/components/fieldset/fieldset.cjs +116 -0
- package/build/legacy/components/fieldset/fieldset.cjs.map +1 -0
- package/build/legacy/components/fieldset/index.cjs +126 -0
- package/build/legacy/components/fieldset/index.cjs.map +1 -0
- package/build/legacy/components/fieldset/parts.cjs +80 -0
- package/build/legacy/components/fieldset/parts.cjs.map +1 -0
- package/build/legacy/components/fieldset/primitives.cjs +76 -0
- package/build/legacy/components/fieldset/primitives.cjs.map +1 -0
- package/build/legacy/components/for.cjs +38 -0
- package/build/legacy/components/for.cjs.map +1 -0
- package/build/legacy/components/radio/index.cjs +143 -0
- package/build/legacy/components/radio/index.cjs.map +1 -0
- package/build/legacy/components/radio/parts.cjs +113 -0
- package/build/legacy/components/radio/parts.cjs.map +1 -0
- package/build/legacy/components/radio/primitives.cjs +115 -0
- package/build/legacy/components/radio/primitives.cjs.map +1 -0
- package/build/legacy/components/radio/radio.cjs +82 -0
- package/build/legacy/components/radio/radio.cjs.map +1 -0
- package/build/legacy/components/select/index.cjs +265 -0
- package/build/legacy/components/select/index.cjs.map +1 -0
- package/build/legacy/components/select/option-group.cjs +60 -0
- package/build/legacy/components/select/option-group.cjs.map +1 -0
- package/build/legacy/components/select/parts.cjs +153 -0
- package/build/legacy/components/select/parts.cjs.map +1 -0
- package/build/legacy/components/select/primitives.cjs +167 -0
- package/build/legacy/components/select/primitives.cjs.map +1 -0
- package/build/legacy/components/select/select.cjs +212 -0
- package/build/legacy/components/select/select.cjs.map +1 -0
- package/build/legacy/components/switch/index.cjs +118 -0
- package/build/legacy/components/switch/index.cjs.map +1 -0
- package/build/legacy/components/switch/parts.cjs +75 -0
- package/build/legacy/components/switch/parts.cjs.map +1 -0
- package/build/legacy/components/switch/primitives.cjs +72 -0
- package/build/legacy/components/switch/primitives.cjs.map +1 -0
- package/build/legacy/components/{Fieldset.cjs → switch/switch-indicator.cjs} +17 -32
- package/build/legacy/components/switch/switch-indicator.cjs.map +1 -0
- package/build/legacy/components/switch/switch.cjs +106 -0
- package/build/legacy/components/switch/switch.cjs.map +1 -0
- package/build/legacy/components/toggle/index.cjs +45 -0
- package/build/legacy/components/toggle/index.cjs.map +1 -0
- package/build/legacy/components/toggle/parts.cjs +41 -0
- package/build/legacy/components/toggle/parts.cjs.map +1 -0
- package/build/legacy/components/toggle/primitives.cjs +35 -0
- package/build/legacy/components/toggle/primitives.cjs.map +1 -0
- package/build/legacy/config/types.cjs.map +1 -1
- package/build/legacy/context/confirm-modal.cjs +55 -45
- package/build/legacy/context/confirm-modal.cjs.map +1 -1
- package/build/legacy/context/cta-modal.cjs +55 -45
- package/build/legacy/context/cta-modal.cjs.map +1 -1
- package/build/legacy/context/field.cjs +23 -4
- package/build/legacy/context/field.cjs.map +1 -1
- package/build/legacy/context/notification-center.cjs +24 -16
- package/build/legacy/context/notification-center.cjs.map +1 -1
- package/build/legacy/context/prompt-modal.cjs +206 -194
- package/build/legacy/context/prompt-modal.cjs.map +1 -1
- package/build/legacy/hooks/useDate.cjs.map +1 -1
- package/build/legacy/hooks/useRootColors.cjs +0 -1
- package/build/legacy/hooks/useRootColors.cjs.map +1 -1
- package/build/legacy/hooks/useToggle.cjs.map +1 -1
- package/build/legacy/index.cjs +1831 -1330
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/utils/index.cjs +22 -2
- package/build/legacy/utils/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +1329 -360
- package/build/modern/{chunk-PM7CWT3N.js → chunk-245SMQ45.js} +2 -2
- package/build/modern/chunk-245SMQ45.js.map +1 -0
- package/build/modern/chunk-2BIHLH4V.js +15 -0
- package/build/modern/chunk-2BIHLH4V.js.map +1 -0
- package/build/modern/chunk-2CVGNLIM.js +15 -0
- package/build/modern/chunk-2CVGNLIM.js.map +1 -0
- package/build/modern/{chunk-ISCJ542I.js → chunk-2HOUQ2DX.js} +2 -2
- package/build/modern/chunk-2LF3HPNA.js +1 -0
- package/build/modern/chunk-5RTNSVYU.js +88 -0
- package/build/modern/chunk-5RTNSVYU.js.map +1 -0
- package/build/modern/chunk-6I2FW4WI.js +33 -0
- package/build/modern/chunk-6I2FW4WI.js.map +1 -0
- package/build/modern/chunk-6KZVE4HC.js +52 -0
- package/build/modern/chunk-6KZVE4HC.js.map +1 -0
- package/build/modern/{chunk-25HMVHLT.js → chunk-7SU6FCTJ.js} +5 -5
- package/build/modern/chunk-7TQRTBUP.js +19 -0
- package/build/modern/chunk-7TQRTBUP.js.map +1 -0
- package/build/modern/{chunk-UZVQ4INR.js → chunk-AIJ75ENY.js} +2 -2
- package/build/modern/chunk-AIJ75ENY.js.map +1 -0
- package/build/modern/chunk-AO3GB72J.js +27 -0
- package/build/modern/chunk-AO3GB72J.js.map +1 -0
- package/build/modern/{chunk-NUMM4TNC.js → chunk-AUALRL3U.js} +2 -2
- package/build/modern/chunk-AUALRL3U.js.map +1 -0
- package/build/modern/{chunk-IGHMP4WA.js → chunk-AZRFYQO7.js} +1 -1
- package/build/modern/chunk-AZRFYQO7.js.map +1 -0
- package/build/modern/chunk-BL7G3577.js +29 -0
- package/build/modern/chunk-BL7G3577.js.map +1 -0
- package/build/modern/chunk-BPRF34DU.js +62 -0
- package/build/modern/chunk-BPRF34DU.js.map +1 -0
- package/build/modern/chunk-CAZ3EICD.js +16 -0
- package/build/modern/chunk-CAZ3EICD.js.map +1 -0
- package/build/modern/chunk-CIMY2U22.js +10 -0
- package/build/modern/chunk-CIMY2U22.js.map +1 -0
- package/build/modern/{chunk-SD3OVTHT.js → chunk-CMYD5KWA.js} +43 -46
- package/build/modern/chunk-CMYD5KWA.js.map +1 -0
- package/build/modern/chunk-CNA2VKAH.js +43 -0
- package/build/modern/chunk-CNA2VKAH.js.map +1 -0
- package/build/modern/chunk-CYC2YUKU.js +1 -0
- package/build/modern/{chunk-PZAZKQMO.js → chunk-DRDNNRU3.js} +2 -2
- package/build/modern/chunk-DRDNNRU3.js.map +1 -0
- package/build/modern/{chunk-NJSETNRL.js → chunk-DXBZ3HMY.js} +2 -2
- package/build/modern/chunk-EL4MX2PG.js +22 -0
- package/build/modern/chunk-EL4MX2PG.js.map +1 -0
- package/build/modern/chunk-FBS7AX76.js +37 -0
- package/build/modern/chunk-FBS7AX76.js.map +1 -0
- package/build/modern/{chunk-JAROS4Q3.js → chunk-FMRWRVUS.js} +7 -7
- package/build/modern/chunk-FMRWRVUS.js.map +1 -0
- package/build/modern/chunk-FUL2VRDU.js +25 -0
- package/build/modern/chunk-FUL2VRDU.js.map +1 -0
- package/build/modern/{chunk-BHB56M7S.js → chunk-H54FR7IP.js} +6 -6
- package/build/modern/chunk-H54FR7IP.js.map +1 -0
- package/build/modern/chunk-IASVL7CW.js +19 -0
- package/build/modern/chunk-IASVL7CW.js.map +1 -0
- package/build/modern/{chunk-REO5GUNC.js → chunk-ICTISECN.js} +1 -1
- package/build/modern/chunk-ICTISECN.js.map +1 -0
- package/build/modern/chunk-IDTAB2UJ.js +1 -0
- package/build/modern/chunk-IIH363FO.js +13 -0
- package/build/modern/chunk-IIH363FO.js.map +1 -0
- package/build/modern/chunk-KQQPZJEI.js +21 -0
- package/build/modern/chunk-KQQPZJEI.js.map +1 -0
- package/build/modern/chunk-KWZ3CEG6.js +23 -0
- package/build/modern/chunk-KWZ3CEG6.js.map +1 -0
- package/build/modern/{chunk-JWIJHSI6.js → chunk-L7N24B6B.js} +3 -6
- package/build/modern/chunk-L7N24B6B.js.map +1 -0
- package/build/modern/chunk-LT62577B.js +23 -0
- package/build/modern/chunk-LT62577B.js.map +1 -0
- package/build/modern/chunk-LZWNHXRP.js +48 -0
- package/build/modern/chunk-LZWNHXRP.js.map +1 -0
- package/build/modern/{chunk-EDARV2EI.js → chunk-MISIUX63.js} +4 -4
- package/build/modern/{chunk-3BM6MZ4A.js → chunk-MWRO5QYD.js} +1 -1
- package/build/modern/chunk-MWRO5QYD.js.map +1 -0
- package/build/modern/chunk-OGYMMATX.js +1 -0
- package/build/modern/chunk-OVHCXBBI.js +22 -0
- package/build/modern/chunk-OVHCXBBI.js.map +1 -0
- package/build/modern/chunk-P3SF56LT.js +47 -0
- package/build/modern/chunk-P3SF56LT.js.map +1 -0
- package/build/modern/{chunk-JIRW4XOJ.js → chunk-Q3I4H6EC.js} +2 -2
- package/build/modern/chunk-Q3I4H6EC.js.map +1 -0
- package/build/modern/chunk-QCBLRACK.js +133 -0
- package/build/modern/chunk-QCBLRACK.js.map +1 -0
- package/build/modern/{chunk-ILQW5VZT.js → chunk-RBNOEAWJ.js} +4 -7
- package/build/modern/chunk-RBNOEAWJ.js.map +1 -0
- package/build/modern/{chunk-YKKNWILF.js → chunk-RHCTPSKT.js} +2 -15
- package/build/modern/chunk-RHCTPSKT.js.map +1 -0
- package/build/modern/chunk-STLN7BMJ.js +22 -0
- package/build/modern/chunk-STLN7BMJ.js.map +1 -0
- package/build/modern/{chunk-7NN3SJ7W.js → chunk-SWX5JWZR.js} +2 -2
- package/build/modern/chunk-SWX5JWZR.js.map +1 -0
- package/build/modern/{chunk-GCQMH4QA.js → chunk-SXLPDPOZ.js} +4 -4
- package/build/modern/chunk-TIJAFPHQ.js +1 -0
- package/build/modern/chunk-TYPULJMJ.js +1 -0
- package/build/modern/chunk-UDY6USHW.js +1 -0
- package/build/modern/chunk-V4YYGGMH.js +1 -0
- package/build/modern/chunk-VSTOSLFS.js +100 -0
- package/build/modern/chunk-VSTOSLFS.js.map +1 -0
- package/build/modern/{chunk-ZL6ZITLA.js → chunk-WECB67DC.js} +2 -2
- package/build/modern/chunk-WECB67DC.js.map +1 -0
- package/build/modern/{chunk-BAWZBF5Q.js → chunk-WN7TJX6J.js} +2 -2
- package/build/modern/{chunk-RMVJK26W.js → chunk-XJQXHSH7.js} +1 -2
- package/build/modern/chunk-XJQXHSH7.js.map +1 -0
- package/build/modern/chunk-XTNGF4D6.js +41 -0
- package/build/modern/chunk-XTNGF4D6.js.map +1 -0
- package/build/modern/chunk-Y4ZEJ2EF.js +31 -0
- package/build/modern/chunk-Y4ZEJ2EF.js.map +1 -0
- package/build/modern/{chunk-WPVDQRRF.js → chunk-YOTXFCCC.js} +2 -2
- package/build/modern/chunk-YOTXFCCC.js.map +1 -0
- package/build/modern/chunk-Z3FDG263.js +53 -0
- package/build/modern/chunk-Z3FDG263.js.map +1 -0
- package/build/modern/chunk-Z52R6ABJ.js +21 -0
- package/build/modern/chunk-Z52R6ABJ.js.map +1 -0
- package/build/modern/{chunk-FGCO27TC.js → chunk-ZDANBCM3.js} +6 -6
- package/build/modern/chunk-ZDANBCM3.js.map +1 -0
- package/build/modern/{chunk-O6LFWUHI.js → chunk-ZFFW5ELD.js} +10 -10
- package/build/modern/chunk-ZFFW5ELD.js.map +1 -0
- package/build/modern/components/Accordion.js +1 -1
- package/build/modern/components/AccordionItemGroup.js +3 -3
- package/build/modern/components/Admonition.client.js +3 -3
- package/build/modern/components/Admonition.js +4 -4
- package/build/modern/components/Avatar.js +2 -2
- package/build/modern/components/DatePicker.client.js +4 -3
- package/build/modern/components/FileStatus.js +11 -5
- package/build/modern/components/FileUploader.js +3 -3
- package/build/modern/components/Legend.js +1 -2
- package/build/modern/components/Tag.js +2 -2
- package/build/modern/components/button/button.js +12 -0
- package/build/modern/components/button/index.js +16 -0
- package/build/modern/components/button/parts.js +10 -0
- package/build/modern/components/checkbox/checkbox-icon.js +12 -0
- package/build/modern/components/checkbox/checkbox.js +13 -0
- package/build/modern/components/checkbox/index.js +30 -0
- package/build/modern/components/checkbox/parts.js +8 -0
- package/build/modern/components/checkbox/primitives.js +17 -0
- package/build/modern/components/deprecated/FieldMessage.js +8 -0
- package/build/modern/components/deprecated/FieldsetLabel.js +7 -0
- package/build/modern/components/deprecated/Label.js +17 -0
- package/build/modern/components/deprecated/Label.js.map +1 -0
- package/build/modern/components/deprecated/Modal.js +7 -0
- package/build/modern/components/deprecated/Modal.js.map +1 -0
- package/build/modern/components/deprecated/ModalDescription.js +7 -0
- package/build/modern/components/deprecated/ModalDescription.js.map +1 -0
- package/build/modern/components/deprecated/ModalHeader.js +7 -0
- package/build/modern/components/deprecated/ModalHeader.js.map +1 -0
- package/build/modern/components/deprecated/ModalHeading.js +7 -0
- package/build/modern/components/deprecated/ModalHeading.js.map +1 -0
- package/build/modern/components/deprecated/NavMenuLink.js +8 -0
- package/build/modern/components/deprecated/NavMenuLink.js.map +1 -0
- package/build/modern/components/deprecated/NavMenuList.js +12 -0
- package/build/modern/components/deprecated/NavMenuList.js.map +1 -0
- package/build/modern/components/deprecated/NavMenuTrigger.js +11 -0
- package/build/modern/components/deprecated/NavMenuTrigger.js.map +1 -0
- package/build/modern/components/field/field.js +14 -0
- package/build/modern/components/field/field.js.map +1 -0
- package/build/modern/components/field/index.js +44 -0
- package/build/modern/components/field/index.js.map +1 -0
- package/build/modern/components/field/parts.js +11 -0
- package/build/modern/components/field/parts.js.map +1 -0
- package/build/modern/components/field/primitives.js +26 -0
- package/build/modern/components/field/primitives.js.map +1 -0
- package/build/modern/components/field/start-indicator.js +7 -0
- package/build/modern/components/field/start-indicator.js.map +1 -0
- package/build/modern/components/field/status-indicator.js +9 -0
- package/build/modern/components/field/status-indicator.js.map +1 -0
- package/build/modern/components/fieldset/fieldset.js +11 -0
- package/build/modern/components/fieldset/fieldset.js.map +1 -0
- package/build/modern/components/fieldset/index.js +24 -0
- package/build/modern/components/fieldset/index.js.map +1 -0
- package/build/modern/components/fieldset/parts.js +8 -0
- package/build/modern/components/fieldset/parts.js.map +1 -0
- package/build/modern/components/fieldset/primitives.js +13 -0
- package/build/modern/components/fieldset/primitives.js.map +1 -0
- package/build/modern/components/for.js +7 -0
- package/build/modern/components/for.js.map +1 -0
- package/build/modern/components/radio/index.js +30 -0
- package/build/modern/components/radio/index.js.map +1 -0
- package/build/modern/components/radio/parts.js +8 -0
- package/build/modern/components/radio/parts.js.map +1 -0
- package/build/modern/components/radio/primitives.js +21 -0
- package/build/modern/components/radio/primitives.js.map +1 -0
- package/build/modern/components/radio/radio.js +8 -0
- package/build/modern/components/radio/radio.js.map +1 -0
- package/build/modern/components/select/index.js +57 -0
- package/build/modern/components/select/index.js.map +1 -0
- package/build/modern/components/select/option-group.js +10 -0
- package/build/modern/components/select/option-group.js.map +1 -0
- package/build/modern/components/select/parts.js +8 -0
- package/build/modern/components/select/parts.js.map +1 -0
- package/build/modern/components/select/primitives.js +37 -0
- package/build/modern/components/select/primitives.js.map +1 -0
- package/build/modern/components/select/select.js +15 -0
- package/build/modern/components/select/select.js.map +1 -0
- package/build/modern/components/switch/index.js +26 -0
- package/build/modern/components/switch/index.js.map +1 -0
- package/build/modern/components/switch/parts.js +8 -0
- package/build/modern/components/switch/parts.js.map +1 -0
- package/build/modern/components/switch/primitives.js +15 -0
- package/build/modern/components/switch/primitives.js.map +1 -0
- package/build/modern/components/switch/switch-indicator.js +9 -0
- package/build/modern/components/switch/switch-indicator.js.map +1 -0
- package/build/modern/components/switch/switch.js +11 -0
- package/build/modern/components/switch/switch.js.map +1 -0
- package/build/modern/components/toggle/index.js +14 -0
- package/build/modern/components/toggle/index.js.map +1 -0
- package/build/modern/components/toggle/parts.js +8 -0
- package/build/modern/components/toggle/parts.js.map +1 -0
- package/build/modern/components/toggle/primitives.js +9 -0
- package/build/modern/components/toggle/primitives.js.map +1 -0
- package/build/modern/context/confirm-modal.js +5 -4
- package/build/modern/context/cta-modal.js +6 -5
- package/build/modern/context/field.js +34 -4
- package/build/modern/context/field.js.map +1 -1
- package/build/modern/context/notification-center.js +5 -4
- package/build/modern/context/prompt-modal.js +14 -8
- package/build/modern/hooks/useDate.js +1 -1
- package/build/modern/hooks/useRootColors.js +1 -1
- package/build/modern/hooks/useToggle.js +1 -1
- package/build/modern/index.js +284 -116
- package/build/modern/index.js.map +1 -1
- package/build/modern/utils/index.js +5 -3
- package/package.json +2 -2
- package/src/components/Accordion.tsx +1 -0
- package/src/components/DatePicker.client.tsx +3 -15
- package/src/components/FileStatus.tsx +4 -5
- package/src/components/Legend.tsx +5 -6
- package/src/components/button/button.tsx +77 -0
- package/src/components/button/index.ts +2 -0
- package/src/components/button/parts.ts +32 -0
- package/src/components/checkbox/checkbox-icon.tsx +39 -0
- package/src/components/checkbox/checkbox.tsx +42 -0
- package/src/components/checkbox/index.ts +3 -0
- package/src/components/checkbox/parts.ts +59 -0
- package/src/components/checkbox/primitives.tsx +104 -0
- package/src/components/{FieldMessage.tsx → deprecated/FieldMessage.tsx} +2 -13
- package/src/components/deprecated/FieldsetLabel.tsx +32 -0
- package/src/components/deprecated/Label.tsx +24 -0
- package/src/components/{NavMenuLink.tsx → deprecated/NavMenuLink.tsx} +1 -1
- package/src/components/{NavMenuList.tsx → deprecated/NavMenuList.tsx} +3 -3
- package/src/components/{NavMenuTrigger.tsx → deprecated/NavMenuTrigger.tsx} +4 -4
- package/src/components/field/field.tsx +77 -0
- package/src/components/field/index.ts +5 -0
- package/src/components/field/parts.ts +77 -0
- package/src/components/field/primitives.tsx +204 -0
- package/src/components/field/start-indicator.tsx +23 -0
- package/src/components/field/status-indicator.tsx +58 -0
- package/src/components/fieldset/fieldset.tsx +55 -0
- package/src/components/fieldset/index.ts +3 -0
- package/src/components/fieldset/parts.ts +47 -0
- package/src/components/fieldset/primitives.tsx +79 -0
- package/src/components/for.tsx +43 -0
- package/src/components/radio/index.ts +3 -0
- package/src/components/radio/parts.ts +65 -0
- package/src/components/radio/primitives.tsx +123 -0
- package/src/components/radio/radio.tsx +35 -0
- package/src/components/select/index.ts +4 -0
- package/src/components/select/option-group.tsx +34 -0
- package/src/components/select/parts.ts +113 -0
- package/src/components/select/primitives.tsx +205 -0
- package/src/components/select/select.tsx +135 -0
- package/src/components/switch/index.ts +3 -0
- package/src/components/switch/parts.ts +53 -0
- package/src/components/switch/primitives.tsx +69 -0
- package/src/components/switch/switch-indicator.tsx +9 -0
- package/src/components/switch/switch.tsx +30 -0
- package/src/components/toggle/index.ts +2 -0
- package/src/components/toggle/parts.ts +32 -0
- package/src/components/toggle/primitives.tsx +17 -0
- package/src/config/types.ts +1 -0
- package/src/context/confirm-modal.tsx +1 -1
- package/src/context/cta-modal.tsx +1 -1
- package/src/context/field.tsx +6 -5
- package/src/context/notification-center.tsx +1 -1
- package/src/context/prompt-modal.tsx +16 -18
- package/src/hooks/useDate.ts +1 -7
- package/src/hooks/useRootColors.ts +0 -1
- package/src/hooks/useToggle.ts +1 -3
- package/src/index.ts +23 -23
- package/src/utils/index.ts +30 -0
- package/build/legacy/components/Button.cjs.map +0 -1
- package/build/legacy/components/Checkbox.cjs +0 -113
- package/build/legacy/components/Checkbox.cjs.map +0 -1
- package/build/legacy/components/FieldMessage.cjs.map +0 -1
- package/build/legacy/components/Fieldset.cjs.map +0 -1
- package/build/legacy/components/FieldsetLabel.cjs.map +0 -1
- package/build/legacy/components/Input.cjs +0 -95
- package/build/legacy/components/Input.cjs.map +0 -1
- package/build/legacy/components/Label.cjs +0 -93
- package/build/legacy/components/Label.cjs.map +0 -1
- package/build/legacy/components/Modal.cjs.map +0 -1
- package/build/legacy/components/ModalDescription.cjs.map +0 -1
- package/build/legacy/components/ModalHeader.cjs.map +0 -1
- package/build/legacy/components/ModalHeading.cjs.map +0 -1
- package/build/legacy/components/NavMenuLink.cjs.map +0 -1
- package/build/legacy/components/NavMenuList.cjs.map +0 -1
- package/build/legacy/components/NavMenuTrigger.cjs.map +0 -1
- package/build/legacy/components/Radio.cjs +0 -81
- package/build/legacy/components/Radio.cjs.map +0 -1
- package/build/legacy/components/Select.cjs +0 -120
- package/build/legacy/components/Select.cjs.map +0 -1
- package/build/legacy/components/Textarea.cjs.map +0 -1
- package/build/legacy/components/Toggle.cjs +0 -101
- package/build/legacy/components/Toggle.cjs.map +0 -1
- package/build/modern/chunk-3BM6MZ4A.js.map +0 -1
- package/build/modern/chunk-3ZDFQO25.js +0 -31
- package/build/modern/chunk-3ZDFQO25.js.map +0 -1
- package/build/modern/chunk-7NN3SJ7W.js.map +0 -1
- package/build/modern/chunk-BHB56M7S.js.map +0 -1
- package/build/modern/chunk-C5EHJUS5.js +0 -10
- package/build/modern/chunk-C5EHJUS5.js.map +0 -1
- package/build/modern/chunk-EXGKZGML.js +0 -28
- package/build/modern/chunk-EXGKZGML.js.map +0 -1
- package/build/modern/chunk-FGCO27TC.js.map +0 -1
- package/build/modern/chunk-FTPZHG6J.js +0 -46
- package/build/modern/chunk-FTPZHG6J.js.map +0 -1
- package/build/modern/chunk-IGHMP4WA.js.map +0 -1
- package/build/modern/chunk-ILQW5VZT.js.map +0 -1
- package/build/modern/chunk-JAROS4Q3.js.map +0 -1
- package/build/modern/chunk-JIJM6JFJ.js +0 -36
- package/build/modern/chunk-JIJM6JFJ.js.map +0 -1
- package/build/modern/chunk-JIRW4XOJ.js.map +0 -1
- package/build/modern/chunk-JWIJHSI6.js.map +0 -1
- package/build/modern/chunk-KKHL3ZO4.js +0 -69
- package/build/modern/chunk-KKHL3ZO4.js.map +0 -1
- package/build/modern/chunk-MZ3UCDUL.js +0 -43
- package/build/modern/chunk-MZ3UCDUL.js.map +0 -1
- package/build/modern/chunk-N24COMHJ.js +0 -63
- package/build/modern/chunk-N24COMHJ.js.map +0 -1
- package/build/modern/chunk-NMF2HYWO.js +0 -50
- package/build/modern/chunk-NMF2HYWO.js.map +0 -1
- package/build/modern/chunk-NUMM4TNC.js.map +0 -1
- package/build/modern/chunk-O6LFWUHI.js.map +0 -1
- package/build/modern/chunk-PM7CWT3N.js.map +0 -1
- package/build/modern/chunk-PZAZKQMO.js.map +0 -1
- package/build/modern/chunk-REO5GUNC.js.map +0 -1
- package/build/modern/chunk-RMVJK26W.js.map +0 -1
- package/build/modern/chunk-SD3OVTHT.js.map +0 -1
- package/build/modern/chunk-UZDVOIW5.js +0 -33
- package/build/modern/chunk-UZDVOIW5.js.map +0 -1
- package/build/modern/chunk-UZVQ4INR.js.map +0 -1
- package/build/modern/chunk-WPVDQRRF.js.map +0 -1
- package/build/modern/chunk-XQICKZH4.js +0 -59
- package/build/modern/chunk-XQICKZH4.js.map +0 -1
- package/build/modern/chunk-YKKNWILF.js.map +0 -1
- package/build/modern/chunk-ZL6ZITLA.js.map +0 -1
- package/build/modern/components/Button.js +0 -7
- package/build/modern/components/Checkbox.js +0 -11
- package/build/modern/components/FieldMessage.js +0 -9
- package/build/modern/components/Fieldset.js +0 -9
- package/build/modern/components/FieldsetLabel.js +0 -7
- package/build/modern/components/Input.js +0 -11
- package/build/modern/components/Label.js +0 -10
- package/build/modern/components/Modal.js +0 -7
- package/build/modern/components/ModalDescription.js +0 -7
- package/build/modern/components/ModalHeader.js +0 -7
- package/build/modern/components/ModalHeading.js +0 -7
- package/build/modern/components/NavMenuLink.js +0 -8
- package/build/modern/components/NavMenuList.js +0 -12
- package/build/modern/components/NavMenuTrigger.js +0 -11
- package/build/modern/components/Radio.js +0 -9
- package/build/modern/components/Select.js +0 -13
- package/build/modern/components/Textarea.js +0 -9
- package/build/modern/components/Toggle.js +0 -10
- package/src/components/Button.tsx +0 -35
- package/src/components/Checkbox.tsx +0 -93
- package/src/components/Fieldset.tsx +0 -65
- package/src/components/FieldsetLabel.tsx +0 -59
- package/src/components/Input.tsx +0 -69
- package/src/components/Label.tsx +0 -69
- package/src/components/Radio.tsx +0 -73
- package/src/components/Select.tsx +0 -108
- package/src/components/Textarea.tsx +0 -52
- package/src/components/Toggle.tsx +0 -91
- /package/build/modern/{chunk-ISCJ542I.js.map → chunk-2HOUQ2DX.js.map} +0 -0
- /package/build/modern/{components/Button.js.map → chunk-2LF3HPNA.js.map} +0 -0
- /package/build/modern/{chunk-25HMVHLT.js.map → chunk-7SU6FCTJ.js.map} +0 -0
- /package/build/modern/{components/Checkbox.js.map → chunk-CYC2YUKU.js.map} +0 -0
- /package/build/modern/{chunk-NJSETNRL.js.map → chunk-DXBZ3HMY.js.map} +0 -0
- /package/build/modern/{components/FieldMessage.js.map → chunk-IDTAB2UJ.js.map} +0 -0
- /package/build/modern/{chunk-EDARV2EI.js.map → chunk-MISIUX63.js.map} +0 -0
- /package/build/modern/{components/Fieldset.js.map → chunk-OGYMMATX.js.map} +0 -0
- /package/build/modern/{chunk-GCQMH4QA.js.map → chunk-SXLPDPOZ.js.map} +0 -0
- /package/build/modern/{components/FieldsetLabel.js.map → chunk-TIJAFPHQ.js.map} +0 -0
- /package/build/modern/{components/Input.js.map → chunk-TYPULJMJ.js.map} +0 -0
- /package/build/modern/{components/Label.js.map → chunk-UDY6USHW.js.map} +0 -0
- /package/build/modern/{components/Modal.js.map → chunk-V4YYGGMH.js.map} +0 -0
- /package/build/modern/{chunk-BAWZBF5Q.js.map → chunk-WN7TJX6J.js.map} +0 -0
- /package/build/modern/components/{ModalDescription.js.map → button/button.js.map} +0 -0
- /package/build/modern/components/{ModalHeader.js.map → button/index.js.map} +0 -0
- /package/build/modern/components/{ModalHeading.js.map → button/parts.js.map} +0 -0
- /package/build/modern/components/{NavMenuLink.js.map → checkbox/checkbox-icon.js.map} +0 -0
- /package/build/modern/components/{NavMenuList.js.map → checkbox/checkbox.js.map} +0 -0
- /package/build/modern/components/{NavMenuTrigger.js.map → checkbox/index.js.map} +0 -0
- /package/build/modern/components/{Radio.js.map → checkbox/parts.js.map} +0 -0
- /package/build/modern/components/{Select.js.map → checkbox/primitives.js.map} +0 -0
- /package/build/modern/components/{Textarea.js.map → deprecated/FieldMessage.js.map} +0 -0
- /package/build/modern/components/{Toggle.js.map → deprecated/FieldsetLabel.js.map} +0 -0
- /package/src/components/{Modal.tsx → deprecated/Modal.tsx} +0 -0
- /package/src/components/{ModalDescription.tsx → deprecated/ModalDescription.tsx} +0 -0
- /package/src/components/{ModalHeader.tsx → deprecated/ModalHeader.tsx} +0 -0
- /package/src/components/{ModalHeading.tsx → deprecated/ModalHeading.tsx} +0 -0
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
import { Portal } from './Portal'
|
|
13
13
|
import { datePicker, iconButton } from '@cerberus/styled-system/recipes'
|
|
14
14
|
import { css, cx } from '@cerberus/styled-system/css'
|
|
15
|
-
import { useFieldContext } from '../context/field'
|
|
16
15
|
import {
|
|
17
16
|
DatePickerView,
|
|
18
17
|
DatePickerContext,
|
|
@@ -23,7 +22,7 @@ import {
|
|
|
23
22
|
DatePickerViewControl,
|
|
24
23
|
} from './DatePicker.server'
|
|
25
24
|
import { IconButton } from './IconButton'
|
|
26
|
-
import { Button } from './
|
|
25
|
+
import { Button } from './button/button'
|
|
27
26
|
import { useCerberusContext } from '../context/cerberus'
|
|
28
27
|
import { useMemo, type InputHTMLAttributes } from 'react'
|
|
29
28
|
|
|
@@ -50,12 +49,10 @@ const datePickerStyles = datePicker()
|
|
|
50
49
|
* ```
|
|
51
50
|
*/
|
|
52
51
|
export function DatePicker(props: DatePickerRootProps) {
|
|
53
|
-
const states = useFieldContext()
|
|
54
|
-
|
|
55
|
-
// TODO: Remove this once the bug is fixed: https://github.com/chakra-ui/ark/issues/3112
|
|
56
|
-
|
|
57
52
|
// There is a bug with the Root component that causes random date selection
|
|
58
53
|
// onBlur after the first selection if the format prop is used.
|
|
54
|
+
// ref: https://github.com/chakra-ui/ark/issues/3112#event-16047829195
|
|
55
|
+
|
|
59
56
|
// const handleFormat = useCallback((value: DateValue) => {
|
|
60
57
|
// return formatISOToMilitary(value.toString())
|
|
61
58
|
// }, [])
|
|
@@ -63,7 +60,6 @@ export function DatePicker(props: DatePickerRootProps) {
|
|
|
63
60
|
return (
|
|
64
61
|
<ArkDP.Root
|
|
65
62
|
{...props}
|
|
66
|
-
{...states}
|
|
67
63
|
positioning={{
|
|
68
64
|
placement: 'bottom-start',
|
|
69
65
|
}}
|
|
@@ -157,14 +153,11 @@ export function DatePickerTrigger(props: DatePickerTriggerProps) {
|
|
|
157
153
|
* ```
|
|
158
154
|
*/
|
|
159
155
|
export function DatePickerInput(props: DatePickerInputProps) {
|
|
160
|
-
const { invalid, ...fieldStates } = useFieldContext()
|
|
161
156
|
return (
|
|
162
157
|
<ArkDP.Control className={datePickerStyles.control}>
|
|
163
158
|
<DatePickerTrigger />
|
|
164
159
|
<ArkDP.Input
|
|
165
160
|
{...props}
|
|
166
|
-
{...fieldStates}
|
|
167
|
-
{...(invalid && { 'aria-invalid': true })}
|
|
168
161
|
className={cx(props.className, datePickerStyles.input)}
|
|
169
162
|
placeholder={props.placeholder ?? 'DD MMM YYYY'}
|
|
170
163
|
maxLength={11}
|
|
@@ -200,7 +193,6 @@ export interface RangePickerInputProps
|
|
|
200
193
|
* ```
|
|
201
194
|
*/
|
|
202
195
|
export function RangePickerInput(props: RangePickerInputProps) {
|
|
203
|
-
const { invalid, ...fieldStates } = useFieldContext()
|
|
204
196
|
const { defaultValue, ...nativeProps } = props
|
|
205
197
|
|
|
206
198
|
const startDate = useMemo(() => defaultValue?.[0], [defaultValue])
|
|
@@ -211,8 +203,6 @@ export function RangePickerInput(props: RangePickerInputProps) {
|
|
|
211
203
|
<DatePickerTrigger />
|
|
212
204
|
<ArkDP.Input
|
|
213
205
|
{...nativeProps}
|
|
214
|
-
{...fieldStates}
|
|
215
|
-
{...(invalid && { 'aria-invalid': true })}
|
|
216
206
|
data-range-input
|
|
217
207
|
defaultValue={startDate}
|
|
218
208
|
className={cx(props.className, datePickerStyles.input)}
|
|
@@ -222,8 +212,6 @@ export function RangePickerInput(props: RangePickerInputProps) {
|
|
|
222
212
|
/>
|
|
223
213
|
<ArkDP.Input
|
|
224
214
|
{...nativeProps}
|
|
225
|
-
{...fieldStates}
|
|
226
|
-
{...(invalid && { 'aria-invalid': true })}
|
|
227
215
|
data-range-input
|
|
228
216
|
defaultValue={endDate}
|
|
229
217
|
data-range-end-input
|
|
@@ -12,12 +12,11 @@ import {
|
|
|
12
12
|
} from '@cerberus/styled-system/recipes'
|
|
13
13
|
import { css, cx } from '@cerberus/styled-system/css'
|
|
14
14
|
import { hstack, vstack } from '@cerberus/styled-system/patterns'
|
|
15
|
-
import { Field } from '../context/field'
|
|
16
15
|
import { useCerberusContext } from '../context/cerberus'
|
|
17
|
-
import { FieldMessage } from './FieldMessage'
|
|
18
16
|
import { ProgressBar, type ProgressBarProps } from './ProgressBar'
|
|
19
17
|
import { IconButton } from './IconButton'
|
|
20
18
|
import { Avatar } from './Avatar'
|
|
19
|
+
import { Field, FieldHelperText } from './field/index'
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* This module contains the FileStatus component.
|
|
@@ -157,15 +156,15 @@ export function FileStatus(props: FileStatusProps) {
|
|
|
157
156
|
now={now}
|
|
158
157
|
size="sm"
|
|
159
158
|
/>
|
|
160
|
-
<Field invalid={modalIconPalette === 'hades-dark'}>
|
|
161
|
-
<
|
|
159
|
+
<Field label="" invalid={modalIconPalette === 'hades-dark'}>
|
|
160
|
+
<FieldHelperText
|
|
162
161
|
className={css({
|
|
163
162
|
color: 'page.text.100',
|
|
164
163
|
})}
|
|
165
164
|
id={`help:${file}`}
|
|
166
165
|
>
|
|
167
166
|
<MatchFileStatusText status={status} now={now} />
|
|
168
|
-
</
|
|
167
|
+
</FieldHelperText>
|
|
169
168
|
</Field>
|
|
170
169
|
</div>
|
|
171
170
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { css, cx } from '@cerberus/styled-system/css'
|
|
4
|
-
import { type HTMLAttributes } from 'react'
|
|
5
|
-
import { useFieldContext } from '../context/field'
|
|
6
|
-
import { Show } from './Show'
|
|
7
4
|
import { label, type LabelVariantProps } from '@cerberus/styled-system/recipes'
|
|
8
5
|
import { hstack } from '@cerberus/styled-system/patterns'
|
|
6
|
+
import { type HTMLAttributes } from 'react'
|
|
7
|
+
import { Show } from './Show'
|
|
8
|
+
import { useFieldContext } from '@ark-ui/react/field'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* This module contains the Fieldset component.
|
|
@@ -50,12 +50,11 @@ export type LegendProps = HTMLAttributes<HTMLLegendElement> & LabelVariantProps
|
|
|
50
50
|
*/
|
|
51
51
|
export function Legend(props: LegendProps) {
|
|
52
52
|
const { size, ...nativeProps } = props
|
|
53
|
-
const { invalid,
|
|
53
|
+
const { invalid, required } = useFieldContext()
|
|
54
54
|
|
|
55
55
|
return (
|
|
56
56
|
<legend
|
|
57
57
|
{...nativeProps}
|
|
58
|
-
{...formState}
|
|
59
58
|
{...(invalid && { 'aria-invalid': true })}
|
|
60
59
|
className={cx(
|
|
61
60
|
nativeProps.className,
|
|
@@ -69,7 +68,7 @@ export function Legend(props: LegendProps) {
|
|
|
69
68
|
)}
|
|
70
69
|
>
|
|
71
70
|
{nativeProps.children}
|
|
72
|
-
<Show when={
|
|
71
|
+
<Show when={required}>
|
|
73
72
|
<span
|
|
74
73
|
className={css({
|
|
75
74
|
color: 'page.text.100',
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type ButtonHTMLAttributes,
|
|
5
|
+
type PropsWithChildren,
|
|
6
|
+
createContext,
|
|
7
|
+
useContext,
|
|
8
|
+
useMemo,
|
|
9
|
+
} from 'react'
|
|
10
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
11
|
+
import {
|
|
12
|
+
button,
|
|
13
|
+
type ButtonVariantProps,
|
|
14
|
+
} from '@cerberus/styled-system/recipes'
|
|
15
|
+
import { Box } from '@cerberus/styled-system/jsx'
|
|
16
|
+
import { Show } from '../Show'
|
|
17
|
+
import { Spinner } from '../Spinner'
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* This module contains the Button component.
|
|
21
|
+
* @module
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
interface ButtonContextValue {
|
|
25
|
+
pending: boolean
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const ButtonContext = createContext<ButtonContextValue>({
|
|
29
|
+
pending: false,
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &
|
|
33
|
+
ButtonVariantProps & {
|
|
34
|
+
pending?: boolean
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A component that allows the user to perform actions
|
|
39
|
+
* @see https://cerberus.digitalu.design/react/button
|
|
40
|
+
*/
|
|
41
|
+
export function Button(props: ButtonProps): JSX.Element {
|
|
42
|
+
const { palette, usage, shape, size, pending = false, ...nativeProps } = props
|
|
43
|
+
const value = useMemo(() => ({ pending }), [pending])
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<ButtonContext.Provider value={value}>
|
|
47
|
+
<button
|
|
48
|
+
{...nativeProps}
|
|
49
|
+
disabled={pending || nativeProps.disabled}
|
|
50
|
+
className={cx(
|
|
51
|
+
nativeProps.className,
|
|
52
|
+
button({
|
|
53
|
+
palette,
|
|
54
|
+
usage,
|
|
55
|
+
shape,
|
|
56
|
+
size,
|
|
57
|
+
}),
|
|
58
|
+
)}
|
|
59
|
+
/>
|
|
60
|
+
</ButtonContext.Provider>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* An icon to display in a button that utilizes the pending state to display
|
|
66
|
+
* a loading spinner.
|
|
67
|
+
*/
|
|
68
|
+
export function ButtonIcon(props: PropsWithChildren<object>) {
|
|
69
|
+
const { pending } = useContext(ButtonContext)
|
|
70
|
+
return (
|
|
71
|
+
<Show when={pending} fallback={<>{props.children}</>}>
|
|
72
|
+
<Box w="4">
|
|
73
|
+
<Spinner />
|
|
74
|
+
</Box>
|
|
75
|
+
</Show>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ElementType } from 'react'
|
|
2
|
+
import { Button, ButtonIcon } from './button'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This module contains the parts of the Button component.
|
|
6
|
+
* @module 'button/parts'
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
interface ButtonPartsValue {
|
|
10
|
+
/**
|
|
11
|
+
* The context provider of the button.
|
|
12
|
+
*/
|
|
13
|
+
Root: ElementType
|
|
14
|
+
/**
|
|
15
|
+
* The icon of the button.
|
|
16
|
+
*/
|
|
17
|
+
Icon: ElementType
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* An Object containing the parts of the Button component. For users that
|
|
22
|
+
* prefer Object component syntax.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
*
|
|
26
|
+
* When using object component syntax, you import the ButtonParts object and
|
|
27
|
+
* the entire family of components vs. only what you use.
|
|
28
|
+
*/
|
|
29
|
+
export const ButtonParts: ButtonPartsValue = {
|
|
30
|
+
Root: Button,
|
|
31
|
+
Icon: ButtonIcon,
|
|
32
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useCerberusContext } from '../../context/cerberus'
|
|
4
|
+
import { CheckboxParts } from './parts'
|
|
5
|
+
import { Show } from '../Show'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* This module contains the Checkbox Icon component.
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
interface CheckboxIconProps {
|
|
13
|
+
indeterminate?: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Checkbox component
|
|
18
|
+
* @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)
|
|
19
|
+
* @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)
|
|
20
|
+
* @see https://cerberus.digitalu.design/react/checkbox
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Field>
|
|
24
|
+
* <Checkbox id="legal" checked={checked.legal} onChange={handleChange} />
|
|
25
|
+
* </Field>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export function CheckboxIcon(props: CheckboxIconProps) {
|
|
29
|
+
const { icons } = useCerberusContext()
|
|
30
|
+
const { checkbox: CheckIcon, indeterminate: IndeterminateIcon } = icons
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<CheckboxParts.Indicator indeterminate={props.indeterminate}>
|
|
34
|
+
<Show when={props.indeterminate} fallback={<CheckIcon />}>
|
|
35
|
+
<IndeterminateIcon />
|
|
36
|
+
</Show>
|
|
37
|
+
</CheckboxParts.Indicator>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { CheckboxRootProps } from '@ark-ui/react'
|
|
2
|
+
import { type CheckboxVariantProps } from '@cerberus/styled-system/recipes'
|
|
3
|
+
import { Show } from '../Show'
|
|
4
|
+
import { Text } from '../Text'
|
|
5
|
+
import { CheckboxParts } from './parts'
|
|
6
|
+
import { CheckboxIcon } from './checkbox-icon'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This module contains the Checkbox component.
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export type CheckboxProps = CheckboxVariantProps & CheckboxRootProps
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Checkbox component is an abstraction of the primitives that displays a
|
|
17
|
+
* controlled checkbox with a label.
|
|
18
|
+
* @description [Cerberus Docs] https://cerberus.digitalu.design/react/checkbox
|
|
19
|
+
* @description [Ark Docs] https://ark-ui.com/docs/components/checkbox
|
|
20
|
+
*/
|
|
21
|
+
export function Checkbox(props: CheckboxProps) {
|
|
22
|
+
const { size, children, ...rootProps } = props
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<CheckboxParts.Root {...rootProps}>
|
|
26
|
+
<CheckboxParts.Control size={size}>
|
|
27
|
+
<CheckboxIcon indeterminate={rootProps.checked === 'indeterminate'} />
|
|
28
|
+
</CheckboxParts.Control>
|
|
29
|
+
|
|
30
|
+
<CheckboxParts.Label size={size}>
|
|
31
|
+
{children}
|
|
32
|
+
<Show when={props.required}>
|
|
33
|
+
<Text as="span" data-part="required-indicator">
|
|
34
|
+
(required)
|
|
35
|
+
</Text>
|
|
36
|
+
</Show>
|
|
37
|
+
</CheckboxParts.Label>
|
|
38
|
+
|
|
39
|
+
<CheckboxParts.HiddenInput />
|
|
40
|
+
</CheckboxParts.Root>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ElementType } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
CheckboxRoot,
|
|
4
|
+
CheckboxLabel,
|
|
5
|
+
CheckboxControl,
|
|
6
|
+
CheckboxIndicator,
|
|
7
|
+
CheckboxHiddenInput,
|
|
8
|
+
CheckboxGroup,
|
|
9
|
+
} from './primitives'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This module contains the parts of the Field component.
|
|
13
|
+
* @module 'field/parts'
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
interface CheckboxPartsValue {
|
|
17
|
+
/**
|
|
18
|
+
* The container of the field.
|
|
19
|
+
*/
|
|
20
|
+
Root: ElementType
|
|
21
|
+
/**
|
|
22
|
+
* The label of the field.
|
|
23
|
+
*/
|
|
24
|
+
Label: ElementType
|
|
25
|
+
/**
|
|
26
|
+
* The control of the field.
|
|
27
|
+
*/
|
|
28
|
+
Control: ElementType
|
|
29
|
+
/**
|
|
30
|
+
* The indicator of the field.
|
|
31
|
+
*/
|
|
32
|
+
Indicator: ElementType
|
|
33
|
+
/**
|
|
34
|
+
* The hidden input of the field.
|
|
35
|
+
*/
|
|
36
|
+
HiddenInput: ElementType
|
|
37
|
+
/**
|
|
38
|
+
* The checkbox group component.
|
|
39
|
+
*/
|
|
40
|
+
Group: ElementType
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* An Object containing the parts of the Checkbox component. For users that
|
|
45
|
+
* prefer Object component syntax.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
*
|
|
49
|
+
* When using object component syntax, you import the CheckboxParts object and
|
|
50
|
+
* the entire family of components vs. only what you use.
|
|
51
|
+
*/
|
|
52
|
+
export const CheckboxParts: CheckboxPartsValue = {
|
|
53
|
+
Root: CheckboxRoot,
|
|
54
|
+
Label: CheckboxLabel,
|
|
55
|
+
Control: CheckboxControl,
|
|
56
|
+
Indicator: CheckboxIndicator,
|
|
57
|
+
HiddenInput: CheckboxHiddenInput,
|
|
58
|
+
Group: CheckboxGroup,
|
|
59
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Checkbox,
|
|
3
|
+
type CheckboxControlProps,
|
|
4
|
+
type CheckboxGroupProps,
|
|
5
|
+
type CheckboxIndicatorProps,
|
|
6
|
+
type CheckboxLabelProps,
|
|
7
|
+
type CheckboxRootProps,
|
|
8
|
+
} from '@ark-ui/react'
|
|
9
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
10
|
+
import {
|
|
11
|
+
checkbox,
|
|
12
|
+
type CheckboxVariantProps,
|
|
13
|
+
} from '@cerberus/styled-system/recipes'
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* This module contains the Checkbox primitives.
|
|
17
|
+
* @module 'react/checkbox'
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Checkbox Root component used to provide the context to all other checkbox
|
|
22
|
+
* primitives.
|
|
23
|
+
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
24
|
+
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
25
|
+
*/
|
|
26
|
+
export function CheckboxRoot(props: CheckboxRootProps) {
|
|
27
|
+
const styles = checkbox()
|
|
28
|
+
return (
|
|
29
|
+
<Checkbox.Root {...props} className={cx(styles.root, props.className)} />
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Checkbox Label component used to display the label of the checkbox.
|
|
35
|
+
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
36
|
+
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
37
|
+
*/
|
|
38
|
+
export function CheckboxLabel(
|
|
39
|
+
props: CheckboxLabelProps & CheckboxVariantProps,
|
|
40
|
+
) {
|
|
41
|
+
const { size, ...labelProps } = props
|
|
42
|
+
const styles = checkbox({ size })
|
|
43
|
+
return (
|
|
44
|
+
<Checkbox.Label
|
|
45
|
+
{...labelProps}
|
|
46
|
+
className={cx(styles.label, labelProps.className)}
|
|
47
|
+
/>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Checkbox Control component used to display the control of the checkbox.
|
|
53
|
+
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
54
|
+
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
55
|
+
*/
|
|
56
|
+
export function CheckboxControl(
|
|
57
|
+
props: CheckboxControlProps & CheckboxVariantProps,
|
|
58
|
+
) {
|
|
59
|
+
const { size, ...controlProps } = props
|
|
60
|
+
const styles = checkbox({ size })
|
|
61
|
+
return (
|
|
62
|
+
<Checkbox.Control
|
|
63
|
+
{...controlProps}
|
|
64
|
+
className={cx(styles.control, controlProps.className)}
|
|
65
|
+
/>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Checkbox Indicator component used to display the indicator of the checkbox.
|
|
71
|
+
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
72
|
+
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
73
|
+
*/
|
|
74
|
+
export function CheckboxIndicator(props: CheckboxIndicatorProps) {
|
|
75
|
+
const styles = checkbox()
|
|
76
|
+
return (
|
|
77
|
+
<Checkbox.Indicator
|
|
78
|
+
{...props}
|
|
79
|
+
className={cx(styles.indicator, props.className)}
|
|
80
|
+
/>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Checkbox HiddenInput component used to provide the native checkbox input.
|
|
86
|
+
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
87
|
+
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
88
|
+
*/
|
|
89
|
+
export function CheckboxHiddenInput(props: CheckboxControlProps) {
|
|
90
|
+
return <Checkbox.HiddenInput {...props} />
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Checkbox Group is used to group checkboxes together in a consistently styled
|
|
95
|
+
* way.
|
|
96
|
+
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
97
|
+
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
98
|
+
*/
|
|
99
|
+
export function CheckboxGroup(props: CheckboxGroupProps) {
|
|
100
|
+
const styles = checkbox()
|
|
101
|
+
return (
|
|
102
|
+
<Checkbox.Group {...props} className={cx(styles.group, props.className)} />
|
|
103
|
+
)
|
|
104
|
+
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
fieldMessage,
|
|
7
7
|
type FieldMessageVariantProps,
|
|
8
8
|
} from '@cerberus/styled-system/recipes'
|
|
9
|
-
import { useFieldContext } from '
|
|
9
|
+
import { useFieldContext } from '@ark-ui/react/field'
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* This module contains the FieldMessage component.
|
|
@@ -25,18 +25,7 @@ export interface FieldMessageBaseProps
|
|
|
25
25
|
export type FieldMessageProps = FieldMessageBaseProps & FieldMessageVariantProps
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
* @see https://cerberus.digitalu.design/react/field-message
|
|
30
|
-
* @example
|
|
31
|
-
* ```tsx
|
|
32
|
-
* <Field>
|
|
33
|
-
* <Label htmlFor="first_name">First Name</Label>
|
|
34
|
-
* <Input aria-describedBy="help:first_name" id="first_name" type="text" />
|
|
35
|
-
* <FieldMessage id="help:first_name">
|
|
36
|
-
* This will only be used in your account information.
|
|
37
|
-
* </FieldMessage>
|
|
38
|
-
* </Field>
|
|
39
|
-
* ```
|
|
28
|
+
* @deprecated use FieldHelperText, FieldErrorText, or FieldParts instead
|
|
40
29
|
*/
|
|
41
30
|
export function FieldMessage(props: FieldMessageProps) {
|
|
42
31
|
const { invalid } = useFieldContext()
|
|
@@ -0,0 +1,32 @@
|
|
|
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 &
|
|
11
|
+
LabelVariantProps & {
|
|
12
|
+
htmlFor?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
*/
|
|
18
|
+
export function FieldsetLabel(props: FieldsetLabelProps) {
|
|
19
|
+
const { size, usage, ...nativeProps } = props
|
|
20
|
+
return (
|
|
21
|
+
<label
|
|
22
|
+
{...nativeProps}
|
|
23
|
+
className={cx(
|
|
24
|
+
nativeProps.className,
|
|
25
|
+
label({
|
|
26
|
+
size,
|
|
27
|
+
usage,
|
|
28
|
+
}),
|
|
29
|
+
)}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HTMLAttributes, PropsWithChildren } from 'react'
|
|
2
|
+
import { label, type LabelVariantProps } from '@cerberus/styled-system/recipes'
|
|
3
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
4
|
+
import { FieldLabel } from '../field'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This module contains the Label component.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
export type LabelBaseProps = HTMLAttributes<HTMLLabelElement>
|
|
11
|
+
export type LabelProps = LabelBaseProps & LabelVariantProps
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use FieldLabel or FieldParts.Label instead.
|
|
15
|
+
*/
|
|
16
|
+
export function Label(props: PropsWithChildren<LabelProps>) {
|
|
17
|
+
const { size, ...nativeProps } = props
|
|
18
|
+
return (
|
|
19
|
+
<FieldLabel
|
|
20
|
+
{...nativeProps}
|
|
21
|
+
className={cx(label({ size }), props.className)}
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { useMemo, type HTMLAttributes } from 'react'
|
|
4
4
|
import { cx } from '@cerberus/styled-system/css'
|
|
5
5
|
import { vstack } from '@cerberus/styled-system/patterns'
|
|
6
|
-
import { useNavMenuContext } from '
|
|
7
|
-
import type { Positions } from '
|
|
8
|
-
import { Show } from '
|
|
6
|
+
import { useNavMenuContext } from '../../context/navMenu'
|
|
7
|
+
import type { Positions } from '../../types'
|
|
8
|
+
import { Show } from '../Show'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* This module contains the NavMenuList component.
|
|
@@ -11,10 +11,10 @@ import { button } from '@cerberus/styled-system/recipes'
|
|
|
11
11
|
import {
|
|
12
12
|
createNavTriggerProps,
|
|
13
13
|
type NavTriggerAriaValues,
|
|
14
|
-
} from '
|
|
15
|
-
import { useNavMenuContext } from '
|
|
16
|
-
import type { ButtonProps } from '
|
|
17
|
-
import { Show } from '
|
|
14
|
+
} from '../../aria-helpers/nav-menu.aria'
|
|
15
|
+
import { useNavMenuContext } from '../../context/navMenu'
|
|
16
|
+
import type { ButtonProps } from '../button/button'
|
|
17
|
+
import { Show } from '../Show'
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* This module contains the NavMenuTrigger component.
|