@mui/system 5.8.5 → 5.9.0
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/CHANGELOG.md +190 -0
- package/Unstable_Grid/Grid.d.ts +12 -0
- package/Unstable_Grid/Grid.js +190 -0
- package/Unstable_Grid/GridProps.d.ts +158 -0
- package/Unstable_Grid/GridProps.js +5 -0
- package/Unstable_Grid/createGrid.d.ts +11 -0
- package/Unstable_Grid/createGrid.js +174 -0
- package/Unstable_Grid/gridClasses.d.ts +20 -0
- package/Unstable_Grid/gridClasses.js +25 -0
- package/Unstable_Grid/gridGenerator.d.ts +26 -0
- package/Unstable_Grid/gridGenerator.js +269 -0
- package/Unstable_Grid/index.d.ts +5 -0
- package/Unstable_Grid/index.js +65 -0
- package/Unstable_Grid/package.json +6 -0
- package/{grid.js → cssGrid.js} +0 -0
- package/cssVars/createCssVarsProvider.d.ts +13 -18
- package/cssVars/createCssVarsProvider.js +13 -17
- package/cssVars/createGetCssVar.d.ts +1 -1
- package/cssVars/createGetCssVar.js +2 -2
- package/cssVars/cssVarsParser.d.ts +4 -9
- package/cssVars/cssVarsParser.js +4 -19
- package/cssVars/getInitColorSchemeScript.d.ts +5 -0
- package/cssVars/getInitColorSchemeScript.js +7 -0
- package/cssVars/index.d.ts +2 -1
- package/cssVars/index.js +9 -1
- package/cssVars/useCurrentColorScheme.js +1 -1
- package/esm/Unstable_Grid/Grid.js +179 -0
- package/esm/Unstable_Grid/GridProps.js +1 -0
- package/esm/Unstable_Grid/createGrid.js +152 -0
- package/esm/Unstable_Grid/gridClasses.js +14 -0
- package/esm/Unstable_Grid/gridGenerator.js +230 -0
- package/esm/Unstable_Grid/index.js +5 -0
- package/esm/{grid.js → cssGrid.js} +0 -0
- package/esm/cssVars/createCssVarsProvider.js +13 -16
- package/esm/cssVars/createGetCssVar.js +2 -2
- package/esm/cssVars/cssVarsParser.js +4 -19
- package/esm/cssVars/getInitColorSchemeScript.js +7 -0
- package/esm/cssVars/index.js +2 -1
- package/esm/cssVars/useCurrentColorScheme.js +1 -1
- package/esm/getThemeValue.js +1 -1
- package/esm/index.js +9 -3
- package/getThemeValue.js +3 -3
- package/index.d.ts +3 -0
- package/index.js +30 -7
- package/legacy/Unstable_Grid/Grid.js +179 -0
- package/legacy/Unstable_Grid/GridProps.js +1 -0
- package/legacy/Unstable_Grid/createGrid.js +166 -0
- package/legacy/Unstable_Grid/gridClasses.js +27 -0
- package/legacy/Unstable_Grid/gridGenerator.js +239 -0
- package/legacy/Unstable_Grid/index.js +5 -0
- package/legacy/{grid.js → cssGrid.js} +0 -0
- package/legacy/cssVars/createCssVarsProvider.js +13 -17
- package/legacy/cssVars/createGetCssVar.js +3 -3
- package/legacy/cssVars/cssVarsParser.js +4 -20
- package/legacy/cssVars/getInitColorSchemeScript.js +3 -1
- package/legacy/cssVars/index.js +2 -1
- package/legacy/cssVars/useCurrentColorScheme.js +1 -1
- package/legacy/getThemeValue.js +1 -1
- package/legacy/index.js +10 -4
- package/modern/Unstable_Grid/Grid.js +179 -0
- package/modern/Unstable_Grid/GridProps.js +1 -0
- package/modern/Unstable_Grid/createGrid.js +150 -0
- package/modern/Unstable_Grid/gridClasses.js +14 -0
- package/modern/Unstable_Grid/gridGenerator.js +226 -0
- package/modern/Unstable_Grid/index.js +5 -0
- package/modern/{grid.js → cssGrid.js} +0 -0
- package/modern/cssVars/createCssVarsProvider.js +13 -16
- package/modern/cssVars/createGetCssVar.js +2 -2
- package/modern/cssVars/cssVarsParser.js +4 -19
- package/modern/cssVars/getInitColorSchemeScript.js +7 -0
- package/modern/cssVars/index.js +2 -1
- package/modern/cssVars/useCurrentColorScheme.js +1 -1
- package/modern/getThemeValue.js +1 -1
- package/modern/index.js +10 -4
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,195 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.9.0
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.8.7..master -->
|
|
6
|
+
|
|
7
|
+
_Jul 12, 2022_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 19 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- 🧪 Exported Grid v2 as `Unstable_Grid2` (#33479) @siriwatknp
|
|
12
|
+
- 📖 Added a guide for using Joy UI and Material UI together (#33396) @siriwatknp
|
|
13
|
+
- 🐛 Fixed a few bugs in Material UI components. Thanks to @ZeeshanTamboli, @ivan-ngchakming, and @joebingham-wk.
|
|
14
|
+
- many other 🐛 bug fixes and 📚 documentation improvements
|
|
15
|
+
- our documentation site is now running with React 18! (#33196) @mnajdova
|
|
16
|
+
|
|
17
|
+
### `@mui/material@5.9.0`
|
|
18
|
+
|
|
19
|
+
- [CssBaseline] Fixes in overriding style (#33338) @ZeeshanTamboli
|
|
20
|
+
- [Autocomplete] Remove unnecessary `clsx` wrapper for single className (#33398) @ZeeshanTamboli
|
|
21
|
+
- [Grid] Export new grid as unstable (#33479) @siriwatknp
|
|
22
|
+
- [Tooltip] Fix children mouse over detection (#32321) @ivan-ngchakming
|
|
23
|
+
- [TypeScript] getCssVar autocomplete for Material UI (#33464) @siriwatknp
|
|
24
|
+
- [TypeScript] Fix theme options components types to use `Theme` (#33434) @siriwatknp
|
|
25
|
+
- [TypeScript] Reexports necessary types for module augmentation (#33397) @siriwatknp
|
|
26
|
+
- [ScopedCssBaseline] Add sx typings (#33474) @joebingham-wk
|
|
27
|
+
|
|
28
|
+
### `@mui/system@5.9.0`
|
|
29
|
+
|
|
30
|
+
- [System] Add offset feature to Grid (#33415) @siriwatknp
|
|
31
|
+
- [system] Add new `Grid` implementation (#32746) @siriwatknp
|
|
32
|
+
|
|
33
|
+
### `@mui/lab@5.0.0-alpha.90`
|
|
34
|
+
|
|
35
|
+
- [lab] Remove the pickers (#33386) @flaviendelangle
|
|
36
|
+
- [Masonry] Support `rem`/`em` values for `spacing` prop (#33384) @hbjORbj
|
|
37
|
+
|
|
38
|
+
### `@mui/base@5.0.0-alpha.89`
|
|
39
|
+
|
|
40
|
+
- Base] Change the order of class names merged in useSlotProps (#33383) @michaldudak
|
|
41
|
+
- [ModalUnstyled] Accept callbacks in componentsProps (#33181) @michaldudak
|
|
42
|
+
- [SelectUnstyled] Accept callbacks in componentsProps (#33197) @michaldudak
|
|
43
|
+
- [TabsUnstyled] Accept callbacks in componentsProps (#33284) @michaldudak
|
|
44
|
+
|
|
45
|
+
### `@mui/joy@5.0.0-alpha.36`
|
|
46
|
+
|
|
47
|
+
- [Joy] Add guide about using Joy and Material UI together (#33396) @siriwatknp
|
|
48
|
+
- [Joy] Fix variants color palette regressions (#33394) @danilo-leal
|
|
49
|
+
|
|
50
|
+
### Docs
|
|
51
|
+
|
|
52
|
+
- [docs] Correcting small grammatical error (#33393) @robyyo
|
|
53
|
+
- [docs] Link to the correct package on Joy component pages (#33439) @cherniavskii
|
|
54
|
+
- [docs] Fix e2e tests (#33477) @siriwatknp
|
|
55
|
+
- [docs] Fix dead links (#33462) @oliviertassinari
|
|
56
|
+
- [docs] Cleanup the migration (#33463) @siriwatknp
|
|
57
|
+
- [docs] Fix broken Sponsoring services links @samuelsycamore
|
|
58
|
+
- [docs] Improve repo README with light/dark logos, relative links and more (#33356) @samuelsycamore
|
|
59
|
+
- [docs] Update links to MUI X Overview and Introduction pages (#33201) @samuelsycamore
|
|
60
|
+
- [docs] Update to React 18 (#33196) @mnajdova
|
|
61
|
+
- [docs] Simplify "Upload button" demo (#33326) @baharalidurrani
|
|
62
|
+
- [docs] Add "refine" demo to showcase (#33240) @omeraplak
|
|
63
|
+
- [docs] Add webpack alias for legacy utils package (#33376) @jgbae
|
|
64
|
+
- [docs] Improve external link icons synonyms (#33257) @davidgarciab
|
|
65
|
+
- [examples] Update MUI Base with Tailwind CSS to use the latest versions of the dependencies (#33401) @mnajdova
|
|
66
|
+
- [examples] Add MUI base example (#33154) @siriwatknp
|
|
67
|
+
|
|
68
|
+
### Core
|
|
69
|
+
|
|
70
|
+
- [core] Fix @mui/monorepo regression for the import of the docs infra (#33390) @Janpot
|
|
71
|
+
- [core] Remove old babel resolve rule (#33432) @oliviertassinari
|
|
72
|
+
- [website] Shorten the plan descriptions on the pricing page (#32984) @joserodolfofreitas
|
|
73
|
+
- [website] Link EULA in the license quantity section (#33292) @oliviertassinari
|
|
74
|
+
|
|
75
|
+
All contributors of this release in alphabetical order: @baharalidurrani, @cherniavskii, @danilo-leal, @davidgarciab, @flaviendelangle, @hbjORbj, @ivan-ngchakming, @Janpot, @jgbae, @joebingham-wk, @joserodolfofreitas, @michaldudak, @mnajdova, @oliviertassinari, @omeraplak, @robyyo, @samuelsycamore, @siriwatknp, @ZeeshanTamboli
|
|
76
|
+
|
|
77
|
+
## 5.8.7
|
|
78
|
+
|
|
79
|
+
<!-- generated comparing v5.8.6..master -->
|
|
80
|
+
|
|
81
|
+
_Jul 4, 2022_
|
|
82
|
+
|
|
83
|
+
A big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
84
|
+
|
|
85
|
+
- 🐛 Fixed an issue causing Typescript errors when building a project with Material UI v5.8.6 (@michaldudak)
|
|
86
|
+
- 🐛 Fixed a few bugs in Material UI components. Thanks @henriqueholtz, @jake-collibra, @MattiasMartens and @TimoWilhelm!
|
|
87
|
+
- many other 🐛 bug fixes and 📚 documentation improvements
|
|
88
|
+
|
|
89
|
+
### `@mui/material@5.8.7`
|
|
90
|
+
|
|
91
|
+
- [Autocomplete] Add some missing props in `useAutocomplete` (#33269) @henriqueholtz
|
|
92
|
+
- [Autocomplete] Extend `componentsProps` to include `popper` and `popupIndicator` slots (#33283) @jake-collibra
|
|
93
|
+
- [Select] Annotate empty string as valid value prop (#33088) @MattiasMartens
|
|
94
|
+
- [SnackbarContent] Fix message text color with css var provider (#33285) @TimoWilhelm
|
|
95
|
+
|
|
96
|
+
### `@mui/styled-engine@5.8.7`
|
|
97
|
+
|
|
98
|
+
- [styled-engine] Add missing type dependency on csstype (#33310) @Methuselah96
|
|
99
|
+
|
|
100
|
+
### `@mui/system@5.8.7`
|
|
101
|
+
|
|
102
|
+
- [system] Simplify theme input types for `CssVarsProvider` (#33381) @siriwatknp
|
|
103
|
+
- [system] Export required types (#33324) @michaldudak
|
|
104
|
+
|
|
105
|
+
### `@mui/joy@5.0.0-alpha.35`
|
|
106
|
+
|
|
107
|
+
- [Joy] Add radio button documentation (#33254) @siriwatknp
|
|
108
|
+
- [Joy] Add switch documentation (#33302) @siriwatknp
|
|
109
|
+
- [Joy] Batch a couple of documentation refinements (#33158)
|
|
110
|
+
- [Joy] Enable Joy and Material UI compatibility (#33379) @siriwatknp
|
|
111
|
+
|
|
112
|
+
### `@mui/base@5.0.0-alpha.88`
|
|
113
|
+
|
|
114
|
+
- [base] Remove a type incompatible with Typescript 3.5 (#33361) @michaldudak
|
|
115
|
+
- [BadgeUnstyled] Export BadgeUnstyledOwnProps interface to fix typescript compiler error (#33314) @aaronlademann-wf
|
|
116
|
+
- [TablePaginationUnstyled] Accept callbacks in componentsProps (#33309) @michaldudak
|
|
117
|
+
|
|
118
|
+
### Docs
|
|
119
|
+
|
|
120
|
+
- [docs] Fix Link typings in the react-router example (#32308) @aaarichter
|
|
121
|
+
- [docs] Add caveat about class components with Tooltip (#33325) @joshkel
|
|
122
|
+
- [docs] Fix SEO issues (#33288) @oliviertassinari
|
|
123
|
+
- [docs] Fix Slider's "player" demo (#33267) @xlianghang
|
|
124
|
+
- [website] Link MUI Toolpad in mui.com (#33287) @oliviertassinari
|
|
125
|
+
|
|
126
|
+
All contributors of this release in alphabetical order: @aaarichter, @aaronlademann-wf, @danilo-leal, @henriqueholtz, @jake-collibra, @joshkel, @MattiasMartens, @Methuselah96, @michaldudak, @oliviertassinari, @siriwatknp, @TimoWilhelm, @xlianghang
|
|
127
|
+
|
|
128
|
+
## 5.8.6
|
|
129
|
+
|
|
130
|
+
<!-- generated comparing v5.8.5..master -->
|
|
131
|
+
|
|
132
|
+
_Jun 27, 2022_
|
|
133
|
+
|
|
134
|
+
A big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
135
|
+
|
|
136
|
+
- ⚒️ Fixed React 18 issues in few components
|
|
137
|
+
- 🚀 Improved the TypeScript augmentation when using CSS variables with `@mui/material`
|
|
138
|
+
- many other 🐛 bug fixes and 📚 documentation improvements
|
|
139
|
+
|
|
140
|
+
### `@mui/material@5.8.6`
|
|
141
|
+
|
|
142
|
+
- ​<!-- 27 -->[Alert] Add support for CSS vars (#32624) @haneenmahd
|
|
143
|
+
- ​<!-- 26 -->[Alert] Use `getContrastText` for filled variant font color (#29813) @SamoraMabuya
|
|
144
|
+
|
|
145
|
+
Note: The color of the text in the warning contained `Alert` in dark mode was changed to black in order to improve the color contrast ratio
|
|
146
|
+
|
|
147
|
+
- ​<!-- 11 -->[OutlinedInput] Fix `ownerState` undefined in theme style overrides (#33241) @siriwatknp
|
|
148
|
+
- ​<!-- 08 -->[Tabs] Fix crash when used with React 18 & Suspense (#33277) @mnajdova
|
|
149
|
+
- ​<!-- 05 -->[TypeScript] Add CSS vars type augmentation for Material UI (#33211) @siriwatknp
|
|
150
|
+
|
|
151
|
+
### `@mui/system@5.8.6`
|
|
152
|
+
|
|
153
|
+
- ​<!-- 09 -->[system] Add enableColorScheme option to getInitColorSchemeScript (#33261) @siriwatknp
|
|
154
|
+
|
|
155
|
+
### `@mui/utils@5.8.6`
|
|
156
|
+
|
|
157
|
+
- ​<!-- 04 -->[utils] Allow state prefix to be configurable (#32972) @siriwatknp
|
|
158
|
+
|
|
159
|
+
### `@mui/base@5.0.0-alpha.87`
|
|
160
|
+
|
|
161
|
+
- ​<!-- 25 -->[base] Improve the return type of useSlotProps (#33279) @michaldudak
|
|
162
|
+
- ​<!-- 24 -->[base] Improve some types (#33270) @mnajdova
|
|
163
|
+
- ​<!-- 13 -->[MenuUnstyled] Fix keyboard accessibility of menu items (#33145) @michaldudak
|
|
164
|
+
- ​<!-- 12 -->[ModalManager] Lock body scroll when container is inside shadow DOM (#33168) @jacobweberbowery
|
|
165
|
+
- ​<!-- 10 -->[SliderUnstyled] Use useSlotProps (#33132) @michaldudak
|
|
166
|
+
- ​<!-- 07 -->[TextareaAutosize] Fix crash when used with React 18 & Suspense (#33238) @howlettt
|
|
167
|
+
- ​<!-- 06 -->[TextareaAutosize] Fix warnings for too many renders in React 18 (#33253) @mnajdova
|
|
168
|
+
|
|
169
|
+
### `@mui/joy@5.0.0-alpha.34`
|
|
170
|
+
|
|
171
|
+
- ​<!-- 14 -->[Joy] Add `Sheet` doc (#32820) @hbjORbj
|
|
172
|
+
|
|
173
|
+
### Docs
|
|
174
|
+
|
|
175
|
+
- ​<!-- 23 -->[blog] Polish Why you should migrate to Material UI v5 today (#33244) @oliviertassinari
|
|
176
|
+
- ​<!-- 21 -->[docs] Add note in docs about `componentsProps.root` taking precedence (#33097) @ZeeshanTamboli
|
|
177
|
+
- ​<!-- 20 -->[docs] Remove a note about Base components being reexported from Material UI (#33265) @michaldudak
|
|
178
|
+
- ​<!-- 19 -->[docs] Update code snippet in docs for custom color palette (#32946) @ZeeshanTamboli
|
|
179
|
+
- ​<!-- 18 -->[docs] Fix the docs for production class generation (#31933) @Fafruch
|
|
180
|
+
- ​<!-- 17 -->[docs] Fix internal link in Box page (#33149) @davidgarciab
|
|
181
|
+
- ​<!-- 16 -->[docs] Badge component link in Base docs should be under Data Display section (#33249) @ZeeshanTamboli
|
|
182
|
+
- ​<!-- 15 -->[examples] Fix comment typo (#33256) @WinmezzZ
|
|
183
|
+
|
|
184
|
+
### Core
|
|
185
|
+
|
|
186
|
+
- ​<!-- 22 -->[core] Remove dead code (#33243) @oliviertassinari
|
|
187
|
+
- ​<!-- 03 -->[website] Fix the scroll-top for all the website (#33215) @oliviertassinari
|
|
188
|
+
- ​<!-- 02 -->[website] List new core role @oliviertassinari
|
|
189
|
+
- ​<!-- 01 -->[website] Fix navigation menu close behavior (#33203) @oliviertassinari
|
|
190
|
+
|
|
191
|
+
All contributors of this release in alphabetical order: @davidgarciab, @Fafruch, @haneenmahd, @hbjORbj, @howlettt, @jacobweberbowery, @michaldudak, @mnajdova, @oliviertassinari, @SamoraMabuya, @siriwatknp, @WinmezzZ, @ZeeshanTamboli
|
|
192
|
+
|
|
3
193
|
## 5.8.5
|
|
4
194
|
|
|
5
195
|
<!-- generated comparing v5.8.4..master -->
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Demos:
|
|
4
|
+
*
|
|
5
|
+
* - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)
|
|
6
|
+
*
|
|
7
|
+
* API:
|
|
8
|
+
*
|
|
9
|
+
* - [Grid API](https://mui.com/system/api/grid/)
|
|
10
|
+
*/
|
|
11
|
+
declare const Grid: import("@mui/types").OverridableComponent<import("./GridProps").GridTypeMap<{}, "div">>;
|
|
12
|
+
export default Grid;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _createGrid = _interopRequireDefault(require("./createGrid"));
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)
|
|
19
|
+
*
|
|
20
|
+
* API:
|
|
21
|
+
*
|
|
22
|
+
* - [Grid API](https://mui.com/system/api/grid/)
|
|
23
|
+
*/
|
|
24
|
+
const Grid = (0, _createGrid.default)();
|
|
25
|
+
process.env.NODE_ENV !== "production" ? Grid.propTypes
|
|
26
|
+
/* remove-proptypes */
|
|
27
|
+
= {
|
|
28
|
+
// ----------------------------- Warning --------------------------------
|
|
29
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
30
|
+
// | To update them edit TypeScript types and run "yarn proptypes" |
|
|
31
|
+
// ----------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The content of the component.
|
|
35
|
+
*/
|
|
36
|
+
children: _propTypes.default.node,
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The number of columns.
|
|
40
|
+
* @default 12
|
|
41
|
+
*/
|
|
42
|
+
columns: _propTypes.default
|
|
43
|
+
/* @typescript-to-proptypes-ignore */
|
|
44
|
+
.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.number, _propTypes.default.object]),
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Defines the horizontal space between the type `item` components.
|
|
48
|
+
* It overrides the value of the `spacing` prop.
|
|
49
|
+
*/
|
|
50
|
+
columnSpacing: _propTypes.default
|
|
51
|
+
/* @typescript-to-proptypes-ignore */
|
|
52
|
+
.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* If `true`, the component will have the flex *container* behavior.
|
|
56
|
+
* You should be wrapping *items* with a *container*.
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
container: _propTypes.default.bool,
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Defines the `flex-direction` style property.
|
|
63
|
+
* It is applied for all screen sizes.
|
|
64
|
+
* @default 'row'
|
|
65
|
+
*/
|
|
66
|
+
direction: _propTypes.default
|
|
67
|
+
/* @typescript-to-proptypes-ignore */
|
|
68
|
+
.oneOfType([_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), _propTypes.default.object]),
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
72
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
73
|
+
* If 'auto', the grid item's width matches its content.
|
|
74
|
+
* If false, the prop is ignored.
|
|
75
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
76
|
+
* The value is applied for the `lg` breakpoint and wider screens if not overridden.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
lg: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
83
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
84
|
+
* The value is applied for the `lg` breakpoint and wider screens if not overridden.
|
|
85
|
+
*/
|
|
86
|
+
lgOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
90
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
91
|
+
* If 'auto', the grid item's width matches its content.
|
|
92
|
+
* If false, the prop is ignored.
|
|
93
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
94
|
+
* The value is applied for the `md` breakpoint and wider screens if not overridden.
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
md: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
101
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
102
|
+
* The value is applied for the `md` breakpoint and wider screens if not overridden.
|
|
103
|
+
*/
|
|
104
|
+
mdOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Defines the vertical space between the type `item` components.
|
|
108
|
+
* It overrides the value of the `spacing` prop.
|
|
109
|
+
*/
|
|
110
|
+
rowSpacing: _propTypes.default
|
|
111
|
+
/* @typescript-to-proptypes-ignore */
|
|
112
|
+
.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
116
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
117
|
+
* If 'auto', the grid item's width matches its content.
|
|
118
|
+
* If false, the prop is ignored.
|
|
119
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
120
|
+
* The value is applied for the `sm` breakpoint and wider screens if not overridden.
|
|
121
|
+
* @default false
|
|
122
|
+
*/
|
|
123
|
+
sm: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
127
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
128
|
+
* The value is applied for the `sm` breakpoint and wider screens if not overridden.
|
|
129
|
+
*/
|
|
130
|
+
smOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Defines the space between the type `item` components.
|
|
134
|
+
* It can only be used on a type `container` component.
|
|
135
|
+
* @default 0
|
|
136
|
+
*/
|
|
137
|
+
spacing: _propTypes.default
|
|
138
|
+
/* @typescript-to-proptypes-ignore */
|
|
139
|
+
.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @ignore
|
|
143
|
+
*/
|
|
144
|
+
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Defines the `flex-wrap` style property.
|
|
148
|
+
* It's applied for all screen sizes.
|
|
149
|
+
* @default 'wrap'
|
|
150
|
+
*/
|
|
151
|
+
wrap: _propTypes.default.oneOf(['nowrap', 'wrap-reverse', 'wrap']),
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
155
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
156
|
+
* If 'auto', the grid item's width matches its content.
|
|
157
|
+
* If false, the prop is ignored.
|
|
158
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
159
|
+
* The value is applied for the `xl` breakpoint and wider screens if not overridden.
|
|
160
|
+
* @default false
|
|
161
|
+
*/
|
|
162
|
+
xl: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
166
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
167
|
+
* The value is applied for the `xl` breakpoint and wider screens if not overridden.
|
|
168
|
+
*/
|
|
169
|
+
xlOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]),
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
173
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
174
|
+
* If 'auto', the grid item's width matches its content.
|
|
175
|
+
* If false, the prop is ignored.
|
|
176
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
177
|
+
* The value is applied for all the screen sizes with the lowest priority.
|
|
178
|
+
* @default false
|
|
179
|
+
*/
|
|
180
|
+
xs: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.bool]),
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
184
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
185
|
+
* The value is applied for the `xs` breakpoint and wider screens if not overridden.
|
|
186
|
+
*/
|
|
187
|
+
xsOffset: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number])
|
|
188
|
+
} : void 0;
|
|
189
|
+
var _default = Grid;
|
|
190
|
+
exports.default = _default;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { OverrideProps, IfEquals } from '@mui/types';
|
|
3
|
+
import { SxProps } from '../styleFunctionSx';
|
|
4
|
+
import { Theme, Breakpoint, BreakpointOverrides } from '../createTheme';
|
|
5
|
+
import { SystemProps } from '../Box';
|
|
6
|
+
declare type ResponsiveStyleValue<T> = T | Array<T | null> | {
|
|
7
|
+
[key in Breakpoint]?: T | null;
|
|
8
|
+
};
|
|
9
|
+
export declare type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
10
|
+
export declare type GridSpacing = number | string;
|
|
11
|
+
export declare type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
12
|
+
export declare type GridSize = 'auto' | number;
|
|
13
|
+
export interface GridDefaultBreakpoints {
|
|
14
|
+
/**
|
|
15
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
16
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
17
|
+
* If 'auto', the grid item's width matches its content.
|
|
18
|
+
* If false, the prop is ignored.
|
|
19
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
20
|
+
* The value is applied for the `lg` breakpoint and wider screens if not overridden.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
lg?: boolean | GridSize;
|
|
24
|
+
/**
|
|
25
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
26
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
27
|
+
* The value is applied for the `lg` breakpoint and wider screens if not overridden.
|
|
28
|
+
*/
|
|
29
|
+
lgOffset?: GridSize;
|
|
30
|
+
/**
|
|
31
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
32
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
33
|
+
* If 'auto', the grid item's width matches its content.
|
|
34
|
+
* If false, the prop is ignored.
|
|
35
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
36
|
+
* The value is applied for the `md` breakpoint and wider screens if not overridden.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
md?: boolean | GridSize;
|
|
40
|
+
/**
|
|
41
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
42
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
43
|
+
* The value is applied for the `md` breakpoint and wider screens if not overridden.
|
|
44
|
+
*/
|
|
45
|
+
mdOffset?: GridSize;
|
|
46
|
+
/**
|
|
47
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
48
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
49
|
+
* If 'auto', the grid item's width matches its content.
|
|
50
|
+
* If false, the prop is ignored.
|
|
51
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
52
|
+
* The value is applied for the `sm` breakpoint and wider screens if not overridden.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
sm?: boolean | GridSize;
|
|
56
|
+
/**
|
|
57
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
58
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
59
|
+
* The value is applied for the `sm` breakpoint and wider screens if not overridden.
|
|
60
|
+
*/
|
|
61
|
+
smOffset?: GridSize;
|
|
62
|
+
/**
|
|
63
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
64
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
65
|
+
* If 'auto', the grid item's width matches its content.
|
|
66
|
+
* If false, the prop is ignored.
|
|
67
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
68
|
+
* The value is applied for the `xl` breakpoint and wider screens if not overridden.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
xl?: boolean | GridSize;
|
|
72
|
+
/**
|
|
73
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
74
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
75
|
+
* The value is applied for the `xl` breakpoint and wider screens if not overridden.
|
|
76
|
+
*/
|
|
77
|
+
xlOffset?: GridSize;
|
|
78
|
+
/**
|
|
79
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
80
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
81
|
+
* If 'auto', the grid item's width matches its content.
|
|
82
|
+
* If false, the prop is ignored.
|
|
83
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
84
|
+
* The value is applied for all the screen sizes with the lowest priority.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
xs?: boolean | GridSize;
|
|
88
|
+
/**
|
|
89
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
90
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
91
|
+
* The value is applied for the `xs` breakpoint and wider screens if not overridden.
|
|
92
|
+
*/
|
|
93
|
+
xsOffset?: GridSize;
|
|
94
|
+
}
|
|
95
|
+
declare type CustomBreakpoints = Partial<Record<Breakpoint, boolean | GridSize> & Record<`${Breakpoint}Offset`, GridSize>>;
|
|
96
|
+
interface BreakpointOverridesEmpty {
|
|
97
|
+
}
|
|
98
|
+
declare type Breakpoints = IfEquals<BreakpointOverrides, BreakpointOverridesEmpty, GridDefaultBreakpoints, CustomBreakpoints>;
|
|
99
|
+
export interface GridBaseProps extends Breakpoints {
|
|
100
|
+
/**
|
|
101
|
+
* The content of the component.
|
|
102
|
+
*/
|
|
103
|
+
children?: React.ReactNode;
|
|
104
|
+
/**
|
|
105
|
+
* The number of columns.
|
|
106
|
+
* @default 12
|
|
107
|
+
*/
|
|
108
|
+
columns?: ResponsiveStyleValue<number>;
|
|
109
|
+
/**
|
|
110
|
+
* Defines the horizontal space between the type `item` components.
|
|
111
|
+
* It overrides the value of the `spacing` prop.
|
|
112
|
+
*/
|
|
113
|
+
columnSpacing?: ResponsiveStyleValue<GridSpacing>;
|
|
114
|
+
/**
|
|
115
|
+
* If `true`, the component will have the flex *container* behavior.
|
|
116
|
+
* You should be wrapping *items* with a *container*.
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
119
|
+
container?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Defines the `flex-direction` style property.
|
|
122
|
+
* It is applied for all screen sizes.
|
|
123
|
+
* @default 'row'
|
|
124
|
+
*/
|
|
125
|
+
direction?: ResponsiveStyleValue<GridDirection>;
|
|
126
|
+
/**
|
|
127
|
+
* Defines the vertical space between the type `item` components.
|
|
128
|
+
* It overrides the value of the `spacing` prop.
|
|
129
|
+
*/
|
|
130
|
+
rowSpacing?: ResponsiveStyleValue<GridSpacing>;
|
|
131
|
+
/**
|
|
132
|
+
* Defines the space between the type `item` components.
|
|
133
|
+
* It can only be used on a type `container` component.
|
|
134
|
+
* @default 0
|
|
135
|
+
*/
|
|
136
|
+
spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Defines the `flex-wrap` style property.
|
|
139
|
+
* It's applied for all screen sizes.
|
|
140
|
+
* @default 'wrap'
|
|
141
|
+
*/
|
|
142
|
+
wrap?: GridWrap;
|
|
143
|
+
}
|
|
144
|
+
export interface GridOwnerState extends GridBaseProps {
|
|
145
|
+
nested: boolean;
|
|
146
|
+
gridSize: Partial<Record<Breakpoint, GridSize | boolean>>;
|
|
147
|
+
gridOffset: Partial<Record<Breakpoint, GridSize>>;
|
|
148
|
+
}
|
|
149
|
+
export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
150
|
+
props: P & GridBaseProps & {
|
|
151
|
+
sx?: SxProps<Theme>;
|
|
152
|
+
} & SystemProps<Theme>;
|
|
153
|
+
defaultComponent: D;
|
|
154
|
+
}
|
|
155
|
+
export declare type GridProps<D extends React.ElementType = GridTypeMap['defaultComponent'], P = {
|
|
156
|
+
component?: React.ElementType;
|
|
157
|
+
}> = OverrideProps<GridTypeMap<P, D>, D>;
|
|
158
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { OverridableComponent } from '@mui/types';
|
|
3
|
+
import { GridTypeMap } from './GridProps';
|
|
4
|
+
declare const defaultCreateStyledComponent: import("@mui/styled-engine").CreateStyledComponent<import("../createStyled").MUIStyledCommonProps<any>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}, any>;
|
|
5
|
+
declare function useThemePropsDefault<T>(props: T): T & {};
|
|
6
|
+
export default function createGrid(options?: {
|
|
7
|
+
createStyledComponent?: typeof defaultCreateStyledComponent;
|
|
8
|
+
useThemeProps?: typeof useThemePropsDefault;
|
|
9
|
+
componentName?: string;
|
|
10
|
+
}): OverridableComponent<GridTypeMap<{}, "div">>;
|
|
11
|
+
export {};
|