@registrucentras/rc-ses-react-components 1.4.0 → 1.5.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/{components → AccordionFormContainer/components}/AccordionCollapseControls.d.ts +1 -1
- package/dist/components/layout/ServiceFormContainer/{index.d.ts → AccordionFormContainer/index.d.ts} +1 -1
- package/dist/components/layout/ServiceFormContainer/AccordionFormContainer/utils.d.ts +4 -0
- package/dist/components/layout/ServiceFormContainer/CardFormContainer/index.d.ts +12 -0
- package/dist/components/layout/ServiceWizardStepper/StepperTypes.d.ts +0 -3
- package/dist/components/layout/ServiceWizardStepper/components/DesktopStepper.d.ts +3 -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 +5 -2
- package/dist/library/icons.d.ts +1 -3
- package/dist/library/index.d.ts +12 -16
- package/dist/library/types.d.ts +6 -0
- package/dist/registrucentras-rc-ses-react-components.cjs +12 -12
- package/dist/registrucentras-rc-ses-react-components.js +2472 -2130
- package/dist/stories/ServiceWizardStepper.stories.d.ts +5 -5
- package/dist/stories/components/Card.stories.d.ts +26 -1
- package/dist/stories/components/ImageCard.stories.d.ts +8 -0
- package/dist/stories/components/ListWithIcons.stories.d.ts +33 -0
- package/dist/stories/components/form/CardFormContainer.stories.d.ts +7 -0
- package/dist/stories/components/form/ServiceFormContainer.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/package.json +1 -1
- package/src/App.tsx +4 -0
- 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/{index.tsx → AccordionFormContainer/index.tsx} +22 -5
- package/src/components/layout/ServiceFormContainer/{utils.ts → AccordionFormContainer/utils.ts} +2 -3
- package/src/components/layout/ServiceFormContainer/CardFormContainer/index.test.tsx +80 -0
- package/src/components/layout/ServiceFormContainer/CardFormContainer/index.tsx +71 -0
- package/src/components/layout/ServiceWizardStepper/ServiceWizardStepper.css +19 -3
- package/src/components/layout/ServiceWizardStepper/StepConnector.tsx +1 -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 +23 -4
- 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 +8 -2
- package/src/components/layout/ServiceWizardStepper/index.tsx +19 -20
- package/src/examples/CardMultipleStepForm/index.tsx +80 -0
- package/src/examples/HorizontalMultiStepForm/index.tsx +22 -17
- package/src/examples/ListWithPagination/index.tsx +41 -11
- package/src/examples/MultipleStepForm/index.tsx +1 -1
- package/src/examples/SingleStepForm/index.tsx +1 -1
- package/src/library/icons.ts +3 -2
- package/src/library/index.ts +20 -23
- package/src/library/types.ts +11 -0
- package/src/main.tsx +5 -0
- package/src/stories/ServiceWizardStepper.stories.tsx +28 -14
- package/src/stories/components/Accordion.stories.tsx +1 -1
- package/src/stories/components/Card.stories.tsx +18 -0
- package/src/stories/components/ImageCard.stories.tsx +54 -0
- package/src/stories/components/ListWithIcons.stories.tsx +74 -0
- package/src/stories/components/form/CardFormContainer.stories.tsx +125 -0
- package/src/stories/components/form/ServiceFormContainer.stories.tsx +1 -1
- package/src/stories/components/inputs/FileDropzone.stories.tsx +117 -0
- package/src/stories/components/inputs/PhoneInput.stories.tsx +110 -0
- package/src/stories/components/layout/Footer.stories.tsx +19 -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/components/layout/ServiceFormContainer/utils.d.ts +0 -4
- /package/src/components/layout/ServiceFormContainer/{components → AccordionFormContainer/components}/AccordionCollapseControls.tsx +0 -0
|
@@ -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/common/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/common/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
|
+
}
|
|
@@ -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,6 +7,8 @@ const MuiAutocomplete: Components['MuiAutocomplete'] = {
|
|
|
7
7
|
styleOverrides: {
|
|
8
8
|
root: {
|
|
9
9
|
'.MuiOutlinedInput-root': {
|
|
10
|
+
borderRadius: '.5rem',
|
|
11
|
+
|
|
10
12
|
'.MuiAutocomplete-input': {
|
|
11
13
|
marginRight: '2rem',
|
|
12
14
|
padding: '.25rem .1875rem',
|
|
@@ -14,12 +16,14 @@ const MuiAutocomplete: Components['MuiAutocomplete'] = {
|
|
|
14
16
|
},
|
|
15
17
|
},
|
|
16
18
|
paper: {
|
|
19
|
+
borderRadius: '.5rem',
|
|
17
20
|
fontSize: '.9375rem',
|
|
18
21
|
lineHeight: '1.125rem',
|
|
19
22
|
|
|
20
23
|
'.MuiAutocomplete-listbox': {
|
|
21
24
|
'.MuiAutocomplete-option': {
|
|
22
25
|
alignItems: 'flex-start',
|
|
26
|
+
borderRadius: '.375rem',
|
|
23
27
|
flexDirection: 'column',
|
|
24
28
|
margin: '0 .375rem',
|
|
25
29
|
padding: '.8125rem .75rem',
|
|
@@ -5,14 +5,28 @@ import Colors from '@/theme/palette'
|
|
|
5
5
|
const MuiCard: Components['MuiCard'] = {
|
|
6
6
|
defaultProps: {
|
|
7
7
|
elevation: 0,
|
|
8
|
+
variant: 'outlined',
|
|
8
9
|
},
|
|
9
10
|
styleOverrides: {
|
|
10
11
|
root: {
|
|
11
|
-
border: '1px solid',
|
|
12
|
-
borderColor: Colors.grey['300'],
|
|
13
12
|
borderRadius: '1rem',
|
|
14
13
|
},
|
|
15
14
|
},
|
|
15
|
+
variants: [
|
|
16
|
+
{
|
|
17
|
+
props: { variant: 'outlined' },
|
|
18
|
+
style: {
|
|
19
|
+
border: '1px solid',
|
|
20
|
+
borderColor: Colors.grey['300'],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
props: { variant: 'elevation' },
|
|
25
|
+
style: {
|
|
26
|
+
border: 'none',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
16
30
|
}
|
|
17
31
|
|
|
18
32
|
export default MuiCard
|
|
@@ -7,7 +7,7 @@ const MuiInputBase: Components['MuiInputBase'] = {
|
|
|
7
7
|
styleOverrides: {
|
|
8
8
|
root: {
|
|
9
9
|
backgroundColor: 'white',
|
|
10
|
-
borderRadius: '.
|
|
10
|
+
borderRadius: '.5rem',
|
|
11
11
|
|
|
12
12
|
'.MuiInputBase-input': {
|
|
13
13
|
color: palette.grey['900'],
|
|
@@ -34,6 +34,7 @@ const MuiInputBase: Components['MuiInputBase'] = {
|
|
|
34
34
|
'&.Mui-focused': {
|
|
35
35
|
'.MuiOutlinedInput-notchedOutline': {
|
|
36
36
|
borderColor: `${palette.grey['900']} !important`,
|
|
37
|
+
borderRadius: '.5rem',
|
|
37
38
|
boxShadow: `0px 0px 0px 3px rgba(${decomposeColor(palette.grey['900']).values}, .2)`,
|
|
38
39
|
},
|
|
39
40
|
|
|
@@ -41,6 +42,7 @@ const MuiInputBase: Components['MuiInputBase'] = {
|
|
|
41
42
|
'.MuiOutlinedInput-notchedOutline': {
|
|
42
43
|
borderColor: `${palette.error['600']} !important`,
|
|
43
44
|
borderWidth: '.125rem',
|
|
45
|
+
borderRadius: '.5rem',
|
|
44
46
|
boxShadow: `0px 0px 0px 3px rgba(${decomposeColor(palette.error['600']).values}, .2)`,
|
|
45
47
|
},
|
|
46
48
|
},
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { AccordionControllerState } from '../../common/Accordion/types/AccordionControllerState';
|
|
2
|
-
import { StepItem } from '../ServiceWizardStepper/StepperTypes';
|
|
3
|
-
declare function mapAccordionStateToSteps(state: AccordionControllerState): StepItem[];
|
|
4
|
-
export default mapAccordionStateToSteps;
|