@registrucentras/rc-ses-react-components 1.1.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/README.md +37 -0
- package/dist/assets/IconProps.d.ts +4 -0
- package/dist/assets/Logo.d.ts +3 -0
- package/dist/assets/ThemeColors.d.ts +6 -0
- package/dist/assets/icons/ArrowRightIcon.d.ts +3 -0
- package/dist/assets/icons/CalendarBlankIcon.d.ts +3 -0
- package/dist/assets/icons/CaretDoubleLeftBoldIcon.d.ts +3 -0
- package/dist/assets/icons/CaretDoubleRightBoldIcon.d.ts +3 -0
- package/dist/assets/icons/CaretDownBoldIcon.d.ts +3 -0
- package/dist/assets/icons/CaretDownFill.d.ts +3 -0
- package/dist/assets/icons/CaretDownIcon.d.ts +3 -0
- package/dist/assets/icons/CaretLeftBoldIcon.d.ts +3 -0
- package/dist/assets/icons/CaretLeftIcon.d.ts +3 -0
- package/dist/assets/icons/CaretRightBoldIcon.d.ts +3 -0
- package/dist/assets/icons/CheckBoldDisabledIcon.d.ts +3 -0
- package/dist/assets/icons/CheckBoldIcon.d.ts +3 -0
- package/dist/assets/icons/CheckCircleFillIcon.d.ts +3 -0
- package/dist/assets/icons/CheckUncheckedBoldIcon.d.ts +3 -0
- package/dist/assets/icons/CloseIcon.d.ts +3 -0
- package/dist/assets/icons/CollapseChevronsIcon.d.ts +3 -0
- package/dist/assets/icons/ExpandChevronsIcon.d.ts +3 -0
- package/dist/assets/icons/InfoFillIcon.d.ts +3 -0
- package/dist/assets/icons/MagnifyingGlassIcon.d.ts +3 -0
- package/dist/assets/icons/MinusBoldIcon.d.ts +3 -0
- package/dist/assets/icons/PlusBoldIcon.d.ts +3 -0
- package/dist/assets/icons/QuestionFillIcon.d.ts +3 -0
- package/dist/assets/icons/QuestionIcon.d.ts +3 -0
- package/dist/assets/icons/ScrollIcon.d.ts +3 -0
- package/dist/assets/icons/SpinnerGapBoldIcon.d.ts +3 -0
- package/dist/assets/icons/UploadSimpleIcon.d.ts +3 -0
- package/dist/assets/icons/WarningDiamondFillIcon.d.ts +3 -0
- package/dist/assets/icons/WarningFillIcon.d.ts +3 -0
- package/dist/assets/icons/XCircleFillIcon.d.ts +3 -0
- package/dist/assets/resolvePaletteColorPath.d.ts +3 -0
- package/dist/components/common/Accordion/hooks/useAccordionController.d.ts +11 -0
- package/dist/components/common/Accordion/index.d.ts +9 -0
- package/dist/components/common/Accordion/types/AccordionControllerState.d.ts +8 -0
- package/dist/components/common/Alert/index.d.ts +3 -0
- package/dist/components/common/Breadcrumbs/index.d.ts +9 -0
- package/dist/components/common/Button/ButtonWithPopover.d.ts +12 -0
- package/dist/components/common/Button/index.d.ts +6 -0
- package/dist/components/common/IconWithCircularBackground.d.ts +14 -0
- package/dist/components/common/Popover/index.d.ts +6 -0
- package/dist/components/common/Tabs/Tab.d.ts +3 -0
- package/dist/components/common/Tabs/TabPanel.d.ts +8 -0
- package/dist/components/common/Tabs/Tabs.d.ts +3 -0
- package/dist/components/common/Tabs/TabsWrapper.d.ts +7 -0
- package/dist/components/form/components/FormControlWrapper/components/FieldSuffix.d.ts +7 -0
- package/dist/components/form/components/FormControlWrapper/const/FormControlLayoutVariables.d.ts +2 -0
- package/dist/components/form/components/FormControlWrapper/index.d.ts +17 -0
- package/dist/components/form/inputs/Checkbox.d.ts +23 -0
- package/dist/components/form/inputs/CheckboxFormControl.d.ts +23 -0
- package/dist/components/form/inputs/Datepicker/components/RcSesDatepickerActionBar.d.ts +3 -0
- package/dist/components/form/inputs/Datepicker/components/RcSesDatepickerCalendarHeader.d.ts +3 -0
- package/dist/components/form/inputs/Datepicker/index.d.ts +16 -0
- package/dist/components/form/inputs/FileDropzone.d.ts +21 -0
- package/dist/components/form/inputs/FileUpload.d.ts +19 -0
- package/dist/components/form/inputs/NumberStepper.d.ts +23 -0
- package/dist/components/form/inputs/PhoneInput.d.ts +3 -0
- package/dist/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.d.ts +3 -0
- package/dist/components/form/inputs/PhoneInputFormControl/components/ListboxComponent.d.ts +3 -0
- package/dist/components/form/inputs/PhoneInputFormControl/components/OuterElementType.d.ts +5 -0
- package/dist/components/form/inputs/PhoneInputFormControl/components/PopperComponent.d.ts +7 -0
- package/dist/components/form/inputs/PhoneInputFormControl/components/RowComponent.d.ts +3 -0
- package/dist/components/form/inputs/PhoneInputFormControl/hooks/useResetCache.d.ts +4 -0
- package/dist/components/form/inputs/PhoneInputFormControl/index.d.ts +22 -0
- package/dist/components/form/inputs/PhoneInputFormControl/types/Country.d.ts +7 -0
- package/dist/components/form/inputs/RadioButtonGroup.d.ts +25 -0
- package/dist/components/form/inputs/SearchableField.d.ts +23 -0
- package/dist/components/form/inputs/Select.d.ts +27 -0
- package/dist/components/form/inputs/TextField.d.ts +16 -0
- package/dist/components/layout/ServiceFormActions.d.ts +9 -0
- package/dist/components/layout/ServiceFormContainer/components/AccordionCollapseControls.d.ts +6 -0
- package/dist/components/layout/ServiceFormContainer/index.d.ts +14 -0
- package/dist/components/layout/ServiceHeader.d.ts +9 -0
- package/dist/components/layout/ServicePage.d.ts +5 -0
- package/dist/components/layout/ServiceWizardStepper/components/ActiveStepIcon.d.ts +2 -0
- package/dist/components/layout/ServiceWizardStepper/components/CompletedStepIcon.d.ts +2 -0
- package/dist/components/layout/ServiceWizardStepper/components/PendingStepIcon.d.ts +2 -0
- package/dist/components/layout/ServiceWizardStepper/index.d.ts +6 -0
- package/dist/components/shared/storage/CookieStorage.d.ts +9 -0
- package/dist/components/storybook/FieldPreview.d.ts +8 -0
- package/dist/components/storybook/FieldPreviewRow.d.ts +8 -0
- package/dist/components/storybook/FieldView.d.ts +8 -0
- package/dist/components/storybook/Fields.d.ts +8 -0
- package/dist/components/storybook/PreviewTitle.d.ts +8 -0
- package/dist/env.d.ts +3 -0
- package/dist/i18n/@mui/x-date-pickers/ltLT.d.ts +133 -0
- package/dist/i18n/i18n.d.ts +6 -0
- package/dist/library/icons.d.ts +14 -0
- package/dist/library/index.d.ts +65 -0
- package/dist/registrucentras-rc-ses-react-components.cjs +48 -0
- package/dist/registrucentras-rc-ses-react-components.js +7288 -0
- package/dist/stories/components/Accordion.stories.d.ts +30 -0
- package/dist/stories/components/Alert.stories.d.ts +7 -0
- package/dist/stories/components/Breadcrumbs.stories.d.ts +8 -0
- package/dist/stories/components/buttons/Button.stories.d.ts +65 -0
- package/dist/stories/components/form/CheckboxFormControl.stories.d.ts +26 -0
- package/dist/stories/components/form/ServiceFormActions.stories.d.ts +12 -0
- package/dist/stories/components/form/ServiceFormContainer.stories.d.ts +16 -0
- package/dist/stories/components/inputs/Checkbox.stories.d.ts +26 -0
- package/dist/stories/components/inputs/DatePicker.stories.d.ts +24 -0
- package/dist/stories/components/inputs/FileUpload.stories.d.ts +30 -0
- package/dist/stories/components/inputs/NumberStepper.stories.d.ts +34 -0
- package/dist/stories/components/inputs/RadioButtonGroup.stories.d.ts +34 -0
- package/dist/stories/components/inputs/SearchableField.stories.d.ts +335 -0
- package/dist/stories/components/inputs/Select.stories.d.ts +874 -0
- package/dist/stories/components/inputs/TextField.stories.d.ts +613 -0
- package/dist/theme/light/MuiAccordion.d.ts +3 -0
- package/dist/theme/light/MuiAccordionDetails.d.ts +3 -0
- package/dist/theme/light/MuiAccordionSummary.d.ts +3 -0
- package/dist/theme/light/MuiAlert.d.ts +3 -0
- package/dist/theme/light/MuiAutocomplete.d.ts +3 -0
- package/dist/theme/light/MuiBreadcrumbs.d.ts +3 -0
- package/dist/theme/light/MuiButton.d.ts +3 -0
- package/dist/theme/light/MuiButtonBase.d.ts +3 -0
- package/dist/theme/light/MuiCard.d.ts +3 -0
- package/dist/theme/light/MuiCardContent.d.ts +3 -0
- package/dist/theme/light/MuiCardHeader.d.ts +3 -0
- package/dist/theme/light/MuiCheckbox.d.ts +3 -0
- package/dist/theme/light/MuiChip.d.ts +3 -0
- package/dist/theme/light/MuiDialog.d.ts +3 -0
- package/dist/theme/light/MuiDivider.d.ts +3 -0
- package/dist/theme/light/MuiFormControl.d.ts +3 -0
- package/dist/theme/light/MuiFormControlLabel.d.ts +3 -0
- package/dist/theme/light/MuiFormGroup.d.ts +3 -0
- package/dist/theme/light/MuiFormHelperText.d.ts +3 -0
- package/dist/theme/light/MuiFormLabel.d.ts +3 -0
- package/dist/theme/light/MuiIconButton.d.ts +3 -0
- package/dist/theme/light/MuiInputBase.d.ts +3 -0
- package/dist/theme/light/MuiLinearProgress.d.ts +3 -0
- package/dist/theme/light/MuiPagination.d.ts +3 -0
- package/dist/theme/light/MuiPickersLayout.d.ts +3 -0
- package/dist/theme/light/MuiPopover.d.ts +3 -0
- package/dist/theme/light/MuiRadio.d.ts +3 -0
- package/dist/theme/light/MuiSelect.d.ts +3 -0
- package/dist/theme/light/MuiStepper.d.ts +3 -0
- package/dist/theme/light/MuiSvgIcon.d.ts +3 -0
- package/dist/theme/light/MuiTab.d.ts +3 -0
- package/dist/theme/light/MuiTable.d.ts +3 -0
- package/dist/theme/light/MuiTableCell.d.ts +3 -0
- package/dist/theme/light/MuiTabs.d.ts +3 -0
- package/dist/theme/light/MuiTextField.d.ts +3 -0
- package/dist/theme/light/MuiTypography.d.ts +3 -0
- package/dist/theme/light/index.d.ts +36 -0
- package/dist/theme/light/themePalette.d.ts +3 -0
- package/dist/theme/palette.d.ts +144 -0
- package/package.json +126 -0
- package/src/App.tsx +42 -0
- package/src/assets/IconProps.ts +5 -0
- package/src/assets/Logo.tsx +111 -0
- package/src/assets/ThemeColors.ts +7 -0
- package/src/assets/icons/ArrowRightIcon.tsx +21 -0
- package/src/assets/icons/CalendarBlankIcon.tsx +21 -0
- package/src/assets/icons/CaretDoubleLeftBoldIcon.tsx +20 -0
- package/src/assets/icons/CaretDoubleRightBoldIcon.tsx +20 -0
- package/src/assets/icons/CaretDownBoldIcon.tsx +20 -0
- package/src/assets/icons/CaretDownFill.tsx +16 -0
- package/src/assets/icons/CaretDownIcon.tsx +21 -0
- package/src/assets/icons/CaretLeftBoldIcon.tsx +20 -0
- package/src/assets/icons/CaretLeftIcon.tsx +21 -0
- package/src/assets/icons/CaretRightBoldIcon.tsx +20 -0
- package/src/assets/icons/CheckBoldDisabledIcon.tsx +32 -0
- package/src/assets/icons/CheckBoldIcon.tsx +32 -0
- package/src/assets/icons/CheckCircleFillIcon.tsx +21 -0
- package/src/assets/icons/CheckUncheckedBoldIcon.tsx +28 -0
- package/src/assets/icons/CloseIcon.tsx +21 -0
- package/src/assets/icons/CollapseChevronsIcon.tsx +21 -0
- package/src/assets/icons/ExpandChevronsIcon.tsx +21 -0
- package/src/assets/icons/InfoFillIcon.tsx +21 -0
- package/src/assets/icons/MagnifyingGlassIcon.tsx +16 -0
- package/src/assets/icons/MinusBoldIcon.tsx +21 -0
- package/src/assets/icons/PlusBoldIcon.tsx +21 -0
- package/src/assets/icons/QuestionFillIcon.tsx +21 -0
- package/src/assets/icons/QuestionIcon.tsx +21 -0
- package/src/assets/icons/ScrollIcon.tsx +21 -0
- package/src/assets/icons/SpinnerGapBoldIcon.tsx +20 -0
- package/src/assets/icons/UploadSimpleIcon.tsx +21 -0
- package/src/assets/icons/WarningDiamondFillIcon.tsx +21 -0
- package/src/assets/icons/WarningFillIcon.tsx +20 -0
- package/src/assets/icons/XCircleFillIcon.tsx +16 -0
- package/src/assets/resolvePaletteColorPath.ts +13 -0
- package/src/components/common/Accordion/hooks/useAccordionController.tsx +42 -0
- package/src/components/common/Accordion/index.tsx +52 -0
- package/src/components/common/Accordion/types/AccordionControllerState.ts +9 -0
- package/src/components/common/Alert/index.tsx +21 -0
- package/src/components/common/Breadcrumbs/index.tsx +21 -0
- package/src/components/common/Button/ButtonWithPopover.tsx +80 -0
- package/src/components/common/Button/index.tsx +21 -0
- package/src/components/common/IconWithCircularBackground.tsx +73 -0
- package/src/components/common/Popover/index.tsx +20 -0
- package/src/components/common/Tabs/Tab.tsx +9 -0
- package/src/components/common/Tabs/TabPanel.tsx +28 -0
- package/src/components/common/Tabs/Tabs.tsx +9 -0
- package/src/components/common/Tabs/TabsWrapper.tsx +33 -0
- package/src/components/form/components/FormControlWrapper/components/FieldSuffix.tsx +14 -0
- package/src/components/form/components/FormControlWrapper/const/FormControlLayoutVariables.ts +4 -0
- package/src/components/form/components/FormControlWrapper/index.tsx +137 -0
- package/src/components/form/inputs/Checkbox.tsx +52 -0
- package/src/components/form/inputs/CheckboxFormControl.tsx +135 -0
- package/src/components/form/inputs/Datepicker/components/RcSesDatepickerActionBar.tsx +37 -0
- package/src/components/form/inputs/Datepicker/components/RcSesDatepickerCalendarHeader.tsx +96 -0
- package/src/components/form/inputs/Datepicker/index.tsx +149 -0
- package/src/components/form/inputs/FileDropzone.tsx +215 -0
- package/src/components/form/inputs/FileUpload.tsx +143 -0
- package/src/components/form/inputs/NumberStepper.tsx +209 -0
- package/src/components/form/inputs/PhoneInput.tsx +28 -0
- package/src/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.tsx +40 -0
- package/src/components/form/inputs/PhoneInputFormControl/components/ListboxComponent.tsx +53 -0
- package/src/components/form/inputs/PhoneInputFormControl/components/OuterElementType.tsx +13 -0
- package/src/components/form/inputs/PhoneInputFormControl/components/PopperComponent.tsx +37 -0
- package/src/components/form/inputs/PhoneInputFormControl/components/RowComponent.tsx +46 -0
- package/src/components/form/inputs/PhoneInputFormControl/hooks/useResetCache.ts +14 -0
- package/src/components/form/inputs/PhoneInputFormControl/index.test.tsx +47 -0
- package/src/components/form/inputs/PhoneInputFormControl/index.tsx +238 -0
- package/src/components/form/inputs/PhoneInputFormControl/styles/styles.css +253 -0
- package/src/components/form/inputs/PhoneInputFormControl/types/Country.ts +9 -0
- package/src/components/form/inputs/RadioButtonGroup.tsx +112 -0
- package/src/components/form/inputs/SearchableField.tsx +120 -0
- package/src/components/form/inputs/Select.tsx +152 -0
- package/src/components/form/inputs/TextField.tsx +59 -0
- package/src/components/layout/ServiceFormActions.tsx +90 -0
- package/src/components/layout/ServiceFormContainer/components/AccordionCollapseControls.tsx +43 -0
- package/src/components/layout/ServiceFormContainer/index.tsx +69 -0
- package/src/components/layout/ServiceHeader.tsx +65 -0
- package/src/components/layout/ServicePage.tsx +10 -0
- package/src/components/layout/ServiceWizardStepper/components/ActiveStepIcon.tsx +15 -0
- package/src/components/layout/ServiceWizardStepper/components/CompletedStepIcon.tsx +19 -0
- package/src/components/layout/ServiceWizardStepper/components/PendingStepIcon.tsx +15 -0
- package/src/components/layout/ServiceWizardStepper/index.tsx +44 -0
- package/src/components/shared/storage/CookieStorage.ts +42 -0
- package/src/components/storybook/FieldPreview.tsx +12 -0
- package/src/components/storybook/FieldPreviewRow.tsx +16 -0
- package/src/components/storybook/FieldView.tsx +9 -0
- package/src/components/storybook/Fields.tsx +9 -0
- package/src/components/storybook/PreviewTitle.tsx +15 -0
- package/src/env.tsx +61 -0
- package/src/examples/MultipleStepForm/components/AdditionalServicesForm.tsx +29 -0
- package/src/examples/MultipleStepForm/components/BasicInformationForm.tsx +5 -0
- package/src/examples/MultipleStepForm/components/ServiceDetailsForm.tsx +152 -0
- package/src/examples/MultipleStepForm/components/ServiceIssuanceForm.tsx +104 -0
- package/src/examples/MultipleStepForm/components/TermsAndConditionsForm.tsx +59 -0
- package/src/examples/MultipleStepForm/index.tsx +104 -0
- package/src/examples/MultipleStepForm/types/MultiStepFormModel.ts +10 -0
- package/src/examples/SingleStepForm/components/ObjectIdentifierSearchModal.tsx +187 -0
- package/src/examples/SingleStepForm/index.tsx +347 -0
- package/src/examples/SingleStepForm/types/SingleStepFormModel.ts +23 -0
- package/src/i18n/@mui/x-date-pickers/ltLT.ts +82 -0
- package/src/i18n/i18n.ts +44 -0
- package/src/i18n/namespaces/common/en.json +9 -0
- package/src/i18n/namespaces/common/lt.json +9 -0
- package/src/i18n/namespaces/input/en.json +53 -0
- package/src/i18n/namespaces/input/lt.json +53 -0
- package/src/library/icons.ts +25 -0
- package/src/library/index.ts +88 -0
- package/src/main.tsx +47 -0
- package/src/setupTests.ts +1 -0
- package/src/stories/components/Accordion.stories.tsx +93 -0
- package/src/stories/components/Alert.stories.tsx +40 -0
- package/src/stories/components/Breadcrumbs.stories.tsx +32 -0
- package/src/stories/components/buttons/Button.stories.tsx +206 -0
- package/src/stories/components/buttons/Button.test.ts +17 -0
- package/src/stories/components/form/CheckboxFormControl.stories.tsx +160 -0
- package/src/stories/components/form/ServiceFormActions.stories.tsx +44 -0
- package/src/stories/components/form/ServiceFormContainer.stories.tsx +178 -0
- package/src/stories/components/inputs/Checkbox.stories.tsx +214 -0
- package/src/stories/components/inputs/DatePicker.stories.tsx +99 -0
- package/src/stories/components/inputs/FileUpload.stories.tsx +159 -0
- package/src/stories/components/inputs/NumberStepper.stories.tsx +162 -0
- package/src/stories/components/inputs/RadioButtonGroup.stories.tsx +155 -0
- package/src/stories/components/inputs/SearchableField.stories.tsx +90 -0
- package/src/stories/components/inputs/Select.stories.tsx +226 -0
- package/src/stories/components/inputs/TextField.stories.tsx +77 -0
- package/src/stubs/Component.tsx +9 -0
- package/src/styles/index.css +12 -0
- package/src/theme/light/MuiAccordion.tsx +50 -0
- package/src/theme/light/MuiAccordionDetails.ts +17 -0
- package/src/theme/light/MuiAccordionSummary.tsx +35 -0
- package/src/theme/light/MuiAlert.tsx +254 -0
- package/src/theme/light/MuiAutocomplete.ts +55 -0
- package/src/theme/light/MuiBreadcrumbs.tsx +42 -0
- package/src/theme/light/MuiButton.tsx +393 -0
- package/src/theme/light/MuiButtonBase.tsx +15 -0
- package/src/theme/light/MuiCard.tsx +18 -0
- package/src/theme/light/MuiCardContent.tsx +19 -0
- package/src/theme/light/MuiCardHeader.tsx +15 -0
- package/src/theme/light/MuiCheckbox.ts +26 -0
- package/src/theme/light/MuiChip.tsx +13 -0
- package/src/theme/light/MuiDialog.ts +25 -0
- package/src/theme/light/MuiDivider.tsx +12 -0
- package/src/theme/light/MuiFormControl.ts +28 -0
- package/src/theme/light/MuiFormControlLabel.ts +48 -0
- package/src/theme/light/MuiFormGroup.ts +83 -0
- package/src/theme/light/MuiFormHelperText.ts +18 -0
- package/src/theme/light/MuiFormLabel.ts +48 -0
- package/src/theme/light/MuiIconButton.ts +30 -0
- package/src/theme/light/MuiInputBase.ts +99 -0
- package/src/theme/light/MuiLinearProgress.ts +17 -0
- package/src/theme/light/MuiPagination.ts +31 -0
- package/src/theme/light/MuiPickersLayout.ts +68 -0
- package/src/theme/light/MuiPopover.ts +29 -0
- package/src/theme/light/MuiRadio.tsx +65 -0
- package/src/theme/light/MuiSelect.tsx +8 -0
- package/src/theme/light/MuiStepper.ts +52 -0
- package/src/theme/light/MuiSvgIcon.ts +17 -0
- package/src/theme/light/MuiTab.tsx +53 -0
- package/src/theme/light/MuiTable.ts +20 -0
- package/src/theme/light/MuiTableCell.ts +40 -0
- package/src/theme/light/MuiTabs.tsx +34 -0
- package/src/theme/light/MuiTextField.tsx +12 -0
- package/src/theme/light/MuiTypography.tsx +57 -0
- package/src/theme/light/index.tsx +138 -0
- package/src/theme/light/themePalette.tsx +23 -0
- package/src/theme/palette.tsx +77 -0
- package/src/types/assets/IconProps.tsx +19 -0
- package/src/types/buttons/ButtonProps.tsx +3 -0
- package/src/types/cards/CardServiceProps.tsx +9 -0
- package/src/types/common/ColorType.tsx +20 -0
- package/src/types/common/QuickLinkType.tsx +5 -0
- package/src/types/inputs/InputIconProps.tsx +5 -0
- package/src/types/lists/ListNewsItemType.tsx +5 -0
- package/src/types/lists/ListServicesItemType.tsx +8 -0
- package/src/types/order/OrderItemStatusType.tsx +3 -0
- package/src/vite-env.d.ts +79 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": {
|
|
3
|
+
"RcSesAlert": {
|
|
4
|
+
"close": "Close"
|
|
5
|
+
},
|
|
6
|
+
|
|
7
|
+
"RcSesButtonWithPopover": {
|
|
8
|
+
"aria": {
|
|
9
|
+
"label": "Additional information"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
"RcSesDatepicker": {
|
|
14
|
+
"aria": {
|
|
15
|
+
"clearValue": "Clear current date selection",
|
|
16
|
+
"openCalendar": "Open datepicker calendar"
|
|
17
|
+
},
|
|
18
|
+
"prevYear": "Previous year",
|
|
19
|
+
"nextYear": "Next year"
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
"RcSesFileDropzone": {
|
|
23
|
+
"label": "Drag and drop file over this area or <1>click here</1> to browse"
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
"RcSesFileUpload": {
|
|
27
|
+
"label": "Upload file"
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
"RcSesFormControlWrapper": {
|
|
31
|
+
"search": "Search",
|
|
32
|
+
"required": "Field is required"
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"RcSesNumberStepper": {
|
|
36
|
+
"add": "Add",
|
|
37
|
+
"subtract": "Subtract"
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
"RcSesPhoneInputFormControl": {
|
|
41
|
+
"aria": {
|
|
42
|
+
"countrySelectorLabel": "Select country phone code"
|
|
43
|
+
},
|
|
44
|
+
"search": "Search",
|
|
45
|
+
"invalid": "Invalid phone number format"
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
"RcSesSearchableField": {
|
|
49
|
+
"clearValueAriaLabel": "Clear search value",
|
|
50
|
+
"searchAriaLabel": "Open search"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": {
|
|
3
|
+
"RcSesAlert": {
|
|
4
|
+
"close": "Uždaryti"
|
|
5
|
+
},
|
|
6
|
+
|
|
7
|
+
"RcSesButtonWithPopover": {
|
|
8
|
+
"aria": {
|
|
9
|
+
"label": "Daugiau informacijos"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
"RcSesDatepicker": {
|
|
14
|
+
"aria": {
|
|
15
|
+
"clearValue": "Išvalyti datos reikšmę",
|
|
16
|
+
"openCalendar": "Atverti datos pasirinkimo kalendorių"
|
|
17
|
+
},
|
|
18
|
+
"prevYear": "Ankstesni metai",
|
|
19
|
+
"nextYear": "Ateinantys metai"
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
"RcSesFileDropzone": {
|
|
23
|
+
"label": "Nutempkite failą čia arba <1>įkelkite</1> iš kompiuterio"
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
"RcSesFileUpload": {
|
|
27
|
+
"label": "Įkelti failą"
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
"RcSesFormControlWrapper": {
|
|
31
|
+
"search": "Ieškoti",
|
|
32
|
+
"required": "Laukas yra privalomas"
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"RcSesNumberStepper": {
|
|
36
|
+
"add": "Pridėti",
|
|
37
|
+
"subtract": "Atimti"
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
"RcSesPhoneInputFormControl": {
|
|
41
|
+
"aria": {
|
|
42
|
+
"countrySelectorLabel": "Šalies telefono numerio kodo pasirinkimas"
|
|
43
|
+
},
|
|
44
|
+
"search": "Ieškoti",
|
|
45
|
+
"invalid": "Klaidingas telefono numerio formatas"
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
"RcSesSearchableField": {
|
|
49
|
+
"clearValueAriaLabel": "Išvalyti paieškos reikšmę",
|
|
50
|
+
"searchAriaLabel": "Ieškoti"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import RcSesLogo from '@/assets/Logo'
|
|
2
|
+
import ArrowRightIcon from '@/assets/icons/ArrowRightIcon'
|
|
3
|
+
import CaretDoubleLeftBoldIcon from '@/assets/icons/CaretDoubleLeftBoldIcon'
|
|
4
|
+
import CaretDoubleRightBoldIcon from '@/assets/icons/CaretDoubleRightBoldIcon'
|
|
5
|
+
import CaretDownBoldIcon from '@/assets/icons/CaretDownBoldIcon'
|
|
6
|
+
import CaretDownIcon from '@/assets/icons/CaretDownIcon'
|
|
7
|
+
import CaretLeftBoldIcon from '@/assets/icons/CaretLeftBoldIcon'
|
|
8
|
+
import CaretLeftIcon from '@/assets/icons/CaretLeftIcon'
|
|
9
|
+
import CaretRightBoldIcon from '@/assets/icons/CaretRightBoldIcon'
|
|
10
|
+
import CheckBoldDisabledIcon from '@/assets/icons/CheckBoldDisabledIcon'
|
|
11
|
+
import CheckBoldIcon from '@/assets/icons/CheckBoldIcon'
|
|
12
|
+
|
|
13
|
+
export { RcSesLogo }
|
|
14
|
+
export { ArrowRightIcon }
|
|
15
|
+
export {
|
|
16
|
+
CheckBoldDisabledIcon,
|
|
17
|
+
CheckBoldIcon,
|
|
18
|
+
CaretDoubleLeftBoldIcon,
|
|
19
|
+
CaretDoubleRightBoldIcon,
|
|
20
|
+
CaretDownBoldIcon,
|
|
21
|
+
CaretDownIcon,
|
|
22
|
+
CaretLeftBoldIcon,
|
|
23
|
+
CaretLeftIcon,
|
|
24
|
+
CaretRightBoldIcon,
|
|
25
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type {} from '@emotion/styled'
|
|
2
|
+
import type {} from '@mui/system'
|
|
3
|
+
import type {} from '@mui/x-date-pickers/themeAugmentation'
|
|
4
|
+
|
|
5
|
+
import RcSesIconProps from '@/assets/IconProps'
|
|
6
|
+
import RcSesLogo from '@/assets/Logo'
|
|
7
|
+
import ArrowRightIcon from '@/assets/icons/ArrowRightIcon'
|
|
8
|
+
import CaretDoubleLeftBoldIcon from '@/assets/icons/CaretDoubleLeftBoldIcon'
|
|
9
|
+
import CaretDoubleRightBoldIcon from '@/assets/icons/CaretDoubleRightBoldIcon'
|
|
10
|
+
import CaretDownBoldIcon from '@/assets/icons/CaretDownBoldIcon'
|
|
11
|
+
import CaretDownIcon from '@/assets/icons/CaretDownIcon'
|
|
12
|
+
import CaretLeftBoldIcon from '@/assets/icons/CaretLeftBoldIcon'
|
|
13
|
+
import CaretLeftIcon from '@/assets/icons/CaretLeftIcon'
|
|
14
|
+
import CaretRightBoldIcon from '@/assets/icons/CaretRightBoldIcon'
|
|
15
|
+
import RcSesAccordion from '@/components/common/Accordion'
|
|
16
|
+
import useAccordionController from '@/components/common/Accordion/hooks/useAccordionController'
|
|
17
|
+
import RcSesAlert from '@/components/common/Alert'
|
|
18
|
+
import RcSesBreadcrumbs from '@/components/common/Breadcrumbs'
|
|
19
|
+
import RcSesButton from '@/components/common/Button'
|
|
20
|
+
import RcSesButtonWithPopover from '@/components/common/Button/ButtonWithPopover'
|
|
21
|
+
import RcSesIconWithCircularBackground from '@/components/common/IconWithCircularBackground'
|
|
22
|
+
import RcSesTab from '@/components/common/Tabs/Tab'
|
|
23
|
+
import RcSesTabPanel from '@/components/common/Tabs/TabPanel'
|
|
24
|
+
import RcSesTabs from '@/components/common/Tabs/Tabs'
|
|
25
|
+
import RcSesTabsWrapper from '@/components/common/Tabs/TabsWrapper'
|
|
26
|
+
import RcSesFormControlWrapper from '@/components/form/components/FormControlWrapper'
|
|
27
|
+
import RcSesCheckbox from '@/components/form/inputs/Checkbox'
|
|
28
|
+
import RcSesCheckboxFormControl from '@/components/form/inputs/CheckboxFormControl'
|
|
29
|
+
import RcSesDatepicker from '@/components/form/inputs/Datepicker'
|
|
30
|
+
import RcSesFileDropzone from '@/components/form/inputs/FileDropzone'
|
|
31
|
+
import RcSesFileUpload from '@/components/form/inputs/FileUpload'
|
|
32
|
+
import RcSesNumberStepper from '@/components/form/inputs/NumberStepper'
|
|
33
|
+
import RcSesPhoneInput from '@/components/form/inputs/PhoneInput'
|
|
34
|
+
import RcSesPhoneInputFormControl from '@/components/form/inputs/PhoneInputFormControl'
|
|
35
|
+
import RcSesRadioButtonGroup from '@/components/form/inputs/RadioButtonGroup'
|
|
36
|
+
import RcSesSearchableField from '@/components/form/inputs/SearchableField'
|
|
37
|
+
import RcSesSelect from '@/components/form/inputs/Select'
|
|
38
|
+
import RcSesTextField from '@/components/form/inputs/TextField'
|
|
39
|
+
import RcSesServiceFormActions from '@/components/layout/ServiceFormActions'
|
|
40
|
+
import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer'
|
|
41
|
+
import RcSesServiceHeader from '@/components/layout/ServiceHeader'
|
|
42
|
+
import RcSesServicePage from '@/components/layout/ServicePage'
|
|
43
|
+
import RcSesTheme from '@/theme/light'
|
|
44
|
+
import RcSesPalette from '@/theme/palette'
|
|
45
|
+
|
|
46
|
+
declare module '@mui/x-date-pickers/models' {
|
|
47
|
+
interface PickerValidDateLookup {
|
|
48
|
+
'date-fns': Date
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { RcSesPalette, RcSesTheme }
|
|
53
|
+
export { RcSesAccordion, useAccordionController }
|
|
54
|
+
export { RcSesAlert, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover }
|
|
55
|
+
export { RcSesCheckbox, RcSesCheckboxFormControl }
|
|
56
|
+
export { RcSesDatepicker }
|
|
57
|
+
export { RcSesFileUpload }
|
|
58
|
+
export { RcSesFileDropzone }
|
|
59
|
+
export { RcSesNumberStepper }
|
|
60
|
+
export { RcSesPhoneInput, RcSesPhoneInputFormControl }
|
|
61
|
+
export { RcSesRadioButtonGroup }
|
|
62
|
+
export { RcSesSearchableField }
|
|
63
|
+
export { RcSesSelect }
|
|
64
|
+
export { RcSesTab, RcSesTabPanel, RcSesTabs, RcSesTabsWrapper }
|
|
65
|
+
export { RcSesTextField }
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
RcSesServiceFormActions,
|
|
69
|
+
RcSesServiceFormContainer,
|
|
70
|
+
RcSesFormControlWrapper,
|
|
71
|
+
RcSesServiceHeader,
|
|
72
|
+
RcSesServicePage,
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type { RcSesIconProps }
|
|
76
|
+
export { RcSesIconWithCircularBackground }
|
|
77
|
+
|
|
78
|
+
export { RcSesLogo }
|
|
79
|
+
export { ArrowRightIcon }
|
|
80
|
+
export {
|
|
81
|
+
CaretDoubleLeftBoldIcon,
|
|
82
|
+
CaretDoubleRightBoldIcon,
|
|
83
|
+
CaretDownBoldIcon,
|
|
84
|
+
CaretDownIcon,
|
|
85
|
+
CaretLeftBoldIcon,
|
|
86
|
+
CaretLeftIcon,
|
|
87
|
+
CaretRightBoldIcon,
|
|
88
|
+
}
|
package/src/main.tsx
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CssBaseline } from '@mui/material'
|
|
2
|
+
import { ThemeProvider } from '@mui/material/styles'
|
|
3
|
+
import type {} from '@mui/system'
|
|
4
|
+
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3'
|
|
5
|
+
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'
|
|
6
|
+
import type {} from '@mui/x-date-pickers/themeAugmentation'
|
|
7
|
+
import { enUS } from 'date-fns/locale/en-US'
|
|
8
|
+
import { lt } from 'date-fns/locale/lt'
|
|
9
|
+
import React from 'react'
|
|
10
|
+
import ReactDOM from 'react-dom/client'
|
|
11
|
+
import { RouterProvider, createBrowserRouter } from 'react-router-dom'
|
|
12
|
+
|
|
13
|
+
import theme from '@/theme/light'
|
|
14
|
+
|
|
15
|
+
import App from './App'
|
|
16
|
+
import MultipleStepForm from './examples/MultipleStepForm'
|
|
17
|
+
import SingleStepForm from './examples/SingleStepForm'
|
|
18
|
+
import i18n from './i18n/i18n'
|
|
19
|
+
import './styles/index.css'
|
|
20
|
+
|
|
21
|
+
const router = createBrowserRouter([
|
|
22
|
+
{
|
|
23
|
+
path: '/',
|
|
24
|
+
element: <App />,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
path: '/single-step-form',
|
|
28
|
+
element: <SingleStepForm />,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
path: '/multi-step-form',
|
|
32
|
+
element: <MultipleStepForm />,
|
|
33
|
+
},
|
|
34
|
+
])
|
|
35
|
+
|
|
36
|
+
const adapterLocale = i18n.language === 'lt' ? lt : enUS
|
|
37
|
+
|
|
38
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
39
|
+
<React.StrictMode>
|
|
40
|
+
<ThemeProvider theme={theme}>
|
|
41
|
+
<LocalizationProvider dateAdapter={AdapterDateFns} adapterLocale={adapterLocale}>
|
|
42
|
+
<CssBaseline />
|
|
43
|
+
<RouterProvider router={router} />
|
|
44
|
+
</LocalizationProvider>
|
|
45
|
+
</ThemeProvider>
|
|
46
|
+
</React.StrictMode>,
|
|
47
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/vitest'
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* eslint-disable react/function-component-definition */
|
|
2
|
+
import { Meta, StoryContext, StoryFn } from '@storybook/react'
|
|
3
|
+
|
|
4
|
+
import RcSesAccordion from '@/components/common/Accordion'
|
|
5
|
+
import useAccordionController from '@/components/common/Accordion/hooks/useAccordionController'
|
|
6
|
+
import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer'
|
|
7
|
+
import FieldView from '@/components/storybook/FieldView'
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof RcSesAccordion> = {
|
|
10
|
+
title: 'components/common/Accordion',
|
|
11
|
+
component: RcSesAccordion,
|
|
12
|
+
argTypes: {
|
|
13
|
+
disabled: {
|
|
14
|
+
control: {
|
|
15
|
+
type: 'boolean',
|
|
16
|
+
},
|
|
17
|
+
table: {
|
|
18
|
+
defaultValue: {},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
tags: ['autodocs'],
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default meta
|
|
26
|
+
|
|
27
|
+
const Template: StoryFn<typeof RcSesAccordion> = (args) => {
|
|
28
|
+
const { disabled } = args
|
|
29
|
+
|
|
30
|
+
const accordionController = useAccordionController({
|
|
31
|
+
initialState: {
|
|
32
|
+
form: {
|
|
33
|
+
canToggle: true,
|
|
34
|
+
expanded: false,
|
|
35
|
+
state: 'active',
|
|
36
|
+
title: 'Accordion title',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<FieldView>
|
|
43
|
+
<RcSesServiceFormContainer
|
|
44
|
+
showProgressStepper
|
|
45
|
+
accordionController={accordionController}
|
|
46
|
+
slotProps={{ container: { maxWidth: 'lg' } }}
|
|
47
|
+
>
|
|
48
|
+
<RcSesAccordion id='form' controller={accordionController} disabled={disabled}>
|
|
49
|
+
Here goes Accordeon content
|
|
50
|
+
</RcSesAccordion>
|
|
51
|
+
</RcSesServiceFormContainer>
|
|
52
|
+
</FieldView>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const codeBlock = (args: any) => {
|
|
57
|
+
const { disabled } = args
|
|
58
|
+
return `
|
|
59
|
+
import RcSesAccordion from '@/components/common/Accordion'
|
|
60
|
+
import useAccordionController from '@/components/common/Accordion/hooks/useAccordionController'
|
|
61
|
+
|
|
62
|
+
const MyComponent = () => (
|
|
63
|
+
const accordionController = useAccordionController({
|
|
64
|
+
initialState: {
|
|
65
|
+
form: {
|
|
66
|
+
canToggle: true,
|
|
67
|
+
expanded: false,
|
|
68
|
+
state: 'active',
|
|
69
|
+
title: "Accordion title",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
<RcSesAccordion controller={accordionController} disabled="${disabled}">
|
|
75
|
+
This is content
|
|
76
|
+
</RcSesAccordion>
|
|
77
|
+
);`
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const Main = Template.bind({})
|
|
81
|
+
Main.args = {
|
|
82
|
+
disabled: false,
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
Main.parameters = {
|
|
86
|
+
docs: {
|
|
87
|
+
source: {
|
|
88
|
+
type: 'dynamic',
|
|
89
|
+
transform: (code: string, storyContext: StoryContext) =>
|
|
90
|
+
codeBlock(storyContext.args),
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* eslint-disable react/function-component-definition */
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react'
|
|
3
|
+
|
|
4
|
+
import RcSesAlert from '@/components/common/Alert'
|
|
5
|
+
import FieldPreview from '@/components/storybook/FieldPreview'
|
|
6
|
+
import FieldView from '@/components/storybook/FieldView'
|
|
7
|
+
import Fields from '@/components/storybook/Fields'
|
|
8
|
+
import PreviewTitle from '@/components/storybook/PreviewTitle'
|
|
9
|
+
|
|
10
|
+
const lorem =
|
|
11
|
+
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard."
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof RcSesAlert> = {
|
|
14
|
+
title: 'components/common/Alert',
|
|
15
|
+
component: RcSesAlert,
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default meta
|
|
20
|
+
|
|
21
|
+
const Template: StoryFn<typeof RcSesAlert> = (args) => (
|
|
22
|
+
<Fields>
|
|
23
|
+
<FieldView>
|
|
24
|
+
<RcSesAlert {...args} />
|
|
25
|
+
</FieldView>
|
|
26
|
+
<FieldPreview>
|
|
27
|
+
<PreviewTitle>State previews</PreviewTitle>
|
|
28
|
+
<RcSesAlert severity='info'>{lorem}</RcSesAlert>
|
|
29
|
+
<RcSesAlert severity='warning'>{lorem}</RcSesAlert>
|
|
30
|
+
<RcSesAlert severity='error'>{lorem}</RcSesAlert>
|
|
31
|
+
<RcSesAlert severity='success'>{lorem}</RcSesAlert>
|
|
32
|
+
</FieldPreview>
|
|
33
|
+
</Fields>
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
export const Main = Template.bind({})
|
|
37
|
+
Main.args = {
|
|
38
|
+
children: lorem,
|
|
39
|
+
severity: 'info',
|
|
40
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* eslint-disable react/function-component-definition */
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react'
|
|
3
|
+
|
|
4
|
+
import RcSesBreadcrumbs from '@/components/common/Breadcrumbs'
|
|
5
|
+
|
|
6
|
+
const Path = [
|
|
7
|
+
{
|
|
8
|
+
label: 'Level 2',
|
|
9
|
+
path: 'level-2',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
label: 'Level 3',
|
|
13
|
+
path: 'level-3',
|
|
14
|
+
},
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
const meta: Meta<typeof RcSesBreadcrumbs> = {
|
|
18
|
+
title: 'components/common/Breadcrumbs',
|
|
19
|
+
component: RcSesBreadcrumbs,
|
|
20
|
+
tags: ['autodocs'],
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default meta
|
|
24
|
+
|
|
25
|
+
const Template: StoryFn<typeof RcSesBreadcrumbs> = (args) => (
|
|
26
|
+
<RcSesBreadcrumbs {...args} />
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
export const Main = Template.bind({})
|
|
30
|
+
Main.args = {
|
|
31
|
+
path: Path,
|
|
32
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { fn } from '@storybook/test'
|
|
3
|
+
|
|
4
|
+
import PlusBoldIcon from '@/assets/icons/PlusBoldIcon'
|
|
5
|
+
import Button from '@/components/common/Button'
|
|
6
|
+
import { ButtonProps } from '@/types/buttons/ButtonProps'
|
|
7
|
+
|
|
8
|
+
const variantOptions: Array<ButtonProps['variant']> = [
|
|
9
|
+
'contained',
|
|
10
|
+
'outlined',
|
|
11
|
+
'link',
|
|
12
|
+
'text',
|
|
13
|
+
]
|
|
14
|
+
const colorOptions = [
|
|
15
|
+
'primary',
|
|
16
|
+
'secondary',
|
|
17
|
+
'grey',
|
|
18
|
+
'error',
|
|
19
|
+
'inherit',
|
|
20
|
+
'success',
|
|
21
|
+
'info',
|
|
22
|
+
'warning',
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
const meta = {
|
|
26
|
+
title: 'components/common/buttons/Button',
|
|
27
|
+
component: Button,
|
|
28
|
+
parameters: {
|
|
29
|
+
layout: 'centered',
|
|
30
|
+
},
|
|
31
|
+
argTypes: {
|
|
32
|
+
variant: {
|
|
33
|
+
options: variantOptions,
|
|
34
|
+
mapping: variantOptions,
|
|
35
|
+
control: {
|
|
36
|
+
type: 'select',
|
|
37
|
+
labels: variantOptions,
|
|
38
|
+
},
|
|
39
|
+
table: {
|
|
40
|
+
defaultValue: {},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
color: {
|
|
44
|
+
options: colorOptions,
|
|
45
|
+
mapping: colorOptions,
|
|
46
|
+
control: {
|
|
47
|
+
type: 'select',
|
|
48
|
+
labels: colorOptions,
|
|
49
|
+
},
|
|
50
|
+
table: {
|
|
51
|
+
defaultValue: {},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
disabled: {
|
|
55
|
+
control: {
|
|
56
|
+
type: 'boolean',
|
|
57
|
+
},
|
|
58
|
+
table: {
|
|
59
|
+
defaultValue: {},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
tags: ['autodocs'],
|
|
64
|
+
args: {
|
|
65
|
+
children: 'Button',
|
|
66
|
+
onClick: fn(),
|
|
67
|
+
},
|
|
68
|
+
} satisfies Meta<typeof Button>
|
|
69
|
+
|
|
70
|
+
export default meta
|
|
71
|
+
type Story = StoryObj<typeof meta>
|
|
72
|
+
|
|
73
|
+
const disableColorContrast = {
|
|
74
|
+
a11y: {
|
|
75
|
+
config: {
|
|
76
|
+
rules: [{ id: 'color-contrast', enabled: false }],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const PrimaryContained: Story = {
|
|
82
|
+
args: {
|
|
83
|
+
variant: 'contained',
|
|
84
|
+
color: 'primary',
|
|
85
|
+
disabled: false,
|
|
86
|
+
},
|
|
87
|
+
/* play: async ({ canvasElement }) => {
|
|
88
|
+
const canvas = within(canvasElement)
|
|
89
|
+
|
|
90
|
+
// See https://storybook.js.org/docs/essentials/actions#automatically-matching-args to learn how to setup logging in the Actions panel
|
|
91
|
+
await userEvent.click(canvas.getByRole('button'))
|
|
92
|
+
|
|
93
|
+
// 👇 Assert DOM structure
|
|
94
|
+
await expect(
|
|
95
|
+
canvas.getByText(
|
|
96
|
+
'Everything is perfect. Your account is ready and we should probably get you started!',
|
|
97
|
+
),
|
|
98
|
+
).toBeInTheDocument()
|
|
99
|
+
}, */
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const PrimaryContainedWithPrefixIcon: Story = {
|
|
103
|
+
args: {
|
|
104
|
+
variant: 'contained',
|
|
105
|
+
color: 'primary',
|
|
106
|
+
disabled: false,
|
|
107
|
+
startIcon: <PlusBoldIcon />,
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const PrimaryContainedWithSuffixIcon: Story = {
|
|
112
|
+
args: {
|
|
113
|
+
variant: 'contained',
|
|
114
|
+
color: 'primary',
|
|
115
|
+
disabled: false,
|
|
116
|
+
endIcon: <PlusBoldIcon />,
|
|
117
|
+
},
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const PrimaryOutlined: Story = {
|
|
121
|
+
parameters: disableColorContrast,
|
|
122
|
+
args: {
|
|
123
|
+
color: 'primary',
|
|
124
|
+
variant: 'outlined',
|
|
125
|
+
},
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export const PrimaryOutlinedWithPrefixIcon: Story = {
|
|
129
|
+
parameters: disableColorContrast,
|
|
130
|
+
args: {
|
|
131
|
+
color: 'primary',
|
|
132
|
+
variant: 'outlined',
|
|
133
|
+
startIcon: <PlusBoldIcon />,
|
|
134
|
+
},
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const PrimaryOutlinedWithSuffixIcon: Story = {
|
|
138
|
+
parameters: disableColorContrast,
|
|
139
|
+
args: {
|
|
140
|
+
color: 'primary',
|
|
141
|
+
variant: 'outlined',
|
|
142
|
+
endIcon: <PlusBoldIcon />,
|
|
143
|
+
},
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export const SecondaryContained: Story = {
|
|
147
|
+
args: {
|
|
148
|
+
color: 'secondary',
|
|
149
|
+
variant: 'contained',
|
|
150
|
+
},
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export const SecondaryOutlined: Story = {
|
|
154
|
+
parameters: disableColorContrast,
|
|
155
|
+
args: {
|
|
156
|
+
color: 'secondary',
|
|
157
|
+
variant: 'outlined',
|
|
158
|
+
},
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export const GreyContained: Story = {
|
|
162
|
+
args: {
|
|
163
|
+
color: 'grey',
|
|
164
|
+
variant: 'contained',
|
|
165
|
+
},
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export const GreyOutlined: Story = {
|
|
169
|
+
parameters: disableColorContrast,
|
|
170
|
+
args: {
|
|
171
|
+
color: 'grey',
|
|
172
|
+
variant: 'outlined',
|
|
173
|
+
},
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export const WarningContained: Story = {
|
|
177
|
+
args: {
|
|
178
|
+
variant: 'contained',
|
|
179
|
+
children: 'Button',
|
|
180
|
+
color: 'warning',
|
|
181
|
+
},
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export const WarningOutlined: Story = {
|
|
185
|
+
parameters: disableColorContrast,
|
|
186
|
+
args: {
|
|
187
|
+
variant: 'outlined',
|
|
188
|
+
children: 'Button',
|
|
189
|
+
color: 'warning',
|
|
190
|
+
},
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export const ErrorContained: Story = {
|
|
194
|
+
args: {
|
|
195
|
+
color: 'error',
|
|
196
|
+
variant: 'contained',
|
|
197
|
+
},
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export const ErrorOutlined: Story = {
|
|
201
|
+
parameters: disableColorContrast,
|
|
202
|
+
args: {
|
|
203
|
+
color: 'error',
|
|
204
|
+
variant: 'outlined',
|
|
205
|
+
},
|
|
206
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { composeStories } from '@storybook/react'
|
|
2
|
+
import '@testing-library/jest-dom'
|
|
3
|
+
import { render, screen } from '@testing-library/react'
|
|
4
|
+
|
|
5
|
+
import * as stories from './Button.stories'
|
|
6
|
+
|
|
7
|
+
const { PrimaryContained } = composeStories(stories)
|
|
8
|
+
|
|
9
|
+
test('reuses args from composed story', () => {
|
|
10
|
+
render(PrimaryContained())
|
|
11
|
+
|
|
12
|
+
const buttonElement = screen.getByRole('button')
|
|
13
|
+
// Testing against values coming from the story itself! No need for duplication
|
|
14
|
+
expect(buttonElement.textContent).toEqual(PrimaryContained.args.children)
|
|
15
|
+
expect(buttonElement).toBeInTheDocument()
|
|
16
|
+
// expect(buttonElement).toHaveAttribute('id')
|
|
17
|
+
})
|