@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,32 @@
|
|
|
1
|
+
import type { ElementType } from 'react'
|
|
2
|
+
import { ToggleRoot, ToggleIndicator } from './primitives'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This module contains the parts of the Toggle parts.
|
|
6
|
+
* @module 'toggle/parts'
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
interface TogglePartsValue {
|
|
10
|
+
/**
|
|
11
|
+
* The container of the toggle.
|
|
12
|
+
*/
|
|
13
|
+
Root: ElementType
|
|
14
|
+
/**
|
|
15
|
+
* The indicator that appears when a toggle is pressed.
|
|
16
|
+
*/
|
|
17
|
+
Indicator: ElementType
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* An Object containing the parts of the Radio component. For users that
|
|
22
|
+
* prefer Object component syntax.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
*
|
|
26
|
+
* When using object component syntax, you import the RadioParts object and
|
|
27
|
+
* the entire family of components vs. only what you use.
|
|
28
|
+
*/
|
|
29
|
+
export const ToggleParts: TogglePartsValue = {
|
|
30
|
+
Root: ToggleRoot,
|
|
31
|
+
Indicator: ToggleIndicator,
|
|
32
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Toggle } from '@ark-ui/react/toggle'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This module provides the Toggle primitives.
|
|
5
|
+
* @module 'react/toggle'
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The ToggleRoot is used to manage the state of the Toggle component.
|
|
10
|
+
*/
|
|
11
|
+
export const ToggleRoot = Toggle.Root
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The ToggleIndicator is used to render the indicator of the Toggle component
|
|
15
|
+
* based on the pressed state.
|
|
16
|
+
*/
|
|
17
|
+
export const ToggleIndicator = Toggle.Indicator
|
package/src/config/types.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type PropsWithChildren,
|
|
12
12
|
type ReactNode,
|
|
13
13
|
} from 'react'
|
|
14
|
-
import { Button } from '../components/
|
|
14
|
+
import { Button } from '../components/button/button'
|
|
15
15
|
import { css } from '@cerberus/styled-system/css'
|
|
16
16
|
import { Show } from '../components/Show'
|
|
17
17
|
import { Avatar } from '../components/Avatar'
|
package/src/context/field.tsx
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { FieldRootProps } from '@ark-ui/react'
|
|
3
4
|
import {
|
|
4
5
|
createContext,
|
|
5
6
|
useContext,
|
|
6
7
|
useMemo,
|
|
7
8
|
type PropsWithChildren,
|
|
8
9
|
} from 'react'
|
|
10
|
+
import { FieldRoot } from '../components/field/primitives'
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* This module provides a context and hook for the field.
|
|
@@ -35,11 +37,10 @@ export interface FieldContextValue {
|
|
|
35
37
|
const FieldContext = createContext<FieldContextValue | null>(null)
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @see https://cerberus.digitalu.design/react/input
|
|
40
|
+
* @deprecated use FieldRoot or FieldParts instead
|
|
40
41
|
*/
|
|
41
|
-
export function
|
|
42
|
-
props: PropsWithChildren<
|
|
42
|
+
export function FieldProvider(
|
|
43
|
+
props: PropsWithChildren<FieldRootProps>,
|
|
43
44
|
): JSX.Element {
|
|
44
45
|
const value = useMemo(
|
|
45
46
|
() => ({
|
|
@@ -53,7 +54,7 @@ export function Field(
|
|
|
53
54
|
|
|
54
55
|
return (
|
|
55
56
|
<FieldContext.Provider value={value}>
|
|
56
|
-
{props
|
|
57
|
+
<FieldRoot {...props} />
|
|
57
58
|
</FieldContext.Provider>
|
|
58
59
|
)
|
|
59
60
|
}
|
|
@@ -17,7 +17,7 @@ import { Notification } from '../components/Notification'
|
|
|
17
17
|
import { animateIn, vstack } from '@cerberus/styled-system/patterns'
|
|
18
18
|
import { Portal, type PortalProps } from '../components/Portal'
|
|
19
19
|
import { notification } from '@cerberus/styled-system/recipes'
|
|
20
|
-
import { Button } from '../components/
|
|
20
|
+
import { Button } from '../components/button/button'
|
|
21
21
|
import { cx } from '@cerberus/styled-system/css'
|
|
22
22
|
import {
|
|
23
23
|
addNotification,
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
type MouseEvent,
|
|
12
12
|
type PropsWithChildren,
|
|
13
13
|
} from 'react'
|
|
14
|
-
import {
|
|
14
|
+
import { DialogCloseTrigger } from '@ark-ui/react'
|
|
15
|
+
import { HStack, VStack } from '@cerberus/styled-system/jsx'
|
|
15
16
|
import { css } from '@cerberus/styled-system/css'
|
|
16
17
|
import { hstack } from '@cerberus/styled-system/patterns'
|
|
17
|
-
import { Input } from '../components/
|
|
18
|
-
import {
|
|
19
|
-
import { Label } from '../components/Label'
|
|
18
|
+
import { FieldLabel, FieldRoot, Input } from '../components/field/index'
|
|
19
|
+
import { Button } from '../components/button/button'
|
|
20
20
|
import { Show } from '../components/Show'
|
|
21
21
|
import { Avatar } from '../components/Avatar'
|
|
22
22
|
import { Text } from '../components/Text'
|
|
@@ -27,8 +27,6 @@ import {
|
|
|
27
27
|
DialogHeading,
|
|
28
28
|
DialogProvider,
|
|
29
29
|
} from '../components/Dialog'
|
|
30
|
-
import { HStack, VStack } from '@cerberus/styled-system/jsx'
|
|
31
|
-
import { DialogCloseTrigger } from '@ark-ui/react'
|
|
32
30
|
|
|
33
31
|
/**
|
|
34
32
|
* This module provides a context and hook for the prompt modal.
|
|
@@ -216,28 +214,28 @@ export function PromptModal(
|
|
|
216
214
|
marginBlockEnd="lg"
|
|
217
215
|
w="full"
|
|
218
216
|
>
|
|
219
|
-
<
|
|
220
|
-
|
|
217
|
+
<FieldRoot
|
|
218
|
+
ids={{
|
|
219
|
+
control: 'confirm',
|
|
220
|
+
}}
|
|
221
|
+
invalid={!isValid}
|
|
222
|
+
>
|
|
223
|
+
<FieldLabel
|
|
221
224
|
className={hstack({
|
|
222
225
|
gap: 'xs',
|
|
223
226
|
justify: 'flex-start !important',
|
|
227
|
+
marginBlockEnd: 'xs',
|
|
228
|
+
textStyle: 'label-md',
|
|
224
229
|
})}
|
|
225
|
-
htmlFor="confirm"
|
|
226
|
-
size="md"
|
|
227
230
|
>
|
|
228
231
|
Type
|
|
229
232
|
<Text as="strong" textTransform="uppercase">
|
|
230
233
|
{content?.key}
|
|
231
234
|
</Text>
|
|
232
235
|
to confirm
|
|
233
|
-
</
|
|
234
|
-
<Input
|
|
235
|
-
|
|
236
|
-
name="confirm"
|
|
237
|
-
onChange={handleChange}
|
|
238
|
-
type="text"
|
|
239
|
-
/>
|
|
240
|
-
</Field>
|
|
236
|
+
</FieldLabel>
|
|
237
|
+
<Input name="confirm" onChange={handleChange} type="text" />
|
|
238
|
+
</FieldRoot>
|
|
241
239
|
</VStack>
|
|
242
240
|
|
|
243
241
|
<HStack gap="md" justify="stretch" w="full">
|
package/src/hooks/useDate.ts
CHANGED
|
@@ -38,13 +38,7 @@ export interface UseDateReturn extends UseDateBase {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```tsx
|
|
44
|
-
* const MyComponent = () => {
|
|
45
|
-
* const date = useDate({ initialValue: '01 JAN 2024' })
|
|
46
|
-
* return <input onChange={date.onChange} type="text" value={date.value} />
|
|
47
|
-
* }
|
|
41
|
+
* @deprecated use the DatePicker family instead
|
|
48
42
|
*/
|
|
49
43
|
export function useDate(options?: UseDateOptions): UseDateReturn {
|
|
50
44
|
const initialValue = options?.initialValue ?? ''
|
|
@@ -38,7 +38,6 @@ export function useRootColors(colors: string[] = []): RootColorsResult {
|
|
|
38
38
|
useEffect(() => {
|
|
39
39
|
if (Object.keys(state).length === colors.length) return
|
|
40
40
|
dispatch(formatColors(colors))
|
|
41
|
-
console.log('updating colors in root hook')
|
|
42
41
|
}, [colors])
|
|
43
42
|
|
|
44
43
|
// reducer is already memoized
|
package/src/hooks/useToggle.ts
CHANGED
|
@@ -29,9 +29,7 @@ export interface ToggleHookReturn {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @see https://cerberus.digitalu.design/react/use-toggle
|
|
34
|
-
* @memberof module:Toggle
|
|
32
|
+
* @deprecated Will be removed in v1. Use ToggleParts instead.
|
|
35
33
|
*/
|
|
36
34
|
export function useToggle(options?: UseToggleOptions): ToggleHookReturn {
|
|
37
35
|
const [checked, setChecked] = useState<string>(options?.checked ?? '')
|
package/src/index.ts
CHANGED
|
@@ -5,13 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
// deprecated
|
|
7
7
|
|
|
8
|
-
export * from './components/
|
|
9
|
-
export * from './components/
|
|
10
|
-
export * from './components/
|
|
11
|
-
export * from './components/
|
|
12
|
-
export * from './components/
|
|
13
|
-
export * from './components/
|
|
14
|
-
export * from './components/
|
|
8
|
+
export * from './components/deprecated/FieldMessage'
|
|
9
|
+
export * from './components/deprecated/FieldsetLabel'
|
|
10
|
+
export * from './components/deprecated/Label'
|
|
11
|
+
export * from './components/deprecated/Modal'
|
|
12
|
+
export * from './components/deprecated/ModalHeader'
|
|
13
|
+
export * from './components/deprecated/ModalHeading'
|
|
14
|
+
export * from './components/deprecated/ModalDescription'
|
|
15
|
+
export * from './components/deprecated/NavMenuTrigger'
|
|
16
|
+
export * from './components/deprecated/NavMenuList'
|
|
17
|
+
export * from './components/deprecated/NavMenuLink'
|
|
18
|
+
export * from './hooks/useDate'
|
|
19
|
+
export * from './hooks/useModal'
|
|
20
|
+
export * from './hooks/useToggle'
|
|
15
21
|
|
|
16
22
|
// components
|
|
17
23
|
|
|
@@ -20,23 +26,22 @@ export * from './components/Accordion.client'
|
|
|
20
26
|
export * from './components/AccordionItemGroup'
|
|
21
27
|
export * from './components/Admonition'
|
|
22
28
|
export * from './components/Avatar'
|
|
23
|
-
export * from './components/
|
|
24
|
-
export * from './components/
|
|
29
|
+
export * from './components/button/index'
|
|
30
|
+
export * from './components/checkbox/index'
|
|
25
31
|
export * from './components/CircularProgress'
|
|
32
|
+
export * from './components/cta-dialog/index'
|
|
26
33
|
export * from './components/DatePicker.client'
|
|
27
34
|
export * from './components/DatePicker.server'
|
|
28
35
|
export * from './components/Dialog'
|
|
29
36
|
export * from './components/Dialog.client'
|
|
30
37
|
export * from './components/Droppable'
|
|
31
|
-
export * from './components/FieldMessage'
|
|
32
38
|
export * from './components/FeatureFlag'
|
|
33
|
-
export * from './components/
|
|
34
|
-
export * from './components/
|
|
39
|
+
export * from './components/field/index'
|
|
40
|
+
export * from './components/fieldset/index'
|
|
35
41
|
export * from './components/FileStatus'
|
|
36
42
|
export * from './components/FileUploader'
|
|
43
|
+
export * from './components/for'
|
|
37
44
|
export * from './components/IconButton'
|
|
38
|
-
export * from './components/Input'
|
|
39
|
-
export * from './components/Label'
|
|
40
45
|
export * from './components/Legend'
|
|
41
46
|
export * from './components/Menu'
|
|
42
47
|
export * from './components/Notification'
|
|
@@ -44,9 +49,11 @@ export * from './components/NotificationHeading'
|
|
|
44
49
|
export * from './components/NotificationDescription'
|
|
45
50
|
export * from './components/Portal'
|
|
46
51
|
export * from './components/ProgressBar'
|
|
47
|
-
export * from './components/
|
|
48
|
-
export * from './components/
|
|
52
|
+
export * from './components/radio/index'
|
|
53
|
+
export * from './components/select/index'
|
|
54
|
+
export * from './components/Show'
|
|
49
55
|
export * from './components/Spinner'
|
|
56
|
+
export * from './components/switch/index'
|
|
50
57
|
export * from './components/Tabs.client'
|
|
51
58
|
export * from './components/Table'
|
|
52
59
|
export * from './components/Thead'
|
|
@@ -55,18 +62,14 @@ export * from './components/Td'
|
|
|
55
62
|
export * from './components/Tbody'
|
|
56
63
|
export * from './components/Tag'
|
|
57
64
|
export * from './components/Text'
|
|
58
|
-
export * from './components/
|
|
59
|
-
export * from './components/Toggle'
|
|
65
|
+
export * from './components/toggle/index'
|
|
60
66
|
export * from './components/Tooltip'
|
|
61
|
-
export * from './components/Show'
|
|
62
67
|
|
|
63
68
|
// context
|
|
64
69
|
|
|
65
70
|
export * from './context/cerberus'
|
|
66
71
|
export * from './context/confirm-modal'
|
|
67
|
-
export * from './context/cta-modal'
|
|
68
72
|
export * from './context/feature-flags'
|
|
69
|
-
export * from './context/field'
|
|
70
73
|
export * from './context/navMenu'
|
|
71
74
|
export * from './context/notification-center'
|
|
72
75
|
export * from './context/prompt-modal'
|
|
@@ -75,10 +78,7 @@ export * from './context/theme'
|
|
|
75
78
|
|
|
76
79
|
// hooks
|
|
77
80
|
|
|
78
|
-
export * from './hooks/useDate'
|
|
79
|
-
export * from './hooks/useModal'
|
|
80
81
|
export * from './hooks/useTheme'
|
|
81
|
-
export * from './hooks/useToggle'
|
|
82
82
|
export * from './hooks/useRootColors'
|
|
83
83
|
|
|
84
84
|
// aria-helpers
|
package/src/utils/index.ts
CHANGED
|
@@ -18,4 +18,34 @@ export function formatNotifyCount(count: number): string {
|
|
|
18
18
|
return count.toString()
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Splits the properties of an object into multiple groups based on lists of keys.
|
|
23
|
+
* @param props - The object to split.
|
|
24
|
+
* @param keyGroups - The lists of keys to include in each group.
|
|
25
|
+
* @returns An array of objects: each containing the properties specified in the corresponding key group, and the last object containing the remaining keys.
|
|
26
|
+
*/
|
|
27
|
+
export function splitProps<T extends object>(
|
|
28
|
+
props: T,
|
|
29
|
+
...keyGroups: (keyof T)[][]
|
|
30
|
+
): { [K in keyof T]?: T[K] }[] {
|
|
31
|
+
const result = keyGroups.map(() => ({}) as { [K in keyof T]?: T[K] })
|
|
32
|
+
const rest = {} as { [K in keyof T]?: T[K] }
|
|
33
|
+
|
|
34
|
+
for (const key in props) {
|
|
35
|
+
let assigned = false
|
|
36
|
+
for (let i = 0; i < keyGroups.length; i++) {
|
|
37
|
+
if (keyGroups[i].includes(key as keyof T)) {
|
|
38
|
+
result[i][key as keyof T] = props[key]
|
|
39
|
+
assigned = true
|
|
40
|
+
break
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (!assigned) {
|
|
44
|
+
rest[key as keyof T] = props[key]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return [...result, rest]
|
|
49
|
+
}
|
|
50
|
+
|
|
21
51
|
export * from './localStorage'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n button,\n type ButtonVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Button component.\n * @module\n */\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n ButtonVariantProps\n\n/**\n * A component that allows the user to perform actions\n * @see https://cerberus.digitalu.design/react/button\n */\nexport function Button(props: ButtonProps): JSX.Element {\n const { palette, usage, shape, ...nativeProps } = props\n return (\n <button\n {...nativeProps}\n className={cx(\n nativeProps.className,\n button({\n palette,\n usage,\n shape,\n }),\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAmB;AACnB,qBAGO;AAiBH;AAHG,SAAS,OAAO,OAAiC;AACtD,QAAM,EAAE,SAAS,OAAO,OAAO,GAAG,YAAY,IAAI;AAClD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,eAAW;AAAA,QACT,YAAY;AAAA,YACZ,uBAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/components/Checkbox.tsx
|
|
22
|
-
var Checkbox_exports = {};
|
|
23
|
-
__export(Checkbox_exports, {
|
|
24
|
-
Checkbox: () => Checkbox
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(Checkbox_exports);
|
|
27
|
-
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
28
|
-
var import_patterns = require("@cerberus/styled-system/patterns");
|
|
29
|
-
var import_css = require("@cerberus/styled-system/css");
|
|
30
|
-
|
|
31
|
-
// src/components/Show.tsx
|
|
32
|
-
var import_react = require("react");
|
|
33
|
-
function Show(props) {
|
|
34
|
-
const { when, children, fallback } = props;
|
|
35
|
-
const condition = (0, import_react.useMemo)(() => when ?? false, [when]);
|
|
36
|
-
return (0, import_react.useMemo)(() => {
|
|
37
|
-
if (condition) return children;
|
|
38
|
-
return fallback ?? null;
|
|
39
|
-
}, [condition, children, fallback]);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// src/context/field.tsx
|
|
43
|
-
var import_react2 = require("react");
|
|
44
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
-
var FieldContext = (0, import_react2.createContext)(null);
|
|
46
|
-
function useFieldContext() {
|
|
47
|
-
const context = (0, import_react2.useContext)(FieldContext);
|
|
48
|
-
if (!context) {
|
|
49
|
-
throw new Error("useFieldContext must be used within a Field Provider.");
|
|
50
|
-
}
|
|
51
|
-
return context;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// src/context/cerberus.tsx
|
|
55
|
-
var import_react3 = require("react");
|
|
56
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
57
|
-
var CerberusContext = (0, import_react3.createContext)(null);
|
|
58
|
-
function useCerberusContext() {
|
|
59
|
-
const context = (0, import_react3.useContext)(CerberusContext);
|
|
60
|
-
if (!context) {
|
|
61
|
-
throw new Error("useCerberus must be used within a CerberusProvider");
|
|
62
|
-
}
|
|
63
|
-
return context;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// src/components/Checkbox.tsx
|
|
67
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
68
|
-
function Checkbox(props) {
|
|
69
|
-
const { describedBy, size, checked, mixed, ...nativeProps } = props;
|
|
70
|
-
const { invalid, ...fieldStates } = useFieldContext();
|
|
71
|
-
const styles = (0, import_recipes.checkbox)({ size });
|
|
72
|
-
const { icons } = useCerberusContext();
|
|
73
|
-
const { checkbox: CheckIcon, indeterminate: IndeterminateIcon } = icons;
|
|
74
|
-
if (!CheckIcon) {
|
|
75
|
-
throw new Error("The CerberusProvider is missing the checkbox icon.");
|
|
76
|
-
}
|
|
77
|
-
if (!IndeterminateIcon) {
|
|
78
|
-
throw new Error("The CerberusProvider is missing the indeterminate icon.");
|
|
79
|
-
}
|
|
80
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
81
|
-
"div",
|
|
82
|
-
{
|
|
83
|
-
className: (0, import_css.cx)(
|
|
84
|
-
styles.root,
|
|
85
|
-
(0, import_patterns.vstack)({
|
|
86
|
-
gap: "0",
|
|
87
|
-
justify: "center"
|
|
88
|
-
})
|
|
89
|
-
),
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
92
|
-
"input",
|
|
93
|
-
{
|
|
94
|
-
...nativeProps,
|
|
95
|
-
...fieldStates,
|
|
96
|
-
...describedBy && { "aria-describedby": describedBy },
|
|
97
|
-
...invalid && { "aria-invalid": true },
|
|
98
|
-
...mixed && { "aria-checked": "mixed" },
|
|
99
|
-
className: (0, import_css.cx)("peer", nativeProps.className, styles.input),
|
|
100
|
-
type: "checkbox"
|
|
101
|
-
}
|
|
102
|
-
),
|
|
103
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Show, { when: checked && !mixed, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CheckIcon, {}) }) }),
|
|
104
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Show, { when: mixed, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: styles.icon, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(IndeterminateIcon, {}) }) })
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
-
0 && (module.exports = {
|
|
111
|
-
Checkbox
|
|
112
|
-
});
|
|
113
|
-
//# sourceMappingURL=Checkbox.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Checkbox.tsx","../../../src/components/Show.tsx","../../../src/context/field.tsx","../../../src/context/cerberus.tsx"],"sourcesContent":["'use client'\n\nimport {\n checkbox,\n type CheckboxVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport { vstack } from '@cerberus/styled-system/patterns'\nimport { cx } from '@cerberus/styled-system/css'\nimport type { InputHTMLAttributes } from 'react'\nimport { Show } from './Show'\nimport { useFieldContext } from '../context/field'\nimport { useCerberusContext } from '../context/cerberus'\n\n/**\n * This module contains the Checkbox component.\n * @module\n */\n\nexport type CheckboxProps = CheckboxVariantProps &\n Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'id'> & {\n /**\n * The id of the FieldMessage element describing the Checkbox.\n */\n describedBy?: string\n /**\n * The unique identifier for the checkbox. Required for accessibility.\n */\n id: string\n /**\n * Used to display a mixed checked state.\n * @description [ARIA Mixed State](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/examples/checkbox-mixed/)\n */\n mixed?: 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 Checkbox(props: CheckboxProps) {\n const { describedBy, size, checked, mixed, ...nativeProps } = props\n const { invalid, ...fieldStates } = useFieldContext()\n const styles = checkbox({ size })\n const { icons } = useCerberusContext()\n const { checkbox: CheckIcon, indeterminate: IndeterminateIcon } = icons\n\n if (!CheckIcon) {\n throw new Error('The CerberusProvider is missing the checkbox icon.')\n }\n if (!IndeterminateIcon) {\n throw new Error('The CerberusProvider is missing the indeterminate icon.')\n }\n\n return (\n <div\n className={cx(\n styles.root,\n vstack({\n gap: '0',\n justify: 'center',\n }),\n )}\n >\n <input\n {...nativeProps}\n {...fieldStates}\n {...(describedBy && { 'aria-describedby': describedBy })}\n {...(invalid && { 'aria-invalid': true })}\n {...(mixed && { 'aria-checked': 'mixed' })}\n className={cx('peer', nativeProps.className, styles.input)}\n type=\"checkbox\"\n />\n <Show when={checked && !mixed}>\n <span className={styles.icon}>\n <CheckIcon />\n </span>\n </Show>\n <Show when={mixed}>\n <span className={styles.icon}>\n <IndeterminateIcon />\n </span>\n </Show>\n </div>\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","'use client'\n\nimport {\n createContext,\n useContext,\n useMemo,\n type PropsWithChildren,\n} from 'react'\n\n/**\n * This module provides a context and hook for the field.\n * @module Field\n */\n\nexport interface FieldContextValue {\n /**\n * Whether the field is disabled.\n * @description [Moz Input Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes)\n */\n disabled?: boolean\n /**\n * Whether the field is read-only.\n */\n readOnly?: boolean\n /**\n * Whether the field is required.\n */\n required?: boolean\n /**\n * Whether the field is invalid.\n */\n invalid?: boolean\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null)\n\n/**\n * Provides the field state for a all related components used within a group.\n * @see https://cerberus.digitalu.design/react/input\n */\nexport function Field(\n props: PropsWithChildren<FieldContextValue>,\n): JSX.Element {\n const value = useMemo(\n () => ({\n disabled: props.disabled,\n readOnly: props.readOnly,\n required: props.required,\n invalid: props.invalid,\n }),\n [props.disabled, props.readOnly, props.required, props.invalid],\n )\n\n return (\n <FieldContext.Provider value={value}>\n {props.children}\n </FieldContext.Provider>\n )\n}\n\n/**\n * Used to access the field context.\n * @returns The field context.\n */\nexport function useFieldContext(): FieldContextValue {\n const context = useContext(FieldContext)\n if (!context) {\n throw new Error('useFieldContext must be used within a Field Provider.')\n }\n return context\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAGO;AACP,sBAAuB;AACvB,iBAAmB;;;ACLnB,mBAAgE;AA4BzD,SAAS,KAAK,OAAgD;AACnE,QAAM,EAAE,MAAM,UAAU,SAAS,IAAI;AACrC,QAAM,gBAAY,sBAAQ,MAAM,QAAQ,OAAO,CAAC,IAAI,CAAC;AAErD,aAAO,sBAAQ,MAAM;AACnB,QAAI,UAAW,QAAO;AACtB,WAAO,YAAY;AAAA,EACrB,GAAG,CAAC,WAAW,UAAU,QAAQ,CAAC;AACpC;;;ACpCA,IAAAA,gBAKO;AA+CH;AApBJ,IAAM,mBAAe,6BAAwC,IAAI;AA8B1D,SAAS,kBAAqC;AACnD,QAAM,cAAU,0BAAW,YAAY;AACvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACzE;AACA,SAAO;AACT;;;ACpEA,IAAAC,gBAAkE;AAyB9D,IAAAC,sBAAA;AAfJ,IAAM,sBAAkB,6BAA2C,IAAI;AAyBhE,SAAS,qBAAqB;AACnC,QAAM,cAAU,0BAAW,eAAe;AAC1C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACtE;AACA,SAAO;AACT;;;AHmBI,IAAAC,sBAAA;AAfG,SAAS,SAAS,OAAsB;AAC7C,QAAM,EAAE,aAAa,MAAM,SAAS,OAAO,GAAG,YAAY,IAAI;AAC9D,QAAM,EAAE,SAAS,GAAG,YAAY,IAAI,gBAAgB;AACpD,QAAM,aAAS,yBAAS,EAAE,KAAK,CAAC;AAChC,QAAM,EAAE,MAAM,IAAI,mBAAmB;AACrC,QAAM,EAAE,UAAU,WAAW,eAAe,kBAAkB,IAAI;AAElE,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACtE;AACA,MAAI,CAAC,mBAAmB;AACtB,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAC3E;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,QACT,OAAO;AAAA,YACP,wBAAO;AAAA,UACL,KAAK;AAAA,UACL,SAAS;AAAA,QACX,CAAC;AAAA,MACH;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACE,GAAG;AAAA,YACH,GAAG;AAAA,YACH,GAAI,eAAe,EAAE,oBAAoB,YAAY;AAAA,YACrD,GAAI,WAAW,EAAE,gBAAgB,KAAK;AAAA,YACtC,GAAI,SAAS,EAAE,gBAAgB,QAAQ;AAAA,YACxC,eAAW,eAAG,QAAQ,YAAY,WAAW,OAAO,KAAK;AAAA,YACzD,MAAK;AAAA;AAAA,QACP;AAAA,QACA,6CAAC,QAAK,MAAM,WAAW,CAAC,OACtB,uDAAC,UAAK,WAAW,OAAO,MACtB,uDAAC,aAAU,GACb,GACF;AAAA,QACA,6CAAC,QAAK,MAAM,OACV,uDAAC,UAAK,WAAW,OAAO,MACtB,uDAAC,qBAAkB,GACrB,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["import_react","import_react","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FieldMessage.tsx","../../../src/context/field.tsx"],"sourcesContent":["'use client'\n\nimport type { HTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n fieldMessage,\n type FieldMessageVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport { useFieldContext } from '../context/field'\n\n/**\n * This module contains the FieldMessage component.\n * @module\n */\nexport interface FieldMessageBaseProps\n extends HTMLAttributes<HTMLParagraphElement> {\n /**\n * The id of the FieldMessage element describing the field. Required for accessibility. It is considered best practice to use the `help` or `error` prefix to help screen readers identify the type of message.\n *\n * @example For help messages: `help:field_id`\n * @example For error messages: `error:field_id`\n */\n id: string\n}\nexport type FieldMessageProps = FieldMessageBaseProps & FieldMessageVariantProps\n\n/**\n * A component that provides feedback about the field.\n * @see https://cerberus.digitalu.design/react/field-message\n * @example\n * ```tsx\n * <Field>\n * <Label htmlFor=\"first_name\">First Name</Label>\n * <Input aria-describedBy=\"help:first_name\" id=\"first_name\" type=\"text\" />\n * <FieldMessage id=\"help:first_name\">\n * This will only be used in your account information.\n * </FieldMessage>\n * </Field>\n * ```\n */\nexport function FieldMessage(props: FieldMessageProps) {\n const { invalid } = useFieldContext()\n return (\n <small\n {...props}\n {...(invalid && { 'aria-invalid': true })}\n className={cx(props.className, fieldMessage())}\n />\n )\n}\n","'use client'\n\nimport {\n createContext,\n useContext,\n useMemo,\n type PropsWithChildren,\n} from 'react'\n\n/**\n * This module provides a context and hook for the field.\n * @module Field\n */\n\nexport interface FieldContextValue {\n /**\n * Whether the field is disabled.\n * @description [Moz Input Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes)\n */\n disabled?: boolean\n /**\n * Whether the field is read-only.\n */\n readOnly?: boolean\n /**\n * Whether the field is required.\n */\n required?: boolean\n /**\n * Whether the field is invalid.\n */\n invalid?: boolean\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null)\n\n/**\n * Provides the field state for a all related components used within a group.\n * @see https://cerberus.digitalu.design/react/input\n */\nexport function Field(\n props: PropsWithChildren<FieldContextValue>,\n): JSX.Element {\n const value = useMemo(\n () => ({\n disabled: props.disabled,\n readOnly: props.readOnly,\n required: props.required,\n invalid: props.invalid,\n }),\n [props.disabled, props.readOnly, props.required, props.invalid],\n )\n\n return (\n <FieldContext.Provider value={value}>\n {props.children}\n </FieldContext.Provider>\n )\n}\n\n/**\n * Used to access the field context.\n * @returns The field context.\n */\nexport function useFieldContext(): FieldContextValue {\n const context = useContext(FieldContext)\n if (!context) {\n throw new Error('useFieldContext must be used within a Field Provider.')\n }\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAAmB;AACnB,qBAGO;;;ACLP,mBAKO;AA+CH;AApBJ,IAAM,mBAAe,4BAAwC,IAAI;AA8B1D,SAAS,kBAAqC;AACnD,QAAM,cAAU,yBAAW,YAAY;AACvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACzE;AACA,SAAO;AACT;;;AD3BI,IAAAA,sBAAA;AAHG,SAAS,aAAa,OAA0B;AACrD,QAAM,EAAE,QAAQ,IAAI,gBAAgB;AACpC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAI,WAAW,EAAE,gBAAgB,KAAK;AAAA,MACvC,eAAW,eAAG,MAAM,eAAW,6BAAa,CAAC;AAAA;AAAA,EAC/C;AAEJ;","names":["import_jsx_runtime"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Fieldset.tsx","../../../src/context/field.tsx"],"sourcesContent":["'use client'\n\nimport { css, cx } from '@cerberus/styled-system/css'\nimport type { FieldsetHTMLAttributes } from 'react'\nimport { useFieldContext } from '../context/field'\n\n/**\n * This module contains the Fieldset component.\n * @module Fieldset\n */\n\nexport type FieldsetProps = FieldsetHTMLAttributes<HTMLFieldSetElement>\n\n/**\n * A component to group related elements in a form for accessibility.\n * @memberof Field\n * @see https://cerberus.digitalu.com/react/fieldset\n * @description [A11y Form Checklist](https://www.a11yproject.com/checklist/#forms)\n * @description [MDN Web Docs: Fieldset](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset)\n * @example\n * ```tsx\n * import { Fieldset, Legend, Field, Radio, Label } from '@cerberus/react'\n * import { Hstack } from '@cerberus/styled-system/jsx'\n *\n * function SomeForm() {\n * return (\n * <form>\n * <Fieldset>\n * <Legend>Do you like cats?</Legend>\n * <Hstack>\n * <Field>\n * <Radio id=\"yes\" name=\"cats\" value=\"yes\" />\n * <Label htmlFor=\"yes\">Yes</Label>\n * </Field>\n * </Hstack>\n * <Hstack>\n * <Field>\n * <Radio id=\"no\" name=\"cats\" value=\"no\" />\n * <Label htmlFor=\"no\">No</Label>\n * </Field>\n * </Hstack>\n * </Fieldset>\n * </form>\n * )\n * }\n */\nexport function Fieldset(props: FieldsetProps) {\n const { invalid, ...formState } = useFieldContext()\n\n return (\n <fieldset\n {...props}\n {...formState}\n {...(invalid && { 'aria-invalid': true })}\n className={cx(\n props.className,\n css({\n border: 'none',\n pt: 2,\n margin: 0,\n }),\n )}\n />\n )\n}\n","'use client'\n\nimport {\n createContext,\n useContext,\n useMemo,\n type PropsWithChildren,\n} from 'react'\n\n/**\n * This module provides a context and hook for the field.\n * @module Field\n */\n\nexport interface FieldContextValue {\n /**\n * Whether the field is disabled.\n * @description [Moz Input Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes)\n */\n disabled?: boolean\n /**\n * Whether the field is read-only.\n */\n readOnly?: boolean\n /**\n * Whether the field is required.\n */\n required?: boolean\n /**\n * Whether the field is invalid.\n */\n invalid?: boolean\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null)\n\n/**\n * Provides the field state for a all related components used within a group.\n * @see https://cerberus.digitalu.design/react/input\n */\nexport function Field(\n props: PropsWithChildren<FieldContextValue>,\n): JSX.Element {\n const value = useMemo(\n () => ({\n disabled: props.disabled,\n readOnly: props.readOnly,\n required: props.required,\n invalid: props.invalid,\n }),\n [props.disabled, props.readOnly, props.required, props.invalid],\n )\n\n return (\n <FieldContext.Provider value={value}>\n {props.children}\n </FieldContext.Provider>\n )\n}\n\n/**\n * Used to access the field context.\n * @returns The field context.\n */\nexport function useFieldContext(): FieldContextValue {\n const context = useContext(FieldContext)\n if (!context) {\n throw new Error('useFieldContext must be used within a Field Provider.')\n }\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAwB;;;ACAxB,mBAKO;AA+CH;AApBJ,IAAM,mBAAe,4BAAwC,IAAI;AA8B1D,SAAS,kBAAqC;AACnD,QAAM,cAAU,yBAAW,YAAY;AACvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACzE;AACA,SAAO;AACT;;;ADpBI,IAAAA,sBAAA;AAJG,SAAS,SAAS,OAAsB;AAC7C,QAAM,EAAE,SAAS,GAAG,UAAU,IAAI,gBAAgB;AAElD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAI,WAAW,EAAE,gBAAgB,KAAK;AAAA,MACvC,eAAW;AAAA,QACT,MAAM;AAAA,YACN,gBAAI;AAAA,UACF,QAAQ;AAAA,UACR,IAAI;AAAA,UACJ,QAAQ;AAAA,QACV,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":["import_jsx_runtime"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/FieldsetLabel.tsx"],"sourcesContent":["import { cx } from '@cerberus/styled-system/css'\nimport { label, type LabelVariantProps } from '@cerberus/styled-system/recipes'\nimport type { LabelProps } from './Label'\n\n/**\n * This module contains the FieldsetLabel component.\n * @module FieldsetLabel\n */\n\nexport type FieldsetLabelProps = LabelProps & LabelVariantProps\n\n/**\n * Used for labeling inputs that are children of a Fieldset group.\n * @memberof Fieldset\n * @see https://cerberus.digitalu.design/react/fieldset\n * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)\n * @example\n * ```tsx\n * import { Fieldset, Legend, Field, Radio, Label } from '@cerberus/react'\n * import { Hstack } from '@cerberus/styled-system/jsx'\n *\n * function SomeForm() {\n * return (\n * <form>\n * <Fieldset>\n * <Legend>Do you like cats?</Legend>\n * <Hstack>\n * <Field>\n * <Radio id=\"yes\" name=\"cats\" value=\"yes\" />\n * <FieldsetLabel htmlFor=\"yes\">Yes</FieldsetLabel>\n * </Field>\n * </Hstack>\n * <Hstack>\n * <Field>\n * <Radio id=\"no\" name=\"cats\" value=\"no\" />\n * <FieldsetLabel htmlFor=\"no\">No</FieldsetLabel>\n * </Field>\n * </Hstack>\n * </Fieldset>\n * </form>\n * )\n * }\n * ```\n */\nexport function FieldsetLabel(props: FieldsetLabelProps) {\n const { size, usage, ...nativeProps } = props\n return (\n <label\n {...nativeProps}\n className={cx(\n nativeProps.className,\n label({\n size,\n usage,\n }),\n )}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAmB;AACnB,qBAA8C;AA8C1C;AAHG,SAAS,cAAc,OAA2B;AACvD,QAAM,EAAE,MAAM,OAAO,GAAG,YAAY,IAAI;AACxC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,eAAW;AAAA,QACT,YAAY;AAAA,YACZ,sBAAM;AAAA,UACJ;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/components/Input.tsx
|
|
22
|
-
var Input_exports = {};
|
|
23
|
-
__export(Input_exports, {
|
|
24
|
-
Input: () => Input
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(Input_exports);
|
|
27
|
-
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
28
|
-
var import_css = require("@cerberus/styled-system/css");
|
|
29
|
-
|
|
30
|
-
// src/context/field.tsx
|
|
31
|
-
var import_react = require("react");
|
|
32
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var FieldContext = (0, import_react.createContext)(null);
|
|
34
|
-
function useFieldContext() {
|
|
35
|
-
const context = (0, import_react.useContext)(FieldContext);
|
|
36
|
-
if (!context) {
|
|
37
|
-
throw new Error("useFieldContext must be used within a Field Provider.");
|
|
38
|
-
}
|
|
39
|
-
return context;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// src/context/cerberus.tsx
|
|
43
|
-
var import_react2 = require("react");
|
|
44
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
45
|
-
var CerberusContext = (0, import_react2.createContext)(null);
|
|
46
|
-
function useCerberusContext() {
|
|
47
|
-
const context = (0, import_react2.useContext)(CerberusContext);
|
|
48
|
-
if (!context) {
|
|
49
|
-
throw new Error("useCerberus must be used within a CerberusProvider");
|
|
50
|
-
}
|
|
51
|
-
return context;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// src/components/Show.tsx
|
|
55
|
-
var import_react3 = require("react");
|
|
56
|
-
function Show(props) {
|
|
57
|
-
const { when, children, fallback } = props;
|
|
58
|
-
const condition = (0, import_react3.useMemo)(() => when ?? false, [when]);
|
|
59
|
-
return (0, import_react3.useMemo)(() => {
|
|
60
|
-
if (condition) return children;
|
|
61
|
-
return fallback ?? null;
|
|
62
|
-
}, [condition, children, fallback]);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// src/components/Input.tsx
|
|
66
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
67
|
-
function Input(props) {
|
|
68
|
-
const { describedBy, size, startIcon, endIcon, ...nativeProps } = props;
|
|
69
|
-
const inputStyles = (0, import_recipes.input)({ size });
|
|
70
|
-
const { invalid, ...fieldStates } = useFieldContext();
|
|
71
|
-
const hasEndIcon = Boolean(endIcon);
|
|
72
|
-
const { icons } = useCerberusContext();
|
|
73
|
-
const { invalid: InvalidIcon } = icons;
|
|
74
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: inputStyles.root, children: [
|
|
75
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Show, { when: Boolean(startIcon), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: inputStyles.startIcon, children: startIcon }) }),
|
|
76
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
77
|
-
"input",
|
|
78
|
-
{
|
|
79
|
-
...nativeProps,
|
|
80
|
-
...fieldStates,
|
|
81
|
-
...describedBy && { "aria-describedby": describedBy },
|
|
82
|
-
...invalid && { "aria-invalid": true },
|
|
83
|
-
"data-start-icon": Boolean(startIcon),
|
|
84
|
-
className: (0, import_css.cx)("peer", nativeProps.className, inputStyles.input)
|
|
85
|
-
}
|
|
86
|
-
),
|
|
87
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Show, { when: invalid, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InvalidIcon, { className: inputStyles.icon }) }),
|
|
88
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Show, { when: hasEndIcon && !invalid, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: inputStyles.icon, children: endIcon }) })
|
|
89
|
-
] });
|
|
90
|
-
}
|
|
91
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
92
|
-
0 && (module.exports = {
|
|
93
|
-
Input
|
|
94
|
-
});
|
|
95
|
-
//# sourceMappingURL=Input.cjs.map
|