@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Stack, Typography } from '@mui/material'
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { InfoIcon } from '@/assets/icons/phosphorIcons'
|
|
5
5
|
import RcSesIconWithSquareBackground from '@/components/common/IconWithSquareBackground'
|
|
6
6
|
|
|
7
7
|
const meta: Meta<typeof RcSesIconWithSquareBackground> = {
|
|
@@ -11,11 +11,11 @@ const meta: Meta<typeof RcSesIconWithSquareBackground> = {
|
|
|
11
11
|
argTypes: {
|
|
12
12
|
size: {
|
|
13
13
|
control: { type: 'select' },
|
|
14
|
-
options: [40, 44],
|
|
14
|
+
options: [16, 20, 24, 32, 40, 44, 48, 56, 64],
|
|
15
15
|
},
|
|
16
16
|
variant: {
|
|
17
17
|
control: { type: 'select' },
|
|
18
|
-
options: ['solid', '
|
|
18
|
+
options: ['solid', 'cyan', 'muted', 'green'],
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
}
|
|
@@ -25,14 +25,14 @@ type Story = StoryObj<typeof meta>
|
|
|
25
25
|
|
|
26
26
|
export const Default: Story = {
|
|
27
27
|
args: {
|
|
28
|
-
Icon:
|
|
28
|
+
Icon: InfoIcon,
|
|
29
29
|
size: 44,
|
|
30
30
|
variant: 'solid',
|
|
31
31
|
},
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const SIZES = [40, 44] as const
|
|
35
|
-
const VARIANTS = ['solid', '
|
|
34
|
+
const SIZES = [16, 20, 24, 32, 40, 44, 48, 56, 64] as const
|
|
35
|
+
const VARIANTS = ['solid', 'cyan', 'muted', 'green'] as const
|
|
36
36
|
|
|
37
37
|
export const AllVariantsAndSizes: Story = {
|
|
38
38
|
parameters: { controls: { disable: true } },
|
|
@@ -45,7 +45,7 @@ export const AllVariantsAndSizes: Story = {
|
|
|
45
45
|
{VARIANTS.map((variant) => (
|
|
46
46
|
<Stack key={variant} spacing={0.5} sx={{ alignItems: 'center' }}>
|
|
47
47
|
<RcSesIconWithSquareBackground
|
|
48
|
-
Icon={
|
|
48
|
+
Icon={InfoIcon}
|
|
49
49
|
size={size}
|
|
50
50
|
variant={variant}
|
|
51
51
|
/>
|
|
@@ -270,7 +270,7 @@ const UsageComponent = () => (
|
|
|
270
270
|
/>
|
|
271
271
|
</UsageSection>
|
|
272
272
|
<UsageSection title='In an icon tile (pass the component)'>
|
|
273
|
-
<RcSesIconWithSquareBackground Icon={PhoneIcon} variant='
|
|
273
|
+
<RcSesIconWithSquareBackground Icon={PhoneIcon} variant='cyan' />
|
|
274
274
|
</UsageSection>
|
|
275
275
|
</Stack>
|
|
276
276
|
)
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Box } from '@mui/material'
|
|
1
2
|
import { Meta, StoryContext, StoryObj } from '@storybook/react-vite'
|
|
3
|
+
import type { CSSProperties } from 'react'
|
|
2
4
|
import { useForm } from 'react-hook-form'
|
|
3
5
|
|
|
4
6
|
import RcSesNumberStepper from '@/components/form/inputs/NumberStepper'
|
|
@@ -132,3 +134,45 @@ export const Main: Story = {
|
|
|
132
134
|
},
|
|
133
135
|
},
|
|
134
136
|
}
|
|
137
|
+
|
|
138
|
+
export const TokenBindings: Story = {
|
|
139
|
+
...Main,
|
|
140
|
+
parameters: {
|
|
141
|
+
docs: {
|
|
142
|
+
description: {
|
|
143
|
+
story:
|
|
144
|
+
'Existing field states come from the shared Input theme. Stepper buttons use color, border and size token maps without changing increment, decrement or boundary behavior.',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const TokenOverrides: Story = {
|
|
151
|
+
...Main,
|
|
152
|
+
render: (args) => (
|
|
153
|
+
<div
|
|
154
|
+
style={
|
|
155
|
+
{
|
|
156
|
+
'--rc-color-surface-sunken': '#dcf4fc',
|
|
157
|
+
'--rc-color-neutrals-200': '#b9e9fa',
|
|
158
|
+
'--rc-color-text-muted': '#6b747f',
|
|
159
|
+
} as CSSProperties
|
|
160
|
+
}
|
|
161
|
+
>
|
|
162
|
+
<NumberStepperDemo {...args} />
|
|
163
|
+
</div>
|
|
164
|
+
),
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export const ConsumerOverrides: Story = {
|
|
168
|
+
...Main,
|
|
169
|
+
render: (args) => (
|
|
170
|
+
<Box sx={{ '& .custom-quantity input': { fontSize: '21px' } }}>
|
|
171
|
+
<NumberStepperDemo {...args} />
|
|
172
|
+
</Box>
|
|
173
|
+
),
|
|
174
|
+
args: {
|
|
175
|
+
...Main.args,
|
|
176
|
+
slotProps: { wrapper: { className: 'custom-quantity' } },
|
|
177
|
+
},
|
|
178
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Box, Stack } from '@mui/material'
|
|
1
2
|
import { Meta } from '@storybook/react-vite'
|
|
3
|
+
import type { CSSProperties } from 'react'
|
|
2
4
|
import { useForm } from 'react-hook-form'
|
|
3
5
|
|
|
4
6
|
import RcSesPhoneInput from '@/components/form/inputs/PhoneInput'
|
|
@@ -109,3 +111,43 @@ export const Main = {
|
|
|
109
111
|
label: 'Phone number',
|
|
110
112
|
},
|
|
111
113
|
}
|
|
114
|
+
|
|
115
|
+
function TokenExamples({ overrides = false }: { overrides?: boolean }) {
|
|
116
|
+
const { control } = useForm({
|
|
117
|
+
defaultValues: {
|
|
118
|
+
empty: '',
|
|
119
|
+
filled: '+37061234567',
|
|
120
|
+
},
|
|
121
|
+
})
|
|
122
|
+
return (
|
|
123
|
+
<Box
|
|
124
|
+
style={
|
|
125
|
+
overrides
|
|
126
|
+
? ({
|
|
127
|
+
'--rc-color-text-default': '#542d16',
|
|
128
|
+
'--rc-color-border-default': '#a56835',
|
|
129
|
+
'--rc-color-border-focus': '#8b4513',
|
|
130
|
+
'--rc-color-surface-base': '#fffaf0',
|
|
131
|
+
'--rc-radius-input': '12px',
|
|
132
|
+
} as CSSProperties)
|
|
133
|
+
: undefined
|
|
134
|
+
}
|
|
135
|
+
>
|
|
136
|
+
<Stack sx={{ width: '100%', maxWidth: '360px' }} spacing={2}>
|
|
137
|
+
{(['empty', 'filled'] as const).map((name) => (
|
|
138
|
+
<RcSesPhoneInput
|
|
139
|
+
key={name}
|
|
140
|
+
id={`phone-token-${name}`}
|
|
141
|
+
name={name}
|
|
142
|
+
control={control}
|
|
143
|
+
label={`Phone / ${name}`}
|
|
144
|
+
slotProps={{ wrapper: { labelOnTop: true } }}
|
|
145
|
+
/>
|
|
146
|
+
))}
|
|
147
|
+
</Stack>
|
|
148
|
+
</Box>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const TokenBindings = { render: () => <TokenExamples /> }
|
|
153
|
+
export const TokenOverrides = { render: () => <TokenExamples overrides /> }
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
FormControl,
|
|
4
|
+
FormControlLabel,
|
|
5
|
+
Radio,
|
|
6
|
+
RadioGroup,
|
|
7
|
+
Stack,
|
|
8
|
+
Typography,
|
|
9
|
+
} from '@mui/material'
|
|
10
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
11
|
+
|
|
12
|
+
import RcSesRadioMark from '@/components/common/RadioMark'
|
|
13
|
+
|
|
14
|
+
const types = ['unselected', 'selected'] as const
|
|
15
|
+
const meta: Meta<typeof RcSesRadioMark> = {
|
|
16
|
+
title: 'Atoms/RadioMark',
|
|
17
|
+
component: RcSesRadioMark,
|
|
18
|
+
tags: ['autodocs'],
|
|
19
|
+
parameters: {
|
|
20
|
+
docs: {
|
|
21
|
+
description: {
|
|
22
|
+
component:
|
|
23
|
+
'Independent decorative 24px Radio-mark. The consuming radio supplies input semantics, labeling, hover, focus and error states. Radio-mark does not depend on Checkbox-mark.',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
argTypes: { type: { control: 'select', options: types } },
|
|
28
|
+
}
|
|
29
|
+
export default meta
|
|
30
|
+
type Story = StoryObj<typeof RcSesRadioMark>
|
|
31
|
+
|
|
32
|
+
export const Main: Story = { args: { type: 'unselected', disabled: false } }
|
|
33
|
+
|
|
34
|
+
export const AllStates: Story = {
|
|
35
|
+
render: () => (
|
|
36
|
+
<Stack spacing={3}>
|
|
37
|
+
{[false, true].map((disabled) => (
|
|
38
|
+
<Stack key={String(disabled)} direction='row' spacing={4}>
|
|
39
|
+
{types.map((type) => (
|
|
40
|
+
<Stack key={type} spacing={1} sx={{ alignItems: 'center' }}>
|
|
41
|
+
<RcSesRadioMark type={type} disabled={disabled} />
|
|
42
|
+
<Typography variant='caption'>
|
|
43
|
+
{type}
|
|
44
|
+
{disabled ? ' / disabled' : ''}
|
|
45
|
+
</Typography>
|
|
46
|
+
</Stack>
|
|
47
|
+
))}
|
|
48
|
+
</Stack>
|
|
49
|
+
))}
|
|
50
|
+
</Stack>
|
|
51
|
+
),
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const TokenOverrides: Story = {
|
|
55
|
+
render: () => (
|
|
56
|
+
<Box
|
|
57
|
+
sx={{
|
|
58
|
+
'--rc-color-control-selected': '#654321',
|
|
59
|
+
'--rc-color-control-border': '#654321',
|
|
60
|
+
'--rc-icon-size-control': '22px',
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
<RcSesRadioMark /> <RcSesRadioMark type='selected' />
|
|
64
|
+
</Box>
|
|
65
|
+
),
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const NativeControls: Story = {
|
|
69
|
+
render: () => (
|
|
70
|
+
<RadioGroup defaultValue='first' aria-label='Shared radio marks'>
|
|
71
|
+
<FormControlLabel control={<Radio />} value='first' label='First radio' />
|
|
72
|
+
<FormControlLabel control={<Radio />} value='second' label='Second radio' />
|
|
73
|
+
<FormControlLabel
|
|
74
|
+
disabled
|
|
75
|
+
control={<Radio />}
|
|
76
|
+
value='disabled'
|
|
77
|
+
label='Disabled radio'
|
|
78
|
+
/>
|
|
79
|
+
</RadioGroup>
|
|
80
|
+
),
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Interactive fixture: keyboard/pointer tests capture the resulting states. */
|
|
84
|
+
export const KeyboardAndPointer: Story = {
|
|
85
|
+
tags: ['no-snapshot'],
|
|
86
|
+
render: () => (
|
|
87
|
+
<Stack spacing={2}>
|
|
88
|
+
<FormControl>
|
|
89
|
+
<RadioGroup defaultValue='selected' aria-label='Radio interactions'>
|
|
90
|
+
<FormControlLabel control={<Radio />} value='selected' label='Selected radio' />
|
|
91
|
+
<FormControlLabel
|
|
92
|
+
control={<Radio />}
|
|
93
|
+
value='unselected'
|
|
94
|
+
label='Unselected radio'
|
|
95
|
+
/>
|
|
96
|
+
</RadioGroup>
|
|
97
|
+
</FormControl>
|
|
98
|
+
<FormControl error>
|
|
99
|
+
<RadioGroup
|
|
100
|
+
defaultValue='selected'
|
|
101
|
+
aria-label='Radio error interactions'
|
|
102
|
+
aria-invalid='true'
|
|
103
|
+
>
|
|
104
|
+
<FormControlLabel
|
|
105
|
+
control={<Radio />}
|
|
106
|
+
value='selected'
|
|
107
|
+
label='Selected error radio'
|
|
108
|
+
/>
|
|
109
|
+
<FormControlLabel
|
|
110
|
+
control={<Radio />}
|
|
111
|
+
value='unselected'
|
|
112
|
+
label='Unselected error radio'
|
|
113
|
+
/>
|
|
114
|
+
</RadioGroup>
|
|
115
|
+
</FormControl>
|
|
116
|
+
<FormControl disabled>
|
|
117
|
+
<RadioGroup defaultValue='selected' aria-label='Disabled radio interactions'>
|
|
118
|
+
<FormControlLabel
|
|
119
|
+
control={<Radio />}
|
|
120
|
+
value='selected'
|
|
121
|
+
label='Selected disabled radio'
|
|
122
|
+
/>
|
|
123
|
+
<FormControlLabel
|
|
124
|
+
control={<Radio />}
|
|
125
|
+
value='unselected'
|
|
126
|
+
label='Unselected disabled radio'
|
|
127
|
+
/>
|
|
128
|
+
</RadioGroup>
|
|
129
|
+
</FormControl>
|
|
130
|
+
</Stack>
|
|
131
|
+
),
|
|
132
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box, Typography } from '@mui/material'
|
|
2
2
|
import { Meta, StoryContext, StoryObj } from '@storybook/react-vite'
|
|
3
|
-
import { useForm } from 'react-hook-form'
|
|
3
|
+
import { useForm, useWatch } from 'react-hook-form'
|
|
4
4
|
|
|
5
5
|
import RcSesPhoneInput from '@/components/form/inputs/PhoneInput'
|
|
6
6
|
import RcSesSelect from '@/components/form/inputs/Select'
|
|
@@ -13,6 +13,14 @@ import SingleStepFormModel from '@/examples/SingleStepForm/types/SingleStepFormM
|
|
|
13
13
|
const meta: Meta<typeof RcSesSelect> = {
|
|
14
14
|
title: 'Atoms/Select',
|
|
15
15
|
component: RcSesSelect,
|
|
16
|
+
parameters: {
|
|
17
|
+
docs: {
|
|
18
|
+
description: {
|
|
19
|
+
component:
|
|
20
|
+
'RcSesSelect uses DS tokens and supports text display with limitTags, search and selectAll for multi-select fields.',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
16
24
|
argTypes: {
|
|
17
25
|
disabled: {
|
|
18
26
|
control: {
|
|
@@ -237,6 +245,135 @@ export const Main: Story = {
|
|
|
237
245
|
},
|
|
238
246
|
}
|
|
239
247
|
|
|
248
|
+
function SelectTokenPreview({ customized = false }: { customized?: boolean }) {
|
|
249
|
+
const { control } = useForm<{
|
|
250
|
+
single: string | null
|
|
251
|
+
multiple: string[]
|
|
252
|
+
grouped: string[]
|
|
253
|
+
invalid: string | null
|
|
254
|
+
disabled: string | null
|
|
255
|
+
loading: string | null
|
|
256
|
+
}>({
|
|
257
|
+
defaultValues: {
|
|
258
|
+
single: null,
|
|
259
|
+
multiple: ['first', 'second'],
|
|
260
|
+
grouped: [],
|
|
261
|
+
invalid: null,
|
|
262
|
+
disabled: 'first',
|
|
263
|
+
loading: null,
|
|
264
|
+
},
|
|
265
|
+
})
|
|
266
|
+
const values = useWatch({ control })
|
|
267
|
+
const options = [
|
|
268
|
+
{ value: 'first', label: 'First option', description: 'Option description' },
|
|
269
|
+
{ value: 'second', label: 'Second option' },
|
|
270
|
+
{ value: 'third', label: 'Third option' },
|
|
271
|
+
]
|
|
272
|
+
return (
|
|
273
|
+
<Box sx={{ width: '26.75rem', maxWidth: '100%', p: 2 }}>
|
|
274
|
+
<RcSesSelect
|
|
275
|
+
id='tokens-single'
|
|
276
|
+
name='single'
|
|
277
|
+
label='Single'
|
|
278
|
+
control={control}
|
|
279
|
+
options={options}
|
|
280
|
+
slotProps={{
|
|
281
|
+
wrapper: { labelOnTop: true, description: 'Field description' },
|
|
282
|
+
field: customized
|
|
283
|
+
? {
|
|
284
|
+
sx: {
|
|
285
|
+
'& .MuiOutlinedInput-root': {
|
|
286
|
+
borderRadius: '3px',
|
|
287
|
+
bgcolor: 'rebeccapurple',
|
|
288
|
+
'& .MuiOutlinedInput-notchedOutline': { borderColor: 'purple' },
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
slotProps: {
|
|
292
|
+
paper: {
|
|
293
|
+
sx: { bgcolor: 'lavender', boxShadow: 'none', borderRadius: '3px' },
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
}
|
|
297
|
+
: undefined,
|
|
298
|
+
}}
|
|
299
|
+
/>
|
|
300
|
+
<RcSesSelect
|
|
301
|
+
id='tokens-multiple'
|
|
302
|
+
name='multiple'
|
|
303
|
+
label='Multiple'
|
|
304
|
+
control={control}
|
|
305
|
+
options={options}
|
|
306
|
+
multiple
|
|
307
|
+
limitTags={1}
|
|
308
|
+
slotProps={{ wrapper: { labelOnTop: true } }}
|
|
309
|
+
/>
|
|
310
|
+
<RcSesSelect
|
|
311
|
+
id='tokens-grouped'
|
|
312
|
+
name='grouped'
|
|
313
|
+
label='Grouped'
|
|
314
|
+
control={control}
|
|
315
|
+
options={options}
|
|
316
|
+
multiple
|
|
317
|
+
dropdownSearch
|
|
318
|
+
selectAll
|
|
319
|
+
slotProps={{
|
|
320
|
+
wrapper: { labelOnTop: true },
|
|
321
|
+
field: {
|
|
322
|
+
groupBy: (option) => (option.value === 'third' ? 'Group B' : 'Group A'),
|
|
323
|
+
},
|
|
324
|
+
}}
|
|
325
|
+
/>
|
|
326
|
+
<RcSesSelect
|
|
327
|
+
id='tokens-invalid'
|
|
328
|
+
name='invalid'
|
|
329
|
+
label='Error'
|
|
330
|
+
control={control}
|
|
331
|
+
options={options}
|
|
332
|
+
errors={{ type: 'manual', message: 'Invalid selection' }}
|
|
333
|
+
slotProps={{ wrapper: { labelOnTop: true } }}
|
|
334
|
+
/>
|
|
335
|
+
<RcSesSelect
|
|
336
|
+
id='tokens-disabled'
|
|
337
|
+
name='disabled'
|
|
338
|
+
label='Disabled'
|
|
339
|
+
control={control}
|
|
340
|
+
options={options}
|
|
341
|
+
disabled
|
|
342
|
+
slotProps={{ wrapper: { labelOnTop: true } }}
|
|
343
|
+
/>
|
|
344
|
+
<RcSesSelect
|
|
345
|
+
id='tokens-loading'
|
|
346
|
+
name='loading'
|
|
347
|
+
label='Loading'
|
|
348
|
+
control={control}
|
|
349
|
+
options={[]}
|
|
350
|
+
loading
|
|
351
|
+
slotProps={{ wrapper: { labelOnTop: true } }}
|
|
352
|
+
/>
|
|
353
|
+
<Box
|
|
354
|
+
component='pre'
|
|
355
|
+
data-testid='select-values'
|
|
356
|
+
sx={{ whiteSpace: 'pre-wrap', fontSize: '.75rem' }}
|
|
357
|
+
>
|
|
358
|
+
{JSON.stringify(values)}
|
|
359
|
+
</Box>
|
|
360
|
+
</Box>
|
|
361
|
+
)
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export const TokenBindings: Story = { render: () => <SelectTokenPreview /> }
|
|
365
|
+
export const TokenOverrides: Story = {
|
|
366
|
+
parameters: {
|
|
367
|
+
docs: {
|
|
368
|
+
description: {
|
|
369
|
+
story:
|
|
370
|
+
'Consumer `slotProps.field.sx` and paper `sx` overrides on the Single field take priority over token styles. The purple colors exist only for this check.',
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
render: () => <SelectTokenPreview customized />,
|
|
375
|
+
}
|
|
376
|
+
|
|
240
377
|
interface VariantsFormModel {
|
|
241
378
|
singleSelect: string | null
|
|
242
379
|
groupedSelect: string | null
|
|
@@ -463,7 +600,7 @@ export const AllVariants: Story = {
|
|
|
463
600
|
|
|
464
601
|
<VariantCard
|
|
465
602
|
title='Multi select + limit tags'
|
|
466
|
-
description='Daugybinis pasirinkimas su limitTags={1},
|
|
603
|
+
description='Daugybinis pasirinkimas su limitTags={1}, rodomas kaip tekstas su "ir dar N" indikatoriu.'
|
|
467
604
|
>
|
|
468
605
|
<RcSesSelect
|
|
469
606
|
id='limited-multi-select'
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { FormControl, FormControlLabel, Stack } from '@mui/material'
|
|
2
|
+
import { ThemeProvider, createTheme } from '@mui/material/styles'
|
|
1
3
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
4
|
import { useState } from 'react'
|
|
3
5
|
|
|
4
6
|
import SimpleCheckbox from '@/components/form/inputs/SimpleCheckbox'
|
|
7
|
+
import theme from '@/theme/light'
|
|
5
8
|
|
|
6
9
|
const meta = {
|
|
7
10
|
title: 'Atoms/SimpleCheckbox',
|
|
@@ -50,3 +53,74 @@ export const Loading: Story = {
|
|
|
50
53
|
},
|
|
51
54
|
},
|
|
52
55
|
}
|
|
56
|
+
|
|
57
|
+
export const TokenBindings: Story = {
|
|
58
|
+
render: () => (
|
|
59
|
+
<Stack spacing={2}>
|
|
60
|
+
<FormControlLabel control={<SimpleCheckbox />} label='Unchecked checkbox' />
|
|
61
|
+
<FormControlLabel
|
|
62
|
+
control={<SimpleCheckbox defaultChecked />}
|
|
63
|
+
label='Checked checkbox'
|
|
64
|
+
/>
|
|
65
|
+
<FormControlLabel
|
|
66
|
+
control={<SimpleCheckbox indeterminate />}
|
|
67
|
+
label='Indeterminate checkbox'
|
|
68
|
+
/>
|
|
69
|
+
<FormControlLabel
|
|
70
|
+
control={<SimpleCheckbox disabled />}
|
|
71
|
+
label='Disabled unchecked checkbox'
|
|
72
|
+
/>
|
|
73
|
+
<FormControlLabel
|
|
74
|
+
control={<SimpleCheckbox disabled defaultChecked />}
|
|
75
|
+
label='Disabled checked checkbox'
|
|
76
|
+
/>
|
|
77
|
+
<FormControlLabel
|
|
78
|
+
control={<SimpleCheckbox disabled indeterminate />}
|
|
79
|
+
label='Disabled indeterminate checkbox'
|
|
80
|
+
/>
|
|
81
|
+
<FormControl error>
|
|
82
|
+
<FormControlLabel
|
|
83
|
+
sx={{ ml: 0 }}
|
|
84
|
+
control={<SimpleCheckbox />}
|
|
85
|
+
label='Error checkbox'
|
|
86
|
+
/>
|
|
87
|
+
</FormControl>
|
|
88
|
+
<FormControlLabel control={<SimpleCheckbox loading />} label='Loading checkbox' />
|
|
89
|
+
</Stack>
|
|
90
|
+
),
|
|
91
|
+
parameters: {
|
|
92
|
+
docs: {
|
|
93
|
+
description: {
|
|
94
|
+
story:
|
|
95
|
+
'Shared Checkbox-mark uses a 24px frame and 20px shape. Hover and error halos belong to the consuming control, while selection and loading behavior are preserved.',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const TokenOverrides: Story = {
|
|
102
|
+
render: () => (
|
|
103
|
+
<Stack spacing={2}>
|
|
104
|
+
<FormControlLabel
|
|
105
|
+
label='Custom checkbox styles'
|
|
106
|
+
control={
|
|
107
|
+
<SimpleCheckbox
|
|
108
|
+
defaultChecked
|
|
109
|
+
sx={{
|
|
110
|
+
'&.Mui-checked': { color: '#0a141e' },
|
|
111
|
+
'&.Mui-focusVisible [data-rc-mark-shape]': { boxShadow: 'none' },
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
}
|
|
115
|
+
/>
|
|
116
|
+
<ThemeProvider
|
|
117
|
+
theme={createTheme(theme, { palette: { secondary: { main: '#4d5863' } } })}
|
|
118
|
+
>
|
|
119
|
+
<FormControlLabel
|
|
120
|
+
label='Custom palette checkbox'
|
|
121
|
+
control={<SimpleCheckbox color='secondary' defaultChecked />}
|
|
122
|
+
/>
|
|
123
|
+
</ThemeProvider>
|
|
124
|
+
</Stack>
|
|
125
|
+
),
|
|
126
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Stack } from '@mui/material'
|
|
1
2
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
-
import { useState } from 'react'
|
|
3
|
+
import { CSSProperties, useState } from 'react'
|
|
3
4
|
|
|
4
5
|
import RcSesSwitch from '@/components/common/Switch'
|
|
5
6
|
|
|
@@ -68,3 +69,47 @@ export const LongLabel: Story = {
|
|
|
68
69
|
</div>
|
|
69
70
|
),
|
|
70
71
|
}
|
|
72
|
+
|
|
73
|
+
export const TokenBindings: Story = {
|
|
74
|
+
args: { label: 'Notifications' },
|
|
75
|
+
render: () => (
|
|
76
|
+
<Stack spacing={2}>
|
|
77
|
+
<ControlledDemo label='Unchecked switch' />
|
|
78
|
+
<ControlledDemo label='Checked switch' initialChecked />
|
|
79
|
+
<ControlledDemo label='Disabled unchecked switch' disabled />
|
|
80
|
+
<ControlledDemo label='Disabled checked switch' initialChecked disabled />
|
|
81
|
+
</Stack>
|
|
82
|
+
),
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const TokenOverrides: Story = {
|
|
86
|
+
...TokenBindings,
|
|
87
|
+
render: () => (
|
|
88
|
+
<div
|
|
89
|
+
style={
|
|
90
|
+
{
|
|
91
|
+
'--rc-color-control-selected': '#008561',
|
|
92
|
+
'--rc-color-control-selected-hover': '#00664e',
|
|
93
|
+
} as CSSProperties
|
|
94
|
+
}
|
|
95
|
+
>
|
|
96
|
+
<ControlledDemo initialChecked />
|
|
97
|
+
</div>
|
|
98
|
+
),
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const ConsumerOverrides: Story = {
|
|
102
|
+
args: { label: 'Custom switch' },
|
|
103
|
+
render: () => (
|
|
104
|
+
<RcSesSwitch
|
|
105
|
+
label='Custom switch'
|
|
106
|
+
defaultChecked
|
|
107
|
+
sx={{
|
|
108
|
+
'& .MuiSwitch-track': { backgroundColor: '#008561' },
|
|
109
|
+
'& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track': {
|
|
110
|
+
backgroundColor: '#008561',
|
|
111
|
+
},
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
),
|
|
115
|
+
}
|