@registrucentras/rc-ses-react-components 2.7.2 → 3.0.0-rc.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/dist/assets/icons/phosphorIcons.d.ts +24 -0
- package/dist/components/common/Accordion/hooks/useAccordionController.d.ts +2 -1
- package/dist/components/common/Accordion/index.d.ts +18 -4
- package/dist/components/common/Accordion/types/AccordionControllerState.d.ts +1 -0
- package/dist/components/common/Card/index.d.ts +3 -0
- package/dist/components/common/CheckboxMark/index.d.ts +8 -0
- package/dist/components/common/DataPagination/components/ExpandButton.d.ts +7 -0
- package/dist/components/common/DataPagination/components/PaginationButton.d.ts +2 -1
- package/dist/components/common/DataPagination/index.d.ts +13 -3
- package/dist/components/common/DataPagination/paginationModel.d.ts +4 -0
- package/dist/components/common/Divider/index.d.ts +6 -0
- package/dist/components/common/EmptyState/index.d.ts +21 -0
- package/dist/components/common/IconWithSquareBackground/index.d.ts +2 -2
- package/dist/components/common/ImageCard/index.d.ts +5 -0
- package/dist/components/common/LinkTile/index.d.ts +11 -0
- package/dist/components/common/RadioMark/index.d.ts +8 -0
- package/dist/components/common/StepCard/StepCardFooter/index.d.ts +1 -1
- package/dist/components/common/TitleBlock/types.d.ts +4 -2
- package/dist/components/form/components/FormControlWrapper/index.d.ts +2 -1
- package/dist/components/form/inputs/Datepicker/RangeDatepicker.d.ts +23 -0
- package/dist/components/form/inputs/Datepicker/SingleDatepicker.d.ts +24 -0
- package/dist/components/form/inputs/Datepicker/components/CalendarViewsHeader.d.ts +18 -0
- package/dist/components/form/inputs/Datepicker/index.d.ts +10 -14
- package/dist/components/form/inputs/Datepicker/rangeModel.d.ts +4 -0
- package/dist/components/form/inputs/FileDropzone.d.ts +2 -2
- package/dist/components/form/inputs/RadioButtonGroup.d.ts +1 -0
- package/dist/components/form/inputs/Select/Select.styles.d.ts +84 -0
- package/dist/components/form/inputs/Select/components/OptionCheckbox.d.ts +2 -1
- package/dist/components/form/inputs/TextField.d.ts +27 -12
- package/dist/components/form/inputs/TextField.styles.d.ts +101 -0
- package/dist/components/layout/ServiceWizardStepper/stepperTokens.d.ts +5 -0
- package/dist/components/loaders/Loader/index.d.ts +12 -9
- package/dist/components/overlays/BottomSheet/index.d.ts +3 -2
- package/dist/components/overlays/Dialog/index.d.ts +1 -1
- package/dist/components/storybook/FileUploadTokenPreview.d.ts +4 -0
- package/dist/components/storybook/TabsTokenPreview.d.ts +3 -0
- package/dist/components/storybook/TokenDocs.d.ts +74 -0
- package/dist/library/index.d.ts +30 -1
- package/dist/registrucentras-rc-ses-react-components.cjs +2 -2
- package/dist/registrucentras-rc-ses-react-components.js +11144 -8374
- package/dist/theme/backdropTokens.d.ts +6 -0
- package/dist/theme/borderTokens.d.ts +33 -0
- package/dist/theme/cards.d.ts +42 -73
- package/dist/theme/colorTokens.d.ts +146 -0
- package/dist/theme/effectTokens.d.ts +9 -0
- package/dist/theme/layoutTokens.d.ts +12 -0
- package/dist/theme/light/MuiAccordion.d.ts +2 -2
- package/dist/theme/light/MuiAccordionSummary.d.ts +19 -0
- package/dist/theme/light/MuiButton.d.ts +7 -0
- package/dist/theme/light/MuiInputBase.d.ts +2 -0
- package/dist/theme/light/MuiPickerPopper.d.ts +3 -0
- package/dist/theme/light/MuiTypography.d.ts +0 -14
- package/dist/theme/palette.d.ts +8 -0
- package/dist/theme/sizeTokens.d.ts +20 -0
- package/dist/theme/spacingRoleBasedTokens.d.ts +38 -0
- package/dist/theme/spacingTokens.d.ts +97 -0
- package/dist/theme/tokenTheme.d.ts +13 -0
- package/dist/theme/typographyTokens.d.ts +104 -0
- package/package.json +2 -2
- package/src/assets/icons/phosphorIcons.ts +11 -0
- package/src/components/common/Accordion/hooks/useAccordionController.tsx +39 -7
- package/src/components/common/Accordion/index.test.tsx +132 -0
- package/src/components/common/Accordion/index.tsx +302 -25
- package/src/components/common/Accordion/types/AccordionControllerState.ts +1 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.tsx +3 -3
- package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.tsx +8 -3
- package/src/components/common/AdvancedList/components/AdvancedListItem/index.tsx +3 -2
- package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.test.tsx +3 -3
- package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.tsx +23 -19
- package/src/components/common/AdvancedList/index.test.tsx +4 -2
- package/src/components/common/Alert/index.tsx +10 -6
- package/src/components/common/Badge/index.tsx +50 -37
- package/src/components/common/Button/index.tsx +12 -10
- package/src/components/common/Card/index.tsx +6 -1
- package/src/components/common/CardShell/index.test.tsx +16 -6
- package/src/components/common/CheckboxMark/index.tsx +86 -0
- package/src/components/common/DataPagination/components/DataPaginationSkeleton.tsx +9 -7
- package/src/components/common/DataPagination/components/ExpandButton.tsx +48 -0
- package/src/components/common/DataPagination/components/PaginationButton.tsx +48 -21
- package/src/components/common/DataPagination/index.test.tsx +229 -12
- package/src/components/common/DataPagination/index.tsx +135 -60
- package/src/components/common/DataPagination/paginationModel.ts +35 -0
- package/src/components/common/Divider/index.test.tsx +33 -0
- package/src/components/common/Divider/index.tsx +52 -0
- package/src/components/common/EmptyState/index.test.tsx +56 -0
- package/src/components/common/EmptyState/index.tsx +211 -0
- package/src/components/common/FilterChip/index.tsx +24 -19
- package/src/components/common/IconWithCircularBackground.tsx +24 -6
- package/src/components/common/IconWithSquareBackground/index.test.tsx +14 -2
- package/src/components/common/IconWithSquareBackground/index.tsx +36 -17
- package/src/components/common/ImageCard/index.test.tsx +16 -0
- package/src/components/common/ImageCard/index.tsx +54 -1
- package/src/components/common/LinkTile/index.test.tsx +57 -0
- package/src/components/common/LinkTile/index.tsx +136 -0
- package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +39 -23
- package/src/components/common/ListWithIcons/index.test.tsx +20 -9
- package/src/components/common/ListWithIcons/index.tsx +6 -6
- package/src/components/common/Popover/index.tsx +11 -1
- package/src/components/common/RadioMark/index.tsx +76 -0
- package/src/components/common/SegmentedControl/components/SegmentButton/index.tsx +49 -25
- package/src/components/common/SegmentedControl/index.tsx +10 -6
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +7 -5
- package/src/components/common/SelectableCardList/index.test.tsx +8 -6
- package/src/components/common/SelectionMarks.test.tsx +92 -0
- package/src/components/common/ServiceLinks/ServiceLinkItem/index.tsx +20 -11
- package/src/components/common/ServiceLinks/index.tsx +3 -3
- package/src/components/common/SideNav/SideNavLayout.tsx +6 -1
- package/src/components/common/SideNav/components/SideNavPill.tsx +24 -12
- package/src/components/common/SideNav/components/SideNavPillList.tsx +18 -12
- package/src/components/common/SideNav/components/SideNavRow.tsx +22 -15
- package/src/components/common/SideNav/index.tsx +10 -9
- package/src/components/common/Snackbar/config.ts +27 -8
- package/src/components/common/Snackbar/index.tsx +39 -16
- package/src/components/common/StepCard/StepCardFooter/index.tsx +28 -6
- package/src/components/common/StepCard/index.tsx +18 -6
- package/src/components/common/Switch/index.tsx +10 -4
- package/src/components/common/Tabs/TabPanel.tsx +6 -3
- package/src/components/common/Tabs/TabsWrapper.tsx +15 -7
- package/src/components/common/TitleBlock/index.test.tsx +14 -17
- package/src/components/common/TitleBlock/index.tsx +120 -15
- package/src/components/common/TitleBlock/types.ts +4 -2
- package/src/components/common/Tooltip/index.tsx +32 -3
- package/src/components/form/components/FormControlWrapper/index.tsx +43 -14
- package/src/components/form/inputs/CheckboxFormControl.tsx +25 -13
- package/src/components/form/inputs/Datepicker/RangeDatepicker.tsx +356 -0
- package/src/components/form/inputs/Datepicker/SingleDatepicker.tsx +207 -0
- package/src/components/form/inputs/Datepicker/components/CalendarViewsHeader.tsx +335 -0
- package/src/components/form/inputs/Datepicker/components/RcSesDatepickerCalendarHeader.tsx +22 -10
- package/src/components/form/inputs/Datepicker/index.test.tsx +23 -18
- package/src/components/form/inputs/Datepicker/index.tsx +20 -150
- package/src/components/form/inputs/Datepicker/rangeModel.test.ts +35 -0
- package/src/components/form/inputs/Datepicker/rangeModel.ts +25 -0
- package/src/components/form/inputs/FileDropzone.tsx +73 -46
- package/src/components/form/inputs/FileUpload.tsx +25 -16
- package/src/components/form/inputs/NumberStepper.tsx +36 -14
- package/src/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.tsx +10 -5
- package/src/components/form/inputs/PhoneInputFormControl/components/ListboxComponent.tsx +7 -1
- package/src/components/form/inputs/PhoneInputFormControl/components/PopperComponent.tsx +5 -2
- package/src/components/form/inputs/PhoneInputFormControl/components/RowComponent.tsx +9 -5
- package/src/components/form/inputs/PhoneInputFormControl/index.tsx +48 -24
- package/src/components/form/inputs/RadioButtonGroup.tsx +14 -6
- package/src/components/form/inputs/Select/Select.styles.ts +76 -0
- package/src/components/form/inputs/Select/components/OptionCheckbox.tsx +6 -33
- package/src/components/form/inputs/Select/index.tsx +124 -86
- package/src/components/form/inputs/SimpleCheckbox.tsx +10 -3
- package/src/components/form/inputs/TextField.presets.test.tsx +284 -0
- package/src/components/form/inputs/TextField.styles.ts +96 -0
- package/src/components/form/inputs/TextField.test.tsx +153 -0
- package/src/components/form/inputs/TextField.tsx +315 -42
- package/src/components/layout/Footer/index.test.tsx +1 -1
- package/src/components/layout/Footer/index.tsx +17 -7
- package/src/components/layout/ServiceFormActions.tsx +5 -1
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/index.tsx +3 -3
- package/src/components/layout/ServiceHeader.tsx +19 -19
- package/src/components/layout/ServiceWizardStepper/ServiceWizardStepper.css +10 -10
- package/src/components/layout/ServiceWizardStepper/StepConnector.tsx +8 -5
- package/src/components/layout/ServiceWizardStepper/components/CustomStepIcon.tsx +22 -7
- package/src/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.tsx +15 -11
- package/src/components/layout/ServiceWizardStepper/components/StyledStepLabel.tsx +28 -11
- package/src/components/layout/ServiceWizardStepper/stepperTokens.ts +8 -0
- package/src/components/loaders/FullPageLoader/index.test.tsx +18 -7
- package/src/components/loaders/FullPageLoader/index.tsx +14 -9
- package/src/components/loaders/Loader/index.tsx +48 -17
- package/src/components/overlays/BottomSheet/index.test.tsx +36 -3
- package/src/components/overlays/BottomSheet/index.tsx +54 -21
- package/src/components/overlays/Dialog/index.tsx +5 -23
- package/src/components/overlays/Drawer/index.tsx +29 -14
- package/src/components/overlays/Modal/index.tsx +46 -8
- package/src/components/storybook/FileUploadTokenPreview.tsx +68 -0
- package/src/components/storybook/TabsTokenPreview.tsx +58 -0
- package/src/components/storybook/TokenDocs.tsx +347 -0
- package/src/examples/MultipleStepForm/components/TermsAndConditionsForm.tsx +5 -1
- package/src/i18n/namespaces/input/en.json +48 -4
- package/src/i18n/namespaces/input/lt.json +48 -4
- package/src/library/index.ts +50 -0
- package/src/stories/atoms/Badge.stories.tsx +2 -1
- package/src/stories/atoms/Button.stories.tsx +124 -6
- package/src/stories/atoms/CheckboxMark.stories.tsx +79 -0
- package/src/stories/atoms/Divider.stories.tsx +129 -0
- package/src/stories/atoms/FilterChip.stories.tsx +9 -1
- package/src/stories/atoms/IconWithSquareBackground.stories.tsx +7 -7
- package/src/stories/atoms/Icons.stories.tsx +1 -1
- package/src/stories/atoms/NumberStepper.stories.tsx +44 -0
- package/src/stories/atoms/PhoneInput.stories.tsx +42 -0
- package/src/stories/atoms/RadioMark.stories.tsx +132 -0
- package/src/stories/atoms/Select.stories.tsx +139 -2
- package/src/stories/atoms/SimpleCheckbox.stories.tsx +74 -0
- package/src/stories/atoms/Switch.stories.tsx +46 -1
- package/src/stories/atoms/TextField.stories.tsx +508 -0
- package/src/stories/atoms/Tooltip.stories.tsx +5 -0
- package/src/stories/fixtures/foundations/Borders.stories.tsx +84 -0
- package/src/stories/fixtures/foundations/Effects.stories.tsx +204 -0
- package/src/stories/fixtures/foundations/Layout.stories.tsx +76 -0
- package/src/stories/fixtures/foundations/Sizes.stories.tsx +42 -0
- package/src/stories/fixtures/foundations/Spacing.stories.tsx +48 -0
- package/src/stories/fixtures/foundations/Typography.stories.tsx +49 -0
- package/src/stories/foundations/Borders.stories.tsx +179 -0
- package/src/stories/foundations/Colors.stories.tsx +253 -0
- package/src/stories/foundations/Effects.stories.tsx +116 -0
- package/src/stories/foundations/Layout.stories.tsx +177 -0
- package/src/stories/foundations/Sizes.stories.tsx +123 -0
- package/src/stories/foundations/Spacing.stories.tsx +159 -0
- package/src/stories/foundations/ThemeAdapter.stories.tsx +389 -0
- package/src/stories/foundations/Typography.stories.tsx +148 -0
- package/src/stories/molecules/Alert.stories.tsx +18 -0
- package/src/stories/molecules/Breadcrumbs.stories.tsx +51 -0
- package/src/stories/molecules/Card.stories.tsx +1 -1
- package/src/stories/molecules/CardShell.stories.tsx +1 -0
- package/src/stories/molecules/DatePicker.stories.tsx +133 -3
- package/src/stories/molecules/EmptyState.stories.tsx +106 -0
- package/src/stories/molecules/FormControlWrapper.stories.tsx +59 -0
- package/src/stories/molecules/LinkTile.stories.tsx +151 -0
- package/src/stories/molecules/ListWithIcons.stories.tsx +27 -2
- package/src/stories/molecules/RadioButtonGroup.stories.tsx +23 -0
- package/src/stories/molecules/SegmentedControl.stories.tsx +62 -1
- package/src/stories/molecules/Tabs.stories.tsx +4 -0
- package/src/stories/molecules/TitleBlock.stories.tsx +16 -16
- package/src/stories/organisms/Accordion.stories.tsx +132 -0
- package/src/stories/organisms/AdvancedListItemShell.stories.tsx +63 -23
- package/src/stories/organisms/BottomSheet.stories.tsx +48 -1
- package/src/stories/organisms/DataPagination.stories.tsx +127 -3
- package/src/stories/organisms/Dialog.stories.tsx +13 -0
- package/src/stories/organisms/FileDropzone.stories.tsx +6 -0
- package/src/stories/organisms/FileUpload.stories.tsx +4 -0
- package/src/stories/organisms/Footer.stories.tsx +20 -0
- package/src/stories/organisms/Modal.stories.tsx +53 -0
- package/src/stories/organisms/ServiceHeader.stories.tsx +25 -3
- package/src/stories/organisms/ServiceLinks.stories.tsx +1 -1
- package/src/stories/organisms/ServiceWizardStepper.stories.tsx +37 -1
- package/src/stories/organisms/SideNav.stories.tsx +8 -1
- package/src/theme/backdropTokens.test.ts +11 -0
- package/src/theme/backdropTokens.ts +11 -0
- package/src/theme/borderTokens.test.ts +59 -0
- package/src/theme/borderTokens.ts +36 -0
- package/src/theme/cards.ts +28 -28
- package/src/theme/colorTokens.test.ts +66 -0
- package/src/theme/colorTokens.ts +87 -0
- package/src/theme/effectTokens.test.ts +29 -0
- package/src/theme/effectTokens.ts +11 -0
- package/src/theme/layoutTokens.test.ts +42 -0
- package/src/theme/layoutTokens.ts +14 -0
- package/src/theme/light/MuiAccordion.tsx +30 -26
- package/src/theme/light/MuiAccordionDetails.ts +10 -5
- package/src/theme/light/MuiAccordionSummary.tsx +31 -17
- package/src/theme/light/MuiAlert.tsx +42 -65
- package/src/theme/light/MuiAutocomplete.ts +14 -7
- package/src/theme/light/MuiBreadcrumbs.tsx +17 -9
- package/src/theme/light/MuiButton.tsx +213 -204
- package/src/theme/light/MuiCard.tsx +5 -4
- package/src/theme/light/MuiCheckbox.ts +45 -14
- package/src/theme/light/MuiChip.tsx +3 -1
- package/src/theme/light/MuiDialog.ts +45 -6
- package/src/theme/light/MuiFormControl.ts +19 -9
- package/src/theme/light/MuiFormControlLabel.ts +16 -25
- package/src/theme/light/MuiFormGroup.ts +29 -26
- package/src/theme/light/MuiFormHelperText.ts +15 -4
- package/src/theme/light/MuiFormLabel.ts +20 -20
- package/src/theme/light/MuiInputBase.ts +49 -84
- package/src/theme/light/MuiOutlinedInput.ts +50 -6
- package/src/theme/light/MuiPagination.ts +21 -21
- package/src/theme/light/MuiPickerPopper.ts +17 -0
- package/src/theme/light/MuiPickersLayout.ts +63 -34
- package/src/theme/light/MuiPickersOutlinedInput.ts +38 -38
- package/src/theme/light/MuiPopover.ts +3 -1
- package/src/theme/light/MuiRadio.tsx +35 -52
- package/src/theme/light/MuiStepper.ts +21 -17
- package/src/theme/light/MuiSwitch.tsx +27 -23
- package/src/theme/light/MuiTab.tsx +27 -18
- package/src/theme/light/MuiTableCell.ts +4 -2
- package/src/theme/light/MuiTabs.tsx +11 -9
- package/src/theme/light/MuiTooltip.ts +2 -1
- package/src/theme/light/MuiTypography.tsx +0 -17
- package/src/theme/light/index.tsx +2 -0
- package/src/theme/light/themePalette.tsx +1 -0
- package/src/theme/palette.tsx +9 -0
- package/src/theme/sizeTokens.test.ts +37 -0
- package/src/theme/sizeTokens.ts +21 -0
- package/src/theme/spacingRoleBasedTokens.ts +41 -0
- package/src/theme/spacingTokens.test.ts +58 -0
- package/src/theme/spacingTokens.ts +114 -0
- package/src/theme/tokenTheme.test.tsx +402 -0
- package/src/theme/tokenTheme.ts +429 -0
- package/src/theme/tokens.css +476 -0
- package/src/theme/tokens.test.ts +174 -0
- package/src/theme/typographyTokens.test.ts +120 -0
- package/src/theme/typographyTokens.ts +119 -0
- package/dist/theme/spacing.d.ts +0 -4
- package/src/stories/foundations/Colors.mdx +0 -127
- package/src/theme/spacing.ts +0 -5
|
@@ -3,16 +3,25 @@ import { FieldError } from 'react-hook-form'
|
|
|
3
3
|
import { useTranslation } from 'react-i18next'
|
|
4
4
|
|
|
5
5
|
import '@/i18n/i18n'
|
|
6
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
6
7
|
import theme from '@/theme/light'
|
|
8
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
9
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
7
10
|
|
|
8
11
|
import FieldSuffix from './components/FieldSuffix'
|
|
9
12
|
import { formControlDesktopLabelWidth } from './const/FormControlLayoutVariables'
|
|
10
13
|
|
|
14
|
+
// Read the rendered input state so every wrapper can share disabled text styling
|
|
15
|
+
// without adding a prop or changing any field's disabled behavior.
|
|
16
|
+
const disabledInput =
|
|
17
|
+
'&:has(.rc-ses-form-field-wrapper .MuiInputBase-root.Mui-disabled, .rc-ses-form-field-wrapper .MuiPickersInputBase-root.Mui-disabled)'
|
|
18
|
+
|
|
11
19
|
interface Props {
|
|
12
20
|
children: React.ReactNode
|
|
13
21
|
className?: string
|
|
14
22
|
description?: React.ReactNode
|
|
15
23
|
errors?: FieldError | undefined
|
|
24
|
+
errorMessage?: React.ReactNode
|
|
16
25
|
fieldSuffix?: React.ReactNode
|
|
17
26
|
hideLabel?: boolean
|
|
18
27
|
id?: string
|
|
@@ -27,6 +36,7 @@ function RcSesFormControlWrapper({
|
|
|
27
36
|
className = undefined,
|
|
28
37
|
description = undefined,
|
|
29
38
|
errors = undefined,
|
|
39
|
+
errorMessage,
|
|
30
40
|
fieldSuffix = undefined,
|
|
31
41
|
hideLabel = false,
|
|
32
42
|
id,
|
|
@@ -41,7 +51,18 @@ function RcSesFormControlWrapper({
|
|
|
41
51
|
const upMd = useMediaQuery(theme.breakpoints.up('md'))
|
|
42
52
|
|
|
43
53
|
return (
|
|
44
|
-
<FormControl
|
|
54
|
+
<FormControl
|
|
55
|
+
className={className}
|
|
56
|
+
error={!!errors}
|
|
57
|
+
sx={{
|
|
58
|
+
my: spacingRoleBasedTokens['space-8'],
|
|
59
|
+
width: '100%',
|
|
60
|
+
[`${disabledInput} > .rc-ses-form-control-wrapper > .MuiFormLabel-root, ${disabledInput} > [aria-live="polite"] > .MuiFormHelperText-root`]:
|
|
61
|
+
{
|
|
62
|
+
color: colorTokens['text-disabled'],
|
|
63
|
+
},
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
45
66
|
<Box
|
|
46
67
|
className='rc-ses-form-control-wrapper'
|
|
47
68
|
sx={{
|
|
@@ -55,18 +76,23 @@ function RcSesFormControlWrapper({
|
|
|
55
76
|
<FormLabel
|
|
56
77
|
htmlFor={id}
|
|
57
78
|
sx={{
|
|
79
|
+
...(labelOnTop && {
|
|
80
|
+
fontSize: typographyTokens['font-size-body-caption'],
|
|
81
|
+
lineHeight: typographyTokens['line-height-body-caption'],
|
|
82
|
+
// The theme's md weight is a media rule, which outranks plain sx.
|
|
83
|
+
'&&': { fontWeight: 400 },
|
|
84
|
+
}),
|
|
58
85
|
flex: {
|
|
59
86
|
xs: '0 0 0%',
|
|
60
87
|
sm: labelOnTop ? '0 0 0%' : `0 0 ${formControlDesktopLabelWidth}`,
|
|
61
88
|
},
|
|
62
|
-
|
|
63
|
-
'
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
pr: 3,
|
|
89
|
+
marginBottom: {
|
|
90
|
+
xs: spacingRoleBasedTokens['space-4'],
|
|
91
|
+
sm: labelOnTop
|
|
92
|
+
? spacingRoleBasedTokens['space-4']
|
|
93
|
+
: spacingRoleBasedTokens['space-0'],
|
|
94
|
+
},
|
|
95
|
+
pr: spacingRoleBasedTokens['space-24'],
|
|
70
96
|
textAlign: { xs: 'left', sm: labelOnTop ? 'left' : 'right' },
|
|
71
97
|
}}
|
|
72
98
|
>
|
|
@@ -121,15 +147,18 @@ function RcSesFormControlWrapper({
|
|
|
121
147
|
}}
|
|
122
148
|
>
|
|
123
149
|
{!!description && (
|
|
124
|
-
<FormHelperText
|
|
150
|
+
<FormHelperText id={id ? `${id}-description` : undefined}>
|
|
151
|
+
{description}
|
|
152
|
+
</FormHelperText>
|
|
125
153
|
)}
|
|
126
154
|
|
|
127
155
|
{!!errors && (
|
|
128
156
|
<FormHelperText id={`${id}-errors`} aria-errormessage={id} error>
|
|
129
|
-
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
157
|
+
{errorMessage ??
|
|
158
|
+
(errors.type === 'required' && !errors.message && (
|
|
159
|
+
<span>{t('required')}</span>
|
|
160
|
+
))}
|
|
161
|
+
{errorMessage == null && !!errors.message && <span>{errors.message}</span>}
|
|
133
162
|
</FormHelperText>
|
|
134
163
|
)}
|
|
135
164
|
</Box>
|
|
@@ -7,10 +7,13 @@ import {
|
|
|
7
7
|
import React, { useEffect, useMemo } from 'react'
|
|
8
8
|
import { UseControllerProps, useController } from 'react-hook-form'
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import RcSesCheckboxMark from '@/components/common/CheckboxMark'
|
|
11
11
|
import RcSesFormControlLabel from '@/components/form/inputs/FormControlLabel'
|
|
12
12
|
import getLoadingIcon from '@/components/utils/loading'
|
|
13
|
-
import
|
|
13
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
14
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
15
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
16
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
14
17
|
|
|
15
18
|
import { RcSesFormControlWrapperProps } from '../components/FormControlWrapper'
|
|
16
19
|
|
|
@@ -92,9 +95,16 @@ function RcSesCheckboxFormControl(props: Props) {
|
|
|
92
95
|
id={id}
|
|
93
96
|
checked={value === true}
|
|
94
97
|
indeterminate={computedIndeterminate}
|
|
95
|
-
checkedIcon={getLoadingIcon(
|
|
98
|
+
checkedIcon={getLoadingIcon(
|
|
99
|
+
<RcSesCheckboxMark type='checked' disabled={disabled} />,
|
|
100
|
+
loading,
|
|
101
|
+
)}
|
|
102
|
+
indeterminateIcon={getLoadingIcon(
|
|
103
|
+
<RcSesCheckboxMark type='indeterminate' disabled={disabled} />,
|
|
104
|
+
loading,
|
|
105
|
+
)}
|
|
96
106
|
disabled={disabled}
|
|
97
|
-
icon={getLoadingIcon(<
|
|
107
|
+
icon={getLoadingIcon(<RcSesCheckboxMark disabled={disabled} />, loading)}
|
|
98
108
|
onChange={handleParentChange}
|
|
99
109
|
{...controllerProps}
|
|
100
110
|
{...slotProps?.field}
|
|
@@ -102,7 +112,7 @@ function RcSesCheckboxFormControl(props: Props) {
|
|
|
102
112
|
/>
|
|
103
113
|
}
|
|
104
114
|
label={
|
|
105
|
-
<FormLabel htmlFor={id} sx={{ fontWeight: 'inherit
|
|
115
|
+
<FormLabel htmlFor={id} sx={{ '&&': { fontWeight: 'inherit' } }}>
|
|
106
116
|
{children}
|
|
107
117
|
{slotProps?.wrapper?.hideLabel && rules?.required === true && (
|
|
108
118
|
<span aria-hidden className='MuiFormControlLabel-asterisk'>
|
|
@@ -118,8 +128,8 @@ function RcSesCheckboxFormControl(props: Props) {
|
|
|
118
128
|
// MUI 9 tightened this slot's type: style shorthands are no longer
|
|
119
129
|
// accepted alongside component props, so they move into sx.
|
|
120
130
|
sx: {
|
|
121
|
-
fontWeight:
|
|
122
|
-
lineHeight: '
|
|
131
|
+
fontWeight: typographyTokens['font-weight-body-small'],
|
|
132
|
+
lineHeight: typographyTokens['line-height-body-small'],
|
|
123
133
|
marginLeft: variant === 'flat' ? '.4375rem' : '.1875rem',
|
|
124
134
|
},
|
|
125
135
|
variant: variant === 'flat' ? 'body1' : 'body2',
|
|
@@ -129,13 +139,15 @@ function RcSesCheckboxFormControl(props: Props) {
|
|
|
129
139
|
sx={{
|
|
130
140
|
...(!variant || variant === 'outlined'
|
|
131
141
|
? {
|
|
132
|
-
backgroundColor:
|
|
133
|
-
borderColor:
|
|
142
|
+
backgroundColor: colorTokens['surface-sunken'],
|
|
143
|
+
borderColor: colorTokens['border-strong'],
|
|
134
144
|
borderStyle: 'solid',
|
|
135
|
-
borderWidth: '
|
|
136
|
-
borderRadius: '
|
|
137
|
-
margin: 0,
|
|
138
|
-
|
|
145
|
+
borderWidth: borderTokens['stroke-1'],
|
|
146
|
+
borderRadius: borderTokens['radius-8'],
|
|
147
|
+
margin: spacingRoleBasedTokens['space-0'],
|
|
148
|
+
// Legacy geometry: the 14px start pairs with MUI's 9px checkbox padding.
|
|
149
|
+
// Figma's selectable area (12px sides, 2px icon frame) differs.
|
|
150
|
+
padding: `${spacingRoleBasedTokens['space-16']} ${spacingRoleBasedTokens['space-20']} ${spacingRoleBasedTokens['space-16']} .875rem`,
|
|
139
151
|
}
|
|
140
152
|
: {}),
|
|
141
153
|
...slotProps?.label?.sx,
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
IconButton,
|
|
4
|
+
InputAdornment,
|
|
5
|
+
Popover,
|
|
6
|
+
TextField,
|
|
7
|
+
useMediaQuery,
|
|
8
|
+
} from '@mui/material'
|
|
9
|
+
import type { DateCalendarProps } from '@mui/x-date-pickers/DateCalendar'
|
|
10
|
+
import { DateCalendar } from '@mui/x-date-pickers/DateCalendar'
|
|
11
|
+
import { PickerDay, PickerDayProps } from '@mui/x-date-pickers/PickerDay'
|
|
12
|
+
import { usePickerAdapter } from '@mui/x-date-pickers/hooks'
|
|
13
|
+
import { format, parseISO } from 'date-fns'
|
|
14
|
+
import React, { createContext, useContext, useId, useMemo, useRef, useState } from 'react'
|
|
15
|
+
import { UseControllerProps, useController } from 'react-hook-form'
|
|
16
|
+
import { useTranslation } from 'react-i18next'
|
|
17
|
+
|
|
18
|
+
import { CalendarBlankIcon, XCircleFillIcon } from '@/assets/icons/phosphorIcons'
|
|
19
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
20
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
21
|
+
import { effectTokens } from '@/theme/effectTokens'
|
|
22
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
23
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
24
|
+
|
|
25
|
+
import FormControlWrapper, {
|
|
26
|
+
RcSesFormControlWrapperProps,
|
|
27
|
+
} from '../../components/FormControlWrapper'
|
|
28
|
+
import CalendarViewsHeader, {
|
|
29
|
+
calendarViewsStyles,
|
|
30
|
+
} from './components/CalendarViewsHeader'
|
|
31
|
+
import { DateRangeValue, readRange, selectRange } from './rangeModel'
|
|
32
|
+
|
|
33
|
+
export type RangeDatepickerProps = UseControllerProps<any, any> &
|
|
34
|
+
Pick<RcSesFormControlWrapperProps, 'label' | 'errors'> & {
|
|
35
|
+
id?: string
|
|
36
|
+
clearable?: boolean
|
|
37
|
+
placeholder?: string
|
|
38
|
+
slotProps?: {
|
|
39
|
+
wrapper?: Partial<Omit<RcSesFormControlWrapperProps, 'label' | 'errors'>>
|
|
40
|
+
calendar?: Omit<
|
|
41
|
+
DateCalendarProps,
|
|
42
|
+
| 'value'
|
|
43
|
+
| 'defaultValue'
|
|
44
|
+
| 'onChange'
|
|
45
|
+
| 'slots'
|
|
46
|
+
| 'slotProps'
|
|
47
|
+
| 'disabled'
|
|
48
|
+
| 'readOnly'
|
|
49
|
+
>
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const RangeContext = createContext<{
|
|
54
|
+
range: DateRangeValue
|
|
55
|
+
preview: string | null
|
|
56
|
+
setPreview: (day: string) => void
|
|
57
|
+
}>({ range: [null, null], preview: null, setPreview: () => {} })
|
|
58
|
+
|
|
59
|
+
function RangeDay(props: PickerDayProps) {
|
|
60
|
+
const {
|
|
61
|
+
range: [start, end],
|
|
62
|
+
preview,
|
|
63
|
+
setPreview,
|
|
64
|
+
} = useContext(RangeContext)
|
|
65
|
+
const { t } = useTranslation('input', { keyPrefix: 'components.RcSesDatepicker.range' })
|
|
66
|
+
const { day: date, disabled, onMouseEnter, onFocus, ...dayProps } = props
|
|
67
|
+
const day = format(date, 'yyyy-MM-dd')
|
|
68
|
+
const endpoint = day === start || day === end
|
|
69
|
+
const low = start && preview && !end ? [start, preview].sort()[0] : start
|
|
70
|
+
const high = start && preview && !end ? [start, preview].sort()[1] : end
|
|
71
|
+
const inside = !!low && !!high && day >= low && day <= high
|
|
72
|
+
let status = ''
|
|
73
|
+
if (endpoint) status = day === start ? t('start') : t('end')
|
|
74
|
+
else if (inside) status = end ? t('inRange') : t('preview')
|
|
75
|
+
|
|
76
|
+
let rangeState: string | undefined
|
|
77
|
+
if (endpoint) rangeState = day === start ? 'start' : 'end'
|
|
78
|
+
else if (inside) rangeState = end ? 'in-range' : 'preview'
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<PickerDay
|
|
82
|
+
{...dayProps}
|
|
83
|
+
day={date}
|
|
84
|
+
disabled={disabled}
|
|
85
|
+
selected={endpoint}
|
|
86
|
+
aria-selected={endpoint}
|
|
87
|
+
aria-label={`${day}${status ? `, ${status}` : ''}`}
|
|
88
|
+
data-range-state={rangeState}
|
|
89
|
+
onMouseEnter={(event, hoveredDate) => {
|
|
90
|
+
onMouseEnter?.(event, hoveredDate)
|
|
91
|
+
if (!disabled) setPreview(day)
|
|
92
|
+
}}
|
|
93
|
+
onFocus={(event, focusedDate) => {
|
|
94
|
+
onFocus?.(event, focusedDate)
|
|
95
|
+
if (!disabled) setPreview(day)
|
|
96
|
+
}}
|
|
97
|
+
sx={{
|
|
98
|
+
'&&': {
|
|
99
|
+
width: '44px',
|
|
100
|
+
height: '44px',
|
|
101
|
+
margin: 0,
|
|
102
|
+
borderRadius: inside && !endpoint ? 0 : borderTokens['radius-8'],
|
|
103
|
+
fontSize: typographyTokens['font-size-body-regular'],
|
|
104
|
+
lineHeight: typographyTokens['line-height-body-regular'],
|
|
105
|
+
color: colorTokens['text-default'],
|
|
106
|
+
backgroundColor: inside ? colorTokens['surface-brand-subtle'] : 'transparent',
|
|
107
|
+
'&.MuiPickerDay-dayOutsideMonth': { color: colorTokens['text-muted'] },
|
|
108
|
+
'&.MuiPickerDay-today': {
|
|
109
|
+
outline: `${borderTokens['stroke-1']} solid var(--rc-color-cyans-500)`,
|
|
110
|
+
outlineOffset: `calc(-1 * ${borderTokens['stroke-1']})`,
|
|
111
|
+
},
|
|
112
|
+
'&:hover': { backgroundColor: colorTokens['surface-muted'] },
|
|
113
|
+
'&.Mui-selected, &.Mui-selected:hover, &.Mui-selected:focus': {
|
|
114
|
+
backgroundColor: colorTokens['control-selected'],
|
|
115
|
+
color: colorTokens['text-inverse'],
|
|
116
|
+
},
|
|
117
|
+
'&.Mui-disabled': { color: colorTokens['text-disabled'] },
|
|
118
|
+
'&.Mui-focusVisible': {
|
|
119
|
+
boxShadow: effectTokens['focus-ring-default'],
|
|
120
|
+
zIndex: 1,
|
|
121
|
+
},
|
|
122
|
+
'&.Mui-selected.Mui-focusVisible': {
|
|
123
|
+
boxShadow: `0 0 0 2px ${colorTokens['surface-base']}, 0 0 0 4px ${colorTokens['border-focus']}`,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
}}
|
|
127
|
+
/>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const RangeDatepicker = React.forwardRef<HTMLInputElement, RangeDatepickerProps>(
|
|
132
|
+
(props, ref) => {
|
|
133
|
+
const {
|
|
134
|
+
id: idProp,
|
|
135
|
+
clearable,
|
|
136
|
+
placeholder,
|
|
137
|
+
label,
|
|
138
|
+
errors,
|
|
139
|
+
slotProps,
|
|
140
|
+
...controller
|
|
141
|
+
} = props
|
|
142
|
+
const { field } = useController(controller)
|
|
143
|
+
const generatedId = useId()
|
|
144
|
+
const id = idProp ?? generatedId
|
|
145
|
+
const { t } = useTranslation('input', { keyPrefix: 'components.RcSesDatepicker' })
|
|
146
|
+
const adapter = usePickerAdapter()
|
|
147
|
+
const anchor = useRef<HTMLDivElement>(null)
|
|
148
|
+
const input = useRef<HTMLInputElement | null>(null)
|
|
149
|
+
const [open, setOpen] = useState(false)
|
|
150
|
+
const [preview, setPreview] = useState<string | null>(null)
|
|
151
|
+
const range = useMemo(() => readRange(field.value), [field.value])
|
|
152
|
+
const [start, end] = range
|
|
153
|
+
const calendarValue = useMemo(
|
|
154
|
+
() => (start ? parseISO(end ?? start) : null),
|
|
155
|
+
[start, end],
|
|
156
|
+
)
|
|
157
|
+
const reducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)')
|
|
158
|
+
const display = start ? `${start}${end ? ` - ${end}` : ''}` : ''
|
|
159
|
+
let announcement = t('range.chooseStart')
|
|
160
|
+
if (start) announcement = t('range.chooseEnd', { start })
|
|
161
|
+
if (start && end) announcement = t('range.selected', { start, end })
|
|
162
|
+
const rangeContext = useMemo(() => ({ range, preview, setPreview }), [range, preview])
|
|
163
|
+
const close = () => {
|
|
164
|
+
setOpen(false)
|
|
165
|
+
setPreview(null)
|
|
166
|
+
field.onBlur()
|
|
167
|
+
input.current?.focus()
|
|
168
|
+
}
|
|
169
|
+
const chooseDay = (date: Date | null) => {
|
|
170
|
+
if (!date) return
|
|
171
|
+
const next = selectRange(range, date)
|
|
172
|
+
field.onChange(next)
|
|
173
|
+
setPreview(null)
|
|
174
|
+
if (next[1]) close()
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<FormControlWrapper
|
|
179
|
+
id={id}
|
|
180
|
+
label={label}
|
|
181
|
+
errors={errors}
|
|
182
|
+
required={!!controller.rules?.required}
|
|
183
|
+
{...slotProps?.wrapper}
|
|
184
|
+
>
|
|
185
|
+
<TextField
|
|
186
|
+
ref={anchor}
|
|
187
|
+
inputRef={(element) => {
|
|
188
|
+
input.current = element
|
|
189
|
+
field.ref(element)
|
|
190
|
+
if (typeof ref === 'function') ref(element)
|
|
191
|
+
else if (ref) ref.current = element
|
|
192
|
+
}}
|
|
193
|
+
id={id}
|
|
194
|
+
name={field.name}
|
|
195
|
+
value={display}
|
|
196
|
+
fullWidth
|
|
197
|
+
disabled={field.disabled}
|
|
198
|
+
error={!!errors}
|
|
199
|
+
placeholder={placeholder ?? 'YYYY-MM-DD - YYYY-MM-DD'}
|
|
200
|
+
onBlur={field.onBlur}
|
|
201
|
+
onClick={() => {
|
|
202
|
+
if (!field.disabled) setOpen(true)
|
|
203
|
+
}}
|
|
204
|
+
onKeyDown={(event) => {
|
|
205
|
+
if (
|
|
206
|
+
event.target === input.current &&
|
|
207
|
+
['Enter', ' ', 'ArrowDown'].includes(event.key) &&
|
|
208
|
+
!field.disabled
|
|
209
|
+
) {
|
|
210
|
+
event.preventDefault()
|
|
211
|
+
setOpen(true)
|
|
212
|
+
}
|
|
213
|
+
}}
|
|
214
|
+
slotProps={{
|
|
215
|
+
htmlInput: {
|
|
216
|
+
role: 'combobox',
|
|
217
|
+
readOnly: true,
|
|
218
|
+
'aria-haspopup': 'dialog',
|
|
219
|
+
'aria-expanded': open,
|
|
220
|
+
'aria-controls': open ? `${id}-calendar` : undefined,
|
|
221
|
+
'aria-describedby': `${id}-status${errors ? ` ${id}-errors` : ''}`,
|
|
222
|
+
},
|
|
223
|
+
input: {
|
|
224
|
+
startAdornment: (
|
|
225
|
+
<InputAdornment position='start'>
|
|
226
|
+
<IconButton
|
|
227
|
+
aria-label={t('aria.openCalendar')}
|
|
228
|
+
aria-haspopup='dialog'
|
|
229
|
+
aria-expanded={open}
|
|
230
|
+
aria-controls={open ? `${id}-calendar` : undefined}
|
|
231
|
+
disabled={field.disabled}
|
|
232
|
+
onClick={() => setOpen(true)}
|
|
233
|
+
>
|
|
234
|
+
<CalendarBlankIcon />
|
|
235
|
+
</IconButton>
|
|
236
|
+
</InputAdornment>
|
|
237
|
+
),
|
|
238
|
+
endAdornment:
|
|
239
|
+
clearable && start ? (
|
|
240
|
+
<InputAdornment position='end'>
|
|
241
|
+
<IconButton
|
|
242
|
+
aria-label={t('aria.clearValue')}
|
|
243
|
+
disabled={field.disabled}
|
|
244
|
+
onClick={(event) => {
|
|
245
|
+
event.stopPropagation()
|
|
246
|
+
field.onChange([null, null])
|
|
247
|
+
setPreview(null)
|
|
248
|
+
input.current?.focus()
|
|
249
|
+
}}
|
|
250
|
+
>
|
|
251
|
+
<XCircleFillIcon />
|
|
252
|
+
</IconButton>
|
|
253
|
+
</InputAdornment>
|
|
254
|
+
) : undefined,
|
|
255
|
+
},
|
|
256
|
+
}}
|
|
257
|
+
/>
|
|
258
|
+
<Box
|
|
259
|
+
id={`${id}-status`}
|
|
260
|
+
role='status'
|
|
261
|
+
aria-live='polite'
|
|
262
|
+
aria-atomic='true'
|
|
263
|
+
sx={{
|
|
264
|
+
position: 'absolute',
|
|
265
|
+
width: '1px',
|
|
266
|
+
height: '1px',
|
|
267
|
+
overflow: 'hidden',
|
|
268
|
+
clipPath: 'inset(50%)',
|
|
269
|
+
}}
|
|
270
|
+
>
|
|
271
|
+
{announcement}
|
|
272
|
+
</Box>
|
|
273
|
+
<Popover
|
|
274
|
+
transitionDuration={reducedMotion ? 0 : undefined}
|
|
275
|
+
open={open && !field.disabled}
|
|
276
|
+
anchorEl={() => anchor.current}
|
|
277
|
+
onClose={close}
|
|
278
|
+
anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
|
|
279
|
+
slotProps={{
|
|
280
|
+
paper: {
|
|
281
|
+
id: `${id}-calendar`,
|
|
282
|
+
role: 'dialog',
|
|
283
|
+
'aria-modal': true,
|
|
284
|
+
'aria-label': t('range.calendar'),
|
|
285
|
+
sx: {
|
|
286
|
+
width: '340px',
|
|
287
|
+
p: 0,
|
|
288
|
+
boxSizing: 'border-box',
|
|
289
|
+
maxWidth: 'calc(100vw - 32px)',
|
|
290
|
+
borderRadius: borderTokens['radius-12'],
|
|
291
|
+
border: `${borderTokens['stroke-1']} solid ${colorTokens['border-subtle']}`,
|
|
292
|
+
backgroundColor: colorTokens['surface-base'],
|
|
293
|
+
boxShadow: effectTokens['elevation-md'],
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
}}
|
|
297
|
+
>
|
|
298
|
+
<Box
|
|
299
|
+
role='status'
|
|
300
|
+
aria-live='polite'
|
|
301
|
+
aria-atomic='true'
|
|
302
|
+
sx={{
|
|
303
|
+
position: 'absolute',
|
|
304
|
+
width: '1px',
|
|
305
|
+
height: '1px',
|
|
306
|
+
overflow: 'hidden',
|
|
307
|
+
clipPath: 'inset(50%)',
|
|
308
|
+
}}
|
|
309
|
+
>
|
|
310
|
+
{announcement}
|
|
311
|
+
</Box>
|
|
312
|
+
<RangeContext.Provider value={rangeContext}>
|
|
313
|
+
<DateCalendar
|
|
314
|
+
views={['day']}
|
|
315
|
+
{...slotProps?.calendar}
|
|
316
|
+
autoFocus
|
|
317
|
+
dayOfWeekFormatter={(date) =>
|
|
318
|
+
adapter.format(date, 'weekdayShort').substring(0, 2)
|
|
319
|
+
}
|
|
320
|
+
reduceAnimations
|
|
321
|
+
showDaysOutsideCurrentMonth
|
|
322
|
+
value={calendarValue}
|
|
323
|
+
onChange={chooseDay}
|
|
324
|
+
slots={{
|
|
325
|
+
day: RangeDay,
|
|
326
|
+
calendarHeader: CalendarViewsHeader,
|
|
327
|
+
}}
|
|
328
|
+
sx={{
|
|
329
|
+
'.MuiDayCalendar-weekContainer': { margin: 0 },
|
|
330
|
+
'.MuiDayCalendar-weekDayLabel': {
|
|
331
|
+
width: '44px',
|
|
332
|
+
height: '24px',
|
|
333
|
+
margin: 0,
|
|
334
|
+
fontSize: typographyTokens['font-size-body-caption'],
|
|
335
|
+
lineHeight: typographyTokens['line-height-body-caption'],
|
|
336
|
+
color: colorTokens['text-secondary'],
|
|
337
|
+
},
|
|
338
|
+
'.MuiDayCalendar-header': {
|
|
339
|
+
marginBottom: spacingRoleBasedTokens['space-12'],
|
|
340
|
+
},
|
|
341
|
+
'.MuiDayCalendar-monthContainer': { overflow: 'visible' },
|
|
342
|
+
'.MuiDateCalendar-viewTransitionContainer': { overflow: 'visible' },
|
|
343
|
+
'.MuiDayCalendar-slideTransition': { minHeight: 0, overflow: 'visible' },
|
|
344
|
+
...calendarViewsStyles,
|
|
345
|
+
width: '100%',
|
|
346
|
+
padding: `calc(${spacingRoleBasedTokens['space-16']} - ${borderTokens['stroke-1']})`,
|
|
347
|
+
}}
|
|
348
|
+
/>
|
|
349
|
+
</RangeContext.Provider>
|
|
350
|
+
</Popover>
|
|
351
|
+
</FormControlWrapper>
|
|
352
|
+
)
|
|
353
|
+
},
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
export default RangeDatepicker
|