@mui/material 9.0.0-alpha.4 → 9.0.0-beta.1
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.mts +1 -1
- package/Accordion/Accordion.d.ts +1 -1
- package/AccordionSummary/AccordionSummary.js +1 -0
- package/AccordionSummary/AccordionSummary.mjs +1 -0
- package/Backdrop/Backdrop.d.mts +1 -1
- package/Backdrop/Backdrop.d.ts +1 -1
- package/BottomNavigationAction/BottomNavigationAction.js +1 -0
- package/BottomNavigationAction/BottomNavigationAction.mjs +1 -0
- package/Breadcrumbs/BreadcrumbCollapsed.js +5 -1
- package/Breadcrumbs/BreadcrumbCollapsed.mjs +5 -1
- package/Button/Button.js +1 -0
- package/Button/Button.mjs +1 -0
- package/ButtonBase/ButtonBase.d.mts +5 -0
- package/ButtonBase/ButtonBase.d.ts +5 -0
- package/ButtonBase/ButtonBase.js +84 -85
- package/ButtonBase/ButtonBase.mjs +84 -85
- package/ButtonBase/useButtonBase.d.mts +91 -0
- package/ButtonBase/useButtonBase.d.ts +91 -0
- package/ButtonBase/useButtonBase.js +174 -0
- package/ButtonBase/useButtonBase.mjs +167 -0
- package/ButtonGroup/ButtonGroup.js +1 -9
- package/ButtonGroup/ButtonGroup.mjs +1 -9
- package/ButtonGroup/buttonGroupClasses.d.mts +0 -68
- package/ButtonGroup/buttonGroupClasses.d.ts +0 -68
- package/ButtonGroup/buttonGroupClasses.js +1 -1
- package/ButtonGroup/buttonGroupClasses.mjs +1 -1
- package/CHANGELOG.md +119 -4
- package/CardActionArea/CardActionArea.js +1 -0
- package/CardActionArea/CardActionArea.mjs +1 -0
- package/CardHeader/CardHeader.d.mts +13 -21
- package/CardHeader/CardHeader.d.ts +13 -21
- package/CardHeader/CardHeader.js +3 -21
- package/CardHeader/CardHeader.mjs +3 -21
- package/Checkbox/Checkbox.js +1 -7
- package/Checkbox/Checkbox.mjs +1 -7
- package/Chip/Chip.d.mts +7 -0
- package/Chip/Chip.d.ts +7 -0
- package/Chip/Chip.js +66 -55
- package/Chip/Chip.mjs +66 -55
- package/Chip/chipClasses.d.mts +0 -104
- package/Chip/chipClasses.d.ts +0 -104
- package/Chip/chipClasses.js +1 -1
- package/Chip/chipClasses.mjs +1 -1
- package/Dialog/Dialog.d.mts +8 -22
- package/Dialog/Dialog.d.ts +8 -22
- package/Dialog/Dialog.js +43 -72
- package/Dialog/Dialog.mjs +43 -72
- package/Dialog/dialogClasses.d.mts +0 -8
- package/Dialog/dialogClasses.d.ts +0 -8
- package/Dialog/dialogClasses.js +1 -1
- package/Dialog/dialogClasses.mjs +1 -1
- package/Divider/Divider.js +2 -10
- package/Divider/Divider.mjs +2 -10
- package/Divider/dividerClasses.d.mts +0 -4
- package/Divider/dividerClasses.d.ts +0 -4
- package/Divider/dividerClasses.js +1 -1
- package/Divider/dividerClasses.mjs +1 -1
- package/Drawer/Drawer.d.mts +1 -13
- package/Drawer/Drawer.d.ts +1 -13
- package/Drawer/Drawer.js +6 -40
- package/Drawer/Drawer.mjs +6 -40
- package/Drawer/drawerClasses.d.mts +0 -32
- package/Drawer/drawerClasses.d.ts +0 -32
- package/Drawer/drawerClasses.js +1 -1
- package/Drawer/drawerClasses.mjs +1 -1
- package/Fab/Fab.js +1 -0
- package/Fab/Fab.mjs +1 -0
- package/FilledInput/FilledInput.js +4 -33
- package/FilledInput/FilledInput.mjs +4 -33
- package/Grid/Grid.d.mts +8 -3
- package/Grid/Grid.d.ts +8 -3
- package/Grid/Grid.js +8 -3
- package/Grid/Grid.mjs +8 -3
- package/Grid/gridClasses.js +1 -1
- package/Grid/gridClasses.mjs +1 -1
- package/IconButton/IconButton.js +1 -0
- package/IconButton/IconButton.mjs +1 -0
- package/ImageListItemBar/ImageListItemBar.js +4 -17
- package/ImageListItemBar/ImageListItemBar.mjs +4 -17
- package/ImageListItemBar/imageListItemBarClasses.d.mts +0 -16
- package/ImageListItemBar/imageListItemBarClasses.d.ts +0 -16
- package/ImageListItemBar/imageListItemBarClasses.js +1 -1
- package/ImageListItemBar/imageListItemBarClasses.mjs +1 -1
- package/Input/Input.js +4 -33
- package/Input/Input.mjs +4 -33
- package/Input/inputClasses.d.mts +0 -16
- package/Input/inputClasses.d.ts +0 -16
- package/InputAdornment/inputAdornmentClasses.d.mts +2 -2
- package/InputAdornment/inputAdornmentClasses.d.ts +2 -2
- package/InputBase/InputBase.d.mts +0 -27
- package/InputBase/InputBase.d.ts +0 -27
- package/InputBase/InputBase.js +6 -35
- package/InputBase/InputBase.mjs +6 -35
- package/InputBase/inputBaseClasses.d.mts +0 -20
- package/InputBase/inputBaseClasses.d.ts +0 -20
- package/InputBase/inputBaseClasses.js +1 -1
- package/InputBase/inputBaseClasses.mjs +1 -1
- package/InputLabel/InputLabel.js +1 -1
- package/InputLabel/InputLabel.mjs +1 -1
- package/LinearProgress/LinearProgress.js +6 -18
- package/LinearProgress/LinearProgress.mjs +6 -18
- package/LinearProgress/linearProgressClasses.d.mts +0 -36
- package/LinearProgress/linearProgressClasses.d.ts +0 -36
- package/LinearProgress/linearProgressClasses.js +1 -1
- package/LinearProgress/linearProgressClasses.mjs +1 -1
- package/Link/Link.d.mts +1 -1
- package/Link/Link.d.ts +1 -1
- package/ListItem/ListItem.d.mts +2 -36
- package/ListItem/ListItem.d.ts +2 -36
- package/ListItem/ListItem.js +27 -152
- package/ListItem/ListItem.mjs +27 -152
- package/ListItem/listItemClasses.d.mts +2 -4
- package/ListItem/listItemClasses.d.ts +2 -4
- package/ListItem/listItemClasses.js +1 -1
- package/ListItem/listItemClasses.mjs +1 -1
- package/ListItemButton/ListItemButton.d.mts +1 -2
- package/ListItemButton/ListItemButton.d.ts +1 -2
- package/ListItemButton/ListItemButton.js +2 -2
- package/ListItemButton/ListItemButton.mjs +2 -2
- package/ListItemIcon/ListItemIcon.js +1 -1
- package/ListItemIcon/ListItemIcon.mjs +1 -1
- package/ListItemSecondaryAction/ListItemSecondaryAction.d.mts +10 -6
- package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +10 -6
- package/ListItemSecondaryAction/ListItemSecondaryAction.js +7 -2
- package/ListItemSecondaryAction/ListItemSecondaryAction.mjs +7 -2
- package/ListItemText/ListItemText.d.mts +12 -20
- package/ListItemText/ListItemText.d.ts +12 -20
- package/ListItemText/ListItemText.js +2 -20
- package/ListItemText/ListItemText.mjs +2 -20
- package/ListSubheader/ListSubheader.js +0 -3
- package/ListSubheader/ListSubheader.mjs +0 -3
- package/Menu/Menu.d.mts +1 -1
- package/Menu/Menu.d.ts +1 -1
- package/Menu/Menu.js +15 -32
- package/Menu/Menu.mjs +15 -32
- package/MenuItem/MenuItem.js +36 -26
- package/MenuItem/MenuItem.mjs +34 -26
- package/MenuList/MenuList.js +136 -101
- package/MenuList/MenuList.mjs +135 -100
- package/MenuList/MenuListContext.d.mts +11 -0
- package/MenuList/MenuListContext.d.ts +11 -0
- package/MenuList/MenuListContext.js +25 -0
- package/MenuList/MenuListContext.mjs +19 -0
- package/Modal/Modal.d.mts +1 -41
- package/Modal/Modal.d.ts +1 -41
- package/Modal/Modal.js +5 -58
- package/Modal/Modal.mjs +5 -58
- package/OutlinedInput/OutlinedInput.js +2 -14
- package/OutlinedInput/OutlinedInput.mjs +2 -14
- package/OutlinedInput/outlinedInputClasses.d.mts +0 -16
- package/OutlinedInput/outlinedInputClasses.d.ts +0 -16
- package/PaginationItem/PaginationItem.d.mts +5 -15
- package/PaginationItem/PaginationItem.d.ts +5 -15
- package/PaginationItem/PaginationItem.js +9 -24
- package/PaginationItem/PaginationItem.mjs +9 -24
- package/PaginationItem/paginationItemClasses.d.mts +0 -16
- package/PaginationItem/paginationItemClasses.d.ts +0 -16
- package/PaginationItem/paginationItemClasses.js +1 -1
- package/PaginationItem/paginationItemClasses.mjs +1 -1
- package/PigmentGrid/PigmentGrid.d.mts +1 -1
- package/PigmentGrid/PigmentGrid.d.ts +1 -1
- package/PigmentGrid/PigmentGrid.js +1 -1
- package/PigmentGrid/PigmentGrid.mjs +1 -1
- package/Popover/Popover.d.mts +1 -1
- package/Popover/Popover.d.ts +1 -1
- package/Popover/Popover.js +19 -7
- package/Popover/Popover.mjs +18 -6
- package/Radio/Radio.js +1 -13
- package/Radio/Radio.mjs +1 -13
- package/Rating/Rating.d.mts +0 -9
- package/Rating/Rating.d.ts +0 -9
- package/Rating/Rating.js +1 -17
- package/Rating/Rating.mjs +1 -17
- package/Select/SelectInput.js +2 -3
- package/Select/SelectInput.mjs +2 -3
- package/Select/selectClasses.d.mts +0 -12
- package/Select/selectClasses.d.ts +0 -12
- package/Select/selectClasses.js +1 -1
- package/Select/selectClasses.mjs +1 -1
- package/Slider/Slider.d.mts +0 -5
- package/Slider/Slider.d.ts +0 -5
- package/Slider/Slider.js +2 -8
- package/Slider/Slider.mjs +2 -8
- package/Slider/sliderClasses.d.mts +0 -28
- package/Slider/sliderClasses.d.ts +0 -28
- package/Slider/sliderClasses.js +1 -1
- package/Slider/sliderClasses.mjs +1 -1
- package/Snackbar/Snackbar.d.mts +1 -1
- package/Snackbar/Snackbar.d.ts +1 -1
- package/SpeedDial/SpeedDial.d.mts +1 -1
- package/SpeedDial/SpeedDial.d.ts +1 -1
- package/Stack/Stack.d.mts +2 -2
- package/Stack/Stack.d.ts +2 -2
- package/StepButton/StepButton.js +44 -14
- package/StepButton/StepButton.mjs +44 -14
- package/StepConnector/StepConnector.js +2 -8
- package/StepConnector/StepConnector.mjs +2 -8
- package/StepConnector/stepConnectorClasses.d.mts +0 -8
- package/StepConnector/stepConnectorClasses.d.ts +0 -8
- package/StepConnector/stepConnectorClasses.js +1 -1
- package/StepConnector/stepConnectorClasses.mjs +1 -1
- package/StepContent/StepContent.d.mts +2 -17
- package/StepContent/StepContent.d.ts +2 -17
- package/StepContent/StepContent.js +3 -22
- package/StepContent/StepContent.mjs +3 -22
- package/StepLabel/StepLabel.d.mts +0 -22
- package/StepLabel/StepLabel.d.ts +0 -22
- package/StepLabel/StepLabel.js +2 -31
- package/StepLabel/StepLabel.mjs +2 -31
- package/Stepper/Stepper.js +54 -22
- package/Stepper/Stepper.mjs +54 -22
- package/Stepper/StepperContext.d.mts +0 -5
- package/Stepper/StepperContext.d.ts +0 -5
- package/Stepper/StepperContext.js +1 -2
- package/Stepper/StepperContext.mjs +0 -1
- package/SvgIcon/createSvgIcon.d.mts +2 -0
- package/SvgIcon/createSvgIcon.d.ts +2 -0
- package/SvgIcon/createSvgIcon.js +31 -0
- package/SvgIcon/createSvgIcon.mjs +26 -0
- package/SvgIcon/index.d.mts +1 -0
- package/SvgIcon/index.d.ts +1 -0
- package/SvgIcon/index.js +8 -0
- package/SvgIcon/index.mjs +1 -0
- package/SwipeableDrawer/SwipeableDrawer.d.mts +0 -5
- package/SwipeableDrawer/SwipeableDrawer.d.ts +0 -5
- package/SwipeableDrawer/SwipeableDrawer.js +6 -37
- package/SwipeableDrawer/SwipeableDrawer.mjs +6 -37
- package/Switch/Switch.js +0 -11
- package/Switch/Switch.mjs +0 -11
- package/Tab/Tab.js +18 -4
- package/Tab/Tab.mjs +18 -4
- package/Tab/tabClasses.d.mts +0 -4
- package/Tab/tabClasses.d.ts +0 -4
- package/Tab/tabClasses.js +1 -1
- package/Tab/tabClasses.mjs +1 -1
- package/TabScrollButton/TabScrollButton.d.mts +1 -1
- package/TabScrollButton/TabScrollButton.d.ts +1 -1
- package/TabScrollButton/TabScrollButton.js +6 -2
- package/TabScrollButton/TabScrollButton.mjs +6 -2
- package/TablePagination/TablePagination.d.mts +0 -24
- package/TablePagination/TablePagination.d.ts +0 -24
- package/TablePagination/TablePagination.js +1 -29
- package/TablePagination/TablePagination.mjs +1 -29
- package/TablePaginationActions/TablePaginationActions.d.mts +0 -10
- package/TablePaginationActions/TablePaginationActions.d.ts +0 -10
- package/TablePaginationActions/TablePaginationActions.js +2 -14
- package/TablePaginationActions/TablePaginationActions.mjs +2 -14
- package/TableSortLabel/TableSortLabel.js +6 -8
- package/TableSortLabel/TableSortLabel.mjs +6 -8
- package/TableSortLabel/tableSortLabelClasses.d.mts +0 -8
- package/TableSortLabel/tableSortLabelClasses.d.ts +0 -8
- package/TableSortLabel/tableSortLabelClasses.js +1 -1
- package/TableSortLabel/tableSortLabelClasses.mjs +1 -1
- package/Tabs/Tabs.js +33 -24
- package/Tabs/Tabs.mjs +32 -23
- package/Tabs/tabsClasses.d.mts +0 -6
- package/Tabs/tabsClasses.d.ts +0 -6
- package/Tabs/tabsClasses.js +1 -1
- package/Tabs/tabsClasses.mjs +1 -1
- package/ToggleButton/ToggleButton.js +1 -0
- package/ToggleButton/ToggleButton.mjs +1 -0
- package/ToggleButtonGroup/ToggleButtonGroup.js +1 -4
- package/ToggleButtonGroup/ToggleButtonGroup.mjs +1 -4
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.mts +0 -8
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +0 -8
- package/ToggleButtonGroup/toggleButtonGroupClasses.js +1 -1
- package/ToggleButtonGroup/toggleButtonGroupClasses.mjs +1 -1
- package/Tooltip/Tooltip.d.mts +1 -1
- package/Tooltip/Tooltip.d.ts +1 -1
- package/Typography/Typography.d.mts +3 -3
- package/Typography/Typography.d.ts +3 -3
- package/Typography/Typography.js +2 -24
- package/Typography/Typography.mjs +3 -25
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internal/SwitchBase.d.mts +2 -12
- package/internal/SwitchBase.d.ts +2 -12
- package/internal/SwitchBase.js +6 -17
- package/internal/SwitchBase.mjs +6 -17
- package/locale/psAF.js +1 -1
- package/locale/psAF.mjs +1 -1
- package/package.json +7 -7
- package/styles/createThemeWithVars.js +10 -9
- package/styles/createThemeWithVars.mjs +10 -9
- package/styles/stringifyTheme.js +1 -1
- package/styles/stringifyTheme.mjs +1 -1
- package/useAutocomplete/useAutocomplete.js +8 -0
- package/useAutocomplete/useAutocomplete.mjs +8 -0
- package/utils/createSvgIcon.d.mts +4 -2
- package/utils/createSvgIcon.d.ts +4 -2
- package/utils/createSvgIcon.js +6 -24
- package/utils/createSvgIcon.mjs +2 -24
- package/utils/focusWithVisible.js +24 -0
- package/utils/focusWithVisible.mjs +19 -0
- package/utils/index.d.mts +0 -1
- package/utils/index.d.ts +0 -1
- package/utils/index.js +0 -7
- package/utils/index.mjs +0 -1
- package/utils/useFocusableWhenDisabled.d.mts +30 -0
- package/utils/useFocusableWhenDisabled.d.ts +30 -0
- package/utils/useFocusableWhenDisabled.js +47 -0
- package/utils/useFocusableWhenDisabled.mjs +41 -0
- package/utils/useRovingTabIndex.d.mts +1 -2
- package/utils/useRovingTabIndex.d.ts +1 -2
- package/utils/useRovingTabIndex.js +25 -4
- package/utils/useRovingTabIndex.mjs +1 -2
- package/version/index.js +2 -2
- package/version/index.mjs +2 -2
package/Tabs/Tabs.mjs
CHANGED
|
@@ -20,7 +20,10 @@ import tabsClasses, { getTabsUtilityClass } from "./tabsClasses.mjs";
|
|
|
20
20
|
import ownerWindow from "../utils/ownerWindow.mjs";
|
|
21
21
|
import isLayoutSupported from "../utils/isLayoutSupported.mjs";
|
|
22
22
|
import useSlot from "../utils/useSlot.mjs";
|
|
23
|
-
import
|
|
23
|
+
import getActiveElement from "../utils/getActiveElement.mjs";
|
|
24
|
+
import ownerDocument from "../utils/ownerDocument.mjs";
|
|
25
|
+
import useForkRef from "../utils/useForkRef.mjs";
|
|
26
|
+
import { RovingTabIndexContext, useRovingTabIndexRoot } from "../utils/useRovingTabIndex.mjs";
|
|
24
27
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
28
|
const useUtilityClasses = ownerState => {
|
|
26
29
|
const {
|
|
@@ -36,7 +39,7 @@ const useUtilityClasses = ownerState => {
|
|
|
36
39
|
const slots = {
|
|
37
40
|
root: ['root', vertical && 'vertical'],
|
|
38
41
|
scroller: ['scroller', fixed && 'fixed', hideScrollbar && 'hideScrollbar', scrollableX && 'scrollableX', scrollableY && 'scrollableY'],
|
|
39
|
-
list: ['list',
|
|
42
|
+
list: ['list', vertical && 'vertical', centered && 'centered'],
|
|
40
43
|
indicator: ['indicator'],
|
|
41
44
|
scrollButtons: ['scrollButtons', scrollButtonsHideMobile && 'scrollButtonsHideMobile'],
|
|
42
45
|
scrollableX: [scrollableX && 'scrollableX'],
|
|
@@ -144,7 +147,7 @@ const List = styled('div', {
|
|
|
144
147
|
const {
|
|
145
148
|
ownerState
|
|
146
149
|
} = props;
|
|
147
|
-
return [styles.list,
|
|
150
|
+
return [styles.list, ownerState.centered && styles.centered];
|
|
148
151
|
}
|
|
149
152
|
})({
|
|
150
153
|
display: 'flex',
|
|
@@ -287,6 +290,10 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
287
290
|
const [displayStartScroll, setDisplayStartScroll] = React.useState(false);
|
|
288
291
|
const [displayEndScroll, setDisplayEndScroll] = React.useState(false);
|
|
289
292
|
const [updateScrollObserver, setUpdateScrollObserver] = React.useState(false);
|
|
293
|
+
const selectedValue = value === false ? null : value;
|
|
294
|
+
// Tracks whether DOM focus is currently inside the tab list. When it is, roving focus
|
|
295
|
+
// should follow in-list keyboard movement instead of snapping back to `selectedValue`.
|
|
296
|
+
const [isFocusWithinList, setIsFocusWithinList] = React.useState(false);
|
|
290
297
|
const [scrollerStyle, setScrollerStyle] = React.useState({
|
|
291
298
|
overflow: 'hidden',
|
|
292
299
|
scrollbarWidth: 0
|
|
@@ -614,6 +621,12 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
614
621
|
const indicator = /*#__PURE__*/_jsx(IndicatorSlot, {
|
|
615
622
|
...indicatorSlotProps
|
|
616
623
|
});
|
|
624
|
+
const rovingContainer = useRovingTabIndexRoot({
|
|
625
|
+
activeItemId: isFocusWithinList ? undefined : selectedValue,
|
|
626
|
+
orientation,
|
|
627
|
+
isRtl
|
|
628
|
+
});
|
|
629
|
+
const rovingContainerProps = rovingContainer.getContainerProps();
|
|
617
630
|
const validChildren = React.Children.toArray(childrenProp).filter(React.isValidElement).map((child, index) => {
|
|
618
631
|
const childValue = child.props.value === undefined ? index : child.props.value;
|
|
619
632
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -628,23 +641,11 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
628
641
|
childValue
|
|
629
642
|
};
|
|
630
643
|
});
|
|
631
|
-
const focusableIndex = valueToIndex.get(value);
|
|
632
|
-
const {
|
|
633
|
-
getContainerProps,
|
|
634
|
-
getItemProps
|
|
635
|
-
} = useRovingTabIndex({
|
|
636
|
-
focusableIndex,
|
|
637
|
-
orientation,
|
|
638
|
-
isRtl
|
|
639
|
-
});
|
|
640
|
-
const rovingTabIndexContainerProps = getContainerProps();
|
|
641
644
|
const children = validChildren.map(({
|
|
642
645
|
child,
|
|
643
|
-
index,
|
|
644
646
|
childValue
|
|
645
647
|
}) => {
|
|
646
648
|
const selected = childValue === value;
|
|
647
|
-
const rovingTabIndexItemProps = getItemProps(index, child.ref);
|
|
648
649
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
649
650
|
fullWidth: variant === 'fullWidth',
|
|
650
651
|
indicator: selected && !mounted && indicator,
|
|
@@ -652,9 +653,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
652
653
|
selectionFollowsFocus,
|
|
653
654
|
onChange,
|
|
654
655
|
textColor,
|
|
655
|
-
value: childValue
|
|
656
|
-
ref: rovingTabIndexItemProps.ref,
|
|
657
|
-
tabIndex: child.props.tabIndex ?? rovingTabIndexItemProps.tabIndex
|
|
656
|
+
value: childValue
|
|
658
657
|
});
|
|
659
658
|
});
|
|
660
659
|
const conditionalElements = getConditionalElements();
|
|
@@ -682,7 +681,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
682
681
|
}
|
|
683
682
|
}
|
|
684
683
|
});
|
|
685
|
-
const mergedRef = useForkRef(
|
|
684
|
+
const mergedRef = useForkRef(rovingContainerProps.ref, tabListRef);
|
|
686
685
|
const handleKeyDown = event => {
|
|
687
686
|
const list = tabListRef.current;
|
|
688
687
|
const currentFocus = getActiveElement(ownerDocument(list));
|
|
@@ -693,22 +692,29 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
693
692
|
if (role !== 'tab') {
|
|
694
693
|
return;
|
|
695
694
|
}
|
|
696
|
-
|
|
695
|
+
rovingContainerProps.onKeyDown(event);
|
|
697
696
|
};
|
|
698
697
|
const [ListSlot, listSlotProps] = useSlot('list', {
|
|
699
698
|
ref: mergedRef,
|
|
700
|
-
className:
|
|
699
|
+
className: classes.list,
|
|
701
700
|
elementType: List,
|
|
702
701
|
externalForwardedProps,
|
|
703
702
|
ownerState,
|
|
704
703
|
getSlotProps: handlers => ({
|
|
705
704
|
...handlers,
|
|
705
|
+
onBlur: event => {
|
|
706
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
707
|
+
setIsFocusWithinList(false);
|
|
708
|
+
}
|
|
709
|
+
handlers.onBlur?.(event);
|
|
710
|
+
},
|
|
706
711
|
onKeyDown: event => {
|
|
707
712
|
handleKeyDown(event);
|
|
708
713
|
handlers.onKeyDown?.(event);
|
|
709
714
|
},
|
|
710
715
|
onFocus: event => {
|
|
711
|
-
|
|
716
|
+
setIsFocusWithinList(true);
|
|
717
|
+
rovingContainerProps.onFocus(event);
|
|
712
718
|
handlers.onFocus?.(event);
|
|
713
719
|
}
|
|
714
720
|
})
|
|
@@ -723,7 +729,10 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
723
729
|
"aria-orientation": orientation === 'vertical' ? 'vertical' : null,
|
|
724
730
|
role: "tablist",
|
|
725
731
|
...listSlotProps,
|
|
726
|
-
children:
|
|
732
|
+
children: /*#__PURE__*/_jsx(RovingTabIndexContext.Provider, {
|
|
733
|
+
value: rovingContainer,
|
|
734
|
+
children: children
|
|
735
|
+
})
|
|
727
736
|
}), mounted && indicator]
|
|
728
737
|
}), conditionalElements.scrollButtonEnd]
|
|
729
738
|
});
|
package/Tabs/tabsClasses.d.mts
CHANGED
|
@@ -3,12 +3,6 @@ export interface TabsClasses {
|
|
|
3
3
|
root: string;
|
|
4
4
|
/** Styles applied to the root element if `orientation="vertical"`. */
|
|
5
5
|
vertical: string;
|
|
6
|
-
/** Styles applied to the flex container element. */
|
|
7
|
-
/** @deprecated use `list` instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details. */
|
|
8
|
-
flexContainer: string;
|
|
9
|
-
/** Styles applied to the flex container element if `orientation="vertical"`. */
|
|
10
|
-
/** @deprecated use a combination of `list` and `vertical` instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details. */
|
|
11
|
-
flexContainerVertical: string;
|
|
12
6
|
/** Styles applied to the list element. */
|
|
13
7
|
list: string;
|
|
14
8
|
/** Styles applied to the flex container element if `centered={true}` & `!variant="scrollable"`. */
|
package/Tabs/tabsClasses.d.ts
CHANGED
|
@@ -3,12 +3,6 @@ export interface TabsClasses {
|
|
|
3
3
|
root: string;
|
|
4
4
|
/** Styles applied to the root element if `orientation="vertical"`. */
|
|
5
5
|
vertical: string;
|
|
6
|
-
/** Styles applied to the flex container element. */
|
|
7
|
-
/** @deprecated use `list` instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details. */
|
|
8
|
-
flexContainer: string;
|
|
9
|
-
/** Styles applied to the flex container element if `orientation="vertical"`. */
|
|
10
|
-
/** @deprecated use a combination of `list` and `vertical` instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details. */
|
|
11
|
-
flexContainerVertical: string;
|
|
12
6
|
/** Styles applied to the list element. */
|
|
13
7
|
list: string;
|
|
14
8
|
/** Styles applied to the flex container element if `centered={true}` & `!variant="scrollable"`. */
|
package/Tabs/tabsClasses.js
CHANGED
|
@@ -11,5 +11,5 @@ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateU
|
|
|
11
11
|
function getTabsUtilityClass(slot) {
|
|
12
12
|
return (0, _generateUtilityClass.default)('MuiTabs', slot);
|
|
13
13
|
}
|
|
14
|
-
const tabsClasses = (0, _generateUtilityClasses.default)('MuiTabs', ['root', 'vertical', 'list', '
|
|
14
|
+
const tabsClasses = (0, _generateUtilityClasses.default)('MuiTabs', ['root', 'vertical', 'list', 'centered', 'scroller', 'fixed', 'scrollableX', 'scrollableY', 'hideScrollbar', 'scrollButtons', 'scrollButtonsHideMobile', 'indicator']);
|
|
15
15
|
var _default = exports.default = tabsClasses;
|
package/Tabs/tabsClasses.mjs
CHANGED
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
3
3
|
export function getTabsUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiTabs', slot);
|
|
5
5
|
}
|
|
6
|
-
const tabsClasses = generateUtilityClasses('MuiTabs', ['root', 'vertical', 'list', '
|
|
6
|
+
const tabsClasses = generateUtilityClasses('MuiTabs', ['root', 'vertical', 'list', 'centered', 'scroller', 'fixed', 'scrollableX', 'scrollableY', 'hideScrollbar', 'scrollButtons', 'scrollButtonsHideMobile', 'indicator']);
|
|
7
7
|
export default tabsClasses;
|
|
@@ -178,6 +178,7 @@ const ToggleButton = /*#__PURE__*/React.forwardRef(function ToggleButton(inProps
|
|
|
178
178
|
const positionClassName = toggleButtonGroupButtonContextPositionClassName || '';
|
|
179
179
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToggleButtonRoot, {
|
|
180
180
|
className: (0, _clsx.default)(contextProps.className, classes.root, className, positionClassName),
|
|
181
|
+
internalNativeButton: true,
|
|
181
182
|
disabled: disabled,
|
|
182
183
|
focusRipple: !disableFocusRipple,
|
|
183
184
|
ref: ref,
|
|
@@ -171,6 +171,7 @@ const ToggleButton = /*#__PURE__*/React.forwardRef(function ToggleButton(inProps
|
|
|
171
171
|
const positionClassName = toggleButtonGroupButtonContextPositionClassName || '';
|
|
172
172
|
return /*#__PURE__*/_jsx(ToggleButtonRoot, {
|
|
173
173
|
className: clsx(contextProps.className, classes.root, className, positionClassName),
|
|
174
|
+
internalNativeButton: true,
|
|
174
175
|
disabled: disabled,
|
|
175
176
|
focusRipple: !disableFocusRipple,
|
|
176
177
|
ref: ref,
|
|
@@ -16,7 +16,6 @@ var _getValidReactChildren = _interopRequireDefault(require("@mui/utils/getValid
|
|
|
16
16
|
var _zeroStyled = require("../zero-styled");
|
|
17
17
|
var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
|
|
18
18
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
19
|
-
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
20
19
|
var _toggleButtonGroupClasses = _interopRequireWildcard(require("./toggleButtonGroupClasses"));
|
|
21
20
|
var _ToggleButtonGroupContext = _interopRequireDefault(require("./ToggleButtonGroupContext"));
|
|
22
21
|
var _ToggleButtonGroupButtonContext = _interopRequireDefault(require("./ToggleButtonGroupButtonContext"));
|
|
@@ -31,7 +30,7 @@ const useUtilityClasses = ownerState => {
|
|
|
31
30
|
} = ownerState;
|
|
32
31
|
const slots = {
|
|
33
32
|
root: ['root', orientation, fullWidth && 'fullWidth'],
|
|
34
|
-
grouped: ['grouped',
|
|
33
|
+
grouped: ['grouped', disabled && 'disabled'],
|
|
35
34
|
firstButton: ['firstButton'],
|
|
36
35
|
lastButton: ['lastButton'],
|
|
37
36
|
middleButton: ['middleButton']
|
|
@@ -47,8 +46,6 @@ const ToggleButtonGroupRoot = (0, _zeroStyled.styled)('div', {
|
|
|
47
46
|
} = props;
|
|
48
47
|
return [{
|
|
49
48
|
[`& .${_toggleButtonGroupClasses.default.grouped}`]: styles.grouped
|
|
50
|
-
}, {
|
|
51
|
-
[`& .${_toggleButtonGroupClasses.default.grouped}`]: styles[`grouped${(0, _capitalize.default)(ownerState.orientation)}`]
|
|
52
49
|
}, {
|
|
53
50
|
[`& .${_toggleButtonGroupClasses.default.firstButton}`]: styles.firstButton
|
|
54
51
|
}, {
|
|
@@ -9,7 +9,6 @@ import getValidReactChildren from '@mui/utils/getValidReactChildren';
|
|
|
9
9
|
import { styled } from "../zero-styled/index.mjs";
|
|
10
10
|
import memoTheme from "../utils/memoTheme.mjs";
|
|
11
11
|
import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
|
|
12
|
-
import capitalize from "../utils/capitalize.mjs";
|
|
13
12
|
import toggleButtonGroupClasses, { getToggleButtonGroupUtilityClass } from "./toggleButtonGroupClasses.mjs";
|
|
14
13
|
import ToggleButtonGroupContext from "./ToggleButtonGroupContext.mjs";
|
|
15
14
|
import ToggleButtonGroupButtonContext from "./ToggleButtonGroupButtonContext.mjs";
|
|
@@ -24,7 +23,7 @@ const useUtilityClasses = ownerState => {
|
|
|
24
23
|
} = ownerState;
|
|
25
24
|
const slots = {
|
|
26
25
|
root: ['root', orientation, fullWidth && 'fullWidth'],
|
|
27
|
-
grouped: ['grouped',
|
|
26
|
+
grouped: ['grouped', disabled && 'disabled'],
|
|
28
27
|
firstButton: ['firstButton'],
|
|
29
28
|
lastButton: ['lastButton'],
|
|
30
29
|
middleButton: ['middleButton']
|
|
@@ -40,8 +39,6 @@ const ToggleButtonGroupRoot = styled('div', {
|
|
|
40
39
|
} = props;
|
|
41
40
|
return [{
|
|
42
41
|
[`& .${toggleButtonGroupClasses.grouped}`]: styles.grouped
|
|
43
|
-
}, {
|
|
44
|
-
[`& .${toggleButtonGroupClasses.grouped}`]: styles[`grouped${capitalize(ownerState.orientation)}`]
|
|
45
42
|
}, {
|
|
46
43
|
[`& .${toggleButtonGroupClasses.firstButton}`]: styles.firstButton
|
|
47
44
|
}, {
|
|
@@ -11,14 +11,6 @@ export interface ToggleButtonGroupClasses {
|
|
|
11
11
|
disabled: string;
|
|
12
12
|
/** Styles applied to the children. */
|
|
13
13
|
grouped: string;
|
|
14
|
-
/** Styles applied to the children if `orientation="horizontal"`.
|
|
15
|
-
* @deprecated Combine the [.MuiToggleButtonGroup-horizontal](/material-ui/api/toggle-button-group/#toggle-button-group-classes-MuiToggleButtonGroup-horizontal) and [.MuiToggleButtonGroup-grouped](/material-ui/api/toggle-button-group/#toggle-button-group-classes-MuiToggleButtonGroup-grouped) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
16
|
-
*/
|
|
17
|
-
groupedHorizontal: string;
|
|
18
|
-
/** Styles applied to the children if `orientation="vertical"`.
|
|
19
|
-
* @deprecated Combine the [.MuiToggleButtonGroup-vertical](/material-ui/api/toggle-button-group/#toggle-button-group-classes-MuiToggleButtonGroup-vertical) and [.MuiToggleButtonGroup-grouped](/material-ui/api/toggle-button-group/#toggle-button-group-classes-MuiToggleButtonGroup-grouped) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
20
|
-
*/
|
|
21
|
-
groupedVertical: string;
|
|
22
14
|
/** Styles applied to the root element if `fullWidth={true}`. */
|
|
23
15
|
fullWidth: string;
|
|
24
16
|
/** Styles applied to the first button in the toggle button group. */
|
|
@@ -11,14 +11,6 @@ export interface ToggleButtonGroupClasses {
|
|
|
11
11
|
disabled: string;
|
|
12
12
|
/** Styles applied to the children. */
|
|
13
13
|
grouped: string;
|
|
14
|
-
/** Styles applied to the children if `orientation="horizontal"`.
|
|
15
|
-
* @deprecated Combine the [.MuiToggleButtonGroup-horizontal](/material-ui/api/toggle-button-group/#toggle-button-group-classes-MuiToggleButtonGroup-horizontal) and [.MuiToggleButtonGroup-grouped](/material-ui/api/toggle-button-group/#toggle-button-group-classes-MuiToggleButtonGroup-grouped) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
16
|
-
*/
|
|
17
|
-
groupedHorizontal: string;
|
|
18
|
-
/** Styles applied to the children if `orientation="vertical"`.
|
|
19
|
-
* @deprecated Combine the [.MuiToggleButtonGroup-vertical](/material-ui/api/toggle-button-group/#toggle-button-group-classes-MuiToggleButtonGroup-vertical) and [.MuiToggleButtonGroup-grouped](/material-ui/api/toggle-button-group/#toggle-button-group-classes-MuiToggleButtonGroup-grouped) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
20
|
-
*/
|
|
21
|
-
groupedVertical: string;
|
|
22
14
|
/** Styles applied to the root element if `fullWidth={true}`. */
|
|
23
15
|
fullWidth: string;
|
|
24
16
|
/** Styles applied to the first button in the toggle button group. */
|
|
@@ -11,5 +11,5 @@ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateU
|
|
|
11
11
|
function getToggleButtonGroupUtilityClass(slot) {
|
|
12
12
|
return (0, _generateUtilityClass.default)('MuiToggleButtonGroup', slot);
|
|
13
13
|
}
|
|
14
|
-
const toggleButtonGroupClasses = (0, _generateUtilityClasses.default)('MuiToggleButtonGroup', ['root', 'selected', 'horizontal', 'vertical', 'disabled', 'grouped', '
|
|
14
|
+
const toggleButtonGroupClasses = (0, _generateUtilityClasses.default)('MuiToggleButtonGroup', ['root', 'selected', 'horizontal', 'vertical', 'disabled', 'grouped', 'fullWidth', 'firstButton', 'lastButton', 'middleButton']);
|
|
15
15
|
var _default = exports.default = toggleButtonGroupClasses;
|
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
3
3
|
export function getToggleButtonGroupUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiToggleButtonGroup', slot);
|
|
5
5
|
}
|
|
6
|
-
const toggleButtonGroupClasses = generateUtilityClasses('MuiToggleButtonGroup', ['root', 'selected', 'horizontal', 'vertical', 'disabled', 'grouped', '
|
|
6
|
+
const toggleButtonGroupClasses = generateUtilityClasses('MuiToggleButtonGroup', ['root', 'selected', 'horizontal', 'vertical', 'disabled', 'grouped', 'fullWidth', 'firstButton', 'lastButton', 'middleButton']);
|
|
7
7
|
export default toggleButtonGroupClasses;
|
package/Tooltip/Tooltip.d.mts
CHANGED
|
@@ -41,7 +41,7 @@ export type TooltipSlotsAndSlotProps = CreateSlotsAndSlotProps<TooltipSlots, {
|
|
|
41
41
|
* Props forwarded to the transition slot.
|
|
42
42
|
* By default, the available props are based on the [Grow](https://mui.com/material-ui/api/grow/#props) component.
|
|
43
43
|
*/
|
|
44
|
-
transition: SlotProps<React.ElementType
|
|
44
|
+
transition: SlotProps<React.ElementType<TransitionProps>, TransitionProps & TooltipTransitionSlotPropsOverrides, TooltipOwnerState>;
|
|
45
45
|
/**
|
|
46
46
|
* Props forwarded to the tooltip slot.
|
|
47
47
|
* By default, the available props are based on the div element.
|
package/Tooltip/Tooltip.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export type TooltipSlotsAndSlotProps = CreateSlotsAndSlotProps<TooltipSlots, {
|
|
|
41
41
|
* Props forwarded to the transition slot.
|
|
42
42
|
* By default, the available props are based on the [Grow](https://mui.com/material-ui/api/grow/#props) component.
|
|
43
43
|
*/
|
|
44
|
-
transition: SlotProps<React.ElementType
|
|
44
|
+
transition: SlotProps<React.ElementType<TransitionProps>, TransitionProps & TooltipTransitionSlotPropsOverrides, TooltipOwnerState>;
|
|
45
45
|
/**
|
|
46
46
|
* Props forwarded to the tooltip slot.
|
|
47
47
|
* By default, the available props are based on the div element.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OverridableStringUnion } from '@mui/types';
|
|
3
|
-
import { SxProps
|
|
3
|
+
import { SxProps } from '@mui/system';
|
|
4
4
|
import { Theme, TypeText } from "../styles/index.mjs";
|
|
5
5
|
import { OverrideProps, OverridableComponent } from "../OverridableComponent/index.mjs";
|
|
6
6
|
import { TypographyVariant } from "../styles/createTypography.mjs";
|
|
7
7
|
import { TypographyClasses } from "./typographyClasses.mjs";
|
|
8
8
|
export interface TypographyPropsVariantOverrides {}
|
|
9
9
|
export interface TypographyPropsColorOverrides {}
|
|
10
|
-
export interface TypographyOwnProps
|
|
10
|
+
export interface TypographyOwnProps {
|
|
11
11
|
/**
|
|
12
12
|
* Set the text-align on the component.
|
|
13
13
|
* @default 'inherit'
|
|
@@ -26,7 +26,7 @@ export interface TypographyOwnProps extends Omit<SystemProps<Theme>, 'color'> {
|
|
|
26
26
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
27
27
|
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
28
28
|
*/
|
|
29
|
-
color?: OverridableStringUnion<'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning' | `text${Capitalize<keyof TypeText>}`, TypographyPropsColorOverrides> | (string & {}) | undefined;
|
|
29
|
+
color?: OverridableStringUnion<'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning' | `text${Capitalize<keyof TypeText>}`, TypographyPropsColorOverrides> | (string & {}) | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* If `true`, the text will have a bottom margin.
|
|
32
32
|
* @default false
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OverridableStringUnion } from '@mui/types';
|
|
3
|
-
import { SxProps
|
|
3
|
+
import { SxProps } from '@mui/system';
|
|
4
4
|
import { Theme, TypeText } from "../styles/index.js";
|
|
5
5
|
import { OverrideProps, OverridableComponent } from "../OverridableComponent/index.js";
|
|
6
6
|
import { TypographyVariant } from "../styles/createTypography.js";
|
|
7
7
|
import { TypographyClasses } from "./typographyClasses.js";
|
|
8
8
|
export interface TypographyPropsVariantOverrides {}
|
|
9
9
|
export interface TypographyPropsColorOverrides {}
|
|
10
|
-
export interface TypographyOwnProps
|
|
10
|
+
export interface TypographyOwnProps {
|
|
11
11
|
/**
|
|
12
12
|
* Set the text-align on the component.
|
|
13
13
|
* @default 'inherit'
|
|
@@ -26,7 +26,7 @@ export interface TypographyOwnProps extends Omit<SystemProps<Theme>, 'color'> {
|
|
|
26
26
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
27
27
|
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
28
28
|
*/
|
|
29
|
-
color?: OverridableStringUnion<'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning' | `text${Capitalize<keyof TypeText>}`, TypographyPropsColorOverrides> | (string & {}) | undefined;
|
|
29
|
+
color?: OverridableStringUnion<'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning' | `text${Capitalize<keyof TypeText>}`, TypographyPropsColorOverrides> | (string & {}) | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* If `true`, the text will have a bottom margin.
|
|
32
32
|
* @default false
|
package/Typography/Typography.js
CHANGED
|
@@ -18,18 +18,6 @@ var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
|
18
18
|
var _createSimplePaletteValueFilter = _interopRequireDefault(require("../utils/createSimplePaletteValueFilter"));
|
|
19
19
|
var _typographyClasses = require("./typographyClasses");
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
const v6Colors = {
|
|
22
|
-
primary: true,
|
|
23
|
-
secondary: true,
|
|
24
|
-
error: true,
|
|
25
|
-
info: true,
|
|
26
|
-
success: true,
|
|
27
|
-
warning: true,
|
|
28
|
-
textPrimary: true,
|
|
29
|
-
textSecondary: true,
|
|
30
|
-
textDisabled: true
|
|
31
|
-
};
|
|
32
|
-
const extendSxProp = (0, _zeroStyled.internal_createExtendSxProp)();
|
|
33
21
|
const useUtilityClasses = ownerState => {
|
|
34
22
|
const {
|
|
35
23
|
align,
|
|
@@ -124,22 +112,12 @@ const defaultVariantMapping = {
|
|
|
124
112
|
inherit: 'p'
|
|
125
113
|
};
|
|
126
114
|
const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, ref) {
|
|
127
|
-
const {
|
|
128
|
-
color,
|
|
129
|
-
...themeProps
|
|
130
|
-
} = (0, _DefaultPropsProvider.useDefaultProps)({
|
|
115
|
+
const props = (0, _DefaultPropsProvider.useDefaultProps)({
|
|
131
116
|
props: inProps,
|
|
132
117
|
name: 'MuiTypography'
|
|
133
118
|
});
|
|
134
|
-
const isSxColor = !v6Colors[color];
|
|
135
|
-
// TODO: Remove `extendSxProp` in v7
|
|
136
|
-
const props = extendSxProp({
|
|
137
|
-
...themeProps,
|
|
138
|
-
...(isSxColor && {
|
|
139
|
-
color
|
|
140
|
-
})
|
|
141
|
-
});
|
|
142
119
|
const {
|
|
120
|
+
color,
|
|
143
121
|
align = 'inherit',
|
|
144
122
|
className,
|
|
145
123
|
component,
|
|
@@ -4,25 +4,13 @@ import * as React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
|
-
import { styled
|
|
7
|
+
import { styled } from "../zero-styled/index.mjs";
|
|
8
8
|
import memoTheme from "../utils/memoTheme.mjs";
|
|
9
9
|
import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
|
|
10
10
|
import capitalize from "../utils/capitalize.mjs";
|
|
11
11
|
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.mjs";
|
|
12
12
|
import { getTypographyUtilityClass } from "./typographyClasses.mjs";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
const v6Colors = {
|
|
15
|
-
primary: true,
|
|
16
|
-
secondary: true,
|
|
17
|
-
error: true,
|
|
18
|
-
info: true,
|
|
19
|
-
success: true,
|
|
20
|
-
warning: true,
|
|
21
|
-
textPrimary: true,
|
|
22
|
-
textSecondary: true,
|
|
23
|
-
textDisabled: true
|
|
24
|
-
};
|
|
25
|
-
const extendSxProp = internal_createExtendSxProp();
|
|
26
14
|
const useUtilityClasses = ownerState => {
|
|
27
15
|
const {
|
|
28
16
|
align,
|
|
@@ -117,22 +105,12 @@ const defaultVariantMapping = {
|
|
|
117
105
|
inherit: 'p'
|
|
118
106
|
};
|
|
119
107
|
const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, ref) {
|
|
120
|
-
const {
|
|
121
|
-
color,
|
|
122
|
-
...themeProps
|
|
123
|
-
} = useDefaultProps({
|
|
108
|
+
const props = useDefaultProps({
|
|
124
109
|
props: inProps,
|
|
125
110
|
name: 'MuiTypography'
|
|
126
111
|
});
|
|
127
|
-
const isSxColor = !v6Colors[color];
|
|
128
|
-
// TODO: Remove `extendSxProp` in v7
|
|
129
|
-
const props = extendSxProp({
|
|
130
|
-
...themeProps,
|
|
131
|
-
...(isSxColor && {
|
|
132
|
-
color
|
|
133
|
-
})
|
|
134
|
-
});
|
|
135
112
|
const {
|
|
113
|
+
color,
|
|
136
114
|
align = 'inherit',
|
|
137
115
|
className,
|
|
138
116
|
component,
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -20,13 +20,13 @@ type SwitchBaseSlotsAndSlotProps = CreateSlotsAndSlotProps<SwitchBaseSlots, {
|
|
|
20
20
|
* Props forwarded to the root slot.
|
|
21
21
|
* By default, the available props are based on the [ButtonBase](https://mui.com/material-ui/api/button-base/#props) component.
|
|
22
22
|
*/
|
|
23
|
-
root: SlotProps<React.ElementType<ButtonBaseProps
|
|
23
|
+
root: SlotProps<React.ElementType<Omit<ButtonBaseProps, 'nativeButton'>>, {}, SwitchBaseOwnerState>;
|
|
24
24
|
/**
|
|
25
25
|
* Props forwarded to the input slot.
|
|
26
26
|
*/
|
|
27
27
|
input: SlotProps<'input', {}, SwitchBaseOwnerState>;
|
|
28
28
|
}>;
|
|
29
|
-
export interface SwitchBaseProps extends StandardProps<ButtonBaseProps, 'children' | 'onChange' | 'type' | 'value'>, SwitchBaseSlotsAndSlotProps {
|
|
29
|
+
export interface SwitchBaseProps extends StandardProps<Omit<ButtonBaseProps, 'nativeButton'>, 'children' | 'onChange' | 'type' | 'value'>, SwitchBaseSlotsAndSlotProps {
|
|
30
30
|
autoFocus?: boolean | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* If `true`, the component is checked.
|
|
@@ -68,16 +68,6 @@ export interface SwitchBaseProps extends StandardProps<ButtonBaseProps, 'childre
|
|
|
68
68
|
* The id of the `input` element.
|
|
69
69
|
*/
|
|
70
70
|
id?: string | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes) applied to the `input` element.
|
|
73
|
-
* @deprecated Use `slotProps.input` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
74
|
-
*/
|
|
75
|
-
inputProps?: React.InputHTMLAttributes<HTMLInputElement> | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Pass a ref to the `input` element.
|
|
78
|
-
* @deprecated Use `slotProps.input.ref` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
79
|
-
*/
|
|
80
|
-
inputRef?: React.Ref<any> | undefined;
|
|
81
71
|
/**
|
|
82
72
|
* Name attribute of the `input` element.
|
|
83
73
|
*/
|
package/internal/SwitchBase.d.ts
CHANGED
|
@@ -20,13 +20,13 @@ type SwitchBaseSlotsAndSlotProps = CreateSlotsAndSlotProps<SwitchBaseSlots, {
|
|
|
20
20
|
* Props forwarded to the root slot.
|
|
21
21
|
* By default, the available props are based on the [ButtonBase](https://mui.com/material-ui/api/button-base/#props) component.
|
|
22
22
|
*/
|
|
23
|
-
root: SlotProps<React.ElementType<ButtonBaseProps
|
|
23
|
+
root: SlotProps<React.ElementType<Omit<ButtonBaseProps, 'nativeButton'>>, {}, SwitchBaseOwnerState>;
|
|
24
24
|
/**
|
|
25
25
|
* Props forwarded to the input slot.
|
|
26
26
|
*/
|
|
27
27
|
input: SlotProps<'input', {}, SwitchBaseOwnerState>;
|
|
28
28
|
}>;
|
|
29
|
-
export interface SwitchBaseProps extends StandardProps<ButtonBaseProps, 'children' | 'onChange' | 'type' | 'value'>, SwitchBaseSlotsAndSlotProps {
|
|
29
|
+
export interface SwitchBaseProps extends StandardProps<Omit<ButtonBaseProps, 'nativeButton'>, 'children' | 'onChange' | 'type' | 'value'>, SwitchBaseSlotsAndSlotProps {
|
|
30
30
|
autoFocus?: boolean | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* If `true`, the component is checked.
|
|
@@ -68,16 +68,6 @@ export interface SwitchBaseProps extends StandardProps<ButtonBaseProps, 'childre
|
|
|
68
68
|
* The id of the `input` element.
|
|
69
69
|
*/
|
|
70
70
|
id?: string | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes) applied to the `input` element.
|
|
73
|
-
* @deprecated Use `slotProps.input` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
74
|
-
*/
|
|
75
|
-
inputProps?: React.InputHTMLAttributes<HTMLInputElement> | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Pass a ref to the `input` element.
|
|
78
|
-
* @deprecated Use `slotProps.input.ref` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
79
|
-
*/
|
|
80
|
-
inputRef?: React.Ref<any> | undefined;
|
|
81
71
|
/**
|
|
82
72
|
* Name attribute of the `input` element.
|
|
83
73
|
*/
|
package/internal/SwitchBase.js
CHANGED
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _refType = _interopRequireDefault(require("@mui/utils/refType"));
|
|
13
12
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
14
13
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
15
14
|
var _rootShouldForwardProp = _interopRequireDefault(require("../styles/rootShouldForwardProp"));
|
|
@@ -102,8 +101,6 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
102
101
|
edge = false,
|
|
103
102
|
icon,
|
|
104
103
|
id,
|
|
105
|
-
inputProps,
|
|
106
|
-
inputRef,
|
|
107
104
|
name,
|
|
108
105
|
onBlur,
|
|
109
106
|
onChange,
|
|
@@ -117,6 +114,10 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
117
114
|
slotProps = {},
|
|
118
115
|
...other
|
|
119
116
|
} = props;
|
|
117
|
+
const {
|
|
118
|
+
nativeButton,
|
|
119
|
+
...buttonBaseProps
|
|
120
|
+
} = other;
|
|
120
121
|
const [checked, setCheckedState] = (0, _useControlled.default)({
|
|
121
122
|
controlled: checkedProp,
|
|
122
123
|
default: Boolean(defaultChecked),
|
|
@@ -169,10 +170,7 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
169
170
|
const classes = useUtilityClasses(ownerState);
|
|
170
171
|
const externalForwardedProps = {
|
|
171
172
|
slots,
|
|
172
|
-
slotProps
|
|
173
|
-
input: inputProps,
|
|
174
|
-
...slotProps
|
|
175
|
-
}
|
|
173
|
+
slotProps
|
|
176
174
|
};
|
|
177
175
|
const [RootSlot, rootSlotProps] = (0, _useSlot.default)('root', {
|
|
178
176
|
ref,
|
|
@@ -182,7 +180,7 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
182
180
|
externalForwardedProps: {
|
|
183
181
|
...externalForwardedProps,
|
|
184
182
|
component: 'span',
|
|
185
|
-
...
|
|
183
|
+
...buttonBaseProps
|
|
186
184
|
},
|
|
187
185
|
getSlotProps: handlers => ({
|
|
188
186
|
...handlers,
|
|
@@ -204,7 +202,6 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
|
|
|
204
202
|
}
|
|
205
203
|
});
|
|
206
204
|
const [InputSlot, inputSlotProps] = (0, _useSlot.default)('input', {
|
|
207
|
-
ref: inputRef,
|
|
208
205
|
elementType: SwitchBaseInput,
|
|
209
206
|
className: classes.input,
|
|
210
207
|
externalForwardedProps,
|
|
@@ -292,14 +289,6 @@ process.env.NODE_ENV !== "production" ? SwitchBase.propTypes = {
|
|
|
292
289
|
* The id of the `input` element.
|
|
293
290
|
*/
|
|
294
291
|
id: _propTypes.default.string,
|
|
295
|
-
/**
|
|
296
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#attributes) applied to the `input` element.
|
|
297
|
-
*/
|
|
298
|
-
inputProps: _propTypes.default.object,
|
|
299
|
-
/**
|
|
300
|
-
* Pass a ref to the `input` element.
|
|
301
|
-
*/
|
|
302
|
-
inputRef: _refType.default,
|
|
303
292
|
/*
|
|
304
293
|
* @ignore
|
|
305
294
|
*/
|