@mui/material 6.0.0-alpha.4 → 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 (272) 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 +86 -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 +21 -14
  34. package/FormControlLabel/FormControlLabel.js +22 -4
  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 +26 -14
  65. package/PaginationItem/PaginationItem.js +64 -20
  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/SvgIcon/SvgIcon.js +73 -21
  86. package/SwipeableDrawer/SwipeArea.js +39 -18
  87. package/Tab/Tab.js +127 -55
  88. package/TabScrollButton/TabScrollButton.js +27 -15
  89. package/Table/Table.js +2 -2
  90. package/TableBody/TableBody.js +2 -2
  91. package/TableCell/TableCell.js +2 -2
  92. package/TableContainer/TableContainer.js +2 -2
  93. package/TableFooter/TableFooter.js +2 -2
  94. package/TableHead/TableHead.js +2 -2
  95. package/TablePagination/TablePagination.js +2 -2
  96. package/TableRow/TableRow.js +2 -2
  97. package/TableSortLabel/TableSortLabel.js +2 -2
  98. package/Tabs/Tabs.js +107 -54
  99. package/TextField/TextField.js +2 -2
  100. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +2 -2
  101. package/Toolbar/Toolbar.js +3 -7
  102. package/Tooltip/Tooltip.js +185 -88
  103. package/Typography/Typography.js +89 -39
  104. package/index.js +1 -1
  105. package/internal/SwitchBase.js +39 -11
  106. package/modern/Accordion/Accordion.js +2 -2
  107. package/modern/Alert/Alert.js +2 -2
  108. package/modern/Avatar/Avatar.js +1 -1
  109. package/modern/Backdrop/Backdrop.js +1 -1
  110. package/modern/Badge/Badge.js +2 -2
  111. package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
  112. package/modern/Button/Button.js +1 -1
  113. package/modern/Checkbox/Checkbox.js +3 -1
  114. package/modern/Chip/chipClasses.js +1 -1
  115. package/modern/Collapse/Collapse.js +66 -35
  116. package/modern/Dialog/Dialog.js +105 -61
  117. package/modern/DialogActions/DialogActions.js +16 -12
  118. package/modern/DialogContent/DialogContent.js +25 -15
  119. package/modern/DialogContentText/DialogContentText.js +3 -2
  120. package/modern/DialogTitle/DialogTitle.js +2 -2
  121. package/modern/Divider/Divider.js +1 -1
  122. package/modern/Drawer/Drawer.js +73 -32
  123. package/modern/Fab/Fab.js +1 -1
  124. package/modern/FilledInput/FilledInput.js +170 -87
  125. package/modern/FormControlLabel/FormControlLabel.js +22 -4
  126. package/modern/FormHelperText/FormHelperText.js +2 -2
  127. package/modern/FormLabel/FormLabel.js +23 -13
  128. package/modern/Grow/Grow.js +3 -1
  129. package/modern/Icon/Icon.js +63 -23
  130. package/modern/ImageList/ImageList.js +2 -2
  131. package/modern/ImageListItem/ImageListItem.js +2 -2
  132. package/modern/ImageListItemBar/ImageListItemBar.js +2 -2
  133. package/modern/Input/Input.js +84 -61
  134. package/modern/InputAdornment/InputAdornment.js +37 -21
  135. package/modern/InputBase/InputBase.js +58 -28
  136. package/modern/InputLabel/InputLabel.js +120 -58
  137. package/modern/Link/Link.js +99 -54
  138. package/modern/Link/getTextDecoration.js +16 -8
  139. package/modern/List/List.js +22 -13
  140. package/modern/ListItem/ListItem.js +2 -2
  141. package/modern/ListItemAvatar/ListItemAvatar.js +2 -2
  142. package/modern/ListItemButton/ListItemButton.js +3 -2
  143. package/modern/ListItemIcon/ListItemIcon.js +14 -9
  144. package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
  145. package/modern/ListItemText/ListItemText.js +2 -2
  146. package/modern/ListSubheader/ListSubheader.js +5 -3
  147. package/modern/Menu/Menu.js +3 -2
  148. package/modern/MenuItem/MenuItem.js +47 -27
  149. package/modern/NativeSelect/NativeSelectInput.js +78 -49
  150. package/modern/OutlinedInput/NotchedOutline.js +60 -43
  151. package/modern/OutlinedInput/OutlinedInput.js +97 -39
  152. package/modern/Pagination/Pagination.js +2 -2
  153. package/modern/PaginationItem/PaginationItem.js +64 -20
  154. package/modern/Paper/Paper.js +44 -21
  155. package/modern/Radio/Radio.js +5 -3
  156. package/modern/Radio/RadioButtonIcon.js +1 -1
  157. package/modern/Rating/Rating.js +3 -2
  158. package/modern/Select/Select.js +2 -1
  159. package/modern/Select/SelectInput.js +8 -6
  160. package/modern/Skeleton/Skeleton.js +109 -61
  161. package/modern/Slider/Slider.js +2 -2
  162. package/modern/Snackbar/Snackbar.js +66 -40
  163. package/modern/SnackbarContent/SnackbarContent.js +2 -2
  164. package/modern/SpeedDial/SpeedDial.js +107 -49
  165. package/modern/SpeedDialAction/SpeedDialAction.js +50 -24
  166. package/modern/SpeedDialIcon/SpeedDialIcon.js +37 -16
  167. package/modern/StepLabel/StepLabel.js +3 -3
  168. package/modern/SvgIcon/SvgIcon.js +73 -21
  169. package/modern/SwipeableDrawer/SwipeArea.js +39 -18
  170. package/modern/Tab/Tab.js +127 -55
  171. package/modern/TabScrollButton/TabScrollButton.js +27 -15
  172. package/modern/Table/Table.js +2 -2
  173. package/modern/TableBody/TableBody.js +2 -2
  174. package/modern/TableCell/TableCell.js +2 -2
  175. package/modern/TableContainer/TableContainer.js +2 -2
  176. package/modern/TableFooter/TableFooter.js +2 -2
  177. package/modern/TableHead/TableHead.js +2 -2
  178. package/modern/TablePagination/TablePagination.js +2 -2
  179. package/modern/TableRow/TableRow.js +2 -2
  180. package/modern/TableSortLabel/TableSortLabel.js +2 -2
  181. package/modern/Tabs/Tabs.js +107 -54
  182. package/modern/TextField/TextField.js +2 -2
  183. package/modern/Toolbar/Toolbar.js +3 -7
  184. package/modern/Tooltip/Tooltip.js +185 -88
  185. package/modern/Typography/Typography.js +89 -39
  186. package/modern/index.js +1 -1
  187. package/modern/internal/SwitchBase.js +39 -11
  188. package/node/Accordion/Accordion.js +2 -2
  189. package/node/Alert/Alert.js +2 -2
  190. package/node/Avatar/Avatar.js +1 -1
  191. package/node/Backdrop/Backdrop.js +1 -1
  192. package/node/Badge/Badge.js +2 -2
  193. package/node/Breadcrumbs/BreadcrumbCollapsed.js +3 -3
  194. package/node/Button/Button.js +2 -2
  195. package/node/Checkbox/Checkbox.js +3 -1
  196. package/node/Chip/chipClasses.js +1 -1
  197. package/node/Collapse/Collapse.js +70 -39
  198. package/node/Dialog/Dialog.js +110 -66
  199. package/node/DialogActions/DialogActions.js +18 -14
  200. package/node/DialogContent/DialogContent.js +27 -17
  201. package/node/DialogContentText/DialogContentText.js +6 -5
  202. package/node/DialogTitle/DialogTitle.js +4 -4
  203. package/node/Divider/Divider.js +1 -1
  204. package/node/Drawer/Drawer.js +78 -37
  205. package/node/Fab/Fab.js +2 -2
  206. package/node/FilledInput/FilledInput.js +176 -91
  207. package/node/FormControlLabel/FormControlLabel.js +23 -5
  208. package/node/FormHelperText/FormHelperText.js +4 -4
  209. package/node/FormLabel/FormLabel.js +26 -16
  210. package/node/Grow/Grow.js +3 -1
  211. package/node/Icon/Icon.js +65 -25
  212. package/node/ImageList/ImageList.js +4 -4
  213. package/node/ImageListItem/ImageListItem.js +4 -4
  214. package/node/ImageListItemBar/ImageListItemBar.js +8 -8
  215. package/node/Input/Input.js +87 -64
  216. package/node/InputAdornment/InputAdornment.js +39 -23
  217. package/node/InputBase/InputBase.js +61 -31
  218. package/node/InputLabel/InputLabel.js +123 -61
  219. package/node/Link/Link.js +101 -56
  220. package/node/Link/getTextDecoration.js +18 -10
  221. package/node/List/List.js +24 -15
  222. package/node/ListItem/ListItem.js +5 -5
  223. package/node/ListItemAvatar/ListItemAvatar.js +4 -4
  224. package/node/ListItemButton/ListItemButton.js +6 -5
  225. package/node/ListItemIcon/ListItemIcon.js +16 -11
  226. package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +4 -4
  227. package/node/ListItemText/ListItemText.js +4 -4
  228. package/node/ListSubheader/ListSubheader.js +7 -5
  229. package/node/Menu/Menu.js +8 -7
  230. package/node/MenuItem/MenuItem.js +50 -30
  231. package/node/NativeSelect/NativeSelectInput.js +80 -53
  232. package/node/OutlinedInput/NotchedOutline.js +64 -47
  233. package/node/OutlinedInput/OutlinedInput.js +101 -43
  234. package/node/Pagination/Pagination.js +5 -5
  235. package/node/PaginationItem/PaginationItem.js +65 -20
  236. package/node/Paper/Paper.js +49 -28
  237. package/node/Radio/Radio.js +6 -4
  238. package/node/Radio/RadioButtonIcon.js +2 -2
  239. package/node/Rating/Rating.js +9 -8
  240. package/node/Select/Select.js +6 -5
  241. package/node/Select/SelectInput.js +9 -7
  242. package/node/Skeleton/Skeleton.js +113 -65
  243. package/node/Slider/Slider.js +2 -2
  244. package/node/Snackbar/Snackbar.js +68 -42
  245. package/node/SnackbarContent/SnackbarContent.js +6 -6
  246. package/node/SpeedDial/SpeedDial.js +111 -53
  247. package/node/SpeedDialAction/SpeedDialAction.js +54 -28
  248. package/node/SpeedDialIcon/SpeedDialIcon.js +39 -18
  249. package/node/StepLabel/StepLabel.js +3 -3
  250. package/node/SvgIcon/SvgIcon.js +79 -24
  251. package/node/SwipeableDrawer/SwipeArea.js +41 -20
  252. package/node/Tab/Tab.js +129 -57
  253. package/node/TabScrollButton/TabScrollButton.js +29 -17
  254. package/node/Table/Table.js +4 -4
  255. package/node/TableBody/TableBody.js +4 -4
  256. package/node/TableCell/TableCell.js +4 -4
  257. package/node/TableContainer/TableContainer.js +4 -4
  258. package/node/TableFooter/TableFooter.js +4 -4
  259. package/node/TableHead/TableHead.js +4 -4
  260. package/node/TablePagination/TablePagination.js +10 -10
  261. package/node/TableRow/TableRow.js +4 -4
  262. package/node/TableSortLabel/TableSortLabel.js +5 -5
  263. package/node/Tabs/Tabs.js +113 -60
  264. package/node/TextField/TextField.js +4 -4
  265. package/node/Toolbar/Toolbar.js +5 -9
  266. package/node/Tooltip/Tooltip.js +189 -92
  267. package/node/Typography/Typography.js +90 -40
  268. package/node/index.js +1 -1
  269. package/node/internal/SwitchBase.js +41 -13
  270. package/package.json +6 -6
  271. package/umd/material-ui.development.js +2777 -1334
  272. package/umd/material-ui.production.min.js +4 -4
@@ -9,8 +9,7 @@ import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import useId from '@mui/utils/useId';
11
11
  import refType from '@mui/utils/refType';
12
- import styled from '../styles/styled';
13
- import useThemeProps from '../styles/useThemeProps';
12
+ import { styled, createUseThemeProps } from '../zero-styled';
14
13
  import Input from '../Input';
15
14
  import FilledInput from '../FilledInput';
16
15
  import OutlinedInput from '../OutlinedInput';
@@ -20,6 +19,7 @@ import FormHelperText from '../FormHelperText';
20
19
  import Select from '../Select';
21
20
  import { getTextFieldUtilityClass } from './textFieldClasses';
22
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ const useThemeProps = createUseThemeProps('MuiTextField');
23
23
  const variantComponent = {
24
24
  standard: Input,
25
25
  filled: FilledInput,
@@ -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 { getToolbarUtilityClass } from './toolbarClasses';
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ const useThemeProps = createUseThemeProps('MuiToolbar');
14
14
  const useUtilityClasses = ownerState => {
15
15
  const {
16
16
  classes,
@@ -56,11 +56,7 @@ const ToolbarRoot = styled('div', {
56
56
  style: {
57
57
  minHeight: 48
58
58
  }
59
- }]
60
- }), ({
61
- theme
62
- }) => ({
63
- variants: [{
59
+ }, {
64
60
  props: {
65
61
  variant: 'regular'
66
62
  },
@@ -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 = ["arrow", "children", "classes", "components", "componentsProps", "describeChild", "disableFocusListener", "disableHoverListener", "disableInteractive", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "followCursor", "id", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "slotProps", "slots", "title", "TransitionComponent", "TransitionProps"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
@@ -12,9 +12,8 @@ import { appendOwnerState } from '@mui/base/utils';
12
12
  import composeClasses from '@mui/utils/composeClasses';
13
13
  import { alpha } from '@mui/system/colorManipulator';
14
14
  import { useRtl } from '@mui/system/RtlProvider';
15
- import styled from '../styles/styled';
15
+ import { styled, createUseThemeProps } from '../zero-styled';
16
16
  import useTheme from '../styles/useTheme';
17
- import useThemeProps from '../styles/useThemeProps';
18
17
  import capitalize from '../utils/capitalize';
19
18
  import Grow from '../Grow';
20
19
  import Popper from '../Popper';
@@ -25,6 +24,7 @@ import useIsFocusVisible from '../utils/useIsFocusVisible';
25
24
  import useControlled from '../utils/useControlled';
26
25
  import tooltipClasses, { getTooltipUtilityClass } from './tooltipClasses';
27
26
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
+ const useThemeProps = createUseThemeProps('MuiTooltip');
28
28
  function round(value) {
29
29
  return Math.round(value * 1e5) / 1e5;
30
30
  }
@@ -53,57 +53,99 @@ const TooltipPopper = styled(Popper, {
53
53
  return [styles.popper, !ownerState.disableInteractive && styles.popperInteractive, ownerState.arrow && styles.popperArrow, !ownerState.open && styles.popperClose];
54
54
  }
55
55
  })(({
56
- theme,
57
- ownerState,
58
- open
59
- }) => _extends({
56
+ theme
57
+ }) => ({
60
58
  zIndex: (theme.vars || theme).zIndex.tooltip,
61
- pointerEvents: 'none'
62
- }, !ownerState.disableInteractive && {
63
- pointerEvents: 'auto'
64
- }, !open && {
65
- pointerEvents: 'none'
66
- }, ownerState.arrow && {
67
- [`&[data-popper-placement*="bottom"] .${tooltipClasses.arrow}`]: {
68
- top: 0,
69
- marginTop: '-0.71em',
70
- '&::before': {
71
- transformOrigin: '0 100%'
59
+ pointerEvents: 'none',
60
+ variants: [{
61
+ props: ({
62
+ ownerState
63
+ }) => !ownerState.disableInteractive,
64
+ style: {
65
+ pointerEvents: 'auto'
72
66
  }
73
- },
74
- [`&[data-popper-placement*="top"] .${tooltipClasses.arrow}`]: {
75
- bottom: 0,
76
- marginBottom: '-0.71em',
77
- '&::before': {
78
- transformOrigin: '100% 0'
67
+ }, {
68
+ props: ({
69
+ open
70
+ }) => !open,
71
+ style: {
72
+ pointerEvents: 'none'
79
73
  }
80
- },
81
- [`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]: _extends({}, !ownerState.isRtl ? {
82
- left: 0,
83
- marginLeft: '-0.71em'
84
- } : {
85
- right: 0,
86
- marginRight: '-0.71em'
87
74
  }, {
88
- height: '1em',
89
- width: '0.71em',
90
- '&::before': {
91
- transformOrigin: '100% 100%'
75
+ props: ({
76
+ ownerState
77
+ }) => ownerState.arrow,
78
+ style: {
79
+ [`&[data-popper-placement*="bottom"] .${tooltipClasses.arrow}`]: {
80
+ top: 0,
81
+ marginTop: '-0.71em',
82
+ '&::before': {
83
+ transformOrigin: '0 100%'
84
+ }
85
+ },
86
+ [`&[data-popper-placement*="top"] .${tooltipClasses.arrow}`]: {
87
+ bottom: 0,
88
+ marginBottom: '-0.71em',
89
+ '&::before': {
90
+ transformOrigin: '100% 0'
91
+ }
92
+ },
93
+ [`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]: {
94
+ height: '1em',
95
+ width: '0.71em',
96
+ '&::before': {
97
+ transformOrigin: '100% 100%'
98
+ }
99
+ },
100
+ [`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]: {
101
+ height: '1em',
102
+ width: '0.71em',
103
+ '&::before': {
104
+ transformOrigin: '0 0'
105
+ }
106
+ }
92
107
  }
93
- }),
94
- [`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]: _extends({}, !ownerState.isRtl ? {
95
- right: 0,
96
- marginRight: '-0.71em'
97
- } : {
98
- left: 0,
99
- marginLeft: '-0.71em'
100
108
  }, {
101
- height: '1em',
102
- width: '0.71em',
103
- '&::before': {
104
- transformOrigin: '0 0'
109
+ props: ({
110
+ ownerState
111
+ }) => ownerState.arrow && !ownerState.isRtl,
112
+ style: {
113
+ [`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]: {
114
+ left: 0,
115
+ marginLeft: '-0.71em'
116
+ }
105
117
  }
106
- })
118
+ }, {
119
+ props: ({
120
+ ownerState
121
+ }) => ownerState.arrow && !!ownerState.isRtl,
122
+ style: {
123
+ [`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]: {
124
+ right: 0,
125
+ marginRight: '-0.71em'
126
+ }
127
+ }
128
+ }, {
129
+ props: ({
130
+ ownerState
131
+ }) => ownerState.arrow && !ownerState.isRtl,
132
+ style: {
133
+ [`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]: {
134
+ right: 0,
135
+ marginRight: '-0.71em'
136
+ }
137
+ }
138
+ }, {
139
+ props: ({
140
+ ownerState
141
+ }) => ownerState.arrow && !!ownerState.isRtl,
142
+ style: {
143
+ [`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]: {
144
+ left: 0,
145
+ marginLeft: '-0.71em'
146
+ }
147
+ }
148
+ }]
107
149
  }));
108
150
  const TooltipTooltip = styled('div', {
109
151
  name: 'MuiTooltip',
@@ -115,9 +157,8 @@ const TooltipTooltip = styled('div', {
115
157
  return [styles.tooltip, ownerState.touch && styles.touch, ownerState.arrow && styles.tooltipArrow, styles[`tooltipPlacement${capitalize(ownerState.placement.split('-')[0])}`]];
116
158
  }
117
159
  })(({
118
- theme,
119
- ownerState
120
- }) => _extends({
160
+ theme
161
+ }) => ({
121
162
  backgroundColor: theme.vars ? theme.vars.palette.Tooltip.bg : alpha(theme.palette.grey[700], 0.92),
122
163
  borderRadius: (theme.vars || theme).shape.borderRadius,
123
164
  color: (theme.vars || theme).palette.common.white,
@@ -127,50 +168,106 @@ const TooltipTooltip = styled('div', {
127
168
  maxWidth: 300,
128
169
  margin: 2,
129
170
  wordWrap: 'break-word',
130
- fontWeight: theme.typography.fontWeightMedium
131
- }, ownerState.arrow && {
132
- position: 'relative',
133
- margin: 0
134
- }, ownerState.touch && {
135
- padding: '8px 16px',
136
- fontSize: theme.typography.pxToRem(14),
137
- lineHeight: `${round(16 / 14)}em`,
138
- fontWeight: theme.typography.fontWeightRegular
139
- }, {
140
- [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: _extends({
171
+ fontWeight: theme.typography.fontWeightMedium,
172
+ [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: {
141
173
  transformOrigin: 'right center'
142
- }, !ownerState.isRtl ? _extends({
143
- marginRight: '14px'
144
- }, ownerState.touch && {
145
- marginRight: '24px'
146
- }) : _extends({
147
- marginLeft: '14px'
148
- }, ownerState.touch && {
149
- marginLeft: '24px'
150
- })),
151
- [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: _extends({
174
+ },
175
+ [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: {
152
176
  transformOrigin: 'left center'
153
- }, !ownerState.isRtl ? _extends({
154
- marginLeft: '14px'
155
- }, ownerState.touch && {
156
- marginLeft: '24px'
157
- }) : _extends({
158
- marginRight: '14px'
159
- }, ownerState.touch && {
160
- marginRight: '24px'
161
- })),
162
- [`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]: _extends({
177
+ },
178
+ [`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]: {
163
179
  transformOrigin: 'center bottom',
164
180
  marginBottom: '14px'
165
- }, ownerState.touch && {
166
- marginBottom: '24px'
167
- }),
168
- [`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]: _extends({
181
+ },
182
+ [`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]: {
169
183
  transformOrigin: 'center top',
170
184
  marginTop: '14px'
171
- }, ownerState.touch && {
172
- marginTop: '24px'
173
- })
185
+ },
186
+ variants: [{
187
+ props: ({
188
+ ownerState
189
+ }) => ownerState.arrow,
190
+ style: {
191
+ position: 'relative',
192
+ margin: 0
193
+ }
194
+ }, {
195
+ props: ({
196
+ ownerState
197
+ }) => ownerState.touch,
198
+ style: {
199
+ padding: '8px 16px',
200
+ fontSize: theme.typography.pxToRem(14),
201
+ lineHeight: `${round(16 / 14)}em`,
202
+ fontWeight: theme.typography.fontWeightRegular
203
+ }
204
+ }, {
205
+ props: ({
206
+ ownerState
207
+ }) => !ownerState.isRtl,
208
+ style: {
209
+ [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: {
210
+ marginRight: '14px'
211
+ },
212
+ [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: {
213
+ marginLeft: '14px'
214
+ }
215
+ }
216
+ }, {
217
+ props: ({
218
+ ownerState
219
+ }) => !ownerState.isRtl && ownerState.touch,
220
+ style: {
221
+ [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: {
222
+ marginRight: '24px'
223
+ },
224
+ [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: {
225
+ marginLeft: '24px'
226
+ }
227
+ }
228
+ }, {
229
+ props: ({
230
+ ownerState
231
+ }) => !!ownerState.isRtl,
232
+ style: {
233
+ [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: {
234
+ marginLeft: '14px'
235
+ },
236
+ [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: {
237
+ marginRight: '14px'
238
+ }
239
+ }
240
+ }, {
241
+ props: ({
242
+ ownerState
243
+ }) => !!ownerState.isRtl && ownerState.touch,
244
+ style: {
245
+ [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: {
246
+ marginLeft: '24px'
247
+ },
248
+ [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: {
249
+ marginRight: '24px'
250
+ }
251
+ }
252
+ }, {
253
+ props: ({
254
+ ownerState
255
+ }) => ownerState.touch,
256
+ style: {
257
+ [`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]: {
258
+ marginBottom: '24px'
259
+ }
260
+ }
261
+ }, {
262
+ props: ({
263
+ ownerState
264
+ }) => ownerState.touch,
265
+ style: {
266
+ [`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]: {
267
+ marginTop: '24px'
268
+ }
269
+ }
270
+ }]
174
271
  }));
175
272
  const TooltipArrow = styled('span', {
176
273
  name: 'MuiTooltip',
@@ -1,18 +1,19 @@
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";
5
- const _excluded = ["align", "className", "component", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"];
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
+ const _excluded = ["color"],
6
+ _excluded2 = ["align", "className", "component", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"];
6
7
  import * as React from 'react';
7
8
  import PropTypes from 'prop-types';
8
9
  import clsx from 'clsx';
9
10
  import { extendSxProp } from '@mui/system/styleFunctionSx';
10
11
  import composeClasses from '@mui/utils/composeClasses';
11
- import styled from '../styles/styled';
12
- import useThemeProps from '../styles/useThemeProps';
12
+ import { styled, createUseThemeProps } from '../zero-styled';
13
13
  import capitalize from '../utils/capitalize';
14
14
  import { getTypographyUtilityClass } from './typographyClasses';
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
+ const useThemeProps = createUseThemeProps('MuiTypography');
16
17
  const useUtilityClasses = ownerState => {
17
18
  const {
18
19
  align,
@@ -37,25 +38,62 @@ export const TypographyRoot = styled('span', {
37
38
  return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== 'inherit' && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];
38
39
  }
39
40
  })(({
40
- theme,
41
- ownerState
42
- }) => _extends({
43
- margin: 0
44
- }, ownerState.variant === 'inherit' && {
45
- // Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
46
- font: 'inherit',
47
- lineHeight: 'inherit',
48
- letterSpacing: 'inherit'
49
- }, ownerState.variant !== 'inherit' && theme.typography[ownerState.variant], ownerState.align !== 'inherit' && {
50
- textAlign: ownerState.align
51
- }, ownerState.noWrap && {
52
- overflow: 'hidden',
53
- textOverflow: 'ellipsis',
54
- whiteSpace: 'nowrap'
55
- }, ownerState.gutterBottom && {
56
- marginBottom: '0.35em'
57
- }, ownerState.paragraph && {
58
- marginBottom: 16
41
+ theme
42
+ }) => ({
43
+ margin: 0,
44
+ variants: [{
45
+ props: {
46
+ variant: 'inherit'
47
+ },
48
+ style: {
49
+ // Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
50
+ font: 'inherit',
51
+ lineHeight: 'inherit',
52
+ letterSpacing: 'inherit'
53
+ }
54
+ }, ...Object.entries(theme.typography).filter(([variant, value]) => variant !== 'inherit' && value && typeof value === 'object').map(([variant, value]) => ({
55
+ props: {
56
+ variant
57
+ },
58
+ style: value
59
+ })), ...Object.entries(theme.palette).filter(([, value]) => value.main).map(([color]) => ({
60
+ props: {
61
+ color
62
+ },
63
+ style: {
64
+ color: (theme.vars || theme).palette[color].main
65
+ }
66
+ })), {
67
+ props: ({
68
+ ownerState
69
+ }) => ownerState.align !== 'inherit',
70
+ style: {
71
+ textAlign: 'var(--Typography-textAlign)'
72
+ }
73
+ }, {
74
+ props: ({
75
+ ownerState
76
+ }) => ownerState.noWrap,
77
+ style: {
78
+ overflow: 'hidden',
79
+ textOverflow: 'ellipsis',
80
+ whiteSpace: 'nowrap'
81
+ }
82
+ }, {
83
+ props: ({
84
+ ownerState
85
+ }) => ownerState.gutterBottom,
86
+ style: {
87
+ marginBottom: '0.35em'
88
+ }
89
+ }, {
90
+ props: ({
91
+ ownerState
92
+ }) => ownerState.paragraph,
93
+ style: {
94
+ marginBottom: 16
95
+ }
96
+ }]
59
97
  }));
60
98
  const defaultVariantMapping = {
61
99
  h1: 'h1',
@@ -71,25 +109,30 @@ const defaultVariantMapping = {
71
109
  inherit: 'p'
72
110
  };
73
111
 
74
- // TODO v6: deprecate these color values in v5.x and remove the transformation in v6
112
+ // TODO v7: remove this transformation and `extendSxProp`
75
113
  const colorTransformations = {
76
- primary: 'primary.main',
77
114
  textPrimary: 'text.primary',
78
- secondary: 'secondary.main',
79
115
  textSecondary: 'text.secondary',
80
- error: 'error.main'
81
- };
82
- const transformDeprecatedColors = color => {
83
- return colorTransformations[color] || color;
116
+ // For the main palette, the color will be applied by the `...Object.entries(theme.palette)` clause in the TypographyRoot's styles
117
+ primary: null,
118
+ secondary: null,
119
+ error: null,
120
+ info: null,
121
+ success: null,
122
+ warning: null
84
123
  };
85
124
  const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, ref) {
86
- const themeProps = useThemeProps({
87
- props: inProps,
88
- name: 'MuiTypography'
89
- });
90
- const color = transformDeprecatedColors(themeProps.color);
91
- const props = extendSxProp(_extends({}, themeProps, {
92
- color
125
+ const _useThemeProps = useThemeProps({
126
+ props: inProps,
127
+ name: 'MuiTypography'
128
+ }),
129
+ {
130
+ color
131
+ } = _useThemeProps,
132
+ themeProps = _objectWithoutPropertiesLoose(_useThemeProps, _excluded);
133
+ const textColor = colorTransformations[color];
134
+ const props = extendSxProp(_extends({}, themeProps, textColor !== null && {
135
+ color: textColor || color
93
136
  }));
94
137
  const {
95
138
  align = 'inherit',
@@ -101,7 +144,7 @@ const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, re
101
144
  variant = 'body1',
102
145
  variantMapping = defaultVariantMapping
103
146
  } = props,
104
- other = _objectWithoutPropertiesLoose(props, _excluded);
147
+ other = _objectWithoutPropertiesLoose(props, _excluded2);
105
148
  const ownerState = _extends({}, props, {
106
149
  align,
107
150
  color,
@@ -120,7 +163,10 @@ const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, re
120
163
  ref: ref,
121
164
  className: clsx(classes.root, className)
122
165
  }, other, {
123
- ownerState: ownerState
166
+ ownerState: ownerState,
167
+ style: _extends({}, align !== 'inherit' && {
168
+ '--Typography-textAlign': align
169
+ }, other.style)
124
170
  }));
125
171
  });
126
172
  process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes */ = {
@@ -168,6 +214,10 @@ process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes
168
214
  * @default false
169
215
  */
170
216
  paragraph: PropTypes.bool,
217
+ /**
218
+ * @ignore
219
+ */
220
+ style: PropTypes.object,
171
221
  /**
172
222
  * The system prop that allows defining system overrides as well as additional CSS styles.
173
223
  */
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.0-alpha.4
2
+ * @mui/material v6.0.0-alpha.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -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 = ["autoFocus", "checked", "checkedIcon", "className", "defaultChecked", "disabled", "disableFocusRipple", "edge", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
@@ -9,7 +9,8 @@ import clsx from 'clsx';
9
9
  import refType from '@mui/utils/refType';
10
10
  import composeClasses from '@mui/utils/composeClasses';
11
11
  import capitalize from '../utils/capitalize';
12
- import styled, { rootShouldForwardProp } from '../styles/styled';
12
+ import rootShouldForwardProp from '../styles/rootShouldForwardProp';
13
+ import { styled } from '../zero-styled';
13
14
  import useControlled from '../utils/useControlled';
14
15
  import useFormControl from '../FormControl/useFormControl';
15
16
  import ButtonBase from '../ButtonBase';
@@ -28,16 +29,43 @@ const useUtilityClasses = ownerState => {
28
29
  };
29
30
  return composeClasses(slots, getSwitchBaseUtilityClass, classes);
30
31
  };
31
- const SwitchBaseRoot = styled(ButtonBase)(({
32
- ownerState
33
- }) => _extends({
32
+ const SwitchBaseRoot = styled(ButtonBase)({
34
33
  padding: 9,
35
- borderRadius: '50%'
36
- }, ownerState.edge === 'start' && {
37
- marginLeft: ownerState.size === 'small' ? -3 : -12
38
- }, ownerState.edge === 'end' && {
39
- marginRight: ownerState.size === 'small' ? -3 : -12
40
- }));
34
+ borderRadius: '50%',
35
+ variants: [{
36
+ props: {
37
+ edge: 'start',
38
+ size: 'small'
39
+ },
40
+ style: {
41
+ marginLeft: -3
42
+ }
43
+ }, {
44
+ props: ({
45
+ edge,
46
+ ownerState
47
+ }) => edge === 'start' && ownerState.size !== 'small',
48
+ style: {
49
+ marginLeft: -12
50
+ }
51
+ }, {
52
+ props: {
53
+ edge: 'end',
54
+ size: 'small'
55
+ },
56
+ style: {
57
+ marginRight: -3
58
+ }
59
+ }, {
60
+ props: ({
61
+ edge,
62
+ ownerState
63
+ }) => edge === 'end' && ownerState.size !== 'small',
64
+ style: {
65
+ marginRight: -12
66
+ }
67
+ }]
68
+ });
41
69
  const SwitchBaseInput = styled('input', {
42
70
  shouldForwardProp: rootShouldForwardProp
43
71
  })({
@@ -290,13 +290,13 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
290
290
  /**
291
291
  * The component used for the transition.
292
292
  * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
293
- * @deprecated Use `slots.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
293
+ * @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
294
294
  */
295
295
  TransitionComponent: _propTypes.default.elementType,
296
296
  /**
297
297
  * Props applied to the transition element.
298
298
  * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
299
- * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
299
+ * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
300
300
  */
301
301
  TransitionProps: _propTypes.default.object
302
302
  } : void 0;
@@ -272,7 +272,7 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes /* remove-proptypes */ =
272
272
  /**
273
273
  * The components used for each slot inside.
274
274
  *
275
- * @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
275
+ * @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.
276
276
  *
277
277
  * @default {}
278
278
  */
@@ -284,7 +284,7 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes /* remove-proptypes */ =
284
284
  * The extra props for the slot components.
285
285
  * You can override the existing props or add new ones.
286
286
  *
287
- * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
287
+ * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
288
288
  *
289
289
  * @default {}
290
290
  */