@registrucentras/rc-ses-react-components 1.6.4 → 1.6.6
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/ArrowsClockwiseIcon.d.ts +3 -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/SearchInput/index.d.ts +27 -0
- 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 +3 -1
- package/dist/library/index.d.ts +2 -0
- package/dist/registrucentras-rc-ses-react-components.cjs +11 -11
- package/dist/registrucentras-rc-ses-react-components.js +3346 -2752
- 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/ServiceFormActions.stories.d.ts +3 -9
- package/dist/stories/components/icons/Icons.stories.d.ts +3 -2
- package/dist/stories/components/inputs/FileDropzone.stories.d.ts +3 -29
- package/dist/stories/components/inputs/NumberStepper.stories.d.ts +3 -31
- package/dist/stories/components/inputs/RadioButtonGroup.stories.d.ts +4 -32
- package/dist/stories/components/inputs/SearchInput.stories.d.ts +11 -0
- 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/navigation/Breadcrumbs.stories.d.ts +4 -6
- package/dist/stories/components/navigation/ServiceWizardStepper.stories.d.ts +5 -5
- package/dist/theme/light/MuiOutlinedInput.d.ts +3 -0
- package/package.json +1 -1
- package/src/assets/IconProps.ts +2 -0
- package/src/assets/icons/ArrowsClockwiseIcon.tsx +16 -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/SearchInput/index.test.tsx +203 -0
- package/src/components/form/inputs/SearchInput/index.tsx +282 -0
- 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/i18n/namespaces/input/en.json +5 -0
- package/src/i18n/namespaces/input/lt.json +5 -0
- package/src/library/icons.ts +4 -0
- package/src/library/index.ts +2 -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/ServiceFormActions.stories.tsx +18 -21
- package/src/stories/components/form/ServiceFormContainer.stories.tsx +1 -1
- package/src/stories/components/icons/Icons.stories.tsx +6 -2
- package/src/stories/components/inputs/FileDropzone.stories.tsx +17 -34
- package/src/stories/components/inputs/NumberStepper.stories.tsx +32 -60
- package/src/stories/components/inputs/RadioButtonGroup.stories.tsx +22 -20
- package/src/stories/components/inputs/SearchInput.stories.tsx +134 -0
- 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/navigation/Breadcrumbs.stories.tsx +6 -8
- package/src/stories/components/navigation/ServiceWizardStepper.stories.tsx +29 -22
- package/src/theme/light/MuiAutocomplete.ts +52 -3
- package/src/theme/light/MuiOutlinedInput.ts +15 -0
- package/src/theme/light/index.tsx +2 -0
- package/src/components/form/inputs/Select.tsx +0 -152
|
@@ -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
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable react/function-component-definition */
|
|
4
|
-
import { Meta, StoryContext, StoryFn } from '@storybook/react'
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react'
|
|
5
2
|
|
|
6
3
|
import RcSesServiceFormActions from '@/components/layout/ServiceFormActions'
|
|
7
4
|
import FieldView from '@/components/storybook/FieldView'
|
|
@@ -15,30 +12,30 @@ const meta: Meta<typeof RcSesServiceFormActions> = {
|
|
|
15
12
|
|
|
16
13
|
export default meta
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
<Fields>
|
|
20
|
-
<FieldView>
|
|
21
|
-
<RcSesServiceFormActions {...args} />
|
|
22
|
-
</FieldView>
|
|
23
|
-
</Fields>
|
|
24
|
-
)
|
|
15
|
+
type Story = StoryObj<typeof RcSesServiceFormActions>
|
|
25
16
|
|
|
26
|
-
const codeBlock = (
|
|
17
|
+
const codeBlock = () => `
|
|
27
18
|
import RcSesServiceFormActions from '@/components/layout/ServiceFormActions'
|
|
28
19
|
|
|
29
20
|
const MyComponent = () => (
|
|
30
21
|
<RcSesServiceFormActions/>
|
|
31
22
|
);`
|
|
32
23
|
|
|
33
|
-
export const Main =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
export const Main: Story = {
|
|
25
|
+
render: (args) => (
|
|
26
|
+
<Fields>
|
|
27
|
+
<FieldView>
|
|
28
|
+
<RcSesServiceFormActions {...args} />
|
|
29
|
+
</FieldView>
|
|
30
|
+
</Fields>
|
|
31
|
+
),
|
|
32
|
+
args: {},
|
|
33
|
+
parameters: {
|
|
34
|
+
docs: {
|
|
35
|
+
source: {
|
|
36
|
+
type: 'dynamic',
|
|
37
|
+
transform: () => codeBlock(),
|
|
38
|
+
},
|
|
42
39
|
},
|
|
43
40
|
},
|
|
44
41
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
|
|
3
3
|
/* eslint-disable react/function-component-definition */
|
|
4
|
-
import { Meta, StoryContext
|
|
4
|
+
import { Meta, StoryContext } from '@storybook/react'
|
|
5
5
|
|
|
6
6
|
import RcSesAccordion from '@/components/common/Accordion'
|
|
7
7
|
import useAccordionController from '@/components/common/Accordion/hooks/useAccordionController'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/function-component-definition, react/prop-types */
|
|
2
2
|
import { Box, FormControl, MenuItem, Select, Typography } from '@mui/material'
|
|
3
|
-
import type { Meta,
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
4
|
import { useMemo, useState } from 'react'
|
|
5
5
|
import type { ReactElement } from 'react'
|
|
6
6
|
|
|
@@ -349,4 +349,8 @@ const GalleryComponent = ({ className, size, fillColor }: StoryArgs) => {
|
|
|
349
349
|
)
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
|
|
352
|
+
type Story = StoryObj<StoryArgs>
|
|
353
|
+
|
|
354
|
+
export const Gallery: Story = {
|
|
355
|
+
render: (args) => <GalleryComponent {...args} />,
|
|
356
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react'
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react'
|
|
3
2
|
import { FieldError, useForm } from 'react-hook-form'
|
|
4
3
|
|
|
5
4
|
import RcSesFileDropzone from '@/components/form/inputs/FileDropzone'
|
|
@@ -18,38 +17,20 @@ const meta: Meta<typeof RcSesFileDropzone> = {
|
|
|
18
17
|
title: 'components/inputs/FileDropzone',
|
|
19
18
|
component: RcSesFileDropzone,
|
|
20
19
|
argTypes: {
|
|
21
|
-
control: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
errors: {
|
|
27
|
-
table: {
|
|
28
|
-
disable: true,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
rules: {
|
|
32
|
-
table: {
|
|
33
|
-
disable: true,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
name: {
|
|
37
|
-
table: {
|
|
38
|
-
disable: true,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
id: {
|
|
42
|
-
table: {
|
|
43
|
-
disable: true,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
20
|
+
control: { table: { disable: true } },
|
|
21
|
+
errors: { table: { disable: true } },
|
|
22
|
+
rules: { table: { disable: true } },
|
|
23
|
+
name: { table: { disable: true } },
|
|
24
|
+
id: { table: { disable: true } },
|
|
46
25
|
},
|
|
47
26
|
tags: ['autodocs'],
|
|
48
27
|
}
|
|
49
28
|
|
|
50
29
|
export default meta
|
|
51
30
|
|
|
52
|
-
|
|
31
|
+
type Story = StoryObj<typeof RcSesFileDropzone>
|
|
32
|
+
|
|
33
|
+
function FileDropzoneDemo(args: any) {
|
|
53
34
|
const {
|
|
54
35
|
control,
|
|
55
36
|
formState: { errors },
|
|
@@ -106,12 +87,14 @@ const Template: StoryFn<typeof RcSesFileDropzone> = (args) => {
|
|
|
106
87
|
)
|
|
107
88
|
}
|
|
108
89
|
|
|
109
|
-
export const Main =
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
90
|
+
export const Main: Story = {
|
|
91
|
+
render: (args) => <FileDropzoneDemo {...args} />,
|
|
92
|
+
args: {
|
|
93
|
+
label: 'Upload files',
|
|
94
|
+
slotProps: {
|
|
95
|
+
wrapper: {
|
|
96
|
+
labelSubtitle: 'Tinkami formatai: .doc, .docx, .pdf',
|
|
97
|
+
},
|
|
115
98
|
},
|
|
116
99
|
},
|
|
117
100
|
}
|