@registrucentras/rc-ses-react-components 1.6.5 → 1.7.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/assets/icons/ArrowsClockwiseIcon.d.ts +3 -0
- package/dist/assets/icons/SearchHelpIcon.d.ts +3 -0
- package/dist/assets/icons/SearchXIcon.d.ts +3 -0
- package/dist/components/common/Breadcrumbs/index.d.ts +3 -1
- package/dist/components/common/Snackbar/SnackbarProvider.d.ts +22 -0
- package/dist/components/common/Snackbar/config.d.ts +21 -0
- package/dist/components/common/Snackbar/index.d.ts +16 -0
- package/dist/components/common/Snackbar/types.d.ts +2 -0
- package/dist/components/form/inputs/CheckboxFormControl.d.ts +2 -0
- package/dist/components/form/inputs/FormControlLabel.d.ts +10 -0
- package/dist/components/form/inputs/SearchInput/index.d.ts +27 -0
- package/dist/components/form/inputs/SimpleCheckbox.d.ts +6 -0
- package/dist/components/layout/ServiceHeader.d.ts +2 -1
- package/dist/components/utils/loading.d.ts +3 -0
- package/dist/library/icons.d.ts +5 -1
- package/dist/library/index.d.ts +11 -2
- package/dist/library/types.d.ts +3 -1
- package/dist/registrucentras-rc-ses-react-components.cjs +10 -27
- package/dist/registrucentras-rc-ses-react-components.js +3484 -2897
- package/dist/stories/components/actions/Button.stories.d.ts +5 -0
- package/dist/stories/components/{SelectableCardList.stories.d.ts → display/SelectableCardList.stories.d.ts} +1 -1
- package/dist/stories/components/feedback/Snackbar.stories.d.ts +143 -0
- package/dist/stories/components/form/CheckboxFormControl.stories.d.ts +3 -0
- package/dist/stories/components/form/SimpleCheckbox.stories.d.ts +19 -0
- package/dist/stories/components/inputs/SearchInput.stories.d.ts +11 -0
- package/dist/stories/components/layout/ServiceHeader.stories.d.ts +1 -0
- package/dist/theme/light/MuiOutlinedInput.d.ts +3 -0
- package/dist/theme/light/index.d.ts +6 -0
- package/dist/theme/palette.d.ts +9 -1
- package/package.json +1 -1
- package/src/assets/icons/ArrowsClockwiseIcon.tsx +16 -0
- package/src/assets/icons/CheckIcon.tsx +1 -1
- package/src/assets/icons/SearchHelpIcon.tsx +44 -0
- package/src/assets/icons/SearchXIcon.tsx +41 -0
- package/src/components/common/Breadcrumbs/index.tsx +4 -3
- package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +5 -3
- package/src/components/common/ListWithIcons/index.tsx +1 -1
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +3 -1
- package/src/components/common/Snackbar/SnackbarProvider.tsx +78 -0
- package/src/components/common/Snackbar/config.ts +77 -0
- package/src/components/common/Snackbar/index.test.tsx +119 -0
- package/src/components/common/Snackbar/index.tsx +181 -0
- package/src/components/common/Snackbar/types.ts +2 -0
- package/src/components/form/inputs/Checkbox.tsx +2 -2
- package/src/components/form/inputs/CheckboxFormControl.test.tsx +68 -0
- package/src/components/form/inputs/CheckboxFormControl.tsx +48 -29
- package/src/components/form/inputs/FormControlLabel.tsx +36 -0
- package/src/components/form/inputs/SearchInput/index.test.tsx +203 -0
- package/src/components/form/inputs/SearchInput/index.tsx +282 -0
- package/src/components/form/inputs/SimpleCheckbox.tsx +23 -0
- package/src/components/layout/ServiceHeader.tsx +22 -8
- package/src/components/utils/loading.tsx +9 -0
- package/src/i18n/namespaces/input/en.json +11 -0
- package/src/i18n/namespaces/input/lt.json +11 -0
- package/src/library/icons.ts +8 -0
- package/src/library/index.ts +15 -1
- package/src/library/types.ts +9 -1
- package/src/stories/Colors.mdx +127 -0
- package/src/stories/components/actions/Button.stories.tsx +130 -0
- package/src/stories/components/{SelectableCardList.stories.tsx → display/SelectableCardList.stories.tsx} +36 -19
- package/src/stories/components/feedback/Snackbar.stories.tsx +504 -0
- package/src/stories/components/form/CheckboxFormControl.stories.tsx +312 -2
- package/src/stories/components/form/SimpleCheckbox.stories.tsx +52 -0
- package/src/stories/components/icons/Icons.stories.tsx +35 -0
- package/src/stories/components/inputs/SearchInput.stories.tsx +134 -0
- package/src/stories/components/layout/ServiceHeader.stories.tsx +43 -8
- package/src/theme/light/MuiButton.tsx +34 -1
- package/src/theme/light/MuiOutlinedInput.ts +15 -0
- package/src/theme/light/index.tsx +8 -0
- package/src/theme/light/themePalette.tsx +2 -0
- package/src/theme/palette.tsx +11 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import Typography from '@mui/material/Typography'
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import React from 'react'
|
|
3
4
|
|
|
4
5
|
import RcSesServiceHeader from '@/components/layout/ServiceHeader'
|
|
5
6
|
|
|
7
|
+
type ServiceHeaderProps = React.ComponentProps<typeof RcSesServiceHeader>
|
|
8
|
+
|
|
6
9
|
const meta: Meta<typeof RcSesServiceHeader> = {
|
|
7
10
|
title: 'components/layout/ServiceHeader',
|
|
8
11
|
component: RcSesServiceHeader,
|
|
@@ -10,26 +13,58 @@ const meta: Meta<typeof RcSesServiceHeader> = {
|
|
|
10
13
|
argTypes: {
|
|
11
14
|
title: { control: 'text' },
|
|
12
15
|
children: { control: 'text' },
|
|
16
|
+
backgroundColor: {
|
|
17
|
+
control: 'inline-radio',
|
|
18
|
+
options: ['primary', 'white'],
|
|
19
|
+
table: {
|
|
20
|
+
defaultValue: { summary: 'primary' },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
13
23
|
},
|
|
14
24
|
}
|
|
15
25
|
|
|
16
26
|
export default meta
|
|
17
27
|
type Story = StoryObj<typeof meta>
|
|
18
28
|
|
|
29
|
+
const breadcrumbs = {
|
|
30
|
+
path: [
|
|
31
|
+
{ label: 'Home', path: '/' },
|
|
32
|
+
{ label: 'Services', path: '/services' },
|
|
33
|
+
{ label: 'Service Title', path: '/services/service' },
|
|
34
|
+
],
|
|
35
|
+
}
|
|
36
|
+
|
|
19
37
|
export const Default: Story = {
|
|
20
38
|
args: {
|
|
21
39
|
title: 'Service Title',
|
|
22
40
|
children: 'This is a description of the service.',
|
|
23
|
-
breadcrumbsProps:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
breadcrumbsProps: breadcrumbs,
|
|
42
|
+
backgroundColor: 'primary',
|
|
43
|
+
},
|
|
44
|
+
render: (args) => (
|
|
45
|
+
<RcSesServiceHeader
|
|
46
|
+
title={args.title}
|
|
47
|
+
breadcrumbsProps={args.breadcrumbsProps}
|
|
48
|
+
backgroundColor={args.backgroundColor as ServiceHeaderProps['backgroundColor']}
|
|
49
|
+
>
|
|
50
|
+
{args.children && <Typography variant='body1'>{args.children}</Typography>}
|
|
51
|
+
</RcSesServiceHeader>
|
|
52
|
+
),
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const WhiteBackground: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
title: 'Service Title',
|
|
58
|
+
children: 'This is a description of the service.',
|
|
59
|
+
breadcrumbsProps: breadcrumbs,
|
|
60
|
+
backgroundColor: 'white',
|
|
30
61
|
},
|
|
31
62
|
render: (args) => (
|
|
32
|
-
<RcSesServiceHeader
|
|
63
|
+
<RcSesServiceHeader
|
|
64
|
+
title={args.title}
|
|
65
|
+
breadcrumbsProps={args.breadcrumbsProps}
|
|
66
|
+
backgroundColor={args.backgroundColor as ServiceHeaderProps['backgroundColor']}
|
|
67
|
+
>
|
|
33
68
|
{args.children && <Typography variant='body1'>{args.children}</Typography>}
|
|
34
69
|
</RcSesServiceHeader>
|
|
35
70
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Components } from '@mui/material'
|
|
2
2
|
|
|
3
|
-
import palette, { error, grey, primary, secondary, warning } from '../palette'
|
|
3
|
+
import palette, { error, grey, overlays, primary, secondary, warning } from '../palette'
|
|
4
4
|
|
|
5
5
|
const MuiButton: Components['MuiButton'] = {
|
|
6
6
|
variants: [
|
|
@@ -357,6 +357,39 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
357
357
|
backgroundColor: error[100],
|
|
358
358
|
},
|
|
359
359
|
},
|
|
360
|
+
|
|
361
|
+
'&.MuiButton-colorLight': {
|
|
362
|
+
borderColor: grey[50],
|
|
363
|
+
color: grey[50],
|
|
364
|
+
backgroundColor: 'transparent',
|
|
365
|
+
|
|
366
|
+
'&:hover': {
|
|
367
|
+
backgroundColor: overlays['200'],
|
|
368
|
+
},
|
|
369
|
+
'&:active': {
|
|
370
|
+
backgroundColor: overlays['300'],
|
|
371
|
+
},
|
|
372
|
+
'&.Mui-disabled': {
|
|
373
|
+
borderColor: `${grey[500]} !important`,
|
|
374
|
+
color: `${grey[500]} !important`,
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
|
|
378
|
+
'&.MuiButton-colorGhost': {
|
|
379
|
+
borderColor: 'transparent',
|
|
380
|
+
color: grey[50],
|
|
381
|
+
backgroundColor: 'transparent',
|
|
382
|
+
|
|
383
|
+
'&:hover': {
|
|
384
|
+
backgroundColor: overlays['200'],
|
|
385
|
+
},
|
|
386
|
+
'&:active': {
|
|
387
|
+
backgroundColor: overlays['300'],
|
|
388
|
+
},
|
|
389
|
+
'&.Mui-disabled': {
|
|
390
|
+
borderColor: `transparent !important`,
|
|
391
|
+
},
|
|
392
|
+
},
|
|
360
393
|
},
|
|
361
394
|
text: {
|
|
362
395
|
'&.MuiButton-colorGrey': {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Components } from '@mui/material'
|
|
2
|
+
|
|
3
|
+
const MuiOutlinedInput: Components['MuiOutlinedInput'] = {
|
|
4
|
+
styleOverrides: {
|
|
5
|
+
root: {
|
|
6
|
+
borderRadius: '.5rem',
|
|
7
|
+
|
|
8
|
+
'.MuiOutlinedInput-notchedOutline': {
|
|
9
|
+
borderRadius: '.5rem',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default MuiOutlinedInput
|
|
@@ -26,6 +26,7 @@ import MuiFormLabel from '@/theme/light/MuiFormLabel'
|
|
|
26
26
|
import MuiIconButton from '@/theme/light/MuiIconButton'
|
|
27
27
|
import MuiInputBase from '@/theme/light/MuiInputBase'
|
|
28
28
|
import MuiLinearProgress from '@/theme/light/MuiLinearProgress'
|
|
29
|
+
import MuiOutlinedInput from '@/theme/light/MuiOutlinedInput'
|
|
29
30
|
import MuiPickersLayout from '@/theme/light/MuiPickersLayout'
|
|
30
31
|
import MuiPopover from '@/theme/light/MuiPopover'
|
|
31
32
|
import MuiRadio from '@/theme/light/MuiRadio'
|
|
@@ -46,11 +47,15 @@ declare module '@mui/material/styles' {
|
|
|
46
47
|
interface Palette {
|
|
47
48
|
dark: Palette['grey']
|
|
48
49
|
grey: Palette['grey']
|
|
50
|
+
light: Palette['grey']
|
|
51
|
+
ghost: Palette['grey']
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
interface PaletteOptions {
|
|
52
55
|
dark?: PaletteOptions['grey']
|
|
53
56
|
grey?: PaletteOptions['grey']
|
|
57
|
+
light?: PaletteOptions['grey']
|
|
58
|
+
ghost?: PaletteOptions['grey']
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
61
|
|
|
@@ -72,6 +77,8 @@ declare module '@mui/material' {
|
|
|
72
77
|
interface ButtonPropsColorOverrides {
|
|
73
78
|
grey: any
|
|
74
79
|
dark: any
|
|
80
|
+
light: any
|
|
81
|
+
ghost: any
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
interface RadioPropsColorOverrides {
|
|
@@ -108,6 +115,7 @@ const theme = createTheme(themePalette, ltLT, enUS, {
|
|
|
108
115
|
MuiIconButton,
|
|
109
116
|
MuiInputBase,
|
|
110
117
|
MuiLinearProgress,
|
|
118
|
+
MuiOutlinedInput,
|
|
111
119
|
MuiPickersLayout,
|
|
112
120
|
MuiPagination,
|
|
113
121
|
MuiPaginationItem,
|
package/src/theme/palette.tsx
CHANGED
|
@@ -73,5 +73,15 @@ const error = {
|
|
|
73
73
|
main: '#fa5a46',
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
const overlays = {
|
|
77
|
+
'200': '#ffffff14',
|
|
78
|
+
'300': '#ffffff29',
|
|
79
|
+
main: '#ffffff14',
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const common = {
|
|
83
|
+
white: '#ffffff',
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { primary, secondary, grey, warning, error, overlays, common }
|
|
77
87
|
export default { primary, secondary, grey, warning, error }
|