@mui/material 6.0.0-alpha.4 → 6.0.0-alpha.6

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 (272) hide show
  1. package/Accordion/Accordion.d.ts +2 -2
  2. package/Accordion/Accordion.js +2 -2
  3. package/AccordionSummary/accordionSummaryClasses.d.ts +1 -1
  4. package/Alert/Alert.d.ts +2 -2
  5. package/Alert/Alert.js +2 -2
  6. package/Alert/alertClasses.d.ts +12 -12
  7. package/Avatar/Avatar.d.ts +1 -1
  8. package/Avatar/Avatar.js +1 -1
  9. package/Backdrop/Backdrop.d.ts +1 -1
  10. package/Backdrop/Backdrop.js +1 -1
  11. package/Badge/Badge.d.ts +2 -2
  12. package/Badge/Badge.js +2 -2
  13. package/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
  14. package/Button/Button.js +1 -1
  15. package/Button/buttonClasses.d.ts +33 -33
  16. package/ButtonGroup/buttonGroupClasses.d.ts +17 -17
  17. package/CHANGELOG.md +86 -0
  18. package/Checkbox/Checkbox.js +3 -1
  19. package/Chip/chipClasses.d.ts +28 -26
  20. package/Chip/chipClasses.js +1 -1
  21. package/Collapse/Collapse.js +66 -35
  22. package/Dialog/Dialog.js +105 -61
  23. package/DialogActions/DialogActions.js +16 -12
  24. package/DialogContent/DialogContent.js +25 -15
  25. package/DialogContentText/DialogContentText.js +3 -2
  26. package/DialogTitle/DialogTitle.js +2 -2
  27. package/Divider/Divider.d.ts +1 -1
  28. package/Divider/Divider.js +1 -1
  29. package/Drawer/Drawer.js +73 -32
  30. package/Fab/Fab.js +1 -1
  31. package/FilledInput/FilledInput.d.ts +1 -0
  32. package/FilledInput/FilledInput.js +170 -87
  33. package/FormControlLabel/FormControlLabel.d.ts +21 -14
  34. package/FormControlLabel/FormControlLabel.js +22 -4
  35. package/FormHelperText/FormHelperText.js +2 -2
  36. package/FormLabel/FormLabel.js +23 -13
  37. package/Grow/Grow.js +3 -1
  38. package/Icon/Icon.js +63 -23
  39. package/ImageList/ImageList.js +2 -2
  40. package/ImageListItem/ImageListItem.js +2 -2
  41. package/ImageListItemBar/ImageListItemBar.js +2 -2
  42. package/Input/Input.d.ts +1 -0
  43. package/Input/Input.js +84 -61
  44. package/InputAdornment/InputAdornment.js +37 -21
  45. package/InputBase/InputBase.js +58 -28
  46. package/InputLabel/InputLabel.js +120 -58
  47. package/Link/Link.js +99 -54
  48. package/Link/getTextDecoration.d.ts +2 -8
  49. package/Link/getTextDecoration.js +16 -8
  50. package/List/List.js +22 -13
  51. package/ListItem/ListItem.js +2 -2
  52. package/ListItemAvatar/ListItemAvatar.js +2 -2
  53. package/ListItemButton/ListItemButton.js +3 -2
  54. package/ListItemIcon/ListItemIcon.js +14 -9
  55. package/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
  56. package/ListItemText/ListItemText.js +2 -2
  57. package/ListSubheader/ListSubheader.js +5 -3
  58. package/Menu/Menu.js +3 -2
  59. package/MenuItem/MenuItem.js +47 -27
  60. package/NativeSelect/NativeSelectInput.js +78 -49
  61. package/OutlinedInput/NotchedOutline.js +60 -43
  62. package/OutlinedInput/OutlinedInput.js +97 -39
  63. package/Pagination/Pagination.js +2 -2
  64. package/PaginationItem/PaginationItem.d.ts +26 -14
  65. package/PaginationItem/PaginationItem.js +64 -20
  66. package/PaginationItem/paginationItemClasses.d.ts +4 -4
  67. package/Paper/Paper.js +44 -21
  68. package/Radio/Radio.js +5 -3
  69. package/Radio/RadioButtonIcon.js +1 -1
  70. package/Rating/Rating.js +3 -2
  71. package/Select/Select.js +2 -1
  72. package/Select/SelectInput.js +8 -6
  73. package/Skeleton/Skeleton.js +109 -61
  74. package/Slider/Slider.d.ts +2 -2
  75. package/Slider/Slider.js +2 -2
  76. package/Snackbar/Snackbar.js +66 -40
  77. package/SnackbarContent/SnackbarContent.js +2 -2
  78. package/SpeedDial/SpeedDial.d.ts +28 -1
  79. package/SpeedDial/SpeedDial.js +107 -49
  80. package/SpeedDialAction/SpeedDialAction.js +50 -24
  81. package/SpeedDialIcon/SpeedDialIcon.js +37 -16
  82. package/StepConnector/stepConnectorClasses.d.ts +2 -2
  83. package/StepLabel/StepLabel.d.ts +3 -3
  84. package/StepLabel/StepLabel.js +3 -3
  85. package/SvgIcon/SvgIcon.js +73 -21
  86. package/SwipeableDrawer/SwipeArea.js +39 -18
  87. package/Tab/Tab.js +127 -55
  88. package/TabScrollButton/TabScrollButton.js +27 -15
  89. package/Table/Table.js +2 -2
  90. package/TableBody/TableBody.js +2 -2
  91. package/TableCell/TableCell.js +2 -2
  92. package/TableContainer/TableContainer.js +2 -2
  93. package/TableFooter/TableFooter.js +2 -2
  94. package/TableHead/TableHead.js +2 -2
  95. package/TablePagination/TablePagination.js +2 -2
  96. package/TableRow/TableRow.js +2 -2
  97. package/TableSortLabel/TableSortLabel.js +2 -2
  98. package/Tabs/Tabs.js +107 -54
  99. package/TextField/TextField.js +2 -2
  100. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +2 -2
  101. package/Toolbar/Toolbar.js +3 -7
  102. package/Tooltip/Tooltip.js +185 -88
  103. package/Typography/Typography.js +89 -39
  104. package/index.js +1 -1
  105. package/internal/SwitchBase.js +39 -11
  106. package/modern/Accordion/Accordion.js +2 -2
  107. package/modern/Alert/Alert.js +2 -2
  108. package/modern/Avatar/Avatar.js +1 -1
  109. package/modern/Backdrop/Backdrop.js +1 -1
  110. package/modern/Badge/Badge.js +2 -2
  111. package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
  112. package/modern/Button/Button.js +1 -1
  113. package/modern/Checkbox/Checkbox.js +3 -1
  114. package/modern/Chip/chipClasses.js +1 -1
  115. package/modern/Collapse/Collapse.js +66 -35
  116. package/modern/Dialog/Dialog.js +105 -61
  117. package/modern/DialogActions/DialogActions.js +16 -12
  118. package/modern/DialogContent/DialogContent.js +25 -15
  119. package/modern/DialogContentText/DialogContentText.js +3 -2
  120. package/modern/DialogTitle/DialogTitle.js +2 -2
  121. package/modern/Divider/Divider.js +1 -1
  122. package/modern/Drawer/Drawer.js +73 -32
  123. package/modern/Fab/Fab.js +1 -1
  124. package/modern/FilledInput/FilledInput.js +170 -87
  125. package/modern/FormControlLabel/FormControlLabel.js +22 -4
  126. package/modern/FormHelperText/FormHelperText.js +2 -2
  127. package/modern/FormLabel/FormLabel.js +23 -13
  128. package/modern/Grow/Grow.js +3 -1
  129. package/modern/Icon/Icon.js +63 -23
  130. package/modern/ImageList/ImageList.js +2 -2
  131. package/modern/ImageListItem/ImageListItem.js +2 -2
  132. package/modern/ImageListItemBar/ImageListItemBar.js +2 -2
  133. package/modern/Input/Input.js +84 -61
  134. package/modern/InputAdornment/InputAdornment.js +37 -21
  135. package/modern/InputBase/InputBase.js +58 -28
  136. package/modern/InputLabel/InputLabel.js +120 -58
  137. package/modern/Link/Link.js +99 -54
  138. package/modern/Link/getTextDecoration.js +16 -8
  139. package/modern/List/List.js +22 -13
  140. package/modern/ListItem/ListItem.js +2 -2
  141. package/modern/ListItemAvatar/ListItemAvatar.js +2 -2
  142. package/modern/ListItemButton/ListItemButton.js +3 -2
  143. package/modern/ListItemIcon/ListItemIcon.js +14 -9
  144. package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
  145. package/modern/ListItemText/ListItemText.js +2 -2
  146. package/modern/ListSubheader/ListSubheader.js +5 -3
  147. package/modern/Menu/Menu.js +3 -2
  148. package/modern/MenuItem/MenuItem.js +47 -27
  149. package/modern/NativeSelect/NativeSelectInput.js +78 -49
  150. package/modern/OutlinedInput/NotchedOutline.js +60 -43
  151. package/modern/OutlinedInput/OutlinedInput.js +97 -39
  152. package/modern/Pagination/Pagination.js +2 -2
  153. package/modern/PaginationItem/PaginationItem.js +64 -20
  154. package/modern/Paper/Paper.js +44 -21
  155. package/modern/Radio/Radio.js +5 -3
  156. package/modern/Radio/RadioButtonIcon.js +1 -1
  157. package/modern/Rating/Rating.js +3 -2
  158. package/modern/Select/Select.js +2 -1
  159. package/modern/Select/SelectInput.js +8 -6
  160. package/modern/Skeleton/Skeleton.js +109 -61
  161. package/modern/Slider/Slider.js +2 -2
  162. package/modern/Snackbar/Snackbar.js +66 -40
  163. package/modern/SnackbarContent/SnackbarContent.js +2 -2
  164. package/modern/SpeedDial/SpeedDial.js +107 -49
  165. package/modern/SpeedDialAction/SpeedDialAction.js +50 -24
  166. package/modern/SpeedDialIcon/SpeedDialIcon.js +37 -16
  167. package/modern/StepLabel/StepLabel.js +3 -3
  168. package/modern/SvgIcon/SvgIcon.js +73 -21
  169. package/modern/SwipeableDrawer/SwipeArea.js +39 -18
  170. package/modern/Tab/Tab.js +127 -55
  171. package/modern/TabScrollButton/TabScrollButton.js +27 -15
  172. package/modern/Table/Table.js +2 -2
  173. package/modern/TableBody/TableBody.js +2 -2
  174. package/modern/TableCell/TableCell.js +2 -2
  175. package/modern/TableContainer/TableContainer.js +2 -2
  176. package/modern/TableFooter/TableFooter.js +2 -2
  177. package/modern/TableHead/TableHead.js +2 -2
  178. package/modern/TablePagination/TablePagination.js +2 -2
  179. package/modern/TableRow/TableRow.js +2 -2
  180. package/modern/TableSortLabel/TableSortLabel.js +2 -2
  181. package/modern/Tabs/Tabs.js +107 -54
  182. package/modern/TextField/TextField.js +2 -2
  183. package/modern/Toolbar/Toolbar.js +3 -7
  184. package/modern/Tooltip/Tooltip.js +185 -88
  185. package/modern/Typography/Typography.js +89 -39
  186. package/modern/index.js +1 -1
  187. package/modern/internal/SwitchBase.js +39 -11
  188. package/node/Accordion/Accordion.js +2 -2
  189. package/node/Alert/Alert.js +2 -2
  190. package/node/Avatar/Avatar.js +1 -1
  191. package/node/Backdrop/Backdrop.js +1 -1
  192. package/node/Badge/Badge.js +2 -2
  193. package/node/Breadcrumbs/BreadcrumbCollapsed.js +3 -3
  194. package/node/Button/Button.js +2 -2
  195. package/node/Checkbox/Checkbox.js +3 -1
  196. package/node/Chip/chipClasses.js +1 -1
  197. package/node/Collapse/Collapse.js +70 -39
  198. package/node/Dialog/Dialog.js +110 -66
  199. package/node/DialogActions/DialogActions.js +18 -14
  200. package/node/DialogContent/DialogContent.js +27 -17
  201. package/node/DialogContentText/DialogContentText.js +6 -5
  202. package/node/DialogTitle/DialogTitle.js +4 -4
  203. package/node/Divider/Divider.js +1 -1
  204. package/node/Drawer/Drawer.js +78 -37
  205. package/node/Fab/Fab.js +2 -2
  206. package/node/FilledInput/FilledInput.js +176 -91
  207. package/node/FormControlLabel/FormControlLabel.js +23 -5
  208. package/node/FormHelperText/FormHelperText.js +4 -4
  209. package/node/FormLabel/FormLabel.js +26 -16
  210. package/node/Grow/Grow.js +3 -1
  211. package/node/Icon/Icon.js +65 -25
  212. package/node/ImageList/ImageList.js +4 -4
  213. package/node/ImageListItem/ImageListItem.js +4 -4
  214. package/node/ImageListItemBar/ImageListItemBar.js +8 -8
  215. package/node/Input/Input.js +87 -64
  216. package/node/InputAdornment/InputAdornment.js +39 -23
  217. package/node/InputBase/InputBase.js +61 -31
  218. package/node/InputLabel/InputLabel.js +123 -61
  219. package/node/Link/Link.js +101 -56
  220. package/node/Link/getTextDecoration.js +18 -10
  221. package/node/List/List.js +24 -15
  222. package/node/ListItem/ListItem.js +5 -5
  223. package/node/ListItemAvatar/ListItemAvatar.js +4 -4
  224. package/node/ListItemButton/ListItemButton.js +6 -5
  225. package/node/ListItemIcon/ListItemIcon.js +16 -11
  226. package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +4 -4
  227. package/node/ListItemText/ListItemText.js +4 -4
  228. package/node/ListSubheader/ListSubheader.js +7 -5
  229. package/node/Menu/Menu.js +8 -7
  230. package/node/MenuItem/MenuItem.js +50 -30
  231. package/node/NativeSelect/NativeSelectInput.js +80 -53
  232. package/node/OutlinedInput/NotchedOutline.js +64 -47
  233. package/node/OutlinedInput/OutlinedInput.js +101 -43
  234. package/node/Pagination/Pagination.js +5 -5
  235. package/node/PaginationItem/PaginationItem.js +65 -20
  236. package/node/Paper/Paper.js +49 -28
  237. package/node/Radio/Radio.js +6 -4
  238. package/node/Radio/RadioButtonIcon.js +2 -2
  239. package/node/Rating/Rating.js +9 -8
  240. package/node/Select/Select.js +6 -5
  241. package/node/Select/SelectInput.js +9 -7
  242. package/node/Skeleton/Skeleton.js +113 -65
  243. package/node/Slider/Slider.js +2 -2
  244. package/node/Snackbar/Snackbar.js +68 -42
  245. package/node/SnackbarContent/SnackbarContent.js +6 -6
  246. package/node/SpeedDial/SpeedDial.js +111 -53
  247. package/node/SpeedDialAction/SpeedDialAction.js +54 -28
  248. package/node/SpeedDialIcon/SpeedDialIcon.js +39 -18
  249. package/node/StepLabel/StepLabel.js +3 -3
  250. package/node/SvgIcon/SvgIcon.js +79 -24
  251. package/node/SwipeableDrawer/SwipeArea.js +41 -20
  252. package/node/Tab/Tab.js +129 -57
  253. package/node/TabScrollButton/TabScrollButton.js +29 -17
  254. package/node/Table/Table.js +4 -4
  255. package/node/TableBody/TableBody.js +4 -4
  256. package/node/TableCell/TableCell.js +4 -4
  257. package/node/TableContainer/TableContainer.js +4 -4
  258. package/node/TableFooter/TableFooter.js +4 -4
  259. package/node/TableHead/TableHead.js +4 -4
  260. package/node/TablePagination/TablePagination.js +10 -10
  261. package/node/TableRow/TableRow.js +4 -4
  262. package/node/TableSortLabel/TableSortLabel.js +5 -5
  263. package/node/Tabs/Tabs.js +113 -60
  264. package/node/TextField/TextField.js +4 -4
  265. package/node/Toolbar/Toolbar.js +5 -9
  266. package/node/Tooltip/Tooltip.js +189 -92
  267. package/node/Typography/Typography.js +90 -40
  268. package/node/index.js +1 -1
  269. package/node/internal/SwitchBase.js +41 -13
  270. package/package.json +6 -6
  271. package/umd/material-ui.development.js +2777 -1334
  272. package/umd/material-ui.production.min.js +4 -4
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["className", "disabled", "error", "IconComponent", "inputRef", "variant"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
@@ -10,7 +10,8 @@ import refType from '@mui/utils/refType';
10
10
  import composeClasses from '@mui/utils/composeClasses';
11
11
  import capitalize from '../utils/capitalize';
12
12
  import nativeSelectClasses, { getNativeSelectUtilityClasses } from './nativeSelectClasses';
13
- import styled, { rootShouldForwardProp } from '../styles/styled';
13
+ import { styled } from '../zero-styled';
14
+ import rootShouldForwardProp from '../styles/rootShouldForwardProp';
14
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
16
  const useUtilityClasses = ownerState => {
16
17
  const {
@@ -27,27 +28,23 @@ const useUtilityClasses = ownerState => {
27
28
  };
28
29
  return composeClasses(slots, getNativeSelectUtilityClasses, classes);
29
30
  };
30
- export const nativeSelectSelectStyles = ({
31
- ownerState,
31
+ export const StyledSelectSelect = styled('select')(({
32
32
  theme
33
- }) => _extends({
33
+ }) => ({
34
+ // Reset
34
35
  MozAppearance: 'none',
35
36
  // Reset
36
37
  WebkitAppearance: 'none',
37
- // Reset
38
38
  // When interacting quickly, the text can end up selected.
39
39
  // Native select can't be selected either.
40
40
  userSelect: 'none',
41
- borderRadius: 0,
42
41
  // Reset
42
+ borderRadius: 0,
43
43
  cursor: 'pointer',
44
- '&:focus': _extends({}, theme.vars ? {
45
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.05)`
46
- } : {
47
- backgroundColor: theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)'
48
- }, {
49
- borderRadius: 0 // Reset Chrome style
50
- }),
44
+ '&:focus': {
45
+ // Reset Chrome style
46
+ borderRadius: 0
47
+ },
51
48
  // Remove IE11 arrow
52
49
  '&::-ms-expand': {
53
50
  display: 'none'
@@ -61,25 +58,42 @@ export const nativeSelectSelectStyles = ({
61
58
  '&:not([multiple]) option, &:not([multiple]) optgroup': {
62
59
  backgroundColor: (theme.vars || theme).palette.background.paper
63
60
  },
64
- // Bump specificity to allow extending custom inputs
65
- '&&&': {
66
- paddingRight: 24,
67
- minWidth: 16 // So it doesn't collapse.
68
- }
69
- }, ownerState.variant === 'filled' && {
70
- '&&&': {
71
- paddingRight: 32
72
- }
73
- }, ownerState.variant === 'outlined' && {
74
- borderRadius: (theme.vars || theme).shape.borderRadius,
75
- '&:focus': {
76
- borderRadius: (theme.vars || theme).shape.borderRadius // Reset the reset for Chrome style
77
- },
78
- '&&&': {
79
- paddingRight: 32
80
- }
81
- });
82
- const NativeSelectSelect = styled('select', {
61
+ variants: [{
62
+ props: ({
63
+ ownerState
64
+ }) => ownerState.variant !== 'filled' && ownerState.variant !== 'outlined',
65
+ style: {
66
+ // Bump specificity to allow extending custom inputs
67
+ '&&&': {
68
+ paddingRight: 24,
69
+ minWidth: 16 // So it doesn't collapse.
70
+ }
71
+ }
72
+ }, {
73
+ props: {
74
+ variant: 'filled'
75
+ },
76
+ style: {
77
+ '&&&': {
78
+ paddingRight: 32
79
+ }
80
+ }
81
+ }, {
82
+ props: {
83
+ variant: 'outlined'
84
+ },
85
+ style: {
86
+ borderRadius: (theme.vars || theme).shape.borderRadius,
87
+ '&:focus': {
88
+ borderRadius: (theme.vars || theme).shape.borderRadius // Reset the reset for Chrome style
89
+ },
90
+ '&&&': {
91
+ paddingRight: 32
92
+ }
93
+ }
94
+ }]
95
+ }));
96
+ const NativeSelectSelect = styled(StyledSelectSelect, {
83
97
  name: 'MuiNativeSelect',
84
98
  slot: 'Select',
85
99
  shouldForwardProp: rootShouldForwardProp,
@@ -91,31 +105,46 @@ const NativeSelectSelect = styled('select', {
91
105
  [`&.${nativeSelectClasses.multiple}`]: styles.multiple
92
106
  }];
93
107
  }
94
- })(nativeSelectSelectStyles);
95
- export const nativeSelectIconStyles = ({
96
- ownerState,
108
+ })({});
109
+ export const StyledSelectIcon = styled('svg')(({
97
110
  theme
98
- }) => _extends({
111
+ }) => ({
99
112
  // We use a position absolute over a flexbox in order to forward the pointer events
100
113
  // to the input and to support wrapping tags..
101
114
  position: 'absolute',
102
115
  right: 0,
103
- top: 'calc(50% - .5em)',
104
116
  // Center vertically, height is 1em
105
- pointerEvents: 'none',
117
+ top: 'calc(50% - .5em)',
106
118
  // Don't block pointer events on the select under the icon.
119
+ pointerEvents: 'none',
107
120
  color: (theme.vars || theme).palette.action.active,
108
121
  [`&.${nativeSelectClasses.disabled}`]: {
109
122
  color: (theme.vars || theme).palette.action.disabled
110
- }
111
- }, ownerState.open && {
112
- transform: 'rotate(180deg)'
113
- }, ownerState.variant === 'filled' && {
114
- right: 7
115
- }, ownerState.variant === 'outlined' && {
116
- right: 7
117
- });
118
- const NativeSelectIcon = styled('svg', {
123
+ },
124
+ variants: [{
125
+ props: ({
126
+ ownerState
127
+ }) => ownerState.open,
128
+ style: {
129
+ transform: 'rotate(180deg)'
130
+ }
131
+ }, {
132
+ props: {
133
+ variant: 'filled'
134
+ },
135
+ style: {
136
+ right: 7
137
+ }
138
+ }, {
139
+ props: {
140
+ variant: 'outlined'
141
+ },
142
+ style: {
143
+ right: 7
144
+ }
145
+ }]
146
+ }));
147
+ const NativeSelectIcon = styled(StyledSelectIcon, {
119
148
  name: 'MuiNativeSelect',
120
149
  slot: 'Icon',
121
150
  overridesResolver: (props, styles) => {
@@ -124,7 +153,7 @@ const NativeSelectIcon = styled('svg', {
124
153
  } = props;
125
154
  return [styles.icon, ownerState.variant && styles[`icon${capitalize(ownerState.variant)}`], ownerState.open && styles.iconOpen];
126
155
  }
127
- })(nativeSelectIconStyles);
156
+ })({});
128
157
 
129
158
  /**
130
159
  * @ignore - internal component.
@@ -1,12 +1,13 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  var _span;
6
6
  const _excluded = ["children", "classes", "className", "label", "notched"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
- import styled, { rootShouldForwardProp } from '../styles/styled';
9
+ import rootShouldForwardProp from '../styles/rootShouldForwardProp';
10
+ import { styled } from '../zero-styled';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const NotchedOutlineRoot = styled('fieldset', {
12
13
  shouldForwardProp: rootShouldForwardProp
@@ -29,51 +30,67 @@ const NotchedOutlineRoot = styled('fieldset', {
29
30
  const NotchedOutlineLegend = styled('legend', {
30
31
  shouldForwardProp: rootShouldForwardProp
31
32
  })(({
32
- ownerState,
33
33
  theme
34
- }) => _extends({
34
+ }) => ({
35
35
  float: 'unset',
36
36
  // Fix conflict with bootstrap
37
37
  width: 'auto',
38
38
  // Fix conflict with bootstrap
39
- overflow: 'hidden'
40
- }, !ownerState.withLabel && {
41
- padding: 0,
42
- lineHeight: '11px',
43
- // sync with `height` in `legend` styles
44
- transition: theme.transitions.create('width', {
45
- duration: 150,
46
- easing: theme.transitions.easing.easeOut
47
- })
48
- }, ownerState.withLabel && _extends({
49
- display: 'block',
50
- // Fix conflict with normalize.css and sanitize.css
51
- padding: 0,
52
- height: 11,
53
- // sync with `lineHeight` in `legend` styles
54
- fontSize: '0.75em',
55
- visibility: 'hidden',
56
- maxWidth: 0.01,
57
- transition: theme.transitions.create('max-width', {
58
- duration: 50,
59
- easing: theme.transitions.easing.easeOut
60
- }),
61
- whiteSpace: 'nowrap',
62
- '& > span': {
63
- paddingLeft: 5,
64
- paddingRight: 5,
65
- display: 'inline-block',
66
- opacity: 0,
67
- visibility: 'visible'
68
- }
69
- }, ownerState.notched && {
70
- maxWidth: '100%',
71
- transition: theme.transitions.create('max-width', {
72
- duration: 100,
73
- easing: theme.transitions.easing.easeOut,
74
- delay: 50
75
- })
76
- })));
39
+ overflow: 'hidden',
40
+ // Fix Horizontal scroll when label too long
41
+ variants: [{
42
+ props: ({
43
+ ownerState
44
+ }) => !ownerState.withLabel,
45
+ style: {
46
+ padding: 0,
47
+ lineHeight: '11px',
48
+ // sync with `height` in `legend` styles
49
+ transition: theme.transitions.create('width', {
50
+ duration: 150,
51
+ easing: theme.transitions.easing.easeOut
52
+ })
53
+ }
54
+ }, {
55
+ props: ({
56
+ ownerState
57
+ }) => ownerState.withLabel,
58
+ style: {
59
+ display: 'block',
60
+ // Fix conflict with normalize.css and sanitize.css
61
+ padding: 0,
62
+ height: 11,
63
+ // sync with `lineHeight` in `legend` styles
64
+ fontSize: '0.75em',
65
+ visibility: 'hidden',
66
+ maxWidth: 0.01,
67
+ transition: theme.transitions.create('max-width', {
68
+ duration: 50,
69
+ easing: theme.transitions.easing.easeOut
70
+ }),
71
+ whiteSpace: 'nowrap',
72
+ '& > span': {
73
+ paddingLeft: 5,
74
+ paddingRight: 5,
75
+ display: 'inline-block',
76
+ opacity: 0,
77
+ visibility: 'visible'
78
+ }
79
+ }
80
+ }, {
81
+ props: ({
82
+ ownerState
83
+ }) => ownerState.withLabel && ownerState.notched,
84
+ style: {
85
+ maxWidth: '100%',
86
+ transition: theme.transitions.create('max-width', {
87
+ duration: 100,
88
+ easing: theme.transitions.easing.easeOut,
89
+ delay: 50
90
+ })
91
+ }
92
+ }]
93
+ }));
77
94
 
78
95
  /**
79
96
  * @ignore - internal component.
@@ -107,7 +124,7 @@ export default function NotchedOutline(props) {
107
124
  })
108
125
  }));
109
126
  }
110
- process.env.NODE_ENV !== "production" ? NotchedOutline.propTypes = {
127
+ process.env.NODE_ENV !== "production" ? NotchedOutline.propTypes /* remove-proptypes */ = {
111
128
  /**
112
129
  * The content of the component.
113
130
  */
@@ -10,11 +10,12 @@ import composeClasses from '@mui/utils/composeClasses';
10
10
  import NotchedOutline from './NotchedOutline';
11
11
  import useFormControl from '../FormControl/useFormControl';
12
12
  import formControlState from '../FormControl/formControlState';
13
- import styled, { rootShouldForwardProp } from '../styles/styled';
13
+ import rootShouldForwardProp from '../styles/rootShouldForwardProp';
14
+ import { styled, createUseThemeProps } from '../zero-styled';
14
15
  import outlinedInputClasses, { getOutlinedInputUtilityClass } from './outlinedInputClasses';
15
- import InputBase, { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot, InputBaseComponent as InputBaseInput } from '../InputBase/InputBase';
16
- import useThemeProps from '../styles/useThemeProps';
16
+ import InputBase, { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot, InputBaseInput } from '../InputBase/InputBase';
17
17
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
18
+ const useThemeProps = createUseThemeProps('MuiOutlinedInput');
18
19
  const useUtilityClasses = ownerState => {
19
20
  const {
20
21
  classes
@@ -33,41 +34,75 @@ const OutlinedInputRoot = styled(InputBaseRoot, {
33
34
  slot: 'Root',
34
35
  overridesResolver: inputBaseRootOverridesResolver
35
36
  })(({
36
- theme,
37
- ownerState
37
+ theme
38
38
  }) => {
39
39
  const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
40
- return _extends({
40
+ return {
41
41
  position: 'relative',
42
42
  borderRadius: (theme.vars || theme).shape.borderRadius,
43
43
  [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
44
44
  borderColor: (theme.vars || theme).palette.text.primary
45
45
  },
46
- // Reset on touch devices, it doesn't add specificity
47
- '@media (hover: none)': {
48
- [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
49
- borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
50
- }
51
- },
52
46
  [`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: {
53
- borderColor: (theme.vars || theme).palette[ownerState.color].main,
54
47
  borderWidth: 2
55
48
  },
56
- [`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]: {
57
- borderColor: (theme.vars || theme).palette.error.main
58
- },
59
- [`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]: {
60
- borderColor: (theme.vars || theme).palette.action.disabled
61
- }
62
- }, ownerState.startAdornment && {
63
- paddingLeft: 14
64
- }, ownerState.endAdornment && {
65
- paddingRight: 14
66
- }, ownerState.multiline && _extends({
67
- padding: '16.5px 14px'
68
- }, ownerState.size === 'small' && {
69
- padding: '8.5px 14px'
70
- }));
49
+ variants: [...Object.entries(theme.palette).filter(([, value]) => value.main).map(([color]) => ({
50
+ props: {
51
+ color
52
+ },
53
+ style: {
54
+ [`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: {
55
+ borderColor: (theme.vars || theme).palette[color].main
56
+ }
57
+ }
58
+ })), {
59
+ props: {},
60
+ // to overide the above style
61
+ style: {
62
+ // Reset on touch devices, it doesn't add specificity
63
+ '@media (hover: none)': {
64
+ [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
65
+ borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
66
+ }
67
+ },
68
+ [`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]: {
69
+ borderColor: (theme.vars || theme).palette.error.main
70
+ },
71
+ [`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]: {
72
+ borderColor: (theme.vars || theme).palette.action.disabled
73
+ }
74
+ }
75
+ }, {
76
+ props: ({
77
+ ownerState
78
+ }) => ownerState.startAdornment,
79
+ style: {
80
+ paddingLeft: 14
81
+ }
82
+ }, {
83
+ props: ({
84
+ ownerState
85
+ }) => ownerState.endAdornment,
86
+ style: {
87
+ paddingRight: 14
88
+ }
89
+ }, {
90
+ props: ({
91
+ ownerState
92
+ }) => ownerState.multiline,
93
+ style: {
94
+ padding: '16.5px 14px'
95
+ }
96
+ }, {
97
+ props: ({
98
+ ownerState,
99
+ size
100
+ }) => ownerState.multiline && size === 'small',
101
+ style: {
102
+ padding: '8.5px 14px'
103
+ }
104
+ }]
105
+ };
71
106
  });
72
107
  const NotchedOutlineRoot = styled(NotchedOutline, {
73
108
  name: 'MuiOutlinedInput',
@@ -86,8 +121,7 @@ const OutlinedInputInput = styled(InputBaseInput, {
86
121
  slot: 'Input',
87
122
  overridesResolver: inputBaseInputOverridesResolver
88
123
  })(({
89
- theme,
90
- ownerState
124
+ theme
91
125
  }) => _extends({
92
126
  padding: '16.5px 14px'
93
127
  }, !theme.vars && {
@@ -108,14 +142,36 @@ const OutlinedInputInput = styled(InputBaseInput, {
108
142
  caretColor: '#fff'
109
143
  }
110
144
  }
111
- }, ownerState.size === 'small' && {
112
- padding: '8.5px 14px'
113
- }, ownerState.multiline && {
114
- padding: 0
115
- }, ownerState.startAdornment && {
116
- paddingLeft: 0
117
- }, ownerState.endAdornment && {
118
- paddingRight: 0
145
+ }, {
146
+ variants: [{
147
+ props: {
148
+ size: 'small'
149
+ },
150
+ style: {
151
+ padding: '8.5px 14px'
152
+ }
153
+ }, {
154
+ props: ({
155
+ ownerState
156
+ }) => ownerState.multiline,
157
+ style: {
158
+ padding: 0
159
+ }
160
+ }, {
161
+ props: ({
162
+ ownerState
163
+ }) => ownerState.startAdornment,
164
+ style: {
165
+ paddingLeft: 0
166
+ }
167
+ }, {
168
+ props: ({
169
+ ownerState
170
+ }) => ownerState.endAdornment,
171
+ style: {
172
+ paddingRight: 0
173
+ }
174
+ }]
119
175
  }));
120
176
  const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
121
177
  var _React$Fragment;
@@ -345,5 +401,7 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes /* remove-propty
345
401
  */
346
402
  value: PropTypes.any
347
403
  } : void 0;
348
- OutlinedInput.muiName = 'Input';
404
+ if (OutlinedInput) {
405
+ OutlinedInput.muiName = 'Input';
406
+ }
349
407
  export default OutlinedInput;
@@ -8,12 +8,12 @@ import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import integerPropType from '@mui/utils/integerPropType';
11
- import useThemeProps from '../styles/useThemeProps';
12
11
  import { getPaginationUtilityClass } from './paginationClasses';
13
12
  import usePagination from '../usePagination';
14
13
  import PaginationItem from '../PaginationItem';
15
- import styled from '../styles/styled';
14
+ import { styled, createUseThemeProps } from '../zero-styled';
16
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
+ const useThemeProps = createUseThemeProps('MuiPagination');
17
17
  const useUtilityClasses = ownerState => {
18
18
  const {
19
19
  classes,
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
- const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "type", "variant"];
5
+ const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "slotProps", "type", "variant"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
@@ -16,6 +16,7 @@ import FirstPageIcon from '../internal/svg-icons/FirstPage';
16
16
  import LastPageIcon from '../internal/svg-icons/LastPage';
17
17
  import NavigateBeforeIcon from '../internal/svg-icons/NavigateBefore';
18
18
  import NavigateNextIcon from '../internal/svg-icons/NavigateNext';
19
+ import useSlot from '../utils/useSlot';
19
20
  import { styled, createUseThemeProps } from '../zero-styled';
20
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
22
  const useThemeProps = createUseThemeProps('MuiPaginationItem');
@@ -281,6 +282,7 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
281
282
  shape = 'circular',
282
283
  size = 'medium',
283
284
  slots = {},
285
+ slotProps = {},
284
286
  type = 'page',
285
287
  variant = 'text'
286
288
  } = props,
@@ -296,18 +298,53 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
296
298
  });
297
299
  const isRtl = useRtl();
298
300
  const classes = useUtilityClasses(ownerState);
299
- const normalizedIcons = isRtl ? {
300
- previous: slots.next || components.next || NavigateNextIcon,
301
- next: slots.previous || components.previous || NavigateBeforeIcon,
302
- last: slots.first || components.first || FirstPageIcon,
303
- first: slots.last || components.last || LastPageIcon
304
- } : {
305
- previous: slots.previous || components.previous || NavigateBeforeIcon,
306
- next: slots.next || components.next || NavigateNextIcon,
307
- first: slots.first || components.first || FirstPageIcon,
308
- last: slots.last || components.last || LastPageIcon
301
+ const externalForwardedProps = {
302
+ slots: {
303
+ previous: slots.previous ?? components.previous,
304
+ next: slots.next ?? components.next,
305
+ first: slots.first ?? components.first,
306
+ last: slots.last ?? components.last
307
+ },
308
+ slotProps
309
309
  };
310
- const Icon = normalizedIcons[type];
310
+ const [PreviousSlot, previousSlotProps] = useSlot('previous', {
311
+ elementType: NavigateBeforeIcon,
312
+ externalForwardedProps,
313
+ ownerState
314
+ });
315
+ const [NextSlot, nextSlotProps] = useSlot('next', {
316
+ elementType: NavigateNextIcon,
317
+ externalForwardedProps,
318
+ ownerState
319
+ });
320
+ const [FirstSlot, firstSlotProps] = useSlot('first', {
321
+ elementType: FirstPageIcon,
322
+ externalForwardedProps,
323
+ ownerState
324
+ });
325
+ const [LastSlot, lastSlotProps] = useSlot('last', {
326
+ elementType: LastPageIcon,
327
+ externalForwardedProps,
328
+ ownerState
329
+ });
330
+ const rtlAwareType = isRtl ? {
331
+ previous: 'next',
332
+ next: 'previous',
333
+ first: 'last',
334
+ last: 'first'
335
+ }[type] : type;
336
+ const IconSlot = {
337
+ previous: PreviousSlot,
338
+ next: NextSlot,
339
+ first: FirstSlot,
340
+ last: LastSlot
341
+ }[rtlAwareType];
342
+ const iconSlotProps = {
343
+ previous: previousSlotProps,
344
+ next: nextSlotProps,
345
+ first: firstSlotProps,
346
+ last: lastSlotProps
347
+ }[rtlAwareType];
311
348
  return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/_jsx(PaginationItemEllipsis, {
312
349
  ref: ref,
313
350
  ownerState: ownerState,
@@ -320,11 +357,10 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
320
357
  disabled: disabled,
321
358
  className: clsx(classes.root, className)
322
359
  }, other, {
323
- children: [type === 'page' && page, Icon ? /*#__PURE__*/_jsx(PaginationItemPageIcon, {
324
- as: Icon,
325
- ownerState: ownerState,
326
- className: classes.icon
327
- }) : null]
360
+ children: [type === 'page' && page, IconSlot ? /*#__PURE__*/_jsx(PaginationItemPageIcon, _extends({}, iconSlotProps, {
361
+ className: classes.icon,
362
+ as: IconSlot
363
+ })) : null]
328
364
  }));
329
365
  });
330
366
  process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-proptypes */ = {
@@ -363,6 +399,7 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-propt
363
399
  * It's recommended to use the `slots` prop instead.
364
400
  *
365
401
  * @default {}
402
+ * @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
366
403
  */
367
404
  components: PropTypes.shape({
368
405
  first: PropTypes.elementType,
@@ -394,11 +431,18 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-propt
394
431
  * @default 'medium'
395
432
  */
396
433
  size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['small', 'medium', 'large']), PropTypes.string]),
434
+ /**
435
+ * The props used for each slot inside.
436
+ * @default {}
437
+ */
438
+ slotProps: PropTypes.shape({
439
+ first: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
440
+ last: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
441
+ next: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
442
+ previous: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
443
+ }),
397
444
  /**
398
445
  * The components used for each slot inside.
399
- *
400
- * This prop is an alias for the `components` prop, which will be deprecated in the future.
401
- *
402
446
  * @default {}
403
447
  */
404
448
  slots: PropTypes.shape({