@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.
- package/dist/package.json +6 -4
- package/dist/src/components/data-display/Avatar/Avatar.theme.js +11 -8
- package/dist/src/components/data-display/Badge/Badge.theme.d.ts +4 -1
- package/dist/src/components/data-display/Badge/Badge.theme.js +216 -55
- package/dist/src/components/data-display/Chip/Chip.theme.d.ts +17 -3
- package/dist/src/components/data-display/Chip/Chip.theme.js +133 -477
- package/dist/src/components/data-display/Chip/get-chip-colors-map.d.ts +42 -0
- package/dist/src/components/data-display/Chip/get-chip-colors-map.js +253 -0
- package/dist/src/components/data-display/Divider/Divider.theme.d.ts +6 -1
- package/dist/src/components/data-display/Divider/Divider.theme.js +60 -3
- package/dist/src/components/data-display/List/List.theme.d.ts +1 -1
- package/dist/src/components/data-display/List/List.theme.js +1 -1
- package/dist/src/components/data-display/ListItem/ListItem.theme.d.ts +1 -1
- package/dist/src/components/data-display/ListItem/ListItem.theme.js +16 -8
- package/dist/src/components/data-display/ListItemAvatar/ListItemAvatar.theme.js +1 -2
- package/dist/src/components/data-display/ListItemButton/ListItemButton.theme.d.ts +0 -5
- package/dist/src/components/data-display/ListItemButton/ListItemButton.theme.js +14 -48
- package/dist/src/components/data-display/ListItemIcon/ListItemIcon.theme.js +4 -4
- package/dist/src/components/data-display/ListSubheader/ListSubheader.theme.d.ts +1 -1
- package/dist/src/components/data-display/ListSubheader/ListSubheader.theme.js +2 -5
- package/dist/src/components/data-display/Skeleton/Skeleton.d.ts +3 -0
- package/dist/src/components/data-display/Skeleton/Skeleton.js +4 -0
- package/dist/src/components/data-display/Skeleton/Skeleton.theme.d.ts +15 -0
- package/dist/src/components/data-display/Skeleton/Skeleton.theme.js +31 -0
- package/dist/src/components/data-display/Skeleton/index.d.ts +1 -0
- package/dist/src/components/data-display/Skeleton/index.js +2 -0
- package/dist/src/components/data-display/Tooltip/Tooltip.theme.js +7 -9
- package/dist/src/components/data-display/Typography/Typography.theme.d.ts +19 -26
- package/dist/src/components/data-display/Typography/Typography.theme.js +7 -163
- package/dist/src/components/feedback/Alert/Alert.theme.d.ts +12 -0
- package/dist/src/components/feedback/Alert/Alert.theme.js +60 -45
- package/dist/src/components/feedback/CircularProgress/CircularProgress.theme.d.ts +6 -1
- package/dist/src/components/feedback/CircularProgress/CircularProgress.theme.js +49 -8
- package/dist/src/components/feedback/LinearProgress/LinearProgress.theme.d.ts +6 -1
- package/dist/src/components/feedback/LinearProgress/LinearProgress.theme.js +83 -9
- package/dist/src/components/feedback/Snackbar/Snackbar.theme.d.ts +4 -4
- package/dist/src/components/feedback/Snackbar/Snackbar.theme.js +7 -3
- package/dist/src/components/index.d.ts +10 -1
- package/dist/src/components/index.js +10 -1
- package/dist/src/components/inputs/Autocomplete/Autocomplete.theme.d.ts +1 -1
- package/dist/src/components/inputs/Autocomplete/Autocomplete.theme.js +23 -51
- package/dist/src/components/inputs/Autocomplete/components/AutocompleteCaretDownIcon.d.ts +1 -0
- package/dist/src/components/inputs/Autocomplete/components/{AutocompletePopupIcon.js → AutocompleteCaretDownIcon.js} +1 -1
- package/dist/src/components/inputs/Autocomplete/components/AutocompleteXIcon.d.ts +1 -0
- package/dist/src/components/inputs/Autocomplete/components/AutocompleteXIcon.js +4 -0
- package/dist/src/components/inputs/Button/Button.theme.d.ts +4 -0
- package/dist/src/components/inputs/Button/Button.theme.js +93 -226
- package/dist/src/components/inputs/Button/get-button-colors-map.d.ts +24 -0
- package/dist/src/components/inputs/Button/get-button-colors-map.js +211 -0
- package/dist/src/components/inputs/Checkbox/Checkbox.theme.d.ts +7 -2
- package/dist/src/components/inputs/Checkbox/Checkbox.theme.js +57 -7
- package/dist/src/components/inputs/Fab/Fab.theme.d.ts +5 -9
- package/dist/src/components/inputs/Fab/Fab.theme.js +27 -98
- package/dist/src/components/inputs/FormHelperText/FormHelperText.d.ts +2 -0
- package/dist/src/components/inputs/FormHelperText/FormHelperText.js +3 -0
- package/dist/src/components/inputs/FormHelperText/FormHelperText.theme.d.ts +7 -0
- package/dist/src/components/inputs/FormHelperText/FormHelperText.theme.js +8 -0
- package/dist/src/components/inputs/FormHelperText/index.d.ts +1 -0
- package/dist/src/components/inputs/FormHelperText/index.js +2 -0
- package/dist/src/components/inputs/FormLabel/FormLabel.d.ts +2 -0
- package/dist/src/components/inputs/FormLabel/FormLabel.js +3 -0
- package/dist/src/components/inputs/FormLabel/FormLabel.theme.d.ts +7 -0
- package/dist/src/components/inputs/FormLabel/FormLabel.theme.js +8 -0
- package/dist/src/components/inputs/FormLabel/index.d.ts +1 -0
- package/dist/src/components/inputs/FormLabel/index.js +2 -0
- package/dist/src/components/inputs/IconButton/IconButton.theme.d.ts +3 -2
- package/dist/src/components/inputs/IconButton/IconButton.theme.js +90 -95
- package/dist/src/components/inputs/InputBase/InputBase.theme.d.ts +9 -26
- package/dist/src/components/inputs/InputBase/InputBase.theme.js +2 -64
- package/dist/src/components/inputs/InputLabel/InputLabel.theme.d.ts +7 -4
- package/dist/src/components/inputs/InputLabel/InputLabel.theme.js +26 -12
- package/dist/src/components/inputs/OutlinedInput/OutlinedInput.theme.d.ts +8 -0
- package/dist/src/components/inputs/OutlinedInput/OutlinedInput.theme.js +67 -0
- package/dist/src/components/inputs/OutlinedInput/index.d.ts +1 -0
- package/dist/src/components/inputs/OutlinedInput/index.js +2 -0
- package/dist/src/components/inputs/Radio/Radio.d.ts +4 -0
- package/dist/src/components/inputs/Radio/Radio.js +4 -0
- package/dist/src/components/inputs/Radio/Radio.theme.d.ts +11 -0
- package/dist/src/components/inputs/Radio/Radio.theme.js +35 -0
- package/dist/src/components/inputs/Radio/index.d.ts +1 -0
- package/dist/src/components/{navigation/TabList → inputs/Radio}/index.js +1 -1
- package/dist/src/components/inputs/Select/Select.theme.d.ts +2 -3
- package/dist/src/components/inputs/Select/Select.theme.js +6 -33
- package/dist/src/components/inputs/Switch/Switch.theme.js +125 -49
- package/dist/src/components/inputs/TextField/TextField.theme.d.ts +2 -3
- package/dist/src/components/inputs/TextField/TextField.theme.js +2 -26
- package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.js +5 -0
- package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.theme.d.ts +11 -0
- package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.theme.js +23 -0
- package/dist/src/components/navigation/Breadcrumbs/Crumb.d.ts +10 -0
- package/dist/src/components/navigation/Breadcrumbs/Crumb.js +10 -0
- package/dist/src/components/navigation/Breadcrumbs/index.d.ts +1 -0
- package/dist/src/components/navigation/Breadcrumbs/index.js +2 -0
- package/dist/src/components/navigation/Drawer/Drawer.theme.d.ts +1 -1
- package/dist/src/components/navigation/Drawer/Drawer.theme.js +50 -6
- package/dist/src/components/navigation/Link/Link.theme.d.ts +11 -2
- package/dist/src/components/navigation/Link/Link.theme.js +66 -9
- package/dist/src/components/navigation/Menu/Menu.theme.d.ts +2 -3
- package/dist/src/components/navigation/Menu/Menu.theme.js +6 -11
- package/dist/src/components/navigation/MenuItem/MenuItem.theme.d.ts +2 -4
- package/dist/src/components/navigation/MenuItem/MenuItem.theme.js +8 -8
- package/dist/src/components/navigation/Pagination/Pagination.theme.d.ts +1 -1
- package/dist/src/components/navigation/Pagination/Pagination.theme.js +11 -3
- package/dist/src/components/navigation/PaginationItem/PaginationItem.theme.js +65 -10
- package/dist/src/components/navigation/PaginationItem/components/PaginationIcons.d.ts +4 -0
- package/dist/src/components/navigation/PaginationItem/components/PaginationIcons.js +8 -0
- package/dist/src/components/navigation/PaginationItem/components/index.d.ts +1 -0
- package/dist/src/components/navigation/PaginationItem/components/index.js +2 -0
- package/dist/src/components/navigation/Tab/Tab.theme.d.ts +7 -1
- package/dist/src/components/navigation/Tab/Tab.theme.js +52 -13
- package/dist/src/components/navigation/Tabs/Tabs.d.ts +3 -0
- package/dist/src/components/navigation/Tabs/Tabs.js +4 -0
- package/dist/src/components/navigation/Tabs/Tabs.theme.d.ts +16 -0
- package/dist/src/components/navigation/Tabs/Tabs.theme.js +55 -0
- package/dist/src/components/navigation/Tabs/index.d.ts +1 -0
- package/dist/src/components/navigation/Tabs/index.js +2 -0
- package/dist/src/components/surfaces/Accordion/Accordion.theme.js +54 -22
- package/dist/src/components/surfaces/Accordion/AccordionDetails.theme.d.ts +10 -0
- package/dist/src/components/surfaces/Accordion/AccordionDetails.theme.js +19 -0
- package/dist/src/components/surfaces/Accordion/AccordionSummary.theme.d.ts +10 -0
- package/dist/src/components/surfaces/Accordion/AccordionSummary.theme.js +37 -0
- package/dist/src/components/surfaces/Accordion/index.d.ts +2 -0
- package/dist/src/components/surfaces/Accordion/index.js +2 -0
- package/dist/src/components/surfaces/Card/Card.theme.js +1 -1
- package/dist/src/components/surfaces/Paper/Paper.theme.d.ts +16 -1
- package/dist/src/components/surfaces/Paper/Paper.theme.js +21 -7
- package/dist/src/components/surfaces/Paper/Paper.tokens.d.ts +8 -0
- package/dist/src/components/surfaces/Paper/Paper.tokens.js +50 -0
- package/dist/src/components/surfaces/Paper/Paper.variants.d.ts +4 -0
- package/dist/src/components/surfaces/Paper/Paper.variants.js +3 -0
- package/dist/src/components/surfaces/Popover/Popover.d.ts +4 -0
- package/dist/src/components/surfaces/Popover/Popover.js +4 -0
- package/dist/src/components/surfaces/Popover/Popover.theme.d.ts +9 -0
- package/dist/src/components/surfaces/Popover/Popover.theme.js +14 -0
- package/dist/src/components/surfaces/Popover/index.d.ts +1 -0
- package/dist/src/components/surfaces/Popover/index.js +2 -0
- package/dist/src/components/utils/Backdrop/Backdrop.d.ts +3 -0
- package/dist/src/components/utils/Backdrop/Backdrop.js +4 -0
- package/dist/src/components/utils/Backdrop/Backdrop.theme.d.ts +11 -0
- package/dist/src/components/utils/Backdrop/Backdrop.theme.js +17 -0
- package/dist/src/components/utils/Backdrop/index.d.ts +1 -0
- package/dist/src/components/utils/Backdrop/index.js +2 -0
- package/dist/src/providers/WebProsTheme.d.ts +1 -0
- package/dist/src/providers/WebProsTheme.js +11 -5
- package/dist/src/shared/rippleEnterKeyframe.d.ts +6 -0
- package/dist/src/shared/rippleEnterKeyframe.js +12 -0
- package/dist/src/shared/viewContext/index.d.ts +1 -0
- package/dist/src/shared/viewContext/index.js +2 -0
- package/dist/src/shared/viewContext/viewContext.d.ts +4 -0
- package/dist/src/shared/viewContext/viewContext.js +2 -0
- package/dist/src/style/additional-color-palette.d.ts +1 -3
- package/dist/src/style/additional-color-palette.js +3 -6
- package/dist/src/style/custom-color-palette.js +50 -52
- package/dist/src/tokens/ThemeColorTokens.d.ts +11 -93
- package/dist/src/tokens/ThemeColorTokens.js +4 -168
- package/dist/src/tokens/ThemeScheme.d.ts +0 -3
- package/dist/src/tokens/ThemeScheme.js +0 -2
- package/dist/src/tokens/colors/Dark.d.ts +16 -0
- package/dist/src/tokens/colors/Dark.js +1398 -0
- package/dist/src/tokens/colors/Light.d.ts +16 -0
- package/dist/src/tokens/colors/Light.js +1398 -0
- package/dist/src/tokens/colors/index.d.ts +7 -0
- package/dist/src/tokens/colors/index.js +4 -0
- package/dist/src/tokens/colors/inverseSchemas.d.ts +40 -0
- package/dist/src/tokens/colors/inverseSchemas.js +3 -0
- package/dist/src/tokens/colors/inverseSchemes.d.ts +53 -0
- package/dist/src/tokens/colors/inverseSchemes.js +3 -0
- package/dist/src/tokens/colors/inverseStateLayers.d.ts +174 -0
- package/dist/src/tokens/colors/inverseStateLayers.js +3 -0
- package/dist/src/tokens/colors/schemas.d.ts +111 -0
- package/dist/src/tokens/colors/schemas.js +3 -0
- package/dist/src/tokens/colors/schemes.d.ts +111 -0
- package/dist/src/tokens/colors/schemes.js +3 -0
- package/dist/src/tokens/colors/stateLayers.d.ts +456 -0
- package/dist/src/tokens/colors/stateLayers.js +3 -0
- package/dist/src/tokens/colors/types.d.ts +9 -0
- package/dist/src/tokens/colors/types.js +2 -0
- package/dist/src/tokens/index.d.ts +6 -2
- package/dist/src/tokens/index.js +2 -1
- package/dist/src/tokens/legacyColors/LegacyDark.d.ts +2 -0
- package/dist/src/tokens/legacyColors/LegacyDark.js +88 -0
- package/dist/src/tokens/legacyColors/LegacyLight.d.ts +2 -0
- package/dist/src/tokens/legacyColors/LegacyLight.js +86 -0
- package/dist/src/tokens/legacyColors/ThemeColorTokensLegacy.d.ts +74 -0
- package/dist/src/tokens/legacyColors/ThemeColorTokensLegacy.js +2 -0
- package/dist/src/tokens/legacyColors/additionalColors/additionalColors.d.ts +21 -0
- package/dist/src/tokens/legacyColors/additionalColors/additionalColors.js +2 -0
- package/dist/src/tokens/{additionalColors → legacyColors/additionalColors}/index.d.ts +1 -0
- package/dist/src/tokens/{additionalColors → legacyColors/additionalColors}/index.js +1 -0
- package/dist/src/tokens/legacyColors/index.d.ts +2 -0
- package/dist/src/tokens/legacyColors/index.js +3 -0
- package/dist/src/tokens/shadows/index.d.ts +12 -0
- package/dist/src/tokens/shadows/index.js +112 -0
- package/dist/src/tokens/typography/index.d.ts +2 -0
- package/dist/src/tokens/typography/index.js +4 -0
- package/dist/src/tokens/typography/typescale.d.ts +28 -0
- package/dist/src/tokens/typography/typescale.js +26 -0
- package/dist/src/tokens/typography/typography.d.ts +2 -0
- package/dist/src/tokens/typography/typography.js +156 -0
- package/dist/src/utils/flatten.d.ts +1 -0
- package/dist/src/utils/flatten.js +12 -0
- package/dist/src/utils/getMUIComponents.js +2 -2
- package/dist/src/utils/getMUIPalette.d.ts +4 -9
- package/dist/src/utils/getMUIPalette.js +49 -25
- package/dist/src/utils/getMUIThemeCustoimzationType.d.ts +31 -0
- package/dist/src/utils/getMUIThemeCustoimzationType.js +2 -0
- package/dist/src/utils/getMUITypography.d.ts +2 -0
- package/dist/src/utils/getMUITypography.js +5 -0
- package/dist/src/utils/getStateLayerColor.d.ts +37 -0
- package/dist/src/utils/getStateLayerColor.js +43 -1
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/patchMUIShadows.js +4 -3
- package/package.json +6 -4
- package/dist/src/components/inputs/Autocomplete/components/AutocompletePopupIcon.d.ts +0 -1
- package/dist/src/components/navigation/PaginationItem/PaginationItem.d.ts +0 -3
- package/dist/src/components/navigation/PaginationItem/PaginationItem.js +0 -4
- package/dist/src/components/navigation/TabList/TabList.d.ts +0 -3
- package/dist/src/components/navigation/TabList/TabList.js +0 -4
- package/dist/src/components/navigation/TabList/TabList.theme.d.ts +0 -10
- package/dist/src/components/navigation/TabList/TabList.theme.js +0 -17
- package/dist/src/components/navigation/TabList/index.d.ts +0 -1
- package/dist/src/hooks/useTonalPalette.d.ts +0 -3
- package/dist/src/hooks/useTonalPalette.js +0 -32
- package/dist/src/providers/ThemeSchemeProvider.d.ts +0 -12
- package/dist/src/providers/ThemeSchemeProvider.js +0 -29
- package/dist/src/tokens/TonalPalette.d.ts +0 -10
- package/dist/src/tokens/TonalPalette.js +0 -10
- package/dist/src/utils/generateTokens.d.ts +0 -4
- package/dist/src/utils/generateTokens.js +0 -107
- /package/dist/src/tokens/{Tone.d.ts → legacyColors/Tone.d.ts} +0 -0
- /package/dist/src/tokens/{Tone.js → legacyColors/Tone.js} +0 -0
|
@@ -1,114 +1,109 @@
|
|
|
1
1
|
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { flatten } from '../../../utils/flatten';
|
|
3
|
+
import { circularProgressClasses, iconButtonClasses, touchRippleClasses, } from '@mui/material';
|
|
4
|
+
import { getButtonColorsMap, } from '../../../components/inputs/Button/get-button-colors-map';
|
|
5
|
+
import { rippleEnterKeyframe } from '../../../shared/rippleEnterKeyframe';
|
|
4
6
|
export const getIconButton = (theme) => {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
const sizes = [
|
|
8
|
+
{
|
|
9
|
+
props: { size: 'small' },
|
|
10
|
+
style: {
|
|
11
|
+
height: 20,
|
|
12
|
+
width: 20,
|
|
13
|
+
// `!important` is the only way in this case to rewrite loader icon size
|
|
14
|
+
[`& .${circularProgressClasses.root}`]: {
|
|
15
|
+
width: '12px !important',
|
|
16
|
+
height: '12px !important',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
props: { size: 'medium' },
|
|
22
|
+
style: {
|
|
23
|
+
height: 34,
|
|
24
|
+
width: 34,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
props: { size: 'large' },
|
|
29
|
+
style: {
|
|
30
|
+
height: 42,
|
|
31
|
+
width: 42,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
const getStylesByColor = (color, viewContext) => {
|
|
36
|
+
const colorsMap = getButtonColorsMap(theme);
|
|
37
|
+
const inverseColorsMap = getButtonColorsMap(theme, 'inverse');
|
|
38
|
+
const colorsPalette = viewContext === 'inverse' ? inverseColorsMap[color] : colorsMap[color];
|
|
39
|
+
// variants = [filled?, tonal, ghost]
|
|
40
|
+
const variantsStyles = Object.entries(colorsPalette).map(([variant, variantColors]) => [
|
|
41
|
+
{
|
|
42
|
+
props: { variant: variant, color, viewContext },
|
|
43
|
+
style: {
|
|
44
|
+
background: variantColors.background,
|
|
45
|
+
color: variantColors.color,
|
|
15
46
|
'&:hover': {
|
|
16
|
-
background:
|
|
17
|
-
},
|
|
18
|
-
'&:focus': {
|
|
19
|
-
background: getStateLayerColor(StateLayer.Focus, palette.onSurfaceVariant.main),
|
|
47
|
+
background: variantColors.hover,
|
|
20
48
|
},
|
|
21
49
|
'&:active': {
|
|
22
|
-
background:
|
|
50
|
+
background: variantColors.active,
|
|
23
51
|
},
|
|
24
|
-
'
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
variants: [
|
|
30
|
-
{
|
|
31
|
-
props: { size: 'small' },
|
|
32
|
-
style: {
|
|
33
|
-
height: 32,
|
|
34
|
-
width: 32,
|
|
35
|
-
borderRadius: 10,
|
|
52
|
+
'&:focus': {
|
|
53
|
+
background: variantColors.focus,
|
|
36
54
|
},
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
props: { variant: 'filled' },
|
|
40
|
-
style: {
|
|
41
|
-
backgroundColor: palette.primary.main,
|
|
42
|
-
color: palette.onPrimary.main,
|
|
43
|
-
'&:hover': {
|
|
44
|
-
backgroundColor: getStateLayerColor(StateLayer.Hover, palette.primary.main, palette.onPrimary.main),
|
|
45
|
-
},
|
|
46
|
-
'&:focus': {
|
|
47
|
-
backgroundColor: getStateLayerColor(StateLayer.Focus, palette.primary.main, palette.onPrimary.main),
|
|
48
|
-
},
|
|
49
|
-
'&:active': {
|
|
50
|
-
backgroundColor: getStateLayerColor(StateLayer.Press, palette.primary.main, palette.onPrimary.main),
|
|
51
|
-
},
|
|
52
|
-
'&.Mui-disabled': {
|
|
53
|
-
backgroundColor: alpha(palette.onSurface.main, 0.04),
|
|
54
|
-
},
|
|
55
|
+
[`& .${touchRippleClasses.ripple}.${touchRippleClasses.rippleVisible}`]: {
|
|
56
|
+
color: variantColors.ripple,
|
|
55
57
|
},
|
|
56
58
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
'&.Mui-disabled': {
|
|
65
|
-
backgroundColor: alpha(palette.onSurface.main, 0.04),
|
|
66
|
-
boxShadow: theme.shadows[0],
|
|
67
|
-
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
props: { variant: variant, color, viewContext, disabled: true },
|
|
62
|
+
style: {
|
|
63
|
+
[`&.${iconButtonClasses.disabled}`]: {
|
|
64
|
+
color: variantColors.disabledColor,
|
|
65
|
+
background: variantColors.disabledBackground,
|
|
68
66
|
},
|
|
69
67
|
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
'&:focus': {
|
|
79
|
-
backgroundColor: getStateLayerColor(StateLayer.Focus, palette.secondaryContainer.main, palette.onSecondaryContainer.main),
|
|
80
|
-
},
|
|
81
|
-
'&:active': {
|
|
82
|
-
backgroundColor: getStateLayerColor(StateLayer.Active, palette.secondaryContainer.main, palette.onSecondaryContainer.main),
|
|
83
|
-
},
|
|
84
|
-
'&.Mui-disabled': {
|
|
85
|
-
backgroundColor: alpha(palette.onSurface.main, 0.04),
|
|
86
|
-
},
|
|
87
|
-
'& > svg': {
|
|
88
|
-
color: palette.primary.main,
|
|
89
|
-
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
props: { variant: variant, color, viewContext, loading: true },
|
|
71
|
+
style: {
|
|
72
|
+
[`&.${iconButtonClasses.disabled}`]: {
|
|
73
|
+
color: variantColors.loadingColor,
|
|
74
|
+
background: variantColors.loadingBackground,
|
|
90
75
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
props: { variant: 'outlined' },
|
|
94
|
-
style: {
|
|
95
|
-
borderColor: palette.outline.main,
|
|
96
|
-
borderWidth: 1,
|
|
97
|
-
borderStyle: 'solid',
|
|
98
|
-
'&.Mui-disabled': {
|
|
99
|
-
borderColor: getStateLayerColor(StateLayer.Disabled, palette.outline.main, palette.onSurface.main),
|
|
100
|
-
},
|
|
76
|
+
[`.${iconButtonClasses.loadingIndicator}`]: {
|
|
77
|
+
color: variantColors.loadingIndicator,
|
|
101
78
|
},
|
|
102
79
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
80
|
+
},
|
|
81
|
+
]);
|
|
82
|
+
return flatten(variantsStyles);
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
MuiIconButton: {
|
|
86
|
+
styleOverrides: {
|
|
87
|
+
root: {
|
|
88
|
+
padding: 0,
|
|
89
|
+
[`& .${touchRippleClasses.ripple}.${touchRippleClasses.rippleVisible}`]: {
|
|
90
|
+
opacity: 1,
|
|
91
|
+
animationName: rippleEnterKeyframe,
|
|
110
92
|
},
|
|
111
93
|
},
|
|
94
|
+
},
|
|
95
|
+
variants: [
|
|
96
|
+
...sizes,
|
|
97
|
+
...getStylesByColor('primary'),
|
|
98
|
+
...getStylesByColor('default'),
|
|
99
|
+
...getStylesByColor('secondary'),
|
|
100
|
+
...getStylesByColor('error'),
|
|
101
|
+
...getStylesByColor('success'),
|
|
102
|
+
...getStylesByColor('primary', 'inverse'),
|
|
103
|
+
...getStylesByColor('default', 'inverse'),
|
|
104
|
+
...getStylesByColor('secondary', 'inverse'),
|
|
105
|
+
...getStylesByColor('error', 'inverse'),
|
|
106
|
+
...getStylesByColor('success', 'inverse'),
|
|
112
107
|
],
|
|
113
108
|
},
|
|
114
109
|
};
|
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ComponentsOverrides, Theme } from '@mui/material';
|
|
2
|
+
declare module '@mui/material/InputBase' {
|
|
3
|
+
interface InputBasePropsSizeOverrides {
|
|
4
|
+
large: true;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
interface M3InputBase {
|
|
3
8
|
MuiInputBase: {
|
|
4
|
-
defaultProps?: ComponentsProps['MuiInputBase'];
|
|
5
9
|
styleOverrides?: ComponentsOverrides<Theme>['MuiInputBase'];
|
|
6
|
-
variants?: ComponentsVariants['MuiInputBase'];
|
|
7
|
-
};
|
|
8
|
-
MuiFormLabel: {
|
|
9
|
-
defaultProps?: ComponentsProps['MuiFormLabel'];
|
|
10
|
-
styleOverrides?: ComponentsOverrides<Theme>['MuiFormLabel'];
|
|
11
|
-
variants?: ComponentsVariants['MuiFormLabel'];
|
|
12
|
-
};
|
|
13
|
-
MuiOutlinedInput: {
|
|
14
|
-
defaultProps?: ComponentsProps['MuiOutlinedInput'];
|
|
15
|
-
styleOverrides?: ComponentsOverrides<Theme>['MuiOutlinedInput'];
|
|
16
|
-
variants?: ComponentsVariants['MuiOutlinedInput'];
|
|
17
|
-
};
|
|
18
|
-
MuiFormHelperText: {
|
|
19
|
-
defaultProps?: ComponentsProps['MuiFormHelperText'];
|
|
20
|
-
styleOverrides?: ComponentsOverrides<Theme>['MuiFormHelperText'];
|
|
21
|
-
variants?: ComponentsVariants['MuiFormHelperText'];
|
|
22
10
|
};
|
|
23
11
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* better to customized common things here, than in each component
|
|
27
|
-
*/
|
|
28
|
-
export declare const getInputBase: (theme: Theme) => M3Autocomplete;
|
|
29
|
-
declare const _default: {};
|
|
30
|
-
export default _default;
|
|
12
|
+
export declare const getInputBase: () => M3InputBase;
|
|
13
|
+
export {};
|
|
@@ -1,70 +1,8 @@
|
|
|
1
1
|
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* There is no separate component for usage outside of MUI, but it is used as base for several inputs
|
|
5
|
-
* better to customized common things here, than in each component
|
|
6
|
-
*/
|
|
7
|
-
export const getInputBase = (theme) => {
|
|
8
|
-
const { palette } = theme;
|
|
2
|
+
export const getInputBase = () => {
|
|
9
3
|
return {
|
|
10
4
|
MuiInputBase: {
|
|
11
|
-
styleOverrides: {
|
|
12
|
-
root: {
|
|
13
|
-
borderRadius: 8,
|
|
14
|
-
borderColor: palette.outline.main,
|
|
15
|
-
padding: '4px 8px',
|
|
16
|
-
'input::placeholder': {
|
|
17
|
-
color: palette.supportive.main,
|
|
18
|
-
opacity: 1,
|
|
19
|
-
},
|
|
20
|
-
'& svg': {
|
|
21
|
-
color: palette.onSurfaceVariant.main,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
input: {
|
|
25
|
-
fontSize: '0.875rem',
|
|
26
|
-
color: palette.onSurface.main,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
MuiOutlinedInput: {
|
|
31
|
-
styleOverrides: {
|
|
32
|
-
root: {
|
|
33
|
-
fieldset: {
|
|
34
|
-
borderColor: palette.outline.main,
|
|
35
|
-
},
|
|
36
|
-
'&.Mui-disabled': {
|
|
37
|
-
input: {
|
|
38
|
-
WebkitTextFillColor: getOnStateLayerColor(OnStateLayer.Disabled, palette.onSurface.main),
|
|
39
|
-
},
|
|
40
|
-
fieldset: {
|
|
41
|
-
'&.MuiOutlinedInput-notchedOutline': {
|
|
42
|
-
borderColor: getOnStateLayerColor(OnStateLayer.Disabled, palette.onSurface.main),
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
MuiFormLabel: {
|
|
50
|
-
styleOverrides: {
|
|
51
|
-
root: {
|
|
52
|
-
color: palette.supportive.main,
|
|
53
|
-
'&.Mui-disabled': {
|
|
54
|
-
color: getOnStateLayerColor(OnStateLayer.Disabled, palette.onSurface.main),
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
MuiFormHelperText: {
|
|
60
|
-
styleOverrides: {
|
|
61
|
-
root: {
|
|
62
|
-
'&.Mui-disabled': {
|
|
63
|
-
color: getOnStateLayerColor(OnStateLayer.Disabled, palette.onSurface.main),
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
},
|
|
5
|
+
styleOverrides: {},
|
|
67
6
|
},
|
|
68
7
|
};
|
|
69
8
|
};
|
|
70
|
-
export default {};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentsVariants } from '@mui/material';
|
|
2
|
+
declare module '@mui/material/InputLabel' {
|
|
3
|
+
interface InputLabelPropsSizeOverrides {
|
|
4
|
+
large: true;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
2
7
|
export interface M3InputLabel {
|
|
3
8
|
MuiInputLabel: {
|
|
4
|
-
defaultProps?: ComponentsProps['MuiInputLabel'];
|
|
5
|
-
styleOverrides?: ComponentsOverrides<Theme>['MuiInputLabel'];
|
|
6
9
|
variants?: ComponentsVariants['MuiInputLabel'];
|
|
7
10
|
};
|
|
8
11
|
}
|
|
9
|
-
export declare const getInputLabel: (
|
|
12
|
+
export declare const getInputLabel: () => M3InputLabel;
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
|
-
|
|
3
|
-
export const getInputLabel = (theme) => {
|
|
4
|
-
const { palette } = theme;
|
|
2
|
+
export const getInputLabel = () => {
|
|
5
3
|
return {
|
|
6
4
|
MuiInputLabel: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
[`&.${inputLabelClasses.shrink}`]: {
|
|
14
|
-
transform: 'translate(14px, -9px) scale(0.75)',
|
|
5
|
+
// the order matters
|
|
6
|
+
variants: [
|
|
7
|
+
{
|
|
8
|
+
props: {},
|
|
9
|
+
style: {
|
|
10
|
+
transform: 'translate(14px, 12px) scale(1)',
|
|
15
11
|
},
|
|
16
12
|
},
|
|
17
|
-
|
|
13
|
+
{
|
|
14
|
+
props: { variant: 'outlined', size: 'small' },
|
|
15
|
+
style: {
|
|
16
|
+
transform: 'translate(14px, 8px) scale(1)',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
props: { variant: 'outlined', size: 'large' },
|
|
21
|
+
style: {
|
|
22
|
+
transform: 'translate(14px, 14px) scale(1)',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
props: ({ variant, ownerState }) => variant === 'outlined' && !!ownerState.shrink,
|
|
27
|
+
style: {
|
|
28
|
+
transform: 'translate(14px, -10px) scale(0.8)',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
],
|
|
18
32
|
},
|
|
19
33
|
};
|
|
20
34
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
|
+
export const getOutlinedInput = () => {
|
|
3
|
+
return {
|
|
4
|
+
MuiOutlinedInput: {
|
|
5
|
+
styleOverrides: {
|
|
6
|
+
root: {
|
|
7
|
+
// the order matters
|
|
8
|
+
variants: [
|
|
9
|
+
{
|
|
10
|
+
props: ({ multiline }) => !!multiline,
|
|
11
|
+
style: {
|
|
12
|
+
paddingTop: 11,
|
|
13
|
+
paddingBottom: 11,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
props: ({ multiline, size }) => !!multiline && size === 'small',
|
|
18
|
+
style: {
|
|
19
|
+
paddingTop: 7,
|
|
20
|
+
paddingBottom: 7,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
props: ({ multiline, size }) => !!multiline && size === 'large',
|
|
25
|
+
style: {
|
|
26
|
+
paddingTop: 14,
|
|
27
|
+
paddingBottom: 14,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
input: {
|
|
33
|
+
height: '20px',
|
|
34
|
+
variants: [
|
|
35
|
+
{
|
|
36
|
+
props: {},
|
|
37
|
+
style: {
|
|
38
|
+
paddingTop: 11,
|
|
39
|
+
paddingBottom: 11,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
props: { size: 'small' },
|
|
44
|
+
style: {
|
|
45
|
+
paddingTop: 7,
|
|
46
|
+
paddingBottom: 7,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
props: { size: 'large' },
|
|
51
|
+
style: {
|
|
52
|
+
paddingTop: 14,
|
|
53
|
+
paddingBottom: 14,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
props: ({ ownerState }) => ownerState.multiline,
|
|
58
|
+
style: {
|
|
59
|
+
padding: 0,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './OutlinedInput.theme';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentsOverrides, ComponentsProps, ComponentsVariants, Theme } from '@mui/material';
|
|
2
|
+
interface M3Radio {
|
|
3
|
+
MuiRadio: {
|
|
4
|
+
styleOverrides?: ComponentsOverrides<Theme>['MuiRadio'];
|
|
5
|
+
variants?: ComponentsVariants<Theme>['MuiRadio'];
|
|
6
|
+
defaultProps?: ComponentsProps['MuiRadio'];
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const getRadio: (theme: Theme) => M3Radio;
|
|
10
|
+
declare const _default: {};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
|
+
export const getRadio = (theme) => {
|
|
3
|
+
const { colors } = theme;
|
|
4
|
+
return {
|
|
5
|
+
MuiRadio: {
|
|
6
|
+
defaultProps: { size: 'small', color: 'default' },
|
|
7
|
+
styleOverrides: {
|
|
8
|
+
root: {
|
|
9
|
+
color: colors.schemes.surfaces.onSurfaceVariant,
|
|
10
|
+
'&.Mui-checked': {
|
|
11
|
+
color: colors.schemes.base.primary,
|
|
12
|
+
},
|
|
13
|
+
'&.Mui-disabled': {
|
|
14
|
+
color: colors.stateLayers.surfaces.onSurfaceVariant.opacity38,
|
|
15
|
+
},
|
|
16
|
+
'&.Mui-disabled.Mui-checked': {
|
|
17
|
+
color: colors.stateLayers.surfaces.onSurface.opacity38,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
variants: [
|
|
22
|
+
{
|
|
23
|
+
props: { color: 'error' },
|
|
24
|
+
style: {
|
|
25
|
+
color: colors.schemes.status.error,
|
|
26
|
+
'&.Mui-checked': {
|
|
27
|
+
color: colors.schemes.status.error,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export default {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Radio.theme';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './Radio.theme';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Theme, ComponentsProps, ComponentsOverrides
|
|
1
|
+
import { Theme, ComponentsProps, ComponentsOverrides } from '@mui/material';
|
|
2
2
|
export interface M3Select {
|
|
3
3
|
MuiSelect: {
|
|
4
4
|
defaultProps?: ComponentsProps['MuiSelect'];
|
|
5
5
|
styleOverrides?: ComponentsOverrides<Theme>['MuiSelect'];
|
|
6
|
-
variants?: ComponentsVariants['MuiSelect'];
|
|
7
6
|
};
|
|
8
7
|
}
|
|
9
|
-
export declare const getSelect: (
|
|
8
|
+
export declare const getSelect: () => M3Select;
|
|
@@ -1,46 +1,19 @@
|
|
|
1
1
|
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
2
|
import { CaretDownIcon } from '@phosphor-icons/react';
|
|
3
|
-
|
|
4
|
-
export const getSelect = (theme) => {
|
|
5
|
-
const { palette } = theme;
|
|
3
|
+
export const getSelect = () => {
|
|
6
4
|
return {
|
|
7
5
|
MuiSelect: {
|
|
8
6
|
defaultProps: {
|
|
9
7
|
IconComponent: CaretDownIcon,
|
|
10
8
|
},
|
|
11
9
|
styleOverrides: {
|
|
12
|
-
|
|
13
|
-
'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
color: palette.supportive.main,
|
|
18
|
-
},
|
|
19
|
-
padding: '0',
|
|
20
|
-
},
|
|
21
|
-
select: {
|
|
22
|
-
// Patch for displaying icons in input
|
|
23
|
-
'.MuiListItem-root': {
|
|
24
|
-
padding: 0,
|
|
25
|
-
},
|
|
26
|
-
'.MuiListItemText-root': {
|
|
27
|
-
margin: 0,
|
|
28
|
-
},
|
|
29
|
-
'&.Mui-disabled': {
|
|
30
|
-
// Mui by default uses -webkit-text-fill-color and if it is set then it is used instead of css color property
|
|
31
|
-
WebkitTextFillColor: getOnStateLayerColor(OnStateLayer.Disabled, palette.onSurface.main),
|
|
32
|
-
borderColor: getStateLayerColor(StateLayer.Disabled, palette.outline.main),
|
|
33
|
-
},
|
|
10
|
+
icon: {
|
|
11
|
+
top: 'calc(50% - 10px)',
|
|
12
|
+
right: 13,
|
|
13
|
+
width: 20,
|
|
14
|
+
height: 20,
|
|
34
15
|
},
|
|
35
16
|
},
|
|
36
|
-
variants: [
|
|
37
|
-
{
|
|
38
|
-
props: { variant: 'outlined' },
|
|
39
|
-
style: {
|
|
40
|
-
borderRadius: 8,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
17
|
},
|
|
45
18
|
};
|
|
46
19
|
};
|