@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.
Files changed (60) hide show
  1. package/README.md +4 -0
  2. package/dist/assets/icons/ShoppingCartIcon.d.ts +3 -0
  3. package/dist/components/common/CardShell/index.d.ts +1 -1
  4. package/dist/components/common/CardShell/types.d.ts +10 -0
  5. package/dist/components/common/ListWithIcons/ListWithIcons.types.d.ts +4 -1
  6. package/dist/components/common/StepCard/StepCardFooter/index.d.ts +34 -0
  7. package/dist/components/common/StepCard/index.d.ts +3 -0
  8. package/dist/components/common/StepCard/types.d.ts +39 -0
  9. package/dist/components/common/TitleBlock/types.d.ts +1 -1
  10. package/dist/components/layout/ServiceFormContainer/CardFormContainer/index.d.ts +3 -0
  11. package/dist/components/loaders/LoadingSpinner/index.d.ts +1 -4
  12. package/dist/library/icons.d.ts +2 -1
  13. package/dist/library/index.d.ts +2 -1
  14. package/dist/library/types.d.ts +4 -3
  15. package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
  16. package/dist/registrucentras-rc-ses-react-components.js +2091 -1888
  17. package/dist/theme/cards.d.ts +12 -12
  18. package/dist/theme/light/MuiTypography.d.ts +14 -0
  19. package/dist/theme/palette.d.ts +124 -124
  20. package/dist/theme/spacing.d.ts +4 -0
  21. package/package.json +2 -1
  22. package/src/assets/icons/ShoppingCartIcon.tsx +16 -0
  23. package/src/components/common/Button/index.test.tsx +20 -11
  24. package/src/components/common/Button/index.tsx +8 -44
  25. package/src/components/common/CardShell/index.tsx +6 -2
  26. package/src/components/common/CardShell/types.ts +10 -0
  27. package/src/components/common/ListWithIcons/ListWithIcons.types.ts +22 -1
  28. package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +13 -4
  29. package/src/components/common/ListWithIcons/index.test.tsx +42 -0
  30. package/src/components/common/StepCard/StepCardFooter/index.test.tsx +162 -0
  31. package/src/components/common/StepCard/StepCardFooter/index.tsx +120 -0
  32. package/src/components/common/StepCard/index.test.tsx +120 -0
  33. package/src/components/common/StepCard/index.tsx +74 -0
  34. package/src/components/common/StepCard/types.ts +45 -0
  35. package/src/components/common/TitleBlock/types.ts +1 -1
  36. package/src/components/form/inputs/SearchableField.test.tsx +1 -1
  37. package/src/components/layout/ServiceFormContainer/CardFormContainer/index.tsx +3 -0
  38. package/src/components/loaders/LoadingSpinner/index.tsx +3 -26
  39. package/src/examples/ListWithPagination/index.tsx +2 -1
  40. package/src/i18n/namespaces/common/en.json +7 -0
  41. package/src/i18n/namespaces/common/lt.json +7 -0
  42. package/src/library/icons.ts +2 -0
  43. package/src/library/index.ts +2 -0
  44. package/src/library/types.ts +17 -2
  45. package/src/stories/atoms/Button.stories.tsx +202 -497
  46. package/src/stories/foundations/ThemedMuiComponents.stories.tsx +2 -2
  47. package/src/stories/molecules/CardShell.stories.tsx +36 -2
  48. package/src/stories/molecules/DatePicker.stories.tsx +1 -2
  49. package/src/stories/molecules/ListWithIcons.stories.tsx +26 -0
  50. package/src/stories/molecules/Popover.stories.tsx +1 -1
  51. package/src/stories/molecules/StepCard.stories.tsx +181 -0
  52. package/src/stories/molecules/TitleBlock.stories.tsx +2 -2
  53. package/src/stories/organisms/AdvancedListItem.stories.tsx +80 -0
  54. package/src/stories/organisms/CardFormContainer.stories.tsx +1 -1
  55. package/src/stories/organisms/Dialog.stories.tsx +1 -2
  56. package/src/theme/light/MuiButton.tsx +54 -0
  57. package/src/theme/light/MuiCard.tsx +9 -7
  58. package/src/theme/light/MuiTypography.tsx +17 -0
  59. package/src/theme/palette.tsx +7 -7
  60. package/src/theme/spacing.ts +5 -0
@@ -50,16 +50,16 @@ declare const footer: {
50
50
  };
51
51
  declare const themes: {
52
52
  brand: {
53
- backgroundColor: string;
54
- borderColor: string;
53
+ backgroundColor: "#f3fbfe";
54
+ borderColor: "#b9e9fa";
55
55
  };
56
56
  default: {
57
- backgroundColor: string;
58
- borderColor: string;
57
+ backgroundColor: "#ffffff";
58
+ borderColor: "#c5cad1";
59
59
  };
60
60
  sunken: {
61
- backgroundColor: string;
62
- borderColor: string;
61
+ backgroundColor: "#f0f2f5";
62
+ borderColor: "#dce0e5";
63
63
  };
64
64
  };
65
65
  export { borderWidth, card, footer, header, subcard, themes };
@@ -102,16 +102,16 @@ declare const _default: {
102
102
  };
103
103
  themes: {
104
104
  brand: {
105
- backgroundColor: string;
106
- borderColor: string;
105
+ backgroundColor: "#f3fbfe";
106
+ borderColor: "#b9e9fa";
107
107
  };
108
108
  default: {
109
- backgroundColor: string;
110
- borderColor: string;
109
+ backgroundColor: "#ffffff";
110
+ borderColor: "#c5cad1";
111
111
  };
112
112
  sunken: {
113
- backgroundColor: string;
114
- borderColor: string;
113
+ backgroundColor: "#f0f2f5";
114
+ borderColor: "#dce0e5";
115
115
  };
116
116
  };
117
117
  };
@@ -1,3 +1,17 @@
1
1
  import { Components } from '@mui/material';
2
+ export declare const typography: {
3
+ bodyRegularMuted: {
4
+ color: "#8e959e";
5
+ fontSize: string;
6
+ fontWeight: number;
7
+ lineHeight: string;
8
+ };
9
+ priceEmphasis: {
10
+ color: "#1f2733";
11
+ fontSize: string;
12
+ fontWeight: number;
13
+ lineHeight: string;
14
+ };
15
+ };
2
16
  declare const MuiTypography: Components['MuiTypography'];
3
17
  export default MuiTypography;
@@ -1,152 +1,152 @@
1
1
  declare const primary: {
2
- '50': string;
3
- '100': string;
4
- '200': string;
5
- '300': string;
6
- '400': string;
7
- '500': string;
8
- '600': string;
9
- '700': string;
10
- '800': string;
11
- '900': string;
12
- '950': string;
13
- main: string;
2
+ readonly '50': "#f3fbfe";
3
+ readonly '100': "#dcf4fc";
4
+ readonly '200': "#b9e9fa";
5
+ readonly '300': "#88daf7";
6
+ readonly '400': "#50c9f3";
7
+ readonly '500': "#06a0d4";
8
+ readonly '600': "#0079ad";
9
+ readonly '700': "#0e6790";
10
+ readonly '800': "#155575";
11
+ readonly '900': "#164763";
12
+ readonly '950': "#082d44";
13
+ readonly main: "#06a0d4";
14
14
  };
15
15
  declare const secondary: {
16
- '50': string;
17
- '100': string;
18
- '200': string;
19
- '300': string;
20
- '400': string;
21
- '500': string;
22
- '600': string;
23
- '700': string;
24
- '800': string;
25
- '900': string;
26
- '950': string;
27
- main: string;
16
+ readonly '50': "#ecfdf6";
17
+ readonly '100': "#d1fae7";
18
+ readonly '200': "#a5f3d3";
19
+ readonly '300': "#6fe7bd";
20
+ readonly '400': "#05d091";
21
+ readonly '500': "#00c288";
22
+ readonly '600': "#00a879";
23
+ readonly '700': "#008561";
24
+ readonly '800': "#00664e";
25
+ readonly '900': "#004e3d";
26
+ readonly '950': "#002c24";
27
+ readonly main: "#00c288";
28
28
  };
29
29
  declare const grey: {
30
- '50': string;
31
- '100': string;
32
- '200': string;
33
- '300': string;
34
- '400': string;
35
- '500': string;
36
- '600': string;
37
- '700': string;
38
- '800': string;
39
- '900': string;
40
- '950': string;
41
- main: string;
30
+ readonly '50': "#f9fafb";
31
+ readonly '100': "#f0f2f5";
32
+ readonly '200': "#dce0e5";
33
+ readonly '300': "#c5cad1";
34
+ readonly '400': "#a9afb8";
35
+ readonly '500': "#8e959e";
36
+ readonly '600': "#6b747f";
37
+ readonly '700': "#4a5361";
38
+ readonly '800': "#29323d";
39
+ readonly '900': "#1f2733";
40
+ readonly '950': "#10161f";
41
+ readonly main: "#8e959e";
42
42
  };
43
43
  declare const warning: {
44
- '50': string;
45
- '100': string;
46
- '200': string;
47
- '300': string;
48
- '400': string;
49
- '500': string;
50
- '600': string;
51
- '700': string;
52
- '800': string;
53
- '900': string;
54
- '950': string;
55
- main: string;
44
+ readonly '50': "#fef9ef";
45
+ readonly '100': "#fdefcf";
46
+ readonly '200': "#fce09f";
47
+ readonly '300': "#fbd170";
48
+ readonly '400': "#fac240";
49
+ readonly '500': "#f9b311";
50
+ readonly '600': "#c78f0d";
51
+ readonly '700': "#956b0a";
52
+ readonly '800': "#634706";
53
+ readonly '900': "#4a3504";
54
+ readonly '950': "#312303";
55
+ readonly main: "#f9b311";
56
56
  };
57
57
  declare const error: {
58
- '50': string;
59
- '100': string;
60
- '200': string;
61
- '300': string;
62
- '400': string;
63
- '500': string;
64
- '600': string;
65
- '700': string;
66
- '800': string;
67
- '900': string;
68
- '950': string;
69
- main: string;
58
+ readonly '50': "#fef4f2";
59
+ readonly '100': "#fededa";
60
+ readonly '200': "#fdbdb5";
61
+ readonly '300': "#fc9c90";
62
+ readonly '400': "#fb7b6b";
63
+ readonly '500': "#fa5a46";
64
+ readonly '600': "#c84838";
65
+ readonly '700': "#96362a";
66
+ readonly '800': "#63231b";
67
+ readonly '900': "#4a1a14";
68
+ readonly '950': "#31110d";
69
+ readonly main: "#fa5a46";
70
70
  };
71
71
  declare const overlays: {
72
- '200': string;
73
- '300': string;
74
- main: string;
72
+ readonly '200': "#ffffff14";
73
+ readonly '300': "#ffffff29";
74
+ readonly main: "#ffffff14";
75
75
  };
76
76
  declare const common: {
77
- white: string;
77
+ readonly white: "#ffffff";
78
78
  };
79
79
  export { primary, secondary, grey, warning, error, overlays, common };
80
80
  declare const _default: {
81
81
  primary: {
82
- '50': string;
83
- '100': string;
84
- '200': string;
85
- '300': string;
86
- '400': string;
87
- '500': string;
88
- '600': string;
89
- '700': string;
90
- '800': string;
91
- '900': string;
92
- '950': string;
93
- main: string;
82
+ readonly '50': "#f3fbfe";
83
+ readonly '100': "#dcf4fc";
84
+ readonly '200': "#b9e9fa";
85
+ readonly '300': "#88daf7";
86
+ readonly '400': "#50c9f3";
87
+ readonly '500': "#06a0d4";
88
+ readonly '600': "#0079ad";
89
+ readonly '700': "#0e6790";
90
+ readonly '800': "#155575";
91
+ readonly '900': "#164763";
92
+ readonly '950': "#082d44";
93
+ readonly main: "#06a0d4";
94
94
  };
95
95
  secondary: {
96
- '50': string;
97
- '100': string;
98
- '200': string;
99
- '300': string;
100
- '400': string;
101
- '500': string;
102
- '600': string;
103
- '700': string;
104
- '800': string;
105
- '900': string;
106
- '950': string;
107
- main: string;
96
+ readonly '50': "#ecfdf6";
97
+ readonly '100': "#d1fae7";
98
+ readonly '200': "#a5f3d3";
99
+ readonly '300': "#6fe7bd";
100
+ readonly '400': "#05d091";
101
+ readonly '500': "#00c288";
102
+ readonly '600': "#00a879";
103
+ readonly '700': "#008561";
104
+ readonly '800': "#00664e";
105
+ readonly '900': "#004e3d";
106
+ readonly '950': "#002c24";
107
+ readonly main: "#00c288";
108
108
  };
109
109
  grey: {
110
- '50': string;
111
- '100': string;
112
- '200': string;
113
- '300': string;
114
- '400': string;
115
- '500': string;
116
- '600': string;
117
- '700': string;
118
- '800': string;
119
- '900': string;
120
- '950': string;
121
- main: string;
110
+ readonly '50': "#f9fafb";
111
+ readonly '100': "#f0f2f5";
112
+ readonly '200': "#dce0e5";
113
+ readonly '300': "#c5cad1";
114
+ readonly '400': "#a9afb8";
115
+ readonly '500': "#8e959e";
116
+ readonly '600': "#6b747f";
117
+ readonly '700': "#4a5361";
118
+ readonly '800': "#29323d";
119
+ readonly '900': "#1f2733";
120
+ readonly '950': "#10161f";
121
+ readonly main: "#8e959e";
122
122
  };
123
123
  warning: {
124
- '50': string;
125
- '100': string;
126
- '200': string;
127
- '300': string;
128
- '400': string;
129
- '500': string;
130
- '600': string;
131
- '700': string;
132
- '800': string;
133
- '900': string;
134
- '950': string;
135
- main: string;
124
+ readonly '50': "#fef9ef";
125
+ readonly '100': "#fdefcf";
126
+ readonly '200': "#fce09f";
127
+ readonly '300': "#fbd170";
128
+ readonly '400': "#fac240";
129
+ readonly '500': "#f9b311";
130
+ readonly '600': "#c78f0d";
131
+ readonly '700': "#956b0a";
132
+ readonly '800': "#634706";
133
+ readonly '900': "#4a3504";
134
+ readonly '950': "#312303";
135
+ readonly main: "#f9b311";
136
136
  };
137
137
  error: {
138
- '50': string;
139
- '100': string;
140
- '200': string;
141
- '300': string;
142
- '400': string;
143
- '500': string;
144
- '600': string;
145
- '700': string;
146
- '800': string;
147
- '900': string;
148
- '950': string;
149
- main: string;
138
+ readonly '50': "#fef4f2";
139
+ readonly '100': "#fededa";
140
+ readonly '200': "#fdbdb5";
141
+ readonly '300': "#fc9c90";
142
+ readonly '400': "#fb7b6b";
143
+ readonly '500': "#fa5a46";
144
+ readonly '600': "#c84838";
145
+ readonly '700': "#96362a";
146
+ readonly '800': "#63231b";
147
+ readonly '900': "#4a1a14";
148
+ readonly '950': "#31110d";
149
+ readonly main: "#fa5a46";
150
150
  };
151
151
  };
152
152
  export default _default;
@@ -0,0 +1,4 @@
1
+ export declare const spacing: {
2
+ sectionGap: string;
3
+ };
4
+ export default spacing;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@registrucentras/rc-ses-react-components",
3
3
  "author": "VĮ REGISTRŲ CENTRAS",
4
- "version": "2.0.0",
4
+ "version": "2.1.0",
5
5
  "description": "RC SES React komponentų biblioteka",
6
6
  "type": "module",
7
7
  "private": false,
@@ -117,6 +117,7 @@
117
117
  "react-router-dom": "6.26.2",
118
118
  "rollup-plugin-typescript2": "^0.37.0",
119
119
  "storybook": "^10.5.5",
120
+ "storybook-addon-tag-badges": "^3.1.0",
120
121
  "typescript": "^5.9.3",
121
122
  "typescript-eslint": "^8.65.0",
122
123
  "vite": "^7.3.6",
@@ -0,0 +1,16 @@
1
+ import { ShoppingCartIcon as PhosphorShoppingCartIcon } from '@phosphor-icons/react'
2
+
3
+ import IconProps from '../IconProps'
4
+
5
+ function ShoppingCartIcon({ className, size = 24, fillColor, ...rest }: IconProps) {
6
+ return (
7
+ <PhosphorShoppingCartIcon
8
+ {...rest}
9
+ className={className}
10
+ size={size}
11
+ color={fillColor}
12
+ />
13
+ )
14
+ }
15
+
16
+ export default ShoppingCartIcon
@@ -12,7 +12,7 @@ describe('Button Component', () => {
12
12
  expect(spinner).toBeInTheDocument()
13
13
  })
14
14
 
15
- it('should set aria-busy attribute when loading', () => {
15
+ it('should mark the button as busy when loading', () => {
16
16
  render(<Button loading>Save</Button>)
17
17
 
18
18
  const button = screen.getByRole('button')
@@ -26,32 +26,40 @@ describe('Button Component', () => {
26
26
  expect(button).toBeDisabled()
27
27
  })
28
28
 
29
- it('should show spinner instead of children when loading', () => {
29
+ it('should keep children in the DOM alongside the spinner when loading (label is visually hidden via CSS)', () => {
30
30
  render(<Button loading>Save</Button>)
31
31
 
32
- expect(screen.queryByText('Save')).not.toBeInTheDocument()
32
+ expect(screen.getByText('Save')).toBeInTheDocument()
33
33
  expect(screen.getByRole('progressbar')).toBeInTheDocument()
34
34
  })
35
35
 
36
- it('should replace startIcon with spinner when loading', () => {
36
+ it('should hide startIcon when loadingPosition is "start"', () => {
37
37
  render(
38
- <Button loading startIcon={<span data-testid='start-icon'>+</span>}>
38
+ <Button
39
+ loading
40
+ loadingPosition='start'
41
+ startIcon={<span data-testid='start-icon'>+</span>}
42
+ >
39
43
  Add
40
44
  </Button>,
41
45
  )
42
46
 
43
- expect(screen.queryByTestId('start-icon')).not.toBeInTheDocument()
47
+ expect(screen.getByRole('button')).toHaveClass('MuiButton-loadingPositionStart')
44
48
  expect(screen.getByRole('progressbar')).toBeInTheDocument()
45
49
  })
46
50
 
47
- it('should replace endIcon with spinner when loading', () => {
51
+ it('should hide endIcon when loadingPosition is "end"', () => {
48
52
  render(
49
- <Button loading endIcon={<span data-testid='end-icon'>→</span>}>
53
+ <Button
54
+ loading
55
+ loadingPosition='end'
56
+ endIcon={<span data-testid='end-icon'>→</span>}
57
+ >
50
58
  Next
51
59
  </Button>,
52
60
  )
53
61
 
54
- expect(screen.queryByTestId('end-icon')).not.toBeInTheDocument()
62
+ expect(screen.getByRole('button')).toHaveClass('MuiButton-loadingPositionEnd')
55
63
  expect(screen.getByRole('progressbar')).toBeInTheDocument()
56
64
  })
57
65
 
@@ -136,20 +144,21 @@ describe('Button Component', () => {
136
144
  })
137
145
 
138
146
  describe('Icon Only Buttons', () => {
139
- it('should show spinner in place of icon when loading and iconOnly', () => {
147
+ it('should render spinner when loading and iconOnly (icon visually hidden via CSS)', () => {
140
148
  render(
141
149
  <Button
142
150
  loading
143
151
  iconOnly
144
152
  variant='contained'
153
+ aria-label='Add'
145
154
  startIcon={<span data-testid='icon'>+</span>}
146
155
  >
147
156
  Add
148
157
  </Button>,
149
158
  )
150
159
 
151
- expect(screen.queryByTestId('icon')).not.toBeInTheDocument()
152
160
  expect(screen.getByRole('progressbar')).toBeInTheDocument()
161
+ expect(screen.getByRole('button')).toHaveClass('MuiButton-loading')
153
162
  })
154
163
  })
155
164
 
@@ -3,7 +3,7 @@ import type { ButtonTypeMap } from '@mui/material/Button'
3
3
  import type { ExtendButtonBase } from '@mui/material/ButtonBase'
4
4
  import { useTranslation } from 'react-i18next'
5
5
 
6
- import RcSesLoadingSpinner, { getSpinnerColor } from '@/components/loaders/LoadingSpinner'
6
+ import RcSesLoadingSpinner from '@/components/loaders/LoadingSpinner'
7
7
  import { ButtonProps } from '@/types/buttons/ButtonProps'
8
8
 
9
9
  const defaultProps: Partial<MuiButtonProps> = {
@@ -18,67 +18,31 @@ const ICON_ONLY_SIZE_MAP = {
18
18
  large: '3rem',
19
19
  } as const
20
20
 
21
- // MUI 6 added a native `loading` prop (`boolean | null`, alongside
22
- // `loadingIndicator` and `loadingPosition`), so it no longer needs declaring
23
- // here - re-declaring it as `boolean` conflicted with MUI's nullable type at
24
- // every call site that spreads ButtonProps.
25
- //
26
- // Behaviour is unchanged: `loading` is still destructured out below and drives
27
- // the custom RcSesLoadingSpinner, so it never reaches MuiButton and the native
28
- // indicator stays inactive. Switching over to MUI's implementation is a
29
- // breaking change, tracked as SAV-5916.
30
21
  type Props = ButtonProps
31
22
 
32
23
  function RcSesButtonComponent(props: Props) {
33
24
  const { t } = useTranslation('common')
34
- const {
35
- children,
36
- iconOnly,
37
- loading = false,
38
- size = 'medium',
39
- sx,
40
- variant,
41
- ...rest
42
- } = props
25
+ const { children, iconOnly, size = 'medium', sx, variant, ...rest } = props
43
26
 
44
27
  const currentVariant = variant ?? defaultProps.variant
45
28
  const isIconOnly =
46
29
  !!iconOnly && (currentVariant === 'contained' || currentVariant === 'outlined')
47
30
 
48
- const showSpinnerInContent = loading && !isIconOnly && !rest.startIcon && !rest.endIcon
49
- const showSpinnerAsIcon = loading && isIconOnly
50
-
51
- const spinnerColor = getSpinnerColor(rest.color)
52
- const spinner = <RcSesLoadingSpinner color={spinnerColor} size={size} />
53
-
54
- const getIconDisplay = (icon: React.ReactNode) => {
55
- if (showSpinnerAsIcon) return undefined
56
- if (loading && !isIconOnly && icon) return spinner
57
- return icon
58
- }
59
-
60
- const displayIcon = getIconDisplay(rest.startIcon)
61
- const displayEndIcon = getIconDisplay(rest.endIcon)
62
-
63
- let displayContent = children
64
- if (showSpinnerInContent || showSpinnerAsIcon) displayContent = spinner
65
-
66
31
  return (
67
32
  <MuiButton
68
33
  {...defaultProps}
69
34
  {...rest}
70
- // TODO: use loading prop when MUI lib upgrade is done
71
- disabled={loading || rest.disabled}
72
35
  size={size}
73
36
  variant={currentVariant}
74
- aria-busy={loading || undefined}
37
+ aria-busy={rest.loading || undefined}
75
38
  aria-label={
76
- loading && rest['aria-label']
39
+ rest.loading && rest['aria-label']
77
40
  ? `${rest['aria-label']} – ${t('components.Button.loading')}`
78
41
  : rest['aria-label']
79
42
  }
80
- startIcon={displayIcon}
81
- endIcon={displayEndIcon}
43
+ loadingIndicator={
44
+ rest.loadingIndicator ?? <RcSesLoadingSpinner color='inherit' size={size} />
45
+ }
82
46
  sx={[
83
47
  ...(Array.isArray(sx) ? sx : [sx]),
84
48
  isIconOnly
@@ -94,7 +58,7 @@ function RcSesButtonComponent(props: Props) {
94
58
  : undefined,
95
59
  ]}
96
60
  >
97
- {displayContent}
61
+ {children}
98
62
  </MuiButton>
99
63
  )
100
64
  }
@@ -16,6 +16,8 @@ function RcSesCardShell({
16
16
  theme = 'default',
17
17
  fullHeight = false,
18
18
  borderless = false,
19
+ contentGap,
20
+ footerGap,
19
21
  header,
20
22
  children,
21
23
  footer,
@@ -28,7 +30,9 @@ function RcSesCardShell({
28
30
  const hasContent = hasSlot(children)
29
31
  const hasFooter = hasSlot(footer)
30
32
 
31
- const footerMt = hasHeader || hasContent ? cards[variant].footerGap : 0
33
+ const resolvedContentGap = contentGap ?? cards[variant].gap
34
+ const resolvedFooterGap = footerGap ?? cards[variant].footerGap
35
+ const footerMt = hasHeader || hasContent ? resolvedFooterGap : 0
32
36
 
33
37
  return (
34
38
  <Box
@@ -75,7 +79,7 @@ function RcSesCardShell({
75
79
  sx={{
76
80
  flexGrow: fullHeight ? 1 : 0,
77
81
  minWidth: 0,
78
- mt: hasHeader ? cards[variant].gap : 0,
82
+ mt: hasHeader ? resolvedContentGap : 0,
79
83
  width: '100%',
80
84
  }}
81
85
  >
@@ -17,6 +17,16 @@ export interface RcSesCardShellProps {
17
17
  fullHeight?: boolean
18
18
  /** Renders the shell without any border. */
19
19
  borderless?: boolean
20
+ /**
21
+ * Overrides the `variant` preset's header-to-content gap (`cards[variant].gap`).
22
+ * Use when a composition needs a fixed spacing regardless of breakpoint.
23
+ */
24
+ contentGap?: string
25
+ /**
26
+ * Overrides the `variant` preset's content-to-footer gap
27
+ * (`cards[variant].footerGap`).
28
+ */
29
+ footerGap?: string
20
30
  /** Header row, normally `RcSesTitleBlock`. The shell only provides the slot. */
21
31
  header?: ReactNode
22
32
  children?: ReactNode
@@ -1,9 +1,30 @@
1
1
  import { ComponentType } from 'react'
2
2
 
3
+ import {
4
+ common,
5
+ error,
6
+ grey,
7
+ overlays,
8
+ primary,
9
+ secondary,
10
+ warning,
11
+ } from '@/theme/palette'
12
+
13
+ export type ListWithIconsItemTone = 'default' | 'secondary' | 'muted' | 'link'
14
+
15
+ export type PaletteColor =
16
+ | (typeof primary)[keyof typeof primary]
17
+ | (typeof secondary)[keyof typeof secondary]
18
+ | (typeof grey)[keyof typeof grey]
19
+ | (typeof warning)[keyof typeof warning]
20
+ | (typeof error)[keyof typeof error]
21
+ | (typeof overlays)[keyof typeof overlays]
22
+ | (typeof common)[keyof typeof common]
23
+
3
24
  export interface ListWithIconsItemData {
4
25
  icon?: ComponentType<{ fillColor?: string; size?: number }>
5
26
  text?: string
6
27
  disabled?: boolean
7
28
  tooltip?: string
8
- textColor?: string
29
+ textColor?: ListWithIconsItemTone | PaletteColor
9
30
  }