@cerberus-design/react 0.15.0 → 0.16.0-next-feeb186
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/legacy/_tsup-dts-rollup.d.cts +1345 -319
- 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/cta-dialog/context.cjs +33 -0
- package/build/legacy/components/cta-dialog/context.cjs.map +1 -0
- package/build/legacy/components/cta-dialog/index.cjs +433 -0
- package/build/legacy/components/cta-dialog/index.cjs.map +1 -0
- package/build/legacy/{context/cta-modal.cjs → components/cta-dialog/provider.cjs} +175 -128
- package/build/legacy/components/cta-dialog/provider.cjs.map +1 -0
- package/build/legacy/components/cta-dialog/trigger-item.cjs +99 -0
- package/build/legacy/components/cta-dialog/trigger-item.cjs.map +1 -0
- package/build/legacy/components/cta-dialog/utils.cjs +47 -0
- package/build/legacy/components/cta-dialog/utils.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 +37 -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/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 +2023 -1466
- 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 +1345 -319
- 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-4LSTU6WU.js +8 -0
- package/build/modern/chunk-4LSTU6WU.js.map +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-6ICNCCPD.js +47 -0
- package/build/modern/chunk-6ICNCCPD.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-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-DXOKSZVQ.js +12 -0
- package/build/modern/chunk-DXOKSZVQ.js.map +1 -0
- 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-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-IKDXADLX.js +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-MVO2GNUA.js +47 -0
- package/build/modern/chunk-MVO2GNUA.js.map +1 -0
- package/build/modern/{chunk-3BM6MZ4A.js → chunk-MWRO5QYD.js} +1 -1
- package/build/modern/chunk-MWRO5QYD.js.map +1 -0
- package/build/modern/{chunk-SD3OVTHT.js → chunk-O542MPR7.js} +40 -43
- package/build/modern/chunk-O542MPR7.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-PLHYOCY3.js +23 -0
- package/build/modern/chunk-PLHYOCY3.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-FGCO27TC.js → chunk-QEM3M4N3.js} +25 -34
- package/build/modern/chunk-QEM3M4N3.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-JAROS4Q3.js → chunk-Z4342DRO.js} +10 -10
- package/build/modern/chunk-Z4342DRO.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-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/cta-dialog/context.js +8 -0
- package/build/modern/components/cta-dialog/index.js +26 -0
- package/build/modern/components/cta-dialog/provider.js +22 -0
- package/build/modern/components/cta-dialog/provider.js.map +1 -0
- package/build/modern/components/cta-dialog/trigger-item.js +10 -0
- package/build/modern/components/cta-dialog/trigger-item.js.map +1 -0
- package/build/modern/components/cta-dialog/utils.js +7 -0
- package/build/modern/components/cta-dialog/utils.js.map +1 -0
- package/build/modern/components/deprecated/FieldMessage.js +8 -0
- package/build/modern/components/deprecated/FieldMessage.js.map +1 -0
- package/build/modern/components/deprecated/FieldsetLabel.js +7 -0
- package/build/modern/components/deprecated/FieldsetLabel.js.map +1 -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/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 +13 -7
- 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 +304 -129
- 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/cta-dialog/context.tsx +34 -0
- package/src/components/cta-dialog/index.ts +2 -0
- package/src/{context/cta-modal.tsx → components/cta-dialog/provider.tsx} +34 -68
- package/src/components/cta-dialog/trigger-item.tsx +53 -0
- package/src/components/cta-dialog/utils.ts +57 -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 +38 -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/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 +24 -24
- 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/legacy/context/cta-modal.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/build/modern/context/cta-modal.js +0 -18
- 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/{components/Fieldset.js.map → chunk-IKDXADLX.js.map} +0 -0
- /package/build/modern/{chunk-EDARV2EI.js.map → chunk-MISIUX63.js.map} +0 -0
- /package/build/modern/{components/FieldsetLabel.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/Input.js.map → chunk-TIJAFPHQ.js.map} +0 -0
- /package/build/modern/{components/Label.js.map → chunk-TYPULJMJ.js.map} +0 -0
- /package/build/modern/{components/Modal.js.map → chunk-UDY6USHW.js.map} +0 -0
- /package/build/modern/{components/ModalDescription.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/{ModalHeader.js.map → button/button.js.map} +0 -0
- /package/build/modern/components/{ModalHeading.js.map → button/index.js.map} +0 -0
- /package/build/modern/components/{NavMenuLink.js.map → button/parts.js.map} +0 -0
- /package/build/modern/components/{NavMenuList.js.map → checkbox/checkbox-icon.js.map} +0 -0
- /package/build/modern/components/{NavMenuTrigger.js.map → checkbox/checkbox.js.map} +0 -0
- /package/build/modern/components/{Radio.js.map → checkbox/index.js.map} +0 -0
- /package/build/modern/components/{Select.js.map → checkbox/parts.js.map} +0 -0
- /package/build/modern/components/{Textarea.js.map → checkbox/primitives.js.map} +0 -0
- /package/build/modern/components/{Toggle.js.map → cta-dialog/context.js.map} +0 -0
- /package/build/modern/{context/cta-modal.js.map → components/cta-dialog/index.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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/checkbox/checkbox-icon.tsx","../../../../src/context/cerberus.tsx","../../../../src/components/checkbox/primitives.tsx","../../../../src/components/checkbox/parts.ts","../../../../src/components/Show.tsx"],"sourcesContent":["'use client'\n\nimport { useCerberusContext } from '../../context/cerberus'\nimport { CheckboxParts } from './parts'\nimport { Show } from '../Show'\n\n/**\n * This module contains the Checkbox Icon component.\n * @module\n */\n\ninterface CheckboxIconProps {\n indeterminate?: boolean\n}\n\n/**\n * Checkbox component\n * @definition [ARIA Target Size](https://www.w3.org/WAI/WCAG21/Understanding/target-size.html#:~:text=Understanding%20SC%202.5.,%3ATarget%20Size%20(Level%20AAA)&text=The%20size%20of%20the%20target,Equivalent)\n * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)\n * @see https://cerberus.digitalu.design/react/checkbox\n * @example\n * ```tsx\n * <Field>\n * <Checkbox id=\"legal\" checked={checked.legal} onChange={handleChange} />\n * </Field>\n * ```\n */\nexport function CheckboxIcon(props: CheckboxIconProps) {\n const { icons } = useCerberusContext()\n const { checkbox: CheckIcon, indeterminate: IndeterminateIcon } = icons\n\n return (\n <CheckboxParts.Indicator indeterminate={props.indeterminate}>\n <Show when={props.indeterminate} fallback={<CheckIcon />}>\n <IndeterminateIcon />\n </Show>\n </CheckboxParts.Indicator>\n )\n}\n","'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\nimport type { SystemConfig } from '../config'\n\n/**\n * This module contains the Cerberus configuration context and helpers.\n * @module context/cerberus\n */\n\ntype CerberusContextValue = SystemConfig\n\nconst CerberusContext = createContext<CerberusContextValue | null>(null)\n\ninterface CerberusProviderProps {\n config: SystemConfig\n}\n\n/**\n * Cerberus configuration provider.\n * @param props.config The Cerberus configuration created with\n * `makeSystemConfig` helper.\n */\nexport function CerberusProvider(\n props: PropsWithChildren<CerberusProviderProps>,\n) {\n return (\n <CerberusContext.Provider value={props.config}>\n {props.children}\n </CerberusContext.Provider>\n )\n}\n\n/**\n * Returns the Cerberus configuration context.\n * @returns The Cerberus configuration context.\n */\nexport function useCerberusContext() {\n const context = useContext(CerberusContext)\n if (!context) {\n throw new Error('useCerberus must be used within a CerberusProvider')\n }\n return context\n}\n","import {\n Checkbox,\n type CheckboxControlProps,\n type CheckboxGroupProps,\n type CheckboxIndicatorProps,\n type CheckboxLabelProps,\n type CheckboxRootProps,\n} from '@ark-ui/react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n checkbox,\n type CheckboxVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Checkbox primitives.\n * @module 'react/checkbox'\n */\n\n/**\n * Checkbox Root component used to provide the context to all other checkbox\n * primitives.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxRoot(props: CheckboxRootProps) {\n const styles = checkbox()\n return (\n <Checkbox.Root {...props} className={cx(styles.root, props.className)} />\n )\n}\n\n/**\n * Checkbox Label component used to display the label of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxLabel(\n props: CheckboxLabelProps & CheckboxVariantProps,\n) {\n const { size, ...labelProps } = props\n const styles = checkbox({ size })\n return (\n <Checkbox.Label\n {...labelProps}\n className={cx(styles.label, labelProps.className)}\n />\n )\n}\n\n/**\n * Checkbox Control component used to display the control of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxControl(\n props: CheckboxControlProps & CheckboxVariantProps,\n) {\n const { size, ...controlProps } = props\n const styles = checkbox({ size })\n return (\n <Checkbox.Control\n {...controlProps}\n className={cx(styles.control, controlProps.className)}\n />\n )\n}\n\n/**\n * Checkbox Indicator component used to display the indicator of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxIndicator(props: CheckboxIndicatorProps) {\n const styles = checkbox()\n return (\n <Checkbox.Indicator\n {...props}\n className={cx(styles.indicator, props.className)}\n />\n )\n}\n\n/**\n * Checkbox HiddenInput component used to provide the native checkbox input.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxHiddenInput(props: CheckboxControlProps) {\n return <Checkbox.HiddenInput {...props} />\n}\n\n/**\n * Checkbox Group is used to group checkboxes together in a consistently styled\n * way.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxGroup(props: CheckboxGroupProps) {\n const styles = checkbox()\n return (\n <Checkbox.Group {...props} className={cx(styles.group, props.className)} />\n )\n}\n","import type { ElementType } from 'react'\nimport {\n CheckboxRoot,\n CheckboxLabel,\n CheckboxControl,\n CheckboxIndicator,\n CheckboxHiddenInput,\n CheckboxGroup,\n} from './primitives'\n\n/**\n * This module contains the parts of the Field component.\n * @module 'field/parts'\n */\n\ninterface CheckboxPartsValue {\n /**\n * The container of the field.\n */\n Root: ElementType\n /**\n * The label of the field.\n */\n Label: ElementType\n /**\n * The control of the field.\n */\n Control: ElementType\n /**\n * The indicator of the field.\n */\n Indicator: ElementType\n /**\n * The hidden input of the field.\n */\n HiddenInput: ElementType\n /**\n * The checkbox group component.\n */\n Group: ElementType\n}\n\n/**\n * An Object containing the parts of the Checkbox component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the CheckboxParts object and\n * the entire family of components vs. only what you use.\n */\nexport const CheckboxParts: CheckboxPartsValue = {\n Root: CheckboxRoot,\n Label: CheckboxLabel,\n Control: CheckboxControl,\n Indicator: CheckboxIndicator,\n HiddenInput: CheckboxHiddenInput,\n Group: CheckboxGroup,\n}\n","'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\n/**\n * This module contains the Show component.\n * @module\n */\n\nexport interface ShowProps {\n /**\n * The condition to render memoized children or the fallback content.\n */\n when: boolean | null | undefined\n /**\n * The children to render when the condition is false.\n */\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render a memoized version of the children or optional fallback\n * content.\n * @see https://cerberus.digitalu.design/react/show\n * @example\n * ```tsx\n * <Show when={isLoggedIn} fallback={<Navigate to=\"/login\" />}>\n * <Dashboard />\n * </Show>\n */\nexport function Show(props: PropsWithChildren<ShowProps>): ReactNode {\n const { when, children, fallback } = props\n const condition = useMemo(() => when ?? false, [when])\n\n return useMemo(() => {\n if (condition) return children\n return fallback ?? null\n }, [condition, children, fallback])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,mBAAkE;AAyB9D;AAfJ,IAAM,sBAAkB,4BAA2C,IAAI;AAyBhE,SAAS,qBAAqB;AACnC,QAAM,cAAU,yBAAW,eAAe;AAC1C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACtE;AACA,SAAO;AACT;;;AC3CA,IAAAA,gBAOO;AACP,iBAAmB;AACnB,qBAGO;AAgBH,IAAAC,sBAAA;AAHG,SAAS,aAAa,OAA0B;AACrD,QAAM,aAAS,yBAAS;AACxB,SACE,6CAAC,uBAAS,MAAT,EAAe,GAAG,OAAO,eAAW,eAAG,OAAO,MAAM,MAAM,SAAS,GAAG;AAE3E;AAOO,SAAS,cACd,OACA;AACA,QAAM,EAAE,MAAM,GAAG,WAAW,IAAI;AAChC,QAAM,aAAS,yBAAS,EAAE,KAAK,CAAC;AAChC,SACE;AAAA,IAAC,uBAAS;AAAA,IAAT;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,OAAO,WAAW,SAAS;AAAA;AAAA,EAClD;AAEJ;AAOO,SAAS,gBACd,OACA;AACA,QAAM,EAAE,MAAM,GAAG,aAAa,IAAI;AAClC,QAAM,aAAS,yBAAS,EAAE,KAAK,CAAC;AAChC,SACE;AAAA,IAAC,uBAAS;AAAA,IAAT;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,SAAS,aAAa,SAAS;AAAA;AAAA,EACtD;AAEJ;AAOO,SAAS,kBAAkB,OAA+B;AAC/D,QAAM,aAAS,yBAAS;AACxB,SACE;AAAA,IAAC,uBAAS;AAAA,IAAT;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,WAAW,MAAM,SAAS;AAAA;AAAA,EACjD;AAEJ;AAOO,SAAS,oBAAoB,OAA6B;AAC/D,SAAO,6CAAC,uBAAS,aAAT,EAAsB,GAAG,OAAO;AAC1C;AAQO,SAAS,cAAc,OAA2B;AACvD,QAAM,aAAS,yBAAS;AACxB,SACE,6CAAC,uBAAS,OAAT,EAAgB,GAAG,OAAO,eAAW,eAAG,OAAO,OAAO,MAAM,SAAS,GAAG;AAE7E;;;ACpDO,IAAM,gBAAoC;AAAA,EAC/C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AAAA,EACb,OAAO;AACT;;;ACxDA,IAAAC,gBAAgE;AA4BzD,SAAS,KAAK,OAAgD;AACnE,QAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,QAAM,gBAAY,uBAAQ,MAAM,QAAQ,OAAO,CAAC,IAAI,CAAC;AAErD,aAAO,uBAAQ,MAAM;AACnB,QAAI,UAAW,QAAO;AACtB,WAAO,YAAY;AAAA,EACrB,GAAG,CAAC,WAAW,UAAU,QAAQ,CAAC;AACpC;;;AJLiD,IAAAC,sBAAA;AAN1C,SAAS,aAAa,OAA0B;AACrD,QAAM,EAAE,MAAM,IAAI,mBAAmB;AACrC,QAAM,EAAE,UAAU,WAAW,eAAe,kBAAkB,IAAI;AAElE,SACE,6CAAC,cAAc,WAAd,EAAwB,eAAe,MAAM,eAC5C,uDAAC,QAAK,MAAM,MAAM,eAAe,UAAU,6CAAC,aAAU,GACpD,uDAAC,qBAAkB,GACrB,GACF;AAEJ;","names":["import_react","import_jsx_runtime","import_react","import_jsx_runtime"]}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/checkbox/checkbox.tsx
|
|
21
|
+
var checkbox_exports = {};
|
|
22
|
+
__export(checkbox_exports, {
|
|
23
|
+
Checkbox: () => Checkbox2
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(checkbox_exports);
|
|
26
|
+
|
|
27
|
+
// src/components/Show.tsx
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
function Show(props) {
|
|
30
|
+
const { when, children, fallback } = props;
|
|
31
|
+
const condition = (0, import_react.useMemo)(() => when ?? false, [when]);
|
|
32
|
+
return (0, import_react.useMemo)(() => {
|
|
33
|
+
if (condition) return children;
|
|
34
|
+
return fallback ?? null;
|
|
35
|
+
}, [condition, children, fallback]);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/components/Text.tsx
|
|
39
|
+
var import_jsx = require("@cerberus/styled-system/jsx");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
function Text(props) {
|
|
42
|
+
const { as = "p", ...pandaJSXProps } = props;
|
|
43
|
+
switch (as) {
|
|
44
|
+
case "h1":
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H1, { ...pandaJSXProps });
|
|
46
|
+
case "h2":
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H2, { ...pandaJSXProps });
|
|
48
|
+
case "h3":
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H3, { ...pandaJSXProps });
|
|
50
|
+
case "h4":
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H4, { ...pandaJSXProps });
|
|
52
|
+
case "h5":
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H5, { ...pandaJSXProps });
|
|
54
|
+
case "h6":
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H6, { ...pandaJSXProps });
|
|
56
|
+
case "strong":
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.Strong, { ...pandaJSXProps });
|
|
58
|
+
case "em":
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.Em, { ...pandaJSXProps });
|
|
60
|
+
case "small":
|
|
61
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.Small, { ...pandaJSXProps });
|
|
62
|
+
case "span":
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.Span, { ...pandaJSXProps });
|
|
64
|
+
default:
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.P, { ...pandaJSXProps });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/components/checkbox/primitives.tsx
|
|
70
|
+
var import_react2 = require("@ark-ui/react");
|
|
71
|
+
var import_css = require("@cerberus/styled-system/css");
|
|
72
|
+
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
73
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
74
|
+
function CheckboxRoot(props) {
|
|
75
|
+
const styles = (0, import_recipes.checkbox)();
|
|
76
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.Checkbox.Root, { ...props, className: (0, import_css.cx)(styles.root, props.className) });
|
|
77
|
+
}
|
|
78
|
+
function CheckboxLabel(props) {
|
|
79
|
+
const { size, ...labelProps } = props;
|
|
80
|
+
const styles = (0, import_recipes.checkbox)({ size });
|
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
82
|
+
import_react2.Checkbox.Label,
|
|
83
|
+
{
|
|
84
|
+
...labelProps,
|
|
85
|
+
className: (0, import_css.cx)(styles.label, labelProps.className)
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function CheckboxControl(props) {
|
|
90
|
+
const { size, ...controlProps } = props;
|
|
91
|
+
const styles = (0, import_recipes.checkbox)({ size });
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
93
|
+
import_react2.Checkbox.Control,
|
|
94
|
+
{
|
|
95
|
+
...controlProps,
|
|
96
|
+
className: (0, import_css.cx)(styles.control, controlProps.className)
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
function CheckboxIndicator(props) {
|
|
101
|
+
const styles = (0, import_recipes.checkbox)();
|
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
103
|
+
import_react2.Checkbox.Indicator,
|
|
104
|
+
{
|
|
105
|
+
...props,
|
|
106
|
+
className: (0, import_css.cx)(styles.indicator, props.className)
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
function CheckboxHiddenInput(props) {
|
|
111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.Checkbox.HiddenInput, { ...props });
|
|
112
|
+
}
|
|
113
|
+
function CheckboxGroup(props) {
|
|
114
|
+
const styles = (0, import_recipes.checkbox)();
|
|
115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.Checkbox.Group, { ...props, className: (0, import_css.cx)(styles.group, props.className) });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// src/components/checkbox/parts.ts
|
|
119
|
+
var CheckboxParts = {
|
|
120
|
+
Root: CheckboxRoot,
|
|
121
|
+
Label: CheckboxLabel,
|
|
122
|
+
Control: CheckboxControl,
|
|
123
|
+
Indicator: CheckboxIndicator,
|
|
124
|
+
HiddenInput: CheckboxHiddenInput,
|
|
125
|
+
Group: CheckboxGroup
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// src/context/cerberus.tsx
|
|
129
|
+
var import_react3 = require("react");
|
|
130
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
131
|
+
var CerberusContext = (0, import_react3.createContext)(null);
|
|
132
|
+
function useCerberusContext() {
|
|
133
|
+
const context = (0, import_react3.useContext)(CerberusContext);
|
|
134
|
+
if (!context) {
|
|
135
|
+
throw new Error("useCerberus must be used within a CerberusProvider");
|
|
136
|
+
}
|
|
137
|
+
return context;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// src/components/checkbox/checkbox-icon.tsx
|
|
141
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
142
|
+
function CheckboxIcon(props) {
|
|
143
|
+
const { icons } = useCerberusContext();
|
|
144
|
+
const { checkbox: CheckIcon, indeterminate: IndeterminateIcon } = icons;
|
|
145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CheckboxParts.Indicator, { indeterminate: props.indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Show, { when: props.indeterminate, fallback: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CheckIcon, {}), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IndeterminateIcon, {}) }) });
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// src/components/checkbox/checkbox.tsx
|
|
149
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
150
|
+
function Checkbox2(props) {
|
|
151
|
+
const { size, children, ...rootProps } = props;
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(CheckboxParts.Root, { ...rootProps, children: [
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckboxParts.Control, { size, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckboxIcon, { indeterminate: rootProps.checked === "indeterminate" }) }),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(CheckboxParts.Label, { size, children: [
|
|
155
|
+
children,
|
|
156
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Show, { when: props.required, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { as: "span", "data-part": "required-indicator", children: "(required)" }) })
|
|
157
|
+
] }),
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckboxParts.HiddenInput, {})
|
|
159
|
+
] });
|
|
160
|
+
}
|
|
161
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
162
|
+
0 && (module.exports = {
|
|
163
|
+
Checkbox
|
|
164
|
+
});
|
|
165
|
+
//# sourceMappingURL=checkbox.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/checkbox/checkbox.tsx","../../../../src/components/Show.tsx","../../../../src/components/Text.tsx","../../../../src/components/checkbox/primitives.tsx","../../../../src/components/checkbox/parts.ts","../../../../src/context/cerberus.tsx","../../../../src/components/checkbox/checkbox-icon.tsx"],"sourcesContent":["import type { CheckboxRootProps } from '@ark-ui/react'\nimport { type CheckboxVariantProps } from '@cerberus/styled-system/recipes'\nimport { Show } from '../Show'\nimport { Text } from '../Text'\nimport { CheckboxParts } from './parts'\nimport { CheckboxIcon } from './checkbox-icon'\n\n/**\n * This module contains the Checkbox component.\n * @module\n */\n\nexport type CheckboxProps = CheckboxVariantProps & CheckboxRootProps\n\n/**\n * Checkbox component is an abstraction of the primitives that displays a\n * controlled checkbox with a label.\n * @description [Cerberus Docs] https://cerberus.digitalu.design/react/checkbox\n * @description [Ark Docs] https://ark-ui.com/docs/components/checkbox\n */\nexport function Checkbox(props: CheckboxProps) {\n const { size, children, ...rootProps } = props\n\n return (\n <CheckboxParts.Root {...rootProps}>\n <CheckboxParts.Control size={size}>\n <CheckboxIcon indeterminate={rootProps.checked === 'indeterminate'} />\n </CheckboxParts.Control>\n\n <CheckboxParts.Label size={size}>\n {children}\n <Show when={props.required}>\n <Text as=\"span\" data-part=\"required-indicator\">\n (required)\n </Text>\n </Show>\n </CheckboxParts.Label>\n\n <CheckboxParts.HiddenInput />\n </CheckboxParts.Root>\n )\n}\n","'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\n/**\n * This module contains the Show component.\n * @module\n */\n\nexport interface ShowProps {\n /**\n * The condition to render memoized children or the fallback content.\n */\n when: boolean | null | undefined\n /**\n * The children to render when the condition is false.\n */\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render a memoized version of the children or optional fallback\n * content.\n * @see https://cerberus.digitalu.design/react/show\n * @example\n * ```tsx\n * <Show when={isLoggedIn} fallback={<Navigate to=\"/login\" />}>\n * <Dashboard />\n * </Show>\n */\nexport function Show(props: PropsWithChildren<ShowProps>): ReactNode {\n const { when, children, fallback } = props\n const condition = useMemo(() => when ?? false, [when])\n\n return useMemo(() => {\n if (condition) return children\n return fallback ?? null\n }, [condition, children, fallback])\n}\n","import {\n Em,\n H1,\n H2,\n H3,\n H4,\n H5,\n H6,\n P,\n Small,\n Span,\n Strong,\n type PProps,\n} from '@cerberus/styled-system/jsx'\nimport { type HTMLAttributes, type PropsWithChildren } from 'react'\n\n/**\n * This module exports a component for rendering text utilizing the styled-system JSX utility.\n * @module @cerberus/react/Text\n */\n\nexport type Headings = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\nexport type TextElements = 'p' | 'strong' | 'em' | 'small' | 'span'\n\n// For some reason we have to use the HTMLParagraphElement type here\n// or else TS will fail for non-style props like 'id' or 'className'\nexport interface TextProps\n extends PProps,\n HTMLAttributes<HTMLParagraphElement> {\n /**\n * The element to render as. Defaults to 'p'.\n */\n as?: TextElements | Headings\n}\n\n/**\n * A component for rendering text utilizing the styled-system JSX utility.\n * @definition [Text docs](https://cerberus.digitalu.design/react/text)\n * @example\n * ```tsx\n * <Text as=\"h1\" color=\"page.text.100\" textStyle={{\n * base: 'heading-md',\n * md: 'heading-lg',\n * }}>\n * Hello, world!\n * </Text>\n */\nexport function Text(props: PropsWithChildren<TextProps>) {\n const { as = 'p', ...pandaJSXProps } = props\n switch (as) {\n case 'h1':\n return <H1 {...pandaJSXProps} />\n case 'h2':\n return <H2 {...pandaJSXProps} />\n case 'h3':\n return <H3 {...pandaJSXProps} />\n case 'h4':\n return <H4 {...pandaJSXProps} />\n case 'h5':\n return <H5 {...pandaJSXProps} />\n case 'h6':\n return <H6 {...pandaJSXProps} />\n case 'strong':\n return <Strong {...pandaJSXProps} />\n case 'em':\n return <Em {...pandaJSXProps} />\n case 'small':\n return <Small {...pandaJSXProps} />\n case 'span':\n return <Span {...pandaJSXProps} />\n default:\n return <P {...pandaJSXProps} />\n }\n}\n","import {\n Checkbox,\n type CheckboxControlProps,\n type CheckboxGroupProps,\n type CheckboxIndicatorProps,\n type CheckboxLabelProps,\n type CheckboxRootProps,\n} from '@ark-ui/react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n checkbox,\n type CheckboxVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Checkbox primitives.\n * @module 'react/checkbox'\n */\n\n/**\n * Checkbox Root component used to provide the context to all other checkbox\n * primitives.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxRoot(props: CheckboxRootProps) {\n const styles = checkbox()\n return (\n <Checkbox.Root {...props} className={cx(styles.root, props.className)} />\n )\n}\n\n/**\n * Checkbox Label component used to display the label of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxLabel(\n props: CheckboxLabelProps & CheckboxVariantProps,\n) {\n const { size, ...labelProps } = props\n const styles = checkbox({ size })\n return (\n <Checkbox.Label\n {...labelProps}\n className={cx(styles.label, labelProps.className)}\n />\n )\n}\n\n/**\n * Checkbox Control component used to display the control of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxControl(\n props: CheckboxControlProps & CheckboxVariantProps,\n) {\n const { size, ...controlProps } = props\n const styles = checkbox({ size })\n return (\n <Checkbox.Control\n {...controlProps}\n className={cx(styles.control, controlProps.className)}\n />\n )\n}\n\n/**\n * Checkbox Indicator component used to display the indicator of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxIndicator(props: CheckboxIndicatorProps) {\n const styles = checkbox()\n return (\n <Checkbox.Indicator\n {...props}\n className={cx(styles.indicator, props.className)}\n />\n )\n}\n\n/**\n * Checkbox HiddenInput component used to provide the native checkbox input.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxHiddenInput(props: CheckboxControlProps) {\n return <Checkbox.HiddenInput {...props} />\n}\n\n/**\n * Checkbox Group is used to group checkboxes together in a consistently styled\n * way.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxGroup(props: CheckboxGroupProps) {\n const styles = checkbox()\n return (\n <Checkbox.Group {...props} className={cx(styles.group, props.className)} />\n )\n}\n","import type { ElementType } from 'react'\nimport {\n CheckboxRoot,\n CheckboxLabel,\n CheckboxControl,\n CheckboxIndicator,\n CheckboxHiddenInput,\n CheckboxGroup,\n} from './primitives'\n\n/**\n * This module contains the parts of the Field component.\n * @module 'field/parts'\n */\n\ninterface CheckboxPartsValue {\n /**\n * The container of the field.\n */\n Root: ElementType\n /**\n * The label of the field.\n */\n Label: ElementType\n /**\n * The control of the field.\n */\n Control: ElementType\n /**\n * The indicator of the field.\n */\n Indicator: ElementType\n /**\n * The hidden input of the field.\n */\n HiddenInput: ElementType\n /**\n * The checkbox group component.\n */\n Group: ElementType\n}\n\n/**\n * An Object containing the parts of the Checkbox component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the CheckboxParts object and\n * the entire family of components vs. only what you use.\n */\nexport const CheckboxParts: CheckboxPartsValue = {\n Root: CheckboxRoot,\n Label: CheckboxLabel,\n Control: CheckboxControl,\n Indicator: CheckboxIndicator,\n HiddenInput: CheckboxHiddenInput,\n Group: CheckboxGroup,\n}\n","'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\nimport type { SystemConfig } from '../config'\n\n/**\n * This module contains the Cerberus configuration context and helpers.\n * @module context/cerberus\n */\n\ntype CerberusContextValue = SystemConfig\n\nconst CerberusContext = createContext<CerberusContextValue | null>(null)\n\ninterface CerberusProviderProps {\n config: SystemConfig\n}\n\n/**\n * Cerberus configuration provider.\n * @param props.config The Cerberus configuration created with\n * `makeSystemConfig` helper.\n */\nexport function CerberusProvider(\n props: PropsWithChildren<CerberusProviderProps>,\n) {\n return (\n <CerberusContext.Provider value={props.config}>\n {props.children}\n </CerberusContext.Provider>\n )\n}\n\n/**\n * Returns the Cerberus configuration context.\n * @returns The Cerberus configuration context.\n */\nexport function useCerberusContext() {\n const context = useContext(CerberusContext)\n if (!context) {\n throw new Error('useCerberus must be used within a CerberusProvider')\n }\n return context\n}\n","'use client'\n\nimport { useCerberusContext } from '../../context/cerberus'\nimport { CheckboxParts } from './parts'\nimport { Show } from '../Show'\n\n/**\n * This module contains the Checkbox Icon component.\n * @module\n */\n\ninterface CheckboxIconProps {\n indeterminate?: boolean\n}\n\n/**\n * Checkbox component\n * @definition [ARIA Target Size](https://www.w3.org/WAI/WCAG21/Understanding/target-size.html#:~:text=Understanding%20SC%202.5.,%3ATarget%20Size%20(Level%20AAA)&text=The%20size%20of%20the%20target,Equivalent)\n * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)\n * @see https://cerberus.digitalu.design/react/checkbox\n * @example\n * ```tsx\n * <Field>\n * <Checkbox id=\"legal\" checked={checked.legal} onChange={handleChange} />\n * </Field>\n * ```\n */\nexport function CheckboxIcon(props: CheckboxIconProps) {\n const { icons } = useCerberusContext()\n const { checkbox: CheckIcon, indeterminate: IndeterminateIcon } = icons\n\n return (\n <CheckboxParts.Indicator indeterminate={props.indeterminate}>\n <Show when={props.indeterminate} fallback={<CheckIcon />}>\n <IndeterminateIcon />\n </Show>\n </CheckboxParts.Indicator>\n )\n}\n"],"mappings":"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","names":["Checkbox","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","Checkbox"]}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/checkbox/index.ts
|
|
21
|
+
var checkbox_exports = {};
|
|
22
|
+
__export(checkbox_exports, {
|
|
23
|
+
Checkbox: () => Checkbox2,
|
|
24
|
+
CheckboxControl: () => CheckboxControl,
|
|
25
|
+
CheckboxGroup: () => CheckboxGroup,
|
|
26
|
+
CheckboxHiddenInput: () => CheckboxHiddenInput,
|
|
27
|
+
CheckboxIndicator: () => CheckboxIndicator,
|
|
28
|
+
CheckboxLabel: () => CheckboxLabel,
|
|
29
|
+
CheckboxParts: () => CheckboxParts,
|
|
30
|
+
CheckboxRoot: () => CheckboxRoot
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(checkbox_exports);
|
|
33
|
+
|
|
34
|
+
// src/components/Show.tsx
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
function Show(props) {
|
|
37
|
+
const { when, children, fallback } = props;
|
|
38
|
+
const condition = (0, import_react.useMemo)(() => when ?? false, [when]);
|
|
39
|
+
return (0, import_react.useMemo)(() => {
|
|
40
|
+
if (condition) return children;
|
|
41
|
+
return fallback ?? null;
|
|
42
|
+
}, [condition, children, fallback]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/components/Text.tsx
|
|
46
|
+
var import_jsx = require("@cerberus/styled-system/jsx");
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
|
+
function Text(props) {
|
|
49
|
+
const { as = "p", ...pandaJSXProps } = props;
|
|
50
|
+
switch (as) {
|
|
51
|
+
case "h1":
|
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H1, { ...pandaJSXProps });
|
|
53
|
+
case "h2":
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H2, { ...pandaJSXProps });
|
|
55
|
+
case "h3":
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H3, { ...pandaJSXProps });
|
|
57
|
+
case "h4":
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H4, { ...pandaJSXProps });
|
|
59
|
+
case "h5":
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H5, { ...pandaJSXProps });
|
|
61
|
+
case "h6":
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.H6, { ...pandaJSXProps });
|
|
63
|
+
case "strong":
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.Strong, { ...pandaJSXProps });
|
|
65
|
+
case "em":
|
|
66
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.Em, { ...pandaJSXProps });
|
|
67
|
+
case "small":
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.Small, { ...pandaJSXProps });
|
|
69
|
+
case "span":
|
|
70
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.Span, { ...pandaJSXProps });
|
|
71
|
+
default:
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx.P, { ...pandaJSXProps });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src/components/checkbox/primitives.tsx
|
|
77
|
+
var import_react2 = require("@ark-ui/react");
|
|
78
|
+
var import_css = require("@cerberus/styled-system/css");
|
|
79
|
+
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
80
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
81
|
+
function CheckboxRoot(props) {
|
|
82
|
+
const styles = (0, import_recipes.checkbox)();
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.Checkbox.Root, { ...props, className: (0, import_css.cx)(styles.root, props.className) });
|
|
84
|
+
}
|
|
85
|
+
function CheckboxLabel(props) {
|
|
86
|
+
const { size, ...labelProps } = props;
|
|
87
|
+
const styles = (0, import_recipes.checkbox)({ size });
|
|
88
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
89
|
+
import_react2.Checkbox.Label,
|
|
90
|
+
{
|
|
91
|
+
...labelProps,
|
|
92
|
+
className: (0, import_css.cx)(styles.label, labelProps.className)
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
function CheckboxControl(props) {
|
|
97
|
+
const { size, ...controlProps } = props;
|
|
98
|
+
const styles = (0, import_recipes.checkbox)({ size });
|
|
99
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
100
|
+
import_react2.Checkbox.Control,
|
|
101
|
+
{
|
|
102
|
+
...controlProps,
|
|
103
|
+
className: (0, import_css.cx)(styles.control, controlProps.className)
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
function CheckboxIndicator(props) {
|
|
108
|
+
const styles = (0, import_recipes.checkbox)();
|
|
109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
110
|
+
import_react2.Checkbox.Indicator,
|
|
111
|
+
{
|
|
112
|
+
...props,
|
|
113
|
+
className: (0, import_css.cx)(styles.indicator, props.className)
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
function CheckboxHiddenInput(props) {
|
|
118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.Checkbox.HiddenInput, { ...props });
|
|
119
|
+
}
|
|
120
|
+
function CheckboxGroup(props) {
|
|
121
|
+
const styles = (0, import_recipes.checkbox)();
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.Checkbox.Group, { ...props, className: (0, import_css.cx)(styles.group, props.className) });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// src/components/checkbox/parts.ts
|
|
126
|
+
var CheckboxParts = {
|
|
127
|
+
Root: CheckboxRoot,
|
|
128
|
+
Label: CheckboxLabel,
|
|
129
|
+
Control: CheckboxControl,
|
|
130
|
+
Indicator: CheckboxIndicator,
|
|
131
|
+
HiddenInput: CheckboxHiddenInput,
|
|
132
|
+
Group: CheckboxGroup
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// src/context/cerberus.tsx
|
|
136
|
+
var import_react3 = require("react");
|
|
137
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
138
|
+
var CerberusContext = (0, import_react3.createContext)(null);
|
|
139
|
+
function useCerberusContext() {
|
|
140
|
+
const context = (0, import_react3.useContext)(CerberusContext);
|
|
141
|
+
if (!context) {
|
|
142
|
+
throw new Error("useCerberus must be used within a CerberusProvider");
|
|
143
|
+
}
|
|
144
|
+
return context;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// src/components/checkbox/checkbox-icon.tsx
|
|
148
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
149
|
+
function CheckboxIcon(props) {
|
|
150
|
+
const { icons } = useCerberusContext();
|
|
151
|
+
const { checkbox: CheckIcon, indeterminate: IndeterminateIcon } = icons;
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CheckboxParts.Indicator, { indeterminate: props.indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Show, { when: props.indeterminate, fallback: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CheckIcon, {}), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IndeterminateIcon, {}) }) });
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// src/components/checkbox/checkbox.tsx
|
|
156
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
157
|
+
function Checkbox2(props) {
|
|
158
|
+
const { size, children, ...rootProps } = props;
|
|
159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(CheckboxParts.Root, { ...rootProps, children: [
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckboxParts.Control, { size, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckboxIcon, { indeterminate: rootProps.checked === "indeterminate" }) }),
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(CheckboxParts.Label, { size, children: [
|
|
162
|
+
children,
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Show, { when: props.required, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { as: "span", "data-part": "required-indicator", children: "(required)" }) })
|
|
164
|
+
] }),
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckboxParts.HiddenInput, {})
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
169
|
+
0 && (module.exports = {
|
|
170
|
+
Checkbox,
|
|
171
|
+
CheckboxControl,
|
|
172
|
+
CheckboxGroup,
|
|
173
|
+
CheckboxHiddenInput,
|
|
174
|
+
CheckboxIndicator,
|
|
175
|
+
CheckboxLabel,
|
|
176
|
+
CheckboxParts,
|
|
177
|
+
CheckboxRoot
|
|
178
|
+
});
|
|
179
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/checkbox/index.ts","../../../../src/components/Show.tsx","../../../../src/components/Text.tsx","../../../../src/components/checkbox/primitives.tsx","../../../../src/components/checkbox/parts.ts","../../../../src/context/cerberus.tsx","../../../../src/components/checkbox/checkbox-icon.tsx","../../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["export * from './checkbox'\nexport * from './parts'\nexport * from './primitives'\n","'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\n/**\n * This module contains the Show component.\n * @module\n */\n\nexport interface ShowProps {\n /**\n * The condition to render memoized children or the fallback content.\n */\n when: boolean | null | undefined\n /**\n * The children to render when the condition is false.\n */\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render a memoized version of the children or optional fallback\n * content.\n * @see https://cerberus.digitalu.design/react/show\n * @example\n * ```tsx\n * <Show when={isLoggedIn} fallback={<Navigate to=\"/login\" />}>\n * <Dashboard />\n * </Show>\n */\nexport function Show(props: PropsWithChildren<ShowProps>): ReactNode {\n const { when, children, fallback } = props\n const condition = useMemo(() => when ?? false, [when])\n\n return useMemo(() => {\n if (condition) return children\n return fallback ?? null\n }, [condition, children, fallback])\n}\n","import {\n Em,\n H1,\n H2,\n H3,\n H4,\n H5,\n H6,\n P,\n Small,\n Span,\n Strong,\n type PProps,\n} from '@cerberus/styled-system/jsx'\nimport { type HTMLAttributes, type PropsWithChildren } from 'react'\n\n/**\n * This module exports a component for rendering text utilizing the styled-system JSX utility.\n * @module @cerberus/react/Text\n */\n\nexport type Headings = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\nexport type TextElements = 'p' | 'strong' | 'em' | 'small' | 'span'\n\n// For some reason we have to use the HTMLParagraphElement type here\n// or else TS will fail for non-style props like 'id' or 'className'\nexport interface TextProps\n extends PProps,\n HTMLAttributes<HTMLParagraphElement> {\n /**\n * The element to render as. Defaults to 'p'.\n */\n as?: TextElements | Headings\n}\n\n/**\n * A component for rendering text utilizing the styled-system JSX utility.\n * @definition [Text docs](https://cerberus.digitalu.design/react/text)\n * @example\n * ```tsx\n * <Text as=\"h1\" color=\"page.text.100\" textStyle={{\n * base: 'heading-md',\n * md: 'heading-lg',\n * }}>\n * Hello, world!\n * </Text>\n */\nexport function Text(props: PropsWithChildren<TextProps>) {\n const { as = 'p', ...pandaJSXProps } = props\n switch (as) {\n case 'h1':\n return <H1 {...pandaJSXProps} />\n case 'h2':\n return <H2 {...pandaJSXProps} />\n case 'h3':\n return <H3 {...pandaJSXProps} />\n case 'h4':\n return <H4 {...pandaJSXProps} />\n case 'h5':\n return <H5 {...pandaJSXProps} />\n case 'h6':\n return <H6 {...pandaJSXProps} />\n case 'strong':\n return <Strong {...pandaJSXProps} />\n case 'em':\n return <Em {...pandaJSXProps} />\n case 'small':\n return <Small {...pandaJSXProps} />\n case 'span':\n return <Span {...pandaJSXProps} />\n default:\n return <P {...pandaJSXProps} />\n }\n}\n","import {\n Checkbox,\n type CheckboxControlProps,\n type CheckboxGroupProps,\n type CheckboxIndicatorProps,\n type CheckboxLabelProps,\n type CheckboxRootProps,\n} from '@ark-ui/react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n checkbox,\n type CheckboxVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Checkbox primitives.\n * @module 'react/checkbox'\n */\n\n/**\n * Checkbox Root component used to provide the context to all other checkbox\n * primitives.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxRoot(props: CheckboxRootProps) {\n const styles = checkbox()\n return (\n <Checkbox.Root {...props} className={cx(styles.root, props.className)} />\n )\n}\n\n/**\n * Checkbox Label component used to display the label of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxLabel(\n props: CheckboxLabelProps & CheckboxVariantProps,\n) {\n const { size, ...labelProps } = props\n const styles = checkbox({ size })\n return (\n <Checkbox.Label\n {...labelProps}\n className={cx(styles.label, labelProps.className)}\n />\n )\n}\n\n/**\n * Checkbox Control component used to display the control of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxControl(\n props: CheckboxControlProps & CheckboxVariantProps,\n) {\n const { size, ...controlProps } = props\n const styles = checkbox({ size })\n return (\n <Checkbox.Control\n {...controlProps}\n className={cx(styles.control, controlProps.className)}\n />\n )\n}\n\n/**\n * Checkbox Indicator component used to display the indicator of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxIndicator(props: CheckboxIndicatorProps) {\n const styles = checkbox()\n return (\n <Checkbox.Indicator\n {...props}\n className={cx(styles.indicator, props.className)}\n />\n )\n}\n\n/**\n * Checkbox HiddenInput component used to provide the native checkbox input.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxHiddenInput(props: CheckboxControlProps) {\n return <Checkbox.HiddenInput {...props} />\n}\n\n/**\n * Checkbox Group is used to group checkboxes together in a consistently styled\n * way.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxGroup(props: CheckboxGroupProps) {\n const styles = checkbox()\n return (\n <Checkbox.Group {...props} className={cx(styles.group, props.className)} />\n )\n}\n","import type { ElementType } from 'react'\nimport {\n CheckboxRoot,\n CheckboxLabel,\n CheckboxControl,\n CheckboxIndicator,\n CheckboxHiddenInput,\n CheckboxGroup,\n} from './primitives'\n\n/**\n * This module contains the parts of the Field component.\n * @module 'field/parts'\n */\n\ninterface CheckboxPartsValue {\n /**\n * The container of the field.\n */\n Root: ElementType\n /**\n * The label of the field.\n */\n Label: ElementType\n /**\n * The control of the field.\n */\n Control: ElementType\n /**\n * The indicator of the field.\n */\n Indicator: ElementType\n /**\n * The hidden input of the field.\n */\n HiddenInput: ElementType\n /**\n * The checkbox group component.\n */\n Group: ElementType\n}\n\n/**\n * An Object containing the parts of the Checkbox component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the CheckboxParts object and\n * the entire family of components vs. only what you use.\n */\nexport const CheckboxParts: CheckboxPartsValue = {\n Root: CheckboxRoot,\n Label: CheckboxLabel,\n Control: CheckboxControl,\n Indicator: CheckboxIndicator,\n HiddenInput: CheckboxHiddenInput,\n Group: CheckboxGroup,\n}\n","'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\nimport type { SystemConfig } from '../config'\n\n/**\n * This module contains the Cerberus configuration context and helpers.\n * @module context/cerberus\n */\n\ntype CerberusContextValue = SystemConfig\n\nconst CerberusContext = createContext<CerberusContextValue | null>(null)\n\ninterface CerberusProviderProps {\n config: SystemConfig\n}\n\n/**\n * Cerberus configuration provider.\n * @param props.config The Cerberus configuration created with\n * `makeSystemConfig` helper.\n */\nexport function CerberusProvider(\n props: PropsWithChildren<CerberusProviderProps>,\n) {\n return (\n <CerberusContext.Provider value={props.config}>\n {props.children}\n </CerberusContext.Provider>\n )\n}\n\n/**\n * Returns the Cerberus configuration context.\n * @returns The Cerberus configuration context.\n */\nexport function useCerberusContext() {\n const context = useContext(CerberusContext)\n if (!context) {\n throw new Error('useCerberus must be used within a CerberusProvider')\n }\n return context\n}\n","'use client'\n\nimport { useCerberusContext } from '../../context/cerberus'\nimport { CheckboxParts } from './parts'\nimport { Show } from '../Show'\n\n/**\n * This module contains the Checkbox Icon component.\n * @module\n */\n\ninterface CheckboxIconProps {\n indeterminate?: boolean\n}\n\n/**\n * Checkbox component\n * @definition [ARIA Target Size](https://www.w3.org/WAI/WCAG21/Understanding/target-size.html#:~:text=Understanding%20SC%202.5.,%3ATarget%20Size%20(Level%20AAA)&text=The%20size%20of%20the%20target,Equivalent)\n * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)\n * @see https://cerberus.digitalu.design/react/checkbox\n * @example\n * ```tsx\n * <Field>\n * <Checkbox id=\"legal\" checked={checked.legal} onChange={handleChange} />\n * </Field>\n * ```\n */\nexport function CheckboxIcon(props: CheckboxIconProps) {\n const { icons } = useCerberusContext()\n const { checkbox: CheckIcon, indeterminate: IndeterminateIcon } = icons\n\n return (\n <CheckboxParts.Indicator indeterminate={props.indeterminate}>\n <Show when={props.indeterminate} fallback={<CheckIcon />}>\n <IndeterminateIcon />\n </Show>\n </CheckboxParts.Indicator>\n )\n}\n","import type { CheckboxRootProps } from '@ark-ui/react'\nimport { type CheckboxVariantProps } from '@cerberus/styled-system/recipes'\nimport { Show } from '../Show'\nimport { Text } from '../Text'\nimport { CheckboxParts } from './parts'\nimport { CheckboxIcon } from './checkbox-icon'\n\n/**\n * This module contains the Checkbox component.\n * @module\n */\n\nexport type CheckboxProps = CheckboxVariantProps & CheckboxRootProps\n\n/**\n * Checkbox component is an abstraction of the primitives that displays a\n * controlled checkbox with a label.\n * @description [Cerberus Docs] https://cerberus.digitalu.design/react/checkbox\n * @description [Ark Docs] https://ark-ui.com/docs/components/checkbox\n */\nexport function Checkbox(props: CheckboxProps) {\n const { size, children, ...rootProps } = props\n\n return (\n <CheckboxParts.Root {...rootProps}>\n <CheckboxParts.Control size={size}>\n <CheckboxIcon indeterminate={rootProps.checked === 'indeterminate'} />\n </CheckboxParts.Control>\n\n <CheckboxParts.Label size={size}>\n {children}\n <Show when={props.required}>\n <Text as=\"span\" data-part=\"required-indicator\">\n (required)\n </Text>\n </Show>\n </CheckboxParts.Label>\n\n <CheckboxParts.HiddenInput />\n </CheckboxParts.Root>\n )\n}\n"],"mappings":"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","names":["Checkbox","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","Checkbox"]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/checkbox/parts.ts
|
|
21
|
+
var parts_exports = {};
|
|
22
|
+
__export(parts_exports, {
|
|
23
|
+
CheckboxParts: () => CheckboxParts
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(parts_exports);
|
|
26
|
+
|
|
27
|
+
// src/components/checkbox/primitives.tsx
|
|
28
|
+
var import_react = require("@ark-ui/react");
|
|
29
|
+
var import_css = require("@cerberus/styled-system/css");
|
|
30
|
+
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
function CheckboxRoot(props) {
|
|
33
|
+
const styles = (0, import_recipes.checkbox)();
|
|
34
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Checkbox.Root, { ...props, className: (0, import_css.cx)(styles.root, props.className) });
|
|
35
|
+
}
|
|
36
|
+
function CheckboxLabel(props) {
|
|
37
|
+
const { size, ...labelProps } = props;
|
|
38
|
+
const styles = (0, import_recipes.checkbox)({ size });
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
|
+
import_react.Checkbox.Label,
|
|
41
|
+
{
|
|
42
|
+
...labelProps,
|
|
43
|
+
className: (0, import_css.cx)(styles.label, labelProps.className)
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function CheckboxControl(props) {
|
|
48
|
+
const { size, ...controlProps } = props;
|
|
49
|
+
const styles = (0, import_recipes.checkbox)({ size });
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
import_react.Checkbox.Control,
|
|
52
|
+
{
|
|
53
|
+
...controlProps,
|
|
54
|
+
className: (0, import_css.cx)(styles.control, controlProps.className)
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function CheckboxIndicator(props) {
|
|
59
|
+
const styles = (0, import_recipes.checkbox)();
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
import_react.Checkbox.Indicator,
|
|
62
|
+
{
|
|
63
|
+
...props,
|
|
64
|
+
className: (0, import_css.cx)(styles.indicator, props.className)
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function CheckboxHiddenInput(props) {
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Checkbox.HiddenInput, { ...props });
|
|
70
|
+
}
|
|
71
|
+
function CheckboxGroup(props) {
|
|
72
|
+
const styles = (0, import_recipes.checkbox)();
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Checkbox.Group, { ...props, className: (0, import_css.cx)(styles.group, props.className) });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src/components/checkbox/parts.ts
|
|
77
|
+
var CheckboxParts = {
|
|
78
|
+
Root: CheckboxRoot,
|
|
79
|
+
Label: CheckboxLabel,
|
|
80
|
+
Control: CheckboxControl,
|
|
81
|
+
Indicator: CheckboxIndicator,
|
|
82
|
+
HiddenInput: CheckboxHiddenInput,
|
|
83
|
+
Group: CheckboxGroup
|
|
84
|
+
};
|
|
85
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
+
0 && (module.exports = {
|
|
87
|
+
CheckboxParts
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=parts.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/checkbox/parts.ts","../../../../src/components/checkbox/primitives.tsx"],"sourcesContent":["import type { ElementType } from 'react'\nimport {\n CheckboxRoot,\n CheckboxLabel,\n CheckboxControl,\n CheckboxIndicator,\n CheckboxHiddenInput,\n CheckboxGroup,\n} from './primitives'\n\n/**\n * This module contains the parts of the Field component.\n * @module 'field/parts'\n */\n\ninterface CheckboxPartsValue {\n /**\n * The container of the field.\n */\n Root: ElementType\n /**\n * The label of the field.\n */\n Label: ElementType\n /**\n * The control of the field.\n */\n Control: ElementType\n /**\n * The indicator of the field.\n */\n Indicator: ElementType\n /**\n * The hidden input of the field.\n */\n HiddenInput: ElementType\n /**\n * The checkbox group component.\n */\n Group: ElementType\n}\n\n/**\n * An Object containing the parts of the Checkbox component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the CheckboxParts object and\n * the entire family of components vs. only what you use.\n */\nexport const CheckboxParts: CheckboxPartsValue = {\n Root: CheckboxRoot,\n Label: CheckboxLabel,\n Control: CheckboxControl,\n Indicator: CheckboxIndicator,\n HiddenInput: CheckboxHiddenInput,\n Group: CheckboxGroup,\n}\n","import {\n Checkbox,\n type CheckboxControlProps,\n type CheckboxGroupProps,\n type CheckboxIndicatorProps,\n type CheckboxLabelProps,\n type CheckboxRootProps,\n} from '@ark-ui/react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n checkbox,\n type CheckboxVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Checkbox primitives.\n * @module 'react/checkbox'\n */\n\n/**\n * Checkbox Root component used to provide the context to all other checkbox\n * primitives.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxRoot(props: CheckboxRootProps) {\n const styles = checkbox()\n return (\n <Checkbox.Root {...props} className={cx(styles.root, props.className)} />\n )\n}\n\n/**\n * Checkbox Label component used to display the label of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxLabel(\n props: CheckboxLabelProps & CheckboxVariantProps,\n) {\n const { size, ...labelProps } = props\n const styles = checkbox({ size })\n return (\n <Checkbox.Label\n {...labelProps}\n className={cx(styles.label, labelProps.className)}\n />\n )\n}\n\n/**\n * Checkbox Control component used to display the control of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxControl(\n props: CheckboxControlProps & CheckboxVariantProps,\n) {\n const { size, ...controlProps } = props\n const styles = checkbox({ size })\n return (\n <Checkbox.Control\n {...controlProps}\n className={cx(styles.control, controlProps.className)}\n />\n )\n}\n\n/**\n * Checkbox Indicator component used to display the indicator of the checkbox.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxIndicator(props: CheckboxIndicatorProps) {\n const styles = checkbox()\n return (\n <Checkbox.Indicator\n {...props}\n className={cx(styles.indicator, props.className)}\n />\n )\n}\n\n/**\n * Checkbox HiddenInput component used to provide the native checkbox input.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxHiddenInput(props: CheckboxControlProps) {\n return <Checkbox.HiddenInput {...props} />\n}\n\n/**\n * Checkbox Group is used to group checkboxes together in a consistently styled\n * way.\n * @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)\n * @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)\n */\nexport function CheckboxGroup(props: CheckboxGroupProps) {\n const styles = checkbox()\n return (\n <Checkbox.Group {...props} className={cx(styles.group, props.className)} />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAOO;AACP,iBAAmB;AACnB,qBAGO;AAgBH;AAHG,SAAS,aAAa,OAA0B;AACrD,QAAM,aAAS,yBAAS;AACxB,SACE,4CAAC,sBAAS,MAAT,EAAe,GAAG,OAAO,eAAW,eAAG,OAAO,MAAM,MAAM,SAAS,GAAG;AAE3E;AAOO,SAAS,cACd,OACA;AACA,QAAM,EAAE,MAAM,GAAG,WAAW,IAAI;AAChC,QAAM,aAAS,yBAAS,EAAE,KAAK,CAAC;AAChC,SACE;AAAA,IAAC,sBAAS;AAAA,IAAT;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,OAAO,WAAW,SAAS;AAAA;AAAA,EAClD;AAEJ;AAOO,SAAS,gBACd,OACA;AACA,QAAM,EAAE,MAAM,GAAG,aAAa,IAAI;AAClC,QAAM,aAAS,yBAAS,EAAE,KAAK,CAAC;AAChC,SACE;AAAA,IAAC,sBAAS;AAAA,IAAT;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,SAAS,aAAa,SAAS;AAAA;AAAA,EACtD;AAEJ;AAOO,SAAS,kBAAkB,OAA+B;AAC/D,QAAM,aAAS,yBAAS;AACxB,SACE;AAAA,IAAC,sBAAS;AAAA,IAAT;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,eAAG,OAAO,WAAW,MAAM,SAAS;AAAA;AAAA,EACjD;AAEJ;AAOO,SAAS,oBAAoB,OAA6B;AAC/D,SAAO,4CAAC,sBAAS,aAAT,EAAsB,GAAG,OAAO;AAC1C;AAQO,SAAS,cAAc,OAA2B;AACvD,QAAM,aAAS,yBAAS;AACxB,SACE,4CAAC,sBAAS,OAAT,EAAgB,GAAG,OAAO,eAAW,eAAG,OAAO,OAAO,MAAM,SAAS,GAAG;AAE7E;;;ADpDO,IAAM,gBAAoC;AAAA,EAC/C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AAAA,EACb,OAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/checkbox/primitives.tsx
|
|
21
|
+
var primitives_exports = {};
|
|
22
|
+
__export(primitives_exports, {
|
|
23
|
+
CheckboxControl: () => CheckboxControl,
|
|
24
|
+
CheckboxGroup: () => CheckboxGroup,
|
|
25
|
+
CheckboxHiddenInput: () => CheckboxHiddenInput,
|
|
26
|
+
CheckboxIndicator: () => CheckboxIndicator,
|
|
27
|
+
CheckboxLabel: () => CheckboxLabel,
|
|
28
|
+
CheckboxRoot: () => CheckboxRoot
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(primitives_exports);
|
|
31
|
+
var import_react = require("@ark-ui/react");
|
|
32
|
+
var import_css = require("@cerberus/styled-system/css");
|
|
33
|
+
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
function CheckboxRoot(props) {
|
|
36
|
+
const styles = (0, import_recipes.checkbox)();
|
|
37
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Checkbox.Root, { ...props, className: (0, import_css.cx)(styles.root, props.className) });
|
|
38
|
+
}
|
|
39
|
+
function CheckboxLabel(props) {
|
|
40
|
+
const { size, ...labelProps } = props;
|
|
41
|
+
const styles = (0, import_recipes.checkbox)({ size });
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
+
import_react.Checkbox.Label,
|
|
44
|
+
{
|
|
45
|
+
...labelProps,
|
|
46
|
+
className: (0, import_css.cx)(styles.label, labelProps.className)
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
function CheckboxControl(props) {
|
|
51
|
+
const { size, ...controlProps } = props;
|
|
52
|
+
const styles = (0, import_recipes.checkbox)({ size });
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
import_react.Checkbox.Control,
|
|
55
|
+
{
|
|
56
|
+
...controlProps,
|
|
57
|
+
className: (0, import_css.cx)(styles.control, controlProps.className)
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function CheckboxIndicator(props) {
|
|
62
|
+
const styles = (0, import_recipes.checkbox)();
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
import_react.Checkbox.Indicator,
|
|
65
|
+
{
|
|
66
|
+
...props,
|
|
67
|
+
className: (0, import_css.cx)(styles.indicator, props.className)
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
function CheckboxHiddenInput(props) {
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Checkbox.HiddenInput, { ...props });
|
|
73
|
+
}
|
|
74
|
+
function CheckboxGroup(props) {
|
|
75
|
+
const styles = (0, import_recipes.checkbox)();
|
|
76
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Checkbox.Group, { ...props, className: (0, import_css.cx)(styles.group, props.className) });
|
|
77
|
+
}
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
CheckboxControl,
|
|
81
|
+
CheckboxGroup,
|
|
82
|
+
CheckboxHiddenInput,
|
|
83
|
+
CheckboxIndicator,
|
|
84
|
+
CheckboxLabel,
|
|
85
|
+
CheckboxRoot
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=primitives.cjs.map
|