@registrucentras/rc-ses-react-components 1.11.0 → 2.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/ArrowLeftIcon.d.ts +1 -1
- package/dist/assets/icons/ArrowRightIcon.d.ts +1 -1
- package/dist/assets/icons/ArrowsClockwiseIcon.d.ts +1 -1
- package/dist/assets/icons/BarcodeIcon.d.ts +1 -1
- package/dist/assets/icons/CalendarBlankIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDoubleLeftBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDoubleRightBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDownBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDownFill.d.ts +1 -1
- package/dist/assets/icons/CaretDownIcon.d.ts +1 -1
- package/dist/assets/icons/CaretLeftBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretLeftIcon.d.ts +1 -1
- package/dist/assets/icons/CaretRightBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CheckBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CheckCircleFillIcon.d.ts +1 -1
- package/dist/assets/icons/CheckIcon.d.ts +1 -1
- package/dist/assets/icons/CheckUncheckedBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CircleFilledIcon.d.ts +1 -1
- package/dist/assets/icons/CloseIcon.d.ts +1 -1
- package/dist/assets/icons/CollapseChevronsIcon.d.ts +1 -1
- package/dist/assets/icons/CopyIcon.d.ts +1 -1
- package/dist/assets/icons/DotCircleFilledIcon.d.ts +1 -1
- package/dist/assets/icons/ExpandChevronsIcon.d.ts +1 -1
- package/dist/assets/icons/InfoFillIcon.d.ts +1 -1
- package/dist/assets/icons/MagnifyingGlassIcon.d.ts +1 -1
- package/dist/assets/icons/MapPinAreaIcon.d.ts +1 -1
- package/dist/assets/icons/MinusBoldIcon.d.ts +1 -1
- package/dist/assets/icons/PencilSimpleLineIcon.d.ts +1 -1
- package/dist/assets/icons/PlusBoldIcon.d.ts +1 -1
- package/dist/assets/icons/QuestionFillIcon.d.ts +1 -1
- package/dist/assets/icons/QuestionIcon.d.ts +1 -1
- package/dist/assets/icons/ScalesIcon.d.ts +1 -1
- package/dist/assets/icons/ScrollIcon.d.ts +1 -1
- package/dist/assets/icons/SearchHelpIcon.d.ts +1 -1
- package/dist/assets/icons/SearchXIcon.d.ts +1 -1
- package/dist/assets/icons/SpinnerGapBoldIcon.d.ts +1 -1
- package/dist/assets/icons/UploadSimpleIcon.d.ts +1 -1
- package/dist/assets/icons/WarningCircleIcon.d.ts +1 -1
- package/dist/assets/icons/WarningDiamondFillIcon.d.ts +1 -1
- package/dist/assets/icons/WarningFillIcon.d.ts +1 -1
- package/dist/assets/icons/XCircleFillIcon.d.ts +1 -1
- package/dist/components/common/Accordion/index.d.ts +1 -1
- package/dist/components/common/Alert/index.d.ts +1 -1
- package/dist/components/common/Badge/index.d.ts +1 -1
- package/dist/components/common/Breadcrumbs/index.d.ts +1 -1
- package/dist/components/common/Button/ButtonWithPopover.d.ts +1 -1
- package/dist/components/common/Button/index.d.ts +2 -4
- package/dist/components/common/Card/index.d.ts +1 -1
- package/dist/components/common/DataPagination/components/DataPaginationSkeleton.d.ts +1 -1
- package/dist/components/common/DataPagination/components/PaginationButton.d.ts +1 -1
- package/dist/components/common/DataPagination/index.d.ts +1 -1
- package/dist/components/common/IconWithCircularBackground.d.ts +1 -1
- package/dist/components/common/ImageCard/index.d.ts +1 -1
- package/dist/components/common/ListWithIcons/components/ListWithIconsItem.d.ts +1 -1
- package/dist/components/common/ListWithIcons/index.d.ts +1 -1
- package/dist/components/common/Popover/index.d.ts +1 -1
- package/dist/components/common/SelectableCardList/components/SelectableCardListItem.d.ts +1 -1
- package/dist/components/common/SelectableCardList/index.d.ts +1 -1
- package/dist/components/common/Snackbar/SnackbarProvider.d.ts +1 -1
- package/dist/components/common/Snackbar/index.d.ts +1 -1
- package/dist/components/common/Switch/index.d.ts +1 -1
- package/dist/components/common/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/common/Tabs/TabsWrapper.d.ts +1 -1
- package/dist/components/form/components/FormControlWrapper/components/FieldSuffix.d.ts +1 -1
- package/dist/components/form/components/FormControlWrapper/index.d.ts +1 -1
- package/dist/components/form/inputs/Checkbox.d.ts +1 -1
- package/dist/components/form/inputs/CheckboxFormControl.d.ts +1 -1
- package/dist/components/form/inputs/Datepicker/components/RcSesDatepickerActionBar.d.ts +1 -1
- package/dist/components/form/inputs/Datepicker/components/RcSesDatepickerCalendarHeader.d.ts +2 -1
- package/dist/components/form/inputs/Datepicker/index.d.ts +1 -1
- package/dist/components/form/inputs/FileDropzone.d.ts +1 -1
- package/dist/components/form/inputs/FileUpload.d.ts +1 -1
- package/dist/components/form/inputs/FormControlLabel.d.ts +2 -2
- package/dist/components/form/inputs/NumberStepper.d.ts +2 -1
- package/dist/components/form/inputs/PhoneInput.d.ts +2 -1
- package/dist/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.d.ts +1 -1
- package/dist/components/form/inputs/PhoneInputFormControl/components/ListboxComponent.d.ts +13 -0
- package/dist/components/form/inputs/PhoneInputFormControl/components/PopperComponent.d.ts +1 -1
- package/dist/components/form/inputs/PhoneInputFormControl/components/RowComponent.d.ts +5 -2
- package/dist/components/form/inputs/PhoneInputFormControl/index.d.ts +2 -1
- package/dist/components/form/inputs/Select/index.d.ts +2 -1
- package/dist/components/form/inputs/SimpleCheckbox.d.ts +2 -1
- package/dist/components/layout/Footer/index.d.ts +1 -1
- package/dist/components/layout/ServiceFormActions.d.ts +1 -1
- package/dist/components/layout/ServiceFormContainer/AccordionFormContainer/components/AccordionCollapseControls.d.ts +1 -1
- package/dist/components/layout/ServiceFormContainer/AccordionFormContainer/index.d.ts +1 -1
- package/dist/components/layout/ServiceFormContainer/CardFormContainer/index.d.ts +1 -1
- package/dist/components/layout/ServiceHeader.d.ts +1 -1
- package/dist/components/layout/ServicePage.d.ts +1 -1
- package/dist/components/layout/ServiceWizardStepper/components/CustomStepIcon.d.ts +1 -1
- package/dist/components/layout/ServiceWizardStepper/components/DesktopStepper.d.ts +1 -1
- package/dist/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.d.ts +1 -1
- package/dist/components/layout/ServiceWizardStepper/components/MobileStepper.d.ts +1 -1
- package/dist/components/layout/ServiceWizardStepper/index.d.ts +1 -1
- package/dist/components/loaders/FullPageLoader/index.d.ts +1 -1
- package/dist/components/loaders/Loader/index.d.ts +1 -1
- package/dist/components/loaders/LoadingSpinner/index.d.ts +1 -1
- package/dist/components/overlays/Dialog/index.d.ts +1 -1
- package/dist/components/overlays/Modal/index.d.ts +1 -1
- package/dist/components/utils/loading.d.ts +1 -1
- package/dist/i18n/@mui/x-date-pickers/ltLT.d.ts +1 -71
- package/dist/registrucentras-rc-ses-react-components.cjs +1 -30
- package/dist/registrucentras-rc-ses-react-components.js +6194 -7998
- package/dist/stories/assets/Logo.stories.d.ts +1 -1
- package/dist/stories/components/actions/Button.stories.d.ts +2 -2
- package/dist/stories/components/actions/ButtonWithPopover.stories.d.ts +1 -1
- package/dist/stories/components/display/Badge.stories.d.ts +1 -1
- package/dist/stories/components/display/Card.stories.d.ts +1 -1
- package/dist/stories/components/display/ImageCard.stories.d.ts +1 -1
- package/dist/stories/components/display/ListWithIcons.stories.d.ts +2 -2
- package/dist/stories/components/display/SegmentedControl.stories.d.ts +9 -9
- package/dist/stories/components/display/SelectableCardList.stories.d.ts +2 -2
- package/dist/stories/components/feedback/Alert.stories.d.ts +1 -1
- package/dist/stories/components/feedback/Snackbar.stories.d.ts +7 -7
- package/dist/stories/components/form/CardFormContainer.stories.d.ts +1 -1
- package/dist/stories/components/form/CheckboxFormControl.stories.d.ts +1 -1
- package/dist/stories/components/form/FormControlWrapper.stories.d.ts +1 -1
- package/dist/stories/components/form/ServiceFormActions.stories.d.ts +1 -1
- package/dist/stories/components/form/ServiceFormContainer.stories.d.ts +2 -2
- package/dist/stories/components/form/SimpleCheckbox.stories.d.ts +1 -1
- package/dist/stories/components/icons/IconWithCircularBackground.stories.d.ts +1 -1
- package/dist/stories/components/icons/Icons.stories.d.ts +1 -1
- package/dist/stories/components/inputs/Checkbox.stories.d.ts +2 -2
- package/dist/stories/components/inputs/DatePicker.stories.d.ts +2 -2
- package/dist/stories/components/inputs/FileDropzone.stories.d.ts +1 -1
- package/dist/stories/components/inputs/FileUpload.stories.d.ts +2 -2
- package/dist/stories/components/inputs/NumberStepper.stories.d.ts +1 -1
- package/dist/stories/components/inputs/PhoneInput.stories.d.ts +2 -2
- package/dist/stories/components/inputs/PhoneInputFormControl.stories.d.ts +1 -1
- package/dist/stories/components/inputs/RadioButtonGroup.stories.d.ts +1 -1
- package/dist/stories/components/inputs/SearchInput.stories.d.ts +1 -1
- package/dist/stories/components/inputs/SearchableField.stories.d.ts +1 -1
- package/dist/stories/components/inputs/Select.stories.d.ts +1 -1
- package/dist/stories/components/inputs/Switch.stories.d.ts +1 -1
- package/dist/stories/components/inputs/TextField.stories.d.ts +1 -1
- package/dist/stories/components/layout/Footer.stories.d.ts +1 -1
- package/dist/stories/components/layout/ServiceHeader.stories.d.ts +1 -1
- package/dist/stories/components/layout/ServicePage.stories.d.ts +1 -1
- package/dist/stories/components/loaders/FullPageLoader.stories.d.ts +1 -1
- package/dist/stories/components/loaders/Loader.stories.d.ts +1 -1
- package/dist/stories/components/loaders/LoadingSpinner.stories.d.ts +1 -1
- package/dist/stories/components/navigation/Accordion.stories.d.ts +2 -2
- package/dist/stories/components/navigation/Breadcrumbs.stories.d.ts +1 -1
- package/dist/stories/components/navigation/DataPagination.stories.d.ts +2 -2
- package/dist/stories/components/navigation/ServiceWizardStepper.stories.d.ts +1 -1
- package/dist/stories/components/overlays/Dialog.stories.d.ts +1 -1
- package/dist/stories/components/overlays/Modal.stories.d.ts +1 -1
- package/dist/stories/components/tabs/Tab.stories.d.ts +1 -1
- package/dist/stories/components/tabs/TabPanel.stories.d.ts +1 -1
- package/dist/stories/components/tabs/Tabs.stories.d.ts +1 -1
- package/dist/stories/components/tabs/TabsWrapper.stories.d.ts +1 -1
- package/package.json +63 -62
- package/src/components/common/Accordion/index.tsx +0 -1
- package/src/components/common/Alert/index.test.tsx +1 -1
- package/src/components/common/Badge/index.test.tsx +1 -1
- package/src/components/common/Button/index.test.tsx +5 -2
- package/src/components/common/Button/index.tsx +10 -4
- package/src/components/common/Card/index.test.tsx +1 -1
- package/src/components/common/DataPagination/index.test.tsx +1 -1
- package/src/components/common/DataPagination/index.tsx +14 -2
- package/src/components/common/ImageCard/index.test.tsx +1 -1
- package/src/components/common/ListWithIcons/index.test.tsx +1 -1
- package/src/components/common/SegmentedControl/components/SegmentButton/index.test.tsx +1 -1
- package/src/components/common/SegmentedControl/components/SegmentButton/index.tsx +2 -0
- package/src/components/common/SegmentedControl/index.test.tsx +1 -1
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +14 -2
- package/src/components/common/SelectableCardList/index.test.tsx +1 -1
- package/src/components/common/Snackbar/SnackbarProvider.tsx +1 -1
- package/src/components/common/Snackbar/index.test.tsx +1 -1
- package/src/components/common/Snackbar/index.tsx +3 -1
- package/src/components/common/Switch/index.test.tsx +1 -1
- package/src/components/common/Switch/index.tsx +21 -6
- package/src/components/form/components/FormControlWrapper/const/FormControlLayoutVariables.ts +1 -1
- package/src/components/form/inputs/CheckboxFormControl.tsx +7 -3
- package/src/components/form/inputs/Datepicker/components/RcSesDatepickerActionBar.tsx +8 -5
- package/src/components/form/inputs/Datepicker/components/RcSesDatepickerCalendarHeader.tsx +12 -12
- package/src/components/form/inputs/Datepicker/index.tsx +37 -32
- package/src/components/form/inputs/FileDropzone.tsx +6 -1
- package/src/components/form/inputs/NumberStepper.tsx +10 -5
- package/src/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.tsx +15 -11
- package/src/components/form/inputs/PhoneInputFormControl/components/ListboxComponent.tsx +31 -27
- package/src/components/form/inputs/PhoneInputFormControl/components/RowComponent.tsx +8 -4
- package/src/components/form/inputs/PhoneInputFormControl/index.test.tsx +57 -2
- package/src/components/form/inputs/PhoneInputFormControl/index.tsx +66 -53
- package/src/components/form/inputs/RadioButtonGroup.tsx +0 -1
- package/src/components/form/inputs/SearchInput/index.test.tsx +1 -1
- package/src/components/form/inputs/SearchInput/index.tsx +23 -13
- package/src/components/form/inputs/SearchableField.test.tsx +126 -0
- package/src/components/form/inputs/SearchableField.tsx +29 -24
- package/src/components/form/inputs/Select/index.tsx +67 -36
- package/src/components/form/inputs/TextField.tsx +1 -7
- package/src/components/layout/Footer/index.test.tsx +1 -1
- package/src/components/layout/ServiceFormActions.tsx +3 -3
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/components/AccordionCollapseControls.tsx +2 -2
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/index.tsx +2 -2
- package/src/components/layout/ServiceFormContainer/CardFormContainer/index.test.tsx +1 -1
- package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.tsx +2 -1
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.test.tsx +8 -6
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.tsx +2 -1
- package/src/components/loaders/FullPageLoader/index.test.tsx +1 -1
- package/src/components/loaders/FullPageLoader/index.tsx +4 -3
- package/src/components/loaders/Loader/index.test.tsx +1 -1
- package/src/components/loaders/Loader/index.tsx +14 -4
- package/src/components/loaders/LoadingSpinner/index.test.tsx +1 -1
- package/src/components/overlays/Dialog/index.test.tsx +1 -1
- package/src/components/overlays/Dialog/index.tsx +7 -5
- package/src/components/overlays/Modal/index.test.tsx +1 -1
- package/src/components/overlays/Modal/index.tsx +4 -2
- package/src/env.tsx +1 -1
- package/src/examples/MultipleStepForm/components/ServiceDetailsForm.tsx +0 -5
- package/src/examples/MultipleStepForm/components/ServiceIssuanceForm.tsx +0 -2
- package/src/examples/MultipleStepForm/components/TermsAndConditionsForm.tsx +2 -2
- package/src/examples/SingleStepForm/components/ObjectIdentifierSearchModal.tsx +12 -8
- package/src/examples/SingleStepForm/index.tsx +0 -2
- package/src/i18n/@mui/x-date-pickers/ltLT.ts +15 -1
- package/src/main.tsx +1 -1
- package/src/stories/Colors.mdx +1 -1
- package/src/stories/Welcome.mdx +1 -1
- package/src/stories/assets/Logo.stories.tsx +1 -1
- package/src/stories/components/actions/Button.stories.tsx +2 -2
- package/src/stories/components/actions/ButtonWithPopover.stories.tsx +1 -1
- package/src/stories/components/display/Badge.stories.tsx +24 -5
- package/src/stories/components/display/Card.stories.tsx +1 -1
- package/src/stories/components/display/ImageCard.stories.tsx +1 -1
- package/src/stories/components/display/ListWithIcons.stories.tsx +1 -1
- package/src/stories/components/display/SegmentedControl.stories.tsx +1 -1
- package/src/stories/components/display/SelectableCardList.stories.tsx +1 -1
- package/src/stories/components/feedback/Alert.stories.tsx +1 -1
- package/src/stories/components/feedback/Snackbar.stories.tsx +1 -1
- package/src/stories/components/form/CardFormContainer.stories.tsx +1 -1
- package/src/stories/components/form/CheckboxFormControl.stories.tsx +1 -1
- package/src/stories/components/form/FormControlWrapper.stories.tsx +1 -1
- package/src/stories/components/form/ServiceFormActions.stories.tsx +1 -1
- package/src/stories/components/form/ServiceFormContainer.stories.tsx +1 -3
- package/src/stories/components/form/SimpleCheckbox.stories.tsx +1 -1
- package/src/stories/components/icons/IconWithCircularBackground.stories.tsx +1 -1
- package/src/stories/components/icons/Icons.stories.tsx +1 -2
- package/src/stories/components/inputs/Checkbox.stories.tsx +1 -2
- package/src/stories/components/inputs/DatePicker.stories.tsx +2 -3
- package/src/stories/components/inputs/FileDropzone.stories.tsx +1 -1
- package/src/stories/components/inputs/FileUpload.stories.tsx +1 -2
- package/src/stories/components/inputs/NumberStepper.stories.tsx +1 -1
- package/src/stories/components/inputs/PhoneInput.stories.tsx +1 -2
- package/src/stories/components/inputs/PhoneInputFormControl.stories.tsx +3 -2
- package/src/stories/components/inputs/RadioButtonGroup.stories.tsx +1 -1
- package/src/stories/components/inputs/SearchInput.stories.tsx +2 -2
- package/src/stories/components/inputs/SearchableField.stories.tsx +1 -1
- package/src/stories/components/inputs/Select.stories.tsx +1 -2
- package/src/stories/components/inputs/Switch.stories.tsx +1 -1
- package/src/stories/components/inputs/TextField.stories.tsx +1 -1
- package/src/stories/components/layout/Footer.stories.tsx +1 -1
- package/src/stories/components/layout/ServiceHeader.stories.tsx +1 -1
- package/src/stories/components/layout/ServicePage.stories.tsx +1 -1
- package/src/stories/components/loaders/FullPageLoader.stories.tsx +1 -1
- package/src/stories/components/loaders/Loader.stories.tsx +1 -1
- package/src/stories/components/loaders/LoadingSpinner.stories.tsx +1 -1
- package/src/stories/components/navigation/Accordion.stories.tsx +1 -2
- package/src/stories/components/navigation/Breadcrumbs.stories.tsx +1 -1
- package/src/stories/components/navigation/DataPagination.stories.tsx +8 -2
- package/src/stories/components/navigation/ServiceWizardStepper.stories.tsx +1 -1
- package/src/stories/components/overlays/Dialog.stories.tsx +1 -1
- package/src/stories/components/overlays/Modal.stories.tsx +1 -1
- package/src/stories/components/tabs/Tab.stories.tsx +12 -1
- package/src/stories/components/tabs/TabPanel.stories.tsx +1 -1
- package/src/stories/components/tabs/Tabs.stories.tsx +1 -1
- package/src/stories/components/tabs/TabsWrapper.stories.tsx +1 -1
- package/src/theme/light/MuiAlert.tsx +82 -75
- package/src/theme/light/MuiLinearProgress.ts +6 -2
- package/src/theme/light/MuiPickersLayout.ts +4 -4
- package/src/theme/light/MuiTabs.tsx +2 -1
- package/src/types/common/ColorType.tsx +1 -7
- package/dist/components/form/inputs/PhoneInputFormControl/components/OuterElementType.d.ts +0 -5
- package/dist/components/form/inputs/PhoneInputFormControl/hooks/useResetCache.d.ts +0 -4
- package/src/components/form/inputs/PhoneInputFormControl/components/OuterElementType.tsx +0 -13
- package/src/components/form/inputs/PhoneInputFormControl/hooks/useResetCache.ts +0 -14
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@registrucentras/rc-ses-react-components",
|
|
3
3
|
"author": "VĮ REGISTRŲ CENTRAS",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0-rc.0",
|
|
5
5
|
"description": "RC SES React komponentų biblioteka",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"private": false,
|
|
@@ -35,91 +35,92 @@
|
|
|
35
35
|
"storybook-build": "storybook build",
|
|
36
36
|
"test": "vitest",
|
|
37
37
|
"test:run": "vitest run",
|
|
38
|
-
"test:coverage": "vitest run --coverage"
|
|
38
|
+
"test:coverage": "vitest run --coverage",
|
|
39
|
+
"test:visual": "playwright test",
|
|
40
|
+
"test:visual:ci": "npm run storybook-build && playwright test",
|
|
41
|
+
"test:visual:update": "docker run --rm -v .:/work -v rcses-visual-node-modules:/work/node_modules -w /work mcr.microsoft.com/playwright:v1.62.0-noble bash -c \"npm ci --no-audit --no-fund && npm run storybook-build && npx playwright test --update-snapshots\"",
|
|
42
|
+
"test:visual:report": "playwright show-report"
|
|
39
43
|
},
|
|
40
44
|
"repository": {
|
|
41
45
|
"type": "git",
|
|
42
46
|
"url": "https://github.com/registrucentras/rc-ses-react-components.git"
|
|
43
47
|
},
|
|
44
48
|
"peerDependencies": {
|
|
45
|
-
"@emotion/react": "11.13.3",
|
|
46
|
-
"@emotion/styled": "11.13.0",
|
|
47
|
-
"@mui/material": "
|
|
48
|
-
"@mui/system": "
|
|
49
|
-
"@mui/x-date-pickers": "
|
|
50
|
-
"date-fns": "3.6.0",
|
|
51
|
-
"date-fns-tz": "3.
|
|
52
|
-
"
|
|
53
|
-
"react": "18.3.1",
|
|
54
|
-
"react-
|
|
55
|
-
"react-i18next": "14.1.3"
|
|
49
|
+
"@emotion/react": "^11.13.3",
|
|
50
|
+
"@emotion/styled": "^11.13.0",
|
|
51
|
+
"@mui/material": "^9.2.0",
|
|
52
|
+
"@mui/system": "^9.2.0",
|
|
53
|
+
"@mui/x-date-pickers": "^9.10.1",
|
|
54
|
+
"date-fns": "^3.6.0 || ^4.0.0",
|
|
55
|
+
"date-fns-tz": "^3.2.0",
|
|
56
|
+
"react": "^18.3.1 || ^19.0.0",
|
|
57
|
+
"react-dom": "^18.3.1 || ^19.0.0",
|
|
58
|
+
"react-hook-form": "^7.53.2"
|
|
56
59
|
},
|
|
57
60
|
"dependencies": {
|
|
58
|
-
"@fontsource/public-sans": "^5.0.18",
|
|
59
61
|
"@phosphor-icons/react": "^2.1.10",
|
|
60
|
-
"axios": "^1.7.2",
|
|
61
62
|
"countries-phone-masks": "^1.1.1",
|
|
63
|
+
"i18next": "^26.3.6",
|
|
62
64
|
"js-cookie": "^3.0.5",
|
|
63
65
|
"maska": "^3.2.0",
|
|
64
|
-
"
|
|
65
|
-
"react-
|
|
66
|
-
"react-
|
|
67
|
-
"
|
|
68
|
-
"react-window": "^1.8.11",
|
|
69
|
-
"uuid": "^11.0.3"
|
|
66
|
+
"react-dropzone": "19.1.1",
|
|
67
|
+
"react-i18next": "^17.0.11",
|
|
68
|
+
"react-window": "^2.3.0",
|
|
69
|
+
"uuid": "^14.0.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@chromatic-com/storybook": "^
|
|
73
|
-
"@
|
|
74
|
-
"@
|
|
75
|
-
"@
|
|
76
|
-
"@
|
|
77
|
-
"@
|
|
78
|
-
"@
|
|
79
|
-
"@
|
|
80
|
-
"@
|
|
81
|
-
"@
|
|
82
|
-
"@
|
|
83
|
-
"@storybook/
|
|
84
|
-
"@storybook/
|
|
85
|
-
"@storybook/
|
|
86
|
-
"@
|
|
72
|
+
"@chromatic-com/storybook": "^5.2.1",
|
|
73
|
+
"@emotion/react": "11.13.3",
|
|
74
|
+
"@emotion/styled": "11.13.0",
|
|
75
|
+
"@eslint/js": "^9.39.5",
|
|
76
|
+
"@fontsource/public-sans": "^5.3.0",
|
|
77
|
+
"@microsoft/api-extractor": "^7.58.12",
|
|
78
|
+
"@mui/material": "9.2.0",
|
|
79
|
+
"@mui/system": "9.2.0",
|
|
80
|
+
"@mui/x-date-pickers": "9.10.1",
|
|
81
|
+
"@playwright/test": "^1.62.0",
|
|
82
|
+
"@rollup/plugin-commonjs": "^26.0.3",
|
|
83
|
+
"@storybook/addon-a11y": "^10.5.5",
|
|
84
|
+
"@storybook/addon-coverage": "^3.0.2",
|
|
85
|
+
"@storybook/addon-docs": "^10.5.5",
|
|
86
|
+
"@storybook/addon-links": "^10.5.5",
|
|
87
|
+
"@storybook/addon-onboarding": "^10.5.5",
|
|
88
|
+
"@storybook/addon-themes": "^10.5.5",
|
|
89
|
+
"@storybook/react": "^10.5.5",
|
|
90
|
+
"@storybook/react-vite": "^10.5.5",
|
|
91
|
+
"@storybook/test-runner": "^0.24.4",
|
|
92
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
87
93
|
"@testing-library/react": "^16.3.0",
|
|
88
|
-
"@trivago/prettier-plugin-sort-imports": "^
|
|
94
|
+
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
89
95
|
"@types/js-cookie": "^3.0.6",
|
|
90
96
|
"@types/react": "^18.3.3",
|
|
91
97
|
"@types/react-dom": "^18.3.0",
|
|
92
|
-
"@types/react-helmet": "^6.1.11",
|
|
93
|
-
"@types/react-window": "^1.8.8",
|
|
94
|
-
"@types/uuid": "^10.0.0",
|
|
95
|
-
"@typescript-eslint/eslint-plugin": "^7.13.0",
|
|
96
|
-
"@typescript-eslint/parser": "^7.13.0",
|
|
97
98
|
"@vitejs/plugin-react": "^4.3.4",
|
|
98
99
|
"@vitest/coverage-v8": "^4.0.15",
|
|
99
100
|
"axe-playwright": "^2.0.1",
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"eslint
|
|
103
|
-
"eslint-config-
|
|
104
|
-
"eslint-
|
|
105
|
-
"eslint-import-resolver-typescript": "^
|
|
106
|
-
"eslint-plugin-import": "^2.29.1",
|
|
107
|
-
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
108
|
-
"eslint-plugin-n": "^17.9.0",
|
|
101
|
+
"date-fns": "4.4.0",
|
|
102
|
+
"date-fns-tz": "3.2.0",
|
|
103
|
+
"eslint": "^9.39.5",
|
|
104
|
+
"eslint-config-airbnb-extended": "^3.1.1",
|
|
105
|
+
"eslint-config-prettier": "^10.1.8",
|
|
106
|
+
"eslint-import-resolver-typescript": "^4.4.5",
|
|
109
107
|
"eslint-plugin-prettier": "^5.1.3",
|
|
110
|
-
"eslint-plugin-
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"eslint-plugin-storybook": "^0.8.0",
|
|
114
|
-
"jsdom": "^27.3.0",
|
|
108
|
+
"eslint-plugin-storybook": "^10.5.5",
|
|
109
|
+
"globals": "^17.8.0",
|
|
110
|
+
"jsdom": "^29.1.1",
|
|
115
111
|
"prettier": "^3.3.2",
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
112
|
+
"react": "18.3.1",
|
|
113
|
+
"react-dom": "18.3.1",
|
|
114
|
+
"react-hook-form": "7.53.2",
|
|
115
|
+
"react-router-dom": "6.26.2",
|
|
116
|
+
"rollup-plugin-typescript2": "^0.37.0",
|
|
117
|
+
"storybook": "^10.5.5",
|
|
118
|
+
"typescript": "^5.9.3",
|
|
119
|
+
"typescript-eslint": "^8.65.0",
|
|
120
|
+
"vite": "^7.3.6",
|
|
120
121
|
"vite-plugin-css-injected-by-js": "^3.5.1",
|
|
121
|
-
"vite-plugin-dts": "^
|
|
122
|
-
"vite-plugin-static-copy": "^
|
|
122
|
+
"vite-plugin-dts": "^5.0.3",
|
|
123
|
+
"vite-plugin-static-copy": "^4.1.1",
|
|
123
124
|
"vitest": "^4.0.15"
|
|
124
125
|
},
|
|
125
126
|
"optionalDependencies": {
|
|
@@ -6,7 +6,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
|
6
6
|
import i18n from '@/i18n/i18n'
|
|
7
7
|
import theme from '@/theme/light'
|
|
8
8
|
|
|
9
|
-
import RcSesBadge from '
|
|
9
|
+
import RcSesBadge from '.'
|
|
10
10
|
|
|
11
11
|
const getCloseAriaLabel = (label: string) =>
|
|
12
12
|
i18n.t('components.RcSesBadge.aria.close', { label, ns: 'input' })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fireEvent, render, screen } from '@testing-library/react'
|
|
2
2
|
import { describe, expect, it, vi } from 'vitest'
|
|
3
3
|
|
|
4
|
-
import Button from '
|
|
4
|
+
import Button from '.'
|
|
5
5
|
|
|
6
6
|
describe('Button Component', () => {
|
|
7
7
|
describe('Loading State', () => {
|
|
@@ -128,7 +128,10 @@ describe('Button Component', () => {
|
|
|
128
128
|
render(<Button variant='text'>Save</Button>)
|
|
129
129
|
|
|
130
130
|
const button = screen.getByRole('button')
|
|
131
|
-
|
|
131
|
+
// MUI 9 removed the combined variant+colour classes: MuiButton-textPrimary
|
|
132
|
+
// is now expressed as MuiButton-text plus MuiButton-colorPrimary.
|
|
133
|
+
expect(button).toHaveClass('MuiButton-text')
|
|
134
|
+
expect(button).toHaveClass('MuiButton-colorPrimary')
|
|
132
135
|
})
|
|
133
136
|
})
|
|
134
137
|
|
|
@@ -16,10 +16,16 @@ const ICON_ONLY_SIZE_MAP = {
|
|
|
16
16
|
large: '3rem',
|
|
17
17
|
} as const
|
|
18
18
|
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
// MUI 6 added a native `loading` prop (`boolean | null`, alongside
|
|
20
|
+
// `loadingIndicator` and `loadingPosition`), so it no longer needs declaring
|
|
21
|
+
// here - re-declaring it as `boolean` conflicted with MUI's nullable type at
|
|
22
|
+
// every call site that spreads ButtonProps.
|
|
23
|
+
//
|
|
24
|
+
// Behaviour is unchanged: `loading` is still destructured out below and drives
|
|
25
|
+
// the custom RcSesLoadingSpinner, so it never reaches MuiButton and the native
|
|
26
|
+
// indicator stays inactive. Switching over to MUI's implementation is a
|
|
27
|
+
// breaking change, tracked as SAV-5916.
|
|
28
|
+
type Props = ButtonProps
|
|
23
29
|
|
|
24
30
|
function RcSesButton(props: Props) {
|
|
25
31
|
const { t } = useTranslation('common')
|
|
@@ -4,8 +4,8 @@ import { render, screen } from '@testing-library/react'
|
|
|
4
4
|
import { type ReactElement } from 'react'
|
|
5
5
|
import { describe, expect, test } from 'vitest'
|
|
6
6
|
|
|
7
|
+
import RcSesCard from '.'
|
|
7
8
|
import theme from '../../../theme/light'
|
|
8
|
-
import RcSesCard from './index'
|
|
9
9
|
|
|
10
10
|
const renderCard = (ui: ReactElement) =>
|
|
11
11
|
render(<ThemeProvider theme={theme}>{ui}</ThemeProvider>)
|
|
@@ -6,7 +6,7 @@ import { beforeEach, describe, expect, test, vi } from 'vitest'
|
|
|
6
6
|
|
|
7
7
|
import theme from '@/theme/light'
|
|
8
8
|
|
|
9
|
-
import DataPagination from '
|
|
9
|
+
import DataPagination from '.'
|
|
10
10
|
|
|
11
11
|
vi.mock('@mui/material', async () => {
|
|
12
12
|
const actual = await vi.importActual<typeof import('@mui/material')>('@mui/material')
|
|
@@ -45,7 +45,13 @@ const DataPagination = ({
|
|
|
45
45
|
|
|
46
46
|
if (isLoading) {
|
|
47
47
|
return (
|
|
48
|
-
<Box
|
|
48
|
+
<Box
|
|
49
|
+
sx={{
|
|
50
|
+
display: 'flex',
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
gap: 1,
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
49
55
|
<DataPaginationSkeleton isMobile={isMobile} />
|
|
50
56
|
</Box>
|
|
51
57
|
)
|
|
@@ -58,7 +64,13 @@ const DataPagination = ({
|
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
return (
|
|
61
|
-
<Box
|
|
67
|
+
<Box
|
|
68
|
+
sx={{
|
|
69
|
+
display: 'flex',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
gap: 1,
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
62
74
|
<>
|
|
63
75
|
<PaginationButton
|
|
64
76
|
onClick={() => handlePageChange(currentPage - 1)}
|
|
@@ -4,8 +4,8 @@ import { render, screen } from '@testing-library/react'
|
|
|
4
4
|
import { type ReactElement } from 'react'
|
|
5
5
|
import { describe, expect, test } from 'vitest'
|
|
6
6
|
|
|
7
|
+
import RcSesImageCard from '.'
|
|
7
8
|
import theme from '../../../theme/light'
|
|
8
|
-
import RcSesImageCard from './index'
|
|
9
9
|
|
|
10
10
|
const renderCard = (ui: ReactElement) =>
|
|
11
11
|
render(<ThemeProvider theme={theme}>{ui}</ThemeProvider>)
|
|
@@ -5,7 +5,7 @@ import { describe, expect, test } from 'vitest'
|
|
|
5
5
|
|
|
6
6
|
import theme from '@/theme/light'
|
|
7
7
|
|
|
8
|
-
import ListWithIcons from '
|
|
8
|
+
import ListWithIcons from '.'
|
|
9
9
|
|
|
10
10
|
const renderListWithIcons = (ui: ReactElement) =>
|
|
11
11
|
render(<ThemeProvider theme={theme}>{ui}</ThemeProvider>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fireEvent, render, screen } from '@testing-library/react'
|
|
2
2
|
import { describe, expect, test, vi } from 'vitest'
|
|
3
3
|
|
|
4
|
-
import RcSesSegmentButton, { type RcSesSegmentOption } from '
|
|
4
|
+
import RcSesSegmentButton, { type RcSesSegmentOption } from '.'
|
|
5
5
|
|
|
6
6
|
describe('RcSesSegmentButton', () => {
|
|
7
7
|
const defaultOption: RcSesSegmentOption = {
|
|
@@ -63,9 +63,11 @@ const RcSesSegmentButton = React.forwardRef<HTMLButtonElement, RcSesSegmentButto
|
|
|
63
63
|
wordBreak: 'break-word',
|
|
64
64
|
fontFamily: '"Public Sans", sans-serif !important',
|
|
65
65
|
border: `2px solid ${isFocused && !isDisabled ? primary['500'] : 'transparent'}`,
|
|
66
|
+
|
|
66
67
|
backgroundColor: isSelected
|
|
67
68
|
? `${primary['50']} !important`
|
|
68
69
|
: 'transparent !important',
|
|
70
|
+
|
|
69
71
|
color: textColor,
|
|
70
72
|
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
71
73
|
fontWeight: 500,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fireEvent, render, screen } from '@testing-library/react'
|
|
2
2
|
import { describe, expect, test, vi } from 'vitest'
|
|
3
3
|
|
|
4
|
-
import RcSesSegmentedControl, { type RcSesSegmentOption } from '
|
|
4
|
+
import RcSesSegmentedControl, { type RcSesSegmentOption } from '.'
|
|
5
5
|
|
|
6
6
|
describe('RcSesSegmentedControl', () => {
|
|
7
7
|
const options: RcSesSegmentOption[] = [
|
|
@@ -24,12 +24,24 @@ const SelectableCardListItem = ({
|
|
|
24
24
|
isLoading = false,
|
|
25
25
|
}: Props) => {
|
|
26
26
|
const titleTemplate = isLoading ? (
|
|
27
|
-
<Stack
|
|
27
|
+
<Stack
|
|
28
|
+
direction='row'
|
|
29
|
+
sx={{
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
gap: '0.75rem',
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
28
34
|
<Skeleton variant='circular' width={20} height={20} />
|
|
29
35
|
<Skeleton variant='text' width={100} />
|
|
30
36
|
</Stack>
|
|
31
37
|
) : (
|
|
32
|
-
<Stack
|
|
38
|
+
<Stack
|
|
39
|
+
direction='row'
|
|
40
|
+
sx={{
|
|
41
|
+
alignItems: 'flex-start',
|
|
42
|
+
gap: '0.75rem',
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
33
45
|
<Radio
|
|
34
46
|
aria-label={`Select ${title}`}
|
|
35
47
|
checked={selected}
|
|
@@ -6,7 +6,7 @@ import { beforeEach, describe, expect, test, vi } from 'vitest'
|
|
|
6
6
|
|
|
7
7
|
import theme from '@/theme/light'
|
|
8
8
|
|
|
9
|
-
import SelectableCardList, { type SelectableCardListItemData } from '
|
|
9
|
+
import SelectableCardList, { type SelectableCardListItemData } from '.'
|
|
10
10
|
|
|
11
11
|
vi.mock('@mui/material', async () => {
|
|
12
12
|
const actual = await vi.importActual<typeof import('@mui/material')>('@mui/material')
|
|
@@ -5,7 +5,7 @@ import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
|
|
|
5
5
|
|
|
6
6
|
import theme from '@/theme/light'
|
|
7
7
|
|
|
8
|
-
import RcSesSnackbar from '
|
|
8
|
+
import RcSesSnackbar from '.'
|
|
9
9
|
|
|
10
10
|
const DEFAULT_PROPS = { state: 'success' as const, message: 'Test', open: true }
|
|
11
11
|
|
|
@@ -98,11 +98,13 @@ function RcSesSnackbar({
|
|
|
98
98
|
onMouseEnter={() => setIsPaused(true)}
|
|
99
99
|
onMouseLeave={() => setIsPaused(false)}
|
|
100
100
|
onKeyDown={(e) => e.key === 'Escape' && handleClose()}
|
|
101
|
-
TransitionComponent={Slide}
|
|
102
101
|
transitionDuration={prefersReducedMotion ? { enter: 0, exit: 0 } : undefined}
|
|
103
102
|
sx={{
|
|
104
103
|
transition: prefersReducedMotion ? 'none' : `bottom 150ms ease-in-out !important`,
|
|
105
104
|
}}
|
|
105
|
+
slots={{
|
|
106
|
+
transition: Slide,
|
|
107
|
+
}}
|
|
106
108
|
>
|
|
107
109
|
<Box
|
|
108
110
|
role={config.ariaLive === 'assertive' ? 'alert' : 'status'}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fireEvent, render, screen } from '@testing-library/react'
|
|
2
2
|
import { describe, expect, it, vi } from 'vitest'
|
|
3
3
|
|
|
4
|
-
import RcSesSwitch from '
|
|
4
|
+
import RcSesSwitch from '.'
|
|
5
5
|
|
|
6
6
|
describe('RcSesSwitch Component', () => {
|
|
7
7
|
describe('Switch semantics', () => {
|
|
@@ -19,20 +19,35 @@ const formControlLabelStyles = {
|
|
|
19
19
|
function RcSesSwitch(props: RcSesSwitchProps) {
|
|
20
20
|
const { label, ariaLabel, disabled, ...switchProps } = props
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
// The handler has to sit on the Switch root rather than on the input: as of
|
|
23
|
+
// MUI 6, SwitchBase applies plain attributes from the input slot but silently
|
|
24
|
+
// drops event handlers, so an onKeyDown passed through `slotProps.input` (or
|
|
25
|
+
// the deprecated `inputProps`) never fires. keydown bubbles up from the input,
|
|
26
|
+
// so a root-level handler still sees it.
|
|
27
|
+
const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {
|
|
28
|
+
if (event.key !== 'Enter' || disabled) {
|
|
29
|
+
return
|
|
26
30
|
}
|
|
31
|
+
event.preventDefault()
|
|
32
|
+
// currentTarget is the root, so reach for the checkbox to toggle it.
|
|
33
|
+
event.currentTarget.querySelector<HTMLInputElement>('input[type="checkbox"]')?.click()
|
|
27
34
|
}
|
|
28
35
|
|
|
36
|
+
// `slotProps.input` rather than `inputProps`: the latter is deprecated in MUI 6
|
|
37
|
+
// and removed in v7.
|
|
29
38
|
const inputProps = {
|
|
30
39
|
...(label === undefined && { 'aria-label': ariaLabel }),
|
|
31
40
|
role: 'switch',
|
|
32
|
-
onKeyDown: handleKeyDown,
|
|
33
41
|
}
|
|
34
42
|
|
|
35
|
-
const switchEl =
|
|
43
|
+
const switchEl = (
|
|
44
|
+
<Switch
|
|
45
|
+
disabled={disabled}
|
|
46
|
+
onKeyDown={handleKeyDown}
|
|
47
|
+
slotProps={{ input: inputProps }}
|
|
48
|
+
{...switchProps}
|
|
49
|
+
/>
|
|
50
|
+
)
|
|
36
51
|
|
|
37
52
|
return label ? (
|
|
38
53
|
<FormControlLabel
|
|
@@ -116,9 +116,13 @@ function RcSesCheckboxFormControl(props: Props) {
|
|
|
116
116
|
{...slotProps?.label}
|
|
117
117
|
slotProps={{
|
|
118
118
|
typography: {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
// MUI 9 tightened this slot's type: style shorthands are no longer
|
|
120
|
+
// accepted alongside component props, so they move into sx.
|
|
121
|
+
sx: {
|
|
122
|
+
fontWeight: 400,
|
|
123
|
+
lineHeight: '1.25rem',
|
|
124
|
+
marginLeft: variant === 'flat' ? '.4375rem' : '.1875rem',
|
|
125
|
+
},
|
|
122
126
|
variant: variant === 'flat' ? 'body1' : 'body2',
|
|
123
127
|
...slotProps?.label?.slotProps?.typography,
|
|
124
128
|
},
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Button, DialogActions } from '@mui/material'
|
|
2
2
|
import type { PickersActionBarProps } from '@mui/x-date-pickers/PickersActionBar'
|
|
3
|
-
import {
|
|
3
|
+
import { usePickerActionsContext, usePickerTranslations } from '@mui/x-date-pickers/hooks'
|
|
4
4
|
|
|
5
5
|
function RcSesDatepickerActionBar(props: PickersActionBarProps) {
|
|
6
|
-
const { actions,
|
|
6
|
+
const { actions, ...other } = props
|
|
7
7
|
|
|
8
|
-
const translations =
|
|
8
|
+
const translations = usePickerTranslations()
|
|
9
|
+
// x-date-pickers 9 dropped the onAccept/onCancel/onClear/onSetToday props from
|
|
10
|
+
// PickersActionBarProps; the actions now come from the picker's context.
|
|
11
|
+
const { clearValue, cancelValueChanges } = usePickerActionsContext()
|
|
9
12
|
|
|
10
13
|
if (actions == null || actions.length === 0) {
|
|
11
14
|
return null
|
|
@@ -15,13 +18,13 @@ function RcSesDatepickerActionBar(props: PickersActionBarProps) {
|
|
|
15
18
|
switch (actionType) {
|
|
16
19
|
case 'clear':
|
|
17
20
|
return (
|
|
18
|
-
<Button key={actionType} color='error' onClick={
|
|
21
|
+
<Button key={actionType} color='error' onClick={clearValue} variant='text'>
|
|
19
22
|
{translations.clearButtonLabel}
|
|
20
23
|
</Button>
|
|
21
24
|
)
|
|
22
25
|
case 'cancel':
|
|
23
26
|
return (
|
|
24
|
-
<Button key={actionType} onClick={
|
|
27
|
+
<Button key={actionType} onClick={cancelValueChanges} variant='text'>
|
|
25
28
|
{translations.cancelButtonLabel}
|
|
26
29
|
</Button>
|
|
27
30
|
)
|
|
@@ -2,8 +2,8 @@ import IconButton from '@mui/material/IconButton'
|
|
|
2
2
|
import Stack from '@mui/material/Stack'
|
|
3
3
|
import Typography from '@mui/material/Typography'
|
|
4
4
|
import { styled } from '@mui/material/styles'
|
|
5
|
-
import { MuiPickersAdapterContext } from '@mui/x-date-pickers/LocalizationProvider'
|
|
6
5
|
import type { PickersCalendarHeaderProps } from '@mui/x-date-pickers/PickersCalendarHeader'
|
|
6
|
+
import { usePickerAdapter, usePickerTranslations } from '@mui/x-date-pickers/hooks'
|
|
7
7
|
import React from 'react'
|
|
8
8
|
import { useTranslation } from 'react-i18next'
|
|
9
9
|
|
|
@@ -40,25 +40,25 @@ const StepperButton = styled(IconButton)({
|
|
|
40
40
|
},
|
|
41
41
|
})
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
// PickersCalendarHeaderProps is no longer generic in x-date-pickers 9.
|
|
44
|
+
function RcSesDatepickerCalendarHeader(props: PickersCalendarHeaderProps) {
|
|
44
45
|
const { t } = useTranslation('input', { keyPrefix: 'components.RcSesDatepicker' })
|
|
45
46
|
|
|
46
47
|
const { currentMonth, onMonthChange } = props
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
// v9 no longer exports MuiPickersAdapterContext, and useLocalizationContext is
|
|
50
|
+
// not public either, so the adapter and the translations come from separate
|
|
51
|
+
// hooks. Both are guaranteed by the picker context, so no null guard is needed.
|
|
52
|
+
const utils = usePickerAdapter()
|
|
53
|
+
const localeText = usePickerTranslations()
|
|
50
54
|
|
|
51
|
-
|
|
55
|
+
const selectNextMonth = () => onMonthChange(utils.addMonths(currentMonth, 1))
|
|
52
56
|
|
|
53
|
-
const
|
|
57
|
+
const selectNextYear = () => onMonthChange(utils.addYears(currentMonth, 1))
|
|
54
58
|
|
|
55
|
-
const
|
|
59
|
+
const selectPreviousMonth = () => onMonthChange(utils.addMonths(currentMonth, -1))
|
|
56
60
|
|
|
57
|
-
const
|
|
58
|
-
onMonthChange(utils.addMonths(currentMonth, -1), 'right')
|
|
59
|
-
|
|
60
|
-
const selectPreviousYear = () =>
|
|
61
|
-
onMonthChange(utils.addYears(currentMonth, -1), 'right')
|
|
61
|
+
const selectPreviousYear = () => onMonthChange(utils.addYears(currentMonth, -1))
|
|
62
62
|
|
|
63
63
|
const monthLabel = utils.format(currentMonth, 'month')
|
|
64
64
|
|