@mui/material 6.1.3 → 6.1.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.
- package/Autocomplete/Autocomplete.js +12 -5
- package/CHANGELOG.md +371 -350
- package/Checkbox/Checkbox.js +1 -0
- package/Dialog/Dialog.d.ts +6 -0
- package/Dialog/Dialog.js +8 -0
- package/IconButton/IconButton.js +5 -16
- package/PigmentHidden/PigmentHidden.js +1 -0
- package/Slider/Slider.js +52 -33
- package/index.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +12 -5
- package/modern/Checkbox/Checkbox.js +1 -0
- package/modern/Dialog/Dialog.js +8 -0
- package/modern/IconButton/IconButton.js +5 -16
- package/modern/PigmentHidden/PigmentHidden.js +1 -0
- package/modern/Slider/Slider.js +52 -33
- package/modern/index.js +1 -1
- package/modern/styles/createPalette.js +78 -70
- package/modern/styles/createThemeNoVars.js +3 -0
- package/modern/useAutocomplete/useAutocomplete.js +1 -3
- package/modern/version/index.js +2 -2
- package/node/Autocomplete/Autocomplete.js +12 -5
- package/node/Checkbox/Checkbox.js +1 -0
- package/node/Dialog/Dialog.js +8 -0
- package/node/IconButton/IconButton.js +5 -16
- package/node/PigmentHidden/PigmentHidden.js +1 -0
- package/node/Slider/Slider.js +50 -32
- package/node/index.js +1 -1
- package/node/styles/createPalette.js +78 -70
- package/node/styles/createThemeNoVars.js +3 -0
- package/node/useAutocomplete/useAutocomplete.js +1 -3
- package/node/version/index.js +2 -2
- package/package.json +6 -6
- package/styles/createPalette.js +78 -70
- package/styles/createThemeNoVars.js +3 -0
- package/useAutocomplete/useAutocomplete.js +1 -3
- package/version/index.js +2 -2
|
@@ -9,70 +9,76 @@ import orange from "../colors/orange.js";
|
|
|
9
9
|
import blue from "../colors/blue.js";
|
|
10
10
|
import lightBlue from "../colors/lightBlue.js";
|
|
11
11
|
import green from "../colors/green.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
12
|
+
function getLight() {
|
|
13
|
+
return {
|
|
14
|
+
// The colors used to style the text.
|
|
15
|
+
text: {
|
|
16
|
+
// The most important text.
|
|
17
|
+
primary: 'rgba(0, 0, 0, 0.87)',
|
|
18
|
+
// Secondary text.
|
|
19
|
+
secondary: 'rgba(0, 0, 0, 0.6)',
|
|
20
|
+
// Disabled text have even lower visual prominence.
|
|
21
|
+
disabled: 'rgba(0, 0, 0, 0.38)'
|
|
22
|
+
},
|
|
23
|
+
// The color used to divide different elements.
|
|
24
|
+
divider: 'rgba(0, 0, 0, 0.12)',
|
|
25
|
+
// The background colors used to style the surfaces.
|
|
26
|
+
// Consistency between these values is important.
|
|
27
|
+
background: {
|
|
28
|
+
paper: common.white,
|
|
29
|
+
default: common.white
|
|
30
|
+
},
|
|
31
|
+
// The colors used to style the action elements.
|
|
32
|
+
action: {
|
|
33
|
+
// The color of an active action like an icon button.
|
|
34
|
+
active: 'rgba(0, 0, 0, 0.54)',
|
|
35
|
+
// The color of an hovered action.
|
|
36
|
+
hover: 'rgba(0, 0, 0, 0.04)',
|
|
37
|
+
hoverOpacity: 0.04,
|
|
38
|
+
// The color of a selected action.
|
|
39
|
+
selected: 'rgba(0, 0, 0, 0.08)',
|
|
40
|
+
selectedOpacity: 0.08,
|
|
41
|
+
// The color of a disabled action.
|
|
42
|
+
disabled: 'rgba(0, 0, 0, 0.26)',
|
|
43
|
+
// The background color of a disabled action.
|
|
44
|
+
disabledBackground: 'rgba(0, 0, 0, 0.12)',
|
|
45
|
+
disabledOpacity: 0.38,
|
|
46
|
+
focus: 'rgba(0, 0, 0, 0.12)',
|
|
47
|
+
focusOpacity: 0.12,
|
|
48
|
+
activatedOpacity: 0.12
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export const light = getLight();
|
|
53
|
+
function getDark() {
|
|
54
|
+
return {
|
|
55
|
+
text: {
|
|
56
|
+
primary: common.white,
|
|
57
|
+
secondary: 'rgba(255, 255, 255, 0.7)',
|
|
58
|
+
disabled: 'rgba(255, 255, 255, 0.5)',
|
|
59
|
+
icon: 'rgba(255, 255, 255, 0.5)'
|
|
60
|
+
},
|
|
61
|
+
divider: 'rgba(255, 255, 255, 0.12)',
|
|
62
|
+
background: {
|
|
63
|
+
paper: '#121212',
|
|
64
|
+
default: '#121212'
|
|
65
|
+
},
|
|
66
|
+
action: {
|
|
67
|
+
active: common.white,
|
|
68
|
+
hover: 'rgba(255, 255, 255, 0.08)',
|
|
69
|
+
hoverOpacity: 0.08,
|
|
70
|
+
selected: 'rgba(255, 255, 255, 0.16)',
|
|
71
|
+
selectedOpacity: 0.16,
|
|
72
|
+
disabled: 'rgba(255, 255, 255, 0.3)',
|
|
73
|
+
disabledBackground: 'rgba(255, 255, 255, 0.12)',
|
|
74
|
+
disabledOpacity: 0.38,
|
|
75
|
+
focus: 'rgba(255, 255, 255, 0.12)',
|
|
76
|
+
focusOpacity: 0.12,
|
|
77
|
+
activatedOpacity: 0.24
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export const dark = getDark();
|
|
76
82
|
function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
77
83
|
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
|
78
84
|
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
|
@@ -224,12 +230,14 @@ export default function createPalette(palette) {
|
|
|
224
230
|
}
|
|
225
231
|
return color;
|
|
226
232
|
};
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
233
|
+
let modeHydrated;
|
|
234
|
+
if (mode === 'light') {
|
|
235
|
+
modeHydrated = getLight();
|
|
236
|
+
} else if (mode === 'dark') {
|
|
237
|
+
modeHydrated = getDark();
|
|
238
|
+
}
|
|
231
239
|
if (process.env.NODE_ENV !== 'production') {
|
|
232
|
-
if (!
|
|
240
|
+
if (!modeHydrated) {
|
|
233
241
|
console.error(`MUI: The palette mode \`${mode}\` is not supported.`);
|
|
234
242
|
}
|
|
235
243
|
}
|
|
@@ -288,7 +296,7 @@ export default function createPalette(palette) {
|
|
|
288
296
|
// E.g., shift from Red 500 to Red 300 or Red 700.
|
|
289
297
|
tonalOffset,
|
|
290
298
|
// The light and dark mode object.
|
|
291
|
-
...
|
|
299
|
+
...modeHydrated
|
|
292
300
|
}, other);
|
|
293
301
|
return paletteOutput;
|
|
294
302
|
}
|
|
@@ -9,6 +9,7 @@ import createTypography from "./createTypography.js";
|
|
|
9
9
|
import shadows from "./shadows.js";
|
|
10
10
|
import createTransitions from "./createTransitions.js";
|
|
11
11
|
import zIndex from "./zIndex.js";
|
|
12
|
+
import { stringifyTheme } from "./stringifyTheme.js";
|
|
12
13
|
function createThemeNoVars(options = {}, ...args) {
|
|
13
14
|
const {
|
|
14
15
|
breakpoints: breakpointsInput,
|
|
@@ -78,6 +79,8 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
78
79
|
theme: this
|
|
79
80
|
});
|
|
80
81
|
};
|
|
82
|
+
muiTheme.toRuntimeSource = stringifyTheme; // for Pigment CSS integration
|
|
83
|
+
|
|
81
84
|
return muiTheme;
|
|
82
85
|
}
|
|
83
86
|
let warnedOnce = false;
|
|
@@ -838,7 +838,6 @@ function useAutocomplete(props) {
|
|
|
838
838
|
const handleInputMouseDown = event => {
|
|
839
839
|
if (!disabledProp && (inputValue === '' || !open)) {
|
|
840
840
|
handlePopupIndicator(event);
|
|
841
|
-
event.stopPropagation();
|
|
842
841
|
}
|
|
843
842
|
};
|
|
844
843
|
let dirty = freeSolo && inputValue.length > 0;
|
|
@@ -915,8 +914,7 @@ function useAutocomplete(props) {
|
|
|
915
914
|
getPopupIndicatorProps: () => ({
|
|
916
915
|
tabIndex: -1,
|
|
917
916
|
type: 'button',
|
|
918
|
-
onClick: handlePopupIndicator
|
|
919
|
-
onMouseDown: event => event.stopPropagation()
|
|
917
|
+
onClick: handlePopupIndicator
|
|
920
918
|
}),
|
|
921
919
|
getTagProps: ({
|
|
922
920
|
index
|
package/modern/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.1.
|
|
1
|
+
export const version = "6.1.5";
|
|
2
2
|
export const major = Number("6");
|
|
3
3
|
export const minor = Number("1");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("5");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|
|
@@ -545,7 +545,6 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
545
545
|
const classes = useUtilityClasses(ownerState);
|
|
546
546
|
const externalForwardedProps = {
|
|
547
547
|
slots: {
|
|
548
|
-
listbox: ListboxComponentProp,
|
|
549
548
|
paper: PaperComponentProp,
|
|
550
549
|
popper: PopperComponentProp,
|
|
551
550
|
...slots
|
|
@@ -558,7 +557,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
558
557
|
}
|
|
559
558
|
};
|
|
560
559
|
const [ListboxSlot, listboxProps] = (0, _useSlot.default)('listbox', {
|
|
561
|
-
elementType:
|
|
560
|
+
elementType: AutocompleteListbox,
|
|
562
561
|
externalForwardedProps,
|
|
563
562
|
ownerState,
|
|
564
563
|
className: classes.listbox,
|
|
@@ -674,8 +673,12 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
674
673
|
});
|
|
675
674
|
let autocompletePopper = null;
|
|
676
675
|
if (groupedOptions.length > 0) {
|
|
677
|
-
autocompletePopper = renderAutocompletePopperChildren(
|
|
678
|
-
|
|
676
|
+
autocompletePopper = renderAutocompletePopperChildren(
|
|
677
|
+
/*#__PURE__*/
|
|
678
|
+
// TODO v7: remove `as` prop and move ListboxComponentProp to externalForwardedProps or remove ListboxComponentProp entirely
|
|
679
|
+
// https://github.com/mui/material-ui/pull/43994#issuecomment-2401945800
|
|
680
|
+
(0, _jsxRuntime.jsx)(ListboxSlot, {
|
|
681
|
+
as: ListboxComponentProp,
|
|
679
682
|
...listboxProps,
|
|
680
683
|
children: groupedOptions.map((option, index) => {
|
|
681
684
|
if (groupBy) {
|
|
@@ -722,7 +725,11 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
722
725
|
ref: setAnchorEl,
|
|
723
726
|
className: classes.inputRoot,
|
|
724
727
|
startAdornment,
|
|
725
|
-
onMouseDown: event =>
|
|
728
|
+
onMouseDown: event => {
|
|
729
|
+
if (event.target === event.currentTarget) {
|
|
730
|
+
handleInputMouseDown(event);
|
|
731
|
+
}
|
|
732
|
+
},
|
|
726
733
|
...((hasClearIcon || hasPopupIcon) && {
|
|
727
734
|
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsxs)(AutocompleteEndAdornment, {
|
|
728
735
|
className: classes.endAdornment,
|
|
@@ -148,6 +148,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(inProps, ref) {
|
|
|
148
148
|
ownerState: ownerState,
|
|
149
149
|
ref: ref,
|
|
150
150
|
className: (0, _clsx.default)(classes.root, className),
|
|
151
|
+
disableRipple: disableRipple,
|
|
151
152
|
...other,
|
|
152
153
|
classes: classes
|
|
153
154
|
});
|
package/node/Dialog/Dialog.js
CHANGED
|
@@ -209,6 +209,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
209
209
|
const {
|
|
210
210
|
'aria-describedby': ariaDescribedby,
|
|
211
211
|
'aria-labelledby': ariaLabelledbyProp,
|
|
212
|
+
'aria-modal': ariaModal = true,
|
|
212
213
|
BackdropComponent,
|
|
213
214
|
BackdropProps,
|
|
214
215
|
children,
|
|
@@ -303,6 +304,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
303
304
|
role: "dialog",
|
|
304
305
|
"aria-describedby": ariaDescribedby,
|
|
305
306
|
"aria-labelledby": ariaLabelledby,
|
|
307
|
+
"aria-modal": ariaModal,
|
|
306
308
|
...PaperProps,
|
|
307
309
|
className: (0, _clsx.default)(classes.paper, PaperProps.className),
|
|
308
310
|
ownerState: ownerState,
|
|
@@ -328,6 +330,12 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
|
|
|
328
330
|
* The id(s) of the element(s) that label the dialog.
|
|
329
331
|
*/
|
|
330
332
|
'aria-labelledby': _propTypes.default.string,
|
|
333
|
+
/**
|
|
334
|
+
* Informs assistive technologies that the element is modal.
|
|
335
|
+
* It's added on the element with role="dialog".
|
|
336
|
+
* @default true
|
|
337
|
+
*/
|
|
338
|
+
'aria-modal': _propTypes.default.oneOfType([_propTypes.default.oneOf(['false', 'true']), _propTypes.default.bool]),
|
|
331
339
|
/**
|
|
332
340
|
* A backdrop component. This prop enables custom backdrop rendering.
|
|
333
341
|
* @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
|
|
@@ -56,12 +56,11 @@ const IconButtonRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
|
|
|
56
56
|
duration: theme.transitions.duration.shortest
|
|
57
57
|
}),
|
|
58
58
|
variants: [{
|
|
59
|
-
props:
|
|
60
|
-
disableRipple: false
|
|
61
|
-
},
|
|
59
|
+
props: props => !props.disableRipple,
|
|
62
60
|
style: {
|
|
61
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
63
62
|
'&:hover': {
|
|
64
|
-
backgroundColor:
|
|
63
|
+
backgroundColor: 'var(--IconButton-hoverBg)',
|
|
65
64
|
// Reset on touch devices, it doesn't add specificity
|
|
66
65
|
'@media (hover: none)': {
|
|
67
66
|
backgroundColor: 'transparent'
|
|
@@ -120,17 +119,10 @@ const IconButtonRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
|
|
|
120
119
|
})), ...Object.entries(theme.palette).filter((0, _createSimplePaletteValueFilter.default)()) // check all the used fields in the style below
|
|
121
120
|
.map(([color]) => ({
|
|
122
121
|
props: {
|
|
123
|
-
color
|
|
124
|
-
disableRipple: false
|
|
122
|
+
color
|
|
125
123
|
},
|
|
126
124
|
style: {
|
|
127
|
-
'
|
|
128
|
-
backgroundColor: theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity),
|
|
129
|
-
// Reset on touch devices, it doesn't add specificity
|
|
130
|
-
'@media (hover: none)': {
|
|
131
|
-
backgroundColor: 'transparent'
|
|
132
|
-
}
|
|
133
|
-
}
|
|
125
|
+
'--IconButton-hoverBg': theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity)
|
|
134
126
|
}
|
|
135
127
|
})), {
|
|
136
128
|
props: {
|
|
@@ -171,7 +163,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
171
163
|
color = 'default',
|
|
172
164
|
disabled = false,
|
|
173
165
|
disableFocusRipple = false,
|
|
174
|
-
disableRipple = false,
|
|
175
166
|
size = 'medium',
|
|
176
167
|
...other
|
|
177
168
|
} = props;
|
|
@@ -181,7 +172,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
181
172
|
color,
|
|
182
173
|
disabled,
|
|
183
174
|
disableFocusRipple,
|
|
184
|
-
disableRipple,
|
|
185
175
|
size
|
|
186
176
|
};
|
|
187
177
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -190,7 +180,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
|
|
|
190
180
|
centerRipple: true,
|
|
191
181
|
focusRipple: !disableFocusRipple,
|
|
192
182
|
disabled: disabled,
|
|
193
|
-
disableRipple: disableRipple,
|
|
194
183
|
ref: ref,
|
|
195
184
|
...other,
|
|
196
185
|
ownerState: ownerState,
|
package/node/Slider/Slider.js
CHANGED
|
@@ -427,6 +427,28 @@ const SliderValueLabel = exports.SliderValueLabel = (0, _zeroStyled.styled)(_Sli
|
|
|
427
427
|
}
|
|
428
428
|
}]
|
|
429
429
|
})));
|
|
430
|
+
process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes /* remove-proptypes */ = {
|
|
431
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
432
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
433
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
434
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
435
|
+
/**
|
|
436
|
+
* @ignore
|
|
437
|
+
*/
|
|
438
|
+
children: _propTypes.default.element.isRequired,
|
|
439
|
+
/**
|
|
440
|
+
* @ignore
|
|
441
|
+
*/
|
|
442
|
+
index: _propTypes.default.number.isRequired,
|
|
443
|
+
/**
|
|
444
|
+
* @ignore
|
|
445
|
+
*/
|
|
446
|
+
open: _propTypes.default.bool.isRequired,
|
|
447
|
+
/**
|
|
448
|
+
* @ignore
|
|
449
|
+
*/
|
|
450
|
+
value: _propTypes.default.number.isRequired
|
|
451
|
+
} : void 0;
|
|
430
452
|
const SliderMark = exports.SliderMark = (0, _zeroStyled.styled)('span', {
|
|
431
453
|
name: 'MuiSlider',
|
|
432
454
|
slot: 'Mark',
|
|
@@ -766,40 +788,36 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
766
788
|
const percent = (0, _useSlider.valueToPercent)(value, min, max);
|
|
767
789
|
const style = axisProps[axis].offset(percent);
|
|
768
790
|
const ValueLabelComponent = valueLabelDisplay === 'off' ? Forward : ValueLabelSlot;
|
|
769
|
-
return (
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
...
|
|
782
|
-
|
|
791
|
+
return /*#__PURE__*/ /* TODO v6: Change component structure. It will help in avoiding the complicated React.cloneElement API added in SliderValueLabel component. Should be: Thumb -> Input, ValueLabel. Follow Joy UI's Slider structure. */(0, _jsxRuntime.jsx)(ValueLabelComponent, {
|
|
792
|
+
...(!(0, _isHostComponent.default)(ValueLabelComponent) && {
|
|
793
|
+
valueLabelFormat,
|
|
794
|
+
valueLabelDisplay,
|
|
795
|
+
value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat,
|
|
796
|
+
index,
|
|
797
|
+
open: open === index || active === index || valueLabelDisplay === 'on',
|
|
798
|
+
disabled
|
|
799
|
+
}),
|
|
800
|
+
...valueLabelProps,
|
|
801
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ThumbSlot, {
|
|
802
|
+
"data-index": index,
|
|
803
|
+
...thumbProps,
|
|
804
|
+
className: (0, _clsx.default)(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
|
|
805
|
+
style: {
|
|
806
|
+
...style,
|
|
807
|
+
...getThumbStyle(index),
|
|
808
|
+
...thumbProps.style
|
|
809
|
+
},
|
|
810
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InputSlot, {
|
|
783
811
|
"data-index": index,
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
},
|
|
791
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InputSlot, {
|
|
792
|
-
"data-index": index,
|
|
793
|
-
"aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
|
|
794
|
-
"aria-valuenow": scale(value),
|
|
795
|
-
"aria-labelledby": ariaLabelledby,
|
|
796
|
-
"aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
|
|
797
|
-
value: values[index],
|
|
798
|
-
...inputSliderProps
|
|
799
|
-
})
|
|
812
|
+
"aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
|
|
813
|
+
"aria-valuenow": scale(value),
|
|
814
|
+
"aria-labelledby": ariaLabelledby,
|
|
815
|
+
"aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
|
|
816
|
+
value: values[index],
|
|
817
|
+
...inputSliderProps
|
|
800
818
|
})
|
|
801
|
-
}
|
|
802
|
-
);
|
|
819
|
+
})
|
|
820
|
+
}, index);
|
|
803
821
|
})]
|
|
804
822
|
});
|
|
805
823
|
});
|
package/node/index.js
CHANGED
|
@@ -18,70 +18,76 @@ var _orange = _interopRequireDefault(require("../colors/orange"));
|
|
|
18
18
|
var _blue = _interopRequireDefault(require("../colors/blue"));
|
|
19
19
|
var _lightBlue = _interopRequireDefault(require("../colors/lightBlue"));
|
|
20
20
|
var _green = _interopRequireDefault(require("../colors/green"));
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
21
|
+
function getLight() {
|
|
22
|
+
return {
|
|
23
|
+
// The colors used to style the text.
|
|
24
|
+
text: {
|
|
25
|
+
// The most important text.
|
|
26
|
+
primary: 'rgba(0, 0, 0, 0.87)',
|
|
27
|
+
// Secondary text.
|
|
28
|
+
secondary: 'rgba(0, 0, 0, 0.6)',
|
|
29
|
+
// Disabled text have even lower visual prominence.
|
|
30
|
+
disabled: 'rgba(0, 0, 0, 0.38)'
|
|
31
|
+
},
|
|
32
|
+
// The color used to divide different elements.
|
|
33
|
+
divider: 'rgba(0, 0, 0, 0.12)',
|
|
34
|
+
// The background colors used to style the surfaces.
|
|
35
|
+
// Consistency between these values is important.
|
|
36
|
+
background: {
|
|
37
|
+
paper: _common.default.white,
|
|
38
|
+
default: _common.default.white
|
|
39
|
+
},
|
|
40
|
+
// The colors used to style the action elements.
|
|
41
|
+
action: {
|
|
42
|
+
// The color of an active action like an icon button.
|
|
43
|
+
active: 'rgba(0, 0, 0, 0.54)',
|
|
44
|
+
// The color of an hovered action.
|
|
45
|
+
hover: 'rgba(0, 0, 0, 0.04)',
|
|
46
|
+
hoverOpacity: 0.04,
|
|
47
|
+
// The color of a selected action.
|
|
48
|
+
selected: 'rgba(0, 0, 0, 0.08)',
|
|
49
|
+
selectedOpacity: 0.08,
|
|
50
|
+
// The color of a disabled action.
|
|
51
|
+
disabled: 'rgba(0, 0, 0, 0.26)',
|
|
52
|
+
// The background color of a disabled action.
|
|
53
|
+
disabledBackground: 'rgba(0, 0, 0, 0.12)',
|
|
54
|
+
disabledOpacity: 0.38,
|
|
55
|
+
focus: 'rgba(0, 0, 0, 0.12)',
|
|
56
|
+
focusOpacity: 0.12,
|
|
57
|
+
activatedOpacity: 0.12
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const light = exports.light = getLight();
|
|
62
|
+
function getDark() {
|
|
63
|
+
return {
|
|
64
|
+
text: {
|
|
65
|
+
primary: _common.default.white,
|
|
66
|
+
secondary: 'rgba(255, 255, 255, 0.7)',
|
|
67
|
+
disabled: 'rgba(255, 255, 255, 0.5)',
|
|
68
|
+
icon: 'rgba(255, 255, 255, 0.5)'
|
|
69
|
+
},
|
|
70
|
+
divider: 'rgba(255, 255, 255, 0.12)',
|
|
71
|
+
background: {
|
|
72
|
+
paper: '#121212',
|
|
73
|
+
default: '#121212'
|
|
74
|
+
},
|
|
75
|
+
action: {
|
|
76
|
+
active: _common.default.white,
|
|
77
|
+
hover: 'rgba(255, 255, 255, 0.08)',
|
|
78
|
+
hoverOpacity: 0.08,
|
|
79
|
+
selected: 'rgba(255, 255, 255, 0.16)',
|
|
80
|
+
selectedOpacity: 0.16,
|
|
81
|
+
disabled: 'rgba(255, 255, 255, 0.3)',
|
|
82
|
+
disabledBackground: 'rgba(255, 255, 255, 0.12)',
|
|
83
|
+
disabledOpacity: 0.38,
|
|
84
|
+
focus: 'rgba(255, 255, 255, 0.12)',
|
|
85
|
+
focusOpacity: 0.12,
|
|
86
|
+
activatedOpacity: 0.24
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const dark = exports.dark = getDark();
|
|
85
91
|
function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
86
92
|
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
|
87
93
|
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
|
@@ -233,12 +239,14 @@ function createPalette(palette) {
|
|
|
233
239
|
}
|
|
234
240
|
return color;
|
|
235
241
|
};
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
242
|
+
let modeHydrated;
|
|
243
|
+
if (mode === 'light') {
|
|
244
|
+
modeHydrated = getLight();
|
|
245
|
+
} else if (mode === 'dark') {
|
|
246
|
+
modeHydrated = getDark();
|
|
247
|
+
}
|
|
240
248
|
if (process.env.NODE_ENV !== 'production') {
|
|
241
|
-
if (!
|
|
249
|
+
if (!modeHydrated) {
|
|
242
250
|
console.error(`MUI: The palette mode \`${mode}\` is not supported.`);
|
|
243
251
|
}
|
|
244
252
|
}
|
|
@@ -297,7 +305,7 @@ function createPalette(palette) {
|
|
|
297
305
|
// E.g., shift from Red 500 to Red 300 or Red 700.
|
|
298
306
|
tonalOffset,
|
|
299
307
|
// The light and dark mode object.
|
|
300
|
-
...
|
|
308
|
+
...modeHydrated
|
|
301
309
|
}, other);
|
|
302
310
|
return paletteOutput;
|
|
303
311
|
}
|