@mui/material 6.4.11 → 6.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Badge/Badge.d.ts +32 -28
- package/Badge/Badge.js +27 -20
- package/BottomNavigationAction/BottomNavigationAction.d.ts +40 -3
- package/BottomNavigationAction/BottomNavigationAction.js +53 -9
- package/CHANGELOG.md +37 -0
- package/CardActionArea/CardActionArea.d.ts +40 -3
- package/CardActionArea/CardActionArea.js +47 -8
- package/Menu/Menu.d.ts +1 -1
- package/OutlinedInput/OutlinedInput.d.ts +29 -2
- package/OutlinedInput/OutlinedInput.js +30 -10
- package/index.js +1 -1
- package/modern/Badge/Badge.js +27 -20
- package/modern/BottomNavigationAction/BottomNavigationAction.js +53 -9
- package/modern/CardActionArea/CardActionArea.js +47 -8
- package/modern/OutlinedInput/OutlinedInput.js +30 -10
- package/modern/index.js +1 -1
- package/modern/styles/ThemeProvider.js +17 -17
- package/modern/version/index.js +2 -2
- package/node/Badge/Badge.js +27 -20
- package/node/BottomNavigationAction/BottomNavigationAction.js +53 -9
- package/node/CardActionArea/CardActionArea.js +47 -8
- package/node/OutlinedInput/OutlinedInput.js +30 -10
- package/node/index.js +1 -1
- package/node/styles/ThemeProvider.js +17 -17
- package/node/version/index.js +2 -2
- package/package.json +4 -4
- package/styles/ThemeProvider.js +17 -17
- package/version/index.js +2 -2
package/modern/Badge/Badge.js
CHANGED
|
@@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import usePreviousProps from '@mui/utils/usePreviousProps';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
|
-
import useSlotProps from '@mui/utils/useSlotProps';
|
|
9
8
|
import useBadge from "./useBadge.js";
|
|
10
9
|
import { styled } from "../zero-styled/index.js";
|
|
11
10
|
import memoTheme from "../utils/memoTheme.js";
|
|
@@ -13,6 +12,7 @@ import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFil
|
|
|
13
12
|
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
14
13
|
import capitalize from "../utils/capitalize.js";
|
|
15
14
|
import badgeClasses, { getBadgeUtilityClass } from "./badgeClasses.js";
|
|
15
|
+
import useSlot from "../utils/useSlot.js";
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
const RADIUS_STANDARD = 10;
|
|
18
18
|
const RADIUS_DOT = 4;
|
|
@@ -282,26 +282,34 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
282
282
|
const classes = useUtilityClasses(ownerState);
|
|
283
283
|
|
|
284
284
|
// support both `slots` and `components` for backward compatibility
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
285
|
+
const externalForwardedProps = {
|
|
286
|
+
slots: {
|
|
287
|
+
root: slots?.root ?? components.Root,
|
|
288
|
+
badge: slots?.badge ?? components.Badge
|
|
289
|
+
},
|
|
290
|
+
slotProps: {
|
|
291
|
+
root: slotProps?.root ?? componentsProps.root,
|
|
292
|
+
badge: slotProps?.badge ?? componentsProps.badge
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
const [RootSlot, rootProps] = useSlot('root', {
|
|
296
|
+
elementType: BadgeRoot,
|
|
297
|
+
externalForwardedProps: {
|
|
298
|
+
...externalForwardedProps,
|
|
299
|
+
...other
|
|
296
300
|
},
|
|
297
301
|
ownerState,
|
|
298
|
-
className: clsx(
|
|
302
|
+
className: clsx(classes.root, className),
|
|
303
|
+
ref,
|
|
304
|
+
additionalProps: {
|
|
305
|
+
as: component
|
|
306
|
+
}
|
|
299
307
|
});
|
|
300
|
-
const badgeProps =
|
|
301
|
-
elementType:
|
|
302
|
-
|
|
308
|
+
const [BadgeSlot, badgeProps] = useSlot('badge', {
|
|
309
|
+
elementType: BadgeBadge,
|
|
310
|
+
externalForwardedProps,
|
|
303
311
|
ownerState,
|
|
304
|
-
className:
|
|
312
|
+
className: classes.badge
|
|
305
313
|
});
|
|
306
314
|
return /*#__PURE__*/_jsxs(RootSlot, {
|
|
307
315
|
...rootProps,
|
|
@@ -399,7 +407,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
|
|
|
399
407
|
*/
|
|
400
408
|
showZero: PropTypes.bool,
|
|
401
409
|
/**
|
|
402
|
-
* The props used for each slot inside
|
|
410
|
+
* The props used for each slot inside.
|
|
403
411
|
* @default {}
|
|
404
412
|
*/
|
|
405
413
|
slotProps: PropTypes.shape({
|
|
@@ -407,8 +415,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
|
|
|
407
415
|
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
408
416
|
}),
|
|
409
417
|
/**
|
|
410
|
-
* The components used for each slot inside
|
|
411
|
-
* Either a string to use a HTML element or a component.
|
|
418
|
+
* The components used for each slot inside.
|
|
412
419
|
* @default {}
|
|
413
420
|
*/
|
|
414
421
|
slots: PropTypes.shape({
|
|
@@ -10,6 +10,7 @@ import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
|
10
10
|
import ButtonBase from "../ButtonBase/index.js";
|
|
11
11
|
import unsupportedProp from "../utils/unsupportedProp.js";
|
|
12
12
|
import bottomNavigationActionClasses, { getBottomNavigationActionUtilityClass } from "./bottomNavigationActionClasses.js";
|
|
13
|
+
import useSlot from "../utils/useSlot.js";
|
|
13
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
15
|
const useUtilityClasses = ownerState => {
|
|
15
16
|
const {
|
|
@@ -107,6 +108,8 @@ const BottomNavigationAction = /*#__PURE__*/React.forwardRef(function BottomNavi
|
|
|
107
108
|
selected,
|
|
108
109
|
showLabel,
|
|
109
110
|
value,
|
|
111
|
+
slots = {},
|
|
112
|
+
slotProps = {},
|
|
110
113
|
...other
|
|
111
114
|
} = props;
|
|
112
115
|
const ownerState = props;
|
|
@@ -119,16 +122,41 @@ const BottomNavigationAction = /*#__PURE__*/React.forwardRef(function BottomNavi
|
|
|
119
122
|
onClick(event);
|
|
120
123
|
}
|
|
121
124
|
};
|
|
122
|
-
|
|
123
|
-
|
|
125
|
+
const externalForwardedProps = {
|
|
126
|
+
slots,
|
|
127
|
+
slotProps
|
|
128
|
+
};
|
|
129
|
+
const [RootSlot, rootProps] = useSlot('root', {
|
|
130
|
+
elementType: BottomNavigationActionRoot,
|
|
131
|
+
externalForwardedProps: {
|
|
132
|
+
...externalForwardedProps,
|
|
133
|
+
...other
|
|
134
|
+
},
|
|
135
|
+
shouldForwardComponentProp: true,
|
|
136
|
+
ownerState,
|
|
137
|
+
ref,
|
|
124
138
|
className: clsx(classes.root, className),
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
139
|
+
additionalProps: {
|
|
140
|
+
focusRipple: true
|
|
141
|
+
},
|
|
142
|
+
getSlotProps: handlers => ({
|
|
143
|
+
...handlers,
|
|
144
|
+
onClick: event => {
|
|
145
|
+
handlers.onClick?.(event);
|
|
146
|
+
handleChange(event);
|
|
147
|
+
}
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
const [LabelSlot, labelProps] = useSlot('label', {
|
|
151
|
+
elementType: BottomNavigationActionLabel,
|
|
152
|
+
externalForwardedProps,
|
|
153
|
+
ownerState,
|
|
154
|
+
className: classes.label
|
|
155
|
+
});
|
|
156
|
+
return /*#__PURE__*/_jsxs(RootSlot, {
|
|
157
|
+
...rootProps,
|
|
158
|
+
children: [icon, /*#__PURE__*/_jsx(LabelSlot, {
|
|
159
|
+
...labelProps,
|
|
132
160
|
children: label
|
|
133
161
|
})]
|
|
134
162
|
});
|
|
@@ -175,6 +203,22 @@ process.env.NODE_ENV !== "production" ? BottomNavigationAction.propTypes /* remo
|
|
|
175
203
|
* The prop defaults to the value (`false`) inherited from the parent BottomNavigation component.
|
|
176
204
|
*/
|
|
177
205
|
showLabel: PropTypes.bool,
|
|
206
|
+
/**
|
|
207
|
+
* The props used for each slot inside.
|
|
208
|
+
* @default {}
|
|
209
|
+
*/
|
|
210
|
+
slotProps: PropTypes.shape({
|
|
211
|
+
label: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
212
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
213
|
+
}),
|
|
214
|
+
/**
|
|
215
|
+
* The components used for each slot inside.
|
|
216
|
+
* @default {}
|
|
217
|
+
*/
|
|
218
|
+
slots: PropTypes.shape({
|
|
219
|
+
label: PropTypes.elementType,
|
|
220
|
+
root: PropTypes.elementType
|
|
221
|
+
}),
|
|
178
222
|
/**
|
|
179
223
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
180
224
|
*/
|
|
@@ -9,6 +9,7 @@ import memoTheme from "../utils/memoTheme.js";
|
|
|
9
9
|
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
10
10
|
import cardActionAreaClasses, { getCardActionAreaUtilityClass } from "./cardActionAreaClasses.js";
|
|
11
11
|
import ButtonBase from "../ButtonBase/index.js";
|
|
12
|
+
import useSlot from "../utils/useSlot.js";
|
|
12
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
14
|
const useUtilityClasses = ownerState => {
|
|
14
15
|
const {
|
|
@@ -72,19 +73,41 @@ const CardActionArea = /*#__PURE__*/React.forwardRef(function CardActionArea(inP
|
|
|
72
73
|
children,
|
|
73
74
|
className,
|
|
74
75
|
focusVisibleClassName,
|
|
76
|
+
slots = {},
|
|
77
|
+
slotProps = {},
|
|
75
78
|
...other
|
|
76
79
|
} = props;
|
|
77
80
|
const ownerState = props;
|
|
78
81
|
const classes = useUtilityClasses(ownerState);
|
|
79
|
-
|
|
82
|
+
const externalForwardedProps = {
|
|
83
|
+
slots,
|
|
84
|
+
slotProps
|
|
85
|
+
};
|
|
86
|
+
const [RootSlot, rootProps] = useSlot('root', {
|
|
87
|
+
elementType: CardActionAreaRoot,
|
|
88
|
+
externalForwardedProps: {
|
|
89
|
+
...externalForwardedProps,
|
|
90
|
+
...other
|
|
91
|
+
},
|
|
92
|
+
shouldForwardComponentProp: true,
|
|
93
|
+
ownerState,
|
|
94
|
+
ref,
|
|
80
95
|
className: clsx(classes.root, className),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
96
|
+
additionalProps: {
|
|
97
|
+
focusVisibleClassName: clsx(focusVisibleClassName, classes.focusVisible)
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const [FocusHighlightSlot, focusHighlightProps] = useSlot('focusHighlight', {
|
|
101
|
+
elementType: CardActionAreaFocusHighlight,
|
|
102
|
+
externalForwardedProps,
|
|
103
|
+
ownerState,
|
|
104
|
+
ref,
|
|
105
|
+
className: classes.focusHighlight
|
|
106
|
+
});
|
|
107
|
+
return /*#__PURE__*/_jsxs(RootSlot, {
|
|
108
|
+
...rootProps,
|
|
109
|
+
children: [children, /*#__PURE__*/_jsx(FocusHighlightSlot, {
|
|
110
|
+
...focusHighlightProps
|
|
88
111
|
})]
|
|
89
112
|
});
|
|
90
113
|
});
|
|
@@ -109,6 +132,22 @@ process.env.NODE_ENV !== "production" ? CardActionArea.propTypes /* remove-propt
|
|
|
109
132
|
* @ignore
|
|
110
133
|
*/
|
|
111
134
|
focusVisibleClassName: PropTypes.string,
|
|
135
|
+
/**
|
|
136
|
+
* The props used for each slot inside.
|
|
137
|
+
* @default {}
|
|
138
|
+
*/
|
|
139
|
+
slotProps: PropTypes.shape({
|
|
140
|
+
focusHighlight: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
141
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
142
|
+
}),
|
|
143
|
+
/**
|
|
144
|
+
* The components used for each slot inside.
|
|
145
|
+
* @default {}
|
|
146
|
+
*/
|
|
147
|
+
slots: PropTypes.shape({
|
|
148
|
+
focusHighlight: PropTypes.elementType,
|
|
149
|
+
root: PropTypes.elementType
|
|
150
|
+
}),
|
|
112
151
|
/**
|
|
113
152
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
114
153
|
*/
|
|
@@ -14,6 +14,7 @@ import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFil
|
|
|
14
14
|
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
15
15
|
import outlinedInputClasses, { getOutlinedInputUtilityClass } from "./outlinedInputClasses.js";
|
|
16
16
|
import InputBase, { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot, InputBaseInput } from "../InputBase/InputBase.js";
|
|
17
|
+
import useSlot from "../utils/useSlot.js";
|
|
17
18
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
18
19
|
const useUtilityClasses = ownerState => {
|
|
19
20
|
const {
|
|
@@ -178,7 +179,6 @@ const OutlinedInputInput = styled(InputBaseInput, {
|
|
|
178
179
|
}]
|
|
179
180
|
})));
|
|
180
181
|
const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
|
|
181
|
-
var _React$Fragment;
|
|
182
182
|
const props = useDefaultProps({
|
|
183
183
|
props: inProps,
|
|
184
184
|
name: 'MuiOutlinedInput'
|
|
@@ -191,6 +191,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
191
191
|
multiline = false,
|
|
192
192
|
notched,
|
|
193
193
|
slots = {},
|
|
194
|
+
slotProps = {},
|
|
194
195
|
type = 'text',
|
|
195
196
|
...other
|
|
196
197
|
} = props;
|
|
@@ -216,17 +217,29 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
216
217
|
};
|
|
217
218
|
const RootSlot = slots.root ?? components.Root ?? OutlinedInputRoot;
|
|
218
219
|
const InputSlot = slots.input ?? components.Input ?? OutlinedInputInput;
|
|
220
|
+
const [NotchedSlot, notchedProps] = useSlot('notchedOutline', {
|
|
221
|
+
elementType: NotchedOutlineRoot,
|
|
222
|
+
className: classes.notchedOutline,
|
|
223
|
+
shouldForwardComponentProp: true,
|
|
224
|
+
ownerState,
|
|
225
|
+
externalForwardedProps: {
|
|
226
|
+
slots,
|
|
227
|
+
slotProps
|
|
228
|
+
},
|
|
229
|
+
additionalProps: {
|
|
230
|
+
label: label != null && label !== '' && fcs.required ? /*#__PURE__*/_jsxs(React.Fragment, {
|
|
231
|
+
children: [label, "\u2009", '*']
|
|
232
|
+
}) : label
|
|
233
|
+
}
|
|
234
|
+
});
|
|
219
235
|
return /*#__PURE__*/_jsx(InputBase, {
|
|
220
236
|
slots: {
|
|
221
237
|
root: RootSlot,
|
|
222
238
|
input: InputSlot
|
|
223
239
|
},
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
label: label != null && label !== '' && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
228
|
-
children: [label, "\u2009", '*']
|
|
229
|
-
})) : label,
|
|
240
|
+
slotProps: slotProps,
|
|
241
|
+
renderSuffix: state => /*#__PURE__*/_jsx(NotchedSlot, {
|
|
242
|
+
...notchedProps,
|
|
230
243
|
notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
|
|
231
244
|
}),
|
|
232
245
|
fullWidth: fullWidth,
|
|
@@ -377,15 +390,22 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes /* remove-propty
|
|
|
377
390
|
* Number of rows to display when multiline option is set to true.
|
|
378
391
|
*/
|
|
379
392
|
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
393
|
+
/**
|
|
394
|
+
* The props used for each slot inside.
|
|
395
|
+
* @default {}
|
|
396
|
+
*/
|
|
397
|
+
slotProps: PropTypes.shape({
|
|
398
|
+
input: PropTypes.object,
|
|
399
|
+
notchedOutline: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
400
|
+
root: PropTypes.object
|
|
401
|
+
}),
|
|
380
402
|
/**
|
|
381
403
|
* The components used for each slot inside.
|
|
382
|
-
*
|
|
383
|
-
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
384
|
-
*
|
|
385
404
|
* @default {}
|
|
386
405
|
*/
|
|
387
406
|
slots: PropTypes.shape({
|
|
388
407
|
input: PropTypes.elementType,
|
|
408
|
+
notchedOutline: PropTypes.elementType,
|
|
389
409
|
root: PropTypes.elementType
|
|
390
410
|
}),
|
|
391
411
|
/**
|
package/modern/index.js
CHANGED
|
@@ -9,27 +9,27 @@ export default function ThemeProvider({
|
|
|
9
9
|
theme,
|
|
10
10
|
...props
|
|
11
11
|
}) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
|
|
23
|
-
return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
|
|
24
|
-
theme: {
|
|
12
|
+
const noVarsTheme = React.useMemo(() => {
|
|
13
|
+
if (typeof theme === 'function') {
|
|
14
|
+
return theme;
|
|
15
|
+
}
|
|
16
|
+
const muiTheme = THEME_ID in theme ? theme[THEME_ID] : theme;
|
|
17
|
+
if (!('colorSchemes' in muiTheme)) {
|
|
18
|
+
if (!('vars' in muiTheme)) {
|
|
19
|
+
// For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
|
|
20
|
+
// The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
|
|
21
|
+
return {
|
|
25
22
|
...theme,
|
|
26
23
|
vars: null
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return theme;
|
|
30
27
|
}
|
|
28
|
+
return null;
|
|
29
|
+
}, [theme]);
|
|
30
|
+
if (noVarsTheme) {
|
|
31
31
|
return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
|
|
32
|
-
theme:
|
|
32
|
+
theme: noVarsTheme,
|
|
33
33
|
...props
|
|
34
34
|
});
|
|
35
35
|
}
|
package/modern/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.4.
|
|
1
|
+
export const version = "6.4.12";
|
|
2
2
|
export const major = Number("6");
|
|
3
3
|
export const minor = Number("4");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("12");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|
package/node/Badge/Badge.js
CHANGED
|
@@ -12,7 +12,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
12
12
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
13
|
var _usePreviousProps = _interopRequireDefault(require("@mui/utils/usePreviousProps"));
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
-
var _useSlotProps = _interopRequireDefault(require("@mui/utils/useSlotProps"));
|
|
16
15
|
var _useBadge = _interopRequireDefault(require("./useBadge"));
|
|
17
16
|
var _zeroStyled = require("../zero-styled");
|
|
18
17
|
var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
|
|
@@ -20,6 +19,7 @@ var _createSimplePaletteValueFilter = _interopRequireDefault(require("../utils/c
|
|
|
20
19
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
21
20
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
22
21
|
var _badgeClasses = _interopRequireWildcard(require("./badgeClasses"));
|
|
22
|
+
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
23
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
24
|
const RADIUS_STANDARD = 10;
|
|
25
25
|
const RADIUS_DOT = 4;
|
|
@@ -289,26 +289,34 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
289
289
|
const classes = useUtilityClasses(ownerState);
|
|
290
290
|
|
|
291
291
|
// support both `slots` and `components` for backward compatibility
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
292
|
+
const externalForwardedProps = {
|
|
293
|
+
slots: {
|
|
294
|
+
root: slots?.root ?? components.Root,
|
|
295
|
+
badge: slots?.badge ?? components.Badge
|
|
296
|
+
},
|
|
297
|
+
slotProps: {
|
|
298
|
+
root: slotProps?.root ?? componentsProps.root,
|
|
299
|
+
badge: slotProps?.badge ?? componentsProps.badge
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
const [RootSlot, rootProps] = (0, _useSlot.default)('root', {
|
|
303
|
+
elementType: BadgeRoot,
|
|
304
|
+
externalForwardedProps: {
|
|
305
|
+
...externalForwardedProps,
|
|
306
|
+
...other
|
|
303
307
|
},
|
|
304
308
|
ownerState,
|
|
305
|
-
className: (0, _clsx.default)(
|
|
309
|
+
className: (0, _clsx.default)(classes.root, className),
|
|
310
|
+
ref,
|
|
311
|
+
additionalProps: {
|
|
312
|
+
as: component
|
|
313
|
+
}
|
|
306
314
|
});
|
|
307
|
-
const badgeProps = (0,
|
|
308
|
-
elementType:
|
|
309
|
-
|
|
315
|
+
const [BadgeSlot, badgeProps] = (0, _useSlot.default)('badge', {
|
|
316
|
+
elementType: BadgeBadge,
|
|
317
|
+
externalForwardedProps,
|
|
310
318
|
ownerState,
|
|
311
|
-
className:
|
|
319
|
+
className: classes.badge
|
|
312
320
|
});
|
|
313
321
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
|
|
314
322
|
...rootProps,
|
|
@@ -406,7 +414,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
|
|
|
406
414
|
*/
|
|
407
415
|
showZero: _propTypes.default.bool,
|
|
408
416
|
/**
|
|
409
|
-
* The props used for each slot inside
|
|
417
|
+
* The props used for each slot inside.
|
|
410
418
|
* @default {}
|
|
411
419
|
*/
|
|
412
420
|
slotProps: _propTypes.default.shape({
|
|
@@ -414,8 +422,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
|
|
|
414
422
|
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
415
423
|
}),
|
|
416
424
|
/**
|
|
417
|
-
* The components used for each slot inside
|
|
418
|
-
* Either a string to use a HTML element or a component.
|
|
425
|
+
* The components used for each slot inside.
|
|
419
426
|
* @default {}
|
|
420
427
|
*/
|
|
421
428
|
slots: _propTypes.default.shape({
|
|
@@ -17,6 +17,7 @@ var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
|
17
17
|
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
18
18
|
var _unsupportedProp = _interopRequireDefault(require("../utils/unsupportedProp"));
|
|
19
19
|
var _bottomNavigationActionClasses = _interopRequireWildcard(require("./bottomNavigationActionClasses"));
|
|
20
|
+
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
20
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
22
|
const useUtilityClasses = ownerState => {
|
|
22
23
|
const {
|
|
@@ -114,6 +115,8 @@ const BottomNavigationAction = /*#__PURE__*/React.forwardRef(function BottomNavi
|
|
|
114
115
|
selected,
|
|
115
116
|
showLabel,
|
|
116
117
|
value,
|
|
118
|
+
slots = {},
|
|
119
|
+
slotProps = {},
|
|
117
120
|
...other
|
|
118
121
|
} = props;
|
|
119
122
|
const ownerState = props;
|
|
@@ -126,16 +129,41 @@ const BottomNavigationAction = /*#__PURE__*/React.forwardRef(function BottomNavi
|
|
|
126
129
|
onClick(event);
|
|
127
130
|
}
|
|
128
131
|
};
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
const externalForwardedProps = {
|
|
133
|
+
slots,
|
|
134
|
+
slotProps
|
|
135
|
+
};
|
|
136
|
+
const [RootSlot, rootProps] = (0, _useSlot.default)('root', {
|
|
137
|
+
elementType: BottomNavigationActionRoot,
|
|
138
|
+
externalForwardedProps: {
|
|
139
|
+
...externalForwardedProps,
|
|
140
|
+
...other
|
|
141
|
+
},
|
|
142
|
+
shouldForwardComponentProp: true,
|
|
143
|
+
ownerState,
|
|
144
|
+
ref,
|
|
131
145
|
className: (0, _clsx.default)(classes.root, className),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
additionalProps: {
|
|
147
|
+
focusRipple: true
|
|
148
|
+
},
|
|
149
|
+
getSlotProps: handlers => ({
|
|
150
|
+
...handlers,
|
|
151
|
+
onClick: event => {
|
|
152
|
+
handlers.onClick?.(event);
|
|
153
|
+
handleChange(event);
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
});
|
|
157
|
+
const [LabelSlot, labelProps] = (0, _useSlot.default)('label', {
|
|
158
|
+
elementType: BottomNavigationActionLabel,
|
|
159
|
+
externalForwardedProps,
|
|
160
|
+
ownerState,
|
|
161
|
+
className: classes.label
|
|
162
|
+
});
|
|
163
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
|
|
164
|
+
...rootProps,
|
|
165
|
+
children: [icon, /*#__PURE__*/(0, _jsxRuntime.jsx)(LabelSlot, {
|
|
166
|
+
...labelProps,
|
|
139
167
|
children: label
|
|
140
168
|
})]
|
|
141
169
|
});
|
|
@@ -182,6 +210,22 @@ process.env.NODE_ENV !== "production" ? BottomNavigationAction.propTypes /* remo
|
|
|
182
210
|
* The prop defaults to the value (`false`) inherited from the parent BottomNavigation component.
|
|
183
211
|
*/
|
|
184
212
|
showLabel: _propTypes.default.bool,
|
|
213
|
+
/**
|
|
214
|
+
* The props used for each slot inside.
|
|
215
|
+
* @default {}
|
|
216
|
+
*/
|
|
217
|
+
slotProps: _propTypes.default.shape({
|
|
218
|
+
label: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
219
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
220
|
+
}),
|
|
221
|
+
/**
|
|
222
|
+
* The components used for each slot inside.
|
|
223
|
+
* @default {}
|
|
224
|
+
*/
|
|
225
|
+
slots: _propTypes.default.shape({
|
|
226
|
+
label: _propTypes.default.elementType,
|
|
227
|
+
root: _propTypes.default.elementType
|
|
228
|
+
}),
|
|
185
229
|
/**
|
|
186
230
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
187
231
|
*/
|
|
@@ -16,6 +16,7 @@ var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
|
|
|
16
16
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
17
17
|
var _cardActionAreaClasses = _interopRequireWildcard(require("./cardActionAreaClasses"));
|
|
18
18
|
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
19
|
+
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
21
|
const useUtilityClasses = ownerState => {
|
|
21
22
|
const {
|
|
@@ -79,19 +80,41 @@ const CardActionArea = /*#__PURE__*/React.forwardRef(function CardActionArea(inP
|
|
|
79
80
|
children,
|
|
80
81
|
className,
|
|
81
82
|
focusVisibleClassName,
|
|
83
|
+
slots = {},
|
|
84
|
+
slotProps = {},
|
|
82
85
|
...other
|
|
83
86
|
} = props;
|
|
84
87
|
const ownerState = props;
|
|
85
88
|
const classes = useUtilityClasses(ownerState);
|
|
86
|
-
|
|
89
|
+
const externalForwardedProps = {
|
|
90
|
+
slots,
|
|
91
|
+
slotProps
|
|
92
|
+
};
|
|
93
|
+
const [RootSlot, rootProps] = (0, _useSlot.default)('root', {
|
|
94
|
+
elementType: CardActionAreaRoot,
|
|
95
|
+
externalForwardedProps: {
|
|
96
|
+
...externalForwardedProps,
|
|
97
|
+
...other
|
|
98
|
+
},
|
|
99
|
+
shouldForwardComponentProp: true,
|
|
100
|
+
ownerState,
|
|
101
|
+
ref,
|
|
87
102
|
className: (0, _clsx.default)(classes.root, className),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
103
|
+
additionalProps: {
|
|
104
|
+
focusVisibleClassName: (0, _clsx.default)(focusVisibleClassName, classes.focusVisible)
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
const [FocusHighlightSlot, focusHighlightProps] = (0, _useSlot.default)('focusHighlight', {
|
|
108
|
+
elementType: CardActionAreaFocusHighlight,
|
|
109
|
+
externalForwardedProps,
|
|
110
|
+
ownerState,
|
|
111
|
+
ref,
|
|
112
|
+
className: classes.focusHighlight
|
|
113
|
+
});
|
|
114
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
|
|
115
|
+
...rootProps,
|
|
116
|
+
children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(FocusHighlightSlot, {
|
|
117
|
+
...focusHighlightProps
|
|
95
118
|
})]
|
|
96
119
|
});
|
|
97
120
|
});
|
|
@@ -116,6 +139,22 @@ process.env.NODE_ENV !== "production" ? CardActionArea.propTypes /* remove-propt
|
|
|
116
139
|
* @ignore
|
|
117
140
|
*/
|
|
118
141
|
focusVisibleClassName: _propTypes.default.string,
|
|
142
|
+
/**
|
|
143
|
+
* The props used for each slot inside.
|
|
144
|
+
* @default {}
|
|
145
|
+
*/
|
|
146
|
+
slotProps: _propTypes.default.shape({
|
|
147
|
+
focusHighlight: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
148
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
149
|
+
}),
|
|
150
|
+
/**
|
|
151
|
+
* The components used for each slot inside.
|
|
152
|
+
* @default {}
|
|
153
|
+
*/
|
|
154
|
+
slots: _propTypes.default.shape({
|
|
155
|
+
focusHighlight: _propTypes.default.elementType,
|
|
156
|
+
root: _propTypes.default.elementType
|
|
157
|
+
}),
|
|
119
158
|
/**
|
|
120
159
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
121
160
|
*/
|