@registrucentras/rc-ses-react-components 2.0.0 → 2.1.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/README.md +4 -0
- package/dist/assets/icons/ShoppingCartIcon.d.ts +3 -0
- package/dist/components/common/CardShell/index.d.ts +1 -1
- package/dist/components/common/CardShell/types.d.ts +10 -0
- package/dist/components/common/ListWithIcons/ListWithIcons.types.d.ts +4 -1
- package/dist/components/common/StepCard/StepCardFooter/index.d.ts +34 -0
- package/dist/components/common/StepCard/index.d.ts +3 -0
- package/dist/components/common/StepCard/types.d.ts +39 -0
- package/dist/components/common/TitleBlock/types.d.ts +1 -1
- package/dist/components/layout/ServiceFormContainer/CardFormContainer/index.d.ts +3 -0
- package/dist/components/loaders/LoadingSpinner/index.d.ts +1 -4
- package/dist/library/icons.d.ts +2 -1
- package/dist/library/index.d.ts +2 -1
- package/dist/library/types.d.ts +4 -3
- package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
- package/dist/registrucentras-rc-ses-react-components.js +2091 -1888
- package/dist/theme/cards.d.ts +12 -12
- package/dist/theme/light/MuiTypography.d.ts +14 -0
- package/dist/theme/palette.d.ts +124 -124
- package/dist/theme/spacing.d.ts +4 -0
- package/package.json +2 -1
- package/src/assets/icons/ShoppingCartIcon.tsx +16 -0
- package/src/components/common/Button/index.test.tsx +20 -11
- package/src/components/common/Button/index.tsx +8 -44
- package/src/components/common/CardShell/index.tsx +6 -2
- package/src/components/common/CardShell/types.ts +10 -0
- package/src/components/common/ListWithIcons/ListWithIcons.types.ts +22 -1
- package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +13 -4
- package/src/components/common/ListWithIcons/index.test.tsx +42 -0
- package/src/components/common/StepCard/StepCardFooter/index.test.tsx +162 -0
- package/src/components/common/StepCard/StepCardFooter/index.tsx +120 -0
- package/src/components/common/StepCard/index.test.tsx +120 -0
- package/src/components/common/StepCard/index.tsx +74 -0
- package/src/components/common/StepCard/types.ts +45 -0
- package/src/components/common/TitleBlock/types.ts +1 -1
- package/src/components/form/inputs/SearchableField.test.tsx +1 -1
- package/src/components/layout/ServiceFormContainer/CardFormContainer/index.tsx +3 -0
- package/src/components/loaders/LoadingSpinner/index.tsx +3 -26
- package/src/examples/ListWithPagination/index.tsx +2 -1
- package/src/i18n/namespaces/common/en.json +7 -0
- package/src/i18n/namespaces/common/lt.json +7 -0
- package/src/library/icons.ts +2 -0
- package/src/library/index.ts +2 -0
- package/src/library/types.ts +17 -2
- package/src/stories/atoms/Button.stories.tsx +202 -497
- package/src/stories/foundations/ThemedMuiComponents.stories.tsx +2 -2
- package/src/stories/molecules/CardShell.stories.tsx +36 -2
- package/src/stories/molecules/DatePicker.stories.tsx +1 -2
- package/src/stories/molecules/ListWithIcons.stories.tsx +26 -0
- package/src/stories/molecules/Popover.stories.tsx +1 -1
- package/src/stories/molecules/StepCard.stories.tsx +181 -0
- package/src/stories/molecules/TitleBlock.stories.tsx +2 -2
- package/src/stories/organisms/AdvancedListItem.stories.tsx +80 -0
- package/src/stories/organisms/CardFormContainer.stories.tsx +1 -1
- package/src/stories/organisms/Dialog.stories.tsx +1 -2
- package/src/theme/light/MuiButton.tsx +54 -0
- package/src/theme/light/MuiCard.tsx +9 -7
- package/src/theme/light/MuiTypography.tsx +17 -0
- package/src/theme/palette.tsx +7 -7
- package/src/theme/spacing.ts +5 -0
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const VALID_SPINNER_COLORS = [
|
|
4
|
-
'primary',
|
|
5
|
-
'secondary',
|
|
6
|
-
'error',
|
|
7
|
-
'warning',
|
|
8
|
-
'info',
|
|
9
|
-
'success',
|
|
10
|
-
'inherit',
|
|
11
|
-
] as const
|
|
12
|
-
|
|
13
|
-
export type RcSesSpinnerColor = (typeof VALID_SPINNER_COLORS)[number]
|
|
1
|
+
import { CircularProgress } from '@mui/material'
|
|
14
2
|
|
|
15
3
|
const SPINNER_SIZE_MAP = {
|
|
16
4
|
small: '16px',
|
|
@@ -18,19 +6,8 @@ const SPINNER_SIZE_MAP = {
|
|
|
18
6
|
large: '24px',
|
|
19
7
|
} as const
|
|
20
8
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
light: 'inherit',
|
|
24
|
-
ghost: 'inherit',
|
|
25
|
-
dark: 'inherit',
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function getSpinnerColor(color: ButtonOwnProps['color']): RcSesSpinnerColor {
|
|
29
|
-
if (color && VALID_SPINNER_COLORS.includes(color as RcSesSpinnerColor)) {
|
|
30
|
-
return color as RcSesSpinnerColor
|
|
31
|
-
}
|
|
32
|
-
return CUSTOM_COLOR_MAP[color as string] ?? 'inherit'
|
|
33
|
-
}
|
|
9
|
+
export type RcSesSpinnerColor =
|
|
10
|
+
'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success' | 'inherit'
|
|
34
11
|
|
|
35
12
|
export interface RcSesLoadingSpinnerProps {
|
|
36
13
|
color?: RcSesSpinnerColor
|
|
@@ -8,6 +8,7 @@ import SelectableCardList, {
|
|
|
8
8
|
import ServiceHeader from '@/components/layout/ServiceHeader'
|
|
9
9
|
import ServicePage from '@/components/layout/ServicePage'
|
|
10
10
|
import { BarcodeIcon, MapPinAreaIcon, ScalesIcon } from '@/library'
|
|
11
|
+
import { error } from '@/theme/palette'
|
|
11
12
|
|
|
12
13
|
interface ApiItem {
|
|
13
14
|
id: string
|
|
@@ -42,7 +43,7 @@ const mapToSelectableItems = (data: ApiItem[]): SelectableCardListItemData[] =>
|
|
|
42
43
|
id: 'status',
|
|
43
44
|
icon: ScalesIcon,
|
|
44
45
|
text: item.legalStatusName,
|
|
45
|
-
textColor: item.legalStatusName === 'Neįregistruotas' ? '
|
|
46
|
+
textColor: item.legalStatusName === 'Neįregistruotas' ? error['600'] : undefined,
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
id: 'address',
|
|
@@ -11,6 +11,13 @@
|
|
|
11
11
|
"Button": {
|
|
12
12
|
"loading": "Loading"
|
|
13
13
|
},
|
|
14
|
+
"StepCard": {
|
|
15
|
+
"cancel": "Cancel",
|
|
16
|
+
"back": "Back",
|
|
17
|
+
"continue": "Continue",
|
|
18
|
+
"addToCart": "Add to cart",
|
|
19
|
+
"totalWithoutVat": "Total excl. VAT"
|
|
20
|
+
},
|
|
14
21
|
"SegmentedControl": {
|
|
15
22
|
"options": "Options",
|
|
16
23
|
"tabs": "Tabs"
|
|
@@ -11,6 +11,13 @@
|
|
|
11
11
|
"Button": {
|
|
12
12
|
"loading": "Kraunasi"
|
|
13
13
|
},
|
|
14
|
+
"StepCard": {
|
|
15
|
+
"cancel": "Atšaukti",
|
|
16
|
+
"back": "Atgal",
|
|
17
|
+
"continue": "Tęsti",
|
|
18
|
+
"addToCart": "Pridėti į krepšelį",
|
|
19
|
+
"totalWithoutVat": "Suma be PVM"
|
|
20
|
+
},
|
|
14
21
|
"SegmentedControl": {
|
|
15
22
|
"options": "Parinktys",
|
|
16
23
|
"tabs": "Skirtukai"
|
package/src/library/icons.ts
CHANGED
|
@@ -40,6 +40,7 @@ import ScalesIcon from '@/assets/icons/ScalesIcon'
|
|
|
40
40
|
import ScrollIcon from '@/assets/icons/ScrollIcon'
|
|
41
41
|
import SearchHelpIcon from '@/assets/icons/SearchHelpIcon'
|
|
42
42
|
import SearchXIcon from '@/assets/icons/SearchXIcon'
|
|
43
|
+
import ShoppingCartIcon from '@/assets/icons/ShoppingCartIcon'
|
|
43
44
|
import SpinnerGapBoldIcon from '@/assets/icons/SpinnerGapBoldIcon'
|
|
44
45
|
import TrashIcon from '@/assets/icons/TrashIcon'
|
|
45
46
|
import UploadSimpleIcon from '@/assets/icons/UploadSimpleIcon'
|
|
@@ -92,6 +93,7 @@ export {
|
|
|
92
93
|
ScrollIcon,
|
|
93
94
|
SearchHelpIcon,
|
|
94
95
|
SearchXIcon,
|
|
96
|
+
ShoppingCartIcon,
|
|
95
97
|
SpinnerGapBoldIcon,
|
|
96
98
|
TrashIcon,
|
|
97
99
|
UploadSimpleIcon,
|
package/src/library/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
RcSesSnackbarProvider,
|
|
29
29
|
useSnackbar,
|
|
30
30
|
} from '@/components/common/Snackbar/SnackbarProvider'
|
|
31
|
+
import RcSesStepCard from '@/components/common/StepCard'
|
|
31
32
|
import RcSesSwitch from '@/components/common/Switch'
|
|
32
33
|
import RcSesTab from '@/components/common/Tabs/Tab'
|
|
33
34
|
import RcSesTabPanel from '@/components/common/Tabs/TabPanel'
|
|
@@ -96,6 +97,7 @@ export {
|
|
|
96
97
|
RcSesSnackbar,
|
|
97
98
|
RcSesSnackbarProvider,
|
|
98
99
|
RcSesModal,
|
|
100
|
+
RcSesStepCard,
|
|
99
101
|
RcSesSwitch,
|
|
100
102
|
}
|
|
101
103
|
export { RcSesSegmentedControl }
|
package/src/library/types.ts
CHANGED
|
@@ -11,7 +11,11 @@ import {
|
|
|
11
11
|
RcSesCardShellTestIds,
|
|
12
12
|
} from '@/components/common/CardShell/types'
|
|
13
13
|
import { ListWithIconsProps } from '@/components/common/ListWithIcons'
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
ListWithIconsItemData,
|
|
16
|
+
ListWithIconsItemTone,
|
|
17
|
+
PaletteColor,
|
|
18
|
+
} from '@/components/common/ListWithIcons/ListWithIcons.types'
|
|
15
19
|
import {
|
|
16
20
|
RcSesSegmentOption,
|
|
17
21
|
RcSesSegmentedControlProps,
|
|
@@ -24,6 +28,10 @@ import {
|
|
|
24
28
|
} from '@/components/common/ServiceLinks/types'
|
|
25
29
|
import { RcSesSideNavItem, RcSesSideNavOverflow } from '@/components/common/SideNav'
|
|
26
30
|
import { RcSesSideNavLayoutProps } from '@/components/common/SideNav/SideNavLayout'
|
|
31
|
+
import {
|
|
32
|
+
RcSesStepCardProps,
|
|
33
|
+
RcSesStepCardTestIds,
|
|
34
|
+
} from '@/components/common/StepCard/types'
|
|
27
35
|
import {
|
|
28
36
|
RcSesTitleBlockProps,
|
|
29
37
|
RcSesTitleBlockTestIds,
|
|
@@ -48,7 +56,12 @@ import { DialogSize, RcSesDialogProps } from '@/components/overlays/Dialog'
|
|
|
48
56
|
import { ModalVariant, RcSesModalProps } from '@/components/overlays/Modal'
|
|
49
57
|
import { ButtonProps } from '@/types/buttons/ButtonProps'
|
|
50
58
|
|
|
51
|
-
export type {
|
|
59
|
+
export type {
|
|
60
|
+
ListWithIconsProps,
|
|
61
|
+
ListWithIconsItemData,
|
|
62
|
+
ListWithIconsItemTone,
|
|
63
|
+
PaletteColor,
|
|
64
|
+
}
|
|
52
65
|
export type { RcSesServiceLinksProps, RcSesServiceLinkItem, RcSesServiceLinksTestIds }
|
|
53
66
|
export type { ButtonProps }
|
|
54
67
|
|
|
@@ -82,6 +95,8 @@ export type {
|
|
|
82
95
|
RcSesSideNavItem,
|
|
83
96
|
RcSesSideNavLayoutProps,
|
|
84
97
|
RcSesSideNavOverflow,
|
|
98
|
+
RcSesStepCardProps,
|
|
99
|
+
RcSesStepCardTestIds,
|
|
85
100
|
}
|
|
86
101
|
export type { RcSesDialogProps, DialogSize }
|
|
87
102
|
export type { RcSesModalProps, ModalVariant }
|