@mui/system 5.10.16 → 5.11.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 +148 -0
- package/borders.js +12 -7
- package/breakpoints.js +2 -0
- package/colorManipulator.d.ts +10 -0
- package/colorManipulator.js +57 -1
- package/compose.js +3 -0
- package/createBox.d.ts +0 -2
- package/createBox.js +2 -3
- package/createStyled.js +2 -3
- package/createTheme/createTheme.d.ts +5 -0
- package/createTheme/createTheme.js +9 -0
- package/cssGrid.js +8 -0
- package/cssVars/createCssVarsProvider.d.ts +54 -1
- package/cssVars/createCssVarsProvider.js +47 -13
- package/esm/borders.js +9 -6
- package/esm/breakpoints.js +2 -0
- package/esm/colorManipulator.js +50 -0
- package/esm/compose.js +3 -0
- package/esm/createBox.js +2 -3
- package/esm/createStyled.js +2 -3
- package/esm/createTheme/createTheme.js +9 -0
- package/esm/cssGrid.js +9 -0
- package/esm/cssVars/createCssVarsProvider.js +47 -13
- package/esm/index.js +1 -2
- package/esm/palette.js +4 -4
- package/esm/sizing.js +9 -9
- package/esm/spacing.js +2 -2
- package/esm/style.js +4 -1
- package/esm/styleFunctionSx/defaultSxConfig.js +284 -0
- package/esm/styleFunctionSx/extendSxProp.js +4 -2
- package/esm/styleFunctionSx/index.js +2 -1
- package/esm/styleFunctionSx/styleFunctionSx.js +45 -17
- package/index.d.ts +1 -2
- package/index.js +8 -9
- package/legacy/borders.js +9 -6
- package/legacy/breakpoints.js +2 -0
- package/legacy/colorManipulator.js +50 -0
- package/legacy/compose.js +3 -0
- package/legacy/createBox.js +2 -4
- package/legacy/createStyled.js +2 -4
- package/legacy/createTheme/createTheme.js +9 -0
- package/legacy/cssGrid.js +9 -0
- package/legacy/cssVars/createCssVarsProvider.js +47 -11
- package/legacy/index.js +2 -3
- package/legacy/palette.js +4 -4
- package/legacy/sizing.js +9 -9
- package/legacy/spacing.js +2 -2
- package/legacy/style.js +3 -2
- package/legacy/styleFunctionSx/defaultSxConfig.js +286 -0
- package/legacy/styleFunctionSx/extendSxProp.js +4 -2
- package/legacy/styleFunctionSx/index.js +2 -1
- package/legacy/styleFunctionSx/styleFunctionSx.js +44 -20
- package/modern/borders.js +9 -6
- package/modern/breakpoints.js +2 -0
- package/modern/colorManipulator.js +50 -0
- package/modern/compose.js +3 -0
- package/modern/createBox.js +2 -3
- package/modern/createStyled.js +2 -3
- package/modern/createTheme/createTheme.js +9 -0
- package/modern/cssGrid.js +9 -0
- package/modern/cssVars/createCssVarsProvider.js +47 -13
- package/modern/index.js +2 -3
- package/modern/palette.js +4 -4
- package/modern/sizing.js +9 -9
- package/modern/spacing.js +2 -2
- package/modern/style.js +4 -1
- package/modern/styleFunctionSx/defaultSxConfig.js +284 -0
- package/modern/styleFunctionSx/extendSxProp.js +3 -2
- package/modern/styleFunctionSx/index.js +2 -1
- package/modern/styleFunctionSx/styleFunctionSx.js +44 -17
- package/package.json +6 -6
- package/palette.js +5 -4
- package/sizing.js +12 -10
- package/spacing.js +4 -0
- package/style.d.ts +10 -8
- package/style.js +4 -1
- package/styleFunctionSx/defaultSxConfig.d.ts +20 -0
- package/styleFunctionSx/defaultSxConfig.js +291 -0
- package/styleFunctionSx/extendSxProp.js +4 -2
- package/styleFunctionSx/index.d.ts +4 -0
- package/styleFunctionSx/index.js +7 -0
- package/styleFunctionSx/styleFunctionSx.d.ts +2 -1
- package/styleFunctionSx/styleFunctionSx.js +45 -17
- package/esm/sx/index.js +0 -1
- package/esm/sx/sx.js +0 -10
- package/legacy/sx/index.js +0 -1
- package/legacy/sx/sx.js +0 -11
- package/modern/sx/index.js +0 -1
- package/modern/sx/sx.js +0 -10
- package/sx/index.d.ts +0 -1
- package/sx/index.js +0 -13
- package/sx/package.json +0 -6
- package/sx/sx.d.ts +0 -4
- package/sx/sx.js +0 -18
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _spacing = require("../spacing");
|
|
8
|
+
var _borders = require("../borders");
|
|
9
|
+
var _cssGrid = require("../cssGrid");
|
|
10
|
+
var _palette = require("../palette");
|
|
11
|
+
var _sizing = require("../sizing");
|
|
12
|
+
const defaultSxConfig = {
|
|
13
|
+
// borders
|
|
14
|
+
border: {
|
|
15
|
+
themeKey: 'borders',
|
|
16
|
+
transform: _borders.borderTransform
|
|
17
|
+
},
|
|
18
|
+
borderTop: {
|
|
19
|
+
themeKey: 'borders',
|
|
20
|
+
transform: _borders.borderTransform
|
|
21
|
+
},
|
|
22
|
+
borderRight: {
|
|
23
|
+
themeKey: 'borders',
|
|
24
|
+
transform: _borders.borderTransform
|
|
25
|
+
},
|
|
26
|
+
borderBottom: {
|
|
27
|
+
themeKey: 'borders',
|
|
28
|
+
transform: _borders.borderTransform
|
|
29
|
+
},
|
|
30
|
+
borderLeft: {
|
|
31
|
+
themeKey: 'borders',
|
|
32
|
+
transform: _borders.borderTransform
|
|
33
|
+
},
|
|
34
|
+
borderColor: {
|
|
35
|
+
themeKey: 'palette'
|
|
36
|
+
},
|
|
37
|
+
borderTopColor: {
|
|
38
|
+
themeKey: 'palette'
|
|
39
|
+
},
|
|
40
|
+
borderRightColor: {
|
|
41
|
+
themeKey: 'palette'
|
|
42
|
+
},
|
|
43
|
+
borderBottomColor: {
|
|
44
|
+
themeKey: 'palette'
|
|
45
|
+
},
|
|
46
|
+
borderLeftColor: {
|
|
47
|
+
themeKey: 'palette'
|
|
48
|
+
},
|
|
49
|
+
borderRadius: {
|
|
50
|
+
themeKey: 'shape.borderRadius',
|
|
51
|
+
style: _borders.borderRadius
|
|
52
|
+
},
|
|
53
|
+
// palette
|
|
54
|
+
color: {
|
|
55
|
+
themeKey: 'palette',
|
|
56
|
+
transform: _palette.paletteTransform
|
|
57
|
+
},
|
|
58
|
+
bgcolor: {
|
|
59
|
+
themeKey: 'palette',
|
|
60
|
+
cssProperty: 'backgroundColor',
|
|
61
|
+
transform: _palette.paletteTransform
|
|
62
|
+
},
|
|
63
|
+
backgroundColor: {
|
|
64
|
+
themeKey: 'palette',
|
|
65
|
+
transform: _palette.paletteTransform
|
|
66
|
+
},
|
|
67
|
+
// spacing
|
|
68
|
+
p: {
|
|
69
|
+
style: _spacing.padding
|
|
70
|
+
},
|
|
71
|
+
pt: {
|
|
72
|
+
style: _spacing.padding
|
|
73
|
+
},
|
|
74
|
+
pr: {
|
|
75
|
+
style: _spacing.padding
|
|
76
|
+
},
|
|
77
|
+
pb: {
|
|
78
|
+
style: _spacing.padding
|
|
79
|
+
},
|
|
80
|
+
pl: {
|
|
81
|
+
style: _spacing.padding
|
|
82
|
+
},
|
|
83
|
+
px: {
|
|
84
|
+
style: _spacing.padding
|
|
85
|
+
},
|
|
86
|
+
py: {
|
|
87
|
+
style: _spacing.padding
|
|
88
|
+
},
|
|
89
|
+
padding: {
|
|
90
|
+
style: _spacing.padding
|
|
91
|
+
},
|
|
92
|
+
paddingTop: {
|
|
93
|
+
style: _spacing.padding
|
|
94
|
+
},
|
|
95
|
+
paddingRight: {
|
|
96
|
+
style: _spacing.padding
|
|
97
|
+
},
|
|
98
|
+
paddingBottom: {
|
|
99
|
+
style: _spacing.padding
|
|
100
|
+
},
|
|
101
|
+
paddingLeft: {
|
|
102
|
+
style: _spacing.padding
|
|
103
|
+
},
|
|
104
|
+
paddingX: {
|
|
105
|
+
style: _spacing.padding
|
|
106
|
+
},
|
|
107
|
+
paddingY: {
|
|
108
|
+
style: _spacing.padding
|
|
109
|
+
},
|
|
110
|
+
paddingInline: {
|
|
111
|
+
style: _spacing.padding
|
|
112
|
+
},
|
|
113
|
+
paddingInlineStart: {
|
|
114
|
+
style: _spacing.padding
|
|
115
|
+
},
|
|
116
|
+
paddingInlineEnd: {
|
|
117
|
+
style: _spacing.padding
|
|
118
|
+
},
|
|
119
|
+
paddingBlock: {
|
|
120
|
+
style: _spacing.padding
|
|
121
|
+
},
|
|
122
|
+
paddingBlockStart: {
|
|
123
|
+
style: _spacing.padding
|
|
124
|
+
},
|
|
125
|
+
paddingBlockEnd: {
|
|
126
|
+
style: _spacing.padding
|
|
127
|
+
},
|
|
128
|
+
m: {
|
|
129
|
+
style: _spacing.margin
|
|
130
|
+
},
|
|
131
|
+
mt: {
|
|
132
|
+
style: _spacing.margin
|
|
133
|
+
},
|
|
134
|
+
mr: {
|
|
135
|
+
style: _spacing.margin
|
|
136
|
+
},
|
|
137
|
+
mb: {
|
|
138
|
+
style: _spacing.margin
|
|
139
|
+
},
|
|
140
|
+
ml: {
|
|
141
|
+
style: _spacing.margin
|
|
142
|
+
},
|
|
143
|
+
mx: {
|
|
144
|
+
style: _spacing.margin
|
|
145
|
+
},
|
|
146
|
+
my: {
|
|
147
|
+
style: _spacing.margin
|
|
148
|
+
},
|
|
149
|
+
margin: {
|
|
150
|
+
style: _spacing.margin
|
|
151
|
+
},
|
|
152
|
+
marginTop: {
|
|
153
|
+
style: _spacing.margin
|
|
154
|
+
},
|
|
155
|
+
marginRight: {
|
|
156
|
+
style: _spacing.margin
|
|
157
|
+
},
|
|
158
|
+
marginBottom: {
|
|
159
|
+
style: _spacing.margin
|
|
160
|
+
},
|
|
161
|
+
marginLeft: {
|
|
162
|
+
style: _spacing.margin
|
|
163
|
+
},
|
|
164
|
+
marginX: {
|
|
165
|
+
style: _spacing.margin
|
|
166
|
+
},
|
|
167
|
+
marginY: {
|
|
168
|
+
style: _spacing.margin
|
|
169
|
+
},
|
|
170
|
+
marginInline: {
|
|
171
|
+
style: _spacing.margin
|
|
172
|
+
},
|
|
173
|
+
marginInlineStart: {
|
|
174
|
+
style: _spacing.margin
|
|
175
|
+
},
|
|
176
|
+
marginInlineEnd: {
|
|
177
|
+
style: _spacing.margin
|
|
178
|
+
},
|
|
179
|
+
marginBlock: {
|
|
180
|
+
style: _spacing.margin
|
|
181
|
+
},
|
|
182
|
+
marginBlockStart: {
|
|
183
|
+
style: _spacing.margin
|
|
184
|
+
},
|
|
185
|
+
marginBlockEnd: {
|
|
186
|
+
style: _spacing.margin
|
|
187
|
+
},
|
|
188
|
+
// display
|
|
189
|
+
displayPrint: {
|
|
190
|
+
cssProperty: false,
|
|
191
|
+
transform: value => ({
|
|
192
|
+
'@media print': {
|
|
193
|
+
display: value
|
|
194
|
+
}
|
|
195
|
+
})
|
|
196
|
+
},
|
|
197
|
+
display: {},
|
|
198
|
+
overflow: {},
|
|
199
|
+
textOverflow: {},
|
|
200
|
+
visibility: {},
|
|
201
|
+
whiteSpace: {},
|
|
202
|
+
// flexbox
|
|
203
|
+
flexBasis: {},
|
|
204
|
+
flexDirection: {},
|
|
205
|
+
flexWrap: {},
|
|
206
|
+
justifyContent: {},
|
|
207
|
+
alignItems: {},
|
|
208
|
+
alignContent: {},
|
|
209
|
+
order: {},
|
|
210
|
+
flex: {},
|
|
211
|
+
flexGrow: {},
|
|
212
|
+
flexShrink: {},
|
|
213
|
+
alignSelf: {},
|
|
214
|
+
justifyItems: {},
|
|
215
|
+
justifySelf: {},
|
|
216
|
+
// grid
|
|
217
|
+
gap: {
|
|
218
|
+
style: _cssGrid.gap
|
|
219
|
+
},
|
|
220
|
+
rowGap: {
|
|
221
|
+
style: _cssGrid.rowGap
|
|
222
|
+
},
|
|
223
|
+
columnGap: {
|
|
224
|
+
style: _cssGrid.columnGap
|
|
225
|
+
},
|
|
226
|
+
gridColumn: {},
|
|
227
|
+
gridRow: {},
|
|
228
|
+
gridAutoFlow: {},
|
|
229
|
+
gridAutoColumns: {},
|
|
230
|
+
gridAutoRows: {},
|
|
231
|
+
gridTemplateColumns: {},
|
|
232
|
+
gridTemplateRows: {},
|
|
233
|
+
gridTemplateAreas: {},
|
|
234
|
+
gridArea: {},
|
|
235
|
+
// positions
|
|
236
|
+
position: {},
|
|
237
|
+
zIndex: {
|
|
238
|
+
themeKey: 'zIndex'
|
|
239
|
+
},
|
|
240
|
+
top: {},
|
|
241
|
+
right: {},
|
|
242
|
+
bottom: {},
|
|
243
|
+
left: {},
|
|
244
|
+
// shadows
|
|
245
|
+
boxShadow: {
|
|
246
|
+
themeKey: 'shadows'
|
|
247
|
+
},
|
|
248
|
+
// sizing
|
|
249
|
+
width: {
|
|
250
|
+
transform: _sizing.sizingTransform
|
|
251
|
+
},
|
|
252
|
+
maxWidth: {
|
|
253
|
+
style: _sizing.maxWidth
|
|
254
|
+
},
|
|
255
|
+
minWidth: {
|
|
256
|
+
transform: _sizing.sizingTransform
|
|
257
|
+
},
|
|
258
|
+
height: {
|
|
259
|
+
transform: _sizing.sizingTransform
|
|
260
|
+
},
|
|
261
|
+
maxHeight: {
|
|
262
|
+
transform: _sizing.sizingTransform
|
|
263
|
+
},
|
|
264
|
+
minHeight: {
|
|
265
|
+
transform: _sizing.sizingTransform
|
|
266
|
+
},
|
|
267
|
+
boxSizing: {},
|
|
268
|
+
// typography
|
|
269
|
+
fontFamily: {
|
|
270
|
+
themeKey: 'typography'
|
|
271
|
+
},
|
|
272
|
+
fontSize: {
|
|
273
|
+
themeKey: 'typography'
|
|
274
|
+
},
|
|
275
|
+
fontStyle: {
|
|
276
|
+
themeKey: 'typography'
|
|
277
|
+
},
|
|
278
|
+
fontWeight: {
|
|
279
|
+
themeKey: 'typography'
|
|
280
|
+
},
|
|
281
|
+
letterSpacing: {},
|
|
282
|
+
textTransform: {},
|
|
283
|
+
lineHeight: {},
|
|
284
|
+
textAlign: {},
|
|
285
|
+
typography: {
|
|
286
|
+
cssProperty: false,
|
|
287
|
+
themeKey: 'typography'
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
var _default = defaultSxConfig;
|
|
291
|
+
exports.default = _default;
|
|
@@ -8,15 +8,17 @@ exports.default = extendSxProp;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var _utils = require("@mui/utils");
|
|
11
|
-
var
|
|
11
|
+
var _defaultSxConfig = _interopRequireDefault(require("./defaultSxConfig"));
|
|
12
12
|
const _excluded = ["sx"];
|
|
13
13
|
const splitProps = props => {
|
|
14
|
+
var _props$theme$unstable, _props$theme;
|
|
14
15
|
const result = {
|
|
15
16
|
systemProps: {},
|
|
16
17
|
otherProps: {}
|
|
17
18
|
};
|
|
19
|
+
const config = (_props$theme$unstable = props == null ? void 0 : (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : _defaultSxConfig.default;
|
|
18
20
|
Object.keys(props).forEach(prop => {
|
|
19
|
-
if (
|
|
21
|
+
if (config[prop]) {
|
|
20
22
|
result.systemProps[prop] = props[prop];
|
|
21
23
|
} else {
|
|
22
24
|
result.otherProps[prop] = props[prop];
|
|
@@ -6,4 +6,8 @@ export * from './OverwriteCSSProperties';
|
|
|
6
6
|
export * from './StandardCssProperties';
|
|
7
7
|
|
|
8
8
|
export { default as extendSxProp } from './extendSxProp';
|
|
9
|
+
|
|
10
|
+
export { default as unstable_defaultSxConfig } from './defaultSxConfig';
|
|
11
|
+
export * from './defaultSxConfig';
|
|
12
|
+
|
|
9
13
|
export * from './extendSxProp';
|
package/styleFunctionSx/index.js
CHANGED
|
@@ -22,7 +22,14 @@ Object.defineProperty(exports, "unstable_createStyleFunctionSx", {
|
|
|
22
22
|
return _styleFunctionSx.unstable_createStyleFunctionSx;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
+
Object.defineProperty(exports, "unstable_defaultSxConfig", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _defaultSxConfig.default;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
25
31
|
var _styleFunctionSx = _interopRequireWildcard(require("./styleFunctionSx"));
|
|
26
32
|
var _extendSxProp = _interopRequireDefault(require("./extendSxProp"));
|
|
33
|
+
var _defaultSxConfig = _interopRequireDefault(require("./defaultSxConfig"));
|
|
27
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
35
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as CSS from 'csstype';
|
|
2
|
+
import { CSSObject } from '@mui/styled-engine';
|
|
2
3
|
import { StandardCSSProperties } from './StandardCssProperties';
|
|
3
4
|
import { AliasesCSSProperties } from './AliasesCSSProperties';
|
|
4
5
|
import { OverwriteCSSProperties } from './OverwriteCSSProperties';
|
|
@@ -74,7 +75,7 @@ export type SxProps<Theme extends object = {}> =
|
|
|
74
75
|
>;
|
|
75
76
|
|
|
76
77
|
export interface StyleFunctionSx {
|
|
77
|
-
(props: object):
|
|
78
|
+
(props: object): CSSObject;
|
|
78
79
|
filterProps?: string[];
|
|
79
80
|
}
|
|
80
81
|
|
|
@@ -6,9 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
exports.unstable_createStyleFunctionSx = unstable_createStyleFunctionSx;
|
|
9
|
+
var _utils = require("@mui/utils");
|
|
9
10
|
var _merge = _interopRequireDefault(require("../merge"));
|
|
10
|
-
var
|
|
11
|
+
var _style = require("../style");
|
|
11
12
|
var _breakpoints = require("../breakpoints");
|
|
13
|
+
var _defaultSxConfig = _interopRequireDefault(require("./defaultSxConfig"));
|
|
12
14
|
function objectsHaveSameKeys(...objects) {
|
|
13
15
|
const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
|
|
14
16
|
const union = new Set(allKeys);
|
|
@@ -19,24 +21,48 @@ function callIfFn(maybeFn, arg) {
|
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
22
|
-
function unstable_createStyleFunctionSx(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
return acc;
|
|
28
|
-
}, {});
|
|
29
|
-
function getThemeValue(prop, value, theme) {
|
|
30
|
-
const inputProps = {
|
|
31
|
-
[prop]: value,
|
|
24
|
+
function unstable_createStyleFunctionSx() {
|
|
25
|
+
function getThemeValue(prop, val, theme, config) {
|
|
26
|
+
const props = {
|
|
27
|
+
[prop]: val,
|
|
32
28
|
theme
|
|
33
29
|
};
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
const options = config[prop];
|
|
31
|
+
if (!options) {
|
|
32
|
+
return {
|
|
33
|
+
[prop]: val
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const {
|
|
37
|
+
cssProperty = prop,
|
|
38
|
+
themeKey,
|
|
39
|
+
transform,
|
|
40
|
+
style
|
|
41
|
+
} = options;
|
|
42
|
+
if (val == null) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const themeMapping = (0, _style.getPath)(theme, themeKey) || {};
|
|
46
|
+
if (style) {
|
|
47
|
+
return style(props);
|
|
48
|
+
}
|
|
49
|
+
const styleFromPropValue = propValueFinal => {
|
|
50
|
+
let value = (0, _style.getStyleValue)(themeMapping, transform, propValueFinal);
|
|
51
|
+
if (propValueFinal === value && typeof propValueFinal === 'string') {
|
|
52
|
+
// Haven't found value
|
|
53
|
+
value = (0, _style.getStyleValue)(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : (0, _utils.unstable_capitalize)(propValueFinal)}`, propValueFinal);
|
|
54
|
+
}
|
|
55
|
+
if (cssProperty === false) {
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
[cssProperty]: value
|
|
60
|
+
};
|
|
37
61
|
};
|
|
62
|
+
return (0, _breakpoints.handleBreakpoints)(props, val, styleFromPropValue);
|
|
38
63
|
}
|
|
39
64
|
function styleFunctionSx(props) {
|
|
65
|
+
var _theme$unstable_sxCon;
|
|
40
66
|
const {
|
|
41
67
|
sx,
|
|
42
68
|
theme = {}
|
|
@@ -45,6 +71,8 @@ function unstable_createStyleFunctionSx(styleFunctionMapping = _getThemeValue.st
|
|
|
45
71
|
return null; // Emotion & styled-components will neglect null
|
|
46
72
|
}
|
|
47
73
|
|
|
74
|
+
const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : _defaultSxConfig.default;
|
|
75
|
+
|
|
48
76
|
/*
|
|
49
77
|
* Receive `sxInput` as object or callback
|
|
50
78
|
* and then recursively check keys & values to create media query object styles.
|
|
@@ -68,8 +96,8 @@ function unstable_createStyleFunctionSx(styleFunctionMapping = _getThemeValue.st
|
|
|
68
96
|
const value = callIfFn(sxObject[styleKey], theme);
|
|
69
97
|
if (value !== null && value !== undefined) {
|
|
70
98
|
if (typeof value === 'object') {
|
|
71
|
-
if (
|
|
72
|
-
css = (0, _merge.default)(css, getThemeValue(styleKey, value, theme));
|
|
99
|
+
if (config[styleKey]) {
|
|
100
|
+
css = (0, _merge.default)(css, getThemeValue(styleKey, value, theme, config));
|
|
73
101
|
} else {
|
|
74
102
|
const breakpointsValues = (0, _breakpoints.handleBreakpoints)({
|
|
75
103
|
theme
|
|
@@ -86,7 +114,7 @@ function unstable_createStyleFunctionSx(styleFunctionMapping = _getThemeValue.st
|
|
|
86
114
|
}
|
|
87
115
|
}
|
|
88
116
|
} else {
|
|
89
|
-
css = (0, _merge.default)(css, getThemeValue(styleKey, value, theme));
|
|
117
|
+
css = (0, _merge.default)(css, getThemeValue(styleKey, value, theme, config));
|
|
90
118
|
}
|
|
91
119
|
}
|
|
92
120
|
});
|
package/esm/sx/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './sx';
|
package/esm/sx/sx.js
DELETED
package/legacy/sx/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './sx';
|
package/legacy/sx/sx.js
DELETED
package/modern/sx/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './sx';
|
package/modern/sx/sx.js
DELETED
package/sx/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './sx';
|
package/sx/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "default", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _sx.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
var _sx = _interopRequireDefault(require("./sx"));
|
package/sx/package.json
DELETED
package/sx/sx.d.ts
DELETED
package/sx/sx.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _styleFunctionSx = _interopRequireDefault(require("../styleFunctionSx"));
|
|
9
|
-
function sx(styles) {
|
|
10
|
-
return ({
|
|
11
|
-
theme
|
|
12
|
-
}) => (0, _styleFunctionSx.default)({
|
|
13
|
-
sx: styles,
|
|
14
|
-
theme
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
var _default = sx;
|
|
18
|
-
exports.default = _default;
|