@registrucentras/rc-ses-react-components 1.4.1 → 1.6.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/components/common/Accordion/hooks/useAccordionController.d.ts +1 -0
- package/dist/components/common/Card/index.d.ts +7 -2
- package/dist/components/common/ImageCard/index.d.ts +13 -0
- package/dist/components/common/ListWithIcons/components/ListWithIconsItem.d.ts +9 -0
- package/dist/components/common/ListWithIcons/index.d.ts +14 -0
- package/dist/components/layout/Footer/index.d.ts +5 -0
- package/dist/components/layout/ServiceFormContainer/CardFormContainer/index.d.ts +3 -2
- package/dist/components/layout/ServiceWizardStepper/StepperTypes.d.ts +0 -3
- package/dist/components/layout/ServiceWizardStepper/components/DesktopStepper.d.ts +2 -1
- package/dist/components/layout/ServiceWizardStepper/components/MobileStepper.d.ts +2 -1
- package/dist/components/layout/ServiceWizardStepper/components/StyledStepLabel.d.ts +2 -2
- package/dist/components/layout/ServiceWizardStepper/index.d.ts +3 -2
- package/dist/library/icons.d.ts +1 -3
- package/dist/library/index.d.ts +6 -14
- package/dist/library/types.d.ts +2 -0
- package/dist/registrucentras-rc-ses-react-components.cjs +11 -11
- package/dist/registrucentras-rc-ses-react-components.js +2530 -2251
- package/dist/stories/components/display/Card.stories.d.ts +49 -0
- package/dist/stories/components/display/ImageCard.stories.d.ts +8 -0
- package/dist/stories/components/display/ListWithIcons.stories.d.ts +33 -0
- package/dist/stories/components/{Alert.stories.d.ts → feedback/Alert.stories.d.ts} +1 -1
- package/dist/stories/components/{Icons.stories.d.ts → icons/Icons.stories.d.ts} +1 -1
- package/dist/stories/components/inputs/FileDropzone.stories.d.ts +32 -0
- package/dist/stories/components/inputs/PhoneInput.stories.d.ts +24 -0
- package/dist/stories/components/inputs/SearchableField.stories.d.ts +2 -2
- package/dist/stories/components/inputs/Select.stories.d.ts +3 -3
- package/dist/stories/components/inputs/TextField.stories.d.ts +5 -5
- package/dist/stories/components/layout/Footer.stories.d.ts +8 -0
- package/dist/stories/components/{Accordion.stories.d.ts → navigation/Accordion.stories.d.ts} +2 -2
- package/dist/stories/components/{Breadcrumbs.stories.d.ts → navigation/Breadcrumbs.stories.d.ts} +1 -1
- package/dist/stories/components/{DataPagination.stories.d.ts → navigation/DataPagination.stories.d.ts} +1 -1
- package/dist/stories/components/navigation/ServiceWizardStepper.stories.d.ts +7 -0
- package/package.json +1 -1
- package/src/components/common/Accordion/hooks/useAccordionController.tsx +43 -11
- package/src/components/common/Card/index.test.tsx +36 -0
- package/src/components/common/Card/index.tsx +62 -22
- package/src/components/common/DataPagination/components/PaginationButton.tsx +1 -1
- package/src/components/common/DataPagination/index.tsx +1 -1
- package/src/components/common/ImageCard/index.test.tsx +78 -0
- package/src/components/common/ImageCard/index.tsx +43 -0
- package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +94 -0
- package/src/components/common/ListWithIcons/index.test.tsx +75 -0
- package/src/components/common/ListWithIcons/index.tsx +47 -0
- package/src/components/form/inputs/CheckboxFormControl.tsx +1 -1
- package/src/components/form/inputs/FileDropzone.tsx +1 -1
- package/src/components/form/inputs/FileUpload.tsx +9 -3
- package/src/components/form/inputs/NumberStepper.tsx +2 -2
- package/src/components/form/inputs/PhoneInputFormControl/components/RowComponent.tsx +1 -0
- package/src/components/form/inputs/RadioButtonGroup.tsx +1 -1
- package/src/components/layout/Footer/index.test.tsx +20 -0
- package/src/components/layout/Footer/index.tsx +33 -0
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/index.tsx +21 -4
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/utils.ts +0 -1
- package/src/components/layout/ServiceFormContainer/CardFormContainer/index.test.tsx +14 -12
- package/src/components/layout/ServiceFormContainer/CardFormContainer/index.tsx +4 -1
- package/src/components/layout/ServiceWizardStepper/StepperTypes.ts +0 -3
- package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.test.tsx +33 -4
- package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.tsx +6 -2
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.test.tsx +34 -7
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.tsx +4 -2
- package/src/components/layout/ServiceWizardStepper/components/StyledStepLabel.tsx +4 -2
- package/src/components/layout/ServiceWizardStepper/index.tsx +13 -21
- package/src/examples/CardMultipleStepForm/index.tsx +18 -31
- package/src/examples/HorizontalMultiStepForm/index.tsx +22 -17
- package/src/examples/ListWithPagination/index.tsx +41 -11
- package/src/library/icons.ts +3 -2
- package/src/library/index.ts +14 -22
- package/src/library/types.ts +6 -0
- package/src/stories/components/{buttons → actions}/Button.stories.tsx +1 -1
- package/src/stories/components/{Card.stories.tsx → display/Card.stories.tsx} +19 -1
- package/src/stories/components/{Card.test.tsx → display/Card.test.tsx} +2 -1
- package/src/stories/components/display/ImageCard.stories.tsx +54 -0
- package/src/stories/components/display/ListWithIcons.stories.tsx +74 -0
- package/src/stories/components/{Alert.stories.tsx → feedback/Alert.stories.tsx} +1 -1
- package/src/stories/components/form/CardFormContainer.stories.tsx +23 -33
- package/src/stories/components/form/CheckboxFormControl.stories.tsx +1 -1
- package/src/stories/components/form/ServiceFormActions.stories.tsx +1 -1
- package/src/stories/components/form/ServiceFormContainer.stories.tsx +1 -1
- package/src/stories/components/{Icons.stories.tsx → icons/Icons.stories.tsx} +1 -1
- package/src/stories/components/inputs/Checkbox.stories.tsx +1 -1
- package/src/stories/components/inputs/DatePicker.stories.tsx +1 -1
- package/src/stories/components/inputs/FileDropzone.stories.tsx +117 -0
- package/src/stories/components/inputs/FileUpload.stories.tsx +1 -1
- package/src/stories/components/inputs/NumberStepper.stories.tsx +1 -1
- package/src/stories/components/inputs/PhoneInput.stories.tsx +110 -0
- package/src/stories/components/inputs/RadioButtonGroup.stories.tsx +1 -1
- package/src/stories/components/inputs/SearchableField.stories.tsx +1 -1
- package/src/stories/components/inputs/Select.stories.tsx +1 -1
- package/src/stories/components/inputs/TextField.stories.tsx +1 -1
- package/src/stories/components/layout/Footer.stories.tsx +19 -0
- package/src/stories/components/{Accordion.stories.tsx → navigation/Accordion.stories.tsx} +1 -1
- package/src/stories/components/{Breadcrumbs.stories.tsx → navigation/Breadcrumbs.stories.tsx} +1 -1
- package/src/stories/components/{DataPagination.stories.tsx → navigation/DataPagination.stories.tsx} +1 -1
- package/src/stories/components/navigation/ServiceWizardStepper.stories.tsx +53 -0
- package/src/theme/light/MuiAutocomplete.ts +4 -0
- package/src/theme/light/MuiCard.tsx +16 -2
- package/src/theme/light/MuiInputBase.ts +3 -1
- package/dist/stories/ServiceWizardStepper.stories.d.ts +0 -7
- package/dist/stories/components/Card.stories.d.ts +0 -24
- package/src/stories/ServiceWizardStepper.stories.tsx +0 -39
- /package/dist/stories/components/{buttons → actions}/Button.stories.d.ts +0 -0
- /package/src/stories/components/{buttons → actions}/Button.test.ts +0 -0
|
@@ -3,7 +3,8 @@ import { composeStories } from '@storybook/react'
|
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
4
|
import { render, screen } from '@testing-library/react'
|
|
5
5
|
|
|
6
|
-
import theme from '
|
|
6
|
+
import theme from '@/theme/light'
|
|
7
|
+
|
|
7
8
|
import * as stories from './Card.stories'
|
|
8
9
|
|
|
9
10
|
const { Main } = composeStories(stories)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* eslint-disable react/function-component-definition */
|
|
2
|
+
import { Box } from '@mui/material'
|
|
3
|
+
import type { Meta, StoryFn } from '@storybook/react'
|
|
4
|
+
|
|
5
|
+
import MagnifyingGlassIcon from '@/assets/icons/MagnifyingGlassIcon'
|
|
6
|
+
import RcSesButton from '@/components/common/Button'
|
|
7
|
+
import RcSesImageCard from '@/components/common/ImageCard'
|
|
8
|
+
import palette from '@/theme/palette'
|
|
9
|
+
|
|
10
|
+
const meta: Meta<typeof RcSesImageCard> = {
|
|
11
|
+
title: 'components/display/ImageCard',
|
|
12
|
+
component: RcSesImageCard,
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default meta
|
|
17
|
+
|
|
18
|
+
const Template: StoryFn<typeof RcSesImageCard> = (args) => <RcSesImageCard {...args} />
|
|
19
|
+
|
|
20
|
+
const defaultImage = (
|
|
21
|
+
<Box sx={{ position: 'relative', display: 'inline-flex' }}>
|
|
22
|
+
<MagnifyingGlassIcon size={64} fillColor={palette.grey[400]} />
|
|
23
|
+
</Box>
|
|
24
|
+
)
|
|
25
|
+
|
|
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>,
|
|
33
|
+
}
|
|
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.',
|
|
41
|
+
}
|
|
42
|
+
|
|
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
|
+
),
|
|
54
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import CheckCircleFillIcon from '@/assets/icons/CheckCircleFillIcon'
|
|
4
|
+
import WarningFillIcon from '@/assets/icons/WarningFillIcon'
|
|
5
|
+
import ListWithIcons, {
|
|
6
|
+
type ListWithIconsItemData,
|
|
7
|
+
} from '@/components/common/ListWithIcons'
|
|
8
|
+
|
|
9
|
+
const baseItems: ListWithIconsItemData[] = [
|
|
10
|
+
{
|
|
11
|
+
id: 'status-ok',
|
|
12
|
+
icon: <CheckCircleFillIcon size={20} />,
|
|
13
|
+
text: 'Application received',
|
|
14
|
+
tooltip: 'The submission was successfully received.',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: 'status-review',
|
|
18
|
+
icon: <WarningFillIcon size={20} />,
|
|
19
|
+
text: 'Requires review',
|
|
20
|
+
tooltip: 'A specialist will review the provided details.',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'status-disabled',
|
|
24
|
+
icon: <WarningFillIcon size={20} />,
|
|
25
|
+
text: 'Unavailable item',
|
|
26
|
+
tooltip: 'This item is currently disabled.',
|
|
27
|
+
disabled: true,
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
const meta = {
|
|
32
|
+
title: 'components/display/ListWithIcons',
|
|
33
|
+
component: ListWithIcons,
|
|
34
|
+
tags: ['autodocs'],
|
|
35
|
+
args: {
|
|
36
|
+
items: baseItems,
|
|
37
|
+
layout: 'vertical',
|
|
38
|
+
isLoading: false,
|
|
39
|
+
},
|
|
40
|
+
argTypes: {
|
|
41
|
+
layout: {
|
|
42
|
+
control: {
|
|
43
|
+
type: 'radio',
|
|
44
|
+
},
|
|
45
|
+
options: ['vertical', 'horizontal'],
|
|
46
|
+
},
|
|
47
|
+
isLoading: {
|
|
48
|
+
control: {
|
|
49
|
+
type: 'boolean',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
items: {
|
|
53
|
+
control: false,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
} satisfies Meta<typeof ListWithIcons>
|
|
57
|
+
|
|
58
|
+
export default meta
|
|
59
|
+
|
|
60
|
+
type Story = StoryObj<typeof meta>
|
|
61
|
+
|
|
62
|
+
export const Main: Story = {}
|
|
63
|
+
|
|
64
|
+
export const Horizontal: Story = {
|
|
65
|
+
args: {
|
|
66
|
+
layout: 'horizontal',
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const Loading: Story = {
|
|
71
|
+
args: {
|
|
72
|
+
isLoading: true,
|
|
73
|
+
},
|
|
74
|
+
}
|
|
@@ -13,7 +13,7 @@ const lorem =
|
|
|
13
13
|
const severities = ['info', 'warning', 'error', 'success'] as const
|
|
14
14
|
|
|
15
15
|
const meta: Meta<typeof RcSesAlert> = {
|
|
16
|
-
title: 'components/
|
|
16
|
+
title: 'components/feedback/Alert',
|
|
17
17
|
component: RcSesAlert,
|
|
18
18
|
tags: ['autodocs'],
|
|
19
19
|
}
|
|
@@ -8,26 +8,27 @@ import FieldView from '@/components/storybook/FieldView'
|
|
|
8
8
|
import Fields from '@/components/storybook/Fields'
|
|
9
9
|
|
|
10
10
|
const shortSteps: StepItem[] = [
|
|
11
|
-
{ id: '1',
|
|
12
|
-
{ id: '2',
|
|
13
|
-
{ id: '3',
|
|
11
|
+
{ id: '1', title: 'Paslauga' },
|
|
12
|
+
{ id: '2', title: 'Duomenys' },
|
|
13
|
+
{ id: '3', title: 'Patvirtinimas' },
|
|
14
14
|
]
|
|
15
15
|
|
|
16
16
|
const longSteps: StepItem[] = [
|
|
17
|
-
{ id: '1',
|
|
18
|
-
{ id: '2',
|
|
19
|
-
{ id: '3',
|
|
20
|
-
{ id: '4',
|
|
21
|
-
{ id: '5',
|
|
17
|
+
{ id: '1', title: 'Paslauga' },
|
|
18
|
+
{ id: '2', title: 'Duomenys' },
|
|
19
|
+
{ id: '3', title: 'Dokumentai' },
|
|
20
|
+
{ id: '4', title: 'Mokėjimas' },
|
|
21
|
+
{ id: '5', title: 'Patvirtinimas' },
|
|
22
22
|
]
|
|
23
23
|
|
|
24
24
|
const meta: Meta<typeof RcSesCardFormContainer> = {
|
|
25
|
-
title: 'components/
|
|
25
|
+
title: 'components/form/CardFormContainer',
|
|
26
26
|
component: RcSesCardFormContainer,
|
|
27
27
|
tags: ['autodocs'],
|
|
28
28
|
argTypes: {
|
|
29
29
|
steps: { table: { disable: true } },
|
|
30
30
|
onStepClick: { table: { disable: true } },
|
|
31
|
+
activeStep: { table: { disable: true } },
|
|
31
32
|
},
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -58,35 +59,23 @@ const DemoContent = () => (
|
|
|
58
59
|
|
|
59
60
|
const createTemplate =
|
|
60
61
|
(
|
|
61
|
-
|
|
62
|
+
steps: StepItem[],
|
|
62
63
|
forcedLayout?: 'row' | 'column',
|
|
63
64
|
): StoryFn<typeof RcSesCardFormContainer> =>
|
|
64
65
|
(args) => {
|
|
65
|
-
const [
|
|
66
|
-
const activeStep = currentSteps.findIndex((s) => s.state === 'active')
|
|
66
|
+
const [activeStep, setActiveStep] = useState(0)
|
|
67
67
|
|
|
68
68
|
const handleBack = () => {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const updated = currentSteps.map((step, index) => {
|
|
72
|
-
if (index < activeStep - 1) return { ...step, state: 'completed' as const }
|
|
73
|
-
if (index === activeStep - 1) return { ...step, state: 'active' as const }
|
|
74
|
-
return { ...step, state: 'pending' as const }
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
setCurrentSteps(updated)
|
|
69
|
+
setActiveStep((prev) => Math.max(prev - 1, 0))
|
|
78
70
|
}
|
|
79
71
|
|
|
80
72
|
const handleNext = () => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const updated = currentSteps.map((step, index) => {
|
|
84
|
-
if (index < activeStep + 1) return { ...step, state: 'completed' as const }
|
|
85
|
-
if (index === activeStep + 1) return { ...step, state: 'active' as const }
|
|
86
|
-
return { ...step, state: 'pending' as const }
|
|
87
|
-
})
|
|
73
|
+
setActiveStep((prev) => Math.min(prev + 1, steps.length - 1))
|
|
74
|
+
}
|
|
88
75
|
|
|
89
|
-
|
|
76
|
+
const handleStepClick = (index: number) => {
|
|
77
|
+
if (index > activeStep) return
|
|
78
|
+
setActiveStep(index)
|
|
90
79
|
}
|
|
91
80
|
|
|
92
81
|
return (
|
|
@@ -95,10 +84,11 @@ const createTemplate =
|
|
|
95
84
|
<RcSesCardFormContainer
|
|
96
85
|
{...args}
|
|
97
86
|
layout={forcedLayout}
|
|
98
|
-
steps={
|
|
99
|
-
|
|
87
|
+
steps={steps}
|
|
88
|
+
activeStep={activeStep}
|
|
89
|
+
onStepClick={handleStepClick}
|
|
100
90
|
leadingActions={
|
|
101
|
-
<Button onClick={handleBack} disabled={activeStep
|
|
91
|
+
<Button onClick={handleBack} disabled={activeStep === 0}>
|
|
102
92
|
Back
|
|
103
93
|
</Button>
|
|
104
94
|
}
|
|
@@ -108,7 +98,7 @@ const createTemplate =
|
|
|
108
98
|
<Button
|
|
109
99
|
variant='contained'
|
|
110
100
|
onClick={handleNext}
|
|
111
|
-
disabled={activeStep ===
|
|
101
|
+
disabled={activeStep === steps.length - 1}
|
|
112
102
|
>
|
|
113
103
|
Next
|
|
114
104
|
</Button>
|
|
@@ -9,7 +9,7 @@ import Fields from '@/components/storybook/Fields'
|
|
|
9
9
|
const variants = ['outlined', 'flat']
|
|
10
10
|
|
|
11
11
|
const meta: Meta<typeof RcSesCheckboxFormControl> = {
|
|
12
|
-
title: 'components/
|
|
12
|
+
title: 'components/form/CheckboxFormControl',
|
|
13
13
|
component: RcSesCheckboxFormControl,
|
|
14
14
|
argTypes: {
|
|
15
15
|
variant: {
|
|
@@ -8,7 +8,7 @@ import FieldView from '@/components/storybook/FieldView'
|
|
|
8
8
|
import Fields from '@/components/storybook/Fields'
|
|
9
9
|
|
|
10
10
|
const meta: Meta<typeof RcSesServiceFormActions> = {
|
|
11
|
-
title: 'components/
|
|
11
|
+
title: 'components/form/ServiceFormActions',
|
|
12
12
|
component: RcSesServiceFormActions,
|
|
13
13
|
tags: ['autodocs'],
|
|
14
14
|
}
|
|
@@ -11,7 +11,7 @@ import Fields from '@/components/storybook/Fields'
|
|
|
11
11
|
import BasicInformationForm from '@/examples/MultipleStepForm/components/BasicInformationForm'
|
|
12
12
|
|
|
13
13
|
const meta: Meta<typeof RcSesServiceFormContainer> = {
|
|
14
|
-
title: 'components/
|
|
14
|
+
title: 'components/form/ServiceFormContainer',
|
|
15
15
|
component: RcSesServiceFormContainer,
|
|
16
16
|
argTypes: {
|
|
17
17
|
accordionController: {
|
|
@@ -11,7 +11,7 @@ import Fields from '@/components/storybook/Fields'
|
|
|
11
11
|
import SingleStepFormModel from '@/examples/SingleStepForm/types/SingleStepFormModel'
|
|
12
12
|
|
|
13
13
|
const meta: Meta<typeof RcSesDatepicker> = {
|
|
14
|
-
title: 'components/
|
|
14
|
+
title: 'components/inputs/DatePicker',
|
|
15
15
|
component: RcSesDatepicker,
|
|
16
16
|
argTypes: {
|
|
17
17
|
clearable: {
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/* eslint-disable react/function-component-definition */
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react'
|
|
3
|
+
import { FieldError, useForm } from 'react-hook-form'
|
|
4
|
+
|
|
5
|
+
import RcSesFileDropzone from '@/components/form/inputs/FileDropzone'
|
|
6
|
+
import FieldPreviewRow from '@/components/storybook/FieldPreviewRow'
|
|
7
|
+
import FieldView from '@/components/storybook/FieldView'
|
|
8
|
+
import Fields from '@/components/storybook/Fields'
|
|
9
|
+
import PreviewTitle from '@/components/storybook/PreviewTitle'
|
|
10
|
+
|
|
11
|
+
type FormModel = {
|
|
12
|
+
documents: File[]
|
|
13
|
+
documentsDisabled: File[]
|
|
14
|
+
documentsError: File[]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const meta: Meta<typeof RcSesFileDropzone> = {
|
|
18
|
+
title: 'components/inputs/FileDropzone',
|
|
19
|
+
component: RcSesFileDropzone,
|
|
20
|
+
argTypes: {
|
|
21
|
+
control: {
|
|
22
|
+
table: {
|
|
23
|
+
disable: true,
|
|
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
|
+
},
|
|
46
|
+
},
|
|
47
|
+
tags: ['autodocs'],
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default meta
|
|
51
|
+
|
|
52
|
+
const Template: StoryFn<typeof RcSesFileDropzone> = (args) => {
|
|
53
|
+
const {
|
|
54
|
+
control,
|
|
55
|
+
formState: { errors },
|
|
56
|
+
} = useForm<FormModel>({
|
|
57
|
+
mode: 'all',
|
|
58
|
+
defaultValues: {
|
|
59
|
+
documents: [],
|
|
60
|
+
documentsDisabled: [],
|
|
61
|
+
documentsError: [],
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const { label, slotProps } = args
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Fields>
|
|
69
|
+
<FieldView>
|
|
70
|
+
<RcSesFileDropzone
|
|
71
|
+
id='documents'
|
|
72
|
+
name='documents'
|
|
73
|
+
control={control}
|
|
74
|
+
rules={{ required: true }}
|
|
75
|
+
label={label}
|
|
76
|
+
errors={errors?.documents as FieldError | undefined}
|
|
77
|
+
slotProps={slotProps}
|
|
78
|
+
/>
|
|
79
|
+
</FieldView>
|
|
80
|
+
|
|
81
|
+
<FieldPreviewRow>
|
|
82
|
+
<PreviewTitle>State previews</PreviewTitle>
|
|
83
|
+
|
|
84
|
+
<RcSesFileDropzone
|
|
85
|
+
id='documentsDisabled'
|
|
86
|
+
name='documentsDisabled'
|
|
87
|
+
control={control}
|
|
88
|
+
rules={{ required: true }}
|
|
89
|
+
label='Disabled'
|
|
90
|
+
disabled
|
|
91
|
+
errors={errors?.documentsDisabled as FieldError | undefined}
|
|
92
|
+
slotProps={slotProps}
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<RcSesFileDropzone
|
|
96
|
+
id='documentsError'
|
|
97
|
+
name='documentsError'
|
|
98
|
+
control={control}
|
|
99
|
+
rules={{ required: true }}
|
|
100
|
+
label='Error'
|
|
101
|
+
errors={{ message: 'Error Message', type: 'required' }}
|
|
102
|
+
slotProps={slotProps}
|
|
103
|
+
/>
|
|
104
|
+
</FieldPreviewRow>
|
|
105
|
+
</Fields>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const Main = Template.bind({})
|
|
110
|
+
Main.args = {
|
|
111
|
+
label: 'Upload files',
|
|
112
|
+
slotProps: {
|
|
113
|
+
wrapper: {
|
|
114
|
+
labelSubtitle: 'Tinkami formatai: .doc, .docx, .pdf',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/* eslint-disable react/function-component-definition */
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react'
|
|
3
|
+
import { useForm } from 'react-hook-form'
|
|
4
|
+
|
|
5
|
+
import RcSesPhoneInput from '@/components/form/inputs/PhoneInput'
|
|
6
|
+
import FieldPreviewRow from '@/components/storybook/FieldPreviewRow'
|
|
7
|
+
import FieldView from '@/components/storybook/FieldView'
|
|
8
|
+
import Fields from '@/components/storybook/Fields'
|
|
9
|
+
import PreviewTitle from '@/components/storybook/PreviewTitle'
|
|
10
|
+
|
|
11
|
+
type FormModel = {
|
|
12
|
+
phone: string
|
|
13
|
+
phoneDisabled: string
|
|
14
|
+
phoneError: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const meta: Meta<typeof RcSesPhoneInput> = {
|
|
18
|
+
title: 'components/inputs/PhoneInput',
|
|
19
|
+
component: RcSesPhoneInput,
|
|
20
|
+
argTypes: {
|
|
21
|
+
control: {
|
|
22
|
+
table: {
|
|
23
|
+
disable: true,
|
|
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
|
+
},
|
|
46
|
+
},
|
|
47
|
+
tags: ['autodocs'],
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default meta
|
|
51
|
+
|
|
52
|
+
const Template: StoryFn<typeof RcSesPhoneInput> = (args) => {
|
|
53
|
+
const {
|
|
54
|
+
control,
|
|
55
|
+
formState: { errors },
|
|
56
|
+
} = useForm<FormModel>({
|
|
57
|
+
mode: 'all',
|
|
58
|
+
defaultValues: {
|
|
59
|
+
phone: '',
|
|
60
|
+
phoneDisabled: '',
|
|
61
|
+
phoneError: '',
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const { label, slotProps } = args
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Fields>
|
|
69
|
+
<FieldView>
|
|
70
|
+
<RcSesPhoneInput
|
|
71
|
+
id='phone'
|
|
72
|
+
name='phone'
|
|
73
|
+
control={control}
|
|
74
|
+
rules={{ required: true }}
|
|
75
|
+
label={label}
|
|
76
|
+
errors={errors?.phone}
|
|
77
|
+
slotProps={slotProps}
|
|
78
|
+
/>
|
|
79
|
+
</FieldView>
|
|
80
|
+
|
|
81
|
+
<FieldPreviewRow>
|
|
82
|
+
<PreviewTitle>State previews</PreviewTitle>
|
|
83
|
+
<RcSesPhoneInput
|
|
84
|
+
id='phoneDisabled'
|
|
85
|
+
name='phoneDisabled'
|
|
86
|
+
control={control}
|
|
87
|
+
rules={{ required: true }}
|
|
88
|
+
label='Disabled'
|
|
89
|
+
disabled
|
|
90
|
+
errors={errors?.phoneDisabled}
|
|
91
|
+
slotProps={slotProps}
|
|
92
|
+
/>
|
|
93
|
+
<RcSesPhoneInput
|
|
94
|
+
id='phoneError'
|
|
95
|
+
name='phoneError'
|
|
96
|
+
control={control}
|
|
97
|
+
rules={{ required: true }}
|
|
98
|
+
label='Error'
|
|
99
|
+
errors={{ message: 'Error Message', type: 'required' }}
|
|
100
|
+
slotProps={slotProps}
|
|
101
|
+
/>
|
|
102
|
+
</FieldPreviewRow>
|
|
103
|
+
</Fields>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const Main = Template.bind({})
|
|
108
|
+
Main.args = {
|
|
109
|
+
label: 'Phone number',
|
|
110
|
+
}
|
|
@@ -15,7 +15,7 @@ type FormModel = {
|
|
|
15
15
|
const variants = ['outlined', 'filled', 'flat']
|
|
16
16
|
|
|
17
17
|
const meta: Meta<typeof RcSesRadioButtonGroup> = {
|
|
18
|
-
title: 'components/
|
|
18
|
+
title: 'components/inputs/RadioButtonGroup',
|
|
19
19
|
component: RcSesRadioButtonGroup,
|
|
20
20
|
argTypes: {
|
|
21
21
|
variant: {
|
|
@@ -7,7 +7,7 @@ import ObjectIdentifierSearchModal from '@/examples/SingleStepForm/components/Ob
|
|
|
7
7
|
import SingleStepFormModel from '@/examples/SingleStepForm/types/SingleStepFormModel'
|
|
8
8
|
|
|
9
9
|
const meta: Meta<typeof RcSesSearchableField> = {
|
|
10
|
-
title: 'components/
|
|
10
|
+
title: 'components/inputs/SearchableField',
|
|
11
11
|
component: RcSesSearchableField,
|
|
12
12
|
tags: ['autodocs'],
|
|
13
13
|
}
|
|
@@ -10,7 +10,7 @@ import PreviewTitle from '@/components/storybook/PreviewTitle'
|
|
|
10
10
|
import SingleStepFormModel from '@/examples/SingleStepForm/types/SingleStepFormModel'
|
|
11
11
|
|
|
12
12
|
const meta: Meta<typeof RcSesSelect> = {
|
|
13
|
-
title: 'components/
|
|
13
|
+
title: 'components/inputs/Select',
|
|
14
14
|
component: RcSesSelect,
|
|
15
15
|
argTypes: {
|
|
16
16
|
disabled: {
|
|
@@ -8,7 +8,7 @@ import Fields from '@/components/storybook/Fields'
|
|
|
8
8
|
import PreviewTitle from '@/components/storybook/PreviewTitle'
|
|
9
9
|
|
|
10
10
|
const meta: Meta<typeof RcSesTextField> = {
|
|
11
|
-
title: 'components/
|
|
11
|
+
title: 'components/inputs/TextField',
|
|
12
12
|
component: RcSesTextField,
|
|
13
13
|
tags: ['autodocs'],
|
|
14
14
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable react/function-component-definition */
|
|
2
|
+
import type { Meta, StoryFn } from '@storybook/react'
|
|
3
|
+
|
|
4
|
+
import RcSesFooter from '@/components/layout/Footer'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof RcSesFooter> = {
|
|
7
|
+
title: 'components/layout/Footer',
|
|
8
|
+
component: RcSesFooter,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default meta
|
|
13
|
+
|
|
14
|
+
const Template: StoryFn<typeof RcSesFooter> = (args) => <RcSesFooter {...args} />
|
|
15
|
+
|
|
16
|
+
export const Main = Template.bind({})
|
|
17
|
+
Main.args = {
|
|
18
|
+
text: '© Valstybės įmonė Registrų centras. Duomenys apie įmonę kaupiami ir saugomi Juridinių asmenų registre.\nStudentų g. 39, LT-08106 Vilnius | tel. +370 5 268 8262 | el. p. info@registrucentras.lt | įmonės kodas 124110246 | PVM mokėtojo kodas LT241102419',
|
|
19
|
+
}
|
|
@@ -7,7 +7,7 @@ import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer/
|
|
|
7
7
|
import FieldView from '@/components/storybook/FieldView'
|
|
8
8
|
|
|
9
9
|
const meta: Meta<typeof RcSesAccordion> = {
|
|
10
|
-
title: 'components/
|
|
10
|
+
title: 'components/navigation/Accordion',
|
|
11
11
|
component: RcSesAccordion,
|
|
12
12
|
argTypes: {
|
|
13
13
|
disabled: {
|
package/src/stories/components/{DataPagination.stories.tsx → navigation/DataPagination.stories.tsx}
RENAMED
|
@@ -5,7 +5,7 @@ import { useState } from 'react'
|
|
|
5
5
|
import DataPagination from '@/components/common/DataPagination'
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
8
|
-
title: 'components/
|
|
8
|
+
title: 'components/navigation/DataPagination',
|
|
9
9
|
component: DataPagination,
|
|
10
10
|
tags: ['autodocs'],
|
|
11
11
|
args: {
|