@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
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import type { SelectItemProps, SelectRootProps } from '@ark-ui/react/select'
|
|
4
|
+
import { type SelectVariantProps } from '@cerberus/styled-system/recipes'
|
|
5
|
+
import { HStack } from '@cerberus/styled-system/jsx'
|
|
6
|
+
import { useCerberusContext } from '../../context/cerberus'
|
|
7
|
+
import { Portal } from '../Portal'
|
|
8
|
+
import { Show } from '../Show'
|
|
9
|
+
import { SelectParts } from './parts'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This module contains the Select components.
|
|
13
|
+
* @module 'react/select'
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export interface SelectCollectionItem {
|
|
17
|
+
/**
|
|
18
|
+
* What is displayed in the dropdown list.
|
|
19
|
+
*/
|
|
20
|
+
label: string
|
|
21
|
+
/**
|
|
22
|
+
* The value of the selected item used in the form.
|
|
23
|
+
*/
|
|
24
|
+
value: string
|
|
25
|
+
/**
|
|
26
|
+
* If the item is disabled.
|
|
27
|
+
*/
|
|
28
|
+
disabled?: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface SelectCollection {
|
|
32
|
+
/**
|
|
33
|
+
* The items to be displayed in the dropdown list.
|
|
34
|
+
*/
|
|
35
|
+
items: SelectCollectionItem[]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface BaseSelectProps {
|
|
39
|
+
/**
|
|
40
|
+
* The placeholder text when no option is selected.
|
|
41
|
+
*/
|
|
42
|
+
placeholder?: string
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type SelectProps = SelectRootProps<SelectCollectionItem> &
|
|
46
|
+
BaseSelectProps &
|
|
47
|
+
SelectVariantProps
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The Select component is a dropdown list that allows users to select an
|
|
51
|
+
* option from a list.
|
|
52
|
+
* @definition [Select docs](https://cerberus.digitalu.design/react/select)
|
|
53
|
+
* @definition [ARK docs](https://ark-ui.com/react/docs/components/select)
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* import { Select, Option, createListCollection } from '@cerberus-design/react'
|
|
57
|
+
*
|
|
58
|
+
* export function SelectBasicPreview() {
|
|
59
|
+
* const collection = createListCollection({
|
|
60
|
+
* items: [
|
|
61
|
+
* { label: 'Hades', value: 'hades' },
|
|
62
|
+
* { label: 'Persephone', value: 'persephone' },
|
|
63
|
+
* { label: 'Zeus', value: 'zeus', disabled: true },
|
|
64
|
+
* ]
|
|
65
|
+
* })
|
|
66
|
+
*
|
|
67
|
+
* return (
|
|
68
|
+
* <Select
|
|
69
|
+
* collection={collection}
|
|
70
|
+
* label="Select Relative"
|
|
71
|
+
* placeholder="Choose option"
|
|
72
|
+
* >
|
|
73
|
+
* {collection.items.map((item) => (
|
|
74
|
+
* <Option key={item.value} item={item} />
|
|
75
|
+
* ))}
|
|
76
|
+
* </Select>
|
|
77
|
+
* )
|
|
78
|
+
* }
|
|
79
|
+
*/
|
|
80
|
+
export function Select(props: SelectProps) {
|
|
81
|
+
const { collection, placeholder, ...rootProps } = props
|
|
82
|
+
const { icons } = useCerberusContext()
|
|
83
|
+
const { selectArrow: SelectArrow, invalid: InvalidIcon } = icons
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<SelectParts.Root collection={collection} {...rootProps}>
|
|
87
|
+
<SelectParts.Control>
|
|
88
|
+
<SelectParts.Trigger>
|
|
89
|
+
<SelectParts.ValueText placeholder={placeholder} />
|
|
90
|
+
|
|
91
|
+
<HStack>
|
|
92
|
+
<Show when={props.invalid}>
|
|
93
|
+
<InvalidIcon data-part="invalid-icon" />
|
|
94
|
+
</Show>
|
|
95
|
+
<SelectParts.Indicator>
|
|
96
|
+
<SelectArrow />
|
|
97
|
+
</SelectParts.Indicator>
|
|
98
|
+
</HStack>
|
|
99
|
+
</SelectParts.Trigger>
|
|
100
|
+
</SelectParts.Control>
|
|
101
|
+
|
|
102
|
+
<Portal>
|
|
103
|
+
<SelectParts.Positioner>
|
|
104
|
+
<SelectParts.Content size={rootProps.size}>
|
|
105
|
+
{props.children}
|
|
106
|
+
</SelectParts.Content>
|
|
107
|
+
</SelectParts.Positioner>
|
|
108
|
+
</Portal>
|
|
109
|
+
|
|
110
|
+
<SelectParts.HiddenSelect />
|
|
111
|
+
</SelectParts.Root>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface OptionProps extends SelectItemProps {
|
|
116
|
+
/**
|
|
117
|
+
* The CollectionListItem to be displayed in the dropdown list.
|
|
118
|
+
*/
|
|
119
|
+
item: SelectCollectionItem
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function Option(props: OptionProps) {
|
|
123
|
+
const { item, ...itemProps } = props
|
|
124
|
+
const { icons } = useCerberusContext()
|
|
125
|
+
const { selectChecked: CheckedIcon } = icons
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<SelectParts.Item {...itemProps} item={item}>
|
|
129
|
+
<SelectParts.ItemText>{item?.label}</SelectParts.ItemText>
|
|
130
|
+
<SelectParts.ItemIndicator>
|
|
131
|
+
<CheckedIcon />
|
|
132
|
+
</SelectParts.ItemIndicator>
|
|
133
|
+
</SelectParts.Item>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ElementType } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
SwitchControl,
|
|
4
|
+
SwitchLabel,
|
|
5
|
+
SwitchRoot,
|
|
6
|
+
SwitchThumb,
|
|
7
|
+
SwitchHiddenInput,
|
|
8
|
+
} from './primitives'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This module contains the parts of the Radio parts.
|
|
12
|
+
* @module 'radio/parts'
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
interface SwitchPartsValue {
|
|
16
|
+
/**
|
|
17
|
+
* The container of the field.
|
|
18
|
+
*/
|
|
19
|
+
Root: ElementType
|
|
20
|
+
/**
|
|
21
|
+
* The label of the field.
|
|
22
|
+
*/
|
|
23
|
+
Label: ElementType
|
|
24
|
+
/**
|
|
25
|
+
* The visual input of the switch.
|
|
26
|
+
*/
|
|
27
|
+
Control: ElementType
|
|
28
|
+
/**
|
|
29
|
+
* The thumb item of the switch.
|
|
30
|
+
*/
|
|
31
|
+
Thumb: ElementType
|
|
32
|
+
/**
|
|
33
|
+
* The native input for the switch.
|
|
34
|
+
*/
|
|
35
|
+
HiddenInput: ElementType
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* An Object containing the parts of the Radio component. For users that
|
|
40
|
+
* prefer Object component syntax.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
*
|
|
44
|
+
* When using object component syntax, you import the SwitchParts object and
|
|
45
|
+
* the entire family of components vs. only what you use.
|
|
46
|
+
*/
|
|
47
|
+
export const SwitchParts: SwitchPartsValue = {
|
|
48
|
+
Root: SwitchRoot,
|
|
49
|
+
Label: SwitchLabel,
|
|
50
|
+
Control: SwitchControl,
|
|
51
|
+
Thumb: SwitchThumb,
|
|
52
|
+
HiddenInput: SwitchHiddenInput,
|
|
53
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Switch,
|
|
3
|
+
type SwitchControlProps,
|
|
4
|
+
type SwitchLabelProps,
|
|
5
|
+
type SwitchRootProps,
|
|
6
|
+
type SwitchThumbProps,
|
|
7
|
+
} from '@ark-ui/react'
|
|
8
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
9
|
+
import {
|
|
10
|
+
switchRecipe,
|
|
11
|
+
type SwitchRecipeVariantProps,
|
|
12
|
+
} from '@cerberus/styled-system/recipes'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* This module contains the Switch primitives
|
|
16
|
+
* @module 'react/switch'
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The SwitchRoot component is the context provider for the Switch components.
|
|
21
|
+
*/
|
|
22
|
+
export function SwitchRoot(props: SwitchRootProps & SwitchRecipeVariantProps) {
|
|
23
|
+
const { size, ...rootProps } = props
|
|
24
|
+
const styles = switchRecipe({ size })
|
|
25
|
+
return (
|
|
26
|
+
<Switch.Root
|
|
27
|
+
{...rootProps}
|
|
28
|
+
className={cx(styles.root, rootProps.className)}
|
|
29
|
+
/>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The SwitchLabel component is the label for the Switch.
|
|
35
|
+
*/
|
|
36
|
+
export function SwitchLabel(props: SwitchLabelProps) {
|
|
37
|
+
const styles = switchRecipe()
|
|
38
|
+
return (
|
|
39
|
+
<Switch.Label {...props} className={cx(styles.label, props.className)} />
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The SwitchControl component is the visual input for the Switch.
|
|
45
|
+
*/
|
|
46
|
+
export function SwitchControl(props: SwitchControlProps) {
|
|
47
|
+
const styles = switchRecipe()
|
|
48
|
+
return (
|
|
49
|
+
<Switch.Control
|
|
50
|
+
{...props}
|
|
51
|
+
className={cx(styles.control, props.className)}
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The SwitchThumb component is the thumb for the Switch.
|
|
58
|
+
*/
|
|
59
|
+
export function SwitchThumb(props: SwitchThumbProps) {
|
|
60
|
+
const styles = switchRecipe()
|
|
61
|
+
return (
|
|
62
|
+
<Switch.Thumb {...props} className={cx(styles.thumb, props.className)} />
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The SwitchHiddenInput component is the native input for the Switch.
|
|
68
|
+
*/
|
|
69
|
+
export const SwitchHiddenInput = Switch.HiddenInput
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SwitchRootProps } from '@ark-ui/react'
|
|
2
|
+
import type { SwitchRecipeVariantProps } from '@cerberus/styled-system/recipes'
|
|
3
|
+
import { SwitchParts } from './parts'
|
|
4
|
+
import { SwitchIndicator } from './switch-indicator'
|
|
5
|
+
|
|
6
|
+
export type SwitchProps = SwitchRootProps & SwitchRecipeVariantProps
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The Switch component is a and abstraction of the primitives that displays a
|
|
10
|
+
* controlled Switch with a label.
|
|
11
|
+
* @description [Cerberus Docs] https://cerberus.digitalu.design/react/switch
|
|
12
|
+
* @description [Ark Docs] https://ark-ui.com/docs/components/switch
|
|
13
|
+
*/
|
|
14
|
+
export function Switch(props: SwitchProps) {
|
|
15
|
+
const { children, ...rootProps } = props
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<SwitchParts.Root {...rootProps}>
|
|
19
|
+
<SwitchParts.Control>
|
|
20
|
+
<SwitchParts.Thumb>
|
|
21
|
+
<SwitchIndicator />
|
|
22
|
+
</SwitchParts.Thumb>
|
|
23
|
+
</SwitchParts.Control>
|
|
24
|
+
|
|
25
|
+
<SwitchParts.Label>{children}</SwitchParts.Label>
|
|
26
|
+
|
|
27
|
+
<SwitchParts.HiddenInput />
|
|
28
|
+
</SwitchParts.Root>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ElementType } from 'react'
|
|
2
|
+
import { ToggleRoot, ToggleIndicator } from './primitives'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This module contains the parts of the Toggle parts.
|
|
6
|
+
* @module 'toggle/parts'
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
interface TogglePartsValue {
|
|
10
|
+
/**
|
|
11
|
+
* The container of the toggle.
|
|
12
|
+
*/
|
|
13
|
+
Root: ElementType
|
|
14
|
+
/**
|
|
15
|
+
* The indicator that appears when a toggle is pressed.
|
|
16
|
+
*/
|
|
17
|
+
Indicator: ElementType
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* An Object containing the parts of the Radio component. For users that
|
|
22
|
+
* prefer Object component syntax.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
*
|
|
26
|
+
* When using object component syntax, you import the RadioParts object and
|
|
27
|
+
* the entire family of components vs. only what you use.
|
|
28
|
+
*/
|
|
29
|
+
export const ToggleParts: TogglePartsValue = {
|
|
30
|
+
Root: ToggleRoot,
|
|
31
|
+
Indicator: ToggleIndicator,
|
|
32
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Toggle } from '@ark-ui/react/toggle'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This module provides the Toggle primitives.
|
|
5
|
+
* @module 'react/toggle'
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The ToggleRoot is used to manage the state of the Toggle component.
|
|
10
|
+
*/
|
|
11
|
+
export const ToggleRoot = Toggle.Root
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The ToggleIndicator is used to render the indicator of the Toggle component
|
|
15
|
+
* based on the pressed state.
|
|
16
|
+
*/
|
|
17
|
+
export const ToggleIndicator = Toggle.Indicator
|
package/src/config/types.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type PropsWithChildren,
|
|
12
12
|
type ReactNode,
|
|
13
13
|
} from 'react'
|
|
14
|
-
import { Button } from '../components/
|
|
14
|
+
import { Button } from '../components/button/button'
|
|
15
15
|
import { css } from '@cerberus/styled-system/css'
|
|
16
16
|
import { Show } from '../components/Show'
|
|
17
17
|
import { Avatar } from '../components/Avatar'
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type PropsWithChildren,
|
|
12
12
|
type ReactNode,
|
|
13
13
|
} from 'react'
|
|
14
|
-
import { Button } from '../components/
|
|
14
|
+
import { Button } from '../components/button/button'
|
|
15
15
|
import { Show } from '../components/Show'
|
|
16
16
|
import { Avatar } from '../components/Avatar'
|
|
17
17
|
import { useCerberusContext } from './cerberus'
|
package/src/context/field.tsx
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { FieldRootProps } from '@ark-ui/react'
|
|
3
4
|
import {
|
|
4
5
|
createContext,
|
|
5
6
|
useContext,
|
|
6
7
|
useMemo,
|
|
7
8
|
type PropsWithChildren,
|
|
8
9
|
} from 'react'
|
|
10
|
+
import { FieldRoot } from '../components/field/primitives'
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* This module provides a context and hook for the field.
|
|
@@ -35,11 +37,10 @@ export interface FieldContextValue {
|
|
|
35
37
|
const FieldContext = createContext<FieldContextValue | null>(null)
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @see https://cerberus.digitalu.design/react/input
|
|
40
|
+
* @deprecated use FieldRoot or FieldParts instead
|
|
40
41
|
*/
|
|
41
|
-
export function
|
|
42
|
-
props: PropsWithChildren<
|
|
42
|
+
export function FieldProvider(
|
|
43
|
+
props: PropsWithChildren<FieldRootProps>,
|
|
43
44
|
): JSX.Element {
|
|
44
45
|
const value = useMemo(
|
|
45
46
|
() => ({
|
|
@@ -53,7 +54,7 @@ export function Field(
|
|
|
53
54
|
|
|
54
55
|
return (
|
|
55
56
|
<FieldContext.Provider value={value}>
|
|
56
|
-
{props
|
|
57
|
+
<FieldRoot {...props} />
|
|
57
58
|
</FieldContext.Provider>
|
|
58
59
|
)
|
|
59
60
|
}
|
|
@@ -17,7 +17,7 @@ import { Notification } from '../components/Notification'
|
|
|
17
17
|
import { animateIn, vstack } from '@cerberus/styled-system/patterns'
|
|
18
18
|
import { Portal, type PortalProps } from '../components/Portal'
|
|
19
19
|
import { notification } from '@cerberus/styled-system/recipes'
|
|
20
|
-
import { Button } from '../components/
|
|
20
|
+
import { Button } from '../components/button/button'
|
|
21
21
|
import { cx } from '@cerberus/styled-system/css'
|
|
22
22
|
import {
|
|
23
23
|
addNotification,
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
type MouseEvent,
|
|
12
12
|
type PropsWithChildren,
|
|
13
13
|
} from 'react'
|
|
14
|
-
import {
|
|
14
|
+
import { DialogCloseTrigger } from '@ark-ui/react'
|
|
15
|
+
import { HStack, VStack } from '@cerberus/styled-system/jsx'
|
|
15
16
|
import { css } from '@cerberus/styled-system/css'
|
|
16
17
|
import { hstack } from '@cerberus/styled-system/patterns'
|
|
17
|
-
import { Input } from '../components/
|
|
18
|
-
import {
|
|
19
|
-
import { Label } from '../components/Label'
|
|
18
|
+
import { FieldLabel, FieldRoot, Input } from '../components/field/index'
|
|
19
|
+
import { Button } from '../components/button/button'
|
|
20
20
|
import { Show } from '../components/Show'
|
|
21
21
|
import { Avatar } from '../components/Avatar'
|
|
22
22
|
import { Text } from '../components/Text'
|
|
@@ -27,8 +27,6 @@ import {
|
|
|
27
27
|
DialogHeading,
|
|
28
28
|
DialogProvider,
|
|
29
29
|
} from '../components/Dialog'
|
|
30
|
-
import { HStack, VStack } from '@cerberus/styled-system/jsx'
|
|
31
|
-
import { DialogCloseTrigger } from '@ark-ui/react'
|
|
32
30
|
|
|
33
31
|
/**
|
|
34
32
|
* This module provides a context and hook for the prompt modal.
|
|
@@ -216,28 +214,28 @@ export function PromptModal(
|
|
|
216
214
|
marginBlockEnd="lg"
|
|
217
215
|
w="full"
|
|
218
216
|
>
|
|
219
|
-
<
|
|
220
|
-
|
|
217
|
+
<FieldRoot
|
|
218
|
+
ids={{
|
|
219
|
+
control: 'confirm',
|
|
220
|
+
}}
|
|
221
|
+
invalid={!isValid}
|
|
222
|
+
>
|
|
223
|
+
<FieldLabel
|
|
221
224
|
className={hstack({
|
|
222
225
|
gap: 'xs',
|
|
223
226
|
justify: 'flex-start !important',
|
|
227
|
+
marginBlockEnd: 'xs',
|
|
228
|
+
textStyle: 'label-md',
|
|
224
229
|
})}
|
|
225
|
-
htmlFor="confirm"
|
|
226
|
-
size="md"
|
|
227
230
|
>
|
|
228
231
|
Type
|
|
229
232
|
<Text as="strong" textTransform="uppercase">
|
|
230
233
|
{content?.key}
|
|
231
234
|
</Text>
|
|
232
235
|
to confirm
|
|
233
|
-
</
|
|
234
|
-
<Input
|
|
235
|
-
|
|
236
|
-
name="confirm"
|
|
237
|
-
onChange={handleChange}
|
|
238
|
-
type="text"
|
|
239
|
-
/>
|
|
240
|
-
</Field>
|
|
236
|
+
</FieldLabel>
|
|
237
|
+
<Input name="confirm" onChange={handleChange} type="text" />
|
|
238
|
+
</FieldRoot>
|
|
241
239
|
</VStack>
|
|
242
240
|
|
|
243
241
|
<HStack gap="md" justify="stretch" w="full">
|
package/src/hooks/useDate.ts
CHANGED
|
@@ -38,13 +38,7 @@ export interface UseDateReturn extends UseDateBase {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```tsx
|
|
44
|
-
* const MyComponent = () => {
|
|
45
|
-
* const date = useDate({ initialValue: '01 JAN 2024' })
|
|
46
|
-
* return <input onChange={date.onChange} type="text" value={date.value} />
|
|
47
|
-
* }
|
|
41
|
+
* @deprecated use the DatePicker family instead
|
|
48
42
|
*/
|
|
49
43
|
export function useDate(options?: UseDateOptions): UseDateReturn {
|
|
50
44
|
const initialValue = options?.initialValue ?? ''
|
|
@@ -38,7 +38,6 @@ export function useRootColors(colors: string[] = []): RootColorsResult {
|
|
|
38
38
|
useEffect(() => {
|
|
39
39
|
if (Object.keys(state).length === colors.length) return
|
|
40
40
|
dispatch(formatColors(colors))
|
|
41
|
-
console.log('updating colors in root hook')
|
|
42
41
|
}, [colors])
|
|
43
42
|
|
|
44
43
|
// reducer is already memoized
|
package/src/hooks/useToggle.ts
CHANGED
|
@@ -29,9 +29,7 @@ export interface ToggleHookReturn {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @see https://cerberus.digitalu.design/react/use-toggle
|
|
34
|
-
* @memberof module:Toggle
|
|
32
|
+
* @deprecated Will be removed in v1. Use ToggleParts instead.
|
|
35
33
|
*/
|
|
36
34
|
export function useToggle(options?: UseToggleOptions): ToggleHookReturn {
|
|
37
35
|
const [checked, setChecked] = useState<string>(options?.checked ?? '')
|
package/src/index.ts
CHANGED
|
@@ -5,13 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
// deprecated
|
|
7
7
|
|
|
8
|
-
export * from './components/
|
|
9
|
-
export * from './components/
|
|
10
|
-
export * from './components/
|
|
11
|
-
export * from './components/
|
|
12
|
-
export * from './components/
|
|
13
|
-
export * from './components/
|
|
14
|
-
export * from './components/
|
|
8
|
+
export * from './components/deprecated/FieldMessage'
|
|
9
|
+
export * from './components/deprecated/FieldsetLabel'
|
|
10
|
+
export * from './components/deprecated/Label'
|
|
11
|
+
export * from './components/deprecated/Modal'
|
|
12
|
+
export * from './components/deprecated/ModalHeader'
|
|
13
|
+
export * from './components/deprecated/ModalHeading'
|
|
14
|
+
export * from './components/deprecated/ModalDescription'
|
|
15
|
+
export * from './components/deprecated/NavMenuTrigger'
|
|
16
|
+
export * from './components/deprecated/NavMenuList'
|
|
17
|
+
export * from './components/deprecated/NavMenuLink'
|
|
18
|
+
export * from './hooks/useDate'
|
|
19
|
+
export * from './hooks/useModal'
|
|
20
|
+
export * from './hooks/useToggle'
|
|
15
21
|
|
|
16
22
|
// components
|
|
17
23
|
|
|
@@ -20,23 +26,21 @@ export * from './components/Accordion.client'
|
|
|
20
26
|
export * from './components/AccordionItemGroup'
|
|
21
27
|
export * from './components/Admonition'
|
|
22
28
|
export * from './components/Avatar'
|
|
23
|
-
export * from './components/
|
|
24
|
-
export * from './components/
|
|
29
|
+
export * from './components/button/index'
|
|
30
|
+
export * from './components/checkbox/index'
|
|
25
31
|
export * from './components/CircularProgress'
|
|
26
32
|
export * from './components/DatePicker.client'
|
|
27
33
|
export * from './components/DatePicker.server'
|
|
28
34
|
export * from './components/Dialog'
|
|
29
35
|
export * from './components/Dialog.client'
|
|
30
36
|
export * from './components/Droppable'
|
|
31
|
-
export * from './components/FieldMessage'
|
|
32
37
|
export * from './components/FeatureFlag'
|
|
33
|
-
export * from './components/
|
|
34
|
-
export * from './components/
|
|
38
|
+
export * from './components/field/index'
|
|
39
|
+
export * from './components/fieldset/index'
|
|
35
40
|
export * from './components/FileStatus'
|
|
36
41
|
export * from './components/FileUploader'
|
|
42
|
+
export * from './components/for'
|
|
37
43
|
export * from './components/IconButton'
|
|
38
|
-
export * from './components/Input'
|
|
39
|
-
export * from './components/Label'
|
|
40
44
|
export * from './components/Legend'
|
|
41
45
|
export * from './components/Menu'
|
|
42
46
|
export * from './components/Notification'
|
|
@@ -44,9 +48,11 @@ export * from './components/NotificationHeading'
|
|
|
44
48
|
export * from './components/NotificationDescription'
|
|
45
49
|
export * from './components/Portal'
|
|
46
50
|
export * from './components/ProgressBar'
|
|
47
|
-
export * from './components/
|
|
48
|
-
export * from './components/
|
|
51
|
+
export * from './components/radio/index'
|
|
52
|
+
export * from './components/select/index'
|
|
53
|
+
export * from './components/Show'
|
|
49
54
|
export * from './components/Spinner'
|
|
55
|
+
export * from './components/switch/index'
|
|
50
56
|
export * from './components/Tabs.client'
|
|
51
57
|
export * from './components/Table'
|
|
52
58
|
export * from './components/Thead'
|
|
@@ -55,10 +61,8 @@ export * from './components/Td'
|
|
|
55
61
|
export * from './components/Tbody'
|
|
56
62
|
export * from './components/Tag'
|
|
57
63
|
export * from './components/Text'
|
|
58
|
-
export * from './components/
|
|
59
|
-
export * from './components/Toggle'
|
|
64
|
+
export * from './components/toggle/index'
|
|
60
65
|
export * from './components/Tooltip'
|
|
61
|
-
export * from './components/Show'
|
|
62
66
|
|
|
63
67
|
// context
|
|
64
68
|
|
|
@@ -66,7 +70,6 @@ export * from './context/cerberus'
|
|
|
66
70
|
export * from './context/confirm-modal'
|
|
67
71
|
export * from './context/cta-modal'
|
|
68
72
|
export * from './context/feature-flags'
|
|
69
|
-
export * from './context/field'
|
|
70
73
|
export * from './context/navMenu'
|
|
71
74
|
export * from './context/notification-center'
|
|
72
75
|
export * from './context/prompt-modal'
|
|
@@ -75,10 +78,7 @@ export * from './context/theme'
|
|
|
75
78
|
|
|
76
79
|
// hooks
|
|
77
80
|
|
|
78
|
-
export * from './hooks/useDate'
|
|
79
|
-
export * from './hooks/useModal'
|
|
80
81
|
export * from './hooks/useTheme'
|
|
81
|
-
export * from './hooks/useToggle'
|
|
82
82
|
export * from './hooks/useRootColors'
|
|
83
83
|
|
|
84
84
|
// aria-helpers
|
package/src/utils/index.ts
CHANGED
|
@@ -18,4 +18,34 @@ export function formatNotifyCount(count: number): string {
|
|
|
18
18
|
return count.toString()
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Splits the properties of an object into multiple groups based on lists of keys.
|
|
23
|
+
* @param props - The object to split.
|
|
24
|
+
* @param keyGroups - The lists of keys to include in each group.
|
|
25
|
+
* @returns An array of objects: each containing the properties specified in the corresponding key group, and the last object containing the remaining keys.
|
|
26
|
+
*/
|
|
27
|
+
export function splitProps<T extends object>(
|
|
28
|
+
props: T,
|
|
29
|
+
...keyGroups: (keyof T)[][]
|
|
30
|
+
): { [K in keyof T]?: T[K] }[] {
|
|
31
|
+
const result = keyGroups.map(() => ({}) as { [K in keyof T]?: T[K] })
|
|
32
|
+
const rest = {} as { [K in keyof T]?: T[K] }
|
|
33
|
+
|
|
34
|
+
for (const key in props) {
|
|
35
|
+
let assigned = false
|
|
36
|
+
for (let i = 0; i < keyGroups.length; i++) {
|
|
37
|
+
if (keyGroups[i].includes(key as keyof T)) {
|
|
38
|
+
result[i][key as keyof T] = props[key]
|
|
39
|
+
assigned = true
|
|
40
|
+
break
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (!assigned) {
|
|
44
|
+
rest[key as keyof T] = props[key]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return [...result, rest]
|
|
49
|
+
}
|
|
50
|
+
|
|
21
51
|
export * from './localStorage'
|