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

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 (269) 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/Avatar/Avatar.d.ts +1 -1
  8. package/Avatar/Avatar.js +1 -1
  9. package/Backdrop/Backdrop.d.ts +1 -1
  10. package/Backdrop/Backdrop.js +1 -1
  11. package/Badge/Badge.d.ts +2 -2
  12. package/Badge/Badge.js +2 -2
  13. package/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
  14. package/Button/Button.js +1 -1
  15. package/Button/buttonClasses.d.ts +33 -33
  16. package/ButtonGroup/buttonGroupClasses.d.ts +17 -17
  17. package/CHANGELOG.md +48 -0
  18. package/Checkbox/Checkbox.js +3 -1
  19. package/Chip/chipClasses.d.ts +28 -26
  20. package/Chip/chipClasses.js +1 -1
  21. package/Collapse/Collapse.js +66 -35
  22. package/Dialog/Dialog.js +105 -61
  23. package/DialogActions/DialogActions.js +16 -12
  24. package/DialogContent/DialogContent.js +25 -15
  25. package/DialogContentText/DialogContentText.js +3 -2
  26. package/DialogTitle/DialogTitle.js +2 -2
  27. package/Divider/Divider.d.ts +1 -1
  28. package/Divider/Divider.js +1 -1
  29. package/Drawer/Drawer.js +73 -32
  30. package/Fab/Fab.js +1 -1
  31. package/FilledInput/FilledInput.d.ts +1 -0
  32. package/FilledInput/FilledInput.js +170 -87
  33. package/FormControlLabel/FormControlLabel.d.ts +1 -1
  34. package/FormControlLabel/FormControlLabel.js +1 -1
  35. package/FormHelperText/FormHelperText.js +2 -2
  36. package/FormLabel/FormLabel.js +23 -13
  37. package/Grow/Grow.js +3 -1
  38. package/Icon/Icon.js +63 -23
  39. package/ImageList/ImageList.js +2 -2
  40. package/ImageListItem/ImageListItem.js +2 -2
  41. package/ImageListItemBar/ImageListItemBar.js +2 -2
  42. package/Input/Input.d.ts +1 -0
  43. package/Input/Input.js +84 -61
  44. package/InputAdornment/InputAdornment.js +37 -21
  45. package/InputBase/InputBase.js +58 -28
  46. package/InputLabel/InputLabel.js +120 -58
  47. package/Link/Link.js +99 -54
  48. package/Link/getTextDecoration.d.ts +2 -8
  49. package/Link/getTextDecoration.js +16 -8
  50. package/List/List.js +22 -13
  51. package/ListItem/ListItem.js +2 -2
  52. package/ListItemAvatar/ListItemAvatar.js +2 -2
  53. package/ListItemButton/ListItemButton.js +3 -2
  54. package/ListItemIcon/ListItemIcon.js +14 -9
  55. package/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
  56. package/ListItemText/ListItemText.js +2 -2
  57. package/ListSubheader/ListSubheader.js +5 -3
  58. package/Menu/Menu.js +3 -2
  59. package/MenuItem/MenuItem.js +47 -27
  60. package/NativeSelect/NativeSelectInput.js +78 -49
  61. package/OutlinedInput/NotchedOutline.js +60 -43
  62. package/OutlinedInput/OutlinedInput.js +97 -39
  63. package/Pagination/Pagination.js +2 -2
  64. package/PaginationItem/PaginationItem.d.ts +1 -1
  65. package/PaginationItem/PaginationItem.js +1 -1
  66. package/PaginationItem/paginationItemClasses.d.ts +4 -4
  67. package/Paper/Paper.js +44 -21
  68. package/Radio/Radio.js +5 -3
  69. package/Radio/RadioButtonIcon.js +1 -1
  70. package/Rating/Rating.js +3 -2
  71. package/Select/Select.js +2 -1
  72. package/Select/SelectInput.js +8 -6
  73. package/Skeleton/Skeleton.js +109 -61
  74. package/Slider/Slider.d.ts +2 -2
  75. package/Slider/Slider.js +2 -2
  76. package/Snackbar/Snackbar.js +66 -40
  77. package/SnackbarContent/SnackbarContent.js +2 -2
  78. package/SpeedDial/SpeedDial.d.ts +28 -1
  79. package/SpeedDial/SpeedDial.js +107 -49
  80. package/SpeedDialAction/SpeedDialAction.js +50 -24
  81. package/SpeedDialIcon/SpeedDialIcon.js +37 -16
  82. package/StepConnector/stepConnectorClasses.d.ts +2 -2
  83. package/StepLabel/StepLabel.d.ts +3 -3
  84. package/StepLabel/StepLabel.js +3 -3
  85. package/SwipeableDrawer/SwipeArea.js +39 -18
  86. package/Tab/Tab.js +127 -55
  87. package/TabScrollButton/TabScrollButton.js +27 -15
  88. package/Table/Table.js +2 -2
  89. package/TableBody/TableBody.js +2 -2
  90. package/TableCell/TableCell.js +2 -2
  91. package/TableContainer/TableContainer.js +2 -2
  92. package/TableFooter/TableFooter.js +2 -2
  93. package/TableHead/TableHead.js +2 -2
  94. package/TablePagination/TablePagination.js +2 -2
  95. package/TableRow/TableRow.js +2 -2
  96. package/TableSortLabel/TableSortLabel.js +2 -2
  97. package/Tabs/Tabs.js +107 -54
  98. package/TextField/TextField.js +2 -2
  99. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +2 -2
  100. package/Toolbar/Toolbar.js +3 -7
  101. package/Tooltip/Tooltip.js +185 -88
  102. package/Typography/Typography.js +89 -39
  103. package/index.js +1 -1
  104. package/internal/SwitchBase.js +39 -11
  105. package/modern/Accordion/Accordion.js +2 -2
  106. package/modern/Alert/Alert.js +2 -2
  107. package/modern/Avatar/Avatar.js +1 -1
  108. package/modern/Backdrop/Backdrop.js +1 -1
  109. package/modern/Badge/Badge.js +2 -2
  110. package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
  111. package/modern/Button/Button.js +1 -1
  112. package/modern/Checkbox/Checkbox.js +3 -1
  113. package/modern/Chip/chipClasses.js +1 -1
  114. package/modern/Collapse/Collapse.js +66 -35
  115. package/modern/Dialog/Dialog.js +105 -61
  116. package/modern/DialogActions/DialogActions.js +16 -12
  117. package/modern/DialogContent/DialogContent.js +25 -15
  118. package/modern/DialogContentText/DialogContentText.js +3 -2
  119. package/modern/DialogTitle/DialogTitle.js +2 -2
  120. package/modern/Divider/Divider.js +1 -1
  121. package/modern/Drawer/Drawer.js +73 -32
  122. package/modern/Fab/Fab.js +1 -1
  123. package/modern/FilledInput/FilledInput.js +170 -87
  124. package/modern/FormControlLabel/FormControlLabel.js +1 -1
  125. package/modern/FormHelperText/FormHelperText.js +2 -2
  126. package/modern/FormLabel/FormLabel.js +23 -13
  127. package/modern/Grow/Grow.js +3 -1
  128. package/modern/Icon/Icon.js +63 -23
  129. package/modern/ImageList/ImageList.js +2 -2
  130. package/modern/ImageListItem/ImageListItem.js +2 -2
  131. package/modern/ImageListItemBar/ImageListItemBar.js +2 -2
  132. package/modern/Input/Input.js +84 -61
  133. package/modern/InputAdornment/InputAdornment.js +37 -21
  134. package/modern/InputBase/InputBase.js +58 -28
  135. package/modern/InputLabel/InputLabel.js +120 -58
  136. package/modern/Link/Link.js +99 -54
  137. package/modern/Link/getTextDecoration.js +16 -8
  138. package/modern/List/List.js +22 -13
  139. package/modern/ListItem/ListItem.js +2 -2
  140. package/modern/ListItemAvatar/ListItemAvatar.js +2 -2
  141. package/modern/ListItemButton/ListItemButton.js +3 -2
  142. package/modern/ListItemIcon/ListItemIcon.js +14 -9
  143. package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
  144. package/modern/ListItemText/ListItemText.js +2 -2
  145. package/modern/ListSubheader/ListSubheader.js +5 -3
  146. package/modern/Menu/Menu.js +3 -2
  147. package/modern/MenuItem/MenuItem.js +47 -27
  148. package/modern/NativeSelect/NativeSelectInput.js +78 -49
  149. package/modern/OutlinedInput/NotchedOutline.js +60 -43
  150. package/modern/OutlinedInput/OutlinedInput.js +97 -39
  151. package/modern/Pagination/Pagination.js +2 -2
  152. package/modern/PaginationItem/PaginationItem.js +1 -1
  153. package/modern/Paper/Paper.js +44 -21
  154. package/modern/Radio/Radio.js +5 -3
  155. package/modern/Radio/RadioButtonIcon.js +1 -1
  156. package/modern/Rating/Rating.js +3 -2
  157. package/modern/Select/Select.js +2 -1
  158. package/modern/Select/SelectInput.js +8 -6
  159. package/modern/Skeleton/Skeleton.js +109 -61
  160. package/modern/Slider/Slider.js +2 -2
  161. package/modern/Snackbar/Snackbar.js +66 -40
  162. package/modern/SnackbarContent/SnackbarContent.js +2 -2
  163. package/modern/SpeedDial/SpeedDial.js +107 -49
  164. package/modern/SpeedDialAction/SpeedDialAction.js +50 -24
  165. package/modern/SpeedDialIcon/SpeedDialIcon.js +37 -16
  166. package/modern/StepLabel/StepLabel.js +3 -3
  167. package/modern/SwipeableDrawer/SwipeArea.js +39 -18
  168. package/modern/Tab/Tab.js +127 -55
  169. package/modern/TabScrollButton/TabScrollButton.js +27 -15
  170. package/modern/Table/Table.js +2 -2
  171. package/modern/TableBody/TableBody.js +2 -2
  172. package/modern/TableCell/TableCell.js +2 -2
  173. package/modern/TableContainer/TableContainer.js +2 -2
  174. package/modern/TableFooter/TableFooter.js +2 -2
  175. package/modern/TableHead/TableHead.js +2 -2
  176. package/modern/TablePagination/TablePagination.js +2 -2
  177. package/modern/TableRow/TableRow.js +2 -2
  178. package/modern/TableSortLabel/TableSortLabel.js +2 -2
  179. package/modern/Tabs/Tabs.js +107 -54
  180. package/modern/TextField/TextField.js +2 -2
  181. package/modern/Toolbar/Toolbar.js +3 -7
  182. package/modern/Tooltip/Tooltip.js +185 -88
  183. package/modern/Typography/Typography.js +89 -39
  184. package/modern/index.js +1 -1
  185. package/modern/internal/SwitchBase.js +39 -11
  186. package/node/Accordion/Accordion.js +2 -2
  187. package/node/Alert/Alert.js +2 -2
  188. package/node/Avatar/Avatar.js +1 -1
  189. package/node/Backdrop/Backdrop.js +1 -1
  190. package/node/Badge/Badge.js +2 -2
  191. package/node/Breadcrumbs/BreadcrumbCollapsed.js +3 -3
  192. package/node/Button/Button.js +2 -2
  193. package/node/Checkbox/Checkbox.js +3 -1
  194. package/node/Chip/chipClasses.js +1 -1
  195. package/node/Collapse/Collapse.js +70 -39
  196. package/node/Dialog/Dialog.js +110 -66
  197. package/node/DialogActions/DialogActions.js +18 -14
  198. package/node/DialogContent/DialogContent.js +27 -17
  199. package/node/DialogContentText/DialogContentText.js +6 -5
  200. package/node/DialogTitle/DialogTitle.js +4 -4
  201. package/node/Divider/Divider.js +1 -1
  202. package/node/Drawer/Drawer.js +78 -37
  203. package/node/Fab/Fab.js +2 -2
  204. package/node/FilledInput/FilledInput.js +176 -91
  205. package/node/FormControlLabel/FormControlLabel.js +1 -1
  206. package/node/FormHelperText/FormHelperText.js +4 -4
  207. package/node/FormLabel/FormLabel.js +26 -16
  208. package/node/Grow/Grow.js +3 -1
  209. package/node/Icon/Icon.js +65 -25
  210. package/node/ImageList/ImageList.js +4 -4
  211. package/node/ImageListItem/ImageListItem.js +4 -4
  212. package/node/ImageListItemBar/ImageListItemBar.js +8 -8
  213. package/node/Input/Input.js +87 -64
  214. package/node/InputAdornment/InputAdornment.js +39 -23
  215. package/node/InputBase/InputBase.js +61 -31
  216. package/node/InputLabel/InputLabel.js +123 -61
  217. package/node/Link/Link.js +101 -56
  218. package/node/Link/getTextDecoration.js +18 -10
  219. package/node/List/List.js +24 -15
  220. package/node/ListItem/ListItem.js +5 -5
  221. package/node/ListItemAvatar/ListItemAvatar.js +4 -4
  222. package/node/ListItemButton/ListItemButton.js +6 -5
  223. package/node/ListItemIcon/ListItemIcon.js +16 -11
  224. package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +4 -4
  225. package/node/ListItemText/ListItemText.js +4 -4
  226. package/node/ListSubheader/ListSubheader.js +7 -5
  227. package/node/Menu/Menu.js +8 -7
  228. package/node/MenuItem/MenuItem.js +50 -30
  229. package/node/NativeSelect/NativeSelectInput.js +80 -53
  230. package/node/OutlinedInput/NotchedOutline.js +64 -47
  231. package/node/OutlinedInput/OutlinedInput.js +101 -43
  232. package/node/Pagination/Pagination.js +5 -5
  233. package/node/PaginationItem/PaginationItem.js +1 -1
  234. package/node/Paper/Paper.js +49 -28
  235. package/node/Radio/Radio.js +6 -4
  236. package/node/Radio/RadioButtonIcon.js +2 -2
  237. package/node/Rating/Rating.js +9 -8
  238. package/node/Select/Select.js +6 -5
  239. package/node/Select/SelectInput.js +9 -7
  240. package/node/Skeleton/Skeleton.js +113 -65
  241. package/node/Slider/Slider.js +2 -2
  242. package/node/Snackbar/Snackbar.js +68 -42
  243. package/node/SnackbarContent/SnackbarContent.js +6 -6
  244. package/node/SpeedDial/SpeedDial.js +111 -53
  245. package/node/SpeedDialAction/SpeedDialAction.js +54 -28
  246. package/node/SpeedDialIcon/SpeedDialIcon.js +39 -18
  247. package/node/StepLabel/StepLabel.js +3 -3
  248. package/node/SwipeableDrawer/SwipeArea.js +41 -20
  249. package/node/Tab/Tab.js +129 -57
  250. package/node/TabScrollButton/TabScrollButton.js +29 -17
  251. package/node/Table/Table.js +4 -4
  252. package/node/TableBody/TableBody.js +4 -4
  253. package/node/TableCell/TableCell.js +4 -4
  254. package/node/TableContainer/TableContainer.js +4 -4
  255. package/node/TableFooter/TableFooter.js +4 -4
  256. package/node/TableHead/TableHead.js +4 -4
  257. package/node/TablePagination/TablePagination.js +10 -10
  258. package/node/TableRow/TableRow.js +4 -4
  259. package/node/TableSortLabel/TableSortLabel.js +5 -5
  260. package/node/Tabs/Tabs.js +113 -60
  261. package/node/TextField/TextField.js +4 -4
  262. package/node/Toolbar/Toolbar.js +5 -9
  263. package/node/Tooltip/Tooltip.js +189 -92
  264. package/node/Typography/Typography.js +90 -40
  265. package/node/index.js +1 -1
  266. package/node/internal/SwitchBase.js +41 -13
  267. package/package.json +4 -4
  268. package/umd/material-ui.development.js +2585 -1287
  269. package/umd/material-ui.production.min.js +4 -4
package/Tab/Tab.js CHANGED
@@ -9,11 +9,11 @@ import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import ButtonBase from '../ButtonBase';
11
11
  import capitalize from '../utils/capitalize';
12
- import useThemeProps from '../styles/useThemeProps';
13
- import styled from '../styles/styled';
12
+ import { styled, createUseThemeProps } from '../zero-styled';
14
13
  import unsupportedProp from '../utils/unsupportedProp';
15
14
  import tabClasses, { getTabUtilityClass } from './tabClasses';
16
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
+ const useThemeProps = createUseThemeProps('MuiTab');
17
17
  const useUtilityClasses = ownerState => {
18
18
  const {
19
19
  classes,
@@ -41,8 +41,7 @@ const TabRoot = styled(ButtonBase, {
41
41
  return [styles.root, ownerState.label && ownerState.icon && styles.labelIcon, styles[`textColor${capitalize(ownerState.textColor)}`], ownerState.fullWidth && styles.fullWidth, ownerState.wrapped && styles.wrapped];
42
42
  }
43
43
  })(({
44
- theme,
45
- ownerState
44
+ theme
46
45
  }) => _extends({}, theme.typography.button, {
47
46
  maxWidth: 360,
48
47
  minWidth: 90,
@@ -52,57 +51,130 @@ const TabRoot = styled(ButtonBase, {
52
51
  padding: '12px 16px',
53
52
  overflow: 'hidden',
54
53
  whiteSpace: 'normal',
55
- textAlign: 'center'
56
- }, ownerState.label && {
57
- flexDirection: ownerState.iconPosition === 'top' || ownerState.iconPosition === 'bottom' ? 'column' : 'row'
58
- }, {
59
- lineHeight: 1.25
60
- }, ownerState.icon && ownerState.label && {
61
- minHeight: 72,
62
- paddingTop: 9,
63
- paddingBottom: 9,
64
- [`& > .${tabClasses.iconWrapper}`]: _extends({}, ownerState.iconPosition === 'top' && {
65
- marginBottom: 6
66
- }, ownerState.iconPosition === 'bottom' && {
67
- marginTop: 6
68
- }, ownerState.iconPosition === 'start' && {
69
- marginRight: theme.spacing(1)
70
- }, ownerState.iconPosition === 'end' && {
71
- marginLeft: theme.spacing(1)
72
- })
73
- }, ownerState.textColor === 'inherit' && {
74
- color: 'inherit',
75
- opacity: 0.6,
76
- // same opacity as theme.palette.text.secondary
77
- [`&.${tabClasses.selected}`]: {
78
- opacity: 1
79
- },
80
- [`&.${tabClasses.disabled}`]: {
81
- opacity: (theme.vars || theme).palette.action.disabledOpacity
82
- }
83
- }, ownerState.textColor === 'primary' && {
84
- color: (theme.vars || theme).palette.text.secondary,
85
- [`&.${tabClasses.selected}`]: {
86
- color: (theme.vars || theme).palette.primary.main
87
- },
88
- [`&.${tabClasses.disabled}`]: {
89
- color: (theme.vars || theme).palette.text.disabled
90
- }
91
- }, ownerState.textColor === 'secondary' && {
92
- color: (theme.vars || theme).palette.text.secondary,
93
- [`&.${tabClasses.selected}`]: {
94
- color: (theme.vars || theme).palette.secondary.main
95
- },
96
- [`&.${tabClasses.disabled}`]: {
97
- color: (theme.vars || theme).palette.text.disabled
98
- }
99
- }, ownerState.fullWidth && {
100
- flexShrink: 1,
101
- flexGrow: 1,
102
- flexBasis: 0,
103
- maxWidth: 'none'
104
- }, ownerState.wrapped && {
105
- fontSize: theme.typography.pxToRem(12)
54
+ textAlign: 'center',
55
+ lineHeight: 1.25,
56
+ variants: [{
57
+ props: ({
58
+ ownerState
59
+ }) => ownerState.label && (ownerState.iconPosition === 'top' || ownerState.iconPosition === 'bottom'),
60
+ style: {
61
+ flexDirection: 'column'
62
+ }
63
+ }, {
64
+ props: ({
65
+ ownerState
66
+ }) => ownerState.label && ownerState.iconPosition !== 'top' && ownerState.iconPosition !== 'bottom',
67
+ style: {
68
+ flexDirection: 'row'
69
+ }
70
+ }, {
71
+ props: ({
72
+ ownerState
73
+ }) => ownerState.icon && ownerState.label,
74
+ style: {
75
+ minHeight: 72,
76
+ paddingTop: 9,
77
+ paddingBottom: 9
78
+ }
79
+ }, {
80
+ props: ({
81
+ ownerState,
82
+ iconPosition
83
+ }) => ownerState.icon && ownerState.label && iconPosition === 'top',
84
+ style: {
85
+ [`& > .${tabClasses.iconWrapper}`]: {
86
+ marginBottom: 6
87
+ }
88
+ }
89
+ }, {
90
+ props: ({
91
+ ownerState,
92
+ iconPosition
93
+ }) => ownerState.icon && ownerState.label && iconPosition === 'bottom',
94
+ style: {
95
+ [`& > .${tabClasses.iconWrapper}`]: {
96
+ marginTop: 6
97
+ }
98
+ }
99
+ }, {
100
+ props: ({
101
+ ownerState,
102
+ iconPosition
103
+ }) => ownerState.icon && ownerState.label && iconPosition === 'start',
104
+ style: {
105
+ [`& > .${tabClasses.iconWrapper}`]: {
106
+ marginRight: theme.spacing(1)
107
+ }
108
+ }
109
+ }, {
110
+ props: ({
111
+ ownerState,
112
+ iconPosition
113
+ }) => ownerState.icon && ownerState.label && iconPosition === 'end',
114
+ style: {
115
+ [`& > .${tabClasses.iconWrapper}`]: {
116
+ marginLeft: theme.spacing(1)
117
+ }
118
+ }
119
+ }, {
120
+ props: {
121
+ textColor: 'inherit'
122
+ },
123
+ style: {
124
+ color: 'inherit',
125
+ opacity: 0.6,
126
+ // same opacity as theme.palette.text.secondary
127
+ [`&.${tabClasses.selected}`]: {
128
+ opacity: 1
129
+ },
130
+ [`&.${tabClasses.disabled}`]: {
131
+ opacity: (theme.vars || theme).palette.action.disabledOpacity
132
+ }
133
+ }
134
+ }, {
135
+ props: {
136
+ textColor: 'primary'
137
+ },
138
+ style: {
139
+ color: (theme.vars || theme).palette.text.secondary,
140
+ [`&.${tabClasses.selected}`]: {
141
+ color: (theme.vars || theme).palette.primary.main
142
+ },
143
+ [`&.${tabClasses.disabled}`]: {
144
+ color: (theme.vars || theme).palette.text.disabled
145
+ }
146
+ }
147
+ }, {
148
+ props: {
149
+ textColor: 'secondary'
150
+ },
151
+ style: {
152
+ color: (theme.vars || theme).palette.text.secondary,
153
+ [`&.${tabClasses.selected}`]: {
154
+ color: (theme.vars || theme).palette.secondary.main
155
+ },
156
+ [`&.${tabClasses.disabled}`]: {
157
+ color: (theme.vars || theme).palette.text.disabled
158
+ }
159
+ }
160
+ }, {
161
+ props: ({
162
+ ownerState
163
+ }) => ownerState.fullWidth,
164
+ style: {
165
+ flexShrink: 1,
166
+ flexGrow: 1,
167
+ flexBasis: 0,
168
+ maxWidth: 'none'
169
+ }
170
+ }, {
171
+ props: ({
172
+ ownerState
173
+ }) => ownerState.wrapped,
174
+ style: {
175
+ fontSize: theme.typography.pxToRem(12)
176
+ }
177
+ }]
106
178
  }));
107
179
  const Tab = /*#__PURE__*/React.forwardRef(function Tab(inProps, ref) {
108
180
  const props = useThemeProps({
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  /* eslint-disable jsx-a11y/aria-role */
4
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
6
6
  const _excluded = ["className", "slots", "slotProps", "direction", "orientation", "disabled"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
@@ -13,10 +13,10 @@ import { useRtl } from '@mui/system/RtlProvider';
13
13
  import KeyboardArrowLeft from '../internal/svg-icons/KeyboardArrowLeft';
14
14
  import KeyboardArrowRight from '../internal/svg-icons/KeyboardArrowRight';
15
15
  import ButtonBase from '../ButtonBase';
16
- import useThemeProps from '../styles/useThemeProps';
17
- import styled from '../styles/styled';
16
+ import { styled, createUseThemeProps } from '../zero-styled';
18
17
  import tabScrollButtonClasses, { getTabScrollButtonUtilityClass } from './tabScrollButtonClasses';
19
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
+ const useThemeProps = createUseThemeProps('MuiTabScrollButton');
20
20
  const useUtilityClasses = ownerState => {
21
21
  const {
22
22
  classes,
@@ -37,22 +37,26 @@ const TabScrollButtonRoot = styled(ButtonBase, {
37
37
  } = props;
38
38
  return [styles.root, ownerState.orientation && styles[ownerState.orientation]];
39
39
  }
40
- })(({
41
- ownerState
42
- }) => _extends({
40
+ })({
43
41
  width: 40,
44
42
  flexShrink: 0,
45
43
  opacity: 0.8,
46
44
  [`&.${tabScrollButtonClasses.disabled}`]: {
47
45
  opacity: 0
48
- }
49
- }, ownerState.orientation === 'vertical' && {
50
- width: '100%',
51
- height: 40,
52
- '& svg': {
53
- transform: `rotate(${ownerState.isRtl ? -90 : 90}deg)`
54
- }
55
- }));
46
+ },
47
+ variants: [{
48
+ props: {
49
+ orientation: 'vertical'
50
+ },
51
+ style: {
52
+ width: '100%',
53
+ height: 40,
54
+ '& svg': {
55
+ transform: 'var(--TabScrollButton-svgRotate)'
56
+ }
57
+ }
58
+ }]
59
+ });
56
60
  const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(inProps, ref) {
57
61
  const props = useThemeProps({
58
62
  props: inProps,
@@ -62,7 +66,8 @@ const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(i
62
66
  className,
63
67
  slots = {},
64
68
  slotProps = {},
65
- direction
69
+ direction,
70
+ orientation
66
71
  } = props,
67
72
  other = _objectWithoutPropertiesLoose(props, _excluded);
68
73
  const isRtl = useRtl();
@@ -96,6 +101,9 @@ const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(i
96
101
  ownerState: ownerState,
97
102
  tabIndex: null
98
103
  }, other, {
104
+ style: _extends({}, other.style, orientation === 'vertical' && {
105
+ '--TabScrollButton-svgRotate': `rotate(${isRtl ? -90 : 90}deg)`
106
+ }),
99
107
  children: direction === 'left' ? /*#__PURE__*/_jsx(StartButtonIcon, _extends({}, startButtonIconProps)) : /*#__PURE__*/_jsx(EndButtonIcon, _extends({}, endButtonIconProps))
100
108
  }));
101
109
  });
@@ -146,6 +154,10 @@ process.env.NODE_ENV !== "production" ? TabScrollButton.propTypes /* remove-prop
146
154
  EndScrollButtonIcon: PropTypes.elementType,
147
155
  StartScrollButtonIcon: PropTypes.elementType
148
156
  }),
157
+ /**
158
+ * @ignore
159
+ */
160
+ style: PropTypes.object,
149
161
  /**
150
162
  * The system prop that allows defining system overrides as well as additional CSS styles.
151
163
  */
package/Table/Table.js CHANGED
@@ -8,10 +8,10 @@ import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import TableContext from './TableContext';
11
- import useThemeProps from '../styles/useThemeProps';
12
- import styled from '../styles/styled';
11
+ import { styled, createUseThemeProps } from '../zero-styled';
13
12
  import { getTableUtilityClass } from './tableClasses';
14
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ const useThemeProps = createUseThemeProps('MuiTable');
15
15
  const useUtilityClasses = ownerState => {
16
16
  const {
17
17
  classes,
@@ -8,10 +8,10 @@ import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import Tablelvl2Context from '../Table/Tablelvl2Context';
11
- import useThemeProps from '../styles/useThemeProps';
12
- import styled from '../styles/styled';
11
+ import { styled, createUseThemeProps } from '../zero-styled';
13
12
  import { getTableBodyUtilityClass } from './tableBodyClasses';
14
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ const useThemeProps = createUseThemeProps('MuiTableBody');
15
15
  const useUtilityClasses = ownerState => {
16
16
  const {
17
17
  classes
@@ -11,10 +11,10 @@ import { darken, alpha, lighten } from '@mui/system/colorManipulator';
11
11
  import capitalize from '../utils/capitalize';
12
12
  import TableContext from '../Table/TableContext';
13
13
  import Tablelvl2Context from '../Table/Tablelvl2Context';
14
- import useThemeProps from '../styles/useThemeProps';
15
- import styled from '../styles/styled';
14
+ import { styled, createUseThemeProps } from '../zero-styled';
16
15
  import tableCellClasses, { getTableCellUtilityClass } from './tableCellClasses';
17
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
+ const useThemeProps = createUseThemeProps('MuiTableCell');
18
18
  const useUtilityClasses = ownerState => {
19
19
  const {
20
20
  classes,
@@ -7,10 +7,10 @@ import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
- import useThemeProps from '../styles/useThemeProps';
11
- import styled from '../styles/styled';
10
+ import { styled, createUseThemeProps } from '../zero-styled';
12
11
  import { getTableContainerUtilityClass } from './tableContainerClasses';
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ const useThemeProps = createUseThemeProps('MuiTableContainer');
14
14
  const useUtilityClasses = ownerState => {
15
15
  const {
16
16
  classes
@@ -8,10 +8,10 @@ import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import Tablelvl2Context from '../Table/Tablelvl2Context';
11
- import useThemeProps from '../styles/useThemeProps';
12
- import styled from '../styles/styled';
11
+ import { styled, createUseThemeProps } from '../zero-styled';
13
12
  import { getTableFooterUtilityClass } from './tableFooterClasses';
14
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ const useThemeProps = createUseThemeProps('MuiTableFooter');
15
15
  const useUtilityClasses = ownerState => {
16
16
  const {
17
17
  classes
@@ -8,10 +8,10 @@ import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import Tablelvl2Context from '../Table/Tablelvl2Context';
11
- import useThemeProps from '../styles/useThemeProps';
12
- import styled from '../styles/styled';
11
+ import { styled, createUseThemeProps } from '../zero-styled';
13
12
  import { getTableHeadUtilityClass } from './tableHeadClasses';
14
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ const useThemeProps = createUseThemeProps('MuiTableHead');
15
15
  const useUtilityClasses = ownerState => {
16
16
  const {
17
17
  classes
@@ -11,8 +11,7 @@ import integerPropType from '@mui/utils/integerPropType';
11
11
  import chainPropTypes from '@mui/utils/chainPropTypes';
12
12
  import { isHostComponent } from '@mui/base/utils';
13
13
  import composeClasses from '@mui/utils/composeClasses';
14
- import styled from '../styles/styled';
15
- import useThemeProps from '../styles/useThemeProps';
14
+ import { styled, createUseThemeProps } from '../zero-styled';
16
15
  import InputBase from '../InputBase';
17
16
  import MenuItem from '../MenuItem';
18
17
  import Select from '../Select';
@@ -23,6 +22,7 @@ import useId from '../utils/useId';
23
22
  import tablePaginationClasses, { getTablePaginationUtilityClass } from './tablePaginationClasses';
24
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
24
  import { createElement as _createElement } from "react";
25
+ const useThemeProps = createUseThemeProps('MuiTablePagination');
26
26
  const TablePaginationRoot = styled(TableCell, {
27
27
  name: 'MuiTablePagination',
28
28
  slot: 'Root',
@@ -9,10 +9,10 @@ import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import { alpha } from '@mui/system/colorManipulator';
11
11
  import Tablelvl2Context from '../Table/Tablelvl2Context';
12
- import useThemeProps from '../styles/useThemeProps';
13
- import styled from '../styles/styled';
12
+ import { styled, createUseThemeProps } from '../zero-styled';
14
13
  import tableRowClasses, { getTableRowUtilityClass } from './tableRowClasses';
15
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
+ const useThemeProps = createUseThemeProps('MuiTableRow');
16
16
  const useUtilityClasses = ownerState => {
17
17
  const {
18
18
  classes,
@@ -9,11 +9,11 @@ import PropTypes from 'prop-types';
9
9
  import * as React from 'react';
10
10
  import ButtonBase from '../ButtonBase';
11
11
  import ArrowDownwardIcon from '../internal/svg-icons/ArrowDownward';
12
- import styled from '../styles/styled';
13
- import useThemeProps from '../styles/useThemeProps';
12
+ import { styled, createUseThemeProps } from '../zero-styled';
14
13
  import capitalize from '../utils/capitalize';
15
14
  import tableSortLabelClasses, { getTableSortLabelUtilityClass } from './tableSortLabelClasses';
16
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
+ const useThemeProps = createUseThemeProps('MuiTableSortLabel');
17
17
  const useUtilityClasses = ownerState => {
18
18
  const {
19
19
  classes,
package/Tabs/Tabs.js CHANGED
@@ -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 = ["aria-label", "aria-labelledby", "action", "centered", "children", "className", "component", "allowScrollButtonsMobile", "indicatorColor", "onChange", "orientation", "ScrollButtonComponent", "scrollButtons", "selectionFollowsFocus", "slots", "slotProps", "TabIndicatorProps", "TabScrollButtonProps", "textColor", "value", "variant", "visibleScrollbar"];
6
6
  import * as React from 'react';
7
7
  import { isFragment } from 'react-is';
@@ -11,8 +11,7 @@ import refType from '@mui/utils/refType';
11
11
  import { useSlotProps } from '@mui/base/utils';
12
12
  import composeClasses from '@mui/utils/composeClasses';
13
13
  import { useRtl } from '@mui/system/RtlProvider';
14
- import styled from '../styles/styled';
15
- import useThemeProps from '../styles/useThemeProps';
14
+ import { styled, createUseThemeProps } from '../zero-styled';
16
15
  import useTheme from '../styles/useTheme';
17
16
  import debounce from '../utils/debounce';
18
17
  import { getNormalizedScrollLeft, detectScrollType } from '../utils/scrollLeft';
@@ -24,6 +23,7 @@ import tabsClasses, { getTabsUtilityClass } from './tabsClasses';
24
23
  import ownerDocument from '../utils/ownerDocument';
25
24
  import ownerWindow from '../utils/ownerWindow';
26
25
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
+ const useThemeProps = createUseThemeProps('MuiTabs');
27
27
  const nextItem = (list, item) => {
28
28
  if (list === item) {
29
29
  return list.firstChild;
@@ -101,22 +101,32 @@ const TabsRoot = styled('div', {
101
101
  }, styles.root, ownerState.vertical && styles.vertical];
102
102
  }
103
103
  })(({
104
- ownerState,
105
104
  theme
106
- }) => _extends({
105
+ }) => ({
107
106
  overflow: 'hidden',
108
107
  minHeight: 48,
109
108
  // Add iOS momentum scrolling for iOS < 13.0
110
109
  WebkitOverflowScrolling: 'touch',
111
- display: 'flex'
112
- }, ownerState.vertical && {
113
- flexDirection: 'column'
114
- }, ownerState.scrollButtonsHideMobile && {
115
- [`& .${tabsClasses.scrollButtons}`]: {
116
- [theme.breakpoints.down('sm')]: {
117
- display: 'none'
110
+ display: 'flex',
111
+ variants: [{
112
+ props: ({
113
+ ownerState
114
+ }) => ownerState.vertical,
115
+ style: {
116
+ flexDirection: 'column'
118
117
  }
119
- }
118
+ }, {
119
+ props: ({
120
+ ownerState
121
+ }) => ownerState.scrollButtonsHideMobile,
122
+ style: {
123
+ [`& .${tabsClasses.scrollButtons}`]: {
124
+ [theme.breakpoints.down('sm')]: {
125
+ display: 'none'
126
+ }
127
+ }
128
+ }
129
+ }]
120
130
  }));
121
131
  const TabsScroller = styled('div', {
122
132
  name: 'MuiTabs',
@@ -127,30 +137,49 @@ const TabsScroller = styled('div', {
127
137
  } = props;
128
138
  return [styles.scroller, ownerState.fixed && styles.fixed, ownerState.hideScrollbar && styles.hideScrollbar, ownerState.scrollableX && styles.scrollableX, ownerState.scrollableY && styles.scrollableY];
129
139
  }
130
- })(({
131
- ownerState
132
- }) => _extends({
140
+ })({
133
141
  position: 'relative',
134
142
  display: 'inline-block',
135
143
  flex: '1 1 auto',
136
- whiteSpace: 'nowrap'
137
- }, ownerState.fixed && {
138
- overflowX: 'hidden',
139
- width: '100%'
140
- }, ownerState.hideScrollbar && {
141
- // Hide dimensionless scrollbar on macOS
142
- scrollbarWidth: 'none',
143
- // Firefox
144
- '&::-webkit-scrollbar': {
145
- display: 'none' // Safari + Chrome
146
- }
147
- }, ownerState.scrollableX && {
148
- overflowX: 'auto',
149
- overflowY: 'hidden'
150
- }, ownerState.scrollableY && {
151
- overflowY: 'auto',
152
- overflowX: 'hidden'
153
- }));
144
+ whiteSpace: 'nowrap',
145
+ variants: [{
146
+ props: ({
147
+ ownerState
148
+ }) => ownerState.fixed,
149
+ style: {
150
+ overflowX: 'hidden',
151
+ width: '100%'
152
+ }
153
+ }, {
154
+ props: ({
155
+ ownerState
156
+ }) => ownerState.hideScrollbar,
157
+ style: {
158
+ // Hide dimensionless scrollbar on macOS
159
+ scrollbarWidth: 'none',
160
+ // Firefox
161
+ '&::-webkit-scrollbar': {
162
+ display: 'none' // Safari + Chrome
163
+ }
164
+ }
165
+ }, {
166
+ props: ({
167
+ ownerState
168
+ }) => ownerState.scrollableX,
169
+ style: {
170
+ overflowX: 'auto',
171
+ overflowY: 'hidden'
172
+ }
173
+ }, {
174
+ props: ({
175
+ ownerState
176
+ }) => ownerState.scrollableY,
177
+ style: {
178
+ overflowY: 'auto',
179
+ overflowX: 'hidden'
180
+ }
181
+ }]
182
+ });
154
183
  const FlexContainer = styled('div', {
155
184
  name: 'MuiTabs',
156
185
  slot: 'FlexContainer',
@@ -160,36 +189,60 @@ const FlexContainer = styled('div', {
160
189
  } = props;
161
190
  return [styles.flexContainer, ownerState.vertical && styles.flexContainerVertical, ownerState.centered && styles.centered];
162
191
  }
163
- })(({
164
- ownerState
165
- }) => _extends({
166
- display: 'flex'
167
- }, ownerState.vertical && {
168
- flexDirection: 'column'
169
- }, ownerState.centered && {
170
- justifyContent: 'center'
171
- }));
192
+ })({
193
+ display: 'flex',
194
+ variants: [{
195
+ props: ({
196
+ ownerState
197
+ }) => ownerState.vertical,
198
+ style: {
199
+ flexDirection: 'column'
200
+ }
201
+ }, {
202
+ props: ({
203
+ ownerState
204
+ }) => ownerState.centered,
205
+ style: {
206
+ justifyContent: 'center'
207
+ }
208
+ }]
209
+ });
172
210
  const TabsIndicator = styled('span', {
173
211
  name: 'MuiTabs',
174
212
  slot: 'Indicator',
175
213
  overridesResolver: (props, styles) => styles.indicator
176
214
  })(({
177
- ownerState,
178
215
  theme
179
- }) => _extends({
216
+ }) => ({
180
217
  position: 'absolute',
181
218
  height: 2,
182
219
  bottom: 0,
183
220
  width: '100%',
184
- transition: theme.transitions.create()
185
- }, ownerState.indicatorColor === 'primary' && {
186
- backgroundColor: (theme.vars || theme).palette.primary.main
187
- }, ownerState.indicatorColor === 'secondary' && {
188
- backgroundColor: (theme.vars || theme).palette.secondary.main
189
- }, ownerState.vertical && {
190
- height: '100%',
191
- width: 2,
192
- right: 0
221
+ transition: theme.transitions.create(),
222
+ variants: [{
223
+ props: {
224
+ indicatorColor: 'primary'
225
+ },
226
+ style: {
227
+ backgroundColor: (theme.vars || theme).palette.primary.main
228
+ }
229
+ }, {
230
+ props: {
231
+ indicatorColor: 'secondary'
232
+ },
233
+ style: {
234
+ backgroundColor: (theme.vars || theme).palette.secondary.main
235
+ }
236
+ }, {
237
+ props: ({
238
+ ownerState
239
+ }) => ownerState.vertical,
240
+ style: {
241
+ height: '100%',
242
+ width: 2,
243
+ right: 0
244
+ }
245
+ }]
193
246
  }));
194
247
  const TabsScrollbarSize = styled(ScrollbarSize)({
195
248
  overflowX: 'auto',