@mui/material 9.0.0-alpha.2 → 9.0.0-alpha.4
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 +0 -14
- package/Accordion/Accordion.d.ts +0 -14
- package/Accordion/Accordion.js +3 -25
- package/Accordion/Accordion.mjs +3 -25
- package/AccordionSummary/AccordionSummary.js +1 -1
- package/AccordionSummary/AccordionSummary.mjs +1 -1
- package/AccordionSummary/accordionSummaryClasses.d.mts +0 -5
- package/AccordionSummary/accordionSummaryClasses.d.ts +0 -5
- package/AccordionSummary/accordionSummaryClasses.js +1 -1
- package/AccordionSummary/accordionSummaryClasses.mjs +1 -1
- package/Alert/Alert.d.mts +0 -23
- package/Alert/Alert.d.ts +0 -23
- package/Alert/Alert.js +4 -36
- package/Alert/Alert.mjs +4 -36
- package/Alert/alertClasses.d.mts +0 -72
- package/Alert/alertClasses.d.ts +0 -72
- package/Alert/alertClasses.js +1 -1
- package/Alert/alertClasses.mjs +1 -1
- package/Autocomplete/Autocomplete.d.mts +26 -60
- package/Autocomplete/Autocomplete.d.ts +26 -60
- package/Autocomplete/Autocomplete.js +76 -119
- package/Autocomplete/Autocomplete.mjs +76 -119
- package/Avatar/Avatar.d.mts +0 -8
- package/Avatar/Avatar.d.ts +0 -8
- package/Avatar/Avatar.js +13 -35
- package/Avatar/Avatar.mjs +13 -35
- package/AvatarGroup/AvatarGroup.d.mts +0 -15
- package/AvatarGroup/AvatarGroup.d.ts +0 -15
- package/AvatarGroup/AvatarGroup.js +1 -18
- package/AvatarGroup/AvatarGroup.mjs +1 -18
- package/Backdrop/Backdrop.d.mts +1 -31
- package/Backdrop/Backdrop.d.ts +1 -31
- package/Backdrop/Backdrop.js +2 -42
- package/Backdrop/Backdrop.mjs +2 -42
- package/Badge/Badge.d.mts +0 -20
- package/Badge/Badge.d.ts +0 -20
- package/Badge/Badge.js +2 -35
- package/Badge/Badge.mjs +2 -35
- package/Box/Box.d.mts +1 -0
- package/Box/Box.d.ts +1 -0
- package/Button/Button.d.mts +1 -0
- package/Button/Button.d.ts +1 -0
- package/Button/Button.js +6 -6
- package/Button/Button.mjs +6 -6
- package/Button/buttonClasses.d.mts +0 -132
- package/Button/buttonClasses.d.ts +0 -132
- package/Button/buttonClasses.js +1 -1
- package/Button/buttonClasses.mjs +1 -1
- package/ButtonBase/ButtonBase.js +16 -2
- package/ButtonBase/ButtonBase.mjs +16 -2
- package/CHANGELOG.md +191 -0
- package/CardHeader/CardHeader.js +5 -1
- package/CardHeader/CardHeader.mjs +5 -1
- package/CircularProgress/CircularProgress.js +2 -2
- package/CircularProgress/CircularProgress.mjs +2 -2
- package/CircularProgress/circularProgressClasses.d.mts +0 -8
- package/CircularProgress/circularProgressClasses.d.ts +0 -8
- package/CircularProgress/circularProgressClasses.js +1 -1
- package/CircularProgress/circularProgressClasses.mjs +1 -1
- package/Divider/Divider.d.mts +1 -6
- package/Divider/Divider.d.ts +1 -6
- package/Divider/Divider.js +2 -18
- package/Divider/Divider.mjs +2 -18
- 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/FormControlLabel/FormControlLabel.d.mts +1 -14
- package/FormControlLabel/FormControlLabel.d.ts +1 -14
- package/FormControlLabel/FormControlLabel.js +1 -13
- package/FormControlLabel/FormControlLabel.mjs +1 -13
- package/Input/Input.js +2 -1
- package/Input/Input.mjs +2 -1
- package/List/List.d.mts +1 -0
- package/List/List.d.ts +1 -0
- package/ListItemButton/ListItemButton.d.mts +1 -0
- package/ListItemButton/ListItemButton.d.ts +1 -0
- package/ListItemIcon/ListItemIcon.d.mts +1 -0
- package/ListItemIcon/ListItemIcon.d.ts +1 -0
- package/ListItemText/ListItemText.d.mts +1 -0
- package/ListItemText/ListItemText.d.ts +1 -0
- package/ListItemText/ListItemText.js +5 -1
- package/ListItemText/ListItemText.mjs +5 -1
- package/ListSubheader/ListSubheader.d.mts +1 -0
- package/ListSubheader/ListSubheader.d.ts +1 -0
- package/Menu/Menu.d.mts +0 -13
- package/Menu/Menu.d.ts +0 -13
- package/Menu/Menu.js +5 -44
- package/Menu/Menu.mjs +5 -44
- package/MenuItem/MenuItem.js +21 -1
- package/MenuItem/MenuItem.mjs +23 -1
- package/MenuList/MenuList.js +77 -109
- package/MenuList/MenuList.mjs +77 -109
- package/MobileStepper/MobileStepper.d.mts +0 -5
- package/MobileStepper/MobileStepper.d.ts +0 -5
- package/MobileStepper/MobileStepper.js +1 -10
- package/MobileStepper/MobileStepper.mjs +1 -10
- package/Paper/Paper.d.mts +1 -0
- package/Paper/Paper.d.ts +1 -0
- package/Popover/Popover.d.mts +4 -48
- package/Popover/Popover.d.ts +4 -48
- package/Popover/Popover.js +4 -64
- package/Popover/Popover.mjs +4 -64
- package/Popper/Popper.d.mts +0 -17
- package/Popper/Popper.d.ts +0 -17
- package/Popper/Popper.js +2 -26
- package/Popper/Popper.mjs +2 -26
- package/Popper/index.d.mts +1 -0
- package/Popper/index.d.ts +1 -0
- package/Popper/index.js +11 -2
- package/Popper/index.mjs +1 -0
- package/Select/SelectInput.js +50 -55
- package/Select/SelectInput.mjs +47 -52
- package/Select/index.d.mts +1 -0
- package/Select/index.d.ts +1 -0
- package/Select/index.js +12 -0
- package/Select/index.mjs +1 -0
- package/Select/utils/SelectFocusSourceContext.d.mts +4 -0
- package/Select/utils/SelectFocusSourceContext.d.ts +4 -0
- package/Select/utils/SelectFocusSourceContext.js +19 -0
- package/Select/utils/SelectFocusSourceContext.mjs +13 -0
- package/Select/utils/areEqualValues.d.mts +1 -0
- package/Select/utils/areEqualValues.d.ts +1 -0
- package/Select/utils/areEqualValues.js +14 -0
- package/Select/utils/areEqualValues.mjs +8 -0
- package/Select/utils/getOpenInteractionType.d.mts +1 -0
- package/Select/utils/getOpenInteractionType.d.ts +1 -0
- package/Select/utils/getOpenInteractionType.js +18 -0
- package/Select/utils/getOpenInteractionType.mjs +12 -0
- package/Select/utils/index.d.mts +4 -0
- package/Select/utils/index.d.ts +4 -0
- package/Select/utils/index.js +40 -0
- package/Select/utils/index.mjs +4 -0
- package/Select/utils/isEmpty.d.mts +1 -0
- package/Select/utils/isEmpty.d.ts +1 -0
- package/Select/utils/isEmpty.js +9 -0
- package/Select/utils/isEmpty.mjs +3 -0
- package/Slider/Slider.d.mts +109 -77
- package/Slider/Slider.d.ts +109 -77
- package/Slider/Slider.js +42 -119
- package/Slider/Slider.mjs +42 -119
- package/Slider/sliderClasses.d.mts +7 -7
- package/Slider/sliderClasses.d.ts +7 -7
- package/Slider/useSlider.js +50 -14
- package/Slider/useSlider.mjs +50 -14
- package/Snackbar/Snackbar.d.mts +1 -27
- package/Snackbar/Snackbar.d.ts +1 -27
- package/Snackbar/Snackbar.js +5 -58
- package/Snackbar/Snackbar.mjs +5 -58
- package/SpeedDial/SpeedDial.d.mts +0 -13
- package/SpeedDial/SpeedDial.d.ts +0 -13
- package/SpeedDial/SpeedDial.js +15 -40
- package/SpeedDial/SpeedDial.mjs +15 -40
- package/SpeedDialAction/SpeedDialAction.d.mts +0 -28
- package/SpeedDialAction/SpeedDialAction.d.ts +0 -28
- package/SpeedDialAction/SpeedDialAction.js +5 -46
- package/SpeedDialAction/SpeedDialAction.mjs +5 -46
- package/Step/Step.js +7 -5
- package/Step/Step.mjs +7 -5
- package/StepButton/StepButton.js +16 -6
- package/StepButton/StepButton.mjs +16 -6
- package/StepConnector/StepConnector.js +2 -2
- package/StepConnector/StepConnector.mjs +2 -2
- package/StepContent/StepContent.js +2 -2
- package/StepContent/StepContent.mjs +2 -2
- package/StepLabel/StepLabel.js +2 -2
- package/StepLabel/StepLabel.mjs +2 -2
- package/Stepper/Stepper.js +44 -7
- package/Stepper/Stepper.mjs +44 -7
- package/Stepper/StepperContext.d.mts +7 -0
- package/Stepper/StepperContext.d.ts +7 -0
- package/Stepper/StepperContext.js +2 -1
- package/Stepper/StepperContext.mjs +1 -0
- package/Stepper/index.d.mts +0 -1
- package/Stepper/index.d.ts +0 -1
- package/Tab/Tab.js +0 -1
- package/Tab/Tab.mjs +0 -1
- package/TablePagination/TablePagination.d.mts +1 -1
- package/TablePagination/TablePagination.d.ts +1 -1
- package/TablePagination/TablePagination.js +4 -2
- package/TablePagination/TablePagination.mjs +4 -2
- package/Tabs/Tabs.d.mts +2 -33
- package/Tabs/Tabs.d.ts +2 -33
- package/Tabs/Tabs.js +54 -135
- package/Tabs/Tabs.mjs +54 -135
- package/TextField/TextField.d.mts +6 -49
- package/TextField/TextField.d.ts +6 -49
- package/TextField/TextField.js +18 -53
- package/TextField/TextField.mjs +18 -53
- package/Tooltip/Tooltip.d.mts +1 -55
- package/Tooltip/Tooltip.d.ts +1 -55
- package/Tooltip/Tooltip.js +9 -87
- package/Tooltip/Tooltip.mjs +9 -87
- package/Typography/Typography.d.mts +1 -6
- package/Typography/Typography.d.ts +1 -6
- package/Typography/Typography.js +3 -19
- package/Typography/Typography.mjs +3 -19
- package/Typography/typographyClasses.d.mts +0 -5
- package/Typography/typographyClasses.d.ts +0 -5
- package/Typography/typographyClasses.js +1 -1
- package/Typography/typographyClasses.mjs +1 -1
- package/index.d.mts +0 -2
- package/index.d.ts +0 -2
- package/index.js +1 -9
- package/index.mjs +1 -2
- package/locale/amET.js +4 -1
- package/locale/amET.mjs +3 -1
- package/locale/arEG.js +4 -1
- package/locale/arEG.mjs +3 -1
- package/locale/arSA.js +4 -1
- package/locale/arSA.mjs +3 -1
- package/locale/arSD.js +4 -1
- package/locale/arSD.mjs +3 -1
- package/locale/beBY.js +4 -1
- package/locale/beBY.mjs +3 -1
- package/locale/bnBD.js +4 -1
- package/locale/bnBD.mjs +3 -1
- package/locale/caES.js +4 -1
- package/locale/caES.mjs +3 -1
- package/locale/csCZ.js +4 -1
- package/locale/csCZ.mjs +3 -1
- package/locale/daDK.js +4 -1
- package/locale/daDK.mjs +3 -1
- package/locale/deDE.js +4 -1
- package/locale/deDE.mjs +3 -1
- package/locale/elGR.js +4 -1
- package/locale/elGR.mjs +3 -1
- package/locale/esES.js +4 -1
- package/locale/esES.mjs +3 -1
- package/locale/etEE.js +4 -1
- package/locale/etEE.mjs +3 -1
- package/locale/faIR.js +4 -1
- package/locale/faIR.mjs +3 -1
- package/locale/fiFI.js +4 -1
- package/locale/fiFI.mjs +3 -1
- package/locale/frFR.js +4 -1
- package/locale/frFR.mjs +3 -1
- package/locale/heIL.js +4 -1
- package/locale/heIL.mjs +3 -1
- package/locale/hiIN.js +4 -1
- package/locale/hiIN.mjs +3 -1
- package/locale/hrHR.js +5 -1
- package/locale/hrHR.mjs +4 -1
- package/locale/isIS.js +4 -1
- package/locale/isIS.mjs +3 -1
- package/locale/itIT.js +4 -1
- package/locale/itIT.mjs +3 -1
- package/locale/jaJP.js +4 -1
- package/locale/jaJP.mjs +3 -1
- package/locale/khKH.js +4 -1
- package/locale/khKH.mjs +3 -1
- package/locale/kkKZ.js +4 -1
- package/locale/kkKZ.mjs +3 -1
- package/locale/koKR.js +4 -1
- package/locale/koKR.mjs +3 -1
- package/locale/kuCKB.js +4 -1
- package/locale/kuCKB.mjs +3 -1
- package/locale/kuLatn.js +4 -1
- package/locale/kuLatn.mjs +3 -1
- package/locale/mkMK.js +5 -1
- package/locale/mkMK.mjs +4 -1
- package/locale/msMS.js +5 -1
- package/locale/msMS.mjs +4 -1
- package/locale/myMY.js +5 -1
- package/locale/myMY.mjs +4 -1
- package/locale/nbNO.js +4 -1
- package/locale/nbNO.mjs +3 -1
- package/locale/neNP.js +5 -1
- package/locale/neNP.mjs +4 -1
- package/locale/nlNL.js +4 -1
- package/locale/nlNL.mjs +3 -1
- package/locale/nnNO.js +4 -1
- package/locale/nnNO.mjs +3 -1
- package/locale/plPL.js +4 -1
- package/locale/plPL.mjs +3 -1
- package/locale/psAF.js +4 -1
- package/locale/psAF.mjs +3 -1
- package/locale/ptBR.js +4 -1
- package/locale/ptBR.mjs +3 -1
- package/locale/ptPT.js +4 -1
- package/locale/ptPT.mjs +3 -1
- package/locale/roRO.js +4 -1
- package/locale/roRO.mjs +3 -1
- package/locale/ruRU.js +4 -1
- package/locale/ruRU.mjs +3 -1
- package/locale/siLK.js +4 -1
- package/locale/siLK.mjs +3 -1
- package/locale/skSK.js +4 -1
- package/locale/skSK.mjs +3 -1
- package/locale/srRS.js +5 -1
- package/locale/srRS.mjs +4 -1
- package/locale/svSE.js +4 -1
- package/locale/svSE.mjs +3 -1
- package/locale/thTH.js +4 -1
- package/locale/thTH.mjs +3 -1
- package/locale/tlTL.js +5 -1
- package/locale/tlTL.mjs +4 -1
- package/locale/trTR.js +4 -1
- package/locale/trTR.mjs +3 -1
- package/locale/ukUA.js +4 -1
- package/locale/ukUA.mjs +3 -1
- package/locale/urPK.js +4 -1
- package/locale/urPK.mjs +3 -1
- package/locale/utils/buildFormatNumber.d.mts +2 -0
- package/locale/utils/buildFormatNumber.d.ts +2 -0
- package/locale/utils/buildFormatNumber.js +23 -0
- package/locale/utils/buildFormatNumber.mjs +17 -0
- package/locale/viVN.js +4 -1
- package/locale/viVN.mjs +3 -1
- package/locale/zhCN.js +4 -1
- package/locale/zhCN.mjs +3 -1
- package/locale/zhHK.js +4 -1
- package/locale/zhHK.mjs +3 -1
- package/locale/zhTW.js +4 -1
- package/locale/zhTW.mjs +3 -1
- package/package.json +236 -236
- package/styles/components.d.mts +0 -5
- package/styles/components.d.ts +0 -5
- package/styles/overrides.d.mts +0 -2
- package/styles/overrides.d.ts +0 -2
- package/styles/props.d.mts +0 -2
- package/styles/props.d.ts +0 -2
- package/themeCssVarsAugmentation/index.js +5 -0
- package/themeCssVarsAugmentation/index.mjs +5 -0
- package/useAutocomplete/useAutocomplete.d.mts +0 -12
- package/useAutocomplete/useAutocomplete.d.ts +0 -12
- package/useAutocomplete/useAutocomplete.js +53 -28
- package/useAutocomplete/useAutocomplete.mjs +53 -28
- package/utils/index.d.mts +2 -0
- package/utils/index.d.ts +2 -0
- package/utils/index.js +14 -0
- package/utils/index.mjs +2 -0
- package/utils/useRovingTabIndex.d.mts +2 -0
- package/utils/useRovingTabIndex.d.ts +2 -0
- package/utils/useRovingTabIndex.js +9 -0
- package/utils/useRovingTabIndex.mjs +2 -0
- package/version/index.js +2 -2
- package/version/index.mjs +2 -2
- package/GridLegacy/GridLegacy.d.mts +0 -160
- package/GridLegacy/GridLegacy.d.ts +0 -160
- package/GridLegacy/GridLegacy.js +0 -601
- package/GridLegacy/GridLegacy.mjs +0 -588
- package/GridLegacy/GridLegacyContext.js +0 -17
- package/GridLegacy/GridLegacyContext.mjs +0 -12
- package/GridLegacy/gridLegacyClasses.d.mts +0 -48
- package/GridLegacy/gridLegacyClasses.d.ts +0 -48
- package/GridLegacy/gridLegacyClasses.js +0 -27
- package/GridLegacy/gridLegacyClasses.mjs +0 -19
- package/GridLegacy/index.d.mts +0 -4
- package/GridLegacy/index.d.ts +0 -4
- package/GridLegacy/index.js +0 -35
- package/GridLegacy/index.mjs +0 -3
|
@@ -21,7 +21,6 @@ var _Tooltip = _interopRequireDefault(require("../Tooltip"));
|
|
|
21
21
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
22
22
|
var _speedDialActionClasses = _interopRequireWildcard(require("./speedDialActionClasses"));
|
|
23
23
|
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
24
|
-
var _utils = require("../utils");
|
|
25
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
25
|
const useUtilityClasses = ownerState => {
|
|
27
26
|
const {
|
|
@@ -147,18 +146,15 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
|
|
|
147
146
|
const {
|
|
148
147
|
className,
|
|
149
148
|
delay = 0,
|
|
150
|
-
FabProps = {},
|
|
151
149
|
icon,
|
|
152
150
|
id,
|
|
153
151
|
open,
|
|
154
|
-
TooltipClasses,
|
|
155
|
-
tooltipOpen: tooltipOpenProp = false,
|
|
156
|
-
tooltipPlacement = 'left',
|
|
157
|
-
tooltipTitle,
|
|
158
152
|
slots = {},
|
|
159
153
|
slotProps = {},
|
|
160
154
|
...other
|
|
161
155
|
} = props;
|
|
156
|
+
const resolvedTooltipSlotProps = typeof slotProps.tooltip === 'function' ? slotProps.tooltip(props) : slotProps.tooltip ?? {};
|
|
157
|
+
const tooltipPlacement = resolvedTooltipSlotProps.placement ?? 'left';
|
|
162
158
|
const ownerState = {
|
|
163
159
|
...props,
|
|
164
160
|
tooltipPlacement
|
|
@@ -166,18 +162,9 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
|
|
|
166
162
|
const classes = useUtilityClasses(ownerState);
|
|
167
163
|
const externalForwardedProps = {
|
|
168
164
|
slots,
|
|
169
|
-
slotProps
|
|
170
|
-
fab: FabProps,
|
|
171
|
-
...slotProps,
|
|
172
|
-
tooltip: (0, _utils.mergeSlotProps)(typeof slotProps.tooltip === 'function' ? slotProps.tooltip(ownerState) : slotProps.tooltip, {
|
|
173
|
-
title: tooltipTitle,
|
|
174
|
-
open: tooltipOpenProp,
|
|
175
|
-
placement: tooltipPlacement,
|
|
176
|
-
classes: TooltipClasses
|
|
177
|
-
})
|
|
178
|
-
}
|
|
165
|
+
slotProps
|
|
179
166
|
};
|
|
180
|
-
const [tooltipOpen, setTooltipOpen] = React.useState(
|
|
167
|
+
const [tooltipOpen, setTooltipOpen] = React.useState(resolvedTooltipSlotProps.open ?? false);
|
|
181
168
|
const handleTooltipClose = () => {
|
|
182
169
|
setTooltipOpen(false);
|
|
183
170
|
};
|
|
@@ -288,12 +275,6 @@ process.env.NODE_ENV !== "production" ? SpeedDialAction.propTypes /* remove-prop
|
|
|
288
275
|
* @default 0
|
|
289
276
|
*/
|
|
290
277
|
delay: _propTypes.default.number,
|
|
291
|
-
/**
|
|
292
|
-
* Props applied to the [`Fab`](https://mui.com/material-ui/api/fab/) component.
|
|
293
|
-
* @default {}
|
|
294
|
-
* @deprecated Use `slotProps.fab` 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.
|
|
295
|
-
*/
|
|
296
|
-
FabProps: _propTypes.default.object,
|
|
297
278
|
/**
|
|
298
279
|
* The icon to display in the SpeedDial Fab.
|
|
299
280
|
*/
|
|
@@ -330,28 +311,6 @@ process.env.NODE_ENV !== "production" ? SpeedDialAction.propTypes /* remove-prop
|
|
|
330
311
|
/**
|
|
331
312
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
332
313
|
*/
|
|
333
|
-
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
334
|
-
/**
|
|
335
|
-
* `classes` prop applied to the [`Tooltip`](https://mui.com/material-ui/api/tooltip/) element.
|
|
336
|
-
* @deprecated Use `slotProps.tooltip.classes` 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.
|
|
337
|
-
*/
|
|
338
|
-
TooltipClasses: _propTypes.default.object,
|
|
339
|
-
/**
|
|
340
|
-
* Make the tooltip always visible when the SpeedDial is open.
|
|
341
|
-
* @default false
|
|
342
|
-
* @deprecated Use `slotProps.tooltip.open` 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.
|
|
343
|
-
*/
|
|
344
|
-
tooltipOpen: _propTypes.default.bool,
|
|
345
|
-
/**
|
|
346
|
-
* Placement of the tooltip.
|
|
347
|
-
* @default 'left'
|
|
348
|
-
* @deprecated Use `slotProps.tooltip.placement` 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.
|
|
349
|
-
*/
|
|
350
|
-
tooltipPlacement: _propTypes.default.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
351
|
-
/**
|
|
352
|
-
* Label to display in the tooltip.
|
|
353
|
-
* @deprecated Use `slotProps.tooltip.title` 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.
|
|
354
|
-
*/
|
|
355
|
-
tooltipTitle: _propTypes.default.node
|
|
314
|
+
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
356
315
|
} : void 0;
|
|
357
316
|
var _default = exports.default = SpeedDialAction;
|
|
@@ -14,7 +14,6 @@ import Tooltip from "../Tooltip/index.mjs";
|
|
|
14
14
|
import capitalize from "../utils/capitalize.mjs";
|
|
15
15
|
import speedDialActionClasses, { getSpeedDialActionUtilityClass } from "./speedDialActionClasses.mjs";
|
|
16
16
|
import useSlot from "../utils/useSlot.mjs";
|
|
17
|
-
import { mergeSlotProps } from "../utils/index.mjs";
|
|
18
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
18
|
const useUtilityClasses = ownerState => {
|
|
20
19
|
const {
|
|
@@ -140,18 +139,15 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
|
|
|
140
139
|
const {
|
|
141
140
|
className,
|
|
142
141
|
delay = 0,
|
|
143
|
-
FabProps = {},
|
|
144
142
|
icon,
|
|
145
143
|
id,
|
|
146
144
|
open,
|
|
147
|
-
TooltipClasses,
|
|
148
|
-
tooltipOpen: tooltipOpenProp = false,
|
|
149
|
-
tooltipPlacement = 'left',
|
|
150
|
-
tooltipTitle,
|
|
151
145
|
slots = {},
|
|
152
146
|
slotProps = {},
|
|
153
147
|
...other
|
|
154
148
|
} = props;
|
|
149
|
+
const resolvedTooltipSlotProps = typeof slotProps.tooltip === 'function' ? slotProps.tooltip(props) : slotProps.tooltip ?? {};
|
|
150
|
+
const tooltipPlacement = resolvedTooltipSlotProps.placement ?? 'left';
|
|
155
151
|
const ownerState = {
|
|
156
152
|
...props,
|
|
157
153
|
tooltipPlacement
|
|
@@ -159,18 +155,9 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
|
|
|
159
155
|
const classes = useUtilityClasses(ownerState);
|
|
160
156
|
const externalForwardedProps = {
|
|
161
157
|
slots,
|
|
162
|
-
slotProps
|
|
163
|
-
fab: FabProps,
|
|
164
|
-
...slotProps,
|
|
165
|
-
tooltip: mergeSlotProps(typeof slotProps.tooltip === 'function' ? slotProps.tooltip(ownerState) : slotProps.tooltip, {
|
|
166
|
-
title: tooltipTitle,
|
|
167
|
-
open: tooltipOpenProp,
|
|
168
|
-
placement: tooltipPlacement,
|
|
169
|
-
classes: TooltipClasses
|
|
170
|
-
})
|
|
171
|
-
}
|
|
158
|
+
slotProps
|
|
172
159
|
};
|
|
173
|
-
const [tooltipOpen, setTooltipOpen] = React.useState(
|
|
160
|
+
const [tooltipOpen, setTooltipOpen] = React.useState(resolvedTooltipSlotProps.open ?? false);
|
|
174
161
|
const handleTooltipClose = () => {
|
|
175
162
|
setTooltipOpen(false);
|
|
176
163
|
};
|
|
@@ -281,12 +268,6 @@ process.env.NODE_ENV !== "production" ? SpeedDialAction.propTypes /* remove-prop
|
|
|
281
268
|
* @default 0
|
|
282
269
|
*/
|
|
283
270
|
delay: PropTypes.number,
|
|
284
|
-
/**
|
|
285
|
-
* Props applied to the [`Fab`](https://mui.com/material-ui/api/fab/) component.
|
|
286
|
-
* @default {}
|
|
287
|
-
* @deprecated Use `slotProps.fab` 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.
|
|
288
|
-
*/
|
|
289
|
-
FabProps: PropTypes.object,
|
|
290
271
|
/**
|
|
291
272
|
* The icon to display in the SpeedDial Fab.
|
|
292
273
|
*/
|
|
@@ -323,28 +304,6 @@ process.env.NODE_ENV !== "production" ? SpeedDialAction.propTypes /* remove-prop
|
|
|
323
304
|
/**
|
|
324
305
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
325
306
|
*/
|
|
326
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
327
|
-
/**
|
|
328
|
-
* `classes` prop applied to the [`Tooltip`](https://mui.com/material-ui/api/tooltip/) element.
|
|
329
|
-
* @deprecated Use `slotProps.tooltip.classes` 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.
|
|
330
|
-
*/
|
|
331
|
-
TooltipClasses: PropTypes.object,
|
|
332
|
-
/**
|
|
333
|
-
* Make the tooltip always visible when the SpeedDial is open.
|
|
334
|
-
* @default false
|
|
335
|
-
* @deprecated Use `slotProps.tooltip.open` 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.
|
|
336
|
-
*/
|
|
337
|
-
tooltipOpen: PropTypes.bool,
|
|
338
|
-
/**
|
|
339
|
-
* Placement of the tooltip.
|
|
340
|
-
* @default 'left'
|
|
341
|
-
* @deprecated Use `slotProps.tooltip.placement` 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.
|
|
342
|
-
*/
|
|
343
|
-
tooltipPlacement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
344
|
-
/**
|
|
345
|
-
* Label to display in the tooltip.
|
|
346
|
-
* @deprecated Use `slotProps.tooltip.title` 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.
|
|
347
|
-
*/
|
|
348
|
-
tooltipTitle: PropTypes.node
|
|
307
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
349
308
|
} : void 0;
|
|
350
309
|
export default SpeedDialAction;
|
package/Step/Step.js
CHANGED
|
@@ -12,7 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
12
12
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
13
|
var _integerPropType = _interopRequireDefault(require("@mui/utils/integerPropType"));
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
-
var _StepperContext =
|
|
15
|
+
var _StepperContext = require("../Stepper/StepperContext");
|
|
16
16
|
var _StepContext = _interopRequireDefault(require("./StepContext"));
|
|
17
17
|
var _zeroStyled = require("../zero-styled");
|
|
18
18
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
@@ -30,7 +30,7 @@ const useUtilityClasses = ownerState => {
|
|
|
30
30
|
};
|
|
31
31
|
return (0, _composeClasses.default)(slots, _stepClasses.getStepUtilityClass, classes);
|
|
32
32
|
};
|
|
33
|
-
const StepRoot = (0, _zeroStyled.styled)('
|
|
33
|
+
const StepRoot = (0, _zeroStyled.styled)('li', {
|
|
34
34
|
name: 'MuiStep',
|
|
35
35
|
slot: 'Root',
|
|
36
36
|
overridesResolver: (props, styles) => {
|
|
@@ -67,7 +67,7 @@ const Step = /*#__PURE__*/React.forwardRef(function Step(inProps, ref) {
|
|
|
67
67
|
active: activeProp,
|
|
68
68
|
children,
|
|
69
69
|
className,
|
|
70
|
-
component = '
|
|
70
|
+
component = 'li',
|
|
71
71
|
completed: completedProp,
|
|
72
72
|
disabled: disabledProp,
|
|
73
73
|
expanded = false,
|
|
@@ -80,8 +80,9 @@ const Step = /*#__PURE__*/React.forwardRef(function Step(inProps, ref) {
|
|
|
80
80
|
connector,
|
|
81
81
|
alternativeLabel,
|
|
82
82
|
orientation,
|
|
83
|
-
nonLinear
|
|
84
|
-
|
|
83
|
+
nonLinear,
|
|
84
|
+
isTabList
|
|
85
|
+
} = (0, _StepperContext.useStepperContext)();
|
|
85
86
|
let [active = false, completed = false, disabled = false] = [activeProp, completedProp, disabledProp];
|
|
86
87
|
if (activeStep === index) {
|
|
87
88
|
active = activeProp !== undefined ? activeProp : true;
|
|
@@ -115,6 +116,7 @@ const Step = /*#__PURE__*/React.forwardRef(function Step(inProps, ref) {
|
|
|
115
116
|
className: (0, _clsx.default)(classes.root, className),
|
|
116
117
|
ref: ref,
|
|
117
118
|
ownerState: ownerState,
|
|
119
|
+
role: isTabList ? 'presentation' : undefined,
|
|
118
120
|
...other,
|
|
119
121
|
children: [connector && alternativeLabel && index !== 0 ? connector : null, children]
|
|
120
122
|
});
|
package/Step/Step.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import integerPropType from '@mui/utils/integerPropType';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
|
-
import
|
|
8
|
+
import { useStepperContext } from "../Stepper/StepperContext.mjs";
|
|
9
9
|
import StepContext from "./StepContext.mjs";
|
|
10
10
|
import { styled } from "../zero-styled/index.mjs";
|
|
11
11
|
import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
|
|
@@ -23,7 +23,7 @@ const useUtilityClasses = ownerState => {
|
|
|
23
23
|
};
|
|
24
24
|
return composeClasses(slots, getStepUtilityClass, classes);
|
|
25
25
|
};
|
|
26
|
-
const StepRoot = styled('
|
|
26
|
+
const StepRoot = styled('li', {
|
|
27
27
|
name: 'MuiStep',
|
|
28
28
|
slot: 'Root',
|
|
29
29
|
overridesResolver: (props, styles) => {
|
|
@@ -60,7 +60,7 @@ const Step = /*#__PURE__*/React.forwardRef(function Step(inProps, ref) {
|
|
|
60
60
|
active: activeProp,
|
|
61
61
|
children,
|
|
62
62
|
className,
|
|
63
|
-
component = '
|
|
63
|
+
component = 'li',
|
|
64
64
|
completed: completedProp,
|
|
65
65
|
disabled: disabledProp,
|
|
66
66
|
expanded = false,
|
|
@@ -73,8 +73,9 @@ const Step = /*#__PURE__*/React.forwardRef(function Step(inProps, ref) {
|
|
|
73
73
|
connector,
|
|
74
74
|
alternativeLabel,
|
|
75
75
|
orientation,
|
|
76
|
-
nonLinear
|
|
77
|
-
|
|
76
|
+
nonLinear,
|
|
77
|
+
isTabList
|
|
78
|
+
} = useStepperContext();
|
|
78
79
|
let [active = false, completed = false, disabled = false] = [activeProp, completedProp, disabledProp];
|
|
79
80
|
if (activeStep === index) {
|
|
80
81
|
active = activeProp !== undefined ? activeProp : true;
|
|
@@ -108,6 +109,7 @@ const Step = /*#__PURE__*/React.forwardRef(function Step(inProps, ref) {
|
|
|
108
109
|
className: clsx(classes.root, className),
|
|
109
110
|
ref: ref,
|
|
110
111
|
ownerState: ownerState,
|
|
112
|
+
role: isTabList ? 'presentation' : undefined,
|
|
111
113
|
...other,
|
|
112
114
|
children: [connector && alternativeLabel && index !== 0 ? connector : null, children]
|
|
113
115
|
});
|
package/StepButton/StepButton.js
CHANGED
|
@@ -16,7 +16,7 @@ var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
|
16
16
|
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
17
17
|
var _StepLabel = _interopRequireDefault(require("../StepLabel"));
|
|
18
18
|
var _isMuiElement = _interopRequireDefault(require("../utils/isMuiElement"));
|
|
19
|
-
var _StepperContext =
|
|
19
|
+
var _StepperContext = require("../Stepper/StepperContext");
|
|
20
20
|
var _StepContext = _interopRequireDefault(require("../Step/StepContext"));
|
|
21
21
|
var _stepButtonClasses = _interopRequireWildcard(require("./stepButtonClasses"));
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -75,11 +75,14 @@ const StepButton = /*#__PURE__*/React.forwardRef(function StepButton(inProps, re
|
|
|
75
75
|
} = props;
|
|
76
76
|
const {
|
|
77
77
|
disabled,
|
|
78
|
-
active
|
|
78
|
+
active,
|
|
79
|
+
index
|
|
79
80
|
} = React.useContext(_StepContext.default);
|
|
80
81
|
const {
|
|
81
|
-
orientation
|
|
82
|
-
|
|
82
|
+
orientation,
|
|
83
|
+
totalSteps,
|
|
84
|
+
getRovingTabIndexProps
|
|
85
|
+
} = (0, _StepperContext.useStepperContext)();
|
|
83
86
|
const ownerState = {
|
|
84
87
|
...props,
|
|
85
88
|
orientation
|
|
@@ -93,6 +96,10 @@ const StepButton = /*#__PURE__*/React.forwardRef(function StepButton(inProps, re
|
|
|
93
96
|
...childProps,
|
|
94
97
|
children: children
|
|
95
98
|
});
|
|
99
|
+
const rovingTabIndexItemProps = getRovingTabIndexProps?.(index, ref) ?? {
|
|
100
|
+
ref,
|
|
101
|
+
tabIndex: active ? 0 : -1
|
|
102
|
+
};
|
|
96
103
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StepButtonRoot, {
|
|
97
104
|
focusRipple: true,
|
|
98
105
|
disabled: disabled,
|
|
@@ -100,9 +107,12 @@ const StepButton = /*#__PURE__*/React.forwardRef(function StepButton(inProps, re
|
|
|
100
107
|
className: classes.touchRipple
|
|
101
108
|
},
|
|
102
109
|
className: (0, _clsx.default)(classes.root, className),
|
|
103
|
-
ref: ref,
|
|
104
110
|
ownerState: ownerState,
|
|
105
|
-
"aria-
|
|
111
|
+
"aria-selected": active,
|
|
112
|
+
"aria-posinset": index + 1,
|
|
113
|
+
"aria-setsize": totalSteps,
|
|
114
|
+
role: "tab",
|
|
115
|
+
...rovingTabIndexItemProps,
|
|
106
116
|
...other,
|
|
107
117
|
children: child
|
|
108
118
|
});
|
|
@@ -9,7 +9,7 @@ import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
|
|
|
9
9
|
import ButtonBase from "../ButtonBase/index.mjs";
|
|
10
10
|
import StepLabel from "../StepLabel/index.mjs";
|
|
11
11
|
import isMuiElement from "../utils/isMuiElement.mjs";
|
|
12
|
-
import
|
|
12
|
+
import { useStepperContext } from "../Stepper/StepperContext.mjs";
|
|
13
13
|
import StepContext from "../Step/StepContext.mjs";
|
|
14
14
|
import stepButtonClasses, { getStepButtonUtilityClass } from "./stepButtonClasses.mjs";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -68,11 +68,14 @@ const StepButton = /*#__PURE__*/React.forwardRef(function StepButton(inProps, re
|
|
|
68
68
|
} = props;
|
|
69
69
|
const {
|
|
70
70
|
disabled,
|
|
71
|
-
active
|
|
71
|
+
active,
|
|
72
|
+
index
|
|
72
73
|
} = React.useContext(StepContext);
|
|
73
74
|
const {
|
|
74
|
-
orientation
|
|
75
|
-
|
|
75
|
+
orientation,
|
|
76
|
+
totalSteps,
|
|
77
|
+
getRovingTabIndexProps
|
|
78
|
+
} = useStepperContext();
|
|
76
79
|
const ownerState = {
|
|
77
80
|
...props,
|
|
78
81
|
orientation
|
|
@@ -86,6 +89,10 @@ const StepButton = /*#__PURE__*/React.forwardRef(function StepButton(inProps, re
|
|
|
86
89
|
...childProps,
|
|
87
90
|
children: children
|
|
88
91
|
});
|
|
92
|
+
const rovingTabIndexItemProps = getRovingTabIndexProps?.(index, ref) ?? {
|
|
93
|
+
ref,
|
|
94
|
+
tabIndex: active ? 0 : -1
|
|
95
|
+
};
|
|
89
96
|
return /*#__PURE__*/_jsx(StepButtonRoot, {
|
|
90
97
|
focusRipple: true,
|
|
91
98
|
disabled: disabled,
|
|
@@ -93,9 +100,12 @@ const StepButton = /*#__PURE__*/React.forwardRef(function StepButton(inProps, re
|
|
|
93
100
|
className: classes.touchRipple
|
|
94
101
|
},
|
|
95
102
|
className: clsx(classes.root, className),
|
|
96
|
-
ref: ref,
|
|
97
103
|
ownerState: ownerState,
|
|
98
|
-
"aria-
|
|
104
|
+
"aria-selected": active,
|
|
105
|
+
"aria-posinset": index + 1,
|
|
106
|
+
"aria-setsize": totalSteps,
|
|
107
|
+
role: "tab",
|
|
108
|
+
...rovingTabIndexItemProps,
|
|
99
109
|
...other,
|
|
100
110
|
children: child
|
|
101
111
|
});
|
|
@@ -15,7 +15,7 @@ var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
|
15
15
|
var _zeroStyled = require("../zero-styled");
|
|
16
16
|
var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
|
|
17
17
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
18
|
-
var _StepperContext =
|
|
18
|
+
var _StepperContext = require("../Stepper/StepperContext");
|
|
19
19
|
var _StepContext = _interopRequireDefault(require("../Step/StepContext"));
|
|
20
20
|
var _stepConnectorClasses = require("./stepConnectorClasses");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -112,7 +112,7 @@ const StepConnector = /*#__PURE__*/React.forwardRef(function StepConnector(inPro
|
|
|
112
112
|
const {
|
|
113
113
|
alternativeLabel,
|
|
114
114
|
orientation = 'horizontal'
|
|
115
|
-
} =
|
|
115
|
+
} = (0, _StepperContext.useStepperContext)();
|
|
116
116
|
const {
|
|
117
117
|
active,
|
|
118
118
|
disabled,
|
|
@@ -8,7 +8,7 @@ import capitalize from "../utils/capitalize.mjs";
|
|
|
8
8
|
import { styled } from "../zero-styled/index.mjs";
|
|
9
9
|
import memoTheme from "../utils/memoTheme.mjs";
|
|
10
10
|
import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
|
|
11
|
-
import
|
|
11
|
+
import { useStepperContext } from "../Stepper/StepperContext.mjs";
|
|
12
12
|
import StepContext from "../Step/StepContext.mjs";
|
|
13
13
|
import { getStepConnectorUtilityClass } from "./stepConnectorClasses.mjs";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -105,7 +105,7 @@ const StepConnector = /*#__PURE__*/React.forwardRef(function StepConnector(inPro
|
|
|
105
105
|
const {
|
|
106
106
|
alternativeLabel,
|
|
107
107
|
orientation = 'horizontal'
|
|
108
|
-
} =
|
|
108
|
+
} = useStepperContext();
|
|
109
109
|
const {
|
|
110
110
|
active,
|
|
111
111
|
disabled,
|
|
@@ -15,7 +15,7 @@ var _zeroStyled = require("../zero-styled");
|
|
|
15
15
|
var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
|
|
16
16
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
17
17
|
var _Collapse = _interopRequireDefault(require("../Collapse"));
|
|
18
|
-
var _StepperContext =
|
|
18
|
+
var _StepperContext = require("../Stepper/StepperContext");
|
|
19
19
|
var _StepContext = _interopRequireDefault(require("../Step/StepContext"));
|
|
20
20
|
var _stepContentClasses = require("./stepContentClasses");
|
|
21
21
|
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
@@ -79,7 +79,7 @@ const StepContent = /*#__PURE__*/React.forwardRef(function StepContent(inProps,
|
|
|
79
79
|
} = props;
|
|
80
80
|
const {
|
|
81
81
|
orientation
|
|
82
|
-
} =
|
|
82
|
+
} = (0, _StepperContext.useStepperContext)();
|
|
83
83
|
const {
|
|
84
84
|
active,
|
|
85
85
|
last,
|
|
@@ -8,7 +8,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 Collapse from "../Collapse/index.mjs";
|
|
11
|
-
import
|
|
11
|
+
import { useStepperContext } from "../Stepper/StepperContext.mjs";
|
|
12
12
|
import StepContext from "../Step/StepContext.mjs";
|
|
13
13
|
import { getStepContentUtilityClass } from "./stepContentClasses.mjs";
|
|
14
14
|
import useSlot from "../utils/useSlot.mjs";
|
|
@@ -72,7 +72,7 @@ const StepContent = /*#__PURE__*/React.forwardRef(function StepContent(inProps,
|
|
|
72
72
|
} = props;
|
|
73
73
|
const {
|
|
74
74
|
orientation
|
|
75
|
-
} =
|
|
75
|
+
} = useStepperContext();
|
|
76
76
|
const {
|
|
77
77
|
active,
|
|
78
78
|
last,
|
package/StepLabel/StepLabel.js
CHANGED
|
@@ -13,7 +13,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
var React = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _StepContext = _interopRequireDefault(require("../Step/StepContext"));
|
|
15
15
|
var _StepIcon = _interopRequireDefault(require("../StepIcon"));
|
|
16
|
-
var _StepperContext =
|
|
16
|
+
var _StepperContext = require("../Stepper/StepperContext");
|
|
17
17
|
var _zeroStyled = require("../zero-styled");
|
|
18
18
|
var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
|
|
19
19
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
@@ -132,7 +132,7 @@ const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref)
|
|
|
132
132
|
const {
|
|
133
133
|
alternativeLabel,
|
|
134
134
|
orientation
|
|
135
|
-
} =
|
|
135
|
+
} = (0, _StepperContext.useStepperContext)();
|
|
136
136
|
const {
|
|
137
137
|
active,
|
|
138
138
|
disabled,
|
package/StepLabel/StepLabel.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import StepContext from "../Step/StepContext.mjs";
|
|
8
8
|
import StepIcon from "../StepIcon/index.mjs";
|
|
9
|
-
import
|
|
9
|
+
import { useStepperContext } from "../Stepper/StepperContext.mjs";
|
|
10
10
|
import { styled } from "../zero-styled/index.mjs";
|
|
11
11
|
import memoTheme from "../utils/memoTheme.mjs";
|
|
12
12
|
import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
|
|
@@ -125,7 +125,7 @@ const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref)
|
|
|
125
125
|
const {
|
|
126
126
|
alternativeLabel,
|
|
127
127
|
orientation
|
|
128
|
-
} =
|
|
128
|
+
} = useStepperContext();
|
|
129
129
|
const {
|
|
130
130
|
active,
|
|
131
131
|
disabled,
|
package/Stepper/Stepper.js
CHANGED
|
@@ -12,11 +12,14 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
12
12
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
13
|
var _integerPropType = _interopRequireDefault(require("@mui/utils/integerPropType"));
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
+
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
16
|
+
var _useRovingTabIndex = _interopRequireDefault(require("../utils/useRovingTabIndex"));
|
|
15
17
|
var _zeroStyled = require("../zero-styled");
|
|
16
18
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
17
19
|
var _stepperClasses = require("./stepperClasses");
|
|
18
20
|
var _StepConnector = _interopRequireDefault(require("../StepConnector"));
|
|
19
|
-
var _StepperContext =
|
|
21
|
+
var _StepperContext = require("./StepperContext");
|
|
22
|
+
var _StepButton = _interopRequireDefault(require("../StepButton"));
|
|
20
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
24
|
const useUtilityClasses = ownerState => {
|
|
22
25
|
const {
|
|
@@ -30,7 +33,7 @@ const useUtilityClasses = ownerState => {
|
|
|
30
33
|
};
|
|
31
34
|
return (0, _composeClasses.default)(slots, _stepperClasses.getStepperUtilityClass, classes);
|
|
32
35
|
};
|
|
33
|
-
const StepperRoot = (0, _zeroStyled.styled)('
|
|
36
|
+
const StepperRoot = (0, _zeroStyled.styled)('ol', {
|
|
34
37
|
name: 'MuiStepper',
|
|
35
38
|
slot: 'Root',
|
|
36
39
|
overridesResolver: (props, styles) => {
|
|
@@ -41,6 +44,9 @@ const StepperRoot = (0, _zeroStyled.styled)('div', {
|
|
|
41
44
|
}
|
|
42
45
|
})({
|
|
43
46
|
display: 'flex',
|
|
47
|
+
listStyle: 'none',
|
|
48
|
+
margin: 0,
|
|
49
|
+
padding: 0,
|
|
44
50
|
variants: [{
|
|
45
51
|
props: {
|
|
46
52
|
orientation: 'horizontal'
|
|
@@ -67,6 +73,7 @@ const StepperRoot = (0, _zeroStyled.styled)('div', {
|
|
|
67
73
|
});
|
|
68
74
|
const defaultConnector = /*#__PURE__*/(0, _jsxRuntime.jsx)(_StepConnector.default, {});
|
|
69
75
|
const Stepper = /*#__PURE__*/React.forwardRef(function Stepper(inProps, ref) {
|
|
76
|
+
const isRtl = (0, _RtlProvider.useRtl)();
|
|
70
77
|
const props = (0, _DefaultPropsProvider.useDefaultProps)({
|
|
71
78
|
props: inProps,
|
|
72
79
|
name: 'MuiStepper'
|
|
@@ -76,7 +83,7 @@ const Stepper = /*#__PURE__*/React.forwardRef(function Stepper(inProps, ref) {
|
|
|
76
83
|
alternativeLabel = false,
|
|
77
84
|
children,
|
|
78
85
|
className,
|
|
79
|
-
component = '
|
|
86
|
+
component = 'ol',
|
|
80
87
|
connector = defaultConnector,
|
|
81
88
|
nonLinear = false,
|
|
82
89
|
orientation = 'horizontal',
|
|
@@ -91,27 +98,57 @@ const Stepper = /*#__PURE__*/React.forwardRef(function Stepper(inProps, ref) {
|
|
|
91
98
|
};
|
|
92
99
|
const classes = useUtilityClasses(ownerState);
|
|
93
100
|
const childrenArray = React.Children.toArray(children).filter(Boolean);
|
|
101
|
+
const totalSteps = childrenArray.length;
|
|
102
|
+
const isTabList = childrenArray.some(child => {
|
|
103
|
+
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if (child.type === _StepButton.default) {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
const grandChildren = child.props.children;
|
|
110
|
+
if (grandChildren) {
|
|
111
|
+
return React.Children.toArray(grandChildren).some(grandChild => /*#__PURE__*/React.isValidElement(grandChild) && grandChild.type === _StepButton.default);
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
});
|
|
94
115
|
const steps = childrenArray.map((step, index) => {
|
|
95
116
|
return /*#__PURE__*/React.cloneElement(step, {
|
|
96
117
|
index,
|
|
97
|
-
last: index + 1 ===
|
|
118
|
+
last: index + 1 === totalSteps,
|
|
98
119
|
...step.props
|
|
99
120
|
});
|
|
100
121
|
});
|
|
122
|
+
const {
|
|
123
|
+
getContainerProps,
|
|
124
|
+
getItemProps
|
|
125
|
+
} = (0, _useRovingTabIndex.default)({
|
|
126
|
+
orientation,
|
|
127
|
+
isRtl
|
|
128
|
+
});
|
|
129
|
+
const rovingTabIndexContainerProps = getContainerProps(ref);
|
|
101
130
|
const contextValue = React.useMemo(() => ({
|
|
102
131
|
activeStep,
|
|
103
132
|
alternativeLabel,
|
|
104
133
|
connector,
|
|
105
134
|
nonLinear,
|
|
106
|
-
orientation
|
|
107
|
-
|
|
108
|
-
|
|
135
|
+
orientation,
|
|
136
|
+
totalSteps,
|
|
137
|
+
getRovingTabIndexProps: getItemProps,
|
|
138
|
+
isTabList
|
|
139
|
+
}), [activeStep, alternativeLabel, connector, nonLinear, orientation, totalSteps, getItemProps, isTabList]);
|
|
140
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StepperContext.StepperContextProvider, {
|
|
109
141
|
value: contextValue,
|
|
110
142
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StepperRoot, {
|
|
111
143
|
as: component,
|
|
112
144
|
ownerState: ownerState,
|
|
113
145
|
className: (0, _clsx.default)(classes.root, className),
|
|
114
146
|
ref: ref,
|
|
147
|
+
...(isTabList && {
|
|
148
|
+
role: 'tablist',
|
|
149
|
+
'aria-orientation': orientation,
|
|
150
|
+
...rovingTabIndexContainerProps
|
|
151
|
+
}),
|
|
115
152
|
...other,
|
|
116
153
|
children: steps
|
|
117
154
|
})
|