@registrucentras/rc-ses-react-components 1.6.6 → 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/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/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 +4 -1
- package/dist/library/index.d.ts +9 -2
- package/dist/library/types.d.ts +3 -1
- package/dist/registrucentras-rc-ses-react-components.cjs +9 -26
- package/dist/registrucentras-rc-ses-react-components.js +3155 -2755
- 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/layout/ServiceHeader.stories.d.ts +1 -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/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/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 +6 -0
- package/src/i18n/namespaces/input/lt.json +6 -0
- package/src/library/icons.ts +6 -0
- package/src/library/index.ts +13 -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/layout/ServiceHeader.stories.tsx +43 -8
- package/src/theme/light/MuiButton.tsx +34 -1
- package/src/theme/light/index.tsx +6 -0
- package/src/theme/light/themePalette.tsx +2 -0
- package/src/theme/palette.tsx +11 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Meta } from '@storybook/blocks'
|
|
2
|
+
import { primary, secondary, grey, warning, error } from '@/theme/palette'
|
|
3
|
+
|
|
4
|
+
<Meta title="Foundations/Colors" />
|
|
5
|
+
|
|
6
|
+
# 🎨 Color Palette
|
|
7
|
+
|
|
8
|
+
All color tokens used throughout RC SES React Components are defined centrally in `src/theme/palette.tsx` and can be imported from the library.
|
|
9
|
+
|
|
10
|
+
## Primary Color
|
|
11
|
+
Used for main actions, links, and interactive elements.
|
|
12
|
+
|
|
13
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)', gap: '12px', marginBottom: '32px' }}>
|
|
14
|
+
{Object.entries(primary).map(([key, value]) => (
|
|
15
|
+
<div key={key} style={{ textAlign: 'center' }}>
|
|
16
|
+
<div style={{
|
|
17
|
+
width: '100%',
|
|
18
|
+
height: '80px',
|
|
19
|
+
backgroundColor: value,
|
|
20
|
+
borderRadius: '8px',
|
|
21
|
+
marginBottom: '8px',
|
|
22
|
+
border: '1px solid #ddd'
|
|
23
|
+
}} />
|
|
24
|
+
<div style={{ fontSize: '12px', fontWeight: '600' }}>{key}</div>
|
|
25
|
+
<div style={{ fontSize: '11px', color: '#666', fontFamily: 'monospace' }}>{value}</div>
|
|
26
|
+
</div>
|
|
27
|
+
))}
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## Secondary Color
|
|
31
|
+
Used for secondary actions and highlights.
|
|
32
|
+
|
|
33
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)', gap: '12px', marginBottom: '32px' }}>
|
|
34
|
+
{Object.entries(secondary).map(([key, value]) => (
|
|
35
|
+
<div key={key} style={{ textAlign: 'center' }}>
|
|
36
|
+
<div style={{
|
|
37
|
+
width: '100%',
|
|
38
|
+
height: '80px',
|
|
39
|
+
backgroundColor: value,
|
|
40
|
+
borderRadius: '8px',
|
|
41
|
+
marginBottom: '8px',
|
|
42
|
+
border: '1px solid #ddd'
|
|
43
|
+
}} />
|
|
44
|
+
<div style={{ fontSize: '12px', fontWeight: '600' }}>{key}</div>
|
|
45
|
+
<div style={{ fontSize: '11px', color: '#666', fontFamily: 'monospace' }}>{value}</div>
|
|
46
|
+
</div>
|
|
47
|
+
))}
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
## Neutral Colors (Grey)
|
|
51
|
+
Used for text, borders, backgrounds, and disabled states.
|
|
52
|
+
|
|
53
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)', gap: '12px', marginBottom: '32px' }}>
|
|
54
|
+
{Object.entries(grey).map(([key, value]) => (
|
|
55
|
+
<div key={key} style={{ textAlign: 'center' }}>
|
|
56
|
+
<div style={{
|
|
57
|
+
width: '100%',
|
|
58
|
+
height: '80px',
|
|
59
|
+
backgroundColor: value,
|
|
60
|
+
borderRadius: '8px',
|
|
61
|
+
marginBottom: '8px',
|
|
62
|
+
border: '1px solid #ddd'
|
|
63
|
+
}} />
|
|
64
|
+
<div style={{ fontSize: '12px', fontWeight: '600' }}>{key}</div>
|
|
65
|
+
<div style={{ fontSize: '11px', color: '#666', fontFamily: 'monospace' }}>{value}</div>
|
|
66
|
+
</div>
|
|
67
|
+
))}
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
## Warning Color
|
|
71
|
+
Used for warning messages and alerts.
|
|
72
|
+
|
|
73
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)', gap: '12px', marginBottom: '32px' }}>
|
|
74
|
+
{Object.entries(warning).map(([key, value]) => (
|
|
75
|
+
<div key={key} style={{ textAlign: 'center' }}>
|
|
76
|
+
<div style={{
|
|
77
|
+
width: '100%',
|
|
78
|
+
height: '80px',
|
|
79
|
+
backgroundColor: value,
|
|
80
|
+
borderRadius: '8px',
|
|
81
|
+
marginBottom: '8px',
|
|
82
|
+
border: '1px solid #ddd'
|
|
83
|
+
}} />
|
|
84
|
+
<div style={{ fontSize: '12px', fontWeight: '600' }}>{key}</div>
|
|
85
|
+
<div style={{ fontSize: '11px', color: '#666', fontFamily: 'monospace' }}>{value}</div>
|
|
86
|
+
</div>
|
|
87
|
+
))}
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
## Error Color
|
|
91
|
+
Used for error messages and destructive actions.
|
|
92
|
+
|
|
93
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)', gap: '12px', marginBottom: '32px' }}>
|
|
94
|
+
{Object.entries(error).map(([key, value]) => (
|
|
95
|
+
<div key={key} style={{ textAlign: 'center' }}>
|
|
96
|
+
<div style={{
|
|
97
|
+
width: '100%',
|
|
98
|
+
height: '80px',
|
|
99
|
+
backgroundColor: value,
|
|
100
|
+
borderRadius: '8px',
|
|
101
|
+
marginBottom: '8px',
|
|
102
|
+
border: '1px solid #ddd'
|
|
103
|
+
}} />
|
|
104
|
+
<div style={{ fontSize: '12px', fontWeight: '600' }}>{key}</div>
|
|
105
|
+
<div style={{ fontSize: '11px', color: '#666', fontFamily: 'monospace' }}>{value}</div>
|
|
106
|
+
</div>
|
|
107
|
+
))}
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
## Usage
|
|
111
|
+
|
|
112
|
+
Import and use color tokens in your components:
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
// Import the entire palette
|
|
116
|
+
import palette from '@/theme/palette'
|
|
117
|
+
|
|
118
|
+
// Use in components
|
|
119
|
+
<Box sx={{ backgroundColor: palette.primary['50'] }} />
|
|
120
|
+
|
|
121
|
+
// Or destructure specific colors
|
|
122
|
+
import { primary, error, grey } from '@/theme/palette'
|
|
123
|
+
|
|
124
|
+
const color = primary['600']
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
|
|
@@ -3,6 +3,7 @@ import { fn } from '@storybook/test'
|
|
|
3
3
|
|
|
4
4
|
import PlusBoldIcon from '@/assets/icons/PlusBoldIcon'
|
|
5
5
|
import Button from '@/components/common/Button'
|
|
6
|
+
import { grey } from '@/theme/palette'
|
|
6
7
|
import { ButtonProps } from '@/types/buttons/ButtonProps'
|
|
7
8
|
|
|
8
9
|
const variantOptions: Array<ButtonProps['variant']> = [
|
|
@@ -21,6 +22,8 @@ const colorOptions = [
|
|
|
21
22
|
'success',
|
|
22
23
|
'info',
|
|
23
24
|
'warning',
|
|
25
|
+
'light',
|
|
26
|
+
'ghost',
|
|
24
27
|
]
|
|
25
28
|
|
|
26
29
|
const meta = {
|
|
@@ -234,3 +237,130 @@ export const ErrorOutlined: Story = {
|
|
|
234
237
|
variant: 'outlined',
|
|
235
238
|
},
|
|
236
239
|
}
|
|
240
|
+
|
|
241
|
+
export const LightOutlined: Story = {
|
|
242
|
+
args: {
|
|
243
|
+
variant: 'outlined',
|
|
244
|
+
color: 'light' as any,
|
|
245
|
+
children: 'Light Button',
|
|
246
|
+
},
|
|
247
|
+
decorators: [
|
|
248
|
+
(Story) => (
|
|
249
|
+
<div
|
|
250
|
+
style={{
|
|
251
|
+
backgroundColor: grey[900],
|
|
252
|
+
padding: '0.5rem',
|
|
253
|
+
borderRadius: '0.5rem',
|
|
254
|
+
display: 'inline-flex',
|
|
255
|
+
alignItems: 'center',
|
|
256
|
+
justifyContent: 'center',
|
|
257
|
+
}}
|
|
258
|
+
>
|
|
259
|
+
<Story />
|
|
260
|
+
</div>
|
|
261
|
+
),
|
|
262
|
+
],
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export const LightOutlinedWithIcon: Story = {
|
|
266
|
+
args: {
|
|
267
|
+
variant: 'outlined',
|
|
268
|
+
color: 'light' as any,
|
|
269
|
+
startIcon: <PlusBoldIcon />,
|
|
270
|
+
children: 'Light Button with Icon',
|
|
271
|
+
},
|
|
272
|
+
decorators: [
|
|
273
|
+
(Story) => (
|
|
274
|
+
<div
|
|
275
|
+
style={{
|
|
276
|
+
backgroundColor: grey[900],
|
|
277
|
+
padding: '0.5rem',
|
|
278
|
+
borderRadius: '0.5rem',
|
|
279
|
+
display: 'inline-flex',
|
|
280
|
+
alignItems: 'center',
|
|
281
|
+
justifyContent: 'center',
|
|
282
|
+
}}
|
|
283
|
+
>
|
|
284
|
+
<Story />
|
|
285
|
+
</div>
|
|
286
|
+
),
|
|
287
|
+
],
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export const LightOutlinedDisabled: Story = {
|
|
291
|
+
args: {
|
|
292
|
+
variant: 'outlined',
|
|
293
|
+
color: 'light' as any,
|
|
294
|
+
children: 'Light Button Disabled',
|
|
295
|
+
disabled: true,
|
|
296
|
+
},
|
|
297
|
+
decorators: [
|
|
298
|
+
(Story) => (
|
|
299
|
+
<div
|
|
300
|
+
style={{
|
|
301
|
+
backgroundColor: grey[900],
|
|
302
|
+
padding: '0.5rem',
|
|
303
|
+
borderRadius: '0.5rem',
|
|
304
|
+
display: 'inline-flex',
|
|
305
|
+
alignItems: 'center',
|
|
306
|
+
justifyContent: 'center',
|
|
307
|
+
}}
|
|
308
|
+
>
|
|
309
|
+
<Story />
|
|
310
|
+
</div>
|
|
311
|
+
),
|
|
312
|
+
],
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export const GhostOutlinedIconOnly: Story = {
|
|
316
|
+
args: {
|
|
317
|
+
'aria-label': 'Close',
|
|
318
|
+
children: <PlusBoldIcon />,
|
|
319
|
+
color: 'ghost' as any,
|
|
320
|
+
iconOnly: true,
|
|
321
|
+
variant: 'outlined',
|
|
322
|
+
},
|
|
323
|
+
decorators: [
|
|
324
|
+
(Story) => (
|
|
325
|
+
<div
|
|
326
|
+
style={{
|
|
327
|
+
backgroundColor: grey[900],
|
|
328
|
+
padding: '0.5rem',
|
|
329
|
+
borderRadius: '0.5rem',
|
|
330
|
+
display: 'inline-flex',
|
|
331
|
+
alignItems: 'center',
|
|
332
|
+
justifyContent: 'center',
|
|
333
|
+
}}
|
|
334
|
+
>
|
|
335
|
+
<Story />
|
|
336
|
+
</div>
|
|
337
|
+
),
|
|
338
|
+
],
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export const GhostOutlinedIconOnlyDisabled: Story = {
|
|
342
|
+
args: {
|
|
343
|
+
'aria-label': 'Close',
|
|
344
|
+
children: <PlusBoldIcon />,
|
|
345
|
+
color: 'ghost' as any,
|
|
346
|
+
disabled: true,
|
|
347
|
+
iconOnly: true,
|
|
348
|
+
variant: 'outlined',
|
|
349
|
+
},
|
|
350
|
+
decorators: [
|
|
351
|
+
(Story) => (
|
|
352
|
+
<div
|
|
353
|
+
style={{
|
|
354
|
+
backgroundColor: grey[900],
|
|
355
|
+
padding: '0.5rem',
|
|
356
|
+
borderRadius: '0.5rem',
|
|
357
|
+
display: 'inline-flex',
|
|
358
|
+
alignItems: 'center',
|
|
359
|
+
justifyContent: 'center',
|
|
360
|
+
}}
|
|
361
|
+
>
|
|
362
|
+
<Story />
|
|
363
|
+
</div>
|
|
364
|
+
),
|
|
365
|
+
],
|
|
366
|
+
}
|
|
@@ -4,38 +4,55 @@ import { useState } from 'react'
|
|
|
4
4
|
import InfoFillIcon from '@/assets/icons/InfoFillIcon'
|
|
5
5
|
import QuestionIcon from '@/assets/icons/QuestionIcon'
|
|
6
6
|
import WarningFillIcon from '@/assets/icons/WarningFillIcon'
|
|
7
|
+
import type { ListWithIconsItemData } from '@/components/common/ListWithIcons/ListWithIcons.types'
|
|
7
8
|
import SelectableCardList, {
|
|
8
9
|
type SelectableCardListItemData,
|
|
9
10
|
type SelectableCardListProps,
|
|
10
11
|
} from '@/components/common/SelectableCardList'
|
|
11
12
|
|
|
13
|
+
const getListItems = (index: number): ListWithIconsItemData[] => {
|
|
14
|
+
switch (index) {
|
|
15
|
+
case 7:
|
|
16
|
+
return []
|
|
17
|
+
|
|
18
|
+
case 6:
|
|
19
|
+
return [{ text: 'International shipping' }]
|
|
20
|
+
|
|
21
|
+
default:
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
icon: InfoFillIcon,
|
|
25
|
+
text: 'Estimated time: 3 business days',
|
|
26
|
+
tooltip: 'Estimated processing duration.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
icon: QuestionIcon,
|
|
30
|
+
text: 'Requires identity verification',
|
|
31
|
+
tooltip: 'You may be asked to verify your identity.',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
icon: WarningFillIcon,
|
|
35
|
+
text: 'Additional fees may apply',
|
|
36
|
+
tooltip: 'Fees depend on selected add-ons.',
|
|
37
|
+
disabled: index % 3 === 0,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
text: 'International shipping',
|
|
41
|
+
},
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
12
46
|
const buildItems = (): SelectableCardListItemData[] =>
|
|
13
47
|
Array.from({ length: 8 }, (_, index) => ({
|
|
14
48
|
id: `item-${index + 1}`,
|
|
15
49
|
title: `Service option ${index + 1}`,
|
|
16
50
|
subtitle: index % 2 === 0 ? 'Recommended for most users' : 'Alternative flow',
|
|
17
|
-
listItems:
|
|
18
|
-
{
|
|
19
|
-
icon: InfoFillIcon,
|
|
20
|
-
text: 'Estimated time: 3 business days',
|
|
21
|
-
tooltip: 'Estimated processing duration.',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
icon: QuestionIcon,
|
|
25
|
-
text: 'Requires identity verification',
|
|
26
|
-
tooltip: 'You may be asked to verify your identity.',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
icon: WarningFillIcon,
|
|
30
|
-
text: 'Additional fees may apply',
|
|
31
|
-
tooltip: 'Fees depend on selected add-ons.',
|
|
32
|
-
disabled: index % 3 === 0,
|
|
33
|
-
},
|
|
34
|
-
],
|
|
51
|
+
listItems: getListItems(index),
|
|
35
52
|
}))
|
|
36
53
|
|
|
37
54
|
const meta = {
|
|
38
|
-
title: 'components/
|
|
55
|
+
title: 'components/display/SelectableCardList',
|
|
39
56
|
component: SelectableCardList,
|
|
40
57
|
tags: ['autodocs'],
|
|
41
58
|
args: {
|