@cerberus-design/react 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/legacy/_tsup-dts-rollup.d.cts +811 -126
- package/build/legacy/aria-helpers/tabs.aria.cjs.map +1 -1
- package/build/legacy/components/Avatar.cjs.map +1 -1
- package/build/legacy/components/Button.cjs.map +1 -1
- package/build/legacy/components/Checkbox.cjs.map +1 -1
- package/build/legacy/components/CircularProgress.cjs +180 -0
- package/build/legacy/components/CircularProgress.cjs.map +1 -0
- package/build/legacy/components/Droppable.cjs.map +1 -1
- package/build/legacy/components/FeatureFlag.cjs.map +1 -1
- package/build/legacy/components/FieldMessage.cjs.map +1 -1
- package/build/legacy/components/FileStatus.cjs +75 -79
- package/build/legacy/components/FileStatus.cjs.map +1 -1
- package/build/legacy/components/FileUploader.cjs +1 -1
- package/build/legacy/components/FileUploader.cjs.map +1 -1
- package/build/legacy/components/IconButton.cjs.map +1 -1
- package/build/legacy/components/Input.cjs.map +1 -1
- package/build/legacy/components/Label.cjs.map +1 -1
- package/build/legacy/components/Modal.cjs.map +1 -1
- package/build/legacy/components/ModalDescription.cjs.map +1 -1
- package/build/legacy/components/ModalHeader.cjs.map +1 -1
- package/build/legacy/components/ModalHeading.cjs.map +1 -1
- package/build/legacy/components/NavMenuLink.cjs.map +1 -1
- package/build/legacy/components/NavMenuList.cjs.map +1 -1
- package/build/legacy/components/NavMenuTrigger.cjs.map +1 -1
- package/build/legacy/components/Notification.cjs.map +1 -1
- package/build/legacy/components/NotificationDescription.cjs.map +1 -1
- package/build/legacy/components/NotificationHeading.cjs.map +1 -1
- package/build/legacy/components/Portal.cjs.map +1 -1
- package/build/legacy/components/ProgressBar.cjs +1 -1
- package/build/legacy/components/ProgressBar.cjs.map +1 -1
- package/build/legacy/components/Radio.cjs.map +1 -1
- package/build/legacy/components/Select.cjs.map +1 -1
- package/build/legacy/components/Show.cjs.map +1 -1
- package/build/legacy/components/Spinner.cjs +104 -0
- package/build/legacy/components/Spinner.cjs.map +1 -0
- package/build/legacy/components/Tab.cjs.map +1 -1
- package/build/legacy/components/TabList.cjs.map +1 -1
- package/build/legacy/components/TabPanel.cjs.map +1 -1
- package/build/legacy/components/Table.cjs.map +1 -1
- package/build/legacy/components/Tag.cjs +70 -4
- package/build/legacy/components/Tag.cjs.map +1 -1
- package/build/legacy/components/Tbody.cjs.map +1 -1
- package/build/legacy/components/Td.cjs.map +1 -1
- package/build/legacy/components/Textarea.cjs.map +1 -1
- package/build/legacy/components/Th.cjs.map +1 -1
- package/build/legacy/components/Thead.cjs.map +1 -1
- package/build/legacy/components/Toggle.cjs.map +1 -1
- package/build/legacy/context/confirm-modal.cjs +2 -2
- package/build/legacy/context/confirm-modal.cjs.map +1 -1
- package/build/legacy/context/feature-flags.cjs.map +1 -1
- package/build/legacy/context/field.cjs.map +1 -1
- package/build/legacy/context/navMenu.cjs.map +1 -1
- package/build/legacy/context/notification-center.cjs +50 -10
- package/build/legacy/context/notification-center.cjs.map +1 -1
- package/build/legacy/context/prompt-modal.cjs +2 -2
- package/build/legacy/context/prompt-modal.cjs.map +1 -1
- package/build/legacy/context/tabs.cjs.map +1 -1
- package/build/legacy/context/theme.cjs +37 -23
- package/build/legacy/context/theme.cjs.map +1 -1
- package/build/legacy/hooks/useModal.cjs.map +1 -1
- package/build/legacy/hooks/useTheme.cjs +41 -32
- package/build/legacy/hooks/useTheme.cjs.map +1 -1
- package/build/legacy/hooks/useToggle.cjs.map +1 -1
- package/build/legacy/index.cjs +605 -316
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +811 -126
- package/build/modern/aria-helpers/tabs.aria.js +2 -2
- package/build/modern/{chunk-DGJPW76I.js → chunk-2RPWSVRX.js} +13 -13
- package/build/modern/chunk-2RPWSVRX.js.map +1 -0
- package/build/modern/{chunk-JB7IQ2BM.js → chunk-2UXE5PDG.js} +1 -1
- package/build/modern/chunk-2UXE5PDG.js.map +1 -0
- package/build/modern/{chunk-4CAT3FHV.js → chunk-2VX52EEJ.js} +1 -1
- package/build/modern/chunk-2VX52EEJ.js.map +1 -0
- package/build/modern/chunk-3O6UTN3J.js +155 -0
- package/build/modern/chunk-3O6UTN3J.js.map +1 -0
- package/build/modern/{chunk-UN3OAW56.js → chunk-477G5ZEL.js} +2 -2
- package/build/modern/chunk-477G5ZEL.js.map +1 -0
- package/build/modern/{chunk-PMCYXRAH.js → chunk-5V5MBSM3.js} +3 -3
- package/build/modern/chunk-5V5MBSM3.js.map +1 -0
- package/build/modern/{chunk-3GXISGPS.js → chunk-7K6PZBHN.js} +2 -2
- package/build/modern/chunk-7K6PZBHN.js.map +1 -0
- package/build/modern/chunk-7SYJFI5E.js +80 -0
- package/build/modern/chunk-7SYJFI5E.js.map +1 -0
- package/build/modern/{chunk-ZCIJRM2X.js → chunk-AUAPBPGW.js} +5 -5
- package/build/modern/chunk-AUAPBPGW.js.map +1 -0
- package/build/modern/{chunk-A5WYZVUR.js → chunk-B4CVET74.js} +1 -1
- package/build/modern/chunk-B4CVET74.js.map +1 -0
- package/build/modern/{chunk-2UFNQM55.js → chunk-BE4EOU2P.js} +1 -1
- package/build/modern/{chunk-2UFNQM55.js.map → chunk-BE4EOU2P.js.map} +1 -1
- package/build/modern/{chunk-VULPMZUW.js → chunk-BIDE4IJG.js} +3 -3
- package/build/modern/chunk-BIDE4IJG.js.map +1 -0
- package/build/modern/{chunk-4O4QFF4S.js → chunk-BUVVRQLZ.js} +1 -1
- package/build/modern/chunk-BUVVRQLZ.js.map +1 -0
- package/build/modern/{chunk-4M3EUP57.js → chunk-CJFW36DZ.js} +1 -1
- package/build/modern/chunk-CJFW36DZ.js.map +1 -0
- package/build/modern/{chunk-T7TOXGZT.js → chunk-E6QFLLXH.js} +21 -21
- package/build/modern/chunk-E6QFLLXH.js.map +1 -0
- package/build/modern/chunk-EB37HRCN.js +31 -0
- package/build/modern/chunk-EB37HRCN.js.map +1 -0
- package/build/modern/chunk-EJOXOICK.js +75 -0
- package/build/modern/chunk-EJOXOICK.js.map +1 -0
- package/build/modern/{chunk-6F34A7NZ.js → chunk-EXGKZGML.js} +1 -1
- package/build/modern/chunk-EXGKZGML.js.map +1 -0
- package/build/modern/{chunk-ISPTI4GC.js → chunk-EZYCKM7R.js} +2 -2
- package/build/modern/chunk-EZYCKM7R.js.map +1 -0
- package/build/modern/{chunk-4YJOK7JJ.js → chunk-GMG3B34U.js} +2 -2
- package/build/modern/chunk-GMG3B34U.js.map +1 -0
- package/build/modern/{chunk-U72VPIZA.js → chunk-HHVQ6LCA.js} +3 -3
- package/build/modern/chunk-HHVQ6LCA.js.map +1 -0
- package/build/modern/{chunk-XREC5IJE.js → chunk-HPM2XRWT.js} +1 -1
- package/build/modern/chunk-HPM2XRWT.js.map +1 -0
- package/build/modern/{chunk-2FK7NR7Y.js → chunk-I35HMGJQ.js} +5 -5
- package/build/modern/chunk-I35HMGJQ.js.map +1 -0
- package/build/modern/{chunk-WWJRKSM5.js → chunk-ILZKQP6R.js} +16 -16
- package/build/modern/chunk-ILZKQP6R.js.map +1 -0
- package/build/modern/{chunk-GKUDLVOV.js → chunk-ITOIXNJS.js} +2 -2
- package/build/modern/{chunk-XOVQGPIE.js → chunk-JCGWTIR4.js} +4 -4
- package/build/modern/chunk-JCGWTIR4.js.map +1 -0
- package/build/modern/{chunk-TCO46FK7.js → chunk-JIJM6JFJ.js} +2 -2
- package/build/modern/chunk-JIJM6JFJ.js.map +1 -0
- package/build/modern/{chunk-VGHVH2T3.js → chunk-JWIJHSI6.js} +5 -3
- package/build/modern/chunk-JWIJHSI6.js.map +1 -0
- package/build/modern/{chunk-6DIGPXAD.js → chunk-KBBASJIY.js} +2 -2
- package/build/modern/chunk-KBBASJIY.js.map +1 -0
- package/build/modern/{chunk-SONHHNYQ.js → chunk-LFWAJ5DX.js} +3 -3
- package/build/modern/chunk-LFWAJ5DX.js.map +1 -0
- package/build/modern/{chunk-PH64POOB.js → chunk-LJYCFFX7.js} +2 -2
- package/build/modern/chunk-LJYCFFX7.js.map +1 -0
- package/build/modern/{chunk-O6WHVUEW.js → chunk-NUGDTZCL.js} +59 -19
- package/build/modern/chunk-NUGDTZCL.js.map +1 -0
- package/build/modern/{chunk-VRPAW76S.js → chunk-O6JYYVO7.js} +5 -5
- package/build/modern/chunk-O6JYYVO7.js.map +1 -0
- package/build/modern/{chunk-KJUCHZHV.js → chunk-O75QAT4Z.js} +1 -1
- package/build/modern/chunk-O75QAT4Z.js.map +1 -0
- package/build/modern/{chunk-C5HLLGME.js → chunk-OW62FLJ6.js} +1 -1
- package/build/modern/chunk-OW62FLJ6.js.map +1 -0
- package/build/modern/{chunk-RPZAPUCF.js → chunk-OWKN5IV7.js} +3 -3
- package/build/modern/chunk-OWKN5IV7.js.map +1 -0
- package/build/modern/{chunk-PJ3744I6.js → chunk-PKQTTFWA.js} +1 -1
- package/build/modern/chunk-PKQTTFWA.js.map +1 -0
- package/build/modern/{chunk-N3FUF4TB.js → chunk-PKY46RRA.js} +1 -1
- package/build/modern/chunk-PKY46RRA.js.map +1 -0
- package/build/modern/{chunk-4M4LCQ43.js → chunk-Q7BRMIBR.js} +1 -1
- package/build/modern/{chunk-4M4LCQ43.js.map → chunk-Q7BRMIBR.js.map} +1 -1
- package/build/modern/{chunk-QEA6N6TN.js → chunk-REO5GUNC.js} +1 -1
- package/build/modern/chunk-REO5GUNC.js.map +1 -0
- package/build/modern/{chunk-KF24CS4S.js → chunk-RIFQSCHT.js} +1 -1
- package/build/modern/chunk-RIFQSCHT.js.map +1 -0
- package/build/modern/{chunk-Z6IWNVPN.js → chunk-S7XGIQY6.js} +10 -4
- package/build/modern/chunk-S7XGIQY6.js.map +1 -0
- package/build/modern/{chunk-3C2DJSEE.js → chunk-SXIXDXG3.js} +1 -1
- package/build/modern/chunk-SXIXDXG3.js.map +1 -0
- package/build/modern/{chunk-7VJOPJVX.js → chunk-TKI2CKHH.js} +1 -1
- package/build/modern/chunk-TKI2CKHH.js.map +1 -0
- package/build/modern/{chunk-SLHX5K6I.js → chunk-UBJBMOG7.js} +4 -2
- package/build/modern/chunk-UBJBMOG7.js.map +1 -0
- package/build/modern/{chunk-ZAU4JVLL.js → chunk-UZDVOIW5.js} +1 -1
- package/build/modern/chunk-UZDVOIW5.js.map +1 -0
- package/build/modern/{chunk-QZ6NS6VN.js → chunk-VG46RHBJ.js} +1 -1
- package/build/modern/chunk-VG46RHBJ.js.map +1 -0
- package/build/modern/{chunk-QU7UV5DB.js → chunk-WLEX22KS.js} +1 -1
- package/build/modern/chunk-WLEX22KS.js.map +1 -0
- package/build/modern/{chunk-FMFKM2AB.js → chunk-WZOYPFUU.js} +5 -5
- package/build/modern/chunk-WZOYPFUU.js.map +1 -0
- package/build/modern/{chunk-HW76XVA3.js → chunk-XEW6TJJ4.js} +1 -1
- package/build/modern/chunk-XEW6TJJ4.js.map +1 -0
- package/build/modern/{chunk-TYTEREKZ.js → chunk-ZFK33MVD.js} +2 -2
- package/build/modern/chunk-ZFK33MVD.js.map +1 -0
- package/build/modern/components/Avatar.js +2 -2
- package/build/modern/components/Button.js +1 -1
- package/build/modern/components/Checkbox.js +3 -3
- package/build/modern/components/CircularProgress.js +8 -0
- package/build/modern/components/CircularProgress.js.map +1 -0
- package/build/modern/components/Droppable.js +1 -1
- package/build/modern/components/FeatureFlag.js +3 -3
- package/build/modern/components/FieldMessage.js +2 -2
- package/build/modern/components/FileStatus.js +7 -7
- package/build/modern/components/FileUploader.js +3 -3
- package/build/modern/components/IconButton.js +1 -1
- package/build/modern/components/Input.js +3 -3
- package/build/modern/components/Label.js +3 -3
- package/build/modern/components/Modal.js +1 -1
- package/build/modern/components/ModalDescription.js +1 -1
- package/build/modern/components/ModalHeader.js +1 -1
- package/build/modern/components/ModalHeading.js +1 -1
- package/build/modern/components/NavMenuLink.js +2 -2
- package/build/modern/components/NavMenuList.js +3 -3
- package/build/modern/components/NavMenuTrigger.js +3 -3
- package/build/modern/components/Notification.js +1 -1
- package/build/modern/components/NotificationDescription.js +1 -1
- package/build/modern/components/NotificationHeading.js +1 -1
- package/build/modern/components/Portal.js +1 -1
- package/build/modern/components/ProgressBar.js +1 -1
- package/build/modern/components/Radio.js +2 -2
- package/build/modern/components/Select.js +3 -3
- package/build/modern/components/Show.js +1 -1
- package/build/modern/components/Spinner.js +7 -0
- package/build/modern/components/Spinner.js.map +1 -0
- package/build/modern/components/Tab.js +3 -3
- package/build/modern/components/TabList.js +2 -2
- package/build/modern/components/TabPanel.js +3 -3
- package/build/modern/components/Table.js +1 -1
- package/build/modern/components/Tag.js +5 -2
- package/build/modern/components/Tbody.js +1 -1
- package/build/modern/components/Td.js +1 -1
- package/build/modern/components/Textarea.js +2 -2
- package/build/modern/components/Th.js +2 -2
- package/build/modern/components/Thead.js +1 -1
- package/build/modern/components/Toggle.js +2 -2
- package/build/modern/context/confirm-modal.js +10 -10
- package/build/modern/context/feature-flags.js +1 -1
- package/build/modern/context/field.js +1 -1
- package/build/modern/context/navMenu.js +1 -1
- package/build/modern/context/notification-center.js +7 -7
- package/build/modern/context/prompt-modal.js +13 -13
- package/build/modern/context/tabs.js +1 -1
- package/build/modern/context/theme.js +2 -5
- package/build/modern/hooks/useModal.js +1 -1
- package/build/modern/hooks/useTheme.js +5 -1
- package/build/modern/hooks/useToggle.js +1 -1
- package/build/modern/index.js +78 -68
- package/build/modern/index.js.map +1 -1
- package/package.json +3 -4
- package/src/components/Avatar.tsx +28 -1
- package/src/components/Button.tsx +1 -1
- package/src/components/Checkbox.tsx +11 -1
- package/src/components/CircularProgress.tsx +170 -0
- package/src/components/Droppable.tsx +13 -0
- package/src/components/FeatureFlag.tsx +7 -0
- package/src/components/FieldMessage.tsx +13 -6
- package/src/components/FileStatus.tsx +43 -16
- package/src/components/FileUploader.tsx +11 -1
- package/src/components/IconButton.tsx +15 -5
- package/src/components/Input.tsx +21 -4
- package/src/components/Label.tsx +13 -8
- package/src/components/Modal.tsx +8 -3
- package/src/components/ModalDescription.tsx +1 -0
- package/src/components/ModalHeader.tsx +1 -0
- package/src/components/ModalHeading.tsx +1 -0
- package/src/components/NavMenuLink.tsx +22 -0
- package/src/components/NavMenuList.tsx +37 -5
- package/src/components/NavMenuTrigger.tsx +13 -0
- package/src/components/Notification.tsx +13 -6
- package/src/components/NotificationDescription.tsx +8 -6
- package/src/components/NotificationHeading.tsx +8 -6
- package/src/components/Portal.tsx +9 -2
- package/src/components/ProgressBar.tsx +15 -5
- package/src/components/Radio.tsx +29 -0
- package/src/components/Select.tsx +17 -8
- package/src/components/Show.tsx +16 -5
- package/src/components/Spinner.tsx +82 -0
- package/src/components/Tab.tsx +13 -5
- package/src/components/TabList.tsx +5 -1
- package/src/components/TabPanel.tsx +7 -2
- package/src/components/Table.tsx +6 -3
- package/src/components/Tag.tsx +34 -7
- package/src/components/Tbody.tsx +7 -1
- package/src/components/Td.tsx +2 -1
- package/src/components/Textarea.tsx +9 -4
- package/src/components/Th.tsx +13 -1
- package/src/components/Thead.tsx +2 -1
- package/src/components/Toggle.tsx +35 -0
- package/src/context/confirm-modal.tsx +19 -2
- package/src/context/feature-flags.tsx +4 -1
- package/src/context/field.tsx +26 -0
- package/src/context/navMenu.tsx +25 -0
- package/src/context/notification-center.tsx +84 -12
- package/src/context/prompt-modal.tsx +41 -3
- package/src/context/tabs.tsx +31 -4
- package/src/context/theme.tsx +47 -10
- package/src/hooks/useModal.ts +14 -0
- package/src/hooks/useTheme.ts +66 -17
- package/src/hooks/useToggle.ts +22 -0
- package/src/index.ts +2 -0
- package/build/modern/chunk-2FK7NR7Y.js.map +0 -1
- package/build/modern/chunk-3C2DJSEE.js.map +0 -1
- package/build/modern/chunk-3GXISGPS.js.map +0 -1
- package/build/modern/chunk-4CAT3FHV.js.map +0 -1
- package/build/modern/chunk-4M3EUP57.js.map +0 -1
- package/build/modern/chunk-4O4QFF4S.js.map +0 -1
- package/build/modern/chunk-4YJOK7JJ.js.map +0 -1
- package/build/modern/chunk-6DIGPXAD.js.map +0 -1
- package/build/modern/chunk-6F34A7NZ.js.map +0 -1
- package/build/modern/chunk-7VJOPJVX.js.map +0 -1
- package/build/modern/chunk-A5WYZVUR.js.map +0 -1
- package/build/modern/chunk-C5HLLGME.js.map +0 -1
- package/build/modern/chunk-DGJPW76I.js.map +0 -1
- package/build/modern/chunk-FMFKM2AB.js.map +0 -1
- package/build/modern/chunk-HW76XVA3.js.map +0 -1
- package/build/modern/chunk-ISPTI4GC.js.map +0 -1
- package/build/modern/chunk-JB7IQ2BM.js.map +0 -1
- package/build/modern/chunk-KF24CS4S.js.map +0 -1
- package/build/modern/chunk-KJUCHZHV.js.map +0 -1
- package/build/modern/chunk-N3FUF4TB.js.map +0 -1
- package/build/modern/chunk-O6WHVUEW.js.map +0 -1
- package/build/modern/chunk-PH64POOB.js.map +0 -1
- package/build/modern/chunk-PJ3744I6.js.map +0 -1
- package/build/modern/chunk-PMCYXRAH.js.map +0 -1
- package/build/modern/chunk-QEA6N6TN.js.map +0 -1
- package/build/modern/chunk-QU7UV5DB.js.map +0 -1
- package/build/modern/chunk-QZ6NS6VN.js.map +0 -1
- package/build/modern/chunk-RPZAPUCF.js.map +0 -1
- package/build/modern/chunk-SLHX5K6I.js.map +0 -1
- package/build/modern/chunk-SONHHNYQ.js.map +0 -1
- package/build/modern/chunk-SXXWC6UD.js +0 -83
- package/build/modern/chunk-SXXWC6UD.js.map +0 -1
- package/build/modern/chunk-T7TOXGZT.js.map +0 -1
- package/build/modern/chunk-TCO46FK7.js.map +0 -1
- package/build/modern/chunk-TYTEREKZ.js.map +0 -1
- package/build/modern/chunk-U72VPIZA.js.map +0 -1
- package/build/modern/chunk-UN3OAW56.js.map +0 -1
- package/build/modern/chunk-VGHVH2T3.js.map +0 -1
- package/build/modern/chunk-VRPAW76S.js.map +0 -1
- package/build/modern/chunk-VULPMZUW.js.map +0 -1
- package/build/modern/chunk-WWJRKSM5.js.map +0 -1
- package/build/modern/chunk-XOVQGPIE.js.map +0 -1
- package/build/modern/chunk-XREC5IJE.js.map +0 -1
- package/build/modern/chunk-Z6IWNVPN.js.map +0 -1
- package/build/modern/chunk-ZAU4JVLL.js.map +0 -1
- package/build/modern/chunk-ZCIJRM2X.js.map +0 -1
- /package/build/modern/{chunk-GKUDLVOV.js.map → chunk-ITOIXNJS.js.map} +0 -0
|
@@ -6,8 +6,6 @@ import {
|
|
|
6
6
|
type HTMLAttributes,
|
|
7
7
|
type MouseEvent,
|
|
8
8
|
} from 'react'
|
|
9
|
-
import { ProgressBar } from './ProgressBar'
|
|
10
|
-
import { IconButton } from './IconButton'
|
|
11
9
|
import {
|
|
12
10
|
fileStatus,
|
|
13
11
|
type FileStatusVariantProps,
|
|
@@ -15,8 +13,10 @@ import {
|
|
|
15
13
|
import { css, cx } from '@cerberus/styled-system/css'
|
|
16
14
|
import { hstack, vstack } from '@cerberus/styled-system/patterns'
|
|
17
15
|
import { $cerberusIcons } from '../config/defineIcons'
|
|
18
|
-
import { FieldMessage } from './FieldMessage'
|
|
19
16
|
import { Field } from '../context/field'
|
|
17
|
+
import { FieldMessage } from './FieldMessage'
|
|
18
|
+
import { ProgressBar, type ProgressBarProps } from './ProgressBar'
|
|
19
|
+
import { IconButton } from './IconButton'
|
|
20
20
|
import { Avatar } from './Avatar'
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -24,13 +24,45 @@ import { Avatar } from './Avatar'
|
|
|
24
24
|
* @module
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* The available values of the fileStatus helper Object.
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* import { fileStatus } from '@cerberus/react'
|
|
32
|
+
* processStatus.TODO // 'todo'
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
27
35
|
export type FileStatusKey = (typeof processStatus)[keyof typeof processStatus]
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The actions that can be performed on a file.
|
|
39
|
+
*/
|
|
28
40
|
export type FileStatusActions = 'cancel' | 'retry' | 'delete'
|
|
29
41
|
export interface FileBaseStatusProps
|
|
30
42
|
extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick'> {
|
|
43
|
+
/**
|
|
44
|
+
* The name of the file.
|
|
45
|
+
*/
|
|
31
46
|
file: string
|
|
32
|
-
|
|
47
|
+
/**
|
|
48
|
+
* The percentage of the file that has been processed.
|
|
49
|
+
*/
|
|
50
|
+
now: ProgressBarProps['now']
|
|
51
|
+
/**
|
|
52
|
+
* The status of the file.
|
|
53
|
+
*/
|
|
33
54
|
status: processStatus
|
|
55
|
+
/**
|
|
56
|
+
* The action to perform on the file when a user clicks the
|
|
57
|
+
* button located at the end of the status card.
|
|
58
|
+
* @param status - The status of the file.
|
|
59
|
+
* @param e - The event object.
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* <FileStatus file="file.txt" now={0} status={processStatus.TODO} action={(status, e) => console.log(status, e)} />
|
|
63
|
+
* ```
|
|
64
|
+
* @default () => {}
|
|
65
|
+
*/
|
|
34
66
|
onClick: (status: FileStatusActions, e: MouseEvent<HTMLButtonElement>) => void
|
|
35
67
|
}
|
|
36
68
|
export type FileStatusProps = FileBaseStatusProps & FileStatusVariantProps
|
|
@@ -51,13 +83,8 @@ export const enum processStatus {
|
|
|
51
83
|
}
|
|
52
84
|
|
|
53
85
|
/**
|
|
54
|
-
*
|
|
55
|
-
* @
|
|
56
|
-
* file: string,
|
|
57
|
-
* now: number,
|
|
58
|
-
* status: keyof typeof fileStatus,
|
|
59
|
-
* action: (status: FileStatusActions, e: MouseEvent<HTMLButtonElement>) => void
|
|
60
|
-
* }.
|
|
86
|
+
* A component that displays the status of a file during file processing.
|
|
87
|
+
* @see https://cerberus.digitalu.design/react/file-uploader
|
|
61
88
|
* @example
|
|
62
89
|
* ```tsx
|
|
63
90
|
* <FileStatus file="file.txt" now={0} status={processStatus.TODO} action={(status, e) => console.log(status, e)} />
|
|
@@ -121,7 +148,7 @@ export function FileStatus(props: FileStatusProps) {
|
|
|
121
148
|
{file}
|
|
122
149
|
</small>
|
|
123
150
|
<ProgressBar now={now} size="sm" />
|
|
124
|
-
<Field invalid={modalIconPalette === '
|
|
151
|
+
<Field invalid={modalIconPalette === 'hades-dark'}>
|
|
125
152
|
<FieldMessage
|
|
126
153
|
className={css({
|
|
127
154
|
color: 'page.text.100',
|
|
@@ -233,12 +260,12 @@ function getModalIconPalette(status: FileStatusKey) {
|
|
|
233
260
|
switch (status) {
|
|
234
261
|
case processStatus.TODO:
|
|
235
262
|
case processStatus.PROCESSING:
|
|
236
|
-
return 'light
|
|
263
|
+
return 'charon-light'
|
|
237
264
|
case processStatus.ERROR:
|
|
238
|
-
return '
|
|
265
|
+
return 'hades-dark'
|
|
239
266
|
case processStatus.DONE:
|
|
240
|
-
return '
|
|
267
|
+
return 'thanatos-light'
|
|
241
268
|
default:
|
|
242
|
-
return 'light
|
|
269
|
+
return 'charon-light'
|
|
243
270
|
}
|
|
244
271
|
}
|
|
@@ -10,10 +10,20 @@ import { Avatar } from './Avatar'
|
|
|
10
10
|
|
|
11
11
|
export interface FileUploaderProps
|
|
12
12
|
extends InputHTMLAttributes<HTMLInputElement> {
|
|
13
|
+
/**
|
|
14
|
+
* The optional heading to display in the FileUploader component.
|
|
15
|
+
*/
|
|
13
16
|
heading?: string
|
|
17
|
+
/**
|
|
18
|
+
* The name of the file input element.
|
|
19
|
+
*/
|
|
14
20
|
name: string
|
|
15
21
|
}
|
|
16
22
|
|
|
23
|
+
/**
|
|
24
|
+
* A component that allows the user to upload files.
|
|
25
|
+
* @see https://cerberus.digitalu.design/react/file-uploader
|
|
26
|
+
*/
|
|
17
27
|
export function FileUploader(props: FileUploaderProps) {
|
|
18
28
|
const styles = fileUploader()
|
|
19
29
|
const Icon = $cerberusIcons.fileUploader
|
|
@@ -29,7 +39,7 @@ export function FileUploader(props: FileUploaderProps) {
|
|
|
29
39
|
>
|
|
30
40
|
<div className={styles.icon}>
|
|
31
41
|
<Avatar
|
|
32
|
-
gradient="light
|
|
42
|
+
gradient="charon-light"
|
|
33
43
|
ariaLabel=""
|
|
34
44
|
icon={<Icon />}
|
|
35
45
|
size="md"
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes } from 'react'
|
|
2
|
-
import { cx
|
|
3
|
-
import {
|
|
2
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
3
|
+
import {
|
|
4
|
+
iconButton,
|
|
5
|
+
type IconButtonVariantProps,
|
|
6
|
+
} from '@cerberus/styled-system/recipes'
|
|
4
7
|
import type { Positions } from '../types'
|
|
5
8
|
|
|
6
9
|
/**
|
|
@@ -10,15 +13,22 @@ import type { Positions } from '../types'
|
|
|
10
13
|
|
|
11
14
|
export interface IconButtonRawProps
|
|
12
15
|
extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
16
|
+
/**
|
|
17
|
+
* The aria-label attribute for the icon button.
|
|
18
|
+
*/
|
|
13
19
|
ariaLabel: string
|
|
20
|
+
/**
|
|
21
|
+
* The position of the tooltip relative to the icon button.
|
|
22
|
+
* @example 'top' | 'right' | 'bottom' | 'left'
|
|
23
|
+
* @default 'top'
|
|
24
|
+
*/
|
|
14
25
|
tooltipPosition?: Positions
|
|
15
26
|
}
|
|
16
|
-
export type
|
|
17
|
-
export type IconButtonProps = IconButtonRawProps & IconButtonRecipeProps
|
|
27
|
+
export type IconButtonProps = IconButtonRawProps & IconButtonVariantProps
|
|
18
28
|
|
|
19
29
|
/**
|
|
20
30
|
* A component that allows the user to perform actions using an icon
|
|
21
|
-
* @
|
|
31
|
+
* @see https://cerberus.digitalu.design/react/icon-button
|
|
22
32
|
*/
|
|
23
33
|
export function IconButton(props: IconButtonProps): JSX.Element {
|
|
24
34
|
const { ariaLabel, palette, usage, size, ...nativeProps } = props
|
package/src/components/Input.tsx
CHANGED
|
@@ -1,22 +1,39 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import type { InputHTMLAttributes, ReactNode } from 'react'
|
|
4
|
-
import { input } from '@cerberus/styled-system/recipes'
|
|
5
|
-
import { cx
|
|
4
|
+
import { input, type InputVariantProps } from '@cerberus/styled-system/recipes'
|
|
5
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
6
6
|
import { useFieldContext } from '../context/field'
|
|
7
7
|
import { $cerberusIcons } from '../config/defineIcons'
|
|
8
8
|
import { Show } from './Show'
|
|
9
9
|
|
|
10
|
-
export type InputRecipeProps = RecipeVariantProps<typeof input>
|
|
11
10
|
export interface InputBaseProps
|
|
12
11
|
extends Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'size'> {
|
|
12
|
+
/**
|
|
13
|
+
* The id of the FieldMessage component used to describe the input. Required for accessibility.
|
|
14
|
+
*/
|
|
13
15
|
describedBy?: string
|
|
16
|
+
/**
|
|
17
|
+
* The unique identifier for the input element. Required for accessibility.
|
|
18
|
+
*/
|
|
14
19
|
id: string
|
|
20
|
+
/**
|
|
21
|
+
* An optional icon to display at the start of the input.
|
|
22
|
+
*/
|
|
15
23
|
startIcon?: ReactNode
|
|
24
|
+
/**
|
|
25
|
+
* An optional icon to display at the end of the input.
|
|
26
|
+
*/
|
|
16
27
|
endIcon?: ReactNode
|
|
17
28
|
}
|
|
18
|
-
export type InputProps = InputBaseProps &
|
|
29
|
+
export type InputProps = InputBaseProps & InputVariantProps
|
|
19
30
|
|
|
31
|
+
/**
|
|
32
|
+
* A component that allows the user to input text. Must be wrapped in a Field
|
|
33
|
+
* component to keep track of the state for entire group of elements related to
|
|
34
|
+
* the field.
|
|
35
|
+
* @see https://cerberus.digitalu.design/react/input
|
|
36
|
+
*/
|
|
20
37
|
export function Input(props: InputProps) {
|
|
21
38
|
const { describedBy, size, startIcon, endIcon, ...nativeProps } = props
|
|
22
39
|
const inputStyles = input({ size })
|
package/src/components/Label.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import type { HTMLAttributes, PropsWithChildren } from 'react'
|
|
4
|
-
import { label } from '@cerberus/styled-system/recipes'
|
|
5
|
-
import { css, cx
|
|
4
|
+
import { label, type LabelVariantProps } from '@cerberus/styled-system/recipes'
|
|
5
|
+
import { css, cx } from '@cerberus/styled-system/css'
|
|
6
6
|
import { hstack } from '@cerberus/styled-system/patterns'
|
|
7
7
|
import { useFieldContext } from '../context/field'
|
|
8
8
|
import { Show } from './Show'
|
|
@@ -11,22 +11,27 @@ import { Show } from './Show'
|
|
|
11
11
|
* This module contains the Label component.
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
export type LabelRecipeProps = RecipeVariantProps<typeof label>
|
|
16
14
|
export interface LabelBaseProps extends HTMLAttributes<HTMLLabelElement> {
|
|
15
|
+
/**
|
|
16
|
+
* The unique identifier for the input element. Required for accessibility.
|
|
17
|
+
*/
|
|
17
18
|
htmlFor: string
|
|
19
|
+
/**
|
|
20
|
+
* Used to hide the label from the UI while keeping it accessible to screen readers. Typically used for global search inputs that have no visible label.
|
|
21
|
+
*/
|
|
18
22
|
hidden?: boolean
|
|
19
23
|
}
|
|
20
|
-
export type LabelProps = LabelBaseProps &
|
|
24
|
+
export type LabelProps = LabelBaseProps & LabelVariantProps
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
|
-
* A
|
|
27
|
+
* A a11y compliant label component.
|
|
24
28
|
* @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)
|
|
25
|
-
* @
|
|
29
|
+
* @see https://cerberus.digitalu.design/react/label
|
|
26
30
|
* @example
|
|
27
31
|
* ```tsx
|
|
28
32
|
* <Field required>
|
|
29
|
-
* <Label htmlFor="
|
|
33
|
+
* <Label htmlFor="search" hidden>Search everything</Label>
|
|
34
|
+
* <Input id="search" startIcon={Search} type="text" />
|
|
30
35
|
* </Field>
|
|
31
36
|
* ```
|
|
32
37
|
*/
|
package/src/components/Modal.tsx
CHANGED
|
@@ -23,14 +23,19 @@ function ModalEl(props: ModalProps, ref: ForwardedRef<HTMLDialogElement>) {
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* The Modal component is the root element for a customizable modal.
|
|
26
|
+
* @see https://cerberus.digitalu.design/react/modal
|
|
26
27
|
* @example
|
|
27
28
|
* ```tsx
|
|
28
29
|
* const { modalRef } = useModal()
|
|
29
30
|
*
|
|
30
31
|
* <Modal ref={modalRef}>
|
|
31
|
-
* <
|
|
32
|
-
* <
|
|
33
|
-
*
|
|
32
|
+
* <Avatar icon={SomeIcon} />
|
|
33
|
+
* <ModalHeader>
|
|
34
|
+
* <ModalHeading>Modal Heading</ModalHeading>
|
|
35
|
+
* <ModalDescription>Modal description</ModalDescription>
|
|
36
|
+
* </ModalHeader>
|
|
37
|
+
*
|
|
38
|
+
* {props.children}
|
|
34
39
|
* </Modal>
|
|
35
40
|
* ```
|
|
36
41
|
*/
|
|
@@ -2,11 +2,33 @@ import type { AnchorHTMLAttributes, ElementType } from 'react'
|
|
|
2
2
|
import { css, cx } from '@cerberus/styled-system/css'
|
|
3
3
|
import { Show } from './Show'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* This module contains the NavMenuLink component.
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
|
|
5
10
|
export interface NavMenuLinkProps
|
|
6
11
|
extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
12
|
+
/**
|
|
13
|
+
* The element type to render as. Recommended to use for Next apps with the
|
|
14
|
+
* `Link` component.
|
|
15
|
+
*/
|
|
7
16
|
as?: ElementType
|
|
8
17
|
}
|
|
9
18
|
|
|
19
|
+
/**
|
|
20
|
+
* The NavMenuLink component is a link element that is used within the NavMenu.
|
|
21
|
+
* @see https://cerberus.digitalu.design/react/nav-menu
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <NavMenu>
|
|
25
|
+
* <NavMenuList id="nav-menu-list" position="bottom">
|
|
26
|
+
* <NavMenuLink href="/home">Home</NavMenuLink>
|
|
27
|
+
* <NavMenuLink href="/about">About</NavMenuLink>
|
|
28
|
+
* </NavMenuList>
|
|
29
|
+
* </NavMenu>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
10
32
|
export function NavMenuLink(props: NavMenuLinkProps): JSX.Element {
|
|
11
33
|
const { as, ...nativeProps } = props
|
|
12
34
|
const hasAs = Boolean(as)
|
|
@@ -7,13 +7,35 @@ import { useNavMenuContext } from '../context/navMenu'
|
|
|
7
7
|
import type { Positions } from '../types'
|
|
8
8
|
import { Show } from './Show'
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* This module contains the NavMenuList component.
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
|
|
10
15
|
interface GetPositionResult {
|
|
16
|
+
/**
|
|
17
|
+
* The left position of the element.
|
|
18
|
+
*/
|
|
11
19
|
left: string
|
|
20
|
+
/**
|
|
21
|
+
* The right position of the element.
|
|
22
|
+
*/
|
|
12
23
|
right: string
|
|
24
|
+
/**
|
|
25
|
+
* The top position of the element.
|
|
26
|
+
*/
|
|
13
27
|
top: string
|
|
28
|
+
/**
|
|
29
|
+
* The bottom position of the element.
|
|
30
|
+
*/
|
|
14
31
|
bottom: string
|
|
15
32
|
}
|
|
16
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Returns the position of the NavMenuList based on the position prop.
|
|
36
|
+
* @param position - The position of the NavMenuList.
|
|
37
|
+
* @returns The position of the NavMenuList.
|
|
38
|
+
*/
|
|
17
39
|
export function getPosition(position: Positions): GetPositionResult {
|
|
18
40
|
const defaultPositions = {
|
|
19
41
|
left: 'auto',
|
|
@@ -67,21 +89,31 @@ const navListStyles = vstack({
|
|
|
67
89
|
})
|
|
68
90
|
|
|
69
91
|
export interface NavMenuListProps extends HTMLAttributes<HTMLUListElement> {
|
|
92
|
+
/**
|
|
93
|
+
* The unique identifier for the NavMenuList. Required for accessibility.
|
|
94
|
+
*/
|
|
70
95
|
id: string
|
|
96
|
+
/**
|
|
97
|
+
* The position of the NavMenuList.
|
|
98
|
+
* @type 'top' | 'right' | 'bottom' | 'left'
|
|
99
|
+
* @default 'bottom'
|
|
100
|
+
*/
|
|
71
101
|
position?: Positions
|
|
72
102
|
}
|
|
73
103
|
|
|
74
104
|
/**
|
|
75
105
|
* A component that allows the user to display a menu of navigation links.
|
|
76
106
|
* @definition [Disclosure Nav](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/)
|
|
77
|
-
* @
|
|
107
|
+
* @see https://cerberus.digitalu.design/react/nav-menu
|
|
78
108
|
*
|
|
79
109
|
* @example
|
|
80
110
|
* ```tsx
|
|
81
|
-
* <
|
|
82
|
-
* <
|
|
83
|
-
*
|
|
84
|
-
* </
|
|
111
|
+
* <NavMenu>
|
|
112
|
+
* <NavMenuList id="nav-menu-list" position="bottom">
|
|
113
|
+
* <NavMenuLink href="/home">Home</NavMenuLink>
|
|
114
|
+
* <NavMenuLink href="/about">About</NavMenuLink>
|
|
115
|
+
* </NavMenuList>
|
|
116
|
+
* </NavMenu>
|
|
85
117
|
* ```
|
|
86
118
|
**/
|
|
87
119
|
export function NavMenuList(props: NavMenuListProps): JSX.Element {
|
|
@@ -16,10 +16,23 @@ import { useNavMenuContext } from '../context/navMenu'
|
|
|
16
16
|
import type { ButtonProps } from './Button'
|
|
17
17
|
import { Show } from './Show'
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* This module contains the NavMenuTrigger component.
|
|
21
|
+
* @module
|
|
22
|
+
*/
|
|
23
|
+
|
|
19
24
|
export interface NavMenuTriggerProps
|
|
20
25
|
extends ButtonHTMLAttributes<HTMLButtonElement>,
|
|
21
26
|
ButtonProps,
|
|
22
27
|
NavTriggerAriaValues {
|
|
28
|
+
/**
|
|
29
|
+
* The element type to render as. Recommended to use for an IconButton trigger vs a standard Button.
|
|
30
|
+
* @default 'button'
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <NavMenuTrigger as={IconButton} href="/home" />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
23
36
|
as?: ElementType
|
|
24
37
|
}
|
|
25
38
|
|
|
@@ -31,22 +31,29 @@ function MatchNotificationIcon(props: NotificationVariantProps) {
|
|
|
31
31
|
|
|
32
32
|
export interface NotificationBaseProps
|
|
33
33
|
extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'onClose'> {
|
|
34
|
+
/**
|
|
35
|
+
* The unique id of the notification. Required for the onClose callback.
|
|
36
|
+
*/
|
|
34
37
|
id: string
|
|
38
|
+
/**
|
|
39
|
+
* Called when the close button is clicked.
|
|
40
|
+
*/
|
|
35
41
|
onClose?: (e: MouseEvent<HTMLButtonElement>) => void
|
|
36
42
|
}
|
|
37
43
|
export type NotificationProps = NotificationBaseProps & NotificationVariantProps
|
|
38
44
|
|
|
39
45
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* @
|
|
46
|
+
* A static Notification component that displays a message to the user. This
|
|
47
|
+
* is typically only used when not utilizing the NotificationCenter.
|
|
48
|
+
* @see https://cerberus.digitalu.design/react/notification
|
|
49
|
+
* @memberof module:NotificationCenter
|
|
43
50
|
* @example
|
|
44
51
|
* ```tsx
|
|
45
52
|
* <Notification id="info:1" open>
|
|
46
53
|
* <NotificationHeading>Info Notification</NotificationHeading>
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
54
|
+
* <NotificationDescription>
|
|
55
|
+
* This is a description with a <a href="#">link</a> in the message.
|
|
56
|
+
* </NotificationDescription>
|
|
50
57
|
* </Notification>
|
|
51
58
|
* ```
|
|
52
59
|
*/
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module exports the NotificationDescription component.
|
|
3
|
-
* @module
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
import { cx } from '@cerberus/styled-system/css'
|
|
7
2
|
import {
|
|
8
3
|
notification,
|
|
@@ -10,13 +5,20 @@ import {
|
|
|
10
5
|
} from '@cerberus/styled-system/recipes'
|
|
11
6
|
import type { HTMLAttributes } from 'react'
|
|
12
7
|
|
|
8
|
+
/**
|
|
9
|
+
* This module exports the NotificationDescription component.
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
13
|
export interface BaseNotificationDescriptionProps
|
|
14
14
|
extends HTMLAttributes<HTMLParagraphElement> {}
|
|
15
15
|
export type NotificationDescriptionProps = BaseNotificationDescriptionProps &
|
|
16
16
|
NotificationVariantProps
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Used to render the description of a notification.
|
|
20
|
+
* @see https://cerberus.digitalu.design/react/notification
|
|
21
|
+
* @memberof module:NotificationCenter
|
|
20
22
|
* @param props - The anything a HTMLParagraphElement can accept.
|
|
21
23
|
*/
|
|
22
24
|
export function NotificationDescription(props: NotificationDescriptionProps) {
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module exports the NotificationHeading component.
|
|
3
|
-
* @module
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
import { cx } from '@cerberus/styled-system/css'
|
|
7
2
|
import {
|
|
8
3
|
notification,
|
|
@@ -10,13 +5,20 @@ import {
|
|
|
10
5
|
} from '@cerberus/styled-system/recipes'
|
|
11
6
|
import type { HTMLAttributes } from 'react'
|
|
12
7
|
|
|
8
|
+
/**
|
|
9
|
+
* This module exports the NotificationHeading component.
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
13
|
export interface BaseNotificationHeadingProps
|
|
14
14
|
extends HTMLAttributes<HTMLParagraphElement> {}
|
|
15
15
|
export type NotificationHeadingProps = BaseNotificationHeadingProps &
|
|
16
16
|
NotificationVariantProps
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Used to render the heading of a notification.
|
|
20
|
+
* @see https://cerberus.digitalu.design/react/notification
|
|
21
|
+
* @memberof module:NotificationCenter
|
|
20
22
|
* @param props - The anything a HTMLParagraphElement can accept.
|
|
21
23
|
*/
|
|
22
24
|
export function NotificationHeading(props: NotificationHeadingProps) {
|
|
@@ -7,14 +7,21 @@ import { createPortal } from 'react-dom'
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
export interface PortalProps {
|
|
10
|
+
/**
|
|
11
|
+
* The root container to render the children into.
|
|
12
|
+
* @default document.body
|
|
13
|
+
*/
|
|
10
14
|
container?: Element | DocumentFragment
|
|
15
|
+
/**
|
|
16
|
+
* An optional key to use for the Portal component.
|
|
17
|
+
*/
|
|
11
18
|
key?: null | string
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
/**
|
|
15
22
|
* The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
23
|
+
* @see https://cerberus.digitalu.design/react/portal
|
|
24
|
+
* @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)
|
|
18
25
|
*/
|
|
19
26
|
export function Portal(props: PropsWithChildren<PortalProps>) {
|
|
20
27
|
const container = props.container || document.body
|
|
@@ -12,11 +12,23 @@ import type { HTMLAttributes } from 'react'
|
|
|
12
12
|
|
|
13
13
|
export interface ProgressBarBaseProps extends HTMLAttributes<HTMLDivElement> {}
|
|
14
14
|
export type NonIndeterminateProgressBarProps = {
|
|
15
|
+
/**
|
|
16
|
+
* The state of the progress bar.
|
|
17
|
+
*/
|
|
15
18
|
indeterminate?: never
|
|
19
|
+
/**
|
|
20
|
+
* The current value of the progress bar.
|
|
21
|
+
*/
|
|
16
22
|
now: number
|
|
17
23
|
}
|
|
18
24
|
export type IndeterminateProgressBarProps = {
|
|
19
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The state of the progress bar.
|
|
27
|
+
*/
|
|
28
|
+
indeterminate?: true
|
|
29
|
+
/**
|
|
30
|
+
* The current value of the progress bar.
|
|
31
|
+
*/
|
|
20
32
|
now?: never
|
|
21
33
|
}
|
|
22
34
|
export type ProgressBarProps = ProgressBarBaseProps &
|
|
@@ -25,9 +37,7 @@ export type ProgressBarProps = ProgressBarBaseProps &
|
|
|
25
37
|
|
|
26
38
|
/**
|
|
27
39
|
* The ProgressBar component is used to display the progress of a task.
|
|
28
|
-
* @
|
|
29
|
-
* @param props.now - The current value of the progress bar
|
|
30
|
-
* @param props.indeterminate - Whether the progress bar is indeterminate
|
|
40
|
+
* @see https://cerberus.digitalu.design/react/progress-indicators
|
|
31
41
|
* @example
|
|
32
42
|
* ```tsx
|
|
33
43
|
* <ProgressBar value={75} />
|
|
@@ -48,7 +58,7 @@ export function ProgressBar(props: ProgressBarProps) {
|
|
|
48
58
|
aria-valuemax={100}
|
|
49
59
|
aria-valuenow={indeterminate ? 0 : nowClamped}
|
|
50
60
|
className={cx(nativeProps.className, styles.root)}
|
|
51
|
-
role="
|
|
61
|
+
role="progressbar"
|
|
52
62
|
>
|
|
53
63
|
<div
|
|
54
64
|
{...(indeterminate && { 'data-indeterminate': true })}
|
package/src/components/Radio.tsx
CHANGED
|
@@ -7,13 +7,42 @@ import type { RecipeVariantProps } from '@cerberus/styled-system/types'
|
|
|
7
7
|
import type { InputHTMLAttributes, PropsWithChildren } from 'react'
|
|
8
8
|
import { useFieldContext } from '../context/field'
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* This module contains the Radio component.
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
|
|
10
15
|
export type RadioRecipe = RecipeVariantProps<typeof radio>
|
|
11
16
|
export interface RadioBaseProps
|
|
12
17
|
extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
18
|
+
/**
|
|
19
|
+
* A unique identifier for the radio button. Required for accessibility.
|
|
20
|
+
*/
|
|
13
21
|
id: string
|
|
14
22
|
}
|
|
15
23
|
export type RadioProps = RadioBaseProps & RadioRecipe
|
|
16
24
|
|
|
25
|
+
/**
|
|
26
|
+
* The Radio component is used to allow users to select a single option from a list of options.
|
|
27
|
+
* @see https://cerberus.digitalu.design/react/radio
|
|
28
|
+
* @memberof module:Field
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Field>
|
|
32
|
+
* <fieldset name="fruit">
|
|
33
|
+
* <Radio id="radio-1" name="fruit" value="1">
|
|
34
|
+
* Option 1
|
|
35
|
+
* </Radio>
|
|
36
|
+
* <Radio id="radio-2" name="fruit" value="2">
|
|
37
|
+
* Option 2
|
|
38
|
+
* </Radio>
|
|
39
|
+
* <Radio id="radio-3" name="fruit" value="3">
|
|
40
|
+
* Option 3
|
|
41
|
+
* </Radio>
|
|
42
|
+
* </fieldset>
|
|
43
|
+
* </Field>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
17
46
|
export function Radio(props: PropsWithChildren<RadioProps>) {
|
|
18
47
|
const { children, size, ...nativeProps } = props
|
|
19
48
|
const { invalid, ...state } = useFieldContext()
|