@mui/material 7.0.0 → 7.0.2

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 (794) hide show
  1. package/Accordion/Accordion.d.ts +2 -2
  2. package/Accordion/Accordion.js +2 -2
  3. package/Alert/Alert.d.ts +2 -2
  4. package/Alert/Alert.js +2 -2
  5. package/Autocomplete/Autocomplete.d.ts +40 -10
  6. package/Autocomplete/Autocomplete.js +45 -33
  7. package/Avatar/Avatar.d.ts +1 -1
  8. package/Avatar/Avatar.js +1 -1
  9. package/AvatarGroup/AvatarGroup.d.ts +2 -2
  10. package/AvatarGroup/AvatarGroup.js +11 -3
  11. package/Backdrop/Backdrop.d.ts +3 -3
  12. package/Backdrop/Backdrop.js +3 -3
  13. package/Badge/Badge.d.ts +2 -2
  14. package/Badge/Badge.js +2 -2
  15. package/Button/Button.js +1 -1
  16. package/CHANGELOG.md +100 -0
  17. package/CardHeader/CardHeader.d.ts +2 -2
  18. package/CardHeader/CardHeader.js +2 -2
  19. package/Checkbox/Checkbox.js +1 -1
  20. package/Dialog/Dialog.d.ts +3 -3
  21. package/Dialog/Dialog.js +3 -3
  22. package/Dialog/dialogClasses.d.ts +6 -2
  23. package/Drawer/Drawer.d.ts +2 -2
  24. package/Drawer/Drawer.js +2 -2
  25. package/Fab/Fab.js +1 -1
  26. package/FilledInput/FilledInput.js +2 -2
  27. package/FormControlLabel/FormControlLabel.d.ts +1 -1
  28. package/FormControlLabel/FormControlLabel.js +1 -1
  29. package/IconButton/IconButton.js +1 -1
  30. package/Input/Input.js +2 -2
  31. package/InputBase/InputBase.d.ts +2 -2
  32. package/InputBase/InputBase.js +2 -2
  33. package/ListItem/ListItem.d.ts +4 -4
  34. package/ListItem/ListItem.js +6 -6
  35. package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +1 -1
  36. package/ListItemSecondaryAction/ListItemSecondaryAction.js +1 -1
  37. package/ListItemText/ListItemText.d.ts +2 -2
  38. package/ListItemText/ListItemText.js +2 -2
  39. package/Menu/Menu.d.ts +2 -2
  40. package/Menu/Menu.js +2 -2
  41. package/MobileStepper/MobileStepper.d.ts +1 -1
  42. package/MobileStepper/MobileStepper.js +1 -1
  43. package/Modal/Modal.d.ts +2 -2
  44. package/Modal/Modal.js +2 -2
  45. package/OutlinedInput/OutlinedInput.js +1 -1
  46. package/PaginationItem/PaginationItem.d.ts +1 -1
  47. package/PaginationItem/PaginationItem.js +1 -1
  48. package/Popover/Popover.d.ts +5 -5
  49. package/Popover/Popover.js +5 -5
  50. package/Popper/Popper.d.ts +2 -2
  51. package/Popper/Popper.js +2 -2
  52. package/Radio/Radio.js +2 -2
  53. package/Rating/Rating.d.ts +1 -1
  54. package/Rating/Rating.js +1 -1
  55. package/Slider/Slider.d.ts +2 -2
  56. package/Slider/Slider.js +2 -2
  57. package/Snackbar/Snackbar.d.ts +4 -4
  58. package/Snackbar/Snackbar.js +4 -4
  59. package/SpeedDial/SpeedDial.d.ts +2 -2
  60. package/SpeedDial/SpeedDial.js +2 -2
  61. package/SpeedDialAction/SpeedDialAction.d.ts +5 -5
  62. package/SpeedDialAction/SpeedDialAction.js +5 -5
  63. package/StepContent/StepContent.d.ts +2 -2
  64. package/StepContent/StepContent.js +2 -2
  65. package/StepLabel/StepLabel.d.ts +3 -3
  66. package/StepLabel/StepLabel.js +3 -3
  67. package/SvgIcon/SvgIcon.d.ts +1 -1
  68. package/SvgIcon/SvgIcon.js +1 -1
  69. package/SwipeableDrawer/SwipeableDrawer.d.ts +1 -1
  70. package/SwipeableDrawer/SwipeableDrawer.js +1 -1
  71. package/Switch/Switch.js +2 -2
  72. package/Tabs/Tabs.d.ts +3 -3
  73. package/Tabs/Tabs.js +3 -3
  74. package/TextField/TextField.d.ts +7 -7
  75. package/TextField/TextField.js +5 -5
  76. package/Tooltip/Tooltip.d.ts +7 -7
  77. package/Tooltip/Tooltip.js +6 -6
  78. package/Typography/Typography.d.ts +1 -1
  79. package/Typography/Typography.js +1 -1
  80. package/esm/Accordion/Accordion.d.ts +2 -2
  81. package/esm/Accordion/Accordion.js +2 -2
  82. package/esm/Alert/Alert.d.ts +2 -2
  83. package/esm/Alert/Alert.js +2 -2
  84. package/esm/Autocomplete/Autocomplete.d.ts +40 -10
  85. package/esm/Autocomplete/Autocomplete.js +45 -33
  86. package/esm/Avatar/Avatar.d.ts +1 -1
  87. package/esm/Avatar/Avatar.js +1 -1
  88. package/esm/AvatarGroup/AvatarGroup.d.ts +2 -2
  89. package/esm/AvatarGroup/AvatarGroup.js +11 -3
  90. package/esm/Backdrop/Backdrop.d.ts +3 -3
  91. package/esm/Backdrop/Backdrop.js +3 -3
  92. package/esm/Badge/Badge.d.ts +2 -2
  93. package/esm/Badge/Badge.js +2 -2
  94. package/esm/Button/Button.js +1 -1
  95. package/esm/CardHeader/CardHeader.d.ts +2 -2
  96. package/esm/CardHeader/CardHeader.js +2 -2
  97. package/esm/Checkbox/Checkbox.js +1 -1
  98. package/esm/Dialog/Dialog.d.ts +3 -3
  99. package/esm/Dialog/Dialog.js +3 -3
  100. package/esm/Dialog/dialogClasses.d.ts +6 -2
  101. package/esm/Drawer/Drawer.d.ts +2 -2
  102. package/esm/Drawer/Drawer.js +2 -2
  103. package/esm/Fab/Fab.js +1 -1
  104. package/esm/FilledInput/FilledInput.js +2 -2
  105. package/esm/FormControlLabel/FormControlLabel.d.ts +1 -1
  106. package/esm/FormControlLabel/FormControlLabel.js +1 -1
  107. package/esm/IconButton/IconButton.js +1 -1
  108. package/esm/Input/Input.js +2 -2
  109. package/esm/InputBase/InputBase.d.ts +2 -2
  110. package/esm/InputBase/InputBase.js +2 -2
  111. package/esm/ListItem/ListItem.d.ts +4 -4
  112. package/esm/ListItem/ListItem.js +6 -6
  113. package/esm/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +1 -1
  114. package/esm/ListItemSecondaryAction/ListItemSecondaryAction.js +1 -1
  115. package/esm/ListItemText/ListItemText.d.ts +2 -2
  116. package/esm/ListItemText/ListItemText.js +2 -2
  117. package/esm/Menu/Menu.d.ts +2 -2
  118. package/esm/Menu/Menu.js +2 -2
  119. package/esm/MobileStepper/MobileStepper.d.ts +1 -1
  120. package/esm/MobileStepper/MobileStepper.js +1 -1
  121. package/esm/Modal/Modal.d.ts +2 -2
  122. package/esm/Modal/Modal.js +2 -2
  123. package/esm/OutlinedInput/OutlinedInput.js +1 -1
  124. package/esm/PaginationItem/PaginationItem.d.ts +1 -1
  125. package/esm/PaginationItem/PaginationItem.js +1 -1
  126. package/esm/Popover/Popover.d.ts +5 -5
  127. package/esm/Popover/Popover.js +5 -5
  128. package/esm/Popper/Popper.d.ts +2 -2
  129. package/esm/Popper/Popper.js +2 -2
  130. package/esm/Radio/Radio.js +2 -2
  131. package/esm/Rating/Rating.d.ts +1 -1
  132. package/esm/Rating/Rating.js +1 -1
  133. package/esm/Slider/Slider.d.ts +2 -2
  134. package/esm/Slider/Slider.js +2 -2
  135. package/esm/Snackbar/Snackbar.d.ts +4 -4
  136. package/esm/Snackbar/Snackbar.js +4 -4
  137. package/esm/SpeedDial/SpeedDial.d.ts +2 -2
  138. package/esm/SpeedDial/SpeedDial.js +2 -2
  139. package/esm/SpeedDialAction/SpeedDialAction.d.ts +5 -5
  140. package/esm/SpeedDialAction/SpeedDialAction.js +5 -5
  141. package/esm/StepContent/StepContent.d.ts +2 -2
  142. package/esm/StepContent/StepContent.js +2 -2
  143. package/esm/StepLabel/StepLabel.d.ts +3 -3
  144. package/esm/StepLabel/StepLabel.js +3 -3
  145. package/esm/SvgIcon/SvgIcon.d.ts +1 -1
  146. package/esm/SvgIcon/SvgIcon.js +1 -1
  147. package/esm/SwipeableDrawer/SwipeableDrawer.d.ts +1 -1
  148. package/esm/SwipeableDrawer/SwipeableDrawer.js +1 -1
  149. package/esm/Switch/Switch.js +2 -2
  150. package/esm/Tabs/Tabs.d.ts +3 -3
  151. package/esm/Tabs/Tabs.js +3 -3
  152. package/esm/TextField/TextField.d.ts +7 -7
  153. package/esm/TextField/TextField.js +5 -5
  154. package/esm/Tooltip/Tooltip.d.ts +7 -7
  155. package/esm/Tooltip/Tooltip.js +6 -6
  156. package/esm/Typography/Typography.d.ts +1 -1
  157. package/esm/Typography/Typography.js +1 -1
  158. package/esm/index.d.ts +0 -1
  159. package/esm/index.js +1 -1
  160. package/esm/internal/SwitchBase.d.ts +2 -2
  161. package/esm/styles/createTypography.d.ts +1 -23
  162. package/esm/styles/cssUtils.d.ts +1 -1
  163. package/esm/styles/index.d.ts +2 -2
  164. package/esm/useAutocomplete/useAutocomplete.d.ts +26 -0
  165. package/esm/useAutocomplete/useAutocomplete.js +88 -42
  166. package/esm/utils/memoTheme.d.ts +1 -1
  167. package/esm/version/index.js +2 -2
  168. package/index.d.ts +0 -1
  169. package/index.js +1 -1
  170. package/internal/SwitchBase.d.ts +2 -2
  171. package/modern/Accordion/Accordion.d.ts +2 -2
  172. package/modern/Alert/Alert.d.ts +2 -2
  173. package/modern/Autocomplete/Autocomplete.d.ts +40 -10
  174. package/modern/Avatar/Avatar.d.ts +1 -1
  175. package/modern/AvatarGroup/AvatarGroup.d.ts +2 -2
  176. package/modern/Backdrop/Backdrop.d.ts +3 -3
  177. package/modern/Badge/Badge.d.ts +2 -2
  178. package/modern/CardHeader/CardHeader.d.ts +2 -2
  179. package/modern/Dialog/Dialog.d.ts +3 -3
  180. package/modern/Dialog/dialogClasses.d.ts +6 -2
  181. package/modern/Drawer/Drawer.d.ts +2 -2
  182. package/modern/FormControlLabel/FormControlLabel.d.ts +1 -1
  183. package/modern/InputBase/InputBase.d.ts +2 -2
  184. package/modern/ListItem/ListItem.d.ts +4 -4
  185. package/modern/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +1 -1
  186. package/modern/ListItemText/ListItemText.d.ts +2 -2
  187. package/modern/Menu/Menu.d.ts +2 -2
  188. package/modern/MobileStepper/MobileStepper.d.ts +1 -1
  189. package/modern/Modal/Modal.d.ts +2 -2
  190. package/modern/PaginationItem/PaginationItem.d.ts +1 -1
  191. package/modern/Popover/Popover.d.ts +5 -5
  192. package/modern/Popper/Popper.d.ts +2 -2
  193. package/modern/Rating/Rating.d.ts +1 -1
  194. package/modern/Slider/Slider.d.ts +2 -2
  195. package/modern/Snackbar/Snackbar.d.ts +4 -4
  196. package/modern/SpeedDial/SpeedDial.d.ts +2 -2
  197. package/modern/SpeedDialAction/SpeedDialAction.d.ts +5 -5
  198. package/modern/StepContent/StepContent.d.ts +2 -2
  199. package/modern/StepLabel/StepLabel.d.ts +3 -3
  200. package/modern/SvgIcon/SvgIcon.d.ts +1 -1
  201. package/modern/SwipeableDrawer/SwipeableDrawer.d.ts +1 -1
  202. package/modern/Tabs/Tabs.d.ts +3 -3
  203. package/modern/TextField/TextField.d.ts +7 -7
  204. package/modern/Tooltip/Tooltip.d.ts +7 -7
  205. package/modern/Typography/Typography.d.ts +1 -1
  206. package/modern/index.d.ts +0 -1
  207. package/modern/internal/SwitchBase.d.ts +2 -2
  208. package/modern/styles/createTypography.d.ts +1 -23
  209. package/modern/styles/cssUtils.d.ts +1 -1
  210. package/modern/styles/index.d.ts +2 -2
  211. package/modern/useAutocomplete/useAutocomplete.d.ts +26 -0
  212. package/modern/utils/memoTheme.d.ts +1 -1
  213. package/package.json +8 -20
  214. package/styles/createTypography.d.ts +1 -23
  215. package/styles/cssUtils.d.ts +1 -1
  216. package/styles/index.d.ts +2 -2
  217. package/useAutocomplete/useAutocomplete.d.ts +26 -0
  218. package/useAutocomplete/useAutocomplete.js +88 -42
  219. package/utils/memoTheme.d.ts +1 -1
  220. package/version/index.js +2 -2
  221. package/modern/Accordion/Accordion.js +0 -328
  222. package/modern/Accordion/AccordionContext.js +0 -13
  223. package/modern/Accordion/accordionClasses.js +0 -7
  224. package/modern/Accordion/index.js +0 -3
  225. package/modern/AccordionActions/AccordionActions.js +0 -93
  226. package/modern/AccordionActions/accordionActionsClasses.js +0 -7
  227. package/modern/AccordionActions/index.js +0 -3
  228. package/modern/AccordionDetails/AccordionDetails.js +0 -70
  229. package/modern/AccordionDetails/accordionDetailsClasses.js +0 -7
  230. package/modern/AccordionDetails/index.js +0 -3
  231. package/modern/AccordionSummary/AccordionSummary.js +0 -250
  232. package/modern/AccordionSummary/accordionSummaryClasses.js +0 -7
  233. package/modern/AccordionSummary/index.js +0 -3
  234. package/modern/Alert/Alert.js +0 -386
  235. package/modern/Alert/alertClasses.js +0 -7
  236. package/modern/Alert/index.js +0 -3
  237. package/modern/AlertTitle/AlertTitle.js +0 -76
  238. package/modern/AlertTitle/alertTitleClasses.js +0 -7
  239. package/modern/AlertTitle/index.js +0 -3
  240. package/modern/AppBar/AppBar.js +0 -227
  241. package/modern/AppBar/appBarClasses.js +0 -7
  242. package/modern/AppBar/index.js +0 -3
  243. package/modern/Autocomplete/Autocomplete.js +0 -1186
  244. package/modern/Autocomplete/autocompleteClasses.js +0 -7
  245. package/modern/Autocomplete/index.js +0 -3
  246. package/modern/Avatar/Avatar.js +0 -299
  247. package/modern/Avatar/avatarClasses.js +0 -7
  248. package/modern/Avatar/index.js +0 -3
  249. package/modern/AvatarGroup/AvatarGroup.js +0 -223
  250. package/modern/AvatarGroup/avatarGroupClasses.js +0 -7
  251. package/modern/AvatarGroup/index.js +0 -3
  252. package/modern/Backdrop/Backdrop.js +0 -205
  253. package/modern/Backdrop/backdropClasses.js +0 -7
  254. package/modern/Backdrop/index.js +0 -3
  255. package/modern/Badge/Badge.js +0 -428
  256. package/modern/Badge/badgeClasses.js +0 -9
  257. package/modern/Badge/index.js +0 -3
  258. package/modern/Badge/useBadge.js +0 -41
  259. package/modern/Badge/useBadge.types.js +0 -1
  260. package/modern/BottomNavigation/BottomNavigation.js +0 -123
  261. package/modern/BottomNavigation/bottomNavigationClasses.js +0 -7
  262. package/modern/BottomNavigation/index.js +0 -3
  263. package/modern/BottomNavigationAction/BottomNavigationAction.js +0 -187
  264. package/modern/BottomNavigationAction/bottomNavigationActionClasses.js +0 -7
  265. package/modern/BottomNavigationAction/index.js +0 -3
  266. package/modern/Box/Box.js +0 -35
  267. package/modern/Box/boxClasses.js +0 -3
  268. package/modern/Box/index.js +0 -3
  269. package/modern/Breadcrumbs/BreadcrumbCollapsed.js +0 -90
  270. package/modern/Breadcrumbs/Breadcrumbs.js +0 -240
  271. package/modern/Breadcrumbs/breadcrumbsClasses.js +0 -7
  272. package/modern/Breadcrumbs/index.js +0 -3
  273. package/modern/Button/Button.js +0 -688
  274. package/modern/Button/buttonClasses.js +0 -7
  275. package/modern/Button/index.js +0 -3
  276. package/modern/ButtonBase/ButtonBase.js +0 -447
  277. package/modern/ButtonBase/Ripple.js +0 -88
  278. package/modern/ButtonBase/TouchRipple.js +0 -324
  279. package/modern/ButtonBase/buttonBaseClasses.js +0 -7
  280. package/modern/ButtonBase/index.js +0 -5
  281. package/modern/ButtonBase/touchRippleClasses.js +0 -7
  282. package/modern/ButtonGroup/ButtonGroup.js +0 -390
  283. package/modern/ButtonGroup/ButtonGroupButtonContext.js +0 -11
  284. package/modern/ButtonGroup/ButtonGroupContext.js +0 -11
  285. package/modern/ButtonGroup/buttonGroupClasses.js +0 -7
  286. package/modern/ButtonGroup/index.js +0 -5
  287. package/modern/Card/Card.js +0 -84
  288. package/modern/Card/cardClasses.js +0 -7
  289. package/modern/Card/index.js +0 -3
  290. package/modern/CardActionArea/CardActionArea.js +0 -117
  291. package/modern/CardActionArea/cardActionAreaClasses.js +0 -7
  292. package/modern/CardActionArea/index.js +0 -3
  293. package/modern/CardActions/CardActions.js +0 -94
  294. package/modern/CardActions/cardActionsClasses.js +0 -7
  295. package/modern/CardActions/index.js +0 -3
  296. package/modern/CardContent/CardContent.js +0 -80
  297. package/modern/CardContent/cardContentClasses.js +0 -7
  298. package/modern/CardContent/index.js +0 -3
  299. package/modern/CardHeader/CardHeader.js +0 -267
  300. package/modern/CardHeader/cardHeaderClasses.js +0 -7
  301. package/modern/CardHeader/index.js +0 -3
  302. package/modern/CardMedia/CardMedia.js +0 -145
  303. package/modern/CardMedia/cardMediaClasses.js +0 -7
  304. package/modern/CardMedia/index.js +0 -3
  305. package/modern/Checkbox/Checkbox.js +0 -280
  306. package/modern/Checkbox/checkboxClasses.js +0 -7
  307. package/modern/Checkbox/index.js +0 -3
  308. package/modern/Chip/Chip.js +0 -576
  309. package/modern/Chip/chipClasses.js +0 -7
  310. package/modern/Chip/index.js +0 -3
  311. package/modern/CircularProgress/CircularProgress.js +0 -285
  312. package/modern/CircularProgress/circularProgressClasses.js +0 -7
  313. package/modern/CircularProgress/index.js +0 -3
  314. package/modern/ClickAwayListener/ClickAwayListener.js +0 -174
  315. package/modern/ClickAwayListener/index.js +0 -1
  316. package/modern/Collapse/Collapse.js +0 -411
  317. package/modern/Collapse/collapseClasses.js +0 -7
  318. package/modern/Collapse/index.js +0 -3
  319. package/modern/Container/Container.js +0 -67
  320. package/modern/Container/containerClasses.js +0 -7
  321. package/modern/Container/index.js +0 -3
  322. package/modern/CssBaseline/CssBaseline.js +0 -161
  323. package/modern/CssBaseline/index.js +0 -1
  324. package/modern/DefaultPropsProvider/DefaultPropsProvider.js +0 -29
  325. package/modern/DefaultPropsProvider/index.js +0 -1
  326. package/modern/Dialog/Dialog.js +0 -513
  327. package/modern/Dialog/DialogContext.js +0 -8
  328. package/modern/Dialog/dialogClasses.js +0 -7
  329. package/modern/Dialog/index.js +0 -3
  330. package/modern/DialogActions/DialogActions.js +0 -96
  331. package/modern/DialogActions/dialogActionsClasses.js +0 -7
  332. package/modern/DialogActions/index.js +0 -3
  333. package/modern/DialogContent/DialogContent.js +0 -109
  334. package/modern/DialogContent/dialogContentClasses.js +0 -7
  335. package/modern/DialogContent/index.js +0 -3
  336. package/modern/DialogContentText/DialogContentText.js +0 -77
  337. package/modern/DialogContentText/dialogContentTextClasses.js +0 -7
  338. package/modern/DialogContentText/index.js +0 -3
  339. package/modern/DialogTitle/DialogTitle.js +0 -81
  340. package/modern/DialogTitle/dialogTitleClasses.js +0 -7
  341. package/modern/DialogTitle/index.js +0 -3
  342. package/modern/Divider/Divider.js +0 -314
  343. package/modern/Divider/dividerClasses.js +0 -7
  344. package/modern/Divider/index.js +0 -3
  345. package/modern/Drawer/Drawer.js +0 -434
  346. package/modern/Drawer/drawerClasses.js +0 -7
  347. package/modern/Drawer/index.js +0 -3
  348. package/modern/Fab/Fab.js +0 -271
  349. package/modern/Fab/fabClasses.js +0 -7
  350. package/modern/Fab/index.js +0 -3
  351. package/modern/Fade/Fade.js +0 -210
  352. package/modern/Fade/index.js +0 -1
  353. package/modern/FilledInput/FilledInput.js +0 -516
  354. package/modern/FilledInput/filledInputClasses.js +0 -11
  355. package/modern/FilledInput/index.js +0 -3
  356. package/modern/FormControl/FormControl.js +0 -305
  357. package/modern/FormControl/FormControlContext.js +0 -11
  358. package/modern/FormControl/formControlClasses.js +0 -7
  359. package/modern/FormControl/formControlState.js +0 -15
  360. package/modern/FormControl/index.js +0 -4
  361. package/modern/FormControl/useFormControl.js +0 -7
  362. package/modern/FormControlLabel/FormControlLabel.js +0 -283
  363. package/modern/FormControlLabel/formControlLabelClasses.js +0 -7
  364. package/modern/FormControlLabel/index.js +0 -3
  365. package/modern/FormGroup/FormGroup.js +0 -108
  366. package/modern/FormGroup/formGroupClasses.js +0 -7
  367. package/modern/FormGroup/index.js +0 -3
  368. package/modern/FormHelperText/FormHelperText.js +0 -186
  369. package/modern/FormHelperText/formHelperTextClasses.js +0 -7
  370. package/modern/FormHelperText/index.js +0 -3
  371. package/modern/FormLabel/FormLabel.js +0 -182
  372. package/modern/FormLabel/formLabelClasses.js +0 -7
  373. package/modern/FormLabel/index.js +0 -4
  374. package/modern/GlobalStyles/GlobalStyles.js +0 -26
  375. package/modern/GlobalStyles/index.js +0 -1
  376. package/modern/Grid/Grid.js +0 -138
  377. package/modern/Grid/gridClasses.js +0 -19
  378. package/modern/Grid/index.js +0 -4
  379. package/modern/GridLegacy/GridLegacy.js +0 -588
  380. package/modern/GridLegacy/GridLegacyContext.js +0 -12
  381. package/modern/GridLegacy/gridLegacyClasses.js +0 -19
  382. package/modern/GridLegacy/index.js +0 -3
  383. package/modern/Grow/Grow.js +0 -262
  384. package/modern/Grow/index.js +0 -1
  385. package/modern/Icon/Icon.js +0 -185
  386. package/modern/Icon/iconClasses.js +0 -7
  387. package/modern/Icon/index.js +0 -3
  388. package/modern/IconButton/IconButton.js +0 -322
  389. package/modern/IconButton/iconButtonClasses.js +0 -7
  390. package/modern/IconButton/index.js +0 -3
  391. package/modern/ImageList/ImageList.js +0 -150
  392. package/modern/ImageList/ImageListContext.js +0 -13
  393. package/modern/ImageList/imageListClasses.js +0 -7
  394. package/modern/ImageList/index.js +0 -3
  395. package/modern/ImageListItem/ImageListItem.js +0 -188
  396. package/modern/ImageListItem/imageListItemClasses.js +0 -7
  397. package/modern/ImageListItem/index.js +0 -3
  398. package/modern/ImageListItemBar/ImageListItemBar.js +0 -253
  399. package/modern/ImageListItemBar/imageListItemBarClasses.js +0 -7
  400. package/modern/ImageListItemBar/index.js +0 -3
  401. package/modern/InitColorSchemeScript/InitColorSchemeScript.js +0 -16
  402. package/modern/InitColorSchemeScript/index.js +0 -1
  403. package/modern/Input/Input.js +0 -361
  404. package/modern/Input/index.js +0 -3
  405. package/modern/Input/inputClasses.js +0 -11
  406. package/modern/InputAdornment/InputAdornment.js +0 -186
  407. package/modern/InputAdornment/index.js +0 -3
  408. package/modern/InputAdornment/inputAdornmentClasses.js +0 -7
  409. package/modern/InputBase/InputBase.js +0 -749
  410. package/modern/InputBase/index.js +0 -3
  411. package/modern/InputBase/inputBaseClasses.js +0 -7
  412. package/modern/InputBase/utils.js +0 -30
  413. package/modern/InputLabel/InputLabel.js +0 -283
  414. package/modern/InputLabel/index.js +0 -3
  415. package/modern/InputLabel/inputLabelClasses.js +0 -7
  416. package/modern/LinearProgress/LinearProgress.js +0 -455
  417. package/modern/LinearProgress/index.js +0 -3
  418. package/modern/LinearProgress/linearProgressClasses.js +0 -7
  419. package/modern/Link/Link.js +0 -283
  420. package/modern/Link/getTextDecoration.js +0 -16
  421. package/modern/Link/index.js +0 -3
  422. package/modern/Link/linkClasses.js +0 -7
  423. package/modern/List/List.js +0 -134
  424. package/modern/List/ListContext.js +0 -12
  425. package/modern/List/index.js +0 -3
  426. package/modern/List/listClasses.js +0 -7
  427. package/modern/ListItem/ListItem.js +0 -388
  428. package/modern/ListItem/index.js +0 -3
  429. package/modern/ListItem/listItemClasses.js +0 -7
  430. package/modern/ListItemAvatar/ListItemAvatar.js +0 -91
  431. package/modern/ListItemAvatar/index.js +0 -3
  432. package/modern/ListItemAvatar/listItemAvatarClasses.js +0 -7
  433. package/modern/ListItemButton/ListItemButton.js +0 -264
  434. package/modern/ListItemButton/index.js +0 -3
  435. package/modern/ListItemButton/listItemButtonClasses.js +0 -7
  436. package/modern/ListItemIcon/ListItemIcon.js +0 -97
  437. package/modern/ListItemIcon/index.js +0 -3
  438. package/modern/ListItemIcon/listItemIconClasses.js +0 -7
  439. package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +0 -96
  440. package/modern/ListItemSecondaryAction/index.js +0 -3
  441. package/modern/ListItemSecondaryAction/listItemSecondaryActionClasses.js +0 -7
  442. package/modern/ListItemText/ListItemText.js +0 -227
  443. package/modern/ListItemText/index.js +0 -3
  444. package/modern/ListItemText/listItemTextClasses.js +0 -7
  445. package/modern/ListSubheader/ListSubheader.js +0 -167
  446. package/modern/ListSubheader/index.js +0 -3
  447. package/modern/ListSubheader/listSubheaderClasses.js +0 -7
  448. package/modern/Menu/Menu.js +0 -341
  449. package/modern/Menu/index.js +0 -3
  450. package/modern/Menu/menuClasses.js +0 -7
  451. package/modern/MenuItem/MenuItem.js +0 -283
  452. package/modern/MenuItem/index.js +0 -3
  453. package/modern/MenuItem/menuItemClasses.js +0 -7
  454. package/modern/MenuList/MenuList.js +0 -290
  455. package/modern/MenuList/index.js +0 -1
  456. package/modern/MobileStepper/MobileStepper.js +0 -306
  457. package/modern/MobileStepper/index.js +0 -3
  458. package/modern/MobileStepper/mobileStepperClasses.js +0 -7
  459. package/modern/Modal/Modal.js +0 -396
  460. package/modern/Modal/ModalManager.js +0 -211
  461. package/modern/Modal/index.js +0 -4
  462. package/modern/Modal/modalClasses.js +0 -7
  463. package/modern/Modal/useModal.js +0 -200
  464. package/modern/Modal/useModal.types.js +0 -1
  465. package/modern/NativeSelect/NativeSelect.js +0 -133
  466. package/modern/NativeSelect/NativeSelectInput.js +0 -240
  467. package/modern/NativeSelect/index.js +0 -3
  468. package/modern/NativeSelect/nativeSelectClasses.js +0 -7
  469. package/modern/NoSsr/NoSsr.js +0 -70
  470. package/modern/NoSsr/NoSsr.types.js +0 -1
  471. package/modern/NoSsr/index.js +0 -1
  472. package/modern/OutlinedInput/NotchedOutline.js +0 -154
  473. package/modern/OutlinedInput/OutlinedInput.js +0 -410
  474. package/modern/OutlinedInput/index.js +0 -3
  475. package/modern/OutlinedInput/outlinedInputClasses.js +0 -11
  476. package/modern/OverridableComponent/index.js +0 -1
  477. package/modern/Pagination/Pagination.js +0 -245
  478. package/modern/Pagination/index.js +0 -3
  479. package/modern/Pagination/paginationClasses.js +0 -7
  480. package/modern/PaginationItem/PaginationItem.js +0 -472
  481. package/modern/PaginationItem/index.js +0 -3
  482. package/modern/PaginationItem/paginationItemClasses.js +0 -7
  483. package/modern/Paper/Paper.js +0 -170
  484. package/modern/Paper/index.js +0 -3
  485. package/modern/Paper/paperClasses.js +0 -7
  486. package/modern/PigmentContainer/PigmentContainer.js +0 -98
  487. package/modern/PigmentContainer/index.js +0 -3
  488. package/modern/PigmentGrid/PigmentGrid.js +0 -126
  489. package/modern/PigmentGrid/index.js +0 -3
  490. package/modern/PigmentStack/PigmentStack.js +0 -81
  491. package/modern/PigmentStack/index.js +0 -3
  492. package/modern/Popover/Popover.js +0 -583
  493. package/modern/Popover/index.js +0 -4
  494. package/modern/Popover/popoverClasses.js +0 -7
  495. package/modern/Popper/BasePopper.js +0 -370
  496. package/modern/Popper/BasePopper.types.js +0 -1
  497. package/modern/Popper/Popper.js +0 -210
  498. package/modern/Popper/index.js +0 -2
  499. package/modern/Popper/popperClasses.js +0 -7
  500. package/modern/Portal/Portal.js +0 -86
  501. package/modern/Portal/Portal.types.js +0 -1
  502. package/modern/Portal/index.js +0 -1
  503. package/modern/Radio/Radio.js +0 -309
  504. package/modern/Radio/RadioButtonIcon.js +0 -87
  505. package/modern/Radio/index.js +0 -3
  506. package/modern/Radio/radioClasses.js +0 -7
  507. package/modern/RadioGroup/RadioGroup.js +0 -114
  508. package/modern/RadioGroup/RadioGroupContext.js +0 -11
  509. package/modern/RadioGroup/index.js +0 -4
  510. package/modern/RadioGroup/radioGroupClasses.js +0 -7
  511. package/modern/RadioGroup/useRadioGroup.js +0 -7
  512. package/modern/Rating/Rating.js +0 -777
  513. package/modern/Rating/index.js +0 -3
  514. package/modern/Rating/ratingClasses.js +0 -7
  515. package/modern/ScopedCssBaseline/ScopedCssBaseline.js +0 -120
  516. package/modern/ScopedCssBaseline/index.js +0 -3
  517. package/modern/ScopedCssBaseline/scopedCssBaselineClasses.js +0 -7
  518. package/modern/Select/Select.js +0 -300
  519. package/modern/Select/SelectInput.js +0 -673
  520. package/modern/Select/index.js +0 -3
  521. package/modern/Select/selectClasses.js +0 -7
  522. package/modern/Skeleton/Skeleton.js +0 -269
  523. package/modern/Skeleton/index.js +0 -3
  524. package/modern/Skeleton/skeletonClasses.js +0 -7
  525. package/modern/Slide/Slide.js +0 -338
  526. package/modern/Slide/index.js +0 -1
  527. package/modern/Slider/Slider.js +0 -1095
  528. package/modern/Slider/SliderValueLabel.js +0 -53
  529. package/modern/Slider/SliderValueLabel.types.js +0 -1
  530. package/modern/Slider/index.js +0 -4
  531. package/modern/Slider/sliderClasses.js +0 -7
  532. package/modern/Slider/useSlider.js +0 -704
  533. package/modern/Slider/useSlider.types.js +0 -1
  534. package/modern/Snackbar/Snackbar.js +0 -426
  535. package/modern/Snackbar/index.js +0 -3
  536. package/modern/Snackbar/snackbarClasses.js +0 -7
  537. package/modern/Snackbar/useSnackbar.js +0 -133
  538. package/modern/Snackbar/useSnackbar.types.js +0 -1
  539. package/modern/SnackbarContent/SnackbarContent.js +0 -132
  540. package/modern/SnackbarContent/index.js +0 -3
  541. package/modern/SnackbarContent/snackbarContentClasses.js +0 -7
  542. package/modern/SpeedDial/SpeedDial.js +0 -579
  543. package/modern/SpeedDial/index.js +0 -3
  544. package/modern/SpeedDial/speedDialClasses.js +0 -7
  545. package/modern/SpeedDialAction/SpeedDialAction.js +0 -351
  546. package/modern/SpeedDialAction/index.js +0 -3
  547. package/modern/SpeedDialAction/speedDialActionClasses.js +0 -7
  548. package/modern/SpeedDialIcon/SpeedDialIcon.js +0 -156
  549. package/modern/SpeedDialIcon/index.js +0 -3
  550. package/modern/SpeedDialIcon/speedDialIconClasses.js +0 -7
  551. package/modern/Stack/Stack.js +0 -62
  552. package/modern/Stack/index.js +0 -2
  553. package/modern/Stack/stackClasses.js +0 -7
  554. package/modern/Step/Step.js +0 -176
  555. package/modern/Step/StepContext.js +0 -19
  556. package/modern/Step/index.js +0 -5
  557. package/modern/Step/stepClasses.js +0 -7
  558. package/modern/StepButton/StepButton.js +0 -133
  559. package/modern/StepButton/index.js +0 -3
  560. package/modern/StepButton/stepButtonClasses.js +0 -7
  561. package/modern/StepConnector/StepConnector.js +0 -152
  562. package/modern/StepConnector/index.js +0 -3
  563. package/modern/StepConnector/stepConnectorClasses.js +0 -7
  564. package/modern/StepContent/StepContent.js +0 -187
  565. package/modern/StepContent/index.js +0 -3
  566. package/modern/StepContent/stepContentClasses.js +0 -7
  567. package/modern/StepIcon/StepIcon.js +0 -161
  568. package/modern/StepIcon/index.js +0 -3
  569. package/modern/StepIcon/stepIconClasses.js +0 -7
  570. package/modern/StepLabel/StepLabel.js +0 -280
  571. package/modern/StepLabel/index.js +0 -3
  572. package/modern/StepLabel/stepLabelClasses.js +0 -7
  573. package/modern/Stepper/Stepper.js +0 -167
  574. package/modern/Stepper/StepperContext.js +0 -19
  575. package/modern/Stepper/index.js +0 -5
  576. package/modern/Stepper/stepperClasses.js +0 -7
  577. package/modern/SvgIcon/SvgIcon.js +0 -234
  578. package/modern/SvgIcon/index.js +0 -3
  579. package/modern/SvgIcon/svgIconClasses.js +0 -7
  580. package/modern/SwipeableDrawer/SwipeArea.js +0 -104
  581. package/modern/SwipeableDrawer/SwipeableDrawer.js +0 -661
  582. package/modern/SwipeableDrawer/index.js +0 -1
  583. package/modern/Switch/Switch.js +0 -407
  584. package/modern/Switch/index.js +0 -3
  585. package/modern/Switch/switchClasses.js +0 -7
  586. package/modern/Tab/Tab.js +0 -338
  587. package/modern/Tab/index.js +0 -3
  588. package/modern/Tab/tabClasses.js +0 -7
  589. package/modern/TabScrollButton/TabScrollButton.js +0 -172
  590. package/modern/TabScrollButton/index.js +0 -3
  591. package/modern/TabScrollButton/tabScrollButtonClasses.js +0 -7
  592. package/modern/Table/Table.js +0 -136
  593. package/modern/Table/TableContext.js +0 -12
  594. package/modern/Table/Tablelvl2Context.js +0 -12
  595. package/modern/Table/index.js +0 -3
  596. package/modern/Table/tableClasses.js +0 -7
  597. package/modern/TableBody/TableBody.js +0 -86
  598. package/modern/TableBody/index.js +0 -3
  599. package/modern/TableBody/tableBodyClasses.js +0 -7
  600. package/modern/TableCell/TableCell.js +0 -270
  601. package/modern/TableCell/index.js +0 -3
  602. package/modern/TableCell/tableCellClasses.js +0 -7
  603. package/modern/TableContainer/TableContainer.js +0 -78
  604. package/modern/TableContainer/index.js +0 -3
  605. package/modern/TableContainer/tableContainerClasses.js +0 -7
  606. package/modern/TableFooter/TableFooter.js +0 -86
  607. package/modern/TableFooter/index.js +0 -3
  608. package/modern/TableFooter/tableFooterClasses.js +0 -7
  609. package/modern/TableHead/TableHead.js +0 -86
  610. package/modern/TableHead/index.js +0 -3
  611. package/modern/TableHead/tableHeadClasses.js +0 -7
  612. package/modern/TablePagination/TablePagination.js +0 -505
  613. package/modern/TablePagination/TablePaginationActions.js +0 -194
  614. package/modern/TablePagination/index.js +0 -3
  615. package/modern/TablePagination/tablePaginationClasses.js +0 -7
  616. package/modern/TableRow/TableRow.js +0 -127
  617. package/modern/TableRow/index.js +0 -3
  618. package/modern/TableRow/tableRowClasses.js +0 -7
  619. package/modern/TableSortLabel/TableSortLabel.js +0 -212
  620. package/modern/TableSortLabel/index.js +0 -3
  621. package/modern/TableSortLabel/tableSortLabelClasses.js +0 -7
  622. package/modern/Tabs/ScrollbarSize.js +0 -58
  623. package/modern/Tabs/Tabs.js +0 -956
  624. package/modern/Tabs/index.js +0 -3
  625. package/modern/Tabs/tabsClasses.js +0 -7
  626. package/modern/TextField/TextField.js +0 -457
  627. package/modern/TextField/index.js +0 -3
  628. package/modern/TextField/textFieldClasses.js +0 -7
  629. package/modern/TextareaAutosize/TextareaAutosize.js +0 -243
  630. package/modern/TextareaAutosize/TextareaAutosize.types.js +0 -1
  631. package/modern/TextareaAutosize/index.js +0 -1
  632. package/modern/ToggleButton/ToggleButton.js +0 -268
  633. package/modern/ToggleButton/index.js +0 -3
  634. package/modern/ToggleButton/toggleButtonClasses.js +0 -7
  635. package/modern/ToggleButtonGroup/ToggleButtonGroup.js +0 -281
  636. package/modern/ToggleButtonGroup/ToggleButtonGroupButtonContext.js +0 -11
  637. package/modern/ToggleButtonGroup/ToggleButtonGroupContext.js +0 -11
  638. package/modern/ToggleButtonGroup/index.js +0 -3
  639. package/modern/ToggleButtonGroup/isValueSelected.js +0 -11
  640. package/modern/ToggleButtonGroup/toggleButtonGroupClasses.js +0 -7
  641. package/modern/Toolbar/Toolbar.js +0 -129
  642. package/modern/Toolbar/index.js +0 -3
  643. package/modern/Toolbar/toolbarClasses.js +0 -7
  644. package/modern/Tooltip/Tooltip.js +0 -898
  645. package/modern/Tooltip/index.js +0 -3
  646. package/modern/Tooltip/tooltipClasses.js +0 -7
  647. package/modern/Typography/Typography.js +0 -268
  648. package/modern/Typography/index.js +0 -3
  649. package/modern/Typography/typographyClasses.js +0 -7
  650. package/modern/Unstable_TrapFocus/FocusTrap.js +0 -329
  651. package/modern/Unstable_TrapFocus/FocusTrap.types.js +0 -1
  652. package/modern/Unstable_TrapFocus/index.js +0 -1
  653. package/modern/Zoom/Zoom.js +0 -210
  654. package/modern/Zoom/index.js +0 -1
  655. package/modern/className/index.js +0 -2
  656. package/modern/colors/amber.js +0 -17
  657. package/modern/colors/blue.js +0 -17
  658. package/modern/colors/blueGrey.js +0 -17
  659. package/modern/colors/brown.js +0 -17
  660. package/modern/colors/common.js +0 -5
  661. package/modern/colors/cyan.js +0 -17
  662. package/modern/colors/deepOrange.js +0 -17
  663. package/modern/colors/deepPurple.js +0 -17
  664. package/modern/colors/green.js +0 -17
  665. package/modern/colors/grey.js +0 -17
  666. package/modern/colors/index.js +0 -20
  667. package/modern/colors/indigo.js +0 -17
  668. package/modern/colors/lightBlue.js +0 -17
  669. package/modern/colors/lightGreen.js +0 -17
  670. package/modern/colors/lime.js +0 -17
  671. package/modern/colors/orange.js +0 -17
  672. package/modern/colors/pink.js +0 -17
  673. package/modern/colors/purple.js +0 -17
  674. package/modern/colors/red.js +0 -17
  675. package/modern/colors/teal.js +0 -17
  676. package/modern/colors/yellow.js +0 -17
  677. package/modern/darkScrollbar/index.js +0 -32
  678. package/modern/generateUtilityClass/index.js +0 -1
  679. package/modern/generateUtilityClasses/index.js +0 -1
  680. package/modern/index.js +0 -286
  681. package/modern/internal/SwitchBase.js +0 -355
  682. package/modern/internal/animate.js +0 -39
  683. package/modern/internal/svg-icons/Add.js +0 -12
  684. package/modern/internal/svg-icons/ArrowDownward.js +0 -12
  685. package/modern/internal/svg-icons/ArrowDropDown.js +0 -12
  686. package/modern/internal/svg-icons/Cancel.js +0 -12
  687. package/modern/internal/svg-icons/CheckBox.js +0 -12
  688. package/modern/internal/svg-icons/CheckBoxOutlineBlank.js +0 -12
  689. package/modern/internal/svg-icons/CheckCircle.js +0 -12
  690. package/modern/internal/svg-icons/Close.js +0 -14
  691. package/modern/internal/svg-icons/ErrorOutline.js +0 -12
  692. package/modern/internal/svg-icons/FirstPage.js +0 -12
  693. package/modern/internal/svg-icons/IndeterminateCheckBox.js +0 -12
  694. package/modern/internal/svg-icons/InfoOutlined.js +0 -12
  695. package/modern/internal/svg-icons/KeyboardArrowLeft.js +0 -12
  696. package/modern/internal/svg-icons/KeyboardArrowRight.js +0 -12
  697. package/modern/internal/svg-icons/LastPage.js +0 -12
  698. package/modern/internal/svg-icons/MoreHoriz.js +0 -12
  699. package/modern/internal/svg-icons/NavigateBefore.js +0 -12
  700. package/modern/internal/svg-icons/NavigateNext.js +0 -12
  701. package/modern/internal/svg-icons/Person.js +0 -12
  702. package/modern/internal/svg-icons/RadioButtonChecked.js +0 -12
  703. package/modern/internal/svg-icons/RadioButtonUnchecked.js +0 -12
  704. package/modern/internal/svg-icons/ReportProblemOutlined.js +0 -12
  705. package/modern/internal/svg-icons/Star.js +0 -12
  706. package/modern/internal/svg-icons/StarBorder.js +0 -12
  707. package/modern/internal/svg-icons/SuccessOutlined.js +0 -12
  708. package/modern/internal/svg-icons/Warning.js +0 -12
  709. package/modern/internal/switchBaseClasses.js +0 -7
  710. package/modern/locale/index.js +0 -4324
  711. package/modern/package.json +0 -1
  712. package/modern/styles/ThemeProvider.js +0 -40
  713. package/modern/styles/ThemeProviderNoVars.js +0 -17
  714. package/modern/styles/ThemeProviderWithVars.js +0 -91
  715. package/modern/styles/adaptV4Theme.js +0 -83
  716. package/modern/styles/components.js +0 -1
  717. package/modern/styles/createColorScheme.js +0 -41
  718. package/modern/styles/createGetSelector.js +0 -60
  719. package/modern/styles/createMixins.js +0 -16
  720. package/modern/styles/createMuiStrictModeTheme.js +0 -7
  721. package/modern/styles/createPalette.js +0 -302
  722. package/modern/styles/createStyles.js +0 -10
  723. package/modern/styles/createTheme.js +0 -98
  724. package/modern/styles/createThemeNoVars.js +0 -91
  725. package/modern/styles/createThemeWithVars.js +0 -386
  726. package/modern/styles/createTransitions.js +0 -89
  727. package/modern/styles/createTypography.js +0 -92
  728. package/modern/styles/cssUtils.js +0 -125
  729. package/modern/styles/defaultTheme.js +0 -5
  730. package/modern/styles/excludeVariablesFromRoot.js +0 -5
  731. package/modern/styles/experimental_extendTheme.js +0 -9
  732. package/modern/styles/getOverlayAlpha.js +0 -10
  733. package/modern/styles/identifier.js +0 -1
  734. package/modern/styles/index.js +0 -37
  735. package/modern/styles/makeStyles.js +0 -4
  736. package/modern/styles/overrides.js +0 -1
  737. package/modern/styles/props.js +0 -1
  738. package/modern/styles/responsiveFontSizes.js +0 -67
  739. package/modern/styles/rootShouldForwardProp.js +0 -3
  740. package/modern/styles/shadows.js +0 -10
  741. package/modern/styles/shouldSkipGeneratingVar.js +0 -5
  742. package/modern/styles/slotShouldForwardProp.js +0 -5
  743. package/modern/styles/stringifyTheme.js +0 -54
  744. package/modern/styles/styled.js +0 -14
  745. package/modern/styles/useTheme.js +0 -15
  746. package/modern/styles/useThemeProps.js +0 -16
  747. package/modern/styles/variants.js +0 -1
  748. package/modern/styles/withStyles.js +0 -4
  749. package/modern/styles/withTheme.js +0 -4
  750. package/modern/styles/zIndex.js +0 -13
  751. package/modern/transitions/index.js +0 -1
  752. package/modern/transitions/transition.js +0 -1
  753. package/modern/transitions/utils.js +0 -13
  754. package/modern/types/OverridableComponentAugmentation.js +0 -1
  755. package/modern/useAutocomplete/index.js +0 -1
  756. package/modern/useAutocomplete/useAutocomplete.js +0 -973
  757. package/modern/useLazyRipple/index.js +0 -3
  758. package/modern/useLazyRipple/useLazyRipple.js +0 -85
  759. package/modern/useMediaQuery/index.js +0 -6
  760. package/modern/usePagination/index.js +0 -1
  761. package/modern/usePagination/usePagination.js +0 -113
  762. package/modern/useScrollTrigger/index.js +0 -1
  763. package/modern/useScrollTrigger/useScrollTrigger.js +0 -55
  764. package/modern/utils/PolymorphicComponent.js +0 -1
  765. package/modern/utils/areArraysEqual.js +0 -4
  766. package/modern/utils/capitalize.js +0 -2
  767. package/modern/utils/createChainedFunction.js +0 -2
  768. package/modern/utils/createSimplePaletteValueFilter.js +0 -41
  769. package/modern/utils/createSvgIcon.js +0 -26
  770. package/modern/utils/debounce.js +0 -2
  771. package/modern/utils/deprecatedPropType.js +0 -2
  772. package/modern/utils/getScrollbarSize.js +0 -2
  773. package/modern/utils/index.js +0 -31
  774. package/modern/utils/isHostComponent.js +0 -7
  775. package/modern/utils/isMuiElement.js +0 -2
  776. package/modern/utils/memoTheme.js +0 -3
  777. package/modern/utils/mergeSlotProps.js +0 -75
  778. package/modern/utils/omitEventHandlers.js +0 -18
  779. package/modern/utils/ownerDocument.js +0 -2
  780. package/modern/utils/ownerWindow.js +0 -2
  781. package/modern/utils/requirePropFactory.js +0 -2
  782. package/modern/utils/setRef.js +0 -2
  783. package/modern/utils/shouldSpreadAdditionalProps.js +0 -5
  784. package/modern/utils/types.js +0 -1
  785. package/modern/utils/unsupportedProp.js +0 -2
  786. package/modern/utils/useControlled.js +0 -4
  787. package/modern/utils/useEnhancedEffect.js +0 -4
  788. package/modern/utils/useEventCallback.js +0 -4
  789. package/modern/utils/useForkRef.js +0 -4
  790. package/modern/utils/useId.js +0 -4
  791. package/modern/utils/useSlot.js +0 -80
  792. package/modern/version/index.js +0 -6
  793. package/modern/zero-styled/index.js +0 -27
  794. package/tsconfig.build.tsbuildinfo +0 -1
@@ -1,973 +0,0 @@
1
- 'use client';
2
-
3
- /* eslint-disable no-constant-condition */
4
- import * as React from 'react';
5
- import { unstable_setRef as setRef, unstable_useEventCallback as useEventCallback, unstable_useControlled as useControlled, unstable_useId as useId, usePreviousProps } from '@mui/utils';
6
-
7
- // https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript
8
- function stripDiacritics(string) {
9
- return string.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
10
- }
11
- export function createFilterOptions(config = {}) {
12
- const {
13
- ignoreAccents = true,
14
- ignoreCase = true,
15
- limit,
16
- matchFrom = 'any',
17
- stringify,
18
- trim = false
19
- } = config;
20
- return (options, {
21
- inputValue,
22
- getOptionLabel
23
- }) => {
24
- let input = trim ? inputValue.trim() : inputValue;
25
- if (ignoreCase) {
26
- input = input.toLowerCase();
27
- }
28
- if (ignoreAccents) {
29
- input = stripDiacritics(input);
30
- }
31
- const filteredOptions = !input ? options : options.filter(option => {
32
- let candidate = (stringify || getOptionLabel)(option);
33
- if (ignoreCase) {
34
- candidate = candidate.toLowerCase();
35
- }
36
- if (ignoreAccents) {
37
- candidate = stripDiacritics(candidate);
38
- }
39
- return matchFrom === 'start' ? candidate.startsWith(input) : candidate.includes(input);
40
- });
41
- return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions;
42
- };
43
- }
44
- const defaultFilterOptions = createFilterOptions();
45
-
46
- // Number of options to jump in list box when `Page Up` and `Page Down` keys are used.
47
- const pageSize = 5;
48
- const defaultIsActiveElementInListbox = listboxRef => listboxRef.current !== null && listboxRef.current.parentElement?.contains(document.activeElement);
49
- const MULTIPLE_DEFAULT_VALUE = [];
50
- function getInputValue(value, multiple, getOptionLabel) {
51
- if (multiple || value == null) {
52
- return '';
53
- }
54
- const optionLabel = getOptionLabel(value);
55
- return typeof optionLabel === 'string' ? optionLabel : '';
56
- }
57
- function useAutocomplete(props) {
58
- const {
59
- // eslint-disable-next-line @typescript-eslint/naming-convention
60
- unstable_isActiveElementInListbox = defaultIsActiveElementInListbox,
61
- // eslint-disable-next-line @typescript-eslint/naming-convention
62
- unstable_classNamePrefix = 'Mui',
63
- autoComplete = false,
64
- autoHighlight = false,
65
- autoSelect = false,
66
- blurOnSelect = false,
67
- clearOnBlur = !props.freeSolo,
68
- clearOnEscape = false,
69
- componentName = 'useAutocomplete',
70
- defaultValue = props.multiple ? MULTIPLE_DEFAULT_VALUE : null,
71
- disableClearable = false,
72
- disableCloseOnSelect = false,
73
- disabled: disabledProp,
74
- disabledItemsFocusable = false,
75
- disableListWrap = false,
76
- filterOptions = defaultFilterOptions,
77
- filterSelectedOptions = false,
78
- freeSolo = false,
79
- getOptionDisabled,
80
- getOptionKey,
81
- getOptionLabel: getOptionLabelProp = option => option.label ?? option,
82
- groupBy,
83
- handleHomeEndKeys = !props.freeSolo,
84
- id: idProp,
85
- includeInputInList = false,
86
- inputValue: inputValueProp,
87
- isOptionEqualToValue = (option, value) => option === value,
88
- multiple = false,
89
- onChange,
90
- onClose,
91
- onHighlightChange,
92
- onInputChange,
93
- onOpen,
94
- open: openProp,
95
- openOnFocus = false,
96
- options,
97
- readOnly = false,
98
- selectOnFocus = !props.freeSolo,
99
- value: valueProp
100
- } = props;
101
- const id = useId(idProp);
102
- let getOptionLabel = getOptionLabelProp;
103
- getOptionLabel = option => {
104
- const optionLabel = getOptionLabelProp(option);
105
- if (typeof optionLabel !== 'string') {
106
- if (process.env.NODE_ENV !== 'production') {
107
- const erroneousReturn = optionLabel === undefined ? 'undefined' : `${typeof optionLabel} (${optionLabel})`;
108
- console.error(`MUI: The \`getOptionLabel\` method of ${componentName} returned ${erroneousReturn} instead of a string for ${JSON.stringify(option)}.`);
109
- }
110
- return String(optionLabel);
111
- }
112
- return optionLabel;
113
- };
114
- const ignoreFocus = React.useRef(false);
115
- const firstFocus = React.useRef(true);
116
- const inputRef = React.useRef(null);
117
- const listboxRef = React.useRef(null);
118
- const [anchorEl, setAnchorEl] = React.useState(null);
119
- const [focusedTag, setFocusedTag] = React.useState(-1);
120
- const defaultHighlighted = autoHighlight ? 0 : -1;
121
- const highlightedIndexRef = React.useRef(defaultHighlighted);
122
-
123
- // Calculate the initial inputValue on mount only.
124
- // Using useRef since defaultValue doesn't need to update inputValue dynamically.
125
- const initialInputValue = React.useRef(getInputValue(defaultValue, multiple, getOptionLabel)).current;
126
- const [value, setValueState] = useControlled({
127
- controlled: valueProp,
128
- default: defaultValue,
129
- name: componentName
130
- });
131
- const [inputValue, setInputValueState] = useControlled({
132
- controlled: inputValueProp,
133
- default: initialInputValue,
134
- name: componentName,
135
- state: 'inputValue'
136
- });
137
- const [focused, setFocused] = React.useState(false);
138
- const resetInputValue = React.useCallback((event, newValue, reason) => {
139
- // retain current `inputValue` if new option isn't selected and `clearOnBlur` is false
140
- // When `multiple` is enabled, `newValue` is an array of all selected items including the newly selected item
141
- const isOptionSelected = multiple ? value.length < newValue.length : newValue !== null;
142
- if (!isOptionSelected && !clearOnBlur) {
143
- return;
144
- }
145
- const newInputValue = getInputValue(newValue, multiple, getOptionLabel);
146
- if (inputValue === newInputValue) {
147
- return;
148
- }
149
- setInputValueState(newInputValue);
150
- if (onInputChange) {
151
- onInputChange(event, newInputValue, reason);
152
- }
153
- }, [getOptionLabel, inputValue, multiple, onInputChange, setInputValueState, clearOnBlur, value]);
154
- const [open, setOpenState] = useControlled({
155
- controlled: openProp,
156
- default: false,
157
- name: componentName,
158
- state: 'open'
159
- });
160
- const [inputPristine, setInputPristine] = React.useState(true);
161
- const inputValueIsSelectedValue = !multiple && value != null && inputValue === getOptionLabel(value);
162
- const popupOpen = open && !readOnly;
163
- const filteredOptions = popupOpen ? filterOptions(options.filter(option => {
164
- if (filterSelectedOptions && (multiple ? value : [value]).some(value2 => value2 !== null && isOptionEqualToValue(option, value2))) {
165
- return false;
166
- }
167
- return true;
168
- }),
169
- // we use the empty string to manipulate `filterOptions` to not filter any options
170
- // i.e. the filter predicate always returns true
171
- {
172
- inputValue: inputValueIsSelectedValue && inputPristine ? '' : inputValue,
173
- getOptionLabel
174
- }) : [];
175
- const previousProps = usePreviousProps({
176
- filteredOptions,
177
- value,
178
- inputValue
179
- });
180
- React.useEffect(() => {
181
- const valueChange = value !== previousProps.value;
182
- if (focused && !valueChange) {
183
- return;
184
- }
185
-
186
- // Only reset the input's value when freeSolo if the component's value changes.
187
- if (freeSolo && !valueChange) {
188
- return;
189
- }
190
- resetInputValue(null, value, 'reset');
191
- }, [value, resetInputValue, focused, previousProps.value, freeSolo]);
192
- const listboxAvailable = open && filteredOptions.length > 0 && !readOnly;
193
- const focusTag = useEventCallback(tagToFocus => {
194
- if (tagToFocus === -1) {
195
- inputRef.current.focus();
196
- } else {
197
- anchorEl.querySelector(`[data-tag-index="${tagToFocus}"]`).focus();
198
- }
199
- });
200
-
201
- // Ensure the focusedTag is never inconsistent
202
- React.useEffect(() => {
203
- if (multiple && focusedTag > value.length - 1) {
204
- setFocusedTag(-1);
205
- focusTag(-1);
206
- }
207
- }, [value, multiple, focusedTag, focusTag]);
208
- function validOptionIndex(index, direction) {
209
- if (!listboxRef.current || index < 0 || index >= filteredOptions.length) {
210
- return -1;
211
- }
212
- let nextFocus = index;
213
- while (true) {
214
- const option = listboxRef.current.querySelector(`[data-option-index="${nextFocus}"]`);
215
-
216
- // Same logic as MenuList.js
217
- const nextFocusDisabled = disabledItemsFocusable ? false : !option || option.disabled || option.getAttribute('aria-disabled') === 'true';
218
- if (option && option.hasAttribute('tabindex') && !nextFocusDisabled) {
219
- // The next option is available
220
- return nextFocus;
221
- }
222
-
223
- // The next option is disabled, move to the next element.
224
- // with looped index
225
- if (direction === 'next') {
226
- nextFocus = (nextFocus + 1) % filteredOptions.length;
227
- } else {
228
- nextFocus = (nextFocus - 1 + filteredOptions.length) % filteredOptions.length;
229
- }
230
-
231
- // We end up with initial index, that means we don't have available options.
232
- // All of them are disabled
233
- if (nextFocus === index) {
234
- return -1;
235
- }
236
- }
237
- }
238
- const setHighlightedIndex = useEventCallback(({
239
- event,
240
- index,
241
- reason
242
- }) => {
243
- highlightedIndexRef.current = index;
244
-
245
- // does the index exist?
246
- if (index === -1) {
247
- inputRef.current.removeAttribute('aria-activedescendant');
248
- } else {
249
- inputRef.current.setAttribute('aria-activedescendant', `${id}-option-${index}`);
250
- }
251
- if (onHighlightChange && ['mouse', 'keyboard', 'touch'].includes(reason)) {
252
- onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
253
- }
254
- if (!listboxRef.current) {
255
- return;
256
- }
257
- const prev = listboxRef.current.querySelector(`[role="option"].${unstable_classNamePrefix}-focused`);
258
- if (prev) {
259
- prev.classList.remove(`${unstable_classNamePrefix}-focused`);
260
- prev.classList.remove(`${unstable_classNamePrefix}-focusVisible`);
261
- }
262
- let listboxNode = listboxRef.current;
263
- if (listboxRef.current.getAttribute('role') !== 'listbox') {
264
- listboxNode = listboxRef.current.parentElement.querySelector('[role="listbox"]');
265
- }
266
-
267
- // "No results"
268
- if (!listboxNode) {
269
- return;
270
- }
271
- if (index === -1) {
272
- listboxNode.scrollTop = 0;
273
- return;
274
- }
275
- const option = listboxRef.current.querySelector(`[data-option-index="${index}"]`);
276
- if (!option) {
277
- return;
278
- }
279
- option.classList.add(`${unstable_classNamePrefix}-focused`);
280
- if (reason === 'keyboard') {
281
- option.classList.add(`${unstable_classNamePrefix}-focusVisible`);
282
- }
283
-
284
- // Scroll active descendant into view.
285
- // Logic copied from https://www.w3.org/WAI/content-assets/wai-aria-practices/patterns/combobox/examples/js/select-only.js
286
- // In case of mouse clicks and touch (in mobile devices) we avoid scrolling the element and keep both behaviors same.
287
- // Consider this API instead once it has a better browser support:
288
- // .scrollIntoView({ scrollMode: 'if-needed', block: 'nearest' });
289
- if (listboxNode.scrollHeight > listboxNode.clientHeight && reason !== 'mouse' && reason !== 'touch') {
290
- const element = option;
291
- const scrollBottom = listboxNode.clientHeight + listboxNode.scrollTop;
292
- const elementBottom = element.offsetTop + element.offsetHeight;
293
- if (elementBottom > scrollBottom) {
294
- listboxNode.scrollTop = elementBottom - listboxNode.clientHeight;
295
- } else if (element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0) < listboxNode.scrollTop) {
296
- listboxNode.scrollTop = element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0);
297
- }
298
- }
299
- });
300
- const changeHighlightedIndex = useEventCallback(({
301
- event,
302
- diff,
303
- direction = 'next',
304
- reason
305
- }) => {
306
- if (!popupOpen) {
307
- return;
308
- }
309
- const getNextIndex = () => {
310
- const maxIndex = filteredOptions.length - 1;
311
- if (diff === 'reset') {
312
- return defaultHighlighted;
313
- }
314
- if (diff === 'start') {
315
- return 0;
316
- }
317
- if (diff === 'end') {
318
- return maxIndex;
319
- }
320
- const newIndex = highlightedIndexRef.current + diff;
321
- if (newIndex < 0) {
322
- if (newIndex === -1 && includeInputInList) {
323
- return -1;
324
- }
325
- if (disableListWrap && highlightedIndexRef.current !== -1 || Math.abs(diff) > 1) {
326
- return 0;
327
- }
328
- return maxIndex;
329
- }
330
- if (newIndex > maxIndex) {
331
- if (newIndex === maxIndex + 1 && includeInputInList) {
332
- return -1;
333
- }
334
- if (disableListWrap || Math.abs(diff) > 1) {
335
- return maxIndex;
336
- }
337
- return 0;
338
- }
339
- return newIndex;
340
- };
341
- const nextIndex = validOptionIndex(getNextIndex(), direction);
342
- setHighlightedIndex({
343
- index: nextIndex,
344
- reason,
345
- event
346
- });
347
-
348
- // Sync the content of the input with the highlighted option.
349
- if (autoComplete && diff !== 'reset') {
350
- if (nextIndex === -1) {
351
- inputRef.current.value = inputValue;
352
- } else {
353
- const option = getOptionLabel(filteredOptions[nextIndex]);
354
- inputRef.current.value = option;
355
-
356
- // The portion of the selected suggestion that has not been typed by the user,
357
- // a completion string, appears inline after the input cursor in the textbox.
358
- const index = option.toLowerCase().indexOf(inputValue.toLowerCase());
359
- if (index === 0 && inputValue.length > 0) {
360
- inputRef.current.setSelectionRange(inputValue.length, option.length);
361
- }
362
- }
363
- }
364
- });
365
- const getPreviousHighlightedOptionIndex = () => {
366
- const isSameValue = (value1, value2) => {
367
- const label1 = value1 ? getOptionLabel(value1) : '';
368
- const label2 = value2 ? getOptionLabel(value2) : '';
369
- return label1 === label2;
370
- };
371
- if (highlightedIndexRef.current !== -1 && previousProps.filteredOptions && previousProps.filteredOptions.length !== filteredOptions.length && previousProps.inputValue === inputValue && (multiple ? value.length === previousProps.value.length && previousProps.value.every((val, i) => getOptionLabel(value[i]) === getOptionLabel(val)) : isSameValue(previousProps.value, value))) {
372
- const previousHighlightedOption = previousProps.filteredOptions[highlightedIndexRef.current];
373
- if (previousHighlightedOption) {
374
- return filteredOptions.findIndex(option => {
375
- return getOptionLabel(option) === getOptionLabel(previousHighlightedOption);
376
- });
377
- }
378
- }
379
- return -1;
380
- };
381
- const syncHighlightedIndex = React.useCallback(() => {
382
- if (!popupOpen) {
383
- return;
384
- }
385
-
386
- // Check if the previously highlighted option still exists in the updated filtered options list and if the value and inputValue haven't changed
387
- // If it exists and the value and the inputValue haven't changed, just update its index, otherwise continue execution
388
- const previousHighlightedOptionIndex = getPreviousHighlightedOptionIndex();
389
- if (previousHighlightedOptionIndex !== -1) {
390
- highlightedIndexRef.current = previousHighlightedOptionIndex;
391
- return;
392
- }
393
- const valueItem = multiple ? value[0] : value;
394
-
395
- // The popup is empty, reset
396
- if (filteredOptions.length === 0 || valueItem == null) {
397
- changeHighlightedIndex({
398
- diff: 'reset'
399
- });
400
- return;
401
- }
402
- if (!listboxRef.current) {
403
- return;
404
- }
405
-
406
- // Synchronize the value with the highlighted index
407
- if (valueItem != null) {
408
- const currentOption = filteredOptions[highlightedIndexRef.current];
409
-
410
- // Keep the current highlighted index if possible
411
- if (multiple && currentOption && value.findIndex(val => isOptionEqualToValue(currentOption, val)) !== -1) {
412
- return;
413
- }
414
- const itemIndex = filteredOptions.findIndex(optionItem => isOptionEqualToValue(optionItem, valueItem));
415
- if (itemIndex === -1) {
416
- changeHighlightedIndex({
417
- diff: 'reset'
418
- });
419
- } else {
420
- setHighlightedIndex({
421
- index: itemIndex
422
- });
423
- }
424
- return;
425
- }
426
-
427
- // Prevent the highlighted index to leak outside the boundaries.
428
- if (highlightedIndexRef.current >= filteredOptions.length - 1) {
429
- setHighlightedIndex({
430
- index: filteredOptions.length - 1
431
- });
432
- return;
433
- }
434
-
435
- // Restore the focus to the previous index.
436
- setHighlightedIndex({
437
- index: highlightedIndexRef.current
438
- });
439
- // Ignore filteredOptions (and options, isOptionEqualToValue, getOptionLabel) not to break the scroll position
440
- // eslint-disable-next-line react-hooks/exhaustive-deps
441
- }, [
442
- // Only sync the highlighted index when the option switch between empty and not
443
- filteredOptions.length,
444
- // Don't sync the highlighted index with the value when multiple
445
- // eslint-disable-next-line react-hooks/exhaustive-deps
446
- multiple ? false : value, filterSelectedOptions, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);
447
- const handleListboxRef = useEventCallback(node => {
448
- setRef(listboxRef, node);
449
- if (!node) {
450
- return;
451
- }
452
- syncHighlightedIndex();
453
- });
454
- if (process.env.NODE_ENV !== 'production') {
455
- // eslint-disable-next-line react-hooks/rules-of-hooks
456
- React.useEffect(() => {
457
- if (!inputRef.current || inputRef.current.nodeName !== 'INPUT') {
458
- if (inputRef.current && inputRef.current.nodeName === 'TEXTAREA') {
459
- console.warn([`A textarea element was provided to ${componentName} where input was expected.`, `This is not a supported scenario but it may work under certain conditions.`, `A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).`, `Make sure to test keyboard navigation and add custom event handlers if necessary.`].join('\n'));
460
- } else {
461
- console.error([`MUI: Unable to find the input element. It was resolved to ${inputRef.current} while an HTMLInputElement was expected.`, `Instead, ${componentName} expects an input element.`, '', componentName === 'useAutocomplete' ? 'Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed.' : 'Make sure you have customized the input component correctly.'].join('\n'));
462
- }
463
- }
464
- }, [componentName]);
465
- }
466
- React.useEffect(() => {
467
- syncHighlightedIndex();
468
- }, [syncHighlightedIndex]);
469
- const handleOpen = event => {
470
- if (open) {
471
- return;
472
- }
473
- setOpenState(true);
474
- setInputPristine(true);
475
- if (onOpen) {
476
- onOpen(event);
477
- }
478
- };
479
- const handleClose = (event, reason) => {
480
- if (!open) {
481
- return;
482
- }
483
- setOpenState(false);
484
- if (onClose) {
485
- onClose(event, reason);
486
- }
487
- };
488
- const handleValue = (event, newValue, reason, details) => {
489
- if (multiple) {
490
- if (value.length === newValue.length && value.every((val, i) => val === newValue[i])) {
491
- return;
492
- }
493
- } else if (value === newValue) {
494
- return;
495
- }
496
- if (onChange) {
497
- onChange(event, newValue, reason, details);
498
- }
499
- setValueState(newValue);
500
- };
501
- const isTouch = React.useRef(false);
502
- const selectNewValue = (event, option, reasonProp = 'selectOption', origin = 'options') => {
503
- let reason = reasonProp;
504
- let newValue = option;
505
- if (multiple) {
506
- newValue = Array.isArray(value) ? value.slice() : [];
507
- if (process.env.NODE_ENV !== 'production') {
508
- const matches = newValue.filter(val => isOptionEqualToValue(option, val));
509
- if (matches.length > 1) {
510
- console.error([`MUI: The \`isOptionEqualToValue\` method of ${componentName} does not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${matches.length} matches.`].join('\n'));
511
- }
512
- }
513
- const itemIndex = newValue.findIndex(valueItem => isOptionEqualToValue(option, valueItem));
514
- if (itemIndex === -1) {
515
- newValue.push(option);
516
- } else if (origin !== 'freeSolo') {
517
- newValue.splice(itemIndex, 1);
518
- reason = 'removeOption';
519
- }
520
- }
521
- resetInputValue(event, newValue, reason);
522
- handleValue(event, newValue, reason, {
523
- option
524
- });
525
- if (!disableCloseOnSelect && (!event || !event.ctrlKey && !event.metaKey)) {
526
- handleClose(event, reason);
527
- }
528
- if (blurOnSelect === true || blurOnSelect === 'touch' && isTouch.current || blurOnSelect === 'mouse' && !isTouch.current) {
529
- inputRef.current.blur();
530
- }
531
- };
532
- function validTagIndex(index, direction) {
533
- if (index === -1) {
534
- return -1;
535
- }
536
- let nextFocus = index;
537
- while (true) {
538
- // Out of range
539
- if (direction === 'next' && nextFocus === value.length || direction === 'previous' && nextFocus === -1) {
540
- return -1;
541
- }
542
- const option = anchorEl.querySelector(`[data-tag-index="${nextFocus}"]`);
543
-
544
- // Same logic as MenuList.js
545
- if (!option || !option.hasAttribute('tabindex') || option.disabled || option.getAttribute('aria-disabled') === 'true') {
546
- nextFocus += direction === 'next' ? 1 : -1;
547
- } else {
548
- return nextFocus;
549
- }
550
- }
551
- }
552
- const handleFocusTag = (event, direction) => {
553
- if (!multiple) {
554
- return;
555
- }
556
- if (inputValue === '') {
557
- handleClose(event, 'toggleInput');
558
- }
559
- let nextTag = focusedTag;
560
- if (focusedTag === -1) {
561
- if (inputValue === '' && direction === 'previous') {
562
- nextTag = value.length - 1;
563
- }
564
- } else {
565
- nextTag += direction === 'next' ? 1 : -1;
566
- if (nextTag < 0) {
567
- nextTag = 0;
568
- }
569
- if (nextTag === value.length) {
570
- nextTag = -1;
571
- }
572
- }
573
- nextTag = validTagIndex(nextTag, direction);
574
- setFocusedTag(nextTag);
575
- focusTag(nextTag);
576
- };
577
- const handleClear = event => {
578
- ignoreFocus.current = true;
579
- setInputValueState('');
580
- if (onInputChange) {
581
- onInputChange(event, '', 'clear');
582
- }
583
- handleValue(event, multiple ? [] : null, 'clear');
584
- };
585
- const handleKeyDown = other => event => {
586
- if (other.onKeyDown) {
587
- other.onKeyDown(event);
588
- }
589
- if (event.defaultMuiPrevented) {
590
- return;
591
- }
592
- if (focusedTag !== -1 && !['ArrowLeft', 'ArrowRight'].includes(event.key)) {
593
- setFocusedTag(-1);
594
- focusTag(-1);
595
- }
596
-
597
- // Wait until IME is settled.
598
- if (event.which !== 229) {
599
- switch (event.key) {
600
- case 'Home':
601
- if (popupOpen && handleHomeEndKeys) {
602
- // Prevent scroll of the page
603
- event.preventDefault();
604
- changeHighlightedIndex({
605
- diff: 'start',
606
- direction: 'next',
607
- reason: 'keyboard',
608
- event
609
- });
610
- }
611
- break;
612
- case 'End':
613
- if (popupOpen && handleHomeEndKeys) {
614
- // Prevent scroll of the page
615
- event.preventDefault();
616
- changeHighlightedIndex({
617
- diff: 'end',
618
- direction: 'previous',
619
- reason: 'keyboard',
620
- event
621
- });
622
- }
623
- break;
624
- case 'PageUp':
625
- // Prevent scroll of the page
626
- event.preventDefault();
627
- changeHighlightedIndex({
628
- diff: -pageSize,
629
- direction: 'previous',
630
- reason: 'keyboard',
631
- event
632
- });
633
- handleOpen(event);
634
- break;
635
- case 'PageDown':
636
- // Prevent scroll of the page
637
- event.preventDefault();
638
- changeHighlightedIndex({
639
- diff: pageSize,
640
- direction: 'next',
641
- reason: 'keyboard',
642
- event
643
- });
644
- handleOpen(event);
645
- break;
646
- case 'ArrowDown':
647
- // Prevent cursor move
648
- event.preventDefault();
649
- changeHighlightedIndex({
650
- diff: 1,
651
- direction: 'next',
652
- reason: 'keyboard',
653
- event
654
- });
655
- handleOpen(event);
656
- break;
657
- case 'ArrowUp':
658
- // Prevent cursor move
659
- event.preventDefault();
660
- changeHighlightedIndex({
661
- diff: -1,
662
- direction: 'previous',
663
- reason: 'keyboard',
664
- event
665
- });
666
- handleOpen(event);
667
- break;
668
- case 'ArrowLeft':
669
- handleFocusTag(event, 'previous');
670
- break;
671
- case 'ArrowRight':
672
- handleFocusTag(event, 'next');
673
- break;
674
- case 'Enter':
675
- if (highlightedIndexRef.current !== -1 && popupOpen) {
676
- const option = filteredOptions[highlightedIndexRef.current];
677
- const disabled = getOptionDisabled ? getOptionDisabled(option) : false;
678
-
679
- // Avoid early form validation, let the end-users continue filling the form.
680
- event.preventDefault();
681
- if (disabled) {
682
- return;
683
- }
684
- selectNewValue(event, option, 'selectOption');
685
-
686
- // Move the selection to the end.
687
- if (autoComplete) {
688
- inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);
689
- }
690
- } else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {
691
- if (multiple) {
692
- // Allow people to add new values before they submit the form.
693
- event.preventDefault();
694
- }
695
- selectNewValue(event, inputValue, 'createOption', 'freeSolo');
696
- }
697
- break;
698
- case 'Escape':
699
- if (popupOpen) {
700
- // Avoid Opera to exit fullscreen mode.
701
- event.preventDefault();
702
- // Avoid the Modal to handle the event.
703
- event.stopPropagation();
704
- handleClose(event, 'escape');
705
- } else if (clearOnEscape && (inputValue !== '' || multiple && value.length > 0)) {
706
- // Avoid Opera to exit fullscreen mode.
707
- event.preventDefault();
708
- // Avoid the Modal to handle the event.
709
- event.stopPropagation();
710
- handleClear(event);
711
- }
712
- break;
713
- case 'Backspace':
714
- // Remove the value on the left of the "cursor"
715
- if (multiple && !readOnly && inputValue === '' && value.length > 0) {
716
- const index = focusedTag === -1 ? value.length - 1 : focusedTag;
717
- const newValue = value.slice();
718
- newValue.splice(index, 1);
719
- handleValue(event, newValue, 'removeOption', {
720
- option: value[index]
721
- });
722
- }
723
- break;
724
- case 'Delete':
725
- // Remove the value on the right of the "cursor"
726
- if (multiple && !readOnly && inputValue === '' && value.length > 0 && focusedTag !== -1) {
727
- const index = focusedTag;
728
- const newValue = value.slice();
729
- newValue.splice(index, 1);
730
- handleValue(event, newValue, 'removeOption', {
731
- option: value[index]
732
- });
733
- }
734
- break;
735
- default:
736
- }
737
- }
738
- };
739
- const handleFocus = event => {
740
- setFocused(true);
741
- if (openOnFocus && !ignoreFocus.current) {
742
- handleOpen(event);
743
- }
744
- };
745
- const handleBlur = event => {
746
- // Ignore the event when using the scrollbar with IE11
747
- if (unstable_isActiveElementInListbox(listboxRef)) {
748
- inputRef.current.focus();
749
- return;
750
- }
751
- setFocused(false);
752
- firstFocus.current = true;
753
- ignoreFocus.current = false;
754
- if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {
755
- selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'blur');
756
- } else if (autoSelect && freeSolo && inputValue !== '') {
757
- selectNewValue(event, inputValue, 'blur', 'freeSolo');
758
- } else if (clearOnBlur) {
759
- resetInputValue(event, value, 'blur');
760
- }
761
- handleClose(event, 'blur');
762
- };
763
- const handleInputChange = event => {
764
- const newValue = event.target.value;
765
- if (inputValue !== newValue) {
766
- setInputValueState(newValue);
767
- setInputPristine(false);
768
- if (onInputChange) {
769
- onInputChange(event, newValue, 'input');
770
- }
771
- }
772
- if (newValue === '') {
773
- if (!disableClearable && !multiple) {
774
- handleValue(event, null, 'clear');
775
- }
776
- } else {
777
- handleOpen(event);
778
- }
779
- };
780
- const handleOptionMouseMove = event => {
781
- const index = Number(event.currentTarget.getAttribute('data-option-index'));
782
- if (highlightedIndexRef.current !== index) {
783
- setHighlightedIndex({
784
- event,
785
- index,
786
- reason: 'mouse'
787
- });
788
- }
789
- };
790
- const handleOptionTouchStart = event => {
791
- setHighlightedIndex({
792
- event,
793
- index: Number(event.currentTarget.getAttribute('data-option-index')),
794
- reason: 'touch'
795
- });
796
- isTouch.current = true;
797
- };
798
- const handleOptionClick = event => {
799
- const index = Number(event.currentTarget.getAttribute('data-option-index'));
800
- selectNewValue(event, filteredOptions[index], 'selectOption');
801
- isTouch.current = false;
802
- };
803
- const handleTagDelete = index => event => {
804
- const newValue = value.slice();
805
- newValue.splice(index, 1);
806
- handleValue(event, newValue, 'removeOption', {
807
- option: value[index]
808
- });
809
- };
810
- const handlePopupIndicator = event => {
811
- if (open) {
812
- handleClose(event, 'toggleInput');
813
- } else {
814
- handleOpen(event);
815
- }
816
- };
817
-
818
- // Prevent input blur when interacting with the combobox
819
- const handleMouseDown = event => {
820
- // Prevent focusing the input if click is anywhere outside the Autocomplete
821
- if (!event.currentTarget.contains(event.target)) {
822
- return;
823
- }
824
- if (event.target.getAttribute('id') !== id) {
825
- event.preventDefault();
826
- }
827
- };
828
-
829
- // Focus the input when interacting with the combobox
830
- const handleClick = event => {
831
- // Prevent focusing the input if click is anywhere outside the Autocomplete
832
- if (!event.currentTarget.contains(event.target)) {
833
- return;
834
- }
835
- inputRef.current.focus();
836
- if (selectOnFocus && firstFocus.current && inputRef.current.selectionEnd - inputRef.current.selectionStart === 0) {
837
- inputRef.current.select();
838
- }
839
- firstFocus.current = false;
840
- };
841
- const handleInputMouseDown = event => {
842
- if (!disabledProp && (inputValue === '' || !open)) {
843
- handlePopupIndicator(event);
844
- }
845
- };
846
- let dirty = freeSolo && inputValue.length > 0;
847
- dirty = dirty || (multiple ? value.length > 0 : value !== null);
848
- let groupedOptions = filteredOptions;
849
- if (groupBy) {
850
- // used to keep track of key and indexes in the result array
851
- const indexBy = new Map();
852
- let warn = false;
853
- groupedOptions = filteredOptions.reduce((acc, option, index) => {
854
- const group = groupBy(option);
855
- if (acc.length > 0 && acc[acc.length - 1].group === group) {
856
- acc[acc.length - 1].options.push(option);
857
- } else {
858
- if (process.env.NODE_ENV !== 'production') {
859
- if (indexBy.get(group) && !warn) {
860
- console.warn(`MUI: The options provided combined with the \`groupBy\` method of ${componentName} returns duplicated headers.`, 'You can solve the issue by sorting the options with the output of `groupBy`.');
861
- warn = true;
862
- }
863
- indexBy.set(group, true);
864
- }
865
- acc.push({
866
- key: index,
867
- index,
868
- group,
869
- options: [option]
870
- });
871
- }
872
- return acc;
873
- }, []);
874
- }
875
- if (disabledProp && focused) {
876
- handleBlur();
877
- }
878
- return {
879
- getRootProps: (other = {}) => ({
880
- ...other,
881
- onKeyDown: handleKeyDown(other),
882
- onMouseDown: handleMouseDown,
883
- onClick: handleClick
884
- }),
885
- getInputLabelProps: () => ({
886
- id: `${id}-label`,
887
- htmlFor: id
888
- }),
889
- getInputProps: () => ({
890
- id,
891
- value: inputValue,
892
- onBlur: handleBlur,
893
- onFocus: handleFocus,
894
- onChange: handleInputChange,
895
- onMouseDown: handleInputMouseDown,
896
- // if open then this is handled imperatively so don't let react override
897
- // only have an opinion about this when closed
898
- 'aria-activedescendant': popupOpen ? '' : null,
899
- 'aria-autocomplete': autoComplete ? 'both' : 'list',
900
- 'aria-controls': listboxAvailable ? `${id}-listbox` : undefined,
901
- 'aria-expanded': listboxAvailable,
902
- // Disable browser's suggestion that might overlap with the popup.
903
- // Handle autocomplete but not autofill.
904
- autoComplete: 'off',
905
- ref: inputRef,
906
- autoCapitalize: 'none',
907
- spellCheck: 'false',
908
- role: 'combobox',
909
- disabled: disabledProp
910
- }),
911
- getClearProps: () => ({
912
- tabIndex: -1,
913
- type: 'button',
914
- onClick: handleClear
915
- }),
916
- getPopupIndicatorProps: () => ({
917
- tabIndex: -1,
918
- type: 'button',
919
- onClick: handlePopupIndicator
920
- }),
921
- getTagProps: ({
922
- index
923
- }) => ({
924
- key: index,
925
- 'data-tag-index': index,
926
- tabIndex: -1,
927
- ...(!readOnly && {
928
- onDelete: handleTagDelete(index)
929
- })
930
- }),
931
- getListboxProps: () => ({
932
- role: 'listbox',
933
- id: `${id}-listbox`,
934
- 'aria-labelledby': `${id}-label`,
935
- ref: handleListboxRef,
936
- onMouseDown: event => {
937
- // Prevent blur
938
- event.preventDefault();
939
- }
940
- }),
941
- getOptionProps: ({
942
- index,
943
- option
944
- }) => {
945
- const selected = (multiple ? value : [value]).some(value2 => value2 != null && isOptionEqualToValue(option, value2));
946
- const disabled = getOptionDisabled ? getOptionDisabled(option) : false;
947
- return {
948
- key: getOptionKey?.(option) ?? getOptionLabel(option),
949
- tabIndex: -1,
950
- role: 'option',
951
- id: `${id}-option-${index}`,
952
- onMouseMove: handleOptionMouseMove,
953
- onClick: handleOptionClick,
954
- onTouchStart: handleOptionTouchStart,
955
- 'data-option-index': index,
956
- 'aria-disabled': disabled,
957
- 'aria-selected': selected
958
- };
959
- },
960
- id,
961
- inputValue,
962
- value,
963
- dirty,
964
- expanded: popupOpen && anchorEl,
965
- popupOpen,
966
- focused: focused || focusedTag !== -1,
967
- anchorEl,
968
- setAnchorEl,
969
- focusedTag,
970
- groupedOptions
971
- };
972
- }
973
- export default useAutocomplete;