@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,65 @@
|
|
|
1
|
+
import type { ElementType } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
RadioGroupRoot,
|
|
4
|
+
RadioGroupLabel,
|
|
5
|
+
RadioGroupIndicator,
|
|
6
|
+
RadioGroupItem,
|
|
7
|
+
RadioGroupItemText,
|
|
8
|
+
RadioGroupItemControl,
|
|
9
|
+
RadioGroupItemHiddenInput,
|
|
10
|
+
} from './primitives'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This module contains the parts of the Radio parts.
|
|
14
|
+
* @module 'radio/parts'
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface RadioPartsValue {
|
|
18
|
+
/**
|
|
19
|
+
* The container of the field.
|
|
20
|
+
*/
|
|
21
|
+
Root: ElementType
|
|
22
|
+
/**
|
|
23
|
+
* The label of the field.
|
|
24
|
+
*/
|
|
25
|
+
Label: ElementType
|
|
26
|
+
/**
|
|
27
|
+
* The indicator that appears when a radio is checked.
|
|
28
|
+
*/
|
|
29
|
+
Indicator: ElementType
|
|
30
|
+
/**
|
|
31
|
+
* An individual radio item of the field.
|
|
32
|
+
*/
|
|
33
|
+
Item: ElementType
|
|
34
|
+
/**
|
|
35
|
+
* The text that labels a single radio of the field.
|
|
36
|
+
*/
|
|
37
|
+
ItemText: ElementType
|
|
38
|
+
/**
|
|
39
|
+
* The visual radio control of the field.
|
|
40
|
+
*/
|
|
41
|
+
ItemControl: ElementType
|
|
42
|
+
/**
|
|
43
|
+
* The native input for a radio item in the field.
|
|
44
|
+
*/
|
|
45
|
+
ItemHiddenInput: ElementType
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* An Object containing the parts of the Radio component. For users that
|
|
50
|
+
* prefer Object component syntax.
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
*
|
|
54
|
+
* When using object component syntax, you import the RadioParts object and
|
|
55
|
+
* the entire family of components vs. only what you use.
|
|
56
|
+
*/
|
|
57
|
+
export const RadioParts: RadioPartsValue = {
|
|
58
|
+
Root: RadioGroupRoot,
|
|
59
|
+
Label: RadioGroupLabel,
|
|
60
|
+
Indicator: RadioGroupIndicator,
|
|
61
|
+
Item: RadioGroupItem,
|
|
62
|
+
ItemText: RadioGroupItemText,
|
|
63
|
+
ItemControl: RadioGroupItemControl,
|
|
64
|
+
ItemHiddenInput: RadioGroupItemHiddenInput,
|
|
65
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RadioGroup as ArkRadioGroup,
|
|
3
|
+
type RadioGroupIndicatorProps,
|
|
4
|
+
type RadioGroupItemControlProps,
|
|
5
|
+
type RadioGroupItemHiddenInputProps,
|
|
6
|
+
type RadioGroupItemProps,
|
|
7
|
+
type RadioGroupItemTextProps,
|
|
8
|
+
type RadioGroupLabelProps,
|
|
9
|
+
type RadioGroupRootProps,
|
|
10
|
+
} from '@ark-ui/react/radio-group'
|
|
11
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
12
|
+
import {
|
|
13
|
+
radioGroup,
|
|
14
|
+
type RadioGroupVariantProps,
|
|
15
|
+
} from '@cerberus/styled-system/recipes'
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* This module contains the Radio primitives
|
|
19
|
+
* @module 'react/radio'
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The RadioGroupRoot component is used to group radio buttons together.
|
|
24
|
+
*/
|
|
25
|
+
export function RadioGroupRoot(
|
|
26
|
+
props: RadioGroupRootProps & RadioGroupVariantProps,
|
|
27
|
+
) {
|
|
28
|
+
const { size, orientation, ...rootProps } = props
|
|
29
|
+
const styles = radioGroup({ size, orientation })
|
|
30
|
+
return (
|
|
31
|
+
<ArkRadioGroup.Root
|
|
32
|
+
{...rootProps}
|
|
33
|
+
className={cx(styles.root, rootProps.className)}
|
|
34
|
+
/>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The RadioGroupLabel component is used to label a group of radio buttons.
|
|
40
|
+
*/
|
|
41
|
+
export function RadioGroupLabel(props: RadioGroupLabelProps) {
|
|
42
|
+
const styles = radioGroup()
|
|
43
|
+
return (
|
|
44
|
+
<ArkRadioGroup.Label
|
|
45
|
+
{...props}
|
|
46
|
+
className={cx(styles.label, props.className)}
|
|
47
|
+
/>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The RadioGroupIndicator component is used to indicate the selected radio
|
|
53
|
+
* button in a group.
|
|
54
|
+
*/
|
|
55
|
+
export function RadioGroupIndicator(props: RadioGroupIndicatorProps) {
|
|
56
|
+
const styles = radioGroup()
|
|
57
|
+
return (
|
|
58
|
+
<ArkRadioGroup.Indicator
|
|
59
|
+
{...props}
|
|
60
|
+
className={cx(styles.indicator, props.className)}
|
|
61
|
+
/>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The RadioGroupItem component is used to render a single radio button in a
|
|
67
|
+
* group.
|
|
68
|
+
*/
|
|
69
|
+
export function RadioGroupItem(props: RadioGroupItemProps) {
|
|
70
|
+
const styles = radioGroup()
|
|
71
|
+
return (
|
|
72
|
+
<ArkRadioGroup.Item
|
|
73
|
+
{...props}
|
|
74
|
+
className={cx(styles.item, props.className)}
|
|
75
|
+
/>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The RadioGroupItemText component is used to render the text label for a
|
|
81
|
+
* single radio button in a group.
|
|
82
|
+
*/
|
|
83
|
+
export function RadioGroupItemText(
|
|
84
|
+
props: RadioGroupItemTextProps & RadioGroupVariantProps,
|
|
85
|
+
) {
|
|
86
|
+
const { size, orientation, ...itemTextProps } = props
|
|
87
|
+
const styles = radioGroup({ size, orientation })
|
|
88
|
+
return (
|
|
89
|
+
<ArkRadioGroup.ItemText
|
|
90
|
+
{...itemTextProps}
|
|
91
|
+
className={cx(styles.itemText, itemTextProps.className)}
|
|
92
|
+
/>
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The RadioGroupItemControl component is used to render the control for a
|
|
98
|
+
* single radio button in a group.
|
|
99
|
+
*/
|
|
100
|
+
export function RadioGroupItemControl(
|
|
101
|
+
props: RadioGroupItemControlProps & RadioGroupVariantProps,
|
|
102
|
+
) {
|
|
103
|
+
const { size, orientation, ...itemControlProps } = props
|
|
104
|
+
const styles = radioGroup({ size, orientation })
|
|
105
|
+
return (
|
|
106
|
+
<ArkRadioGroup.ItemControl
|
|
107
|
+
{...itemControlProps}
|
|
108
|
+
className={cx(styles.itemControl, itemControlProps.className)}
|
|
109
|
+
/>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The RadioGroupItemHiddenInput component is used to render the hidden input
|
|
115
|
+
* for a single radio button in a group.
|
|
116
|
+
*/
|
|
117
|
+
export function RadioGroupItemHiddenInput(
|
|
118
|
+
props: RadioGroupItemHiddenInputProps,
|
|
119
|
+
) {
|
|
120
|
+
return <ArkRadioGroup.ItemHiddenInput {...props} />
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const RadioGroup = RadioGroupRoot
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { RadioGroupItemProps } from '@ark-ui/react'
|
|
2
|
+
import { type RadioGroupVariantProps } from '@cerberus/styled-system/recipes'
|
|
3
|
+
import {
|
|
4
|
+
RadioGroupItem,
|
|
5
|
+
RadioGroupItemControl,
|
|
6
|
+
RadioGroupItemHiddenInput,
|
|
7
|
+
RadioGroupItemText,
|
|
8
|
+
} from './primitives'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This module contains the Radio component.
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export type RadioProps = RadioGroupVariantProps & RadioGroupItemProps
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The Radio component is used to allow users to select a single option from a list of options.
|
|
19
|
+
* @see https://cerberus.digitalu.design/react/radio
|
|
20
|
+
* @memberof module:Field
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Radio value="option1">Option 1</Radio>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export function Radio(props: RadioProps) {
|
|
27
|
+
const { size, children, ...groupProps } = props
|
|
28
|
+
return (
|
|
29
|
+
<RadioGroupItem {...groupProps}>
|
|
30
|
+
<RadioGroupItemControl size={size} />
|
|
31
|
+
<RadioGroupItemText size={size}>{children}</RadioGroupItemText>
|
|
32
|
+
<RadioGroupItemHiddenInput />
|
|
33
|
+
</RadioGroupItem>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SelectItemGroupLabelProps,
|
|
3
|
+
SelectItemGroupProps,
|
|
4
|
+
} from '@ark-ui/react/select'
|
|
5
|
+
import { SelectItemGroup, SelectItemGroupLabel } from './primitives'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The OptionGroup component is a group of options in the dropdown list.
|
|
9
|
+
* @definition [Select docs](https://cerberus.digitalu.design/react/select)
|
|
10
|
+
* @definition [ARK docs](https://ark-ui.com/react/docs/components/select)
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <OptionGroup>
|
|
14
|
+
* <OptionGroupLabel>Greek gods</OptionGroupLabel>
|
|
15
|
+
* ...
|
|
16
|
+
* </OptionGroup>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export function OptionGroup(props: SelectItemGroupProps) {
|
|
20
|
+
return <SelectItemGroup {...props} />
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The OptionGroupLabel component is the label of the OptionGroup.
|
|
25
|
+
* @definition [Select docs](https://cerberus.digitalu.design/react/select)
|
|
26
|
+
* @definition [ARK docs](https://ark-ui.com/react/docs/components/select)
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <OptionGroupLabel>Greek gods</OptionGroupLabel>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function OptionGroupLabel(props: SelectItemGroupLabelProps) {
|
|
33
|
+
return <SelectItemGroupLabel {...props} />
|
|
34
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { ElementType } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
SelectClearTrigger,
|
|
4
|
+
SelectContent,
|
|
5
|
+
SelectControl,
|
|
6
|
+
SelectHiddenSelect,
|
|
7
|
+
SelectIndicator,
|
|
8
|
+
SelectItem,
|
|
9
|
+
SelectItemGroup,
|
|
10
|
+
SelectItemGroupLabel,
|
|
11
|
+
SelectItemIndicator,
|
|
12
|
+
SelectItemText,
|
|
13
|
+
SelectLabel,
|
|
14
|
+
SelectPositioner,
|
|
15
|
+
SelectRoot,
|
|
16
|
+
SelectTrigger,
|
|
17
|
+
SelectValueText,
|
|
18
|
+
} from './primitives'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* This module contains the parts of the Select parts.
|
|
22
|
+
* @module 'select/parts'
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
interface SelectPartsValue {
|
|
26
|
+
/**
|
|
27
|
+
* The context provider for the Select component.
|
|
28
|
+
*/
|
|
29
|
+
Root: ElementType
|
|
30
|
+
/**
|
|
31
|
+
* The label that appears above the select input.
|
|
32
|
+
*/
|
|
33
|
+
Label: ElementType
|
|
34
|
+
/**
|
|
35
|
+
* The control that wraps the select trigger.
|
|
36
|
+
*/
|
|
37
|
+
Control: ElementType
|
|
38
|
+
/**
|
|
39
|
+
* The trigger that opens the dropdown.
|
|
40
|
+
*/
|
|
41
|
+
Trigger: ElementType
|
|
42
|
+
/**
|
|
43
|
+
* The trigger to clear the select input.
|
|
44
|
+
*/
|
|
45
|
+
ClearTrigger: ElementType
|
|
46
|
+
/**
|
|
47
|
+
* The text that appears in the trigger.
|
|
48
|
+
*/
|
|
49
|
+
ValueText: ElementType
|
|
50
|
+
/**
|
|
51
|
+
* The indicator that appears in the trigger.
|
|
52
|
+
*/
|
|
53
|
+
Indicator: ElementType
|
|
54
|
+
/**
|
|
55
|
+
* The positioner that wraps the content.
|
|
56
|
+
*/
|
|
57
|
+
Positioner: ElementType
|
|
58
|
+
/**
|
|
59
|
+
* The content of the select component.
|
|
60
|
+
*/
|
|
61
|
+
Content: ElementType
|
|
62
|
+
/**
|
|
63
|
+
* A group of items in the select component.
|
|
64
|
+
*/
|
|
65
|
+
ItemGroup: ElementType
|
|
66
|
+
/**
|
|
67
|
+
* The label for a group of items in the select component.
|
|
68
|
+
*/
|
|
69
|
+
ItemGroupLabel: ElementType
|
|
70
|
+
/**
|
|
71
|
+
* An individual item in the select component.
|
|
72
|
+
*/
|
|
73
|
+
Item: ElementType
|
|
74
|
+
/**
|
|
75
|
+
* The text that labels a single radio of the field.
|
|
76
|
+
*/
|
|
77
|
+
ItemText: ElementType
|
|
78
|
+
/**
|
|
79
|
+
* The indicator that appears when the item has been selected.
|
|
80
|
+
*/
|
|
81
|
+
ItemIndicator: ElementType
|
|
82
|
+
/**
|
|
83
|
+
* The native select for use within a field.
|
|
84
|
+
*/
|
|
85
|
+
HiddenSelect: ElementType
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* An Object containing the parts of the Radio component. For users that
|
|
90
|
+
* prefer Object component syntax.
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
*
|
|
94
|
+
* When using object component syntax, you import the SelectParts object and
|
|
95
|
+
* the entire family of components vs. only what you use.
|
|
96
|
+
*/
|
|
97
|
+
export const SelectParts: SelectPartsValue = {
|
|
98
|
+
Root: SelectRoot,
|
|
99
|
+
Label: SelectLabel,
|
|
100
|
+
Control: SelectControl,
|
|
101
|
+
Trigger: SelectTrigger,
|
|
102
|
+
ClearTrigger: SelectClearTrigger,
|
|
103
|
+
ValueText: SelectValueText,
|
|
104
|
+
Indicator: SelectIndicator,
|
|
105
|
+
Positioner: SelectPositioner,
|
|
106
|
+
Content: SelectContent,
|
|
107
|
+
ItemGroup: SelectItemGroup,
|
|
108
|
+
ItemGroupLabel: SelectItemGroupLabel,
|
|
109
|
+
Item: SelectItem,
|
|
110
|
+
ItemText: SelectItemText,
|
|
111
|
+
ItemIndicator: SelectItemIndicator,
|
|
112
|
+
HiddenSelect: SelectHiddenSelect,
|
|
113
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createListCollection,
|
|
3
|
+
Select,
|
|
4
|
+
type ListCollection,
|
|
5
|
+
type SelectClearTriggerProps,
|
|
6
|
+
type SelectContentProps,
|
|
7
|
+
type SelectControlProps,
|
|
8
|
+
type SelectHiddenSelectProps,
|
|
9
|
+
type SelectIndicatorProps,
|
|
10
|
+
type SelectItemGroupLabelProps,
|
|
11
|
+
type SelectItemGroupProps,
|
|
12
|
+
type SelectItemIndicatorProps,
|
|
13
|
+
type SelectItemProps,
|
|
14
|
+
type SelectItemTextProps,
|
|
15
|
+
type SelectLabelProps,
|
|
16
|
+
type SelectPositionerProps,
|
|
17
|
+
type SelectRootProps,
|
|
18
|
+
type SelectTriggerProps,
|
|
19
|
+
type SelectValueChangeDetails,
|
|
20
|
+
type SelectValueTextProps,
|
|
21
|
+
} from '@ark-ui/react/select'
|
|
22
|
+
import {
|
|
23
|
+
select,
|
|
24
|
+
type SelectVariantProps,
|
|
25
|
+
} from '@cerberus/styled-system/recipes'
|
|
26
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
27
|
+
import type { SelectCollectionItem } from './select'
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This module contains the Select primitives
|
|
31
|
+
* @module 'react/select'
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The SelectRoot component is the context provider for the Select component.
|
|
36
|
+
*/
|
|
37
|
+
export function SelectRoot(
|
|
38
|
+
props: SelectRootProps<SelectCollectionItem> & SelectVariantProps,
|
|
39
|
+
) {
|
|
40
|
+
const { size, ...rootProps } = props
|
|
41
|
+
const styles = select({ size })
|
|
42
|
+
return (
|
|
43
|
+
<Select.Root
|
|
44
|
+
{...rootProps}
|
|
45
|
+
className={cx(styles.root, rootProps.className)}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The label that appears above the select input.
|
|
52
|
+
*/
|
|
53
|
+
export function SelectLabel(props: SelectLabelProps) {
|
|
54
|
+
const styles = select()
|
|
55
|
+
return (
|
|
56
|
+
<Select.Label {...props} className={cx(styles.label, props.className)} />
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The control that wraps the select trigger.
|
|
62
|
+
*/
|
|
63
|
+
export function SelectControl(props: SelectControlProps) {
|
|
64
|
+
return <Select.Control {...props} />
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The trigger that opens the dropdown.
|
|
69
|
+
*/
|
|
70
|
+
export function SelectTrigger(props: SelectTriggerProps) {
|
|
71
|
+
const styles = select()
|
|
72
|
+
return (
|
|
73
|
+
<Select.Trigger
|
|
74
|
+
{...props}
|
|
75
|
+
className={cx(styles.trigger, props.className)}
|
|
76
|
+
/>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The text that appears in the trigger.
|
|
82
|
+
*/
|
|
83
|
+
export function SelectValueText(props: SelectValueTextProps) {
|
|
84
|
+
return <Select.ValueText {...props} />
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The indicator that appears in the trigger.
|
|
89
|
+
*/
|
|
90
|
+
export function SelectIndicator(props: SelectIndicatorProps) {
|
|
91
|
+
const styles = select()
|
|
92
|
+
return (
|
|
93
|
+
<Select.Indicator
|
|
94
|
+
{...props}
|
|
95
|
+
className={cx(styles.indicator, props.className)}
|
|
96
|
+
/>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The trigger that clears the selected value.
|
|
102
|
+
*/
|
|
103
|
+
export function SelectClearTrigger(props: SelectClearTriggerProps) {
|
|
104
|
+
return <Select.ClearTrigger {...props} />
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The positioner that contains the dropdown.
|
|
109
|
+
*/
|
|
110
|
+
export function SelectPositioner(props: SelectPositionerProps) {
|
|
111
|
+
const styles = select()
|
|
112
|
+
return (
|
|
113
|
+
<Select.Positioner
|
|
114
|
+
{...props}
|
|
115
|
+
className={cx(styles.positioner, props.className)}
|
|
116
|
+
/>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The content of the dropdown (i.e. the container itself).
|
|
122
|
+
*/
|
|
123
|
+
export function SelectContent(props: SelectContentProps & SelectVariantProps) {
|
|
124
|
+
const { size, ...contentProps } = props
|
|
125
|
+
const styles = select({ size })
|
|
126
|
+
return (
|
|
127
|
+
<Select.Content
|
|
128
|
+
{...contentProps}
|
|
129
|
+
className={cx(styles.content, contentProps.className)}
|
|
130
|
+
/>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The container for a group of item options.
|
|
136
|
+
*/
|
|
137
|
+
export function SelectItemGroup(props: SelectItemGroupProps) {
|
|
138
|
+
return <Select.ItemGroup {...props} />
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The label for a group of item options.
|
|
143
|
+
*/
|
|
144
|
+
export function SelectItemGroupLabel(props: SelectItemGroupLabelProps) {
|
|
145
|
+
const styles = select()
|
|
146
|
+
return (
|
|
147
|
+
<Select.ItemGroupLabel
|
|
148
|
+
{...props}
|
|
149
|
+
className={cx(styles.itemGroupLabel, props.className)}
|
|
150
|
+
/>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The container for an item in the select content.
|
|
156
|
+
*/
|
|
157
|
+
export function SelectItem(props: SelectItemProps) {
|
|
158
|
+
const styles = select()
|
|
159
|
+
return <Select.Item {...props} className={cx(styles.item, props.className)} />
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The text for an item option.
|
|
164
|
+
*/
|
|
165
|
+
export function SelectItemText(props: SelectItemTextProps) {
|
|
166
|
+
return <Select.ItemText {...props} />
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* The indicator for an item option shown when it is selected.
|
|
171
|
+
*/
|
|
172
|
+
export function SelectItemIndicator(props: SelectItemIndicatorProps) {
|
|
173
|
+
const styles = select()
|
|
174
|
+
return (
|
|
175
|
+
<Select.ItemIndicator
|
|
176
|
+
{...props}
|
|
177
|
+
className={cx(styles.itemIndicator, props.className)}
|
|
178
|
+
/>
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* The native input for a select item.
|
|
184
|
+
*/
|
|
185
|
+
export function SelectHiddenSelect(props: SelectHiddenSelectProps) {
|
|
186
|
+
return <Select.HiddenSelect {...props} />
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* A helper function to create a SelectCollection object.
|
|
191
|
+
* @param collection - An array of SelectCollectionItem objects that matches
|
|
192
|
+
* the following shape:
|
|
193
|
+
* ```ts
|
|
194
|
+
* [{ label: 'Hades', value: 'hades', disabled?: true }]
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
export function createSelectCollection(
|
|
198
|
+
collection: SelectCollectionItem[],
|
|
199
|
+
): ListCollection<SelectCollectionItem> {
|
|
200
|
+
return createListCollection({
|
|
201
|
+
items: collection,
|
|
202
|
+
})
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export type { SelectValueChangeDetails, ListCollection }
|