@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.
Files changed (89) hide show
  1. package/dist/components/common/Accordion/hooks/useAccordionController.d.ts +1 -0
  2. package/dist/components/common/Card/index.d.ts +7 -2
  3. package/dist/components/common/ImageCard/index.d.ts +13 -0
  4. package/dist/components/common/ListWithIcons/components/ListWithIconsItem.d.ts +9 -0
  5. package/dist/components/common/ListWithIcons/index.d.ts +14 -0
  6. package/dist/components/layout/Footer/index.d.ts +5 -0
  7. package/dist/components/layout/ServiceFormContainer/{components → AccordionFormContainer/components}/AccordionCollapseControls.d.ts +1 -1
  8. package/dist/components/layout/ServiceFormContainer/{index.d.ts → AccordionFormContainer/index.d.ts} +1 -1
  9. package/dist/components/layout/ServiceFormContainer/AccordionFormContainer/utils.d.ts +4 -0
  10. package/dist/components/layout/ServiceFormContainer/CardFormContainer/index.d.ts +12 -0
  11. package/dist/components/layout/ServiceWizardStepper/StepperTypes.d.ts +0 -3
  12. package/dist/components/layout/ServiceWizardStepper/components/DesktopStepper.d.ts +3 -1
  13. package/dist/components/layout/ServiceWizardStepper/components/MobileStepper.d.ts +2 -1
  14. package/dist/components/layout/ServiceWizardStepper/components/StyledStepLabel.d.ts +2 -2
  15. package/dist/components/layout/ServiceWizardStepper/index.d.ts +5 -2
  16. package/dist/library/icons.d.ts +1 -3
  17. package/dist/library/index.d.ts +12 -16
  18. package/dist/library/types.d.ts +6 -0
  19. package/dist/registrucentras-rc-ses-react-components.cjs +12 -12
  20. package/dist/registrucentras-rc-ses-react-components.js +2472 -2130
  21. package/dist/stories/ServiceWizardStepper.stories.d.ts +5 -5
  22. package/dist/stories/components/Card.stories.d.ts +26 -1
  23. package/dist/stories/components/ImageCard.stories.d.ts +8 -0
  24. package/dist/stories/components/ListWithIcons.stories.d.ts +33 -0
  25. package/dist/stories/components/form/CardFormContainer.stories.d.ts +7 -0
  26. package/dist/stories/components/form/ServiceFormContainer.stories.d.ts +1 -1
  27. package/dist/stories/components/inputs/FileDropzone.stories.d.ts +32 -0
  28. package/dist/stories/components/inputs/PhoneInput.stories.d.ts +24 -0
  29. package/dist/stories/components/inputs/SearchableField.stories.d.ts +2 -2
  30. package/dist/stories/components/inputs/Select.stories.d.ts +3 -3
  31. package/dist/stories/components/inputs/TextField.stories.d.ts +5 -5
  32. package/dist/stories/components/layout/Footer.stories.d.ts +8 -0
  33. package/package.json +1 -1
  34. package/src/App.tsx +4 -0
  35. package/src/components/common/Accordion/hooks/useAccordionController.tsx +43 -11
  36. package/src/components/common/Card/index.test.tsx +36 -0
  37. package/src/components/common/Card/index.tsx +62 -22
  38. package/src/components/common/DataPagination/components/PaginationButton.tsx +1 -1
  39. package/src/components/common/DataPagination/index.tsx +1 -1
  40. package/src/components/common/ImageCard/index.test.tsx +78 -0
  41. package/src/components/common/ImageCard/index.tsx +43 -0
  42. package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +94 -0
  43. package/src/components/common/ListWithIcons/index.test.tsx +75 -0
  44. package/src/components/common/ListWithIcons/index.tsx +47 -0
  45. package/src/components/form/inputs/CheckboxFormControl.tsx +1 -1
  46. package/src/components/form/inputs/FileDropzone.tsx +1 -1
  47. package/src/components/form/inputs/FileUpload.tsx +9 -3
  48. package/src/components/form/inputs/NumberStepper.tsx +2 -2
  49. package/src/components/form/inputs/PhoneInputFormControl/components/RowComponent.tsx +1 -0
  50. package/src/components/form/inputs/RadioButtonGroup.tsx +1 -1
  51. package/src/components/layout/Footer/index.test.tsx +20 -0
  52. package/src/components/layout/Footer/index.tsx +33 -0
  53. package/src/components/layout/ServiceFormContainer/{index.tsx → AccordionFormContainer/index.tsx} +22 -5
  54. package/src/components/layout/ServiceFormContainer/{utils.ts → AccordionFormContainer/utils.ts} +2 -3
  55. package/src/components/layout/ServiceFormContainer/CardFormContainer/index.test.tsx +80 -0
  56. package/src/components/layout/ServiceFormContainer/CardFormContainer/index.tsx +71 -0
  57. package/src/components/layout/ServiceWizardStepper/ServiceWizardStepper.css +19 -3
  58. package/src/components/layout/ServiceWizardStepper/StepConnector.tsx +1 -1
  59. package/src/components/layout/ServiceWizardStepper/StepperTypes.ts +0 -3
  60. package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.test.tsx +33 -4
  61. package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.tsx +23 -4
  62. package/src/components/layout/ServiceWizardStepper/components/MobileStepper.test.tsx +34 -7
  63. package/src/components/layout/ServiceWizardStepper/components/MobileStepper.tsx +4 -2
  64. package/src/components/layout/ServiceWizardStepper/components/StyledStepLabel.tsx +8 -2
  65. package/src/components/layout/ServiceWizardStepper/index.tsx +19 -20
  66. package/src/examples/CardMultipleStepForm/index.tsx +80 -0
  67. package/src/examples/HorizontalMultiStepForm/index.tsx +22 -17
  68. package/src/examples/ListWithPagination/index.tsx +41 -11
  69. package/src/examples/MultipleStepForm/index.tsx +1 -1
  70. package/src/examples/SingleStepForm/index.tsx +1 -1
  71. package/src/library/icons.ts +3 -2
  72. package/src/library/index.ts +20 -23
  73. package/src/library/types.ts +11 -0
  74. package/src/main.tsx +5 -0
  75. package/src/stories/ServiceWizardStepper.stories.tsx +28 -14
  76. package/src/stories/components/Accordion.stories.tsx +1 -1
  77. package/src/stories/components/Card.stories.tsx +18 -0
  78. package/src/stories/components/ImageCard.stories.tsx +54 -0
  79. package/src/stories/components/ListWithIcons.stories.tsx +74 -0
  80. package/src/stories/components/form/CardFormContainer.stories.tsx +125 -0
  81. package/src/stories/components/form/ServiceFormContainer.stories.tsx +1 -1
  82. package/src/stories/components/inputs/FileDropzone.stories.tsx +117 -0
  83. package/src/stories/components/inputs/PhoneInput.stories.tsx +110 -0
  84. package/src/stories/components/layout/Footer.stories.tsx +19 -0
  85. package/src/theme/light/MuiAutocomplete.ts +4 -0
  86. package/src/theme/light/MuiCard.tsx +16 -2
  87. package/src/theme/light/MuiInputBase.ts +3 -1
  88. package/dist/components/layout/ServiceFormContainer/utils.d.ts +0 -4
  89. /package/src/components/layout/ServiceFormContainer/{components → AccordionFormContainer/components}/AccordionCollapseControls.tsx +0 -0
@@ -1,11 +1,43 @@
1
- import { Grid, Typography } from '@mui/material'
1
+ import { Button, Grid } from '@mui/material'
2
2
  import React, { useState } from 'react'
3
3
 
4
4
  import DataPagination from '@/components/common/DataPagination'
5
+ import ListWithIcons from '@/components/common/ListWithIcons'
5
6
  import ServicePage from '@/components/layout/ServicePage'
7
+ import { QuestionIcon } from '@/library/icons'
8
+ import palette from '@/theme/palette'
9
+
10
+ const mockItems = [
11
+ {
12
+ id: '1',
13
+ icon: <QuestionIcon fillColor={palette.grey[600]} />,
14
+ text: 'Explanatory text Test ilgas pavadinimas',
15
+ tooltip: 'Extra info',
16
+ },
17
+ {
18
+ id: '2',
19
+ icon: <QuestionIcon fillColor={palette.grey[600]} />,
20
+ text: 'Disabled item',
21
+ tooltip: 'Extra info',
22
+ disabled: true,
23
+ },
24
+ {
25
+ id: '3',
26
+ icon: <QuestionIcon fillColor={palette.grey[600]} />,
27
+ text: 'Hover me',
28
+ tooltip: 'Extra info',
29
+ },
30
+ {
31
+ id: '4',
32
+ icon: <QuestionIcon fillColor={palette.grey[600]} />,
33
+ text: 'Loading item',
34
+ tooltip: 'Extra info',
35
+ },
36
+ ]
6
37
 
7
38
  function ListWithPagination() {
8
39
  const [page, setPage] = useState(1)
40
+ const [isLoading, setIsLoading] = useState(false)
9
41
  const ITEMS_PER_PAGE = 5
10
42
 
11
43
  const mockData = React.useMemo(
@@ -17,19 +49,14 @@ function ListWithPagination() {
17
49
  [],
18
50
  )
19
51
 
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])
52
+ const handleSetIsLoading = () => {
53
+ setIsLoading(!isLoading)
54
+ }
24
55
 
25
56
  return (
26
57
  <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
- ))}
58
+ <Grid container sx={{ mt: 2 }}>
59
+ <ListWithIcons items={mockItems} layout='horizontal' isLoading={isLoading} />
33
60
  </Grid>
34
61
 
35
62
  <DataPagination
@@ -37,6 +64,9 @@ function ListWithPagination() {
37
64
  page={page}
38
65
  onChange={setPage}
39
66
  />
67
+ <Button onClick={handleSetIsLoading} sx={{ mt: 2 }}>
68
+ Toggle loading
69
+ </Button>
40
70
  </ServicePage>
41
71
  )
42
72
  }
@@ -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
 
@@ -34,9 +34,10 @@ import WarningDiamondFillIcon from '@/assets/icons/WarningDiamondFillIcon'
34
34
  import WarningFillIcon from '@/assets/icons/WarningFillIcon'
35
35
  import XCircleFillIcon from '@/assets/icons/XCircleFillIcon'
36
36
 
37
- export { RcSesLogo }
38
- export { ArrowRightIcon, ArrowLeftIcon }
39
37
  export {
38
+ RcSesLogo,
39
+ ArrowLeftIcon,
40
+ ArrowRightIcon,
40
41
  BarcodeIcon,
41
42
  CalendarBlankIcon,
42
43
  CaretDoubleLeftBoldIcon,
@@ -3,16 +3,6 @@ import type {} from '@mui/system'
3
3
  import type {} from '@mui/x-date-pickers/themeAugmentation'
4
4
 
5
5
  import RcSesIconProps from '@/assets/IconProps'
6
- import RcSesLogo from '@/assets/Logo'
7
- import ArrowLeftIcon from '@/assets/icons/ArrowLeftIcon'
8
- import ArrowRightIcon from '@/assets/icons/ArrowRightIcon'
9
- import CaretDoubleLeftBoldIcon from '@/assets/icons/CaretDoubleLeftBoldIcon'
10
- import CaretDoubleRightBoldIcon from '@/assets/icons/CaretDoubleRightBoldIcon'
11
- import CaretDownBoldIcon from '@/assets/icons/CaretDownBoldIcon'
12
- import CaretDownIcon from '@/assets/icons/CaretDownIcon'
13
- import CaretLeftBoldIcon from '@/assets/icons/CaretLeftBoldIcon'
14
- import CaretLeftIcon from '@/assets/icons/CaretLeftIcon'
15
- import CaretRightBoldIcon from '@/assets/icons/CaretRightBoldIcon'
16
6
  import RcSesAccordion from '@/components/common/Accordion'
17
7
  import useAccordionController from '@/components/common/Accordion/hooks/useAccordionController'
18
8
  import RcSesAlert from '@/components/common/Alert'
@@ -22,6 +12,8 @@ import RcSesButtonWithPopover from '@/components/common/Button/ButtonWithPopover
22
12
  import RcSesCard from '@/components/common/Card'
23
13
  import DataPagination from '@/components/common/DataPagination'
24
14
  import RcSesIconWithCircularBackground from '@/components/common/IconWithCircularBackground'
15
+ import RcSesImageCard from '@/components/common/ImageCard'
16
+ import ListWithIcons from '@/components/common/ListWithIcons'
25
17
  import RcSesTab from '@/components/common/Tabs/Tab'
26
18
  import RcSesTabPanel from '@/components/common/Tabs/TabPanel'
27
19
  import RcSesTabs from '@/components/common/Tabs/Tabs'
@@ -39,10 +31,13 @@ import RcSesRadioButtonGroup from '@/components/form/inputs/RadioButtonGroup'
39
31
  import RcSesSearchableField from '@/components/form/inputs/SearchableField'
40
32
  import RcSesSelect from '@/components/form/inputs/Select'
41
33
  import RcSesTextField from '@/components/form/inputs/TextField'
34
+ import RcSesFooter from '@/components/layout/Footer'
42
35
  import RcSesServiceFormActions from '@/components/layout/ServiceFormActions'
43
- import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer'
36
+ import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer/AccordionFormContainer'
37
+ import RcSesCardFormContainer from '@/components/layout/ServiceFormContainer/CardFormContainer'
44
38
  import RcSesServiceHeader from '@/components/layout/ServiceHeader'
45
39
  import RcSesServicePage from '@/components/layout/ServicePage'
40
+ import ServiceWizardStepper from '@/components/layout/ServiceWizardStepper'
46
41
  import RcSesTheme from '@/theme/light'
47
42
  import RcSesPalette from '@/theme/palette'
48
43
 
@@ -54,7 +49,15 @@ declare module '@mui/x-date-pickers/models' {
54
49
 
55
50
  export { RcSesPalette, RcSesTheme }
56
51
  export { RcSesAccordion, useAccordionController }
57
- export { RcSesAlert, RcSesBreadcrumbs, RcSesButton, RcSesButtonWithPopover, RcSesCard }
52
+ export {
53
+ RcSesAlert,
54
+ RcSesBreadcrumbs,
55
+ RcSesButton,
56
+ RcSesButtonWithPopover,
57
+ RcSesCard,
58
+ RcSesFooter,
59
+ RcSesImageCard,
60
+ }
58
61
  export { RcSesCheckbox, RcSesCheckboxFormControl }
59
62
  export { RcSesDatepicker }
60
63
  export { RcSesFileUpload }
@@ -67,10 +70,14 @@ export { RcSesSelect }
67
70
  export { RcSesTab, RcSesTabPanel, RcSesTabs, RcSesTabsWrapper }
68
71
  export { RcSesTextField }
69
72
  export { DataPagination }
73
+ export { ListWithIcons }
74
+ export { ServiceWizardStepper }
75
+ export type * from './types'
70
76
 
71
77
  export {
72
78
  RcSesServiceFormActions,
73
79
  RcSesServiceFormContainer,
80
+ RcSesCardFormContainer,
74
81
  RcSesFormControlWrapper,
75
82
  RcSesServiceHeader,
76
83
  RcSesServicePage,
@@ -79,14 +86,4 @@ export {
79
86
  export type { RcSesIconProps }
80
87
  export { RcSesIconWithCircularBackground }
81
88
 
82
- export { RcSesLogo }
83
- export { ArrowRightIcon, ArrowLeftIcon }
84
- export {
85
- CaretDoubleLeftBoldIcon,
86
- CaretDoubleRightBoldIcon,
87
- CaretDownBoldIcon,
88
- CaretDownIcon,
89
- CaretLeftBoldIcon,
90
- CaretLeftIcon,
91
- CaretRightBoldIcon,
92
- }
89
+ export * from './icons'
@@ -0,0 +1,11 @@
1
+ import { RcSesCardProps } from '@/components/common/Card'
2
+ import {
3
+ ListWithIconsItemData,
4
+ ListWithIconsProps,
5
+ } from '@/components/common/ListWithIcons'
6
+ import { RcSesCardFormContainerProps } from '@/components/layout/ServiceFormContainer/CardFormContainer'
7
+ import { ServiceWizardStepperProps } from '@/components/layout/ServiceWizardStepper'
8
+
9
+ export type { ListWithIconsProps, ListWithIconsItemData }
10
+
11
+ export type { RcSesCardFormContainerProps, RcSesCardProps, ServiceWizardStepperProps }
package/src/main.tsx CHANGED
@@ -13,6 +13,7 @@ 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'
16
17
  import HorizontalMultipleStepForm from './examples/HorizontalMultiStepForm'
17
18
  import ListWithPagination from './examples/ListWithPagination'
18
19
  import MultipleStepForm from './examples/MultipleStepForm'
@@ -41,6 +42,10 @@ const router = createBrowserRouter([
41
42
  path: '/horizontal-multi-step-form',
42
43
  element: <HorizontalMultipleStepForm />,
43
44
  },
45
+ {
46
+ path: '/card-multi-step-form',
47
+ element: <CardMultipleStepForm />,
48
+ },
44
49
  ])
45
50
 
46
51
  const adapterLocale = i18n.language === 'lt' ? lt : enUS
@@ -1,12 +1,13 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react'
2
+ import { useState } from 'react'
2
3
 
3
4
  import ServiceWizardStepper from '../components/layout/ServiceWizardStepper'
4
5
  import { StepItem } from '../components/layout/ServiceWizardStepper/StepperTypes'
5
6
 
6
7
  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' },
8
+ { id: '1', title: 'Step 1' },
9
+ { id: '2', title: 'Step 2' },
10
+ { id: '3', title: 'Step 3' },
10
11
  ]
11
12
 
12
13
  const meta: Meta<typeof ServiceWizardStepper> = {
@@ -18,22 +19,35 @@ const meta: Meta<typeof ServiceWizardStepper> = {
18
19
  control: 'radio',
19
20
  options: ['horizontal', 'vertical'],
20
21
  },
22
+ activeStep: { table: { disable: true } },
23
+ onStepClick: { table: { disable: true } },
21
24
  },
22
25
  }
23
26
  export default meta
24
27
 
25
28
  type Story = StoryObj<typeof ServiceWizardStepper>
26
29
 
27
- export const Horizontal: Story = {
28
- args: {
29
- steps,
30
- orientation: 'horizontal',
31
- },
32
- }
30
+ const createStory = (orientation: 'horizontal' | 'vertical'): Story => ({
31
+ render: (args) => {
32
+ const [activeStep, setActiveStep] = useState(0)
33
+
34
+ const handleStepClick = (index: number) => {
35
+ if (index > activeStep) return
36
+ setActiveStep(index)
37
+ }
33
38
 
34
- export const Vertical: Story = {
35
- args: {
36
- steps,
37
- orientation: 'vertical',
39
+ return (
40
+ <ServiceWizardStepper
41
+ {...args}
42
+ steps={steps}
43
+ activeStep={activeStep}
44
+ onStepClick={handleStepClick}
45
+ orientation={orientation}
46
+ />
47
+ )
38
48
  },
39
- }
49
+ })
50
+
51
+ export const Horizontal = createStory('horizontal')
52
+
53
+ export const Vertical = createStory('vertical')
@@ -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> = {
@@ -3,8 +3,10 @@ import { Box, Typography } from '@mui/material'
3
3
  import type { Meta, StoryFn } from '@storybook/react'
4
4
 
5
5
  import CaretLeftIcon from '@/assets/icons/CaretLeftIcon'
6
+ import MagnifyingGlassIcon from '@/assets/icons/MagnifyingGlassIcon'
6
7
  import RcSesButton from '@/components/common/Button'
7
8
  import RcSesCard from '@/components/common/Card'
9
+ import palette from '@/theme/palette'
8
10
 
9
11
  const meta: Meta<typeof RcSesCard> = {
10
12
  title: 'components/common/Card',
@@ -49,3 +51,19 @@ Main.args = {
49
51
  </>
50
52
  ),
51
53
  }
54
+
55
+ export const WithImage = Template.bind({})
56
+ WithImage.args = {
57
+ variant: 'elevation',
58
+ centered: true,
59
+ title: 'Place heading text here',
60
+ description:
61
+ 'Additional description text elaborating on situation and what to do next.',
62
+ image: (
63
+ <Box sx={{ color: palette.grey[400], position: 'relative', display: 'inline-flex' }}>
64
+ <MagnifyingGlassIcon size={64} fillColor={palette.grey[400]} />
65
+ </Box>
66
+ ),
67
+ children: <RcSesButton>Button</RcSesButton>,
68
+ contentBackground: false,
69
+ }
@@ -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/common/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/common/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
+ }
@@ -0,0 +1,125 @@
1
+ import { Button, Container, Typography } from '@mui/material'
2
+ import type { Meta, StoryFn } from '@storybook/react'
3
+ import { useState } from 'react'
4
+
5
+ import RcSesCardFormContainer from '@/components/layout/ServiceFormContainer/CardFormContainer'
6
+ import { StepItem } from '@/components/layout/ServiceWizardStepper/StepperTypes'
7
+ import FieldView from '@/components/storybook/FieldView'
8
+ import Fields from '@/components/storybook/Fields'
9
+
10
+ const shortSteps: StepItem[] = [
11
+ { id: '1', title: 'Paslauga' },
12
+ { id: '2', title: 'Duomenys' },
13
+ { id: '3', title: 'Patvirtinimas' },
14
+ ]
15
+
16
+ const longSteps: StepItem[] = [
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
+ ]
23
+
24
+ const meta: Meta<typeof RcSesCardFormContainer> = {
25
+ title: 'components/common/form/CardFormContainer',
26
+ component: RcSesCardFormContainer,
27
+ tags: ['autodocs'],
28
+ argTypes: {
29
+ steps: { table: { disable: true } },
30
+ onStepClick: { table: { disable: true } },
31
+ activeStep: { table: { disable: true } },
32
+ },
33
+ }
34
+
35
+ export default meta
36
+
37
+ const DemoContent = () => (
38
+ <>
39
+ <Typography variant='h6'>Pavadinimas</Typography>
40
+ <Typography variant='body2' sx={{ mb: 2 }}>
41
+ Papildomas aprašymo tekstas
42
+ </Typography>
43
+
44
+ <Container
45
+ sx={{
46
+ height: 140,
47
+ background: '#EDEDED',
48
+ borderRadius: '8px',
49
+ display: 'flex',
50
+ alignItems: 'center',
51
+ justifyContent: 'center',
52
+ mb: 2,
53
+ }}
54
+ >
55
+ <Typography variant='body2'>Vidinis paslaugų front-end sprendimas</Typography>
56
+ </Container>
57
+ </>
58
+ )
59
+
60
+ const createTemplate =
61
+ (
62
+ steps: StepItem[],
63
+ forcedLayout?: 'row' | 'column',
64
+ ): StoryFn<typeof RcSesCardFormContainer> =>
65
+ (args) => {
66
+ const [activeStep, setActiveStep] = useState(0)
67
+
68
+ const handleBack = () => {
69
+ setActiveStep((prev) => Math.max(prev - 1, 0))
70
+ }
71
+
72
+ const handleNext = () => {
73
+ setActiveStep((prev) => Math.min(prev + 1, steps.length - 1))
74
+ }
75
+
76
+ const handleStepClick = (index: number) => {
77
+ if (index > activeStep) return
78
+ setActiveStep(index)
79
+ }
80
+
81
+ return (
82
+ <Fields>
83
+ <FieldView>
84
+ <RcSesCardFormContainer
85
+ {...args}
86
+ layout={forcedLayout}
87
+ steps={steps}
88
+ activeStep={activeStep}
89
+ onStepClick={handleStepClick}
90
+ leadingActions={
91
+ <Button onClick={handleBack} disabled={activeStep === 0}>
92
+ Back
93
+ </Button>
94
+ }
95
+ trailingActions={
96
+ <>
97
+ <Button variant='outlined'>Button</Button>
98
+ <Button
99
+ variant='contained'
100
+ onClick={handleNext}
101
+ disabled={activeStep === steps.length - 1}
102
+ >
103
+ Next
104
+ </Button>
105
+ </>
106
+ }
107
+ >
108
+ <DemoContent />
109
+ </RcSesCardFormContainer>
110
+ </FieldView>
111
+ </Fields>
112
+ )
113
+ }
114
+
115
+ export const HorizontalDemo = createTemplate(shortSteps, 'column')
116
+ HorizontalDemo.args = {
117
+ title: 'Antraštės tekstas',
118
+ description: 'Papildomas aprašymo tekstas',
119
+ }
120
+
121
+ export const VerticalDemo = createTemplate(longSteps, 'row')
122
+ VerticalDemo.args = {
123
+ title: 'Antraštės tekstas',
124
+ description: 'Papildomas aprašymo tekstas',
125
+ }
@@ -5,7 +5,7 @@ import { Meta, StoryContext, StoryFn } from '@storybook/react'
5
5
 
6
6
  import RcSesAccordion from '@/components/common/Accordion'
7
7
  import useAccordionController from '@/components/common/Accordion/hooks/useAccordionController'
8
- import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer'
8
+ import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer/AccordionFormContainer'
9
9
  import FieldView from '@/components/storybook/FieldView'
10
10
  import Fields from '@/components/storybook/Fields'
11
11
  import BasicInformationForm from '@/examples/MultipleStepForm/components/BasicInformationForm'