@mui/system 6.0.0-alpha.0 → 6.0.0-alpha.3
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 +243 -4
- package/Container/Container.d.ts +1 -1
- package/Stack/Stack.d.ts +1 -1
- package/Stack/createStack.d.ts +1 -1
- package/Unstable_Grid/Grid.d.ts +1 -1
- package/Unstable_Grid/createGrid.d.ts +1 -1
- package/breakpoints/breakpoints.js +19 -1
- package/createTheme/createSpacing.d.ts +2 -2
- package/createTheme/createSpacing.js +7 -8
- package/createTheme/createTheme.d.ts +2 -1
- package/createTheme/createTheme.js +2 -0
- package/cssContainerQueries/cssContainerQueries.d.ts +24 -0
- package/cssContainerQueries/cssContainerQueries.js +68 -0
- package/cssContainerQueries/index.d.ts +3 -0
- package/cssContainerQueries/index.js +2 -0
- package/cssContainerQueries/package.json +6 -0
- package/cssVars/createCssVarsProvider.js +3 -0
- package/cssVars/cssVarsParser.d.ts +1 -1
- package/cssVars/cssVarsParser.js +3 -2
- package/index.d.ts +2 -0
- package/index.js +2 -1
- package/modern/breakpoints/breakpoints.js +19 -1
- package/modern/createTheme/createSpacing.js +7 -8
- package/modern/createTheme/createTheme.js +2 -0
- package/modern/cssContainerQueries/cssContainerQueries.js +68 -0
- package/modern/cssContainerQueries/index.js +2 -0
- package/modern/cssVars/createCssVarsProvider.js +3 -0
- package/modern/cssVars/cssVarsParser.js +3 -2
- package/modern/index.js +2 -1
- package/modern/spacing/spacing.js +24 -21
- package/modern/styleFunctionSx/styleFunctionSx.js +2 -1
- package/node/breakpoints/breakpoints.js +19 -1
- package/node/createTheme/createSpacing.js +7 -8
- package/node/createTheme/createTheme.js +2 -0
- package/node/cssContainerQueries/cssContainerQueries.js +79 -0
- package/node/cssContainerQueries/index.js +32 -0
- package/node/cssVars/createCssVarsProvider.js +3 -0
- package/node/cssVars/cssVarsParser.js +3 -2
- package/node/index.js +9 -1
- package/node/spacing/spacing.js +24 -21
- package/node/styleFunctionSx/styleFunctionSx.js +2 -1
- package/package.json +5 -5
- package/spacing/spacing.js +24 -21
- package/styleFunctionSx/styleFunctionSx.js +2 -1
- package/legacy/Box/Box.js +0 -30
- package/legacy/Box/boxClasses.js +0 -3
- package/legacy/Box/index.js +0 -5
- package/legacy/Container/Container.js +0 -61
- package/legacy/Container/ContainerProps.js +0 -1
- package/legacy/Container/containerClasses.js +0 -7
- package/legacy/Container/createContainer.js +0 -140
- package/legacy/Container/index.js +0 -5
- package/legacy/GlobalStyles/GlobalStyles.js +0 -37
- package/legacy/GlobalStyles/index.js +0 -4
- package/legacy/RtlProvider/index.js +0 -22
- package/legacy/Stack/Stack.js +0 -62
- package/legacy/Stack/StackProps.js +0 -1
- package/legacy/Stack/createStack.js +0 -180
- package/legacy/Stack/index.js +0 -7
- package/legacy/Stack/stackClasses.js +0 -7
- package/legacy/ThemeProvider/ThemeProvider.js +0 -87
- package/legacy/ThemeProvider/index.js +0 -3
- package/legacy/Unstable_Grid/Grid.js +0 -177
- package/legacy/Unstable_Grid/GridProps.js +0 -1
- package/legacy/Unstable_Grid/createGrid.js +0 -184
- package/legacy/Unstable_Grid/gridClasses.js +0 -28
- package/legacy/Unstable_Grid/gridGenerator.js +0 -216
- package/legacy/Unstable_Grid/index.js +0 -8
- package/legacy/Unstable_Grid/traverseBreakpoints.js +0 -48
- package/legacy/borders/borders.js +0 -51
- package/legacy/borders/index.js +0 -4
- package/legacy/breakpoints/breakpoints.js +0 -162
- package/legacy/breakpoints/index.js +0 -4
- package/legacy/colorManipulator/colorManipulator.js +0 -356
- package/legacy/colorManipulator/index.js +0 -3
- package/legacy/compose/compose.js +0 -32
- package/legacy/compose/index.js +0 -3
- package/legacy/createBox/createBox.js +0 -38
- package/legacy/createBox/index.js +0 -3
- package/legacy/createStyled/createStyled.js +0 -250
- package/legacy/createStyled/index.js +0 -4
- package/legacy/createTheme/applyStyles.js +0 -73
- package/legacy/createTheme/createBreakpoints.js +0 -83
- package/legacy/createTheme/createSpacing.js +0 -36
- package/legacy/createTheme/createTheme.js +0 -49
- package/legacy/createTheme/index.js +0 -3
- package/legacy/createTheme/shape.js +0 -4
- package/legacy/cssGrid/cssGrid.js +0 -91
- package/legacy/cssGrid/index.js +0 -4
- package/legacy/cssVars/createCssVarsProvider.js +0 -335
- package/legacy/cssVars/createCssVarsTheme.js +0 -13
- package/legacy/cssVars/createGetCssVar.js +0 -30
- package/legacy/cssVars/cssVarsParser.js +0 -140
- package/legacy/cssVars/getInitColorSchemeScript.js +0 -28
- package/legacy/cssVars/index.js +0 -6
- package/legacy/cssVars/prepareCssVars.js +0 -92
- package/legacy/cssVars/useCurrentColorScheme.js +0 -237
- package/legacy/display/display.js +0 -29
- package/legacy/display/index.js +0 -4
- package/legacy/flexbox/flexbox.js +0 -43
- package/legacy/flexbox/index.js +0 -4
- package/legacy/getThemeValue/getThemeValue.js +0 -47
- package/legacy/getThemeValue/index.js +0 -4
- package/legacy/index.js +0 -72
- package/legacy/memoize/index.js +0 -3
- package/legacy/memoize/memoize.js +0 -9
- package/legacy/merge/index.js +0 -3
- package/legacy/merge/merge.js +0 -10
- package/legacy/palette/index.js +0 -4
- package/legacy/palette/palette.js +0 -26
- package/legacy/positions/index.js +0 -4
- package/legacy/positions/positions.js +0 -22
- package/legacy/propsToClassKey/index.js +0 -3
- package/legacy/propsToClassKey/propsToClassKey.js +0 -24
- package/legacy/responsivePropType/index.js +0 -3
- package/legacy/responsivePropType/responsivePropType.js +0 -3
- package/legacy/shadows/index.js +0 -3
- package/legacy/shadows/shadows.js +0 -6
- package/legacy/sizing/index.js +0 -4
- package/legacy/sizing/sizing.js +0 -65
- package/legacy/spacing/index.js +0 -4
- package/legacy/spacing/spacing.js +0 -158
- package/legacy/style/index.js +0 -4
- package/legacy/style/style.js +0 -73
- package/legacy/styleFunctionSx/defaultSxConfig.js +0 -293
- package/legacy/styleFunctionSx/extendSxProp.js +0 -45
- package/legacy/styleFunctionSx/index.js +0 -4
- package/legacy/styleFunctionSx/styleFunctionSx.js +0 -126
- package/legacy/styled/index.js +0 -3
- package/legacy/styled/styled.js +0 -3
- package/legacy/typography/index.js +0 -4
- package/legacy/typography/typography.js +0 -37
- package/legacy/useMediaQuery/index.js +0 -2
- package/legacy/useMediaQuery/useMediaQuery.js +0 -145
- package/legacy/useTheme/index.js +0 -4
- package/legacy/useTheme/useTheme.js +0 -10
- package/legacy/useThemeProps/getThemeProps.js +0 -10
- package/legacy/useThemeProps/index.js +0 -4
- package/legacy/useThemeProps/useThemeProps.js +0 -20
- package/legacy/useThemeWithoutDefault/index.js +0 -3
- package/legacy/useThemeWithoutDefault/useThemeWithoutDefault.js +0 -13
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { DEFAULT_MODE_STORAGE_KEY, DEFAULT_COLOR_SCHEME_STORAGE_KEY } from './getInitColorSchemeScript';
|
|
6
|
-
export function getSystemMode(mode) {
|
|
7
|
-
if (typeof window !== 'undefined' && mode === 'system') {
|
|
8
|
-
var mql = window.matchMedia('(prefers-color-scheme: dark)');
|
|
9
|
-
if (mql.matches) {
|
|
10
|
-
return 'dark';
|
|
11
|
-
}
|
|
12
|
-
return 'light';
|
|
13
|
-
}
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
function processState(state, callback) {
|
|
17
|
-
if (state.mode === 'light' || state.mode === 'system' && state.systemMode === 'light') {
|
|
18
|
-
return callback('light');
|
|
19
|
-
}
|
|
20
|
-
if (state.mode === 'dark' || state.mode === 'system' && state.systemMode === 'dark') {
|
|
21
|
-
return callback('dark');
|
|
22
|
-
}
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
export function getColorScheme(state) {
|
|
26
|
-
return processState(state, function (mode) {
|
|
27
|
-
if (mode === 'light') {
|
|
28
|
-
return state.lightColorScheme;
|
|
29
|
-
}
|
|
30
|
-
if (mode === 'dark') {
|
|
31
|
-
return state.darkColorScheme;
|
|
32
|
-
}
|
|
33
|
-
return undefined;
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
function initializeValue(key, defaultValue) {
|
|
37
|
-
if (typeof window === 'undefined') {
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
40
|
-
var value;
|
|
41
|
-
try {
|
|
42
|
-
value = localStorage.getItem(key) || undefined;
|
|
43
|
-
if (!value) {
|
|
44
|
-
// the first time that user enters the site.
|
|
45
|
-
localStorage.setItem(key, defaultValue);
|
|
46
|
-
}
|
|
47
|
-
} catch (e) {
|
|
48
|
-
// Unsupported
|
|
49
|
-
}
|
|
50
|
-
return value || defaultValue;
|
|
51
|
-
}
|
|
52
|
-
export default function useCurrentColorScheme(options) {
|
|
53
|
-
var _options$defaultMode = options.defaultMode,
|
|
54
|
-
defaultMode = _options$defaultMode === void 0 ? 'light' : _options$defaultMode,
|
|
55
|
-
defaultLightColorScheme = options.defaultLightColorScheme,
|
|
56
|
-
defaultDarkColorScheme = options.defaultDarkColorScheme,
|
|
57
|
-
_options$supportedCol = options.supportedColorSchemes,
|
|
58
|
-
supportedColorSchemes = _options$supportedCol === void 0 ? [] : _options$supportedCol,
|
|
59
|
-
_options$modeStorageK = options.modeStorageKey,
|
|
60
|
-
modeStorageKey = _options$modeStorageK === void 0 ? DEFAULT_MODE_STORAGE_KEY : _options$modeStorageK,
|
|
61
|
-
_options$colorSchemeS = options.colorSchemeStorageKey,
|
|
62
|
-
colorSchemeStorageKey = _options$colorSchemeS === void 0 ? DEFAULT_COLOR_SCHEME_STORAGE_KEY : _options$colorSchemeS,
|
|
63
|
-
_options$storageWindo = options.storageWindow,
|
|
64
|
-
storageWindow = _options$storageWindo === void 0 ? typeof window === 'undefined' ? undefined : window : _options$storageWindo;
|
|
65
|
-
var joinedColorSchemes = supportedColorSchemes.join(',');
|
|
66
|
-
var _React$useState = React.useState(function () {
|
|
67
|
-
var initialMode = initializeValue(modeStorageKey, defaultMode);
|
|
68
|
-
var lightColorScheme = initializeValue("".concat(colorSchemeStorageKey, "-light"), defaultLightColorScheme);
|
|
69
|
-
var darkColorScheme = initializeValue("".concat(colorSchemeStorageKey, "-dark"), defaultDarkColorScheme);
|
|
70
|
-
return {
|
|
71
|
-
mode: initialMode,
|
|
72
|
-
systemMode: getSystemMode(initialMode),
|
|
73
|
-
lightColorScheme: lightColorScheme,
|
|
74
|
-
darkColorScheme: darkColorScheme
|
|
75
|
-
};
|
|
76
|
-
}),
|
|
77
|
-
state = _React$useState[0],
|
|
78
|
-
setState = _React$useState[1];
|
|
79
|
-
var colorScheme = getColorScheme(state);
|
|
80
|
-
var setMode = React.useCallback(function (mode) {
|
|
81
|
-
setState(function (currentState) {
|
|
82
|
-
if (mode === currentState.mode) {
|
|
83
|
-
// do nothing if mode does not change
|
|
84
|
-
return currentState;
|
|
85
|
-
}
|
|
86
|
-
var newMode = mode != null ? mode : defaultMode;
|
|
87
|
-
try {
|
|
88
|
-
localStorage.setItem(modeStorageKey, newMode);
|
|
89
|
-
} catch (e) {
|
|
90
|
-
// Unsupported
|
|
91
|
-
}
|
|
92
|
-
return _extends({}, currentState, {
|
|
93
|
-
mode: newMode,
|
|
94
|
-
systemMode: getSystemMode(newMode)
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
}, [modeStorageKey, defaultMode]);
|
|
98
|
-
var setColorScheme = React.useCallback(function (value) {
|
|
99
|
-
if (!value) {
|
|
100
|
-
setState(function (currentState) {
|
|
101
|
-
try {
|
|
102
|
-
localStorage.setItem("".concat(colorSchemeStorageKey, "-light"), defaultLightColorScheme);
|
|
103
|
-
localStorage.setItem("".concat(colorSchemeStorageKey, "-dark"), defaultDarkColorScheme);
|
|
104
|
-
} catch (e) {
|
|
105
|
-
// Unsupported
|
|
106
|
-
}
|
|
107
|
-
return _extends({}, currentState, {
|
|
108
|
-
lightColorScheme: defaultLightColorScheme,
|
|
109
|
-
darkColorScheme: defaultDarkColorScheme
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
} else if (typeof value === 'string') {
|
|
113
|
-
if (value && !joinedColorSchemes.includes(value)) {
|
|
114
|
-
console.error("`".concat(value, "` does not exist in `theme.colorSchemes`."));
|
|
115
|
-
} else {
|
|
116
|
-
setState(function (currentState) {
|
|
117
|
-
var newState = _extends({}, currentState);
|
|
118
|
-
processState(currentState, function (mode) {
|
|
119
|
-
try {
|
|
120
|
-
localStorage.setItem("".concat(colorSchemeStorageKey, "-").concat(mode), value);
|
|
121
|
-
} catch (e) {
|
|
122
|
-
// Unsupported
|
|
123
|
-
}
|
|
124
|
-
if (mode === 'light') {
|
|
125
|
-
newState.lightColorScheme = value;
|
|
126
|
-
}
|
|
127
|
-
if (mode === 'dark') {
|
|
128
|
-
newState.darkColorScheme = value;
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
return newState;
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
} else {
|
|
135
|
-
setState(function (currentState) {
|
|
136
|
-
var newState = _extends({}, currentState);
|
|
137
|
-
var newLightColorScheme = value.light === null ? defaultLightColorScheme : value.light;
|
|
138
|
-
var newDarkColorScheme = value.dark === null ? defaultDarkColorScheme : value.dark;
|
|
139
|
-
if (newLightColorScheme) {
|
|
140
|
-
if (!joinedColorSchemes.includes(newLightColorScheme)) {
|
|
141
|
-
console.error("`".concat(newLightColorScheme, "` does not exist in `theme.colorSchemes`."));
|
|
142
|
-
} else {
|
|
143
|
-
newState.lightColorScheme = newLightColorScheme;
|
|
144
|
-
try {
|
|
145
|
-
localStorage.setItem("".concat(colorSchemeStorageKey, "-light"), newLightColorScheme);
|
|
146
|
-
} catch (error) {
|
|
147
|
-
// Unsupported
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
if (newDarkColorScheme) {
|
|
152
|
-
if (!joinedColorSchemes.includes(newDarkColorScheme)) {
|
|
153
|
-
console.error("`".concat(newDarkColorScheme, "` does not exist in `theme.colorSchemes`."));
|
|
154
|
-
} else {
|
|
155
|
-
newState.darkColorScheme = newDarkColorScheme;
|
|
156
|
-
try {
|
|
157
|
-
localStorage.setItem("".concat(colorSchemeStorageKey, "-dark"), newDarkColorScheme);
|
|
158
|
-
} catch (error) {
|
|
159
|
-
// Unsupported
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return newState;
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}, [joinedColorSchemes, colorSchemeStorageKey, defaultLightColorScheme, defaultDarkColorScheme]);
|
|
167
|
-
var handleMediaQuery = React.useCallback(function (event) {
|
|
168
|
-
if (state.mode === 'system') {
|
|
169
|
-
setState(function (currentState) {
|
|
170
|
-
var systemMode = event != null && event.matches ? 'dark' : 'light';
|
|
171
|
-
|
|
172
|
-
// Early exit, nothing changed.
|
|
173
|
-
if (currentState.systemMode === systemMode) {
|
|
174
|
-
return currentState;
|
|
175
|
-
}
|
|
176
|
-
return _extends({}, currentState, {
|
|
177
|
-
systemMode: systemMode
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
}, [state.mode]);
|
|
182
|
-
|
|
183
|
-
// Ref hack to avoid adding handleMediaQuery as a dep
|
|
184
|
-
var mediaListener = React.useRef(handleMediaQuery);
|
|
185
|
-
mediaListener.current = handleMediaQuery;
|
|
186
|
-
React.useEffect(function () {
|
|
187
|
-
var handler = function handler() {
|
|
188
|
-
return mediaListener.current.apply(mediaListener, arguments);
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
// Always listen to System preference
|
|
192
|
-
var media = window.matchMedia('(prefers-color-scheme: dark)');
|
|
193
|
-
|
|
194
|
-
// Intentionally use deprecated listener methods to support iOS & old browsers
|
|
195
|
-
media.addListener(handler);
|
|
196
|
-
handler(media);
|
|
197
|
-
return function () {
|
|
198
|
-
media.removeListener(handler);
|
|
199
|
-
};
|
|
200
|
-
}, []);
|
|
201
|
-
|
|
202
|
-
// Handle when localStorage has changed
|
|
203
|
-
React.useEffect(function () {
|
|
204
|
-
if (storageWindow) {
|
|
205
|
-
var handleStorage = function handleStorage(event) {
|
|
206
|
-
var value = event.newValue;
|
|
207
|
-
if (typeof event.key === 'string' && event.key.startsWith(colorSchemeStorageKey) && (!value || joinedColorSchemes.match(value))) {
|
|
208
|
-
// If the key is deleted, value will be null then reset color scheme to the default one.
|
|
209
|
-
if (event.key.endsWith('light')) {
|
|
210
|
-
setColorScheme({
|
|
211
|
-
light: value
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
if (event.key.endsWith('dark')) {
|
|
215
|
-
setColorScheme({
|
|
216
|
-
dark: value
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
if (event.key === modeStorageKey && (!value || ['light', 'dark', 'system'].includes(value))) {
|
|
221
|
-
setMode(value || defaultMode);
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
// For syncing color-scheme changes between iframes
|
|
225
|
-
storageWindow.addEventListener('storage', handleStorage);
|
|
226
|
-
return function () {
|
|
227
|
-
storageWindow.removeEventListener('storage', handleStorage);
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
return undefined;
|
|
231
|
-
}, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode, storageWindow]);
|
|
232
|
-
return _extends({}, state, {
|
|
233
|
-
colorScheme: colorScheme,
|
|
234
|
-
setMode: setMode,
|
|
235
|
-
setColorScheme: setColorScheme
|
|
236
|
-
});
|
|
237
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import style from '../style';
|
|
2
|
-
import compose from '../compose';
|
|
3
|
-
export var displayPrint = style({
|
|
4
|
-
prop: 'displayPrint',
|
|
5
|
-
cssProperty: false,
|
|
6
|
-
transform: function transform(value) {
|
|
7
|
-
return {
|
|
8
|
-
'@media print': {
|
|
9
|
-
display: value
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
export var displayRaw = style({
|
|
15
|
-
prop: 'display'
|
|
16
|
-
});
|
|
17
|
-
export var overflow = style({
|
|
18
|
-
prop: 'overflow'
|
|
19
|
-
});
|
|
20
|
-
export var textOverflow = style({
|
|
21
|
-
prop: 'textOverflow'
|
|
22
|
-
});
|
|
23
|
-
export var visibility = style({
|
|
24
|
-
prop: 'visibility'
|
|
25
|
-
});
|
|
26
|
-
export var whiteSpace = style({
|
|
27
|
-
prop: 'whiteSpace'
|
|
28
|
-
});
|
|
29
|
-
export default compose(displayPrint, displayRaw, overflow, textOverflow, visibility, whiteSpace);
|
package/legacy/display/index.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import style from '../style';
|
|
2
|
-
import compose from '../compose';
|
|
3
|
-
export var flexBasis = style({
|
|
4
|
-
prop: 'flexBasis'
|
|
5
|
-
});
|
|
6
|
-
export var flexDirection = style({
|
|
7
|
-
prop: 'flexDirection'
|
|
8
|
-
});
|
|
9
|
-
export var flexWrap = style({
|
|
10
|
-
prop: 'flexWrap'
|
|
11
|
-
});
|
|
12
|
-
export var justifyContent = style({
|
|
13
|
-
prop: 'justifyContent'
|
|
14
|
-
});
|
|
15
|
-
export var alignItems = style({
|
|
16
|
-
prop: 'alignItems'
|
|
17
|
-
});
|
|
18
|
-
export var alignContent = style({
|
|
19
|
-
prop: 'alignContent'
|
|
20
|
-
});
|
|
21
|
-
export var order = style({
|
|
22
|
-
prop: 'order'
|
|
23
|
-
});
|
|
24
|
-
export var flex = style({
|
|
25
|
-
prop: 'flex'
|
|
26
|
-
});
|
|
27
|
-
export var flexGrow = style({
|
|
28
|
-
prop: 'flexGrow'
|
|
29
|
-
});
|
|
30
|
-
export var flexShrink = style({
|
|
31
|
-
prop: 'flexShrink'
|
|
32
|
-
});
|
|
33
|
-
export var alignSelf = style({
|
|
34
|
-
prop: 'alignSelf'
|
|
35
|
-
});
|
|
36
|
-
export var justifyItems = style({
|
|
37
|
-
prop: 'justifyItems'
|
|
38
|
-
});
|
|
39
|
-
export var justifySelf = style({
|
|
40
|
-
prop: 'justifySelf'
|
|
41
|
-
});
|
|
42
|
-
var flexbox = compose(flexBasis, flexDirection, flexWrap, justifyContent, alignItems, alignContent, order, flex, flexGrow, flexShrink, alignSelf, justifyItems, justifySelf);
|
|
43
|
-
export default flexbox;
|
package/legacy/flexbox/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import borders from '../borders';
|
|
3
|
-
import display from '../display';
|
|
4
|
-
import flexbox from '../flexbox';
|
|
5
|
-
import grid from '../cssGrid';
|
|
6
|
-
import positions from '../positions';
|
|
7
|
-
import palette from '../palette';
|
|
8
|
-
import shadows from '../shadows';
|
|
9
|
-
import sizing from '../sizing';
|
|
10
|
-
import spacing from '../spacing';
|
|
11
|
-
import typography from '../typography';
|
|
12
|
-
var filterPropsMapping = {
|
|
13
|
-
borders: borders.filterProps,
|
|
14
|
-
display: display.filterProps,
|
|
15
|
-
flexbox: flexbox.filterProps,
|
|
16
|
-
grid: grid.filterProps,
|
|
17
|
-
positions: positions.filterProps,
|
|
18
|
-
palette: palette.filterProps,
|
|
19
|
-
shadows: shadows.filterProps,
|
|
20
|
-
sizing: sizing.filterProps,
|
|
21
|
-
spacing: spacing.filterProps,
|
|
22
|
-
typography: typography.filterProps
|
|
23
|
-
};
|
|
24
|
-
export var styleFunctionMapping = {
|
|
25
|
-
borders: borders,
|
|
26
|
-
display: display,
|
|
27
|
-
flexbox: flexbox,
|
|
28
|
-
grid: grid,
|
|
29
|
-
positions: positions,
|
|
30
|
-
palette: palette,
|
|
31
|
-
shadows: shadows,
|
|
32
|
-
sizing: sizing,
|
|
33
|
-
spacing: spacing,
|
|
34
|
-
typography: typography
|
|
35
|
-
};
|
|
36
|
-
export var propToStyleFunction = Object.keys(filterPropsMapping).reduce(function (acc, styleFnName) {
|
|
37
|
-
filterPropsMapping[styleFnName].forEach(function (propName) {
|
|
38
|
-
acc[propName] = styleFunctionMapping[styleFnName];
|
|
39
|
-
});
|
|
40
|
-
return acc;
|
|
41
|
-
}, {});
|
|
42
|
-
function getThemeValue(prop, value, theme) {
|
|
43
|
-
var inputProps = _defineProperty(_defineProperty({}, prop, value), "theme", theme);
|
|
44
|
-
var styleFunction = propToStyleFunction[prop];
|
|
45
|
-
return styleFunction ? styleFunction(inputProps) : _defineProperty({}, prop, value);
|
|
46
|
-
}
|
|
47
|
-
export default getThemeValue;
|
package/legacy/index.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @mui/system v6.0.0-alpha.0
|
|
3
|
-
*
|
|
4
|
-
* @license MIT
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
|
9
|
-
export { css, keyframes, StyledEngineProvider } from '@mui/styled-engine';
|
|
10
|
-
export { default as GlobalStyles } from './GlobalStyles';
|
|
11
|
-
export { default as borders } from './borders';
|
|
12
|
-
export * from './borders';
|
|
13
|
-
export { default as breakpoints } from './breakpoints';
|
|
14
|
-
export { handleBreakpoints, mergeBreakpointsInOrder, resolveBreakpointValues as unstable_resolveBreakpointValues } from './breakpoints';
|
|
15
|
-
export { default as compose } from './compose';
|
|
16
|
-
export { default as display } from './display';
|
|
17
|
-
export { default as flexbox } from './flexbox';
|
|
18
|
-
export * from './flexbox';
|
|
19
|
-
export { default as grid } from './cssGrid';
|
|
20
|
-
export * from './cssGrid';
|
|
21
|
-
export { default as palette } from './palette';
|
|
22
|
-
export * from './palette';
|
|
23
|
-
export { default as positions } from './positions';
|
|
24
|
-
export * from './positions';
|
|
25
|
-
export { default as shadows } from './shadows';
|
|
26
|
-
export { default as sizing } from './sizing';
|
|
27
|
-
export * from './sizing';
|
|
28
|
-
export { default as spacing } from './spacing';
|
|
29
|
-
export * from './spacing';
|
|
30
|
-
export { default as style, getPath, getStyleValue } from './style';
|
|
31
|
-
export { default as typography } from './typography';
|
|
32
|
-
export * from './typography';
|
|
33
|
-
export { default as unstable_styleFunctionSx, unstable_createStyleFunctionSx, extendSxProp as unstable_extendSxProp, unstable_defaultSxConfig } from './styleFunctionSx';
|
|
34
|
-
// TODO: Remove this function in v6
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
36
|
-
export function experimental_sx() {
|
|
37
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.For more details, see https://github.com/mui/material-ui/pull/35150." : _formatMuiErrorMessage(20));
|
|
38
|
-
}
|
|
39
|
-
export { default as unstable_getThemeValue } from './getThemeValue';
|
|
40
|
-
export { default as Box } from './Box';
|
|
41
|
-
export { default as createBox } from './createBox';
|
|
42
|
-
export { default as createStyled } from './createStyled';
|
|
43
|
-
export * from './createStyled';
|
|
44
|
-
export { default as styled } from './styled';
|
|
45
|
-
export { default as createTheme } from './createTheme';
|
|
46
|
-
export { default as createBreakpoints } from './createTheme/createBreakpoints';
|
|
47
|
-
export { default as createSpacing } from './createTheme/createSpacing';
|
|
48
|
-
export { default as shape } from './createTheme/shape';
|
|
49
|
-
export { default as useThemeProps, getThemeProps } from './useThemeProps';
|
|
50
|
-
export { default as useTheme } from './useTheme';
|
|
51
|
-
export { default as useThemeWithoutDefault } from './useThemeWithoutDefault';
|
|
52
|
-
export { default as useMediaQuery } from './useMediaQuery';
|
|
53
|
-
export * from './colorManipulator';
|
|
54
|
-
export { default as ThemeProvider } from './ThemeProvider';
|
|
55
|
-
export { default as unstable_createCssVarsProvider } from './cssVars/createCssVarsProvider';
|
|
56
|
-
export { default as unstable_createGetCssVar } from './cssVars/createGetCssVar';
|
|
57
|
-
export { default as unstable_cssVarsParser } from './cssVars/cssVarsParser';
|
|
58
|
-
export { default as unstable_prepareCssVars } from './cssVars/prepareCssVars';
|
|
59
|
-
export { default as unstable_createCssVarsTheme } from './cssVars/createCssVarsTheme';
|
|
60
|
-
export { default as responsivePropType } from './responsivePropType';
|
|
61
|
-
export { default as RtlProvider } from './RtlProvider';
|
|
62
|
-
export * from './RtlProvider';
|
|
63
|
-
|
|
64
|
-
/** ----------------- */
|
|
65
|
-
/** Layout components */
|
|
66
|
-
export { default as createContainer } from './Container/createContainer';
|
|
67
|
-
export { default as Container } from './Container';
|
|
68
|
-
export * from './Container';
|
|
69
|
-
export { default as Unstable_Grid } from './Unstable_Grid/Grid';
|
|
70
|
-
export * from './Unstable_Grid';
|
|
71
|
-
export { default as Stack } from './Stack/Stack';
|
|
72
|
-
export * from './Stack';
|
package/legacy/memoize/index.js
DELETED
package/legacy/merge/index.js
DELETED
package/legacy/merge/merge.js
DELETED
package/legacy/palette/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import style from '../style';
|
|
2
|
-
import compose from '../compose';
|
|
3
|
-
export function paletteTransform(value, userValue) {
|
|
4
|
-
if (userValue === 'grey') {
|
|
5
|
-
return userValue;
|
|
6
|
-
}
|
|
7
|
-
return value;
|
|
8
|
-
}
|
|
9
|
-
export var color = style({
|
|
10
|
-
prop: 'color',
|
|
11
|
-
themeKey: 'palette',
|
|
12
|
-
transform: paletteTransform
|
|
13
|
-
});
|
|
14
|
-
export var bgcolor = style({
|
|
15
|
-
prop: 'bgcolor',
|
|
16
|
-
cssProperty: 'backgroundColor',
|
|
17
|
-
themeKey: 'palette',
|
|
18
|
-
transform: paletteTransform
|
|
19
|
-
});
|
|
20
|
-
export var backgroundColor = style({
|
|
21
|
-
prop: 'backgroundColor',
|
|
22
|
-
themeKey: 'palette',
|
|
23
|
-
transform: paletteTransform
|
|
24
|
-
});
|
|
25
|
-
var palette = compose(color, bgcolor, backgroundColor);
|
|
26
|
-
export default palette;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import style from '../style';
|
|
2
|
-
import compose from '../compose';
|
|
3
|
-
export var position = style({
|
|
4
|
-
prop: 'position'
|
|
5
|
-
});
|
|
6
|
-
export var zIndex = style({
|
|
7
|
-
prop: 'zIndex',
|
|
8
|
-
themeKey: 'zIndex'
|
|
9
|
-
});
|
|
10
|
-
export var top = style({
|
|
11
|
-
prop: 'top'
|
|
12
|
-
});
|
|
13
|
-
export var right = style({
|
|
14
|
-
prop: 'right'
|
|
15
|
-
});
|
|
16
|
-
export var bottom = style({
|
|
17
|
-
prop: 'bottom'
|
|
18
|
-
});
|
|
19
|
-
export var left = style({
|
|
20
|
-
prop: 'left'
|
|
21
|
-
});
|
|
22
|
-
export default compose(position, zIndex, top, right, bottom, left);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
import capitalize from '@mui/utils/capitalize';
|
|
3
|
-
function isEmpty(string) {
|
|
4
|
-
return string.length === 0;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Generates string classKey based on the properties provided. It starts with the
|
|
9
|
-
* variant if defined, and then it appends all other properties in alphabetical order.
|
|
10
|
-
* @param {object} props - the properties for which the classKey should be created.
|
|
11
|
-
*/
|
|
12
|
-
export default function propsToClassKey(props) {
|
|
13
|
-
var variant = props.variant,
|
|
14
|
-
other = _objectWithoutProperties(props, ["variant"]);
|
|
15
|
-
var classKey = variant || '';
|
|
16
|
-
Object.keys(other).sort().forEach(function (key) {
|
|
17
|
-
if (key === 'color') {
|
|
18
|
-
classKey += isEmpty(classKey) ? props[key] : capitalize(props[key]);
|
|
19
|
-
} else {
|
|
20
|
-
classKey += "".concat(isEmpty(classKey) ? key : capitalize(key)).concat(capitalize(props[key].toString()));
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
return classKey;
|
|
24
|
-
}
|
package/legacy/shadows/index.js
DELETED
package/legacy/sizing/index.js
DELETED
package/legacy/sizing/sizing.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import style from '../style';
|
|
2
|
-
import compose from '../compose';
|
|
3
|
-
import { handleBreakpoints, values as breakpointsValues } from '../breakpoints';
|
|
4
|
-
export function sizingTransform(value) {
|
|
5
|
-
return value <= 1 && value !== 0 ? "".concat(value * 100, "%") : value;
|
|
6
|
-
}
|
|
7
|
-
export var width = style({
|
|
8
|
-
prop: 'width',
|
|
9
|
-
transform: sizingTransform
|
|
10
|
-
});
|
|
11
|
-
export var maxWidth = function maxWidth(props) {
|
|
12
|
-
if (props.maxWidth !== undefined && props.maxWidth !== null) {
|
|
13
|
-
var styleFromPropValue = function styleFromPropValue(propValue) {
|
|
14
|
-
var _props$theme, _props$theme2;
|
|
15
|
-
var breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || breakpointsValues[propValue];
|
|
16
|
-
if (!breakpoint) {
|
|
17
|
-
return {
|
|
18
|
-
maxWidth: sizingTransform(propValue)
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {
|
|
22
|
-
return {
|
|
23
|
-
maxWidth: "".concat(breakpoint).concat(props.theme.breakpoints.unit)
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
maxWidth: breakpoint
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
|
|
31
|
-
}
|
|
32
|
-
return null;
|
|
33
|
-
};
|
|
34
|
-
maxWidth.filterProps = ['maxWidth'];
|
|
35
|
-
export var minWidth = style({
|
|
36
|
-
prop: 'minWidth',
|
|
37
|
-
transform: sizingTransform
|
|
38
|
-
});
|
|
39
|
-
export var height = style({
|
|
40
|
-
prop: 'height',
|
|
41
|
-
transform: sizingTransform
|
|
42
|
-
});
|
|
43
|
-
export var maxHeight = style({
|
|
44
|
-
prop: 'maxHeight',
|
|
45
|
-
transform: sizingTransform
|
|
46
|
-
});
|
|
47
|
-
export var minHeight = style({
|
|
48
|
-
prop: 'minHeight',
|
|
49
|
-
transform: sizingTransform
|
|
50
|
-
});
|
|
51
|
-
export var sizeWidth = style({
|
|
52
|
-
prop: 'size',
|
|
53
|
-
cssProperty: 'width',
|
|
54
|
-
transform: sizingTransform
|
|
55
|
-
});
|
|
56
|
-
export var sizeHeight = style({
|
|
57
|
-
prop: 'size',
|
|
58
|
-
cssProperty: 'height',
|
|
59
|
-
transform: sizingTransform
|
|
60
|
-
});
|
|
61
|
-
export var boxSizing = style({
|
|
62
|
-
prop: 'boxSizing'
|
|
63
|
-
});
|
|
64
|
-
var sizing = compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
|
|
65
|
-
export default sizing;
|
package/legacy/spacing/index.js
DELETED