@mui/system 5.14.3 → 5.14.5

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.
package/Box/Box.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { OverridableComponent, OverrideProps } from '@mui/types';
3
- import { Theme } from '../createTheme';
3
+ import { Theme as SystemTheme } from '../createTheme';
4
4
  import {
5
5
  SxProps,
6
6
  AllSystemCSSProperties,
@@ -170,17 +170,26 @@ export type SystemProps<Theme extends object = {}> = {
170
170
  | ((theme: Theme) => ResponsiveStyleValue<AllSystemCSSProperties[K]>);
171
171
  };
172
172
 
173
- export interface BoxTypeMap<P = {}, D extends React.ElementType = 'div', T extends object = Theme> {
174
- props: P &
175
- SystemProps<T> & {
173
+ export interface BoxTypeMap<
174
+ AdditionalProps = {},
175
+ RootComponent extends React.ElementType = 'div',
176
+ Theme extends object = SystemTheme,
177
+ > {
178
+ props: AdditionalProps &
179
+ SystemProps<Theme> & {
176
180
  children?: React.ReactNode;
181
+ /**
182
+ * The component used for the root node.
183
+ * Either a string to use a HTML element or a component.
184
+ */
185
+ component?: React.ElementType;
177
186
  ref?: React.Ref<unknown>;
178
187
  /**
179
188
  * The system prop that allows defining system overrides as well as additional CSS styles.
180
189
  */
181
- sx?: SxProps<T>;
190
+ sx?: SxProps<Theme>;
182
191
  };
183
- defaultComponent: D;
192
+ defaultComponent: RootComponent;
184
193
  }
185
194
  /**
186
195
  *
@@ -196,8 +205,10 @@ export interface BoxTypeMap<P = {}, D extends React.ElementType = 'div', T exten
196
205
  declare const Box: OverridableComponent<BoxTypeMap>;
197
206
 
198
207
  export type BoxProps<
199
- D extends React.ElementType = BoxTypeMap['defaultComponent'],
200
- P = {},
201
- > = OverrideProps<BoxTypeMap<P, D>, D> & { component?: React.ElementType };
208
+ RootComponent extends React.ElementType = BoxTypeMap['defaultComponent'],
209
+ AdditionalProps = {},
210
+ > = OverrideProps<BoxTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
211
+ component?: React.ElementType;
212
+ };
202
213
 
203
214
  export default Box;
package/CHANGELOG.md CHANGED
@@ -1,5 +1,173 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.14.5
4
+
5
+ <!-- generated comparing v5.14.4..master -->
6
+
7
+ _Aug 14, 2023_
8
+
9
+ A big thanks to the 17 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - @mnajdova [made it easier to use third-party components in Base UI slots](https://mui.com/base-ui/getting-started/customization/#overriding-subcomponent-slots) with the introduction of the `prepareForSlot` utility (#38138)
12
+
13
+ ### `@mui/material@5.14.5`
14
+
15
+ - &#8203;<!-- 04 -->[TextField] Fix to handle `onClick` on root element (#38072) @LukasTy
16
+
17
+ ### `@mui/codemod@5.14.5`
18
+
19
+ - &#8203;<!-- 31 -->[codemod] Add v5.0.0/tree-view-moved-to-x codemod (#38248) @flaviendelangle
20
+
21
+ ### `@mui/joy@5.0.0-beta.2`
22
+
23
+ - &#8203;<!-- 07 -->[Input][joy-ui] Fix the `FormHelperText` icon color (#38387) @TheNatkat
24
+ - &#8203;<!-- 06 -->[Skeleton][joy-ui] Soften the pulse animation (#38384) @zanivan
25
+ - &#8203;<!-- 05 -->[TabPanel][joy-ui] Add `keepMounted` prop (#38293) @decadef20
26
+
27
+ ### `@mui/base@5.0.0-beta.11`
28
+
29
+ - &#8203;<!-- 30 -->[base-ui] Remove the legacy Extend\* types (#38184) @michaldudak
30
+ - &#8203;<!-- 29 -->[base-ui] Add `useModal` hook (#38187) @mnajdova
31
+ - &#8203;<!-- 28 -->[base-ui] Add `prepareForSlot` util (#38138) @mnajdova
32
+ - &#8203;<!-- 26 -->[useButton][base-ui] Fix tabIndex not being forwarded (#38417) @DiegoAndai
33
+ - &#8203;<!-- 25 -->[useButton][base-ui] Fix onFocusVisible not being handled (#38399) @DiegoAndai
34
+
35
+ ### Docs
36
+
37
+ - &#8203;<!-- 32 -->[blog] Blog post for MUI X mid v6. Date Pickers, Data Grid, and Charts (#38241) @richbustos
38
+ - &#8203;<!-- 35 -->[docs][base-ui] Update number input API docs (#38363) @mj12albert
39
+ - &#8203;<!-- 29 -->[docs] Improve page transition speed (#38394) @oliviertassinari
40
+ - &#8203;<!-- 28 -->[docs] Improve examples (#38398) @oliviertassinari
41
+ - &#8203;<!-- 19 -->[docs][docs] Add `FileUpload` demo (#38420) @sai6855
42
+ - &#8203;<!-- 18 -->[docs][joy-ui] Refine the Order Dashboard template design (#38395) @zanivan
43
+ - &#8203;<!-- 17 -->[docs][material-ui][joy-ui] Simplify the Quickstart section on the Usage page (#38385) @danilo-leal
44
+ - &#8203;<!-- 16 -->[docs][Menu][joy] Explain how to control the open state (#38355) @michaldudak
45
+ - &#8203;<!-- 15 -->[docs][material] Revise the Support page (#38207) @samuelsycamore
46
+ - &#8203;<!-- 14 -->[docs][material-ui] Remove incorrect `aria-label`s in extended variant examples of Floating Action Button (#37170) @ashleykolodziej
47
+ - &#8203;<!-- 13 -->[docs][material-ui] Adjust slightly the installation page content (#38380) @danilo-leal
48
+ - &#8203;<!-- 12 -->[docs][Switch] Fix the readOnly class name in docs (#38277) @michaldudak
49
+ - &#8203;<!-- 11 -->[docs][TablePagination] Add Tailwind CSS & plain CSS introduction demo (#38286) @mnajdova
50
+
51
+ ### Examples
52
+
53
+ - &#8203;<!-- 10 -->[examples] Add Joy UI + Vite.js + TypeScript example app (#37406) @nithins1
54
+
55
+ ### Core
56
+
57
+ - &#8203;<!-- 30 -->[core] Consistent URL add leading / @oliviertassinari
58
+ - &#8203;<!-- 27 -->[docs-infra] Fix rebase issue @oliviertassinari
59
+ - &#8203;<!-- 26 -->[docs-infra] Fix typo in docs infra docs @oliviertassinari
60
+ - &#8203;<!-- 25 -->[docs-infra] Fix nested list margin (#38456) @oliviertassinari
61
+ - &#8203;<!-- 24 -->[docs-infra] Move the Diamond Sponsors to the TOC (#38410) @danilo-leal
62
+ - &#8203;<!-- 22 -->[docs-infra] Move imports into page data (#38297) @alexfauquette
63
+ - &#8203;<!-- 21 -->[docs-infra] Adjust heading styles (#38365) @danilo-leal
64
+ - &#8203;<!-- 20 -->[docs-infra] Fix info callout border color (#38370) @danilo-leal
65
+ - &#8203;<!-- 05 -->[website] Upgrade the homepage hero demos design (#38388) @danilo-leal
66
+ - &#8203;<!-- 04 -->[website] Improve Base UI hero section demo (#38255) @danilo-leal
67
+ - &#8203;<!-- 03 -->[website] Fix EmailSubscribe look (#38429) @oliviertassinari
68
+ - &#8203;<!-- 02 -->[website] Link Discord in footer (#38369) @richbustos
69
+ - &#8203;<!-- 01 -->[website] Clean up the `GetStartedButtons` component (#38256) @danilo-leal
70
+
71
+ All contributors of this release in alphabetical order: @alexfauquette, @ashleykolodziej, @danilo-leal, @decadef20, @DiegoAndai, @flaviendelangle, @LukasTy, @michaldudak, @mj12albert, @mnajdova, @nithins1, @oliviertassinari, @richbustos, @sai6855, @samuelsycamore, @TheNatkat, @zanivan
72
+
73
+ ## 5.14.4
74
+
75
+ <!-- generated comparing v5.14.3..master -->
76
+
77
+ _Aug 8, 2023_
78
+
79
+ A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
80
+
81
+ - 🎉 Added [Number input](https://mui.com/base-ui/react-number-input) component & [useNumberInput](https://mui.com/base-ui/react-number-input#hook) hook in [Base UI](https://mui.com/base-ui/getting-started/) @mj12albert
82
+
83
+ ### `@mui/material@5.14.4`
84
+
85
+ - &#8203;<!-- 25 -->[Checkbox][material] Add size classes (#38182) @michaldudak
86
+ - &#8203;<!-- 03 -->[Typography] Improve inherit variant logic (#38123) @ZeeshanTamboli
87
+
88
+ ### `@mui/system@5.14.4`
89
+
90
+ - &#8203;<!-- 34 -->Revert "[Box] Remove `component` from TypeMap (#38168)" (#38356) @michaldudak
91
+
92
+ ### `@mui/base@5.0.0-beta.10`
93
+
94
+ #### Breaking changes
95
+
96
+ - &#8203;<!-- 32 -->[base] Ban default exports (#38200) @michaldudak
97
+
98
+ Base UI default exports were changed to named ones. Previously we had a mix of default and named ones.
99
+ This was changed to improve consistency and avoid problems some bundlers have with default exports.
100
+ See https://github.com/mui/material-ui/issues/21862 for more context.
101
+
102
+ ```diff
103
+ - import Button, { buttonClasses } from '@mui/base/Button';
104
+ + import { Button, buttonClasses } from '@mui/base/Button';
105
+ - import BaseMenu from '@mui/base/Menu';
106
+ + import { Menu as BaseMenu } from '@mui/base/Menu';
107
+ ```
108
+
109
+ Additionally, the `ClassNameGenerator` has been moved to the directory matching its name:
110
+
111
+ ```diff
112
+ - import ClassNameGenerator from '@mui/base/className';
113
+ + import { ClassNameGenerator } from '@mui/base/ClassNameGenerator';
114
+ ```
115
+
116
+ A codemod is provided to help with the migration:
117
+
118
+ ```bash
119
+ npx @mui/codemod v5.0.0/base-use-named-imports <path>
120
+ ```
121
+
122
+ #### Changes
123
+
124
+ - &#8203;<!-- 31 -->[base] Create useNumberInput and NumberInput (#36119) @mj12albert
125
+ - &#8203;<!-- 28 -->[Select][base] Fix flicker on click of controlled Select button (#37855) @VishruthR
126
+ - &#8203;<!-- 09 -->[Dropdown] Fix imports of types (#38296) @yash-thakur
127
+
128
+ ### `@mui/joy@5.0.0-beta.1`
129
+
130
+ - &#8203;<!-- 06 -->[joy-ui][MenuButton] Fix disable of `MenuButton` (#38342) @sai6855
131
+
132
+ ### Docs
133
+
134
+ - &#8203;<!-- 33 -->[docs][AppBar] Fix `ResponsiveAppBar` demo logo href (#38346) @iownthegame
135
+ - &#8203;<!-- 30 -->[docs][base] Add Tailwind CSS + plain CSS demo on the Button page (#38240) @alisasanib
136
+ - &#8203;<!-- 29 -->[docs][Menu][base] Remove `Unstyled` prefix from demos' function names (#38270) @sai6855
137
+ - &#8203;<!-- 22 -->[docs] Add themeable component guide (#37908) @siriwatknp
138
+ - &#8203;<!-- 21 -->[docs] Fix Joy UI demo background color (#38307) @oliviertassinari
139
+ - &#8203;<!-- 20 -->[docs] Update API docs for Number Input component (#38301) @ZeeshanTamboli
140
+ - &#8203;<!-- 14 -->[docs][joy-ui] Revise the theme typography page (#38285) @danilo-leal
141
+ - &#8203;<!-- 13 -->[docs][joy-ui] Add TS demo for Menu Bar (#38308) @sai6855
142
+ - &#8203;<!-- 10 -->[docs][joy-ui] Updated Typography callout at getting started (#38289) @zanivan
143
+ - &#8203;<!-- 12 -->[docs][joy-ui] Fix the Inter font installation instructions (#38284) @danilo-leal
144
+ - &#8203;<!-- 11 -->[docs][material] Add note to Autocomplete about ref forwarding (#38305) @samuelsycamore
145
+ - &#8203;<!-- 05 -->[docs][Skeleton] Make the demos feel more realistic (#38212) @oliviertassinari
146
+
147
+ - &#8203;<!-- 08 -->[examples] Swap Next.js examples between App Router and Pages Router; update naming convention (#38204) @samuelsycamore
148
+ - &#8203;<!-- 07 -->[examples][material-ui] Add Material UI + Next.js (App Router) example in JS (#38323) @samuelsycamore
149
+ - &#8203;<!-- 27 -->[blog] Discord announcement blog (#38258) @richbustos
150
+ - &#8203;<!-- 26 -->[blog] Fix 301 links to Toolpad @oliviertassinari
151
+ - &#8203;<!-- 04 -->[website] Updating Charts demo with real charts usage for MUI X marketing page (#38317) @richbustos
152
+ - &#8203;<!-- 03 -->[website] Adjust styles of the Product section on the homepage (#38366) @danilo-leal
153
+ - &#8203;<!-- 02 -->[website] Add Nora teamMember card to 'About' (#38358) @noraleonte
154
+ - &#8203;<!-- 01 -->[website] Fix image layout shift (#38326) @oliviertassinari
155
+
156
+ ### Core
157
+
158
+ - &#8203;<!-- 24 -->[core] Fix docs demo export function consistency (#38191) @oliviertassinari
159
+ - &#8203;<!-- 23 -->[core] Fix the link-check script on Windows (#38276) @michaldudak
160
+ - &#8203;<!-- 26 -->[core] Use @testing-library/user-event direct API (#38325) @mj12albert
161
+ - &#8203;<!-- 29 -->[core] Port GitHub workflow for ensuring triage label is present (#38312) @DanailH
162
+ - &#8203;<!-- 19 -->[docs-infra] Consider files ending with .types.ts as props files (#37533) @mnajdova
163
+ - &#8203;<!-- 18 -->[docs-infra] Fix skip to content design (#38304) @oliviertassinari
164
+ - &#8203;<!-- 17 -->[docs-infra] Add a general round of polish to the API content display (#38282) @danilo-leal
165
+ - &#8203;<!-- 16 -->[docs-infra] Make the side nav collapse animation snappier (#38259) @danilo-leal
166
+ - &#8203;<!-- 15 -->[docs-infra] New Component API design followup (#38183) @cherniavskii
167
+ - &#8203;<!-- 06 -->[test] Remove unnecessary `async` keyword from test (#38373) @ZeeshanTamboli
168
+
169
+ All contributors of this release in alphabetical order: @alisasanib, @cherniavskii, @DanailH, @danilo-leal, @iownthegame, @michaldudak, @mj12albert, @mnajdova, @noraleonte, @oliviertassinari, @richbustos, @sai6855, @samuelsycamore, @siriwatknp, @VishruthR, @yash-thakur, @zanivan, @ZeeshanTamboli
170
+
3
171
  ## 5.14.3
4
172
 
5
173
  <!-- generated comparing v5.14.2..master -->
@@ -129,7 +297,7 @@ A big thanks to the 23 contributors who made this release possible.
129
297
  - &#8203;<!-- 19 -->[docs][joy] Add adjustments to the color inversion page (#37143) @danilo-leal
130
298
  - &#8203;<!-- 18 -->[docs][material] Improve documentation about adding custom colors (#37743) @DiegoAndai
131
299
  - &#8203;<!-- 17 -->[examples] Fix Joy UI Next.js App Router font loading (#38095) @IgnacioUtrilla
132
- - &#8203;<!-- 16 -->[examples] Fix material-next-app-router Font Usage with next/font (#38026) @onderonur
300
+ - &#8203;<!-- 16 -->[examples] Fix material-next Font Usage with next/font (#38026) @onderonur
133
301
 
134
302
  ### Core
135
303
 
@@ -401,7 +569,7 @@ _Jun 21, 2023_
401
569
  A big thanks to the 25 contributors who made this release possible. Here are some highlights ✨:
402
570
 
403
571
  - 💫 Added [Slider](https://mui.com/material-ui/react-slider/#material-you-version) component using the new Material You design language (#37520) @DiegoAndai.
404
- - 📚 Added [examples](https://github.com/mui/material-ui/tree/master/examples/material-next-app-router-ts) showcasing how you can use Material UI with next.js's app directory (#37315) @smo043
572
+ - 📚 Added [examples](https://github.com/mui/material-ui/tree/master/examples/material-ui-nextjs-ts) showcasing how you can use Material UI with next.js's app directory (#37315) @smo043
405
573
 
406
574
  ### `@mui/material@5.13.6`
407
575
 
@@ -462,7 +630,7 @@ A big thanks to the 25 contributors who made this release possible. Here are som
462
630
  - &#8203;<!-- 19 -->[docs-infra] Add analyticsTags to Algolia (#37600) @Janpot
463
631
  - &#8203;<!-- 18 -->[docs-infra] Simplify product id handling (#37593) @oliviertassinari
464
632
  - &#8203;<!-- 35 -->[CHANGELOG] Add missing release date for v5.13.5 @oliviertassinari
465
- - &#8203;<!-- 16 -->[examples] Shell command fix in the readme file of material-next-app-router-ts example (#37675) @bablukpik
633
+ - &#8203;<!-- 16 -->[examples] Shell command fix in the readme file of material-next-ts example (#37675) @bablukpik
466
634
  - &#8203;<!-- 15 -->[examples] Next.js v13 app router with Material UI (#37315) @smo043
467
635
 
468
636
  ### Core
@@ -3619,7 +3787,7 @@ A big thanks to the 19 contributors who made this release possible. Here are som
3619
3787
  - [docs] Add webpack alias for legacy utils package (#33376) @jgbae
3620
3788
  - [docs] Improve external link icons synonyms (#33257) @davidgarciab
3621
3789
  - [examples] Update Base UI with Tailwind CSS to use the latest versions of the dependencies (#33401) @mnajdova
3622
- - [examples] Add MUI base example (#33154) @siriwatknp
3790
+ - [examples] Add Base UI example (#33154) @siriwatknp
3623
3791
 
3624
3792
  ### Core
3625
3793
 
@@ -3638,7 +3806,7 @@ _Jul 4, 2022_
3638
3806
 
3639
3807
  A big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
3640
3808
 
3641
- - 🐛 Fixed an issue causing Typescript errors when building a project with Material UI v5.8.6 (@michaldudak)
3809
+ - 🐛 Fixed an issue causing TypeScript errors when building a project with Material UI v5.8.6 (@michaldudak)
3642
3810
  - 🐛 Fixed a few bugs in Material UI components. Thanks @henriqueholtz, @jake-collibra, @MattiasMartens and @TimoWilhelm!
3643
3811
  - many other 🐛 bug fixes and 📚 documentation improvements
3644
3812
 
@@ -3667,7 +3835,7 @@ A big thanks to the 13 contributors who made this release possible. Here are som
3667
3835
 
3668
3836
  ### `@mui/base@5.0.0-alpha.88`
3669
3837
 
3670
- - [base] Remove a type incompatible with Typescript 3.5 (#33361) @michaldudak
3838
+ - [base] Remove a type incompatible with TypeScript 3.5 (#33361) @michaldudak
3671
3839
  - [BadgeUnstyled] Export BadgeUnstyledOwnProps interface to fix typescript compiler error (#33314) @aaronlademann-wf
3672
3840
  - [TablePaginationUnstyled] Accept callbacks in componentsProps (#33309) @michaldudak
3673
3841
 
@@ -5109,7 +5277,7 @@ _Feb 1, 2022_
5109
5277
 
5110
5278
  A big thanks to the 22 contributors who made this release possible. Here are some highlights ✨:
5111
5279
 
5112
- - 🛠 @goncalovf added an example project using [Material UI with Vite.js](https://github.com/mui/material-ui/tree/master/examples/material-vite) (#28241)
5280
+ - 🛠 @goncalovf added an example project using [Material UI with Vite.js](https://github.com/mui/material-ui/tree/master/examples/material-ui-vite) (#28241)
5113
5281
  - Number of 🐛 bug fixes and 📚 documentation improvements.
5114
5282
 
5115
5283
  ### `@mui/material@5.4.0`
@@ -10284,7 +10452,7 @@ A big thanks to the 34 contributors who made this release possible. Here are som
10284
10452
  - [theme] Add htmlFontSize to Typography interface (#23412) @fergusmcdonald
10285
10453
  - [Tooltip] Fix PopperProps popper modifiers not being merged properly (#23421) @dominique-mueller
10286
10454
  - [Tooltip] Long press select text on iOS (#23466) @hmaddisb
10287
- - [Tooltip] Unexpected behaviour onOpen/onClose (#23482) @brorlarsnicklas
10455
+ - [Tooltip] Unexpected behavior onOpen/onClose (#23482) @brorlarsnicklas
10288
10456
 
10289
10457
  ### `@material-ui/lab@v5.0.0-alpha.16`
10290
10458
 
@@ -3,8 +3,8 @@ import { OverrideProps } from '@mui/types';
3
3
  import { SxProps } from '../styleFunctionSx';
4
4
  import { Theme, Breakpoint } from '../createTheme';
5
5
  import { ContainerClasses } from './containerClasses';
6
- export interface ContainerTypeMap<P = {}, D extends React.ElementType = 'div'> {
7
- props: P & {
6
+ export interface ContainerTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
7
+ props: AdditionalProps & {
8
8
  children?: React.ReactNode;
9
9
  /**
10
10
  * Override or extend the styles applied to the component.
@@ -35,6 +35,6 @@ export interface ContainerTypeMap<P = {}, D extends React.ElementType = 'div'> {
35
35
  */
36
36
  sx?: SxProps<Theme>;
37
37
  };
38
- defaultComponent: D;
38
+ defaultComponent: DefaultComponent;
39
39
  }
40
- export type ContainerProps<D extends React.ElementType = ContainerTypeMap['defaultComponent'], P = {}> = OverrideProps<ContainerTypeMap<P, D>, D>;
40
+ export type ContainerProps<RootComponent extends React.ElementType = ContainerTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<ContainerTypeMap<AdditionalProps, RootComponent>, RootComponent>;
@@ -34,18 +34,18 @@ export interface StackBaseProps {
34
34
  */
35
35
  useFlexGap?: boolean;
36
36
  }
37
- export interface StackTypeMap<P = {}, D extends React.ElementType = 'div'> {
38
- props: P & StackBaseProps & {
37
+ export interface StackTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
38
+ props: AdditionalProps & StackBaseProps & {
39
39
  /**
40
40
  * The system prop, which allows defining system overrides as well as additional CSS styles.
41
41
  */
42
42
  sx?: SxProps<Theme>;
43
43
  } & SystemProps<Theme>;
44
- defaultComponent: D;
44
+ defaultComponent: DefaultComponent;
45
45
  }
46
- export type StackProps<D extends React.ElementType = StackTypeMap['defaultComponent'], P = {
46
+ export type StackProps<RootComponent extends React.ElementType = StackTypeMap['defaultComponent'], AdditionalProps = {
47
47
  component?: React.ElementType;
48
- }> = OverrideProps<StackTypeMap<P, D>, D>;
48
+ }> = OverrideProps<StackTypeMap<AdditionalProps, RootComponent>, RootComponent>;
49
49
  export interface StackOwnerState {
50
50
  direction: StackProps['direction'];
51
51
  spacing: StackProps['spacing'];
@@ -173,13 +173,13 @@ export interface GridOwnerState extends GridBaseProps {
173
173
  gridSize: Partial<Record<Breakpoint, GridSize | boolean>>;
174
174
  gridOffset: Partial<Record<Breakpoint, GridSize>>;
175
175
  }
176
- export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
177
- props: P & GridBaseProps & {
176
+ export interface GridTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
177
+ props: AdditionalProps & GridBaseProps & {
178
178
  sx?: SxProps<Theme>;
179
179
  } & SystemProps<Theme>;
180
- defaultComponent: D;
180
+ defaultComponent: DefaultComponent;
181
181
  }
182
- export type GridProps<D extends React.ElementType = GridTypeMap['defaultComponent'], P = {
182
+ export type GridProps<RootComponent extends React.ElementType = GridTypeMap['defaultComponent'], AdditionalProps = {
183
183
  component?: React.ElementType;
184
- }> = OverrideProps<GridTypeMap<P, D>, D>;
184
+ }> = OverrideProps<GridTypeMap<AdditionalProps, RootComponent>, RootComponent>;
185
185
  export {};
package/createStyled.d.ts CHANGED
@@ -24,16 +24,16 @@ export interface MuiStyledOptions {
24
24
  skipSx?: boolean;
25
25
  }
26
26
 
27
- export type CreateMUIStyled<T extends object = DefaultTheme> = CreateMUIStyledStyledEngine<
28
- MUIStyledCommonProps<T>,
27
+ export type CreateMUIStyled<Theme extends object = DefaultTheme> = CreateMUIStyledStyledEngine<
28
+ MUIStyledCommonProps<Theme>,
29
29
  MuiStyledOptions,
30
- T
30
+ Theme
31
31
  >;
32
32
 
33
- export default function createStyled<T extends object = DefaultTheme>(options?: {
33
+ export default function createStyled<Theme extends object = DefaultTheme>(options?: {
34
34
  themeId?: string;
35
- defaultTheme?: T;
35
+ defaultTheme?: Theme;
36
36
  rootShouldForwardProp?: (prop: PropertyKey) => boolean;
37
37
  slotShouldForwardProp?: (prop: PropertyKey) => boolean;
38
38
  styleFunctionSx?: typeof styleFunctionSx;
39
- }): CreateMUIStyled<T>;
39
+ }): CreateMUIStyled<Theme>;
package/createStyled.js CHANGED
@@ -78,6 +78,9 @@ function shouldForwardProp(prop) {
78
78
  const systemDefaultTheme = (0, _createTheme.default)();
79
79
  exports.systemDefaultTheme = systemDefaultTheme;
80
80
  const lowercaseFirstLetter = string => {
81
+ if (!string) {
82
+ return string;
83
+ }
81
84
  return string.charAt(0).toLowerCase() + string.slice(1);
82
85
  };
83
86
  function resolveTheme({
@@ -87,6 +90,12 @@ function resolveTheme({
87
90
  }) {
88
91
  return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;
89
92
  }
93
+ function defaultOverridesResolver(slot) {
94
+ if (!slot) {
95
+ return null;
96
+ }
97
+ return (props, styles) => styles[slot];
98
+ }
90
99
  function createStyled(input = {}) {
91
100
  const {
92
101
  themeId,
@@ -111,21 +120,31 @@ function createStyled(input = {}) {
111
120
  slot: componentSlot,
112
121
  skipVariantsResolver: inputSkipVariantsResolver,
113
122
  skipSx: inputSkipSx,
114
- overridesResolver
123
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
124
+ // For more details: https://github.com/mui/material-ui/pull/37908
125
+ overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
115
126
  } = inputOptions,
116
127
  options = (0, _objectWithoutPropertiesLoose2.default)(inputOptions, _excluded);
117
128
 
118
129
  // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
119
- const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
130
+ const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
131
+ // TODO v6: remove `Root` in the next major release
132
+ // For more details: https://github.com/mui/material-ui/pull/37908
133
+ componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;
120
134
  const skipSx = inputSkipSx || false;
121
135
  let label;
122
136
  if (process.env.NODE_ENV !== 'production') {
123
137
  if (componentName) {
138
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
139
+ // For more details: https://github.com/mui/material-ui/pull/37908
124
140
  label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;
125
141
  }
126
142
  }
127
143
  let shouldForwardPropOption = shouldForwardProp;
128
- if (componentSlot === 'Root') {
144
+
145
+ // TODO v6: remove `Root` in the next major release
146
+ // For more details: https://github.com/mui/material-ui/pull/37908
147
+ if (componentSlot === 'Root' || componentSlot === 'root') {
129
148
  shouldForwardPropOption = rootShouldForwardProp;
130
149
  } else if (componentSlot) {
131
150
  // any other slot specified
@@ -207,7 +226,7 @@ function createStyled(input = {}) {
207
226
  if (process.env.NODE_ENV !== 'production') {
208
227
  let displayName;
209
228
  if (componentName) {
210
- displayName = `${componentName}${componentSlot || ''}`;
229
+ displayName = `${componentName}${(0, _utils.unstable_capitalize)(componentSlot || '')}`;
211
230
  }
212
231
  if (displayName === undefined) {
213
232
  displayName = `Styled(${(0, _utils.getDisplayName)(tag)})`;
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
4
4
  /* eslint-disable no-underscore-dangle */
5
5
  import styledEngineStyled, { internal_processStyles as processStyles } from '@mui/styled-engine';
6
- import { getDisplayName } from '@mui/utils';
6
+ import { getDisplayName, unstable_capitalize as capitalize } from '@mui/utils';
7
7
  import createTheme from './createTheme';
8
8
  import propsToClassKey from './propsToClassKey';
9
9
  import styleFunctionSx from './styleFunctionSx';
@@ -66,6 +66,9 @@ export function shouldForwardProp(prop) {
66
66
  }
67
67
  export const systemDefaultTheme = createTheme();
68
68
  const lowercaseFirstLetter = string => {
69
+ if (!string) {
70
+ return string;
71
+ }
69
72
  return string.charAt(0).toLowerCase() + string.slice(1);
70
73
  };
71
74
  function resolveTheme({
@@ -75,6 +78,12 @@ function resolveTheme({
75
78
  }) {
76
79
  return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;
77
80
  }
81
+ function defaultOverridesResolver(slot) {
82
+ if (!slot) {
83
+ return null;
84
+ }
85
+ return (props, styles) => styles[slot];
86
+ }
78
87
  export default function createStyled(input = {}) {
79
88
  const {
80
89
  themeId,
@@ -99,21 +108,31 @@ export default function createStyled(input = {}) {
99
108
  slot: componentSlot,
100
109
  skipVariantsResolver: inputSkipVariantsResolver,
101
110
  skipSx: inputSkipSx,
102
- overridesResolver
111
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
112
+ // For more details: https://github.com/mui/material-ui/pull/37908
113
+ overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
103
114
  } = inputOptions,
104
115
  options = _objectWithoutPropertiesLoose(inputOptions, _excluded);
105
116
 
106
117
  // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
107
- const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
118
+ const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
119
+ // TODO v6: remove `Root` in the next major release
120
+ // For more details: https://github.com/mui/material-ui/pull/37908
121
+ componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;
108
122
  const skipSx = inputSkipSx || false;
109
123
  let label;
110
124
  if (process.env.NODE_ENV !== 'production') {
111
125
  if (componentName) {
126
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
127
+ // For more details: https://github.com/mui/material-ui/pull/37908
112
128
  label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;
113
129
  }
114
130
  }
115
131
  let shouldForwardPropOption = shouldForwardProp;
116
- if (componentSlot === 'Root') {
132
+
133
+ // TODO v6: remove `Root` in the next major release
134
+ // For more details: https://github.com/mui/material-ui/pull/37908
135
+ if (componentSlot === 'Root' || componentSlot === 'root') {
117
136
  shouldForwardPropOption = rootShouldForwardProp;
118
137
  } else if (componentSlot) {
119
138
  // any other slot specified
@@ -195,7 +214,7 @@ export default function createStyled(input = {}) {
195
214
  if (process.env.NODE_ENV !== 'production') {
196
215
  let displayName;
197
216
  if (componentName) {
198
- displayName = `${componentName}${componentSlot || ''}`;
217
+ displayName = `${componentName}${capitalize(componentSlot || '')}`;
199
218
  }
200
219
  if (displayName === undefined) {
201
220
  displayName = `Styled(${getDisplayName(tag)})`;
@@ -34,6 +34,8 @@ export function unstable_createStyleFunctionSx() {
34
34
  if (val == null) {
35
35
  return null;
36
36
  }
37
+
38
+ // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123
37
39
  if (themeKey === 'typography' && val === 'inherit') {
38
40
  return {
39
41
  [prop]: val
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v5.14.3
2
+ * @mui/system v5.14.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -4,7 +4,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  /* eslint-disable no-underscore-dangle */
6
6
  import styledEngineStyled, { internal_processStyles as processStyles } from '@mui/styled-engine';
7
- import { getDisplayName } from '@mui/utils';
7
+ import { getDisplayName, unstable_capitalize as capitalize } from '@mui/utils';
8
8
  import createTheme from './createTheme';
9
9
  import propsToClassKey from './propsToClassKey';
10
10
  import styleFunctionSx from './styleFunctionSx';
@@ -66,6 +66,9 @@ export function shouldForwardProp(prop) {
66
66
  }
67
67
  export var systemDefaultTheme = createTheme();
68
68
  var lowercaseFirstLetter = function lowercaseFirstLetter(string) {
69
+ if (!string) {
70
+ return string;
71
+ }
69
72
  return string.charAt(0).toLowerCase() + string.slice(1);
70
73
  };
71
74
  function resolveTheme(_ref) {
@@ -74,6 +77,14 @@ function resolveTheme(_ref) {
74
77
  themeId = _ref.themeId;
75
78
  return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;
76
79
  }
80
+ function defaultOverridesResolver(slot) {
81
+ if (!slot) {
82
+ return null;
83
+ }
84
+ return function (props, styles) {
85
+ return styles[slot];
86
+ };
87
+ }
77
88
  export default function createStyled() {
78
89
  var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
79
90
  var themeId = input.themeId,
@@ -104,18 +115,27 @@ export default function createStyled() {
104
115
  componentSlot = inputOptions.slot,
105
116
  inputSkipVariantsResolver = inputOptions.skipVariantsResolver,
106
117
  inputSkipSx = inputOptions.skipSx,
107
- overridesResolver = inputOptions.overridesResolver,
118
+ _inputOptions$overrid = inputOptions.overridesResolver,
119
+ overridesResolver = _inputOptions$overrid === void 0 ? defaultOverridesResolver(lowercaseFirstLetter(componentSlot)) : _inputOptions$overrid,
108
120
  options = _objectWithoutProperties(inputOptions, ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"]); // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
109
- var skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
121
+ var skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
122
+ // TODO v6: remove `Root` in the next major release
123
+ // For more details: https://github.com/mui/material-ui/pull/37908
124
+ componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;
110
125
  var skipSx = inputSkipSx || false;
111
126
  var label;
112
127
  if (process.env.NODE_ENV !== 'production') {
113
128
  if (componentName) {
129
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
130
+ // For more details: https://github.com/mui/material-ui/pull/37908
114
131
  label = "".concat(componentName, "-").concat(lowercaseFirstLetter(componentSlot || 'Root'));
115
132
  }
116
133
  }
117
134
  var shouldForwardPropOption = shouldForwardProp;
118
- if (componentSlot === 'Root') {
135
+
136
+ // TODO v6: remove `Root` in the next major release
137
+ // For more details: https://github.com/mui/material-ui/pull/37908
138
+ if (componentSlot === 'Root' || componentSlot === 'root') {
119
139
  shouldForwardPropOption = rootShouldForwardProp;
120
140
  } else if (componentSlot) {
121
141
  // any other slot specified
@@ -205,7 +225,7 @@ export default function createStyled() {
205
225
  if (process.env.NODE_ENV !== 'production') {
206
226
  var displayName;
207
227
  if (componentName) {
208
- displayName = "".concat(componentName).concat(componentSlot || '');
228
+ displayName = "".concat(componentName).concat(capitalize(componentSlot || ''));
209
229
  }
210
230
  if (displayName === undefined) {
211
231
  displayName = "Styled(".concat(getDisplayName(tag), ")");
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v5.14.3
2
+ * @mui/system v5.14.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -38,6 +38,8 @@ export function unstable_createStyleFunctionSx() {
38
38
  if (val == null) {
39
39
  return null;
40
40
  }
41
+
42
+ // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123
41
43
  if (themeKey === 'typography' && val === 'inherit') {
42
44
  return _defineProperty({}, prop, val);
43
45
  }
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
4
4
  /* eslint-disable no-underscore-dangle */
5
5
  import styledEngineStyled, { internal_processStyles as processStyles } from '@mui/styled-engine';
6
- import { getDisplayName } from '@mui/utils';
6
+ import { getDisplayName, unstable_capitalize as capitalize } from '@mui/utils';
7
7
  import createTheme from './createTheme';
8
8
  import propsToClassKey from './propsToClassKey';
9
9
  import styleFunctionSx from './styleFunctionSx';
@@ -65,6 +65,9 @@ export function shouldForwardProp(prop) {
65
65
  }
66
66
  export const systemDefaultTheme = createTheme();
67
67
  const lowercaseFirstLetter = string => {
68
+ if (!string) {
69
+ return string;
70
+ }
68
71
  return string.charAt(0).toLowerCase() + string.slice(1);
69
72
  };
70
73
  function resolveTheme({
@@ -74,6 +77,12 @@ function resolveTheme({
74
77
  }) {
75
78
  return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;
76
79
  }
80
+ function defaultOverridesResolver(slot) {
81
+ if (!slot) {
82
+ return null;
83
+ }
84
+ return (props, styles) => styles[slot];
85
+ }
77
86
  export default function createStyled(input = {}) {
78
87
  const {
79
88
  themeId,
@@ -98,21 +107,31 @@ export default function createStyled(input = {}) {
98
107
  slot: componentSlot,
99
108
  skipVariantsResolver: inputSkipVariantsResolver,
100
109
  skipSx: inputSkipSx,
101
- overridesResolver
110
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
111
+ // For more details: https://github.com/mui/material-ui/pull/37908
112
+ overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
102
113
  } = inputOptions,
103
114
  options = _objectWithoutPropertiesLoose(inputOptions, _excluded);
104
115
 
105
116
  // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
106
- const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
117
+ const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
118
+ // TODO v6: remove `Root` in the next major release
119
+ // For more details: https://github.com/mui/material-ui/pull/37908
120
+ componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;
107
121
  const skipSx = inputSkipSx || false;
108
122
  let label;
109
123
  if (process.env.NODE_ENV !== 'production') {
110
124
  if (componentName) {
125
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
126
+ // For more details: https://github.com/mui/material-ui/pull/37908
111
127
  label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;
112
128
  }
113
129
  }
114
130
  let shouldForwardPropOption = shouldForwardProp;
115
- if (componentSlot === 'Root') {
131
+
132
+ // TODO v6: remove `Root` in the next major release
133
+ // For more details: https://github.com/mui/material-ui/pull/37908
134
+ if (componentSlot === 'Root' || componentSlot === 'root') {
116
135
  shouldForwardPropOption = rootShouldForwardProp;
117
136
  } else if (componentSlot) {
118
137
  // any other slot specified
@@ -194,7 +213,7 @@ export default function createStyled(input = {}) {
194
213
  if (process.env.NODE_ENV !== 'production') {
195
214
  let displayName;
196
215
  if (componentName) {
197
- displayName = `${componentName}${componentSlot || ''}`;
216
+ displayName = `${componentName}${capitalize(componentSlot || '')}`;
198
217
  }
199
218
  if (displayName === undefined) {
200
219
  displayName = `Styled(${getDisplayName(tag)})`;
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v5.14.3
2
+ * @mui/system v5.14.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -34,6 +34,8 @@ export function unstable_createStyleFunctionSx() {
34
34
  if (val == null) {
35
35
  return null;
36
36
  }
37
+
38
+ // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123
37
39
  if (themeKey === 'typography' && val === 'inherit') {
38
40
  return {
39
41
  [prop]: val
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/system",
3
- "version": "5.14.3",
3
+ "version": "5.14.5",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "CSS utilities for rapidly laying out custom designs.",
@@ -44,10 +44,10 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@babel/runtime": "^7.22.6",
47
- "@mui/private-theming": "^5.13.7",
47
+ "@mui/private-theming": "^5.14.5",
48
48
  "@mui/styled-engine": "^5.13.2",
49
49
  "@mui/types": "^7.2.4",
50
- "@mui/utils": "^5.14.3",
50
+ "@mui/utils": "^5.14.5",
51
51
  "clsx": "^2.0.0",
52
52
  "csstype": "^3.1.2",
53
53
  "prop-types": "^15.8.1"
@@ -42,6 +42,8 @@ function unstable_createStyleFunctionSx() {
42
42
  if (val == null) {
43
43
  return null;
44
44
  }
45
+
46
+ // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123
45
47
  if (themeKey === 'typography' && val === 'inherit') {
46
48
  return {
47
49
  [prop]: val