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

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.
@@ -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. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
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({
@@ -8,10 +8,10 @@ import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import capitalize from '../utils/capitalize';
11
- import useThemeProps from '../styles/useThemeProps';
12
- import styled from '../styles/styled';
11
+ import { styled, createUseThemeProps } from '../zero-styled';
13
12
  import { getSvgIconUtilityClass } from './svgIconClasses';
14
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ const useThemeProps = createUseThemeProps('MuiSvgIcon');
15
15
  const useUtilityClasses = ownerState => {
16
16
  const {
17
17
  color,
@@ -33,32 +33,82 @@ const SvgIconRoot = styled('svg', {
33
33
  return [styles.root, ownerState.color !== 'inherit' && styles[`color${capitalize(ownerState.color)}`], styles[`fontSize${capitalize(ownerState.fontSize)}`]];
34
34
  }
35
35
  })(({
36
- theme,
37
- ownerState
36
+ theme
38
37
  }) => ({
39
38
  userSelect: 'none',
40
39
  width: '1em',
41
40
  height: '1em',
42
41
  display: 'inline-block',
43
- // the <svg> will define the property that has `currentColor`
44
- // for example heroicons uses fill="none" and stroke="currentColor"
45
- fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',
46
42
  flexShrink: 0,
47
43
  transition: theme.transitions?.create?.('fill', {
48
- duration: theme.transitions?.duration?.shorter
44
+ duration: (theme.vars ?? theme).transitions?.duration?.shorter
49
45
  }),
50
- fontSize: {
51
- inherit: 'inherit',
52
- small: theme.typography?.pxToRem?.(20) || '1.25rem',
53
- medium: theme.typography?.pxToRem?.(24) || '1.5rem',
54
- large: theme.typography?.pxToRem?.(35) || '2.1875rem'
55
- }[ownerState.fontSize],
56
- // TODO v5 deprecate, v6 remove for sx
57
- color: (theme.vars || theme).palette?.[ownerState.color]?.main ?? {
58
- action: (theme.vars || theme).palette?.action?.active,
59
- disabled: (theme.vars || theme).palette?.action?.disabled,
60
- inherit: undefined
61
- }[ownerState.color]
46
+ variants: [{
47
+ props: props => !props.hasSvgAsChild,
48
+ style: {
49
+ // the <svg> will define the property that has `currentColor`
50
+ // for example heroicons uses fill="none" and stroke="currentColor"
51
+ fill: 'currentColor'
52
+ }
53
+ }, {
54
+ props: {
55
+ fontSize: 'inherit'
56
+ },
57
+ style: {
58
+ fontSize: 'inherit'
59
+ }
60
+ }, {
61
+ props: {
62
+ fontSize: 'small'
63
+ },
64
+ style: {
65
+ fontSize: theme.typography?.pxToRem?.(20) || '1.25rem'
66
+ }
67
+ }, {
68
+ props: {
69
+ fontSize: 'medium'
70
+ },
71
+ style: {
72
+ fontSize: theme.typography?.pxToRem?.(24) || '1.5rem'
73
+ }
74
+ }, {
75
+ props: {
76
+ fontSize: 'large'
77
+ },
78
+ style: {
79
+ fontSize: theme.typography?.pxToRem?.(35) || '2.1875rem'
80
+ }
81
+ },
82
+ // TODO v5 deprecate color prop, v6 remove for sx
83
+ ...Object.entries((theme.vars ?? theme).palette).filter(([, value]) => value.main).map(([color]) => ({
84
+ props: {
85
+ color
86
+ },
87
+ style: {
88
+ color: (theme.vars ?? theme).palette?.[color]?.main
89
+ }
90
+ })), {
91
+ props: {
92
+ color: 'action'
93
+ },
94
+ style: {
95
+ color: (theme.vars ?? theme).palette?.action?.active
96
+ }
97
+ }, {
98
+ props: {
99
+ color: 'disabled'
100
+ },
101
+ style: {
102
+ color: (theme.vars ?? theme).palette?.action?.disabled
103
+ }
104
+ }, {
105
+ props: {
106
+ color: 'inherit'
107
+ },
108
+ style: {
109
+ color: undefined
110
+ }
111
+ }]
62
112
  }));
63
113
  const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
64
114
  const props = useThemeProps({
@@ -179,5 +229,7 @@ process.env.NODE_ENV !== "production" ? SvgIcon.propTypes /* remove-proptypes */
179
229
  */
180
230
  viewBox: PropTypes.string
181
231
  } : void 0;
182
- SvgIcon.muiName = 'SvgIcon';
232
+ if (SvgIcon) {
233
+ SvgIcon.muiName = 'SvgIcon';
234
+ }
183
235
  export default SvgIcon;
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.0-alpha.4
2
+ * @mui/material v6.0.0-alpha.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -20,8 +20,9 @@ var _Typography = _interopRequireDefault(require("../Typography"));
20
20
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
21
21
  var _formControlLabelClasses = _interopRequireWildcard(require("./formControlLabelClasses"));
22
22
  var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
23
+ var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
23
24
  var _jsxRuntime = require("react/jsx-runtime");
24
- const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slotProps", "value"];
25
+ const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slots", "slotProps", "value"];
25
26
  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); }
26
27
  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; }
27
28
  const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiFormControlLabel');
@@ -119,7 +120,7 @@ const AsteriskComponent = (0, _zeroStyled.styled)('span', {
119
120
  * Use this component if you want to display an extra label.
120
121
  */
121
122
  const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel(inProps, ref) {
122
- var _ref, _slotProps$typography;
123
+ var _ref;
123
124
  const props = useThemeProps({
124
125
  props: inProps,
125
126
  name: 'MuiFormControlLabel'
@@ -133,6 +134,7 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
133
134
  label: labelProp,
134
135
  labelPlacement = 'end',
135
136
  required: requiredProp,
137
+ slots = {},
136
138
  slotProps = {}
137
139
  } = props,
138
140
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
@@ -160,10 +162,18 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
160
162
  error: fcs.error
161
163
  });
162
164
  const classes = useUtilityClasses(ownerState);
163
- const typographySlotProps = (_slotProps$typography = slotProps.typography) != null ? _slotProps$typography : componentsProps.typography;
165
+ const externalForwardedProps = {
166
+ slots,
167
+ slotProps: (0, _extends2.default)({}, componentsProps, slotProps)
168
+ };
169
+ const [TypographySlot, typographySlotProps] = (0, _useSlot.default)('typography', {
170
+ elementType: _Typography.default,
171
+ externalForwardedProps,
172
+ ownerState
173
+ });
164
174
  let label = labelProp;
165
175
  if (label != null && label.type !== _Typography.default && !disableTypography) {
166
- label = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, (0, _extends2.default)({
176
+ label = /*#__PURE__*/(0, _jsxRuntime.jsx)(TypographySlot, (0, _extends2.default)({
167
177
  component: "span"
168
178
  }, typographySlotProps, {
169
179
  className: (0, _clsx.default)(classes.label, typographySlotProps == null ? void 0 : typographySlotProps.className),
@@ -206,6 +216,7 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
206
216
  /**
207
217
  * The props used for each slot inside.
208
218
  * @default {}
219
+ * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
209
220
  */
210
221
  componentsProps: _propTypes.default.shape({
211
222
  typography: _propTypes.default.object
@@ -255,7 +266,14 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
255
266
  * @default {}
256
267
  */
257
268
  slotProps: _propTypes.default.shape({
258
- typography: _propTypes.default.object
269
+ typography: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
270
+ }),
271
+ /**
272
+ * The components used for each slot inside.
273
+ * @default {}
274
+ */
275
+ slots: _propTypes.default.shape({
276
+ typography: _propTypes.default.elementType
259
277
  }),
260
278
  /**
261
279
  * The system prop that allows defining system overrides as well as additional CSS styles.
@@ -21,9 +21,10 @@ var _FirstPage = _interopRequireDefault(require("../internal/svg-icons/FirstPage
21
21
  var _LastPage = _interopRequireDefault(require("../internal/svg-icons/LastPage"));
22
22
  var _NavigateBefore = _interopRequireDefault(require("../internal/svg-icons/NavigateBefore"));
23
23
  var _NavigateNext = _interopRequireDefault(require("../internal/svg-icons/NavigateNext"));
24
+ var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
24
25
  var _zeroStyled = require("../zero-styled");
25
26
  var _jsxRuntime = require("react/jsx-runtime");
26
- const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "type", "variant"];
27
+ const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "slotProps", "type", "variant"];
27
28
  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); }
28
29
  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
30
  const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiPaginationItem');
@@ -274,6 +275,7 @@ const PaginationItemPageIcon = (0, _zeroStyled.styled)('div', {
274
275
  }]
275
276
  }));
276
277
  const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inProps, ref) {
278
+ var _slots$previous, _slots$next, _slots$first, _slots$last;
277
279
  const props = useThemeProps({
278
280
  props: inProps,
279
281
  name: 'MuiPaginationItem'
@@ -289,6 +291,7 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
289
291
  shape = 'circular',
290
292
  size = 'medium',
291
293
  slots = {},
294
+ slotProps = {},
292
295
  type = 'page',
293
296
  variant = 'text'
294
297
  } = props,
@@ -304,18 +307,53 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
304
307
  });
305
308
  const isRtl = (0, _RtlProvider.useRtl)();
306
309
  const classes = useUtilityClasses(ownerState);
307
- const normalizedIcons = isRtl ? {
308
- previous: slots.next || components.next || _NavigateNext.default,
309
- next: slots.previous || components.previous || _NavigateBefore.default,
310
- last: slots.first || components.first || _FirstPage.default,
311
- first: slots.last || components.last || _LastPage.default
312
- } : {
313
- previous: slots.previous || components.previous || _NavigateBefore.default,
314
- next: slots.next || components.next || _NavigateNext.default,
315
- first: slots.first || components.first || _FirstPage.default,
316
- last: slots.last || components.last || _LastPage.default
310
+ const externalForwardedProps = {
311
+ slots: {
312
+ previous: (_slots$previous = slots.previous) != null ? _slots$previous : components.previous,
313
+ next: (_slots$next = slots.next) != null ? _slots$next : components.next,
314
+ first: (_slots$first = slots.first) != null ? _slots$first : components.first,
315
+ last: (_slots$last = slots.last) != null ? _slots$last : components.last
316
+ },
317
+ slotProps
317
318
  };
318
- const Icon = normalizedIcons[type];
319
+ const [PreviousSlot, previousSlotProps] = (0, _useSlot.default)('previous', {
320
+ elementType: _NavigateBefore.default,
321
+ externalForwardedProps,
322
+ ownerState
323
+ });
324
+ const [NextSlot, nextSlotProps] = (0, _useSlot.default)('next', {
325
+ elementType: _NavigateNext.default,
326
+ externalForwardedProps,
327
+ ownerState
328
+ });
329
+ const [FirstSlot, firstSlotProps] = (0, _useSlot.default)('first', {
330
+ elementType: _FirstPage.default,
331
+ externalForwardedProps,
332
+ ownerState
333
+ });
334
+ const [LastSlot, lastSlotProps] = (0, _useSlot.default)('last', {
335
+ elementType: _LastPage.default,
336
+ externalForwardedProps,
337
+ ownerState
338
+ });
339
+ const rtlAwareType = isRtl ? {
340
+ previous: 'next',
341
+ next: 'previous',
342
+ first: 'last',
343
+ last: 'first'
344
+ }[type] : type;
345
+ const IconSlot = {
346
+ previous: PreviousSlot,
347
+ next: NextSlot,
348
+ first: FirstSlot,
349
+ last: LastSlot
350
+ }[rtlAwareType];
351
+ const iconSlotProps = {
352
+ previous: previousSlotProps,
353
+ next: nextSlotProps,
354
+ first: firstSlotProps,
355
+ last: lastSlotProps
356
+ }[rtlAwareType];
319
357
  return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PaginationItemEllipsis, {
320
358
  ref: ref,
321
359
  ownerState: ownerState,
@@ -328,11 +366,10 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
328
366
  disabled: disabled,
329
367
  className: (0, _clsx.default)(classes.root, className)
330
368
  }, other, {
331
- children: [type === 'page' && page, Icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PaginationItemPageIcon, {
332
- as: Icon,
333
- ownerState: ownerState,
334
- className: classes.icon
335
- }) : null]
369
+ children: [type === 'page' && page, IconSlot ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PaginationItemPageIcon, (0, _extends2.default)({}, iconSlotProps, {
370
+ className: classes.icon,
371
+ as: IconSlot
372
+ })) : null]
336
373
  }));
337
374
  });
338
375
  process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-proptypes */ = {
@@ -371,6 +408,7 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-propt
371
408
  * It's recommended to use the `slots` prop instead.
372
409
  *
373
410
  * @default {}
411
+ * @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
374
412
  */
375
413
  components: _propTypes.default.shape({
376
414
  first: _propTypes.default.elementType,
@@ -402,11 +440,18 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-propt
402
440
  * @default 'medium'
403
441
  */
404
442
  size: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['small', 'medium', 'large']), _propTypes.default.string]),
443
+ /**
444
+ * The props used for each slot inside.
445
+ * @default {}
446
+ */
447
+ slotProps: _propTypes.default.shape({
448
+ first: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
449
+ last: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
450
+ next: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
451
+ previous: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
452
+ }),
405
453
  /**
406
454
  * The components used for each slot inside.
407
- *
408
- * This prop is an alias for the `components` prop, which will be deprecated in the future.
409
- *
410
455
  * @default {}
411
456
  */
412
457
  slots: _propTypes.default.shape({
@@ -13,13 +13,13 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _clsx = _interopRequireDefault(require("clsx"));
14
14
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
15
15
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
16
- var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
17
- var _styled = _interopRequireDefault(require("../styles/styled"));
16
+ var _zeroStyled = require("../zero-styled");
18
17
  var _svgIconClasses = require("./svgIconClasses");
19
18
  var _jsxRuntime = require("react/jsx-runtime");
20
19
  const _excluded = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
21
20
  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); }
22
21
  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; }
22
+ const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiSvgIcon');
23
23
  const useUtilityClasses = ownerState => {
24
24
  const {
25
25
  color,
@@ -31,7 +31,7 @@ const useUtilityClasses = ownerState => {
31
31
  };
32
32
  return (0, _composeClasses.default)(slots, _svgIconClasses.getSvgIconUtilityClass, classes);
33
33
  };
34
- const SvgIconRoot = (0, _styled.default)('svg', {
34
+ const SvgIconRoot = (0, _zeroStyled.styled)('svg', {
35
35
  name: 'MuiSvgIcon',
36
36
  slot: 'Root',
37
37
  overridesResolver: (props, styles) => {
@@ -41,38 +41,91 @@ const SvgIconRoot = (0, _styled.default)('svg', {
41
41
  return [styles.root, ownerState.color !== 'inherit' && styles[`color${(0, _capitalize.default)(ownerState.color)}`], styles[`fontSize${(0, _capitalize.default)(ownerState.fontSize)}`]];
42
42
  }
43
43
  })(({
44
- theme,
45
- ownerState
44
+ theme
46
45
  }) => {
47
- var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette2, _palette3;
46
+ var _theme$transitions, _theme$transitions$cr, _transitions, _theme$vars, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _theme$vars2, _palette2, _theme$vars4, _palette3, _theme$vars5;
48
47
  return {
49
48
  userSelect: 'none',
50
49
  width: '1em',
51
50
  height: '1em',
52
51
  display: 'inline-block',
53
- // the <svg> will define the property that has `currentColor`
54
- // for example heroicons uses fill="none" and stroke="currentColor"
55
- fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',
56
52
  flexShrink: 0,
57
53
  transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
58
- duration: (_theme$transitions2 = theme.transitions) == null || (_theme$transitions2 = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2.shorter
54
+ duration: (_transitions = ((_theme$vars = theme.vars) != null ? _theme$vars : theme).transitions) == null || (_transitions = _transitions.duration) == null ? void 0 : _transitions.shorter
59
55
  }),
60
- fontSize: {
61
- inherit: 'inherit',
62
- small: ((_theme$typography = theme.typography) == null || (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',
63
- medium: ((_theme$typography2 = theme.typography) == null || (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',
64
- large: ((_theme$typography3 = theme.typography) == null || (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'
65
- }[ownerState.fontSize],
66
- // TODO v5 deprecate, v6 remove for sx
67
- color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null || (_palette = _palette[ownerState.color]) == null ? void 0 : _palette.main) != null ? _palette$ownerState$c : {
68
- action: (_palette2 = (theme.vars || theme).palette) == null || (_palette2 = _palette2.action) == null ? void 0 : _palette2.active,
69
- disabled: (_palette3 = (theme.vars || theme).palette) == null || (_palette3 = _palette3.action) == null ? void 0 : _palette3.disabled,
70
- inherit: undefined
71
- }[ownerState.color]
56
+ variants: [{
57
+ props: props => !props.hasSvgAsChild,
58
+ style: {
59
+ // the <svg> will define the property that has `currentColor`
60
+ // for example heroicons uses fill="none" and stroke="currentColor"
61
+ fill: 'currentColor'
62
+ }
63
+ }, {
64
+ props: {
65
+ fontSize: 'inherit'
66
+ },
67
+ style: {
68
+ fontSize: 'inherit'
69
+ }
70
+ }, {
71
+ props: {
72
+ fontSize: 'small'
73
+ },
74
+ style: {
75
+ fontSize: ((_theme$typography = theme.typography) == null || (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem'
76
+ }
77
+ }, {
78
+ props: {
79
+ fontSize: 'medium'
80
+ },
81
+ style: {
82
+ fontSize: ((_theme$typography2 = theme.typography) == null || (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem'
83
+ }
84
+ }, {
85
+ props: {
86
+ fontSize: 'large'
87
+ },
88
+ style: {
89
+ fontSize: ((_theme$typography3 = theme.typography) == null || (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'
90
+ }
91
+ },
92
+ // TODO v5 deprecate color prop, v6 remove for sx
93
+ ...Object.entries(((_theme$vars2 = theme.vars) != null ? _theme$vars2 : theme).palette).filter(([, value]) => value.main).map(([color]) => {
94
+ var _palette, _theme$vars3;
95
+ return {
96
+ props: {
97
+ color
98
+ },
99
+ style: {
100
+ color: (_palette = ((_theme$vars3 = theme.vars) != null ? _theme$vars3 : theme).palette) == null || (_palette = _palette[color]) == null ? void 0 : _palette.main
101
+ }
102
+ };
103
+ }), {
104
+ props: {
105
+ color: 'action'
106
+ },
107
+ style: {
108
+ color: (_palette2 = ((_theme$vars4 = theme.vars) != null ? _theme$vars4 : theme).palette) == null || (_palette2 = _palette2.action) == null ? void 0 : _palette2.active
109
+ }
110
+ }, {
111
+ props: {
112
+ color: 'disabled'
113
+ },
114
+ style: {
115
+ color: (_palette3 = ((_theme$vars5 = theme.vars) != null ? _theme$vars5 : theme).palette) == null || (_palette3 = _palette3.action) == null ? void 0 : _palette3.disabled
116
+ }
117
+ }, {
118
+ props: {
119
+ color: 'inherit'
120
+ },
121
+ style: {
122
+ color: undefined
123
+ }
124
+ }]
72
125
  };
73
126
  });
74
127
  const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
75
- const props = (0, _useThemeProps.default)({
128
+ const props = useThemeProps({
76
129
  props: inProps,
77
130
  name: 'MuiSvgIcon'
78
131
  });
@@ -190,5 +243,7 @@ process.env.NODE_ENV !== "production" ? SvgIcon.propTypes /* remove-proptypes */
190
243
  */
191
244
  viewBox: _propTypes.default.string
192
245
  } : void 0;
193
- SvgIcon.muiName = 'SvgIcon';
246
+ if (SvgIcon) {
247
+ SvgIcon.muiName = 'SvgIcon';
248
+ }
194
249
  var _default = exports.default = SvgIcon;
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.0-alpha.4
2
+ * @mui/material v6.0.0-alpha.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "6.0.0-alpha.4",
3
+ "version": "6.0.0-alpha.5",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
@@ -29,16 +29,16 @@
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.24.4",
31
31
  "@types/react-transition-group": "^4.4.10",
32
- "clsx": "^2.1.0",
32
+ "clsx": "^2.1.1",
33
33
  "csstype": "^3.1.3",
34
34
  "prop-types": "^15.8.1",
35
35
  "react-is": "^18.2.0",
36
36
  "react-transition-group": "^4.4.5",
37
+ "@mui/core-downloads-tracker": "^6.0.0-alpha.5",
37
38
  "@mui/types": "^7.2.14",
38
- "@mui/system": "^6.0.0-alpha.4",
39
- "@mui/core-downloads-tracker": "^6.0.0-alpha.4",
40
- "@mui/utils": "^6.0.0-alpha.3",
41
- "@mui/base": "5.0.0-beta.42"
39
+ "@mui/utils": "^6.0.0-alpha.5",
40
+ "@mui/system": "^6.0.0-alpha.5",
41
+ "@mui/base": "5.0.0-beta.43"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@emotion/react": "^11.5.0",