@registrucentras/rc-ses-react-components 1.6.3 → 1.6.5
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/IconProps.d.ts +2 -0
- package/dist/assets/icons/CheckIcon.d.ts +3 -0
- package/dist/assets/icons/PencilSimpleLineIcon.d.ts +3 -0
- package/dist/components/common/Card/index.d.ts +4 -1
- package/dist/components/form/inputs/Select/Select.types.d.ts +5 -0
- package/dist/components/form/inputs/Select/hooks/useFilteredOptions.d.ts +3 -0
- package/dist/components/form/inputs/Select/hooks/useSelectAllLogic.d.ts +7 -0
- package/dist/components/form/inputs/{Select.d.ts → Select/index.d.ts} +12 -12
- package/dist/library/icons.d.ts +2 -1
- package/dist/registrucentras-rc-ses-react-components.cjs +11 -11
- package/dist/registrucentras-rc-ses-react-components.js +3154 -2747
- package/dist/stories/assets/Logo.stories.d.ts +12 -0
- package/dist/stories/components/actions/ButtonWithPopover.stories.d.ts +7 -0
- package/dist/stories/components/display/Card.stories.d.ts +6 -47
- package/dist/stories/components/display/ImageCard.stories.d.ts +6 -6
- package/dist/stories/components/feedback/Alert.stories.d.ts +7 -16
- package/dist/stories/components/form/CardFormContainer.stories.d.ts +5 -5
- package/dist/stories/components/form/CheckboxFormControl.stories.d.ts +3 -23
- package/dist/stories/components/form/FormControlWrapper.stories.d.ts +6 -0
- package/dist/stories/components/form/ServiceFormActions.stories.d.ts +3 -9
- package/dist/stories/components/form/ServiceFormContainer.stories.d.ts +11 -12
- package/dist/stories/components/icons/IconWithCircularBackground.stories.d.ts +6 -0
- package/dist/stories/components/icons/Icons.stories.d.ts +3 -2
- package/dist/stories/components/inputs/Checkbox.stories.d.ts +17 -22
- package/dist/stories/components/inputs/DatePicker.stories.d.ts +18 -20
- package/dist/stories/components/inputs/FileDropzone.stories.d.ts +3 -29
- package/dist/stories/components/inputs/FileUpload.stories.d.ts +14 -26
- package/dist/stories/components/inputs/NumberStepper.stories.d.ts +3 -31
- package/dist/stories/components/inputs/PhoneInput.stories.d.ts +6 -20
- package/dist/stories/components/inputs/PhoneInputFormControl.stories.d.ts +6 -0
- package/dist/stories/components/inputs/RadioButtonGroup.stories.d.ts +4 -32
- package/dist/stories/components/inputs/SearchableField.stories.d.ts +3 -332
- package/dist/stories/components/inputs/Select.stories.d.ts +4 -871
- package/dist/stories/components/inputs/TextField.stories.d.ts +3 -610
- package/dist/stories/components/layout/Footer.stories.d.ts +3 -5
- package/dist/stories/components/layout/ServiceHeader.stories.d.ts +6 -0
- package/dist/stories/components/layout/ServicePage.stories.d.ts +6 -0
- package/dist/stories/components/navigation/Accordion.stories.d.ts +15 -27
- package/dist/stories/components/navigation/Breadcrumbs.stories.d.ts +4 -6
- package/dist/stories/components/navigation/ServiceWizardStepper.stories.d.ts +5 -5
- package/dist/stories/components/tabs/Tab.stories.d.ts +8 -0
- package/dist/stories/components/tabs/TabPanel.stories.d.ts +7 -0
- package/dist/stories/components/tabs/Tabs.stories.d.ts +7 -0
- package/dist/stories/components/tabs/TabsWrapper.stories.d.ts +6 -0
- package/package.json +1 -1
- package/src/assets/IconProps.ts +2 -0
- package/src/assets/icons/CheckIcon.tsx +23 -0
- package/src/assets/icons/PencilSimpleLineIcon.tsx +17 -0
- package/src/components/common/Card/index.test.tsx +8 -0
- package/src/components/common/Card/index.tsx +64 -25
- package/src/components/common/SelectableCardList/index.tsx +2 -1
- package/src/components/form/components/FormControlWrapper/index.tsx +6 -1
- package/src/components/form/inputs/PhoneInputFormControl/index.tsx +11 -3
- package/src/components/form/inputs/Select/Select.types.ts +5 -0
- package/src/components/form/inputs/Select/hooks/useFilteredOptions.ts +18 -0
- package/src/components/form/inputs/Select/hooks/useSelectAllLogic.ts +22 -0
- package/src/components/form/inputs/Select/index.tsx +494 -0
- package/src/library/icons.ts +2 -0
- package/src/stories/Welcome.mdx +87 -0
- package/src/stories/assets/Logo.stories.tsx +16 -0
- package/src/stories/components/actions/ButtonWithPopover.stories.tsx +33 -0
- package/src/stories/components/display/Card.stories.tsx +64 -47
- package/src/stories/components/display/ImageCard.stories.tsx +29 -27
- package/src/stories/components/feedback/Alert.stories.tsx +59 -50
- package/src/stories/components/form/CardFormContainer.stories.tsx +77 -63
- package/src/stories/components/form/CheckboxFormControl.stories.tsx +29 -71
- package/src/stories/components/form/FormControlWrapper.stories.tsx +35 -0
- package/src/stories/components/form/ServiceFormActions.stories.tsx +18 -21
- package/src/stories/components/form/ServiceFormContainer.stories.tsx +11 -11
- package/src/stories/components/icons/IconWithCircularBackground.stories.tsx +39 -0
- package/src/stories/components/icons/Icons.stories.tsx +6 -2
- package/src/stories/components/inputs/Checkbox.stories.tsx +17 -16
- package/src/stories/components/inputs/DatePicker.stories.tsx +16 -15
- package/src/stories/components/inputs/FileDropzone.stories.tsx +17 -34
- package/src/stories/components/inputs/FileUpload.stories.tsx +14 -29
- package/src/stories/components/inputs/NumberStepper.stories.tsx +32 -60
- package/src/stories/components/inputs/PhoneInput.stories.tsx +7 -5
- package/src/stories/components/inputs/PhoneInputFormControl.stories.tsx +33 -0
- package/src/stories/components/inputs/RadioButtonGroup.stories.tsx +22 -20
- package/src/stories/components/inputs/SearchableField.stories.tsx +16 -14
- package/src/stories/components/inputs/Select.stories.tsx +245 -13
- package/src/stories/components/inputs/TextField.stories.tsx +47 -47
- package/src/stories/components/layout/Footer.stories.tsx +6 -6
- package/src/stories/components/layout/ServiceHeader.stories.tsx +36 -0
- package/src/stories/components/layout/ServicePage.stories.tsx +26 -0
- package/src/stories/components/navigation/Accordion.stories.tsx +14 -13
- package/src/stories/components/navigation/Breadcrumbs.stories.tsx +6 -8
- package/src/stories/components/navigation/DataPagination.stories.tsx +19 -17
- package/src/stories/components/navigation/ServiceWizardStepper.stories.tsx +29 -22
- package/src/stories/components/tabs/Tab.stories.tsx +32 -0
- package/src/stories/components/tabs/TabPanel.stories.tsx +31 -0
- package/src/stories/components/tabs/Tabs.stories.tsx +62 -0
- package/src/stories/components/tabs/TabsWrapper.stories.tsx +34 -0
- package/src/theme/light/MuiAutocomplete.ts +52 -3
- package/src/components/form/inputs/Select.tsx +0 -152
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* eslint-disable react/function-component-definition */
|
|
2
1
|
import { Box, Typography } from '@mui/material'
|
|
3
|
-
import type { Meta,
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
3
|
|
|
5
4
|
import CaretLeftIcon from '@/assets/icons/CaretLeftIcon'
|
|
6
5
|
import MagnifyingGlassIcon from '@/assets/icons/MagnifyingGlassIcon'
|
|
6
|
+
import PencilSimpleLineIcon from '@/assets/icons/PencilSimpleLineIcon'
|
|
7
7
|
import RcSesButton from '@/components/common/Button'
|
|
8
8
|
import RcSesCard from '@/components/common/Card'
|
|
9
9
|
import palette from '@/theme/palette'
|
|
@@ -16,54 +16,71 @@ const meta: Meta<typeof RcSesCard> = {
|
|
|
16
16
|
|
|
17
17
|
export default meta
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
type Story = StoryObj<typeof RcSesCard>
|
|
20
20
|
|
|
21
|
-
export const Main =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Button
|
|
43
|
-
</RcSesButton>
|
|
44
|
-
),
|
|
45
|
-
trailingActions: (
|
|
46
|
-
<>
|
|
47
|
-
<RcSesButton color='grey' variant='outlined'>
|
|
21
|
+
export const Main: Story = {
|
|
22
|
+
args: {
|
|
23
|
+
title: 'Pavadinimas',
|
|
24
|
+
description: 'Papildomas aprasymo tekstas',
|
|
25
|
+
children: (
|
|
26
|
+
<Box
|
|
27
|
+
sx={{
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
color: 'text.primary',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
justifyContent: 'center',
|
|
32
|
+
minHeight: { xs: '9.625rem', md: '11.5rem' },
|
|
33
|
+
px: 3,
|
|
34
|
+
width: '100%',
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<Typography align='center'>Vidinis paslaugu front-end sprendimas</Typography>
|
|
38
|
+
</Box>
|
|
39
|
+
),
|
|
40
|
+
leadingActions: (
|
|
41
|
+
<RcSesButton startIcon={<CaretLeftIcon />} color='grey' variant='outlined'>
|
|
48
42
|
Button
|
|
49
43
|
</RcSesButton>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
),
|
|
45
|
+
trailingActions: (
|
|
46
|
+
<>
|
|
47
|
+
<RcSesButton color='grey' variant='outlined'>
|
|
48
|
+
Button
|
|
49
|
+
</RcSesButton>
|
|
50
|
+
<RcSesButton>Button</RcSesButton>
|
|
51
|
+
</>
|
|
52
|
+
),
|
|
53
|
+
},
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
export const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
export const WithHeaderAction: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
title: 'Juridinis asmuo',
|
|
59
|
+
description: 'UAB "Telia Lietuva", 121215434',
|
|
60
|
+
contentBackground: false,
|
|
61
|
+
headerAction: (
|
|
62
|
+
<RcSesButton startIcon={<PencilSimpleLineIcon />} variant='text' size='small'>
|
|
63
|
+
Redaguoti
|
|
64
|
+
</RcSesButton>
|
|
65
|
+
),
|
|
66
|
+
},
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const WithImage: Story = {
|
|
70
|
+
args: {
|
|
71
|
+
variant: 'elevation',
|
|
72
|
+
centered: true,
|
|
73
|
+
title: 'Place heading text here',
|
|
74
|
+
description:
|
|
75
|
+
'Additional description text elaborating on situation and what to do next.',
|
|
76
|
+
image: (
|
|
77
|
+
<Box
|
|
78
|
+
sx={{ color: palette.grey[400], position: 'relative', display: 'inline-flex' }}
|
|
79
|
+
>
|
|
80
|
+
<MagnifyingGlassIcon size={64} fillColor={palette.grey[400]} />
|
|
81
|
+
</Box>
|
|
82
|
+
),
|
|
83
|
+
children: <RcSesButton>Button</RcSesButton>,
|
|
84
|
+
contentBackground: false,
|
|
85
|
+
},
|
|
69
86
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/* eslint-disable react/function-component-definition */
|
|
2
1
|
import { Box } from '@mui/material'
|
|
3
|
-
import type { Meta,
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
3
|
|
|
5
4
|
import MagnifyingGlassIcon from '@/assets/icons/MagnifyingGlassIcon'
|
|
6
5
|
import RcSesButton from '@/components/common/Button'
|
|
@@ -15,7 +14,7 @@ const meta: Meta<typeof RcSesImageCard> = {
|
|
|
15
14
|
|
|
16
15
|
export default meta
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
type Story = StoryObj<typeof RcSesImageCard>
|
|
19
18
|
|
|
20
19
|
const defaultImage = (
|
|
21
20
|
<Box sx={{ position: 'relative', display: 'inline-flex' }}>
|
|
@@ -23,32 +22,35 @@ const defaultImage = (
|
|
|
23
22
|
</Box>
|
|
24
23
|
)
|
|
25
24
|
|
|
26
|
-
export const Main =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
export const Main: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
image: defaultImage,
|
|
28
|
+
title: 'Place heading text here',
|
|
29
|
+
description:
|
|
30
|
+
'Additional description text elaborating on situation and what to do next.',
|
|
31
|
+
button: <RcSesButton>Button</RcSesButton>,
|
|
32
|
+
},
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export const WithoutButton =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
export const WithoutButton: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
image: defaultImage,
|
|
38
|
+
title: 'Place heading text here',
|
|
39
|
+
description:
|
|
40
|
+
'Additional description text elaborating on situation and what to do next.',
|
|
41
|
+
},
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
export const OutlinedButton =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
export const OutlinedButton: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
image: defaultImage,
|
|
47
|
+
title: 'Place heading text here',
|
|
48
|
+
description:
|
|
49
|
+
'Additional description text elaborating on situation and what to do next.',
|
|
50
|
+
button: (
|
|
51
|
+
<RcSesButton color='grey' variant='outlined'>
|
|
52
|
+
Button
|
|
53
|
+
</RcSesButton>
|
|
54
|
+
),
|
|
55
|
+
},
|
|
54
56
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react'
|
|
3
2
|
|
|
4
3
|
import RcSesAlert from '@/components/common/Alert'
|
|
5
4
|
import FieldPreview from '@/components/storybook/FieldPreview'
|
|
@@ -20,37 +19,39 @@ const meta: Meta<typeof RcSesAlert> = {
|
|
|
20
19
|
|
|
21
20
|
export default meta
|
|
22
21
|
|
|
22
|
+
type Story = StoryObj<typeof RcSesAlert>
|
|
23
|
+
|
|
23
24
|
// ---------------------------------------------------------------------------
|
|
24
25
|
// Main (interactive / configurable via Controls panel)
|
|
25
26
|
// ---------------------------------------------------------------------------
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
export const Main: Story = {
|
|
29
|
+
render: (args) => (
|
|
30
|
+
<Fields>
|
|
31
|
+
<FieldView>
|
|
32
|
+
<RcSesAlert {...args} />
|
|
33
|
+
</FieldView>
|
|
34
|
+
<FieldPreview>
|
|
35
|
+
<PreviewTitle>State previews</PreviewTitle>
|
|
36
|
+
{severities.map((severity) => (
|
|
37
|
+
<RcSesAlert key={severity} severity={severity}>
|
|
38
|
+
{lorem}
|
|
39
|
+
</RcSesAlert>
|
|
40
|
+
))}
|
|
41
|
+
</FieldPreview>
|
|
42
|
+
</Fields>
|
|
43
|
+
),
|
|
44
|
+
args: {
|
|
45
|
+
children: lorem,
|
|
46
|
+
severity: 'info',
|
|
47
|
+
},
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
// ---------------------------------------------------------------------------
|
|
50
51
|
// Variants
|
|
51
52
|
// ---------------------------------------------------------------------------
|
|
52
53
|
|
|
53
|
-
const
|
|
54
|
+
const renderVariants: Story['render'] = (args) => (
|
|
54
55
|
<>
|
|
55
56
|
{severities.map((severity) => (
|
|
56
57
|
<RcSesAlert key={severity} {...args} severity={severity}>
|
|
@@ -60,38 +61,46 @@ const VariantsTemplate: StoryFn<typeof RcSesAlert> = (args) => (
|
|
|
60
61
|
</>
|
|
61
62
|
)
|
|
62
63
|
|
|
63
|
-
export const Outlined =
|
|
64
|
-
|
|
64
|
+
export const Outlined: Story = {
|
|
65
|
+
render: renderVariants,
|
|
66
|
+
args: { variant: 'outlined' },
|
|
67
|
+
}
|
|
65
68
|
|
|
66
|
-
export const Filled =
|
|
67
|
-
|
|
69
|
+
export const Filled: Story = {
|
|
70
|
+
render: renderVariants,
|
|
71
|
+
args: { variant: 'filled' },
|
|
72
|
+
}
|
|
68
73
|
|
|
69
|
-
export const Standard =
|
|
70
|
-
|
|
74
|
+
export const Standard: Story = {
|
|
75
|
+
render: renderVariants,
|
|
76
|
+
args: { variant: 'standard' },
|
|
77
|
+
}
|
|
71
78
|
|
|
72
79
|
// ---------------------------------------------------------------------------
|
|
73
80
|
// Container — full-bleed banner keeping content width-constrained
|
|
74
81
|
// ---------------------------------------------------------------------------
|
|
75
82
|
|
|
76
|
-
export const WithContainer:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
export const WithContainer: Story = {
|
|
84
|
+
render: () => (
|
|
85
|
+
<>
|
|
86
|
+
<PreviewTitle>container (default maxWidth)</PreviewTitle>
|
|
87
|
+
{severities.map((severity) => (
|
|
88
|
+
<RcSesAlert key={severity} severity={severity} container sx={{ mb: 1 }}>
|
|
89
|
+
{lorem}
|
|
90
|
+
</RcSesAlert>
|
|
91
|
+
))}
|
|
84
92
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
)
|
|
93
|
+
<PreviewTitle>container with maxWidth="sm"</PreviewTitle>
|
|
94
|
+
{severities.map((severity) => (
|
|
95
|
+
<RcSesAlert
|
|
96
|
+
key={severity}
|
|
97
|
+
severity={severity}
|
|
98
|
+
container={{ maxWidth: 'sm' }}
|
|
99
|
+
sx={{ mb: 1 }}
|
|
100
|
+
>
|
|
101
|
+
{lorem}
|
|
102
|
+
</RcSesAlert>
|
|
103
|
+
))}
|
|
104
|
+
</>
|
|
105
|
+
),
|
|
106
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button, Container, Typography } from '@mui/material'
|
|
2
|
-
import type { Meta,
|
|
3
|
-
import { useState } from 'react'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { ComponentProps, useState } from 'react'
|
|
4
4
|
|
|
5
5
|
import RcSesCardFormContainer from '@/components/layout/ServiceFormContainer/CardFormContainer'
|
|
6
6
|
import { StepItem } from '@/components/layout/ServiceWizardStepper/StepperTypes'
|
|
@@ -57,69 +57,83 @@ const DemoContent = () => (
|
|
|
57
57
|
</>
|
|
58
58
|
)
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<Fields>
|
|
83
|
-
<FieldView>
|
|
84
|
-
<RcSesCardFormContainer
|
|
85
|
-
{...args}
|
|
86
|
-
layout={forcedLayout}
|
|
87
|
-
steps={steps}
|
|
88
|
-
activeStep={activeStep}
|
|
89
|
-
onStepClick={handleStepClick}
|
|
90
|
-
leadingActions={
|
|
91
|
-
<Button onClick={handleBack} disabled={activeStep === 0}>
|
|
92
|
-
Back
|
|
93
|
-
</Button>
|
|
94
|
-
}
|
|
95
|
-
trailingActions={
|
|
96
|
-
<>
|
|
97
|
-
<Button variant='outlined'>Button</Button>
|
|
98
|
-
<Button
|
|
99
|
-
variant='contained'
|
|
100
|
-
onClick={handleNext}
|
|
101
|
-
disabled={activeStep === steps.length - 1}
|
|
102
|
-
>
|
|
103
|
-
Next
|
|
104
|
-
</Button>
|
|
105
|
-
</>
|
|
106
|
-
}
|
|
107
|
-
>
|
|
108
|
-
<DemoContent />
|
|
109
|
-
</RcSesCardFormContainer>
|
|
110
|
-
</FieldView>
|
|
111
|
-
</Fields>
|
|
112
|
-
)
|
|
60
|
+
type Story = StoryObj<typeof RcSesCardFormContainer>
|
|
61
|
+
|
|
62
|
+
type CardFormContainerDemoProps = ComponentProps<typeof RcSesCardFormContainer> & {
|
|
63
|
+
steps: StepItem[]
|
|
64
|
+
forcedLayout?: 'row' | 'column'
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function CardFormContainerDemo({
|
|
68
|
+
steps,
|
|
69
|
+
forcedLayout,
|
|
70
|
+
...args
|
|
71
|
+
}: CardFormContainerDemoProps) {
|
|
72
|
+
const [activeStep, setActiveStep] = useState(0)
|
|
73
|
+
|
|
74
|
+
const handleBack = () => {
|
|
75
|
+
setActiveStep((prev) => Math.max(prev - 1, 0))
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const handleNext = () => {
|
|
79
|
+
setActiveStep((prev) => Math.min(prev + 1, steps.length - 1))
|
|
113
80
|
}
|
|
114
81
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
82
|
+
const handleStepClick = (index: number) => {
|
|
83
|
+
if (index > activeStep) return
|
|
84
|
+
setActiveStep(index)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<Fields>
|
|
89
|
+
<FieldView>
|
|
90
|
+
<RcSesCardFormContainer
|
|
91
|
+
{...args}
|
|
92
|
+
layout={forcedLayout}
|
|
93
|
+
steps={steps}
|
|
94
|
+
activeStep={activeStep}
|
|
95
|
+
onStepClick={handleStepClick}
|
|
96
|
+
leadingActions={
|
|
97
|
+
<Button onClick={handleBack} disabled={activeStep === 0}>
|
|
98
|
+
Back
|
|
99
|
+
</Button>
|
|
100
|
+
}
|
|
101
|
+
trailingActions={
|
|
102
|
+
<>
|
|
103
|
+
<Button variant='outlined'>Button</Button>
|
|
104
|
+
<Button
|
|
105
|
+
variant='contained'
|
|
106
|
+
onClick={handleNext}
|
|
107
|
+
disabled={activeStep === steps.length - 1}
|
|
108
|
+
>
|
|
109
|
+
Next
|
|
110
|
+
</Button>
|
|
111
|
+
</>
|
|
112
|
+
}
|
|
113
|
+
>
|
|
114
|
+
<DemoContent />
|
|
115
|
+
</RcSesCardFormContainer>
|
|
116
|
+
</FieldView>
|
|
117
|
+
</Fields>
|
|
118
|
+
)
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
export const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
export const HorizontalDemo: Story = {
|
|
122
|
+
render: (args) => (
|
|
123
|
+
<CardFormContainerDemo {...args} steps={shortSteps} forcedLayout='column' />
|
|
124
|
+
),
|
|
125
|
+
args: {
|
|
126
|
+
title: 'Antraštės tekstas',
|
|
127
|
+
description: 'Papildomas aprašymo tekstas',
|
|
128
|
+
},
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const VerticalDemo: Story = {
|
|
132
|
+
render: (args) => (
|
|
133
|
+
<CardFormContainerDemo {...args} steps={longSteps} forcedLayout='row' />
|
|
134
|
+
),
|
|
135
|
+
args: {
|
|
136
|
+
title: 'Antraštės tekstas',
|
|
137
|
+
description: 'Papildomas aprašymo tekstas',
|
|
138
|
+
},
|
|
125
139
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { Meta, StoryContext, StoryFn } from '@storybook/react'
|
|
1
|
+
import { Meta, StoryContext, StoryObj } from '@storybook/react'
|
|
3
2
|
import { useForm } from 'react-hook-form'
|
|
4
3
|
|
|
5
4
|
import RcSesCheckboxFormControl from '@/components/form/inputs/CheckboxFormControl'
|
|
@@ -19,61 +18,17 @@ const meta: Meta<typeof RcSesCheckboxFormControl> = {
|
|
|
19
18
|
defaultValue: { summary: 'outlined' },
|
|
20
19
|
},
|
|
21
20
|
},
|
|
22
|
-
slotProps: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
table: {
|
|
34
|
-
disable: true,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
errors: {
|
|
38
|
-
table: {
|
|
39
|
-
disable: true,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
onBlur: {
|
|
43
|
-
table: {
|
|
44
|
-
disable: true,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
onChange: {
|
|
48
|
-
table: {
|
|
49
|
-
disable: true,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
rules: {
|
|
53
|
-
table: {
|
|
54
|
-
disable: true,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
control: {
|
|
58
|
-
table: {
|
|
59
|
-
disable: true,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
name: {
|
|
63
|
-
table: {
|
|
64
|
-
disable: true,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
disabled: {
|
|
68
|
-
table: {
|
|
69
|
-
disable: true,
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
label: {
|
|
73
|
-
table: {
|
|
74
|
-
disable: true,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
21
|
+
slotProps: { table: { disable: true } },
|
|
22
|
+
loading: { table: { disable: true } },
|
|
23
|
+
id: { table: { disable: true } },
|
|
24
|
+
errors: { table: { disable: true } },
|
|
25
|
+
onBlur: { table: { disable: true } },
|
|
26
|
+
onChange: { table: { disable: true } },
|
|
27
|
+
rules: { table: { disable: true } },
|
|
28
|
+
control: { table: { disable: true } },
|
|
29
|
+
name: { table: { disable: true } },
|
|
30
|
+
disabled: { table: { disable: true } },
|
|
31
|
+
label: { table: { disable: true } },
|
|
77
32
|
},
|
|
78
33
|
tags: ['autodocs'],
|
|
79
34
|
}
|
|
@@ -84,7 +39,9 @@ type FormModel = {
|
|
|
84
39
|
|
|
85
40
|
export default meta
|
|
86
41
|
|
|
87
|
-
|
|
42
|
+
type Story = StoryObj<typeof RcSesCheckboxFormControl>
|
|
43
|
+
|
|
44
|
+
function CheckboxFormControlDemo(args: any) {
|
|
88
45
|
const { variant, children } = args
|
|
89
46
|
const {
|
|
90
47
|
control,
|
|
@@ -142,19 +99,20 @@ const codeBlock = (args: any) => {
|
|
|
142
99
|
);`
|
|
143
100
|
}
|
|
144
101
|
|
|
145
|
-
export const Main =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
102
|
+
export const Main: Story = {
|
|
103
|
+
render: (args) => <CheckboxFormControlDemo {...args} />,
|
|
104
|
+
args: {
|
|
105
|
+
label: 'This is label',
|
|
106
|
+
children: 'This is body',
|
|
107
|
+
variant: 'outlined',
|
|
108
|
+
},
|
|
109
|
+
parameters: {
|
|
110
|
+
docs: {
|
|
111
|
+
source: {
|
|
112
|
+
type: 'dynamic',
|
|
113
|
+
transform: (_code: string, storyContext: StoryContext) =>
|
|
114
|
+
codeBlock(storyContext.args),
|
|
115
|
+
},
|
|
158
116
|
},
|
|
159
117
|
},
|
|
160
118
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import TextField from '@mui/material/TextField'
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
|
|
4
|
+
import RcSesFormControlWrapper from '@/components/form/components/FormControlWrapper'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof RcSesFormControlWrapper> = {
|
|
7
|
+
title: 'components/form/FormControlWrapper',
|
|
8
|
+
component: RcSesFormControlWrapper,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
label: { control: 'text' },
|
|
12
|
+
description: { control: 'text' },
|
|
13
|
+
hideLabel: { control: 'boolean' },
|
|
14
|
+
labelOnTop: { control: 'boolean' },
|
|
15
|
+
required: { control: 'boolean' },
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default meta
|
|
20
|
+
type Story = StoryObj<typeof meta>
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
label: 'Label',
|
|
25
|
+
description: 'This is a helpful description',
|
|
26
|
+
hideLabel: false,
|
|
27
|
+
labelOnTop: false,
|
|
28
|
+
required: false,
|
|
29
|
+
},
|
|
30
|
+
render: (args) => (
|
|
31
|
+
<RcSesFormControlWrapper {...args}>
|
|
32
|
+
<TextField id='input' placeholder='Type text here' size='small' fullWidth />
|
|
33
|
+
</RcSesFormControlWrapper>
|
|
34
|
+
),
|
|
35
|
+
}
|