@registrucentras/rc-ses-react-components 1.3.1 → 1.4.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/README.md +3 -1
- package/dist/assets/IconProps.d.ts +4 -2
- package/dist/assets/icons/ArrowLeftIcon.d.ts +3 -0
- package/dist/assets/icons/ArrowRightIcon.d.ts +1 -1
- package/dist/assets/icons/BarcodeIcon.d.ts +3 -0
- package/dist/assets/icons/CalendarBlankIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDoubleLeftBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDoubleRightBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDownBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDownFill.d.ts +2 -2
- package/dist/assets/icons/CaretDownIcon.d.ts +1 -1
- package/dist/assets/icons/CaretLeftBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretLeftIcon.d.ts +1 -1
- package/dist/assets/icons/CaretRightBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CheckBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CheckCircleFillIcon.d.ts +2 -2
- package/dist/assets/icons/CheckUncheckedBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CircleFilledIcon.d.ts +3 -0
- package/dist/assets/icons/CloseIcon.d.ts +1 -1
- package/dist/assets/icons/CollapseChevronsIcon.d.ts +1 -1
- package/dist/assets/icons/DotCircleFilledIcon.d.ts +3 -0
- package/dist/assets/icons/ExpandChevronsIcon.d.ts +1 -1
- package/dist/assets/icons/InfoFillIcon.d.ts +1 -1
- package/dist/assets/icons/MagnifyingGlassIcon.d.ts +2 -2
- package/dist/assets/icons/MapPinAreaIcon.d.ts +3 -0
- package/dist/assets/icons/MinusBoldIcon.d.ts +1 -1
- package/dist/assets/icons/PlusBoldIcon.d.ts +1 -1
- package/dist/assets/icons/QuestionFillIcon.d.ts +1 -1
- package/dist/assets/icons/QuestionIcon.d.ts +1 -1
- package/dist/assets/icons/ScalesIcon.d.ts +3 -0
- package/dist/assets/icons/ScrollIcon.d.ts +1 -1
- package/dist/assets/icons/SpinnerGapBoldIcon.d.ts +1 -1
- package/dist/assets/icons/UploadSimpleIcon.d.ts +1 -1
- package/dist/assets/icons/WarningDiamondFillIcon.d.ts +1 -1
- package/dist/assets/icons/WarningFillIcon.d.ts +1 -1
- package/dist/assets/icons/XCircleFillIcon.d.ts +2 -2
- package/dist/components/common/Button/index.d.ts +2 -2
- package/dist/components/common/Card/index.d.ts +31 -0
- package/dist/components/common/DataPagination/components/PaginationButton.d.ts +8 -0
- package/dist/components/common/DataPagination/index.d.ts +10 -0
- package/dist/components/layout/ServiceFormContainer/utils.d.ts +4 -0
- package/dist/components/layout/ServiceWizardStepper/StepConnector.d.ts +7 -0
- package/dist/components/layout/ServiceWizardStepper/StepperTypes.d.ts +7 -0
- package/dist/components/layout/ServiceWizardStepper/components/CustomStepIcon.d.ts +3 -0
- package/dist/components/layout/ServiceWizardStepper/components/DesktopStepper.d.ts +9 -0
- package/dist/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.d.ts +6 -0
- package/dist/components/layout/ServiceWizardStepper/components/MobileStepper.d.ts +8 -0
- package/dist/components/layout/ServiceWizardStepper/components/StyledStepLabel.d.ts +11 -0
- package/dist/components/layout/ServiceWizardStepper/index.d.ts +6 -5
- package/dist/library/icons.d.ts +27 -3
- package/dist/library/index.d.ts +6 -2
- package/dist/registrucentras-rc-ses-react-components.cjs +12 -12
- package/dist/registrucentras-rc-ses-react-components.js +3882 -2672
- package/dist/stories/ServiceWizardStepper.stories.d.ts +7 -0
- package/dist/stories/components/Accordion.stories.d.ts +2 -2
- package/dist/stories/components/Card.stories.d.ts +24 -0
- package/dist/stories/components/DataPagination.stories.d.ts +47 -0
- package/dist/stories/components/Icons.stories.d.ts +6 -0
- package/dist/stories/components/buttons/Button.stories.d.ts +10 -0
- package/dist/stories/components/form/CheckboxFormControl.stories.d.ts +2 -2
- package/dist/stories/components/inputs/Checkbox.stories.d.ts +2 -2
- package/dist/stories/components/inputs/FileUpload.stories.d.ts +2 -2
- package/dist/stories/components/inputs/NumberStepper.stories.d.ts +2 -2
- package/dist/stories/components/inputs/SearchableField.stories.d.ts +60 -60
- package/dist/stories/components/inputs/Select.stories.d.ts +126 -126
- package/dist/stories/components/inputs/TextField.stories.d.ts +113 -113
- package/dist/theme/light/MuiPagination.d.ts +2 -1
- package/package.json +2 -1
- package/src/App.tsx +8 -0
- package/src/assets/IconProps.ts +5 -2
- package/src/assets/icons/ArrowLeftIcon.tsx +16 -0
- package/src/assets/icons/ArrowRightIcon.tsx +8 -13
- package/src/assets/icons/BarcodeIcon.tsx +9 -0
- package/src/assets/icons/CalendarBlankIcon.tsx +4 -16
- package/src/assets/icons/CaretDoubleLeftBoldIcon.tsx +14 -12
- package/src/assets/icons/CaretDoubleRightBoldIcon.tsx +14 -12
- package/src/assets/icons/CaretDownBoldIcon.tsx +9 -12
- package/src/assets/icons/CaretDownFill.tsx +11 -10
- package/src/assets/icons/CaretDownIcon.tsx +4 -16
- package/src/assets/icons/CaretLeftBoldIcon.tsx +9 -12
- package/src/assets/icons/CaretLeftIcon.tsx +4 -16
- package/src/assets/icons/CaretRightBoldIcon.tsx +9 -12
- package/src/assets/icons/CheckBoldIcon.tsx +9 -24
- package/src/assets/icons/CheckCircleFillIcon.tsx +10 -14
- package/src/assets/icons/CheckUncheckedBoldIcon.tsx +4 -23
- package/src/assets/icons/CircleFilledIcon.tsx +11 -0
- package/src/assets/icons/CloseIcon.tsx +4 -16
- package/src/assets/icons/CollapseChevronsIcon.tsx +9 -13
- package/src/assets/icons/DotCircleFilledIcon.tsx +23 -0
- package/src/assets/icons/ExpandChevronsIcon.tsx +9 -13
- package/src/assets/icons/InfoFillIcon.tsx +4 -14
- package/src/assets/icons/MagnifyingGlassIcon.tsx +5 -12
- package/src/assets/icons/MapPinAreaIcon.tsx +9 -0
- package/src/assets/icons/MinusBoldIcon.tsx +4 -14
- package/src/assets/icons/PlusBoldIcon.tsx +4 -14
- package/src/assets/icons/QuestionFillIcon.tsx +9 -13
- package/src/assets/icons/QuestionIcon.tsx +4 -16
- package/src/assets/icons/ScalesIcon.tsx +9 -0
- package/src/assets/icons/ScrollIcon.tsx +4 -16
- package/src/assets/icons/SpinnerGapBoldIcon.tsx +9 -12
- package/src/assets/icons/UploadSimpleIcon.tsx +4 -16
- package/src/assets/icons/WarningDiamondFillIcon.tsx +9 -13
- package/src/assets/icons/WarningFillIcon.tsx +9 -13
- package/src/assets/icons/XCircleFillIcon.tsx +11 -10
- package/src/components/common/Button/index.tsx +34 -3
- package/src/components/common/Card/index.test.tsx +136 -0
- package/src/components/common/Card/index.tsx +231 -0
- package/src/components/common/DataPagination/components/PaginationButton.tsx +63 -0
- package/src/components/common/DataPagination/index.test.tsx +122 -0
- package/src/components/common/DataPagination/index.tsx +70 -0
- package/src/components/form/inputs/CheckboxFormControl.tsx +1 -11
- package/src/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.tsx +1 -1
- package/src/components/form/inputs/PhoneInputFormControl/index.tsx +3 -4
- package/src/components/layout/ServiceFormContainer/index.tsx +5 -1
- package/src/components/layout/ServiceFormContainer/utils.ts +12 -0
- package/src/components/layout/ServiceWizardStepper/ServiceWizardStepper.css +69 -0
- package/src/components/layout/ServiceWizardStepper/StepConnector.tsx +29 -0
- package/src/components/layout/ServiceWizardStepper/StepperTypes.ts +7 -0
- package/src/components/layout/ServiceWizardStepper/components/CustomStepIcon.test.tsx +22 -0
- package/src/components/layout/ServiceWizardStepper/components/CustomStepIcon.tsx +41 -0
- package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.test.tsx +40 -0
- package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.tsx +48 -0
- package/src/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.test.tsx +24 -0
- package/src/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.tsx +46 -0
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.test.tsx +21 -0
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.tsx +54 -0
- package/src/components/layout/ServiceWizardStepper/components/StyledStepLabel.tsx +53 -0
- package/src/components/layout/ServiceWizardStepper/index.tsx +56 -37
- package/src/examples/HorizontalMultiStepForm/index.tsx +64 -0
- package/src/examples/ListWithPagination/index.tsx +44 -0
- package/src/library/icons.ts +51 -4
- package/src/library/index.ts +6 -2
- package/src/main.tsx +10 -0
- package/src/stories/ServiceWizardStepper.stories.tsx +39 -0
- package/src/stories/components/Card.stories.tsx +51 -0
- package/src/stories/components/Card.test.tsx +18 -0
- package/src/stories/components/DataPagination.stories.tsx +75 -0
- package/src/stories/components/Icons.stories.tsx +352 -0
- package/src/stories/components/buttons/Button.stories.tsx +30 -0
- package/src/theme/light/MuiAlert.tsx +10 -10
- package/src/theme/light/MuiButton.tsx +42 -15
- package/src/theme/light/MuiCard.tsx +2 -2
- package/src/theme/light/MuiPagination.ts +40 -12
- package/src/theme/light/index.tsx +2 -1
- package/src/types/buttons/ButtonProps.tsx +3 -1
- package/dist/assets/icons/CheckBoldDisabledIcon.d.ts +0 -3
- package/dist/components/layout/ServiceWizardStepper/components/ActiveStepIcon.d.ts +0 -2
- package/dist/components/layout/ServiceWizardStepper/components/CompletedStepIcon.d.ts +0 -2
- package/dist/components/layout/ServiceWizardStepper/components/PendingStepIcon.d.ts +0 -2
- package/src/assets/icons/CheckBoldDisabledIcon.tsx +0 -32
- package/src/components/layout/ServiceWizardStepper/components/ActiveStepIcon.tsx +0 -15
- package/src/components/layout/ServiceWizardStepper/components/CompletedStepIcon.tsx +0 -19
- package/src/components/layout/ServiceWizardStepper/components/PendingStepIcon.tsx +0 -15
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Typography } from '@mui/material'
|
|
2
|
+
|
|
3
|
+
import ServiceHeader from '@/components/layout/ServiceHeader'
|
|
4
|
+
import ServicePage from '@/components/layout/ServicePage'
|
|
5
|
+
import ServiceWizardStepper from '@/components/layout/ServiceWizardStepper'
|
|
6
|
+
import { StepItem } from '@/components/layout/ServiceWizardStepper/StepperTypes'
|
|
7
|
+
|
|
8
|
+
const steps3: StepItem[] = [
|
|
9
|
+
{ id: '1', state: 'completed', title: '1-2 žodžių tekstas' },
|
|
10
|
+
{ id: '2', state: 'active', title: '1-2 žodžių tekstas' },
|
|
11
|
+
{ id: '3', state: 'pending', title: '1-2 žodžių tekstas' },
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
const steps4: StepItem[] = [
|
|
15
|
+
{ id: '1', state: 'active', title: '1-2 žodžių tekstas' },
|
|
16
|
+
{ id: '2', state: 'pending', title: '1-2 žodžių tekstas' },
|
|
17
|
+
{ id: '3', state: 'pending', title: '1-2 žodžių tekstas' },
|
|
18
|
+
{ id: '4', state: 'pending', title: '1-2 žodžių tekstas' },
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
const steps5: StepItem[] = [
|
|
22
|
+
{ id: '1', state: 'completed', title: '1-2 žodžių tekstas' },
|
|
23
|
+
{ id: '2', state: 'completed', title: '1-2 žodžių tekstas' },
|
|
24
|
+
{ id: '3', state: 'active', title: '1-2 žodžių tekstas' },
|
|
25
|
+
{ id: '4', state: 'pending', title: '1-2 žodžių tekstas' },
|
|
26
|
+
{ id: '5', state: 'pending', title: '1-2 žodžių tekstas' },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
function HorizontalMultipleStepForm() {
|
|
30
|
+
return (
|
|
31
|
+
<ServicePage>
|
|
32
|
+
<ServiceHeader
|
|
33
|
+
breadcrumbsProps={{
|
|
34
|
+
path: [
|
|
35
|
+
{ label: 'Pagrindinis', path: '/' },
|
|
36
|
+
{
|
|
37
|
+
label: 'Horizontalios formos su vedliu pavyzdys',
|
|
38
|
+
path: '/horizontal-sample-form-multiple-steps',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
}}
|
|
42
|
+
title='Nekilnojamojo turto registro išrašas pagal nurodytą turto adresą'
|
|
43
|
+
>
|
|
44
|
+
<Typography variant='body1'>
|
|
45
|
+
Šiame puslapyje Jūs galite užsisakyti Nekilnojamojo turto registro išrašus,
|
|
46
|
+
pažymas bei kitus dokumentus. Užsakytą NTR išrašą, pažymą ar kitą dokumentą
|
|
47
|
+
galėsite gauti elektroniniu būdu arba atsiimti pasirinktame VĮ Registrų centro
|
|
48
|
+
padalinyje.
|
|
49
|
+
</Typography>
|
|
50
|
+
</ServiceHeader>
|
|
51
|
+
|
|
52
|
+
<div
|
|
53
|
+
style={{ padding: '2rem', display: 'flex', flexDirection: 'column', gap: '2rem' }}
|
|
54
|
+
>
|
|
55
|
+
<ServiceWizardStepper steps={steps3} />
|
|
56
|
+
<ServiceWizardStepper steps={steps4} />
|
|
57
|
+
<ServiceWizardStepper steps={steps5} />
|
|
58
|
+
</div>
|
|
59
|
+
<ServiceWizardStepper steps={steps5} />
|
|
60
|
+
</ServicePage>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default HorizontalMultipleStepForm
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Grid, Typography } from '@mui/material'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
|
|
4
|
+
import DataPagination from '@/components/common/DataPagination'
|
|
5
|
+
import ServicePage from '@/components/layout/ServicePage'
|
|
6
|
+
|
|
7
|
+
function ListWithPagination() {
|
|
8
|
+
const [page, setPage] = useState(1)
|
|
9
|
+
const ITEMS_PER_PAGE = 5
|
|
10
|
+
|
|
11
|
+
const mockData = React.useMemo(
|
|
12
|
+
() =>
|
|
13
|
+
Array.from({ length: 42 }, (_, i) => ({
|
|
14
|
+
id: i + 1,
|
|
15
|
+
name: `Item ${i + 1}`,
|
|
16
|
+
})),
|
|
17
|
+
[],
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
const paginatedData = React.useMemo(() => {
|
|
21
|
+
const start = (page - 1) * ITEMS_PER_PAGE
|
|
22
|
+
return mockData.slice(start, start + ITEMS_PER_PAGE)
|
|
23
|
+
}, [page, mockData])
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<ServicePage>
|
|
27
|
+
<Grid container spacing={2} sx={{ mt: 2 }}>
|
|
28
|
+
{paginatedData.map((item) => (
|
|
29
|
+
<Grid item xs={12} key={item.id}>
|
|
30
|
+
<Typography>{item.name}</Typography>
|
|
31
|
+
</Grid>
|
|
32
|
+
))}
|
|
33
|
+
</Grid>
|
|
34
|
+
|
|
35
|
+
<DataPagination
|
|
36
|
+
count={Math.ceil(mockData.length / ITEMS_PER_PAGE)}
|
|
37
|
+
page={page}
|
|
38
|
+
onChange={setPage}
|
|
39
|
+
/>
|
|
40
|
+
</ServicePage>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default ListWithPagination
|
package/src/library/icons.ts
CHANGED
|
@@ -1,25 +1,72 @@
|
|
|
1
1
|
import RcSesLogo from '@/assets/Logo'
|
|
2
|
+
import ArrowLeftIcon from '@/assets/icons/ArrowLeftIcon'
|
|
2
3
|
import ArrowRightIcon from '@/assets/icons/ArrowRightIcon'
|
|
4
|
+
import BarcodeIcon from '@/assets/icons/BarcodeIcon'
|
|
5
|
+
import CalendarBlankIcon from '@/assets/icons/CalendarBlankIcon'
|
|
3
6
|
import CaretDoubleLeftBoldIcon from '@/assets/icons/CaretDoubleLeftBoldIcon'
|
|
4
7
|
import CaretDoubleRightBoldIcon from '@/assets/icons/CaretDoubleRightBoldIcon'
|
|
5
8
|
import CaretDownBoldIcon from '@/assets/icons/CaretDownBoldIcon'
|
|
9
|
+
import CaretDownFill from '@/assets/icons/CaretDownFill'
|
|
6
10
|
import CaretDownIcon from '@/assets/icons/CaretDownIcon'
|
|
7
11
|
import CaretLeftBoldIcon from '@/assets/icons/CaretLeftBoldIcon'
|
|
8
12
|
import CaretLeftIcon from '@/assets/icons/CaretLeftIcon'
|
|
9
13
|
import CaretRightBoldIcon from '@/assets/icons/CaretRightBoldIcon'
|
|
10
|
-
import CheckBoldDisabledIcon from '@/assets/icons/CheckBoldDisabledIcon'
|
|
11
14
|
import CheckBoldIcon from '@/assets/icons/CheckBoldIcon'
|
|
15
|
+
import CheckCircleFillIcon from '@/assets/icons/CheckCircleFillIcon'
|
|
16
|
+
import CheckUncheckedBoldIcon from '@/assets/icons/CheckUncheckedBoldIcon'
|
|
17
|
+
import CircleFilledIcon from '@/assets/icons/CircleFilledIcon'
|
|
18
|
+
import CloseIcon from '@/assets/icons/CloseIcon'
|
|
19
|
+
import CollapseChevronsIcon from '@/assets/icons/CollapseChevronsIcon'
|
|
20
|
+
import DotCircleFilledIcon from '@/assets/icons/DotCircleFilledIcon'
|
|
21
|
+
import ExpandChevronsIcon from '@/assets/icons/ExpandChevronsIcon'
|
|
22
|
+
import InfoFillIcon from '@/assets/icons/InfoFillIcon'
|
|
23
|
+
import MagnifyingGlassIcon from '@/assets/icons/MagnifyingGlassIcon'
|
|
24
|
+
import MapPinAreaIcon from '@/assets/icons/MapPinAreaIcon'
|
|
25
|
+
import MinusBoldIcon from '@/assets/icons/MinusBoldIcon'
|
|
26
|
+
import PlusBoldIcon from '@/assets/icons/PlusBoldIcon'
|
|
27
|
+
import QuestionFillIcon from '@/assets/icons/QuestionFillIcon'
|
|
28
|
+
import QuestionIcon from '@/assets/icons/QuestionIcon'
|
|
29
|
+
import ScalesIcon from '@/assets/icons/ScalesIcon'
|
|
30
|
+
import ScrollIcon from '@/assets/icons/ScrollIcon'
|
|
31
|
+
import SpinnerGapBoldIcon from '@/assets/icons/SpinnerGapBoldIcon'
|
|
32
|
+
import UploadSimpleIcon from '@/assets/icons/UploadSimpleIcon'
|
|
33
|
+
import WarningDiamondFillIcon from '@/assets/icons/WarningDiamondFillIcon'
|
|
34
|
+
import WarningFillIcon from '@/assets/icons/WarningFillIcon'
|
|
35
|
+
import XCircleFillIcon from '@/assets/icons/XCircleFillIcon'
|
|
12
36
|
|
|
13
37
|
export { RcSesLogo }
|
|
14
|
-
export { ArrowRightIcon }
|
|
38
|
+
export { ArrowRightIcon, ArrowLeftIcon }
|
|
15
39
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
40
|
+
BarcodeIcon,
|
|
41
|
+
CalendarBlankIcon,
|
|
18
42
|
CaretDoubleLeftBoldIcon,
|
|
19
43
|
CaretDoubleRightBoldIcon,
|
|
20
44
|
CaretDownBoldIcon,
|
|
45
|
+
CaretDownFill,
|
|
21
46
|
CaretDownIcon,
|
|
22
47
|
CaretLeftBoldIcon,
|
|
23
48
|
CaretLeftIcon,
|
|
24
49
|
CaretRightBoldIcon,
|
|
50
|
+
CheckBoldIcon,
|
|
51
|
+
CheckCircleFillIcon,
|
|
52
|
+
CheckUncheckedBoldIcon,
|
|
53
|
+
CircleFilledIcon,
|
|
54
|
+
CloseIcon,
|
|
55
|
+
CollapseChevronsIcon,
|
|
56
|
+
DotCircleFilledIcon,
|
|
57
|
+
ExpandChevronsIcon,
|
|
58
|
+
InfoFillIcon,
|
|
59
|
+
MagnifyingGlassIcon,
|
|
60
|
+
MapPinAreaIcon,
|
|
61
|
+
MinusBoldIcon,
|
|
62
|
+
PlusBoldIcon,
|
|
63
|
+
QuestionFillIcon,
|
|
64
|
+
QuestionIcon,
|
|
65
|
+
ScalesIcon,
|
|
66
|
+
ScrollIcon,
|
|
67
|
+
SpinnerGapBoldIcon,
|
|
68
|
+
UploadSimpleIcon,
|
|
69
|
+
WarningDiamondFillIcon,
|
|
70
|
+
WarningFillIcon,
|
|
71
|
+
XCircleFillIcon,
|
|
25
72
|
}
|
package/src/library/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type {} from '@mui/x-date-pickers/themeAugmentation'
|
|
|
4
4
|
|
|
5
5
|
import RcSesIconProps from '@/assets/IconProps'
|
|
6
6
|
import RcSesLogo from '@/assets/Logo'
|
|
7
|
+
import ArrowLeftIcon from '@/assets/icons/ArrowLeftIcon'
|
|
7
8
|
import ArrowRightIcon from '@/assets/icons/ArrowRightIcon'
|
|
8
9
|
import CaretDoubleLeftBoldIcon from '@/assets/icons/CaretDoubleLeftBoldIcon'
|
|
9
10
|
import CaretDoubleRightBoldIcon from '@/assets/icons/CaretDoubleRightBoldIcon'
|
|
@@ -18,6 +19,8 @@ import RcSesAlert from '@/components/common/Alert'
|
|
|
18
19
|
import RcSesBreadcrumbs from '@/components/common/Breadcrumbs'
|
|
19
20
|
import RcSesButton from '@/components/common/Button'
|
|
20
21
|
import RcSesButtonWithPopover from '@/components/common/Button/ButtonWithPopover'
|
|
22
|
+
import RcSesCard from '@/components/common/Card'
|
|
23
|
+
import DataPagination from '@/components/common/DataPagination'
|
|
21
24
|
import RcSesIconWithCircularBackground from '@/components/common/IconWithCircularBackground'
|
|
22
25
|
import RcSesTab from '@/components/common/Tabs/Tab'
|
|
23
26
|
import RcSesTabPanel from '@/components/common/Tabs/TabPanel'
|
|
@@ -51,7 +54,7 @@ declare module '@mui/x-date-pickers/models' {
|
|
|
51
54
|
|
|
52
55
|
export { RcSesPalette, RcSesTheme }
|
|
53
56
|
export { RcSesAccordion, useAccordionController }
|
|
54
|
-
export { RcSesAlert, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover }
|
|
57
|
+
export { RcSesAlert, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesCard }
|
|
55
58
|
export { RcSesCheckbox, RcSesCheckboxFormControl }
|
|
56
59
|
export { RcSesDatepicker }
|
|
57
60
|
export { RcSesFileUpload }
|
|
@@ -63,6 +66,7 @@ export { RcSesSearchableField }
|
|
|
63
66
|
export { RcSesSelect }
|
|
64
67
|
export { RcSesTab, RcSesTabPanel, RcSesTabs, RcSesTabsWrapper }
|
|
65
68
|
export { RcSesTextField }
|
|
69
|
+
export { DataPagination }
|
|
66
70
|
|
|
67
71
|
export {
|
|
68
72
|
RcSesServiceFormActions,
|
|
@@ -76,7 +80,7 @@ export type { RcSesIconProps }
|
|
|
76
80
|
export { RcSesIconWithCircularBackground }
|
|
77
81
|
|
|
78
82
|
export { RcSesLogo }
|
|
79
|
-
export { ArrowRightIcon }
|
|
83
|
+
export { ArrowRightIcon, ArrowLeftIcon }
|
|
80
84
|
export {
|
|
81
85
|
CaretDoubleLeftBoldIcon,
|
|
82
86
|
CaretDoubleRightBoldIcon,
|
package/src/main.tsx
CHANGED
|
@@ -13,6 +13,8 @@ import { RouterProvider, createBrowserRouter } from 'react-router-dom'
|
|
|
13
13
|
import theme from '@/theme/light'
|
|
14
14
|
|
|
15
15
|
import App from './App'
|
|
16
|
+
import HorizontalMultipleStepForm from './examples/HorizontalMultiStepForm'
|
|
17
|
+
import ListWithPagination from './examples/ListWithPagination'
|
|
16
18
|
import MultipleStepForm from './examples/MultipleStepForm'
|
|
17
19
|
import SingleStepForm from './examples/SingleStepForm'
|
|
18
20
|
import i18n from './i18n/i18n'
|
|
@@ -31,6 +33,14 @@ const router = createBrowserRouter([
|
|
|
31
33
|
path: '/multi-step-form',
|
|
32
34
|
element: <MultipleStepForm />,
|
|
33
35
|
},
|
|
36
|
+
{
|
|
37
|
+
path: '/pagination',
|
|
38
|
+
element: <ListWithPagination />,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
path: '/horizontal-multi-step-form',
|
|
42
|
+
element: <HorizontalMultipleStepForm />,
|
|
43
|
+
},
|
|
34
44
|
])
|
|
35
45
|
|
|
36
46
|
const adapterLocale = i18n.language === 'lt' ? lt : enUS
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import ServiceWizardStepper from '../components/layout/ServiceWizardStepper'
|
|
4
|
+
import { StepItem } from '../components/layout/ServiceWizardStepper/StepperTypes'
|
|
5
|
+
|
|
6
|
+
const steps: StepItem[] = [
|
|
7
|
+
{ id: '1', title: 'Step 1', state: 'completed' },
|
|
8
|
+
{ id: '2', title: 'Step 2', state: 'active' },
|
|
9
|
+
{ id: '3', title: 'Step 3', state: 'pending' },
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof ServiceWizardStepper> = {
|
|
13
|
+
title: 'Components/ServiceWizardStepper',
|
|
14
|
+
component: ServiceWizardStepper,
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
argTypes: {
|
|
17
|
+
orientation: {
|
|
18
|
+
control: 'radio',
|
|
19
|
+
options: ['horizontal', 'vertical'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
export default meta
|
|
24
|
+
|
|
25
|
+
type Story = StoryObj<typeof ServiceWizardStepper>
|
|
26
|
+
|
|
27
|
+
export const Horizontal: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
steps,
|
|
30
|
+
orientation: 'horizontal',
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const Vertical: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
steps,
|
|
37
|
+
orientation: 'vertical',
|
|
38
|
+
},
|
|
39
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* eslint-disable react/function-component-definition */
|
|
2
|
+
import { Box, Typography } from '@mui/material'
|
|
3
|
+
import type { Meta, StoryFn } from '@storybook/react'
|
|
4
|
+
|
|
5
|
+
import CaretLeftIcon from '@/assets/icons/CaretLeftIcon'
|
|
6
|
+
import RcSesButton from '@/components/common/Button'
|
|
7
|
+
import RcSesCard from '@/components/common/Card'
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof RcSesCard> = {
|
|
10
|
+
title: 'components/common/Card',
|
|
11
|
+
component: RcSesCard,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default meta
|
|
16
|
+
|
|
17
|
+
const Template: StoryFn<typeof RcSesCard> = (args) => <RcSesCard {...args} />
|
|
18
|
+
|
|
19
|
+
export const Main = Template.bind({})
|
|
20
|
+
Main.args = {
|
|
21
|
+
title: 'Pavadinimas',
|
|
22
|
+
description: 'Papildomas aprasymo tekstas',
|
|
23
|
+
children: (
|
|
24
|
+
<Box
|
|
25
|
+
sx={{
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
color: 'text.primary',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
justifyContent: 'center',
|
|
30
|
+
minHeight: { xs: '9.625rem', md: '11.5rem' },
|
|
31
|
+
px: 3,
|
|
32
|
+
width: '100%',
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<Typography align='center'>Vidinis paslaugu front-end sprendimas</Typography>
|
|
36
|
+
</Box>
|
|
37
|
+
),
|
|
38
|
+
leadingActions: (
|
|
39
|
+
<RcSesButton startIcon={<CaretLeftIcon />} color='grey' variant='outlined'>
|
|
40
|
+
Button
|
|
41
|
+
</RcSesButton>
|
|
42
|
+
),
|
|
43
|
+
trailingActions: (
|
|
44
|
+
<>
|
|
45
|
+
<RcSesButton color='grey' variant='outlined'>
|
|
46
|
+
Button
|
|
47
|
+
</RcSesButton>
|
|
48
|
+
<RcSesButton>Button</RcSesButton>
|
|
49
|
+
</>
|
|
50
|
+
),
|
|
51
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ThemeProvider } from '@mui/material/styles'
|
|
2
|
+
import { composeStories } from '@storybook/react'
|
|
3
|
+
import '@testing-library/jest-dom'
|
|
4
|
+
import { render, screen } from '@testing-library/react'
|
|
5
|
+
|
|
6
|
+
import theme from '../../theme/light'
|
|
7
|
+
import * as stories from './Card.stories'
|
|
8
|
+
|
|
9
|
+
const { Main } = composeStories(stories)
|
|
10
|
+
|
|
11
|
+
test('reuses args from composed card story', () => {
|
|
12
|
+
render(<ThemeProvider theme={theme}>{Main()}</ThemeProvider>)
|
|
13
|
+
|
|
14
|
+
expect(screen.getByText(Main.args.title as string)).toBeInTheDocument()
|
|
15
|
+
expect(screen.getByText(Main.args.description as string)).toBeInTheDocument()
|
|
16
|
+
expect(screen.getByText('Vidinis paslaugu front-end sprendimas')).toBeInTheDocument()
|
|
17
|
+
expect(screen.getAllByRole('button', { name: 'Button' })).toHaveLength(3)
|
|
18
|
+
})
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Box, Typography } from '@mui/material'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
|
|
5
|
+
import DataPagination from '@/components/common/DataPagination'
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'components/common/DataPagination',
|
|
9
|
+
component: DataPagination,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
args: {
|
|
12
|
+
count: 12,
|
|
13
|
+
defaultPage: 1,
|
|
14
|
+
prevLabel: 'Atgal',
|
|
15
|
+
nextLabel: 'Kitas',
|
|
16
|
+
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
count: {
|
|
19
|
+
control: {
|
|
20
|
+
type: 'number',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultPage: {
|
|
24
|
+
control: {
|
|
25
|
+
type: 'number',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
page: {
|
|
29
|
+
control: {
|
|
30
|
+
type: 'number',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
onChange: {
|
|
34
|
+
action: 'pageChanged',
|
|
35
|
+
},
|
|
36
|
+
prevLabel: {
|
|
37
|
+
control: {
|
|
38
|
+
type: 'text',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
nextLabel: {
|
|
42
|
+
control: {
|
|
43
|
+
type: 'text',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
} satisfies Meta<typeof DataPagination>
|
|
48
|
+
|
|
49
|
+
export default meta
|
|
50
|
+
type Story = StoryObj<typeof meta>
|
|
51
|
+
|
|
52
|
+
export const Uncontrolled: Story = {}
|
|
53
|
+
|
|
54
|
+
export const Controlled: Story = {
|
|
55
|
+
render: (args) => {
|
|
56
|
+
const [page, setPage] = useState(args.page ?? 1)
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Box display='flex' flexDirection='column' gap={2}>
|
|
60
|
+
<Typography variant='body2'>Current page: {page}</Typography>
|
|
61
|
+
<DataPagination
|
|
62
|
+
{...args}
|
|
63
|
+
page={page}
|
|
64
|
+
onChange={(nextPage) => {
|
|
65
|
+
setPage(nextPage)
|
|
66
|
+
args.onChange?.(nextPage)
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
</Box>
|
|
70
|
+
)
|
|
71
|
+
},
|
|
72
|
+
args: {
|
|
73
|
+
page: 1,
|
|
74
|
+
},
|
|
75
|
+
}
|