@mui/system 5.15.4 → 5.15.6
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 +398 -242
- package/README.md +2 -2
- package/colorManipulator.js +6 -5
- package/esm/colorManipulator.js +6 -5
- package/index.js +1 -1
- package/legacy/colorManipulator.js +6 -5
- package/legacy/index.js +1 -1
- package/modern/colorManipulator.js +6 -5
- package/modern/index.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# MUI
|
|
1
|
+
# MUI System
|
|
2
2
|
|
|
3
|
-
MUI
|
|
3
|
+
MUI System is a set of CSS utilities to help you build custom designs more efficiently. It makes it possible to rapidly lay out custom designs.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
package/colorManipulator.js
CHANGED
|
@@ -22,6 +22,7 @@ exports.private_safeLighten = private_safeLighten;
|
|
|
22
22
|
exports.recomposeColor = recomposeColor;
|
|
23
23
|
exports.rgbToHex = rgbToHex;
|
|
24
24
|
var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
|
|
25
|
+
var _utils = require("@mui/utils");
|
|
25
26
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -31,13 +32,13 @@ var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatM
|
|
|
31
32
|
* @param {number} max The upper boundary of the output range
|
|
32
33
|
* @returns {number} A number in the range [min, max]
|
|
33
34
|
*/
|
|
34
|
-
function
|
|
35
|
+
function clampWrapper(value, min = 0, max = 1) {
|
|
35
36
|
if (process.env.NODE_ENV !== 'production') {
|
|
36
37
|
if (value < min || value > max) {
|
|
37
38
|
console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
return
|
|
41
|
+
return (0, _utils.clamp)(value, min, max);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
/**
|
|
@@ -245,7 +246,7 @@ function getContrastRatio(foreground, background) {
|
|
|
245
246
|
*/
|
|
246
247
|
function alpha(color, value) {
|
|
247
248
|
color = decomposeColor(color);
|
|
248
|
-
value =
|
|
249
|
+
value = clampWrapper(value);
|
|
249
250
|
if (color.type === 'rgb' || color.type === 'hsl') {
|
|
250
251
|
color.type += 'a';
|
|
251
252
|
}
|
|
@@ -275,7 +276,7 @@ function private_safeAlpha(color, value, warning) {
|
|
|
275
276
|
*/
|
|
276
277
|
function darken(color, coefficient) {
|
|
277
278
|
color = decomposeColor(color);
|
|
278
|
-
coefficient =
|
|
279
|
+
coefficient = clampWrapper(coefficient);
|
|
279
280
|
if (color.type.indexOf('hsl') !== -1) {
|
|
280
281
|
color.values[2] *= 1 - coefficient;
|
|
281
282
|
} else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {
|
|
@@ -304,7 +305,7 @@ function private_safeDarken(color, coefficient, warning) {
|
|
|
304
305
|
*/
|
|
305
306
|
function lighten(color, coefficient) {
|
|
306
307
|
color = decomposeColor(color);
|
|
307
|
-
coefficient =
|
|
308
|
+
coefficient = clampWrapper(coefficient);
|
|
308
309
|
if (color.type.indexOf('hsl') !== -1) {
|
|
309
310
|
color.values[2] += (100 - color.values[2]) * coefficient;
|
|
310
311
|
} else if (color.type.indexOf('rgb') !== -1) {
|
package/esm/colorManipulator.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
|
2
2
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
|
+
import { clamp } from '@mui/utils';
|
|
3
4
|
/**
|
|
4
5
|
* Returns a number whose value is limited to the given range.
|
|
5
6
|
* @param {number} value The value to be clamped
|
|
@@ -7,13 +8,13 @@ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
|
|
7
8
|
* @param {number} max The upper boundary of the output range
|
|
8
9
|
* @returns {number} A number in the range [min, max]
|
|
9
10
|
*/
|
|
10
|
-
function
|
|
11
|
+
function clampWrapper(value, min = 0, max = 1) {
|
|
11
12
|
if (process.env.NODE_ENV !== 'production') {
|
|
12
13
|
if (value < min || value > max) {
|
|
13
14
|
console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
|
-
return
|
|
17
|
+
return clamp(value, min, max);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -219,7 +220,7 @@ export function getContrastRatio(foreground, background) {
|
|
|
219
220
|
*/
|
|
220
221
|
export function alpha(color, value) {
|
|
221
222
|
color = decomposeColor(color);
|
|
222
|
-
value =
|
|
223
|
+
value = clampWrapper(value);
|
|
223
224
|
if (color.type === 'rgb' || color.type === 'hsl') {
|
|
224
225
|
color.type += 'a';
|
|
225
226
|
}
|
|
@@ -249,7 +250,7 @@ export function private_safeAlpha(color, value, warning) {
|
|
|
249
250
|
*/
|
|
250
251
|
export function darken(color, coefficient) {
|
|
251
252
|
color = decomposeColor(color);
|
|
252
|
-
coefficient =
|
|
253
|
+
coefficient = clampWrapper(coefficient);
|
|
253
254
|
if (color.type.indexOf('hsl') !== -1) {
|
|
254
255
|
color.values[2] *= 1 - coefficient;
|
|
255
256
|
} else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {
|
|
@@ -278,7 +279,7 @@ export function private_safeDarken(color, coefficient, warning) {
|
|
|
278
279
|
*/
|
|
279
280
|
export function lighten(color, coefficient) {
|
|
280
281
|
color = decomposeColor(color);
|
|
281
|
-
coefficient =
|
|
282
|
+
coefficient = clampWrapper(coefficient);
|
|
282
283
|
if (color.type.indexOf('hsl') !== -1) {
|
|
283
284
|
color.values[2] += (100 - color.values[2]) * coefficient;
|
|
284
285
|
} else if (color.type.indexOf('rgb') !== -1) {
|
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
|
2
2
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
|
+
import { clamp } from '@mui/utils';
|
|
3
4
|
/**
|
|
4
5
|
* Returns a number whose value is limited to the given range.
|
|
5
6
|
* @param {number} value The value to be clamped
|
|
@@ -7,7 +8,7 @@ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
|
|
7
8
|
* @param {number} max The upper boundary of the output range
|
|
8
9
|
* @returns {number} A number in the range [min, max]
|
|
9
10
|
*/
|
|
10
|
-
function
|
|
11
|
+
function clampWrapper(value) {
|
|
11
12
|
var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
12
13
|
var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
13
14
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -15,7 +16,7 @@ function clamp(value) {
|
|
|
15
16
|
console.error("MUI: The value provided ".concat(value, " is out of range [").concat(min, ", ").concat(max, "]."));
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return clamp(value, min, max);
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
/**
|
|
@@ -226,7 +227,7 @@ export function getContrastRatio(foreground, background) {
|
|
|
226
227
|
*/
|
|
227
228
|
export function alpha(color, value) {
|
|
228
229
|
color = decomposeColor(color);
|
|
229
|
-
value =
|
|
230
|
+
value = clampWrapper(value);
|
|
230
231
|
if (color.type === 'rgb' || color.type === 'hsl') {
|
|
231
232
|
color.type += 'a';
|
|
232
233
|
}
|
|
@@ -256,7 +257,7 @@ export function private_safeAlpha(color, value, warning) {
|
|
|
256
257
|
*/
|
|
257
258
|
export function darken(color, coefficient) {
|
|
258
259
|
color = decomposeColor(color);
|
|
259
|
-
coefficient =
|
|
260
|
+
coefficient = clampWrapper(coefficient);
|
|
260
261
|
if (color.type.indexOf('hsl') !== -1) {
|
|
261
262
|
color.values[2] *= 1 - coefficient;
|
|
262
263
|
} else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {
|
|
@@ -285,7 +286,7 @@ export function private_safeDarken(color, coefficient, warning) {
|
|
|
285
286
|
*/
|
|
286
287
|
export function lighten(color, coefficient) {
|
|
287
288
|
color = decomposeColor(color);
|
|
288
|
-
coefficient =
|
|
289
|
+
coefficient = clampWrapper(coefficient);
|
|
289
290
|
if (color.type.indexOf('hsl') !== -1) {
|
|
290
291
|
color.values[2] += (100 - color.values[2]) * coefficient;
|
|
291
292
|
} else if (color.type.indexOf('rgb') !== -1) {
|
package/legacy/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
|
2
2
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
|
+
import { clamp } from '@mui/utils';
|
|
3
4
|
/**
|
|
4
5
|
* Returns a number whose value is limited to the given range.
|
|
5
6
|
* @param {number} value The value to be clamped
|
|
@@ -7,13 +8,13 @@ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
|
|
7
8
|
* @param {number} max The upper boundary of the output range
|
|
8
9
|
* @returns {number} A number in the range [min, max]
|
|
9
10
|
*/
|
|
10
|
-
function
|
|
11
|
+
function clampWrapper(value, min = 0, max = 1) {
|
|
11
12
|
if (process.env.NODE_ENV !== 'production') {
|
|
12
13
|
if (value < min || value > max) {
|
|
13
14
|
console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
|
-
return
|
|
17
|
+
return clamp(value, min, max);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -219,7 +220,7 @@ export function getContrastRatio(foreground, background) {
|
|
|
219
220
|
*/
|
|
220
221
|
export function alpha(color, value) {
|
|
221
222
|
color = decomposeColor(color);
|
|
222
|
-
value =
|
|
223
|
+
value = clampWrapper(value);
|
|
223
224
|
if (color.type === 'rgb' || color.type === 'hsl') {
|
|
224
225
|
color.type += 'a';
|
|
225
226
|
}
|
|
@@ -249,7 +250,7 @@ export function private_safeAlpha(color, value, warning) {
|
|
|
249
250
|
*/
|
|
250
251
|
export function darken(color, coefficient) {
|
|
251
252
|
color = decomposeColor(color);
|
|
252
|
-
coefficient =
|
|
253
|
+
coefficient = clampWrapper(coefficient);
|
|
253
254
|
if (color.type.indexOf('hsl') !== -1) {
|
|
254
255
|
color.values[2] *= 1 - coefficient;
|
|
255
256
|
} else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {
|
|
@@ -278,7 +279,7 @@ export function private_safeDarken(color, coefficient, warning) {
|
|
|
278
279
|
*/
|
|
279
280
|
export function lighten(color, coefficient) {
|
|
280
281
|
color = decomposeColor(color);
|
|
281
|
-
coefficient =
|
|
282
|
+
coefficient = clampWrapper(coefficient);
|
|
282
283
|
if (color.type.indexOf('hsl') !== -1) {
|
|
283
284
|
color.values[2] += (100 - color.values[2]) * coefficient;
|
|
284
285
|
} else if (color.type.indexOf('rgb') !== -1) {
|
package/modern/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/system",
|
|
3
|
-
"version": "5.15.
|
|
3
|
+
"version": "5.15.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "MUI System is a set of CSS utilities to help you build custom designs more efficiently. It makes it possible to rapidly lay out custom designs.",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"url": "https://opencollective.com/mui-org"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@babel/runtime": "^7.23.
|
|
29
|
+
"@babel/runtime": "^7.23.8",
|
|
30
30
|
"clsx": "^2.1.0",
|
|
31
31
|
"csstype": "^3.1.2",
|
|
32
32
|
"prop-types": "^15.8.1",
|
|
33
|
-
"@mui/private-theming": "^5.15.
|
|
33
|
+
"@mui/private-theming": "^5.15.6",
|
|
34
|
+
"@mui/styled-engine": "^5.15.6",
|
|
34
35
|
"@mui/types": "^7.2.13",
|
|
35
|
-
"@mui/utils": "^5.15.
|
|
36
|
-
"@mui/styled-engine": "^5.15.4"
|
|
36
|
+
"@mui/utils": "^5.15.6"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@emotion/react": "^11.5.0",
|