@cerberus-design/react 0.8.0 → 0.8.1
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.ts → _tsup-dts-rollup.d.cts} +207 -5
- package/build/legacy/aria-helpers/nav-menu.aria.cjs +36 -0
- package/build/legacy/aria-helpers/nav-menu.aria.cjs.map +1 -0
- package/build/legacy/aria-helpers/tabs.aria.cjs +100 -0
- package/build/legacy/aria-helpers/tabs.aria.cjs.map +1 -0
- package/build/legacy/aria-helpers/trap-focus.aria.cjs +54 -0
- package/build/legacy/aria-helpers/trap-focus.aria.cjs.map +1 -0
- package/build/legacy/components/Button.cjs +50 -0
- package/build/legacy/components/Button.cjs.map +1 -0
- package/build/legacy/components/Checkbox.cjs +157 -0
- package/build/legacy/components/Checkbox.cjs.map +1 -0
- package/build/legacy/components/Droppable.cjs +54 -0
- package/build/legacy/components/Droppable.cjs.map +1 -0
- package/build/legacy/components/FeatureFlag.cjs +63 -0
- package/build/legacy/components/FeatureFlag.cjs.map +1 -0
- package/build/legacy/components/FieldMessage.cjs +59 -0
- package/build/legacy/components/FieldMessage.cjs.map +1 -0
- package/build/legacy/components/FileStatus.cjs +390 -0
- package/build/legacy/components/FileStatus.cjs.map +1 -0
- package/build/legacy/components/FileUploader.cjs +159 -0
- package/build/legacy/components/FileUploader.cjs.map +1 -0
- package/build/legacy/components/IconButton.cjs +53 -0
- package/build/legacy/components/IconButton.cjs.map +1 -0
- package/build/legacy/components/Input.cjs +145 -0
- package/build/legacy/components/Input.cjs.map +1 -0
- package/build/legacy/components/Label.cjs +93 -0
- package/build/legacy/components/Label.cjs.map +1 -0
- package/build/legacy/components/Modal.cjs +45 -0
- package/build/legacy/components/Modal.cjs.map +1 -0
- package/build/legacy/components/ModalDescription.cjs +36 -0
- package/build/legacy/components/ModalDescription.cjs.map +1 -0
- package/build/legacy/components/ModalHeader.cjs +49 -0
- package/build/legacy/components/ModalHeader.cjs.map +1 -0
- package/build/legacy/components/ModalHeading.cjs +36 -0
- package/build/legacy/components/ModalHeading.cjs.map +1 -0
- package/build/legacy/components/ModalIcon.cjs +51 -0
- package/build/legacy/components/ModalIcon.cjs.map +1 -0
- package/build/legacy/components/NavMenuLink.cjs +81 -0
- package/build/legacy/components/NavMenuLink.cjs.map +1 -0
- package/build/legacy/components/NavMenuList.cjs +131 -0
- package/build/legacy/components/NavMenuList.cjs.map +1 -0
- package/build/legacy/components/NavMenuTrigger.cjs +128 -0
- package/build/legacy/components/NavMenuTrigger.cjs.map +1 -0
- package/build/legacy/components/Notification.cjs +181 -0
- package/build/legacy/components/Notification.cjs.map +1 -0
- package/build/legacy/components/NotificationDescription.cjs +44 -0
- package/build/legacy/components/NotificationDescription.cjs.map +1 -0
- package/build/legacy/components/NotificationHeading.cjs +38 -0
- package/build/legacy/components/NotificationHeading.cjs.map +1 -0
- package/build/legacy/components/Portal.cjs +35 -0
- package/build/legacy/components/Portal.cjs.map +1 -0
- package/build/legacy/components/ProgressBar.cjs +61 -0
- package/build/legacy/components/ProgressBar.cjs.map +1 -0
- package/build/legacy/components/Radio.cjs +68 -0
- package/build/legacy/components/Radio.cjs.map +1 -0
- package/build/legacy/components/Select.cjs +170 -0
- package/build/legacy/components/Select.cjs.map +1 -0
- package/build/legacy/components/Show.cjs +40 -0
- package/build/legacy/components/Show.cjs.map +1 -0
- package/build/legacy/components/Tab.cjs +135 -0
- package/build/legacy/components/Tab.cjs.map +1 -0
- package/build/legacy/components/TabList.cjs +68 -0
- package/build/legacy/components/TabList.cjs.map +1 -0
- package/build/legacy/components/TabPanel.cjs +76 -0
- package/build/legacy/components/TabPanel.cjs.map +1 -0
- package/build/legacy/components/Table.cjs +53 -0
- package/build/legacy/components/Table.cjs.map +1 -0
- package/build/legacy/components/Tag.cjs +91 -0
- package/build/legacy/components/Tag.cjs.map +1 -0
- package/build/legacy/components/Tbody.cjs +48 -0
- package/build/legacy/components/Tbody.cjs.map +1 -0
- package/build/legacy/components/Td.cjs +48 -0
- package/build/legacy/components/Td.cjs.map +1 -0
- package/build/legacy/components/Textarea.cjs +71 -0
- package/build/legacy/components/Textarea.cjs.map +1 -0
- package/build/legacy/components/Th.cjs +80 -0
- package/build/legacy/components/Th.cjs.map +1 -0
- package/build/legacy/components/Thead.cjs +36 -0
- package/build/legacy/components/Thead.cjs.map +1 -0
- package/build/legacy/components/Toggle.cjs +151 -0
- package/build/legacy/components/Toggle.cjs.map +1 -0
- package/build/legacy/config/cerbIcons.cjs +88 -0
- package/build/legacy/config/cerbIcons.cjs.map +1 -0
- package/build/legacy/config/defineIcons.cjs +110 -0
- package/build/legacy/config/defineIcons.cjs.map +1 -0
- package/build/legacy/config/icons/checkbox.icons.cjs +67 -0
- package/build/legacy/config/icons/checkbox.icons.cjs.map +1 -0
- package/build/legacy/context/confirm-modal.cjs +371 -0
- package/build/legacy/context/confirm-modal.cjs.map +1 -0
- package/build/legacy/context/feature-flags.cjs +48 -0
- package/build/legacy/context/feature-flags.cjs.map +1 -0
- package/build/legacy/context/field.cjs +55 -0
- package/build/legacy/context/field.cjs.map +1 -0
- package/build/legacy/context/navMenu.cjs +70 -0
- package/build/legacy/context/navMenu.cjs.map +1 -0
- package/build/legacy/context/notification-center.cjs +347 -0
- package/build/legacy/context/notification-center.cjs.map +1 -0
- package/build/legacy/context/prompt-modal.cjs +508 -0
- package/build/legacy/context/prompt-modal.cjs.map +1 -0
- package/build/legacy/context/tabs.cjs +78 -0
- package/build/legacy/context/tabs.cjs.map +1 -0
- package/build/legacy/context/theme.cjs +104 -0
- package/build/legacy/context/theme.cjs.map +1 -0
- package/build/legacy/hooks/useModal.cjs +50 -0
- package/build/legacy/hooks/useModal.cjs.map +1 -0
- package/build/legacy/hooks/useTheme.cjs +87 -0
- package/build/legacy/hooks/useTheme.cjs.map +1 -0
- package/build/legacy/hooks/useToggle.cjs +47 -0
- package/build/legacy/hooks/useToggle.cjs.map +1 -0
- package/build/legacy/index.cjs +2165 -0
- package/build/legacy/index.cjs.map +1 -0
- package/build/legacy/types.cjs +19 -0
- package/build/legacy/types.cjs.map +1 -0
- package/build/modern/_tsup-dts-rollup.d.ts +207 -5
- package/build/{legacy/chunk-JJGZRBIR.js → modern/chunk-2FK7NR7Y.js} +8 -7
- package/build/{legacy/chunk-JJGZRBIR.js.map → modern/chunk-2FK7NR7Y.js.map} +1 -1
- package/build/modern/chunk-4FD33RTW.js +56 -0
- package/build/modern/chunk-4FD33RTW.js.map +1 -0
- package/build/modern/{chunk-XB4ZRAH4.js → chunk-53QBTZZF.js} +5 -5
- package/build/modern/{chunk-BEYPMC73.js → chunk-5WVXIAG2.js} +2 -2
- package/build/modern/chunk-7NX4RGDB.js +218 -0
- package/build/modern/chunk-7NX4RGDB.js.map +1 -0
- package/build/modern/chunk-CP7OUC2Q.js +42 -0
- package/build/modern/chunk-CP7OUC2Q.js.map +1 -0
- package/build/modern/{chunk-4N2L357B.js → chunk-EJIMJWPB.js} +2 -2
- package/build/{legacy/chunk-GVNPFXKL.js → modern/chunk-GUECLKHY.js} +18 -1
- package/build/modern/chunk-GUECLKHY.js.map +1 -0
- package/build/modern/{chunk-Y5IY7O23.js → chunk-GZY6CH7D.js} +5 -5
- package/build/{legacy/chunk-IL5ELPTT.js → modern/chunk-ID3XWGLY.js} +2 -2
- package/build/modern/chunk-RHG26FYL.js +68 -0
- package/build/modern/chunk-RHG26FYL.js.map +1 -0
- package/build/modern/{chunk-LTDNZRUY.js → chunk-S6CMAXQF.js} +10 -10
- package/build/modern/{chunk-IOG6XIR5.js → chunk-TF3HRELU.js} +3 -3
- package/build/modern/{chunk-IOG6XIR5.js.map → chunk-TF3HRELU.js.map} +1 -1
- package/build/modern/chunk-TYTEREKZ.js +39 -0
- package/build/modern/chunk-TYTEREKZ.js.map +1 -0
- package/build/{legacy/chunk-JJP2TFTU.js → modern/chunk-VCR5C6Q3.js} +1 -1
- package/build/modern/chunk-VCR5C6Q3.js.map +1 -0
- package/build/modern/{chunk-QO2UXGW4.js → chunk-VPWBSZAR.js} +2 -2
- package/build/modern/components/Checkbox.js +13 -0
- package/build/modern/components/FileStatus.js +17 -0
- package/build/modern/components/FileUploader.js +4 -3
- package/build/modern/components/Input.js +5 -4
- package/build/modern/components/Label.js +2 -2
- package/build/modern/components/ModalIcon.js +1 -1
- package/build/modern/components/Notification.js +4 -3
- package/build/modern/components/ProgressBar.js +7 -0
- package/build/modern/components/Select.js +15 -0
- package/build/modern/components/Toggle.js +4 -3
- package/build/modern/config/cerbIcons.js +2 -1
- package/build/modern/config/defineIcons.js +3 -2
- package/build/modern/config/icons/checkbox.icons.js +9 -0
- package/build/modern/context/confirm-modal.js +5 -4
- package/build/modern/context/notification-center.js +5 -4
- package/build/modern/context/prompt-modal.js +8 -7
- package/build/modern/index.js +59 -38
- package/build/modern/index.js.map +1 -1
- package/package.json +6 -6
- package/src/components/Checkbox.tsx +76 -0
- package/src/components/FileStatus.tsx +246 -0
- package/src/components/FileUploader.tsx +1 -1
- package/src/components/Label.tsx +3 -2
- package/src/components/ModalIcon.tsx +2 -2
- package/src/components/ProgressBar.tsx +61 -0
- package/src/components/Select.tsx +96 -0
- package/src/config/cerbIcons.ts +20 -0
- package/src/config/icons/checkbox.icons.tsx +49 -0
- package/src/index.ts +4 -0
- package/build/legacy/aria-helpers/nav-menu.aria.js +0 -7
- package/build/legacy/aria-helpers/tabs.aria.js +0 -9
- package/build/legacy/aria-helpers/trap-focus.aria.js +0 -7
- package/build/legacy/chunk-2UFNQM55.js +0 -21
- package/build/legacy/chunk-2UFNQM55.js.map +0 -1
- package/build/legacy/chunk-2VPKILZ6.js +0 -122
- package/build/legacy/chunk-2VPKILZ6.js.map +0 -1
- package/build/legacy/chunk-3C2DJSEE.js +0 -16
- package/build/legacy/chunk-3C2DJSEE.js.map +0 -1
- package/build/legacy/chunk-3GXISGPS.js +0 -47
- package/build/legacy/chunk-3GXISGPS.js.map +0 -1
- package/build/legacy/chunk-4CAT3FHV.js +0 -11
- package/build/legacy/chunk-4CAT3FHV.js.map +0 -1
- package/build/legacy/chunk-4M3EUP57.js +0 -22
- package/build/legacy/chunk-4M3EUP57.js.map +0 -1
- package/build/legacy/chunk-4M4LCQ43.js +0 -12
- package/build/legacy/chunk-4M4LCQ43.js.map +0 -1
- package/build/legacy/chunk-4O4QFF4S.js +0 -15
- package/build/legacy/chunk-4O4QFF4S.js.map +0 -1
- package/build/legacy/chunk-55J6XMHW.js +0 -1
- package/build/legacy/chunk-6DIGPXAD.js +0 -48
- package/build/legacy/chunk-6DIGPXAD.js.map +0 -1
- package/build/legacy/chunk-6F34A7NZ.js +0 -28
- package/build/legacy/chunk-6F34A7NZ.js.map +0 -1
- package/build/legacy/chunk-7VJOPJVX.js +0 -29
- package/build/legacy/chunk-7VJOPJVX.js.map +0 -1
- package/build/legacy/chunk-A5WYZVUR.js +0 -28
- package/build/legacy/chunk-A5WYZVUR.js.map +0 -1
- package/build/legacy/chunk-AAKIOHAX.js +0 -155
- package/build/legacy/chunk-AAKIOHAX.js.map +0 -1
- package/build/legacy/chunk-BEYPMC73.js +0 -27
- package/build/legacy/chunk-EVEEQRH6.js +0 -58
- package/build/legacy/chunk-EVEEQRH6.js.map +0 -1
- package/build/legacy/chunk-GKUDLVOV.js +0 -64
- package/build/legacy/chunk-GKUDLVOV.js.map +0 -1
- package/build/legacy/chunk-GVNPFXKL.js.map +0 -1
- package/build/legacy/chunk-HW76XVA3.js +0 -22
- package/build/legacy/chunk-HW76XVA3.js.map +0 -1
- package/build/legacy/chunk-ISPTI4GC.js +0 -32
- package/build/legacy/chunk-ISPTI4GC.js.map +0 -1
- package/build/legacy/chunk-JB7IQ2BM.js +0 -12
- package/build/legacy/chunk-JB7IQ2BM.js.map +0 -1
- package/build/legacy/chunk-JF76VIL3.js +0 -12
- package/build/legacy/chunk-JF76VIL3.js.map +0 -1
- package/build/legacy/chunk-JJP2TFTU.js.map +0 -1
- package/build/legacy/chunk-KESKDLX6.js +0 -30
- package/build/legacy/chunk-KESKDLX6.js.map +0 -1
- package/build/legacy/chunk-KF24CS4S.js +0 -58
- package/build/legacy/chunk-KF24CS4S.js.map +0 -1
- package/build/legacy/chunk-KJUCHZHV.js +0 -51
- package/build/legacy/chunk-KJUCHZHV.js.map +0 -1
- package/build/legacy/chunk-L46XIE3D.js +0 -208
- package/build/legacy/chunk-L46XIE3D.js.map +0 -1
- package/build/legacy/chunk-LF2QFS5S.js +0 -76
- package/build/legacy/chunk-N3FUF4TB.js +0 -12
- package/build/legacy/chunk-N3FUF4TB.js.map +0 -1
- package/build/legacy/chunk-NE5NHILF.js +0 -47
- package/build/legacy/chunk-NE5NHILF.js.map +0 -1
- package/build/legacy/chunk-PH64POOB.js +0 -33
- package/build/legacy/chunk-PH64POOB.js.map +0 -1
- package/build/legacy/chunk-PJ3744I6.js +0 -24
- package/build/legacy/chunk-PJ3744I6.js.map +0 -1
- package/build/legacy/chunk-PMCYXRAH.js +0 -86
- package/build/legacy/chunk-PMCYXRAH.js.map +0 -1
- package/build/legacy/chunk-QU7UV5DB.js +0 -25
- package/build/legacy/chunk-QU7UV5DB.js.map +0 -1
- package/build/legacy/chunk-RPZAPUCF.js +0 -81
- package/build/legacy/chunk-RPZAPUCF.js.map +0 -1
- package/build/legacy/chunk-SCQVXJBT.js +0 -22
- package/build/legacy/chunk-SCQVXJBT.js.map +0 -1
- package/build/legacy/chunk-SLHX5K6I.js +0 -29
- package/build/legacy/chunk-SLHX5K6I.js.map +0 -1
- package/build/legacy/chunk-SMCEFK6Q.js +0 -63
- package/build/legacy/chunk-SMCEFK6Q.js.map +0 -1
- package/build/legacy/chunk-SXXWC6UD.js +0 -83
- package/build/legacy/chunk-SXXWC6UD.js.map +0 -1
- package/build/legacy/chunk-TCO46FK7.js +0 -36
- package/build/legacy/chunk-TCO46FK7.js.map +0 -1
- package/build/legacy/chunk-TZNYJ3G7.js +0 -25
- package/build/legacy/chunk-TZNYJ3G7.js.map +0 -1
- package/build/legacy/chunk-U72VPIZA.js +0 -32
- package/build/legacy/chunk-U72VPIZA.js.map +0 -1
- package/build/legacy/chunk-VGHVH2T3.js +0 -24
- package/build/legacy/chunk-VGHVH2T3.js.map +0 -1
- package/build/legacy/chunk-VULPMZUW.js +0 -18
- package/build/legacy/chunk-VULPMZUW.js.map +0 -1
- package/build/legacy/chunk-XB4ZRAH4.js +0 -42
- package/build/legacy/chunk-XREC5IJE.js +0 -24
- package/build/legacy/chunk-XREC5IJE.js.map +0 -1
- package/build/legacy/chunk-ZAU4JVLL.js +0 -33
- package/build/legacy/chunk-ZAU4JVLL.js.map +0 -1
- package/build/legacy/components/Button.js +0 -7
- package/build/legacy/components/Droppable.js +0 -8
- package/build/legacy/components/Droppable.js.map +0 -1
- package/build/legacy/components/FeatureFlag.js +0 -10
- package/build/legacy/components/FeatureFlag.js.map +0 -1
- package/build/legacy/components/FieldMessage.js +0 -9
- package/build/legacy/components/FieldMessage.js.map +0 -1
- package/build/legacy/components/FileUploader.js +0 -11
- package/build/legacy/components/FileUploader.js.map +0 -1
- package/build/legacy/components/IconButton.js +0 -7
- package/build/legacy/components/IconButton.js.map +0 -1
- package/build/legacy/components/Input.js +0 -12
- package/build/legacy/components/Input.js.map +0 -1
- package/build/legacy/components/Label.js +0 -10
- package/build/legacy/components/Label.js.map +0 -1
- package/build/legacy/components/Modal.js +0 -7
- package/build/legacy/components/Modal.js.map +0 -1
- package/build/legacy/components/ModalDescription.js +0 -7
- package/build/legacy/components/ModalDescription.js.map +0 -1
- package/build/legacy/components/ModalHeader.js +0 -7
- package/build/legacy/components/ModalHeader.js.map +0 -1
- package/build/legacy/components/ModalHeading.js +0 -7
- package/build/legacy/components/ModalHeading.js.map +0 -1
- package/build/legacy/components/ModalIcon.js +0 -7
- package/build/legacy/components/ModalIcon.js.map +0 -1
- package/build/legacy/components/NavMenuLink.js +0 -8
- package/build/legacy/components/NavMenuLink.js.map +0 -1
- package/build/legacy/components/NavMenuList.js +0 -12
- package/build/legacy/components/NavMenuList.js.map +0 -1
- package/build/legacy/components/NavMenuTrigger.js +0 -11
- package/build/legacy/components/NavMenuTrigger.js.map +0 -1
- package/build/legacy/components/Notification.js +0 -11
- package/build/legacy/components/Notification.js.map +0 -1
- package/build/legacy/components/NotificationDescription.js +0 -7
- package/build/legacy/components/NotificationDescription.js.map +0 -1
- package/build/legacy/components/NotificationHeading.js +0 -7
- package/build/legacy/components/NotificationHeading.js.map +0 -1
- package/build/legacy/components/Portal.js +0 -7
- package/build/legacy/components/Portal.js.map +0 -1
- package/build/legacy/components/Radio.js +0 -9
- package/build/legacy/components/Radio.js.map +0 -1
- package/build/legacy/components/Show.js +0 -8
- package/build/legacy/components/Show.js.map +0 -1
- package/build/legacy/components/Tab.js +0 -10
- package/build/legacy/components/Tab.js.map +0 -1
- package/build/legacy/components/TabList.js +0 -9
- package/build/legacy/components/TabList.js.map +0 -1
- package/build/legacy/components/TabPanel.js +0 -10
- package/build/legacy/components/TabPanel.js.map +0 -1
- package/build/legacy/components/Table.js +0 -9
- package/build/legacy/components/Table.js.map +0 -1
- package/build/legacy/components/Tag.js +0 -8
- package/build/legacy/components/Tag.js.map +0 -1
- package/build/legacy/components/Tbody.js +0 -7
- package/build/legacy/components/Tbody.js.map +0 -1
- package/build/legacy/components/Td.js +0 -7
- package/build/legacy/components/Td.js.map +0 -1
- package/build/legacy/components/Textarea.js +0 -9
- package/build/legacy/components/Textarea.js.map +0 -1
- package/build/legacy/components/Th.js +0 -8
- package/build/legacy/components/Th.js.map +0 -1
- package/build/legacy/components/Thead.js +0 -7
- package/build/legacy/components/Thead.js.map +0 -1
- package/build/legacy/components/Toggle.js +0 -11
- package/build/legacy/components/Toggle.js.map +0 -1
- package/build/legacy/config/cerbIcons.js +0 -7
- package/build/legacy/config/cerbIcons.js.map +0 -1
- package/build/legacy/config/defineIcons.js +0 -10
- package/build/legacy/config/defineIcons.js.map +0 -1
- package/build/legacy/context/confirm-modal.js +0 -22
- package/build/legacy/context/confirm-modal.js.map +0 -1
- package/build/legacy/context/feature-flags.js +0 -10
- package/build/legacy/context/feature-flags.js.map +0 -1
- package/build/legacy/context/field.js +0 -10
- package/build/legacy/context/field.js.map +0 -1
- package/build/legacy/context/navMenu.js +0 -10
- package/build/legacy/context/navMenu.js.map +0 -1
- package/build/legacy/context/notification-center.js +0 -19
- package/build/legacy/context/notification-center.js.map +0 -1
- package/build/legacy/context/prompt-modal.js +0 -25
- package/build/legacy/context/prompt-modal.js.map +0 -1
- package/build/legacy/context/tabs.js +0 -12
- package/build/legacy/context/tabs.js.map +0 -1
- package/build/legacy/context/theme.js +0 -14
- package/build/legacy/context/theme.js.map +0 -1
- package/build/legacy/hooks/useModal.js +0 -8
- package/build/legacy/hooks/useModal.js.map +0 -1
- package/build/legacy/hooks/useTheme.js +0 -8
- package/build/legacy/hooks/useTheme.js.map +0 -1
- package/build/legacy/hooks/useToggle.js +0 -8
- package/build/legacy/hooks/useToggle.js.map +0 -1
- package/build/legacy/index.js +0 -226
- package/build/legacy/index.js.map +0 -1
- package/build/legacy/types.js +0 -2
- package/build/legacy/types.js.map +0 -1
- package/build/modern/chunk-4N2L357B.js.map +0 -1
- package/build/modern/chunk-BEYPMC73.js.map +0 -1
- package/build/modern/chunk-GVNPFXKL.js +0 -26
- package/build/modern/chunk-GVNPFXKL.js.map +0 -1
- package/build/modern/chunk-IL5ELPTT.js +0 -58
- package/build/modern/chunk-IL5ELPTT.js.map +0 -1
- package/build/modern/chunk-JJGZRBIR.js +0 -49
- package/build/modern/chunk-JJGZRBIR.js.map +0 -1
- package/build/modern/chunk-JJP2TFTU.js +0 -29
- package/build/modern/chunk-JJP2TFTU.js.map +0 -1
- package/build/modern/chunk-XB4ZRAH4.js.map +0 -1
- /package/build/legacy/{noExternals.d.ts → noExternals.d.cts} +0 -0
- /package/build/{legacy/chunk-XB4ZRAH4.js.map → modern/chunk-53QBTZZF.js.map} +0 -0
- /package/build/{legacy/chunk-BEYPMC73.js.map → modern/chunk-5WVXIAG2.js.map} +0 -0
- /package/build/{legacy/chunk-LF2QFS5S.js.map → modern/chunk-EJIMJWPB.js.map} +0 -0
- /package/build/modern/{chunk-Y5IY7O23.js.map → chunk-GZY6CH7D.js.map} +0 -0
- /package/build/{legacy/chunk-IL5ELPTT.js.map → modern/chunk-ID3XWGLY.js.map} +0 -0
- /package/build/modern/{chunk-LTDNZRUY.js.map → chunk-S6CMAXQF.js.map} +0 -0
- /package/build/modern/{chunk-QO2UXGW4.js.map → chunk-VPWBSZAR.js.map} +0 -0
- /package/build/{legacy/aria-helpers/nav-menu.aria.js.map → modern/components/Checkbox.js.map} +0 -0
- /package/build/{legacy/aria-helpers/tabs.aria.js.map → modern/components/FileStatus.js.map} +0 -0
- /package/build/{legacy/aria-helpers/trap-focus.aria.js.map → modern/components/ProgressBar.js.map} +0 -0
- /package/build/{legacy/chunk-55J6XMHW.js.map → modern/components/Select.js.map} +0 -0
- /package/build/{legacy/components/Button.js.map → modern/config/icons/checkbox.icons.js.map} +0 -0
|
@@ -0,0 +1,371 @@
|
|
|
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/context/confirm-modal.tsx
|
|
22
|
+
var confirm_modal_exports = {};
|
|
23
|
+
__export(confirm_modal_exports, {
|
|
24
|
+
ConfirmModal: () => ConfirmModal,
|
|
25
|
+
useConfirmModal: () => useConfirmModal
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(confirm_modal_exports);
|
|
28
|
+
var import_react4 = require("react");
|
|
29
|
+
|
|
30
|
+
// src/components/Portal.tsx
|
|
31
|
+
var import_react_dom = require("react-dom");
|
|
32
|
+
function Portal(props) {
|
|
33
|
+
const container = props.container || document.body;
|
|
34
|
+
return (0, import_react_dom.createPortal)(props.children, container, props.key);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// src/components/Button.tsx
|
|
38
|
+
var import_css = require("@cerberus/styled-system/css");
|
|
39
|
+
var import_recipes = require("@cerberus/styled-system/recipes");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
function Button(props) {
|
|
42
|
+
const { palette, usage, shape, ...nativeProps } = props;
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
...nativeProps,
|
|
47
|
+
className: (0, import_css.cx)(
|
|
48
|
+
nativeProps.className,
|
|
49
|
+
(0, import_recipes.button)({
|
|
50
|
+
palette,
|
|
51
|
+
usage,
|
|
52
|
+
shape
|
|
53
|
+
})
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/context/confirm-modal.tsx
|
|
60
|
+
var import_css7 = require("@cerberus/styled-system/css");
|
|
61
|
+
var import_patterns3 = require("@cerberus/styled-system/patterns");
|
|
62
|
+
|
|
63
|
+
// src/config/cerbIcons.ts
|
|
64
|
+
var import_icons = require("@cerberus/icons");
|
|
65
|
+
|
|
66
|
+
// src/config/icons/checkbox.icons.tsx
|
|
67
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
68
|
+
function CheckmarkIcon(props) {
|
|
69
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
70
|
+
"svg",
|
|
71
|
+
{
|
|
72
|
+
"aria-hidden": "true",
|
|
73
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
74
|
+
fill: "none",
|
|
75
|
+
role: "img",
|
|
76
|
+
viewBox: "0 0 24 24",
|
|
77
|
+
...props,
|
|
78
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
79
|
+
"path",
|
|
80
|
+
{
|
|
81
|
+
fill: "currentColor",
|
|
82
|
+
d: "M9.714 18 4 12.335l1.818-1.764 3.896 3.824L18.181 6 20 7.803 9.714 18Z"
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
function IndeterminateIcon(props) {
|
|
89
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
90
|
+
"svg",
|
|
91
|
+
{
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
94
|
+
role: "img",
|
|
95
|
+
fill: "none",
|
|
96
|
+
viewBox: "0 0 24 24",
|
|
97
|
+
...props,
|
|
98
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { fill: "currentColor", d: "M4 11h16v2.667H4z" })
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// src/config/cerbIcons.ts
|
|
104
|
+
var defaultIcons = {
|
|
105
|
+
checkbox: CheckmarkIcon,
|
|
106
|
+
close: import_icons.CloseFilled,
|
|
107
|
+
confirmModal: import_icons.Information,
|
|
108
|
+
delete: import_icons.TrashCan,
|
|
109
|
+
promptModal: import_icons.Information,
|
|
110
|
+
fileUploader: import_icons.CloudUpload,
|
|
111
|
+
indeterminate: IndeterminateIcon,
|
|
112
|
+
infoNotification: import_icons.InformationFilled,
|
|
113
|
+
successNotification: import_icons.CheckmarkFilled,
|
|
114
|
+
warningNotification: import_icons.WarningFilled,
|
|
115
|
+
dangerNotification: import_icons.ErrorFilled,
|
|
116
|
+
invalid: import_icons.WarningFilled,
|
|
117
|
+
invalidAlt: import_icons.Warning,
|
|
118
|
+
redo: import_icons.Restart,
|
|
119
|
+
selectArrow: import_icons.ChevronDown,
|
|
120
|
+
toggleChecked: import_icons.Checkmark
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// src/config/defineIcons.ts
|
|
124
|
+
var $cerberusIcons = defaultIcons;
|
|
125
|
+
|
|
126
|
+
// src/aria-helpers/trap-focus.aria.ts
|
|
127
|
+
function trapFocus(modalRef) {
|
|
128
|
+
var _a;
|
|
129
|
+
const focusableElements = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
130
|
+
const focusable = Array.from(
|
|
131
|
+
((_a = modalRef.current) == null ? void 0 : _a.querySelectorAll(focusableElements)) ?? []
|
|
132
|
+
);
|
|
133
|
+
const firstFocusable = focusable[0];
|
|
134
|
+
const lastFocusable = focusable[focusable.length - 1];
|
|
135
|
+
return function handleKeyDown(event) {
|
|
136
|
+
if (event.key === "Tab") {
|
|
137
|
+
if (event.shiftKey) {
|
|
138
|
+
if (document.activeElement === firstFocusable) {
|
|
139
|
+
lastFocusable.focus();
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
}
|
|
142
|
+
} else {
|
|
143
|
+
if (document.activeElement === lastFocusable) {
|
|
144
|
+
firstFocusable.focus();
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// src/components/ModalIcon.tsx
|
|
153
|
+
var import_css2 = require("@cerberus/styled-system/css");
|
|
154
|
+
var import_patterns = require("@cerberus/styled-system/patterns");
|
|
155
|
+
var import_recipes2 = require("@cerberus/styled-system/recipes");
|
|
156
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
157
|
+
function ModalIcon(props) {
|
|
158
|
+
const { palette, ...nativeProps } = props;
|
|
159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
160
|
+
"div",
|
|
161
|
+
{
|
|
162
|
+
...nativeProps,
|
|
163
|
+
className: (0, import_css2.cx)(
|
|
164
|
+
nativeProps.className,
|
|
165
|
+
(0, import_recipes2.modalIcon)({
|
|
166
|
+
palette
|
|
167
|
+
}),
|
|
168
|
+
(0, import_patterns.circle)()
|
|
169
|
+
),
|
|
170
|
+
children: props.children
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// src/components/Show.tsx
|
|
176
|
+
var import_react = require("react");
|
|
177
|
+
function Show(props) {
|
|
178
|
+
const { when, children, fallback } = props;
|
|
179
|
+
const condition = (0, import_react.useMemo)(() => when ?? false, [when]);
|
|
180
|
+
return (0, import_react.useMemo)(() => {
|
|
181
|
+
if (condition) return children;
|
|
182
|
+
return fallback ?? null;
|
|
183
|
+
}, [condition, children, fallback]);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// src/components/Modal.tsx
|
|
187
|
+
var import_css3 = require("@cerberus/styled-system/css");
|
|
188
|
+
var import_recipes3 = require("@cerberus/styled-system/recipes");
|
|
189
|
+
var import_react2 = require("react");
|
|
190
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
191
|
+
function ModalEl(props, ref) {
|
|
192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
193
|
+
"dialog",
|
|
194
|
+
{
|
|
195
|
+
...props,
|
|
196
|
+
className: (0, import_css3.cx)(props.className, (0, import_recipes3.modal)().dialog),
|
|
197
|
+
ref
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
var Modal = (0, import_react2.forwardRef)(ModalEl);
|
|
202
|
+
|
|
203
|
+
// src/hooks/useModal.ts
|
|
204
|
+
var import_react3 = require("react");
|
|
205
|
+
function useModal() {
|
|
206
|
+
const modalRef = (0, import_react3.useRef)(null);
|
|
207
|
+
const show = (0, import_react3.useCallback)(() => {
|
|
208
|
+
var _a;
|
|
209
|
+
(_a = modalRef.current) == null ? void 0 : _a.showModal();
|
|
210
|
+
}, []);
|
|
211
|
+
const close = (0, import_react3.useCallback)(() => {
|
|
212
|
+
var _a;
|
|
213
|
+
(_a = modalRef.current) == null ? void 0 : _a.close();
|
|
214
|
+
}, []);
|
|
215
|
+
return (0, import_react3.useMemo)(() => {
|
|
216
|
+
return {
|
|
217
|
+
modalRef,
|
|
218
|
+
show,
|
|
219
|
+
close
|
|
220
|
+
};
|
|
221
|
+
}, [modalRef, show, close]);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// src/components/ModalHeader.tsx
|
|
225
|
+
var import_css4 = require("@cerberus/styled-system/css");
|
|
226
|
+
var import_patterns2 = require("@cerberus/styled-system/patterns");
|
|
227
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
228
|
+
function ModalHeader(props) {
|
|
229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
230
|
+
"div",
|
|
231
|
+
{
|
|
232
|
+
...props,
|
|
233
|
+
className: (0, import_css4.cx)(
|
|
234
|
+
props.className,
|
|
235
|
+
(0, import_patterns2.vstack)({
|
|
236
|
+
alignItems: "flex-start",
|
|
237
|
+
gap: "4",
|
|
238
|
+
mb: "8"
|
|
239
|
+
})
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// src/components/ModalHeading.tsx
|
|
246
|
+
var import_css5 = require("@cerberus/styled-system/css");
|
|
247
|
+
var import_recipes4 = require("@cerberus/styled-system/recipes");
|
|
248
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
249
|
+
function ModalHeading(props) {
|
|
250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { ...props, className: (0, import_css5.cx)(props.className, (0, import_recipes4.modal)().heading) });
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// src/components/ModalDescription.tsx
|
|
254
|
+
var import_css6 = require("@cerberus/styled-system/css");
|
|
255
|
+
var import_recipes5 = require("@cerberus/styled-system/recipes");
|
|
256
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
257
|
+
function ModalDescription(props) {
|
|
258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { ...props, className: (0, import_css6.cx)(props.className, (0, import_recipes5.modal)().description) });
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// src/context/confirm-modal.tsx
|
|
262
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
263
|
+
var ConfirmModalContext = (0, import_react4.createContext)(null);
|
|
264
|
+
function ConfirmModal(props) {
|
|
265
|
+
const { modalRef, show, close } = useModal();
|
|
266
|
+
const resolveRef = (0, import_react4.useRef)(null);
|
|
267
|
+
const [content, setContent] = (0, import_react4.useState)(null);
|
|
268
|
+
const focusTrap = trapFocus(modalRef);
|
|
269
|
+
const ConfirmIcon = $cerberusIcons.confirmModal;
|
|
270
|
+
const palette = (0, import_react4.useMemo)(
|
|
271
|
+
() => (content == null ? void 0 : content.kind) === "destructive" ? "danger" : "action",
|
|
272
|
+
[content]
|
|
273
|
+
);
|
|
274
|
+
const handleChoice = (0, import_react4.useCallback)(
|
|
275
|
+
(e) => {
|
|
276
|
+
var _a, _b;
|
|
277
|
+
const target = e.currentTarget;
|
|
278
|
+
if (target.value === "true") {
|
|
279
|
+
(_a = resolveRef.current) == null ? void 0 : _a.call(resolveRef, true);
|
|
280
|
+
}
|
|
281
|
+
(_b = resolveRef.current) == null ? void 0 : _b.call(resolveRef, false);
|
|
282
|
+
close();
|
|
283
|
+
},
|
|
284
|
+
[close]
|
|
285
|
+
);
|
|
286
|
+
const handleShow = (0, import_react4.useCallback)(
|
|
287
|
+
(options) => {
|
|
288
|
+
return new Promise((resolve) => {
|
|
289
|
+
setContent({ ...options, kind: options.kind || "non-destructive" });
|
|
290
|
+
show();
|
|
291
|
+
resolveRef.current = resolve;
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
[show]
|
|
295
|
+
);
|
|
296
|
+
const value = (0, import_react4.useMemo)(
|
|
297
|
+
() => ({
|
|
298
|
+
show: handleShow
|
|
299
|
+
}),
|
|
300
|
+
[handleShow]
|
|
301
|
+
);
|
|
302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(ConfirmModalContext.Provider, { value, children: [
|
|
303
|
+
props.children,
|
|
304
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
|
|
305
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(ModalHeader, { children: [
|
|
306
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
307
|
+
Show,
|
|
308
|
+
{
|
|
309
|
+
when: palette === "danger",
|
|
310
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ModalIcon, { palette: "action", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ConfirmIcon, { size: 24 }) }),
|
|
311
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ModalIcon, { palette: "danger", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ConfirmIcon, { size: 24 }) })
|
|
312
|
+
}
|
|
313
|
+
),
|
|
314
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
|
|
315
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
|
|
316
|
+
] }),
|
|
317
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
318
|
+
"div",
|
|
319
|
+
{
|
|
320
|
+
className: (0, import_patterns3.hstack)({
|
|
321
|
+
gap: "4"
|
|
322
|
+
}),
|
|
323
|
+
children: [
|
|
324
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
325
|
+
Button,
|
|
326
|
+
{
|
|
327
|
+
autoFocus: true,
|
|
328
|
+
className: (0, import_css7.css)({
|
|
329
|
+
w: "1/2"
|
|
330
|
+
}),
|
|
331
|
+
name: "confirm",
|
|
332
|
+
onClick: handleChoice,
|
|
333
|
+
palette,
|
|
334
|
+
value: "true",
|
|
335
|
+
children: content == null ? void 0 : content.actionText
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
339
|
+
Button,
|
|
340
|
+
{
|
|
341
|
+
className: (0, import_css7.css)({
|
|
342
|
+
w: "1/2"
|
|
343
|
+
}),
|
|
344
|
+
name: "cancel",
|
|
345
|
+
onClick: handleChoice,
|
|
346
|
+
usage: "outlined",
|
|
347
|
+
value: "false",
|
|
348
|
+
children: content == null ? void 0 : content.cancelText
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
)
|
|
354
|
+
] }) })
|
|
355
|
+
] });
|
|
356
|
+
}
|
|
357
|
+
function useConfirmModal() {
|
|
358
|
+
const context = (0, import_react4.useContext)(ConfirmModalContext);
|
|
359
|
+
if (context === null) {
|
|
360
|
+
throw new Error(
|
|
361
|
+
"useConfirmModal must be used within a ConfirmModal Provider"
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
return context;
|
|
365
|
+
}
|
|
366
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
367
|
+
0 && (module.exports = {
|
|
368
|
+
ConfirmModal,
|
|
369
|
+
useConfirmModal
|
|
370
|
+
});
|
|
371
|
+
//# sourceMappingURL=confirm-modal.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/context/confirm-modal.tsx","../../../src/components/Portal.tsx","../../../src/components/Button.tsx","../../../src/config/cerbIcons.ts","../../../src/config/icons/checkbox.icons.tsx","../../../src/config/defineIcons.ts","../../../src/aria-helpers/trap-focus.aria.ts","../../../src/components/ModalIcon.tsx","../../../src/components/Show.tsx","../../../src/components/Modal.tsx","../../../src/hooks/useModal.ts","../../../src/components/ModalHeader.tsx","../../../src/components/ModalHeading.tsx","../../../src/components/ModalDescription.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n type MouseEvent,\n type PropsWithChildren,\n} from 'react'\nimport { Portal } from '../components/Portal'\nimport { Button } from '../components/Button'\nimport { css } from '@cerberus/styled-system/css'\nimport { hstack } from '@cerberus/styled-system/patterns'\nimport { $cerberusIcons } from '../config/defineIcons'\nimport { trapFocus } from '../aria-helpers/trap-focus.aria'\nimport { ModalIcon } from '../components/ModalIcon'\nimport { Show } from '../components/Show'\nimport { Modal } from '../components/Modal'\nimport { useModal } from '../hooks/useModal'\nimport { ModalHeader } from '../components/ModalHeader'\nimport { ModalHeading } from '../components/ModalHeading'\nimport { ModalDescription } from '../components/ModalDescription'\n\n/**\n * This module provides a context and hook for the confirm modal.\n * @module\n */\n\nexport interface ShowConfirmModalOptions {\n kind?: 'destructive' | 'non-destructive'\n heading: string\n description?: string\n actionText: string\n cancelText: string\n}\nexport type ShowResult =\n | ((value: boolean | PromiseLike<boolean>) => void)\n | null\n\nexport interface ConfirmModalValue {\n show: (options: ShowConfirmModalOptions) => Promise<boolean>\n}\n\nconst ConfirmModalContext = createContext<ConfirmModalValue | null>(null)\n\nexport interface ConfirmModalProviderProps {}\n\n/**\n * Provides a confirm modal to the app.\n * @example\n * ```tsx\n * // Wrap the Provider around the root of the feature.\n * <ConfirmModal>\n * <SomeFeatureSection />\n * </ConfirmModal>\n *\n * // Use the hook to show the confirm modal.\n * const confirm = useConfirmModal()\n *\n * const handleClick = useCallback(async () => {\n * const userConsent = await confirm.show({\n * heading: 'Add new payment method?',\n * description:\n * 'This will add a new payment method to your account to be billed for future purchases.',\n * actionText: 'Yes, add payment method',\n * cancelText: 'No, cancel',\n * })\n * setConsent(userConsent)\n * }, [confirm])\n * ```\n */\nexport function ConfirmModal(\n props: PropsWithChildren<ConfirmModalProviderProps>,\n) {\n const { modalRef, show, close } = useModal()\n const resolveRef = useRef<ShowResult>(null)\n const [content, setContent] = useState<ShowConfirmModalOptions | null>(null)\n const focusTrap = trapFocus(modalRef)\n const ConfirmIcon = $cerberusIcons.confirmModal\n\n const palette = useMemo(\n () => (content?.kind === 'destructive' ? 'danger' : 'action'),\n [content],\n )\n\n const handleChoice = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n const target = e.currentTarget as HTMLButtonElement\n if (target.value === 'true') {\n resolveRef.current?.(true)\n }\n resolveRef.current?.(false)\n close()\n },\n [close],\n )\n\n const handleShow = useCallback(\n (options: ShowConfirmModalOptions) => {\n return new Promise<boolean>((resolve) => {\n setContent({ ...options, kind: options.kind || 'non-destructive' })\n show()\n resolveRef.current = resolve\n })\n },\n [show],\n )\n\n const value = useMemo(\n () => ({\n show: handleShow,\n }),\n [handleShow],\n )\n\n return (\n <ConfirmModalContext.Provider value={value}>\n {props.children}\n\n <Portal>\n <Modal onKeyDown={focusTrap} ref={modalRef}>\n <ModalHeader>\n <Show\n when={palette === 'danger'}\n fallback={\n <ModalIcon palette=\"action\">\n <ConfirmIcon size={24} />\n </ModalIcon>\n }\n >\n <ModalIcon palette=\"danger\">\n <ConfirmIcon size={24} />\n </ModalIcon>\n </Show>\n <ModalHeading>{content?.heading}</ModalHeading>\n <ModalDescription>{content?.description}</ModalDescription>\n </ModalHeader>\n\n <div\n className={hstack({\n gap: '4',\n })}\n >\n <Button\n autoFocus\n className={css({\n w: '1/2',\n })}\n name=\"confirm\"\n onClick={handleChoice}\n palette={palette}\n value=\"true\"\n >\n {content?.actionText}\n </Button>\n <Button\n className={css({\n w: '1/2',\n })}\n name=\"cancel\"\n onClick={handleChoice}\n usage=\"outlined\"\n value=\"false\"\n >\n {content?.cancelText}\n </Button>\n </div>\n </Modal>\n </Portal>\n </ConfirmModalContext.Provider>\n )\n}\n\nexport function useConfirmModal(): ConfirmModalValue {\n const context = useContext(ConfirmModalContext)\n if (context === null) {\n throw new Error(\n 'useConfirmModal must be used within a ConfirmModal Provider',\n )\n }\n return context\n}\n","import type { PropsWithChildren } from 'react'\nimport { createPortal } from 'react-dom'\n\n/**\n * This module is the Portal component.\n * @module\n */\n\nexport interface PortalProps {\n container?: Element | DocumentFragment\n key?: null | string\n}\n\n/**\n * The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.\n * @param container - The props for the Portal component.\n * @returns ReactPortal\n */\nexport function Portal(props: PropsWithChildren<PortalProps>) {\n const container = props.container || document.body\n return createPortal(props.children, container, props.key)\n}\n","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 * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Button.tsx\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","import {\n Checkmark,\n CheckmarkFilled,\n ChevronDown,\n CloseFilled,\n CloudUpload,\n ErrorFilled,\n Information,\n InformationFilled,\n Restart,\n TrashCan,\n Warning,\n WarningFilled,\n type CarbonIconType,\n} from '@cerberus/icons'\nimport type { ElementType } from 'react'\nimport { CheckmarkIcon, IndeterminateIcon } from './icons/checkbox.icons'\n\nexport type IconType = CarbonIconType | ElementType\n\nexport interface DefinedIcons {\n checkbox?: IconType\n close?: IconType\n confirmModal?: IconType\n delete?: IconType\n promptModal?: IconType\n fileUploader?: IconType\n indeterminate?: IconType\n infoNotification?: IconType\n successNotification?: IconType\n warningNotification?: IconType\n dangerNotification?: IconType\n invalid: IconType\n invalidAlt?: IconType\n redo?: IconType\n selectArrow?: IconType\n toggleChecked?: IconType\n}\n\nexport const defaultIcons: DefinedIcons = {\n checkbox: CheckmarkIcon,\n close: CloseFilled,\n confirmModal: Information,\n delete: TrashCan,\n promptModal: Information,\n fileUploader: CloudUpload,\n indeterminate: IndeterminateIcon,\n infoNotification: InformationFilled,\n successNotification: CheckmarkFilled,\n warningNotification: WarningFilled,\n dangerNotification: ErrorFilled,\n invalid: WarningFilled,\n invalidAlt: Warning,\n redo: Restart,\n selectArrow: ChevronDown,\n toggleChecked: Checkmark,\n}\n","import type { SVGProps } from 'react'\n\n/**\n * This module contains substitute icons for the Checkbox component.\n * @module\n */\n\ninterface CheckboxIconProps extends SVGProps<SVGSVGElement> {}\n\n/**\n * Checkmark icon for Checkbox component\n */\nexport function CheckmarkIcon(props: CheckboxIconProps) {\n return (\n <svg\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n role=\"img\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fill=\"currentColor\"\n d=\"M9.714 18 4 12.335l1.818-1.764 3.896 3.824L18.181 6 20 7.803 9.714 18Z\"\n />\n </svg>\n )\n}\n\ninterface IndeterminateIconProps extends SVGProps<SVGSVGElement> {}\n\n/**\n * Indeterminate icon for Checkbox component\n */\nexport function IndeterminateIcon(props: IndeterminateIconProps) {\n return (\n <svg\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"img\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path fill=\"currentColor\" d=\"M4 11h16v2.667H4z\" />\n </svg>\n )\n}\n","import { defaultIcons, type DefinedIcons } from './cerbIcons'\n\nfunction _validateIconsProperties(icons: DefinedIcons) {\n if (!icons.invalid) {\n throw new Error(\n 'The an invalid property must be defined in your custom icons library.',\n )\n }\n}\n\nexport function defineIcons(icons: DefinedIcons): Required<DefinedIcons> {\n _validateIconsProperties(icons)\n $cerberusIcons = {\n ...defaultIcons,\n ...icons,\n } as Required<DefinedIcons>\n return $cerberusIcons\n}\n\n// Default icons\n\nexport let $cerberusIcons = defaultIcons as Required<DefinedIcons>\n","import type { KeyboardEvent, KeyboardEventHandler, RefObject } from 'react'\n\nexport function trapFocus(\n modalRef: RefObject<HTMLDialogElement>,\n): KeyboardEventHandler<HTMLDialogElement> {\n const focusableElements =\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n const focusable = Array.from(\n modalRef.current?.querySelectorAll(focusableElements) ?? [],\n )\n const firstFocusable = focusable[0] as HTMLElement\n const lastFocusable = focusable[focusable.length - 1] as HTMLElement\n\n return function handleKeyDown(event: KeyboardEvent<HTMLDialogElement>) {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstFocusable) {\n lastFocusable.focus()\n event.preventDefault()\n }\n } else {\n if (document.activeElement === lastFocusable) {\n firstFocusable.focus()\n event.preventDefault()\n }\n }\n }\n }\n}\n","import { cx } from '@cerberus/styled-system/css'\nimport { circle } from '@cerberus/styled-system/patterns'\nimport {\n modalIcon,\n type ModalIconVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport type { HTMLAttributes, PropsWithChildren } from 'react'\n\nexport type ModalIconProps = HTMLAttributes<HTMLDivElement> &\n ModalIconVariantProps\n\nexport function ModalIcon(props: PropsWithChildren<ModalIconProps>) {\n const { palette, ...nativeProps } = props\n return (\n <div\n {...nativeProps}\n className={cx(\n nativeProps.className,\n modalIcon({\n palette,\n }),\n circle(),\n )}\n >\n {props.children}\n </div>\n )\n}\n","'use client'\n\nimport { useMemo, type PropsWithChildren, type ReactNode } from 'react'\n\nexport interface ShowProps {\n when: boolean | null | undefined\n fallback?: ReactNode\n}\n\n/**\n * Conditionally render its children or an optional fallback component\n * based on the SolidJS component.\n * @definition [Show docs](https://cerberus.digitalu.design/react/show)\n * @example\n * ```tsx\n * <Show when={condition}>\n * <div>Content</div>\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 { cx } from '@cerberus/styled-system/css'\nimport { modal } from '@cerberus/styled-system/recipes'\nimport { forwardRef, type ForwardedRef, type HTMLAttributes } from 'react'\n\n/**\n * This module contains the Modal root component for a customizable modal.\n * @module\n */\n\n// Modal\n\nexport type ModalProps = HTMLAttributes<HTMLDialogElement>\n\nfunction ModalEl(props: ModalProps, ref: ForwardedRef<HTMLDialogElement>) {\n return (\n <dialog\n {...props}\n className={cx(props.className, modal().dialog)}\n ref={ref}\n />\n )\n}\n\n/**\n * The Modal component is the root element for a customizable modal.\n * @example\n * ```tsx\n * const { modalRef } = useModal()\n *\n * <Modal ref={modalRef}>\n * <ModalIcon icon={$cerberusIcons.alert} />\n * <h2>Modal Heading</h2>\n * <p>Modal description</p>\n * </Modal>\n * ```\n */\nexport const Modal = forwardRef(ModalEl)\n","'use client'\n\nimport { useCallback, useMemo, useRef, type RefObject } from 'react'\n\n/**\n * This module provides a hook for using a custom modal.\n * @module\n */\n\ninterface UseModalReturnValue {\n modalRef: RefObject<HTMLDialogElement>\n show: () => void\n close: () => void\n}\n\nexport function useModal(): UseModalReturnValue {\n const modalRef = useRef<HTMLDialogElement | null>(null)\n\n const show = useCallback(() => {\n modalRef.current?.showModal()\n }, [])\n\n const close = useCallback(() => {\n modalRef.current?.close()\n }, [])\n\n return useMemo(() => {\n return {\n modalRef,\n show,\n close,\n }\n }, [modalRef, show, close])\n}\n","import { cx } from '@cerberus/styled-system/css'\nimport { vstack } from '@cerberus/styled-system/patterns'\nimport type { HTMLAttributes } from 'react'\n\n/**\n * This module contains the ModalHeader component for a customizable modal.\n * @module\n */\n\nexport type ModalHeaderProps = HTMLAttributes<HTMLDivElement>\n\n/**\n * The ModalHeader component is a header element for a customizable modal.\n * @example\n * ```tsx\n * <Modal>\n * <ModalHeader>\n * <h2>Modal Heading</h2>\n * </ModalHeader>\n * </Modal>\n * ```\n */\nexport function ModalHeader(props: ModalHeaderProps) {\n return (\n <div\n {...props}\n className={cx(\n props.className,\n vstack({\n alignItems: 'flex-start',\n gap: '4',\n mb: '8',\n }),\n )}\n />\n )\n}\n","import { cx } from '@cerberus/styled-system/css'\nimport { modal } from '@cerberus/styled-system/recipes'\nimport type { HTMLAttributes } from 'react'\n\n/**\n * This module contains the ModalHeading component for a customizable modal.\n * @module\n */\n\nexport type ModalHeadingProps = HTMLAttributes<HTMLParagraphElement>\n\n/**\n * The ModalHeading component is a heading element for a customizable modal.\n * @example\n * ```tsx\n * <Modal>\n * <ModalHeading>Modal Heading</ModalHeading>\n * </Modal>\n * ```\n */\nexport function ModalHeading(props: ModalHeadingProps) {\n return <p {...props} className={cx(props.className, modal().heading)} />\n}\n","import { cx } from '@cerberus/styled-system/css'\nimport { modal } from '@cerberus/styled-system/recipes'\nimport type { HTMLAttributes } from 'react'\n\n/**\n * This module contains the ModalDescription component for a customizable modal.\n * @module\n */\n\nexport type ModalDescriptionProps = HTMLAttributes<HTMLParagraphElement>\n\n/**\n * The ModalDescription component is a heading element for a customizable modal.\n * @example\n * ```tsx\n * <Modal>\n * <ModalDescription>Modal Heading</ModalDescription>\n * </Modal>\n * ```\n */\nexport function ModalDescription(props: ModalDescriptionProps) {\n return <p {...props} className={cx(props.className, modal().description)} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,gBASO;;;ACVP,uBAA6B;AAiBtB,SAAS,OAAO,OAAuC;AAC5D,QAAM,YAAY,MAAM,aAAa,SAAS;AAC9C,aAAO,+BAAa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AAM,YAAY;AAAA,YAClB,UACE,6CAAC,aAAU,SAAQ,UACjB,uDAAC,eAAY,MAAM,IAAI,GACzB;AAAA,YAGF,uDAAC,aAAU,SAAQ,UACjB,uDAAC,eAAY,MAAM,IAAI,GACzB;AAAA;AAAA,QACF;AAAA,QACA,6CAAC,gBAAc,6CAAS,SAAQ;AAAA,QAChC,6CAAC,oBAAkB,6CAAS,aAAY;AAAA,SAC1C;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,eAAW,yBAAO;AAAA,YAChB,KAAK;AAAA,UACP,CAAC;AAAA,UAED;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAS;AAAA,gBACT,eAAW,iBAAI;AAAA,kBACb,GAAG;AAAA,gBACL,CAAC;AAAA,gBACD,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT;AAAA,gBACA,OAAM;AAAA,gBAEL,6CAAS;AAAA;AAAA,YACZ;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,eAAW,iBAAI;AAAA,kBACb,GAAG;AAAA,gBACL,CAAC;AAAA,gBACD,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,OAAM;AAAA,gBACN,OAAM;AAAA,gBAEL,6CAAS;AAAA;AAAA,YACZ;AAAA;AAAA;AAAA,MACF;AAAA,OACF,GACF;AAAA,KACF;AAEJ;AAEO,SAAS,kBAAqC;AACnD,QAAM,cAAU,0BAAW,mBAAmB;AAC9C,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":["import_react","import_css","import_patterns","import_jsx_runtime","import_css","import_recipes","import_jsx_runtime","import_css","import_recipes","import_react","import_jsx_runtime","import_react","import_css","import_patterns","import_jsx_runtime","import_css","import_recipes","import_jsx_runtime","import_css","import_recipes","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
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/context/feature-flags.tsx
|
|
22
|
+
var feature_flags_exports = {};
|
|
23
|
+
__export(feature_flags_exports, {
|
|
24
|
+
FeatureFlags: () => FeatureFlags,
|
|
25
|
+
useFeatureFlags: () => useFeatureFlags
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(feature_flags_exports);
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
var FeatureFlagContext = (0, import_react.createContext)(null);
|
|
31
|
+
function FeatureFlags(props) {
|
|
32
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FeatureFlagContext.Provider, { value: props.flags, children: props.children });
|
|
33
|
+
}
|
|
34
|
+
function useFeatureFlags(key) {
|
|
35
|
+
const context = (0, import_react.useContext)(FeatureFlagContext);
|
|
36
|
+
if (context === null) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
"useFeatureFlag must be used within a FeatureFlags Provider"
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return context[key] ?? false;
|
|
42
|
+
}
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
FeatureFlags,
|
|
46
|
+
useFeatureFlags
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=feature-flags.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/context/feature-flags.tsx"],"sourcesContent":["'use client'\n\nimport { createContext, useContext, type PropsWithChildren } from 'react'\n\n/**\n * This module provides a context and hook for feature flags.\n * @module\n */\n\nexport interface FeatureFlagValue {\n [key: string]: boolean\n}\n\nconst FeatureFlagContext = createContext<FeatureFlagValue | null>(null)\n\nexport interface FeatureFlagProviderProps {\n flags: FeatureFlagValue\n}\n\n/**\n * Provides feature flags to the application.\n * @param flags - The flags data for the provider.\n * @example\n * ```tsx\n * // This should be a JSON file or a server response.\n * const flags = {\n * featureOne: true,\n * featureTwo: false\n * }\n *\n * // Wrap the Provider around the root of your application.\n * <FeatureFlags flags={flags}>\n * <FeatureFlag flag=\"featureOne\">\n * This is visible.\n * </FeatureFlag>\n * <FeatureFlag flag=\"featureTwo\">\n * This is hidden.\n * </FeatureFlag>\n * </FeatureFlags>\n * ```\n */\nexport function FeatureFlags(\n props: PropsWithChildren<FeatureFlagProviderProps>,\n) {\n return (\n <FeatureFlagContext.Provider value={props.flags}>\n {props.children}\n </FeatureFlagContext.Provider>\n )\n}\n\nexport function useFeatureFlags(key: string): boolean {\n const context = useContext(FeatureFlagContext)\n if (context === null) {\n throw new Error(\n 'useFeatureFlag must be used within a FeatureFlags Provider',\n )\n }\n return context[key] ?? false\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAkE;AA2C9D;AAhCJ,IAAM,yBAAqB,4BAAuC,IAAI;AA4B/D,SAAS,aACd,OACA;AACA,SACE,4CAAC,mBAAmB,UAAnB,EAA4B,OAAO,MAAM,OACvC,gBAAM,UACT;AAEJ;AAEO,SAAS,gBAAgB,KAAsB;AACpD,QAAM,cAAU,yBAAW,kBAAkB;AAC7C,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO,QAAQ,GAAG,KAAK;AACzB;","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
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/context/field.tsx
|
|
22
|
+
var field_exports = {};
|
|
23
|
+
__export(field_exports, {
|
|
24
|
+
Field: () => Field,
|
|
25
|
+
useFieldContext: () => useFieldContext
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(field_exports);
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
var FieldContext = (0, import_react.createContext)(null);
|
|
31
|
+
function Field(props) {
|
|
32
|
+
const value = (0, import_react.useMemo)(
|
|
33
|
+
() => ({
|
|
34
|
+
disabled: props.disabled,
|
|
35
|
+
readOnly: props.readOnly,
|
|
36
|
+
required: props.required,
|
|
37
|
+
invalid: props.invalid
|
|
38
|
+
}),
|
|
39
|
+
[props.disabled, props.readOnly, props.required, props.invalid]
|
|
40
|
+
);
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldContext.Provider, { value, children: props.children });
|
|
42
|
+
}
|
|
43
|
+
function useFieldContext() {
|
|
44
|
+
const context = (0, import_react.useContext)(FieldContext);
|
|
45
|
+
if (!context) {
|
|
46
|
+
throw new Error("useFieldContext must be used within a Field Provider.");
|
|
47
|
+
}
|
|
48
|
+
return context;
|
|
49
|
+
}
|
|
50
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
+
0 && (module.exports = {
|
|
52
|
+
Field,
|
|
53
|
+
useFieldContext
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=field.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/context/field.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useContext,\n useMemo,\n type PropsWithChildren,\n} from 'react'\n\nexport interface FieldContextValue {\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n invalid?: boolean\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null)\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\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;AAAA;AAEA,mBAKO;AAyBH;AAhBJ,IAAM,mBAAe,4BAAwC,IAAI;AAE1D,SAAS,MACd,OACa;AACb,QAAM,YAAQ;AAAA,IACZ,OAAO;AAAA,MACL,UAAU,MAAM;AAAA,MAChB,UAAU,MAAM;AAAA,MAChB,UAAU,MAAM;AAAA,MAChB,SAAS,MAAM;AAAA,IACjB;AAAA,IACA,CAAC,MAAM,UAAU,MAAM,UAAU,MAAM,UAAU,MAAM,OAAO;AAAA,EAChE;AAEA,SACE,4CAAC,aAAa,UAAb,EAAsB,OACpB,gBAAM,UACT;AAEJ;AAEO,SAAS,kBAAqC;AACnD,QAAM,cAAU,yBAAW,YAAY;AACvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,uDAAuD;AAAA,EACzE;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
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/context/navMenu.tsx
|
|
22
|
+
var navMenu_exports = {};
|
|
23
|
+
__export(navMenu_exports, {
|
|
24
|
+
NavMenu: () => NavMenu,
|
|
25
|
+
useNavMenuContext: () => useNavMenuContext
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(navMenu_exports);
|
|
28
|
+
var import_css = require("@cerberus/styled-system/css");
|
|
29
|
+
var import_react = require("react");
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var NavMenuContext = (0, import_react.createContext)(null);
|
|
32
|
+
function NavMenu(props) {
|
|
33
|
+
const triggerRef = (0, import_react.useRef)(null);
|
|
34
|
+
const menuRef = (0, import_react.useRef)(null);
|
|
35
|
+
const [expanded, setExpanded] = (0, import_react.useState)(false);
|
|
36
|
+
const handleToggle = (0, import_react.useCallback)(() => {
|
|
37
|
+
setExpanded((prev) => !prev);
|
|
38
|
+
}, []);
|
|
39
|
+
const value = (0, import_react.useMemo)(
|
|
40
|
+
() => ({
|
|
41
|
+
triggerRef,
|
|
42
|
+
menuRef,
|
|
43
|
+
expanded,
|
|
44
|
+
onToggle: handleToggle
|
|
45
|
+
}),
|
|
46
|
+
[expanded, handleToggle]
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NavMenuContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
+
"nav",
|
|
50
|
+
{
|
|
51
|
+
className: (0, import_css.css)({
|
|
52
|
+
position: "relative"
|
|
53
|
+
}),
|
|
54
|
+
children: props.children
|
|
55
|
+
}
|
|
56
|
+
) });
|
|
57
|
+
}
|
|
58
|
+
function useNavMenuContext() {
|
|
59
|
+
const context = (0, import_react.useContext)(NavMenuContext);
|
|
60
|
+
if (!context) {
|
|
61
|
+
throw new Error("useNavMenuContext must be used within a NavMenu.");
|
|
62
|
+
}
|
|
63
|
+
return context;
|
|
64
|
+
}
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
NavMenu,
|
|
68
|
+
useNavMenuContext
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=navMenu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/context/navMenu.tsx"],"sourcesContent":["'use client'\n\nimport { css } from '@cerberus/styled-system/css'\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n type RefObject,\n} from 'react'\n\nexport type NavTriggerRef = RefObject<HTMLButtonElement>\nexport type NavMenuRef = RefObject<HTMLUListElement>\n\nexport interface NavMenuContextValue {\n triggerRef: NavTriggerRef | null\n menuRef: NavMenuRef | null\n expanded: boolean\n onToggle: () => void\n}\n\nconst NavMenuContext = createContext<NavMenuContextValue | null>(null)\n\nexport function NavMenu(props: PropsWithChildren): JSX.Element {\n const triggerRef = useRef<HTMLButtonElement>(null)\n const menuRef = useRef<HTMLUListElement>(null)\n const [expanded, setExpanded] = useState<boolean>(false)\n\n const handleToggle = useCallback(() => {\n setExpanded((prev) => !prev)\n }, [])\n\n const value = useMemo(\n () => ({\n triggerRef,\n menuRef,\n expanded,\n onToggle: handleToggle,\n }),\n [expanded, handleToggle],\n )\n\n return (\n <NavMenuContext.Provider value={value}>\n <nav\n className={css({\n position: 'relative',\n })}\n >\n {props.children}\n </nav>\n </NavMenuContext.Provider>\n )\n}\n\nexport function useNavMenuContext(): NavMenuContextValue {\n const context = useContext(NavMenuContext)\n if (!context) {\n throw new Error('useNavMenuContext must be used within a NavMenu.')\n }\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAoB;AACpB,mBASO;AAmCD;AAvBN,IAAM,qBAAiB,4BAA0C,IAAI;AAE9D,SAAS,QAAQ,OAAuC;AAC7D,QAAM,iBAAa,qBAA0B,IAAI;AACjD,QAAM,cAAU,qBAAyB,IAAI;AAC7C,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAkB,KAAK;AAEvD,QAAM,mBAAe,0BAAY,MAAM;AACrC,gBAAY,CAAC,SAAS,CAAC,IAAI;AAAA,EAC7B,GAAG,CAAC,CAAC;AAEL,QAAM,YAAQ;AAAA,IACZ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,IACZ;AAAA,IACA,CAAC,UAAU,YAAY;AAAA,EACzB;AAEA,SACE,4CAAC,eAAe,UAAf,EAAwB,OACvB;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,gBAAI;AAAA,QACb,UAAU;AAAA,MACZ,CAAC;AAAA,MAEA,gBAAM;AAAA;AAAA,EACT,GACF;AAEJ;AAEO,SAAS,oBAAyC;AACvD,QAAM,cAAU,yBAAW,cAAc;AACzC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,SAAO;AACT;","names":[]}
|