@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,21 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Autocomplete,
|
|
3
|
+
Box,
|
|
4
|
+
Button,
|
|
5
|
+
InputAdornment,
|
|
6
|
+
Stack,
|
|
7
|
+
TextField,
|
|
8
|
+
ThemeProvider,
|
|
9
|
+
Typography,
|
|
10
|
+
} from '@mui/material'
|
|
11
|
+
import { Info, MagnifyingGlass } from '@phosphor-icons/react'
|
|
1
12
|
import { Meta, StoryContext, StoryObj } from '@storybook/react-vite'
|
|
13
|
+
import { useState } from 'react'
|
|
14
|
+
import { useForm } from 'react-hook-form'
|
|
2
15
|
|
|
16
|
+
import { EnvelopeSimpleIcon } from '@/assets/icons/phosphorIcons'
|
|
3
17
|
import RcSesTextField from '@/components/form/inputs/TextField'
|
|
18
|
+
import RcSesLoadingSpinner from '@/components/loaders/LoadingSpinner'
|
|
4
19
|
import FieldPreviewRow from '@/components/storybook/FieldPreviewRow'
|
|
5
20
|
import FieldView from '@/components/storybook/FieldView'
|
|
6
21
|
import Fields from '@/components/storybook/Fields'
|
|
7
22
|
import PreviewTitle from '@/components/storybook/PreviewTitle'
|
|
23
|
+
import theme from '@/theme/light'
|
|
24
|
+
import { createRcSesTokenTheme } from '@/theme/tokenTheme'
|
|
8
25
|
|
|
9
26
|
const meta: Meta<typeof RcSesTextField> = {
|
|
10
27
|
title: 'Atoms/TextField',
|
|
11
28
|
component: RcSesTextField,
|
|
12
29
|
tags: ['autodocs'],
|
|
30
|
+
parameters: {
|
|
31
|
+
docs: {
|
|
32
|
+
description: {
|
|
33
|
+
component:
|
|
34
|
+
'Field presets use RcSesFormControlWrapper for labels, required markers and supporting text. The default side label from sm up is retained; set slotProps.wrapper.labelOnTop for a top label. The unified Input v2 label anatomy is deferred to the shared-wrapper follow-up.',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
13
38
|
}
|
|
14
39
|
|
|
15
40
|
export default meta
|
|
16
41
|
|
|
17
42
|
type Story = StoryObj<typeof RcSesTextField>
|
|
18
43
|
|
|
44
|
+
const tokenTheme = createRcSesTokenTheme()
|
|
45
|
+
|
|
46
|
+
// Raw MUI inputs prove the shared styles do not depend on RcSesTextField sx.
|
|
47
|
+
export const SharedInputStates: Story = {
|
|
48
|
+
tags: ['no-snapshot'],
|
|
49
|
+
render: () => (
|
|
50
|
+
<Stack spacing={3}>
|
|
51
|
+
{(
|
|
52
|
+
[
|
|
53
|
+
['legacy', theme],
|
|
54
|
+
['tokens', tokenTheme],
|
|
55
|
+
] as const
|
|
56
|
+
).map(([name, activeTheme]) => (
|
|
57
|
+
<ThemeProvider key={name} theme={activeTheme}>
|
|
58
|
+
<TextField label={`${name} rest`} />
|
|
59
|
+
<TextField label={`${name} error`} error />
|
|
60
|
+
<TextField label={`${name} disabled`} disabled />
|
|
61
|
+
<Autocomplete
|
|
62
|
+
options={['Pirmas', 'Antras']}
|
|
63
|
+
renderInput={(params) => (
|
|
64
|
+
<TextField {...params} label={`${name} autocomplete`} />
|
|
65
|
+
)}
|
|
66
|
+
/>
|
|
67
|
+
</ThemeProvider>
|
|
68
|
+
))}
|
|
69
|
+
</Stack>
|
|
70
|
+
),
|
|
71
|
+
}
|
|
72
|
+
|
|
19
73
|
const codeBlock = (args: any) => {
|
|
20
74
|
const { slotProps, disabled, label } = args
|
|
21
75
|
return `
|
|
@@ -75,3 +129,457 @@ export const Main: Story = {
|
|
|
75
129
|
},
|
|
76
130
|
},
|
|
77
131
|
}
|
|
132
|
+
|
|
133
|
+
export const TokenStates: Story = {
|
|
134
|
+
render: () => (
|
|
135
|
+
<Stack spacing={3} sx={{ maxWidth: 600 }}>
|
|
136
|
+
<RcSesTextField
|
|
137
|
+
label='Tuščias laukas'
|
|
138
|
+
slotProps={{
|
|
139
|
+
wrapper: { labelOnTop: true, description: 'Pagalbinis tekstas' },
|
|
140
|
+
field: { placeholder: 'Tekstas' },
|
|
141
|
+
}}
|
|
142
|
+
/>
|
|
143
|
+
<RcSesTextField
|
|
144
|
+
label='Užpildytas laukas'
|
|
145
|
+
slotProps={{
|
|
146
|
+
wrapper: { labelOnTop: true },
|
|
147
|
+
field: { defaultValue: 'Įvesta reikšmė' },
|
|
148
|
+
}}
|
|
149
|
+
/>
|
|
150
|
+
<RcSesTextField
|
|
151
|
+
label='Išjungtas laukas'
|
|
152
|
+
disabled
|
|
153
|
+
slotProps={{
|
|
154
|
+
wrapper: { labelOnTop: true, description: 'Pagalbinis tekstas' },
|
|
155
|
+
field: { placeholder: 'Tekstas' },
|
|
156
|
+
}}
|
|
157
|
+
/>
|
|
158
|
+
<RcSesTextField
|
|
159
|
+
label='Klaida ir error hover'
|
|
160
|
+
errors={{ type: 'required', message: 'Įveskite reikšmę' }}
|
|
161
|
+
slotProps={{
|
|
162
|
+
wrapper: { labelOnTop: true },
|
|
163
|
+
field: { placeholder: 'Užveskite pelę arba sufokusuokite' },
|
|
164
|
+
}}
|
|
165
|
+
/>
|
|
166
|
+
<RcSesTextField
|
|
167
|
+
label='Išjungtas laukas su klaida'
|
|
168
|
+
disabled
|
|
169
|
+
errors={{ type: 'required', message: 'Įveskite reikšmę' }}
|
|
170
|
+
slotProps={{ wrapper: { labelOnTop: true }, field: { placeholder: 'Tekstas' } }}
|
|
171
|
+
/>
|
|
172
|
+
<RcSesTextField
|
|
173
|
+
label='Tik skaitymui'
|
|
174
|
+
slotProps={{
|
|
175
|
+
wrapper: { labelOnTop: true },
|
|
176
|
+
field: {
|
|
177
|
+
defaultValue: 'Tik skaitymui',
|
|
178
|
+
slotProps: { input: { readOnly: true } },
|
|
179
|
+
},
|
|
180
|
+
}}
|
|
181
|
+
/>
|
|
182
|
+
</Stack>
|
|
183
|
+
),
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export const Adornments: Story = {
|
|
187
|
+
render: () => (
|
|
188
|
+
<Stack spacing={3} sx={{ maxWidth: 600 }}>
|
|
189
|
+
<RcSesTextField
|
|
190
|
+
label='Paieška'
|
|
191
|
+
slotProps={{
|
|
192
|
+
wrapper: { labelOnTop: true },
|
|
193
|
+
field: {
|
|
194
|
+
placeholder: 'Ieškoti paslaugų',
|
|
195
|
+
slotProps: {
|
|
196
|
+
input: {
|
|
197
|
+
startAdornment: (
|
|
198
|
+
<InputAdornment position='start'>
|
|
199
|
+
<MagnifyingGlass aria-hidden />
|
|
200
|
+
</InputAdornment>
|
|
201
|
+
),
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
}}
|
|
206
|
+
/>
|
|
207
|
+
<RcSesTextField
|
|
208
|
+
label='Telefonas'
|
|
209
|
+
slotProps={{
|
|
210
|
+
wrapper: { labelOnTop: true },
|
|
211
|
+
field: {
|
|
212
|
+
type: 'tel',
|
|
213
|
+
placeholder: '600 00000',
|
|
214
|
+
slotProps: {
|
|
215
|
+
input: {
|
|
216
|
+
startAdornment: <InputAdornment position='start'>+370</InputAdornment>,
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
}}
|
|
221
|
+
/>
|
|
222
|
+
<RcSesTextField
|
|
223
|
+
label='Suma'
|
|
224
|
+
slotProps={{
|
|
225
|
+
wrapper: { labelOnTop: true },
|
|
226
|
+
field: {
|
|
227
|
+
placeholder: '12,00',
|
|
228
|
+
slotProps: {
|
|
229
|
+
input: { endAdornment: <InputAdornment position='end'>€</InputAdornment> },
|
|
230
|
+
htmlInput: { inputMode: 'decimal' },
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
}}
|
|
234
|
+
/>
|
|
235
|
+
<RcSesTextField
|
|
236
|
+
label='Leading / trailing'
|
|
237
|
+
slotProps={{
|
|
238
|
+
wrapper: { labelOnTop: true },
|
|
239
|
+
field: {
|
|
240
|
+
placeholder: 'Tekstas su ikonomis',
|
|
241
|
+
slotProps: {
|
|
242
|
+
input: {
|
|
243
|
+
startAdornment: (
|
|
244
|
+
<InputAdornment position='start'>
|
|
245
|
+
<MagnifyingGlass aria-hidden />
|
|
246
|
+
</InputAdornment>
|
|
247
|
+
),
|
|
248
|
+
endAdornment: (
|
|
249
|
+
<InputAdornment position='end'>
|
|
250
|
+
<Info aria-hidden />
|
|
251
|
+
</InputAdornment>
|
|
252
|
+
),
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
}}
|
|
257
|
+
/>
|
|
258
|
+
</Stack>
|
|
259
|
+
),
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export const Multiline: Story = {
|
|
263
|
+
args: {
|
|
264
|
+
label: 'Suteikiamų teisių aprašymas',
|
|
265
|
+
multiline: true,
|
|
266
|
+
slotProps: {
|
|
267
|
+
wrapper: { labelOnTop: true, description: 'Pagalbinis tekstas' },
|
|
268
|
+
field: {
|
|
269
|
+
rows: 4,
|
|
270
|
+
placeholder: 'Pvz., atstovauti VMI, pateikti prašymus ir gauti dokumentus',
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export const InputStyleOverrides: Story = {
|
|
277
|
+
render: () => (
|
|
278
|
+
<Stack spacing={3} sx={{ maxWidth: 600 }}>
|
|
279
|
+
<RcSesTextField
|
|
280
|
+
label='Custom input'
|
|
281
|
+
slotProps={{
|
|
282
|
+
wrapper: { labelOnTop: true },
|
|
283
|
+
field: {
|
|
284
|
+
slotProps: {
|
|
285
|
+
input: {
|
|
286
|
+
sx: { '& .MuiInputBase-input': { fontSize: '20px', padding: '4px 8px' } },
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
}}
|
|
291
|
+
/>
|
|
292
|
+
<RcSesTextField
|
|
293
|
+
label='Callback input'
|
|
294
|
+
slotProps={{
|
|
295
|
+
wrapper: { labelOnTop: true },
|
|
296
|
+
field: {
|
|
297
|
+
slotProps: {
|
|
298
|
+
input: () => ({
|
|
299
|
+
sx: [
|
|
300
|
+
{ '& .MuiInputBase-input': { fontSize: '18px' } },
|
|
301
|
+
(activeTheme) => ({
|
|
302
|
+
'& .MuiInputBase-input': {
|
|
303
|
+
fontSize: '24px',
|
|
304
|
+
padding: activeTheme.spacing(1),
|
|
305
|
+
},
|
|
306
|
+
}),
|
|
307
|
+
],
|
|
308
|
+
}),
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
}}
|
|
312
|
+
/>
|
|
313
|
+
</Stack>
|
|
314
|
+
),
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export const Loading: Story = {
|
|
318
|
+
render: () => (
|
|
319
|
+
<Stack spacing={3} sx={{ maxWidth: 600 }}>
|
|
320
|
+
{(['small', 'large'] as const).map((size) => (
|
|
321
|
+
<div key={size} role='group' aria-label={`Loading ${size}`}>
|
|
322
|
+
<RcSesTextField
|
|
323
|
+
label={`Kraunama (${size})`}
|
|
324
|
+
slotProps={{
|
|
325
|
+
wrapper: { labelOnTop: true },
|
|
326
|
+
field: {
|
|
327
|
+
placeholder: 'Ieškoma…',
|
|
328
|
+
slotProps: {
|
|
329
|
+
htmlInput: { 'aria-busy': true },
|
|
330
|
+
input: {
|
|
331
|
+
endAdornment: (
|
|
332
|
+
<InputAdornment position='end'>
|
|
333
|
+
<RcSesLoadingSpinner size={size} />
|
|
334
|
+
</InputAdornment>
|
|
335
|
+
),
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
}}
|
|
340
|
+
/>
|
|
341
|
+
</div>
|
|
342
|
+
))}
|
|
343
|
+
</Stack>
|
|
344
|
+
),
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
const inputArgs: Story['args'] = {
|
|
348
|
+
label: 'Antraštė',
|
|
349
|
+
required: true,
|
|
350
|
+
placeholder: 'Tekstas',
|
|
351
|
+
helperText: 'Pagalbinis tekstas',
|
|
352
|
+
explainer: 'Papildomas lauko paaiškinimas.',
|
|
353
|
+
}
|
|
354
|
+
const inputDecorators: Story['decorators'] = [
|
|
355
|
+
(InputStory) => (
|
|
356
|
+
<Box sx={{ width: 560, maxWidth: '100%' }}>
|
|
357
|
+
<InputStory />
|
|
358
|
+
</Box>
|
|
359
|
+
),
|
|
360
|
+
]
|
|
361
|
+
|
|
362
|
+
export const Input: Story = { args: inputArgs, decorators: inputDecorators }
|
|
363
|
+
export const Error: Story = {
|
|
364
|
+
args: { ...inputArgs, errorText: 'Įveskite reikšmę' },
|
|
365
|
+
decorators: inputDecorators,
|
|
366
|
+
}
|
|
367
|
+
export const ReadOnly: Story = {
|
|
368
|
+
args: { ...inputArgs, readOnly: true, defaultValue: 'Galima pažymėti ir kopijuoti' },
|
|
369
|
+
decorators: inputDecorators,
|
|
370
|
+
}
|
|
371
|
+
export const Disabled: Story = {
|
|
372
|
+
args: { ...inputArgs, disabled: true, defaultValue: 'Tekstas' },
|
|
373
|
+
decorators: inputDecorators,
|
|
374
|
+
}
|
|
375
|
+
export const Optional: Story = {
|
|
376
|
+
args: { ...inputArgs, required: false },
|
|
377
|
+
decorators: inputDecorators,
|
|
378
|
+
}
|
|
379
|
+
export const LoadingState: Story = {
|
|
380
|
+
args: { ...inputArgs, loading: true },
|
|
381
|
+
decorators: inputDecorators,
|
|
382
|
+
}
|
|
383
|
+
export const Password: Story = {
|
|
384
|
+
args: {
|
|
385
|
+
...inputArgs,
|
|
386
|
+
preset: 'password',
|
|
387
|
+
label: 'Slaptažodis',
|
|
388
|
+
defaultValue: 'Slaptas123!',
|
|
389
|
+
},
|
|
390
|
+
decorators: inputDecorators,
|
|
391
|
+
}
|
|
392
|
+
export const Phone: Story = {
|
|
393
|
+
args: { ...inputArgs, preset: 'phone', label: 'Telefonas', defaultValue: '600 00000' },
|
|
394
|
+
decorators: inputDecorators,
|
|
395
|
+
}
|
|
396
|
+
export const Number: Story = {
|
|
397
|
+
args: {
|
|
398
|
+
...inputArgs,
|
|
399
|
+
preset: 'number',
|
|
400
|
+
label: 'Suma',
|
|
401
|
+
suffix: '€',
|
|
402
|
+
defaultValue: '12,00',
|
|
403
|
+
},
|
|
404
|
+
decorators: inputDecorators,
|
|
405
|
+
}
|
|
406
|
+
export const Search: Story = {
|
|
407
|
+
args: { ...inputArgs, preset: 'search', label: 'Paieška', defaultValue: 'Registrai' },
|
|
408
|
+
decorators: inputDecorators,
|
|
409
|
+
}
|
|
410
|
+
export const Presets: Story = {
|
|
411
|
+
decorators: inputDecorators,
|
|
412
|
+
render: () => (
|
|
413
|
+
<Stack spacing={3}>
|
|
414
|
+
<RcSesTextField
|
|
415
|
+
label='Vardas, pavardė'
|
|
416
|
+
required
|
|
417
|
+
defaultValue='Jonas Jonaitis'
|
|
418
|
+
helperText='Kaip nurodyta dokumentuose'
|
|
419
|
+
/>
|
|
420
|
+
<RcSesTextField
|
|
421
|
+
preset='search'
|
|
422
|
+
required
|
|
423
|
+
placeholder='Ieškoti paslaugų'
|
|
424
|
+
slotProps={{ htmlInput: { 'aria-label': 'Paieška' } }}
|
|
425
|
+
/>
|
|
426
|
+
<RcSesTextField
|
|
427
|
+
preset='password'
|
|
428
|
+
label='Slaptažodis'
|
|
429
|
+
required
|
|
430
|
+
defaultValue='Slaptas123!'
|
|
431
|
+
helperText='Mažiausiai 8 simboliai'
|
|
432
|
+
/>
|
|
433
|
+
<RcSesTextField
|
|
434
|
+
preset='phone'
|
|
435
|
+
label='Telefonas'
|
|
436
|
+
required
|
|
437
|
+
defaultValue='600 00000'
|
|
438
|
+
/>
|
|
439
|
+
<RcSesTextField
|
|
440
|
+
preset='number'
|
|
441
|
+
label='Suma'
|
|
442
|
+
required
|
|
443
|
+
suffix='€'
|
|
444
|
+
defaultValue='12,00'
|
|
445
|
+
/>
|
|
446
|
+
</Stack>
|
|
447
|
+
),
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export const PresetAdornments: Story = {
|
|
451
|
+
decorators: inputDecorators,
|
|
452
|
+
render: () => (
|
|
453
|
+
<Stack spacing={3}>
|
|
454
|
+
<RcSesTextField
|
|
455
|
+
label='El. paštas'
|
|
456
|
+
required
|
|
457
|
+
leading={<EnvelopeSimpleIcon size={20} aria-hidden />}
|
|
458
|
+
type='email'
|
|
459
|
+
/>
|
|
460
|
+
<RcSesTextField label='Svoris' preset='number' required suffix='kg' />
|
|
461
|
+
<RcSesTextField label='Kodas' required prefix='LT' />
|
|
462
|
+
<RcSesTextField
|
|
463
|
+
label='Ilga etiketė, kuri prireikus laužoma ir neturi būti nukirsta'
|
|
464
|
+
required
|
|
465
|
+
defaultValue={'Labai ilga įmonės pavadinimo reikšmė '.repeat(8)}
|
|
466
|
+
/>
|
|
467
|
+
</Stack>
|
|
468
|
+
),
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export const InputStates: Story = {
|
|
472
|
+
decorators: inputDecorators,
|
|
473
|
+
render: () => (
|
|
474
|
+
<Stack spacing={3}>
|
|
475
|
+
<RcSesTextField
|
|
476
|
+
label='Tuščias laukas'
|
|
477
|
+
required
|
|
478
|
+
placeholder='Tekstas'
|
|
479
|
+
helperText='Pagalbinis tekstas'
|
|
480
|
+
explainer='Lauko paaiškinimas'
|
|
481
|
+
/>
|
|
482
|
+
<RcSesTextField label='Užpildytas laukas' required defaultValue='Įvesta reikšmė' />
|
|
483
|
+
<RcSesTextField
|
|
484
|
+
label='Klaida'
|
|
485
|
+
required
|
|
486
|
+
errorText='Įveskite reikšmę'
|
|
487
|
+
helperText='Pagalbinis tekstas lieka matomas kartu su klaida'
|
|
488
|
+
/>
|
|
489
|
+
<RcSesTextField
|
|
490
|
+
label='Tik skaitymui'
|
|
491
|
+
readOnly
|
|
492
|
+
required
|
|
493
|
+
defaultValue='Galima fokusuoti ir kopijuoti'
|
|
494
|
+
/>
|
|
495
|
+
<RcSesTextField
|
|
496
|
+
label='Išjungtas laukas'
|
|
497
|
+
disabled
|
|
498
|
+
required
|
|
499
|
+
defaultValue='Tekstas'
|
|
500
|
+
helperText='Pagalbinis tekstas'
|
|
501
|
+
/>
|
|
502
|
+
<RcSesTextField label='Kraunama' loading required />
|
|
503
|
+
<RcSesTextField label='Papildomas laukas' />
|
|
504
|
+
</Stack>
|
|
505
|
+
),
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
function ControlledDemo() {
|
|
509
|
+
const [value, setValue] = useState('Registrai')
|
|
510
|
+
return (
|
|
511
|
+
<Stack spacing={2}>
|
|
512
|
+
<RcSesTextField
|
|
513
|
+
preset='search'
|
|
514
|
+
label='Paieška'
|
|
515
|
+
required
|
|
516
|
+
value={value}
|
|
517
|
+
onChange={(event) => setValue(event.target.value)}
|
|
518
|
+
/>
|
|
519
|
+
<Box component='output' aria-label='Reikšmė'>
|
|
520
|
+
{value || 'Tuščia'}
|
|
521
|
+
</Box>
|
|
522
|
+
<Button onClick={() => setValue('Atkurta')}>Atkurti</Button>
|
|
523
|
+
</Stack>
|
|
524
|
+
)
|
|
525
|
+
}
|
|
526
|
+
export const Controlled: Story = {
|
|
527
|
+
decorators: inputDecorators,
|
|
528
|
+
render: () => <ControlledDemo />,
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
function FormDemo() {
|
|
532
|
+
const {
|
|
533
|
+
register,
|
|
534
|
+
handleSubmit,
|
|
535
|
+
formState: { errors },
|
|
536
|
+
} = useForm({
|
|
537
|
+
defaultValues: { companyCode: '', companyName: '', address: '', search: '' },
|
|
538
|
+
mode: 'onSubmit',
|
|
539
|
+
reValidateMode: 'onSubmit',
|
|
540
|
+
})
|
|
541
|
+
const [submitted, setSubmitted] = useState(false)
|
|
542
|
+
return (
|
|
543
|
+
<Stack
|
|
544
|
+
component='form'
|
|
545
|
+
noValidate
|
|
546
|
+
spacing={2}
|
|
547
|
+
onSubmit={handleSubmit(() => setSubmitted(true))}
|
|
548
|
+
>
|
|
549
|
+
<Typography variant='body2'>Privalomi laukai pažymėti žvaigždute (*).</Typography>
|
|
550
|
+
<RcSesTextField
|
|
551
|
+
{...register('companyCode', { required: 'Įveskite įmonės kodą' })}
|
|
552
|
+
label='Įmonės kodas'
|
|
553
|
+
required
|
|
554
|
+
helperText='Įveskite įmonės kodą iš registro'
|
|
555
|
+
errorText={errors.companyCode?.message}
|
|
556
|
+
/>
|
|
557
|
+
<RcSesTextField
|
|
558
|
+
{...register('companyName', { required: 'Įveskite pavadinimą' })}
|
|
559
|
+
label='Pavadinimas'
|
|
560
|
+
required
|
|
561
|
+
errorText={errors.companyName?.message}
|
|
562
|
+
/>
|
|
563
|
+
<RcSesTextField {...register('address')} label='Buveinė' />
|
|
564
|
+
<RcSesTextField {...register('search')} preset='search' label='Papildoma paieška' />
|
|
565
|
+
<Button type='submit' variant='contained'>
|
|
566
|
+
Tęsti
|
|
567
|
+
</Button>
|
|
568
|
+
{submitted && <Box role='status'>Duomenys pateikti</Box>}
|
|
569
|
+
</Stack>
|
|
570
|
+
)
|
|
571
|
+
}
|
|
572
|
+
export const Form: Story = {
|
|
573
|
+
decorators: inputDecorators,
|
|
574
|
+
render: () => <FormDemo />,
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export const NativeReset: Story = {
|
|
578
|
+
decorators: inputDecorators,
|
|
579
|
+
render: () => (
|
|
580
|
+
<Stack component='form' spacing={2}>
|
|
581
|
+
<RcSesTextField preset='search' label='Paieška' required defaultValue='' />
|
|
582
|
+
<Button type='reset'>Išvalyti formą</Button>
|
|
583
|
+
</Stack>
|
|
584
|
+
),
|
|
585
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Button, Typography } from '@mui/material'
|
|
2
2
|
import type { Meta } from '@storybook/react-vite'
|
|
3
|
+
import { fireEvent, within } from 'storybook/test'
|
|
3
4
|
|
|
4
5
|
import RcSesTooltip from '@/components/common/Tooltip'
|
|
5
6
|
|
|
@@ -38,12 +39,16 @@ export const Default = {
|
|
|
38
39
|
title:
|
|
39
40
|
'Deklaruojant išvykimą iš Lietuvos nurodoma užsienio valstybė, į kurią išvykstama.',
|
|
40
41
|
},
|
|
42
|
+
tags: ['snapshot-fullpage'],
|
|
41
43
|
render: (args: any) => (
|
|
42
44
|
<Typography>
|
|
43
45
|
Išvykimo valstybė
|
|
44
46
|
<RcSesTooltip {...args} />
|
|
45
47
|
</Typography>
|
|
46
48
|
),
|
|
49
|
+
play: async ({ canvasElement }: { canvasElement: HTMLElement }) => {
|
|
50
|
+
fireEvent.click(within(canvasElement).getByRole('button'))
|
|
51
|
+
},
|
|
47
52
|
} as const
|
|
48
53
|
|
|
49
54
|
export const CustomTrigger = {
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Autocomplete,
|
|
3
|
+
Box,
|
|
4
|
+
Button,
|
|
5
|
+
Card,
|
|
6
|
+
Stack,
|
|
7
|
+
TextField,
|
|
8
|
+
ThemeProvider,
|
|
9
|
+
Typography,
|
|
10
|
+
} from '@mui/material'
|
|
11
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
12
|
+
|
|
13
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
14
|
+
import { createRcSesTokenTheme } from '@/theme/tokenTheme'
|
|
15
|
+
|
|
16
|
+
const tokenTheme = createRcSesTokenTheme()
|
|
17
|
+
const customTheme = createRcSesTokenTheme({
|
|
18
|
+
components: { MuiButton: { styleOverrides: { root: { borderRadius: '3px' } } } },
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const meta = {
|
|
22
|
+
title: 'Fixtures/Foundations/Borders',
|
|
23
|
+
tags: ['no-snapshot', '!dev'],
|
|
24
|
+
parameters: { layout: 'padded' },
|
|
25
|
+
} satisfies Meta
|
|
26
|
+
export default meta
|
|
27
|
+
type Story = StoryObj<typeof meta>
|
|
28
|
+
|
|
29
|
+
export const Radius: Story = {
|
|
30
|
+
parameters: {
|
|
31
|
+
docs: {
|
|
32
|
+
description: {
|
|
33
|
+
story:
|
|
34
|
+
'Input description specifies 6 px, but the Figma export alias points to 8 px. The exported reference is used; designer confirmation is still required.',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
render: () => (
|
|
39
|
+
<ThemeProvider theme={tokenTheme}>
|
|
40
|
+
<Stack spacing={2}>
|
|
41
|
+
<Typography variant='h2'>Radius primitives and aliases</Typography>
|
|
42
|
+
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 2 }}>
|
|
43
|
+
{Object.entries(borderTokens)
|
|
44
|
+
.filter(([name]) => name.startsWith('radius-'))
|
|
45
|
+
.map(([name, value]) => (
|
|
46
|
+
<Box
|
|
47
|
+
key={name}
|
|
48
|
+
data-testid={name}
|
|
49
|
+
sx={{ borderRadius: value, border: '1px solid', p: 2 }}
|
|
50
|
+
>
|
|
51
|
+
{name}
|
|
52
|
+
</Box>
|
|
53
|
+
))}
|
|
54
|
+
</Box>
|
|
55
|
+
<Box
|
|
56
|
+
data-testid='theme-radius'
|
|
57
|
+
sx={{ borderRadius: 2, border: '1px solid', p: 2 }}
|
|
58
|
+
>
|
|
59
|
+
theme.shape.borderRadius * 2
|
|
60
|
+
</Box>
|
|
61
|
+
<Card data-testid='theme-card' sx={{ p: 2 }}>
|
|
62
|
+
Card radius alias
|
|
63
|
+
</Card>
|
|
64
|
+
<Button data-testid='theme-button'>Button radius alias</Button>
|
|
65
|
+
<TextField data-testid='theme-input' label='Input radius alias' />
|
|
66
|
+
<Autocomplete
|
|
67
|
+
data-testid='theme-autocomplete'
|
|
68
|
+
options={['One', 'Two']}
|
|
69
|
+
renderInput={(params) => (
|
|
70
|
+
<TextField {...params} label='Autocomplete radius alias' />
|
|
71
|
+
)}
|
|
72
|
+
/>
|
|
73
|
+
<TextField
|
|
74
|
+
data-testid='theme-input-error'
|
|
75
|
+
label='Error input radius alias'
|
|
76
|
+
error
|
|
77
|
+
/>
|
|
78
|
+
<ThemeProvider theme={customTheme}>
|
|
79
|
+
<Button data-testid='custom-radius'>Consumer override: 3px</Button>
|
|
80
|
+
</ThemeProvider>
|
|
81
|
+
</Stack>
|
|
82
|
+
</ThemeProvider>
|
|
83
|
+
),
|
|
84
|
+
}
|