@mui/material 9.0.0 → 9.1.0

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.
Files changed (278) hide show
  1. package/Accordion/Accordion.d.mts +2 -2
  2. package/Accordion/Accordion.d.ts +2 -2
  3. package/Accordion/Accordion.js +3 -2
  4. package/Accordion/Accordion.mjs +3 -2
  5. package/AccordionSummary/AccordionSummary.js +27 -29
  6. package/AccordionSummary/AccordionSummary.mjs +27 -29
  7. package/Autocomplete/Autocomplete.js +73 -17
  8. package/Autocomplete/Autocomplete.mjs +73 -17
  9. package/Avatar/Avatar.js +4 -0
  10. package/Avatar/Avatar.mjs +4 -0
  11. package/Backdrop/Backdrop.d.mts +2 -2
  12. package/Backdrop/Backdrop.d.ts +2 -2
  13. package/Badge/Badge.js +31 -24
  14. package/Badge/Badge.mjs +31 -24
  15. package/BottomNavigationAction/BottomNavigationAction.js +6 -2
  16. package/BottomNavigationAction/BottomNavigationAction.mjs +6 -2
  17. package/Button/Button.js +19 -6
  18. package/Button/Button.mjs +19 -6
  19. package/ButtonBase/ButtonBase.d.mts +7 -0
  20. package/ButtonBase/ButtonBase.d.ts +7 -0
  21. package/ButtonBase/ButtonBase.js +5 -2
  22. package/ButtonBase/ButtonBase.mjs +5 -2
  23. package/ButtonBase/Ripple.js +21 -11
  24. package/ButtonBase/Ripple.mjs +21 -11
  25. package/ButtonBase/TouchRipple.js +252 -116
  26. package/ButtonBase/TouchRipple.mjs +253 -117
  27. package/CHANGELOG.md +216 -1245
  28. package/CardActionArea/CardActionArea.js +2 -1
  29. package/CardActionArea/CardActionArea.mjs +2 -1
  30. package/Checkbox/Checkbox.js +2 -1
  31. package/Checkbox/Checkbox.mjs +2 -1
  32. package/Chip/Chip.js +2 -1
  33. package/Chip/Chip.mjs +2 -1
  34. package/CircularProgress/CircularProgress.d.mts +12 -2
  35. package/CircularProgress/CircularProgress.d.ts +12 -2
  36. package/CircularProgress/CircularProgress.js +115 -58
  37. package/CircularProgress/CircularProgress.mjs +114 -58
  38. package/ClickAwayListener/ClickAwayListener.js +3 -6
  39. package/ClickAwayListener/ClickAwayListener.mjs +3 -6
  40. package/Collapse/Collapse.d.mts +15 -3
  41. package/Collapse/Collapse.d.ts +15 -3
  42. package/Collapse/Collapse.js +44 -31
  43. package/Collapse/Collapse.mjs +43 -30
  44. package/Dialog/Dialog.d.mts +2 -2
  45. package/Dialog/Dialog.d.ts +2 -2
  46. package/Dialog/Dialog.js +13 -6
  47. package/Dialog/Dialog.mjs +13 -6
  48. package/Drawer/Drawer.d.mts +2 -2
  49. package/Drawer/Drawer.d.ts +2 -2
  50. package/Drawer/Drawer.js +18 -4
  51. package/Drawer/Drawer.mjs +18 -4
  52. package/Fab/Fab.js +9 -2
  53. package/Fab/Fab.mjs +9 -2
  54. package/Fade/Fade.d.mts +15 -2
  55. package/Fade/Fade.d.ts +15 -2
  56. package/Fade/Fade.js +46 -19
  57. package/Fade/Fade.mjs +45 -18
  58. package/FilledInput/FilledInput.d.mts +4 -0
  59. package/FilledInput/FilledInput.d.ts +4 -0
  60. package/FilledInput/FilledInput.js +22 -23
  61. package/FilledInput/FilledInput.mjs +22 -23
  62. package/FormControl/useFormControl.d.mts +12 -2
  63. package/FormControl/useFormControl.d.ts +12 -2
  64. package/FormControl/useFormControl.js +13 -0
  65. package/FormControl/useFormControl.mjs +12 -0
  66. package/FormControlLabel/FormControlLabel.js +5 -8
  67. package/FormControlLabel/FormControlLabel.mjs +5 -8
  68. package/FormGroup/FormGroup.js +2 -5
  69. package/FormGroup/FormGroup.mjs +2 -5
  70. package/FormHelperText/FormHelperText.js +2 -5
  71. package/FormHelperText/FormHelperText.mjs +2 -5
  72. package/FormLabel/FormLabel.js +2 -5
  73. package/FormLabel/FormLabel.mjs +2 -5
  74. package/Grow/Grow.d.mts +15 -2
  75. package/Grow/Grow.d.ts +15 -2
  76. package/Grow/Grow.js +45 -28
  77. package/Grow/Grow.mjs +44 -27
  78. package/IconButton/IconButton.js +3 -9
  79. package/IconButton/IconButton.mjs +3 -9
  80. package/Input/Input.d.mts +4 -0
  81. package/Input/Input.d.ts +4 -0
  82. package/Input/Input.js +9 -2
  83. package/Input/Input.mjs +9 -2
  84. package/InputBase/InputBase.d.mts +2 -1
  85. package/InputBase/InputBase.d.ts +2 -1
  86. package/InputBase/InputBase.js +52 -16
  87. package/InputBase/InputBase.mjs +52 -16
  88. package/InputLabel/InputLabel.js +7 -9
  89. package/InputLabel/InputLabel.mjs +7 -9
  90. package/LICENSE +1 -1
  91. package/LinearProgress/LinearProgress.d.mts +12 -2
  92. package/LinearProgress/LinearProgress.d.ts +12 -2
  93. package/LinearProgress/LinearProgress.js +225 -126
  94. package/LinearProgress/LinearProgress.mjs +224 -126
  95. package/List/List.js +2 -1
  96. package/List/List.mjs +2 -1
  97. package/ListItem/ListItem.js +2 -1
  98. package/ListItem/ListItem.mjs +2 -1
  99. package/ListItemButton/ListItemButton.js +9 -2
  100. package/ListItemButton/ListItemButton.mjs +9 -2
  101. package/Menu/Menu.d.mts +1 -1
  102. package/Menu/Menu.d.ts +1 -1
  103. package/MenuItem/MenuItem.js +7 -1
  104. package/MenuItem/MenuItem.mjs +7 -1
  105. package/MenuList/MenuList.js +2 -1
  106. package/MenuList/MenuList.mjs +2 -1
  107. package/MobileStepper/MobileStepper.js +2 -1
  108. package/MobileStepper/MobileStepper.mjs +2 -1
  109. package/NativeSelect/NativeSelect.js +2 -5
  110. package/NativeSelect/NativeSelect.mjs +2 -5
  111. package/OutlinedInput/NotchedOutline.js +4 -3
  112. package/OutlinedInput/NotchedOutline.mjs +4 -3
  113. package/OutlinedInput/OutlinedInput.js +13 -23
  114. package/OutlinedInput/OutlinedInput.mjs +13 -23
  115. package/PaginationItem/PaginationItem.js +2 -1
  116. package/PaginationItem/PaginationItem.mjs +2 -1
  117. package/Paper/Paper.js +2 -1
  118. package/Paper/Paper.mjs +2 -1
  119. package/PigmentContainer/PigmentContainer.js +0 -1
  120. package/PigmentContainer/PigmentContainer.mjs +0 -1
  121. package/Popover/Popover.d.mts +1 -1
  122. package/Popover/Popover.d.ts +1 -1
  123. package/Popper/BasePopper.js +23 -1
  124. package/Popper/BasePopper.mjs +23 -1
  125. package/README.md +3 -2
  126. package/Radio/RadioButtonIcon.js +3 -2
  127. package/Radio/RadioButtonIcon.mjs +3 -2
  128. package/Rating/Rating.js +2 -1
  129. package/Rating/Rating.mjs +2 -1
  130. package/Select/Select.js +2 -5
  131. package/Select/Select.mjs +2 -5
  132. package/Select/SelectInput.js +276 -24
  133. package/Select/SelectInput.mjs +276 -24
  134. package/Select/utils/closedTypeahead.js +73 -0
  135. package/Select/utils/closedTypeahead.mjs +63 -0
  136. package/Skeleton/Skeleton.js +22 -2
  137. package/Skeleton/Skeleton.mjs +22 -2
  138. package/Slide/Slide.d.mts +15 -2
  139. package/Slide/Slide.d.ts +15 -2
  140. package/Slide/Slide.js +97 -47
  141. package/Slide/Slide.mjs +97 -47
  142. package/Slider/Slider.js +14 -4
  143. package/Slider/Slider.mjs +14 -4
  144. package/Slider/useSlider.js +4 -3
  145. package/Slider/useSlider.mjs +4 -3
  146. package/Snackbar/Snackbar.d.mts +2 -2
  147. package/Snackbar/Snackbar.d.ts +2 -2
  148. package/SpeedDial/SpeedDial.d.mts +1 -1
  149. package/SpeedDial/SpeedDial.d.ts +1 -1
  150. package/SpeedDial/SpeedDial.js +6 -2
  151. package/SpeedDial/SpeedDial.mjs +6 -2
  152. package/SpeedDialAction/SpeedDialAction.js +11 -2
  153. package/SpeedDialAction/SpeedDialAction.mjs +12 -3
  154. package/SpeedDialIcon/SpeedDialIcon.js +40 -37
  155. package/SpeedDialIcon/SpeedDialIcon.mjs +40 -37
  156. package/Step/Step.js +47 -15
  157. package/Step/Step.mjs +47 -15
  158. package/StepButton/StepButton.js +9 -3
  159. package/StepButton/StepButton.mjs +9 -3
  160. package/StepConnector/StepConnector.js +10 -0
  161. package/StepConnector/StepConnector.mjs +10 -0
  162. package/StepContent/StepContent.d.mts +2 -2
  163. package/StepContent/StepContent.d.ts +2 -2
  164. package/StepContent/StepContent.js +26 -2
  165. package/StepContent/StepContent.mjs +26 -2
  166. package/StepIcon/StepIcon.js +2 -1
  167. package/StepIcon/StepIcon.mjs +2 -1
  168. package/StepLabel/StepLabel.js +52 -7
  169. package/StepLabel/StepLabel.mjs +52 -7
  170. package/Stepper/Stepper.d.mts +2 -0
  171. package/Stepper/Stepper.d.ts +2 -0
  172. package/Stepper/Stepper.js +18 -0
  173. package/Stepper/Stepper.mjs +18 -0
  174. package/SvgIcon/SvgIcon.js +2 -1
  175. package/SvgIcon/SvgIcon.mjs +2 -1
  176. package/SwipeableDrawer/SwipeableDrawer.js +21 -6
  177. package/SwipeableDrawer/SwipeableDrawer.mjs +21 -6
  178. package/Switch/Switch.js +10 -8
  179. package/Switch/Switch.mjs +10 -8
  180. package/TableSortLabel/TableSortLabel.js +2 -1
  181. package/TableSortLabel/TableSortLabel.mjs +2 -1
  182. package/Tabs/ScrollbarSize.js +2 -1
  183. package/Tabs/ScrollbarSize.mjs +2 -1
  184. package/Tabs/Tabs.js +16 -4
  185. package/Tabs/Tabs.mjs +16 -4
  186. package/Tooltip/Tooltip.d.mts +2 -2
  187. package/Tooltip/Tooltip.d.ts +2 -2
  188. package/Tooltip/Tooltip.js +29 -108
  189. package/Tooltip/Tooltip.mjs +29 -108
  190. package/Unstable_TrapFocus/FocusTrap.js +60 -22
  191. package/Unstable_TrapFocus/FocusTrap.mjs +60 -22
  192. package/Zoom/Zoom.d.mts +15 -2
  193. package/Zoom/Zoom.d.ts +15 -2
  194. package/Zoom/Zoom.js +43 -16
  195. package/Zoom/Zoom.mjs +42 -15
  196. package/index.js +1 -1
  197. package/index.mjs +1 -1
  198. package/internal/Transition.d.mts +34 -0
  199. package/internal/Transition.d.ts +34 -0
  200. package/internal/Transition.js +444 -0
  201. package/internal/Transition.mjs +436 -0
  202. package/internal/react-transition-group.d.mts +8 -0
  203. package/internal/react-transition-group.d.ts +8 -0
  204. package/package.json +50 -50
  205. package/styles/createMotion.d.mts +8 -0
  206. package/styles/createMotion.d.ts +8 -0
  207. package/styles/createMotion.js +13 -0
  208. package/styles/createMotion.mjs +7 -0
  209. package/styles/createThemeFoundation.d.mts +2 -0
  210. package/styles/createThemeFoundation.d.ts +2 -0
  211. package/styles/createThemeNoVars.d.mts +3 -0
  212. package/styles/createThemeNoVars.d.ts +3 -0
  213. package/styles/createThemeNoVars.js +5 -0
  214. package/styles/createThemeNoVars.mjs +5 -0
  215. package/styles/createTransitions.d.mts +6 -2
  216. package/styles/createTransitions.d.ts +6 -2
  217. package/styles/createTransitions.js +12 -4
  218. package/styles/createTransitions.mjs +12 -4
  219. package/styles/enhanceHighContrast.d.mts +70 -0
  220. package/styles/enhanceHighContrast.d.ts +70 -0
  221. package/styles/enhanceHighContrast.js +502 -0
  222. package/styles/enhanceHighContrast.mjs +495 -0
  223. package/styles/index.d.mts +2 -0
  224. package/styles/index.d.ts +2 -0
  225. package/styles/index.js +8 -0
  226. package/styles/index.mjs +1 -0
  227. package/styles/reducedMotion.d.mts +7 -0
  228. package/styles/reducedMotion.d.ts +7 -0
  229. package/styles/reducedMotion.js +21 -0
  230. package/styles/reducedMotion.mjs +14 -0
  231. package/styles/responsiveFontSizes.js +19 -8
  232. package/styles/responsiveFontSizes.mjs +19 -8
  233. package/styles/shouldSkipGeneratingVar.js +1 -1
  234. package/styles/shouldSkipGeneratingVar.mjs +1 -1
  235. package/styles/stringifyTheme.js +1 -0
  236. package/styles/stringifyTheme.mjs +1 -0
  237. package/styles/useThemeProps.d.mts +3 -3
  238. package/styles/useThemeProps.d.ts +3 -3
  239. package/transitions/index.d.mts +1 -1
  240. package/transitions/index.d.ts +1 -1
  241. package/transitions/index.js +0 -11
  242. package/transitions/index.mjs +1 -1
  243. package/transitions/transition.d.mts +1 -12
  244. package/transitions/transition.d.ts +1 -12
  245. package/transitions/types.d.mts +73 -0
  246. package/transitions/types.d.ts +73 -0
  247. package/transitions/useReducedMotion.d.mts +14 -0
  248. package/transitions/useReducedMotion.d.ts +14 -0
  249. package/transitions/useReducedMotion.js +117 -0
  250. package/transitions/useReducedMotion.mjs +110 -0
  251. package/transitions/utils.d.mts +51 -2
  252. package/transitions/utils.d.ts +51 -2
  253. package/transitions/utils.js +97 -4
  254. package/transitions/utils.mjs +94 -4
  255. package/useAutocomplete/useAutocomplete.d.mts +12 -6
  256. package/useAutocomplete/useAutocomplete.d.ts +12 -6
  257. package/useAutocomplete/useAutocomplete.js +230 -55
  258. package/useAutocomplete/useAutocomplete.mjs +230 -55
  259. package/utils/contains.d.mts +2 -0
  260. package/utils/contains.d.ts +2 -0
  261. package/utils/contains.js +9 -0
  262. package/utils/contains.mjs +2 -0
  263. package/utils/focusable.d.mts +7 -0
  264. package/utils/focusable.d.ts +7 -0
  265. package/utils/focusable.js +20 -0
  266. package/utils/focusable.mjs +13 -0
  267. package/utils/getEventTarget.d.mts +2 -0
  268. package/utils/getEventTarget.d.ts +2 -0
  269. package/utils/getEventTarget.js +9 -0
  270. package/utils/getEventTarget.mjs +2 -0
  271. package/utils/mergeSlotProps.js +2 -8
  272. package/utils/mergeSlotProps.mjs +1 -8
  273. package/version/index.js +2 -2
  274. package/version/index.mjs +2 -2
  275. package/FormControl/formControlState.js +0 -21
  276. package/FormControl/formControlState.mjs +0 -15
  277. /package/transitions/{transition.js → types.js} +0 -0
  278. /package/transitions/{transition.mjs → types.mjs} +0 -0
@@ -4,7 +4,7 @@ import { PopperProps } from "../Popper/index.js";
4
4
  import { Theme } from "../styles/index.js";
5
5
  import { InternalStandardProps as StandardProps } from "../internal/index.js";
6
6
  import { CreateSlotsAndSlotProps, SlotProps } from "../utils/types.js";
7
- import { TransitionProps } from "../transitions/transition.js";
7
+ import { TransitionProps } from "../transitions/types.js";
8
8
  import { TooltipClasses } from "./tooltipClasses.js";
9
9
  export interface TooltipPopperSlotPropsOverrides {}
10
10
  export interface TooltipTransitionSlotPropsOverrides {}
@@ -18,7 +18,7 @@ export interface TooltipSlots {
18
18
  popper: React.ElementType;
19
19
  /**
20
20
  * The component used for the transition.
21
- * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
21
+ * [Follow this guide](/material-ui/transitions/#transition-slots) to learn more about the requirements for this component.
22
22
  * @default Grow
23
23
  */
24
24
  transition: React.ElementType;
@@ -14,7 +14,6 @@ var _clsx = _interopRequireDefault(require("clsx"));
14
14
  var _useTimeout = _interopRequireWildcard(require("@mui/utils/useTimeout"));
15
15
  var _elementAcceptingRef = _interopRequireDefault(require("@mui/utils/elementAcceptingRef"));
16
16
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
17
- var _RtlProvider = require("@mui/system/RtlProvider");
18
17
  var _isFocusVisible = _interopRequireDefault(require("@mui/utils/isFocusVisible"));
19
18
  var _getReactElementRef = _interopRequireDefault(require("@mui/utils/getReactElementRef"));
20
19
  var _zeroStyled = require("../zero-styled");
@@ -64,17 +63,11 @@ const TooltipPopper = (0, _zeroStyled.styled)(_Popper.default, {
64
63
  pointerEvents: 'none',
65
64
  variants: [{
66
65
  props: ({
67
- ownerState
68
- }) => !ownerState.disableInteractive,
69
- style: {
70
- pointerEvents: 'auto'
71
- }
72
- }, {
73
- props: ({
66
+ ownerState,
74
67
  open
75
- }) => !open,
68
+ }) => open && !ownerState.disableInteractive,
76
69
  style: {
77
- pointerEvents: 'none'
70
+ pointerEvents: 'auto'
78
71
  }
79
72
  }, {
80
73
  props: ({
@@ -98,6 +91,8 @@ const TooltipPopper = (0, _zeroStyled.styled)(_Popper.default, {
98
91
  [`&[data-popper-placement*="right"] .${_tooltipClasses.default.arrow}`]: {
99
92
  height: '1em',
100
93
  width: '0.71em',
94
+ insetInlineStart: 0,
95
+ marginInlineStart: '-0.71em',
101
96
  '&::before': {
102
97
  transformOrigin: '100% 100%'
103
98
  }
@@ -105,51 +100,13 @@ const TooltipPopper = (0, _zeroStyled.styled)(_Popper.default, {
105
100
  [`&[data-popper-placement*="left"] .${_tooltipClasses.default.arrow}`]: {
106
101
  height: '1em',
107
102
  width: '0.71em',
103
+ insetInlineEnd: 0,
104
+ marginInlineEnd: '-0.71em',
108
105
  '&::before': {
109
106
  transformOrigin: '0 0'
110
107
  }
111
108
  }
112
109
  }
113
- }, {
114
- props: ({
115
- ownerState
116
- }) => ownerState.arrow && !ownerState.isRtl,
117
- style: {
118
- [`&[data-popper-placement*="right"] .${_tooltipClasses.default.arrow}`]: {
119
- left: 0,
120
- marginLeft: '-0.71em'
121
- }
122
- }
123
- }, {
124
- props: ({
125
- ownerState
126
- }) => ownerState.arrow && !!ownerState.isRtl,
127
- style: {
128
- [`&[data-popper-placement*="right"] .${_tooltipClasses.default.arrow}`]: {
129
- right: 0,
130
- marginRight: '-0.71em'
131
- }
132
- }
133
- }, {
134
- props: ({
135
- ownerState
136
- }) => ownerState.arrow && !ownerState.isRtl,
137
- style: {
138
- [`&[data-popper-placement*="left"] .${_tooltipClasses.default.arrow}`]: {
139
- right: 0,
140
- marginRight: '-0.71em'
141
- }
142
- }
143
- }, {
144
- props: ({
145
- ownerState
146
- }) => ownerState.arrow && !!ownerState.isRtl,
147
- style: {
148
- [`&[data-popper-placement*="left"] .${_tooltipClasses.default.arrow}`]: {
149
- left: 0,
150
- marginLeft: '-0.71em'
151
- }
152
- }
153
110
  }]
154
111
  })));
155
112
  const TooltipTooltip = (0, _zeroStyled.styled)('div', {
@@ -175,10 +132,12 @@ const TooltipTooltip = (0, _zeroStyled.styled)('div', {
175
132
  wordWrap: 'break-word',
176
133
  fontWeight: theme.typography.fontWeightMedium,
177
134
  [`.${_tooltipClasses.default.popper}[data-popper-placement*="left"] &`]: {
178
- transformOrigin: 'right center'
135
+ transformOrigin: 'right center',
136
+ marginInlineEnd: '14px'
179
137
  },
180
138
  [`.${_tooltipClasses.default.popper}[data-popper-placement*="right"] &`]: {
181
- transformOrigin: 'left center'
139
+ transformOrigin: 'left center',
140
+ marginInlineStart: '14px'
182
141
  },
183
142
  [`.${_tooltipClasses.default.popper}[data-popper-placement*="top"] &`]: {
184
143
  transformOrigin: 'center bottom',
@@ -194,7 +153,7 @@ const TooltipTooltip = (0, _zeroStyled.styled)('div', {
194
153
  }) => ownerState.arrow,
195
154
  style: {
196
155
  position: 'relative',
197
- margin: 0
156
+ marginBlock: 0
198
157
  }
199
158
  }, {
200
159
  props: ({
@@ -209,65 +168,17 @@ const TooltipTooltip = (0, _zeroStyled.styled)('div', {
209
168
  }, {
210
169
  props: ({
211
170
  ownerState
212
- }) => !ownerState.isRtl,
213
- style: {
214
- [`.${_tooltipClasses.default.popper}[data-popper-placement*="left"] &`]: {
215
- marginRight: '14px'
216
- },
217
- [`.${_tooltipClasses.default.popper}[data-popper-placement*="right"] &`]: {
218
- marginLeft: '14px'
219
- }
220
- }
221
- }, {
222
- props: ({
223
- ownerState
224
- }) => !ownerState.isRtl && ownerState.touch,
225
- style: {
226
- [`.${_tooltipClasses.default.popper}[data-popper-placement*="left"] &`]: {
227
- marginRight: '24px'
228
- },
229
- [`.${_tooltipClasses.default.popper}[data-popper-placement*="right"] &`]: {
230
- marginLeft: '24px'
231
- }
232
- }
233
- }, {
234
- props: ({
235
- ownerState
236
- }) => !!ownerState.isRtl,
171
+ }) => ownerState.touch,
237
172
  style: {
238
173
  [`.${_tooltipClasses.default.popper}[data-popper-placement*="left"] &`]: {
239
- marginLeft: '14px'
174
+ marginInlineEnd: '24px'
240
175
  },
241
176
  [`.${_tooltipClasses.default.popper}[data-popper-placement*="right"] &`]: {
242
- marginRight: '14px'
243
- }
244
- }
245
- }, {
246
- props: ({
247
- ownerState
248
- }) => !!ownerState.isRtl && ownerState.touch,
249
- style: {
250
- [`.${_tooltipClasses.default.popper}[data-popper-placement*="left"] &`]: {
251
- marginLeft: '24px'
177
+ marginInlineStart: '24px'
252
178
  },
253
- [`.${_tooltipClasses.default.popper}[data-popper-placement*="right"] &`]: {
254
- marginRight: '24px'
255
- }
256
- }
257
- }, {
258
- props: ({
259
- ownerState
260
- }) => ownerState.touch,
261
- style: {
262
179
  [`.${_tooltipClasses.default.popper}[data-popper-placement*="top"] &`]: {
263
180
  marginBottom: '24px'
264
- }
265
- }
266
- }, {
267
- props: ({
268
- ownerState
269
- }) => ownerState.touch,
270
- style: {
181
+ },
271
182
  [`.${_tooltipClasses.default.popper}[data-popper-placement*="bottom"] &`]: {
272
183
  marginTop: '24px'
273
184
  }
@@ -350,7 +261,6 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
350
261
  children: childrenProp
351
262
  });
352
263
  const theme = (0, _zeroStyled.useTheme)();
353
- const isRtl = (0, _RtlProvider.useRtl)();
354
264
  const [childNode, setChildNode] = React.useState();
355
265
  const [arrowRef, setArrowRef] = React.useState(null);
356
266
  const ignoreNonTouchEvents = React.useRef(false);
@@ -420,6 +330,9 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
420
330
  });
421
331
  });
422
332
  const handleMouseOver = event => {
333
+ if (childNode?.disabled) {
334
+ return;
335
+ }
423
336
  if (ignoreNonTouchEvents.current && event.type !== 'touchstart') {
424
337
  return;
425
338
  }
@@ -450,7 +363,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
450
363
  const handleBlur = event => {
451
364
  // Needed for https://github.com/mui/material-ui/issues/45373
452
365
  const target = event?.target ?? childNode;
453
- if (!target || !(0, _isFocusVisible.default)(target)) {
366
+ if (!target || target.disabled || !(0, _isFocusVisible.default)(target)) {
454
367
  setChildIsFocusVisible(false);
455
368
 
456
369
  // InputBase can call onBlur() without an event when the input becomes disabled.
@@ -478,6 +391,15 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
478
391
  setChildNode(event.currentTarget);
479
392
  }
480
393
  if ((0, _isFocusVisible.default)(event.target)) {
394
+ // Workaround for https://github.com/facebook/react/issues/9142.
395
+ // React does not fire blur when a focused element becomes disabled.
396
+ const handleNativeBlur = blurEvent => {
397
+ if (blurEvent.target.disabled) {
398
+ handleBlur(blurEvent);
399
+ }
400
+ blurEvent.target.removeEventListener('blur', handleNativeBlur);
401
+ };
402
+ event.target.addEventListener('blur', handleNativeBlur);
481
403
  setChildIsFocusVisible(true);
482
404
  handleMouseOver(event);
483
405
  }
@@ -609,7 +531,6 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
609
531
  }
610
532
  const ownerState = {
611
533
  ...props,
612
- isRtl,
613
534
  arrow,
614
535
  disableInteractive,
615
536
  placement,
@@ -6,7 +6,6 @@ import clsx from 'clsx';
6
6
  import useTimeout, { Timeout } from '@mui/utils/useTimeout';
7
7
  import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
8
8
  import composeClasses from '@mui/utils/composeClasses';
9
- import { useRtl } from '@mui/system/RtlProvider';
10
9
  import isFocusVisible from '@mui/utils/isFocusVisible';
11
10
  import getReactElementRef from '@mui/utils/getReactElementRef';
12
11
  import { styled, useTheme } from "../zero-styled/index.mjs";
@@ -56,17 +55,11 @@ const TooltipPopper = styled(Popper, {
56
55
  pointerEvents: 'none',
57
56
  variants: [{
58
57
  props: ({
59
- ownerState
60
- }) => !ownerState.disableInteractive,
61
- style: {
62
- pointerEvents: 'auto'
63
- }
64
- }, {
65
- props: ({
58
+ ownerState,
66
59
  open
67
- }) => !open,
60
+ }) => open && !ownerState.disableInteractive,
68
61
  style: {
69
- pointerEvents: 'none'
62
+ pointerEvents: 'auto'
70
63
  }
71
64
  }, {
72
65
  props: ({
@@ -90,6 +83,8 @@ const TooltipPopper = styled(Popper, {
90
83
  [`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]: {
91
84
  height: '1em',
92
85
  width: '0.71em',
86
+ insetInlineStart: 0,
87
+ marginInlineStart: '-0.71em',
93
88
  '&::before': {
94
89
  transformOrigin: '100% 100%'
95
90
  }
@@ -97,51 +92,13 @@ const TooltipPopper = styled(Popper, {
97
92
  [`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]: {
98
93
  height: '1em',
99
94
  width: '0.71em',
95
+ insetInlineEnd: 0,
96
+ marginInlineEnd: '-0.71em',
100
97
  '&::before': {
101
98
  transformOrigin: '0 0'
102
99
  }
103
100
  }
104
101
  }
105
- }, {
106
- props: ({
107
- ownerState
108
- }) => ownerState.arrow && !ownerState.isRtl,
109
- style: {
110
- [`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]: {
111
- left: 0,
112
- marginLeft: '-0.71em'
113
- }
114
- }
115
- }, {
116
- props: ({
117
- ownerState
118
- }) => ownerState.arrow && !!ownerState.isRtl,
119
- style: {
120
- [`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]: {
121
- right: 0,
122
- marginRight: '-0.71em'
123
- }
124
- }
125
- }, {
126
- props: ({
127
- ownerState
128
- }) => ownerState.arrow && !ownerState.isRtl,
129
- style: {
130
- [`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]: {
131
- right: 0,
132
- marginRight: '-0.71em'
133
- }
134
- }
135
- }, {
136
- props: ({
137
- ownerState
138
- }) => ownerState.arrow && !!ownerState.isRtl,
139
- style: {
140
- [`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]: {
141
- left: 0,
142
- marginLeft: '-0.71em'
143
- }
144
- }
145
102
  }]
146
103
  })));
147
104
  const TooltipTooltip = styled('div', {
@@ -167,10 +124,12 @@ const TooltipTooltip = styled('div', {
167
124
  wordWrap: 'break-word',
168
125
  fontWeight: theme.typography.fontWeightMedium,
169
126
  [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: {
170
- transformOrigin: 'right center'
127
+ transformOrigin: 'right center',
128
+ marginInlineEnd: '14px'
171
129
  },
172
130
  [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: {
173
- transformOrigin: 'left center'
131
+ transformOrigin: 'left center',
132
+ marginInlineStart: '14px'
174
133
  },
175
134
  [`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]: {
176
135
  transformOrigin: 'center bottom',
@@ -186,7 +145,7 @@ const TooltipTooltip = styled('div', {
186
145
  }) => ownerState.arrow,
187
146
  style: {
188
147
  position: 'relative',
189
- margin: 0
148
+ marginBlock: 0
190
149
  }
191
150
  }, {
192
151
  props: ({
@@ -201,65 +160,17 @@ const TooltipTooltip = styled('div', {
201
160
  }, {
202
161
  props: ({
203
162
  ownerState
204
- }) => !ownerState.isRtl,
205
- style: {
206
- [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: {
207
- marginRight: '14px'
208
- },
209
- [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: {
210
- marginLeft: '14px'
211
- }
212
- }
213
- }, {
214
- props: ({
215
- ownerState
216
- }) => !ownerState.isRtl && ownerState.touch,
217
- style: {
218
- [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: {
219
- marginRight: '24px'
220
- },
221
- [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: {
222
- marginLeft: '24px'
223
- }
224
- }
225
- }, {
226
- props: ({
227
- ownerState
228
- }) => !!ownerState.isRtl,
163
+ }) => ownerState.touch,
229
164
  style: {
230
165
  [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: {
231
- marginLeft: '14px'
166
+ marginInlineEnd: '24px'
232
167
  },
233
168
  [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: {
234
- marginRight: '14px'
235
- }
236
- }
237
- }, {
238
- props: ({
239
- ownerState
240
- }) => !!ownerState.isRtl && ownerState.touch,
241
- style: {
242
- [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: {
243
- marginLeft: '24px'
169
+ marginInlineStart: '24px'
244
170
  },
245
- [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: {
246
- marginRight: '24px'
247
- }
248
- }
249
- }, {
250
- props: ({
251
- ownerState
252
- }) => ownerState.touch,
253
- style: {
254
171
  [`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]: {
255
172
  marginBottom: '24px'
256
- }
257
- }
258
- }, {
259
- props: ({
260
- ownerState
261
- }) => ownerState.touch,
262
- style: {
173
+ },
263
174
  [`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]: {
264
175
  marginTop: '24px'
265
176
  }
@@ -342,7 +253,6 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
342
253
  children: childrenProp
343
254
  });
344
255
  const theme = useTheme();
345
- const isRtl = useRtl();
346
256
  const [childNode, setChildNode] = React.useState();
347
257
  const [arrowRef, setArrowRef] = React.useState(null);
348
258
  const ignoreNonTouchEvents = React.useRef(false);
@@ -412,6 +322,9 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
412
322
  });
413
323
  });
414
324
  const handleMouseOver = event => {
325
+ if (childNode?.disabled) {
326
+ return;
327
+ }
415
328
  if (ignoreNonTouchEvents.current && event.type !== 'touchstart') {
416
329
  return;
417
330
  }
@@ -442,7 +355,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
442
355
  const handleBlur = event => {
443
356
  // Needed for https://github.com/mui/material-ui/issues/45373
444
357
  const target = event?.target ?? childNode;
445
- if (!target || !isFocusVisible(target)) {
358
+ if (!target || target.disabled || !isFocusVisible(target)) {
446
359
  setChildIsFocusVisible(false);
447
360
 
448
361
  // InputBase can call onBlur() without an event when the input becomes disabled.
@@ -470,6 +383,15 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
470
383
  setChildNode(event.currentTarget);
471
384
  }
472
385
  if (isFocusVisible(event.target)) {
386
+ // Workaround for https://github.com/facebook/react/issues/9142.
387
+ // React does not fire blur when a focused element becomes disabled.
388
+ const handleNativeBlur = blurEvent => {
389
+ if (blurEvent.target.disabled) {
390
+ handleBlur(blurEvent);
391
+ }
392
+ blurEvent.target.removeEventListener('blur', handleNativeBlur);
393
+ };
394
+ event.target.addEventListener('blur', handleNativeBlur);
473
395
  setChildIsFocusVisible(true);
474
396
  handleMouseOver(event);
475
397
  }
@@ -601,7 +523,6 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
601
523
  }
602
524
  const ownerState = {
603
525
  ...props,
604
- isRtl,
605
526
  arrow,
606
527
  disableInteractive,
607
528
  placement,
@@ -15,7 +15,9 @@ var _ownerDocument = _interopRequireDefault(require("@mui/utils/ownerDocument"))
15
15
  var _getReactElementRef = _interopRequireDefault(require("@mui/utils/getReactElementRef"));
16
16
  var _exactProp = _interopRequireDefault(require("@mui/utils/exactProp"));
17
17
  var _elementAcceptingRef = _interopRequireDefault(require("@mui/utils/elementAcceptingRef"));
18
+ var _contains = _interopRequireDefault(require("../utils/contains"));
18
19
  var _getActiveElement = _interopRequireDefault(require("../utils/getActiveElement"));
20
+ var _focusable = require("../utils/focusable");
19
21
  var _jsxRuntime = require("react/jsx-runtime");
20
22
  // Inspired by https://github.com/focus-trap/tabbable
21
23
  const candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'].join(',');
@@ -114,34 +116,36 @@ function FocusTrap(props) {
114
116
  activated.current = !disableAutoFocus;
115
117
  }, [disableAutoFocus, open]);
116
118
  React.useEffect(() => {
119
+ // Reset on every mount — React 18 Strict Mode double-mounts leave this
120
+ // stuck at `true` after the cleanup of the previous mount set it.
121
+ ignoreNextEnforceFocus.current = false;
122
+
117
123
  // We might render an empty child.
118
124
  if (!open || !rootRef.current) {
119
125
  return;
120
126
  }
121
127
  const doc = (0, _ownerDocument.default)(rootRef.current);
122
128
  const activeElement = (0, _getActiveElement.default)(doc);
123
- if (!rootRef.current.contains(activeElement)) {
124
- if (!rootRef.current.hasAttribute('tabIndex')) {
129
+
130
+ // Prefer the explicitly marked focusable element. Fall back to the root
131
+ // element for generic FocusTrap usage.
132
+ const focusTarget = (0, _focusable.getFocusTarget)(rootRef.current) ?? rootRef.current;
133
+ if (!(0, _contains.default)(rootRef.current, activeElement)) {
134
+ if (!focusTarget.hasAttribute('tabIndex')) {
125
135
  if (process.env.NODE_ENV !== 'production') {
126
136
  console.error(['MUI: The modal content node does not accept focus.', 'For the benefit of assistive technologies, ' + 'the tabIndex of the node is being set to "-1".'].join('\n'));
127
137
  }
128
- rootRef.current.setAttribute('tabIndex', '-1');
138
+ focusTarget.setAttribute('tabIndex', '-1');
129
139
  }
130
140
  if (activated.current) {
131
- rootRef.current.focus();
141
+ focusTarget.focus();
132
142
  }
133
143
  }
134
144
  return () => {
135
145
  // restoreLastFocus()
136
- if (!disableRestoreFocus) {
137
- // In IE11 it is possible for document.activeElement to be null resulting
138
- // in nodeToRestore.current being null.
139
- // Not all elements in IE11 have a focus method.
140
- // Once IE11 support is dropped the focus() call can be unconditional.
141
- if (nodeToRestore.current && nodeToRestore.current.focus) {
142
- ignoreNextEnforceFocus.current = true;
143
- nodeToRestore.current.focus();
144
- }
146
+ if (!disableRestoreFocus && nodeToRestore.current) {
147
+ ignoreNextEnforceFocus.current = true;
148
+ nodeToRestore.current.focus();
145
149
  nodeToRestore.current = null;
146
150
  }
147
151
  };
@@ -160,17 +164,51 @@ function FocusTrap(props) {
160
164
  if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== 'Tab') {
161
165
  return;
162
166
  }
167
+ const rootElement = rootRef.current;
163
168
  const activeElement = (0, _getActiveElement.default)(doc);
169
+ if (rootElement === null) {
170
+ return;
171
+ }
172
+ const focusTarget = (0, _focusable.getFocusTarget)(rootElement);
173
+ const isFocusStart = activeElement === rootElement || activeElement === focusTarget;
164
174
 
165
- // Make sure the next tab starts from the right place.
166
- // activeElement refers to the origin.
167
- if (activeElement === rootRef.current && nativeEvent.shiftKey) {
168
- // We need to ignore the next contain as
169
- // it will try to move the focus back to the rootRef element.
170
- ignoreNextEnforceFocus.current = true;
171
- if (sentinelEnd.current) {
172
- sentinelEnd.current.focus();
175
+ // Marked focus targets can be non-tabbable, but should start tabbing
176
+ // from the first/last tabbable child.
177
+ if (isFocusStart) {
178
+ const tabbable = getTabbable(rootElement);
179
+ if (tabbable.length === 0) {
180
+ return;
181
+ }
182
+ nativeEvent.preventDefault();
183
+ if (nativeEvent.shiftKey) {
184
+ tabbable[tabbable.length - 1].focus();
185
+ } else {
186
+ tabbable[0].focus();
187
+ }
188
+ return;
189
+ }
190
+ if ((0, _contains.default)(rootElement, activeElement)) {
191
+ const tabbable = getTabbable(rootElement);
192
+ const currentIndex = tabbable.indexOf(activeElement);
193
+ if (currentIndex === -1) {
194
+ // Leave shadow-root descendants to native tab handling.
195
+ return;
196
+ }
197
+ const hasPositiveTabIndex = tabbable.some(node => getTabIndex(node) > 0);
198
+
199
+ // Positive tabIndex needs the computed order; regular tabIndex=0 can
200
+ // use native tab handling.
201
+ if (!hasPositiveTabIndex) {
202
+ return;
203
+ }
204
+ nativeEvent.preventDefault();
205
+ let nextIndex = 0;
206
+ if (nativeEvent.shiftKey) {
207
+ nextIndex = currentIndex <= 0 ? tabbable.length - 1 : currentIndex - 1;
208
+ } else {
209
+ nextIndex = currentIndex === tabbable.length - 1 ? 0 : currentIndex + 1;
173
210
  }
211
+ tabbable[nextIndex].focus();
174
212
  }
175
213
  };
176
214
  const contain = () => {
@@ -188,7 +226,7 @@ function FocusTrap(props) {
188
226
  }
189
227
 
190
228
  // The focus is already inside
191
- if (rootElement.contains(activeEl)) {
229
+ if ((0, _contains.default)(rootElement, activeEl)) {
192
230
  return;
193
231
  }
194
232