@mui/material 6.0.0-alpha.5 → 6.0.0-alpha.7

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 (274) hide show
  1. package/Accordion/Accordion.d.ts +2 -2
  2. package/Accordion/Accordion.js +2 -2
  3. package/AccordionSummary/accordionSummaryClasses.d.ts +1 -1
  4. package/Alert/Alert.d.ts +2 -2
  5. package/Alert/Alert.js +2 -2
  6. package/Alert/alertClasses.d.ts +12 -12
  7. package/Autocomplete/Autocomplete.d.ts +78 -12
  8. package/Autocomplete/Autocomplete.js +120 -59
  9. package/Avatar/Avatar.d.ts +1 -1
  10. package/Avatar/Avatar.js +1 -1
  11. package/Backdrop/Backdrop.d.ts +1 -1
  12. package/Backdrop/Backdrop.js +1 -1
  13. package/Badge/Badge.d.ts +2 -2
  14. package/Badge/Badge.js +2 -2
  15. package/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
  16. package/Button/Button.js +1 -1
  17. package/Button/buttonClasses.d.ts +33 -33
  18. package/ButtonGroup/buttonGroupClasses.d.ts +17 -17
  19. package/CHANGELOG.md +95 -0
  20. package/Checkbox/Checkbox.js +3 -1
  21. package/Chip/chipClasses.d.ts +28 -26
  22. package/Chip/chipClasses.js +1 -1
  23. package/CircularProgress/circularProgressClasses.d.ts +6 -2
  24. package/Collapse/Collapse.js +66 -35
  25. package/Dialog/Dialog.js +105 -61
  26. package/DialogActions/DialogActions.js +16 -12
  27. package/DialogContent/DialogContent.js +25 -15
  28. package/DialogContentText/DialogContentText.js +3 -2
  29. package/DialogTitle/DialogTitle.js +2 -2
  30. package/Divider/Divider.d.ts +1 -1
  31. package/Divider/Divider.js +1 -1
  32. package/Drawer/Drawer.js +73 -32
  33. package/Fab/Fab.js +1 -1
  34. package/FilledInput/FilledInput.d.ts +1 -0
  35. package/FilledInput/FilledInput.js +170 -87
  36. package/FormControlLabel/FormControlLabel.d.ts +1 -1
  37. package/FormControlLabel/FormControlLabel.js +1 -1
  38. package/FormHelperText/FormHelperText.js +2 -2
  39. package/FormLabel/FormLabel.js +23 -13
  40. package/Grow/Grow.js +3 -1
  41. package/Icon/Icon.js +63 -23
  42. package/ImageList/ImageList.js +2 -2
  43. package/ImageListItem/ImageListItem.js +2 -2
  44. package/ImageListItemBar/ImageListItemBar.js +2 -2
  45. package/Input/Input.d.ts +1 -0
  46. package/Input/Input.js +84 -61
  47. package/InputAdornment/InputAdornment.js +37 -21
  48. package/InputBase/InputBase.js +58 -28
  49. package/InputLabel/InputLabel.js +120 -58
  50. package/Link/Link.js +99 -54
  51. package/Link/getTextDecoration.d.ts +2 -8
  52. package/Link/getTextDecoration.js +16 -8
  53. package/List/List.js +22 -13
  54. package/ListItem/ListItem.js +2 -2
  55. package/ListItemAvatar/ListItemAvatar.js +2 -2
  56. package/ListItemButton/ListItemButton.js +3 -2
  57. package/ListItemIcon/ListItemIcon.js +14 -9
  58. package/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
  59. package/ListItemText/ListItemText.js +2 -2
  60. package/ListSubheader/ListSubheader.js +5 -3
  61. package/Menu/Menu.js +3 -2
  62. package/MenuItem/MenuItem.js +47 -27
  63. package/NativeSelect/NativeSelectInput.js +78 -49
  64. package/OutlinedInput/NotchedOutline.js +60 -43
  65. package/OutlinedInput/OutlinedInput.js +97 -39
  66. package/Pagination/Pagination.js +2 -2
  67. package/PaginationItem/PaginationItem.d.ts +1 -1
  68. package/PaginationItem/PaginationItem.js +1 -1
  69. package/PaginationItem/paginationItemClasses.d.ts +4 -4
  70. package/Paper/Paper.js +44 -21
  71. package/Radio/Radio.js +5 -3
  72. package/Radio/RadioButtonIcon.js +1 -1
  73. package/Rating/Rating.js +3 -2
  74. package/Select/Select.js +2 -1
  75. package/Select/SelectInput.js +8 -6
  76. package/Skeleton/Skeleton.js +109 -61
  77. package/Slider/Slider.d.ts +2 -2
  78. package/Slider/Slider.js +2 -2
  79. package/Snackbar/Snackbar.js +66 -40
  80. package/SnackbarContent/SnackbarContent.js +2 -2
  81. package/SpeedDial/SpeedDial.d.ts +28 -1
  82. package/SpeedDial/SpeedDial.js +107 -49
  83. package/SpeedDialAction/SpeedDialAction.js +50 -24
  84. package/SpeedDialIcon/SpeedDialIcon.js +37 -16
  85. package/StepConnector/stepConnectorClasses.d.ts +2 -2
  86. package/StepLabel/StepLabel.d.ts +3 -3
  87. package/StepLabel/StepLabel.js +3 -3
  88. package/SwipeableDrawer/SwipeArea.js +39 -18
  89. package/Tab/Tab.js +127 -55
  90. package/TabScrollButton/TabScrollButton.js +27 -15
  91. package/Table/Table.js +2 -2
  92. package/TableBody/TableBody.js +2 -2
  93. package/TableCell/TableCell.js +2 -2
  94. package/TableContainer/TableContainer.js +2 -2
  95. package/TableFooter/TableFooter.js +2 -2
  96. package/TableHead/TableHead.js +2 -2
  97. package/TablePagination/TablePagination.js +2 -2
  98. package/TableRow/TableRow.js +2 -2
  99. package/TableSortLabel/TableSortLabel.js +2 -2
  100. package/Tabs/Tabs.js +107 -54
  101. package/TextField/TextField.js +2 -2
  102. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +4 -2
  103. package/Toolbar/Toolbar.js +3 -7
  104. package/Tooltip/Tooltip.js +185 -88
  105. package/Typography/Typography.js +89 -39
  106. package/index.js +1 -1
  107. package/internal/SwitchBase.js +39 -11
  108. package/modern/Accordion/Accordion.js +2 -2
  109. package/modern/Alert/Alert.js +2 -2
  110. package/modern/Autocomplete/Autocomplete.js +120 -59
  111. package/modern/Avatar/Avatar.js +1 -1
  112. package/modern/Backdrop/Backdrop.js +1 -1
  113. package/modern/Badge/Badge.js +2 -2
  114. package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
  115. package/modern/Button/Button.js +1 -1
  116. package/modern/Checkbox/Checkbox.js +3 -1
  117. package/modern/Chip/chipClasses.js +1 -1
  118. package/modern/Collapse/Collapse.js +66 -35
  119. package/modern/Dialog/Dialog.js +105 -61
  120. package/modern/DialogActions/DialogActions.js +16 -12
  121. package/modern/DialogContent/DialogContent.js +25 -15
  122. package/modern/DialogContentText/DialogContentText.js +3 -2
  123. package/modern/DialogTitle/DialogTitle.js +2 -2
  124. package/modern/Divider/Divider.js +1 -1
  125. package/modern/Drawer/Drawer.js +73 -32
  126. package/modern/Fab/Fab.js +1 -1
  127. package/modern/FilledInput/FilledInput.js +170 -87
  128. package/modern/FormControlLabel/FormControlLabel.js +1 -1
  129. package/modern/FormHelperText/FormHelperText.js +2 -2
  130. package/modern/FormLabel/FormLabel.js +23 -13
  131. package/modern/Grow/Grow.js +3 -1
  132. package/modern/Icon/Icon.js +63 -23
  133. package/modern/ImageList/ImageList.js +2 -2
  134. package/modern/ImageListItem/ImageListItem.js +2 -2
  135. package/modern/ImageListItemBar/ImageListItemBar.js +2 -2
  136. package/modern/Input/Input.js +84 -61
  137. package/modern/InputAdornment/InputAdornment.js +37 -21
  138. package/modern/InputBase/InputBase.js +58 -28
  139. package/modern/InputLabel/InputLabel.js +120 -58
  140. package/modern/Link/Link.js +99 -54
  141. package/modern/Link/getTextDecoration.js +16 -8
  142. package/modern/List/List.js +22 -13
  143. package/modern/ListItem/ListItem.js +2 -2
  144. package/modern/ListItemAvatar/ListItemAvatar.js +2 -2
  145. package/modern/ListItemButton/ListItemButton.js +3 -2
  146. package/modern/ListItemIcon/ListItemIcon.js +14 -9
  147. package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
  148. package/modern/ListItemText/ListItemText.js +2 -2
  149. package/modern/ListSubheader/ListSubheader.js +5 -3
  150. package/modern/Menu/Menu.js +3 -2
  151. package/modern/MenuItem/MenuItem.js +47 -27
  152. package/modern/NativeSelect/NativeSelectInput.js +78 -49
  153. package/modern/OutlinedInput/NotchedOutline.js +60 -43
  154. package/modern/OutlinedInput/OutlinedInput.js +97 -39
  155. package/modern/Pagination/Pagination.js +2 -2
  156. package/modern/PaginationItem/PaginationItem.js +1 -1
  157. package/modern/Paper/Paper.js +44 -21
  158. package/modern/Radio/Radio.js +5 -3
  159. package/modern/Radio/RadioButtonIcon.js +1 -1
  160. package/modern/Rating/Rating.js +3 -2
  161. package/modern/Select/Select.js +2 -1
  162. package/modern/Select/SelectInput.js +8 -6
  163. package/modern/Skeleton/Skeleton.js +109 -61
  164. package/modern/Slider/Slider.js +2 -2
  165. package/modern/Snackbar/Snackbar.js +66 -40
  166. package/modern/SnackbarContent/SnackbarContent.js +2 -2
  167. package/modern/SpeedDial/SpeedDial.js +107 -49
  168. package/modern/SpeedDialAction/SpeedDialAction.js +50 -24
  169. package/modern/SpeedDialIcon/SpeedDialIcon.js +37 -16
  170. package/modern/StepLabel/StepLabel.js +3 -3
  171. package/modern/SwipeableDrawer/SwipeArea.js +39 -18
  172. package/modern/Tab/Tab.js +127 -55
  173. package/modern/TabScrollButton/TabScrollButton.js +27 -15
  174. package/modern/Table/Table.js +2 -2
  175. package/modern/TableBody/TableBody.js +2 -2
  176. package/modern/TableCell/TableCell.js +2 -2
  177. package/modern/TableContainer/TableContainer.js +2 -2
  178. package/modern/TableFooter/TableFooter.js +2 -2
  179. package/modern/TableHead/TableHead.js +2 -2
  180. package/modern/TablePagination/TablePagination.js +2 -2
  181. package/modern/TableRow/TableRow.js +2 -2
  182. package/modern/TableSortLabel/TableSortLabel.js +2 -2
  183. package/modern/Tabs/Tabs.js +107 -54
  184. package/modern/TextField/TextField.js +2 -2
  185. package/modern/Toolbar/Toolbar.js +3 -7
  186. package/modern/Tooltip/Tooltip.js +185 -88
  187. package/modern/Typography/Typography.js +89 -39
  188. package/modern/index.js +1 -1
  189. package/modern/internal/SwitchBase.js +39 -11
  190. package/node/Accordion/Accordion.js +2 -2
  191. package/node/Alert/Alert.js +2 -2
  192. package/node/Autocomplete/Autocomplete.js +120 -60
  193. package/node/Avatar/Avatar.js +1 -1
  194. package/node/Backdrop/Backdrop.js +1 -1
  195. package/node/Badge/Badge.js +2 -2
  196. package/node/Breadcrumbs/BreadcrumbCollapsed.js +3 -3
  197. package/node/Button/Button.js +2 -2
  198. package/node/Checkbox/Checkbox.js +3 -1
  199. package/node/Chip/chipClasses.js +1 -1
  200. package/node/Collapse/Collapse.js +70 -39
  201. package/node/Dialog/Dialog.js +110 -66
  202. package/node/DialogActions/DialogActions.js +18 -14
  203. package/node/DialogContent/DialogContent.js +27 -17
  204. package/node/DialogContentText/DialogContentText.js +6 -5
  205. package/node/DialogTitle/DialogTitle.js +4 -4
  206. package/node/Divider/Divider.js +1 -1
  207. package/node/Drawer/Drawer.js +78 -37
  208. package/node/Fab/Fab.js +2 -2
  209. package/node/FilledInput/FilledInput.js +176 -91
  210. package/node/FormControlLabel/FormControlLabel.js +1 -1
  211. package/node/FormHelperText/FormHelperText.js +4 -4
  212. package/node/FormLabel/FormLabel.js +26 -16
  213. package/node/Grow/Grow.js +3 -1
  214. package/node/Icon/Icon.js +65 -25
  215. package/node/ImageList/ImageList.js +4 -4
  216. package/node/ImageListItem/ImageListItem.js +4 -4
  217. package/node/ImageListItemBar/ImageListItemBar.js +8 -8
  218. package/node/Input/Input.js +87 -64
  219. package/node/InputAdornment/InputAdornment.js +39 -23
  220. package/node/InputBase/InputBase.js +61 -31
  221. package/node/InputLabel/InputLabel.js +123 -61
  222. package/node/Link/Link.js +101 -56
  223. package/node/Link/getTextDecoration.js +18 -10
  224. package/node/List/List.js +24 -15
  225. package/node/ListItem/ListItem.js +5 -5
  226. package/node/ListItemAvatar/ListItemAvatar.js +4 -4
  227. package/node/ListItemButton/ListItemButton.js +6 -5
  228. package/node/ListItemIcon/ListItemIcon.js +16 -11
  229. package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +4 -4
  230. package/node/ListItemText/ListItemText.js +4 -4
  231. package/node/ListSubheader/ListSubheader.js +7 -5
  232. package/node/Menu/Menu.js +8 -7
  233. package/node/MenuItem/MenuItem.js +50 -30
  234. package/node/NativeSelect/NativeSelectInput.js +80 -53
  235. package/node/OutlinedInput/NotchedOutline.js +64 -47
  236. package/node/OutlinedInput/OutlinedInput.js +101 -43
  237. package/node/Pagination/Pagination.js +5 -5
  238. package/node/PaginationItem/PaginationItem.js +1 -1
  239. package/node/Paper/Paper.js +49 -28
  240. package/node/Radio/Radio.js +6 -4
  241. package/node/Radio/RadioButtonIcon.js +2 -2
  242. package/node/Rating/Rating.js +9 -8
  243. package/node/Select/Select.js +6 -5
  244. package/node/Select/SelectInput.js +9 -7
  245. package/node/Skeleton/Skeleton.js +113 -65
  246. package/node/Slider/Slider.js +2 -2
  247. package/node/Snackbar/Snackbar.js +68 -42
  248. package/node/SnackbarContent/SnackbarContent.js +6 -6
  249. package/node/SpeedDial/SpeedDial.js +111 -53
  250. package/node/SpeedDialAction/SpeedDialAction.js +54 -28
  251. package/node/SpeedDialIcon/SpeedDialIcon.js +39 -18
  252. package/node/StepLabel/StepLabel.js +3 -3
  253. package/node/SwipeableDrawer/SwipeArea.js +41 -20
  254. package/node/Tab/Tab.js +129 -57
  255. package/node/TabScrollButton/TabScrollButton.js +29 -17
  256. package/node/Table/Table.js +4 -4
  257. package/node/TableBody/TableBody.js +4 -4
  258. package/node/TableCell/TableCell.js +4 -4
  259. package/node/TableContainer/TableContainer.js +4 -4
  260. package/node/TableFooter/TableFooter.js +4 -4
  261. package/node/TableHead/TableHead.js +4 -4
  262. package/node/TablePagination/TablePagination.js +10 -10
  263. package/node/TableRow/TableRow.js +4 -4
  264. package/node/TableSortLabel/TableSortLabel.js +5 -5
  265. package/node/Tabs/Tabs.js +113 -60
  266. package/node/TextField/TextField.js +4 -4
  267. package/node/Toolbar/Toolbar.js +5 -9
  268. package/node/Tooltip/Tooltip.js +189 -92
  269. package/node/Typography/Typography.js +90 -40
  270. package/node/index.js +1 -1
  271. package/node/internal/SwitchBase.js +41 -13
  272. package/package.json +6 -6
  273. package/umd/material-ui.development.js +2705 -1353
  274. package/umd/material-ui.production.min.js +4 -4
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["className", "disabled", "error", "IconComponent", "inputRef", "variant"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
@@ -10,7 +10,8 @@ import refType from '@mui/utils/refType';
10
10
  import composeClasses from '@mui/utils/composeClasses';
11
11
  import capitalize from '../utils/capitalize';
12
12
  import nativeSelectClasses, { getNativeSelectUtilityClasses } from './nativeSelectClasses';
13
- import styled, { rootShouldForwardProp } from '../styles/styled';
13
+ import { styled } from '../zero-styled';
14
+ import rootShouldForwardProp from '../styles/rootShouldForwardProp';
14
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
16
  const useUtilityClasses = ownerState => {
16
17
  const {
@@ -27,27 +28,23 @@ const useUtilityClasses = ownerState => {
27
28
  };
28
29
  return composeClasses(slots, getNativeSelectUtilityClasses, classes);
29
30
  };
30
- export const nativeSelectSelectStyles = ({
31
- ownerState,
31
+ export const StyledSelectSelect = styled('select')(({
32
32
  theme
33
- }) => _extends({
33
+ }) => ({
34
+ // Reset
34
35
  MozAppearance: 'none',
35
36
  // Reset
36
37
  WebkitAppearance: 'none',
37
- // Reset
38
38
  // When interacting quickly, the text can end up selected.
39
39
  // Native select can't be selected either.
40
40
  userSelect: 'none',
41
- borderRadius: 0,
42
41
  // Reset
42
+ borderRadius: 0,
43
43
  cursor: 'pointer',
44
- '&:focus': _extends({}, theme.vars ? {
45
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.05)`
46
- } : {
47
- backgroundColor: theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)'
48
- }, {
49
- borderRadius: 0 // Reset Chrome style
50
- }),
44
+ '&:focus': {
45
+ // Reset Chrome style
46
+ borderRadius: 0
47
+ },
51
48
  // Remove IE11 arrow
52
49
  '&::-ms-expand': {
53
50
  display: 'none'
@@ -61,25 +58,42 @@ export const nativeSelectSelectStyles = ({
61
58
  '&:not([multiple]) option, &:not([multiple]) optgroup': {
62
59
  backgroundColor: (theme.vars || theme).palette.background.paper
63
60
  },
64
- // Bump specificity to allow extending custom inputs
65
- '&&&': {
66
- paddingRight: 24,
67
- minWidth: 16 // So it doesn't collapse.
68
- }
69
- }, ownerState.variant === 'filled' && {
70
- '&&&': {
71
- paddingRight: 32
72
- }
73
- }, ownerState.variant === 'outlined' && {
74
- borderRadius: (theme.vars || theme).shape.borderRadius,
75
- '&:focus': {
76
- borderRadius: (theme.vars || theme).shape.borderRadius // Reset the reset for Chrome style
77
- },
78
- '&&&': {
79
- paddingRight: 32
80
- }
81
- });
82
- const NativeSelectSelect = styled('select', {
61
+ variants: [{
62
+ props: ({
63
+ ownerState
64
+ }) => ownerState.variant !== 'filled' && ownerState.variant !== 'outlined',
65
+ style: {
66
+ // Bump specificity to allow extending custom inputs
67
+ '&&&': {
68
+ paddingRight: 24,
69
+ minWidth: 16 // So it doesn't collapse.
70
+ }
71
+ }
72
+ }, {
73
+ props: {
74
+ variant: 'filled'
75
+ },
76
+ style: {
77
+ '&&&': {
78
+ paddingRight: 32
79
+ }
80
+ }
81
+ }, {
82
+ props: {
83
+ variant: 'outlined'
84
+ },
85
+ style: {
86
+ borderRadius: (theme.vars || theme).shape.borderRadius,
87
+ '&:focus': {
88
+ borderRadius: (theme.vars || theme).shape.borderRadius // Reset the reset for Chrome style
89
+ },
90
+ '&&&': {
91
+ paddingRight: 32
92
+ }
93
+ }
94
+ }]
95
+ }));
96
+ const NativeSelectSelect = styled(StyledSelectSelect, {
83
97
  name: 'MuiNativeSelect',
84
98
  slot: 'Select',
85
99
  shouldForwardProp: rootShouldForwardProp,
@@ -91,31 +105,46 @@ const NativeSelectSelect = styled('select', {
91
105
  [`&.${nativeSelectClasses.multiple}`]: styles.multiple
92
106
  }];
93
107
  }
94
- })(nativeSelectSelectStyles);
95
- export const nativeSelectIconStyles = ({
96
- ownerState,
108
+ })({});
109
+ export const StyledSelectIcon = styled('svg')(({
97
110
  theme
98
- }) => _extends({
111
+ }) => ({
99
112
  // We use a position absolute over a flexbox in order to forward the pointer events
100
113
  // to the input and to support wrapping tags..
101
114
  position: 'absolute',
102
115
  right: 0,
103
- top: 'calc(50% - .5em)',
104
116
  // Center vertically, height is 1em
105
- pointerEvents: 'none',
117
+ top: 'calc(50% - .5em)',
106
118
  // Don't block pointer events on the select under the icon.
119
+ pointerEvents: 'none',
107
120
  color: (theme.vars || theme).palette.action.active,
108
121
  [`&.${nativeSelectClasses.disabled}`]: {
109
122
  color: (theme.vars || theme).palette.action.disabled
110
- }
111
- }, ownerState.open && {
112
- transform: 'rotate(180deg)'
113
- }, ownerState.variant === 'filled' && {
114
- right: 7
115
- }, ownerState.variant === 'outlined' && {
116
- right: 7
117
- });
118
- const NativeSelectIcon = styled('svg', {
123
+ },
124
+ variants: [{
125
+ props: ({
126
+ ownerState
127
+ }) => ownerState.open,
128
+ style: {
129
+ transform: 'rotate(180deg)'
130
+ }
131
+ }, {
132
+ props: {
133
+ variant: 'filled'
134
+ },
135
+ style: {
136
+ right: 7
137
+ }
138
+ }, {
139
+ props: {
140
+ variant: 'outlined'
141
+ },
142
+ style: {
143
+ right: 7
144
+ }
145
+ }]
146
+ }));
147
+ const NativeSelectIcon = styled(StyledSelectIcon, {
119
148
  name: 'MuiNativeSelect',
120
149
  slot: 'Icon',
121
150
  overridesResolver: (props, styles) => {
@@ -124,7 +153,7 @@ const NativeSelectIcon = styled('svg', {
124
153
  } = props;
125
154
  return [styles.icon, ownerState.variant && styles[`icon${capitalize(ownerState.variant)}`], ownerState.open && styles.iconOpen];
126
155
  }
127
- })(nativeSelectIconStyles);
156
+ })({});
128
157
 
129
158
  /**
130
159
  * @ignore - internal component.
@@ -1,12 +1,13 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  var _span;
6
6
  const _excluded = ["children", "classes", "className", "label", "notched"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
- import styled, { rootShouldForwardProp } from '../styles/styled';
9
+ import rootShouldForwardProp from '../styles/rootShouldForwardProp';
10
+ import { styled } from '../zero-styled';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const NotchedOutlineRoot = styled('fieldset', {
12
13
  shouldForwardProp: rootShouldForwardProp
@@ -29,51 +30,67 @@ const NotchedOutlineRoot = styled('fieldset', {
29
30
  const NotchedOutlineLegend = styled('legend', {
30
31
  shouldForwardProp: rootShouldForwardProp
31
32
  })(({
32
- ownerState,
33
33
  theme
34
- }) => _extends({
34
+ }) => ({
35
35
  float: 'unset',
36
36
  // Fix conflict with bootstrap
37
37
  width: 'auto',
38
38
  // Fix conflict with bootstrap
39
- overflow: 'hidden'
40
- }, !ownerState.withLabel && {
41
- padding: 0,
42
- lineHeight: '11px',
43
- // sync with `height` in `legend` styles
44
- transition: theme.transitions.create('width', {
45
- duration: 150,
46
- easing: theme.transitions.easing.easeOut
47
- })
48
- }, ownerState.withLabel && _extends({
49
- display: 'block',
50
- // Fix conflict with normalize.css and sanitize.css
51
- padding: 0,
52
- height: 11,
53
- // sync with `lineHeight` in `legend` styles
54
- fontSize: '0.75em',
55
- visibility: 'hidden',
56
- maxWidth: 0.01,
57
- transition: theme.transitions.create('max-width', {
58
- duration: 50,
59
- easing: theme.transitions.easing.easeOut
60
- }),
61
- whiteSpace: 'nowrap',
62
- '& > span': {
63
- paddingLeft: 5,
64
- paddingRight: 5,
65
- display: 'inline-block',
66
- opacity: 0,
67
- visibility: 'visible'
68
- }
69
- }, ownerState.notched && {
70
- maxWidth: '100%',
71
- transition: theme.transitions.create('max-width', {
72
- duration: 100,
73
- easing: theme.transitions.easing.easeOut,
74
- delay: 50
75
- })
76
- })));
39
+ overflow: 'hidden',
40
+ // Fix Horizontal scroll when label too long
41
+ variants: [{
42
+ props: ({
43
+ ownerState
44
+ }) => !ownerState.withLabel,
45
+ style: {
46
+ padding: 0,
47
+ lineHeight: '11px',
48
+ // sync with `height` in `legend` styles
49
+ transition: theme.transitions.create('width', {
50
+ duration: 150,
51
+ easing: theme.transitions.easing.easeOut
52
+ })
53
+ }
54
+ }, {
55
+ props: ({
56
+ ownerState
57
+ }) => ownerState.withLabel,
58
+ style: {
59
+ display: 'block',
60
+ // Fix conflict with normalize.css and sanitize.css
61
+ padding: 0,
62
+ height: 11,
63
+ // sync with `lineHeight` in `legend` styles
64
+ fontSize: '0.75em',
65
+ visibility: 'hidden',
66
+ maxWidth: 0.01,
67
+ transition: theme.transitions.create('max-width', {
68
+ duration: 50,
69
+ easing: theme.transitions.easing.easeOut
70
+ }),
71
+ whiteSpace: 'nowrap',
72
+ '& > span': {
73
+ paddingLeft: 5,
74
+ paddingRight: 5,
75
+ display: 'inline-block',
76
+ opacity: 0,
77
+ visibility: 'visible'
78
+ }
79
+ }
80
+ }, {
81
+ props: ({
82
+ ownerState
83
+ }) => ownerState.withLabel && ownerState.notched,
84
+ style: {
85
+ maxWidth: '100%',
86
+ transition: theme.transitions.create('max-width', {
87
+ duration: 100,
88
+ easing: theme.transitions.easing.easeOut,
89
+ delay: 50
90
+ })
91
+ }
92
+ }]
93
+ }));
77
94
 
78
95
  /**
79
96
  * @ignore - internal component.
@@ -107,7 +124,7 @@ export default function NotchedOutline(props) {
107
124
  })
108
125
  }));
109
126
  }
110
- process.env.NODE_ENV !== "production" ? NotchedOutline.propTypes = {
127
+ process.env.NODE_ENV !== "production" ? NotchedOutline.propTypes /* remove-proptypes */ = {
111
128
  /**
112
129
  * The content of the component.
113
130
  */
@@ -10,11 +10,12 @@ import composeClasses from '@mui/utils/composeClasses';
10
10
  import NotchedOutline from './NotchedOutline';
11
11
  import useFormControl from '../FormControl/useFormControl';
12
12
  import formControlState from '../FormControl/formControlState';
13
- import styled, { rootShouldForwardProp } from '../styles/styled';
13
+ import rootShouldForwardProp from '../styles/rootShouldForwardProp';
14
+ import { styled, createUseThemeProps } from '../zero-styled';
14
15
  import outlinedInputClasses, { getOutlinedInputUtilityClass } from './outlinedInputClasses';
15
- import InputBase, { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot, InputBaseComponent as InputBaseInput } from '../InputBase/InputBase';
16
- import useThemeProps from '../styles/useThemeProps';
16
+ import InputBase, { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot, InputBaseInput } from '../InputBase/InputBase';
17
17
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
18
+ const useThemeProps = createUseThemeProps('MuiOutlinedInput');
18
19
  const useUtilityClasses = ownerState => {
19
20
  const {
20
21
  classes
@@ -33,41 +34,75 @@ const OutlinedInputRoot = styled(InputBaseRoot, {
33
34
  slot: 'Root',
34
35
  overridesResolver: inputBaseRootOverridesResolver
35
36
  })(({
36
- theme,
37
- ownerState
37
+ theme
38
38
  }) => {
39
39
  const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
40
- return _extends({
40
+ return {
41
41
  position: 'relative',
42
42
  borderRadius: (theme.vars || theme).shape.borderRadius,
43
43
  [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
44
44
  borderColor: (theme.vars || theme).palette.text.primary
45
45
  },
46
- // Reset on touch devices, it doesn't add specificity
47
- '@media (hover: none)': {
48
- [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
49
- borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
50
- }
51
- },
52
46
  [`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: {
53
- borderColor: (theme.vars || theme).palette[ownerState.color].main,
54
47
  borderWidth: 2
55
48
  },
56
- [`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]: {
57
- borderColor: (theme.vars || theme).palette.error.main
58
- },
59
- [`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]: {
60
- borderColor: (theme.vars || theme).palette.action.disabled
61
- }
62
- }, ownerState.startAdornment && {
63
- paddingLeft: 14
64
- }, ownerState.endAdornment && {
65
- paddingRight: 14
66
- }, ownerState.multiline && _extends({
67
- padding: '16.5px 14px'
68
- }, ownerState.size === 'small' && {
69
- padding: '8.5px 14px'
70
- }));
49
+ variants: [...Object.entries(theme.palette).filter(([, value]) => value.main).map(([color]) => ({
50
+ props: {
51
+ color
52
+ },
53
+ style: {
54
+ [`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: {
55
+ borderColor: (theme.vars || theme).palette[color].main
56
+ }
57
+ }
58
+ })), {
59
+ props: {},
60
+ // to overide the above style
61
+ style: {
62
+ // Reset on touch devices, it doesn't add specificity
63
+ '@media (hover: none)': {
64
+ [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
65
+ borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
66
+ }
67
+ },
68
+ [`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]: {
69
+ borderColor: (theme.vars || theme).palette.error.main
70
+ },
71
+ [`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]: {
72
+ borderColor: (theme.vars || theme).palette.action.disabled
73
+ }
74
+ }
75
+ }, {
76
+ props: ({
77
+ ownerState
78
+ }) => ownerState.startAdornment,
79
+ style: {
80
+ paddingLeft: 14
81
+ }
82
+ }, {
83
+ props: ({
84
+ ownerState
85
+ }) => ownerState.endAdornment,
86
+ style: {
87
+ paddingRight: 14
88
+ }
89
+ }, {
90
+ props: ({
91
+ ownerState
92
+ }) => ownerState.multiline,
93
+ style: {
94
+ padding: '16.5px 14px'
95
+ }
96
+ }, {
97
+ props: ({
98
+ ownerState,
99
+ size
100
+ }) => ownerState.multiline && size === 'small',
101
+ style: {
102
+ padding: '8.5px 14px'
103
+ }
104
+ }]
105
+ };
71
106
  });
72
107
  const NotchedOutlineRoot = styled(NotchedOutline, {
73
108
  name: 'MuiOutlinedInput',
@@ -86,8 +121,7 @@ const OutlinedInputInput = styled(InputBaseInput, {
86
121
  slot: 'Input',
87
122
  overridesResolver: inputBaseInputOverridesResolver
88
123
  })(({
89
- theme,
90
- ownerState
124
+ theme
91
125
  }) => _extends({
92
126
  padding: '16.5px 14px'
93
127
  }, !theme.vars && {
@@ -108,14 +142,36 @@ const OutlinedInputInput = styled(InputBaseInput, {
108
142
  caretColor: '#fff'
109
143
  }
110
144
  }
111
- }, ownerState.size === 'small' && {
112
- padding: '8.5px 14px'
113
- }, ownerState.multiline && {
114
- padding: 0
115
- }, ownerState.startAdornment && {
116
- paddingLeft: 0
117
- }, ownerState.endAdornment && {
118
- paddingRight: 0
145
+ }, {
146
+ variants: [{
147
+ props: {
148
+ size: 'small'
149
+ },
150
+ style: {
151
+ padding: '8.5px 14px'
152
+ }
153
+ }, {
154
+ props: ({
155
+ ownerState
156
+ }) => ownerState.multiline,
157
+ style: {
158
+ padding: 0
159
+ }
160
+ }, {
161
+ props: ({
162
+ ownerState
163
+ }) => ownerState.startAdornment,
164
+ style: {
165
+ paddingLeft: 0
166
+ }
167
+ }, {
168
+ props: ({
169
+ ownerState
170
+ }) => ownerState.endAdornment,
171
+ style: {
172
+ paddingRight: 0
173
+ }
174
+ }]
119
175
  }));
120
176
  const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
121
177
  var _React$Fragment;
@@ -345,5 +401,7 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes /* remove-propty
345
401
  */
346
402
  value: PropTypes.any
347
403
  } : void 0;
348
- OutlinedInput.muiName = 'Input';
404
+ if (OutlinedInput) {
405
+ OutlinedInput.muiName = 'Input';
406
+ }
349
407
  export default OutlinedInput;
@@ -8,12 +8,12 @@ import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import integerPropType from '@mui/utils/integerPropType';
11
- import useThemeProps from '../styles/useThemeProps';
12
11
  import { getPaginationUtilityClass } from './paginationClasses';
13
12
  import usePagination from '../usePagination';
14
13
  import PaginationItem from '../PaginationItem';
15
- import styled from '../styles/styled';
14
+ import { styled, createUseThemeProps } from '../zero-styled';
16
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
+ const useThemeProps = createUseThemeProps('MuiPagination');
17
17
  const useUtilityClasses = ownerState => {
18
18
  const {
19
19
  classes,
@@ -399,7 +399,7 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-propt
399
399
  * It's recommended to use the `slots` prop instead.
400
400
  *
401
401
  * @default {}
402
- * @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
402
+ * @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
403
403
  */
404
404
  components: PropTypes.shape({
405
405
  first: PropTypes.elementType,
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["className", "component", "elevation", "square", "variant"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
@@ -10,12 +10,12 @@ import integerPropType from '@mui/utils/integerPropType';
10
10
  import chainPropTypes from '@mui/utils/chainPropTypes';
11
11
  import composeClasses from '@mui/utils/composeClasses';
12
12
  import { alpha } from '@mui/system/colorManipulator';
13
- import styled from '../styles/styled';
13
+ import { styled, createUseThemeProps } from '../zero-styled';
14
14
  import getOverlayAlpha from '../styles/getOverlayAlpha';
15
- import useThemeProps from '../styles/useThemeProps';
16
15
  import useTheme from '../styles/useTheme';
17
16
  import { getPaperUtilityClass } from './paperClasses';
18
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
+ const useThemeProps = createUseThemeProps('MuiPaper');
19
19
  const useUtilityClasses = ownerState => {
20
20
  const {
21
21
  square,
@@ -38,28 +38,41 @@ const PaperRoot = styled('div', {
38
38
  return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === 'elevation' && styles[`elevation${ownerState.elevation}`]];
39
39
  }
40
40
  })(({
41
- theme,
42
- ownerState
43
- }) => _extends({
41
+ theme
42
+ }) => ({
44
43
  backgroundColor: (theme.vars || theme).palette.background.paper,
45
44
  color: (theme.vars || theme).palette.text.primary,
46
- transition: theme.transitions.create('box-shadow')
47
- }, !ownerState.square && {
48
- borderRadius: theme.shape.borderRadius
49
- }, ownerState.variant === 'outlined' && {
50
- border: `1px solid ${(theme.vars || theme).palette.divider}`
51
- }, ownerState.variant === 'elevation' && _extends({
52
- boxShadow: (theme.vars || theme).shadows[ownerState.elevation]
53
- }, !theme.vars && theme.palette.mode === 'dark' && {
54
- backgroundImage: `linear-gradient(${alpha('#fff', getOverlayAlpha(ownerState.elevation))}, ${alpha('#fff', getOverlayAlpha(ownerState.elevation))})`
55
- }, theme.vars && {
56
- backgroundImage: theme.vars.overlays?.[ownerState.elevation]
57
- })));
45
+ transition: theme.transitions.create('box-shadow'),
46
+ variants: [{
47
+ props: ({
48
+ ownerState
49
+ }) => !ownerState.square,
50
+ style: {
51
+ borderRadius: theme.shape.borderRadius
52
+ }
53
+ }, {
54
+ props: {
55
+ variant: 'outlined'
56
+ },
57
+ style: {
58
+ border: `1px solid ${(theme.vars || theme).palette.divider}`
59
+ }
60
+ }, {
61
+ props: {
62
+ variant: 'elevation'
63
+ },
64
+ style: {
65
+ boxShadow: 'var(--Paper-shadow)',
66
+ backgroundImage: 'var(--Paper-overlay)'
67
+ }
68
+ }]
69
+ }));
58
70
  const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
59
71
  const props = useThemeProps({
60
72
  props: inProps,
61
73
  name: 'MuiPaper'
62
74
  });
75
+ const theme = useTheme();
63
76
  const {
64
77
  className,
65
78
  component = 'div',
@@ -76,8 +89,6 @@ const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
76
89
  });
77
90
  const classes = useUtilityClasses(ownerState);
78
91
  if (process.env.NODE_ENV !== 'production') {
79
- // eslint-disable-next-line react-hooks/rules-of-hooks
80
- const theme = useTheme();
81
92
  if (theme.shadows[elevation] === undefined) {
82
93
  console.error([`MUI: The elevation provided <Paper elevation={${elevation}}> is not available in the theme.`, `Please make sure that \`theme.shadows[${elevation}]\` is defined.`].join('\n'));
83
94
  }
@@ -87,7 +98,15 @@ const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
87
98
  ownerState: ownerState,
88
99
  className: clsx(classes.root, className),
89
100
  ref: ref
90
- }, other));
101
+ }, other, {
102
+ style: _extends({}, variant === 'elevation' && _extends({
103
+ '--Paper-shadow': (theme.vars || theme).shadows[elevation]
104
+ }, theme.vars && {
105
+ '--Paper-overlay': theme.overlays?.[elevation]
106
+ }, !theme.vars && theme.palette.mode === 'dark' && {
107
+ '--Paper-overlay': `linear-gradient(${alpha('#fff', getOverlayAlpha(elevation))}, ${alpha('#fff', getOverlayAlpha(elevation))})`
108
+ }), other.style)
109
+ }));
91
110
  });
92
111
  process.env.NODE_ENV !== "production" ? Paper.propTypes /* remove-proptypes */ = {
93
112
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -131,6 +150,10 @@ process.env.NODE_ENV !== "production" ? Paper.propTypes /* remove-proptypes */ =
131
150
  * @default false
132
151
  */
133
152
  square: PropTypes.bool,
153
+ /**
154
+ * @ignore
155
+ */
156
+ style: PropTypes.object,
134
157
  /**
135
158
  * The system prop that allows defining system overrides as well as additional CSS styles.
136
159
  */