@vitessce/description 4.0.10 → 4.1.1
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/dist/index.js +836 -543
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -72,6 +72,7 @@ const CoordinationType = {
|
|
|
72
72
|
SPATIAL_ROTATION_ORBIT: "spatialRotationOrbit",
|
|
73
73
|
SPATIAL_ORBIT_AXIS: "spatialOrbitAxis",
|
|
74
74
|
SPATIAL_AXIS_FIXED: "spatialAxisFixed",
|
|
75
|
+
SPATIAL_CAMERA_SNAPSHOT: "spatialCameraSnapshot",
|
|
75
76
|
HEATMAP_ZOOM_X: "heatmapZoomX",
|
|
76
77
|
HEATMAP_ZOOM_Y: "heatmapZoomY",
|
|
77
78
|
HEATMAP_TARGET_X: "heatmapTargetX",
|
|
@@ -119,6 +120,7 @@ const CoordinationType = {
|
|
|
119
120
|
SPATIAL_TARGET_C: "spatialTargetC",
|
|
120
121
|
SPATIAL_LAYER_VISIBLE: "spatialLayerVisible",
|
|
121
122
|
SPATIAL_LAYER_OPACITY: "spatialLayerOpacity",
|
|
123
|
+
SPATIAL_LAYER_OPACITY_UNSELECTED: "spatialLayerOpacityUnselected",
|
|
122
124
|
SPATIAL_LAYER_COLORMAP: "spatialLayerColormap",
|
|
123
125
|
SPATIAL_LAYER_LABEL: "spatialLayerLabel",
|
|
124
126
|
SPATIAL_LAYER_TRANSPARENT_COLOR: "spatialLayerTransparentColor",
|
|
@@ -155,6 +157,7 @@ const CoordinationType = {
|
|
|
155
157
|
PIXEL_HIGHLIGHT: "pixelHighlight",
|
|
156
158
|
// Per-image-layer
|
|
157
159
|
TOOLTIP_CROSSHAIRS_VISIBLE: "tooltipCrosshairsVisible",
|
|
160
|
+
TOOLTIP_OBS_SETS_MODE: "tooltipObsSetsMode",
|
|
158
161
|
LEGEND_VISIBLE: "legendVisible",
|
|
159
162
|
SPATIAL_CHANNEL_LABELS_VISIBLE: "spatialChannelLabelsVisible",
|
|
160
163
|
SPATIAL_CHANNEL_LABELS_ORIENTATION: "spatialChannelLabelsOrientation",
|
|
@@ -213,6 +216,8 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
213
216
|
CoordinationType.SPATIAL_ROTATION_ORBIT,
|
|
214
217
|
CoordinationType.SPATIAL_ORBIT_AXIS,
|
|
215
218
|
CoordinationType.SPATIAL_ZOOM,
|
|
219
|
+
CoordinationType.SPATIAL_CAMERA_SNAPSHOT,
|
|
220
|
+
CoordinationType.SPATIAL_RENDERING_MODE,
|
|
216
221
|
CoordinationType.OBS_FILTER,
|
|
217
222
|
CoordinationType.OBS_HIGHLIGHT,
|
|
218
223
|
CoordinationType.OBS_SET_SELECTION,
|
|
@@ -238,6 +243,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
238
243
|
CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
|
|
239
244
|
CoordinationType.SPATIAL_LAYER_COLOR,
|
|
240
245
|
CoordinationType.SPATIAL_LAYER_OPACITY,
|
|
246
|
+
CoordinationType.SPATIAL_LAYER_OPACITY_UNSELECTED,
|
|
241
247
|
CoordinationType.SPATIAL_LAYER_VISIBLE,
|
|
242
248
|
CoordinationType.SPATIAL_LAYER_LABEL,
|
|
243
249
|
CoordinationType.SPATIAL_CHANNEL_COLOR,
|
|
@@ -279,6 +285,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
279
285
|
CoordinationType.OBS_COLOR_ENCODING,
|
|
280
286
|
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
281
287
|
CoordinationType.TOOLTIPS_VISIBLE,
|
|
288
|
+
CoordinationType.TOOLTIP_OBS_SETS_MODE,
|
|
282
289
|
CoordinationType.SAMPLE_TYPE,
|
|
283
290
|
CoordinationType.SAMPLE_SET_SELECTION,
|
|
284
291
|
CoordinationType.SAMPLE_SET_FILTER,
|
|
@@ -330,6 +337,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
330
337
|
CoordinationType.OBS_COLOR_ENCODING,
|
|
331
338
|
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
332
339
|
CoordinationType.TOOLTIPS_VISIBLE,
|
|
340
|
+
CoordinationType.TOOLTIP_OBS_SETS_MODE,
|
|
333
341
|
CoordinationType.SAMPLE_TYPE,
|
|
334
342
|
CoordinationType.SAMPLE_SET_SELECTION,
|
|
335
343
|
CoordinationType.SAMPLE_SET_FILTER,
|
|
@@ -411,6 +419,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
411
419
|
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
412
420
|
CoordinationType.MOLECULE_HIGHLIGHT,
|
|
413
421
|
CoordinationType.TOOLTIPS_VISIBLE,
|
|
422
|
+
CoordinationType.TOOLTIP_OBS_SETS_MODE,
|
|
414
423
|
CoordinationType.PHOTOMETRIC_INTERPRETATION,
|
|
415
424
|
CoordinationType.ANNOTATION_STORY,
|
|
416
425
|
CoordinationType.ANNOTATION_SHAPES,
|
|
@@ -442,6 +451,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
442
451
|
CoordinationType.SPATIAL_ROTATION_ORBIT,
|
|
443
452
|
CoordinationType.SPATIAL_ORBIT_AXIS,
|
|
444
453
|
CoordinationType.SPATIAL_AXIS_FIXED,
|
|
454
|
+
CoordinationType.SPATIAL_CAMERA_SNAPSHOT,
|
|
445
455
|
CoordinationType.OBS_FILTER,
|
|
446
456
|
CoordinationType.OBS_HIGHLIGHT,
|
|
447
457
|
CoordinationType.OBS_SET_SELECTION,
|
|
@@ -459,10 +469,12 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
459
469
|
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
460
470
|
CoordinationType.MOLECULE_HIGHLIGHT,
|
|
461
471
|
CoordinationType.TOOLTIPS_VISIBLE,
|
|
472
|
+
CoordinationType.TOOLTIP_OBS_SETS_MODE,
|
|
462
473
|
CoordinationType.FILE_UID,
|
|
463
474
|
CoordinationType.SPATIAL_TARGET_C,
|
|
464
475
|
CoordinationType.SPATIAL_LAYER_VISIBLE,
|
|
465
476
|
CoordinationType.SPATIAL_LAYER_OPACITY,
|
|
477
|
+
CoordinationType.SPATIAL_LAYER_OPACITY_UNSELECTED,
|
|
466
478
|
CoordinationType.SPATIAL_LAYER_COLORMAP,
|
|
467
479
|
CoordinationType.SPATIAL_LAYER_TRANSPARENT_COLOR,
|
|
468
480
|
CoordinationType.SPATIAL_LAYER_MODEL_MATRIX,
|
|
@@ -541,7 +553,8 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
541
553
|
CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
|
|
542
554
|
CoordinationType.OBS_COLOR_ENCODING,
|
|
543
555
|
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
544
|
-
CoordinationType.TOOLTIPS_VISIBLE
|
|
556
|
+
CoordinationType.TOOLTIPS_VISIBLE,
|
|
557
|
+
CoordinationType.TOOLTIP_OBS_SETS_MODE
|
|
545
558
|
],
|
|
546
559
|
[ViewType.OBS_SETS]: [
|
|
547
560
|
CoordinationType.DATASET,
|
|
@@ -658,6 +671,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
|
658
671
|
CoordinationType.SPATIAL_LAYER_VISIBLE,
|
|
659
672
|
CoordinationType.SPATIAL_LAYER_LABEL,
|
|
660
673
|
CoordinationType.SPATIAL_LAYER_OPACITY,
|
|
674
|
+
CoordinationType.SPATIAL_LAYER_OPACITY_UNSELECTED,
|
|
661
675
|
CoordinationType.SPATIAL_LAYER_COLORMAP,
|
|
662
676
|
CoordinationType.SPATIAL_LAYER_TRANSPARENT_COLOR,
|
|
663
677
|
CoordinationType.SPATIAL_LAYER_MODEL_MATRIX,
|
|
@@ -1371,7 +1385,7 @@ function rulesheet(callback) {
|
|
|
1371
1385
|
}
|
|
1372
1386
|
};
|
|
1373
1387
|
}
|
|
1374
|
-
function memoize
|
|
1388
|
+
function memoize(fn) {
|
|
1375
1389
|
var cache = /* @__PURE__ */ Object.create(null);
|
|
1376
1390
|
return function(arg2) {
|
|
1377
1391
|
if (cache[arg2] === void 0) cache[arg2] = fn(arg2);
|
|
@@ -1659,10 +1673,10 @@ var createCache = function createCache2(options) {
|
|
|
1659
1673
|
}
|
|
1660
1674
|
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
1661
1675
|
var inserted = {};
|
|
1662
|
-
var
|
|
1676
|
+
var container2;
|
|
1663
1677
|
var nodesToHydrate = [];
|
|
1664
1678
|
{
|
|
1665
|
-
|
|
1679
|
+
container2 = options.container || document.head;
|
|
1666
1680
|
Array.prototype.forEach.call(
|
|
1667
1681
|
// this means we will ignore elements which don't have a space in them which
|
|
1668
1682
|
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
@@ -1699,7 +1713,7 @@ var createCache = function createCache2(options) {
|
|
|
1699
1713
|
key,
|
|
1700
1714
|
sheet: new StyleSheet({
|
|
1701
1715
|
key,
|
|
1702
|
-
container,
|
|
1716
|
+
container: container2,
|
|
1703
1717
|
nonce: options.nonce,
|
|
1704
1718
|
speedy: options.speedy,
|
|
1705
1719
|
prepend: options.prepend,
|
|
@@ -2023,7 +2037,7 @@ var isCustomProperty = function isCustomProperty2(property) {
|
|
|
2023
2037
|
var isProcessableValue = function isProcessableValue2(value) {
|
|
2024
2038
|
return value != null && typeof value !== "boolean";
|
|
2025
2039
|
};
|
|
2026
|
-
var processStyleName = /* @__PURE__ */ memoize
|
|
2040
|
+
var processStyleName = /* @__PURE__ */ memoize(function(styleName) {
|
|
2027
2041
|
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
|
|
2028
2042
|
});
|
|
2029
2043
|
var processStyleValue = function processStyleValue2(key, value) {
|
|
@@ -2920,7 +2934,7 @@ const { tss: tss$1 } = createTss({
|
|
|
2920
2934
|
tss$1.create({});
|
|
2921
2935
|
const THEME_ID = "$$material";
|
|
2922
2936
|
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
|
|
2923
|
-
var isPropValid = /* @__PURE__ */ memoize
|
|
2937
|
+
var isPropValid = /* @__PURE__ */ memoize(
|
|
2924
2938
|
function(prop) {
|
|
2925
2939
|
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
2926
2940
|
}
|
|
@@ -3870,8 +3884,7 @@ function requireReactIs_development() {
|
|
|
3870
3884
|
}
|
|
3871
3885
|
}
|
|
3872
3886
|
}
|
|
3873
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
3874
|
-
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
3887
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
3875
3888
|
reactIs_development.ContextConsumer = REACT_CONSUMER_TYPE;
|
|
3876
3889
|
reactIs_development.ContextProvider = REACT_CONTEXT_TYPE;
|
|
3877
3890
|
reactIs_development.Element = REACT_ELEMENT_TYPE;
|
|
@@ -3921,7 +3934,7 @@ function requireReactIs_development() {
|
|
|
3921
3934
|
return typeOf2(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
3922
3935
|
};
|
|
3923
3936
|
reactIs_development.isValidElementType = function(type) {
|
|
3924
|
-
return "string" === typeof type || "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || "object" === typeof type && null !== type && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type.getModuleId) ? true : false;
|
|
3937
|
+
return "string" === typeof type || "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_VIEW_TRANSITION_TYPE || "object" === typeof type && null !== type && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type.getModuleId) ? true : false;
|
|
3925
3938
|
};
|
|
3926
3939
|
reactIs_development.typeOf = typeOf2;
|
|
3927
3940
|
})();
|
|
@@ -3991,19 +4004,12 @@ const sortBreakpointsValues = (values2) => {
|
|
|
3991
4004
|
};
|
|
3992
4005
|
function createBreakpoints(breakpoints) {
|
|
3993
4006
|
const {
|
|
3994
|
-
// The breakpoint **start** at this value.
|
|
3995
|
-
// For instance with the first breakpoint xs: [xs, sm).
|
|
3996
4007
|
values: values2 = {
|
|
3997
4008
|
xs: 0,
|
|
3998
|
-
// phone
|
|
3999
4009
|
sm: 600,
|
|
4000
|
-
// tablet
|
|
4001
4010
|
md: 900,
|
|
4002
|
-
// small laptop
|
|
4003
4011
|
lg: 1200,
|
|
4004
|
-
// desktop
|
|
4005
4012
|
xl: 1536
|
|
4006
|
-
// large screen
|
|
4007
4013
|
},
|
|
4008
4014
|
unit = "px",
|
|
4009
4015
|
step = 5,
|
|
@@ -4039,6 +4045,10 @@ function createBreakpoints(breakpoints) {
|
|
|
4039
4045
|
}
|
|
4040
4046
|
return between(key, keys2[keys2.indexOf(key) + 1]).replace("@media", "@media not all and");
|
|
4041
4047
|
}
|
|
4048
|
+
const mediaKeys = [];
|
|
4049
|
+
for (let i = 0; i < keys2.length; i += 1) {
|
|
4050
|
+
mediaKeys.push(up(keys2[i]));
|
|
4051
|
+
}
|
|
4042
4052
|
return {
|
|
4043
4053
|
keys: keys2,
|
|
4044
4054
|
values: sortedValues,
|
|
@@ -4048,28 +4058,40 @@ function createBreakpoints(breakpoints) {
|
|
|
4048
4058
|
only,
|
|
4049
4059
|
not,
|
|
4050
4060
|
unit,
|
|
4061
|
+
internal_mediaKeys: mediaKeys,
|
|
4051
4062
|
...other
|
|
4052
4063
|
};
|
|
4053
4064
|
}
|
|
4065
|
+
const MIN_WIDTH_PATTERN = /min-width:\s*([0-9.]+)/;
|
|
4054
4066
|
function sortContainerQueries(theme, css) {
|
|
4055
|
-
if (!theme.containerQueries) {
|
|
4067
|
+
if (!theme.containerQueries || !hasContainerQuery(css)) {
|
|
4056
4068
|
return css;
|
|
4057
4069
|
}
|
|
4058
|
-
const
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
return css;
|
|
4070
|
+
const keys2 = [];
|
|
4071
|
+
for (const key in css) {
|
|
4072
|
+
if (key.startsWith("@container")) {
|
|
4073
|
+
keys2.push(key);
|
|
4074
|
+
}
|
|
4064
4075
|
}
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
delete acc[key];
|
|
4068
|
-
acc[key] = value;
|
|
4069
|
-
return acc;
|
|
4070
|
-
}, {
|
|
4071
|
-
...css
|
|
4076
|
+
keys2.sort((a, b) => {
|
|
4077
|
+
return +(a.match(MIN_WIDTH_PATTERN)?.[1] || 0) - +(b.match(MIN_WIDTH_PATTERN)?.[1] || 0);
|
|
4072
4078
|
});
|
|
4079
|
+
const result = css;
|
|
4080
|
+
for (let i = 0; i < keys2.length; i += 1) {
|
|
4081
|
+
const key = keys2[i];
|
|
4082
|
+
const value = result[key];
|
|
4083
|
+
delete result[key];
|
|
4084
|
+
result[key] = value;
|
|
4085
|
+
}
|
|
4086
|
+
return result;
|
|
4087
|
+
}
|
|
4088
|
+
function hasContainerQuery(css) {
|
|
4089
|
+
for (const key in css) {
|
|
4090
|
+
if (key.startsWith("@container")) {
|
|
4091
|
+
return true;
|
|
4092
|
+
}
|
|
4093
|
+
}
|
|
4094
|
+
return false;
|
|
4073
4095
|
}
|
|
4074
4096
|
function isCqShorthand(breakpointKeys, value) {
|
|
4075
4097
|
return value === "@" || value.startsWith("@") && (breakpointKeys.some((key) => value.startsWith(`@${key}`)) || !!value.match(/^@\d/));
|
|
@@ -4078,8 +4100,11 @@ function getContainerQuery(theme, shorthand) {
|
|
|
4078
4100
|
const matches = shorthand.match(/^@([^/]+)?\/?(.+)?$/);
|
|
4079
4101
|
if (!matches) {
|
|
4080
4102
|
{
|
|
4081
|
-
throw
|
|
4082
|
-
|
|
4103
|
+
throw (
|
|
4104
|
+
/* minify-error */
|
|
4105
|
+
new Error(`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
|
|
4106
|
+
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`)
|
|
4107
|
+
);
|
|
4083
4108
|
}
|
|
4084
4109
|
}
|
|
4085
4110
|
const [, containerQuery, containerName] = matches;
|
|
@@ -4116,15 +4141,82 @@ const shape = {
|
|
|
4116
4141
|
borderRadius: 4
|
|
4117
4142
|
};
|
|
4118
4143
|
const responsivePropType = PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]);
|
|
4119
|
-
function
|
|
4120
|
-
if (
|
|
4121
|
-
return
|
|
4144
|
+
function isObjectEmpty$1(object) {
|
|
4145
|
+
if (object == null) {
|
|
4146
|
+
return true;
|
|
4122
4147
|
}
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4148
|
+
for (const _ in object) {
|
|
4149
|
+
return false;
|
|
4150
|
+
}
|
|
4151
|
+
return true;
|
|
4152
|
+
}
|
|
4153
|
+
function fastDeepAssign(target, source) {
|
|
4154
|
+
const sourceIsArray = Array.isArray(source);
|
|
4155
|
+
const targetIsArray = Array.isArray(target);
|
|
4156
|
+
if (isPrimitive(source)) {
|
|
4157
|
+
return source;
|
|
4158
|
+
} else if (isPrimitiveOrBuiltIn(target)) {
|
|
4159
|
+
return clone(source);
|
|
4160
|
+
} else if (sourceIsArray && targetIsArray) {
|
|
4161
|
+
return mergeArray(target, source);
|
|
4162
|
+
} else if (sourceIsArray !== targetIsArray) {
|
|
4163
|
+
return clone(source);
|
|
4164
|
+
} else {
|
|
4165
|
+
return mergeObject(target, source);
|
|
4166
|
+
}
|
|
4167
|
+
}
|
|
4168
|
+
function cloneArray(value) {
|
|
4169
|
+
let i = 0;
|
|
4170
|
+
const il = value.length;
|
|
4171
|
+
const result = new Array(il);
|
|
4172
|
+
for (i = 0; i < il; i += 1) {
|
|
4173
|
+
result[i] = clone(value[i]);
|
|
4174
|
+
}
|
|
4175
|
+
return result;
|
|
4176
|
+
}
|
|
4177
|
+
function cloneObject(target) {
|
|
4178
|
+
const result = {};
|
|
4179
|
+
for (const key in target) {
|
|
4180
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
4181
|
+
continue;
|
|
4182
|
+
}
|
|
4183
|
+
result[key] = clone(target[key]);
|
|
4184
|
+
}
|
|
4185
|
+
return result;
|
|
4186
|
+
}
|
|
4187
|
+
function mergeArray(target, source) {
|
|
4188
|
+
const tl = target.length;
|
|
4189
|
+
for (let i = 0; i < source.length; i += 1) {
|
|
4190
|
+
target[tl + i] = clone(source[i]);
|
|
4191
|
+
}
|
|
4192
|
+
return target;
|
|
4193
|
+
}
|
|
4194
|
+
function isMergeableObject(value) {
|
|
4195
|
+
return typeof value === "object" && value !== null && !(value instanceof RegExp) && !(value instanceof Date);
|
|
4196
|
+
}
|
|
4197
|
+
function isPrimitive(value) {
|
|
4198
|
+
return typeof value !== "object" || value === null;
|
|
4199
|
+
}
|
|
4200
|
+
function isPrimitiveOrBuiltIn(value) {
|
|
4201
|
+
return typeof value !== "object" || value === null || value instanceof RegExp || value instanceof Date;
|
|
4127
4202
|
}
|
|
4203
|
+
function clone(entry) {
|
|
4204
|
+
return isMergeableObject(entry) ? Array.isArray(entry) ? cloneArray(entry) : cloneObject(entry) : entry;
|
|
4205
|
+
}
|
|
4206
|
+
function mergeObject(target, source) {
|
|
4207
|
+
for (const key in source) {
|
|
4208
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
4209
|
+
continue;
|
|
4210
|
+
}
|
|
4211
|
+
if (key in target) {
|
|
4212
|
+
target[key] = fastDeepAssign(target[key], source[key]);
|
|
4213
|
+
} else {
|
|
4214
|
+
target[key] = clone(source[key]);
|
|
4215
|
+
}
|
|
4216
|
+
}
|
|
4217
|
+
return target;
|
|
4218
|
+
}
|
|
4219
|
+
const EMPTY_THEME$2 = {};
|
|
4128
4220
|
const values = {
|
|
4129
4221
|
xs: 0,
|
|
4130
4222
|
// phone
|
|
@@ -4137,12 +4229,9 @@ const values = {
|
|
|
4137
4229
|
xl: 1536
|
|
4138
4230
|
// large screen
|
|
4139
4231
|
};
|
|
4140
|
-
const
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
keys: ["xs", "sm", "md", "lg", "xl"],
|
|
4144
|
-
up: (key) => `@media (min-width:${values[key]}px)`
|
|
4145
|
-
};
|
|
4232
|
+
const DEFAULT_BREAKPOINTS = createBreakpoints({
|
|
4233
|
+
values
|
|
4234
|
+
});
|
|
4146
4235
|
const defaultContainerQueries = {
|
|
4147
4236
|
containerQueries: (containerName) => ({
|
|
4148
4237
|
up: (key) => {
|
|
@@ -4155,52 +4244,89 @@ const defaultContainerQueries = {
|
|
|
4155
4244
|
})
|
|
4156
4245
|
};
|
|
4157
4246
|
function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
4158
|
-
const
|
|
4247
|
+
const result = {};
|
|
4248
|
+
return iterateBreakpoints(result, props.theme, propValue, (mediaKey, value, initialKey) => {
|
|
4249
|
+
const finalValue = styleFromPropValue(value, initialKey);
|
|
4250
|
+
if (mediaKey) {
|
|
4251
|
+
result[mediaKey] = finalValue;
|
|
4252
|
+
} else {
|
|
4253
|
+
fastDeepAssign(result, finalValue);
|
|
4254
|
+
}
|
|
4255
|
+
});
|
|
4256
|
+
}
|
|
4257
|
+
function iterateBreakpoints(target, theme, propValue, callback) {
|
|
4258
|
+
theme ??= EMPTY_THEME$2;
|
|
4159
4259
|
if (Array.isArray(propValue)) {
|
|
4160
|
-
const
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4260
|
+
const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
|
|
4261
|
+
for (let i = 0; i < propValue.length; i += 1) {
|
|
4262
|
+
buildBreakpoint(target, breakpoints.up(breakpoints.keys[i]), propValue[i], void 0, callback);
|
|
4263
|
+
}
|
|
4264
|
+
return target;
|
|
4165
4265
|
}
|
|
4166
4266
|
if (typeof propValue === "object") {
|
|
4167
|
-
const
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4267
|
+
const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
|
|
4268
|
+
const breakpointValues = breakpoints.values ?? values;
|
|
4269
|
+
for (const key in propValue) {
|
|
4270
|
+
if (isCqShorthand(breakpoints.keys, key)) {
|
|
4271
|
+
const containerKey = getContainerQuery(theme.containerQueries ? theme : defaultContainerQueries, key);
|
|
4171
4272
|
if (containerKey) {
|
|
4172
|
-
|
|
4273
|
+
buildBreakpoint(target, containerKey, propValue[key], key, callback);
|
|
4173
4274
|
}
|
|
4174
|
-
} else if (
|
|
4175
|
-
const mediaKey =
|
|
4176
|
-
|
|
4275
|
+
} else if (key in breakpointValues) {
|
|
4276
|
+
const mediaKey = breakpoints.up(key);
|
|
4277
|
+
buildBreakpoint(target, mediaKey, propValue[key], key, callback);
|
|
4177
4278
|
} else {
|
|
4178
|
-
const cssKey =
|
|
4179
|
-
|
|
4279
|
+
const cssKey = key;
|
|
4280
|
+
target[cssKey] = propValue[cssKey];
|
|
4180
4281
|
}
|
|
4181
|
-
|
|
4182
|
-
|
|
4282
|
+
}
|
|
4283
|
+
return target;
|
|
4183
4284
|
}
|
|
4184
|
-
|
|
4185
|
-
return
|
|
4285
|
+
callback(void 0, propValue);
|
|
4286
|
+
return target;
|
|
4186
4287
|
}
|
|
4187
|
-
function
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
acc[breakpointStyleKey] = {};
|
|
4191
|
-
return acc;
|
|
4192
|
-
}, {});
|
|
4193
|
-
return breakpointsInOrder || {};
|
|
4288
|
+
function buildBreakpoint(target, mediaKey, value, initialKey, callback) {
|
|
4289
|
+
target[mediaKey] ??= {};
|
|
4290
|
+
callback(mediaKey, value, initialKey);
|
|
4194
4291
|
}
|
|
4195
|
-
function
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4292
|
+
function createEmptyBreakpointObject(breakpoints = DEFAULT_BREAKPOINTS) {
|
|
4293
|
+
const {
|
|
4294
|
+
internal_mediaKeys: mediaKeys
|
|
4295
|
+
} = breakpoints;
|
|
4296
|
+
const result = {};
|
|
4297
|
+
for (let i = 0; i < mediaKeys.length; i += 1) {
|
|
4298
|
+
result[mediaKeys[i]] = {};
|
|
4299
|
+
}
|
|
4300
|
+
return result;
|
|
4301
|
+
}
|
|
4302
|
+
function removeUnusedBreakpoints(breakpoints, style2) {
|
|
4303
|
+
const breakpointKeys = breakpoints.internal_mediaKeys;
|
|
4304
|
+
for (let i = 0; i < breakpointKeys.length; i += 1) {
|
|
4305
|
+
const key = breakpointKeys[i];
|
|
4306
|
+
if (isObjectEmpty$1(style2[key])) {
|
|
4307
|
+
delete style2[key];
|
|
4201
4308
|
}
|
|
4202
|
-
|
|
4203
|
-
|
|
4309
|
+
}
|
|
4310
|
+
return style2;
|
|
4311
|
+
}
|
|
4312
|
+
function hasBreakpoint(breakpoints, value) {
|
|
4313
|
+
if (Array.isArray(value)) {
|
|
4314
|
+
return true;
|
|
4315
|
+
}
|
|
4316
|
+
if (typeof value === "object" && value !== null) {
|
|
4317
|
+
for (let i = 0; i < breakpoints.keys.length; i += 1) {
|
|
4318
|
+
if (breakpoints.keys[i] in value) {
|
|
4319
|
+
return true;
|
|
4320
|
+
}
|
|
4321
|
+
}
|
|
4322
|
+
const valueKeys = Object.keys(value);
|
|
4323
|
+
for (let i = 0; i < valueKeys.length; i += 1) {
|
|
4324
|
+
if (isCqShorthand(breakpoints.keys, valueKeys[i])) {
|
|
4325
|
+
return true;
|
|
4326
|
+
}
|
|
4327
|
+
}
|
|
4328
|
+
}
|
|
4329
|
+
return false;
|
|
4204
4330
|
}
|
|
4205
4331
|
function capitalize(string2) {
|
|
4206
4332
|
if (typeof string2 !== "string") {
|
|
@@ -4208,37 +4334,54 @@ function capitalize(string2) {
|
|
|
4208
4334
|
}
|
|
4209
4335
|
return string2.charAt(0).toUpperCase() + string2.slice(1);
|
|
4210
4336
|
}
|
|
4211
|
-
function
|
|
4212
|
-
if (!path || typeof path !== "string") {
|
|
4213
|
-
return null;
|
|
4214
|
-
}
|
|
4215
|
-
if (obj && obj.vars && checkVars) {
|
|
4216
|
-
const val = `vars.${path}`.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
|
|
4217
|
-
if (val != null) {
|
|
4218
|
-
return val;
|
|
4219
|
-
}
|
|
4220
|
-
}
|
|
4221
|
-
return path.split(".").reduce((acc, item) => {
|
|
4222
|
-
if (acc && acc[item] != null) {
|
|
4223
|
-
return acc[item];
|
|
4224
|
-
}
|
|
4225
|
-
return null;
|
|
4226
|
-
}, obj);
|
|
4227
|
-
}
|
|
4228
|
-
function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
|
4337
|
+
function getStyleValue2(themeMapping, transform, userValue, alternateProp) {
|
|
4229
4338
|
let value;
|
|
4230
4339
|
if (typeof themeMapping === "function") {
|
|
4231
|
-
value = themeMapping(
|
|
4340
|
+
value = themeMapping(userValue);
|
|
4232
4341
|
} else if (Array.isArray(themeMapping)) {
|
|
4233
|
-
value = themeMapping[
|
|
4342
|
+
value = themeMapping[userValue] || userValue;
|
|
4343
|
+
} else if (typeof userValue === "string") {
|
|
4344
|
+
value = getPath(themeMapping, userValue, true, alternateProp) || userValue;
|
|
4234
4345
|
} else {
|
|
4235
|
-
value =
|
|
4346
|
+
value = userValue;
|
|
4236
4347
|
}
|
|
4237
4348
|
if (transform) {
|
|
4238
4349
|
value = transform(value, userValue, themeMapping);
|
|
4239
4350
|
}
|
|
4240
4351
|
return value;
|
|
4241
4352
|
}
|
|
4353
|
+
function getPath(obj, pathInput, checkVars = true, alternateProp = void 0) {
|
|
4354
|
+
if (!obj || !pathInput) {
|
|
4355
|
+
return null;
|
|
4356
|
+
}
|
|
4357
|
+
const path = pathInput.split(".");
|
|
4358
|
+
if (obj.vars && checkVars) {
|
|
4359
|
+
const val = getPathImpl(obj.vars, path, alternateProp);
|
|
4360
|
+
if (val != null) {
|
|
4361
|
+
return val;
|
|
4362
|
+
}
|
|
4363
|
+
}
|
|
4364
|
+
return getPathImpl(obj, path, alternateProp);
|
|
4365
|
+
}
|
|
4366
|
+
function getPathImpl(object, path, alternateProp = void 0) {
|
|
4367
|
+
let lastResult = void 0;
|
|
4368
|
+
let result = object;
|
|
4369
|
+
let index2 = 0;
|
|
4370
|
+
while (index2 < path.length) {
|
|
4371
|
+
if (result === null || result === void 0) {
|
|
4372
|
+
return result;
|
|
4373
|
+
}
|
|
4374
|
+
lastResult = result;
|
|
4375
|
+
result = result[path[index2]];
|
|
4376
|
+
index2 += 1;
|
|
4377
|
+
}
|
|
4378
|
+
if (alternateProp && result === void 0) {
|
|
4379
|
+
const lastKey = path[path.length - 1];
|
|
4380
|
+
const alternateKey = `${alternateProp}${lastKey === "default" ? "" : capitalize(lastKey)}`;
|
|
4381
|
+
return lastResult?.[alternateKey];
|
|
4382
|
+
}
|
|
4383
|
+
return result;
|
|
4384
|
+
}
|
|
4242
4385
|
function style$1(options) {
|
|
4243
4386
|
const {
|
|
4244
4387
|
prop,
|
|
@@ -4253,15 +4396,9 @@ function style$1(options) {
|
|
|
4253
4396
|
const propValue = props[prop];
|
|
4254
4397
|
const theme = props.theme;
|
|
4255
4398
|
const themeMapping = getPath(theme, themeKey) || {};
|
|
4256
|
-
const styleFromPropValue = (
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
|
|
4260
|
-
}
|
|
4261
|
-
if (cssProperty === false) {
|
|
4262
|
-
return value;
|
|
4263
|
-
}
|
|
4264
|
-
return {
|
|
4399
|
+
const styleFromPropValue = (valueFinal) => {
|
|
4400
|
+
const value = getStyleValue2(themeMapping, transform, valueFinal, prop);
|
|
4401
|
+
return cssProperty === false ? value : {
|
|
4265
4402
|
[cssProperty]: value
|
|
4266
4403
|
};
|
|
4267
4404
|
};
|
|
@@ -4273,15 +4410,9 @@ function style$1(options) {
|
|
|
4273
4410
|
fn.filterProps = [prop];
|
|
4274
4411
|
return fn;
|
|
4275
4412
|
}
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
if (cache[arg2] === void 0) {
|
|
4280
|
-
cache[arg2] = fn(arg2);
|
|
4281
|
-
}
|
|
4282
|
-
return cache[arg2];
|
|
4283
|
-
};
|
|
4284
|
-
}
|
|
4413
|
+
const EMPTY_THEME$1 = {
|
|
4414
|
+
internal_cache: {}
|
|
4415
|
+
};
|
|
4285
4416
|
const properties = {
|
|
4286
4417
|
m: "margin",
|
|
4287
4418
|
p: "padding"
|
|
@@ -4300,22 +4431,24 @@ const aliases = {
|
|
|
4300
4431
|
paddingX: "px",
|
|
4301
4432
|
paddingY: "py"
|
|
4302
4433
|
};
|
|
4303
|
-
const
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4434
|
+
const CSS_PROPERTIES = {};
|
|
4435
|
+
for (const key in properties) {
|
|
4436
|
+
CSS_PROPERTIES[key] = [properties[key]];
|
|
4437
|
+
}
|
|
4438
|
+
for (const keyProperty in properties) {
|
|
4439
|
+
for (const keyDirection in directions) {
|
|
4440
|
+
const property = properties[keyProperty];
|
|
4441
|
+
const direction = directions[keyDirection];
|
|
4442
|
+
const value = Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
|
|
4443
|
+
CSS_PROPERTIES[keyProperty + keyDirection] = value;
|
|
4310
4444
|
}
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
const
|
|
4317
|
-
const
|
|
4318
|
-
const spacingKeys = [...marginKeys, ...paddingKeys];
|
|
4445
|
+
}
|
|
4446
|
+
for (const key in aliases) {
|
|
4447
|
+
CSS_PROPERTIES[key] = CSS_PROPERTIES[aliases[key]];
|
|
4448
|
+
}
|
|
4449
|
+
const marginKeys = /* @__PURE__ */ new Set(["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"]);
|
|
4450
|
+
const paddingKeys = /* @__PURE__ */ new Set(["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"]);
|
|
4451
|
+
const spacingKeys = /* @__PURE__ */ new Set([...marginKeys, ...paddingKeys]);
|
|
4319
4452
|
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
4320
4453
|
const themeSpacing = getPath(theme, themeKey, true) ?? defaultValue;
|
|
4321
4454
|
if (typeof themeSpacing === "number" || typeof themeSpacing === "string") {
|
|
@@ -4383,42 +4516,45 @@ function getValue(transformer, propValue) {
|
|
|
4383
4516
|
}
|
|
4384
4517
|
return transformer(propValue);
|
|
4385
4518
|
}
|
|
4386
|
-
|
|
4387
|
-
return (propValue) => cssProperties.reduce((acc, cssProperty) => {
|
|
4388
|
-
acc[cssProperty] = getValue(transformer, propValue);
|
|
4389
|
-
return acc;
|
|
4390
|
-
}, {});
|
|
4391
|
-
}
|
|
4392
|
-
function resolveCssProperty(props, keys2, prop, transformer) {
|
|
4393
|
-
if (!keys2.includes(prop)) {
|
|
4394
|
-
return null;
|
|
4395
|
-
}
|
|
4396
|
-
const cssProperties = getCssProperties(prop);
|
|
4397
|
-
const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
|
|
4398
|
-
const propValue = props[prop];
|
|
4399
|
-
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
4400
|
-
}
|
|
4519
|
+
const container = [""];
|
|
4401
4520
|
function style(props, keys2) {
|
|
4402
|
-
const
|
|
4403
|
-
|
|
4521
|
+
const theme = props.theme ?? EMPTY_THEME$1;
|
|
4522
|
+
const transformer = theme?.internal_cache?.unarySpacing ?? createUnarySpacing(theme);
|
|
4523
|
+
const result = {};
|
|
4524
|
+
for (const prop in props) {
|
|
4525
|
+
if (!keys2.has(prop)) {
|
|
4526
|
+
continue;
|
|
4527
|
+
}
|
|
4528
|
+
const cssProperties = CSS_PROPERTIES[prop] ?? (container[0] = prop, container);
|
|
4529
|
+
const propValue = props[prop];
|
|
4530
|
+
iterateBreakpoints(result, props.theme, propValue, (mediaKey, value) => {
|
|
4531
|
+
const target = mediaKey ? result[mediaKey] : result;
|
|
4532
|
+
for (let i = 0; i < cssProperties.length; i += 1) {
|
|
4533
|
+
target[cssProperties[i]] = getValue(transformer, value);
|
|
4534
|
+
}
|
|
4535
|
+
});
|
|
4536
|
+
}
|
|
4537
|
+
return result;
|
|
4404
4538
|
}
|
|
4405
|
-
function
|
|
4539
|
+
function marginFn(props) {
|
|
4406
4540
|
return style(props, marginKeys);
|
|
4407
4541
|
}
|
|
4408
|
-
|
|
4542
|
+
marginFn.propTypes = Array.from(marginKeys).reduce((obj, key) => {
|
|
4409
4543
|
obj[key] = responsivePropType;
|
|
4410
4544
|
return obj;
|
|
4411
4545
|
}, {});
|
|
4412
|
-
|
|
4413
|
-
|
|
4546
|
+
marginFn.filterProps = marginKeys;
|
|
4547
|
+
const margin = marginFn;
|
|
4548
|
+
function paddingFn(props) {
|
|
4414
4549
|
return style(props, paddingKeys);
|
|
4415
4550
|
}
|
|
4416
|
-
|
|
4551
|
+
paddingFn.propTypes = Array.from(paddingKeys).reduce((obj, key) => {
|
|
4417
4552
|
obj[key] = responsivePropType;
|
|
4418
4553
|
return obj;
|
|
4419
4554
|
}, {});
|
|
4420
|
-
|
|
4421
|
-
|
|
4555
|
+
paddingFn.filterProps = paddingKeys;
|
|
4556
|
+
const padding = paddingFn;
|
|
4557
|
+
Array.from(spacingKeys).reduce((obj, key) => {
|
|
4422
4558
|
obj[key] = responsivePropType;
|
|
4423
4559
|
return obj;
|
|
4424
4560
|
}, {});
|
|
@@ -4451,12 +4587,13 @@ function compose(...styles) {
|
|
|
4451
4587
|
return acc;
|
|
4452
4588
|
}, {});
|
|
4453
4589
|
const fn = (props) => {
|
|
4454
|
-
|
|
4590
|
+
const result = {};
|
|
4591
|
+
for (const prop in props) {
|
|
4455
4592
|
if (handlers2[prop]) {
|
|
4456
|
-
|
|
4593
|
+
fastDeepAssign(result, handlers2[prop](props));
|
|
4457
4594
|
}
|
|
4458
|
-
|
|
4459
|
-
|
|
4595
|
+
}
|
|
4596
|
+
return result;
|
|
4460
4597
|
};
|
|
4461
4598
|
fn.propTypes = styles.reduce((acc, style2) => Object.assign(acc, style2.propTypes), {});
|
|
4462
4599
|
fn.filterProps = styles.reduce((acc, style2) => acc.concat(style2.filterProps), []);
|
|
@@ -4595,6 +4732,7 @@ const backgroundColor = style$1({
|
|
|
4595
4732
|
transform: paletteTransform
|
|
4596
4733
|
});
|
|
4597
4734
|
compose(color$1, bgcolor, backgroundColor);
|
|
4735
|
+
const breakpointsValues = values;
|
|
4598
4736
|
function sizingTransform(value) {
|
|
4599
4737
|
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
4600
4738
|
}
|
|
@@ -4605,7 +4743,7 @@ const width = style$1({
|
|
|
4605
4743
|
const maxWidth = (props) => {
|
|
4606
4744
|
if (props.maxWidth !== void 0 && props.maxWidth !== null) {
|
|
4607
4745
|
const styleFromPropValue = (propValue) => {
|
|
4608
|
-
const breakpoint = props.theme?.breakpoints?.values?.[propValue] ||
|
|
4746
|
+
const breakpoint = props.theme?.breakpoints?.values?.[propValue] || breakpointsValues[propValue];
|
|
4609
4747
|
if (!breakpoint) {
|
|
4610
4748
|
return {
|
|
4611
4749
|
maxWidth: sizingTransform(propValue)
|
|
@@ -4943,68 +5081,24 @@ const defaultSxConfig = {
|
|
|
4943
5081
|
themeKey: "typography"
|
|
4944
5082
|
}
|
|
4945
5083
|
};
|
|
4946
|
-
|
|
4947
|
-
const allKeys = objects.reduce((keys2, object) => keys2.concat(Object.keys(object)), []);
|
|
4948
|
-
const union = new Set(allKeys);
|
|
4949
|
-
return objects.every((object) => union.size === Object.keys(object).length);
|
|
4950
|
-
}
|
|
4951
|
-
function callIfFn(maybeFn, arg2) {
|
|
4952
|
-
return typeof maybeFn === "function" ? maybeFn(arg2) : maybeFn;
|
|
4953
|
-
}
|
|
5084
|
+
const EMPTY_THEME = {};
|
|
4954
5085
|
function unstable_createStyleFunctionSx() {
|
|
4955
|
-
function
|
|
4956
|
-
|
|
4957
|
-
[prop]: val,
|
|
4958
|
-
theme
|
|
4959
|
-
};
|
|
4960
|
-
const options = config[prop];
|
|
4961
|
-
if (!options) {
|
|
4962
|
-
return {
|
|
4963
|
-
[prop]: val
|
|
4964
|
-
};
|
|
4965
|
-
}
|
|
4966
|
-
const {
|
|
4967
|
-
cssProperty = prop,
|
|
4968
|
-
themeKey,
|
|
4969
|
-
transform,
|
|
4970
|
-
style: style2
|
|
4971
|
-
} = options;
|
|
4972
|
-
if (val == null) {
|
|
5086
|
+
function styleFunctionSx2(props) {
|
|
5087
|
+
if (!props.sx) {
|
|
4973
5088
|
return null;
|
|
4974
5089
|
}
|
|
4975
|
-
if (themeKey === "typography" && val === "inherit") {
|
|
4976
|
-
return {
|
|
4977
|
-
[prop]: val
|
|
4978
|
-
};
|
|
4979
|
-
}
|
|
4980
|
-
const themeMapping = getPath(theme, themeKey) || {};
|
|
4981
|
-
if (style2) {
|
|
4982
|
-
return style2(props);
|
|
4983
|
-
}
|
|
4984
|
-
const styleFromPropValue = (propValueFinal) => {
|
|
4985
|
-
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
4986
|
-
if (propValueFinal === value && typeof propValueFinal === "string") {
|
|
4987
|
-
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
|
|
4988
|
-
}
|
|
4989
|
-
if (cssProperty === false) {
|
|
4990
|
-
return value;
|
|
4991
|
-
}
|
|
4992
|
-
return {
|
|
4993
|
-
[cssProperty]: value
|
|
4994
|
-
};
|
|
4995
|
-
};
|
|
4996
|
-
return handleBreakpoints(props, val, styleFromPropValue);
|
|
4997
|
-
}
|
|
4998
|
-
function styleFunctionSx2(props) {
|
|
4999
5090
|
const {
|
|
5000
5091
|
sx,
|
|
5001
|
-
theme =
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
return null;
|
|
5005
|
-
}
|
|
5092
|
+
theme = EMPTY_THEME,
|
|
5093
|
+
nested
|
|
5094
|
+
} = props;
|
|
5006
5095
|
const config = theme.unstable_sxConfig ?? defaultSxConfig;
|
|
5007
|
-
|
|
5096
|
+
const wrapper2 = {
|
|
5097
|
+
sx: null,
|
|
5098
|
+
theme,
|
|
5099
|
+
nested: true
|
|
5100
|
+
};
|
|
5101
|
+
function process(sxInput) {
|
|
5008
5102
|
let sxObject = sxInput;
|
|
5009
5103
|
if (typeof sxInput === "function") {
|
|
5010
5104
|
sxObject = sxInput(theme);
|
|
@@ -5014,43 +5108,94 @@ function unstable_createStyleFunctionSx() {
|
|
|
5014
5108
|
if (!sxObject) {
|
|
5015
5109
|
return null;
|
|
5016
5110
|
}
|
|
5017
|
-
const
|
|
5018
|
-
const
|
|
5019
|
-
|
|
5020
|
-
Object.keys(sxObject).forEach((styleKey) => {
|
|
5111
|
+
const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
|
|
5112
|
+
const css = createEmptyBreakpointObject(breakpoints);
|
|
5113
|
+
for (const styleKey in sxObject) {
|
|
5021
5114
|
const value = callIfFn(sxObject[styleKey], theme);
|
|
5022
|
-
if (value
|
|
5023
|
-
|
|
5024
|
-
if (config[styleKey]) {
|
|
5025
|
-
css = merge$1(css, getThemeValue(styleKey, value, theme, config));
|
|
5026
|
-
} else {
|
|
5027
|
-
const breakpointsValues = handleBreakpoints({
|
|
5028
|
-
theme
|
|
5029
|
-
}, value, (x) => ({
|
|
5030
|
-
[styleKey]: x
|
|
5031
|
-
}));
|
|
5032
|
-
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
5033
|
-
css[styleKey] = styleFunctionSx2({
|
|
5034
|
-
sx: value,
|
|
5035
|
-
theme
|
|
5036
|
-
});
|
|
5037
|
-
} else {
|
|
5038
|
-
css = merge$1(css, breakpointsValues);
|
|
5039
|
-
}
|
|
5040
|
-
}
|
|
5041
|
-
} else {
|
|
5042
|
-
css = merge$1(css, getThemeValue(styleKey, value, theme, config));
|
|
5043
|
-
}
|
|
5115
|
+
if (value === null || value === void 0) {
|
|
5116
|
+
continue;
|
|
5044
5117
|
}
|
|
5045
|
-
|
|
5046
|
-
|
|
5118
|
+
if (typeof value !== "object") {
|
|
5119
|
+
setThemeValue(css, styleKey, value, theme, config);
|
|
5120
|
+
continue;
|
|
5121
|
+
}
|
|
5122
|
+
if (config[styleKey]) {
|
|
5123
|
+
setThemeValue(css, styleKey, value, theme, config);
|
|
5124
|
+
continue;
|
|
5125
|
+
}
|
|
5126
|
+
if (hasBreakpoint(breakpoints, value)) {
|
|
5127
|
+
iterateBreakpoints(css, props.theme, value, (mediaKey, finalValue) => {
|
|
5128
|
+
css[mediaKey][styleKey] = finalValue;
|
|
5129
|
+
});
|
|
5130
|
+
} else {
|
|
5131
|
+
wrapper2.sx = value;
|
|
5132
|
+
css[styleKey] = styleFunctionSx2(wrapper2);
|
|
5133
|
+
}
|
|
5134
|
+
}
|
|
5135
|
+
if (!nested && theme.modularCssLayers) {
|
|
5136
|
+
return {
|
|
5137
|
+
"@layer sx": sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css))
|
|
5138
|
+
};
|
|
5139
|
+
}
|
|
5140
|
+
return sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css));
|
|
5047
5141
|
}
|
|
5048
|
-
return Array.isArray(sx) ? sx.map(
|
|
5142
|
+
return Array.isArray(sx) ? sx.map(process) : process(sx);
|
|
5049
5143
|
}
|
|
5144
|
+
styleFunctionSx2.filterProps = ["sx"];
|
|
5050
5145
|
return styleFunctionSx2;
|
|
5051
5146
|
}
|
|
5052
5147
|
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
5053
|
-
|
|
5148
|
+
function setThemeValue(css, prop, value, theme, config) {
|
|
5149
|
+
const options = config[prop];
|
|
5150
|
+
if (!options) {
|
|
5151
|
+
css[prop] = value;
|
|
5152
|
+
return;
|
|
5153
|
+
}
|
|
5154
|
+
if (value == null) {
|
|
5155
|
+
return;
|
|
5156
|
+
}
|
|
5157
|
+
const {
|
|
5158
|
+
themeKey
|
|
5159
|
+
} = options;
|
|
5160
|
+
if (themeKey === "typography" && value === "inherit") {
|
|
5161
|
+
css[prop] = value;
|
|
5162
|
+
return;
|
|
5163
|
+
}
|
|
5164
|
+
const {
|
|
5165
|
+
style: style2
|
|
5166
|
+
} = options;
|
|
5167
|
+
if (style2) {
|
|
5168
|
+
fastDeepAssign(css, style2({
|
|
5169
|
+
[prop]: value,
|
|
5170
|
+
theme
|
|
5171
|
+
}));
|
|
5172
|
+
return;
|
|
5173
|
+
}
|
|
5174
|
+
const {
|
|
5175
|
+
cssProperty = prop,
|
|
5176
|
+
transform
|
|
5177
|
+
} = options;
|
|
5178
|
+
const themeMapping = getPath(theme, themeKey);
|
|
5179
|
+
iterateBreakpoints(css, theme, value, (mediaKey, valueFinal) => {
|
|
5180
|
+
const finalValue = getStyleValue2(themeMapping, transform, valueFinal, prop);
|
|
5181
|
+
if (cssProperty === false) {
|
|
5182
|
+
if (mediaKey) {
|
|
5183
|
+
fastDeepAssign(css[mediaKey], finalValue);
|
|
5184
|
+
} else {
|
|
5185
|
+
fastDeepAssign(css, finalValue);
|
|
5186
|
+
}
|
|
5187
|
+
} else {
|
|
5188
|
+
if (mediaKey) {
|
|
5189
|
+
css[mediaKey][cssProperty] = finalValue;
|
|
5190
|
+
} else {
|
|
5191
|
+
css[cssProperty] = finalValue;
|
|
5192
|
+
}
|
|
5193
|
+
}
|
|
5194
|
+
});
|
|
5195
|
+
}
|
|
5196
|
+
function callIfFn(maybeFn, arg2) {
|
|
5197
|
+
return typeof maybeFn === "function" ? maybeFn(arg2) : maybeFn;
|
|
5198
|
+
}
|
|
5054
5199
|
function applyStyles(key, styles) {
|
|
5055
5200
|
const theme = this;
|
|
5056
5201
|
if (theme.vars) {
|
|
@@ -5111,67 +5256,19 @@ function createTheme$1(options = {}, ...args) {
|
|
|
5111
5256
|
theme: this
|
|
5112
5257
|
});
|
|
5113
5258
|
};
|
|
5259
|
+
muiTheme.internal_cache = {};
|
|
5114
5260
|
return muiTheme;
|
|
5115
5261
|
}
|
|
5116
|
-
function isObjectEmpty
|
|
5262
|
+
function isObjectEmpty(obj) {
|
|
5117
5263
|
return Object.keys(obj).length === 0;
|
|
5118
5264
|
}
|
|
5119
|
-
function
|
|
5265
|
+
function useThemeWithoutDefault(defaultTheme2 = null) {
|
|
5120
5266
|
const contextTheme = React.useContext(ThemeContext);
|
|
5121
|
-
return !contextTheme || isObjectEmpty
|
|
5267
|
+
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme2 : contextTheme;
|
|
5122
5268
|
}
|
|
5123
5269
|
const systemDefaultTheme$1 = createTheme$1();
|
|
5124
5270
|
function useTheme$1(defaultTheme2 = systemDefaultTheme$1) {
|
|
5125
|
-
return
|
|
5126
|
-
}
|
|
5127
|
-
const splitProps = (props) => {
|
|
5128
|
-
const result = {
|
|
5129
|
-
systemProps: {},
|
|
5130
|
-
otherProps: {}
|
|
5131
|
-
};
|
|
5132
|
-
const config = props?.theme?.unstable_sxConfig ?? defaultSxConfig;
|
|
5133
|
-
Object.keys(props).forEach((prop) => {
|
|
5134
|
-
if (config[prop]) {
|
|
5135
|
-
result.systemProps[prop] = props[prop];
|
|
5136
|
-
} else {
|
|
5137
|
-
result.otherProps[prop] = props[prop];
|
|
5138
|
-
}
|
|
5139
|
-
});
|
|
5140
|
-
return result;
|
|
5141
|
-
};
|
|
5142
|
-
function extendSxProp$1(props) {
|
|
5143
|
-
const {
|
|
5144
|
-
sx: inSx,
|
|
5145
|
-
...other
|
|
5146
|
-
} = props;
|
|
5147
|
-
const {
|
|
5148
|
-
systemProps,
|
|
5149
|
-
otherProps
|
|
5150
|
-
} = splitProps(other);
|
|
5151
|
-
let finalSx;
|
|
5152
|
-
if (Array.isArray(inSx)) {
|
|
5153
|
-
finalSx = [systemProps, ...inSx];
|
|
5154
|
-
} else if (typeof inSx === "function") {
|
|
5155
|
-
finalSx = (...args) => {
|
|
5156
|
-
const result = inSx(...args);
|
|
5157
|
-
if (!isPlainObject$1(result)) {
|
|
5158
|
-
return systemProps;
|
|
5159
|
-
}
|
|
5160
|
-
return {
|
|
5161
|
-
...systemProps,
|
|
5162
|
-
...result
|
|
5163
|
-
};
|
|
5164
|
-
};
|
|
5165
|
-
} else {
|
|
5166
|
-
finalSx = {
|
|
5167
|
-
...systemProps,
|
|
5168
|
-
...inSx
|
|
5169
|
-
};
|
|
5170
|
-
}
|
|
5171
|
-
return {
|
|
5172
|
-
...otherProps,
|
|
5173
|
-
sx: finalSx
|
|
5174
|
-
};
|
|
5271
|
+
return useThemeWithoutDefault(defaultTheme2);
|
|
5175
5272
|
}
|
|
5176
5273
|
const defaultGenerator = (componentName) => componentName;
|
|
5177
5274
|
const createClassNameGenerator = () => {
|
|
@@ -5282,6 +5379,12 @@ const systemDefaultTheme = createTheme$1();
|
|
|
5282
5379
|
function shouldForwardProp(prop) {
|
|
5283
5380
|
return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
|
|
5284
5381
|
}
|
|
5382
|
+
function shallowLayer(serialized, layerName) {
|
|
5383
|
+
if (layerName && serialized && typeof serialized === "object" && serialized.styles && !serialized.styles.startsWith("@layer")) {
|
|
5384
|
+
serialized.styles = `@layer ${layerName}{${String(serialized.styles)}}`;
|
|
5385
|
+
}
|
|
5386
|
+
return serialized;
|
|
5387
|
+
}
|
|
5285
5388
|
function defaultOverridesResolver(slot) {
|
|
5286
5389
|
if (!slot) {
|
|
5287
5390
|
return null;
|
|
@@ -5289,32 +5392,32 @@ function defaultOverridesResolver(slot) {
|
|
|
5289
5392
|
return (_props, styles) => styles[slot];
|
|
5290
5393
|
}
|
|
5291
5394
|
function attachTheme(props, themeId, defaultTheme2) {
|
|
5292
|
-
props.theme = isObjectEmpty(props.theme) ? defaultTheme2 : props.theme[themeId] || props.theme;
|
|
5395
|
+
props.theme = isObjectEmpty$1(props.theme) ? defaultTheme2 : props.theme[themeId] || props.theme;
|
|
5293
5396
|
}
|
|
5294
|
-
function processStyle(props, style2) {
|
|
5397
|
+
function processStyle(props, style2, layerName) {
|
|
5295
5398
|
const resolvedStyle = typeof style2 === "function" ? style2(props) : style2;
|
|
5296
5399
|
if (Array.isArray(resolvedStyle)) {
|
|
5297
|
-
return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle));
|
|
5400
|
+
return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle, layerName));
|
|
5298
5401
|
}
|
|
5299
5402
|
if (Array.isArray(resolvedStyle?.variants)) {
|
|
5300
5403
|
let rootStyle;
|
|
5301
5404
|
if (resolvedStyle.isProcessed) {
|
|
5302
|
-
rootStyle = resolvedStyle.style;
|
|
5405
|
+
rootStyle = layerName ? shallowLayer(resolvedStyle.style, layerName) : resolvedStyle.style;
|
|
5303
5406
|
} else {
|
|
5304
5407
|
const {
|
|
5305
5408
|
variants,
|
|
5306
5409
|
...otherStyles
|
|
5307
5410
|
} = resolvedStyle;
|
|
5308
|
-
rootStyle = otherStyles;
|
|
5411
|
+
rootStyle = layerName ? shallowLayer(internal_serializeStyles(otherStyles), layerName) : otherStyles;
|
|
5309
5412
|
}
|
|
5310
|
-
return processStyleVariants(props, resolvedStyle.variants, [rootStyle]);
|
|
5413
|
+
return processStyleVariants(props, resolvedStyle.variants, [rootStyle], layerName);
|
|
5311
5414
|
}
|
|
5312
5415
|
if (resolvedStyle?.isProcessed) {
|
|
5313
|
-
return resolvedStyle.style;
|
|
5416
|
+
return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle.style), layerName) : resolvedStyle.style;
|
|
5314
5417
|
}
|
|
5315
|
-
return resolvedStyle;
|
|
5418
|
+
return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle), layerName) : resolvedStyle;
|
|
5316
5419
|
}
|
|
5317
|
-
function processStyleVariants(props, variants, results = []) {
|
|
5420
|
+
function processStyleVariants(props, variants, results = [], layerName = void 0) {
|
|
5318
5421
|
let mergedState;
|
|
5319
5422
|
variantLoop: for (let i = 0; i < variants.length; i += 1) {
|
|
5320
5423
|
const variant = variants[i];
|
|
@@ -5340,9 +5443,9 @@ function processStyleVariants(props, variants, results = []) {
|
|
|
5340
5443
|
...props.ownerState,
|
|
5341
5444
|
ownerState: props.ownerState
|
|
5342
5445
|
};
|
|
5343
|
-
results.push(variant.style(mergedState));
|
|
5446
|
+
results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style(mergedState)), layerName) : variant.style(mergedState));
|
|
5344
5447
|
} else {
|
|
5345
|
-
results.push(variant.style);
|
|
5448
|
+
results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style), layerName) : variant.style);
|
|
5346
5449
|
}
|
|
5347
5450
|
}
|
|
5348
5451
|
return results;
|
|
@@ -5369,6 +5472,7 @@ function createStyled2(input = {}) {
|
|
|
5369
5472
|
overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot)),
|
|
5370
5473
|
...options
|
|
5371
5474
|
} = inputOptions;
|
|
5475
|
+
const layerName = componentName && componentName.startsWith("Mui") || !!componentSlot ? "components" : "custom";
|
|
5372
5476
|
const skipVariantsResolver = inputSkipVariantsResolver !== void 0 ? inputSkipVariantsResolver : (
|
|
5373
5477
|
// TODO v6: remove `Root` in the next major release
|
|
5374
5478
|
// For more details: https://github.com/mui/material-ui/pull/37908
|
|
@@ -5389,18 +5493,21 @@ function createStyled2(input = {}) {
|
|
|
5389
5493
|
...options
|
|
5390
5494
|
});
|
|
5391
5495
|
const transformStyle = (style2) => {
|
|
5392
|
-
if (
|
|
5496
|
+
if (style2.__emotion_real === style2) {
|
|
5497
|
+
return style2;
|
|
5498
|
+
}
|
|
5499
|
+
if (typeof style2 === "function") {
|
|
5393
5500
|
return function styleFunctionProcessor(props) {
|
|
5394
|
-
return processStyle(props, style2);
|
|
5501
|
+
return processStyle(props, style2, props.theme.modularCssLayers ? layerName : void 0);
|
|
5395
5502
|
};
|
|
5396
5503
|
}
|
|
5397
5504
|
if (isPlainObject$1(style2)) {
|
|
5398
5505
|
const serialized = preprocessStyles(style2);
|
|
5399
|
-
if (!serialized.variants) {
|
|
5400
|
-
return serialized.style;
|
|
5401
|
-
}
|
|
5402
5506
|
return function styleObjectProcessor(props) {
|
|
5403
|
-
|
|
5507
|
+
if (!serialized.variants) {
|
|
5508
|
+
return props.theme.modularCssLayers ? shallowLayer(serialized.style, layerName) : serialized.style;
|
|
5509
|
+
}
|
|
5510
|
+
return processStyle(props, serialized, props.theme.modularCssLayers ? layerName : void 0);
|
|
5404
5511
|
};
|
|
5405
5512
|
}
|
|
5406
5513
|
return style2;
|
|
@@ -5419,7 +5526,7 @@ function createStyled2(input = {}) {
|
|
|
5419
5526
|
}
|
|
5420
5527
|
const resolvedStyleOverrides = {};
|
|
5421
5528
|
for (const slotKey in styleOverrides) {
|
|
5422
|
-
resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey]);
|
|
5529
|
+
resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey], props.theme.modularCssLayers ? "theme" : void 0);
|
|
5423
5530
|
}
|
|
5424
5531
|
return overridesResolver(props, resolvedStyleOverrides);
|
|
5425
5532
|
});
|
|
@@ -5431,7 +5538,7 @@ function createStyled2(input = {}) {
|
|
|
5431
5538
|
if (!themeVariants) {
|
|
5432
5539
|
return null;
|
|
5433
5540
|
}
|
|
5434
|
-
return processStyleVariants(props, themeVariants);
|
|
5541
|
+
return processStyleVariants(props, themeVariants, [], props.theme.modularCssLayers ? "theme" : void 0);
|
|
5435
5542
|
});
|
|
5436
5543
|
}
|
|
5437
5544
|
if (!skipSx) {
|
|
@@ -5480,12 +5587,6 @@ function generateStyledLabel(componentName, componentSlot) {
|
|
|
5480
5587
|
}
|
|
5481
5588
|
return label;
|
|
5482
5589
|
}
|
|
5483
|
-
function isObjectEmpty(object) {
|
|
5484
|
-
for (const _ in object) {
|
|
5485
|
-
return false;
|
|
5486
|
-
}
|
|
5487
|
-
return true;
|
|
5488
|
-
}
|
|
5489
5590
|
function isStringTag(tag) {
|
|
5490
5591
|
return typeof tag === "string" && // 96 is one less than the char code
|
|
5491
5592
|
// for "a" so this is checking that
|
|
@@ -5498,7 +5599,7 @@ function lowercaseFirstLetter(string2) {
|
|
|
5498
5599
|
}
|
|
5499
5600
|
return string2.charAt(0).toLowerCase() + string2.slice(1);
|
|
5500
5601
|
}
|
|
5501
|
-
function resolveProps(defaultProps, props) {
|
|
5602
|
+
function resolveProps(defaultProps, props, mergeClassNameAndStyle = false) {
|
|
5502
5603
|
const output = {
|
|
5503
5604
|
...props
|
|
5504
5605
|
};
|
|
@@ -5524,10 +5625,23 @@ function resolveProps(defaultProps, props) {
|
|
|
5524
5625
|
for (const slotKey in defaultSlotProps) {
|
|
5525
5626
|
if (Object.prototype.hasOwnProperty.call(defaultSlotProps, slotKey)) {
|
|
5526
5627
|
const slotPropName = slotKey;
|
|
5527
|
-
|
|
5628
|
+
const defaultSlotPropValue = defaultSlotProps[slotPropName];
|
|
5629
|
+
const slotPropValue = slotProps[slotPropName];
|
|
5630
|
+
if (typeof defaultSlotPropValue === "function" || typeof slotPropValue === "function") {
|
|
5631
|
+
output[propName][slotPropName] = (...args) => resolveProps((typeof defaultSlotPropValue === "function" ? defaultSlotPropValue(...args) : defaultSlotPropValue) ?? {}, (typeof slotPropValue === "function" ? slotPropValue(...args) : slotPropValue) ?? {}, mergeClassNameAndStyle);
|
|
5632
|
+
} else {
|
|
5633
|
+
output[propName][slotPropName] = resolveProps(defaultSlotPropValue ?? {}, slotPropValue ?? {}, mergeClassNameAndStyle);
|
|
5634
|
+
}
|
|
5528
5635
|
}
|
|
5529
5636
|
}
|
|
5530
5637
|
}
|
|
5638
|
+
} else if (propName === "className" && mergeClassNameAndStyle && props.className !== void 0) {
|
|
5639
|
+
output.className = clsx(defaultProps?.className, props?.className);
|
|
5640
|
+
} else if (propName === "style" && mergeClassNameAndStyle && props.style) {
|
|
5641
|
+
output.style = {
|
|
5642
|
+
...defaultProps?.style,
|
|
5643
|
+
...props?.style
|
|
5644
|
+
};
|
|
5531
5645
|
} else if (output[propName] === void 0) {
|
|
5532
5646
|
output[propName] = defaultProps[propName];
|
|
5533
5647
|
}
|
|
@@ -5687,6 +5801,9 @@ function private_safeAlpha(color2, value, warning) {
|
|
|
5687
5801
|
try {
|
|
5688
5802
|
return alpha(color2, value);
|
|
5689
5803
|
} catch (error) {
|
|
5804
|
+
if (warning && true) {
|
|
5805
|
+
console.warn(warning);
|
|
5806
|
+
}
|
|
5690
5807
|
return color2;
|
|
5691
5808
|
}
|
|
5692
5809
|
}
|
|
@@ -5706,6 +5823,9 @@ function private_safeDarken(color2, coefficient, warning) {
|
|
|
5706
5823
|
try {
|
|
5707
5824
|
return darken(color2, coefficient);
|
|
5708
5825
|
} catch (error) {
|
|
5826
|
+
if (warning && true) {
|
|
5827
|
+
console.warn(warning);
|
|
5828
|
+
}
|
|
5709
5829
|
return color2;
|
|
5710
5830
|
}
|
|
5711
5831
|
}
|
|
@@ -5729,6 +5849,9 @@ function private_safeLighten(color2, coefficient, warning) {
|
|
|
5729
5849
|
try {
|
|
5730
5850
|
return lighten(color2, coefficient);
|
|
5731
5851
|
} catch (error) {
|
|
5852
|
+
if (warning && true) {
|
|
5853
|
+
console.warn(warning);
|
|
5854
|
+
}
|
|
5732
5855
|
return color2;
|
|
5733
5856
|
}
|
|
5734
5857
|
}
|
|
@@ -5781,10 +5904,10 @@ function getThemeProps(params) {
|
|
|
5781
5904
|
}
|
|
5782
5905
|
const config = theme.components[name2];
|
|
5783
5906
|
if (config.defaultProps) {
|
|
5784
|
-
return resolveProps(config.defaultProps, props);
|
|
5907
|
+
return resolveProps(config.defaultProps, props, theme.components.mergeClassNameAndStyle);
|
|
5785
5908
|
}
|
|
5786
5909
|
if (!config.styleOverrides && !config.variants) {
|
|
5787
|
-
return resolveProps(config, props);
|
|
5910
|
+
return resolveProps(config, props, theme.components.mergeClassNameAndStyle);
|
|
5788
5911
|
}
|
|
5789
5912
|
return props;
|
|
5790
5913
|
}
|
|
@@ -5834,9 +5957,14 @@ function createGetCssVar$1(prefix2 = "") {
|
|
|
5834
5957
|
};
|
|
5835
5958
|
return getCssVar;
|
|
5836
5959
|
}
|
|
5960
|
+
const prototypePollutingKeys = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
5837
5961
|
const assignNestedKeys = (obj, keys2, value, arrayKeys = []) => {
|
|
5838
5962
|
let temp = obj;
|
|
5839
|
-
keys2.
|
|
5963
|
+
for (let index2 = 0; index2 < keys2.length; index2 += 1) {
|
|
5964
|
+
const k = keys2[index2];
|
|
5965
|
+
if (prototypePollutingKeys.has(k)) {
|
|
5966
|
+
break;
|
|
5967
|
+
}
|
|
5840
5968
|
if (index2 === keys2.length - 1) {
|
|
5841
5969
|
if (Array.isArray(temp)) {
|
|
5842
5970
|
temp[Number(k)] = value;
|
|
@@ -5849,7 +5977,7 @@ const assignNestedKeys = (obj, keys2, value, arrayKeys = []) => {
|
|
|
5849
5977
|
}
|
|
5850
5978
|
temp = temp[k];
|
|
5851
5979
|
}
|
|
5852
|
-
}
|
|
5980
|
+
}
|
|
5853
5981
|
};
|
|
5854
5982
|
const walkObjectDeep = (obj, callback, shouldSkipPaths) => {
|
|
5855
5983
|
function recurse(object, parentKeys = [], arrayKeys = []) {
|
|
@@ -5916,7 +6044,8 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
5916
6044
|
const {
|
|
5917
6045
|
getSelector = defaultGetSelector2,
|
|
5918
6046
|
disableCssColorScheme,
|
|
5919
|
-
colorSchemeSelector: selector
|
|
6047
|
+
colorSchemeSelector: selector,
|
|
6048
|
+
enableContrastVars
|
|
5920
6049
|
} = parserConfig;
|
|
5921
6050
|
const {
|
|
5922
6051
|
colorSchemes = {},
|
|
@@ -6050,6 +6179,17 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
6050
6179
|
...finalCss
|
|
6051
6180
|
}), finalCss);
|
|
6052
6181
|
});
|
|
6182
|
+
if (enableContrastVars) {
|
|
6183
|
+
stylesheets.push({
|
|
6184
|
+
":root": {
|
|
6185
|
+
// use double underscore to indicate that these are private variables
|
|
6186
|
+
"--__l-threshold": "0.7",
|
|
6187
|
+
"--__l": "clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)",
|
|
6188
|
+
"--__a": "clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"
|
|
6189
|
+
// 0.87 is the default alpha value for black text.
|
|
6190
|
+
}
|
|
6191
|
+
});
|
|
6192
|
+
}
|
|
6053
6193
|
return stylesheets;
|
|
6054
6194
|
};
|
|
6055
6195
|
return {
|
|
@@ -6250,6 +6390,19 @@ function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
|
6250
6390
|
}
|
|
6251
6391
|
}
|
|
6252
6392
|
}
|
|
6393
|
+
function mixLightOrDark(colorSpace, intent, direction, shade, tonalOffset) {
|
|
6394
|
+
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
|
6395
|
+
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
|
6396
|
+
if (!intent[direction]) {
|
|
6397
|
+
if (intent.hasOwnProperty(shade)) {
|
|
6398
|
+
intent[direction] = intent[shade];
|
|
6399
|
+
} else if (direction === "light") {
|
|
6400
|
+
intent.light = `color-mix(in ${colorSpace}, ${intent.main}, #fff ${(tonalOffsetLight * 100).toFixed(0)}%)`;
|
|
6401
|
+
} else if (direction === "dark") {
|
|
6402
|
+
intent.dark = `color-mix(in ${colorSpace}, ${intent.main}, #000 ${(tonalOffsetDark * 100).toFixed(0)}%)`;
|
|
6403
|
+
}
|
|
6404
|
+
}
|
|
6405
|
+
}
|
|
6253
6406
|
function getDefaultPrimary(mode = "light") {
|
|
6254
6407
|
if (mode === "dark") {
|
|
6255
6408
|
return {
|
|
@@ -6335,11 +6488,15 @@ function getDefaultWarning(mode = "light") {
|
|
|
6335
6488
|
dark: orange[900]
|
|
6336
6489
|
};
|
|
6337
6490
|
}
|
|
6491
|
+
function contrastColor(background) {
|
|
6492
|
+
return `oklch(from ${background} var(--__l) 0 h / var(--__a))`;
|
|
6493
|
+
}
|
|
6338
6494
|
function createPalette(palette) {
|
|
6339
6495
|
const {
|
|
6340
6496
|
mode = "light",
|
|
6341
6497
|
contrastThreshold = 3,
|
|
6342
6498
|
tonalOffset = 0.2,
|
|
6499
|
+
colorSpace,
|
|
6343
6500
|
...other
|
|
6344
6501
|
} = palette;
|
|
6345
6502
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
@@ -6349,6 +6506,9 @@ function createPalette(palette) {
|
|
|
6349
6506
|
const success = palette.success || getDefaultSuccess(mode);
|
|
6350
6507
|
const warning = palette.warning || getDefaultWarning(mode);
|
|
6351
6508
|
function getContrastText(background) {
|
|
6509
|
+
if (colorSpace) {
|
|
6510
|
+
return contrastColor(background);
|
|
6511
|
+
}
|
|
6352
6512
|
const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
|
|
6353
6513
|
{
|
|
6354
6514
|
const contrast = getContrastRatio(background, contrastText);
|
|
@@ -6391,8 +6551,13 @@ const theme2 = createTheme({ palette: {
|
|
|
6391
6551
|
primary: { main: green[500] },
|
|
6392
6552
|
} });`);
|
|
6393
6553
|
}
|
|
6394
|
-
|
|
6395
|
-
|
|
6554
|
+
if (colorSpace) {
|
|
6555
|
+
mixLightOrDark(colorSpace, color2, "light", lightShade, tonalOffset);
|
|
6556
|
+
mixLightOrDark(colorSpace, color2, "dark", darkShade, tonalOffset);
|
|
6557
|
+
} else {
|
|
6558
|
+
addLightOrDark(color2, "light", lightShade, tonalOffset);
|
|
6559
|
+
addLightOrDark(color2, "dark", darkShade, tonalOffset);
|
|
6560
|
+
}
|
|
6396
6561
|
if (!color2.contrastText) {
|
|
6397
6562
|
color2.contrastText = getContrastText(color2.main);
|
|
6398
6563
|
}
|
|
@@ -6468,6 +6633,44 @@ const theme2 = createTheme({ palette: {
|
|
|
6468
6633
|
}, other);
|
|
6469
6634
|
return paletteOutput;
|
|
6470
6635
|
}
|
|
6636
|
+
const focusVisibleOffsetVar = "--_focusVisible-offset";
|
|
6637
|
+
const focusVisibleBehaviorVar = "--_focusVisible-behavior";
|
|
6638
|
+
const focusVisibleShadowVar = "--_focusVisible-shadow";
|
|
6639
|
+
const offsetValue = `var(${focusVisibleOffsetVar}, 1)`;
|
|
6640
|
+
const behaviorValue = `var(${focusVisibleBehaviorVar}, )`;
|
|
6641
|
+
function mergeFocusVisibleInput(optionsFocusVisible, args) {
|
|
6642
|
+
return args.reduce((acc, arg2) => arg2 && "focusVisible" in arg2 ? deepmerge(acc, {
|
|
6643
|
+
focusVisible: arg2.focusVisible
|
|
6644
|
+
}) : acc, {
|
|
6645
|
+
focusVisible: optionsFocusVisible
|
|
6646
|
+
}).focusVisible;
|
|
6647
|
+
}
|
|
6648
|
+
function isResolvedFocusVisible(input) {
|
|
6649
|
+
return input != null && typeof input === "object" && typeof input.outlineOffset === "string" && input.outlineOffset.includes(focusVisibleOffsetVar);
|
|
6650
|
+
}
|
|
6651
|
+
function resolveFocusVisible(input, outlineColor2) {
|
|
6652
|
+
return wireFocusVisibleVars({
|
|
6653
|
+
outlineStyle: "solid",
|
|
6654
|
+
outlineColor: outlineColor2,
|
|
6655
|
+
outlineWidth: 2,
|
|
6656
|
+
outlineOffset: 2,
|
|
6657
|
+
// invisible shadow for parent component with solid background (AppBar, Snackbar, Alert) can control the ring color.
|
|
6658
|
+
boxShadow: `var(${focusVisibleShadowVar}, 0 0)`,
|
|
6659
|
+
...input === true ? null : input
|
|
6660
|
+
});
|
|
6661
|
+
}
|
|
6662
|
+
function wireFocusVisibleVars(resolved) {
|
|
6663
|
+
const offset2 = resolved.outlineOffset ?? 0;
|
|
6664
|
+
if (typeof offset2 !== "string" || !offset2.includes(focusVisibleOffsetVar)) {
|
|
6665
|
+
const offsetPx = typeof offset2 === "number" ? `${offset2}px` : offset2;
|
|
6666
|
+
resolved.outlineOffset = `calc(${offsetValue} * ${offsetPx})`;
|
|
6667
|
+
}
|
|
6668
|
+
const standaloneBoxShadows = /* @__PURE__ */ new Set(["none", "initial", "inherit", "unset", "revert", "revert-layer"]);
|
|
6669
|
+
if (typeof resolved.boxShadow === "string" && !standaloneBoxShadows.has(resolved.boxShadow.trim().toLowerCase()) && !/\binset\b/.test(resolved.boxShadow) && !resolved.boxShadow.includes(focusVisibleBehaviorVar)) {
|
|
6670
|
+
resolved.boxShadow = `${behaviorValue} ${resolved.boxShadow}`;
|
|
6671
|
+
}
|
|
6672
|
+
return resolved;
|
|
6673
|
+
}
|
|
6471
6674
|
function prepareTypographyVars(typography) {
|
|
6472
6675
|
const vars = {};
|
|
6473
6676
|
const entries = Object.entries(typography);
|
|
@@ -6589,6 +6792,8 @@ function createShadow(...px) {
|
|
|
6589
6792
|
return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",");
|
|
6590
6793
|
}
|
|
6591
6794
|
const shadows = ["none", createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
|
|
6795
|
+
const DEFAULT_TRANSITION_PROPS = ["all"];
|
|
6796
|
+
const EMPTY_OPTIONS = {};
|
|
6592
6797
|
const easing = {
|
|
6593
6798
|
// This is the most common easing curve.
|
|
6594
6799
|
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
@@ -6624,15 +6829,19 @@ function getAutoHeightDuration(height2) {
|
|
|
6624
6829
|
return Math.min(Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10), 3e3);
|
|
6625
6830
|
}
|
|
6626
6831
|
function createTransitions(inputTransitions) {
|
|
6832
|
+
const transitions = {
|
|
6833
|
+
...inputTransitions
|
|
6834
|
+
};
|
|
6835
|
+
delete transitions.reducedMotion;
|
|
6627
6836
|
const mergedEasing = {
|
|
6628
6837
|
...easing,
|
|
6629
|
-
...
|
|
6838
|
+
...transitions.easing
|
|
6630
6839
|
};
|
|
6631
6840
|
const mergedDuration = {
|
|
6632
6841
|
...duration,
|
|
6633
|
-
...
|
|
6842
|
+
...transitions.duration
|
|
6634
6843
|
};
|
|
6635
|
-
const
|
|
6844
|
+
const createTransitionValue = (props = DEFAULT_TRANSITION_PROPS, options = EMPTY_OPTIONS) => {
|
|
6636
6845
|
const {
|
|
6637
6846
|
duration: durationOption = mergedDuration.standard,
|
|
6638
6847
|
easing: easingOption = mergedEasing.easeInOut,
|
|
@@ -6663,14 +6872,22 @@ function createTransitions(inputTransitions) {
|
|
|
6663
6872
|
}
|
|
6664
6873
|
return (Array.isArray(props) ? props : [props]).map((animatedProp) => `${animatedProp} ${typeof durationOption === "string" ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === "string" ? delay : formatMs(delay)}`).join(",");
|
|
6665
6874
|
};
|
|
6875
|
+
const create2 = transitions.create ?? createTransitionValue;
|
|
6666
6876
|
return {
|
|
6667
6877
|
getAutoHeightDuration,
|
|
6668
6878
|
create: create2,
|
|
6669
|
-
...
|
|
6879
|
+
...transitions,
|
|
6670
6880
|
easing: mergedEasing,
|
|
6671
6881
|
duration: mergedDuration
|
|
6672
6882
|
};
|
|
6673
6883
|
}
|
|
6884
|
+
const EMPTY_MOTION = {};
|
|
6885
|
+
function createMotion(inputMotion = EMPTY_MOTION) {
|
|
6886
|
+
return {
|
|
6887
|
+
reducedMotion: "never",
|
|
6888
|
+
...inputMotion
|
|
6889
|
+
};
|
|
6890
|
+
}
|
|
6674
6891
|
const zIndex = {
|
|
6675
6892
|
mobileStepper: 1e3,
|
|
6676
6893
|
fab: 1050,
|
|
@@ -6692,7 +6909,7 @@ function stringifyTheme(baseTheme = {}) {
|
|
|
6692
6909
|
const array = Object.entries(object);
|
|
6693
6910
|
for (let index2 = 0; index2 < array.length; index2++) {
|
|
6694
6911
|
const [key, value] = array[index2];
|
|
6695
|
-
if (!isSerializable(value) || key.startsWith("unstable_")) {
|
|
6912
|
+
if (!isSerializable(value) || key.startsWith("unstable_") || key.startsWith("internal_")) {
|
|
6696
6913
|
delete object[key];
|
|
6697
6914
|
} else if (isPlainObject$1(value)) {
|
|
6698
6915
|
object[key] = {
|
|
@@ -6708,19 +6925,70 @@ function stringifyTheme(baseTheme = {}) {
|
|
|
6708
6925
|
const theme = ${JSON.stringify(serializableTheme, null, 2)};
|
|
6709
6926
|
|
|
6710
6927
|
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
6928
|
+
theme.motion = { reducedMotion: 'never', ...theme.motion };
|
|
6711
6929
|
theme.transitions = createTransitions(theme.transitions || {});
|
|
6712
6930
|
|
|
6713
6931
|
export default theme;`;
|
|
6714
6932
|
}
|
|
6933
|
+
function coefficientToPercentage(coefficient) {
|
|
6934
|
+
if (typeof coefficient === "number") {
|
|
6935
|
+
return `${(coefficient * 100).toFixed(0)}%`;
|
|
6936
|
+
}
|
|
6937
|
+
return `calc((${coefficient}) * 100%)`;
|
|
6938
|
+
}
|
|
6939
|
+
const parseAddition = (str) => {
|
|
6940
|
+
if (!Number.isNaN(+str)) {
|
|
6941
|
+
return +str;
|
|
6942
|
+
}
|
|
6943
|
+
const numbers = str.match(/\d*\.?\d+/g);
|
|
6944
|
+
if (!numbers) {
|
|
6945
|
+
return 0;
|
|
6946
|
+
}
|
|
6947
|
+
let sum = 0;
|
|
6948
|
+
for (let i = 0; i < numbers.length; i += 1) {
|
|
6949
|
+
sum += +numbers[i];
|
|
6950
|
+
}
|
|
6951
|
+
return sum;
|
|
6952
|
+
};
|
|
6953
|
+
function attachColorManipulators(theme) {
|
|
6954
|
+
Object.assign(theme, {
|
|
6955
|
+
alpha(color2, coefficient) {
|
|
6956
|
+
const obj = this || theme;
|
|
6957
|
+
if (obj.colorSpace) {
|
|
6958
|
+
return `oklch(from ${color2} l c h / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
|
|
6959
|
+
}
|
|
6960
|
+
if (obj.vars) {
|
|
6961
|
+
return `rgba(${color2.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g, "var(--$1Channel)")} / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
|
|
6962
|
+
}
|
|
6963
|
+
return alpha(color2, parseAddition(coefficient));
|
|
6964
|
+
},
|
|
6965
|
+
lighten(color2, coefficient) {
|
|
6966
|
+
const obj = this || theme;
|
|
6967
|
+
if (obj.colorSpace) {
|
|
6968
|
+
return `color-mix(in ${obj.colorSpace}, ${color2}, #fff ${coefficientToPercentage(coefficient)})`;
|
|
6969
|
+
}
|
|
6970
|
+
return lighten(color2, coefficient);
|
|
6971
|
+
},
|
|
6972
|
+
darken(color2, coefficient) {
|
|
6973
|
+
const obj = this || theme;
|
|
6974
|
+
if (obj.colorSpace) {
|
|
6975
|
+
return `color-mix(in ${obj.colorSpace}, ${color2}, #000 ${coefficientToPercentage(coefficient)})`;
|
|
6976
|
+
}
|
|
6977
|
+
return darken(color2, coefficient);
|
|
6978
|
+
}
|
|
6979
|
+
});
|
|
6980
|
+
}
|
|
6715
6981
|
function createThemeNoVars(options = {}, ...args) {
|
|
6716
6982
|
const {
|
|
6717
6983
|
breakpoints: breakpointsInput,
|
|
6718
6984
|
mixins: mixinsInput = {},
|
|
6719
6985
|
spacing: spacingInput,
|
|
6720
6986
|
palette: paletteInput = {},
|
|
6987
|
+
motion: motionInput = {},
|
|
6721
6988
|
transitions: transitionsInput = {},
|
|
6722
6989
|
typography: typographyInput = {},
|
|
6723
6990
|
shape: shapeInput,
|
|
6991
|
+
colorSpace,
|
|
6724
6992
|
...other
|
|
6725
6993
|
} = options;
|
|
6726
6994
|
if (options.vars && // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
|
|
@@ -6728,7 +6996,10 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
6728
6996
|
options.generateThemeVars === void 0) {
|
|
6729
6997
|
throw new Error("MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.");
|
|
6730
6998
|
}
|
|
6731
|
-
const palette = createPalette(
|
|
6999
|
+
const palette = createPalette({
|
|
7000
|
+
...paletteInput,
|
|
7001
|
+
colorSpace
|
|
7002
|
+
});
|
|
6732
7003
|
const systemTheme = createTheme$1(options);
|
|
6733
7004
|
let muiTheme = deepmerge(systemTheme, {
|
|
6734
7005
|
mixins: createMixins(systemTheme.breakpoints, mixinsInput),
|
|
@@ -6736,6 +7007,7 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
6736
7007
|
// Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
|
|
6737
7008
|
shadows: shadows.slice(),
|
|
6738
7009
|
typography: createTypography(palette, typographyInput),
|
|
7010
|
+
motion: createMotion(motionInput),
|
|
6739
7011
|
transitions: createTransitions(transitionsInput),
|
|
6740
7012
|
zIndex: {
|
|
6741
7013
|
...zIndex
|
|
@@ -6743,6 +7015,10 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
6743
7015
|
});
|
|
6744
7016
|
muiTheme = deepmerge(muiTheme, other);
|
|
6745
7017
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
7018
|
+
delete muiTheme.transitions.reducedMotion;
|
|
7019
|
+
if (muiTheme.focusVisible != null && muiTheme.focusVisible !== false) {
|
|
7020
|
+
muiTheme.focusVisible = resolveFocusVisible(muiTheme.focusVisible, muiTheme.palette.primary.main);
|
|
7021
|
+
}
|
|
6746
7022
|
{
|
|
6747
7023
|
const stateClasses = ["active", "checked", "completed", "disabled", "error", "expanded", "focused", "focusVisible", "required", "selected"];
|
|
6748
7024
|
const traverse = (node2, component) => {
|
|
@@ -6780,6 +7056,7 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
6780
7056
|
});
|
|
6781
7057
|
};
|
|
6782
7058
|
muiTheme.toRuntimeSource = stringifyTheme;
|
|
7059
|
+
attachColorManipulators(muiTheme);
|
|
6783
7060
|
return muiTheme;
|
|
6784
7061
|
}
|
|
6785
7062
|
function getOverlayAlpha(elevation) {
|
|
@@ -6817,9 +7094,13 @@ function createColorScheme(options) {
|
|
|
6817
7094
|
// need to cast to avoid module augmentation test
|
|
6818
7095
|
opacity,
|
|
6819
7096
|
overlays,
|
|
6820
|
-
|
|
7097
|
+
colorSpace,
|
|
7098
|
+
...other
|
|
6821
7099
|
} = options;
|
|
6822
|
-
const palette = createPalette(
|
|
7100
|
+
const palette = createPalette({
|
|
7101
|
+
...paletteInput,
|
|
7102
|
+
colorSpace
|
|
7103
|
+
});
|
|
6823
7104
|
return {
|
|
6824
7105
|
palette,
|
|
6825
7106
|
opacity: {
|
|
@@ -6827,11 +7108,14 @@ function createColorScheme(options) {
|
|
|
6827
7108
|
...opacity
|
|
6828
7109
|
},
|
|
6829
7110
|
overlays: overlays || getOverlays(palette.mode),
|
|
6830
|
-
...
|
|
7111
|
+
...other
|
|
6831
7112
|
};
|
|
6832
7113
|
}
|
|
6833
7114
|
function shouldSkipGeneratingVar(keys2) {
|
|
6834
|
-
return
|
|
7115
|
+
return keys2[0] === "motion" || // Keep `focusVisible` inline: its values reference the per-component private vars
|
|
7116
|
+
// (`--_focusVisible-offset`/`-behavior`). Hoisted to a `:root` var they resolve where those
|
|
7117
|
+
// vars are unset, silently breaking the inner-ring inset.
|
|
7118
|
+
keys2[0] === "focusVisible" || !!keys2[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys2[0].match(/sxConfig$/) || // ends with sxConfig
|
|
6835
7119
|
keys2[0] === "palette" && !!keys2[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
|
|
6836
7120
|
}
|
|
6837
7121
|
const excludeVariablesFromRoot = (cssVarPrefix) => [...[...Array(25)].map((_, index2) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}overlays-${index2}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkColor`];
|
|
@@ -6934,7 +7218,7 @@ const silent = (fn) => {
|
|
|
6934
7218
|
return void 0;
|
|
6935
7219
|
};
|
|
6936
7220
|
const createGetCssVar = (cssVarPrefix = "mui") => createGetCssVar$1(cssVarPrefix);
|
|
6937
|
-
function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
7221
|
+
function attachColorScheme$1(colorSpace, colorSchemes, scheme, restTheme, colorScheme) {
|
|
6938
7222
|
if (!scheme) {
|
|
6939
7223
|
return void 0;
|
|
6940
7224
|
}
|
|
@@ -6946,7 +7230,8 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
|
6946
7230
|
palette: {
|
|
6947
7231
|
mode,
|
|
6948
7232
|
...scheme?.palette
|
|
6949
|
-
}
|
|
7233
|
+
},
|
|
7234
|
+
colorSpace
|
|
6950
7235
|
});
|
|
6951
7236
|
return void 0;
|
|
6952
7237
|
}
|
|
@@ -6958,7 +7243,8 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
|
6958
7243
|
palette: {
|
|
6959
7244
|
mode,
|
|
6960
7245
|
...scheme?.palette
|
|
6961
|
-
}
|
|
7246
|
+
},
|
|
7247
|
+
colorSpace
|
|
6962
7248
|
});
|
|
6963
7249
|
colorSchemes[colorScheme] = {
|
|
6964
7250
|
...scheme,
|
|
@@ -6979,6 +7265,7 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
6979
7265
|
defaultColorScheme: defaultColorSchemeInput,
|
|
6980
7266
|
disableCssColorScheme = false,
|
|
6981
7267
|
cssVarPrefix = "mui",
|
|
7268
|
+
nativeColor = false,
|
|
6982
7269
|
shouldSkipGeneratingVar: shouldSkipGeneratingVar$1 = shouldSkipGeneratingVar,
|
|
6983
7270
|
colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? "media" : void 0,
|
|
6984
7271
|
rootSelector = ":root",
|
|
@@ -7003,12 +7290,16 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
7003
7290
|
if (!defaultScheme) {
|
|
7004
7291
|
throw new Error(`MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid.`);
|
|
7005
7292
|
}
|
|
7006
|
-
|
|
7293
|
+
let colorSpace;
|
|
7294
|
+
if (nativeColor) {
|
|
7295
|
+
colorSpace = "oklch";
|
|
7296
|
+
}
|
|
7297
|
+
const muiTheme = attachColorScheme$1(colorSpace, colorSchemes, defaultScheme, input, defaultColorScheme);
|
|
7007
7298
|
if (builtInLight && !colorSchemes.light) {
|
|
7008
|
-
attachColorScheme$1(colorSchemes, builtInLight, void 0, "light");
|
|
7299
|
+
attachColorScheme$1(colorSpace, colorSchemes, builtInLight, void 0, "light");
|
|
7009
7300
|
}
|
|
7010
7301
|
if (builtInDark && !colorSchemes.dark) {
|
|
7011
|
-
attachColorScheme$1(colorSchemes, builtInDark, void 0, "dark");
|
|
7302
|
+
attachColorScheme$1(colorSpace, colorSchemes, builtInDark, void 0, "dark");
|
|
7012
7303
|
}
|
|
7013
7304
|
let theme = {
|
|
7014
7305
|
defaultColorScheme,
|
|
@@ -7040,12 +7331,28 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
7040
7331
|
setColor(palette.common, "background", "#000");
|
|
7041
7332
|
setColor(palette.common, "onBackground", "#fff");
|
|
7042
7333
|
}
|
|
7334
|
+
function colorMix(method, color2, coefficient) {
|
|
7335
|
+
if (colorSpace) {
|
|
7336
|
+
let mixer;
|
|
7337
|
+
if (method === private_safeAlpha) {
|
|
7338
|
+
mixer = `transparent ${((1 - coefficient) * 100).toFixed(0)}%`;
|
|
7339
|
+
}
|
|
7340
|
+
if (method === private_safeDarken) {
|
|
7341
|
+
mixer = `#000 ${(coefficient * 100).toFixed(0)}%`;
|
|
7342
|
+
}
|
|
7343
|
+
if (method === private_safeLighten) {
|
|
7344
|
+
mixer = `#fff ${(coefficient * 100).toFixed(0)}%`;
|
|
7345
|
+
}
|
|
7346
|
+
return `color-mix(in ${colorSpace}, ${color2}, ${mixer})`;
|
|
7347
|
+
}
|
|
7348
|
+
return method(color2, coefficient);
|
|
7349
|
+
}
|
|
7043
7350
|
assignNode(palette, ["Alert", "AppBar", "Avatar", "Button", "Chip", "FilledInput", "LinearProgress", "Skeleton", "Slider", "SnackbarContent", "SpeedDialAction", "StepConnector", "StepContent", "Switch", "TableCell", "Tooltip"]);
|
|
7044
7351
|
if (palette.mode === "light") {
|
|
7045
|
-
setColor(palette.Alert, "errorColor", private_safeDarken(palette.error.light, 0.6));
|
|
7046
|
-
setColor(palette.Alert, "infoColor", private_safeDarken(palette.info.light, 0.6));
|
|
7047
|
-
setColor(palette.Alert, "successColor", private_safeDarken(palette.success.light, 0.6));
|
|
7048
|
-
setColor(palette.Alert, "warningColor", private_safeDarken(palette.warning.light, 0.6));
|
|
7352
|
+
setColor(palette.Alert, "errorColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
|
|
7353
|
+
setColor(palette.Alert, "infoColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
|
|
7354
|
+
setColor(palette.Alert, "successColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
|
|
7355
|
+
setColor(palette.Alert, "warningColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
|
|
7049
7356
|
setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-main"));
|
|
7050
7357
|
setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-main"));
|
|
7051
7358
|
setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-main"));
|
|
@@ -7054,10 +7361,10 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
7054
7361
|
setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.main)));
|
|
7055
7362
|
setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.main)));
|
|
7056
7363
|
setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.main)));
|
|
7057
|
-
setColor(palette.Alert, "errorStandardBg", private_safeLighten(palette.error.light, 0.9));
|
|
7058
|
-
setColor(palette.Alert, "infoStandardBg", private_safeLighten(palette.info.light, 0.9));
|
|
7059
|
-
setColor(palette.Alert, "successStandardBg", private_safeLighten(palette.success.light, 0.9));
|
|
7060
|
-
setColor(palette.Alert, "warningStandardBg", private_safeLighten(palette.warning.light, 0.9));
|
|
7364
|
+
setColor(palette.Alert, "errorStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
|
|
7365
|
+
setColor(palette.Alert, "infoStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
|
|
7366
|
+
setColor(palette.Alert, "successStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
|
|
7367
|
+
setColor(palette.Alert, "warningStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
|
|
7061
7368
|
setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
|
|
7062
7369
|
setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
|
|
7063
7370
|
setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
|
|
@@ -7072,41 +7379,41 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
7072
7379
|
setColor(palette.FilledInput, "bg", "rgba(0, 0, 0, 0.06)");
|
|
7073
7380
|
setColor(palette.FilledInput, "hoverBg", "rgba(0, 0, 0, 0.09)");
|
|
7074
7381
|
setColor(palette.FilledInput, "disabledBg", "rgba(0, 0, 0, 0.12)");
|
|
7075
|
-
setColor(palette.LinearProgress, "primaryBg", private_safeLighten(palette.primary.main, 0.62));
|
|
7076
|
-
setColor(palette.LinearProgress, "secondaryBg", private_safeLighten(palette.secondary.main, 0.62));
|
|
7077
|
-
setColor(palette.LinearProgress, "errorBg", private_safeLighten(palette.error.main, 0.62));
|
|
7078
|
-
setColor(palette.LinearProgress, "infoBg", private_safeLighten(palette.info.main, 0.62));
|
|
7079
|
-
setColor(palette.LinearProgress, "successBg", private_safeLighten(palette.success.main, 0.62));
|
|
7080
|
-
setColor(palette.LinearProgress, "warningBg", private_safeLighten(palette.warning.main, 0.62));
|
|
7081
|
-
setColor(palette.Skeleton, "bg", `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.11)`);
|
|
7082
|
-
setColor(palette.Slider, "primaryTrack", private_safeLighten(palette.primary.main, 0.62));
|
|
7083
|
-
setColor(palette.Slider, "secondaryTrack", private_safeLighten(palette.secondary.main, 0.62));
|
|
7084
|
-
setColor(palette.Slider, "errorTrack", private_safeLighten(palette.error.main, 0.62));
|
|
7085
|
-
setColor(palette.Slider, "infoTrack", private_safeLighten(palette.info.main, 0.62));
|
|
7086
|
-
setColor(palette.Slider, "successTrack", private_safeLighten(palette.success.main, 0.62));
|
|
7087
|
-
setColor(palette.Slider, "warningTrack", private_safeLighten(palette.warning.main, 0.62));
|
|
7088
|
-
const snackbarContentBackground = private_safeEmphasize(palette.background.default, 0.8);
|
|
7382
|
+
setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
|
|
7383
|
+
setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
|
|
7384
|
+
setColor(palette.LinearProgress, "errorBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
|
|
7385
|
+
setColor(palette.LinearProgress, "infoBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
|
|
7386
|
+
setColor(palette.LinearProgress, "successBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
|
|
7387
|
+
setColor(palette.LinearProgress, "warningBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.62));
|
|
7388
|
+
setColor(palette.Skeleton, "bg", colorSpace ? colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-text-primary") : palette.text.primary, 0.11) : `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.11)`);
|
|
7389
|
+
setColor(palette.Slider, "primaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
|
|
7390
|
+
setColor(palette.Slider, "secondaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
|
|
7391
|
+
setColor(palette.Slider, "errorTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
|
|
7392
|
+
setColor(palette.Slider, "infoTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
|
|
7393
|
+
setColor(palette.Slider, "successTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
|
|
7394
|
+
setColor(palette.Slider, "warningTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
|
|
7395
|
+
const snackbarContentBackground = colorSpace ? colorMix(private_safeDarken, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.6825) : private_safeEmphasize(palette.background.default, 0.8);
|
|
7089
7396
|
setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
|
|
7090
|
-
setColor(palette.SnackbarContent, "color", silent(() => palette.getContrastText(snackbarContentBackground)));
|
|
7397
|
+
setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? dark.text.primary : palette.getContrastText(snackbarContentBackground)));
|
|
7091
7398
|
setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
|
|
7092
7399
|
setColor(palette.StepConnector, "border", setCssVarColor("palette-grey-400"));
|
|
7093
7400
|
setColor(palette.StepContent, "border", setCssVarColor("palette-grey-400"));
|
|
7094
7401
|
setColor(palette.Switch, "defaultColor", setCssVarColor("palette-common-white"));
|
|
7095
7402
|
setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-100"));
|
|
7096
|
-
setColor(palette.Switch, "primaryDisabledColor", private_safeLighten(palette.primary.main, 0.62));
|
|
7097
|
-
setColor(palette.Switch, "secondaryDisabledColor", private_safeLighten(palette.secondary.main, 0.62));
|
|
7098
|
-
setColor(palette.Switch, "errorDisabledColor", private_safeLighten(palette.error.main, 0.62));
|
|
7099
|
-
setColor(palette.Switch, "infoDisabledColor", private_safeLighten(palette.info.main, 0.62));
|
|
7100
|
-
setColor(palette.Switch, "successDisabledColor", private_safeLighten(palette.success.main, 0.62));
|
|
7101
|
-
setColor(palette.Switch, "warningDisabledColor", private_safeLighten(palette.warning.main, 0.62));
|
|
7102
|
-
setColor(palette.TableCell, "border", private_safeLighten
|
|
7103
|
-
setColor(palette.Tooltip, "bg", private_safeAlpha(palette.grey[700], 0.92));
|
|
7403
|
+
setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
|
|
7404
|
+
setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
|
|
7405
|
+
setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
|
|
7406
|
+
setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
|
|
7407
|
+
setColor(palette.Switch, "successDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
|
|
7408
|
+
setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
|
|
7409
|
+
setColor(palette.TableCell, "border", colorMix(private_safeLighten, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.88));
|
|
7410
|
+
setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
|
|
7104
7411
|
}
|
|
7105
7412
|
if (palette.mode === "dark") {
|
|
7106
|
-
setColor(palette.Alert, "errorColor", private_safeLighten(palette.error.light, 0.6));
|
|
7107
|
-
setColor(palette.Alert, "infoColor", private_safeLighten(palette.info.light, 0.6));
|
|
7108
|
-
setColor(palette.Alert, "successColor", private_safeLighten(palette.success.light, 0.6));
|
|
7109
|
-
setColor(palette.Alert, "warningColor", private_safeLighten(palette.warning.light, 0.6));
|
|
7413
|
+
setColor(palette.Alert, "errorColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
|
|
7414
|
+
setColor(palette.Alert, "infoColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
|
|
7415
|
+
setColor(palette.Alert, "successColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
|
|
7416
|
+
setColor(palette.Alert, "warningColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
|
|
7110
7417
|
setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-dark"));
|
|
7111
7418
|
setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-dark"));
|
|
7112
7419
|
setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-dark"));
|
|
@@ -7115,10 +7422,10 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
7115
7422
|
setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.dark)));
|
|
7116
7423
|
setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.dark)));
|
|
7117
7424
|
setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.dark)));
|
|
7118
|
-
setColor(palette.Alert, "errorStandardBg", private_safeDarken(palette.error.light, 0.9));
|
|
7119
|
-
setColor(palette.Alert, "infoStandardBg", private_safeDarken(palette.info.light, 0.9));
|
|
7120
|
-
setColor(palette.Alert, "successStandardBg", private_safeDarken(palette.success.light, 0.9));
|
|
7121
|
-
setColor(palette.Alert, "warningStandardBg", private_safeDarken(palette.warning.light, 0.9));
|
|
7425
|
+
setColor(palette.Alert, "errorStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
|
|
7426
|
+
setColor(palette.Alert, "infoStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
|
|
7427
|
+
setColor(palette.Alert, "successStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
|
|
7428
|
+
setColor(palette.Alert, "warningStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
|
|
7122
7429
|
setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
|
|
7123
7430
|
setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
|
|
7124
7431
|
setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
|
|
@@ -7135,44 +7442,46 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
7135
7442
|
setColor(palette.FilledInput, "bg", "rgba(255, 255, 255, 0.09)");
|
|
7136
7443
|
setColor(palette.FilledInput, "hoverBg", "rgba(255, 255, 255, 0.13)");
|
|
7137
7444
|
setColor(palette.FilledInput, "disabledBg", "rgba(255, 255, 255, 0.12)");
|
|
7138
|
-
setColor(palette.LinearProgress, "primaryBg", private_safeDarken(palette.primary.main, 0.5));
|
|
7139
|
-
setColor(palette.LinearProgress, "secondaryBg", private_safeDarken(palette.secondary.main, 0.5));
|
|
7140
|
-
setColor(palette.LinearProgress, "errorBg", private_safeDarken(palette.error.main, 0.5));
|
|
7141
|
-
setColor(palette.LinearProgress, "infoBg", private_safeDarken(palette.info.main, 0.5));
|
|
7142
|
-
setColor(palette.LinearProgress, "successBg", private_safeDarken(palette.success.main, 0.5));
|
|
7143
|
-
setColor(palette.LinearProgress, "warningBg", private_safeDarken(palette.warning.main, 0.5));
|
|
7144
|
-
setColor(palette.Skeleton, "bg", `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.13)`);
|
|
7145
|
-
setColor(palette.Slider, "primaryTrack", private_safeDarken(palette.primary.main, 0.5));
|
|
7146
|
-
setColor(palette.Slider, "secondaryTrack", private_safeDarken(palette.secondary.main, 0.5));
|
|
7147
|
-
setColor(palette.Slider, "errorTrack", private_safeDarken(palette.error.main, 0.5));
|
|
7148
|
-
setColor(palette.Slider, "infoTrack", private_safeDarken(palette.info.main, 0.5));
|
|
7149
|
-
setColor(palette.Slider, "successTrack", private_safeDarken(palette.success.main, 0.5));
|
|
7150
|
-
setColor(palette.Slider, "warningTrack", private_safeDarken(palette.warning.main, 0.5));
|
|
7151
|
-
const snackbarContentBackground = private_safeEmphasize(palette.background.default, 0.98);
|
|
7445
|
+
setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
|
|
7446
|
+
setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
|
|
7447
|
+
setColor(palette.LinearProgress, "errorBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
|
|
7448
|
+
setColor(palette.LinearProgress, "infoBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
|
|
7449
|
+
setColor(palette.LinearProgress, "successBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
|
|
7450
|
+
setColor(palette.LinearProgress, "warningBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.5));
|
|
7451
|
+
setColor(palette.Skeleton, "bg", colorSpace ? colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-text-primary") : palette.text.primary, 0.13) : `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.13)`);
|
|
7452
|
+
setColor(palette.Slider, "primaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
|
|
7453
|
+
setColor(palette.Slider, "secondaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
|
|
7454
|
+
setColor(palette.Slider, "errorTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
|
|
7455
|
+
setColor(palette.Slider, "infoTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
|
|
7456
|
+
setColor(palette.Slider, "successTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
|
|
7457
|
+
setColor(palette.Slider, "warningTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.5));
|
|
7458
|
+
const snackbarContentBackground = colorSpace ? colorMix(private_safeLighten, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.985) : private_safeEmphasize(palette.background.default, 0.98);
|
|
7152
7459
|
setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
|
|
7153
|
-
setColor(palette.SnackbarContent, "color", silent(() => palette.getContrastText(snackbarContentBackground)));
|
|
7460
|
+
setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? light.text.primary : palette.getContrastText(snackbarContentBackground)));
|
|
7154
7461
|
setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
|
|
7155
7462
|
setColor(palette.StepConnector, "border", setCssVarColor("palette-grey-600"));
|
|
7156
7463
|
setColor(palette.StepContent, "border", setCssVarColor("palette-grey-600"));
|
|
7157
7464
|
setColor(palette.Switch, "defaultColor", setCssVarColor("palette-grey-300"));
|
|
7158
7465
|
setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-600"));
|
|
7159
|
-
setColor(palette.Switch, "primaryDisabledColor", private_safeDarken(palette.primary.main, 0.55));
|
|
7160
|
-
setColor(palette.Switch, "secondaryDisabledColor", private_safeDarken(palette.secondary.main, 0.55));
|
|
7161
|
-
setColor(palette.Switch, "errorDisabledColor", private_safeDarken(palette.error.main, 0.55));
|
|
7162
|
-
setColor(palette.Switch, "infoDisabledColor", private_safeDarken(palette.info.main, 0.55));
|
|
7163
|
-
setColor(palette.Switch, "successDisabledColor", private_safeDarken(palette.success.main, 0.55));
|
|
7164
|
-
setColor(palette.Switch, "warningDisabledColor", private_safeDarken(palette.warning.main, 0.55));
|
|
7165
|
-
setColor(palette.TableCell, "border", private_safeDarken
|
|
7166
|
-
setColor(palette.Tooltip, "bg", private_safeAlpha(palette.grey[700], 0.92));
|
|
7167
|
-
}
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7466
|
+
setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.55));
|
|
7467
|
+
setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.55));
|
|
7468
|
+
setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.55));
|
|
7469
|
+
setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.55));
|
|
7470
|
+
setColor(palette.Switch, "successDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.55));
|
|
7471
|
+
setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.55));
|
|
7472
|
+
setColor(palette.TableCell, "border", colorMix(private_safeDarken, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.68));
|
|
7473
|
+
setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
|
|
7474
|
+
}
|
|
7475
|
+
if (!nativeColor) {
|
|
7476
|
+
setColorChannel(palette.background, "default");
|
|
7477
|
+
setColorChannel(palette.background, "paper");
|
|
7478
|
+
setColorChannel(palette.common, "background");
|
|
7479
|
+
setColorChannel(palette.common, "onBackground");
|
|
7480
|
+
setColorChannel(palette, "divider");
|
|
7481
|
+
}
|
|
7173
7482
|
Object.keys(palette).forEach((color2) => {
|
|
7174
7483
|
const colors = palette[color2];
|
|
7175
|
-
if (color2 !== "tonalOffset" && colors && typeof colors === "object") {
|
|
7484
|
+
if (color2 !== "tonalOffset" && !nativeColor && colors && typeof colors === "object") {
|
|
7176
7485
|
if (colors.main) {
|
|
7177
7486
|
setColor(palette[color2], "mainChannel", private_safeColorChannel(toRgb(colors.main)));
|
|
7178
7487
|
}
|
|
@@ -7201,11 +7510,16 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
7201
7510
|
});
|
|
7202
7511
|
});
|
|
7203
7512
|
theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
|
|
7513
|
+
const focusVisibleInput = mergeFocusVisibleInput(options.focusVisible, args);
|
|
7514
|
+
if (focusVisibleInput != null && focusVisibleInput !== false) {
|
|
7515
|
+
theme.focusVisible = resolveFocusVisible(focusVisibleInput, getCssVar("palette-primary-main"));
|
|
7516
|
+
}
|
|
7204
7517
|
const parserConfig = {
|
|
7205
7518
|
prefix: cssVarPrefix,
|
|
7206
7519
|
disableCssColorScheme,
|
|
7207
7520
|
shouldSkipGeneratingVar: shouldSkipGeneratingVar$1,
|
|
7208
|
-
getSelector: defaultGetSelector(theme)
|
|
7521
|
+
getSelector: defaultGetSelector(theme),
|
|
7522
|
+
enableContrastVars: nativeColor
|
|
7209
7523
|
};
|
|
7210
7524
|
const {
|
|
7211
7525
|
vars,
|
|
@@ -7234,6 +7548,7 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
7234
7548
|
theme: this
|
|
7235
7549
|
});
|
|
7236
7550
|
};
|
|
7551
|
+
theme.internal_cache = {};
|
|
7237
7552
|
theme.toRuntimeSource = stringifyTheme;
|
|
7238
7553
|
return theme;
|
|
7239
7554
|
}
|
|
@@ -7260,7 +7575,7 @@ function createTheme(options = {}, ...args) {
|
|
|
7260
7575
|
light: true
|
|
7261
7576
|
} : void 0,
|
|
7262
7577
|
defaultColorScheme: initialDefaultColorScheme = palette?.mode,
|
|
7263
|
-
...
|
|
7578
|
+
...other
|
|
7264
7579
|
} = options;
|
|
7265
7580
|
const defaultColorSchemeInput = initialDefaultColorScheme || "light";
|
|
7266
7581
|
const defaultScheme = initialColorSchemes?.[defaultColorSchemeInput];
|
|
@@ -7309,18 +7624,74 @@ function createTheme(options = {}, ...args) {
|
|
|
7309
7624
|
};
|
|
7310
7625
|
attachColorScheme(theme, "light", colorSchemesInput.light);
|
|
7311
7626
|
}
|
|
7627
|
+
if (theme.focusVisible != null && theme.focusVisible !== false) {
|
|
7628
|
+
let focusVisibleInput = theme.focusVisible;
|
|
7629
|
+
const rawFocusVisible = mergeFocusVisibleInput(options.focusVisible, args);
|
|
7630
|
+
const authoredColor = rawFocusVisible && typeof rawFocusVisible === "object" ? rawFocusVisible.outlineColor : void 0;
|
|
7631
|
+
if (!authoredColor || isResolvedFocusVisible(rawFocusVisible) && authoredColor === theme.palette.primary.main) {
|
|
7632
|
+
const {
|
|
7633
|
+
outlineColor: outlineColor2,
|
|
7634
|
+
...rest
|
|
7635
|
+
} = focusVisibleInput;
|
|
7636
|
+
focusVisibleInput = rest;
|
|
7637
|
+
}
|
|
7638
|
+
Object.keys(theme.colorSchemes).forEach((scheme) => {
|
|
7639
|
+
const schemePalette = theme.colorSchemes?.[scheme]?.palette;
|
|
7640
|
+
if (schemePalette?.primary) {
|
|
7641
|
+
theme.colorSchemes[scheme].focusVisible = resolveFocusVisible(focusVisibleInput, schemePalette.primary.main);
|
|
7642
|
+
}
|
|
7643
|
+
});
|
|
7644
|
+
}
|
|
7312
7645
|
return theme;
|
|
7313
7646
|
}
|
|
7314
7647
|
if (!palette && !("light" in colorSchemesInput) && defaultColorSchemeInput === "light") {
|
|
7315
7648
|
colorSchemesInput.light = true;
|
|
7316
7649
|
}
|
|
7317
7650
|
return createThemeWithVars({
|
|
7318
|
-
...
|
|
7651
|
+
...other,
|
|
7319
7652
|
colorSchemes: colorSchemesInput,
|
|
7320
7653
|
defaultColorScheme: defaultColorSchemeInput,
|
|
7321
7654
|
...typeof cssVariables !== "boolean" && cssVariables
|
|
7322
7655
|
}, ...args);
|
|
7323
7656
|
}
|
|
7657
|
+
function useForkRef$1(...refs) {
|
|
7658
|
+
const cleanupRef = React.useRef(void 0);
|
|
7659
|
+
const refEffect = React.useCallback((instance) => {
|
|
7660
|
+
const cleanups = refs.map((ref) => {
|
|
7661
|
+
if (ref == null) {
|
|
7662
|
+
return null;
|
|
7663
|
+
}
|
|
7664
|
+
if (typeof ref === "function") {
|
|
7665
|
+
const refCallback = ref;
|
|
7666
|
+
const refCleanup = refCallback(instance);
|
|
7667
|
+
return typeof refCleanup === "function" ? refCleanup : () => {
|
|
7668
|
+
refCallback(null);
|
|
7669
|
+
};
|
|
7670
|
+
}
|
|
7671
|
+
ref.current = instance;
|
|
7672
|
+
return () => {
|
|
7673
|
+
ref.current = null;
|
|
7674
|
+
};
|
|
7675
|
+
});
|
|
7676
|
+
return () => {
|
|
7677
|
+
cleanups.forEach((refCleanup) => refCleanup?.());
|
|
7678
|
+
};
|
|
7679
|
+
}, refs);
|
|
7680
|
+
return React.useMemo(() => {
|
|
7681
|
+
if (refs.every((ref) => ref == null)) {
|
|
7682
|
+
return null;
|
|
7683
|
+
}
|
|
7684
|
+
return (value) => {
|
|
7685
|
+
if (cleanupRef.current) {
|
|
7686
|
+
cleanupRef.current();
|
|
7687
|
+
cleanupRef.current = void 0;
|
|
7688
|
+
}
|
|
7689
|
+
if (value != null) {
|
|
7690
|
+
cleanupRef.current = refEffect(value);
|
|
7691
|
+
}
|
|
7692
|
+
};
|
|
7693
|
+
}, refs);
|
|
7694
|
+
}
|
|
7324
7695
|
const defaultTheme = createTheme();
|
|
7325
7696
|
function useTheme() {
|
|
7326
7697
|
const theme = useTheme$1(defaultTheme);
|
|
@@ -7338,20 +7709,6 @@ const styled = createStyled2({
|
|
|
7338
7709
|
defaultTheme,
|
|
7339
7710
|
rootShouldForwardProp
|
|
7340
7711
|
});
|
|
7341
|
-
const { makeStyles } = createMakeAndWithStyles({
|
|
7342
|
-
useTheme
|
|
7343
|
-
});
|
|
7344
|
-
const { tss } = createTss({
|
|
7345
|
-
"useContext": function useContext2() {
|
|
7346
|
-
const theme = useTheme();
|
|
7347
|
-
return { theme };
|
|
7348
|
-
},
|
|
7349
|
-
"usePlugin": useMuiThemeStyleOverridesPlugin
|
|
7350
|
-
});
|
|
7351
|
-
const useStyles$1 = tss.create({});
|
|
7352
|
-
function internal_createExtendSxProp() {
|
|
7353
|
-
return extendSxProp$1;
|
|
7354
|
-
}
|
|
7355
7712
|
const memoTheme = unstable_memoTheme;
|
|
7356
7713
|
({
|
|
7357
7714
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -7370,6 +7727,17 @@ const memoTheme = unstable_memoTheme;
|
|
|
7370
7727
|
function useDefaultProps(params) {
|
|
7371
7728
|
return useDefaultProps$1(params);
|
|
7372
7729
|
}
|
|
7730
|
+
const { makeStyles } = createMakeAndWithStyles({
|
|
7731
|
+
useTheme
|
|
7732
|
+
});
|
|
7733
|
+
const { tss } = createTss({
|
|
7734
|
+
"useContext": function useContext2() {
|
|
7735
|
+
const theme = useTheme();
|
|
7736
|
+
return { theme };
|
|
7737
|
+
},
|
|
7738
|
+
"usePlugin": useMuiThemeStyleOverridesPlugin
|
|
7739
|
+
});
|
|
7740
|
+
const useStyles$1 = tss.create({});
|
|
7373
7741
|
function setRef$1(ref, value) {
|
|
7374
7742
|
if (typeof ref === "function") {
|
|
7375
7743
|
ref(value);
|
|
@@ -7377,56 +7745,6 @@ function setRef$1(ref, value) {
|
|
|
7377
7745
|
ref.current = value;
|
|
7378
7746
|
}
|
|
7379
7747
|
}
|
|
7380
|
-
function useForkRef$1(...refs) {
|
|
7381
|
-
const cleanupRef = React.useRef(void 0);
|
|
7382
|
-
const refEffect = React.useCallback((instance) => {
|
|
7383
|
-
const cleanups = refs.map((ref) => {
|
|
7384
|
-
if (ref == null) {
|
|
7385
|
-
return null;
|
|
7386
|
-
}
|
|
7387
|
-
if (typeof ref === "function") {
|
|
7388
|
-
const refCallback = ref;
|
|
7389
|
-
const refCleanup = refCallback(instance);
|
|
7390
|
-
return typeof refCleanup === "function" ? refCleanup : () => {
|
|
7391
|
-
refCallback(null);
|
|
7392
|
-
};
|
|
7393
|
-
}
|
|
7394
|
-
ref.current = instance;
|
|
7395
|
-
return () => {
|
|
7396
|
-
ref.current = null;
|
|
7397
|
-
};
|
|
7398
|
-
});
|
|
7399
|
-
return () => {
|
|
7400
|
-
cleanups.forEach((refCleanup) => refCleanup?.());
|
|
7401
|
-
};
|
|
7402
|
-
}, refs);
|
|
7403
|
-
return React.useMemo(() => {
|
|
7404
|
-
if (refs.every((ref) => ref == null)) {
|
|
7405
|
-
return null;
|
|
7406
|
-
}
|
|
7407
|
-
return (value) => {
|
|
7408
|
-
if (cleanupRef.current) {
|
|
7409
|
-
cleanupRef.current();
|
|
7410
|
-
cleanupRef.current = void 0;
|
|
7411
|
-
}
|
|
7412
|
-
if (value != null) {
|
|
7413
|
-
cleanupRef.current = refEffect(value);
|
|
7414
|
-
}
|
|
7415
|
-
};
|
|
7416
|
-
}, refs);
|
|
7417
|
-
}
|
|
7418
|
-
function _setPrototypeOf(t, e) {
|
|
7419
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
|
|
7420
|
-
return t2.__proto__ = e2, t2;
|
|
7421
|
-
}, _setPrototypeOf(t, e);
|
|
7422
|
-
}
|
|
7423
|
-
function _inheritsLoose(t, o) {
|
|
7424
|
-
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
7425
|
-
}
|
|
7426
|
-
function _assertThisInitialized(e) {
|
|
7427
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
7428
|
-
return e;
|
|
7429
|
-
}
|
|
7430
7748
|
function hasCorrectMainProperty(obj) {
|
|
7431
7749
|
return typeof obj.main === "string";
|
|
7432
7750
|
}
|
|
@@ -7461,22 +7779,22 @@ function getReactElementRef(element2) {
|
|
|
7461
7779
|
}
|
|
7462
7780
|
return element2?.ref || null;
|
|
7463
7781
|
}
|
|
7464
|
-
function getContainer(
|
|
7465
|
-
return typeof
|
|
7782
|
+
function getContainer(container2) {
|
|
7783
|
+
return typeof container2 === "function" ? container2() : container2;
|
|
7466
7784
|
}
|
|
7467
7785
|
const Portal = /* @__PURE__ */ React.forwardRef(function Portal2(props, forwardedRef) {
|
|
7468
7786
|
const {
|
|
7469
7787
|
children,
|
|
7470
|
-
container,
|
|
7788
|
+
container: container2,
|
|
7471
7789
|
disablePortal = false
|
|
7472
7790
|
} = props;
|
|
7473
7791
|
const [mountNode, setMountNode] = React.useState(null);
|
|
7474
7792
|
const handleRef = useForkRef$1(/* @__PURE__ */ React.isValidElement(children) ? getReactElementRef(children) : null, forwardedRef);
|
|
7475
7793
|
useEnhancedEffect$1(() => {
|
|
7476
7794
|
if (!disablePortal) {
|
|
7477
|
-
setMountNode(getContainer(
|
|
7795
|
+
setMountNode(getContainer(container2) || document.body);
|
|
7478
7796
|
}
|
|
7479
|
-
}, [
|
|
7797
|
+
}, [container2, disablePortal]);
|
|
7480
7798
|
useEnhancedEffect$1(() => {
|
|
7481
7799
|
if (mountNode && !disablePortal) {
|
|
7482
7800
|
setRef$1(forwardedRef, mountNode);
|
|
@@ -7529,30 +7847,17 @@ Portal.propTypes = {
|
|
|
7529
7847
|
function getTypographyUtilityClass(slot) {
|
|
7530
7848
|
return generateUtilityClass("MuiTypography", slot);
|
|
7531
7849
|
}
|
|
7532
|
-
generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom"
|
|
7533
|
-
const v6Colors = {
|
|
7534
|
-
primary: true,
|
|
7535
|
-
secondary: true,
|
|
7536
|
-
error: true,
|
|
7537
|
-
info: true,
|
|
7538
|
-
success: true,
|
|
7539
|
-
warning: true,
|
|
7540
|
-
textPrimary: true,
|
|
7541
|
-
textSecondary: true,
|
|
7542
|
-
textDisabled: true
|
|
7543
|
-
};
|
|
7544
|
-
const extendSxProp = internal_createExtendSxProp();
|
|
7850
|
+
generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom"]);
|
|
7545
7851
|
const useUtilityClasses = (ownerState) => {
|
|
7546
7852
|
const {
|
|
7547
7853
|
align,
|
|
7548
7854
|
gutterBottom,
|
|
7549
7855
|
noWrap,
|
|
7550
|
-
paragraph: paragraph2,
|
|
7551
7856
|
variant,
|
|
7552
7857
|
classes
|
|
7553
7858
|
} = ownerState;
|
|
7554
7859
|
const slots = {
|
|
7555
|
-
root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap"
|
|
7860
|
+
root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap"]
|
|
7556
7861
|
};
|
|
7557
7862
|
return composeClasses(slots, getTypographyUtilityClass, classes);
|
|
7558
7863
|
};
|
|
@@ -7563,7 +7868,7 @@ const TypographyRoot = styled("span", {
|
|
|
7563
7868
|
const {
|
|
7564
7869
|
ownerState
|
|
7565
7870
|
} = props;
|
|
7566
|
-
return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom
|
|
7871
|
+
return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom];
|
|
7567
7872
|
}
|
|
7568
7873
|
})(memoTheme(({
|
|
7569
7874
|
theme
|
|
@@ -7621,13 +7926,6 @@ const TypographyRoot = styled("span", {
|
|
|
7621
7926
|
style: {
|
|
7622
7927
|
marginBottom: "0.35em"
|
|
7623
7928
|
}
|
|
7624
|
-
}, {
|
|
7625
|
-
props: ({
|
|
7626
|
-
ownerState
|
|
7627
|
-
}) => ownerState.paragraph,
|
|
7628
|
-
style: {
|
|
7629
|
-
marginBottom: 16
|
|
7630
|
-
}
|
|
7631
7929
|
}]
|
|
7632
7930
|
})));
|
|
7633
7931
|
const defaultVariantMapping = {
|
|
@@ -7644,27 +7942,17 @@ const defaultVariantMapping = {
|
|
|
7644
7942
|
inherit: "p"
|
|
7645
7943
|
};
|
|
7646
7944
|
const Typography = /* @__PURE__ */ React.forwardRef(function Typography2(inProps, ref) {
|
|
7647
|
-
const {
|
|
7648
|
-
color: color2,
|
|
7649
|
-
...themeProps
|
|
7650
|
-
} = useDefaultProps({
|
|
7945
|
+
const props = useDefaultProps({
|
|
7651
7946
|
props: inProps,
|
|
7652
7947
|
name: "MuiTypography"
|
|
7653
7948
|
});
|
|
7654
|
-
const isSxColor = !v6Colors[color2];
|
|
7655
|
-
const props = extendSxProp({
|
|
7656
|
-
...themeProps,
|
|
7657
|
-
...isSxColor && {
|
|
7658
|
-
color: color2
|
|
7659
|
-
}
|
|
7660
|
-
});
|
|
7661
7949
|
const {
|
|
7950
|
+
color: color2,
|
|
7662
7951
|
align = "inherit",
|
|
7663
7952
|
className,
|
|
7664
7953
|
component,
|
|
7665
7954
|
gutterBottom = false,
|
|
7666
7955
|
noWrap = false,
|
|
7667
|
-
paragraph: paragraph2 = false,
|
|
7668
7956
|
variant = "body1",
|
|
7669
7957
|
variantMapping = defaultVariantMapping,
|
|
7670
7958
|
...other
|
|
@@ -7677,11 +7965,10 @@ const Typography = /* @__PURE__ */ React.forwardRef(function Typography2(inProps
|
|
|
7677
7965
|
component,
|
|
7678
7966
|
gutterBottom,
|
|
7679
7967
|
noWrap,
|
|
7680
|
-
paragraph: paragraph2,
|
|
7681
7968
|
variant,
|
|
7682
7969
|
variantMapping
|
|
7683
7970
|
};
|
|
7684
|
-
const Component = component ||
|
|
7971
|
+
const Component = component || variantMapping[variant] || defaultVariantMapping[variant] || "span";
|
|
7685
7972
|
const classes = useUtilityClasses(ownerState);
|
|
7686
7973
|
return /* @__PURE__ */ jsx(TypographyRoot, {
|
|
7687
7974
|
as: Component,
|
|
@@ -7743,12 +8030,6 @@ Typography.propTypes = {
|
|
|
7743
8030
|
* @default false
|
|
7744
8031
|
*/
|
|
7745
8032
|
noWrap: PropTypes.bool,
|
|
7746
|
-
/**
|
|
7747
|
-
* If `true`, the element will be a paragraph element.
|
|
7748
|
-
* @default false
|
|
7749
|
-
* @deprecated Use the `component` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
7750
|
-
*/
|
|
7751
|
-
paragraph: PropTypes.bool,
|
|
7752
8033
|
/**
|
|
7753
8034
|
* @ignore
|
|
7754
8035
|
*/
|
|
@@ -9378,7 +9659,7 @@ function getAnchorEl(anchorEl) {
|
|
|
9378
9659
|
const useEnhancedEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
9379
9660
|
const defaultPopperOptions = {};
|
|
9380
9661
|
React.forwardRef((props, ref) => {
|
|
9381
|
-
const { anchorEl, children, container, disablePortal = false, keepMounted = false, modifiers: modifiers2, open, placement: initialPlacement = "bottom", popperOptions = defaultPopperOptions, popperRef: popperRefProp, style: style2, transition = false, ...other } = props;
|
|
9662
|
+
const { anchorEl, children, container: container2, disablePortal = false, keepMounted = false, modifiers: modifiers2, open, placement: initialPlacement = "bottom", popperOptions = defaultPopperOptions, popperRef: popperRefProp, style: style2, transition = false, ...other } = props;
|
|
9382
9663
|
const tooltipRef = React.useRef(null);
|
|
9383
9664
|
const ownRef = useForkRef(tooltipRef, ref);
|
|
9384
9665
|
const popperRef = React.useRef(null);
|
|
@@ -9475,7 +9756,7 @@ React.forwardRef((props, ref) => {
|
|
|
9475
9756
|
onExited: handleExited
|
|
9476
9757
|
};
|
|
9477
9758
|
}
|
|
9478
|
-
return jsx(Portal, { disablePortal, container, children: jsx("div", { ref: handleRef, role: "tooltip", ...other, style: {
|
|
9759
|
+
return jsx(Portal, { disablePortal, container: container2, children: jsx("div", { ref: handleRef, role: "tooltip", ...other, style: {
|
|
9479
9760
|
// Prevents scroll issue, waiting for Popper.js to add this style once initiated.
|
|
9480
9761
|
position: "fixed",
|
|
9481
9762
|
// Fix Popper.js display issue
|
|
@@ -9485,6 +9766,18 @@ React.forwardRef((props, ref) => {
|
|
|
9485
9766
|
...style2
|
|
9486
9767
|
}, children: typeof children === "function" ? children(childProps) : children }) });
|
|
9487
9768
|
});
|
|
9769
|
+
function _assertThisInitialized(e) {
|
|
9770
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
9771
|
+
return e;
|
|
9772
|
+
}
|
|
9773
|
+
function _setPrototypeOf(t, e) {
|
|
9774
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
|
|
9775
|
+
return t2.__proto__ = e2, t2;
|
|
9776
|
+
}, _setPrototypeOf(t, e);
|
|
9777
|
+
}
|
|
9778
|
+
function _inheritsLoose(t, o) {
|
|
9779
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
9780
|
+
}
|
|
9488
9781
|
var safeIsNaN = Number.isNaN || function ponyfill(value) {
|
|
9489
9782
|
return typeof value === "number" && value !== value;
|
|
9490
9783
|
};
|
|
@@ -18044,7 +18337,7 @@ function requireExtend() {
|
|
|
18044
18337
|
return obj[name2];
|
|
18045
18338
|
};
|
|
18046
18339
|
extend$1 = function extend2() {
|
|
18047
|
-
var options, name2, src, copy2, copyIsArray,
|
|
18340
|
+
var options, name2, src, copy2, copyIsArray, clone2;
|
|
18048
18341
|
var target = arguments[0];
|
|
18049
18342
|
var i = 1;
|
|
18050
18343
|
var length2 = arguments.length;
|
|
@@ -18067,11 +18360,11 @@ function requireExtend() {
|
|
|
18067
18360
|
if (deep && copy2 && (isPlainObject2(copy2) || (copyIsArray = isArray(copy2)))) {
|
|
18068
18361
|
if (copyIsArray) {
|
|
18069
18362
|
copyIsArray = false;
|
|
18070
|
-
|
|
18363
|
+
clone2 = src && isArray(src) ? src : [];
|
|
18071
18364
|
} else {
|
|
18072
|
-
|
|
18365
|
+
clone2 = src && isPlainObject2(src) ? src : {};
|
|
18073
18366
|
}
|
|
18074
|
-
setProperty(target, { name: name2, newValue: extend2(deep,
|
|
18367
|
+
setProperty(target, { name: name2, newValue: extend2(deep, clone2, copy2) });
|
|
18075
18368
|
} else if (typeof copy2 !== "undefined") {
|
|
18076
18369
|
setProperty(target, { name: name2, newValue: copy2 });
|
|
18077
18370
|
}
|