@mui/material 7.3.4 → 7.3.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.
- package/Accordion/Accordion.d.ts +56 -55
- package/AccordionSummary/accordionSummaryClasses.d.ts +1 -1
- package/Alert/alertClasses.d.ts +24 -24
- package/AppBar/AppBar.d.ts +13 -2
- package/AppBar/AppBar.js +12 -1
- package/Breadcrumbs/BreadcrumbCollapsed.js +0 -2
- package/Button/Button.d.ts +1 -0
- package/Button/buttonClasses.d.ts +33 -33
- package/ButtonBase/ButtonBase.js +8 -1
- package/ButtonBase/TouchRipple.js +1 -1
- package/ButtonGroup/buttonGroupClasses.d.ts +17 -17
- package/CHANGELOG.md +142 -0
- package/Chip/Chip.js +1 -1
- package/Chip/chipClasses.d.ts +26 -26
- package/CircularProgress/circularProgressClasses.d.ts +2 -2
- package/Collapse/Collapse.d.ts +31 -1
- package/Collapse/Collapse.js +73 -30
- package/CssBaseline/CssBaseline.d.ts +1 -1
- package/CssBaseline/CssBaseline.js +1 -1
- package/DefaultPropsProvider/DefaultPropsProvider.d.ts +1 -1
- package/Dialog/dialogClasses.d.ts +2 -2
- package/Divider/dividerClasses.d.ts +1 -1
- package/Drawer/drawerClasses.d.ts +8 -8
- package/FormControl/FormControl.d.ts +1 -0
- package/FormHelperText/FormHelperText.d.ts +1 -0
- package/FormLabel/FormLabel.d.ts +1 -0
- package/GlobalStyles/GlobalStyles.js +0 -2
- package/IconButton/IconButton.d.ts +1 -0
- package/ImageListItemBar/imageListItemBarClasses.d.ts +4 -4
- package/InitColorSchemeScript/InitColorSchemeScript.d.ts +1 -2
- package/InitColorSchemeScript/InitColorSchemeScript.js +0 -2
- package/Input/inputClasses.d.ts +4 -4
- package/InputBase/inputBaseClasses.d.ts +5 -5
- package/InputLabel/InputLabel.d.ts +1 -0
- package/LinearProgress/linearProgressClasses.d.ts +9 -9
- package/ListItem/ListItem.d.ts +5 -0
- package/ListItem/ListItem.js +19 -4
- package/MenuList/MenuList.js +2 -1
- package/OutlinedInput/NotchedOutline.js +0 -2
- package/OutlinedInput/OutlinedInput.d.ts +1 -0
- package/OutlinedInput/outlinedInputClasses.d.ts +4 -4
- package/PaginationItem/paginationItemClasses.d.ts +4 -4
- package/Radio/RadioButtonIcon.js +0 -2
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +1 -1
- package/ScopedCssBaseline/ScopedCssBaseline.js +1 -1
- package/Select/SelectInput.d.ts +2 -0
- package/Select/SelectInput.js +6 -0
- package/Select/selectClasses.d.ts +3 -3
- package/Slider/Slider.d.ts +1 -1
- package/Slider/sliderClasses.d.ts +7 -7
- package/Slider/useSlider.types.d.ts +1 -1
- package/Snackbar/Snackbar.js +1 -3
- package/StepConnector/stepConnectorClasses.d.ts +2 -2
- package/TableSortLabel/tableSortLabelClasses.d.ts +2 -2
- package/Tabs/Tabs.js +3 -2
- package/TextField/TextField.d.ts +10 -5
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +2 -2
- package/Unstable_TrapFocus/FocusTrap.js +13 -8
- package/Zoom/Zoom.d.ts +1 -1
- package/Zoom/Zoom.js +1 -1
- package/esm/Accordion/Accordion.d.ts +56 -55
- package/esm/AccordionSummary/accordionSummaryClasses.d.ts +1 -1
- package/esm/Alert/alertClasses.d.ts +24 -24
- package/esm/AppBar/AppBar.d.ts +13 -2
- package/esm/AppBar/AppBar.js +12 -1
- package/esm/Breadcrumbs/BreadcrumbCollapsed.js +0 -1
- package/esm/Button/Button.d.ts +1 -0
- package/esm/Button/buttonClasses.d.ts +33 -33
- package/esm/ButtonBase/ButtonBase.js +8 -1
- package/esm/ButtonBase/TouchRipple.js +1 -1
- package/esm/ButtonGroup/buttonGroupClasses.d.ts +17 -17
- package/esm/Chip/Chip.js +1 -1
- package/esm/Chip/chipClasses.d.ts +26 -26
- package/esm/CircularProgress/circularProgressClasses.d.ts +2 -2
- package/esm/Collapse/Collapse.d.ts +31 -1
- package/esm/Collapse/Collapse.js +73 -30
- package/esm/CssBaseline/CssBaseline.d.ts +1 -1
- package/esm/CssBaseline/CssBaseline.js +1 -1
- package/esm/DefaultPropsProvider/DefaultPropsProvider.d.ts +1 -1
- package/esm/Dialog/dialogClasses.d.ts +2 -2
- package/esm/Divider/dividerClasses.d.ts +1 -1
- package/esm/Drawer/drawerClasses.d.ts +8 -8
- package/esm/FormControl/FormControl.d.ts +1 -0
- package/esm/FormHelperText/FormHelperText.d.ts +1 -0
- package/esm/FormLabel/FormLabel.d.ts +1 -0
- package/esm/GlobalStyles/GlobalStyles.js +0 -1
- package/esm/IconButton/IconButton.d.ts +1 -0
- package/esm/ImageListItemBar/imageListItemBarClasses.d.ts +4 -4
- package/esm/InitColorSchemeScript/InitColorSchemeScript.d.ts +1 -2
- package/esm/InitColorSchemeScript/InitColorSchemeScript.js +0 -1
- package/esm/Input/inputClasses.d.ts +4 -4
- package/esm/InputBase/inputBaseClasses.d.ts +5 -5
- package/esm/InputLabel/InputLabel.d.ts +1 -0
- package/esm/LinearProgress/linearProgressClasses.d.ts +9 -9
- package/esm/ListItem/ListItem.d.ts +5 -0
- package/esm/ListItem/ListItem.js +19 -4
- package/esm/MenuList/MenuList.js +2 -1
- package/esm/OutlinedInput/NotchedOutline.js +0 -1
- package/esm/OutlinedInput/OutlinedInput.d.ts +1 -0
- package/esm/OutlinedInput/outlinedInputClasses.d.ts +4 -4
- package/esm/PaginationItem/paginationItemClasses.d.ts +4 -4
- package/esm/Radio/RadioButtonIcon.js +0 -1
- package/esm/ScopedCssBaseline/ScopedCssBaseline.d.ts +1 -1
- package/esm/ScopedCssBaseline/ScopedCssBaseline.js +1 -1
- package/esm/Select/SelectInput.d.ts +2 -0
- package/esm/Select/SelectInput.js +6 -0
- package/esm/Select/selectClasses.d.ts +3 -3
- package/esm/Slider/Slider.d.ts +1 -1
- package/esm/Slider/sliderClasses.d.ts +7 -7
- package/esm/Slider/useSlider.types.d.ts +1 -1
- package/esm/Snackbar/Snackbar.js +1 -3
- package/esm/StepConnector/stepConnectorClasses.d.ts +2 -2
- package/esm/TableSortLabel/tableSortLabelClasses.d.ts +2 -2
- package/esm/Tabs/Tabs.js +3 -2
- package/esm/TextField/TextField.d.ts +10 -5
- package/esm/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +2 -2
- package/esm/Unstable_TrapFocus/FocusTrap.js +13 -8
- package/esm/Zoom/Zoom.d.ts +1 -1
- package/esm/Zoom/Zoom.js +1 -1
- package/esm/index.js +1 -1
- package/esm/internal/svg-icons/Add.js +0 -1
- package/esm/internal/svg-icons/ArrowDownward.js +0 -1
- package/esm/internal/svg-icons/ArrowDropDown.js +0 -1
- package/esm/internal/svg-icons/Cancel.js +0 -1
- package/esm/internal/svg-icons/CheckBox.js +0 -1
- package/esm/internal/svg-icons/CheckBoxOutlineBlank.js +0 -1
- package/esm/internal/svg-icons/CheckCircle.js +0 -1
- package/esm/internal/svg-icons/Close.js +0 -1
- package/esm/internal/svg-icons/ErrorOutline.js +0 -1
- package/esm/internal/svg-icons/FirstPage.js +0 -1
- package/esm/internal/svg-icons/IndeterminateCheckBox.js +0 -1
- package/esm/internal/svg-icons/InfoOutlined.js +0 -1
- package/esm/internal/svg-icons/KeyboardArrowLeft.js +0 -1
- package/esm/internal/svg-icons/KeyboardArrowRight.js +0 -1
- package/esm/internal/svg-icons/LastPage.js +0 -1
- package/esm/internal/svg-icons/MoreHoriz.js +0 -1
- package/esm/internal/svg-icons/NavigateBefore.js +0 -1
- package/esm/internal/svg-icons/NavigateNext.js +0 -1
- package/esm/internal/svg-icons/Person.js +0 -1
- package/esm/internal/svg-icons/RadioButtonChecked.js +0 -1
- package/esm/internal/svg-icons/RadioButtonUnchecked.js +0 -1
- package/esm/internal/svg-icons/ReportProblemOutlined.js +0 -1
- package/esm/internal/svg-icons/Star.js +0 -1
- package/esm/internal/svg-icons/StarBorder.js +0 -1
- package/esm/internal/svg-icons/SuccessOutlined.js +0 -1
- package/esm/internal/svg-icons/Warning.js +0 -1
- package/esm/locale/caES.js +45 -42
- package/esm/styles/ThemeProvider.d.ts +1 -1
- package/esm/styles/ThemeProviderWithVars.d.ts +2 -3
- package/esm/styles/ThemeProviderWithVars.js +0 -1
- package/esm/styles/createThemeFoundation.d.ts +5 -3
- package/esm/styles/createThemeNoVars.d.ts +6 -3
- package/esm/styles/createThemeWithVars.d.ts +4 -4
- package/esm/styles/index.d.ts +1 -1
- package/esm/useAutocomplete/useAutocomplete.js +15 -2
- package/esm/utils/getActiveElement.d.ts +2 -0
- package/esm/utils/getActiveElement.js +2 -0
- package/esm/version/index.js +2 -2
- package/esm/zero-styled/index.d.ts +1 -2
- package/esm/zero-styled/index.js +0 -1
- package/index.js +1 -1
- package/internal/svg-icons/Add.js +0 -2
- package/internal/svg-icons/ArrowDownward.js +0 -2
- package/internal/svg-icons/ArrowDropDown.js +0 -2
- package/internal/svg-icons/Cancel.js +0 -2
- package/internal/svg-icons/CheckBox.js +0 -2
- package/internal/svg-icons/CheckBoxOutlineBlank.js +0 -2
- package/internal/svg-icons/CheckCircle.js +0 -2
- package/internal/svg-icons/Close.js +0 -2
- package/internal/svg-icons/ErrorOutline.js +0 -2
- package/internal/svg-icons/FirstPage.js +0 -2
- package/internal/svg-icons/IndeterminateCheckBox.js +0 -2
- package/internal/svg-icons/InfoOutlined.js +0 -2
- package/internal/svg-icons/KeyboardArrowLeft.js +0 -2
- package/internal/svg-icons/KeyboardArrowRight.js +0 -2
- package/internal/svg-icons/LastPage.js +0 -2
- package/internal/svg-icons/MoreHoriz.js +0 -2
- package/internal/svg-icons/NavigateBefore.js +0 -2
- package/internal/svg-icons/NavigateNext.js +0 -2
- package/internal/svg-icons/Person.js +0 -2
- package/internal/svg-icons/RadioButtonChecked.js +0 -2
- package/internal/svg-icons/RadioButtonUnchecked.js +0 -2
- package/internal/svg-icons/ReportProblemOutlined.js +0 -2
- package/internal/svg-icons/Star.js +0 -2
- package/internal/svg-icons/StarBorder.js +0 -2
- package/internal/svg-icons/SuccessOutlined.js +0 -2
- package/internal/svg-icons/Warning.js +0 -2
- package/locale/caES.js +45 -42
- package/package.json +7 -7
- package/styles/ThemeProvider.d.ts +1 -1
- package/styles/ThemeProviderWithVars.d.ts +2 -3
- package/styles/ThemeProviderWithVars.js +0 -2
- package/styles/createThemeFoundation.d.ts +5 -3
- package/styles/createThemeNoVars.d.ts +6 -3
- package/styles/createThemeWithVars.d.ts +4 -4
- package/styles/index.d.ts +1 -1
- package/useAutocomplete/useAutocomplete.js +15 -2
- package/utils/getActiveElement.d.ts +2 -0
- package/utils/getActiveElement.js +9 -0
- package/version/index.js +2 -2
- package/zero-styled/index.d.ts +1 -2
- package/zero-styled/index.js +0 -2
|
@@ -8,6 +8,7 @@ import ownerDocument from '@mui/utils/ownerDocument';
|
|
|
8
8
|
import getReactElementRef from '@mui/utils/getReactElementRef';
|
|
9
9
|
import exactProp from '@mui/utils/exactProp';
|
|
10
10
|
import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
|
|
11
|
+
import getActiveElement from "../utils/getActiveElement.js";
|
|
11
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
// Inspired by https://github.com/focus-trap/tabbable
|
|
13
14
|
const candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'].join(',');
|
|
@@ -111,7 +112,8 @@ function FocusTrap(props) {
|
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
114
|
const doc = ownerDocument(rootRef.current);
|
|
114
|
-
|
|
115
|
+
const activeElement = getActiveElement(doc);
|
|
116
|
+
if (!rootRef.current.contains(activeElement)) {
|
|
115
117
|
if (!rootRef.current.hasAttribute('tabIndex')) {
|
|
116
118
|
if (process.env.NODE_ENV !== 'production') {
|
|
117
119
|
console.error(['MUI: The modal content node does not accept focus.', 'For the benefit of assistive technologies, ' + 'the tabIndex of the node is being set to "-1".'].join('\n'));
|
|
@@ -146,6 +148,7 @@ function FocusTrap(props) {
|
|
|
146
148
|
return;
|
|
147
149
|
}
|
|
148
150
|
const doc = ownerDocument(rootRef.current);
|
|
151
|
+
const activeElement = getActiveElement(doc);
|
|
149
152
|
const loopFocus = nativeEvent => {
|
|
150
153
|
lastKeydown.current = nativeEvent;
|
|
151
154
|
if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== 'Tab') {
|
|
@@ -153,8 +156,8 @@ function FocusTrap(props) {
|
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
// Make sure the next tab starts from the right place.
|
|
156
|
-
//
|
|
157
|
-
if (
|
|
159
|
+
// activeElement refers to the origin.
|
|
160
|
+
if (activeElement === rootRef.current && nativeEvent.shiftKey) {
|
|
158
161
|
// We need to ignore the next contain as
|
|
159
162
|
// it will try to move the focus back to the rootRef element.
|
|
160
163
|
ignoreNextEnforceFocus.current = true;
|
|
@@ -171,23 +174,24 @@ function FocusTrap(props) {
|
|
|
171
174
|
if (rootElement === null) {
|
|
172
175
|
return;
|
|
173
176
|
}
|
|
177
|
+
const activeEl = getActiveElement(doc);
|
|
174
178
|
if (!doc.hasFocus() || !isEnabled() || ignoreNextEnforceFocus.current) {
|
|
175
179
|
ignoreNextEnforceFocus.current = false;
|
|
176
180
|
return;
|
|
177
181
|
}
|
|
178
182
|
|
|
179
183
|
// The focus is already inside
|
|
180
|
-
if (rootElement.contains(
|
|
184
|
+
if (rootElement.contains(activeEl)) {
|
|
181
185
|
return;
|
|
182
186
|
}
|
|
183
187
|
|
|
184
188
|
// The disableEnforceFocus is set and the focus is outside of the focus trap (and sentinel nodes)
|
|
185
|
-
if (disableEnforceFocus &&
|
|
189
|
+
if (disableEnforceFocus && activeEl !== sentinelStart.current && activeEl !== sentinelEnd.current) {
|
|
186
190
|
return;
|
|
187
191
|
}
|
|
188
192
|
|
|
189
193
|
// if the focus event is not coming from inside the children's react tree, reset the refs
|
|
190
|
-
if (
|
|
194
|
+
if (activeEl !== reactFocusEventTarget.current) {
|
|
191
195
|
reactFocusEventTarget.current = null;
|
|
192
196
|
} else if (reactFocusEventTarget.current !== null) {
|
|
193
197
|
return;
|
|
@@ -196,7 +200,7 @@ function FocusTrap(props) {
|
|
|
196
200
|
return;
|
|
197
201
|
}
|
|
198
202
|
let tabbable = [];
|
|
199
|
-
if (
|
|
203
|
+
if (activeEl === sentinelStart.current || activeEl === sentinelEnd.current) {
|
|
200
204
|
tabbable = getTabbable(rootRef.current);
|
|
201
205
|
}
|
|
202
206
|
|
|
@@ -228,7 +232,8 @@ function FocusTrap(props) {
|
|
|
228
232
|
// The whatwg spec defines how the browser should behave but does not explicitly mention any events:
|
|
229
233
|
// https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule.
|
|
230
234
|
const interval = setInterval(() => {
|
|
231
|
-
|
|
235
|
+
const activeEl = getActiveElement(doc);
|
|
236
|
+
if (activeEl && activeEl.tagName === 'BODY') {
|
|
232
237
|
contain();
|
|
233
238
|
}
|
|
234
239
|
}, 50);
|
package/esm/Zoom/Zoom.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface ZoomProps extends TransitionProps {
|
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* The Zoom transition can be used for the floating variant of the
|
|
37
|
-
* [Button](https://mui.com/material-ui/react-
|
|
37
|
+
* [Button](https://mui.com/material-ui/react-floating-action-button/#animation) component.
|
|
38
38
|
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
|
|
39
39
|
*
|
|
40
40
|
* Demos:
|
package/esm/Zoom/Zoom.js
CHANGED
|
@@ -20,7 +20,7 @@ const styles = {
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* The Zoom transition can be used for the floating variant of the
|
|
23
|
-
* [Button](/material-ui/react-
|
|
23
|
+
* [Button](/material-ui/react-floating-action-button/#animation) component.
|
|
24
24
|
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
|
|
25
25
|
*/
|
|
26
26
|
const Zoom = /*#__PURE__*/React.forwardRef(function Zoom(props, ref) {
|
package/esm/index.js
CHANGED
package/esm/locale/caES.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
export const caES = {
|
|
2
2
|
components: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
MuiBreadcrumbs: {
|
|
4
|
+
defaultProps: {
|
|
5
|
+
expandText: 'Mostra el camí'
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
8
|
MuiTablePagination: {
|
|
9
9
|
defaultProps: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
labelRowsPerPage: 'Files per pàgina:'
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
getItemAriaLabel: type => {
|
|
11
|
+
if (type === 'first') {
|
|
12
|
+
return 'Ves a la primera pàgina';
|
|
13
|
+
}
|
|
14
|
+
if (type === 'last') {
|
|
15
|
+
return "Ves a l'última pàgina";
|
|
16
|
+
}
|
|
17
|
+
if (type === 'next') {
|
|
18
|
+
return 'Ves a la pàgina següent';
|
|
19
|
+
}
|
|
20
|
+
// if (type === 'previous') {
|
|
21
|
+
return 'Ves a la pàgina anterior';
|
|
22
|
+
},
|
|
23
|
+
labelRowsPerPage: 'Files per pàgina:',
|
|
24
|
+
labelDisplayedRows: ({
|
|
25
|
+
from,
|
|
26
|
+
to,
|
|
27
|
+
count
|
|
28
|
+
}) => `${from}–${to} de ${count !== -1 ? count : `més de ${to}`}`
|
|
26
29
|
}
|
|
27
30
|
},
|
|
28
31
|
MuiRating: {
|
|
@@ -44,27 +47,27 @@ export const caES = {
|
|
|
44
47
|
defaultProps: {
|
|
45
48
|
closeText: 'Tancat'
|
|
46
49
|
}
|
|
50
|
+
},
|
|
51
|
+
MuiPagination: {
|
|
52
|
+
defaultProps: {
|
|
53
|
+
'aria-label': 'Navegació entre pàgines',
|
|
54
|
+
getItemAriaLabel: (type, page, selected) => {
|
|
55
|
+
if (type === 'page') {
|
|
56
|
+
return `${selected ? '' : 'Ves a la '}pàgina ${page}`;
|
|
57
|
+
}
|
|
58
|
+
if (type === 'first') {
|
|
59
|
+
return 'Ves a la primera pàgina';
|
|
60
|
+
}
|
|
61
|
+
if (type === 'last') {
|
|
62
|
+
return "Ves a l'última pàgina";
|
|
63
|
+
}
|
|
64
|
+
if (type === 'next') {
|
|
65
|
+
return 'Ves a la pàgina següent';
|
|
66
|
+
}
|
|
67
|
+
// if (type === 'previous') {
|
|
68
|
+
return 'Ves a la pàgina anterior';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
47
71
|
}
|
|
48
|
-
// MuiPagination: {
|
|
49
|
-
// defaultProps: {
|
|
50
|
-
// 'aria-label': 'Pagination navigation',
|
|
51
|
-
// getItemAriaLabel: (type, page, selected) => {
|
|
52
|
-
// if (type === 'page') {
|
|
53
|
-
// return `${selected ? '' : 'Go to '}page ${page}`;
|
|
54
|
-
// }
|
|
55
|
-
// if (type === 'first') {
|
|
56
|
-
// return 'Go to first page';
|
|
57
|
-
// }
|
|
58
|
-
// if (type === 'last') {
|
|
59
|
-
// return 'Go to last page';
|
|
60
|
-
// }
|
|
61
|
-
// if (type === 'next') {
|
|
62
|
-
// return 'Go to next page';
|
|
63
|
-
// }
|
|
64
|
-
// // if (type === 'previous') {
|
|
65
|
-
// return 'Go to previous page';
|
|
66
|
-
// },
|
|
67
|
-
// },
|
|
68
|
-
// },
|
|
69
72
|
}
|
|
70
73
|
};
|
|
@@ -72,5 +72,5 @@ export interface ThemeProviderProps<Theme = DefaultTheme> extends ThemeProviderC
|
|
|
72
72
|
export default function ThemeProvider<Theme = DefaultTheme>({
|
|
73
73
|
theme,
|
|
74
74
|
...props
|
|
75
|
-
}: ThemeProviderProps<Theme>):
|
|
75
|
+
}: ThemeProviderProps<Theme>): import("react/jsx-runtime").JSX.Element;
|
|
76
76
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { SupportedColorScheme } from "./createThemeWithVars.js";
|
|
3
2
|
declare const useColorScheme: () => import("@mui/system").ColorSchemeContextValue<SupportedColorScheme>, deprecatedGetInitColorSchemeScript: typeof import("@mui/system/InitColorSchemeScript").default;
|
|
4
|
-
declare function Experimental_CssVarsProvider(props: any):
|
|
3
|
+
declare function Experimental_CssVarsProvider(props: any): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
declare const getInitColorSchemeScript: typeof deprecatedGetInitColorSchemeScript;
|
|
6
5
|
/**
|
|
7
6
|
* TODO: remove this export in v7
|
|
@@ -26,7 +25,7 @@ declare const getInitColorSchemeScript: typeof deprecatedGetInitColorSchemeScrip
|
|
|
26
25
|
*
|
|
27
26
|
* To see the full documentation, check out https://mui.com/material-ui/customization/css-theme-variables/usage/.
|
|
28
27
|
*/
|
|
29
|
-
export declare const CssVarsProvider: (props:
|
|
28
|
+
export declare const CssVarsProvider: (props: import("react").PropsWithChildren<Partial<import("@mui/system").CssVarsProviderConfig<SupportedColorScheme>> & {
|
|
30
29
|
theme?: {
|
|
31
30
|
cssVariables?: false;
|
|
32
31
|
cssVarPrefix?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OverridableStringUnion } from '@mui/types';
|
|
2
|
-
import { SxConfig, SxProps, CSSObject, ApplyStyles, Theme as SystemTheme } from '@mui/system';
|
|
2
|
+
import { SxConfig, SxProps, CSSObject, ApplyStyles, Theme as SystemTheme, Shape as SystemShape, ShapeOptions as SystemShapeOptions } from '@mui/system';
|
|
3
3
|
import { ExtractTypographyTokens } from '@mui/system/cssVars';
|
|
4
4
|
import { Palette, PaletteOptions } from "./createPalette.js";
|
|
5
5
|
import { Shadows } from "./shadows.js";
|
|
@@ -152,6 +152,8 @@ export interface PaletteTableCell {
|
|
|
152
152
|
export interface PaletteTooltip {
|
|
153
153
|
bg: string;
|
|
154
154
|
}
|
|
155
|
+
export interface Shape extends SystemShape {}
|
|
156
|
+
export interface ShapeOptions extends SystemShapeOptions {}
|
|
155
157
|
export interface ColorSystemOptions {
|
|
156
158
|
palette?: PaletteOptions & {
|
|
157
159
|
background?: Partial<PaletteBackgroundChannel>;
|
|
@@ -224,7 +226,7 @@ export interface ThemeVars {
|
|
|
224
226
|
opacity: Opacity;
|
|
225
227
|
overlays: Overlays;
|
|
226
228
|
shadows: Shadows;
|
|
227
|
-
shape:
|
|
229
|
+
shape: Shape;
|
|
228
230
|
spacing: string;
|
|
229
231
|
zIndex: ZIndex;
|
|
230
232
|
}
|
|
@@ -256,7 +258,7 @@ export interface CssVarsTheme extends ColorSystem {
|
|
|
256
258
|
generateSpacing: () => SystemTheme['spacing'];
|
|
257
259
|
spacing: SystemTheme['spacing'];
|
|
258
260
|
breakpoints: SystemTheme['breakpoints'];
|
|
259
|
-
shape:
|
|
261
|
+
shape: Shape;
|
|
260
262
|
typography: TypographyVariants;
|
|
261
263
|
transitions: Transitions;
|
|
262
264
|
shadows: Shadows;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme, SxProps, CSSObject, SxConfig } from '@mui/system';
|
|
1
|
+
import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme, SxProps, CSSObject, SxConfig, ApplyStyles } from '@mui/system';
|
|
2
2
|
import { Mixins, MixinsOptions } from "./createMixins.js";
|
|
3
3
|
import { Palette, PaletteOptions } from "./createPalette.js";
|
|
4
4
|
import { TypographyVariants, TypographyVariantsOptions } from "./createTypography.js";
|
|
@@ -6,7 +6,7 @@ import { Shadows } from "./shadows.js";
|
|
|
6
6
|
import { Transitions, TransitionsOptions } from "./createTransitions.js";
|
|
7
7
|
import { ZIndex, ZIndexOptions } from "./zIndex.js";
|
|
8
8
|
import { Components } from "./components.js";
|
|
9
|
-
import { CssVarsTheme, CssVarsPalette, ColorSystemOptions } from "./createThemeFoundation.js";
|
|
9
|
+
import { CssVarsTheme, CssVarsPalette, ColorSystemOptions, Shape, ShapeOptions, SupportedColorScheme } from "./createThemeFoundation.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* To disable custom properties, use module augmentation
|
|
@@ -27,6 +27,7 @@ export interface ThemeOptions extends Omit<SystemThemeOptions, 'zIndex'>, CssVar
|
|
|
27
27
|
components?: Components<Omit<Theme, 'components'>>;
|
|
28
28
|
palette?: PaletteOptions;
|
|
29
29
|
shadows?: Shadows;
|
|
30
|
+
shape?: ShapeOptions;
|
|
30
31
|
transitions?: TransitionsOptions;
|
|
31
32
|
typography?: TypographyVariantsOptions | ((palette: Palette) => TypographyVariantsOptions);
|
|
32
33
|
zIndex?: ZIndexOptions;
|
|
@@ -40,17 +41,19 @@ export interface BaseTheme extends SystemTheme {
|
|
|
40
41
|
enabled: true;
|
|
41
42
|
} ? CssVarsPalette : {});
|
|
42
43
|
shadows: Shadows;
|
|
44
|
+
shape: Shape;
|
|
43
45
|
transitions: Transitions;
|
|
44
46
|
typography: TypographyVariants;
|
|
45
47
|
zIndex: ZIndex;
|
|
46
48
|
unstable_strictMode?: boolean;
|
|
49
|
+
applyStyles: ApplyStyles<SupportedColorScheme>;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
// shut off automatic exporting for the `BaseTheme` above
|
|
50
53
|
export {};
|
|
51
54
|
type CssVarsProperties = CssThemeVariables extends {
|
|
52
55
|
enabled: true;
|
|
53
|
-
} ? Pick<CssVarsTheme, '
|
|
56
|
+
} ? Pick<CssVarsTheme, 'colorSchemes' | 'colorSchemeSelector' | 'rootSelector' | 'cssVarPrefix' | 'defaultColorScheme' | 'getCssVar' | 'getColorSchemeSelector' | 'generateThemeVars' | 'generateStyleSheets' | 'generateSpacing' | 'shouldSkipGeneratingVar' | 'vars'> : Partial<Pick<CssVarsTheme, 'vars'>>;
|
|
54
57
|
|
|
55
58
|
/**
|
|
56
59
|
* Our [TypeScript guide on theme customization](https://mui.com/material-ui/guides/typescript/#customization-of-theme) explains in detail how you would add custom properties.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ThemeOptions, Theme } from "./createThemeNoVars.js";
|
|
2
2
|
import { Components } from "./components.js";
|
|
3
|
-
import { DefaultColorScheme, ColorSchemeOverrides, ExtendedColorScheme, SupportedColorScheme, Opacity, Overlays, PaletteBackgroundChannel, PaletteCommonChannel, PaletteColorChannel, PaletteActionChannel, PaletteTextChannel, PaletteAlert, PaletteAppBar, PaletteAvatar, PaletteButton, PaletteChip, PaletteFilledInput, PaletteLinearProgress, PaletteSkeleton, PaletteSlider, PaletteSnackbarContent, PaletteSpeedDialAction, PaletteStepConnector, PaletteStepContent, PaletteSwitch, PaletteTableCell, PaletteTooltip, ColorSystemOptions, CssVarsPalette, ColorSystem, ThemeVars, ThemeCssVarOverrides, ThemeCssVar, CssVarsTheme } from "./createThemeFoundation.js";
|
|
3
|
+
import { DefaultColorScheme, ColorSchemeOverrides, ExtendedColorScheme, SupportedColorScheme, Opacity, Overlays, PaletteBackgroundChannel, PaletteCommonChannel, PaletteColorChannel, PaletteActionChannel, PaletteTextChannel, PaletteAlert, PaletteAppBar, PaletteAvatar, PaletteButton, PaletteChip, PaletteFilledInput, PaletteLinearProgress, PaletteSkeleton, PaletteSlider, PaletteSnackbarContent, PaletteSpeedDialAction, PaletteStepConnector, PaletteStepContent, PaletteSwitch, PaletteTableCell, PaletteTooltip, ColorSystemOptions, CssVarsPalette, ColorSystem, ThemeVars, ThemeCssVarOverrides, ThemeCssVar, CssVarsTheme, Shape, ShapeOptions } from "./createThemeFoundation.js";
|
|
4
4
|
|
|
5
5
|
// Re-export all types from foundation to maintain backward compatibility
|
|
6
|
-
export type { DefaultColorScheme, ColorSchemeOverrides, ExtendedColorScheme, SupportedColorScheme, Opacity, Overlays, PaletteBackgroundChannel, PaletteCommonChannel, PaletteColorChannel, PaletteActionChannel, PaletteTextChannel, PaletteAlert, PaletteAppBar, PaletteAvatar, PaletteButton, PaletteChip, PaletteFilledInput, PaletteLinearProgress, PaletteSkeleton, PaletteSlider, PaletteSnackbarContent, PaletteSpeedDialAction, PaletteStepConnector, PaletteStepContent, PaletteSwitch, PaletteTableCell, PaletteTooltip, ColorSystemOptions, CssVarsPalette, ColorSystem, ThemeVars, ThemeCssVarOverrides, ThemeCssVar, CssVarsTheme };
|
|
6
|
+
export type { DefaultColorScheme, ColorSchemeOverrides, ExtendedColorScheme, SupportedColorScheme, Opacity, Overlays, PaletteBackgroundChannel, PaletteCommonChannel, PaletteColorChannel, PaletteActionChannel, PaletteTextChannel, PaletteAlert, PaletteAppBar, PaletteAvatar, PaletteButton, PaletteChip, PaletteFilledInput, PaletteLinearProgress, PaletteSkeleton, PaletteSlider, PaletteSnackbarContent, PaletteSpeedDialAction, PaletteStepConnector, PaletteStepContent, PaletteSwitch, PaletteTableCell, PaletteTooltip, ColorSystemOptions, CssVarsPalette, ColorSystem, ThemeVars, ThemeCssVarOverrides, ThemeCssVar, CssVarsTheme, Shape, ShapeOptions };
|
|
7
7
|
export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'components'> {
|
|
8
8
|
/**
|
|
9
9
|
* The strategy to generate CSS variables
|
|
10
10
|
*
|
|
11
11
|
* @example 'media'
|
|
12
|
-
* Generate CSS variables using [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
|
|
12
|
+
* Generate CSS variables using [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-color-scheme)
|
|
13
13
|
*
|
|
14
14
|
* @example '.mode-%s'
|
|
15
15
|
* Generate CSS variables within a class .mode-light, .mode-dark
|
|
@@ -25,7 +25,7 @@ export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'com
|
|
|
25
25
|
cssVarPrefix?: string;
|
|
26
26
|
/**
|
|
27
27
|
* If `true`, the CSS color-scheme will not be set.
|
|
28
|
-
* https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
|
|
28
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/color-scheme
|
|
29
29
|
* @default false
|
|
30
30
|
*/
|
|
31
31
|
disableCssColorScheme?: boolean;
|
package/esm/styles/index.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export { default as withTheme } from "./withTheme.js";
|
|
|
59
59
|
export * from "./ThemeProviderWithVars.js";
|
|
60
60
|
export type { StorageManager } from '@mui/system/cssVars';
|
|
61
61
|
export { default as extendTheme } from "./createThemeWithVars.js";
|
|
62
|
-
export type { ColorSchemeOverrides, SupportedColorScheme, ColorSystem, CssVarsPalette, Opacity, Overlays, PaletteAlert, PaletteActionChannel, PaletteAppBar, PaletteAvatar, PaletteChip, PaletteColorChannel, PaletteCommonChannel, PaletteFilledInput, PaletteLinearProgress, PaletteSkeleton, PaletteSlider, PaletteSnackbarContent, PaletteSpeedDialAction, PaletteStepConnector, PaletteStepContent, PaletteSwitch, PaletteTableCell, PaletteTextChannel, PaletteTooltip, CssVarsThemeOptions, CssVarsTheme, ThemeVars, ThemeCssVar, ThemeCssVarOverrides, ColorSystemOptions } from "./createThemeWithVars.js";
|
|
62
|
+
export type { ColorSchemeOverrides, SupportedColorScheme, ColorSystem, CssVarsPalette, Opacity, Overlays, PaletteAlert, PaletteActionChannel, PaletteAppBar, PaletteAvatar, PaletteChip, PaletteColorChannel, PaletteCommonChannel, PaletteFilledInput, PaletteLinearProgress, PaletteSkeleton, PaletteSlider, PaletteSnackbarContent, PaletteSpeedDialAction, PaletteStepConnector, PaletteStepContent, PaletteSwitch, PaletteTableCell, PaletteTextChannel, PaletteTooltip, CssVarsThemeOptions, CssVarsTheme, ThemeVars, ThemeCssVar, ThemeCssVarOverrides, ColorSystemOptions, Shape, ShapeOptions } from "./createThemeWithVars.js";
|
|
63
63
|
export { default as getOverlayAlpha } from "./getOverlayAlpha.js";
|
|
64
64
|
export { default as shouldSkipGeneratingVar } from "./shouldSkipGeneratingVar.js";
|
|
65
65
|
|
|
@@ -465,7 +465,7 @@ function useAutocomplete(props) {
|
|
|
465
465
|
filteredOptions.length,
|
|
466
466
|
// Don't sync the highlighted index with the value when multiple
|
|
467
467
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
468
|
-
multiple ? false : value,
|
|
468
|
+
multiple ? false : value, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);
|
|
469
469
|
const handleListboxRef = useEventCallback(node => {
|
|
470
470
|
setRef(listboxRef, node);
|
|
471
471
|
if (!node) {
|
|
@@ -693,7 +693,8 @@ function useAutocomplete(props) {
|
|
|
693
693
|
handleOpen(event);
|
|
694
694
|
break;
|
|
695
695
|
case 'ArrowLeft':
|
|
696
|
-
if (!multiple && renderValue) {
|
|
696
|
+
if (!multiple && renderValue && value != null) {
|
|
697
|
+
setFocusedItem(0);
|
|
697
698
|
focusItem(0);
|
|
698
699
|
} else {
|
|
699
700
|
handleFocusItem(event, 'previous');
|
|
@@ -701,6 +702,7 @@ function useAutocomplete(props) {
|
|
|
701
702
|
break;
|
|
702
703
|
case 'ArrowRight':
|
|
703
704
|
if (!multiple && renderValue) {
|
|
705
|
+
setFocusedItem(-1);
|
|
704
706
|
focusItem(-1);
|
|
705
707
|
} else {
|
|
706
708
|
handleFocusItem(event, 'next');
|
|
@@ -757,6 +759,7 @@ function useAutocomplete(props) {
|
|
|
757
759
|
}
|
|
758
760
|
if (!multiple && renderValue && !readOnly) {
|
|
759
761
|
setValueState(null);
|
|
762
|
+
setFocusedItem(-1);
|
|
760
763
|
focusItem(-1);
|
|
761
764
|
}
|
|
762
765
|
break;
|
|
@@ -772,6 +775,7 @@ function useAutocomplete(props) {
|
|
|
772
775
|
}
|
|
773
776
|
if (!multiple && renderValue && !readOnly) {
|
|
774
777
|
setValueState(null);
|
|
778
|
+
setFocusedItem(-1);
|
|
775
779
|
focusItem(-1);
|
|
776
780
|
}
|
|
777
781
|
break;
|
|
@@ -781,6 +785,15 @@ function useAutocomplete(props) {
|
|
|
781
785
|
};
|
|
782
786
|
const handleFocus = event => {
|
|
783
787
|
setFocused(true);
|
|
788
|
+
|
|
789
|
+
// When focusing the input, ensure any previously focused item (chip)
|
|
790
|
+
// is cleared so the input receives the visible caret and the
|
|
791
|
+
// input-focused styling is applied.
|
|
792
|
+
if (focusedItem !== -1) {
|
|
793
|
+
setFocusedItem(-1);
|
|
794
|
+
// Ensure DOM focus lands on the input
|
|
795
|
+
focusItem(-1);
|
|
796
|
+
}
|
|
784
797
|
if (openOnFocus && !ignoreFocus.current) {
|
|
785
798
|
handleOpen(event);
|
|
786
799
|
}
|