@registrucentras/rc-ses-react-components 1.3.1 → 1.4.1

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 (169) hide show
  1. package/README.md +3 -1
  2. package/dist/assets/IconProps.d.ts +4 -2
  3. package/dist/assets/icons/ArrowLeftIcon.d.ts +3 -0
  4. package/dist/assets/icons/ArrowRightIcon.d.ts +1 -1
  5. package/dist/assets/icons/BarcodeIcon.d.ts +3 -0
  6. package/dist/assets/icons/CalendarBlankIcon.d.ts +1 -1
  7. package/dist/assets/icons/CaretDoubleLeftBoldIcon.d.ts +1 -1
  8. package/dist/assets/icons/CaretDoubleRightBoldIcon.d.ts +1 -1
  9. package/dist/assets/icons/CaretDownBoldIcon.d.ts +1 -1
  10. package/dist/assets/icons/CaretDownFill.d.ts +2 -2
  11. package/dist/assets/icons/CaretDownIcon.d.ts +1 -1
  12. package/dist/assets/icons/CaretLeftBoldIcon.d.ts +1 -1
  13. package/dist/assets/icons/CaretLeftIcon.d.ts +1 -1
  14. package/dist/assets/icons/CaretRightBoldIcon.d.ts +1 -1
  15. package/dist/assets/icons/CheckBoldIcon.d.ts +1 -1
  16. package/dist/assets/icons/CheckCircleFillIcon.d.ts +2 -2
  17. package/dist/assets/icons/CheckUncheckedBoldIcon.d.ts +1 -1
  18. package/dist/assets/icons/CircleFilledIcon.d.ts +3 -0
  19. package/dist/assets/icons/CloseIcon.d.ts +1 -1
  20. package/dist/assets/icons/CollapseChevronsIcon.d.ts +1 -1
  21. package/dist/assets/icons/DotCircleFilledIcon.d.ts +3 -0
  22. package/dist/assets/icons/ExpandChevronsIcon.d.ts +1 -1
  23. package/dist/assets/icons/InfoFillIcon.d.ts +1 -1
  24. package/dist/assets/icons/MagnifyingGlassIcon.d.ts +2 -2
  25. package/dist/assets/icons/MapPinAreaIcon.d.ts +3 -0
  26. package/dist/assets/icons/MinusBoldIcon.d.ts +1 -1
  27. package/dist/assets/icons/PlusBoldIcon.d.ts +1 -1
  28. package/dist/assets/icons/QuestionFillIcon.d.ts +1 -1
  29. package/dist/assets/icons/QuestionIcon.d.ts +1 -1
  30. package/dist/assets/icons/ScalesIcon.d.ts +3 -0
  31. package/dist/assets/icons/ScrollIcon.d.ts +1 -1
  32. package/dist/assets/icons/SpinnerGapBoldIcon.d.ts +1 -1
  33. package/dist/assets/icons/UploadSimpleIcon.d.ts +1 -1
  34. package/dist/assets/icons/WarningDiamondFillIcon.d.ts +1 -1
  35. package/dist/assets/icons/WarningFillIcon.d.ts +1 -1
  36. package/dist/assets/icons/XCircleFillIcon.d.ts +2 -2
  37. package/dist/components/common/Button/index.d.ts +2 -2
  38. package/dist/components/common/Card/index.d.ts +31 -0
  39. package/dist/components/common/DataPagination/components/PaginationButton.d.ts +8 -0
  40. package/dist/components/common/DataPagination/index.d.ts +10 -0
  41. package/dist/components/layout/ServiceFormContainer/{components → AccordionFormContainer/components}/AccordionCollapseControls.d.ts +1 -1
  42. package/dist/components/layout/ServiceFormContainer/{index.d.ts → AccordionFormContainer/index.d.ts} +1 -1
  43. package/dist/components/layout/ServiceFormContainer/AccordionFormContainer/utils.d.ts +4 -0
  44. package/dist/components/layout/ServiceFormContainer/CardFormContainer/index.d.ts +11 -0
  45. package/dist/components/layout/ServiceWizardStepper/StepConnector.d.ts +7 -0
  46. package/dist/components/layout/ServiceWizardStepper/StepperTypes.d.ts +7 -0
  47. package/dist/components/layout/ServiceWizardStepper/components/CustomStepIcon.d.ts +3 -0
  48. package/dist/components/layout/ServiceWizardStepper/components/DesktopStepper.d.ts +10 -0
  49. package/dist/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.d.ts +6 -0
  50. package/dist/components/layout/ServiceWizardStepper/components/MobileStepper.d.ts +8 -0
  51. package/dist/components/layout/ServiceWizardStepper/components/StyledStepLabel.d.ts +11 -0
  52. package/dist/components/layout/ServiceWizardStepper/index.d.ts +8 -5
  53. package/dist/library/icons.d.ts +27 -3
  54. package/dist/library/index.d.ts +12 -4
  55. package/dist/library/types.d.ts +4 -0
  56. package/dist/registrucentras-rc-ses-react-components.cjs +12 -12
  57. package/dist/registrucentras-rc-ses-react-components.js +3945 -2672
  58. package/dist/stories/ServiceWizardStepper.stories.d.ts +7 -0
  59. package/dist/stories/components/Accordion.stories.d.ts +2 -2
  60. package/dist/stories/components/Card.stories.d.ts +24 -0
  61. package/dist/stories/components/DataPagination.stories.d.ts +47 -0
  62. package/dist/stories/components/Icons.stories.d.ts +6 -0
  63. package/dist/stories/components/buttons/Button.stories.d.ts +10 -0
  64. package/dist/stories/components/form/CardFormContainer.stories.d.ts +7 -0
  65. package/dist/stories/components/form/CheckboxFormControl.stories.d.ts +2 -2
  66. package/dist/stories/components/form/ServiceFormContainer.stories.d.ts +1 -1
  67. package/dist/stories/components/inputs/Checkbox.stories.d.ts +2 -2
  68. package/dist/stories/components/inputs/FileUpload.stories.d.ts +2 -2
  69. package/dist/stories/components/inputs/NumberStepper.stories.d.ts +2 -2
  70. package/dist/stories/components/inputs/SearchableField.stories.d.ts +60 -60
  71. package/dist/stories/components/inputs/Select.stories.d.ts +126 -126
  72. package/dist/stories/components/inputs/TextField.stories.d.ts +113 -113
  73. package/dist/theme/light/MuiPagination.d.ts +2 -1
  74. package/package.json +2 -1
  75. package/src/App.tsx +12 -0
  76. package/src/assets/IconProps.ts +5 -2
  77. package/src/assets/icons/ArrowLeftIcon.tsx +16 -0
  78. package/src/assets/icons/ArrowRightIcon.tsx +8 -13
  79. package/src/assets/icons/BarcodeIcon.tsx +9 -0
  80. package/src/assets/icons/CalendarBlankIcon.tsx +4 -16
  81. package/src/assets/icons/CaretDoubleLeftBoldIcon.tsx +14 -12
  82. package/src/assets/icons/CaretDoubleRightBoldIcon.tsx +14 -12
  83. package/src/assets/icons/CaretDownBoldIcon.tsx +9 -12
  84. package/src/assets/icons/CaretDownFill.tsx +11 -10
  85. package/src/assets/icons/CaretDownIcon.tsx +4 -16
  86. package/src/assets/icons/CaretLeftBoldIcon.tsx +9 -12
  87. package/src/assets/icons/CaretLeftIcon.tsx +4 -16
  88. package/src/assets/icons/CaretRightBoldIcon.tsx +9 -12
  89. package/src/assets/icons/CheckBoldIcon.tsx +9 -24
  90. package/src/assets/icons/CheckCircleFillIcon.tsx +10 -14
  91. package/src/assets/icons/CheckUncheckedBoldIcon.tsx +4 -23
  92. package/src/assets/icons/CircleFilledIcon.tsx +11 -0
  93. package/src/assets/icons/CloseIcon.tsx +4 -16
  94. package/src/assets/icons/CollapseChevronsIcon.tsx +9 -13
  95. package/src/assets/icons/DotCircleFilledIcon.tsx +23 -0
  96. package/src/assets/icons/ExpandChevronsIcon.tsx +9 -13
  97. package/src/assets/icons/InfoFillIcon.tsx +4 -14
  98. package/src/assets/icons/MagnifyingGlassIcon.tsx +5 -12
  99. package/src/assets/icons/MapPinAreaIcon.tsx +9 -0
  100. package/src/assets/icons/MinusBoldIcon.tsx +4 -14
  101. package/src/assets/icons/PlusBoldIcon.tsx +4 -14
  102. package/src/assets/icons/QuestionFillIcon.tsx +9 -13
  103. package/src/assets/icons/QuestionIcon.tsx +4 -16
  104. package/src/assets/icons/ScalesIcon.tsx +9 -0
  105. package/src/assets/icons/ScrollIcon.tsx +4 -16
  106. package/src/assets/icons/SpinnerGapBoldIcon.tsx +9 -12
  107. package/src/assets/icons/UploadSimpleIcon.tsx +4 -16
  108. package/src/assets/icons/WarningDiamondFillIcon.tsx +9 -13
  109. package/src/assets/icons/WarningFillIcon.tsx +9 -13
  110. package/src/assets/icons/XCircleFillIcon.tsx +11 -10
  111. package/src/components/common/Button/index.tsx +34 -3
  112. package/src/components/common/Card/index.test.tsx +136 -0
  113. package/src/components/common/Card/index.tsx +231 -0
  114. package/src/components/common/DataPagination/components/PaginationButton.tsx +63 -0
  115. package/src/components/common/DataPagination/index.test.tsx +122 -0
  116. package/src/components/common/DataPagination/index.tsx +70 -0
  117. package/src/components/form/inputs/CheckboxFormControl.tsx +1 -11
  118. package/src/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.tsx +1 -1
  119. package/src/components/form/inputs/PhoneInputFormControl/index.tsx +3 -4
  120. package/src/components/layout/ServiceFormContainer/{index.tsx → AccordionFormContainer/index.tsx} +6 -2
  121. package/src/components/layout/ServiceFormContainer/AccordionFormContainer/utils.ts +12 -0
  122. package/src/components/layout/ServiceFormContainer/CardFormContainer/index.test.tsx +78 -0
  123. package/src/components/layout/ServiceFormContainer/CardFormContainer/index.tsx +68 -0
  124. package/src/components/layout/ServiceWizardStepper/ServiceWizardStepper.css +85 -0
  125. package/src/components/layout/ServiceWizardStepper/StepConnector.tsx +29 -0
  126. package/src/components/layout/ServiceWizardStepper/StepperTypes.ts +7 -0
  127. package/src/components/layout/ServiceWizardStepper/components/CustomStepIcon.test.tsx +22 -0
  128. package/src/components/layout/ServiceWizardStepper/components/CustomStepIcon.tsx +41 -0
  129. package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.test.tsx +40 -0
  130. package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.tsx +63 -0
  131. package/src/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.test.tsx +24 -0
  132. package/src/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.tsx +46 -0
  133. package/src/components/layout/ServiceWizardStepper/components/MobileStepper.test.tsx +21 -0
  134. package/src/components/layout/ServiceWizardStepper/components/MobileStepper.tsx +54 -0
  135. package/src/components/layout/ServiceWizardStepper/components/StyledStepLabel.tsx +57 -0
  136. package/src/components/layout/ServiceWizardStepper/index.tsx +63 -37
  137. package/src/examples/CardMultipleStepForm/index.tsx +93 -0
  138. package/src/examples/HorizontalMultiStepForm/index.tsx +64 -0
  139. package/src/examples/ListWithPagination/index.tsx +44 -0
  140. package/src/examples/MultipleStepForm/index.tsx +1 -1
  141. package/src/examples/SingleStepForm/index.tsx +1 -1
  142. package/src/library/icons.ts +51 -4
  143. package/src/library/index.ts +12 -3
  144. package/src/library/types.ts +5 -0
  145. package/src/main.tsx +15 -0
  146. package/src/stories/ServiceWizardStepper.stories.tsx +39 -0
  147. package/src/stories/components/Accordion.stories.tsx +1 -1
  148. package/src/stories/components/Card.stories.tsx +51 -0
  149. package/src/stories/components/Card.test.tsx +18 -0
  150. package/src/stories/components/DataPagination.stories.tsx +75 -0
  151. package/src/stories/components/Icons.stories.tsx +352 -0
  152. package/src/stories/components/buttons/Button.stories.tsx +30 -0
  153. package/src/stories/components/form/CardFormContainer.stories.tsx +135 -0
  154. package/src/stories/components/form/ServiceFormContainer.stories.tsx +1 -1
  155. package/src/theme/light/MuiAlert.tsx +10 -10
  156. package/src/theme/light/MuiButton.tsx +42 -15
  157. package/src/theme/light/MuiCard.tsx +2 -2
  158. package/src/theme/light/MuiPagination.ts +40 -12
  159. package/src/theme/light/index.tsx +2 -1
  160. package/src/types/buttons/ButtonProps.tsx +3 -1
  161. package/dist/assets/icons/CheckBoldDisabledIcon.d.ts +0 -3
  162. package/dist/components/layout/ServiceWizardStepper/components/ActiveStepIcon.d.ts +0 -2
  163. package/dist/components/layout/ServiceWizardStepper/components/CompletedStepIcon.d.ts +0 -2
  164. package/dist/components/layout/ServiceWizardStepper/components/PendingStepIcon.d.ts +0 -2
  165. package/src/assets/icons/CheckBoldDisabledIcon.tsx +0 -32
  166. package/src/components/layout/ServiceWizardStepper/components/ActiveStepIcon.tsx +0 -15
  167. package/src/components/layout/ServiceWizardStepper/components/CompletedStepIcon.tsx +0 -19
  168. package/src/components/layout/ServiceWizardStepper/components/PendingStepIcon.tsx +0 -15
  169. /package/src/components/layout/ServiceFormContainer/{components → AccordionFormContainer/components}/AccordionCollapseControls.tsx +0 -0
@@ -0,0 +1,57 @@
1
+ import { StepLabel, styled } from '@mui/material'
2
+
3
+ import palette, { grey } from '@/theme/palette'
4
+
5
+ import { StepItem } from '../StepperTypes'
6
+
7
+ interface StyledStepLabelProps {
8
+ stepState: StepItem['state']
9
+ orientation?: 'vertical' | 'horizontal'
10
+ isLast?: boolean
11
+ }
12
+
13
+ const StyledStepLabel = styled(StepLabel, {
14
+ shouldForwardProp: (prop) =>
15
+ prop !== 'stepState' && prop !== 'orientation' && prop !== 'isLast',
16
+ })<StyledStepLabelProps>(({ stepState, orientation, isLast }) => ({
17
+ '& .MuiStepLabel-label': {
18
+ fontWeight: stepState === 'active' ? 700 : 400,
19
+ color: stepState === 'pending' ? grey[500] : grey[800],
20
+ },
21
+ ...(orientation === 'vertical' && {
22
+ '& .MuiStepLabel-label.Mui-active': {
23
+ fontSize: '14px',
24
+ },
25
+ }),
26
+ ...(orientation === 'vertical' &&
27
+ !isLast && {
28
+ '&.MuiStepLabel-root.MuiStepLabel-vertical .MuiStepLabel-label': {
29
+ marginTop: 0,
30
+ },
31
+
32
+ '& .MuiStepLabel-iconContainer': {
33
+ position: 'relative',
34
+ },
35
+
36
+ '& .MuiStepLabel-iconContainer::after': {
37
+ content: '""',
38
+ position: 'absolute',
39
+ top: '100%',
40
+ left: '9px',
41
+ width: '2px',
42
+ height: '14px',
43
+ borderRadius: '2px',
44
+ backgroundColor:
45
+ stepState === 'completed' ? palette.primary[400] : palette.grey[300],
46
+ marginTop: '4px',
47
+ },
48
+ }),
49
+
50
+ ...(orientation === 'horizontal' && {
51
+ '& .MuiStepLabel-label.MuiStepLabel-alternativeLabel': {
52
+ marginTop: 4,
53
+ },
54
+ }),
55
+ }))
56
+
57
+ export default StyledStepLabel
@@ -1,43 +1,69 @@
1
- import Step from '@mui/material/Step'
2
- import StepLabel from '@mui/material/StepLabel'
3
- import Stepper from '@mui/material/Stepper'
4
- import React from 'react'
5
-
6
- import {
7
- AccordionControllerState,
8
- AccordionState,
9
- } from '@/components/common/Accordion/types/AccordionControllerState'
10
-
11
- import ActiveStepIcon from './components/ActiveStepIcon'
12
- import CompletedStepIcon from './components/CompletedStepIcon'
13
- import PendingStepIcon from './components/PendingStepIcon'
14
-
15
- type Props = {
16
- steps: AccordionControllerState
1
+ import { useMediaQuery, useTheme } from '@mui/material'
2
+ import { useEffect, useState } from 'react'
3
+
4
+ import './ServiceWizardStepper.css'
5
+ import { StepItem } from './StepperTypes'
6
+ import DesktopStepper from './components/DesktopStepper'
7
+ import MobileStepper from './components/MobileStepper'
8
+
9
+ export interface ServiceWizardStepperProps {
10
+ orientation?: 'vertical' | 'horizontal'
11
+ steps: StepItem[]
12
+ onStepClick?: (steps: StepItem[]) => void
13
+ isLoading?: boolean
17
14
  }
18
- function ServiceWizardStepper({ steps }: Props) {
19
- const getStepIcon = React.useCallback((state: AccordionState['state']) => {
20
- switch (state) {
21
- case 'active':
22
- return ActiveStepIcon
23
- case 'completed':
24
- return CompletedStepIcon
25
- default:
26
- return PendingStepIcon
27
- }
28
- }, [])
29
-
30
- const activeStep =
31
- Object.values(steps).findIndex((step) => step.state === 'active') ?? 0
15
+
16
+ const updateSteps = (index: number, prev: StepItem[]): StepItem[] =>
17
+ prev.map((step, i) => {
18
+ if (i < index) return { ...step, state: 'completed' }
19
+ if (i === index) return { ...step, state: 'active' }
20
+ return { ...step, state: 'pending' }
21
+ })
22
+
23
+ function ServiceWizardStepper({
24
+ steps,
25
+ orientation = 'horizontal',
26
+ onStepClick,
27
+ isLoading = false,
28
+ }: ServiceWizardStepperProps) {
29
+ const [currentSteps, setCurrentSteps] = useState(steps)
30
+
31
+ useEffect(() => {
32
+ setCurrentSteps(steps)
33
+ }, [steps])
34
+
35
+ const theme = useTheme()
36
+ const isMobile = useMediaQuery(theme.breakpoints.down('md'))
37
+
38
+ const resolvedOrientation = isMobile ? 'horizontal' : orientation
39
+
40
+ const activeStep = currentSteps.findIndex((s) => s.state === 'active') ?? 0
41
+
42
+ const handleStepClick = (index: number) => {
43
+ if (index < 0 || index > activeStep) return
44
+ const updatedSteps = updateSteps(index, currentSteps)
45
+ setCurrentSteps(updatedSteps)
46
+ onStepClick?.(updatedSteps)
47
+ }
48
+
49
+ if (isMobile) {
50
+ return (
51
+ <MobileStepper
52
+ stepEntries={currentSteps}
53
+ activeStep={activeStep}
54
+ handleStepClick={handleStepClick}
55
+ />
56
+ )
57
+ }
32
58
 
33
59
  return (
34
- <Stepper activeStep={activeStep} orientation='vertical' sx={{ mt: 6.5 }}>
35
- {Object.values(steps).map((step) => (
36
- <Step key={step.title}>
37
- <StepLabel StepIconComponent={getStepIcon(step.state)}>{step.title}</StepLabel>
38
- </Step>
39
- ))}
40
- </Stepper>
60
+ <DesktopStepper
61
+ stepEntries={currentSteps}
62
+ activeStep={activeStep}
63
+ handleStepClick={handleStepClick}
64
+ resolvedOrientation={resolvedOrientation}
65
+ isLoading={isLoading}
66
+ />
41
67
  )
42
68
  }
43
69
 
@@ -0,0 +1,93 @@
1
+ import { Button, Typography } from '@mui/material'
2
+ import { useState } from 'react'
3
+
4
+ import RcSesCardFormContainer from '@/components/layout/ServiceFormContainer/CardFormContainer'
5
+ import ServiceHeader from '@/components/layout/ServiceHeader'
6
+ import ServicePage from '@/components/layout/ServicePage'
7
+ import { StepItem } from '@/components/layout/ServiceWizardStepper/StepperTypes'
8
+
9
+ const steps: StepItem[] = [
10
+ { id: '1', state: 'completed', title: '1-2 žodžių tekstas' },
11
+ { id: '2', state: 'active', title: '1-2 žodžių tekstas' },
12
+ { id: '3', state: 'pending', title: '1-2 žodžių tekstas' },
13
+ { id: '4', state: 'pending', title: '1-2 žodžių tekstas' },
14
+ ]
15
+
16
+ function CardMultipleStepForm() {
17
+ const [currentSteps, setSteps] = useState(steps)
18
+ const activeStep = currentSteps.findIndex((s) => s.state === 'active')
19
+
20
+ const handleBack = () => {
21
+ if (activeStep <= 0) return
22
+
23
+ const updatedSteps: StepItem[] = currentSteps.map((step, index) => {
24
+ if (index < activeStep - 1) return { ...step, state: 'completed' }
25
+ if (index === activeStep - 1) return { ...step, state: 'active' }
26
+ return { ...step, state: 'pending' }
27
+ })
28
+
29
+ setSteps(updatedSteps)
30
+ }
31
+
32
+ const handleNext = () => {
33
+ const activeIndex = currentSteps.findIndex((s) => s.state === 'active')
34
+ if (activeIndex === -1 || activeIndex === currentSteps.length - 1) return
35
+ const updatedSteps: StepItem[] = currentSteps.map((step, index) => {
36
+ if (index < activeIndex + 1) return { ...step, state: 'completed' }
37
+ if (index === activeIndex + 1) return { ...step, state: 'active' }
38
+ return { ...step, state: 'pending' }
39
+ })
40
+ setSteps(updatedSteps)
41
+ }
42
+ return (
43
+ <ServicePage>
44
+ <ServiceHeader
45
+ breadcrumbsProps={{
46
+ path: [
47
+ { label: 'Pagrindinis', path: '/' },
48
+ {
49
+ label: 'Horizontalios formos su vedliu pavyzdys',
50
+ path: '/horizontal-sample-form-multiple-steps',
51
+ },
52
+ ],
53
+ }}
54
+ title='Nekilnojamojo turto registro išrašas pagal nurodytą turto adresą'
55
+ >
56
+ <Typography variant='body1'>
57
+ Šiame puslapyje Jūs galite užsisakyti Nekilnojamojo turto registro išrašus,
58
+ pažymas bei kitus dokumentus. Užsakytą NTR išrašą, pažymą ar kitą dokumentą
59
+ galėsite gauti elektroniniu būdu arba atsiimti pasirinktame VĮ Registrų centro
60
+ padalinyje.
61
+ </Typography>
62
+ </ServiceHeader>
63
+
64
+ <RcSesCardFormContainer
65
+ steps={currentSteps}
66
+ onStepClick={(newSteps) => setSteps(newSteps)}
67
+ title='Test'
68
+ description='Test description'
69
+ leadingActions={
70
+ <Button onClick={handleBack} disabled={activeStep === 0}>
71
+ Back
72
+ </Button>
73
+ }
74
+ trailingActions={
75
+ <>
76
+ <Button variant='outlined'>Button</Button>
77
+ <Button
78
+ variant='contained'
79
+ onClick={handleNext}
80
+ disabled={activeStep === currentSteps.length - 1}
81
+ >
82
+ Next
83
+ </Button>
84
+ </>
85
+ }
86
+ >
87
+ <Typography variant='body1'>{`Current Step: ${activeStep + 1}`}</Typography>
88
+ </RcSesCardFormContainer>
89
+ </ServicePage>
90
+ )
91
+ }
92
+
93
+ export default CardMultipleStepForm
@@ -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
@@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom'
4
4
  import RcSesAccordion from '@/components/common/Accordion'
5
5
  import useAccordionController from '@/components/common/Accordion/hooks/useAccordionController'
6
6
  import ServiceFormActions from '@/components/layout/ServiceFormActions'
7
- import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer'
7
+ import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer/AccordionFormContainer'
8
8
  import ServiceHeader from '@/components/layout/ServiceHeader'
9
9
  import ServicePage from '@/components/layout/ServicePage'
10
10
 
@@ -17,7 +17,7 @@ import RcSesSearchableField from '@/components/form/inputs/SearchableField'
17
17
  import RcSesSelect from '@/components/form/inputs/Select'
18
18
  import RcSesTextField from '@/components/form/inputs/TextField'
19
19
  import ServiceFormActions from '@/components/layout/ServiceFormActions'
20
- import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer'
20
+ import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer/AccordionFormContainer'
21
21
  import ServiceHeader from '@/components/layout/ServiceHeader'
22
22
  import ServicePage from '@/components/layout/ServicePage'
23
23
 
@@ -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
- CheckBoldDisabledIcon,
17
- CheckBoldIcon,
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
  }
@@ -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'
@@ -37,9 +40,11 @@ import RcSesSearchableField from '@/components/form/inputs/SearchableField'
37
40
  import RcSesSelect from '@/components/form/inputs/Select'
38
41
  import RcSesTextField from '@/components/form/inputs/TextField'
39
42
  import RcSesServiceFormActions from '@/components/layout/ServiceFormActions'
40
- import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer'
43
+ import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer/AccordionFormContainer'
44
+ import RcSesCardFormContainer from '@/components/layout/ServiceFormContainer/CardFormContainer'
41
45
  import RcSesServiceHeader from '@/components/layout/ServiceHeader'
42
46
  import RcSesServicePage from '@/components/layout/ServicePage'
47
+ import ServiceWizardStepper from '@/components/layout/ServiceWizardStepper'
43
48
  import RcSesTheme from '@/theme/light'
44
49
  import RcSesPalette from '@/theme/palette'
45
50
 
@@ -51,7 +56,7 @@ declare module '@mui/x-date-pickers/models' {
51
56
 
52
57
  export { RcSesPalette, RcSesTheme }
53
58
  export { RcSesAccordion, useAccordionController }
54
- export { RcSesAlert, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover }
59
+ export { RcSesAlert, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesCard }
55
60
  export { RcSesCheckbox, RcSesCheckboxFormControl }
56
61
  export { RcSesDatepicker }
57
62
  export { RcSesFileUpload }
@@ -63,10 +68,14 @@ export { RcSesSearchableField }
63
68
  export { RcSesSelect }
64
69
  export { RcSesTab, RcSesTabPanel, RcSesTabs, RcSesTabsWrapper }
65
70
  export { RcSesTextField }
71
+ export { DataPagination }
72
+ export { ServiceWizardStepper }
73
+ export type * from './types'
66
74
 
67
75
  export {
68
76
  RcSesServiceFormActions,
69
77
  RcSesServiceFormContainer,
78
+ RcSesCardFormContainer,
70
79
  RcSesFormControlWrapper,
71
80
  RcSesServiceHeader,
72
81
  RcSesServicePage,
@@ -76,7 +85,7 @@ export type { RcSesIconProps }
76
85
  export { RcSesIconWithCircularBackground }
77
86
 
78
87
  export { RcSesLogo }
79
- export { ArrowRightIcon }
88
+ export { ArrowRightIcon, ArrowLeftIcon }
80
89
  export {
81
90
  CaretDoubleLeftBoldIcon,
82
91
  CaretDoubleRightBoldIcon,
@@ -0,0 +1,5 @@
1
+ import { RcSesCardProps } from '@/components/common/Card'
2
+ import { RcSesCardFormContainerProps } from '@/components/layout/ServiceFormContainer/CardFormContainer'
3
+ import { ServiceWizardStepperProps } from '@/components/layout/ServiceWizardStepper'
4
+
5
+ export type { RcSesCardFormContainerProps, RcSesCardProps, ServiceWizardStepperProps }
package/src/main.tsx CHANGED
@@ -13,6 +13,9 @@ import { RouterProvider, createBrowserRouter } from 'react-router-dom'
13
13
  import theme from '@/theme/light'
14
14
 
15
15
  import App from './App'
16
+ import CardMultipleStepForm from './examples/CardMultipleStepForm'
17
+ import HorizontalMultipleStepForm from './examples/HorizontalMultiStepForm'
18
+ import ListWithPagination from './examples/ListWithPagination'
16
19
  import MultipleStepForm from './examples/MultipleStepForm'
17
20
  import SingleStepForm from './examples/SingleStepForm'
18
21
  import i18n from './i18n/i18n'
@@ -31,6 +34,18 @@ const router = createBrowserRouter([
31
34
  path: '/multi-step-form',
32
35
  element: <MultipleStepForm />,
33
36
  },
37
+ {
38
+ path: '/pagination',
39
+ element: <ListWithPagination />,
40
+ },
41
+ {
42
+ path: '/horizontal-multi-step-form',
43
+ element: <HorizontalMultipleStepForm />,
44
+ },
45
+ {
46
+ path: '/card-multi-step-form',
47
+ element: <CardMultipleStepForm />,
48
+ },
34
49
  ])
35
50
 
36
51
  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
+ }
@@ -3,7 +3,7 @@ import { Meta, StoryContext, StoryFn } from '@storybook/react'
3
3
 
4
4
  import RcSesAccordion from '@/components/common/Accordion'
5
5
  import useAccordionController from '@/components/common/Accordion/hooks/useAccordionController'
6
- import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer'
6
+ import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer/AccordionFormContainer'
7
7
  import FieldView from '@/components/storybook/FieldView'
8
8
 
9
9
  const meta: Meta<typeof RcSesAccordion> = {
@@ -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
+ }