@registrucentras/rc-ses-react-components 1.4.1 → 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/CardFormContainer/index.d.ts +3 -2
- package/dist/components/layout/ServiceWizardStepper/StepperTypes.d.ts +0 -3
- package/dist/components/layout/ServiceWizardStepper/components/DesktopStepper.d.ts +2 -1
- package/dist/components/layout/ServiceWizardStepper/components/MobileStepper.d.ts +2 -1
- package/dist/components/layout/ServiceWizardStepper/components/StyledStepLabel.d.ts +2 -2
- package/dist/components/layout/ServiceWizardStepper/index.d.ts +3 -2
- package/dist/library/icons.d.ts +1 -3
- package/dist/library/index.d.ts +6 -14
- package/dist/library/types.d.ts +2 -0
- package/dist/registrucentras-rc-ses-react-components.cjs +11 -11
- package/dist/registrucentras-rc-ses-react-components.js +2530 -2251
- package/dist/stories/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/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/components/common/Accordion/hooks/useAccordionController.tsx +43 -11
- package/src/components/common/Card/index.test.tsx +36 -0
- package/src/components/common/Card/index.tsx +62 -22
- package/src/components/common/DataPagination/components/PaginationButton.tsx +1 -1
- package/src/components/common/DataPagination/index.tsx +1 -1
- package/src/components/common/ImageCard/index.test.tsx +78 -0
- package/src/components/common/ImageCard/index.tsx +43 -0
- package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +94 -0
- package/src/components/common/ListWithIcons/index.test.tsx +75 -0
- package/src/components/common/ListWithIcons/index.tsx +47 -0
- package/src/components/form/inputs/CheckboxFormControl.tsx +1 -1
- package/src/components/form/inputs/FileDropzone.tsx +1 -1
- package/src/components/form/inputs/FileUpload.tsx +9 -3
- package/src/components/form/inputs/NumberStepper.tsx +2 -2
- package/src/components/form/inputs/PhoneInputFormControl/components/RowComponent.tsx +1 -0
- package/src/components/form/inputs/RadioButtonGroup.tsx +1 -1
- package/src/components/layout/Footer/index.test.tsx +20 -0
- package/src/components/layout/Footer/index.tsx +33 -0
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/index.tsx +21 -4
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/utils.ts +0 -1
- package/src/components/layout/ServiceFormContainer/CardFormContainer/index.test.tsx +14 -12
- package/src/components/layout/ServiceFormContainer/CardFormContainer/index.tsx +4 -1
- package/src/components/layout/ServiceWizardStepper/StepperTypes.ts +0 -3
- package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.test.tsx +33 -4
- package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.tsx +6 -2
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.test.tsx +34 -7
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.tsx +4 -2
- package/src/components/layout/ServiceWizardStepper/components/StyledStepLabel.tsx +4 -2
- package/src/components/layout/ServiceWizardStepper/index.tsx +13 -21
- package/src/examples/CardMultipleStepForm/index.tsx +18 -31
- package/src/examples/HorizontalMultiStepForm/index.tsx +22 -17
- package/src/examples/ListWithPagination/index.tsx +41 -11
- package/src/library/icons.ts +3 -2
- package/src/library/index.ts +14 -22
- package/src/library/types.ts +6 -0
- package/src/stories/ServiceWizardStepper.stories.tsx +28 -14
- 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 +22 -32
- 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
|
@@ -4,11 +4,17 @@ import { StepItem } from '../StepperTypes'
|
|
|
4
4
|
import DesktopStepper from './DesktopStepper'
|
|
5
5
|
|
|
6
6
|
const steps: StepItem[] = [
|
|
7
|
-
{ id: '1', title: 'Step 1'
|
|
8
|
-
{ id: '2', title: 'Step 2'
|
|
9
|
-
{ id: '3', title: 'Step 3'
|
|
7
|
+
{ id: '1', title: 'Step 1' },
|
|
8
|
+
{ id: '2', title: 'Step 2' },
|
|
9
|
+
{ id: '3', title: 'Step 3' },
|
|
10
10
|
]
|
|
11
11
|
|
|
12
|
+
const getStepState = (index: number, activeStep: number) => {
|
|
13
|
+
if (index < activeStep) return 'completed'
|
|
14
|
+
if (index === activeStep) return 'active'
|
|
15
|
+
return 'pending'
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
describe('DesktopStepper', () => {
|
|
13
19
|
it('renders all steps', () => {
|
|
14
20
|
const { getByText } = render(
|
|
@@ -17,8 +23,10 @@ describe('DesktopStepper', () => {
|
|
|
17
23
|
activeStep={1}
|
|
18
24
|
handleStepClick={() => {}}
|
|
19
25
|
resolvedOrientation='horizontal'
|
|
26
|
+
getStepState={(index) => getStepState(index, 1)}
|
|
20
27
|
/>,
|
|
21
28
|
)
|
|
29
|
+
|
|
22
30
|
expect(getByText('Step 1')).toBeInTheDocument()
|
|
23
31
|
expect(getByText('Step 2')).toBeInTheDocument()
|
|
24
32
|
expect(getByText('Step 3')).toBeInTheDocument()
|
|
@@ -26,15 +34,36 @@ describe('DesktopStepper', () => {
|
|
|
26
34
|
|
|
27
35
|
it('calls handleStepClick when a step is clicked', () => {
|
|
28
36
|
const handleStepClick = vi.fn()
|
|
37
|
+
|
|
29
38
|
const { getByText } = render(
|
|
30
39
|
<DesktopStepper
|
|
31
40
|
stepEntries={steps}
|
|
32
41
|
activeStep={1}
|
|
33
42
|
handleStepClick={handleStepClick}
|
|
34
43
|
resolvedOrientation='horizontal'
|
|
44
|
+
getStepState={(index) => getStepState(index, 1)}
|
|
35
45
|
/>,
|
|
36
46
|
)
|
|
47
|
+
|
|
37
48
|
fireEvent.click(getByText('Step 1'))
|
|
38
|
-
expect(handleStepClick).
|
|
49
|
+
expect(handleStepClick).toHaveBeenCalledWith(0)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('does not allow clicking future steps', () => {
|
|
53
|
+
const handleStepClick = vi.fn()
|
|
54
|
+
|
|
55
|
+
const { getByText } = render(
|
|
56
|
+
<DesktopStepper
|
|
57
|
+
stepEntries={steps}
|
|
58
|
+
activeStep={1}
|
|
59
|
+
handleStepClick={handleStepClick}
|
|
60
|
+
resolvedOrientation='horizontal'
|
|
61
|
+
getStepState={(index) => getStepState(index, 1)}
|
|
62
|
+
/>,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
fireEvent.click(getByText('Step 3'))
|
|
66
|
+
|
|
67
|
+
expect(handleStepClick).not.toHaveBeenCalled()
|
|
39
68
|
})
|
|
40
69
|
})
|
|
@@ -11,6 +11,7 @@ interface DesktopStepperProps {
|
|
|
11
11
|
handleStepClick: (index: number) => void
|
|
12
12
|
resolvedOrientation: 'vertical' | 'horizontal'
|
|
13
13
|
isLoading?: boolean
|
|
14
|
+
getStepState: (index: number) => 'completed' | 'active' | 'pending'
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const DesktopStepper = ({
|
|
@@ -19,6 +20,7 @@ const DesktopStepper = ({
|
|
|
19
20
|
handleStepClick,
|
|
20
21
|
resolvedOrientation,
|
|
21
22
|
isLoading = false,
|
|
23
|
+
getStepState,
|
|
22
24
|
}: DesktopStepperProps) => (
|
|
23
25
|
<Stepper
|
|
24
26
|
alternativeLabel={resolvedOrientation === 'horizontal'}
|
|
@@ -37,13 +39,15 @@ const DesktopStepper = ({
|
|
|
37
39
|
}
|
|
38
40
|
>
|
|
39
41
|
{stepEntries.map((step, index) => {
|
|
40
|
-
const isClickable = index <=
|
|
42
|
+
const isClickable = index <= activeStep
|
|
43
|
+
const stepState = getStepState(index)
|
|
44
|
+
|
|
41
45
|
return (
|
|
42
46
|
<Step key={step.id}>
|
|
43
47
|
<StepButton onClick={() => handleStepClick(index)} disabled={!isClickable}>
|
|
44
48
|
<StyledStepLabel
|
|
45
49
|
StepIconComponent={CustomStepIcon}
|
|
46
|
-
stepState={
|
|
50
|
+
stepState={stepState}
|
|
47
51
|
orientation={resolvedOrientation}
|
|
48
52
|
isLast={index === stepEntries.length - 1}
|
|
49
53
|
>
|
|
@@ -4,18 +4,45 @@ import { StepItem } from '../StepperTypes'
|
|
|
4
4
|
import MobileStepper from './MobileStepper'
|
|
5
5
|
|
|
6
6
|
const steps: StepItem[] = [
|
|
7
|
-
{ id: '1', title: 'Step 1'
|
|
8
|
-
{ id: '2', title: 'Step 2'
|
|
9
|
-
{ id: '3', title: 'Step 3'
|
|
7
|
+
{ id: '1', title: 'Step 1' },
|
|
8
|
+
{ id: '2', title: 'Step 2' },
|
|
9
|
+
{ id: '3', title: 'Step 3' },
|
|
10
10
|
]
|
|
11
11
|
|
|
12
|
+
const getStepState = (index: number, activeStep: number) => {
|
|
13
|
+
if (index < activeStep) return 'completed'
|
|
14
|
+
if (index === activeStep) return 'active'
|
|
15
|
+
return 'pending'
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
describe('MobileStepper', () => {
|
|
13
|
-
it('renders all steps', () => {
|
|
19
|
+
it('renders all steps and navigation button', () => {
|
|
20
|
+
render(
|
|
21
|
+
<MobileStepper
|
|
22
|
+
stepEntries={steps}
|
|
23
|
+
activeStep={1}
|
|
24
|
+
handleStepClick={() => {}}
|
|
25
|
+
getStepState={(index) => getStepState(index, 1)}
|
|
26
|
+
/>,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
const buttons = screen.getAllByRole('button')
|
|
30
|
+
|
|
31
|
+
expect(buttons).toHaveLength(steps.length + 1)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
it('does not render back button on first step', () => {
|
|
14
35
|
render(
|
|
15
|
-
<MobileStepper
|
|
36
|
+
<MobileStepper
|
|
37
|
+
stepEntries={steps}
|
|
38
|
+
activeStep={0}
|
|
39
|
+
handleStepClick={() => {}}
|
|
40
|
+
getStepState={(index) => getStepState(index, 0)}
|
|
41
|
+
/>,
|
|
16
42
|
)
|
|
17
43
|
|
|
18
|
-
const
|
|
19
|
-
|
|
44
|
+
const buttons = screen.getAllByRole('button')
|
|
45
|
+
|
|
46
|
+
expect(buttons).toHaveLength(steps.length)
|
|
20
47
|
})
|
|
21
48
|
})
|
|
@@ -11,12 +11,14 @@ interface MobileStepperProps {
|
|
|
11
11
|
stepEntries: StepItem[]
|
|
12
12
|
activeStep: number
|
|
13
13
|
handleStepClick: (index: number) => void
|
|
14
|
+
getStepState: (index: number) => 'completed' | 'active' | 'pending'
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const MobileStepper = ({
|
|
17
18
|
stepEntries,
|
|
18
19
|
activeStep,
|
|
19
20
|
handleStepClick,
|
|
21
|
+
getStepState,
|
|
20
22
|
}: MobileStepperProps) => (
|
|
21
23
|
<Box className='ServiceWizardStepper-MobileStepperWrapper'>
|
|
22
24
|
<Box className='ServiceWizardStepper-NavSlot'>
|
|
@@ -35,12 +37,12 @@ const MobileStepper = ({
|
|
|
35
37
|
connector={<StepConnector />}
|
|
36
38
|
className='ServiceWizardStepper ServiceWizardStepper-horizontal'
|
|
37
39
|
>
|
|
38
|
-
{stepEntries.map((step) => (
|
|
40
|
+
{stepEntries.map((step, index) => (
|
|
39
41
|
<Step key={step.id}>
|
|
40
42
|
<StepButton disabled>
|
|
41
43
|
<StyledStepLabel
|
|
42
44
|
StepIconComponent={CustomStepIcon}
|
|
43
|
-
stepState={
|
|
45
|
+
stepState={getStepState(index)}
|
|
44
46
|
/>
|
|
45
47
|
</StepButton>
|
|
46
48
|
</Step>
|
|
@@ -2,10 +2,10 @@ import { StepLabel, styled } from '@mui/material'
|
|
|
2
2
|
|
|
3
3
|
import palette, { grey } from '@/theme/palette'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
export type StepState = 'completed' | 'active' | 'pending'
|
|
6
6
|
|
|
7
7
|
interface StyledStepLabelProps {
|
|
8
|
-
stepState:
|
|
8
|
+
stepState: StepState
|
|
9
9
|
orientation?: 'vertical' | 'horizontal'
|
|
10
10
|
isLast?: boolean
|
|
11
11
|
}
|
|
@@ -18,11 +18,13 @@ const StyledStepLabel = styled(StepLabel, {
|
|
|
18
18
|
fontWeight: stepState === 'active' ? 700 : 400,
|
|
19
19
|
color: stepState === 'pending' ? grey[500] : grey[800],
|
|
20
20
|
},
|
|
21
|
+
|
|
21
22
|
...(orientation === 'vertical' && {
|
|
22
23
|
'& .MuiStepLabel-label.Mui-active': {
|
|
23
24
|
fontSize: '14px',
|
|
24
25
|
},
|
|
25
26
|
}),
|
|
27
|
+
|
|
26
28
|
...(orientation === 'vertical' &&
|
|
27
29
|
!isLast && {
|
|
28
30
|
'&.MuiStepLabel-root.MuiStepLabel-vertical .MuiStepLabel-label': {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useMediaQuery, useTheme } from '@mui/material'
|
|
2
|
-
import { useEffect, useState } from 'react'
|
|
3
2
|
|
|
4
3
|
import './ServiceWizardStepper.css'
|
|
5
4
|
import { StepItem } from './StepperTypes'
|
|
@@ -9,60 +8,53 @@ import MobileStepper from './components/MobileStepper'
|
|
|
9
8
|
export interface ServiceWizardStepperProps {
|
|
10
9
|
orientation?: 'vertical' | 'horizontal'
|
|
11
10
|
steps: StepItem[]
|
|
12
|
-
|
|
11
|
+
activeStep: number
|
|
12
|
+
onStepClick?: (index: number) => void
|
|
13
13
|
isLoading?: boolean
|
|
14
14
|
}
|
|
15
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
16
|
function ServiceWizardStepper({
|
|
24
17
|
steps,
|
|
18
|
+
activeStep,
|
|
25
19
|
orientation = 'horizontal',
|
|
26
20
|
onStepClick,
|
|
27
21
|
isLoading = false,
|
|
28
22
|
}: ServiceWizardStepperProps) {
|
|
29
|
-
const [currentSteps, setCurrentSteps] = useState(steps)
|
|
30
|
-
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
setCurrentSteps(steps)
|
|
33
|
-
}, [steps])
|
|
34
|
-
|
|
35
23
|
const theme = useTheme()
|
|
36
24
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'))
|
|
37
25
|
|
|
38
26
|
const resolvedOrientation = isMobile ? 'horizontal' : orientation
|
|
39
27
|
|
|
40
|
-
const
|
|
28
|
+
const getStepState = (index: number) => {
|
|
29
|
+
if (index < activeStep) return 'completed'
|
|
30
|
+
if (index === activeStep) return 'active'
|
|
31
|
+
return 'pending'
|
|
32
|
+
}
|
|
41
33
|
|
|
42
34
|
const handleStepClick = (index: number) => {
|
|
43
35
|
if (index < 0 || index > activeStep) return
|
|
44
|
-
|
|
45
|
-
setCurrentSteps(updatedSteps)
|
|
46
|
-
onStepClick?.(updatedSteps)
|
|
36
|
+
onStepClick?.(index)
|
|
47
37
|
}
|
|
48
38
|
|
|
49
39
|
if (isMobile) {
|
|
50
40
|
return (
|
|
51
41
|
<MobileStepper
|
|
52
|
-
stepEntries={
|
|
42
|
+
stepEntries={steps}
|
|
53
43
|
activeStep={activeStep}
|
|
54
44
|
handleStepClick={handleStepClick}
|
|
45
|
+
getStepState={getStepState}
|
|
55
46
|
/>
|
|
56
47
|
)
|
|
57
48
|
}
|
|
58
49
|
|
|
59
50
|
return (
|
|
60
51
|
<DesktopStepper
|
|
61
|
-
stepEntries={
|
|
52
|
+
stepEntries={steps}
|
|
62
53
|
activeStep={activeStep}
|
|
63
54
|
handleStepClick={handleStepClick}
|
|
64
55
|
resolvedOrientation={resolvedOrientation}
|
|
65
56
|
isLoading={isLoading}
|
|
57
|
+
getStepState={getStepState}
|
|
66
58
|
/>
|
|
67
59
|
)
|
|
68
60
|
}
|
|
@@ -7,38 +7,28 @@ import ServicePage from '@/components/layout/ServicePage'
|
|
|
7
7
|
import { StepItem } from '@/components/layout/ServiceWizardStepper/StepperTypes'
|
|
8
8
|
|
|
9
9
|
const steps: StepItem[] = [
|
|
10
|
-
{ id: '1',
|
|
11
|
-
{ id: '2',
|
|
12
|
-
{ id: '3',
|
|
13
|
-
{ id: '4',
|
|
10
|
+
{ id: '1', title: '1-2 žodžių tekstas' },
|
|
11
|
+
{ id: '2', title: '1-2 žodžių tekstas' },
|
|
12
|
+
{ id: '3', title: '1-2 žodžių tekstas' },
|
|
13
|
+
{ id: '4', title: '1-2 žodžių tekstas' },
|
|
14
14
|
]
|
|
15
15
|
|
|
16
16
|
function CardMultipleStepForm() {
|
|
17
|
-
const [
|
|
18
|
-
const activeStep = currentSteps.findIndex((s) => s.state === 'active')
|
|
17
|
+
const [activeStep, setActiveStep] = useState(0)
|
|
19
18
|
|
|
20
19
|
const handleBack = () => {
|
|
21
|
-
|
|
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)
|
|
20
|
+
setActiveStep((prev) => Math.max(prev - 1, 0))
|
|
30
21
|
}
|
|
31
22
|
|
|
32
23
|
const handleNext = () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
})
|
|
40
|
-
setSteps(updatedSteps)
|
|
24
|
+
setActiveStep((prev) => Math.min(prev + 1, steps.length - 1))
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const handleStepClick = (index: number) => {
|
|
28
|
+
if (index > activeStep) return
|
|
29
|
+
setActiveStep(index)
|
|
41
30
|
}
|
|
31
|
+
|
|
42
32
|
return (
|
|
43
33
|
<ServicePage>
|
|
44
34
|
<ServiceHeader
|
|
@@ -62,22 +52,19 @@ function CardMultipleStepForm() {
|
|
|
62
52
|
</ServiceHeader>
|
|
63
53
|
|
|
64
54
|
<RcSesCardFormContainer
|
|
65
|
-
steps={
|
|
66
|
-
|
|
55
|
+
steps={steps}
|
|
56
|
+
activeStep={activeStep}
|
|
57
|
+
onStepClick={handleStepClick}
|
|
67
58
|
title='Test'
|
|
68
59
|
description='Test description'
|
|
69
|
-
leadingActions={
|
|
70
|
-
<Button onClick={handleBack} disabled={activeStep === 0}>
|
|
71
|
-
Back
|
|
72
|
-
</Button>
|
|
73
|
-
}
|
|
60
|
+
leadingActions={activeStep !== 0 && <Button onClick={handleBack}>Back</Button>}
|
|
74
61
|
trailingActions={
|
|
75
62
|
<>
|
|
76
63
|
<Button variant='outlined'>Button</Button>
|
|
77
64
|
<Button
|
|
78
65
|
variant='contained'
|
|
79
66
|
onClick={handleNext}
|
|
80
|
-
disabled={activeStep ===
|
|
67
|
+
disabled={activeStep === steps.length - 1}
|
|
81
68
|
>
|
|
82
69
|
Next
|
|
83
70
|
</Button>
|
|
@@ -6,24 +6,24 @@ import ServiceWizardStepper from '@/components/layout/ServiceWizardStepper'
|
|
|
6
6
|
import { StepItem } from '@/components/layout/ServiceWizardStepper/StepperTypes'
|
|
7
7
|
|
|
8
8
|
const steps3: StepItem[] = [
|
|
9
|
-
{ id: '1',
|
|
10
|
-
{ id: '2',
|
|
11
|
-
{ id: '3',
|
|
9
|
+
{ id: '1', title: '1-2 žodžių tekstas' },
|
|
10
|
+
{ id: '2', title: '1-2 žodžių tekstas' },
|
|
11
|
+
{ id: '3', title: '1-2 žodžių tekstas' },
|
|
12
12
|
]
|
|
13
13
|
|
|
14
14
|
const steps4: StepItem[] = [
|
|
15
|
-
{ id: '1',
|
|
16
|
-
{ id: '2',
|
|
17
|
-
{ id: '3',
|
|
18
|
-
{ id: '4',
|
|
15
|
+
{ id: '1', title: '1-2 žodžių tekstas' },
|
|
16
|
+
{ id: '2', title: '1-2 žodžių tekstas' },
|
|
17
|
+
{ id: '3', title: '1-2 žodžių tekstas' },
|
|
18
|
+
{ id: '4', title: '1-2 žodžių tekstas' },
|
|
19
19
|
]
|
|
20
20
|
|
|
21
21
|
const steps5: StepItem[] = [
|
|
22
|
-
{ id: '1',
|
|
23
|
-
{ id: '2',
|
|
24
|
-
{ id: '3',
|
|
25
|
-
{ id: '4',
|
|
26
|
-
{ id: '5',
|
|
22
|
+
{ id: '1', title: '1-2 žodžių tekstas' },
|
|
23
|
+
{ id: '2', title: '1-2 žodžių tekstas' },
|
|
24
|
+
{ id: '3', title: '1-2 žodžių tekstas' },
|
|
25
|
+
{ id: '4', title: '1-2 žodžių tekstas' },
|
|
26
|
+
{ id: '5', title: '1-2 žodžių tekstas' },
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
function HorizontalMultipleStepForm() {
|
|
@@ -50,13 +50,18 @@ function HorizontalMultipleStepForm() {
|
|
|
50
50
|
</ServiceHeader>
|
|
51
51
|
|
|
52
52
|
<div
|
|
53
|
-
style={{
|
|
53
|
+
style={{
|
|
54
|
+
padding: '2rem',
|
|
55
|
+
display: 'flex',
|
|
56
|
+
flexDirection: 'column',
|
|
57
|
+
gap: '2rem',
|
|
58
|
+
}}
|
|
54
59
|
>
|
|
55
|
-
<ServiceWizardStepper steps={steps3} />
|
|
56
|
-
<ServiceWizardStepper steps={steps4} />
|
|
57
|
-
<ServiceWizardStepper steps={steps5} />
|
|
60
|
+
<ServiceWizardStepper steps={steps3} activeStep={1} />
|
|
61
|
+
<ServiceWizardStepper steps={steps4} activeStep={0} />
|
|
62
|
+
<ServiceWizardStepper steps={steps5} activeStep={2} />
|
|
58
63
|
</div>
|
|
59
|
-
<ServiceWizardStepper steps={steps5} />
|
|
64
|
+
<ServiceWizardStepper steps={steps5} activeStep={4} />
|
|
60
65
|
</ServicePage>
|
|
61
66
|
)
|
|
62
67
|
}
|
|
@@ -1,11 +1,43 @@
|
|
|
1
|
-
import {
|
|
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
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, [page, mockData])
|
|
52
|
+
const handleSetIsLoading = () => {
|
|
53
|
+
setIsLoading(!isLoading)
|
|
54
|
+
}
|
|
24
55
|
|
|
25
56
|
return (
|
|
26
57
|
<ServicePage>
|
|
27
|
-
<Grid container
|
|
28
|
-
{
|
|
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
|
}
|
package/src/library/icons.ts
CHANGED
|
@@ -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,
|
package/src/library/index.ts
CHANGED
|
@@ -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,6 +31,7 @@ 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
36
|
import RcSesServiceFormContainer from '@/components/layout/ServiceFormContainer/AccordionFormContainer'
|
|
44
37
|
import RcSesCardFormContainer from '@/components/layout/ServiceFormContainer/CardFormContainer'
|
|
@@ -56,7 +49,15 @@ declare module '@mui/x-date-pickers/models' {
|
|
|
56
49
|
|
|
57
50
|
export { RcSesPalette, RcSesTheme }
|
|
58
51
|
export { RcSesAccordion, useAccordionController }
|
|
59
|
-
export {
|
|
52
|
+
export {
|
|
53
|
+
RcSesAlert,
|
|
54
|
+
RcSesBreadcrumbs,
|
|
55
|
+
RcSesButton,
|
|
56
|
+
RcSesButtonWithPopover,
|
|
57
|
+
RcSesCard,
|
|
58
|
+
RcSesFooter,
|
|
59
|
+
RcSesImageCard,
|
|
60
|
+
}
|
|
60
61
|
export { RcSesCheckbox, RcSesCheckboxFormControl }
|
|
61
62
|
export { RcSesDatepicker }
|
|
62
63
|
export { RcSesFileUpload }
|
|
@@ -69,6 +70,7 @@ export { RcSesSelect }
|
|
|
69
70
|
export { RcSesTab, RcSesTabPanel, RcSesTabs, RcSesTabsWrapper }
|
|
70
71
|
export { RcSesTextField }
|
|
71
72
|
export { DataPagination }
|
|
73
|
+
export { ListWithIcons }
|
|
72
74
|
export { ServiceWizardStepper }
|
|
73
75
|
export type * from './types'
|
|
74
76
|
|
|
@@ -84,14 +86,4 @@ export {
|
|
|
84
86
|
export type { RcSesIconProps }
|
|
85
87
|
export { RcSesIconWithCircularBackground }
|
|
86
88
|
|
|
87
|
-
export
|
|
88
|
-
export { ArrowRightIcon, ArrowLeftIcon }
|
|
89
|
-
export {
|
|
90
|
-
CaretDoubleLeftBoldIcon,
|
|
91
|
-
CaretDoubleRightBoldIcon,
|
|
92
|
-
CaretDownBoldIcon,
|
|
93
|
-
CaretDownIcon,
|
|
94
|
-
CaretLeftBoldIcon,
|
|
95
|
-
CaretLeftIcon,
|
|
96
|
-
CaretRightBoldIcon,
|
|
97
|
-
}
|
|
89
|
+
export * from './icons'
|
package/src/library/types.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { RcSesCardProps } from '@/components/common/Card'
|
|
2
|
+
import {
|
|
3
|
+
ListWithIconsItemData,
|
|
4
|
+
ListWithIconsProps,
|
|
5
|
+
} from '@/components/common/ListWithIcons'
|
|
2
6
|
import { RcSesCardFormContainerProps } from '@/components/layout/ServiceFormContainer/CardFormContainer'
|
|
3
7
|
import { ServiceWizardStepperProps } from '@/components/layout/ServiceWizardStepper'
|
|
4
8
|
|
|
9
|
+
export type { ListWithIconsProps, ListWithIconsItemData }
|
|
10
|
+
|
|
5
11
|
export type { RcSesCardFormContainerProps, RcSesCardProps, ServiceWizardStepperProps }
|