@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,246 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useCallback,
|
|
5
|
+
useMemo,
|
|
6
|
+
type HTMLAttributes,
|
|
7
|
+
type MouseEvent,
|
|
8
|
+
} from 'react'
|
|
9
|
+
import { ProgressBar } from './ProgressBar'
|
|
10
|
+
import { IconButton } from './IconButton'
|
|
11
|
+
import {
|
|
12
|
+
fileStatus,
|
|
13
|
+
type FileStatusVariantProps,
|
|
14
|
+
} from '@cerberus/styled-system/recipes'
|
|
15
|
+
import { css, cx } from '@cerberus/styled-system/css'
|
|
16
|
+
import { circle, hstack, vstack } from '@cerberus/styled-system/patterns'
|
|
17
|
+
import { $cerberusIcons } from '../config/defineIcons'
|
|
18
|
+
import { FieldMessage } from './FieldMessage'
|
|
19
|
+
import { Field } from '../context/field'
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* This module contains the FileStatus component.
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export type FileStatusKey = (typeof processStatus)[keyof typeof processStatus]
|
|
27
|
+
export type FileStatusActions = 'cancel' | 'retry' | 'delete'
|
|
28
|
+
export interface FileBaseStatusProps
|
|
29
|
+
extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick'> {
|
|
30
|
+
file: string
|
|
31
|
+
now: number
|
|
32
|
+
status: processStatus
|
|
33
|
+
onClick: (status: FileStatusActions, e: MouseEvent<HTMLButtonElement>) => void
|
|
34
|
+
}
|
|
35
|
+
export type FileStatusProps = FileBaseStatusProps & FileStatusVariantProps
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A helper object to represent the status of a file.
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* import { fileStatus } from '@cerberus/react'
|
|
42
|
+
* processStatus.TODO // 'todo'
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export const enum processStatus {
|
|
46
|
+
TODO = 'todo',
|
|
47
|
+
PROCESSING = 'processing',
|
|
48
|
+
DONE = 'done',
|
|
49
|
+
ERROR = 'error',
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* This component displays the status of a file.
|
|
54
|
+
* @param props - {
|
|
55
|
+
* file: string,
|
|
56
|
+
* now: number,
|
|
57
|
+
* status: keyof typeof fileStatus,
|
|
58
|
+
* action: (status: FileStatusActions, e: MouseEvent<HTMLButtonElement>) => void
|
|
59
|
+
* }.
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* <FileStatus file="file.txt" now={0} status={processStatus.TODO} action={(status, e) => console.log(status, e)} />
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export function FileStatus(props: FileStatusProps) {
|
|
66
|
+
const { file, now, status, onClick, ...nativeProps } = props
|
|
67
|
+
const actionLabel = useMemo(() => getStatusActionLabel(status), [status])
|
|
68
|
+
const palette = useMemo(() => getPalette(status), [status])
|
|
69
|
+
const modalIconPalette = useMemo(() => getModalIconPalette(status), [status])
|
|
70
|
+
const styles = useMemo(() => {
|
|
71
|
+
switch (status) {
|
|
72
|
+
case processStatus.TODO:
|
|
73
|
+
return fileStatus({ status: 'todo' })
|
|
74
|
+
case processStatus.PROCESSING:
|
|
75
|
+
return fileStatus({ status: 'processing' })
|
|
76
|
+
case processStatus.DONE:
|
|
77
|
+
return fileStatus({ status: 'done' })
|
|
78
|
+
case processStatus.ERROR:
|
|
79
|
+
return fileStatus({ status: 'error' })
|
|
80
|
+
default:
|
|
81
|
+
return fileStatus()
|
|
82
|
+
}
|
|
83
|
+
}, [status])
|
|
84
|
+
|
|
85
|
+
const handleClick = useCallback(
|
|
86
|
+
(e: MouseEvent<HTMLButtonElement>) => {
|
|
87
|
+
const actionStatus = getStatusActionLabel(
|
|
88
|
+
status,
|
|
89
|
+
).toLocaleLowerCase() as FileStatusActions
|
|
90
|
+
onClick(actionStatus, e)
|
|
91
|
+
},
|
|
92
|
+
[onClick],
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<div
|
|
97
|
+
{...nativeProps}
|
|
98
|
+
className={cx(nativeProps.className, styles.root, hstack())}
|
|
99
|
+
>
|
|
100
|
+
<div
|
|
101
|
+
className={cx(
|
|
102
|
+
styles.icon,
|
|
103
|
+
circle({
|
|
104
|
+
size: '2rem',
|
|
105
|
+
}),
|
|
106
|
+
)}
|
|
107
|
+
>
|
|
108
|
+
<MatchFileStatusIcon status={status} />
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<div
|
|
112
|
+
className={vstack({
|
|
113
|
+
alignItems: 'flex-start',
|
|
114
|
+
gap: '0.12rem',
|
|
115
|
+
w: 'full',
|
|
116
|
+
})}
|
|
117
|
+
>
|
|
118
|
+
<small
|
|
119
|
+
className={css({
|
|
120
|
+
color: 'page.text.initial',
|
|
121
|
+
textStyle: 'label-sm',
|
|
122
|
+
})}
|
|
123
|
+
>
|
|
124
|
+
{file}
|
|
125
|
+
</small>
|
|
126
|
+
<ProgressBar now={now} size="sm" />
|
|
127
|
+
<Field invalid={modalIconPalette === 'danger'}>
|
|
128
|
+
<FieldMessage
|
|
129
|
+
className={css({
|
|
130
|
+
color: 'page.text.100',
|
|
131
|
+
})}
|
|
132
|
+
id={`help:${file}`}
|
|
133
|
+
>
|
|
134
|
+
<MatchFileStatusText status={status} now={now} />
|
|
135
|
+
</FieldMessage>
|
|
136
|
+
</Field>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<IconButton
|
|
140
|
+
ariaLabel={actionLabel}
|
|
141
|
+
onClick={handleClick}
|
|
142
|
+
palette={palette}
|
|
143
|
+
size="sm"
|
|
144
|
+
>
|
|
145
|
+
<MatchStatusAction status={status} />
|
|
146
|
+
</IconButton>
|
|
147
|
+
</div>
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
interface FileStatusElProps {
|
|
152
|
+
status: FileStatusProps['status']
|
|
153
|
+
now?: number
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function MatchFileStatusIcon(props: FileStatusElProps) {
|
|
157
|
+
const {
|
|
158
|
+
fileUploader: FileUploaderIcon,
|
|
159
|
+
invalidAlt: InvalidIcon,
|
|
160
|
+
successNotification: DoneIcon,
|
|
161
|
+
} = $cerberusIcons
|
|
162
|
+
|
|
163
|
+
switch (props.status) {
|
|
164
|
+
case processStatus.TODO:
|
|
165
|
+
case processStatus.PROCESSING:
|
|
166
|
+
return <FileUploaderIcon />
|
|
167
|
+
case processStatus.DONE:
|
|
168
|
+
return <DoneIcon />
|
|
169
|
+
case processStatus.ERROR:
|
|
170
|
+
return <InvalidIcon />
|
|
171
|
+
default:
|
|
172
|
+
throw new Error('Unknown status')
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function MatchFileStatusText(props: FileStatusElProps) {
|
|
177
|
+
switch (props.status) {
|
|
178
|
+
case processStatus.TODO:
|
|
179
|
+
return 'Waiting to upload'
|
|
180
|
+
case processStatus.PROCESSING:
|
|
181
|
+
return `${props.now}% Complete`
|
|
182
|
+
case processStatus.DONE:
|
|
183
|
+
return 'File uploaded successfully'
|
|
184
|
+
case processStatus.ERROR:
|
|
185
|
+
return 'There was an error uploading the file'
|
|
186
|
+
default:
|
|
187
|
+
throw new Error('Invalid status')
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function MatchStatusAction(props: FileStatusElProps) {
|
|
192
|
+
const { close: CloseIcon, redo: RedoIcon, delete: TrashIcon } = $cerberusIcons
|
|
193
|
+
switch (props.status) {
|
|
194
|
+
case processStatus.TODO:
|
|
195
|
+
case processStatus.PROCESSING:
|
|
196
|
+
return <CloseIcon />
|
|
197
|
+
case processStatus.ERROR:
|
|
198
|
+
return <RedoIcon />
|
|
199
|
+
case processStatus.DONE:
|
|
200
|
+
return <TrashIcon />
|
|
201
|
+
default:
|
|
202
|
+
throw new Error('Invalid status')
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function getStatusActionLabel(status: FileStatusKey) {
|
|
207
|
+
switch (status) {
|
|
208
|
+
case processStatus.TODO:
|
|
209
|
+
case processStatus.PROCESSING:
|
|
210
|
+
return 'Cancel'
|
|
211
|
+
case processStatus.ERROR:
|
|
212
|
+
return 'Retry'
|
|
213
|
+
case processStatus.DONE:
|
|
214
|
+
return 'Delete'
|
|
215
|
+
default:
|
|
216
|
+
return ''
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function getPalette(status: FileStatusKey) {
|
|
221
|
+
switch (status) {
|
|
222
|
+
case processStatus.TODO:
|
|
223
|
+
case processStatus.PROCESSING:
|
|
224
|
+
return 'danger'
|
|
225
|
+
case processStatus.ERROR:
|
|
226
|
+
return 'action'
|
|
227
|
+
case processStatus.DONE:
|
|
228
|
+
return 'danger'
|
|
229
|
+
default:
|
|
230
|
+
return 'action'
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function getModalIconPalette(status: FileStatusKey) {
|
|
235
|
+
switch (status) {
|
|
236
|
+
case processStatus.TODO:
|
|
237
|
+
case processStatus.PROCESSING:
|
|
238
|
+
return 'action'
|
|
239
|
+
case processStatus.ERROR:
|
|
240
|
+
return 'danger'
|
|
241
|
+
case processStatus.DONE:
|
|
242
|
+
return 'success'
|
|
243
|
+
default:
|
|
244
|
+
return 'action'
|
|
245
|
+
}
|
|
246
|
+
}
|
|
@@ -43,7 +43,7 @@ export function FileUploader(props: FileUploaderProps) {
|
|
|
43
43
|
<p className={styles.heading}>{props.heading}</p>
|
|
44
44
|
</Show>
|
|
45
45
|
Import {props.accept?.replace(',', ', ')} files
|
|
46
|
-
<p className={styles.description}>
|
|
46
|
+
<p className={styles.description}>Click to select files</p>
|
|
47
47
|
<input
|
|
48
48
|
{...props}
|
|
49
49
|
className={cx(props.className, styles.input)}
|
package/src/components/Label.tsx
CHANGED
|
@@ -38,12 +38,13 @@ export function Label(props: PropsWithChildren<LabelProps>) {
|
|
|
38
38
|
return (
|
|
39
39
|
<label
|
|
40
40
|
{...nativeProps}
|
|
41
|
-
data-disabled
|
|
41
|
+
{...(disabled && { 'data-disabled': true })}
|
|
42
42
|
className={cx(
|
|
43
43
|
nativeProps.className,
|
|
44
44
|
label({ size, usage }),
|
|
45
45
|
hstack({
|
|
46
46
|
justify: 'space-between',
|
|
47
|
+
w: 'full',
|
|
47
48
|
}),
|
|
48
49
|
)}
|
|
49
50
|
>
|
|
@@ -51,7 +52,7 @@ export function Label(props: PropsWithChildren<LabelProps>) {
|
|
|
51
52
|
<Show when={required}>
|
|
52
53
|
<span
|
|
53
54
|
className={css({
|
|
54
|
-
color: '
|
|
55
|
+
color: 'inherit',
|
|
55
56
|
fontSize: 'inherit',
|
|
56
57
|
})}
|
|
57
58
|
>
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from '@cerberus/styled-system/recipes'
|
|
7
7
|
import type { HTMLAttributes, PropsWithChildren } from 'react'
|
|
8
8
|
|
|
9
|
-
export type
|
|
10
|
-
|
|
9
|
+
export type ModalIconProps = HTMLAttributes<HTMLDivElement> &
|
|
10
|
+
ModalIconVariantProps
|
|
11
11
|
|
|
12
12
|
export function ModalIcon(props: PropsWithChildren<ModalIconProps>) {
|
|
13
13
|
const { palette, ...nativeProps } = props
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
2
|
+
import {
|
|
3
|
+
progressBar,
|
|
4
|
+
type ProgressBarVariantProps,
|
|
5
|
+
} from '@cerberus/styled-system/recipes'
|
|
6
|
+
import type { HTMLAttributes } from 'react'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This module contains the ProgressBar component.
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export interface ProgressBarBaseProps extends HTMLAttributes<HTMLDivElement> {}
|
|
14
|
+
export type NonIndeterminateProgressBarProps = {
|
|
15
|
+
indeterminate?: never
|
|
16
|
+
now: number
|
|
17
|
+
}
|
|
18
|
+
export type IndeterminateProgressBarProps = {
|
|
19
|
+
indeterminate: true
|
|
20
|
+
now?: never
|
|
21
|
+
}
|
|
22
|
+
export type ProgressBarProps = ProgressBarBaseProps &
|
|
23
|
+
ProgressBarVariantProps &
|
|
24
|
+
(NonIndeterminateProgressBarProps | IndeterminateProgressBarProps)
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The ProgressBar component is used to display the progress of a task.
|
|
28
|
+
* @param props - HTML div element attributes
|
|
29
|
+
* @param props.now - The current value of the progress bar
|
|
30
|
+
* @param props.indeterminate - Whether the progress bar is indeterminate
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <ProgressBar value={75} />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export function ProgressBar(props: ProgressBarProps) {
|
|
37
|
+
const { indeterminate, size, usage, now, ...nativeProps } = props
|
|
38
|
+
const styles = progressBar({ size, usage })
|
|
39
|
+
const nowClamped = Math.min(100, Math.max(0, now || 0))
|
|
40
|
+
const width = {
|
|
41
|
+
width: indeterminate ? '50%' : `${nowClamped}%`,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div
|
|
46
|
+
{...nativeProps}
|
|
47
|
+
aria-valuemin={0}
|
|
48
|
+
aria-valuemax={100}
|
|
49
|
+
aria-valuenow={indeterminate ? 0 : nowClamped}
|
|
50
|
+
className={cx(nativeProps.className, styles.root)}
|
|
51
|
+
role="meter"
|
|
52
|
+
>
|
|
53
|
+
<div
|
|
54
|
+
{...(indeterminate && { 'data-indeterminate': true })}
|
|
55
|
+
data-complete={nowClamped === 100}
|
|
56
|
+
className={styles.bar}
|
|
57
|
+
style={width}
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
4
|
+
import { hstack } from '@cerberus/styled-system/patterns'
|
|
5
|
+
import {
|
|
6
|
+
select,
|
|
7
|
+
type SelectVariantProps,
|
|
8
|
+
} from '@cerberus/styled-system/recipes'
|
|
9
|
+
import type { OptionHTMLAttributes, SelectHTMLAttributes } from 'react'
|
|
10
|
+
import { $cerberusIcons } from '../config/defineIcons'
|
|
11
|
+
import { useFieldContext } from '../context/field'
|
|
12
|
+
import { Show } from './Show'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* This module contains the select components.
|
|
16
|
+
* @module
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export type SelectProps = Omit<
|
|
20
|
+
SelectHTMLAttributes<HTMLSelectElement>,
|
|
21
|
+
'size'
|
|
22
|
+
> &
|
|
23
|
+
SelectVariantProps & {
|
|
24
|
+
id: string
|
|
25
|
+
describedBy?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Select component
|
|
30
|
+
* props: SelectHTMLAttributes<HTMLSelectElement> & SelectVariantProps & { describedBy?: string }
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <Select describedby="help:fruit" id="fruit">
|
|
34
|
+
* <Option value="">Choose option</Option>
|
|
35
|
+
* <Option value="one">Option 1</Option>
|
|
36
|
+
* <Option value="two">Option 2</Option>
|
|
37
|
+
* <Option value="three">Option 3</Option>
|
|
38
|
+
* </Select>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function Select(props: SelectProps) {
|
|
42
|
+
const { describedBy, size, ...nativeProps } = props
|
|
43
|
+
const { invalid, ...fieldStates } = useFieldContext()
|
|
44
|
+
const { invalid: InvalidIcon, selectArrow: SelectArrow } = $cerberusIcons
|
|
45
|
+
const styles = select({
|
|
46
|
+
size,
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className={styles.root}>
|
|
51
|
+
<select
|
|
52
|
+
{...nativeProps}
|
|
53
|
+
{...fieldStates}
|
|
54
|
+
{...(describedBy && { 'aria-describedby': describedBy })}
|
|
55
|
+
{...(invalid && { 'aria-invalid': true })}
|
|
56
|
+
className={styles.input}
|
|
57
|
+
/>
|
|
58
|
+
<span
|
|
59
|
+
className={cx(
|
|
60
|
+
styles.iconStack,
|
|
61
|
+
hstack({
|
|
62
|
+
gap: '2',
|
|
63
|
+
}),
|
|
64
|
+
)}
|
|
65
|
+
>
|
|
66
|
+
<Show when={invalid}>
|
|
67
|
+
<span
|
|
68
|
+
{...(invalid && { 'data-invalid': true })}
|
|
69
|
+
className={styles.stateIcon}
|
|
70
|
+
>
|
|
71
|
+
<InvalidIcon />
|
|
72
|
+
</span>
|
|
73
|
+
</Show>
|
|
74
|
+
<span className={styles.arrowIcon}>
|
|
75
|
+
<SelectArrow />
|
|
76
|
+
</span>
|
|
77
|
+
</span>
|
|
78
|
+
</div>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// We only export this component for consistency with the other components
|
|
83
|
+
|
|
84
|
+
export type OptionProps = OptionHTMLAttributes<HTMLOptionElement>
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Option component
|
|
88
|
+
* props: OptionHTMLAttributes<HTMLOptionElement>
|
|
89
|
+
* @example
|
|
90
|
+
* ```tsx
|
|
91
|
+
* <Option value="one">Option 1</Option>
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export function Option(props: OptionProps) {
|
|
95
|
+
return <option {...props} />
|
|
96
|
+
}
|
package/src/config/cerbIcons.ts
CHANGED
|
@@ -1,37 +1,57 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Checkmark,
|
|
3
3
|
CheckmarkFilled,
|
|
4
|
+
ChevronDown,
|
|
5
|
+
CloseFilled,
|
|
4
6
|
CloudUpload,
|
|
5
7
|
ErrorFilled,
|
|
6
8
|
Information,
|
|
7
9
|
InformationFilled,
|
|
10
|
+
Restart,
|
|
11
|
+
TrashCan,
|
|
12
|
+
Warning,
|
|
8
13
|
WarningFilled,
|
|
9
14
|
type CarbonIconType,
|
|
10
15
|
} from '@cerberus/icons'
|
|
11
16
|
import type { ElementType } from 'react'
|
|
17
|
+
import { CheckmarkIcon, IndeterminateIcon } from './icons/checkbox.icons'
|
|
12
18
|
|
|
13
19
|
export type IconType = CarbonIconType | ElementType
|
|
14
20
|
|
|
15
21
|
export interface DefinedIcons {
|
|
22
|
+
checkbox?: IconType
|
|
23
|
+
close?: IconType
|
|
16
24
|
confirmModal?: IconType
|
|
25
|
+
delete?: IconType
|
|
17
26
|
promptModal?: IconType
|
|
18
27
|
fileUploader?: IconType
|
|
28
|
+
indeterminate?: IconType
|
|
19
29
|
infoNotification?: IconType
|
|
20
30
|
successNotification?: IconType
|
|
21
31
|
warningNotification?: IconType
|
|
22
32
|
dangerNotification?: IconType
|
|
23
33
|
invalid: IconType
|
|
34
|
+
invalidAlt?: IconType
|
|
35
|
+
redo?: IconType
|
|
36
|
+
selectArrow?: IconType
|
|
24
37
|
toggleChecked?: IconType
|
|
25
38
|
}
|
|
26
39
|
|
|
27
40
|
export const defaultIcons: DefinedIcons = {
|
|
41
|
+
checkbox: CheckmarkIcon,
|
|
42
|
+
close: CloseFilled,
|
|
28
43
|
confirmModal: Information,
|
|
44
|
+
delete: TrashCan,
|
|
29
45
|
promptModal: Information,
|
|
30
46
|
fileUploader: CloudUpload,
|
|
47
|
+
indeterminate: IndeterminateIcon,
|
|
31
48
|
infoNotification: InformationFilled,
|
|
32
49
|
successNotification: CheckmarkFilled,
|
|
33
50
|
warningNotification: WarningFilled,
|
|
34
51
|
dangerNotification: ErrorFilled,
|
|
35
52
|
invalid: WarningFilled,
|
|
53
|
+
invalidAlt: Warning,
|
|
54
|
+
redo: Restart,
|
|
55
|
+
selectArrow: ChevronDown,
|
|
36
56
|
toggleChecked: Checkmark,
|
|
37
57
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { SVGProps } from 'react'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This module contains substitute icons for the Checkbox component.
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
interface CheckboxIconProps extends SVGProps<SVGSVGElement> {}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Checkmark icon for Checkbox component
|
|
12
|
+
*/
|
|
13
|
+
export function CheckmarkIcon(props: CheckboxIconProps) {
|
|
14
|
+
return (
|
|
15
|
+
<svg
|
|
16
|
+
aria-hidden="true"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
fill="none"
|
|
19
|
+
role="img"
|
|
20
|
+
viewBox="0 0 24 24"
|
|
21
|
+
{...props}
|
|
22
|
+
>
|
|
23
|
+
<path
|
|
24
|
+
fill="currentColor"
|
|
25
|
+
d="M9.714 18 4 12.335l1.818-1.764 3.896 3.824L18.181 6 20 7.803 9.714 18Z"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface IndeterminateIconProps extends SVGProps<SVGSVGElement> {}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Indeterminate icon for Checkbox component
|
|
35
|
+
*/
|
|
36
|
+
export function IndeterminateIcon(props: IndeterminateIconProps) {
|
|
37
|
+
return (
|
|
38
|
+
<svg
|
|
39
|
+
aria-hidden="true"
|
|
40
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
41
|
+
role="img"
|
|
42
|
+
fill="none"
|
|
43
|
+
viewBox="0 0 24 24"
|
|
44
|
+
{...props}
|
|
45
|
+
>
|
|
46
|
+
<path fill="currentColor" d="M4 11h16v2.667H4z" />
|
|
47
|
+
</svg>
|
|
48
|
+
)
|
|
49
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
// components
|
|
7
7
|
|
|
8
8
|
export * from './components/Button'
|
|
9
|
+
export * from './components/Checkbox'
|
|
9
10
|
export * from './components/Droppable'
|
|
10
11
|
export * from './components/FieldMessage'
|
|
11
12
|
export * from './components/FeatureFlag'
|
|
13
|
+
export * from './components/FileStatus'
|
|
12
14
|
export * from './components/FileUploader'
|
|
13
15
|
export * from './components/IconButton'
|
|
14
16
|
export * from './components/Input'
|
|
@@ -25,7 +27,9 @@ export * from './components/Notification'
|
|
|
25
27
|
export * from './components/NotificationHeading'
|
|
26
28
|
export * from './components/NotificationDescription'
|
|
27
29
|
export * from './components/Portal'
|
|
30
|
+
export * from './components/ProgressBar'
|
|
28
31
|
export * from './components/Radio'
|
|
32
|
+
export * from './components/Select'
|
|
29
33
|
export * from './components/Tab'
|
|
30
34
|
export * from './components/TabList'
|
|
31
35
|
export * from './components/TabPanel'
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// src/components/Modal.tsx
|
|
2
|
-
import { cx } from "@cerberus/styled-system/css";
|
|
3
|
-
import { modal } from "@cerberus/styled-system/recipes";
|
|
4
|
-
import { forwardRef } from "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
function ModalEl(props, ref) {
|
|
7
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
-
"dialog",
|
|
9
|
-
{
|
|
10
|
-
...props,
|
|
11
|
-
className: cx(props.className, modal().dialog),
|
|
12
|
-
ref
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
var Modal = forwardRef(ModalEl);
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
Modal
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=chunk-2UFNQM55.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Modal.tsx"],"sourcesContent":["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"],"mappings":";AAAA,SAAS,UAAU;AACnB,SAAS,aAAa;AACtB,SAAS,kBAA0D;AAa/D;AAFJ,SAAS,QAAQ,OAAmB,KAAsC;AACxE,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,MAAM,WAAW,MAAM,EAAE,MAAM;AAAA,MAC7C;AAAA;AAAA,EACF;AAEJ;AAeO,IAAM,QAAQ,WAAW,OAAO;","names":[]}
|