@mui/material 5.11.13 → 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/Breadcrumbs/BreadcrumbCollapsed.js +26 -3
- package/Breadcrumbs/Breadcrumbs.d.ts +31 -0
- package/Breadcrumbs/Breadcrumbs.js +30 -2
- package/CHANGELOG.md +71 -3
- package/ListItemButton/ListItemButton.js +4 -2
- package/README.md +5 -4
- package/StepButton/StepButton.js +4 -2
- package/TabScrollButton/TabScrollButton.d.ts +34 -1
- package/TabScrollButton/TabScrollButton.js +41 -8
- package/Tabs/Tabs.d.ts +40 -0
- package/Tabs/Tabs.js +43 -2
- package/index.js +1 -1
- 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/locale/index.d.ts +1 -0
- package/locale/index.js +73 -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/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/package.json +4 -4
- package/umd/material-ui.development.js +254 -118
- package/umd/material-ui.production.min.js +20 -20
|
@@ -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,8 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
|
+
import { SlotComponentProps } from '@mui/base';
|
|
3
4
|
import { Theme } from '../styles';
|
|
4
5
|
import { OverridableComponent, OverrideProps } from '../OverridableComponent';
|
|
5
6
|
import { BreadcrumbsClasses } from './breadcrumbsClasses';
|
|
7
|
+
import SvgIcon from '../SvgIcon';
|
|
8
|
+
|
|
9
|
+
export interface BreadcrumbsCollapsedIconSlotPropsOverrides {}
|
|
10
|
+
|
|
11
|
+
export interface BreadcrumbsOwnerState extends BreadcrumbsProps {
|
|
12
|
+
expanded: boolean;
|
|
13
|
+
}
|
|
6
14
|
|
|
7
15
|
export interface BreadcrumbsTypeMap<P = {}, D extends React.ElementType = 'nav'> {
|
|
8
16
|
props: P & {
|
|
@@ -14,6 +22,29 @@ export interface BreadcrumbsTypeMap<P = {}, D extends React.ElementType = 'nav'>
|
|
|
14
22
|
* Override or extend the styles applied to the component.
|
|
15
23
|
*/
|
|
16
24
|
classes?: Partial<BreadcrumbsClasses>;
|
|
25
|
+
/**
|
|
26
|
+
* The components used for each slot inside the Breadcumb.
|
|
27
|
+
* Either a string to use a HTML element or a component.
|
|
28
|
+
* @default {}
|
|
29
|
+
*/
|
|
30
|
+
slots?: {
|
|
31
|
+
CollapsedIcon?: React.ElementType;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The props used for each slot inside the Breadcumb.
|
|
35
|
+
* @default {}
|
|
36
|
+
*/
|
|
37
|
+
slotProps?: {
|
|
38
|
+
/**
|
|
39
|
+
* Props applied to the CollapsedIcon slot.
|
|
40
|
+
* @default {}
|
|
41
|
+
*/
|
|
42
|
+
collapsedIcon?: SlotComponentProps<
|
|
43
|
+
typeof SvgIcon,
|
|
44
|
+
BreadcrumbsCollapsedIconSlotPropsOverrides,
|
|
45
|
+
BreadcrumbsOwnerState
|
|
46
|
+
>;
|
|
47
|
+
};
|
|
17
48
|
/**
|
|
18
49
|
* Override the default label for the expand button.
|
|
19
50
|
*
|
|
@@ -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
|
*/
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,73 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.11.14
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.11.13..master -->
|
|
6
|
+
|
|
7
|
+
_Mar 21, 2023_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 15 contributors who made this release possible.
|
|
10
|
+
This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
|
|
11
|
+
|
|
12
|
+
### `@mui/material@5.11.14`
|
|
13
|
+
|
|
14
|
+
- [Breadcrumbs] Add ability to change icon used in `BreadcrumbCollapsed` through slots (#33812) @pratikkarad
|
|
15
|
+
- [Stepper] Add aria-current to active StepButton (#36526) @michalak111
|
|
16
|
+
- [TabScrollButton] Add ability to change left and right icons (#33863) @pratikkarad
|
|
17
|
+
- [ListItemButton] Respect LinkComponent (#34159) @zaverden
|
|
18
|
+
- [l10n] Add Central Kurdish (ku-CKB) locale (#36592) @HediMuhamad
|
|
19
|
+
|
|
20
|
+
### `@mui/system@5.11.14`
|
|
21
|
+
|
|
22
|
+
- [system] Fix sx prop regression for fontWeight values (#36543) @mnajdova
|
|
23
|
+
|
|
24
|
+
### `@mui/base@5.0.0-alpha.121`
|
|
25
|
+
|
|
26
|
+
- [docs][base] Improve the Slots Table in API docs (#36330) @hbjORbj
|
|
27
|
+
|
|
28
|
+
### `@mui/joy@5.0.0-alpha.72`
|
|
29
|
+
|
|
30
|
+
- [Joy] Ensure new CSS variable naming is everywhere (#36460) @hbjORbj
|
|
31
|
+
- [Menu][joy] Classname listbox is missing (#36520) @hbjORbj
|
|
32
|
+
- [Joy] Fix `--List-decorator*` vars (#36595) @siriwatknp
|
|
33
|
+
|
|
34
|
+
### `@mui/lab@5.0.0-alpha.124`
|
|
35
|
+
|
|
36
|
+
- [Masonry] Include Masonry in theme augmentation interface (#36533) @hbjORbj
|
|
37
|
+
|
|
38
|
+
### Docs
|
|
39
|
+
|
|
40
|
+
- [blog] Post blog about Chamonix retreat to the website (#36517) @mikailaread
|
|
41
|
+
- [blog] Fix image layout shift (#36522) @oliviertassinari
|
|
42
|
+
- [docs] Use `theme.applyDarkStyles` for the rest of the docs (#36161) @siriwatknp
|
|
43
|
+
- [docs] Fix 301 and 404 links (#36555) @oliviertassinari
|
|
44
|
+
- [docs] Keep slot code order in API docs (#36499) @oliviertassinari
|
|
45
|
+
- [docs] Missing className on Migrating from JSS example (#36536) @gabrielnafuzi
|
|
46
|
+
- [docs] Fix function name for Joy templates (#36512) @hbjORbj
|
|
47
|
+
- [docs] Add multiline Chip example (#36437) @dav1app
|
|
48
|
+
- [docs] Add a new gold sponsor (#36518) @hbjORbj
|
|
49
|
+
- [docs][joy] Improve the Slots Table in API docs (#36328) @hbjORbj
|
|
50
|
+
- [docs] Fix virtualElement demo for Popper (#36320) @sai6855
|
|
51
|
+
- [docs] Fix typo in API docs (#36388) @RomanHotsiy
|
|
52
|
+
- [docs] Ensure classname displayed under Slots section in API docs exists (#36539) @hbjORbj
|
|
53
|
+
- [docs][joy] Build TS versions for Modal component demos (#36385) @varunmulay22
|
|
54
|
+
- [docs][joy] Build TS versions for Menu component demos (#36383) @varunmulay22
|
|
55
|
+
- [docs][joy] Build TS versions for Switch component demos (#36379) @varunmulay22
|
|
56
|
+
- [docs] Remove `shouldSkipGeneratingVar` usage (#36581) @siriwatknp
|
|
57
|
+
- [docs][material] Update Table's demo to show pointer cursor on clickable rows (#36546) @varunmulay22
|
|
58
|
+
- [website] Designer role changes (#36528) @danilo-leal
|
|
59
|
+
- [website] No association between showcase and MUI @oliviertassinari
|
|
60
|
+
- [website] Open Head of Operations role (#36501) @oliviertassinari
|
|
61
|
+
- [website] Limit sponsors description to two rows @oliviertassinari
|
|
62
|
+
|
|
63
|
+
### Core
|
|
64
|
+
|
|
65
|
+
- [core] Fix CI @oliviertassinari
|
|
66
|
+
- [core] Fix blank line @oliviertassinari
|
|
67
|
+
- [website] Simplify internal ops @oliviertassinari
|
|
68
|
+
|
|
69
|
+
All contributors of this release in alphabetical order: @danilo-leal, @dav1app, @gabrielnafuzi, @hbjORbj, @HediMuhamad, @michalak111, @mikailaread, @mnajdova, @oliviertassinari, @pratikkarad, @RomanHotsiy, @sai6855, @siriwatknp, @varunmulay22, @zaverden
|
|
70
|
+
|
|
3
71
|
## 5.11.13
|
|
4
72
|
|
|
5
73
|
<!-- generated comparing v5.11.12..master -->
|
|
@@ -9076,7 +9144,7 @@ _Nov 4, 2020_
|
|
|
9076
9144
|
A big thanks to the 20 contributors who made this release possible. Here are some highlights ✨:
|
|
9077
9145
|
|
|
9078
9146
|
- ⚛️ Add support for React 17 (#23311) @eps1lon.
|
|
9079
|
-
React 17 release is unusual because it doesn't add any new developer-facing features. It was released a couple of days ago. You can learn more about it in the [introduction post](https://reactjs.org/blog/2020/10/20/react-v17.html). Material UI now supports `^16.8.0 || ^17.0.0`.
|
|
9147
|
+
React 17 release is unusual because it doesn't add any new developer-facing features. It was released a couple of days ago. You can learn more about it in the [introduction post](https://legacy.reactjs.org/blog/2020/10/20/react-v17.html). Material UI now supports `^16.8.0 || ^17.0.0`.
|
|
9080
9148
|
- 🛠 Introduce a new `@material-ui/unstyled` package (#23270) @mnajdova.
|
|
9081
9149
|
This package will host the unstyled version of the components. In this first iteration, only the Slider is available. You can find it documented under the [same page](https://mui.com/components/slider-styled/#unstyled-slider) as the styled version.
|
|
9082
9150
|
|
|
@@ -10085,7 +10153,7 @@ Here are some highlights ✨:
|
|
|
10085
10153
|
#### Breaking changes
|
|
10086
10154
|
|
|
10087
10155
|
- [Modal] Remove `onRendered` prop from Modal and Portal (#22464) @eps1lon
|
|
10088
|
-
Depending on your use case either use a [callback ref](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) on the child element or an effect hook in the child component.
|
|
10156
|
+
Depending on your use case either use a [callback ref](https://legacy.reactjs.org/docs/refs-and-the-dom.html#callback-refs) on the child element or an effect hook in the child component.
|
|
10089
10157
|
|
|
10090
10158
|
#### Changes
|
|
10091
10159
|
|
|
@@ -10548,7 +10616,7 @@ Here are some highlights ✨:
|
|
|
10548
10616
|
|
|
10549
10617
|
- [RootRef] Remove component (#21974) @eps1lon
|
|
10550
10618
|
This component was removed. You can get a reference to the underlying DOM node of our components via `ref` prop.
|
|
10551
|
-
The component relied on [`ReactDOM.findDOMNode`](https://reactjs.org/docs/react-dom.html#finddomnode) which is [deprecated in `React.StrictMode`](https://reactjs.org/docs/strict-mode.html#warning-about-deprecated-finddomnode-usage).
|
|
10619
|
+
The component relied on [`ReactDOM.findDOMNode`](https://legacy.reactjs.org/docs/react-dom.html#finddomnode) which is [deprecated in `React.StrictMode`](https://legacy.reactjs.org/docs/strict-mode.html#warning-about-deprecated-finddomnode-usage).
|
|
10552
10620
|
|
|
10553
10621
|
```diff
|
|
10554
10622
|
-<RootRef rootRef={ref}>
|
|
@@ -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)
|
package/README.md
CHANGED
|
@@ -133,6 +133,7 @@ via [OpenCollective](https://opencollective.com/mui) or via [Patreon](https://ww
|
|
|
133
133
|
<p>
|
|
134
134
|
<a href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://avatars.githubusercontent.com/u/30204434?s=192" alt="tidelift.com" title="Enterprise-ready open-source software" loading="lazy" /></a>
|
|
135
135
|
<a href="https://www.text-em-all.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img src="https://avatars.githubusercontent.com/u/1262264?s=192" alt="text-em-all.com" title="Mass Text Messaging & Automated Calling" height="96" width="96" loading="lazy"></a>
|
|
136
|
+
<a href="https://open.spotify.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/spotify/f37ea28/logo/192.png" alt="Spotify" title="Music service to access to millions of songs" loading="lazy" /></a>
|
|
136
137
|
<a href="https://megafamous.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://mui.com/static/sponsors/megafamous.png" alt="megafamous.com" title="The best place to buy Instagram followers & likes." loading="lazy" /></a>
|
|
137
138
|
<a href="https://www.dialmycalls.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/dialmycalls/f5ae9ab/avatar/192.png" alt="dialmycalls.com" title="Send text messages, calls & emails to thousands with ease." loading="lazy" /></a>
|
|
138
139
|
<a href="https://goread.io/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/goread_io/eb6337d/logo/192.png" alt="goread.io" title="Instagram followers, likes, power likes, views, comments, saves in minutes." loading="lazy" /></a>
|
|
@@ -217,7 +218,7 @@ These great services sponsor MUI's core infrastructure:
|
|
|
217
218
|
<picture>
|
|
218
219
|
<source media="(prefers-color-scheme: dark)" srcset="/docs/public/static/readme/github-darkmode.svg">
|
|
219
220
|
<source media="(prefers-color-scheme: light)" srcset="/docs/public/static/readme/github-lightmode.svg">
|
|
220
|
-
<img alt="GitHub logo" src="/docs/public/static/readme/github-
|
|
221
|
+
<img alt="GitHub logo" src="/docs/public/static/readme/github-lightmode.svg" width="80" height="43">
|
|
221
222
|
</picture>
|
|
222
223
|
|
|
223
224
|
[GitHub](https://github.com/) lets us host the Git repository and coordinate contributions.
|
|
@@ -225,7 +226,7 @@ These great services sponsor MUI's core infrastructure:
|
|
|
225
226
|
<picture>
|
|
226
227
|
<source media="(prefers-color-scheme: dark)" srcset="/docs/public/static/readme/netlify-darkmode.svg">
|
|
227
228
|
<source media="(prefers-color-scheme: light)" srcset="/docs/public/static/readme/netlify-lightmode.svg">
|
|
228
|
-
<img alt="Netlify logo" src="/docs/public/static/readme/netlify-
|
|
229
|
+
<img alt="Netlify logo" src="/docs/public/static/readme/netlify-lightmode.svg" width="100" height="27" style="margin-top: 1rem;">
|
|
229
230
|
</picture>
|
|
230
231
|
|
|
231
232
|
[Netlify](https://www.netlify.com/) lets us distribute the documentation.
|
|
@@ -233,11 +234,11 @@ These great services sponsor MUI's core infrastructure:
|
|
|
233
234
|
<picture>
|
|
234
235
|
<source media="(prefers-color-scheme: dark)" srcset="/docs/public/static/readme/browserstack-darkmode.svg">
|
|
235
236
|
<source media="(prefers-color-scheme: light)" srcset="/docs/public/static/readme/browserstack-lightmode.svg">
|
|
236
|
-
<img alt="
|
|
237
|
+
<img alt="BrowserStack logo" src="/docs/public/static/readme/browserstack-lightmode.svg" width="140" height="25" style="margin-top: 1rem;">
|
|
237
238
|
</picture>
|
|
238
239
|
|
|
239
240
|
[BrowserStack](https://www.browserstack.com/) lets us test in real browsers.
|
|
240
241
|
|
|
241
|
-
<img loading="lazy" alt="CodeCov logo" src="https://
|
|
242
|
+
<img loading="lazy" alt="CodeCov logo" src="https://avatars.githubusercontent.com/u/8226205?s=70" width="35" height="35" style="margin-top: 1rem;">
|
|
242
243
|
|
|
243
244
|
[CodeCov](https://about.codecov.io/) lets us monitor test coverage.
|
package/StepButton/StepButton.js
CHANGED
|
@@ -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,8 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
|
-
import {
|
|
3
|
+
import { SlotComponentProps } from '@mui/base';
|
|
4
|
+
import { InternalStandardProps as StandardProps, SvgIcon, Theme } from '..';
|
|
4
5
|
import { TabScrollButtonClasses } from './tabScrollButtonClasses';
|
|
5
6
|
|
|
7
|
+
export interface TabScrollButtonStartIconSlotPropsOverrides {}
|
|
8
|
+
export interface TabScrollButtonEndIconSlotPropsOverrides {}
|
|
9
|
+
|
|
10
|
+
export interface TabScrollButtonOwnerState extends TabScrollButtonProps {
|
|
11
|
+
isRtl: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
6
14
|
export interface TabScrollButtonProps extends StandardProps<React.HTMLAttributes<HTMLDivElement>> {
|
|
7
15
|
/**
|
|
8
16
|
* The content of the component.
|
|
@@ -12,6 +20,31 @@ export interface TabScrollButtonProps extends StandardProps<React.HTMLAttributes
|
|
|
12
20
|
* Override or extend the styles applied to the component.
|
|
13
21
|
*/
|
|
14
22
|
classes?: Partial<TabScrollButtonClasses>;
|
|
23
|
+
/**
|
|
24
|
+
* The components used for each slot inside.
|
|
25
|
+
* @default {}
|
|
26
|
+
*/
|
|
27
|
+
slots?: {
|
|
28
|
+
StartScrollButtonIcon?: React.ElementType;
|
|
29
|
+
EndScrollButtonIcon?: React.ElementType;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The extra props for the slot components.
|
|
33
|
+
* You can override the existing props or add new ones.
|
|
34
|
+
* @default {}
|
|
35
|
+
*/
|
|
36
|
+
slotProps?: {
|
|
37
|
+
startScrollButtonIcon?: SlotComponentProps<
|
|
38
|
+
typeof SvgIcon,
|
|
39
|
+
TabScrollButtonStartIconSlotPropsOverrides,
|
|
40
|
+
TabScrollButtonOwnerState
|
|
41
|
+
>;
|
|
42
|
+
endScrollButtonIcon?: SlotComponentProps<
|
|
43
|
+
typeof SvgIcon,
|
|
44
|
+
TabScrollButtonEndIconSlotPropsOverrides,
|
|
45
|
+
TabScrollButtonOwnerState
|
|
46
|
+
>;
|
|
47
|
+
};
|
|
15
48
|
/**
|
|
16
49
|
* The direction the button should indicate.
|
|
17
50
|
*/
|
|
@@ -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';
|
|
@@ -52,12 +51,15 @@ const TabScrollButtonRoot = styled(ButtonBase, {
|
|
|
52
51
|
}
|
|
53
52
|
}));
|
|
54
53
|
const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(inProps, ref) {
|
|
54
|
+
var _slots$StartScrollBut, _slots$EndScrollButto;
|
|
55
55
|
const props = useThemeProps({
|
|
56
56
|
props: inProps,
|
|
57
57
|
name: 'MuiTabScrollButton'
|
|
58
58
|
});
|
|
59
59
|
const {
|
|
60
60
|
className,
|
|
61
|
+
slots = {},
|
|
62
|
+
slotProps = {},
|
|
61
63
|
direction
|
|
62
64
|
} = props,
|
|
63
65
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -67,6 +69,24 @@ const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(i
|
|
|
67
69
|
isRtl
|
|
68
70
|
}, props);
|
|
69
71
|
const classes = useUtilityClasses(ownerState);
|
|
72
|
+
const StartButtonIcon = (_slots$StartScrollBut = slots.StartScrollButtonIcon) != null ? _slots$StartScrollBut : KeyboardArrowLeft;
|
|
73
|
+
const EndButtonIcon = (_slots$EndScrollButto = slots.EndScrollButtonIcon) != null ? _slots$EndScrollButto : KeyboardArrowRight;
|
|
74
|
+
const startButtonIconProps = useSlotProps({
|
|
75
|
+
elementType: StartButtonIcon,
|
|
76
|
+
externalSlotProps: slotProps.startScrollButtonIcon,
|
|
77
|
+
additionalProps: {
|
|
78
|
+
fontSize: 'small'
|
|
79
|
+
},
|
|
80
|
+
ownerState
|
|
81
|
+
});
|
|
82
|
+
const endButtonIconProps = useSlotProps({
|
|
83
|
+
elementType: EndButtonIcon,
|
|
84
|
+
externalSlotProps: slotProps.endScrollButtonIcon,
|
|
85
|
+
additionalProps: {
|
|
86
|
+
fontSize: 'small'
|
|
87
|
+
},
|
|
88
|
+
ownerState
|
|
89
|
+
});
|
|
70
90
|
return /*#__PURE__*/_jsx(TabScrollButtonRoot, _extends({
|
|
71
91
|
component: "div",
|
|
72
92
|
className: clsx(classes.root, className),
|
|
@@ -75,11 +95,7 @@ const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(i
|
|
|
75
95
|
ownerState: ownerState,
|
|
76
96
|
tabIndex: null
|
|
77
97
|
}, other, {
|
|
78
|
-
children: direction === 'left' ?
|
|
79
|
-
fontSize: "small"
|
|
80
|
-
})) : _KeyboardArrowRight || (_KeyboardArrowRight = /*#__PURE__*/_jsx(KeyboardArrowRight, {
|
|
81
|
-
fontSize: "small"
|
|
82
|
-
}))
|
|
98
|
+
children: direction === 'left' ? /*#__PURE__*/_jsx(StartButtonIcon, _extends({}, startButtonIconProps)) : /*#__PURE__*/_jsx(EndButtonIcon, _extends({}, endButtonIconProps))
|
|
83
99
|
}));
|
|
84
100
|
});
|
|
85
101
|
process.env.NODE_ENV !== "production" ? TabScrollButton.propTypes /* remove-proptypes */ = {
|
|
@@ -112,6 +128,23 @@ process.env.NODE_ENV !== "production" ? TabScrollButton.propTypes /* remove-prop
|
|
|
112
128
|
* The component orientation (layout flow direction).
|
|
113
129
|
*/
|
|
114
130
|
orientation: PropTypes.oneOf(['horizontal', 'vertical']).isRequired,
|
|
131
|
+
/**
|
|
132
|
+
* The extra props for the slot components.
|
|
133
|
+
* You can override the existing props or add new ones.
|
|
134
|
+
* @default {}
|
|
135
|
+
*/
|
|
136
|
+
slotProps: PropTypes.shape({
|
|
137
|
+
endScrollButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
138
|
+
startScrollButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
139
|
+
}),
|
|
140
|
+
/**
|
|
141
|
+
* The components used for each slot inside.
|
|
142
|
+
* @default {}
|
|
143
|
+
*/
|
|
144
|
+
slots: PropTypes.shape({
|
|
145
|
+
EndScrollButtonIcon: PropTypes.elementType,
|
|
146
|
+
StartScrollButtonIcon: PropTypes.elementType
|
|
147
|
+
}),
|
|
115
148
|
/**
|
|
116
149
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
117
150
|
*/
|
package/Tabs/Tabs.d.ts
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
|
+
import { SlotComponentProps } from '@mui/base';
|
|
3
4
|
import { OverridableStringUnion } from '@mui/types';
|
|
4
5
|
import { Theme } from '../styles';
|
|
5
6
|
import ButtonBase from '../ButtonBase';
|
|
6
7
|
import { TabScrollButtonProps } from '../TabScrollButton';
|
|
7
8
|
import { OverridableComponent, OverrideProps } from '../OverridableComponent';
|
|
8
9
|
import { TabsClasses } from './tabsClasses';
|
|
10
|
+
import SvgIcon from '../SvgIcon';
|
|
9
11
|
|
|
10
12
|
export interface TabsPropsIndicatorColorOverrides {}
|
|
11
13
|
|
|
14
|
+
export interface TabsStartScrollButtonIconSlotPropsOverrides {}
|
|
15
|
+
export interface TabsEndScrollButtonIconSlotPropsOverrides {}
|
|
16
|
+
|
|
17
|
+
export interface TabsOwnerState extends TabsProps {
|
|
18
|
+
vertical: boolean;
|
|
19
|
+
fixed: boolean;
|
|
20
|
+
hideScrollbar: boolean;
|
|
21
|
+
scrollableX: boolean;
|
|
22
|
+
scrollableY: boolean;
|
|
23
|
+
centered: boolean;
|
|
24
|
+
scrollButtonsHideMobile: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
12
27
|
export interface TabsTypeMap<P = {}, D extends React.ElementType = typeof ButtonBase> {
|
|
13
28
|
props: P & {
|
|
14
29
|
/**
|
|
@@ -48,6 +63,31 @@ export interface TabsTypeMap<P = {}, D extends React.ElementType = typeof Button
|
|
|
48
63
|
* Override or extend the styles applied to the component.
|
|
49
64
|
*/
|
|
50
65
|
classes?: Partial<TabsClasses>;
|
|
66
|
+
/**
|
|
67
|
+
* The components used for each slot inside.
|
|
68
|
+
* @default {}
|
|
69
|
+
*/
|
|
70
|
+
slots?: {
|
|
71
|
+
StartScrollButtonIcon?: React.ElementType;
|
|
72
|
+
EndScrollButtonIcon?: React.ElementType;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* The extra props for the slot components.
|
|
76
|
+
* You can override the existing props or add new ones.
|
|
77
|
+
* @default {}
|
|
78
|
+
*/
|
|
79
|
+
slotProps?: {
|
|
80
|
+
startScrollButtonIcon?: SlotComponentProps<
|
|
81
|
+
typeof SvgIcon,
|
|
82
|
+
TabsStartScrollButtonIconSlotPropsOverrides,
|
|
83
|
+
TabsOwnerState
|
|
84
|
+
>;
|
|
85
|
+
endScrollButtonIcon?: SlotComponentProps<
|
|
86
|
+
typeof SvgIcon,
|
|
87
|
+
TabsEndScrollButtonIconSlotPropsOverrides,
|
|
88
|
+
TabsOwnerState
|
|
89
|
+
>;
|
|
90
|
+
};
|
|
51
91
|
/**
|
|
52
92
|
* Determines the color of the indicator.
|
|
53
93
|
* @default 'primary'
|
package/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/index.js
CHANGED