@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
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.rootOverridesResolver = exports.inputOverridesResolver = exports.default = exports.InputBaseRoot = exports.InputBaseComponent = void 0;
8
+ exports.rootOverridesResolver = exports.inputOverridesResolver = exports.default = exports.InputBaseRoot = exports.InputBaseInput = void 0;
9
9
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
@@ -20,8 +20,7 @@ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"
20
20
  var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
21
21
  var _FormControlContext = _interopRequireDefault(require("../FormControl/FormControlContext"));
22
22
  var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
23
- var _styled = _interopRequireDefault(require("../styles/styled"));
24
- var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
23
+ var _zeroStyled = require("../zero-styled");
25
24
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
26
25
  var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
27
26
  var _useEnhancedEffect = _interopRequireDefault(require("../utils/useEnhancedEffect"));
@@ -32,6 +31,7 @@ var _jsxRuntime = require("react/jsx-runtime");
32
31
  const _excluded = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "slotProps", "slots", "startAdornment", "type", "value"];
33
32
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
34
33
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
34
+ const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiInputBase');
35
35
  const rootOverridesResolver = (props, styles) => {
36
36
  const {
37
37
  ownerState
@@ -69,13 +69,12 @@ const useUtilityClasses = ownerState => {
69
69
  };
70
70
  return (0, _composeClasses.default)(slots, _inputBaseClasses.getInputBaseUtilityClass, classes);
71
71
  };
72
- const InputBaseRoot = exports.InputBaseRoot = (0, _styled.default)('div', {
72
+ const InputBaseRoot = exports.InputBaseRoot = (0, _zeroStyled.styled)('div', {
73
73
  name: 'MuiInputBase',
74
74
  slot: 'Root',
75
75
  overridesResolver: rootOverridesResolver
76
76
  })(({
77
- theme,
78
- ownerState
77
+ theme
79
78
  }) => (0, _extends2.default)({}, theme.typography.body1, {
80
79
  color: (theme.vars || theme).palette.text.primary,
81
80
  lineHeight: '1.4375em',
@@ -89,21 +88,37 @@ const InputBaseRoot = exports.InputBaseRoot = (0, _styled.default)('div', {
89
88
  [`&.${_inputBaseClasses.default.disabled}`]: {
90
89
  color: (theme.vars || theme).palette.text.disabled,
91
90
  cursor: 'default'
92
- }
93
- }, ownerState.multiline && (0, _extends2.default)({
94
- padding: '4px 0 5px'
95
- }, ownerState.size === 'small' && {
96
- paddingTop: 1
97
- }), ownerState.fullWidth && {
98
- width: '100%'
91
+ },
92
+ variants: [{
93
+ props: ({
94
+ ownerState
95
+ }) => ownerState.multiline,
96
+ style: {
97
+ padding: '4px 0 5px'
98
+ }
99
+ }, {
100
+ props: ({
101
+ ownerState,
102
+ size
103
+ }) => ownerState.multiline && size === 'small',
104
+ style: {
105
+ paddingTop: 1
106
+ }
107
+ }, {
108
+ props: ({
109
+ ownerState
110
+ }) => ownerState.fullWidth,
111
+ style: {
112
+ width: '100%'
113
+ }
114
+ }]
99
115
  }));
100
- const InputBaseComponent = exports.InputBaseComponent = (0, _styled.default)('input', {
116
+ const InputBaseInput = exports.InputBaseInput = (0, _zeroStyled.styled)('input', {
101
117
  name: 'MuiInputBase',
102
118
  slot: 'Input',
103
119
  overridesResolver: inputOverridesResolver
104
120
  })(({
105
- theme,
106
- ownerState
121
+ theme
107
122
  }) => {
108
123
  const light = theme.palette.mode === 'light';
109
124
  const placeholder = (0, _extends2.default)({
@@ -125,7 +140,7 @@ const InputBaseComponent = exports.InputBaseComponent = (0, _styled.default)('in
125
140
  } : {
126
141
  opacity: light ? 0.42 : 0.5
127
142
  };
128
- return (0, _extends2.default)({
143
+ return {
129
144
  font: 'inherit',
130
145
  letterSpacing: 'inherit',
131
146
  color: 'currentColor',
@@ -187,18 +202,33 @@ const InputBaseComponent = exports.InputBaseComponent = (0, _styled.default)('in
187
202
  '&:-webkit-autofill': {
188
203
  animationDuration: '5000s',
189
204
  animationName: 'mui-auto-fill'
190
- }
191
- }, ownerState.size === 'small' && {
192
- paddingTop: 1
193
- }, ownerState.multiline && {
194
- height: 'auto',
195
- resize: 'none',
196
- padding: 0,
197
- paddingTop: 0
198
- }, ownerState.type === 'search' && {
199
- // Improve type search style.
200
- MozAppearance: 'textfield'
201
- });
205
+ },
206
+ variants: [{
207
+ props: {
208
+ size: 'small'
209
+ },
210
+ style: {
211
+ paddingTop: 1
212
+ }
213
+ }, {
214
+ props: ({
215
+ ownerState
216
+ }) => ownerState.multiline,
217
+ style: {
218
+ height: 'auto',
219
+ resize: 'none',
220
+ padding: 0,
221
+ paddingTop: 0
222
+ }
223
+ }, {
224
+ props: {
225
+ type: 'search'
226
+ },
227
+ style: {
228
+ MozAppearance: 'textfield' // Improve type search style.
229
+ }
230
+ }]
231
+ };
202
232
  });
203
233
  const inputGlobalStyles = /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlobalStyles.default, {
204
234
  styles: {
@@ -222,7 +252,7 @@ const inputGlobalStyles = /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlobalStyles.defaul
222
252
  */
223
253
  const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
224
254
  var _slotProps$input;
225
- const props = (0, _useThemeProps.default)({
255
+ const props = useThemeProps({
226
256
  props: inProps,
227
257
  name: 'MuiInputBase'
228
258
  });
@@ -439,7 +469,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
439
469
  const classes = useUtilityClasses(ownerState);
440
470
  const Root = slots.root || components.Root || InputBaseRoot;
441
471
  const rootProps = slotProps.root || componentsProps.root || {};
442
- const Input = slots.input || components.Input || InputBaseComponent;
472
+ const Input = slots.input || components.Input || InputBaseInput;
443
473
  inputProps = (0, _extends2.default)({}, inputProps, (_slotProps$input = slotProps.input) != null ? _slotProps$input : componentsProps.input);
444
474
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
445
475
  children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({}, rootProps, !(0, _utils.isHostComponent)(Root) && {
@@ -15,14 +15,15 @@ var _clsx = _interopRequireDefault(require("clsx"));
15
15
  var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
16
16
  var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
17
17
  var _FormLabel = _interopRequireWildcard(require("../FormLabel"));
18
- var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
19
18
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
20
- var _styled = _interopRequireWildcard(require("../styles/styled"));
19
+ var _rootShouldForwardProp = _interopRequireDefault(require("../styles/rootShouldForwardProp"));
20
+ var _zeroStyled = require("../zero-styled");
21
21
  var _inputLabelClasses = require("./inputLabelClasses");
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
23
  const _excluded = ["disableAnimation", "margin", "shrink", "variant", "className"];
24
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
25
25
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
26
+ const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiInputLabel');
26
27
  const useUtilityClasses = ownerState => {
27
28
  const {
28
29
  classes,
@@ -40,8 +41,8 @@ const useUtilityClasses = ownerState => {
40
41
  const composedClasses = (0, _composeClasses.default)(slots, _inputLabelClasses.getInputLabelUtilityClasses, classes);
41
42
  return (0, _extends2.default)({}, classes, composedClasses);
42
43
  };
43
- const InputLabelRoot = (0, _styled.default)(_FormLabel.default, {
44
- shouldForwardProp: prop => (0, _styled.rootShouldForwardProp)(prop) || prop === 'classes',
44
+ const InputLabelRoot = (0, _zeroStyled.styled)(_FormLabel.default, {
45
+ shouldForwardProp: prop => (0, _rootShouldForwardProp.default)(prop) || prop === 'classes',
45
46
  name: 'MuiInputLabel',
46
47
  slot: 'Root',
47
48
  overridesResolver: (props, styles) => {
@@ -53,69 +54,130 @@ const InputLabelRoot = (0, _styled.default)(_FormLabel.default, {
53
54
  }, styles.root, ownerState.formControl && styles.formControl, ownerState.size === 'small' && styles.sizeSmall, ownerState.shrink && styles.shrink, !ownerState.disableAnimation && styles.animated, ownerState.focused && styles.focused, styles[ownerState.variant]];
54
55
  }
55
56
  })(({
56
- theme,
57
- ownerState
58
- }) => (0, _extends2.default)({
57
+ theme
58
+ }) => ({
59
59
  display: 'block',
60
60
  transformOrigin: 'top left',
61
61
  whiteSpace: 'nowrap',
62
62
  overflow: 'hidden',
63
63
  textOverflow: 'ellipsis',
64
- maxWidth: '100%'
65
- }, ownerState.formControl && {
66
- position: 'absolute',
67
- left: 0,
68
- top: 0,
69
- // slight alteration to spec spacing to match visual spec result
70
- transform: 'translate(0, 20px) scale(1)'
71
- }, ownerState.size === 'small' && {
72
- // Compensation for the `Input.inputSizeSmall` style.
73
- transform: 'translate(0, 17px) scale(1)'
74
- }, ownerState.shrink && {
75
- transform: 'translate(0, -1.5px) scale(0.75)',
76
- transformOrigin: 'top left',
77
- maxWidth: '133%'
78
- }, !ownerState.disableAnimation && {
79
- transition: theme.transitions.create(['color', 'transform', 'max-width'], {
80
- duration: theme.transitions.duration.shorter,
81
- easing: theme.transitions.easing.easeOut
82
- })
83
- }, ownerState.variant === 'filled' && (0, _extends2.default)({
84
- // Chrome's autofill feature gives the input field a yellow background.
85
- // Since the input field is behind the label in the HTML tree,
86
- // the input field is drawn last and hides the label with an opaque background color.
87
- // zIndex: 1 will raise the label above opaque background-colors of input.
88
- zIndex: 1,
89
- pointerEvents: 'none',
90
- transform: 'translate(12px, 16px) scale(1)',
91
- maxWidth: 'calc(100% - 24px)'
92
- }, ownerState.size === 'small' && {
93
- transform: 'translate(12px, 13px) scale(1)'
94
- }, ownerState.shrink && (0, _extends2.default)({
95
- userSelect: 'none',
96
- pointerEvents: 'auto',
97
- transform: 'translate(12px, 7px) scale(0.75)',
98
- maxWidth: 'calc(133% - 24px)'
99
- }, ownerState.size === 'small' && {
100
- transform: 'translate(12px, 4px) scale(0.75)'
101
- })), ownerState.variant === 'outlined' && (0, _extends2.default)({
102
- // see comment above on filled.zIndex
103
- zIndex: 1,
104
- pointerEvents: 'none',
105
- transform: 'translate(14px, 16px) scale(1)',
106
- maxWidth: 'calc(100% - 24px)'
107
- }, ownerState.size === 'small' && {
108
- transform: 'translate(14px, 9px) scale(1)'
109
- }, ownerState.shrink && {
110
- userSelect: 'none',
111
- pointerEvents: 'auto',
112
- // Theoretically, we should have (8+5)*2/0.75 = 34px
113
- // but it feels a better when it bleeds a bit on the left, so 32px.
114
- maxWidth: 'calc(133% - 32px)',
115
- transform: 'translate(14px, -9px) scale(0.75)'
116
- })));
64
+ maxWidth: '100%',
65
+ variants: [{
66
+ props: ({
67
+ ownerState
68
+ }) => ownerState.formControl,
69
+ style: {
70
+ position: 'absolute',
71
+ left: 0,
72
+ top: 0,
73
+ // slight alteration to spec spacing to match visual spec result
74
+ transform: 'translate(0, 20px) scale(1)'
75
+ }
76
+ }, {
77
+ props: {
78
+ size: 'small'
79
+ },
80
+ style: {
81
+ // Compensation for the `Input.inputSizeSmall` style.
82
+ transform: 'translate(0, 17px) scale(1)'
83
+ }
84
+ }, {
85
+ props: ({
86
+ ownerState
87
+ }) => ownerState.shrink,
88
+ style: {
89
+ transform: 'translate(0, -1.5px) scale(0.75)',
90
+ transformOrigin: 'top left',
91
+ maxWidth: '133%'
92
+ }
93
+ }, {
94
+ props: ({
95
+ ownerState
96
+ }) => !ownerState.disableAnimation,
97
+ style: {
98
+ transition: theme.transitions.create(['color', 'transform', 'max-width'], {
99
+ duration: theme.transitions.duration.shorter,
100
+ easing: theme.transitions.easing.easeOut
101
+ })
102
+ }
103
+ }, {
104
+ props: {
105
+ variant: 'filled'
106
+ },
107
+ style: {
108
+ // Chrome's autofill feature gives the input field a yellow background.
109
+ // Since the input field is behind the label in the HTML tree,
110
+ // the input field is drawn last and hides the label with an opaque background color.
111
+ // zIndex: 1 will raise the label above opaque background-colors of input.
112
+ zIndex: 1,
113
+ pointerEvents: 'none',
114
+ transform: 'translate(12px, 16px) scale(1)',
115
+ maxWidth: 'calc(100% - 24px)'
116
+ }
117
+ }, {
118
+ props: {
119
+ variant: 'filled',
120
+ size: 'small'
121
+ },
122
+ style: {
123
+ transform: 'translate(12px, 13px) scale(1)'
124
+ }
125
+ }, {
126
+ props: ({
127
+ variant,
128
+ ownerState
129
+ }) => variant === 'filled' && ownerState.shrink,
130
+ style: {
131
+ userSelect: 'none',
132
+ pointerEvents: 'auto',
133
+ transform: 'translate(12px, 7px) scale(0.75)',
134
+ maxWidth: 'calc(133% - 24px)'
135
+ }
136
+ }, {
137
+ props: ({
138
+ variant,
139
+ ownerState,
140
+ size
141
+ }) => variant === 'filled' && ownerState.shrink && size === 'small',
142
+ style: {
143
+ transform: 'translate(12px, 4px) scale(0.75)'
144
+ }
145
+ }, {
146
+ props: {
147
+ variant: 'outlined'
148
+ },
149
+ style: {
150
+ // see comment above on filled.zIndex
151
+ zIndex: 1,
152
+ pointerEvents: 'none',
153
+ transform: 'translate(14px, 16px) scale(1)',
154
+ maxWidth: 'calc(100% - 24px)'
155
+ }
156
+ }, {
157
+ props: {
158
+ variant: 'outlined',
159
+ size: 'small'
160
+ },
161
+ style: {
162
+ transform: 'translate(14px, 9px) scale(1)'
163
+ }
164
+ }, {
165
+ props: ({
166
+ variant,
167
+ ownerState
168
+ }) => variant === 'outlined' && ownerState.shrink,
169
+ style: {
170
+ userSelect: 'none',
171
+ pointerEvents: 'auto',
172
+ // Theoretically, we should have (8+5)*2/0.75 = 34px
173
+ // but it feels a better when it bleeds a bit on the left, so 32px.
174
+ maxWidth: 'calc(133% - 32px)',
175
+ transform: 'translate(14px, -9px) scale(0.75)'
176
+ }
177
+ }]
178
+ }));
117
179
  const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, ref) {
118
- const props = (0, _useThemeProps.default)({
180
+ const props = useThemeProps({
119
181
  name: 'MuiInputLabel',
120
182
  props: inProps
121
183
  });
package/node/Link/Link.js CHANGED
@@ -6,25 +6,27 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _clsx = _interopRequireDefault(require("clsx"));
14
+ var _colorManipulator = require("@mui/system/colorManipulator");
14
15
  var _elementTypeAcceptingRef = _interopRequireDefault(require("@mui/utils/elementTypeAcceptingRef"));
15
16
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
16
17
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
17
- var _styled = _interopRequireDefault(require("../styles/styled"));
18
- var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
18
+ var _zeroStyled = require("../zero-styled");
19
19
  var _useIsFocusVisible = _interopRequireDefault(require("../utils/useIsFocusVisible"));
20
20
  var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
21
21
  var _Typography = _interopRequireDefault(require("../Typography"));
22
22
  var _linkClasses = _interopRequireWildcard(require("./linkClasses"));
23
23
  var _getTextDecoration = _interopRequireWildcard(require("./getTextDecoration"));
24
+ var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
24
25
  var _jsxRuntime = require("react/jsx-runtime");
25
26
  const _excluded = ["className", "color", "component", "onBlur", "onFocus", "TypographyClasses", "underline", "variant", "sx"];
26
27
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
27
28
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
29
+ const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiLink');
28
30
  const useUtilityClasses = ownerState => {
29
31
  const {
30
32
  classes,
@@ -37,7 +39,7 @@ const useUtilityClasses = ownerState => {
37
39
  };
38
40
  return (0, _composeClasses.default)(slots, _linkClasses.getLinkUtilityClass, classes);
39
41
  };
40
- const LinkRoot = (0, _styled.default)(_Typography.default, {
42
+ const LinkRoot = (0, _zeroStyled.styled)(_Typography.default, {
41
43
  name: 'MuiLink',
42
44
  slot: 'Root',
43
45
  overridesResolver: (props, styles) => {
@@ -47,60 +49,92 @@ const LinkRoot = (0, _styled.default)(_Typography.default, {
47
49
  return [styles.root, styles[`underline${(0, _capitalize.default)(ownerState.underline)}`], ownerState.component === 'button' && styles.button];
48
50
  }
49
51
  })(({
50
- theme,
51
- ownerState
52
+ theme
52
53
  }) => {
53
- return (0, _extends2.default)({}, ownerState.underline === 'none' && {
54
- textDecoration: 'none'
55
- }, ownerState.underline === 'hover' && {
56
- textDecoration: 'none',
57
- '&:hover': {
58
- textDecoration: 'underline'
59
- }
60
- }, ownerState.underline === 'always' && (0, _extends2.default)({
61
- textDecoration: 'underline'
62
- }, ownerState.color !== 'inherit' && {
63
- textDecorationColor: (0, _getTextDecoration.default)({
64
- theme,
65
- ownerState
66
- })
67
- }, {
68
- '&:hover': {
69
- textDecorationColor: 'inherit'
70
- }
71
- }), ownerState.component === 'button' && {
72
- position: 'relative',
73
- WebkitTapHighlightColor: 'transparent',
74
- backgroundColor: 'transparent',
75
- // Reset default value
76
- // We disable the focus ring for mouse, touch and keyboard users.
77
- outline: 0,
78
- border: 0,
79
- margin: 0,
80
- // Remove the margin in Safari
81
- borderRadius: 0,
82
- padding: 0,
83
- // Remove the padding in Firefox
84
- cursor: 'pointer',
85
- userSelect: 'none',
86
- verticalAlign: 'middle',
87
- MozAppearance: 'none',
88
- // Reset
89
- WebkitAppearance: 'none',
90
- // Reset
91
- '&::-moz-focus-inner': {
92
- borderStyle: 'none' // Remove Firefox dotted outline.
93
- },
94
- [`&.${_linkClasses.default.focusVisible}`]: {
95
- outline: 'auto'
96
- }
97
- });
54
+ return {
55
+ variants: [{
56
+ props: {
57
+ underline: 'none'
58
+ },
59
+ style: {
60
+ textDecoration: 'none'
61
+ }
62
+ }, {
63
+ props: {
64
+ underline: 'hover'
65
+ },
66
+ style: {
67
+ textDecoration: 'none',
68
+ '&:hover': {
69
+ textDecoration: 'underline'
70
+ }
71
+ }
72
+ }, {
73
+ props: {
74
+ underline: 'always'
75
+ },
76
+ style: {
77
+ textDecoration: 'underline',
78
+ '&:hover': {
79
+ textDecorationColor: 'inherit'
80
+ }
81
+ }
82
+ }, {
83
+ props: ({
84
+ underline,
85
+ ownerState
86
+ }) => underline === 'always' && ownerState.color !== 'inherit',
87
+ style: {
88
+ textDecorationColor: 'var(--Link-underlineColor)'
89
+ }
90
+ }, ...Object.entries(theme.palette).filter(([, value]) => value.main).map(([color]) => ({
91
+ props: {
92
+ underline: 'always',
93
+ color
94
+ },
95
+ style: {
96
+ '--Link-underlineColor': theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / 0.4)` : (0, _colorManipulator.alpha)(theme.palette[color].main, 0.4)
97
+ }
98
+ })), {
99
+ props: {
100
+ component: 'button'
101
+ },
102
+ style: {
103
+ position: 'relative',
104
+ WebkitTapHighlightColor: 'transparent',
105
+ backgroundColor: 'transparent',
106
+ // Reset default value
107
+ // We disable the focus ring for mouse, touch and keyboard users.
108
+ outline: 0,
109
+ border: 0,
110
+ margin: 0,
111
+ // Remove the margin in Safari
112
+ borderRadius: 0,
113
+ padding: 0,
114
+ // Remove the padding in Firefox
115
+ cursor: 'pointer',
116
+ userSelect: 'none',
117
+ verticalAlign: 'middle',
118
+ MozAppearance: 'none',
119
+ // Reset
120
+ WebkitAppearance: 'none',
121
+ // Reset
122
+ '&::-moz-focus-inner': {
123
+ borderStyle: 'none' // Remove Firefox dotted outline.
124
+ },
125
+ [`&.${_linkClasses.default.focusVisible}`]: {
126
+ outline: 'auto'
127
+ }
128
+ }
129
+ }]
130
+ };
98
131
  });
99
132
  const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
100
- const props = (0, _useThemeProps.default)({
133
+ const props = useThemeProps({
101
134
  props: inProps,
102
135
  name: 'MuiLink'
103
136
  });
137
+ const theme = (0, _useTheme.default)();
104
138
  const {
105
139
  className,
106
140
  color = 'primary',
@@ -156,11 +190,18 @@ const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
156
190
  onFocus: handleFocus,
157
191
  ref: handlerRef,
158
192
  ownerState: ownerState,
159
- variant: variant,
160
- sx: [...(!Object.keys(_getTextDecoration.colorTransformations).includes(color) ? [{
193
+ variant: variant
194
+ }, other, {
195
+ sx: [...(_getTextDecoration.colorTransformations[color] === undefined ? [{
161
196
  color
162
- }] : []), ...(Array.isArray(sx) ? sx : [sx])]
163
- }, other));
197
+ }] : []), ...(Array.isArray(sx) ? sx : [sx])],
198
+ style: (0, _extends2.default)({}, other.style, underline === 'always' && color !== 'inherit' && {
199
+ '--Link-underlineColor': (0, _getTextDecoration.default)({
200
+ theme,
201
+ ownerState
202
+ })
203
+ })
204
+ }));
164
205
  });
165
206
  process.env.NODE_ENV !== "production" ? Link.propTypes /* remove-proptypes */ = {
166
207
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -197,6 +238,10 @@ process.env.NODE_ENV !== "production" ? Link.propTypes /* remove-proptypes */ =
197
238
  * @ignore
198
239
  */
199
240
  onFocus: _propTypes.default.func,
241
+ /**
242
+ * @ignore
243
+ */
244
+ style: _propTypes.default.object,
200
245
  /**
201
246
  * The system prop that allows defining system overrides as well as additional CSS styles.
202
247
  */
@@ -4,25 +4,33 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.colorTransformations = void 0;
7
- var _system = require("@mui/system");
7
+ var _style = require("@mui/system/style");
8
8
  var _colorManipulator = require("@mui/system/colorManipulator");
9
+ // TODO v7: remove this transformation
9
10
  const colorTransformations = exports.colorTransformations = {
10
- primary: 'primary.main',
11
11
  textPrimary: 'text.primary',
12
- secondary: 'secondary.main',
13
12
  textSecondary: 'text.secondary',
14
- error: 'error.main'
15
- };
16
- const transformDeprecatedColors = color => {
17
- return colorTransformations[color] || color;
13
+ // For main palette, the color will be applied by the styles above.
14
+ primary: null,
15
+ secondary: null,
16
+ error: null,
17
+ info: null,
18
+ success: null,
19
+ warning: null
18
20
  };
19
21
  const getTextDecoration = ({
20
22
  theme,
21
23
  ownerState
22
24
  }) => {
23
- const transformedColor = transformDeprecatedColors(ownerState.color);
24
- const color = (0, _system.getPath)(theme, `palette.${transformedColor}`, false) || ownerState.color;
25
- const channelColor = (0, _system.getPath)(theme, `palette.${transformedColor}Channel`);
25
+ let transformedColor = colorTransformations[ownerState.color];
26
+ if (transformedColor === null) {
27
+ return null;
28
+ }
29
+ if (transformedColor === undefined) {
30
+ transformedColor = ownerState.color;
31
+ }
32
+ const color = (0, _style.getPath)(theme, `palette.${transformedColor}`, false) || ownerState.color;
33
+ const channelColor = (0, _style.getPath)(theme, `palette.${transformedColor}Channel`);
26
34
  if ('vars' in theme && channelColor) {
27
35
  return `rgba(${channelColor} / 0.4)`;
28
36
  }