@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.
Files changed (95) hide show
  1. package/dist/assets/IconProps.d.ts +2 -0
  2. package/dist/assets/icons/CheckIcon.d.ts +3 -0
  3. package/dist/assets/icons/PencilSimpleLineIcon.d.ts +3 -0
  4. package/dist/components/common/Card/index.d.ts +4 -1
  5. package/dist/components/form/inputs/Select/Select.types.d.ts +5 -0
  6. package/dist/components/form/inputs/Select/hooks/useFilteredOptions.d.ts +3 -0
  7. package/dist/components/form/inputs/Select/hooks/useSelectAllLogic.d.ts +7 -0
  8. package/dist/components/form/inputs/{Select.d.ts → Select/index.d.ts} +12 -12
  9. package/dist/library/icons.d.ts +2 -1
  10. package/dist/registrucentras-rc-ses-react-components.cjs +11 -11
  11. package/dist/registrucentras-rc-ses-react-components.js +3154 -2747
  12. package/dist/stories/assets/Logo.stories.d.ts +12 -0
  13. package/dist/stories/components/actions/ButtonWithPopover.stories.d.ts +7 -0
  14. package/dist/stories/components/display/Card.stories.d.ts +6 -47
  15. package/dist/stories/components/display/ImageCard.stories.d.ts +6 -6
  16. package/dist/stories/components/feedback/Alert.stories.d.ts +7 -16
  17. package/dist/stories/components/form/CardFormContainer.stories.d.ts +5 -5
  18. package/dist/stories/components/form/CheckboxFormControl.stories.d.ts +3 -23
  19. package/dist/stories/components/form/FormControlWrapper.stories.d.ts +6 -0
  20. package/dist/stories/components/form/ServiceFormActions.stories.d.ts +3 -9
  21. package/dist/stories/components/form/ServiceFormContainer.stories.d.ts +11 -12
  22. package/dist/stories/components/icons/IconWithCircularBackground.stories.d.ts +6 -0
  23. package/dist/stories/components/icons/Icons.stories.d.ts +3 -2
  24. package/dist/stories/components/inputs/Checkbox.stories.d.ts +17 -22
  25. package/dist/stories/components/inputs/DatePicker.stories.d.ts +18 -20
  26. package/dist/stories/components/inputs/FileDropzone.stories.d.ts +3 -29
  27. package/dist/stories/components/inputs/FileUpload.stories.d.ts +14 -26
  28. package/dist/stories/components/inputs/NumberStepper.stories.d.ts +3 -31
  29. package/dist/stories/components/inputs/PhoneInput.stories.d.ts +6 -20
  30. package/dist/stories/components/inputs/PhoneInputFormControl.stories.d.ts +6 -0
  31. package/dist/stories/components/inputs/RadioButtonGroup.stories.d.ts +4 -32
  32. package/dist/stories/components/inputs/SearchableField.stories.d.ts +3 -332
  33. package/dist/stories/components/inputs/Select.stories.d.ts +4 -871
  34. package/dist/stories/components/inputs/TextField.stories.d.ts +3 -610
  35. package/dist/stories/components/layout/Footer.stories.d.ts +3 -5
  36. package/dist/stories/components/layout/ServiceHeader.stories.d.ts +6 -0
  37. package/dist/stories/components/layout/ServicePage.stories.d.ts +6 -0
  38. package/dist/stories/components/navigation/Accordion.stories.d.ts +15 -27
  39. package/dist/stories/components/navigation/Breadcrumbs.stories.d.ts +4 -6
  40. package/dist/stories/components/navigation/ServiceWizardStepper.stories.d.ts +5 -5
  41. package/dist/stories/components/tabs/Tab.stories.d.ts +8 -0
  42. package/dist/stories/components/tabs/TabPanel.stories.d.ts +7 -0
  43. package/dist/stories/components/tabs/Tabs.stories.d.ts +7 -0
  44. package/dist/stories/components/tabs/TabsWrapper.stories.d.ts +6 -0
  45. package/package.json +1 -1
  46. package/src/assets/IconProps.ts +2 -0
  47. package/src/assets/icons/CheckIcon.tsx +23 -0
  48. package/src/assets/icons/PencilSimpleLineIcon.tsx +17 -0
  49. package/src/components/common/Card/index.test.tsx +8 -0
  50. package/src/components/common/Card/index.tsx +64 -25
  51. package/src/components/common/SelectableCardList/index.tsx +2 -1
  52. package/src/components/form/components/FormControlWrapper/index.tsx +6 -1
  53. package/src/components/form/inputs/PhoneInputFormControl/index.tsx +11 -3
  54. package/src/components/form/inputs/Select/Select.types.ts +5 -0
  55. package/src/components/form/inputs/Select/hooks/useFilteredOptions.ts +18 -0
  56. package/src/components/form/inputs/Select/hooks/useSelectAllLogic.ts +22 -0
  57. package/src/components/form/inputs/Select/index.tsx +494 -0
  58. package/src/library/icons.ts +2 -0
  59. package/src/stories/Welcome.mdx +87 -0
  60. package/src/stories/assets/Logo.stories.tsx +16 -0
  61. package/src/stories/components/actions/ButtonWithPopover.stories.tsx +33 -0
  62. package/src/stories/components/display/Card.stories.tsx +64 -47
  63. package/src/stories/components/display/ImageCard.stories.tsx +29 -27
  64. package/src/stories/components/feedback/Alert.stories.tsx +59 -50
  65. package/src/stories/components/form/CardFormContainer.stories.tsx +77 -63
  66. package/src/stories/components/form/CheckboxFormControl.stories.tsx +29 -71
  67. package/src/stories/components/form/FormControlWrapper.stories.tsx +35 -0
  68. package/src/stories/components/form/ServiceFormActions.stories.tsx +18 -21
  69. package/src/stories/components/form/ServiceFormContainer.stories.tsx +11 -11
  70. package/src/stories/components/icons/IconWithCircularBackground.stories.tsx +39 -0
  71. package/src/stories/components/icons/Icons.stories.tsx +6 -2
  72. package/src/stories/components/inputs/Checkbox.stories.tsx +17 -16
  73. package/src/stories/components/inputs/DatePicker.stories.tsx +16 -15
  74. package/src/stories/components/inputs/FileDropzone.stories.tsx +17 -34
  75. package/src/stories/components/inputs/FileUpload.stories.tsx +14 -29
  76. package/src/stories/components/inputs/NumberStepper.stories.tsx +32 -60
  77. package/src/stories/components/inputs/PhoneInput.stories.tsx +7 -5
  78. package/src/stories/components/inputs/PhoneInputFormControl.stories.tsx +33 -0
  79. package/src/stories/components/inputs/RadioButtonGroup.stories.tsx +22 -20
  80. package/src/stories/components/inputs/SearchableField.stories.tsx +16 -14
  81. package/src/stories/components/inputs/Select.stories.tsx +245 -13
  82. package/src/stories/components/inputs/TextField.stories.tsx +47 -47
  83. package/src/stories/components/layout/Footer.stories.tsx +6 -6
  84. package/src/stories/components/layout/ServiceHeader.stories.tsx +36 -0
  85. package/src/stories/components/layout/ServicePage.stories.tsx +26 -0
  86. package/src/stories/components/navigation/Accordion.stories.tsx +14 -13
  87. package/src/stories/components/navigation/Breadcrumbs.stories.tsx +6 -8
  88. package/src/stories/components/navigation/DataPagination.stories.tsx +19 -17
  89. package/src/stories/components/navigation/ServiceWizardStepper.stories.tsx +29 -22
  90. package/src/stories/components/tabs/Tab.stories.tsx +32 -0
  91. package/src/stories/components/tabs/TabPanel.stories.tsx +31 -0
  92. package/src/stories/components/tabs/Tabs.stories.tsx +62 -0
  93. package/src/stories/components/tabs/TabsWrapper.stories.tsx +34 -0
  94. package/src/theme/light/MuiAutocomplete.ts +52 -3
  95. 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, StoryFn } from '@storybook/react'
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
- const Template: StoryFn<typeof RcSesCard> = (args) => <RcSesCard {...args} />
19
+ type Story = StoryObj<typeof RcSesCard>
20
20
 
21
- export const Main = Template.bind({})
22
- Main.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'>
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
- <RcSesButton>Button</RcSesButton>
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 WithImage = Template.bind({})
56
- WithImage.args = {
57
- variant: 'elevation',
58
- centered: true,
59
- title: 'Place heading text here',
60
- description:
61
- 'Additional description text elaborating on situation and what to do next.',
62
- image: (
63
- <Box sx={{ color: palette.grey[400], position: 'relative', display: 'inline-flex' }}>
64
- <MagnifyingGlassIcon size={64} fillColor={palette.grey[400]} />
65
- </Box>
66
- ),
67
- children: <RcSesButton>Button</RcSesButton>,
68
- contentBackground: false,
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, StoryFn } from '@storybook/react'
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
- const Template: StoryFn<typeof RcSesImageCard> = (args) => <RcSesImageCard {...args} />
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 = Template.bind({})
27
- Main.args = {
28
- image: defaultImage,
29
- title: 'Place heading text here',
30
- description:
31
- 'Additional description text elaborating on situation and what to do next.',
32
- button: <RcSesButton>Button</RcSesButton>,
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 = Template.bind({})
36
- WithoutButton.args = {
37
- image: defaultImage,
38
- title: 'Place heading text here',
39
- description:
40
- 'Additional description text elaborating on situation and what to do next.',
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 = Template.bind({})
44
- OutlinedButton.args = {
45
- image: defaultImage,
46
- title: 'Place heading text here',
47
- description:
48
- 'Additional description text elaborating on situation and what to do next.',
49
- button: (
50
- <RcSesButton color='grey' variant='outlined'>
51
- Button
52
- </RcSesButton>
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
- /* eslint-disable react/function-component-definition */
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 Template: StoryFn<typeof RcSesAlert> = (args) => (
28
- <Fields>
29
- <FieldView>
30
- <RcSesAlert {...args} />
31
- </FieldView>
32
- <FieldPreview>
33
- <PreviewTitle>State previews</PreviewTitle>
34
- {severities.map((severity) => (
35
- <RcSesAlert key={severity} severity={severity}>
36
- {lorem}
37
- </RcSesAlert>
38
- ))}
39
- </FieldPreview>
40
- </Fields>
41
- )
42
-
43
- export const Main = Template.bind({})
44
- Main.args = {
45
- children: lorem,
46
- severity: 'info',
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 VariantsTemplate: StoryFn<typeof RcSesAlert> = (args) => (
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 = VariantsTemplate.bind({})
64
- Outlined.args = { variant: 'outlined' }
64
+ export const Outlined: Story = {
65
+ render: renderVariants,
66
+ args: { variant: 'outlined' },
67
+ }
65
68
 
66
- export const Filled = VariantsTemplate.bind({})
67
- Filled.args = { variant: 'filled' }
69
+ export const Filled: Story = {
70
+ render: renderVariants,
71
+ args: { variant: 'filled' },
72
+ }
68
73
 
69
- export const Standard = VariantsTemplate.bind({})
70
- Standard.args = { variant: 'standard' }
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: StoryFn<typeof RcSesAlert> = () => (
77
- <>
78
- <PreviewTitle>container (default maxWidth)</PreviewTitle>
79
- {severities.map((severity) => (
80
- <RcSesAlert key={severity} severity={severity} container sx={{ mb: 1 }}>
81
- {lorem}
82
- </RcSesAlert>
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
- <PreviewTitle>container with maxWidth=&quot;sm&quot;</PreviewTitle>
86
- {severities.map((severity) => (
87
- <RcSesAlert
88
- key={severity}
89
- severity={severity}
90
- container={{ maxWidth: 'sm' }}
91
- sx={{ mb: 1 }}
92
- >
93
- {lorem}
94
- </RcSesAlert>
95
- ))}
96
- </>
97
- )
93
+ <PreviewTitle>container with maxWidth=&quot;sm&quot;</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, StoryFn } from '@storybook/react'
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
- const createTemplate =
61
- (
62
- steps: StepItem[],
63
- forcedLayout?: 'row' | 'column',
64
- ): StoryFn<typeof RcSesCardFormContainer> =>
65
- (args) => {
66
- const [activeStep, setActiveStep] = useState(0)
67
-
68
- const handleBack = () => {
69
- setActiveStep((prev) => Math.max(prev - 1, 0))
70
- }
71
-
72
- const handleNext = () => {
73
- setActiveStep((prev) => Math.min(prev + 1, steps.length - 1))
74
- }
75
-
76
- const handleStepClick = (index: number) => {
77
- if (index > activeStep) return
78
- setActiveStep(index)
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
- export const HorizontalDemo = createTemplate(shortSteps, 'column')
116
- HorizontalDemo.args = {
117
- title: 'Antraštės tekstas',
118
- description: 'Papildomas aprašymo tekstas',
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 VerticalDemo = createTemplate(longSteps, 'row')
122
- VerticalDemo.args = {
123
- title: 'Antraštės tekstas',
124
- description: 'Papildomas aprašymo tekstas',
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
- /* eslint-disable react/function-component-definition */
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
- table: {
24
- disable: true,
25
- },
26
- },
27
- loading: {
28
- table: {
29
- disable: true,
30
- },
31
- },
32
- id: {
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
- const Template: StoryFn<typeof RcSesCheckboxFormControl> = (args) => {
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 = Template.bind({})
146
- Main.args = {
147
- label: 'This is label',
148
- children: 'This is body',
149
- variant: 'outlined',
150
- }
151
-
152
- Main.parameters = {
153
- docs: {
154
- source: {
155
- type: 'dynamic',
156
- transform: (code: string, storyContext: StoryContext) =>
157
- codeBlock(storyContext.args),
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
+ }