@mui/material 5.11.12 → 5.11.14
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/accordionClasses.d.ts +18 -18
- package/AccordionActions/accordionActionsClasses.d.ts +10 -10
- package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
- package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
- package/Alert/alertClasses.d.ts +44 -44
- package/AlertTitle/alertTitleClasses.d.ts +8 -8
- package/AppBar/appBarClasses.d.ts +28 -28
- package/Autocomplete/autocompleteClasses.d.ts +56 -56
- package/Avatar/avatarClasses.d.ts +20 -20
- package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
- package/Backdrop/backdropClasses.d.ts +10 -10
- package/Badge/badgeClasses.d.ts +56 -56
- package/BottomNavigation/BottomNavigation.js +0 -0
- package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
- package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
- package/Breadcrumbs/BreadcrumbCollapsed.js +26 -3
- package/Breadcrumbs/Breadcrumbs.d.ts +31 -0
- package/Breadcrumbs/Breadcrumbs.js +30 -2
- package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
- package/Button/buttonClasses.d.ts +100 -100
- package/ButtonBase/buttonBaseClasses.d.ts +12 -12
- package/ButtonBase/touchRippleClasses.d.ts +20 -20
- package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
- package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
- package/CHANGELOG.md +114 -5
- package/Card/cardClasses.d.ts +8 -8
- package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
- package/CardActions/cardActionsClasses.d.ts +10 -10
- package/CardContent/cardContentClasses.d.ts +8 -8
- package/CardHeader/cardHeaderClasses.d.ts +18 -18
- package/CardMedia/cardMediaClasses.d.ts +12 -12
- package/Checkbox/checkboxClasses.d.ts +18 -18
- package/Chip/chipClasses.d.ts +96 -96
- package/CircularProgress/circularProgressClasses.d.ts +26 -26
- package/ClickAwayListener/index.d.ts +2 -2
- package/Collapse/collapseClasses.d.ts +18 -18
- package/Container/containerClasses.d.ts +6 -6
- package/Dialog/DialogContext.d.ts +6 -6
- package/Dialog/dialogClasses.d.ts +36 -36
- package/DialogActions/dialogActionsClasses.d.ts +10 -10
- package/DialogContent/dialogContentClasses.d.ts +10 -10
- package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
- package/DialogTitle/dialogTitleClasses.d.ts +8 -8
- package/Divider/dividerClasses.d.ts +34 -34
- package/Drawer/drawerClasses.d.ts +30 -30
- package/Fab/fabClasses.d.ts +26 -26
- package/FilledInput/filledInputClasses.d.ts +40 -40
- package/FormControl/FormControlContext.d.ts +17 -17
- package/FormControl/formControlClasses.d.ts +14 -14
- package/FormControl/useFormControl.d.ts +2 -2
- package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
- package/FormGroup/formGroupClasses.d.ts +12 -12
- package/FormHelperText/formHelperTextClasses.d.ts +22 -22
- package/FormLabel/formLabelClasses.d.ts +22 -22
- package/Grid/gridClasses.d.ts +48 -48
- package/Icon/iconClasses.d.ts +24 -24
- package/IconButton/iconButtonClasses.d.ts +34 -34
- package/ImageList/imageListClasses.d.ts +16 -16
- package/ImageListItem/imageListItemClasses.d.ts +18 -18
- package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
- package/Input/inputClasses.d.ts +34 -34
- package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
- package/InputBase/inputBaseClasses.d.ts +46 -46
- package/InputLabel/inputLabelClasses.d.ts +32 -32
- package/LinearProgress/linearProgressClasses.d.ts +42 -42
- package/Link/getTextDecoration.d.ts +15 -15
- package/Link/linkClasses.d.ts +18 -18
- package/List/listClasses.d.ts +14 -14
- package/ListItem/listItemClasses.d.ts +30 -30
- package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
- package/ListItemButton/ListItemButton.js +4 -2
- package/ListItemButton/listItemButtonClasses.d.ts +22 -22
- package/ListItemIcon/listItemIconClasses.d.ts +10 -10
- package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
- package/ListItemText/listItemTextClasses.d.ts +18 -18
- package/ListSubheader/listSubheaderClasses.d.ts +18 -18
- package/Menu/menuClasses.d.ts +12 -12
- package/MenuItem/menuItemClasses.d.ts +20 -20
- package/MobileStepper/mobileStepperClasses.d.ts +22 -22
- package/NativeSelect/nativeSelectClasses.d.ts +32 -32
- package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
- package/Pagination/paginationClasses.d.ts +14 -14
- package/PaginationItem/paginationItemClasses.d.ts +42 -42
- package/Paper/paperClasses.d.ts +39 -39
- package/Popover/popoverClasses.d.ts +10 -10
- package/Popper/Popper.d.ts +55 -55
- package/README.md +5 -4
- package/Radio/radioClasses.d.ts +16 -16
- package/RadioGroup/RadioGroupContext.d.ts +11 -11
- package/RadioGroup/useRadioGroup.d.ts +4 -4
- package/Rating/ratingClasses.d.ts +40 -40
- package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
- package/Select/selectClasses.d.ts +30 -30
- package/Skeleton/skeletonClasses.d.ts +26 -26
- package/Slider/SliderValueLabel.d.ts +15 -15
- package/Slider/SliderValueLabel.types.d.ts +24 -24
- package/Slider/sliderClasses.d.ts +58 -58
- package/Snackbar/snackbarClasses.d.ts +20 -20
- package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
- package/SpeedDial/speedDialClasses.d.ts +22 -22
- package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
- package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
- package/Stack/stackClasses.d.ts +6 -6
- package/Step/StepContext.d.ts +20 -20
- package/Step/stepClasses.d.ts +16 -16
- package/StepButton/StepButton.js +4 -2
- package/StepButton/stepButtonClasses.d.ts +14 -14
- package/StepConnector/stepConnectorClasses.d.ts +26 -26
- package/StepContent/stepContentClasses.d.ts +12 -12
- package/StepIcon/stepIconClasses.d.ts +16 -16
- package/StepLabel/stepLabelClasses.d.ts +28 -28
- package/Stepper/StepperContext.d.ts +18 -18
- package/Stepper/stepperClasses.d.ts +14 -14
- package/SvgIcon/svgIconClasses.d.ts +26 -26
- package/Switch/switchClasses.d.ts +32 -32
- package/Tab/tabClasses.d.ts +26 -26
- package/TabScrollButton/TabScrollButton.d.ts +34 -1
- package/TabScrollButton/TabScrollButton.js +41 -8
- package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
- package/Table/tableClasses.d.ts +10 -10
- package/TableBody/tableBodyClasses.d.ts +8 -8
- package/TableCell/tableCellClasses.d.ts +32 -32
- package/TableContainer/tableContainerClasses.d.ts +8 -8
- package/TableFooter/tableFooterClasses.d.ts +8 -8
- package/TableHead/tableHeadClasses.d.ts +8 -8
- package/TablePagination/tablePaginationClasses.d.ts +28 -28
- package/TableRow/tableRowClasses.d.ts +16 -16
- package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
- package/Tabs/Tabs.d.ts +40 -0
- package/Tabs/Tabs.js +43 -2
- package/Tabs/tabsClasses.d.ts +32 -32
- package/TextField/textFieldClasses.d.ts +8 -8
- package/ToggleButton/toggleButtonClasses.d.ts +24 -24
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
- package/Toolbar/toolbarClasses.d.ts +14 -14
- package/Tooltip/tooltipClasses.d.ts +30 -30
- package/Typography/typographyClasses.d.ts +50 -50
- package/Unstable_Grid2/Grid2.d.ts +4 -4
- package/Unstable_Grid2/Grid2Props.d.ts +15 -15
- package/Unstable_Grid2/grid2Classes.d.ts +5 -5
- package/Unstable_Grid2/index.d.ts +4 -4
- package/className/index.d.ts +1 -1
- package/darkScrollbar/index.d.ts +28 -28
- package/generateUtilityClass/index.d.ts +2 -2
- package/generateUtilityClasses/index.d.ts +1 -1
- package/index.js +1 -1
- package/internal/switchBaseClasses.d.ts +12 -12
- package/legacy/BottomNavigation/BottomNavigation.js +0 -0
- package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +25 -3
- package/legacy/Breadcrumbs/Breadcrumbs.js +32 -2
- package/legacy/ListItemButton/ListItemButton.js +4 -2
- package/legacy/StepButton/StepButton.js +4 -2
- package/legacy/TabScrollButton/TabScrollButton.js +43 -8
- package/legacy/Tabs/Tabs.js +45 -2
- package/legacy/index.js +1 -1
- package/legacy/locale/index.js +156 -80
- package/legacy/styles/createTypography.js +8 -1
- package/legacy/styles/experimental_extendTheme.js +1 -6
- package/legacy/styles/index.js +1 -0
- package/legacy/styles/shouldSkipGeneratingVar.js +6 -0
- package/locale/index.d.ts +76 -75
- package/locale/index.js +73 -0
- package/modern/BottomNavigation/BottomNavigation.js +0 -0
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +26 -3
- package/modern/Breadcrumbs/Breadcrumbs.js +30 -2
- package/modern/ListItemButton/ListItemButton.js +4 -2
- package/modern/StepButton/StepButton.js +4 -2
- package/modern/TabScrollButton/TabScrollButton.js +40 -8
- package/modern/Tabs/Tabs.js +43 -2
- package/modern/index.js +1 -1
- package/modern/locale/index.js +73 -0
- package/modern/styles/createTypography.js +8 -1
- package/modern/styles/experimental_extendTheme.js +1 -3
- package/modern/styles/index.js +1 -0
- package/modern/styles/shouldSkipGeneratingVar.js +5 -0
- package/node/BottomNavigation/BottomNavigation.js +0 -0
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +26 -3
- package/node/Breadcrumbs/Breadcrumbs.js +29 -1
- package/node/ListItemButton/ListItemButton.js +4 -2
- package/node/StepButton/StepButton.js +4 -2
- package/node/TabScrollButton/TabScrollButton.js +42 -9
- package/node/Tabs/Tabs.js +42 -1
- package/node/index.js +1 -1
- package/node/locale/index.js +75 -1
- package/node/styles/createTypography.js +8 -1
- package/node/styles/experimental_extendTheme.js +2 -9
- package/node/styles/index.js +8 -0
- package/node/styles/shouldSkipGeneratingVar.js +12 -0
- package/package.json +5 -5
- package/styles/CssVarsProvider.d.ts +15 -15
- package/styles/createTypography.js +8 -1
- package/styles/excludeVariablesFromRoot.d.ts +5 -5
- package/styles/experimental_extendTheme.d.ts +5 -1
- package/styles/experimental_extendTheme.js +1 -6
- package/styles/getOverlayAlpha.d.ts +2 -2
- package/styles/index.d.ts +1 -0
- package/styles/index.js +1 -0
- package/styles/shouldSkipGeneratingVar.d.ts +1 -0
- package/styles/shouldSkipGeneratingVar.js +6 -0
- package/transitions/index.d.ts +1 -1
- package/transitions/transition.d.ts +13 -13
- package/transitions/utils.d.ts +23 -23
- package/types/OverridableComponentAugmentation.d.ts +31 -31
- package/umd/material-ui.development.js +335 -131
- package/umd/material-ui.production.min.js +20 -20
- package/useMediaQuery/useMediaQuery.d.ts +46 -46
- package/useTouchRipple/index.d.ts +1 -1
- package/useTouchRipple/useTouchRipple.d.ts +28 -28
- package/utils/getScrollbarSize.d.ts +2 -2
- package/utils/ownerDocument.d.ts +2 -2
- package/utils/ownerWindow.d.ts +2 -2
- package/utils/setRef.d.ts +2 -2
|
File without changes
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
const _excluded = ["slots", "slotProps"];
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
4
6
|
import { emphasize } from '@mui/system';
|
|
@@ -42,19 +44,40 @@ const BreadcrumbCollapsedIcon = styled(MoreHorizIcon)({
|
|
|
42
44
|
* @ignore - internal component.
|
|
43
45
|
*/
|
|
44
46
|
function BreadcrumbCollapsed(props) {
|
|
47
|
+
const {
|
|
48
|
+
slots = {},
|
|
49
|
+
slotProps = {}
|
|
50
|
+
} = props,
|
|
51
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
45
52
|
const ownerState = props;
|
|
46
53
|
return /*#__PURE__*/_jsx("li", {
|
|
47
54
|
children: /*#__PURE__*/_jsx(BreadcrumbCollapsedButton, _extends({
|
|
48
55
|
focusRipple: true
|
|
49
|
-
},
|
|
56
|
+
}, otherProps, {
|
|
50
57
|
ownerState: ownerState,
|
|
51
|
-
children: /*#__PURE__*/_jsx(BreadcrumbCollapsedIcon, {
|
|
58
|
+
children: /*#__PURE__*/_jsx(BreadcrumbCollapsedIcon, _extends({
|
|
59
|
+
as: slots.CollapsedIcon,
|
|
52
60
|
ownerState: ownerState
|
|
53
|
-
})
|
|
61
|
+
}, slotProps.collapsedIcon))
|
|
54
62
|
}))
|
|
55
63
|
});
|
|
56
64
|
}
|
|
57
65
|
process.env.NODE_ENV !== "production" ? BreadcrumbCollapsed.propTypes = {
|
|
66
|
+
/**
|
|
67
|
+
* The props used for the CollapsedIcon slot.
|
|
68
|
+
* @default {}
|
|
69
|
+
*/
|
|
70
|
+
slotProps: PropTypes.shape({
|
|
71
|
+
collapsedIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
72
|
+
}),
|
|
73
|
+
/**
|
|
74
|
+
* The components used for each slot inside the BreadcumbCollapsed.
|
|
75
|
+
* Either a string to use a HTML element or a component.
|
|
76
|
+
* @default {}
|
|
77
|
+
*/
|
|
78
|
+
slots: PropTypes.shape({
|
|
79
|
+
CollapsedIcon: PropTypes.elementType
|
|
80
|
+
}),
|
|
58
81
|
/**
|
|
59
82
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
60
83
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["children", "className", "component", "expandText", "itemsAfterCollapse", "itemsBeforeCollapse", "maxItems", "separator"];
|
|
3
|
+
const _excluded = ["children", "className", "component", "slots", "slotProps", "expandText", "itemsAfterCollapse", "itemsBeforeCollapse", "maxItems", "separator"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { isFragment } from 'react-is';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import { integerPropType } from '@mui/utils';
|
|
9
|
-
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
9
|
+
import { unstable_composeClasses as composeClasses, useSlotProps } from '@mui/base';
|
|
10
10
|
import styled from '../styles/styled';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
12
|
import Typography from '../Typography';
|
|
@@ -80,6 +80,8 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps,
|
|
|
80
80
|
children,
|
|
81
81
|
className,
|
|
82
82
|
component = 'nav',
|
|
83
|
+
slots = {},
|
|
84
|
+
slotProps = {},
|
|
83
85
|
expandText = 'Show path',
|
|
84
86
|
itemsAfterCollapse = 1,
|
|
85
87
|
itemsBeforeCollapse = 1,
|
|
@@ -98,6 +100,11 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps,
|
|
|
98
100
|
separator
|
|
99
101
|
});
|
|
100
102
|
const classes = useUtilityClasses(ownerState);
|
|
103
|
+
const collapsedIconSlotProps = useSlotProps({
|
|
104
|
+
elementType: slots.CollapsedIcon,
|
|
105
|
+
externalSlotProps: slotProps.collapsedIcon,
|
|
106
|
+
ownerState
|
|
107
|
+
});
|
|
101
108
|
const listRef = React.useRef(null);
|
|
102
109
|
const renderItemsBeforeAndAfter = allItems => {
|
|
103
110
|
const handleClickExpand = () => {
|
|
@@ -123,6 +130,12 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps,
|
|
|
123
130
|
}
|
|
124
131
|
return [...allItems.slice(0, itemsBeforeCollapse), /*#__PURE__*/_jsx(BreadcrumbCollapsed, {
|
|
125
132
|
"aria-label": expandText,
|
|
133
|
+
slots: {
|
|
134
|
+
CollapsedIcon: slots.CollapsedIcon
|
|
135
|
+
},
|
|
136
|
+
slotProps: {
|
|
137
|
+
collapsedIcon: collapsedIconSlotProps
|
|
138
|
+
},
|
|
126
139
|
onClick: handleClickExpand
|
|
127
140
|
}, "ellipsis"), ...allItems.slice(allItems.length - itemsAfterCollapse, allItems.length)];
|
|
128
141
|
};
|
|
@@ -203,6 +216,21 @@ process.env.NODE_ENV !== "production" ? Breadcrumbs.propTypes /* remove-proptype
|
|
|
203
216
|
* @default '/'
|
|
204
217
|
*/
|
|
205
218
|
separator: PropTypes.node,
|
|
219
|
+
/**
|
|
220
|
+
* The props used for each slot inside the Breadcumb.
|
|
221
|
+
* @default {}
|
|
222
|
+
*/
|
|
223
|
+
slotProps: PropTypes.shape({
|
|
224
|
+
collapsedIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
225
|
+
}),
|
|
226
|
+
/**
|
|
227
|
+
* The components used for each slot inside the Breadcumb.
|
|
228
|
+
* Either a string to use a HTML element or a component.
|
|
229
|
+
* @default {}
|
|
230
|
+
*/
|
|
231
|
+
slots: PropTypes.shape({
|
|
232
|
+
CollapsedIcon: PropTypes.elementType
|
|
233
|
+
}),
|
|
206
234
|
/**
|
|
207
235
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
208
236
|
*/
|
|
@@ -145,8 +145,10 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
|
|
|
145
145
|
value: childContext,
|
|
146
146
|
children: /*#__PURE__*/_jsx(ListItemButtonRoot, _extends({
|
|
147
147
|
ref: handleRef,
|
|
148
|
-
href: other.href || other.to
|
|
149
|
-
|
|
148
|
+
href: other.href || other.to
|
|
149
|
+
// `ButtonBase` processes `href` or `to` if `component` is set to 'button'
|
|
150
|
+
,
|
|
151
|
+
component: (other.href || other.to) && component === 'div' ? 'button' : component,
|
|
150
152
|
focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),
|
|
151
153
|
ownerState: ownerState,
|
|
152
154
|
className: clsx(classes.root, className)
|
|
@@ -65,7 +65,8 @@ const StepButton = /*#__PURE__*/React.forwardRef(function StepButton(inProps, re
|
|
|
65
65
|
} = props,
|
|
66
66
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
67
67
|
const {
|
|
68
|
-
disabled
|
|
68
|
+
disabled,
|
|
69
|
+
active
|
|
69
70
|
} = React.useContext(StepContext);
|
|
70
71
|
const {
|
|
71
72
|
orientation
|
|
@@ -89,7 +90,8 @@ const StepButton = /*#__PURE__*/React.forwardRef(function StepButton(inProps, re
|
|
|
89
90
|
},
|
|
90
91
|
className: clsx(classes.root, className),
|
|
91
92
|
ref: ref,
|
|
92
|
-
ownerState: ownerState
|
|
93
|
+
ownerState: ownerState,
|
|
94
|
+
"aria-current": active ? 'step' : undefined
|
|
93
95
|
}, other, {
|
|
94
96
|
children: child
|
|
95
97
|
}));
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
|
|
4
|
-
const _excluded = ["className", "direction", "orientation", "disabled"];
|
|
3
|
+
const _excluded = ["className", "slots", "slotProps", "direction", "orientation", "disabled"];
|
|
5
4
|
/* eslint-disable jsx-a11y/aria-role */
|
|
6
5
|
import * as React from 'react';
|
|
7
6
|
import PropTypes from 'prop-types';
|
|
8
7
|
import clsx from 'clsx';
|
|
9
|
-
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
8
|
+
import { unstable_composeClasses as composeClasses, useSlotProps } from '@mui/base';
|
|
10
9
|
import KeyboardArrowLeft from '../internal/svg-icons/KeyboardArrowLeft';
|
|
11
10
|
import KeyboardArrowRight from '../internal/svg-icons/KeyboardArrowRight';
|
|
12
11
|
import ButtonBase from '../ButtonBase';
|
|
@@ -58,6 +57,8 @@ const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(i
|
|
|
58
57
|
});
|
|
59
58
|
const {
|
|
60
59
|
className,
|
|
60
|
+
slots = {},
|
|
61
|
+
slotProps = {},
|
|
61
62
|
direction
|
|
62
63
|
} = props,
|
|
63
64
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -67,6 +68,24 @@ const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(i
|
|
|
67
68
|
isRtl
|
|
68
69
|
}, props);
|
|
69
70
|
const classes = useUtilityClasses(ownerState);
|
|
71
|
+
const StartButtonIcon = slots.StartScrollButtonIcon ?? KeyboardArrowLeft;
|
|
72
|
+
const EndButtonIcon = slots.EndScrollButtonIcon ?? KeyboardArrowRight;
|
|
73
|
+
const startButtonIconProps = useSlotProps({
|
|
74
|
+
elementType: StartButtonIcon,
|
|
75
|
+
externalSlotProps: slotProps.startScrollButtonIcon,
|
|
76
|
+
additionalProps: {
|
|
77
|
+
fontSize: 'small'
|
|
78
|
+
},
|
|
79
|
+
ownerState
|
|
80
|
+
});
|
|
81
|
+
const endButtonIconProps = useSlotProps({
|
|
82
|
+
elementType: EndButtonIcon,
|
|
83
|
+
externalSlotProps: slotProps.endScrollButtonIcon,
|
|
84
|
+
additionalProps: {
|
|
85
|
+
fontSize: 'small'
|
|
86
|
+
},
|
|
87
|
+
ownerState
|
|
88
|
+
});
|
|
70
89
|
return /*#__PURE__*/_jsx(TabScrollButtonRoot, _extends({
|
|
71
90
|
component: "div",
|
|
72
91
|
className: clsx(classes.root, className),
|
|
@@ -75,11 +94,7 @@ const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(i
|
|
|
75
94
|
ownerState: ownerState,
|
|
76
95
|
tabIndex: null
|
|
77
96
|
}, other, {
|
|
78
|
-
children: direction === 'left' ?
|
|
79
|
-
fontSize: "small"
|
|
80
|
-
})) : _KeyboardArrowRight || (_KeyboardArrowRight = /*#__PURE__*/_jsx(KeyboardArrowRight, {
|
|
81
|
-
fontSize: "small"
|
|
82
|
-
}))
|
|
97
|
+
children: direction === 'left' ? /*#__PURE__*/_jsx(StartButtonIcon, _extends({}, startButtonIconProps)) : /*#__PURE__*/_jsx(EndButtonIcon, _extends({}, endButtonIconProps))
|
|
83
98
|
}));
|
|
84
99
|
});
|
|
85
100
|
process.env.NODE_ENV !== "production" ? TabScrollButton.propTypes /* remove-proptypes */ = {
|
|
@@ -112,6 +127,23 @@ process.env.NODE_ENV !== "production" ? TabScrollButton.propTypes /* remove-prop
|
|
|
112
127
|
* The component orientation (layout flow direction).
|
|
113
128
|
*/
|
|
114
129
|
orientation: PropTypes.oneOf(['horizontal', 'vertical']).isRequired,
|
|
130
|
+
/**
|
|
131
|
+
* The extra props for the slot components.
|
|
132
|
+
* You can override the existing props or add new ones.
|
|
133
|
+
* @default {}
|
|
134
|
+
*/
|
|
135
|
+
slotProps: PropTypes.shape({
|
|
136
|
+
endScrollButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
137
|
+
startScrollButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
138
|
+
}),
|
|
139
|
+
/**
|
|
140
|
+
* The components used for each slot inside.
|
|
141
|
+
* @default {}
|
|
142
|
+
*/
|
|
143
|
+
slots: PropTypes.shape({
|
|
144
|
+
EndScrollButtonIcon: PropTypes.elementType,
|
|
145
|
+
StartScrollButtonIcon: PropTypes.elementType
|
|
146
|
+
}),
|
|
115
147
|
/**
|
|
116
148
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
117
149
|
*/
|
package/modern/Tabs/Tabs.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["aria-label", "aria-labelledby", "action", "centered", "children", "className", "component", "allowScrollButtonsMobile", "indicatorColor", "onChange", "orientation", "ScrollButtonComponent", "scrollButtons", "selectionFollowsFocus", "TabIndicatorProps", "TabScrollButtonProps", "textColor", "value", "variant", "visibleScrollbar"];
|
|
3
|
+
const _excluded = ["aria-label", "aria-labelledby", "action", "centered", "children", "className", "component", "allowScrollButtonsMobile", "indicatorColor", "onChange", "orientation", "ScrollButtonComponent", "scrollButtons", "selectionFollowsFocus", "slots", "slotProps", "TabIndicatorProps", "TabScrollButtonProps", "textColor", "value", "variant", "visibleScrollbar"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { isFragment } from 'react-is';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import { refType } from '@mui/utils';
|
|
9
|
-
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
9
|
+
import { unstable_composeClasses as composeClasses, useSlotProps } from '@mui/base';
|
|
10
10
|
import styled from '../styles/styled';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
12
|
import useTheme from '../styles/useTheme';
|
|
@@ -226,6 +226,8 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
226
226
|
ScrollButtonComponent = TabScrollButton,
|
|
227
227
|
scrollButtons = 'auto',
|
|
228
228
|
selectionFollowsFocus,
|
|
229
|
+
slots = {},
|
|
230
|
+
slotProps = {},
|
|
229
231
|
TabIndicatorProps = {},
|
|
230
232
|
TabScrollButtonProps = {},
|
|
231
233
|
textColor = 'primary',
|
|
@@ -259,6 +261,16 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
259
261
|
scrollButtonsHideMobile: !allowScrollButtonsMobile
|
|
260
262
|
});
|
|
261
263
|
const classes = useUtilityClasses(ownerState);
|
|
264
|
+
const startScrollButtonIconProps = useSlotProps({
|
|
265
|
+
elementType: slots.StartScrollButtonIcon,
|
|
266
|
+
externalSlotProps: slotProps.startScrollButtonIcon,
|
|
267
|
+
ownerState
|
|
268
|
+
});
|
|
269
|
+
const endScrollButtonIconProps = useSlotProps({
|
|
270
|
+
elementType: slots.EndScrollButtonIcon,
|
|
271
|
+
externalSlotProps: slotProps.endScrollButtonIcon,
|
|
272
|
+
ownerState
|
|
273
|
+
});
|
|
262
274
|
if (process.env.NODE_ENV !== 'production') {
|
|
263
275
|
if (centered && scrollable) {
|
|
264
276
|
console.error('MUI: You can not use the `centered={true}` and `variant="scrollable"` properties ' + 'at the same time on a `Tabs` component.');
|
|
@@ -423,6 +435,12 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
423
435
|
const scrollButtonsActive = displayScroll.start || displayScroll.end;
|
|
424
436
|
const showScrollButtons = scrollable && (scrollButtons === 'auto' && scrollButtonsActive || scrollButtons === true);
|
|
425
437
|
conditionalElements.scrollButtonStart = showScrollButtons ? /*#__PURE__*/_jsx(ScrollButtonComponent, _extends({
|
|
438
|
+
slots: {
|
|
439
|
+
StartScrollButtonIcon: slots.StartScrollButtonIcon
|
|
440
|
+
},
|
|
441
|
+
slotProps: {
|
|
442
|
+
startScrollButtonIcon: startScrollButtonIconProps
|
|
443
|
+
},
|
|
426
444
|
orientation: orientation,
|
|
427
445
|
direction: isRtl ? 'right' : 'left',
|
|
428
446
|
onClick: handleStartScrollClick,
|
|
@@ -431,6 +449,12 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
431
449
|
className: clsx(classes.scrollButtons, TabScrollButtonProps.className)
|
|
432
450
|
})) : null;
|
|
433
451
|
conditionalElements.scrollButtonEnd = showScrollButtons ? /*#__PURE__*/_jsx(ScrollButtonComponent, _extends({
|
|
452
|
+
slots: {
|
|
453
|
+
EndScrollButtonIcon: slots.EndScrollButtonIcon
|
|
454
|
+
},
|
|
455
|
+
slotProps: {
|
|
456
|
+
endScrollButtonIcon: endScrollButtonIconProps
|
|
457
|
+
},
|
|
434
458
|
orientation: orientation,
|
|
435
459
|
direction: isRtl ? 'left' : 'right',
|
|
436
460
|
onClick: handleEndScrollClick,
|
|
@@ -732,6 +756,23 @@ process.env.NODE_ENV !== "production" ? Tabs.propTypes /* remove-proptypes */ =
|
|
|
732
756
|
* changes on activation.
|
|
733
757
|
*/
|
|
734
758
|
selectionFollowsFocus: PropTypes.bool,
|
|
759
|
+
/**
|
|
760
|
+
* The extra props for the slot components.
|
|
761
|
+
* You can override the existing props or add new ones.
|
|
762
|
+
* @default {}
|
|
763
|
+
*/
|
|
764
|
+
slotProps: PropTypes.shape({
|
|
765
|
+
endScrollButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
766
|
+
startScrollButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
767
|
+
}),
|
|
768
|
+
/**
|
|
769
|
+
* The components used for each slot inside.
|
|
770
|
+
* @default {}
|
|
771
|
+
*/
|
|
772
|
+
slots: PropTypes.shape({
|
|
773
|
+
EndScrollButtonIcon: PropTypes.elementType,
|
|
774
|
+
StartScrollButtonIcon: PropTypes.elementType
|
|
775
|
+
}),
|
|
735
776
|
/**
|
|
736
777
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
737
778
|
*/
|
package/modern/index.js
CHANGED
package/modern/locale/index.js
CHANGED
|
@@ -2211,6 +2211,79 @@ export const koKR = {
|
|
|
2211
2211
|
}
|
|
2212
2212
|
}
|
|
2213
2213
|
};
|
|
2214
|
+
export const kuCKB = {
|
|
2215
|
+
components: {
|
|
2216
|
+
MuiBreadcrumbs: {
|
|
2217
|
+
defaultProps: {
|
|
2218
|
+
expandText: 'ڕێچکە پیشان بدە'
|
|
2219
|
+
}
|
|
2220
|
+
},
|
|
2221
|
+
MuiTablePagination: {
|
|
2222
|
+
defaultProps: {
|
|
2223
|
+
getItemAriaLabel: type => {
|
|
2224
|
+
if (type === 'first') {
|
|
2225
|
+
return 'چوونە یەکەم پەڕە';
|
|
2226
|
+
}
|
|
2227
|
+
if (type === 'last') {
|
|
2228
|
+
return 'چوونە کۆتا پەڕە';
|
|
2229
|
+
}
|
|
2230
|
+
if (type === 'next') {
|
|
2231
|
+
return 'چوونە پەڕەی دواتر';
|
|
2232
|
+
}
|
|
2233
|
+
// if (type === 'previous') {
|
|
2234
|
+
return 'گەڕانەوە بۆ پەڕەی پێشوو';
|
|
2235
|
+
},
|
|
2236
|
+
labelRowsPerPage: 'ژمارەی ڕیزەکان لە هەر پەڕەیەک:',
|
|
2237
|
+
labelDisplayedRows: ({
|
|
2238
|
+
from,
|
|
2239
|
+
to,
|
|
2240
|
+
count
|
|
2241
|
+
}) => `${from}–${to} لە ${count !== -1 ? count : ` زیاترە لە${to}`}`
|
|
2242
|
+
}
|
|
2243
|
+
},
|
|
2244
|
+
MuiRating: {
|
|
2245
|
+
defaultProps: {
|
|
2246
|
+
getLabelText: value => `${value} ${value !== 1 ? 'ئەستێرەکان' : 'ئەستێرە'}`,
|
|
2247
|
+
emptyLabelText: 'خاڵیە'
|
|
2248
|
+
}
|
|
2249
|
+
},
|
|
2250
|
+
MuiAutocomplete: {
|
|
2251
|
+
defaultProps: {
|
|
2252
|
+
clearText: 'سڕینەوە',
|
|
2253
|
+
closeText: 'داخستن',
|
|
2254
|
+
loadingText: 'لە بارکردندایە...',
|
|
2255
|
+
noOptionsText: 'هیچ بژاردەیەک نیە',
|
|
2256
|
+
openText: 'کردنەوە'
|
|
2257
|
+
}
|
|
2258
|
+
},
|
|
2259
|
+
MuiAlert: {
|
|
2260
|
+
defaultProps: {
|
|
2261
|
+
closeText: 'داخستن'
|
|
2262
|
+
}
|
|
2263
|
+
},
|
|
2264
|
+
MuiPagination: {
|
|
2265
|
+
defaultProps: {
|
|
2266
|
+
'aria-label': 'گەڕان لە پەڕەکان',
|
|
2267
|
+
getItemAriaLabel: (type, page, selected) => {
|
|
2268
|
+
if (type === 'page') {
|
|
2269
|
+
return `${selected ? '' : 'چوون بۆ '} پەڕەی ${page}`;
|
|
2270
|
+
}
|
|
2271
|
+
if (type === 'first') {
|
|
2272
|
+
return 'چوونە یەکەم پەڕە';
|
|
2273
|
+
}
|
|
2274
|
+
if (type === 'last') {
|
|
2275
|
+
return 'چوونە کۆتا پەڕە';
|
|
2276
|
+
}
|
|
2277
|
+
if (type === 'next') {
|
|
2278
|
+
return 'چوونە پەڕەی دواتر';
|
|
2279
|
+
}
|
|
2280
|
+
// if (type === 'previous') {
|
|
2281
|
+
return 'گەڕانەوە بۆ پەڕەی پێشوو';
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
};
|
|
2214
2287
|
export const kuLatn = {
|
|
2215
2288
|
components: {
|
|
2216
2289
|
MuiBreadcrumbs: {
|
|
@@ -65,7 +65,14 @@ export default function createTypography(palette, typography) {
|
|
|
65
65
|
body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),
|
|
66
66
|
button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),
|
|
67
67
|
caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
|
|
68
|
-
overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps)
|
|
68
|
+
overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),
|
|
69
|
+
inherit: {
|
|
70
|
+
fontFamily: 'inherit',
|
|
71
|
+
fontWeight: 'inherit',
|
|
72
|
+
fontSize: 'inherit',
|
|
73
|
+
lineHeight: 'inherit',
|
|
74
|
+
letterSpacing: 'inherit'
|
|
75
|
+
}
|
|
69
76
|
};
|
|
70
77
|
return deepmerge(_extends({
|
|
71
78
|
htmlFontSize,
|
|
@@ -4,6 +4,7 @@ const _excluded = ["colorSchemes", "cssVarPrefix", "shouldSkipGeneratingVar"],
|
|
|
4
4
|
_excluded2 = ["palette"];
|
|
5
5
|
import { deepmerge } from '@mui/utils';
|
|
6
6
|
import { private_safeColorChannel as safeColorChannel, private_safeAlpha as safeAlpha, private_safeDarken as safeDarken, private_safeLighten as safeLighten, private_safeEmphasize as safeEmphasize, unstable_createGetCssVar as systemCreateGetCssVar, unstable_defaultSxConfig as defaultSxConfig, unstable_styleFunctionSx as styleFunctionSx, unstable_prepareCssVars as prepareCssVars } from '@mui/system';
|
|
7
|
+
import defaultShouldSkipGeneratingVar from './shouldSkipGeneratingVar';
|
|
7
8
|
import createThemeWithoutVars from './createTheme';
|
|
8
9
|
import getOverlayAlpha from './getOverlayAlpha';
|
|
9
10
|
const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
@@ -41,9 +42,6 @@ const silent = fn => {
|
|
|
41
42
|
return undefined;
|
|
42
43
|
};
|
|
43
44
|
export const createGetCssVar = (cssVarPrefix = 'mui') => systemCreateGetCssVar(cssVarPrefix);
|
|
44
|
-
export const defaultShouldSkipGeneratingVar = keys => !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
|
|
45
|
-
// ends with sxConfig
|
|
46
|
-
keys[0] === 'palette' && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
|
|
47
45
|
export default function extendTheme(options = {}, ...args) {
|
|
48
46
|
const {
|
|
49
47
|
colorSchemes: colorSchemesInput = {},
|
package/modern/styles/index.js
CHANGED
|
@@ -26,6 +26,7 @@ export { default as withTheme } from './withTheme';
|
|
|
26
26
|
export * from './CssVarsProvider';
|
|
27
27
|
export { default as experimental_extendTheme } from './experimental_extendTheme';
|
|
28
28
|
export { default as getOverlayAlpha } from './getOverlayAlpha';
|
|
29
|
+
export { default as shouldSkipGeneratingVar } from './shouldSkipGeneratingVar';
|
|
29
30
|
|
|
30
31
|
// Private methods for creating parts of the theme
|
|
31
32
|
export { default as private_createTypography } from './createTypography';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export default function shouldSkipGeneratingVar(keys) {
|
|
2
|
+
return !!keys[0].match(/(cssVarPrefix|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
|
|
3
|
+
// ends with sxConfig
|
|
4
|
+
keys[0] === 'palette' && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
|
|
5
|
+
}
|
|
File without changes
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var React = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -13,6 +14,7 @@ var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
|
13
14
|
var _MoreHoriz = _interopRequireDefault(require("../internal/svg-icons/MoreHoriz"));
|
|
14
15
|
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
const _excluded = ["slots", "slotProps"];
|
|
16
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
20
|
const BreadcrumbCollapsedButton = (0, _styled.default)(_ButtonBase.default)(({
|
|
@@ -51,19 +53,40 @@ const BreadcrumbCollapsedIcon = (0, _styled.default)(_MoreHoriz.default)({
|
|
|
51
53
|
* @ignore - internal component.
|
|
52
54
|
*/
|
|
53
55
|
function BreadcrumbCollapsed(props) {
|
|
56
|
+
const {
|
|
57
|
+
slots = {},
|
|
58
|
+
slotProps = {}
|
|
59
|
+
} = props,
|
|
60
|
+
otherProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
54
61
|
const ownerState = props;
|
|
55
62
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
56
63
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(BreadcrumbCollapsedButton, (0, _extends2.default)({
|
|
57
64
|
focusRipple: true
|
|
58
|
-
},
|
|
65
|
+
}, otherProps, {
|
|
59
66
|
ownerState: ownerState,
|
|
60
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(BreadcrumbCollapsedIcon, {
|
|
67
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(BreadcrumbCollapsedIcon, (0, _extends2.default)({
|
|
68
|
+
as: slots.CollapsedIcon,
|
|
61
69
|
ownerState: ownerState
|
|
62
|
-
})
|
|
70
|
+
}, slotProps.collapsedIcon))
|
|
63
71
|
}))
|
|
64
72
|
});
|
|
65
73
|
}
|
|
66
74
|
process.env.NODE_ENV !== "production" ? BreadcrumbCollapsed.propTypes = {
|
|
75
|
+
/**
|
|
76
|
+
* The props used for the CollapsedIcon slot.
|
|
77
|
+
* @default {}
|
|
78
|
+
*/
|
|
79
|
+
slotProps: _propTypes.default.shape({
|
|
80
|
+
collapsedIcon: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
81
|
+
}),
|
|
82
|
+
/**
|
|
83
|
+
* The components used for each slot inside the BreadcumbCollapsed.
|
|
84
|
+
* Either a string to use a HTML element or a component.
|
|
85
|
+
* @default {}
|
|
86
|
+
*/
|
|
87
|
+
slots: _propTypes.default.shape({
|
|
88
|
+
CollapsedIcon: _propTypes.default.elementType
|
|
89
|
+
}),
|
|
67
90
|
/**
|
|
68
91
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
69
92
|
*/
|
|
@@ -19,7 +19,7 @@ var _Typography = _interopRequireDefault(require("../Typography"));
|
|
|
19
19
|
var _BreadcrumbCollapsed = _interopRequireDefault(require("./BreadcrumbCollapsed"));
|
|
20
20
|
var _breadcrumbsClasses = _interopRequireWildcard(require("./breadcrumbsClasses"));
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const _excluded = ["children", "className", "component", "expandText", "itemsAfterCollapse", "itemsBeforeCollapse", "maxItems", "separator"];
|
|
22
|
+
const _excluded = ["children", "className", "component", "slots", "slotProps", "expandText", "itemsAfterCollapse", "itemsBeforeCollapse", "maxItems", "separator"];
|
|
23
23
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
25
|
const useUtilityClasses = ownerState => {
|
|
@@ -89,6 +89,8 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps,
|
|
|
89
89
|
children,
|
|
90
90
|
className,
|
|
91
91
|
component = 'nav',
|
|
92
|
+
slots = {},
|
|
93
|
+
slotProps = {},
|
|
92
94
|
expandText = 'Show path',
|
|
93
95
|
itemsAfterCollapse = 1,
|
|
94
96
|
itemsBeforeCollapse = 1,
|
|
@@ -107,6 +109,11 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps,
|
|
|
107
109
|
separator
|
|
108
110
|
});
|
|
109
111
|
const classes = useUtilityClasses(ownerState);
|
|
112
|
+
const collapsedIconSlotProps = (0, _base.useSlotProps)({
|
|
113
|
+
elementType: slots.CollapsedIcon,
|
|
114
|
+
externalSlotProps: slotProps.collapsedIcon,
|
|
115
|
+
ownerState
|
|
116
|
+
});
|
|
110
117
|
const listRef = React.useRef(null);
|
|
111
118
|
const renderItemsBeforeAndAfter = allItems => {
|
|
112
119
|
const handleClickExpand = () => {
|
|
@@ -132,6 +139,12 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps,
|
|
|
132
139
|
}
|
|
133
140
|
return [...allItems.slice(0, itemsBeforeCollapse), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BreadcrumbCollapsed.default, {
|
|
134
141
|
"aria-label": expandText,
|
|
142
|
+
slots: {
|
|
143
|
+
CollapsedIcon: slots.CollapsedIcon
|
|
144
|
+
},
|
|
145
|
+
slotProps: {
|
|
146
|
+
collapsedIcon: collapsedIconSlotProps
|
|
147
|
+
},
|
|
135
148
|
onClick: handleClickExpand
|
|
136
149
|
}, "ellipsis"), ...allItems.slice(allItems.length - itemsAfterCollapse, allItems.length)];
|
|
137
150
|
};
|
|
@@ -212,6 +225,21 @@ process.env.NODE_ENV !== "production" ? Breadcrumbs.propTypes /* remove-proptype
|
|
|
212
225
|
* @default '/'
|
|
213
226
|
*/
|
|
214
227
|
separator: _propTypes.default.node,
|
|
228
|
+
/**
|
|
229
|
+
* The props used for each slot inside the Breadcumb.
|
|
230
|
+
* @default {}
|
|
231
|
+
*/
|
|
232
|
+
slotProps: _propTypes.default.shape({
|
|
233
|
+
collapsedIcon: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
234
|
+
}),
|
|
235
|
+
/**
|
|
236
|
+
* The components used for each slot inside the Breadcumb.
|
|
237
|
+
* Either a string to use a HTML element or a component.
|
|
238
|
+
* @default {}
|
|
239
|
+
*/
|
|
240
|
+
slots: _propTypes.default.shape({
|
|
241
|
+
CollapsedIcon: _propTypes.default.elementType
|
|
242
|
+
}),
|
|
215
243
|
/**
|
|
216
244
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
217
245
|
*/
|
|
@@ -155,8 +155,10 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
|
|
|
155
155
|
value: childContext,
|
|
156
156
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ListItemButtonRoot, (0, _extends2.default)({
|
|
157
157
|
ref: handleRef,
|
|
158
|
-
href: other.href || other.to
|
|
159
|
-
|
|
158
|
+
href: other.href || other.to
|
|
159
|
+
// `ButtonBase` processes `href` or `to` if `component` is set to 'button'
|
|
160
|
+
,
|
|
161
|
+
component: (other.href || other.to) && component === 'div' ? 'button' : component,
|
|
160
162
|
focusVisibleClassName: (0, _clsx.default)(classes.focusVisible, focusVisibleClassName),
|
|
161
163
|
ownerState: ownerState,
|
|
162
164
|
className: (0, _clsx.default)(classes.root, className)
|
|
@@ -74,7 +74,8 @@ const StepButton = /*#__PURE__*/React.forwardRef(function StepButton(inProps, re
|
|
|
74
74
|
} = props,
|
|
75
75
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
76
76
|
const {
|
|
77
|
-
disabled
|
|
77
|
+
disabled,
|
|
78
|
+
active
|
|
78
79
|
} = React.useContext(_StepContext.default);
|
|
79
80
|
const {
|
|
80
81
|
orientation
|
|
@@ -98,7 +99,8 @@ const StepButton = /*#__PURE__*/React.forwardRef(function StepButton(inProps, re
|
|
|
98
99
|
},
|
|
99
100
|
className: (0, _clsx.default)(classes.root, className),
|
|
100
101
|
ref: ref,
|
|
101
|
-
ownerState: ownerState
|
|
102
|
+
ownerState: ownerState,
|
|
103
|
+
"aria-current": active ? 'step' : undefined
|
|
102
104
|
}, other, {
|
|
103
105
|
children: child
|
|
104
106
|
}));
|