@webpros/mui-theme 0.1.5 → 0.2.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 (233) hide show
  1. package/dist/package.json +6 -4
  2. package/dist/src/components/data-display/Avatar/Avatar.theme.js +11 -8
  3. package/dist/src/components/data-display/Badge/Badge.theme.d.ts +4 -1
  4. package/dist/src/components/data-display/Badge/Badge.theme.js +216 -55
  5. package/dist/src/components/data-display/Chip/Chip.theme.d.ts +17 -3
  6. package/dist/src/components/data-display/Chip/Chip.theme.js +133 -477
  7. package/dist/src/components/data-display/Chip/get-chip-colors-map.d.ts +42 -0
  8. package/dist/src/components/data-display/Chip/get-chip-colors-map.js +253 -0
  9. package/dist/src/components/data-display/Divider/Divider.theme.d.ts +6 -1
  10. package/dist/src/components/data-display/Divider/Divider.theme.js +60 -3
  11. package/dist/src/components/data-display/List/List.theme.d.ts +1 -1
  12. package/dist/src/components/data-display/List/List.theme.js +1 -1
  13. package/dist/src/components/data-display/ListItem/ListItem.theme.d.ts +1 -1
  14. package/dist/src/components/data-display/ListItem/ListItem.theme.js +16 -8
  15. package/dist/src/components/data-display/ListItemAvatar/ListItemAvatar.theme.js +1 -2
  16. package/dist/src/components/data-display/ListItemButton/ListItemButton.theme.d.ts +0 -5
  17. package/dist/src/components/data-display/ListItemButton/ListItemButton.theme.js +14 -48
  18. package/dist/src/components/data-display/ListItemIcon/ListItemIcon.theme.js +4 -4
  19. package/dist/src/components/data-display/ListSubheader/ListSubheader.theme.d.ts +1 -1
  20. package/dist/src/components/data-display/ListSubheader/ListSubheader.theme.js +2 -5
  21. package/dist/src/components/data-display/Skeleton/Skeleton.d.ts +3 -0
  22. package/dist/src/components/data-display/Skeleton/Skeleton.js +4 -0
  23. package/dist/src/components/data-display/Skeleton/Skeleton.theme.d.ts +15 -0
  24. package/dist/src/components/data-display/Skeleton/Skeleton.theme.js +31 -0
  25. package/dist/src/components/data-display/Skeleton/index.d.ts +1 -0
  26. package/dist/src/components/data-display/Skeleton/index.js +2 -0
  27. package/dist/src/components/data-display/Tooltip/Tooltip.theme.js +7 -9
  28. package/dist/src/components/data-display/Typography/Typography.theme.d.ts +19 -26
  29. package/dist/src/components/data-display/Typography/Typography.theme.js +7 -163
  30. package/dist/src/components/feedback/Alert/Alert.theme.d.ts +12 -0
  31. package/dist/src/components/feedback/Alert/Alert.theme.js +60 -45
  32. package/dist/src/components/feedback/CircularProgress/CircularProgress.theme.d.ts +6 -1
  33. package/dist/src/components/feedback/CircularProgress/CircularProgress.theme.js +49 -8
  34. package/dist/src/components/feedback/LinearProgress/LinearProgress.theme.d.ts +6 -1
  35. package/dist/src/components/feedback/LinearProgress/LinearProgress.theme.js +83 -9
  36. package/dist/src/components/feedback/Snackbar/Snackbar.theme.d.ts +4 -4
  37. package/dist/src/components/feedback/Snackbar/Snackbar.theme.js +7 -3
  38. package/dist/src/components/index.d.ts +10 -1
  39. package/dist/src/components/index.js +10 -1
  40. package/dist/src/components/inputs/Autocomplete/Autocomplete.theme.d.ts +1 -1
  41. package/dist/src/components/inputs/Autocomplete/Autocomplete.theme.js +23 -51
  42. package/dist/src/components/inputs/Autocomplete/components/AutocompleteCaretDownIcon.d.ts +1 -0
  43. package/dist/src/components/inputs/Autocomplete/components/{AutocompletePopupIcon.js → AutocompleteCaretDownIcon.js} +1 -1
  44. package/dist/src/components/inputs/Autocomplete/components/AutocompleteXIcon.d.ts +1 -0
  45. package/dist/src/components/inputs/Autocomplete/components/AutocompleteXIcon.js +4 -0
  46. package/dist/src/components/inputs/Button/Button.theme.d.ts +4 -0
  47. package/dist/src/components/inputs/Button/Button.theme.js +93 -226
  48. package/dist/src/components/inputs/Button/get-button-colors-map.d.ts +24 -0
  49. package/dist/src/components/inputs/Button/get-button-colors-map.js +211 -0
  50. package/dist/src/components/inputs/Checkbox/Checkbox.theme.d.ts +7 -2
  51. package/dist/src/components/inputs/Checkbox/Checkbox.theme.js +57 -7
  52. package/dist/src/components/inputs/Fab/Fab.theme.d.ts +5 -9
  53. package/dist/src/components/inputs/Fab/Fab.theme.js +27 -98
  54. package/dist/src/components/inputs/FormHelperText/FormHelperText.d.ts +2 -0
  55. package/dist/src/components/inputs/FormHelperText/FormHelperText.js +3 -0
  56. package/dist/src/components/inputs/FormHelperText/FormHelperText.theme.d.ts +7 -0
  57. package/dist/src/components/inputs/FormHelperText/FormHelperText.theme.js +8 -0
  58. package/dist/src/components/inputs/FormHelperText/index.d.ts +1 -0
  59. package/dist/src/components/inputs/FormHelperText/index.js +2 -0
  60. package/dist/src/components/inputs/FormLabel/FormLabel.d.ts +2 -0
  61. package/dist/src/components/inputs/FormLabel/FormLabel.js +3 -0
  62. package/dist/src/components/inputs/FormLabel/FormLabel.theme.d.ts +7 -0
  63. package/dist/src/components/inputs/FormLabel/FormLabel.theme.js +8 -0
  64. package/dist/src/components/inputs/FormLabel/index.d.ts +1 -0
  65. package/dist/src/components/inputs/FormLabel/index.js +2 -0
  66. package/dist/src/components/inputs/IconButton/IconButton.theme.d.ts +3 -2
  67. package/dist/src/components/inputs/IconButton/IconButton.theme.js +90 -95
  68. package/dist/src/components/inputs/InputBase/InputBase.theme.d.ts +9 -26
  69. package/dist/src/components/inputs/InputBase/InputBase.theme.js +2 -64
  70. package/dist/src/components/inputs/InputLabel/InputLabel.theme.d.ts +7 -4
  71. package/dist/src/components/inputs/InputLabel/InputLabel.theme.js +26 -12
  72. package/dist/src/components/inputs/OutlinedInput/OutlinedInput.theme.d.ts +8 -0
  73. package/dist/src/components/inputs/OutlinedInput/OutlinedInput.theme.js +67 -0
  74. package/dist/src/components/inputs/OutlinedInput/index.d.ts +1 -0
  75. package/dist/src/components/inputs/OutlinedInput/index.js +2 -0
  76. package/dist/src/components/inputs/Radio/Radio.d.ts +4 -0
  77. package/dist/src/components/inputs/Radio/Radio.js +4 -0
  78. package/dist/src/components/inputs/Radio/Radio.theme.d.ts +11 -0
  79. package/dist/src/components/inputs/Radio/Radio.theme.js +35 -0
  80. package/dist/src/components/inputs/Radio/index.d.ts +1 -0
  81. package/dist/src/components/{navigation/TabList → inputs/Radio}/index.js +1 -1
  82. package/dist/src/components/inputs/Select/Select.theme.d.ts +2 -3
  83. package/dist/src/components/inputs/Select/Select.theme.js +6 -33
  84. package/dist/src/components/inputs/Switch/Switch.theme.js +125 -49
  85. package/dist/src/components/inputs/TextField/TextField.theme.d.ts +2 -3
  86. package/dist/src/components/inputs/TextField/TextField.theme.js +2 -26
  87. package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.d.ts +4 -0
  88. package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.js +5 -0
  89. package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.theme.d.ts +11 -0
  90. package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.theme.js +23 -0
  91. package/dist/src/components/navigation/Breadcrumbs/Crumb.d.ts +10 -0
  92. package/dist/src/components/navigation/Breadcrumbs/Crumb.js +10 -0
  93. package/dist/src/components/navigation/Breadcrumbs/index.d.ts +1 -0
  94. package/dist/src/components/navigation/Breadcrumbs/index.js +2 -0
  95. package/dist/src/components/navigation/Drawer/Drawer.theme.d.ts +1 -1
  96. package/dist/src/components/navigation/Drawer/Drawer.theme.js +50 -6
  97. package/dist/src/components/navigation/Link/Link.theme.d.ts +11 -2
  98. package/dist/src/components/navigation/Link/Link.theme.js +66 -9
  99. package/dist/src/components/navigation/Menu/Menu.theme.d.ts +2 -3
  100. package/dist/src/components/navigation/Menu/Menu.theme.js +6 -11
  101. package/dist/src/components/navigation/MenuItem/MenuItem.theme.d.ts +2 -4
  102. package/dist/src/components/navigation/MenuItem/MenuItem.theme.js +8 -8
  103. package/dist/src/components/navigation/Pagination/Pagination.theme.d.ts +1 -1
  104. package/dist/src/components/navigation/Pagination/Pagination.theme.js +11 -3
  105. package/dist/src/components/navigation/PaginationItem/PaginationItem.theme.js +65 -10
  106. package/dist/src/components/navigation/PaginationItem/components/PaginationIcons.d.ts +4 -0
  107. package/dist/src/components/navigation/PaginationItem/components/PaginationIcons.js +8 -0
  108. package/dist/src/components/navigation/PaginationItem/components/index.d.ts +1 -0
  109. package/dist/src/components/navigation/PaginationItem/components/index.js +2 -0
  110. package/dist/src/components/navigation/Tab/Tab.theme.d.ts +7 -1
  111. package/dist/src/components/navigation/Tab/Tab.theme.js +52 -13
  112. package/dist/src/components/navigation/Tabs/Tabs.d.ts +3 -0
  113. package/dist/src/components/navigation/Tabs/Tabs.js +4 -0
  114. package/dist/src/components/navigation/Tabs/Tabs.theme.d.ts +16 -0
  115. package/dist/src/components/navigation/Tabs/Tabs.theme.js +55 -0
  116. package/dist/src/components/navigation/Tabs/index.d.ts +1 -0
  117. package/dist/src/components/navigation/Tabs/index.js +2 -0
  118. package/dist/src/components/surfaces/Accordion/Accordion.theme.js +54 -22
  119. package/dist/src/components/surfaces/Accordion/AccordionDetails.theme.d.ts +10 -0
  120. package/dist/src/components/surfaces/Accordion/AccordionDetails.theme.js +19 -0
  121. package/dist/src/components/surfaces/Accordion/AccordionSummary.theme.d.ts +10 -0
  122. package/dist/src/components/surfaces/Accordion/AccordionSummary.theme.js +37 -0
  123. package/dist/src/components/surfaces/Accordion/index.d.ts +2 -0
  124. package/dist/src/components/surfaces/Accordion/index.js +2 -0
  125. package/dist/src/components/surfaces/Card/Card.theme.js +1 -1
  126. package/dist/src/components/surfaces/Paper/Paper.theme.d.ts +16 -1
  127. package/dist/src/components/surfaces/Paper/Paper.theme.js +21 -7
  128. package/dist/src/components/surfaces/Paper/Paper.tokens.d.ts +8 -0
  129. package/dist/src/components/surfaces/Paper/Paper.tokens.js +50 -0
  130. package/dist/src/components/surfaces/Paper/Paper.variants.d.ts +4 -0
  131. package/dist/src/components/surfaces/Paper/Paper.variants.js +3 -0
  132. package/dist/src/components/surfaces/Popover/Popover.d.ts +4 -0
  133. package/dist/src/components/surfaces/Popover/Popover.js +4 -0
  134. package/dist/src/components/surfaces/Popover/Popover.theme.d.ts +9 -0
  135. package/dist/src/components/surfaces/Popover/Popover.theme.js +14 -0
  136. package/dist/src/components/surfaces/Popover/index.d.ts +1 -0
  137. package/dist/src/components/surfaces/Popover/index.js +2 -0
  138. package/dist/src/components/utils/Backdrop/Backdrop.d.ts +3 -0
  139. package/dist/src/components/utils/Backdrop/Backdrop.js +4 -0
  140. package/dist/src/components/utils/Backdrop/Backdrop.theme.d.ts +11 -0
  141. package/dist/src/components/utils/Backdrop/Backdrop.theme.js +17 -0
  142. package/dist/src/components/utils/Backdrop/index.d.ts +1 -0
  143. package/dist/src/components/utils/Backdrop/index.js +2 -0
  144. package/dist/src/providers/WebProsTheme.d.ts +1 -0
  145. package/dist/src/providers/WebProsTheme.js +11 -5
  146. package/dist/src/shared/rippleEnterKeyframe.d.ts +6 -0
  147. package/dist/src/shared/rippleEnterKeyframe.js +12 -0
  148. package/dist/src/shared/viewContext/index.d.ts +1 -0
  149. package/dist/src/shared/viewContext/index.js +2 -0
  150. package/dist/src/shared/viewContext/viewContext.d.ts +4 -0
  151. package/dist/src/shared/viewContext/viewContext.js +2 -0
  152. package/dist/src/style/additional-color-palette.d.ts +1 -3
  153. package/dist/src/style/additional-color-palette.js +3 -6
  154. package/dist/src/style/custom-color-palette.js +50 -52
  155. package/dist/src/tokens/ThemeColorTokens.d.ts +11 -93
  156. package/dist/src/tokens/ThemeColorTokens.js +4 -168
  157. package/dist/src/tokens/ThemeScheme.d.ts +0 -3
  158. package/dist/src/tokens/ThemeScheme.js +0 -2
  159. package/dist/src/tokens/colors/Dark.d.ts +16 -0
  160. package/dist/src/tokens/colors/Dark.js +1398 -0
  161. package/dist/src/tokens/colors/Light.d.ts +16 -0
  162. package/dist/src/tokens/colors/Light.js +1398 -0
  163. package/dist/src/tokens/colors/index.d.ts +7 -0
  164. package/dist/src/tokens/colors/index.js +4 -0
  165. package/dist/src/tokens/colors/inverseSchemas.d.ts +40 -0
  166. package/dist/src/tokens/colors/inverseSchemas.js +3 -0
  167. package/dist/src/tokens/colors/inverseSchemes.d.ts +53 -0
  168. package/dist/src/tokens/colors/inverseSchemes.js +3 -0
  169. package/dist/src/tokens/colors/inverseStateLayers.d.ts +174 -0
  170. package/dist/src/tokens/colors/inverseStateLayers.js +3 -0
  171. package/dist/src/tokens/colors/schemas.d.ts +111 -0
  172. package/dist/src/tokens/colors/schemas.js +3 -0
  173. package/dist/src/tokens/colors/schemes.d.ts +111 -0
  174. package/dist/src/tokens/colors/schemes.js +3 -0
  175. package/dist/src/tokens/colors/stateLayers.d.ts +456 -0
  176. package/dist/src/tokens/colors/stateLayers.js +3 -0
  177. package/dist/src/tokens/colors/types.d.ts +9 -0
  178. package/dist/src/tokens/colors/types.js +2 -0
  179. package/dist/src/tokens/index.d.ts +6 -2
  180. package/dist/src/tokens/index.js +2 -1
  181. package/dist/src/tokens/legacyColors/LegacyDark.d.ts +2 -0
  182. package/dist/src/tokens/legacyColors/LegacyDark.js +88 -0
  183. package/dist/src/tokens/legacyColors/LegacyLight.d.ts +2 -0
  184. package/dist/src/tokens/legacyColors/LegacyLight.js +86 -0
  185. package/dist/src/tokens/legacyColors/ThemeColorTokensLegacy.d.ts +74 -0
  186. package/dist/src/tokens/legacyColors/ThemeColorTokensLegacy.js +2 -0
  187. package/dist/src/tokens/legacyColors/additionalColors/additionalColors.d.ts +21 -0
  188. package/dist/src/tokens/legacyColors/additionalColors/additionalColors.js +2 -0
  189. package/dist/src/tokens/{additionalColors → legacyColors/additionalColors}/index.d.ts +1 -0
  190. package/dist/src/tokens/{additionalColors → legacyColors/additionalColors}/index.js +1 -0
  191. package/dist/src/tokens/legacyColors/index.d.ts +2 -0
  192. package/dist/src/tokens/legacyColors/index.js +3 -0
  193. package/dist/src/tokens/shadows/index.d.ts +12 -0
  194. package/dist/src/tokens/shadows/index.js +112 -0
  195. package/dist/src/tokens/typography/index.d.ts +2 -0
  196. package/dist/src/tokens/typography/index.js +4 -0
  197. package/dist/src/tokens/typography/typescale.d.ts +28 -0
  198. package/dist/src/tokens/typography/typescale.js +26 -0
  199. package/dist/src/tokens/typography/typography.d.ts +2 -0
  200. package/dist/src/tokens/typography/typography.js +156 -0
  201. package/dist/src/utils/flatten.d.ts +1 -0
  202. package/dist/src/utils/flatten.js +12 -0
  203. package/dist/src/utils/getMUIComponents.js +2 -2
  204. package/dist/src/utils/getMUIPalette.d.ts +4 -9
  205. package/dist/src/utils/getMUIPalette.js +49 -25
  206. package/dist/src/utils/getMUIThemeCustoimzationType.d.ts +31 -0
  207. package/dist/src/utils/getMUIThemeCustoimzationType.js +2 -0
  208. package/dist/src/utils/getMUITypography.d.ts +2 -0
  209. package/dist/src/utils/getMUITypography.js +5 -0
  210. package/dist/src/utils/getStateLayerColor.d.ts +37 -0
  211. package/dist/src/utils/getStateLayerColor.js +43 -1
  212. package/dist/src/utils/index.d.ts +1 -1
  213. package/dist/src/utils/index.js +1 -1
  214. package/dist/src/utils/patchMUIShadows.js +4 -3
  215. package/package.json +6 -4
  216. package/dist/src/components/inputs/Autocomplete/components/AutocompletePopupIcon.d.ts +0 -1
  217. package/dist/src/components/navigation/PaginationItem/PaginationItem.d.ts +0 -3
  218. package/dist/src/components/navigation/PaginationItem/PaginationItem.js +0 -4
  219. package/dist/src/components/navigation/TabList/TabList.d.ts +0 -3
  220. package/dist/src/components/navigation/TabList/TabList.js +0 -4
  221. package/dist/src/components/navigation/TabList/TabList.theme.d.ts +0 -10
  222. package/dist/src/components/navigation/TabList/TabList.theme.js +0 -17
  223. package/dist/src/components/navigation/TabList/index.d.ts +0 -1
  224. package/dist/src/hooks/useTonalPalette.d.ts +0 -3
  225. package/dist/src/hooks/useTonalPalette.js +0 -32
  226. package/dist/src/providers/ThemeSchemeProvider.d.ts +0 -12
  227. package/dist/src/providers/ThemeSchemeProvider.js +0 -29
  228. package/dist/src/tokens/TonalPalette.d.ts +0 -10
  229. package/dist/src/tokens/TonalPalette.js +0 -10
  230. package/dist/src/utils/generateTokens.d.ts +0 -4
  231. package/dist/src/utils/generateTokens.js +0 -107
  232. /package/dist/src/tokens/{Tone.d.ts → legacyColors/Tone.d.ts} +0 -0
  233. /package/dist/src/tokens/{Tone.js → legacyColors/Tone.js} +0 -0
@@ -1,5 +1,6 @@
1
1
  // Copyright 2025 WebPros International GmbH. All rights reserved.
2
2
  export * from './utils/CssBaseline';
3
+ export * from './utils/Backdrop';
3
4
  export * from './feedback/Alert';
4
5
  export * from './feedback/Snackbar';
5
6
  export * from './feedback/CircularProgress';
@@ -21,6 +22,7 @@ export * from './navigation/Drawer';
21
22
  export * from './inputs/Fab';
22
23
  export * from './inputs/IconButton';
23
24
  export * from './data-display/Divider';
25
+ export * from './data-display/List';
24
26
  export * from './data-display/ListItem';
25
27
  export * from './data-display/ListItemButton';
26
28
  export * from './data-display/ListItemIcon';
@@ -31,14 +33,21 @@ export * from './data-display/Table';
31
33
  export * from './navigation/Menu';
32
34
  export * from './navigation/MenuItem';
33
35
  export * from './surfaces/Paper';
36
+ export * from './surfaces/Popover';
34
37
  export * from './inputs/Switch';
35
38
  export * from './navigation/Link';
39
+ export * from './navigation/Breadcrumbs';
36
40
  export * from './navigation/PaginationItem';
37
41
  export * from './navigation/Tab';
38
- export * from './navigation/TabList';
42
+ export * from './navigation/Tabs';
39
43
  export * from './inputs/TextField';
40
44
  export * from './inputs/ToggleButton';
41
45
  export * from './inputs/ToggleButtonGroup';
42
46
  export * from './data-display/Tooltip';
43
47
  export * from './data-display/Typography';
44
48
  export * from './inputs/InputBase';
49
+ export * from './data-display/Skeleton';
50
+ export * from './inputs/FormLabel';
51
+ export * from './inputs/OutlinedInput';
52
+ export * from './inputs/FormHelperText';
53
+ export * from './inputs/Radio';
@@ -6,5 +6,5 @@ interface M3Autocomplete {
6
6
  variants?: ComponentsVariants['MuiAutocomplete'];
7
7
  };
8
8
  }
9
- export declare const getAutocomplete: (theme: Theme) => M3Autocomplete;
9
+ export declare const getAutocomplete: () => M3Autocomplete;
10
10
  export {};
@@ -1,64 +1,36 @@
1
1
  // Copyright 2025 WebPros International GmbH. All rights reserved.
2
- import { alpha, } from '@mui/material';
3
- import { ChipDeleteIcon } from '../../../components/data-display/Chip/components/ChipDeleteIcon';
4
- import { AutocompletePopupIcon } from '../../../components/inputs/Autocomplete/components/AutocompletePopupIcon';
5
- export const getAutocomplete = (theme) => {
6
- const { palette } = theme;
2
+ import { outlinedInputClasses, inputBaseClasses, } from '@mui/material';
3
+ import { AutocompleteCaretDownIcon } from '../../../components/inputs/Autocomplete/components/AutocompleteCaretDownIcon';
4
+ import { AutocompleteXIcon } from '../../../components/inputs/Autocomplete/components/AutocompleteXIcon';
5
+ export const getAutocomplete = () => {
7
6
  return {
8
7
  MuiAutocomplete: {
9
8
  defaultProps: {
10
- clearIcon: ChipDeleteIcon,
11
- popupIcon: AutocompletePopupIcon,
9
+ clearIcon: AutocompleteXIcon,
10
+ popupIcon: AutocompleteCaretDownIcon,
11
+ slotProps: {
12
+ paper: {
13
+ elevation: 3,
14
+ },
15
+ },
12
16
  },
13
17
  styleOverrides: {
14
18
  root: {
15
- '.MuiOutlinedInput-root.MuiInputBase-sizeSmall': {
16
- padding: '4px 8px',
17
- '.MuiAutocomplete-input': {
18
- padding: '6px 8px',
19
- height: '21px',
20
- },
21
- '.MuiAutocomplete-popupIndicator': {
22
- width: '20px',
23
- marginRight: '-4px',
24
- },
25
- },
26
- svg: {
27
- width: '16px',
28
- height: '16px',
29
- fontSize: '16px',
30
- color: palette.supportive.main,
31
- },
32
- },
33
- paper: {
34
- borderRadius: 16,
35
- backgroundColor: palette.surfaceContainerHigh.light,
36
- boxShadow: theme.shadows[2],
37
- color: palette.onSurface.main,
38
- },
39
- popupIndicator: {
40
- fontSize: '16px',
41
- ':hover': {
42
- background: 'none',
19
+ [`& .${outlinedInputClasses.root}.${inputBaseClasses.sizeSmall}`]: {
20
+ // Don't specify paddingRight, as it overrides the default value set when there is only
21
+ // one of the popup or clear icon as the specificity is equal so the latter one wins
22
+ paddingTop: 4.5,
23
+ paddingBottom: 4.5,
24
+ paddingLeft: 6,
43
25
  },
44
- '> svg': {
45
- color: palette.supportive.main,
26
+ [`& .${outlinedInputClasses.root}`]: {
27
+ padding: '3.5px 9px 3.5px',
46
28
  },
47
29
  },
48
- listbox: {
49
- '& .MuiAutocomplete-option': {
50
- padding: '8px 12px',
51
- '&:hover': {
52
- backgroundColor: alpha(palette.onSurface.main, 0.04),
53
- },
54
- '&[aria-selected="true"]': {
55
- backgroundColor: palette.secondaryContainer.main,
56
- },
57
- },
58
- },
59
- clearIndicator: {
60
- ':hover': {
61
- background: 'none',
30
+ endAdornment: {
31
+ svg: {
32
+ width: 20,
33
+ height: 20,
62
34
  },
63
35
  },
64
36
  },
@@ -0,0 +1 @@
1
+ export declare const AutocompleteCaretDownIcon: import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // Copyright 2025 WebPros International GmbH. All rights reserved.
3
3
  import { CaretDownIcon } from '@phosphor-icons/react';
4
- export const AutocompletePopupIcon = _jsx(CaretDownIcon, { size: 18 });
4
+ export const AutocompleteCaretDownIcon = _jsx(CaretDownIcon, {});
@@ -0,0 +1 @@
1
+ export declare const AutocompleteXIcon: import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Copyright 2025 WebPros International GmbH. All rights reserved.
3
+ import { XIcon } from '@phosphor-icons/react';
4
+ export const AutocompleteXIcon = _jsx(XIcon, {});
@@ -1,4 +1,5 @@
1
1
  import { Theme, ComponentsProps, ComponentsOverrides, ComponentsVariants } from '@mui/material';
2
+ import { ComponentWithViewContextOwnProps } from '../../../shared/viewContext';
2
3
  declare module '@mui/material/Button' {
3
4
  interface ButtonPropsVariantOverrides {
4
5
  elevated: true;
@@ -12,6 +13,9 @@ declare module '@mui/material/Button' {
12
13
  interface ButtonPropsColorOverrides {
13
14
  tertiary: true;
14
15
  surface: true;
16
+ default: true;
17
+ }
18
+ interface ButtonOwnProps extends ComponentWithViewContextOwnProps {
15
19
  }
16
20
  }
17
21
  interface M3Button {
@@ -1,241 +1,108 @@
1
1
  // Copyright 2025 WebPros International GmbH. All rights reserved.
2
- import { alpha, } from '@mui/material';
3
- import { StateLayer, getStateLayerColor } from '../../../utils/getStateLayerColor';
2
+ import { flatten } from '../../../utils/flatten';
3
+ import { buttonClasses, circularProgressClasses, iconButtonClasses, touchRippleClasses, } from '@mui/material';
4
+ import { getButtonColorsMap } from './get-button-colors-map';
5
+ import { rippleEnterKeyframe } from '../../../shared/rippleEnterKeyframe';
4
6
  export const getButton = (theme) => {
5
- const { palette } = theme;
6
- return {
7
- MuiButton: {
8
- styleOverrides: {
9
- root: {
10
- height: 40,
11
- minWidth: 0,
12
- padding: '0 6px',
13
- borderRadius: 14,
14
- textTransform: 'none',
15
- fontWeight: 500,
16
- '&.Mui-disabled': {
17
- color: alpha(palette.onSurface.main, 0.38),
7
+ const { typography } = theme;
8
+ const sizes = [
9
+ {
10
+ props: { size: 'small' },
11
+ style: Object.assign(Object.assign({}, typography.LabelSmall), { padding: '2px 8px', height: 20, borderRadius: '17px',
12
+ // `!important` is the only way in this case to rewrite loader icon size
13
+ [`& .${circularProgressClasses.root}`]: {
14
+ width: '12px !important',
15
+ height: '12px !important',
16
+ } }),
17
+ },
18
+ {
19
+ props: { size: 'medium' },
20
+ style: Object.assign(Object.assign({}, typography.LabelMedium), { borderRadius: '17px', height: 34, padding: '7px 17px' }),
21
+ },
22
+ {
23
+ props: { size: 'large' },
24
+ style: Object.assign(Object.assign({}, typography.LabelLarge), { borderRadius: '24px', height: 42, padding: '9px 24px' }),
25
+ },
26
+ ];
27
+ const getStylesByColor = (color, viewContext) => {
28
+ const colorsMap = getButtonColorsMap(theme);
29
+ const inverseColorsMap = getButtonColorsMap(theme, 'inverse');
30
+ const colorsPalette = viewContext === 'inverse' ? inverseColorsMap[color] : colorsMap[color];
31
+ // variants = [filled?, tonal, ghost]
32
+ const variantsStyles = Object.entries(colorsPalette).map(([variant, variantColors]) => [
33
+ {
34
+ props: { variant: variant, color, viewContext },
35
+ style: {
36
+ background: variantColors.background,
37
+ color: variantColors.color,
38
+ '&:hover': {
39
+ background: variantColors.hover,
40
+ },
41
+ '&:active': {
42
+ background: variantColors.active,
43
+ },
44
+ '&:focus': {
45
+ background: variantColors.focus,
46
+ },
47
+ [`& .${touchRippleClasses.ripple}.${touchRippleClasses.rippleVisible}`]: {
48
+ color: variantColors.ripple,
18
49
  },
19
- '.MuiButton-startIcon': { marginRight: 4 },
20
- '.MuiButton-endIcon': { marginLeft: 4 },
21
50
  },
22
51
  },
23
- variants: [
24
- {
25
- props: { size: 'small' },
26
- style: {
27
- height: 32,
28
- borderRadius: 10,
29
- fontSize: '0.875rem',
30
- },
31
- },
32
- {
33
- props: { variant: 'filled' },
34
- style: {
35
- backgroundColor: palette.primary.main,
36
- color: palette.onPrimary.main,
37
- boxShadow: theme.shadows[0],
38
- padding: '0 24px',
39
- '&:hover': {
40
- backgroundColor: getStateLayerColor(StateLayer.Hover, palette.primary.main, palette.onPrimary.main),
41
- boxShadow: theme.shadows[1],
42
- },
43
- '&:focus': {
44
- backgroundColor: getStateLayerColor(StateLayer.Focus, palette.primary.main, palette.onPrimary.main),
45
- boxShadow: theme.shadows[0],
46
- },
47
- '&:active': {
48
- backgroundColor: getStateLayerColor(StateLayer.Press, palette.primary.main, palette.onPrimary.main),
49
- boxShadow: theme.shadows[0],
50
- outline: `2px solid ${getStateLayerColor(StateLayer.Press, palette.primary.main, palette.onPrimary.main)}`,
51
- outlineOffset: 2,
52
- },
53
- '&.Mui-disabled': {
54
- backgroundColor: alpha(palette.onSurface.main, 0.04),
55
- boxShadow: theme.shadows[0],
56
- },
57
- '.MuiButton-startIcon': { marginLeft: -8 },
58
- '.MuiButton-endIcon': { marginRight: -8 },
59
- },
60
- },
61
- {
62
- props: { variant: 'filled', size: 'small' },
63
- style: {
64
- padding: '0 12px',
65
- '.MuiButton-startIcon': { marginLeft: -4 },
66
- '.MuiButton-endIcon': { marginRight: -4 },
67
- },
68
- },
69
- {
70
- props: { variant: 'outlined' },
71
- style: {
72
- color: palette.primary.main,
73
- borderColor: palette.outline.main,
74
- borderWidth: 1,
75
- padding: '0 24px',
76
- '&:hover': {
77
- backgroundColor: alpha(palette.primary.main, 0.08),
78
- borderColor: palette.outline.main,
79
- },
80
- '&:focus': {
81
- backgroundColor: alpha(palette.primary.main, 0.12),
82
- borderColor: palette.primary.main,
83
- },
84
- '&:active': {
85
- backgroundColor: alpha(palette.primary.main, 0.12),
86
- borderColor: palette.outline.main,
87
- },
88
- '&.Mui-disabled': {
89
- borderColor: alpha(palette.onSurface.main, 0.12),
90
- },
91
- '.MuiButton-startIcon': { marginLeft: -8 },
92
- '.MuiButton-endIcon': { marginRight: -8 },
93
- },
94
- },
95
- {
96
- props: { variant: 'outlined', size: 'small' },
97
- style: {
98
- padding: '0 12px',
99
- '.MuiButton-startIcon': { marginLeft: 0 },
100
- '.MuiButton-endIcon': { marginRight: 0 },
101
- },
102
- },
103
- {
104
- props: { variant: 'text' },
105
- style: {
106
- backgroundColor: 'transparent',
107
- color: palette.primary.main,
108
- '&:hover': {
109
- backgroundColor: alpha(palette.primary.main, 0.08),
110
- },
111
- '&:focus': {
112
- backgroundColor: alpha(palette.primary.main, 0.12),
113
- },
114
- '&:active': {
115
- backgroundColor: alpha(palette.primary.main, 0.12),
116
- },
117
- '.MuiButton-startIcon': { marginLeft: -2 },
118
- '.MuiButton-endIcon': { marginRight: -2 },
119
- },
120
- },
121
- {
122
- props: { variant: 'text', size: 'small' },
123
- style: {
124
- padding: '0 6px',
52
+ {
53
+ props: { variant: variant, color, viewContext, disabled: true },
54
+ style: {
55
+ [`&.${buttonClasses.disabled}`]: {
56
+ color: variantColors.disabledColor,
57
+ background: variantColors.disabledBackground,
125
58
  },
126
59
  },
127
- {
128
- props: { variant: 'ghost' },
129
- style: {
130
- backgroundColor: 'transparent',
131
- color: palette.onSurfaceVariant.main,
132
- '&:hover': {
133
- backgroundColor: alpha(palette.primary.main, 0.08),
134
- },
135
- '&:focus': {
136
- backgroundColor: alpha(palette.primary.main, 0.12),
137
- },
138
- '&:active': {
139
- backgroundColor: alpha(palette.primary.main, 0.12),
140
- },
141
- '& .MuiButton-startIcon': {
142
- marginRight: 4,
143
- },
144
- '.MuiButton-startIcon': { marginLeft: -2 },
145
- '.MuiButton-endIcon': { marginRight: -2 },
146
- },
147
- },
148
- {
149
- props: { variant: 'ghost', size: 'small' },
150
- style: {
151
- padding: '0 6px',
152
- },
153
- },
154
- {
155
- props: { variant: 'elevated' },
156
- style: {
157
- boxShadow: theme.shadows[1],
158
- backgroundColor: palette.surfaceContainerLow.main,
159
- color: palette.primary.main,
160
- padding: '0 24px',
161
- '&:hover': {
162
- background: getStateLayerColor(StateLayer.Hover, palette.surfaceContainerLow.main, palette.primary.main),
163
- boxShadow: theme.shadows[2],
164
- },
165
- '&:focus': {
166
- background: getStateLayerColor(StateLayer.Focus, palette.surfaceContainerLow.main, palette.primary.main),
167
- },
168
- '&:active': {
169
- background: getStateLayerColor(StateLayer.Press, palette.surfaceContainerLow.main, palette.primary.main),
170
- },
171
- '&.Mui-disabled': {
172
- backgroundColor: alpha(palette.onSurface.main, 0.04),
173
- boxShadow: theme.shadows[0],
174
- },
175
- '.MuiButton-startIcon': { marginLeft: -8 },
176
- '.MuiButton-endIcon': { marginRight: -8 },
177
- },
178
- },
179
- {
180
- props: { variant: 'elevated', size: 'small' },
181
- style: {
182
- padding: '0 12px',
183
- '.MuiButton-startIcon': { marginLeft: -4 },
184
- '.MuiButton-endIcon': { marginRight: -4 },
185
- },
186
- },
187
- {
188
- props: { variant: 'tonal' },
189
- style: {
190
- backgroundColor: palette.secondaryContainer.main,
191
- color: palette.onSecondaryContainer.main,
192
- padding: '0 24px',
193
- '&:hover': {
194
- backgroundColor: palette.primary.main,
195
- color: palette.onPrimary.main,
196
- },
197
- '&:focus': {
198
- backgroundColor: getStateLayerColor(StateLayer.Focus, palette.primary.main, palette.onSecondaryContainer.main),
199
- color: palette.onPrimary.main,
200
- },
201
- '&:active': {
202
- backgroundColor: getStateLayerColor(StateLayer.Press, palette.primary.main, palette.onSecondaryContainer.main),
203
- color: palette.onPrimary.main,
204
- outline: `2px solid ${getStateLayerColor(StateLayer.Press, palette.primary.main, palette.onSecondaryContainer.main)}`,
205
- outlineOffset: 2,
206
- },
207
- '&.Mui-disabled': {
208
- backgroundColor: alpha(palette.onSurface.main, 0.04),
209
- },
210
- '.MuiButton-startIcon': { marginLeft: -8 },
211
- '.MuiButton-endIcon': { marginRight: -8 },
212
- },
213
- },
214
- {
215
- props: { variant: 'tonal', size: 'small' },
216
- style: {
217
- padding: '0 12px',
218
- '.MuiButton-startIcon': { marginLeft: -4 },
219
- '.MuiButton-endIcon': { marginRight: -4 },
60
+ },
61
+ {
62
+ props: { variant: variant, color, viewContext, loading: true },
63
+ style: {
64
+ [`&.${iconButtonClasses.disabled}`]: {
65
+ color: variantColors.loadingColor,
66
+ background: variantColors.loadingBackground,
220
67
  },
221
- },
222
- {
223
- props: { variant: 'filled', color: 'error' },
224
- style: {
225
- backgroundColor: palette.error.main,
226
- color: palette.background.default,
227
- '&:hover': {
228
- backgroundColor: palette.error.main,
229
- },
68
+ [`.${buttonClasses.loadingIndicator}`]: {
69
+ color: variantColors.loadingIndicator,
230
70
  },
231
71
  },
232
- {
233
- props: { variant: 'ghost', color: 'error' },
234
- style: {
235
- backgroundColor: 'transparent',
236
- color: palette.onSurface.main,
72
+ },
73
+ ]);
74
+ return flatten(variantsStyles);
75
+ };
76
+ return {
77
+ MuiButton: {
78
+ styleOverrides: {
79
+ root: {
80
+ textTransform: 'none',
81
+ boxShadow: 'none',
82
+ '.MuiButton-startIcon': { marginRight: 4 },
83
+ '.MuiButton-endIcon': { marginLeft: 4 },
84
+ minWidth: 'auto', // Overriding for small buttons
85
+ [`& .${touchRippleClasses.ripple}.${touchRippleClasses.rippleVisible}`]: {
86
+ opacity: 1,
87
+ animationName: rippleEnterKeyframe,
237
88
  },
238
89
  },
90
+ },
91
+ variants: [
92
+ // First we define size variants to ensure proper sizing. Do not couple size with variant and colors.
93
+ ...sizes,
94
+ // Now we define variants and colors. Name the variants and states according to the Figma file.
95
+ // Is there is required difference in namings - you should contract design team to clarify it and fix it.
96
+ ...getStylesByColor('primary'),
97
+ ...getStylesByColor('default'),
98
+ ...getStylesByColor('secondary'),
99
+ ...getStylesByColor('error'),
100
+ ...getStylesByColor('success'),
101
+ ...getStylesByColor('primary', 'inverse'),
102
+ ...getStylesByColor('default', 'inverse'),
103
+ ...getStylesByColor('secondary', 'inverse'),
104
+ ...getStylesByColor('error', 'inverse'),
105
+ ...getStylesByColor('success', 'inverse'),
239
106
  ],
240
107
  },
241
108
  };
@@ -0,0 +1,24 @@
1
+ import { Theme } from '@mui/material';
2
+ import { ViewContext } from '../../../shared/viewContext';
3
+ type IconButtonColors = {
4
+ background: string;
5
+ color: string;
6
+ disabledBackground: string;
7
+ disabledColor: string;
8
+ loadingBackground: string;
9
+ loadingColor: string;
10
+ loadingIndicator: string;
11
+ hover: string;
12
+ active: string;
13
+ focus: string;
14
+ ripple?: string;
15
+ };
16
+ export type Variant = 'filled' | 'tonal' | 'ghost';
17
+ export declare const getButtonColorsMap: (theme: Theme, viewContext?: ViewContext) => {
18
+ primary: Partial<Record<Variant, IconButtonColors>>;
19
+ default: Partial<Record<Variant, IconButtonColors>>;
20
+ secondary: Partial<Record<Variant, IconButtonColors>>;
21
+ error: Partial<Record<Variant, IconButtonColors>>;
22
+ success: Partial<Record<Variant, IconButtonColors>>;
23
+ };
24
+ export {};