@mui/material 5.14.6 → 5.14.8

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 (118) hide show
  1. package/Accordion/Accordion.d.ts +2 -2
  2. package/AccordionSummary/AccordionSummary.d.ts +22 -20
  3. package/AppBar/AppBar.d.ts +33 -31
  4. package/Avatar/Avatar.d.ts +49 -50
  5. package/Backdrop/Backdrop.d.ts +87 -85
  6. package/Badge/Badge.d.ts +2 -2
  7. package/BottomNavigation/BottomNavigation.d.ts +35 -33
  8. package/BottomNavigationAction/BottomNavigationAction.d.ts +39 -37
  9. package/Breadcrumbs/Breadcrumbs.d.ts +69 -67
  10. package/Button/Button.d.ts +72 -73
  11. package/ButtonBase/ButtonBase.d.ts +83 -81
  12. package/ButtonGroup/ButtonGroup.d.ts +72 -70
  13. package/CHANGELOG.md +136 -2
  14. package/Card/Card.d.ts +19 -18
  15. package/CardActionArea/CardActionArea.d.ts +15 -13
  16. package/CardContent/CardContent.d.ts +18 -16
  17. package/CardHeader/CardHeader.d.ts +77 -67
  18. package/CardMedia/CardMedia.d.ts +30 -28
  19. package/Chip/Chip.d.ts +84 -82
  20. package/CircularProgress/CircularProgress.d.ts +1 -1
  21. package/CircularProgress/CircularProgress.js +1 -1
  22. package/Container/Container.d.ts +35 -33
  23. package/DialogContentText/DialogContentText.d.ts +14 -12
  24. package/DialogTitle/DialogTitle.d.ts +18 -16
  25. package/Divider/Divider.d.ts +49 -50
  26. package/Fab/Fab.d.ts +59 -56
  27. package/FormControl/FormControl.d.ts +74 -72
  28. package/FormHelperText/FormHelperText.d.ts +52 -50
  29. package/FormLabel/FormLabel.d.ts +7 -4
  30. package/Grid/Grid.d.ts +69 -68
  31. package/Hidden/Hidden.d.ts +10 -10
  32. package/Icon/Icon.d.ts +50 -48
  33. package/IconButton/IconButton.d.ts +52 -50
  34. package/ImageList/ImageList.d.ts +41 -39
  35. package/ImageListItem/ImageListItem.d.ts +28 -26
  36. package/ImageListItem/ImageListItem.js +2 -1
  37. package/InputAdornment/InputAdornment.d.ts +39 -37
  38. package/InputBase/InputBase.js +1 -1
  39. package/InputLabel/InputLabel.d.ts +58 -56
  40. package/InputLabel/InputLabel.js +2 -1
  41. package/Link/Link.d.ts +37 -39
  42. package/List/List.d.ts +34 -35
  43. package/ListItem/ListItem.d.ts +53 -49
  44. package/ListItemButton/ListItemButton.d.ts +9 -3
  45. package/ListSubheader/ListSubheader.d.ts +38 -36
  46. package/MenuItem/MenuItem.d.ts +47 -44
  47. package/MenuList/MenuList.d.ts +37 -35
  48. package/Modal/Modal.d.ts +172 -178
  49. package/PaginationItem/PaginationItem.d.ts +85 -83
  50. package/Paper/Paper.d.ts +2 -2
  51. package/Popover/Popover.d.ts +2 -1
  52. package/Popover/Popover.js +20 -6
  53. package/Radio/Radio.js +3 -2
  54. package/Radio/radioClasses.d.ts +2 -0
  55. package/Radio/radioClasses.js +1 -1
  56. package/ScopedCssBaseline/ScopedCssBaseline.d.ts +25 -23
  57. package/Select/SelectInput.js +9 -5
  58. package/Skeleton/Skeleton.d.ts +42 -40
  59. package/Slider/Slider.d.ts +249 -247
  60. package/Snackbar/Snackbar.d.ts +4 -4
  61. package/Snackbar/Snackbar.js +4 -4
  62. package/Stack/Stack.d.ts +39 -38
  63. package/Step/Step.d.ts +46 -44
  64. package/StepButton/StepButton.d.ts +27 -25
  65. package/Stepper/Stepper.d.ts +45 -44
  66. package/SvgIcon/SvgIcon.d.ts +77 -75
  67. package/SwipeableDrawer/SwipeableDrawer.js +4 -4
  68. package/Tab/Tab.d.ts +52 -50
  69. package/TabScrollButton/TabScrollButton.d.ts +3 -2
  70. package/Table/Table.d.ts +35 -33
  71. package/TableBody/TableBody.d.ts +18 -16
  72. package/TableContainer/TableContainer.d.ts +18 -16
  73. package/TableFooter/TableFooter.d.ts +18 -16
  74. package/TableHead/TableHead.d.ts +18 -16
  75. package/TablePagination/TablePagination.d.ts +113 -112
  76. package/TableRow/TableRow.d.ts +28 -26
  77. package/TableSortLabel/TableSortLabel.d.ts +40 -36
  78. package/Tabs/Tabs.d.ts +153 -150
  79. package/ToggleButton/ToggleButton.d.ts +72 -70
  80. package/Toolbar/Toolbar.d.ts +29 -27
  81. package/Typography/Typography.d.ts +2 -2
  82. package/index.js +1 -1
  83. package/legacy/CircularProgress/CircularProgress.js +1 -1
  84. package/legacy/ImageListItem/ImageListItem.js +2 -1
  85. package/legacy/InputBase/InputBase.js +1 -1
  86. package/legacy/InputLabel/InputLabel.js +2 -1
  87. package/legacy/Popover/Popover.js +22 -5
  88. package/legacy/Radio/Radio.js +3 -2
  89. package/legacy/Radio/radioClasses.js +1 -1
  90. package/legacy/Select/SelectInput.js +9 -5
  91. package/legacy/Snackbar/Snackbar.js +4 -4
  92. package/legacy/SwipeableDrawer/SwipeableDrawer.js +4 -4
  93. package/legacy/index.js +1 -1
  94. package/modern/CircularProgress/CircularProgress.js +1 -1
  95. package/modern/ImageListItem/ImageListItem.js +2 -1
  96. package/modern/InputBase/InputBase.js +1 -1
  97. package/modern/InputLabel/InputLabel.js +2 -1
  98. package/modern/Popover/Popover.js +20 -6
  99. package/modern/Radio/Radio.js +3 -2
  100. package/modern/Radio/radioClasses.js +1 -1
  101. package/modern/Select/SelectInput.js +8 -5
  102. package/modern/Snackbar/Snackbar.js +4 -4
  103. package/modern/SwipeableDrawer/SwipeableDrawer.js +4 -4
  104. package/modern/index.js +1 -1
  105. package/node/CircularProgress/CircularProgress.js +1 -1
  106. package/node/ImageListItem/ImageListItem.js +2 -1
  107. package/node/InputBase/InputBase.js +1 -1
  108. package/node/InputLabel/InputLabel.js +2 -1
  109. package/node/Popover/Popover.js +20 -6
  110. package/node/Radio/Radio.js +3 -2
  111. package/node/Radio/radioClasses.js +1 -1
  112. package/node/Select/SelectInput.js +9 -5
  113. package/node/Snackbar/Snackbar.js +4 -4
  114. package/node/SwipeableDrawer/SwipeableDrawer.js +4 -4
  115. package/node/index.js +1 -1
  116. package/package.json +5 -5
  117. package/umd/material-ui.development.js +75 -34
  118. package/umd/material-ui.production.min.js +7 -7
package/Modal/Modal.d.ts CHANGED
@@ -26,187 +26,181 @@ export interface ModalSlots {
26
26
  backdrop?: React.ElementType;
27
27
  }
28
28
 
29
+ export interface ModalOwnProps {
30
+ /**
31
+ * A backdrop component. This prop enables custom backdrop rendering.
32
+ * @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
33
+ * Use the `slots.backdrop` prop to make your application ready for the next version of Material UI.
34
+ * @default styled(Backdrop, {
35
+ * name: 'MuiModal',
36
+ * slot: 'Backdrop',
37
+ * overridesResolver: (props, styles) => {
38
+ * return styles.backdrop;
39
+ * },
40
+ * })({
41
+ * zIndex: -1,
42
+ * })
43
+ */
44
+ BackdropComponent?: React.ElementType<BackdropProps>;
45
+ /**
46
+ * Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
47
+ * @deprecated Use `slotProps.backdrop` instead.
48
+ */
49
+ BackdropProps?: Partial<BackdropProps>;
50
+ /**
51
+ * A single child content element.
52
+ */
53
+ children: React.ReactElement;
54
+ /**
55
+ * Override or extend the styles applied to the component.
56
+ */
57
+ classes?: Partial<ModalClasses>;
58
+ /**
59
+ * @ignore
60
+ */
61
+ className?: string;
62
+ /**
63
+ * When set to true the Modal waits until a nested Transition is completed before closing.
64
+ * @default false
65
+ */
66
+ closeAfterTransition?: boolean;
67
+ /**
68
+ * The components used for each slot inside.
69
+ *
70
+ * This prop is an alias for the `slots` prop.
71
+ * It's recommended to use the `slots` prop instead.
72
+ *
73
+ * @default {}
74
+ */
75
+ components?: {
76
+ Root?: React.ElementType;
77
+ Backdrop?: React.ElementType;
78
+ };
79
+ /**
80
+ * The extra props for the slot components.
81
+ * You can override the existing props or add new ones.
82
+ *
83
+ * This prop is an alias for the `slotProps` prop.
84
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
85
+ *
86
+ * @default {}
87
+ */
88
+ componentsProps?: {
89
+ root?: SlotComponentProps<'div', ModalComponentsPropsOverrides, ModalOwnerState>;
90
+ backdrop?: SlotComponentProps<typeof Backdrop, ModalComponentsPropsOverrides, ModalOwnerState>;
91
+ };
92
+ /**
93
+ * An HTML element or function that returns one.
94
+ * The `container` will have the portal children appended to it.
95
+ *
96
+ * By default, it uses the body of the top-level document object,
97
+ * so it's simply `document.body` most of the time.
98
+ */
99
+ container?: PortalProps['container'];
100
+ /**
101
+ * If `true`, the modal will not automatically shift focus to itself when it opens, and
102
+ * replace it to the last focused element when it closes.
103
+ * This also works correctly with any modal children that have the `disableAutoFocus` prop.
104
+ *
105
+ * Generally this should never be set to `true` as it makes the modal less
106
+ * accessible to assistive technologies, like screen readers.
107
+ * @default false
108
+ */
109
+ disableAutoFocus?: boolean;
110
+ /**
111
+ * If `true`, the modal will not prevent focus from leaving the modal while open.
112
+ *
113
+ * Generally this should never be set to `true` as it makes the modal less
114
+ * accessible to assistive technologies, like screen readers.
115
+ * @default false
116
+ */
117
+ disableEnforceFocus?: boolean;
118
+ /**
119
+ * If `true`, hitting escape will not fire the `onClose` callback.
120
+ * @default false
121
+ */
122
+ disableEscapeKeyDown?: boolean;
123
+ /**
124
+ * The `children` will be under the DOM hierarchy of the parent component.
125
+ * @default false
126
+ */
127
+ disablePortal?: PortalProps['disablePortal'];
128
+ /**
129
+ * If `true`, the modal will not restore focus to previously focused element once
130
+ * modal is hidden or unmounted.
131
+ * @default false
132
+ */
133
+ disableRestoreFocus?: boolean;
134
+ /**
135
+ * Disable the scroll lock behavior.
136
+ * @default false
137
+ */
138
+ disableScrollLock?: boolean;
139
+ /**
140
+ * If `true`, the backdrop is not rendered.
141
+ * @default false
142
+ */
143
+ hideBackdrop?: boolean;
144
+ /**
145
+ * Always keep the children in the DOM.
146
+ * This prop can be useful in SEO situation or
147
+ * when you want to maximize the responsiveness of the Modal.
148
+ * @default false
149
+ */
150
+ keepMounted?: boolean;
151
+ /**
152
+ * Callback fired when the backdrop is clicked.
153
+ * @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
154
+ */
155
+ onBackdropClick?: React.ReactEventHandler<{}>;
156
+ /**
157
+ * Callback fired when the component requests to be closed.
158
+ * The `reason` parameter can optionally be used to control the response to `onClose`.
159
+ *
160
+ * @param {object} event The event source of the callback.
161
+ * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
162
+ */
163
+ onClose?: {
164
+ bivarianceHack(event: {}, reason: 'backdropClick' | 'escapeKeyDown'): void;
165
+ }['bivarianceHack'];
166
+ /**
167
+ * A function called when a transition enters.
168
+ */
169
+ onTransitionEnter?: () => void;
170
+ /**
171
+ * A function called when a transition has exited.
172
+ */
173
+ onTransitionExited?: () => void;
174
+ /**
175
+ * If `true`, the component is shown.
176
+ */
177
+ open: boolean;
178
+ /**
179
+ * The components used for each slot inside the Modal.
180
+ * Either a string to use a HTML element or a component.
181
+ * @default {}
182
+ */
183
+ slots?: ModalSlots;
184
+ /**
185
+ * The props used for each slot inside the Modal.
186
+ * @default {}
187
+ */
188
+ slotProps?: {
189
+ root?: SlotComponentProps<'div', ModalComponentsPropsOverrides, ModalOwnerState>;
190
+ backdrop?: SlotComponentProps<typeof Backdrop, ModalComponentsPropsOverrides, ModalOwnerState>;
191
+ };
192
+ /**
193
+ * The system prop that allows defining system overrides as well as additional CSS styles.
194
+ */
195
+ sx?: SxProps<Theme>;
196
+ }
197
+
29
198
  export interface ModalTypeMap<
30
- DefaultComponent extends React.ElementType = 'div',
199
+ RootComponent extends React.ElementType = 'div',
31
200
  AdditionalProps = {},
32
201
  > {
33
- props: AdditionalProps & {
34
- /**
35
- * A backdrop component. This prop enables custom backdrop rendering.
36
- * @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
37
- * Use the `slots.backdrop` prop to make your application ready for the next version of Material UI.
38
- * @default styled(Backdrop, {
39
- * name: 'MuiModal',
40
- * slot: 'Backdrop',
41
- * overridesResolver: (props, styles) => {
42
- * return styles.backdrop;
43
- * },
44
- * })({
45
- * zIndex: -1,
46
- * })
47
- */
48
- BackdropComponent?: React.ElementType<BackdropProps>;
49
- /**
50
- * Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
51
- * @deprecated Use `slotProps.backdrop` instead.
52
- */
53
- BackdropProps?: Partial<BackdropProps>;
54
- /**
55
- * A single child content element.
56
- */
57
- children: React.ReactElement;
58
- /**
59
- * Override or extend the styles applied to the component.
60
- */
61
- classes?: Partial<ModalClasses>;
62
- /**
63
- * @ignore
64
- */
65
- className?: string;
66
- /**
67
- * When set to true the Modal waits until a nested Transition is completed before closing.
68
- * @default false
69
- */
70
- closeAfterTransition?: boolean;
71
- /**
72
- * The components used for each slot inside.
73
- *
74
- * This prop is an alias for the `slots` prop.
75
- * It's recommended to use the `slots` prop instead.
76
- *
77
- * @default {}
78
- */
79
- components?: {
80
- Root?: React.ElementType;
81
- Backdrop?: React.ElementType;
82
- };
83
- /**
84
- * The extra props for the slot components.
85
- * You can override the existing props or add new ones.
86
- *
87
- * This prop is an alias for the `slotProps` prop.
88
- * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
89
- *
90
- * @default {}
91
- */
92
- componentsProps?: {
93
- root?: SlotComponentProps<'div', ModalComponentsPropsOverrides, ModalOwnerState>;
94
- backdrop?: SlotComponentProps<
95
- typeof Backdrop,
96
- ModalComponentsPropsOverrides,
97
- ModalOwnerState
98
- >;
99
- };
100
- /**
101
- * An HTML element or function that returns one.
102
- * The `container` will have the portal children appended to it.
103
- *
104
- * By default, it uses the body of the top-level document object,
105
- * so it's simply `document.body` most of the time.
106
- */
107
- container?: PortalProps['container'];
108
- /**
109
- * If `true`, the modal will not automatically shift focus to itself when it opens, and
110
- * replace it to the last focused element when it closes.
111
- * This also works correctly with any modal children that have the `disableAutoFocus` prop.
112
- *
113
- * Generally this should never be set to `true` as it makes the modal less
114
- * accessible to assistive technologies, like screen readers.
115
- * @default false
116
- */
117
- disableAutoFocus?: boolean;
118
- /**
119
- * If `true`, the modal will not prevent focus from leaving the modal while open.
120
- *
121
- * Generally this should never be set to `true` as it makes the modal less
122
- * accessible to assistive technologies, like screen readers.
123
- * @default false
124
- */
125
- disableEnforceFocus?: boolean;
126
- /**
127
- * If `true`, hitting escape will not fire the `onClose` callback.
128
- * @default false
129
- */
130
- disableEscapeKeyDown?: boolean;
131
- /**
132
- * The `children` will be under the DOM hierarchy of the parent component.
133
- * @default false
134
- */
135
- disablePortal?: PortalProps['disablePortal'];
136
- /**
137
- * If `true`, the modal will not restore focus to previously focused element once
138
- * modal is hidden or unmounted.
139
- * @default false
140
- */
141
- disableRestoreFocus?: boolean;
142
- /**
143
- * Disable the scroll lock behavior.
144
- * @default false
145
- */
146
- disableScrollLock?: boolean;
147
- /**
148
- * If `true`, the backdrop is not rendered.
149
- * @default false
150
- */
151
- hideBackdrop?: boolean;
152
- /**
153
- * Always keep the children in the DOM.
154
- * This prop can be useful in SEO situation or
155
- * when you want to maximize the responsiveness of the Modal.
156
- * @default false
157
- */
158
- keepMounted?: boolean;
159
- /**
160
- * Callback fired when the backdrop is clicked.
161
- * @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
162
- */
163
- onBackdropClick?: React.ReactEventHandler<{}>;
164
- /**
165
- * Callback fired when the component requests to be closed.
166
- * The `reason` parameter can optionally be used to control the response to `onClose`.
167
- *
168
- * @param {object} event The event source of the callback.
169
- * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
170
- */
171
- onClose?: {
172
- bivarianceHack(event: {}, reason: 'backdropClick' | 'escapeKeyDown'): void;
173
- }['bivarianceHack'];
174
- /**
175
- * A function called when a transition enters.
176
- */
177
- onTransitionEnter?: () => void;
178
- /**
179
- * A function called when a transition has exited.
180
- */
181
- onTransitionExited?: () => void;
182
- /**
183
- * If `true`, the component is shown.
184
- */
185
- open: boolean;
186
- /**
187
- * The components used for each slot inside the Modal.
188
- * Either a string to use a HTML element or a component.
189
- * @default {}
190
- */
191
- slots?: ModalSlots;
192
- /**
193
- * The props used for each slot inside the Modal.
194
- * @default {}
195
- */
196
- slotProps?: {
197
- root?: SlotComponentProps<'div', ModalComponentsPropsOverrides, ModalOwnerState>;
198
- backdrop?: SlotComponentProps<
199
- typeof Backdrop,
200
- ModalComponentsPropsOverrides,
201
- ModalOwnerState
202
- >;
203
- };
204
- /**
205
- * The system prop that allows defining system overrides as well as additional CSS styles.
206
- */
207
- sx?: SxProps<Theme>;
208
- };
209
- defaultComponent: DefaultComponent;
202
+ props: AdditionalProps & ModalOwnProps;
203
+ defaultComponent: RootComponent;
210
204
  }
211
205
 
212
206
  type ModalRootProps = NonNullable<ModalTypeMap['props']['slotProps']>['root'];
@@ -12,92 +12,94 @@ export interface PaginationItemPropsSizeOverrides {}
12
12
 
13
13
  export interface PaginationItemPropsColorOverrides {}
14
14
 
15
+ export interface PaginationItemOwnProps {
16
+ /**
17
+ * Override or extend the styles applied to the component.
18
+ */
19
+ classes?: Partial<PaginationItemClasses>;
20
+ /**
21
+ * The active color.
22
+ * It supports both default and custom theme colors, which can be added as shown in the
23
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
24
+ * @default 'standard'
25
+ */
26
+ color?: OverridableStringUnion<
27
+ 'standard' | 'primary' | 'secondary',
28
+ PaginationItemPropsColorOverrides
29
+ >;
30
+ /**
31
+ * The components used for each slot inside.
32
+ *
33
+ * This prop is an alias for the `slots` prop.
34
+ * It's recommended to use the `slots` prop instead.
35
+ *
36
+ * @default {}
37
+ */
38
+ components?: {
39
+ first?: React.ElementType;
40
+ last?: React.ElementType;
41
+ next?: React.ElementType;
42
+ previous?: React.ElementType;
43
+ };
44
+ /**
45
+ * If `true`, the component is disabled.
46
+ * @default false
47
+ */
48
+ disabled?: boolean;
49
+ /**
50
+ * The current page number.
51
+ */
52
+ page?: React.ReactNode;
53
+ /**
54
+ * If `true` the pagination item is selected.
55
+ * @default false
56
+ */
57
+ selected?: boolean;
58
+ /**
59
+ * The shape of the pagination item.
60
+ * @default 'circular'
61
+ */
62
+ shape?: 'circular' | 'rounded';
63
+ /**
64
+ * The size of the component.
65
+ * @default 'medium'
66
+ */
67
+ size?: OverridableStringUnion<'small' | 'medium' | 'large', PaginationItemPropsSizeOverrides>;
68
+ /**
69
+ * The components used for each slot inside.
70
+ *
71
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
72
+ *
73
+ * @default {}
74
+ */
75
+ slots?: {
76
+ first?: React.ElementType;
77
+ last?: React.ElementType;
78
+ next?: React.ElementType;
79
+ previous?: React.ElementType;
80
+ };
81
+ /**
82
+ * The system prop that allows defining system overrides as well as additional CSS styles.
83
+ */
84
+ sx?: SxProps<Theme>;
85
+ /**
86
+ * The type of pagination item.
87
+ * @default 'page'
88
+ */
89
+ type?: UsePaginationItem['type'];
90
+ /**
91
+ * The variant to use.
92
+ * @default 'text'
93
+ */
94
+ variant?: OverridableStringUnion<'text' | 'outlined', PaginationItemPropsVariantOverrides>;
95
+ }
96
+
15
97
  export interface PaginationItemTypeMap<
16
98
  AdditionalProps = {},
17
- DefaultComponent extends React.ElementType = 'div',
99
+ RootComponent extends React.ElementType = 'div',
18
100
  > {
19
- props: AdditionalProps & {
20
- /**
21
- * Override or extend the styles applied to the component.
22
- */
23
- classes?: Partial<PaginationItemClasses>;
24
- /**
25
- * The active color.
26
- * It supports both default and custom theme colors, which can be added as shown in the
27
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
28
- * @default 'standard'
29
- */
30
- color?: OverridableStringUnion<
31
- 'standard' | 'primary' | 'secondary',
32
- PaginationItemPropsColorOverrides
33
- >;
34
- /**
35
- * The components used for each slot inside.
36
- *
37
- * This prop is an alias for the `slots` prop.
38
- * It's recommended to use the `slots` prop instead.
39
- *
40
- * @default {}
41
- */
42
- components?: {
43
- first?: React.ElementType;
44
- last?: React.ElementType;
45
- next?: React.ElementType;
46
- previous?: React.ElementType;
47
- };
48
- /**
49
- * If `true`, the component is disabled.
50
- * @default false
51
- */
52
- disabled?: boolean;
53
- /**
54
- * The current page number.
55
- */
56
- page?: React.ReactNode;
57
- /**
58
- * If `true` the pagination item is selected.
59
- * @default false
60
- */
61
- selected?: boolean;
62
- /**
63
- * The shape of the pagination item.
64
- * @default 'circular'
65
- */
66
- shape?: 'circular' | 'rounded';
67
- /**
68
- * The size of the component.
69
- * @default 'medium'
70
- */
71
- size?: OverridableStringUnion<'small' | 'medium' | 'large', PaginationItemPropsSizeOverrides>;
72
- /**
73
- * The components used for each slot inside.
74
- *
75
- * This prop is an alias for the `components` prop, which will be deprecated in the future.
76
- *
77
- * @default {}
78
- */
79
- slots?: {
80
- first?: React.ElementType;
81
- last?: React.ElementType;
82
- next?: React.ElementType;
83
- previous?: React.ElementType;
84
- };
85
- /**
86
- * The system prop that allows defining system overrides as well as additional CSS styles.
87
- */
88
- sx?: SxProps<Theme>;
89
- /**
90
- * The type of pagination item.
91
- * @default 'page'
92
- */
93
- type?: UsePaginationItem['type'];
94
- /**
95
- * The variant to use.
96
- * @default 'text'
97
- */
98
- variant?: OverridableStringUnion<'text' | 'outlined', PaginationItemPropsVariantOverrides>;
99
- };
100
- defaultComponent: DefaultComponent;
101
+ props: AdditionalProps & PaginationItemOwnProps;
102
+ defaultComponent: RootComponent;
101
103
  }
102
104
 
103
105
  /**
package/Paper/Paper.d.ts CHANGED
@@ -40,10 +40,10 @@ export interface PaperOwnProps {
40
40
 
41
41
  export interface PaperTypeMap<
42
42
  AdditionalProps = {},
43
- DefaultComponent extends React.ElementType = 'div',
43
+ RootComponent extends React.ElementType = 'div',
44
44
  > {
45
45
  props: AdditionalProps & PaperOwnProps;
46
- defaultComponent: DefaultComponent;
46
+ defaultComponent: RootComponent;
47
47
  }
48
48
 
49
49
  /**
@@ -91,9 +91,10 @@ export interface PopoverProps
91
91
  elevation?: number;
92
92
  /**
93
93
  * Specifies how close to the edge of the window the popover can appear.
94
+ * If null, the popover will not be constrained by the window.
94
95
  * @default 16
95
96
  */
96
- marginThreshold?: number;
97
+ marginThreshold?: number | null;
97
98
  onClose?: ModalProps['onClose'];
98
99
  /**
99
100
  * If `true`, the component is shown.
@@ -3,7 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["onEntering"],
6
- _excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps"],
6
+ _excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps", "disableScrollLock"],
7
7
  _excluded3 = ["slotProps"];
8
8
  import * as React from 'react';
9
9
  import PropTypes from 'prop-types';
@@ -113,7 +113,8 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
113
113
  transitionDuration: transitionDurationProp = 'auto',
114
114
  TransitionProps: {
115
115
  onEntering
116
- } = {}
116
+ } = {},
117
+ disableScrollLock = false
117
118
  } = props,
118
119
  TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded),
119
120
  other = _objectWithoutPropertiesLoose(props, _excluded2);
@@ -201,11 +202,11 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
201
202
  const widthThreshold = containerWindow.innerWidth - marginThreshold;
202
203
 
203
204
  // Check if the vertical axis needs shifting
204
- if (top < marginThreshold) {
205
+ if (marginThreshold !== null && top < marginThreshold) {
205
206
  const diff = top - marginThreshold;
206
207
  top -= diff;
207
208
  elemTransformOrigin.vertical += diff;
208
- } else if (bottom > heightThreshold) {
209
+ } else if (marginThreshold !== null && bottom > heightThreshold) {
209
210
  const diff = bottom - heightThreshold;
210
211
  top -= diff;
211
212
  elemTransformOrigin.vertical += diff;
@@ -217,7 +218,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
217
218
  }
218
219
 
219
220
  // Check if the horizontal axis needs shifting
220
- if (left < marginThreshold) {
221
+ if (marginThreshold !== null && left < marginThreshold) {
221
222
  const diff = left - marginThreshold;
222
223
  left -= diff;
223
224
  elemTransformOrigin.horizontal += diff;
@@ -248,6 +249,12 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
248
249
  element.style.transformOrigin = positioning.transformOrigin;
249
250
  setIsPositioned(true);
250
251
  }, [getPositioningStyle]);
252
+ React.useEffect(() => {
253
+ if (disableScrollLock) {
254
+ window.addEventListener('scroll', setPositioningStyles);
255
+ }
256
+ return () => window.removeEventListener('scroll', setPositioningStyles);
257
+ }, [anchorEl, disableScrollLock, setPositioningStyles]);
251
258
  const handleEntering = (element, isAppearing) => {
252
259
  if (onEntering) {
253
260
  onEntering(element, isAppearing);
@@ -328,7 +335,8 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
328
335
  } = _useSlotProps,
329
336
  rootProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded3);
330
337
  return /*#__PURE__*/_jsx(RootSlot, _extends({}, rootProps, !isHostComponent(RootSlot) && {
331
- slotProps: rootSlotPropsProp
338
+ slotProps: rootSlotPropsProp,
339
+ disableScrollLock
332
340
  }, {
333
341
  children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
334
342
  appear: true,
@@ -423,6 +431,11 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
423
431
  * so it's simply `document.body` most of the time.
424
432
  */
425
433
  container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
434
+ /**
435
+ * Disable the scroll lock behavior.
436
+ * @default false
437
+ */
438
+ disableScrollLock: PropTypes.bool,
426
439
  /**
427
440
  * The elevation of the popover.
428
441
  * @default 8
@@ -430,6 +443,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
430
443
  elevation: integerPropType,
431
444
  /**
432
445
  * Specifies how close to the edge of the window the popover can appear.
446
+ * If null, the popover will not be constrained by the window.
433
447
  * @default 16
434
448
  */
435
449
  marginThreshold: PropTypes.number,
package/Radio/Radio.js CHANGED
@@ -21,10 +21,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
21
21
  const useUtilityClasses = ownerState => {
22
22
  const {
23
23
  classes,
24
- color
24
+ color,
25
+ size
25
26
  } = ownerState;
26
27
  const slots = {
27
- root: ['root', `color${capitalize(color)}`]
28
+ root: ['root', `color${capitalize(color)}`, size !== 'medium' && `size${capitalize(size)}`]
28
29
  };
29
30
  return _extends({}, classes, composeClasses(slots, getRadioUtilityClass, classes));
30
31
  };
@@ -9,6 +9,8 @@ export interface RadioClasses {
9
9
  colorPrimary: string;
10
10
  /** Styles applied to the root element if `color="secondary"`. */
11
11
  colorSecondary: string;
12
+ /** Styles applied to the root element if `size="small"`. */
13
+ sizeSmall: string;
12
14
  }
13
15
  export type RadioClassKey = keyof RadioClasses;
14
16
  export declare function getRadioUtilityClass(slot: string): string;
@@ -3,5 +3,5 @@ import generateUtilityClass from '../generateUtilityClass';
3
3
  export function getRadioUtilityClass(slot) {
4
4
  return generateUtilityClass('MuiRadio', slot);
5
5
  }
6
- const radioClasses = generateUtilityClasses('MuiRadio', ['root', 'checked', 'disabled', 'colorPrimary', 'colorSecondary']);
6
+ const radioClasses = generateUtilityClasses('MuiRadio', ['root', 'checked', 'disabled', 'colorPrimary', 'colorSecondary', 'sizeSmall']);
7
7
  export default radioClasses;