@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
|
@@ -2,15 +2,22 @@ import { StepIconProps } from '@mui/material'
|
|
|
2
2
|
|
|
3
3
|
import DotCircleFilledIcon from '@/assets/icons/DotCircleFilledIcon'
|
|
4
4
|
import { CheckCircleFillIcon, CircleFilledIcon } from '@/assets/icons/phosphorIcons'
|
|
5
|
-
import
|
|
5
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
6
|
+
import { sizeTokens } from '@/theme/sizeTokens'
|
|
7
|
+
|
|
8
|
+
import stepperColors from '../stepperTokens'
|
|
6
9
|
|
|
7
10
|
const CustomStepIcon = ({ active, completed, className, style }: StepIconProps) => {
|
|
8
11
|
if (completed) {
|
|
9
12
|
return (
|
|
10
13
|
<CheckCircleFillIcon
|
|
11
14
|
className={className}
|
|
12
|
-
style={
|
|
13
|
-
|
|
15
|
+
style={{
|
|
16
|
+
width: sizeTokens['icon-size-20'],
|
|
17
|
+
height: sizeTokens['icon-size-20'],
|
|
18
|
+
...style,
|
|
19
|
+
}}
|
|
20
|
+
fillColor={stepperColors.progress}
|
|
14
21
|
size={20}
|
|
15
22
|
/>
|
|
16
23
|
)
|
|
@@ -20,8 +27,12 @@ const CustomStepIcon = ({ active, completed, className, style }: StepIconProps)
|
|
|
20
27
|
return (
|
|
21
28
|
<DotCircleFilledIcon
|
|
22
29
|
className={className}
|
|
23
|
-
style={
|
|
24
|
-
|
|
30
|
+
style={{
|
|
31
|
+
width: sizeTokens['icon-size-20'],
|
|
32
|
+
height: sizeTokens['icon-size-20'],
|
|
33
|
+
...style,
|
|
34
|
+
}}
|
|
35
|
+
fillColor={stepperColors.progress}
|
|
25
36
|
size={20}
|
|
26
37
|
/>
|
|
27
38
|
)
|
|
@@ -30,8 +41,12 @@ const CustomStepIcon = ({ active, completed, className, style }: StepIconProps)
|
|
|
30
41
|
return (
|
|
31
42
|
<CircleFilledIcon
|
|
32
43
|
className={className}
|
|
33
|
-
style={
|
|
34
|
-
|
|
44
|
+
style={{
|
|
45
|
+
width: sizeTokens['icon-size-20'],
|
|
46
|
+
height: sizeTokens['icon-size-20'],
|
|
47
|
+
...style,
|
|
48
|
+
}}
|
|
49
|
+
fillColor={colorTokens['border-default']}
|
|
35
50
|
size={20}
|
|
36
51
|
/>
|
|
37
52
|
)
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Button, ButtonProps } from '@mui/material'
|
|
2
2
|
|
|
3
3
|
import { CaretLeftIcon, CaretRightBoldIcon } from '@/assets/icons/phosphorIcons'
|
|
4
|
-
import
|
|
4
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
5
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
6
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
7
|
+
|
|
8
|
+
import stepperColors from '../stepperTokens'
|
|
5
9
|
|
|
6
10
|
type Props = ButtonProps & {
|
|
7
11
|
direction: 'back' | 'forward'
|
|
@@ -16,18 +20,18 @@ const HorizontalStepperButton = ({ direction, sx, ...rest }: Props) => {
|
|
|
16
20
|
color='inherit'
|
|
17
21
|
{...rest}
|
|
18
22
|
sx={{
|
|
19
|
-
minWidth: 36,
|
|
20
|
-
width: 36,
|
|
21
|
-
height: 36,
|
|
22
|
-
padding: 0,
|
|
23
|
-
borderRadius:
|
|
24
|
-
borderColor:
|
|
25
|
-
color:
|
|
23
|
+
minWidth: spacingRoleBasedTokens['space-36'],
|
|
24
|
+
width: spacingRoleBasedTokens['space-36'],
|
|
25
|
+
height: spacingRoleBasedTokens['space-36'],
|
|
26
|
+
padding: spacingRoleBasedTokens['space-0'],
|
|
27
|
+
borderRadius: borderTokens['radius-8'],
|
|
28
|
+
borderColor: colorTokens['control-unselected'],
|
|
29
|
+
color: stepperColors.label,
|
|
26
30
|
|
|
27
31
|
'&:hover': {
|
|
28
|
-
borderColor:
|
|
29
|
-
backgroundColor:
|
|
30
|
-
color: '
|
|
32
|
+
borderColor: stepperColors.label,
|
|
33
|
+
backgroundColor: stepperColors.label,
|
|
34
|
+
color: colorTokens['text-inverse'],
|
|
31
35
|
},
|
|
32
36
|
|
|
33
37
|
'&.Mui-disabled': {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { StepLabel, styled } from '@mui/material'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
4
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
5
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
6
|
+
import { spacingTokens } from '@/theme/spacingTokens'
|
|
7
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
8
|
+
|
|
9
|
+
import stepperColors from '../stepperTokens'
|
|
4
10
|
|
|
5
11
|
export type StepState = 'completed' | 'active' | 'pending'
|
|
6
12
|
|
|
@@ -14,14 +20,23 @@ const StyledStepLabel = styled(StepLabel, {
|
|
|
14
20
|
shouldForwardProp: (prop) =>
|
|
15
21
|
prop !== 'stepState' && prop !== 'orientation' && prop !== 'isLast',
|
|
16
22
|
})<StyledStepLabelProps>(({ stepState, orientation, isLast }) => ({
|
|
17
|
-
'
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
'&& .MuiStepLabel-label': {
|
|
24
|
+
// Figma's Active item variants bind Heading/H4 (500); the designer confirmed bold is intended.
|
|
25
|
+
fontWeight: stepState === 'active' ? 700 : 500,
|
|
26
|
+
fontSize: typographyTokens['font-size-heading-h4'],
|
|
27
|
+
lineHeight: typographyTokens['line-height-heading-h4'],
|
|
28
|
+
color:
|
|
29
|
+
orientation === 'vertical' && stepState === 'pending'
|
|
30
|
+
? colorTokens['text-muted']
|
|
31
|
+
: stepperColors.label,
|
|
20
32
|
},
|
|
21
33
|
|
|
22
34
|
...(orientation === 'vertical' && {
|
|
23
|
-
'
|
|
24
|
-
fontSize: '
|
|
35
|
+
'&& .MuiStepLabel-label.Mui-active': {
|
|
36
|
+
fontSize: typographyTokens['font-size-heading-h4'],
|
|
37
|
+
lineHeight: typographyTokens['line-height-heading-h4'],
|
|
38
|
+
fontWeight: 700,
|
|
39
|
+
color: stepperColors.label,
|
|
25
40
|
},
|
|
26
41
|
}),
|
|
27
42
|
|
|
@@ -40,18 +55,20 @@ const StyledStepLabel = styled(StepLabel, {
|
|
|
40
55
|
position: 'absolute',
|
|
41
56
|
top: '100%',
|
|
42
57
|
left: '9px',
|
|
43
|
-
width: '
|
|
58
|
+
width: borderTokens['stroke-2'],
|
|
44
59
|
height: '14px',
|
|
45
|
-
borderRadius: '
|
|
60
|
+
borderRadius: borderTokens['radius-2'],
|
|
46
61
|
backgroundColor:
|
|
47
|
-
stepState === 'completed'
|
|
48
|
-
|
|
62
|
+
stepState === 'completed'
|
|
63
|
+
? stepperColors.progress
|
|
64
|
+
: colorTokens['border-default'],
|
|
65
|
+
marginTop: spacingRoleBasedTokens['space-4'],
|
|
49
66
|
},
|
|
50
67
|
}),
|
|
51
68
|
|
|
52
69
|
...(orientation === 'horizontal' && {
|
|
53
70
|
'& .MuiStepLabel-label.MuiStepLabel-alternativeLabel': {
|
|
54
|
-
marginTop:
|
|
71
|
+
marginTop: spacingTokens['spacing-aliases-stepper-item-gap'],
|
|
55
72
|
},
|
|
56
73
|
}),
|
|
57
74
|
}))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThemeProvider
|
|
1
|
+
import { ThemeProvider } from '@mui/material/styles'
|
|
2
2
|
import { render, screen } from '@testing-library/react'
|
|
3
3
|
import { type ReactElement } from 'react'
|
|
4
4
|
import { beforeEach, describe, expect, it } from 'vitest'
|
|
@@ -13,6 +13,17 @@ const getDefaultLoaderLabel = () => i18n.t('components.Loader.loading', { ns: 'c
|
|
|
13
13
|
const renderWithTheme = (ui: ReactElement) =>
|
|
14
14
|
render(<ThemeProvider theme={theme}>{ui}</ThemeProvider>)
|
|
15
15
|
|
|
16
|
+
// jsdom's computed style drops color-mix(), so read the rules applied to the element.
|
|
17
|
+
const getAppliedCss = (element: Element) =>
|
|
18
|
+
Array.from(document.styleSheets)
|
|
19
|
+
.flatMap((sheet) => Array.from(sheet.cssRules))
|
|
20
|
+
.filter(
|
|
21
|
+
(rule): rule is CSSStyleRule =>
|
|
22
|
+
rule instanceof CSSStyleRule && element.matches(rule.selectorText),
|
|
23
|
+
)
|
|
24
|
+
.map((rule) => rule.style.cssText)
|
|
25
|
+
.join(' ')
|
|
26
|
+
|
|
16
27
|
describe('RcSesFullPageLoader', () => {
|
|
17
28
|
beforeEach(async () => {
|
|
18
29
|
await i18n.changeLanguage('lt')
|
|
@@ -30,9 +41,9 @@ describe('RcSesFullPageLoader', () => {
|
|
|
30
41
|
|
|
31
42
|
const backdrop = document.querySelector('.MuiBackdrop-root') as HTMLElement
|
|
32
43
|
|
|
33
|
-
expect(backdrop).
|
|
34
|
-
|
|
35
|
-
|
|
44
|
+
expect(getAppliedCss(backdrop)).toContain(
|
|
45
|
+
'color-mix(in srgb, var(--rc-color-surface-base) 70%, transparent)',
|
|
46
|
+
)
|
|
36
47
|
})
|
|
37
48
|
|
|
38
49
|
it('should render dark backdrop variant', () => {
|
|
@@ -40,9 +51,9 @@ describe('RcSesFullPageLoader', () => {
|
|
|
40
51
|
|
|
41
52
|
const backdrop = document.querySelector('.MuiBackdrop-root') as HTMLElement
|
|
42
53
|
|
|
43
|
-
expect(backdrop).
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
expect(getAppliedCss(backdrop)).toContain(
|
|
55
|
+
'color-mix(in srgb, var(--rc-color-surface-inverse) 55%, transparent)',
|
|
56
|
+
)
|
|
46
57
|
})
|
|
47
58
|
|
|
48
59
|
it('should prevent and restore background focus', () => {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Box, BoxProps, Modal, Paper } from '@mui/material'
|
|
2
|
-
import { alpha } from '@mui/material/styles'
|
|
3
2
|
|
|
4
3
|
import RcSesLoader, { RcSesLoaderProps } from '@/components/loaders/Loader'
|
|
4
|
+
import { backdropTokens } from '@/theme/backdropTokens'
|
|
5
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
6
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
7
|
+
import { effectTokens } from '@/theme/effectTokens'
|
|
5
8
|
|
|
6
9
|
export type RcSesLoaderBackdrop = 'dark' | 'light'
|
|
7
10
|
|
|
@@ -9,6 +12,11 @@ export type RcSesLoaderBackdrop = 'dark' | 'light'
|
|
|
9
12
|
const FULL_PAGE_LOADER_CONTAINER_WIDTH = 187
|
|
10
13
|
const FULL_PAGE_LOADER_CONTAINER_HEIGHT = 198
|
|
11
14
|
|
|
15
|
+
const BACKDROP_COLOR = {
|
|
16
|
+
dark: backdropTokens['backdrop-dark'],
|
|
17
|
+
light: backdropTokens['backdrop-light'],
|
|
18
|
+
}
|
|
19
|
+
|
|
12
20
|
type FullPageLoaderContentProps = Pick<RcSesLoaderProps, 'label' | 'showLabel'>
|
|
13
21
|
|
|
14
22
|
export interface RcSesFullPageLoaderProps
|
|
@@ -30,12 +38,7 @@ function RcSesFullPageLoader({
|
|
|
30
38
|
open
|
|
31
39
|
slotProps={{
|
|
32
40
|
backdrop: {
|
|
33
|
-
sx: {
|
|
34
|
-
backgroundColor: (theme) =>
|
|
35
|
-
backdrop === 'dark'
|
|
36
|
-
? alpha(theme.palette.grey[900], 0.45)
|
|
37
|
-
: alpha(theme.palette.common.white, 0.72),
|
|
38
|
-
},
|
|
41
|
+
sx: { backgroundColor: BACKDROP_COLOR[backdrop] },
|
|
39
42
|
},
|
|
40
43
|
}}
|
|
41
44
|
>
|
|
@@ -49,9 +52,11 @@ function RcSesFullPageLoader({
|
|
|
49
52
|
{...props}
|
|
50
53
|
>
|
|
51
54
|
<Paper
|
|
52
|
-
elevation={
|
|
55
|
+
elevation={0}
|
|
53
56
|
sx={{
|
|
54
|
-
|
|
57
|
+
backgroundColor: colorTokens['surface-base'],
|
|
58
|
+
borderRadius: borderTokens['radius-16'],
|
|
59
|
+
boxShadow: effectTokens['elevation-lg'],
|
|
55
60
|
boxSizing: 'border-box',
|
|
56
61
|
display: 'grid',
|
|
57
62
|
height: FULL_PAGE_LOADER_CONTAINER_HEIGHT,
|
|
@@ -1,24 +1,33 @@
|
|
|
1
|
-
import { Stack, StackProps, Typography } from '@mui/material'
|
|
1
|
+
import { Box, Stack, StackProps, Typography } from '@mui/material'
|
|
2
2
|
import { useTranslation } from 'react-i18next'
|
|
3
3
|
|
|
4
4
|
import RcSesLoadingSpinner from '@/components/loaders/LoadingSpinner'
|
|
5
|
-
import
|
|
5
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
6
|
+
import { spacingTokens } from '@/theme/spacingTokens'
|
|
7
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
6
8
|
|
|
9
|
+
// CircularProgress draws its stroke in a 44-unit viewBox.
|
|
10
|
+
const SPINNER_VIEWBOX = 44
|
|
11
|
+
|
|
12
|
+
// Spinner and stroke sizes in px, per the Figma Spinner sizes.
|
|
7
13
|
const LOADER_SIZE_MAP = {
|
|
8
14
|
small: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
spinnerSize: 24,
|
|
16
|
+
strokeWidth: 2.5,
|
|
17
|
+
fontSize: typographyTokens['font-size-body-small'],
|
|
18
|
+
lineHeight: typographyTokens['line-height-body-small'],
|
|
12
19
|
},
|
|
13
20
|
medium: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
spinnerSize: 40,
|
|
22
|
+
strokeWidth: 3,
|
|
23
|
+
fontSize: typographyTokens['font-size-body-regular'],
|
|
24
|
+
lineHeight: typographyTokens['line-height-body-regular'],
|
|
17
25
|
},
|
|
18
26
|
large: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
spinnerSize: 64,
|
|
28
|
+
strokeWidth: 4,
|
|
29
|
+
fontSize: typographyTokens['font-size-body-regular'],
|
|
30
|
+
lineHeight: typographyTokens['line-height-body-regular'],
|
|
22
31
|
},
|
|
23
32
|
} as const
|
|
24
33
|
|
|
@@ -39,7 +48,7 @@ function RcSesLoader({
|
|
|
39
48
|
...props
|
|
40
49
|
}: RcSesLoaderProps) {
|
|
41
50
|
const { t } = useTranslation('common', { keyPrefix: 'components.Loader' })
|
|
42
|
-
const {
|
|
51
|
+
const { spinnerSize, strokeWidth, fontSize, lineHeight } = LOADER_SIZE_MAP[size]
|
|
43
52
|
const resolvedLabel = label ?? t('loading')
|
|
44
53
|
|
|
45
54
|
return (
|
|
@@ -51,18 +60,40 @@ function RcSesLoader({
|
|
|
51
60
|
sx={[
|
|
52
61
|
{
|
|
53
62
|
alignItems: 'center',
|
|
54
|
-
gap,
|
|
63
|
+
gap: spacingTokens['spacing-aliases-stack-tight'],
|
|
55
64
|
},
|
|
56
|
-
{ color:
|
|
65
|
+
{ color: colorTokens['text-link'] },
|
|
57
66
|
...(Array.isArray(sx) ? sx : [sx]),
|
|
58
67
|
]}
|
|
59
68
|
>
|
|
60
|
-
<
|
|
69
|
+
<Box
|
|
70
|
+
sx={{
|
|
71
|
+
position: 'relative',
|
|
72
|
+
display: 'flex',
|
|
73
|
+
'& .MuiCircularProgress-circle': {
|
|
74
|
+
strokeWidth: (strokeWidth * SPINNER_VIEWBOX) / spinnerSize,
|
|
75
|
+
},
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
{/* Track: a full ring under the arc, the same width as its stroke. */}
|
|
79
|
+
<Box
|
|
80
|
+
aria-hidden
|
|
81
|
+
sx={{
|
|
82
|
+
position: 'absolute',
|
|
83
|
+
inset: 0,
|
|
84
|
+
borderRadius: '50%',
|
|
85
|
+
border: `${strokeWidth}px solid ${colorTokens['border-subtle']}`,
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
88
|
+
<RcSesLoadingSpinner color='inherit' size={`${spinnerSize}px`} />
|
|
89
|
+
</Box>
|
|
61
90
|
{showLabel && (
|
|
62
91
|
<Typography
|
|
63
|
-
variant={textVariant}
|
|
64
92
|
sx={{
|
|
65
|
-
color: 'text
|
|
93
|
+
color: colorTokens['text-secondary'],
|
|
94
|
+
fontSize,
|
|
95
|
+
lineHeight,
|
|
96
|
+
fontWeight: typographyTokens['font-weight-body-regular'],
|
|
66
97
|
}}
|
|
67
98
|
>
|
|
68
99
|
{resolvedLabel}
|
|
@@ -30,7 +30,7 @@ describe('RcSesBottomSheet', () => {
|
|
|
30
30
|
)
|
|
31
31
|
|
|
32
32
|
expect(screen.getByText('Content')).toBeInTheDocument()
|
|
33
|
-
expect(screen.queryAllByRole('button')).toHaveLength(
|
|
33
|
+
expect(screen.queryAllByRole('button')).toHaveLength(1)
|
|
34
34
|
})
|
|
35
35
|
|
|
36
36
|
it('renders the primary and secondary action buttons with their labels', () => {
|
|
@@ -95,7 +95,7 @@ describe('RcSesBottomSheet', () => {
|
|
|
95
95
|
</RcSesBottomSheet>,
|
|
96
96
|
)
|
|
97
97
|
|
|
98
|
-
expect(screen.queryAllByRole('button')).toHaveLength(
|
|
98
|
+
expect(screen.queryAllByRole('button')).toHaveLength(1)
|
|
99
99
|
})
|
|
100
100
|
|
|
101
101
|
it('does not render a back button by default', () => {
|
|
@@ -105,6 +105,16 @@ describe('RcSesBottomSheet', () => {
|
|
|
105
105
|
</RcSesBottomSheet>,
|
|
106
106
|
)
|
|
107
107
|
|
|
108
|
+
expect(screen.queryAllByRole('button')).toHaveLength(1)
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
it('does not render a close button then showClose is false', () => {
|
|
112
|
+
render(
|
|
113
|
+
<RcSesBottomSheet open onClose={vi.fn()} title='Filtrai' showClose={false}>
|
|
114
|
+
Content
|
|
115
|
+
</RcSesBottomSheet>,
|
|
116
|
+
)
|
|
117
|
+
|
|
108
118
|
expect(screen.queryAllByRole('button')).toHaveLength(0)
|
|
109
119
|
})
|
|
110
120
|
|
|
@@ -112,7 +122,14 @@ describe('RcSesBottomSheet', () => {
|
|
|
112
122
|
const onBack = vi.fn()
|
|
113
123
|
const onClose = vi.fn()
|
|
114
124
|
render(
|
|
115
|
-
<RcSesBottomSheet
|
|
125
|
+
<RcSesBottomSheet
|
|
126
|
+
open
|
|
127
|
+
onClose={onClose}
|
|
128
|
+
onBack={onBack}
|
|
129
|
+
showBack
|
|
130
|
+
showClose={false}
|
|
131
|
+
title='2 iš 2'
|
|
132
|
+
>
|
|
116
133
|
Content
|
|
117
134
|
</RcSesBottomSheet>,
|
|
118
135
|
)
|
|
@@ -123,6 +140,22 @@ describe('RcSesBottomSheet', () => {
|
|
|
123
140
|
expect(onClose).not.toHaveBeenCalled()
|
|
124
141
|
})
|
|
125
142
|
|
|
143
|
+
it('calls onClose, when the close button is pressed', () => {
|
|
144
|
+
const onBack = vi.fn()
|
|
145
|
+
const onClose = vi.fn()
|
|
146
|
+
render(
|
|
147
|
+
<RcSesBottomSheet open onClose={onClose} onBack={onBack} title='2 iš 2'>
|
|
148
|
+
Content
|
|
149
|
+
</RcSesBottomSheet>,
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
fireEvent.click(screen.getByRole('button'))
|
|
153
|
+
|
|
154
|
+
expect(onClose).toHaveBeenCalledTimes(1)
|
|
155
|
+
expect(onClose).toHaveBeenCalledWith(expect.anything(), 'closeButtonClick')
|
|
156
|
+
expect(onBack).not.toHaveBeenCalled()
|
|
157
|
+
})
|
|
158
|
+
|
|
126
159
|
it('closes on Escape even when backdrop close is disabled', () => {
|
|
127
160
|
const onClose = vi.fn()
|
|
128
161
|
render(
|
|
@@ -17,24 +17,33 @@ import {
|
|
|
17
17
|
} from 'react'
|
|
18
18
|
import { useTranslation } from 'react-i18next'
|
|
19
19
|
|
|
20
|
-
import { ArrowLeftIcon } from '@/assets/icons/phosphorIcons'
|
|
20
|
+
import { ArrowLeftIcon, CloseIcon } from '@/assets/icons/phosphorIcons'
|
|
21
21
|
import usePrefersReducedMotion from '@/components/common/AdvancedList/components/AdvancedListItem/hooks/usePrefersReducedMotion'
|
|
22
22
|
import RcSesButton from '@/components/common/Button'
|
|
23
|
-
import {
|
|
23
|
+
import { backdropTokens } from '@/theme/backdropTokens'
|
|
24
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
25
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
26
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
27
|
+
import { spacingTokens } from '@/theme/spacingTokens'
|
|
28
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
24
29
|
|
|
25
30
|
import useSwipeToDismiss from './useSwipeToDismiss'
|
|
26
31
|
|
|
27
32
|
const SHEET = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
padding: `${spacingTokens['spacing-aliases-bottom-sheet-padding-top']} ${spacingTokens['spacing-aliases-bottom-sheet-padding-x']} ${spacingTokens['spacing-aliases-bottom-sheet-padding-bottom']}`,
|
|
34
|
+
sectionGap: spacingTokens['spacing-aliases-bottom-sheet-section-gap'],
|
|
35
|
+
handleWidth: spacingRoleBasedTokens['space-40'],
|
|
36
|
+
handleHeight: spacingRoleBasedTokens['space-4'],
|
|
37
|
+
handleHitAreaPadding: `${spacingRoleBasedTokens['space-0']} ${spacingRoleBasedTokens['space-0']} ${spacingTokens['spacing-aliases-bottom-sheet-handle-gap']}`,
|
|
38
|
+
headerPadding: spacingRoleBasedTokens['space-0'],
|
|
39
|
+
contentPadding: `${spacingRoleBasedTokens['space-8']} ${spacingRoleBasedTokens['space-0']}`,
|
|
40
|
+
actionsPadding: `${spacingTokens['spacing-aliases-bottom-sheet-padding-top']} ${spacingRoleBasedTokens['space-0']} ${spacingRoleBasedTokens['space-0']}`,
|
|
41
|
+
cornerRadius: borderTokens['radius-modal'],
|
|
35
42
|
maxHeight: '85vh',
|
|
36
|
-
titleFontSize: '
|
|
37
|
-
titleLineHeight: '
|
|
43
|
+
titleFontSize: typographyTokens['font-size-heading-h3'],
|
|
44
|
+
titleLineHeight: typographyTokens['line-height-heading-h3'],
|
|
45
|
+
// Figma's upward sheet shadow has no effect variable.
|
|
46
|
+
shadow: '0 -4px 24px 0 #0000002e',
|
|
38
47
|
}
|
|
39
48
|
|
|
40
49
|
const SHEET_MAX_WIDTH = {
|
|
@@ -56,6 +65,7 @@ export interface RcSesBottomSheetProps extends Omit<
|
|
|
56
65
|
title?: string
|
|
57
66
|
children?: ReactNode
|
|
58
67
|
showBack?: boolean
|
|
68
|
+
showClose?: boolean
|
|
59
69
|
onBack?: () => void
|
|
60
70
|
primaryActionLabel?: string
|
|
61
71
|
onPrimaryAction?: () => void
|
|
@@ -67,7 +77,7 @@ export interface RcSesBottomSheetProps extends Omit<
|
|
|
67
77
|
size?: 'sm' | 'md'
|
|
68
78
|
onClose?: (
|
|
69
79
|
event: unknown,
|
|
70
|
-
reason: 'backdropClick' | 'escapeKeyDown' | 'swipeDown',
|
|
80
|
+
reason: 'backdropClick' | 'escapeKeyDown' | 'swipeDown' | 'closeButtonClick',
|
|
71
81
|
) => void
|
|
72
82
|
}
|
|
73
83
|
|
|
@@ -75,6 +85,7 @@ function RcSesBottomSheet({
|
|
|
75
85
|
title,
|
|
76
86
|
children,
|
|
77
87
|
showBack = false,
|
|
88
|
+
showClose = true,
|
|
78
89
|
onBack,
|
|
79
90
|
primaryActionLabel,
|
|
80
91
|
onPrimaryAction,
|
|
@@ -133,15 +144,20 @@ function RcSesBottomSheet({
|
|
|
133
144
|
scroll={scroll}
|
|
134
145
|
slots={{ transition: prefersReducedMotion ? Fade : SlideUpTransition }}
|
|
135
146
|
slotProps={{
|
|
147
|
+
backdrop: { sx: { backgroundColor: backdropTokens['backdrop-dark'] } },
|
|
136
148
|
container: { sx: { alignItems: 'flex-end' } },
|
|
137
149
|
paper: {
|
|
138
150
|
ref: paperRef,
|
|
139
151
|
sx: {
|
|
140
|
-
margin: 0,
|
|
152
|
+
margin: spacingRoleBasedTokens['space-0'],
|
|
141
153
|
width: '100%',
|
|
142
154
|
maxWidth: SHEET_MAX_WIDTH[size],
|
|
143
155
|
maxHeight: SHEET.maxHeight,
|
|
144
|
-
|
|
156
|
+
padding: SHEET.padding,
|
|
157
|
+
gap: SHEET.sectionGap,
|
|
158
|
+
backgroundColor: colorTokens['surface-base'],
|
|
159
|
+
boxShadow: SHEET.shadow,
|
|
160
|
+
borderRadius: `${SHEET.cornerRadius} ${SHEET.cornerRadius} ${borderTokens['radius-0']} ${borderTokens['radius-0']}`,
|
|
145
161
|
},
|
|
146
162
|
},
|
|
147
163
|
}}
|
|
@@ -164,18 +180,18 @@ function RcSesBottomSheet({
|
|
|
164
180
|
sx={{
|
|
165
181
|
width: SHEET.handleWidth,
|
|
166
182
|
height: SHEET.handleHeight,
|
|
167
|
-
borderRadius:
|
|
168
|
-
backgroundColor:
|
|
183
|
+
borderRadius: borderTokens['radius-pill'],
|
|
184
|
+
backgroundColor: colorTokens['border-default'],
|
|
169
185
|
}}
|
|
170
186
|
/>
|
|
171
187
|
</Box>
|
|
172
188
|
|
|
173
|
-
{(title || showBack) && (
|
|
189
|
+
{(title || showBack || showClose) && (
|
|
174
190
|
<Box
|
|
175
191
|
sx={{
|
|
176
192
|
display: 'flex',
|
|
177
193
|
alignItems: 'center',
|
|
178
|
-
gap:
|
|
194
|
+
gap: spacingTokens['spacing-aliases-bottom-sheet-content-gap'],
|
|
179
195
|
padding: SHEET.headerPadding,
|
|
180
196
|
flexShrink: 0,
|
|
181
197
|
}}
|
|
@@ -183,8 +199,9 @@ function RcSesBottomSheet({
|
|
|
183
199
|
{showBack && (
|
|
184
200
|
<RcSesButton
|
|
185
201
|
iconOnly
|
|
186
|
-
|
|
187
|
-
color='
|
|
202
|
+
size='medium'
|
|
203
|
+
color='inherit'
|
|
204
|
+
variant='link'
|
|
188
205
|
onClick={onBack}
|
|
189
206
|
aria-label={t('aria.back')}
|
|
190
207
|
>
|
|
@@ -200,11 +217,27 @@ function RcSesBottomSheet({
|
|
|
200
217
|
flex: 1,
|
|
201
218
|
fontSize: SHEET.titleFontSize,
|
|
202
219
|
lineHeight: SHEET.titleLineHeight,
|
|
220
|
+
color: colorTokens['text-default'],
|
|
203
221
|
}}
|
|
204
222
|
>
|
|
205
223
|
{title}
|
|
206
224
|
</Typography>
|
|
207
225
|
)}
|
|
226
|
+
{showClose && (
|
|
227
|
+
<RcSesButton
|
|
228
|
+
iconOnly
|
|
229
|
+
size='medium'
|
|
230
|
+
color='inherit'
|
|
231
|
+
variant='link'
|
|
232
|
+
onClick={(event) => onClose?.(event, 'closeButtonClick')}
|
|
233
|
+
aria-label={t('aria.close')}
|
|
234
|
+
sx={{
|
|
235
|
+
marginLeft: 'auto',
|
|
236
|
+
}}
|
|
237
|
+
>
|
|
238
|
+
<CloseIcon />
|
|
239
|
+
</RcSesButton>
|
|
240
|
+
)}
|
|
208
241
|
</Box>
|
|
209
242
|
)}
|
|
210
243
|
|
|
@@ -221,7 +254,7 @@ function RcSesBottomSheet({
|
|
|
221
254
|
<Box
|
|
222
255
|
sx={{
|
|
223
256
|
display: 'flex',
|
|
224
|
-
gap:
|
|
257
|
+
gap: spacingTokens['spacing-aliases-bottom-sheet-footer-gap'],
|
|
225
258
|
padding: SHEET.actionsPadding,
|
|
226
259
|
flexShrink: 0,
|
|
227
260
|
}}
|
|
@@ -31,6 +31,7 @@ function RcSesDialog({
|
|
|
31
31
|
actions,
|
|
32
32
|
onClose,
|
|
33
33
|
size = 'md',
|
|
34
|
+
className,
|
|
34
35
|
...props
|
|
35
36
|
}: RcSesDialogProps) {
|
|
36
37
|
const dialogWidth = SIZE_MAP[size]
|
|
@@ -41,11 +42,12 @@ function RcSesDialog({
|
|
|
41
42
|
<MuiDialog
|
|
42
43
|
onClose={onClose}
|
|
43
44
|
{...props}
|
|
45
|
+
className={['RcSesDialog-root', className].filter(Boolean).join(' ')}
|
|
44
46
|
maxWidth={false}
|
|
45
47
|
aria-labelledby={titleId}
|
|
46
48
|
aria-describedby={children ? contentId : undefined}
|
|
47
49
|
slotProps={{
|
|
48
|
-
paper: { sx: { width: dialogWidth
|
|
50
|
+
paper: { sx: { width: dialogWidth } },
|
|
49
51
|
}}
|
|
50
52
|
>
|
|
51
53
|
<DialogTitle
|
|
@@ -54,32 +56,12 @@ function RcSesDialog({
|
|
|
54
56
|
display: 'flex',
|
|
55
57
|
justifyContent: 'space-between',
|
|
56
58
|
alignItems: 'flex-start',
|
|
57
|
-
fontSize: '24px',
|
|
58
|
-
lineHeight: '32px',
|
|
59
|
-
padding: '2rem 2rem 1rem !important',
|
|
60
59
|
}}
|
|
61
60
|
>
|
|
62
61
|
{dialogTitle}
|
|
63
62
|
</DialogTitle>
|
|
64
|
-
{children &&
|
|
65
|
-
|
|
66
|
-
id={contentId}
|
|
67
|
-
sx={{
|
|
68
|
-
padding: '0 2rem !important',
|
|
69
|
-
}}
|
|
70
|
-
>
|
|
71
|
-
{children}
|
|
72
|
-
</DialogContent>
|
|
73
|
-
)}
|
|
74
|
-
{actions && (
|
|
75
|
-
<DialogActions
|
|
76
|
-
sx={{
|
|
77
|
-
padding: '1.25rem 2rem 2rem !important',
|
|
78
|
-
}}
|
|
79
|
-
>
|
|
80
|
-
{actions}
|
|
81
|
-
</DialogActions>
|
|
82
|
-
)}
|
|
63
|
+
{children && <DialogContent id={contentId}>{children}</DialogContent>}
|
|
64
|
+
{actions && <DialogActions>{actions}</DialogActions>}
|
|
83
65
|
</MuiDialog>
|
|
84
66
|
)
|
|
85
67
|
}
|