@vitessce/tooltip 4.0.10 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +859 -545
- package/dist-tsc/styles.d.ts +1 -1
- package/dist-tsc/styles.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -449,7 +449,7 @@ function rulesheet(callback) {
|
|
|
449
449
|
}
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
|
-
function memoize
|
|
452
|
+
function memoize(fn) {
|
|
453
453
|
var cache = /* @__PURE__ */ Object.create(null);
|
|
454
454
|
return function(arg2) {
|
|
455
455
|
if (cache[arg2] === void 0) cache[arg2] = fn(arg2);
|
|
@@ -737,10 +737,10 @@ var createCache = function createCache2(options) {
|
|
|
737
737
|
}
|
|
738
738
|
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
739
739
|
var inserted = {};
|
|
740
|
-
var
|
|
740
|
+
var container2;
|
|
741
741
|
var nodesToHydrate = [];
|
|
742
742
|
{
|
|
743
|
-
|
|
743
|
+
container2 = options.container || document.head;
|
|
744
744
|
Array.prototype.forEach.call(
|
|
745
745
|
// this means we will ignore elements which don't have a space in them which
|
|
746
746
|
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
@@ -777,7 +777,7 @@ var createCache = function createCache2(options) {
|
|
|
777
777
|
key,
|
|
778
778
|
sheet: new StyleSheet({
|
|
779
779
|
key,
|
|
780
|
-
container,
|
|
780
|
+
container: container2,
|
|
781
781
|
nonce: options.nonce,
|
|
782
782
|
speedy: options.speedy,
|
|
783
783
|
prepend: options.prepend,
|
|
@@ -1101,7 +1101,7 @@ var isCustomProperty = function isCustomProperty2(property) {
|
|
|
1101
1101
|
var isProcessableValue = function isProcessableValue2(value) {
|
|
1102
1102
|
return value != null && typeof value !== "boolean";
|
|
1103
1103
|
};
|
|
1104
|
-
var processStyleName = /* @__PURE__ */ memoize
|
|
1104
|
+
var processStyleName = /* @__PURE__ */ memoize(function(styleName) {
|
|
1105
1105
|
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
|
|
1106
1106
|
});
|
|
1107
1107
|
var processStyleValue = function processStyleValue2(key, value) {
|
|
@@ -1365,7 +1365,7 @@ function matchCSSObject(arg2) {
|
|
|
1365
1365
|
return arg2 instanceof Object && !("styles" in arg2) && !("length" in arg2) && !("__emotion_styles" in arg2);
|
|
1366
1366
|
}
|
|
1367
1367
|
const { createCssAndCx } = /* @__PURE__ */ (() => {
|
|
1368
|
-
function
|
|
1368
|
+
function merge(registered, css, className) {
|
|
1369
1369
|
const registeredStyles = [];
|
|
1370
1370
|
const rawClassName = getRegisteredStyles(registered, registeredStyles, className);
|
|
1371
1371
|
if (registeredStyles.length < 2) {
|
|
@@ -1391,7 +1391,7 @@ const { createCssAndCx } = /* @__PURE__ */ (() => {
|
|
|
1391
1391
|
const cx = (...args) => {
|
|
1392
1392
|
const className = classnames(args);
|
|
1393
1393
|
const feat27FixedClassnames = increaseSpecificityToTakePrecedenceOverMediaQueries.fixClassName(cache, className, css);
|
|
1394
|
-
return
|
|
1394
|
+
return merge(cache.registered, css, feat27FixedClassnames);
|
|
1395
1395
|
};
|
|
1396
1396
|
return { css, cx };
|
|
1397
1397
|
}
|
|
@@ -1998,7 +1998,7 @@ const { tss: tss$1 } = createTss({
|
|
|
1998
1998
|
tss$1.create({});
|
|
1999
1999
|
const THEME_ID = "$$material";
|
|
2000
2000
|
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)-.*))$/;
|
|
2001
|
-
var isPropValid = /* @__PURE__ */ memoize
|
|
2001
|
+
var isPropValid = /* @__PURE__ */ memoize(
|
|
2002
2002
|
function(prop) {
|
|
2003
2003
|
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
2004
2004
|
}
|
|
@@ -2948,8 +2948,7 @@ function requireReactIs_development() {
|
|
|
2948
2948
|
}
|
|
2949
2949
|
}
|
|
2950
2950
|
}
|
|
2951
|
-
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");
|
|
2952
|
-
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");
|
|
2951
|
+
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");
|
|
2953
2952
|
reactIs_development.ContextConsumer = REACT_CONSUMER_TYPE;
|
|
2954
2953
|
reactIs_development.ContextProvider = REACT_CONTEXT_TYPE;
|
|
2955
2954
|
reactIs_development.Element = REACT_ELEMENT_TYPE;
|
|
@@ -2999,7 +2998,7 @@ function requireReactIs_development() {
|
|
|
2999
2998
|
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
3000
2999
|
};
|
|
3001
3000
|
reactIs_development.isValidElementType = function(type) {
|
|
3002
|
-
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;
|
|
3001
|
+
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;
|
|
3003
3002
|
};
|
|
3004
3003
|
reactIs_development.typeOf = typeOf;
|
|
3005
3004
|
})();
|
|
@@ -3069,19 +3068,12 @@ const sortBreakpointsValues = (values2) => {
|
|
|
3069
3068
|
};
|
|
3070
3069
|
function createBreakpoints(breakpoints) {
|
|
3071
3070
|
const {
|
|
3072
|
-
// The breakpoint **start** at this value.
|
|
3073
|
-
// For instance with the first breakpoint xs: [xs, sm).
|
|
3074
3071
|
values: values2 = {
|
|
3075
3072
|
xs: 0,
|
|
3076
|
-
// phone
|
|
3077
3073
|
sm: 600,
|
|
3078
|
-
// tablet
|
|
3079
3074
|
md: 900,
|
|
3080
|
-
// small laptop
|
|
3081
3075
|
lg: 1200,
|
|
3082
|
-
// desktop
|
|
3083
3076
|
xl: 1536
|
|
3084
|
-
// large screen
|
|
3085
3077
|
},
|
|
3086
3078
|
unit = "px",
|
|
3087
3079
|
step = 5,
|
|
@@ -3117,6 +3109,10 @@ function createBreakpoints(breakpoints) {
|
|
|
3117
3109
|
}
|
|
3118
3110
|
return between(key, keys[keys.indexOf(key) + 1]).replace("@media", "@media not all and");
|
|
3119
3111
|
}
|
|
3112
|
+
const mediaKeys = [];
|
|
3113
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
3114
|
+
mediaKeys.push(up(keys[i]));
|
|
3115
|
+
}
|
|
3120
3116
|
return {
|
|
3121
3117
|
keys,
|
|
3122
3118
|
values: sortedValues,
|
|
@@ -3126,28 +3122,40 @@ function createBreakpoints(breakpoints) {
|
|
|
3126
3122
|
only,
|
|
3127
3123
|
not,
|
|
3128
3124
|
unit,
|
|
3125
|
+
internal_mediaKeys: mediaKeys,
|
|
3129
3126
|
...other
|
|
3130
3127
|
};
|
|
3131
3128
|
}
|
|
3129
|
+
const MIN_WIDTH_PATTERN = /min-width:\s*([0-9.]+)/;
|
|
3132
3130
|
function sortContainerQueries(theme, css) {
|
|
3133
|
-
if (!theme.containerQueries) {
|
|
3131
|
+
if (!theme.containerQueries || !hasContainerQuery(css)) {
|
|
3134
3132
|
return css;
|
|
3135
3133
|
}
|
|
3136
|
-
const
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
return css;
|
|
3134
|
+
const keys = [];
|
|
3135
|
+
for (const key in css) {
|
|
3136
|
+
if (key.startsWith("@container")) {
|
|
3137
|
+
keys.push(key);
|
|
3138
|
+
}
|
|
3142
3139
|
}
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
delete acc[key];
|
|
3146
|
-
acc[key] = value;
|
|
3147
|
-
return acc;
|
|
3148
|
-
}, {
|
|
3149
|
-
...css
|
|
3140
|
+
keys.sort((a, b) => {
|
|
3141
|
+
return +(a.match(MIN_WIDTH_PATTERN)?.[1] || 0) - +(b.match(MIN_WIDTH_PATTERN)?.[1] || 0);
|
|
3150
3142
|
});
|
|
3143
|
+
const result = css;
|
|
3144
|
+
for (let i = 0; i < keys.length; i += 1) {
|
|
3145
|
+
const key = keys[i];
|
|
3146
|
+
const value = result[key];
|
|
3147
|
+
delete result[key];
|
|
3148
|
+
result[key] = value;
|
|
3149
|
+
}
|
|
3150
|
+
return result;
|
|
3151
|
+
}
|
|
3152
|
+
function hasContainerQuery(css) {
|
|
3153
|
+
for (const key in css) {
|
|
3154
|
+
if (key.startsWith("@container")) {
|
|
3155
|
+
return true;
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
return false;
|
|
3151
3159
|
}
|
|
3152
3160
|
function isCqShorthand(breakpointKeys, value) {
|
|
3153
3161
|
return value === "@" || value.startsWith("@") && (breakpointKeys.some((key) => value.startsWith(`@${key}`)) || !!value.match(/^@\d/));
|
|
@@ -3156,8 +3164,11 @@ function getContainerQuery(theme, shorthand) {
|
|
|
3156
3164
|
const matches = shorthand.match(/^@([^/]+)?\/?(.+)?$/);
|
|
3157
3165
|
if (!matches) {
|
|
3158
3166
|
{
|
|
3159
|
-
throw
|
|
3160
|
-
|
|
3167
|
+
throw (
|
|
3168
|
+
/* minify-error */
|
|
3169
|
+
new Error(`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
|
|
3170
|
+
For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`)
|
|
3171
|
+
);
|
|
3161
3172
|
}
|
|
3162
3173
|
}
|
|
3163
3174
|
const [, containerQuery, containerName] = matches;
|
|
@@ -3194,15 +3205,82 @@ const shape = {
|
|
|
3194
3205
|
borderRadius: 4
|
|
3195
3206
|
};
|
|
3196
3207
|
const responsivePropType = PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]);
|
|
3197
|
-
function
|
|
3198
|
-
if (
|
|
3199
|
-
return
|
|
3208
|
+
function isObjectEmpty$1(object) {
|
|
3209
|
+
if (object == null) {
|
|
3210
|
+
return true;
|
|
3200
3211
|
}
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3212
|
+
for (const _ in object) {
|
|
3213
|
+
return false;
|
|
3214
|
+
}
|
|
3215
|
+
return true;
|
|
3216
|
+
}
|
|
3217
|
+
function fastDeepAssign(target, source) {
|
|
3218
|
+
const sourceIsArray = Array.isArray(source);
|
|
3219
|
+
const targetIsArray = Array.isArray(target);
|
|
3220
|
+
if (isPrimitive(source)) {
|
|
3221
|
+
return source;
|
|
3222
|
+
} else if (isPrimitiveOrBuiltIn(target)) {
|
|
3223
|
+
return clone(source);
|
|
3224
|
+
} else if (sourceIsArray && targetIsArray) {
|
|
3225
|
+
return mergeArray(target, source);
|
|
3226
|
+
} else if (sourceIsArray !== targetIsArray) {
|
|
3227
|
+
return clone(source);
|
|
3228
|
+
} else {
|
|
3229
|
+
return mergeObject(target, source);
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
function cloneArray(value) {
|
|
3233
|
+
let i = 0;
|
|
3234
|
+
const il = value.length;
|
|
3235
|
+
const result = new Array(il);
|
|
3236
|
+
for (i = 0; i < il; i += 1) {
|
|
3237
|
+
result[i] = clone(value[i]);
|
|
3238
|
+
}
|
|
3239
|
+
return result;
|
|
3205
3240
|
}
|
|
3241
|
+
function cloneObject(target) {
|
|
3242
|
+
const result = {};
|
|
3243
|
+
for (const key in target) {
|
|
3244
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
3245
|
+
continue;
|
|
3246
|
+
}
|
|
3247
|
+
result[key] = clone(target[key]);
|
|
3248
|
+
}
|
|
3249
|
+
return result;
|
|
3250
|
+
}
|
|
3251
|
+
function mergeArray(target, source) {
|
|
3252
|
+
const tl = target.length;
|
|
3253
|
+
for (let i = 0; i < source.length; i += 1) {
|
|
3254
|
+
target[tl + i] = clone(source[i]);
|
|
3255
|
+
}
|
|
3256
|
+
return target;
|
|
3257
|
+
}
|
|
3258
|
+
function isMergeableObject(value) {
|
|
3259
|
+
return typeof value === "object" && value !== null && !(value instanceof RegExp) && !(value instanceof Date);
|
|
3260
|
+
}
|
|
3261
|
+
function isPrimitive(value) {
|
|
3262
|
+
return typeof value !== "object" || value === null;
|
|
3263
|
+
}
|
|
3264
|
+
function isPrimitiveOrBuiltIn(value) {
|
|
3265
|
+
return typeof value !== "object" || value === null || value instanceof RegExp || value instanceof Date;
|
|
3266
|
+
}
|
|
3267
|
+
function clone(entry) {
|
|
3268
|
+
return isMergeableObject(entry) ? Array.isArray(entry) ? cloneArray(entry) : cloneObject(entry) : entry;
|
|
3269
|
+
}
|
|
3270
|
+
function mergeObject(target, source) {
|
|
3271
|
+
for (const key in source) {
|
|
3272
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
3273
|
+
continue;
|
|
3274
|
+
}
|
|
3275
|
+
if (key in target) {
|
|
3276
|
+
target[key] = fastDeepAssign(target[key], source[key]);
|
|
3277
|
+
} else {
|
|
3278
|
+
target[key] = clone(source[key]);
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
return target;
|
|
3282
|
+
}
|
|
3283
|
+
const EMPTY_THEME$2 = {};
|
|
3206
3284
|
const values = {
|
|
3207
3285
|
xs: 0,
|
|
3208
3286
|
// phone
|
|
@@ -3215,12 +3293,9 @@ const values = {
|
|
|
3215
3293
|
xl: 1536
|
|
3216
3294
|
// large screen
|
|
3217
3295
|
};
|
|
3218
|
-
const
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
keys: ["xs", "sm", "md", "lg", "xl"],
|
|
3222
|
-
up: (key) => `@media (min-width:${values[key]}px)`
|
|
3223
|
-
};
|
|
3296
|
+
const DEFAULT_BREAKPOINTS = createBreakpoints({
|
|
3297
|
+
values
|
|
3298
|
+
});
|
|
3224
3299
|
const defaultContainerQueries = {
|
|
3225
3300
|
containerQueries: (containerName) => ({
|
|
3226
3301
|
up: (key) => {
|
|
@@ -3233,52 +3308,89 @@ const defaultContainerQueries = {
|
|
|
3233
3308
|
})
|
|
3234
3309
|
};
|
|
3235
3310
|
function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
3236
|
-
const
|
|
3311
|
+
const result = {};
|
|
3312
|
+
return iterateBreakpoints(result, props.theme, propValue, (mediaKey, value, initialKey) => {
|
|
3313
|
+
const finalValue = styleFromPropValue(value, initialKey);
|
|
3314
|
+
if (mediaKey) {
|
|
3315
|
+
result[mediaKey] = finalValue;
|
|
3316
|
+
} else {
|
|
3317
|
+
fastDeepAssign(result, finalValue);
|
|
3318
|
+
}
|
|
3319
|
+
});
|
|
3320
|
+
}
|
|
3321
|
+
function iterateBreakpoints(target, theme, propValue, callback) {
|
|
3322
|
+
theme ??= EMPTY_THEME$2;
|
|
3237
3323
|
if (Array.isArray(propValue)) {
|
|
3238
|
-
const
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3324
|
+
const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
|
|
3325
|
+
for (let i = 0; i < propValue.length; i += 1) {
|
|
3326
|
+
buildBreakpoint(target, breakpoints.up(breakpoints.keys[i]), propValue[i], void 0, callback);
|
|
3327
|
+
}
|
|
3328
|
+
return target;
|
|
3243
3329
|
}
|
|
3244
3330
|
if (typeof propValue === "object") {
|
|
3245
|
-
const
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3331
|
+
const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
|
|
3332
|
+
const breakpointValues = breakpoints.values ?? values;
|
|
3333
|
+
for (const key in propValue) {
|
|
3334
|
+
if (isCqShorthand(breakpoints.keys, key)) {
|
|
3335
|
+
const containerKey = getContainerQuery(theme.containerQueries ? theme : defaultContainerQueries, key);
|
|
3249
3336
|
if (containerKey) {
|
|
3250
|
-
|
|
3337
|
+
buildBreakpoint(target, containerKey, propValue[key], key, callback);
|
|
3251
3338
|
}
|
|
3252
|
-
} else if (
|
|
3253
|
-
const mediaKey =
|
|
3254
|
-
|
|
3339
|
+
} else if (key in breakpointValues) {
|
|
3340
|
+
const mediaKey = breakpoints.up(key);
|
|
3341
|
+
buildBreakpoint(target, mediaKey, propValue[key], key, callback);
|
|
3255
3342
|
} else {
|
|
3256
|
-
const cssKey =
|
|
3257
|
-
|
|
3343
|
+
const cssKey = key;
|
|
3344
|
+
target[cssKey] = propValue[cssKey];
|
|
3258
3345
|
}
|
|
3259
|
-
|
|
3260
|
-
|
|
3346
|
+
}
|
|
3347
|
+
return target;
|
|
3261
3348
|
}
|
|
3262
|
-
|
|
3263
|
-
return
|
|
3349
|
+
callback(void 0, propValue);
|
|
3350
|
+
return target;
|
|
3264
3351
|
}
|
|
3265
|
-
function
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3352
|
+
function buildBreakpoint(target, mediaKey, value, initialKey, callback) {
|
|
3353
|
+
target[mediaKey] ??= {};
|
|
3354
|
+
callback(mediaKey, value, initialKey);
|
|
3355
|
+
}
|
|
3356
|
+
function createEmptyBreakpointObject(breakpoints = DEFAULT_BREAKPOINTS) {
|
|
3357
|
+
const {
|
|
3358
|
+
internal_mediaKeys: mediaKeys
|
|
3359
|
+
} = breakpoints;
|
|
3360
|
+
const result = {};
|
|
3361
|
+
for (let i = 0; i < mediaKeys.length; i += 1) {
|
|
3362
|
+
result[mediaKeys[i]] = {};
|
|
3363
|
+
}
|
|
3364
|
+
return result;
|
|
3272
3365
|
}
|
|
3273
|
-
function removeUnusedBreakpoints(
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
const
|
|
3277
|
-
if (
|
|
3278
|
-
delete
|
|
3366
|
+
function removeUnusedBreakpoints(breakpoints, style2) {
|
|
3367
|
+
const breakpointKeys = breakpoints.internal_mediaKeys;
|
|
3368
|
+
for (let i = 0; i < breakpointKeys.length; i += 1) {
|
|
3369
|
+
const key = breakpointKeys[i];
|
|
3370
|
+
if (isObjectEmpty$1(style2[key])) {
|
|
3371
|
+
delete style2[key];
|
|
3279
3372
|
}
|
|
3280
|
-
|
|
3281
|
-
|
|
3373
|
+
}
|
|
3374
|
+
return style2;
|
|
3375
|
+
}
|
|
3376
|
+
function hasBreakpoint(breakpoints, value) {
|
|
3377
|
+
if (Array.isArray(value)) {
|
|
3378
|
+
return true;
|
|
3379
|
+
}
|
|
3380
|
+
if (typeof value === "object" && value !== null) {
|
|
3381
|
+
for (let i = 0; i < breakpoints.keys.length; i += 1) {
|
|
3382
|
+
if (breakpoints.keys[i] in value) {
|
|
3383
|
+
return true;
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
const valueKeys = Object.keys(value);
|
|
3387
|
+
for (let i = 0; i < valueKeys.length; i += 1) {
|
|
3388
|
+
if (isCqShorthand(breakpoints.keys, valueKeys[i])) {
|
|
3389
|
+
return true;
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
return false;
|
|
3282
3394
|
}
|
|
3283
3395
|
function capitalize(string) {
|
|
3284
3396
|
if (typeof string !== "string") {
|
|
@@ -3286,37 +3398,54 @@ function capitalize(string) {
|
|
|
3286
3398
|
}
|
|
3287
3399
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
3288
3400
|
}
|
|
3289
|
-
function
|
|
3290
|
-
if (!path || typeof path !== "string") {
|
|
3291
|
-
return null;
|
|
3292
|
-
}
|
|
3293
|
-
if (obj && obj.vars && checkVars) {
|
|
3294
|
-
const val = `vars.${path}`.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
|
|
3295
|
-
if (val != null) {
|
|
3296
|
-
return val;
|
|
3297
|
-
}
|
|
3298
|
-
}
|
|
3299
|
-
return path.split(".").reduce((acc, item) => {
|
|
3300
|
-
if (acc && acc[item] != null) {
|
|
3301
|
-
return acc[item];
|
|
3302
|
-
}
|
|
3303
|
-
return null;
|
|
3304
|
-
}, obj);
|
|
3305
|
-
}
|
|
3306
|
-
function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
|
3401
|
+
function getStyleValue2(themeMapping, transform, userValue, alternateProp) {
|
|
3307
3402
|
let value;
|
|
3308
3403
|
if (typeof themeMapping === "function") {
|
|
3309
|
-
value = themeMapping(
|
|
3404
|
+
value = themeMapping(userValue);
|
|
3310
3405
|
} else if (Array.isArray(themeMapping)) {
|
|
3311
|
-
value = themeMapping[
|
|
3406
|
+
value = themeMapping[userValue] || userValue;
|
|
3407
|
+
} else if (typeof userValue === "string") {
|
|
3408
|
+
value = getPath(themeMapping, userValue, true, alternateProp) || userValue;
|
|
3312
3409
|
} else {
|
|
3313
|
-
value =
|
|
3410
|
+
value = userValue;
|
|
3314
3411
|
}
|
|
3315
3412
|
if (transform) {
|
|
3316
3413
|
value = transform(value, userValue, themeMapping);
|
|
3317
3414
|
}
|
|
3318
3415
|
return value;
|
|
3319
3416
|
}
|
|
3417
|
+
function getPath(obj, pathInput, checkVars = true, alternateProp = void 0) {
|
|
3418
|
+
if (!obj || !pathInput) {
|
|
3419
|
+
return null;
|
|
3420
|
+
}
|
|
3421
|
+
const path = pathInput.split(".");
|
|
3422
|
+
if (obj.vars && checkVars) {
|
|
3423
|
+
const val = getPathImpl(obj.vars, path, alternateProp);
|
|
3424
|
+
if (val != null) {
|
|
3425
|
+
return val;
|
|
3426
|
+
}
|
|
3427
|
+
}
|
|
3428
|
+
return getPathImpl(obj, path, alternateProp);
|
|
3429
|
+
}
|
|
3430
|
+
function getPathImpl(object, path, alternateProp = void 0) {
|
|
3431
|
+
let lastResult = void 0;
|
|
3432
|
+
let result = object;
|
|
3433
|
+
let index = 0;
|
|
3434
|
+
while (index < path.length) {
|
|
3435
|
+
if (result === null || result === void 0) {
|
|
3436
|
+
return result;
|
|
3437
|
+
}
|
|
3438
|
+
lastResult = result;
|
|
3439
|
+
result = result[path[index]];
|
|
3440
|
+
index += 1;
|
|
3441
|
+
}
|
|
3442
|
+
if (alternateProp && result === void 0) {
|
|
3443
|
+
const lastKey = path[path.length - 1];
|
|
3444
|
+
const alternateKey = `${alternateProp}${lastKey === "default" ? "" : capitalize(lastKey)}`;
|
|
3445
|
+
return lastResult?.[alternateKey];
|
|
3446
|
+
}
|
|
3447
|
+
return result;
|
|
3448
|
+
}
|
|
3320
3449
|
function style$1(options) {
|
|
3321
3450
|
const {
|
|
3322
3451
|
prop,
|
|
@@ -3331,15 +3460,9 @@ function style$1(options) {
|
|
|
3331
3460
|
const propValue = props[prop];
|
|
3332
3461
|
const theme = props.theme;
|
|
3333
3462
|
const themeMapping = getPath(theme, themeKey) || {};
|
|
3334
|
-
const styleFromPropValue = (
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
|
|
3338
|
-
}
|
|
3339
|
-
if (cssProperty === false) {
|
|
3340
|
-
return value;
|
|
3341
|
-
}
|
|
3342
|
-
return {
|
|
3463
|
+
const styleFromPropValue = (valueFinal) => {
|
|
3464
|
+
const value = getStyleValue2(themeMapping, transform, valueFinal, prop);
|
|
3465
|
+
return cssProperty === false ? value : {
|
|
3343
3466
|
[cssProperty]: value
|
|
3344
3467
|
};
|
|
3345
3468
|
};
|
|
@@ -3351,15 +3474,9 @@ function style$1(options) {
|
|
|
3351
3474
|
fn.filterProps = [prop];
|
|
3352
3475
|
return fn;
|
|
3353
3476
|
}
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
if (cache[arg2] === void 0) {
|
|
3358
|
-
cache[arg2] = fn(arg2);
|
|
3359
|
-
}
|
|
3360
|
-
return cache[arg2];
|
|
3361
|
-
};
|
|
3362
|
-
}
|
|
3477
|
+
const EMPTY_THEME$1 = {
|
|
3478
|
+
internal_cache: {}
|
|
3479
|
+
};
|
|
3363
3480
|
const properties = {
|
|
3364
3481
|
m: "margin",
|
|
3365
3482
|
p: "padding"
|
|
@@ -3378,22 +3495,24 @@ const aliases = {
|
|
|
3378
3495
|
paddingX: "px",
|
|
3379
3496
|
paddingY: "py"
|
|
3380
3497
|
};
|
|
3381
|
-
const
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3498
|
+
const CSS_PROPERTIES = {};
|
|
3499
|
+
for (const key in properties) {
|
|
3500
|
+
CSS_PROPERTIES[key] = [properties[key]];
|
|
3501
|
+
}
|
|
3502
|
+
for (const keyProperty in properties) {
|
|
3503
|
+
for (const keyDirection in directions) {
|
|
3504
|
+
const property = properties[keyProperty];
|
|
3505
|
+
const direction = directions[keyDirection];
|
|
3506
|
+
const value = Array.isArray(direction) ? direction.map((dir) => property + dir) : [property + direction];
|
|
3507
|
+
CSS_PROPERTIES[keyProperty + keyDirection] = value;
|
|
3388
3508
|
}
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
const
|
|
3395
|
-
const
|
|
3396
|
-
const spacingKeys = [...marginKeys, ...paddingKeys];
|
|
3509
|
+
}
|
|
3510
|
+
for (const key in aliases) {
|
|
3511
|
+
CSS_PROPERTIES[key] = CSS_PROPERTIES[aliases[key]];
|
|
3512
|
+
}
|
|
3513
|
+
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"]);
|
|
3514
|
+
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"]);
|
|
3515
|
+
const spacingKeys = /* @__PURE__ */ new Set([...marginKeys, ...paddingKeys]);
|
|
3397
3516
|
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
3398
3517
|
const themeSpacing = getPath(theme, themeKey, true) ?? defaultValue;
|
|
3399
3518
|
if (typeof themeSpacing === "number" || typeof themeSpacing === "string") {
|
|
@@ -3461,42 +3580,45 @@ function getValue(transformer, propValue) {
|
|
|
3461
3580
|
}
|
|
3462
3581
|
return transformer(propValue);
|
|
3463
3582
|
}
|
|
3464
|
-
|
|
3465
|
-
return (propValue) => cssProperties.reduce((acc, cssProperty) => {
|
|
3466
|
-
acc[cssProperty] = getValue(transformer, propValue);
|
|
3467
|
-
return acc;
|
|
3468
|
-
}, {});
|
|
3469
|
-
}
|
|
3470
|
-
function resolveCssProperty(props, keys, prop, transformer) {
|
|
3471
|
-
if (!keys.includes(prop)) {
|
|
3472
|
-
return null;
|
|
3473
|
-
}
|
|
3474
|
-
const cssProperties = getCssProperties(prop);
|
|
3475
|
-
const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
|
|
3476
|
-
const propValue = props[prop];
|
|
3477
|
-
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
3478
|
-
}
|
|
3583
|
+
const container = [""];
|
|
3479
3584
|
function style(props, keys) {
|
|
3480
|
-
const
|
|
3481
|
-
|
|
3585
|
+
const theme = props.theme ?? EMPTY_THEME$1;
|
|
3586
|
+
const transformer = theme?.internal_cache?.unarySpacing ?? createUnarySpacing(theme);
|
|
3587
|
+
const result = {};
|
|
3588
|
+
for (const prop in props) {
|
|
3589
|
+
if (!keys.has(prop)) {
|
|
3590
|
+
continue;
|
|
3591
|
+
}
|
|
3592
|
+
const cssProperties = CSS_PROPERTIES[prop] ?? (container[0] = prop, container);
|
|
3593
|
+
const propValue = props[prop];
|
|
3594
|
+
iterateBreakpoints(result, props.theme, propValue, (mediaKey, value) => {
|
|
3595
|
+
const target = mediaKey ? result[mediaKey] : result;
|
|
3596
|
+
for (let i = 0; i < cssProperties.length; i += 1) {
|
|
3597
|
+
target[cssProperties[i]] = getValue(transformer, value);
|
|
3598
|
+
}
|
|
3599
|
+
});
|
|
3600
|
+
}
|
|
3601
|
+
return result;
|
|
3482
3602
|
}
|
|
3483
|
-
function
|
|
3603
|
+
function marginFn(props) {
|
|
3484
3604
|
return style(props, marginKeys);
|
|
3485
3605
|
}
|
|
3486
|
-
|
|
3606
|
+
marginFn.propTypes = Array.from(marginKeys).reduce((obj, key) => {
|
|
3487
3607
|
obj[key] = responsivePropType;
|
|
3488
3608
|
return obj;
|
|
3489
3609
|
}, {});
|
|
3490
|
-
|
|
3491
|
-
|
|
3610
|
+
marginFn.filterProps = marginKeys;
|
|
3611
|
+
const margin = marginFn;
|
|
3612
|
+
function paddingFn(props) {
|
|
3492
3613
|
return style(props, paddingKeys);
|
|
3493
3614
|
}
|
|
3494
|
-
|
|
3615
|
+
paddingFn.propTypes = Array.from(paddingKeys).reduce((obj, key) => {
|
|
3495
3616
|
obj[key] = responsivePropType;
|
|
3496
3617
|
return obj;
|
|
3497
3618
|
}, {});
|
|
3498
|
-
|
|
3499
|
-
|
|
3619
|
+
paddingFn.filterProps = paddingKeys;
|
|
3620
|
+
const padding = paddingFn;
|
|
3621
|
+
Array.from(spacingKeys).reduce((obj, key) => {
|
|
3500
3622
|
obj[key] = responsivePropType;
|
|
3501
3623
|
return obj;
|
|
3502
3624
|
}, {});
|
|
@@ -3529,12 +3651,13 @@ function compose(...styles) {
|
|
|
3529
3651
|
return acc;
|
|
3530
3652
|
}, {});
|
|
3531
3653
|
const fn = (props) => {
|
|
3532
|
-
|
|
3654
|
+
const result = {};
|
|
3655
|
+
for (const prop in props) {
|
|
3533
3656
|
if (handlers[prop]) {
|
|
3534
|
-
|
|
3657
|
+
fastDeepAssign(result, handlers[prop](props));
|
|
3535
3658
|
}
|
|
3536
|
-
|
|
3537
|
-
|
|
3659
|
+
}
|
|
3660
|
+
return result;
|
|
3538
3661
|
};
|
|
3539
3662
|
fn.propTypes = styles.reduce((acc, style2) => Object.assign(acc, style2.propTypes), {});
|
|
3540
3663
|
fn.filterProps = styles.reduce((acc, style2) => acc.concat(style2.filterProps), []);
|
|
@@ -3673,6 +3796,7 @@ const backgroundColor = style$1({
|
|
|
3673
3796
|
transform: paletteTransform
|
|
3674
3797
|
});
|
|
3675
3798
|
compose(color, bgcolor, backgroundColor);
|
|
3799
|
+
const breakpointsValues = values;
|
|
3676
3800
|
function sizingTransform(value) {
|
|
3677
3801
|
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
3678
3802
|
}
|
|
@@ -3683,7 +3807,7 @@ const width = style$1({
|
|
|
3683
3807
|
const maxWidth = (props) => {
|
|
3684
3808
|
if (props.maxWidth !== void 0 && props.maxWidth !== null) {
|
|
3685
3809
|
const styleFromPropValue = (propValue) => {
|
|
3686
|
-
const breakpoint = props.theme?.breakpoints?.values?.[propValue] ||
|
|
3810
|
+
const breakpoint = props.theme?.breakpoints?.values?.[propValue] || breakpointsValues[propValue];
|
|
3687
3811
|
if (!breakpoint) {
|
|
3688
3812
|
return {
|
|
3689
3813
|
maxWidth: sizingTransform(propValue)
|
|
@@ -4021,68 +4145,24 @@ const defaultSxConfig = {
|
|
|
4021
4145
|
themeKey: "typography"
|
|
4022
4146
|
}
|
|
4023
4147
|
};
|
|
4024
|
-
|
|
4025
|
-
const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
|
|
4026
|
-
const union = new Set(allKeys);
|
|
4027
|
-
return objects.every((object) => union.size === Object.keys(object).length);
|
|
4028
|
-
}
|
|
4029
|
-
function callIfFn(maybeFn, arg2) {
|
|
4030
|
-
return typeof maybeFn === "function" ? maybeFn(arg2) : maybeFn;
|
|
4031
|
-
}
|
|
4148
|
+
const EMPTY_THEME = {};
|
|
4032
4149
|
function unstable_createStyleFunctionSx() {
|
|
4033
|
-
function
|
|
4034
|
-
|
|
4035
|
-
[prop]: val,
|
|
4036
|
-
theme
|
|
4037
|
-
};
|
|
4038
|
-
const options = config[prop];
|
|
4039
|
-
if (!options) {
|
|
4040
|
-
return {
|
|
4041
|
-
[prop]: val
|
|
4042
|
-
};
|
|
4043
|
-
}
|
|
4044
|
-
const {
|
|
4045
|
-
cssProperty = prop,
|
|
4046
|
-
themeKey,
|
|
4047
|
-
transform,
|
|
4048
|
-
style: style2
|
|
4049
|
-
} = options;
|
|
4050
|
-
if (val == null) {
|
|
4150
|
+
function styleFunctionSx2(props) {
|
|
4151
|
+
if (!props.sx) {
|
|
4051
4152
|
return null;
|
|
4052
4153
|
}
|
|
4053
|
-
if (themeKey === "typography" && val === "inherit") {
|
|
4054
|
-
return {
|
|
4055
|
-
[prop]: val
|
|
4056
|
-
};
|
|
4057
|
-
}
|
|
4058
|
-
const themeMapping = getPath(theme, themeKey) || {};
|
|
4059
|
-
if (style2) {
|
|
4060
|
-
return style2(props);
|
|
4061
|
-
}
|
|
4062
|
-
const styleFromPropValue = (propValueFinal) => {
|
|
4063
|
-
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
4064
|
-
if (propValueFinal === value && typeof propValueFinal === "string") {
|
|
4065
|
-
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === "default" ? "" : capitalize(propValueFinal)}`, propValueFinal);
|
|
4066
|
-
}
|
|
4067
|
-
if (cssProperty === false) {
|
|
4068
|
-
return value;
|
|
4069
|
-
}
|
|
4070
|
-
return {
|
|
4071
|
-
[cssProperty]: value
|
|
4072
|
-
};
|
|
4073
|
-
};
|
|
4074
|
-
return handleBreakpoints(props, val, styleFromPropValue);
|
|
4075
|
-
}
|
|
4076
|
-
function styleFunctionSx2(props) {
|
|
4077
4154
|
const {
|
|
4078
4155
|
sx,
|
|
4079
|
-
theme =
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
return null;
|
|
4083
|
-
}
|
|
4156
|
+
theme = EMPTY_THEME,
|
|
4157
|
+
nested
|
|
4158
|
+
} = props;
|
|
4084
4159
|
const config = theme.unstable_sxConfig ?? defaultSxConfig;
|
|
4085
|
-
|
|
4160
|
+
const wrapper2 = {
|
|
4161
|
+
sx: null,
|
|
4162
|
+
theme,
|
|
4163
|
+
nested: true
|
|
4164
|
+
};
|
|
4165
|
+
function process(sxInput) {
|
|
4086
4166
|
let sxObject = sxInput;
|
|
4087
4167
|
if (typeof sxInput === "function") {
|
|
4088
4168
|
sxObject = sxInput(theme);
|
|
@@ -4092,43 +4172,94 @@ function unstable_createStyleFunctionSx() {
|
|
|
4092
4172
|
if (!sxObject) {
|
|
4093
4173
|
return null;
|
|
4094
4174
|
}
|
|
4095
|
-
const
|
|
4096
|
-
const
|
|
4097
|
-
|
|
4098
|
-
Object.keys(sxObject).forEach((styleKey) => {
|
|
4175
|
+
const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
|
|
4176
|
+
const css = createEmptyBreakpointObject(breakpoints);
|
|
4177
|
+
for (const styleKey in sxObject) {
|
|
4099
4178
|
const value = callIfFn(sxObject[styleKey], theme);
|
|
4100
|
-
if (value
|
|
4101
|
-
|
|
4102
|
-
if (config[styleKey]) {
|
|
4103
|
-
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
4104
|
-
} else {
|
|
4105
|
-
const breakpointsValues = handleBreakpoints({
|
|
4106
|
-
theme
|
|
4107
|
-
}, value, (x) => ({
|
|
4108
|
-
[styleKey]: x
|
|
4109
|
-
}));
|
|
4110
|
-
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
4111
|
-
css[styleKey] = styleFunctionSx2({
|
|
4112
|
-
sx: value,
|
|
4113
|
-
theme
|
|
4114
|
-
});
|
|
4115
|
-
} else {
|
|
4116
|
-
css = merge(css, breakpointsValues);
|
|
4117
|
-
}
|
|
4118
|
-
}
|
|
4119
|
-
} else {
|
|
4120
|
-
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
4121
|
-
}
|
|
4179
|
+
if (value === null || value === void 0) {
|
|
4180
|
+
continue;
|
|
4122
4181
|
}
|
|
4123
|
-
|
|
4124
|
-
|
|
4182
|
+
if (typeof value !== "object") {
|
|
4183
|
+
setThemeValue(css, styleKey, value, theme, config);
|
|
4184
|
+
continue;
|
|
4185
|
+
}
|
|
4186
|
+
if (config[styleKey]) {
|
|
4187
|
+
setThemeValue(css, styleKey, value, theme, config);
|
|
4188
|
+
continue;
|
|
4189
|
+
}
|
|
4190
|
+
if (hasBreakpoint(breakpoints, value)) {
|
|
4191
|
+
iterateBreakpoints(css, props.theme, value, (mediaKey, finalValue) => {
|
|
4192
|
+
css[mediaKey][styleKey] = finalValue;
|
|
4193
|
+
});
|
|
4194
|
+
} else {
|
|
4195
|
+
wrapper2.sx = value;
|
|
4196
|
+
css[styleKey] = styleFunctionSx2(wrapper2);
|
|
4197
|
+
}
|
|
4198
|
+
}
|
|
4199
|
+
if (!nested && theme.modularCssLayers) {
|
|
4200
|
+
return {
|
|
4201
|
+
"@layer sx": sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css))
|
|
4202
|
+
};
|
|
4203
|
+
}
|
|
4204
|
+
return sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css));
|
|
4125
4205
|
}
|
|
4126
|
-
return Array.isArray(sx) ? sx.map(
|
|
4206
|
+
return Array.isArray(sx) ? sx.map(process) : process(sx);
|
|
4127
4207
|
}
|
|
4208
|
+
styleFunctionSx2.filterProps = ["sx"];
|
|
4128
4209
|
return styleFunctionSx2;
|
|
4129
4210
|
}
|
|
4130
4211
|
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
4131
|
-
|
|
4212
|
+
function setThemeValue(css, prop, value, theme, config) {
|
|
4213
|
+
const options = config[prop];
|
|
4214
|
+
if (!options) {
|
|
4215
|
+
css[prop] = value;
|
|
4216
|
+
return;
|
|
4217
|
+
}
|
|
4218
|
+
if (value == null) {
|
|
4219
|
+
return;
|
|
4220
|
+
}
|
|
4221
|
+
const {
|
|
4222
|
+
themeKey
|
|
4223
|
+
} = options;
|
|
4224
|
+
if (themeKey === "typography" && value === "inherit") {
|
|
4225
|
+
css[prop] = value;
|
|
4226
|
+
return;
|
|
4227
|
+
}
|
|
4228
|
+
const {
|
|
4229
|
+
style: style2
|
|
4230
|
+
} = options;
|
|
4231
|
+
if (style2) {
|
|
4232
|
+
fastDeepAssign(css, style2({
|
|
4233
|
+
[prop]: value,
|
|
4234
|
+
theme
|
|
4235
|
+
}));
|
|
4236
|
+
return;
|
|
4237
|
+
}
|
|
4238
|
+
const {
|
|
4239
|
+
cssProperty = prop,
|
|
4240
|
+
transform
|
|
4241
|
+
} = options;
|
|
4242
|
+
const themeMapping = getPath(theme, themeKey);
|
|
4243
|
+
iterateBreakpoints(css, theme, value, (mediaKey, valueFinal) => {
|
|
4244
|
+
const finalValue = getStyleValue2(themeMapping, transform, valueFinal, prop);
|
|
4245
|
+
if (cssProperty === false) {
|
|
4246
|
+
if (mediaKey) {
|
|
4247
|
+
fastDeepAssign(css[mediaKey], finalValue);
|
|
4248
|
+
} else {
|
|
4249
|
+
fastDeepAssign(css, finalValue);
|
|
4250
|
+
}
|
|
4251
|
+
} else {
|
|
4252
|
+
if (mediaKey) {
|
|
4253
|
+
css[mediaKey][cssProperty] = finalValue;
|
|
4254
|
+
} else {
|
|
4255
|
+
css[cssProperty] = finalValue;
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
});
|
|
4259
|
+
}
|
|
4260
|
+
function callIfFn(maybeFn, arg2) {
|
|
4261
|
+
return typeof maybeFn === "function" ? maybeFn(arg2) : maybeFn;
|
|
4262
|
+
}
|
|
4132
4263
|
function applyStyles(key, styles) {
|
|
4133
4264
|
const theme = this;
|
|
4134
4265
|
if (theme.vars) {
|
|
@@ -4189,67 +4320,19 @@ function createTheme$1(options = {}, ...args) {
|
|
|
4189
4320
|
theme: this
|
|
4190
4321
|
});
|
|
4191
4322
|
};
|
|
4323
|
+
muiTheme.internal_cache = {};
|
|
4192
4324
|
return muiTheme;
|
|
4193
4325
|
}
|
|
4194
|
-
function isObjectEmpty
|
|
4326
|
+
function isObjectEmpty(obj) {
|
|
4195
4327
|
return Object.keys(obj).length === 0;
|
|
4196
4328
|
}
|
|
4197
|
-
function
|
|
4329
|
+
function useThemeWithoutDefault(defaultTheme2 = null) {
|
|
4198
4330
|
const contextTheme = React.useContext(ThemeContext);
|
|
4199
|
-
return !contextTheme || isObjectEmpty
|
|
4331
|
+
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme2 : contextTheme;
|
|
4200
4332
|
}
|
|
4201
4333
|
const systemDefaultTheme$1 = createTheme$1();
|
|
4202
4334
|
function useTheme$1(defaultTheme2 = systemDefaultTheme$1) {
|
|
4203
|
-
return
|
|
4204
|
-
}
|
|
4205
|
-
const splitProps = (props) => {
|
|
4206
|
-
const result = {
|
|
4207
|
-
systemProps: {},
|
|
4208
|
-
otherProps: {}
|
|
4209
|
-
};
|
|
4210
|
-
const config = props?.theme?.unstable_sxConfig ?? defaultSxConfig;
|
|
4211
|
-
Object.keys(props).forEach((prop) => {
|
|
4212
|
-
if (config[prop]) {
|
|
4213
|
-
result.systemProps[prop] = props[prop];
|
|
4214
|
-
} else {
|
|
4215
|
-
result.otherProps[prop] = props[prop];
|
|
4216
|
-
}
|
|
4217
|
-
});
|
|
4218
|
-
return result;
|
|
4219
|
-
};
|
|
4220
|
-
function extendSxProp$1(props) {
|
|
4221
|
-
const {
|
|
4222
|
-
sx: inSx,
|
|
4223
|
-
...other
|
|
4224
|
-
} = props;
|
|
4225
|
-
const {
|
|
4226
|
-
systemProps,
|
|
4227
|
-
otherProps
|
|
4228
|
-
} = splitProps(other);
|
|
4229
|
-
let finalSx;
|
|
4230
|
-
if (Array.isArray(inSx)) {
|
|
4231
|
-
finalSx = [systemProps, ...inSx];
|
|
4232
|
-
} else if (typeof inSx === "function") {
|
|
4233
|
-
finalSx = (...args) => {
|
|
4234
|
-
const result = inSx(...args);
|
|
4235
|
-
if (!isPlainObject(result)) {
|
|
4236
|
-
return systemProps;
|
|
4237
|
-
}
|
|
4238
|
-
return {
|
|
4239
|
-
...systemProps,
|
|
4240
|
-
...result
|
|
4241
|
-
};
|
|
4242
|
-
};
|
|
4243
|
-
} else {
|
|
4244
|
-
finalSx = {
|
|
4245
|
-
...systemProps,
|
|
4246
|
-
...inSx
|
|
4247
|
-
};
|
|
4248
|
-
}
|
|
4249
|
-
return {
|
|
4250
|
-
...otherProps,
|
|
4251
|
-
sx: finalSx
|
|
4252
|
-
};
|
|
4335
|
+
return useThemeWithoutDefault(defaultTheme2);
|
|
4253
4336
|
}
|
|
4254
4337
|
const defaultGenerator = (componentName) => componentName;
|
|
4255
4338
|
const createClassNameGenerator = () => {
|
|
@@ -4360,6 +4443,12 @@ const systemDefaultTheme = createTheme$1();
|
|
|
4360
4443
|
function shouldForwardProp(prop) {
|
|
4361
4444
|
return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
|
|
4362
4445
|
}
|
|
4446
|
+
function shallowLayer(serialized, layerName) {
|
|
4447
|
+
if (layerName && serialized && typeof serialized === "object" && serialized.styles && !serialized.styles.startsWith("@layer")) {
|
|
4448
|
+
serialized.styles = `@layer ${layerName}{${String(serialized.styles)}}`;
|
|
4449
|
+
}
|
|
4450
|
+
return serialized;
|
|
4451
|
+
}
|
|
4363
4452
|
function defaultOverridesResolver(slot) {
|
|
4364
4453
|
if (!slot) {
|
|
4365
4454
|
return null;
|
|
@@ -4367,32 +4456,32 @@ function defaultOverridesResolver(slot) {
|
|
|
4367
4456
|
return (_props, styles) => styles[slot];
|
|
4368
4457
|
}
|
|
4369
4458
|
function attachTheme(props, themeId, defaultTheme2) {
|
|
4370
|
-
props.theme = isObjectEmpty(props.theme) ? defaultTheme2 : props.theme[themeId] || props.theme;
|
|
4459
|
+
props.theme = isObjectEmpty$1(props.theme) ? defaultTheme2 : props.theme[themeId] || props.theme;
|
|
4371
4460
|
}
|
|
4372
|
-
function processStyle(props, style2) {
|
|
4461
|
+
function processStyle(props, style2, layerName) {
|
|
4373
4462
|
const resolvedStyle = typeof style2 === "function" ? style2(props) : style2;
|
|
4374
4463
|
if (Array.isArray(resolvedStyle)) {
|
|
4375
|
-
return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle));
|
|
4464
|
+
return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle, layerName));
|
|
4376
4465
|
}
|
|
4377
4466
|
if (Array.isArray(resolvedStyle?.variants)) {
|
|
4378
4467
|
let rootStyle;
|
|
4379
4468
|
if (resolvedStyle.isProcessed) {
|
|
4380
|
-
rootStyle = resolvedStyle.style;
|
|
4469
|
+
rootStyle = layerName ? shallowLayer(resolvedStyle.style, layerName) : resolvedStyle.style;
|
|
4381
4470
|
} else {
|
|
4382
4471
|
const {
|
|
4383
4472
|
variants,
|
|
4384
4473
|
...otherStyles
|
|
4385
4474
|
} = resolvedStyle;
|
|
4386
|
-
rootStyle = otherStyles;
|
|
4475
|
+
rootStyle = layerName ? shallowLayer(internal_serializeStyles(otherStyles), layerName) : otherStyles;
|
|
4387
4476
|
}
|
|
4388
|
-
return processStyleVariants(props, resolvedStyle.variants, [rootStyle]);
|
|
4477
|
+
return processStyleVariants(props, resolvedStyle.variants, [rootStyle], layerName);
|
|
4389
4478
|
}
|
|
4390
4479
|
if (resolvedStyle?.isProcessed) {
|
|
4391
|
-
return resolvedStyle.style;
|
|
4480
|
+
return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle.style), layerName) : resolvedStyle.style;
|
|
4392
4481
|
}
|
|
4393
|
-
return resolvedStyle;
|
|
4482
|
+
return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle), layerName) : resolvedStyle;
|
|
4394
4483
|
}
|
|
4395
|
-
function processStyleVariants(props, variants, results = []) {
|
|
4484
|
+
function processStyleVariants(props, variants, results = [], layerName = void 0) {
|
|
4396
4485
|
let mergedState;
|
|
4397
4486
|
variantLoop: for (let i = 0; i < variants.length; i += 1) {
|
|
4398
4487
|
const variant = variants[i];
|
|
@@ -4418,9 +4507,9 @@ function processStyleVariants(props, variants, results = []) {
|
|
|
4418
4507
|
...props.ownerState,
|
|
4419
4508
|
ownerState: props.ownerState
|
|
4420
4509
|
};
|
|
4421
|
-
results.push(variant.style(mergedState));
|
|
4510
|
+
results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style(mergedState)), layerName) : variant.style(mergedState));
|
|
4422
4511
|
} else {
|
|
4423
|
-
results.push(variant.style);
|
|
4512
|
+
results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style), layerName) : variant.style);
|
|
4424
4513
|
}
|
|
4425
4514
|
}
|
|
4426
4515
|
return results;
|
|
@@ -4447,6 +4536,7 @@ function createStyled2(input = {}) {
|
|
|
4447
4536
|
overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot)),
|
|
4448
4537
|
...options
|
|
4449
4538
|
} = inputOptions;
|
|
4539
|
+
const layerName = componentName && componentName.startsWith("Mui") || !!componentSlot ? "components" : "custom";
|
|
4450
4540
|
const skipVariantsResolver = inputSkipVariantsResolver !== void 0 ? inputSkipVariantsResolver : (
|
|
4451
4541
|
// TODO v6: remove `Root` in the next major release
|
|
4452
4542
|
// For more details: https://github.com/mui/material-ui/pull/37908
|
|
@@ -4467,18 +4557,21 @@ function createStyled2(input = {}) {
|
|
|
4467
4557
|
...options
|
|
4468
4558
|
});
|
|
4469
4559
|
const transformStyle = (style2) => {
|
|
4470
|
-
if (
|
|
4560
|
+
if (style2.__emotion_real === style2) {
|
|
4561
|
+
return style2;
|
|
4562
|
+
}
|
|
4563
|
+
if (typeof style2 === "function") {
|
|
4471
4564
|
return function styleFunctionProcessor(props) {
|
|
4472
|
-
return processStyle(props, style2);
|
|
4565
|
+
return processStyle(props, style2, props.theme.modularCssLayers ? layerName : void 0);
|
|
4473
4566
|
};
|
|
4474
4567
|
}
|
|
4475
4568
|
if (isPlainObject(style2)) {
|
|
4476
4569
|
const serialized = preprocessStyles(style2);
|
|
4477
|
-
if (!serialized.variants) {
|
|
4478
|
-
return serialized.style;
|
|
4479
|
-
}
|
|
4480
4570
|
return function styleObjectProcessor(props) {
|
|
4481
|
-
|
|
4571
|
+
if (!serialized.variants) {
|
|
4572
|
+
return props.theme.modularCssLayers ? shallowLayer(serialized.style, layerName) : serialized.style;
|
|
4573
|
+
}
|
|
4574
|
+
return processStyle(props, serialized, props.theme.modularCssLayers ? layerName : void 0);
|
|
4482
4575
|
};
|
|
4483
4576
|
}
|
|
4484
4577
|
return style2;
|
|
@@ -4497,7 +4590,7 @@ function createStyled2(input = {}) {
|
|
|
4497
4590
|
}
|
|
4498
4591
|
const resolvedStyleOverrides = {};
|
|
4499
4592
|
for (const slotKey in styleOverrides) {
|
|
4500
|
-
resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey]);
|
|
4593
|
+
resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey], props.theme.modularCssLayers ? "theme" : void 0);
|
|
4501
4594
|
}
|
|
4502
4595
|
return overridesResolver(props, resolvedStyleOverrides);
|
|
4503
4596
|
});
|
|
@@ -4509,7 +4602,7 @@ function createStyled2(input = {}) {
|
|
|
4509
4602
|
if (!themeVariants) {
|
|
4510
4603
|
return null;
|
|
4511
4604
|
}
|
|
4512
|
-
return processStyleVariants(props, themeVariants);
|
|
4605
|
+
return processStyleVariants(props, themeVariants, [], props.theme.modularCssLayers ? "theme" : void 0);
|
|
4513
4606
|
});
|
|
4514
4607
|
}
|
|
4515
4608
|
if (!skipSx) {
|
|
@@ -4558,12 +4651,6 @@ function generateStyledLabel(componentName, componentSlot) {
|
|
|
4558
4651
|
}
|
|
4559
4652
|
return label;
|
|
4560
4653
|
}
|
|
4561
|
-
function isObjectEmpty(object) {
|
|
4562
|
-
for (const _ in object) {
|
|
4563
|
-
return false;
|
|
4564
|
-
}
|
|
4565
|
-
return true;
|
|
4566
|
-
}
|
|
4567
4654
|
function isStringTag(tag) {
|
|
4568
4655
|
return typeof tag === "string" && // 96 is one less than the char code
|
|
4569
4656
|
// for "a" so this is checking that
|
|
@@ -4576,7 +4663,7 @@ function lowercaseFirstLetter(string) {
|
|
|
4576
4663
|
}
|
|
4577
4664
|
return string.charAt(0).toLowerCase() + string.slice(1);
|
|
4578
4665
|
}
|
|
4579
|
-
function resolveProps(defaultProps, props) {
|
|
4666
|
+
function resolveProps(defaultProps, props, mergeClassNameAndStyle = false) {
|
|
4580
4667
|
const output = {
|
|
4581
4668
|
...props
|
|
4582
4669
|
};
|
|
@@ -4602,10 +4689,23 @@ function resolveProps(defaultProps, props) {
|
|
|
4602
4689
|
for (const slotKey in defaultSlotProps) {
|
|
4603
4690
|
if (Object.prototype.hasOwnProperty.call(defaultSlotProps, slotKey)) {
|
|
4604
4691
|
const slotPropName = slotKey;
|
|
4605
|
-
|
|
4692
|
+
const defaultSlotPropValue = defaultSlotProps[slotPropName];
|
|
4693
|
+
const slotPropValue = slotProps[slotPropName];
|
|
4694
|
+
if (typeof defaultSlotPropValue === "function" || typeof slotPropValue === "function") {
|
|
4695
|
+
output[propName][slotPropName] = (...args) => resolveProps((typeof defaultSlotPropValue === "function" ? defaultSlotPropValue(...args) : defaultSlotPropValue) ?? {}, (typeof slotPropValue === "function" ? slotPropValue(...args) : slotPropValue) ?? {}, mergeClassNameAndStyle);
|
|
4696
|
+
} else {
|
|
4697
|
+
output[propName][slotPropName] = resolveProps(defaultSlotPropValue ?? {}, slotPropValue ?? {}, mergeClassNameAndStyle);
|
|
4698
|
+
}
|
|
4606
4699
|
}
|
|
4607
4700
|
}
|
|
4608
4701
|
}
|
|
4702
|
+
} else if (propName === "className" && mergeClassNameAndStyle && props.className !== void 0) {
|
|
4703
|
+
output.className = clsx(defaultProps?.className, props?.className);
|
|
4704
|
+
} else if (propName === "style" && mergeClassNameAndStyle && props.style) {
|
|
4705
|
+
output.style = {
|
|
4706
|
+
...defaultProps?.style,
|
|
4707
|
+
...props?.style
|
|
4708
|
+
};
|
|
4609
4709
|
} else if (output[propName] === void 0) {
|
|
4610
4710
|
output[propName] = defaultProps[propName];
|
|
4611
4711
|
}
|
|
@@ -4765,6 +4865,9 @@ function private_safeAlpha(color2, value, warning) {
|
|
|
4765
4865
|
try {
|
|
4766
4866
|
return alpha(color2, value);
|
|
4767
4867
|
} catch (error) {
|
|
4868
|
+
if (warning && true) {
|
|
4869
|
+
console.warn(warning);
|
|
4870
|
+
}
|
|
4768
4871
|
return color2;
|
|
4769
4872
|
}
|
|
4770
4873
|
}
|
|
@@ -4784,6 +4887,9 @@ function private_safeDarken(color2, coefficient, warning) {
|
|
|
4784
4887
|
try {
|
|
4785
4888
|
return darken(color2, coefficient);
|
|
4786
4889
|
} catch (error) {
|
|
4890
|
+
if (warning && true) {
|
|
4891
|
+
console.warn(warning);
|
|
4892
|
+
}
|
|
4787
4893
|
return color2;
|
|
4788
4894
|
}
|
|
4789
4895
|
}
|
|
@@ -4807,6 +4913,9 @@ function private_safeLighten(color2, coefficient, warning) {
|
|
|
4807
4913
|
try {
|
|
4808
4914
|
return lighten(color2, coefficient);
|
|
4809
4915
|
} catch (error) {
|
|
4916
|
+
if (warning && true) {
|
|
4917
|
+
console.warn(warning);
|
|
4918
|
+
}
|
|
4810
4919
|
return color2;
|
|
4811
4920
|
}
|
|
4812
4921
|
}
|
|
@@ -4859,10 +4968,10 @@ function getThemeProps(params) {
|
|
|
4859
4968
|
}
|
|
4860
4969
|
const config = theme.components[name];
|
|
4861
4970
|
if (config.defaultProps) {
|
|
4862
|
-
return resolveProps(config.defaultProps, props);
|
|
4971
|
+
return resolveProps(config.defaultProps, props, theme.components.mergeClassNameAndStyle);
|
|
4863
4972
|
}
|
|
4864
4973
|
if (!config.styleOverrides && !config.variants) {
|
|
4865
|
-
return resolveProps(config, props);
|
|
4974
|
+
return resolveProps(config, props, theme.components.mergeClassNameAndStyle);
|
|
4866
4975
|
}
|
|
4867
4976
|
return props;
|
|
4868
4977
|
}
|
|
@@ -4912,9 +5021,14 @@ function createGetCssVar$1(prefix2 = "") {
|
|
|
4912
5021
|
};
|
|
4913
5022
|
return getCssVar;
|
|
4914
5023
|
}
|
|
5024
|
+
const prototypePollutingKeys = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
4915
5025
|
const assignNestedKeys = (obj, keys, value, arrayKeys = []) => {
|
|
4916
5026
|
let temp = obj;
|
|
4917
|
-
keys.
|
|
5027
|
+
for (let index = 0; index < keys.length; index += 1) {
|
|
5028
|
+
const k = keys[index];
|
|
5029
|
+
if (prototypePollutingKeys.has(k)) {
|
|
5030
|
+
break;
|
|
5031
|
+
}
|
|
4918
5032
|
if (index === keys.length - 1) {
|
|
4919
5033
|
if (Array.isArray(temp)) {
|
|
4920
5034
|
temp[Number(k)] = value;
|
|
@@ -4927,7 +5041,7 @@ const assignNestedKeys = (obj, keys, value, arrayKeys = []) => {
|
|
|
4927
5041
|
}
|
|
4928
5042
|
temp = temp[k];
|
|
4929
5043
|
}
|
|
4930
|
-
}
|
|
5044
|
+
}
|
|
4931
5045
|
};
|
|
4932
5046
|
const walkObjectDeep = (obj, callback, shouldSkipPaths) => {
|
|
4933
5047
|
function recurse(object, parentKeys = [], arrayKeys = []) {
|
|
@@ -4994,7 +5108,8 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
4994
5108
|
const {
|
|
4995
5109
|
getSelector = defaultGetSelector2,
|
|
4996
5110
|
disableCssColorScheme,
|
|
4997
|
-
colorSchemeSelector: selector
|
|
5111
|
+
colorSchemeSelector: selector,
|
|
5112
|
+
enableContrastVars
|
|
4998
5113
|
} = parserConfig;
|
|
4999
5114
|
const {
|
|
5000
5115
|
colorSchemes = {},
|
|
@@ -5128,6 +5243,17 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
5128
5243
|
...finalCss
|
|
5129
5244
|
}), finalCss);
|
|
5130
5245
|
});
|
|
5246
|
+
if (enableContrastVars) {
|
|
5247
|
+
stylesheets.push({
|
|
5248
|
+
":root": {
|
|
5249
|
+
// use double underscore to indicate that these are private variables
|
|
5250
|
+
"--__l-threshold": "0.7",
|
|
5251
|
+
"--__l": "clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)",
|
|
5252
|
+
"--__a": "clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"
|
|
5253
|
+
// 0.87 is the default alpha value for black text.
|
|
5254
|
+
}
|
|
5255
|
+
});
|
|
5256
|
+
}
|
|
5131
5257
|
return stylesheets;
|
|
5132
5258
|
};
|
|
5133
5259
|
return {
|
|
@@ -5328,6 +5454,19 @@ function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
|
5328
5454
|
}
|
|
5329
5455
|
}
|
|
5330
5456
|
}
|
|
5457
|
+
function mixLightOrDark(colorSpace, intent, direction, shade, tonalOffset) {
|
|
5458
|
+
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
|
5459
|
+
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
|
5460
|
+
if (!intent[direction]) {
|
|
5461
|
+
if (intent.hasOwnProperty(shade)) {
|
|
5462
|
+
intent[direction] = intent[shade];
|
|
5463
|
+
} else if (direction === "light") {
|
|
5464
|
+
intent.light = `color-mix(in ${colorSpace}, ${intent.main}, #fff ${(tonalOffsetLight * 100).toFixed(0)}%)`;
|
|
5465
|
+
} else if (direction === "dark") {
|
|
5466
|
+
intent.dark = `color-mix(in ${colorSpace}, ${intent.main}, #000 ${(tonalOffsetDark * 100).toFixed(0)}%)`;
|
|
5467
|
+
}
|
|
5468
|
+
}
|
|
5469
|
+
}
|
|
5331
5470
|
function getDefaultPrimary(mode = "light") {
|
|
5332
5471
|
if (mode === "dark") {
|
|
5333
5472
|
return {
|
|
@@ -5413,11 +5552,15 @@ function getDefaultWarning(mode = "light") {
|
|
|
5413
5552
|
dark: orange[900]
|
|
5414
5553
|
};
|
|
5415
5554
|
}
|
|
5555
|
+
function contrastColor(background) {
|
|
5556
|
+
return `oklch(from ${background} var(--__l) 0 h / var(--__a))`;
|
|
5557
|
+
}
|
|
5416
5558
|
function createPalette(palette) {
|
|
5417
5559
|
const {
|
|
5418
5560
|
mode = "light",
|
|
5419
5561
|
contrastThreshold = 3,
|
|
5420
5562
|
tonalOffset = 0.2,
|
|
5563
|
+
colorSpace,
|
|
5421
5564
|
...other
|
|
5422
5565
|
} = palette;
|
|
5423
5566
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
@@ -5427,6 +5570,9 @@ function createPalette(palette) {
|
|
|
5427
5570
|
const success = palette.success || getDefaultSuccess(mode);
|
|
5428
5571
|
const warning = palette.warning || getDefaultWarning(mode);
|
|
5429
5572
|
function getContrastText(background) {
|
|
5573
|
+
if (colorSpace) {
|
|
5574
|
+
return contrastColor(background);
|
|
5575
|
+
}
|
|
5430
5576
|
const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
|
|
5431
5577
|
{
|
|
5432
5578
|
const contrast = getContrastRatio(background, contrastText);
|
|
@@ -5469,8 +5615,13 @@ const theme2 = createTheme({ palette: {
|
|
|
5469
5615
|
primary: { main: green[500] },
|
|
5470
5616
|
} });`);
|
|
5471
5617
|
}
|
|
5472
|
-
|
|
5473
|
-
|
|
5618
|
+
if (colorSpace) {
|
|
5619
|
+
mixLightOrDark(colorSpace, color2, "light", lightShade, tonalOffset);
|
|
5620
|
+
mixLightOrDark(colorSpace, color2, "dark", darkShade, tonalOffset);
|
|
5621
|
+
} else {
|
|
5622
|
+
addLightOrDark(color2, "light", lightShade, tonalOffset);
|
|
5623
|
+
addLightOrDark(color2, "dark", darkShade, tonalOffset);
|
|
5624
|
+
}
|
|
5474
5625
|
if (!color2.contrastText) {
|
|
5475
5626
|
color2.contrastText = getContrastText(color2.main);
|
|
5476
5627
|
}
|
|
@@ -5546,6 +5697,44 @@ const theme2 = createTheme({ palette: {
|
|
|
5546
5697
|
}, other);
|
|
5547
5698
|
return paletteOutput;
|
|
5548
5699
|
}
|
|
5700
|
+
const focusVisibleOffsetVar = "--_focusVisible-offset";
|
|
5701
|
+
const focusVisibleBehaviorVar = "--_focusVisible-behavior";
|
|
5702
|
+
const focusVisibleShadowVar = "--_focusVisible-shadow";
|
|
5703
|
+
const offsetValue = `var(${focusVisibleOffsetVar}, 1)`;
|
|
5704
|
+
const behaviorValue = `var(${focusVisibleBehaviorVar}, )`;
|
|
5705
|
+
function mergeFocusVisibleInput(optionsFocusVisible, args) {
|
|
5706
|
+
return args.reduce((acc, arg2) => arg2 && "focusVisible" in arg2 ? deepmerge(acc, {
|
|
5707
|
+
focusVisible: arg2.focusVisible
|
|
5708
|
+
}) : acc, {
|
|
5709
|
+
focusVisible: optionsFocusVisible
|
|
5710
|
+
}).focusVisible;
|
|
5711
|
+
}
|
|
5712
|
+
function isResolvedFocusVisible(input) {
|
|
5713
|
+
return input != null && typeof input === "object" && typeof input.outlineOffset === "string" && input.outlineOffset.includes(focusVisibleOffsetVar);
|
|
5714
|
+
}
|
|
5715
|
+
function resolveFocusVisible(input, outlineColor2) {
|
|
5716
|
+
return wireFocusVisibleVars({
|
|
5717
|
+
outlineStyle: "solid",
|
|
5718
|
+
outlineColor: outlineColor2,
|
|
5719
|
+
outlineWidth: 2,
|
|
5720
|
+
outlineOffset: 2,
|
|
5721
|
+
// invisible shadow for parent component with solid background (AppBar, Snackbar, Alert) can control the ring color.
|
|
5722
|
+
boxShadow: `var(${focusVisibleShadowVar}, 0 0)`,
|
|
5723
|
+
...input === true ? null : input
|
|
5724
|
+
});
|
|
5725
|
+
}
|
|
5726
|
+
function wireFocusVisibleVars(resolved) {
|
|
5727
|
+
const offset2 = resolved.outlineOffset ?? 0;
|
|
5728
|
+
if (typeof offset2 !== "string" || !offset2.includes(focusVisibleOffsetVar)) {
|
|
5729
|
+
const offsetPx = typeof offset2 === "number" ? `${offset2}px` : offset2;
|
|
5730
|
+
resolved.outlineOffset = `calc(${offsetValue} * ${offsetPx})`;
|
|
5731
|
+
}
|
|
5732
|
+
const standaloneBoxShadows = /* @__PURE__ */ new Set(["none", "initial", "inherit", "unset", "revert", "revert-layer"]);
|
|
5733
|
+
if (typeof resolved.boxShadow === "string" && !standaloneBoxShadows.has(resolved.boxShadow.trim().toLowerCase()) && !/\binset\b/.test(resolved.boxShadow) && !resolved.boxShadow.includes(focusVisibleBehaviorVar)) {
|
|
5734
|
+
resolved.boxShadow = `${behaviorValue} ${resolved.boxShadow}`;
|
|
5735
|
+
}
|
|
5736
|
+
return resolved;
|
|
5737
|
+
}
|
|
5549
5738
|
function prepareTypographyVars(typography) {
|
|
5550
5739
|
const vars = {};
|
|
5551
5740
|
const entries = Object.entries(typography);
|
|
@@ -5667,6 +5856,8 @@ function createShadow(...px) {
|
|
|
5667
5856
|
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(",");
|
|
5668
5857
|
}
|
|
5669
5858
|
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)];
|
|
5859
|
+
const DEFAULT_TRANSITION_PROPS$1 = ["all"];
|
|
5860
|
+
const EMPTY_OPTIONS$1 = {};
|
|
5670
5861
|
const easing = {
|
|
5671
5862
|
// This is the most common easing curve.
|
|
5672
5863
|
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
@@ -5702,15 +5893,19 @@ function getAutoHeightDuration(height2) {
|
|
|
5702
5893
|
return Math.min(Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10), 3e3);
|
|
5703
5894
|
}
|
|
5704
5895
|
function createTransitions(inputTransitions) {
|
|
5896
|
+
const transitions = {
|
|
5897
|
+
...inputTransitions
|
|
5898
|
+
};
|
|
5899
|
+
delete transitions.reducedMotion;
|
|
5705
5900
|
const mergedEasing = {
|
|
5706
5901
|
...easing,
|
|
5707
|
-
...
|
|
5902
|
+
...transitions.easing
|
|
5708
5903
|
};
|
|
5709
5904
|
const mergedDuration = {
|
|
5710
5905
|
...duration,
|
|
5711
|
-
...
|
|
5906
|
+
...transitions.duration
|
|
5712
5907
|
};
|
|
5713
|
-
const
|
|
5908
|
+
const createTransitionValue = (props = DEFAULT_TRANSITION_PROPS$1, options = EMPTY_OPTIONS$1) => {
|
|
5714
5909
|
const {
|
|
5715
5910
|
duration: durationOption = mergedDuration.standard,
|
|
5716
5911
|
easing: easingOption = mergedEasing.easeInOut,
|
|
@@ -5741,14 +5936,22 @@ function createTransitions(inputTransitions) {
|
|
|
5741
5936
|
}
|
|
5742
5937
|
return (Array.isArray(props) ? props : [props]).map((animatedProp) => `${animatedProp} ${typeof durationOption === "string" ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === "string" ? delay : formatMs(delay)}`).join(",");
|
|
5743
5938
|
};
|
|
5939
|
+
const create = transitions.create ?? createTransitionValue;
|
|
5744
5940
|
return {
|
|
5745
5941
|
getAutoHeightDuration,
|
|
5746
5942
|
create,
|
|
5747
|
-
...
|
|
5943
|
+
...transitions,
|
|
5748
5944
|
easing: mergedEasing,
|
|
5749
5945
|
duration: mergedDuration
|
|
5750
5946
|
};
|
|
5751
5947
|
}
|
|
5948
|
+
const EMPTY_MOTION = {};
|
|
5949
|
+
function createMotion(inputMotion = EMPTY_MOTION) {
|
|
5950
|
+
return {
|
|
5951
|
+
reducedMotion: "never",
|
|
5952
|
+
...inputMotion
|
|
5953
|
+
};
|
|
5954
|
+
}
|
|
5752
5955
|
const zIndex = {
|
|
5753
5956
|
mobileStepper: 1e3,
|
|
5754
5957
|
fab: 1050,
|
|
@@ -5770,7 +5973,7 @@ function stringifyTheme(baseTheme = {}) {
|
|
|
5770
5973
|
const array = Object.entries(object);
|
|
5771
5974
|
for (let index = 0; index < array.length; index++) {
|
|
5772
5975
|
const [key, value] = array[index];
|
|
5773
|
-
if (!isSerializable(value) || key.startsWith("unstable_")) {
|
|
5976
|
+
if (!isSerializable(value) || key.startsWith("unstable_") || key.startsWith("internal_")) {
|
|
5774
5977
|
delete object[key];
|
|
5775
5978
|
} else if (isPlainObject(value)) {
|
|
5776
5979
|
object[key] = {
|
|
@@ -5786,19 +5989,70 @@ function stringifyTheme(baseTheme = {}) {
|
|
|
5786
5989
|
const theme = ${JSON.stringify(serializableTheme, null, 2)};
|
|
5787
5990
|
|
|
5788
5991
|
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
5992
|
+
theme.motion = { reducedMotion: 'never', ...theme.motion };
|
|
5789
5993
|
theme.transitions = createTransitions(theme.transitions || {});
|
|
5790
5994
|
|
|
5791
5995
|
export default theme;`;
|
|
5792
5996
|
}
|
|
5997
|
+
function coefficientToPercentage(coefficient) {
|
|
5998
|
+
if (typeof coefficient === "number") {
|
|
5999
|
+
return `${(coefficient * 100).toFixed(0)}%`;
|
|
6000
|
+
}
|
|
6001
|
+
return `calc((${coefficient}) * 100%)`;
|
|
6002
|
+
}
|
|
6003
|
+
const parseAddition = (str) => {
|
|
6004
|
+
if (!Number.isNaN(+str)) {
|
|
6005
|
+
return +str;
|
|
6006
|
+
}
|
|
6007
|
+
const numbers = str.match(/\d*\.?\d+/g);
|
|
6008
|
+
if (!numbers) {
|
|
6009
|
+
return 0;
|
|
6010
|
+
}
|
|
6011
|
+
let sum = 0;
|
|
6012
|
+
for (let i = 0; i < numbers.length; i += 1) {
|
|
6013
|
+
sum += +numbers[i];
|
|
6014
|
+
}
|
|
6015
|
+
return sum;
|
|
6016
|
+
};
|
|
6017
|
+
function attachColorManipulators(theme) {
|
|
6018
|
+
Object.assign(theme, {
|
|
6019
|
+
alpha(color2, coefficient) {
|
|
6020
|
+
const obj = this || theme;
|
|
6021
|
+
if (obj.colorSpace) {
|
|
6022
|
+
return `oklch(from ${color2} l c h / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
|
|
6023
|
+
}
|
|
6024
|
+
if (obj.vars) {
|
|
6025
|
+
return `rgba(${color2.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g, "var(--$1Channel)")} / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
|
|
6026
|
+
}
|
|
6027
|
+
return alpha(color2, parseAddition(coefficient));
|
|
6028
|
+
},
|
|
6029
|
+
lighten(color2, coefficient) {
|
|
6030
|
+
const obj = this || theme;
|
|
6031
|
+
if (obj.colorSpace) {
|
|
6032
|
+
return `color-mix(in ${obj.colorSpace}, ${color2}, #fff ${coefficientToPercentage(coefficient)})`;
|
|
6033
|
+
}
|
|
6034
|
+
return lighten(color2, coefficient);
|
|
6035
|
+
},
|
|
6036
|
+
darken(color2, coefficient) {
|
|
6037
|
+
const obj = this || theme;
|
|
6038
|
+
if (obj.colorSpace) {
|
|
6039
|
+
return `color-mix(in ${obj.colorSpace}, ${color2}, #000 ${coefficientToPercentage(coefficient)})`;
|
|
6040
|
+
}
|
|
6041
|
+
return darken(color2, coefficient);
|
|
6042
|
+
}
|
|
6043
|
+
});
|
|
6044
|
+
}
|
|
5793
6045
|
function createThemeNoVars(options = {}, ...args) {
|
|
5794
6046
|
const {
|
|
5795
6047
|
breakpoints: breakpointsInput,
|
|
5796
6048
|
mixins: mixinsInput = {},
|
|
5797
6049
|
spacing: spacingInput,
|
|
5798
6050
|
palette: paletteInput = {},
|
|
6051
|
+
motion: motionInput = {},
|
|
5799
6052
|
transitions: transitionsInput = {},
|
|
5800
6053
|
typography: typographyInput = {},
|
|
5801
6054
|
shape: shapeInput,
|
|
6055
|
+
colorSpace,
|
|
5802
6056
|
...other
|
|
5803
6057
|
} = options;
|
|
5804
6058
|
if (options.vars && // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
|
|
@@ -5806,7 +6060,10 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
5806
6060
|
options.generateThemeVars === void 0) {
|
|
5807
6061
|
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.");
|
|
5808
6062
|
}
|
|
5809
|
-
const palette = createPalette(
|
|
6063
|
+
const palette = createPalette({
|
|
6064
|
+
...paletteInput,
|
|
6065
|
+
colorSpace
|
|
6066
|
+
});
|
|
5810
6067
|
const systemTheme = createTheme$1(options);
|
|
5811
6068
|
let muiTheme = deepmerge(systemTheme, {
|
|
5812
6069
|
mixins: createMixins(systemTheme.breakpoints, mixinsInput),
|
|
@@ -5814,6 +6071,7 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
5814
6071
|
// Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
|
|
5815
6072
|
shadows: shadows.slice(),
|
|
5816
6073
|
typography: createTypography(palette, typographyInput),
|
|
6074
|
+
motion: createMotion(motionInput),
|
|
5817
6075
|
transitions: createTransitions(transitionsInput),
|
|
5818
6076
|
zIndex: {
|
|
5819
6077
|
...zIndex
|
|
@@ -5821,6 +6079,10 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
5821
6079
|
});
|
|
5822
6080
|
muiTheme = deepmerge(muiTheme, other);
|
|
5823
6081
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
6082
|
+
delete muiTheme.transitions.reducedMotion;
|
|
6083
|
+
if (muiTheme.focusVisible != null && muiTheme.focusVisible !== false) {
|
|
6084
|
+
muiTheme.focusVisible = resolveFocusVisible(muiTheme.focusVisible, muiTheme.palette.primary.main);
|
|
6085
|
+
}
|
|
5824
6086
|
{
|
|
5825
6087
|
const stateClasses = ["active", "checked", "completed", "disabled", "error", "expanded", "focused", "focusVisible", "required", "selected"];
|
|
5826
6088
|
const traverse = (node2, component) => {
|
|
@@ -5858,6 +6120,7 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
5858
6120
|
});
|
|
5859
6121
|
};
|
|
5860
6122
|
muiTheme.toRuntimeSource = stringifyTheme;
|
|
6123
|
+
attachColorManipulators(muiTheme);
|
|
5861
6124
|
return muiTheme;
|
|
5862
6125
|
}
|
|
5863
6126
|
function getOverlayAlpha(elevation) {
|
|
@@ -5895,9 +6158,13 @@ function createColorScheme(options) {
|
|
|
5895
6158
|
// need to cast to avoid module augmentation test
|
|
5896
6159
|
opacity,
|
|
5897
6160
|
overlays,
|
|
5898
|
-
|
|
6161
|
+
colorSpace,
|
|
6162
|
+
...other
|
|
5899
6163
|
} = options;
|
|
5900
|
-
const palette = createPalette(
|
|
6164
|
+
const palette = createPalette({
|
|
6165
|
+
...paletteInput,
|
|
6166
|
+
colorSpace
|
|
6167
|
+
});
|
|
5901
6168
|
return {
|
|
5902
6169
|
palette,
|
|
5903
6170
|
opacity: {
|
|
@@ -5905,11 +6172,14 @@ function createColorScheme(options) {
|
|
|
5905
6172
|
...opacity
|
|
5906
6173
|
},
|
|
5907
6174
|
overlays: overlays || getOverlays(palette.mode),
|
|
5908
|
-
...
|
|
6175
|
+
...other
|
|
5909
6176
|
};
|
|
5910
6177
|
}
|
|
5911
6178
|
function shouldSkipGeneratingVar(keys) {
|
|
5912
|
-
return
|
|
6179
|
+
return keys[0] === "motion" || // Keep `focusVisible` inline: its values reference the per-component private vars
|
|
6180
|
+
// (`--_focusVisible-offset`/`-behavior`). Hoisted to a `:root` var they resolve where those
|
|
6181
|
+
// vars are unset, silently breaking the inner-ring inset.
|
|
6182
|
+
keys[0] === "focusVisible" || !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) || // ends with sxConfig
|
|
5913
6183
|
keys[0] === "palette" && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
|
|
5914
6184
|
}
|
|
5915
6185
|
const excludeVariablesFromRoot = (cssVarPrefix) => [...[...Array(25)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}overlays-${index}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkColor`];
|
|
@@ -6012,7 +6282,7 @@ const silent = (fn) => {
|
|
|
6012
6282
|
return void 0;
|
|
6013
6283
|
};
|
|
6014
6284
|
const createGetCssVar = (cssVarPrefix = "mui") => createGetCssVar$1(cssVarPrefix);
|
|
6015
|
-
function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
6285
|
+
function attachColorScheme$1(colorSpace, colorSchemes, scheme, restTheme, colorScheme) {
|
|
6016
6286
|
if (!scheme) {
|
|
6017
6287
|
return void 0;
|
|
6018
6288
|
}
|
|
@@ -6024,7 +6294,8 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
|
6024
6294
|
palette: {
|
|
6025
6295
|
mode,
|
|
6026
6296
|
...scheme?.palette
|
|
6027
|
-
}
|
|
6297
|
+
},
|
|
6298
|
+
colorSpace
|
|
6028
6299
|
});
|
|
6029
6300
|
return void 0;
|
|
6030
6301
|
}
|
|
@@ -6036,7 +6307,8 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
|
6036
6307
|
palette: {
|
|
6037
6308
|
mode,
|
|
6038
6309
|
...scheme?.palette
|
|
6039
|
-
}
|
|
6310
|
+
},
|
|
6311
|
+
colorSpace
|
|
6040
6312
|
});
|
|
6041
6313
|
colorSchemes[colorScheme] = {
|
|
6042
6314
|
...scheme,
|
|
@@ -6057,6 +6329,7 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
6057
6329
|
defaultColorScheme: defaultColorSchemeInput,
|
|
6058
6330
|
disableCssColorScheme = false,
|
|
6059
6331
|
cssVarPrefix = "mui",
|
|
6332
|
+
nativeColor = false,
|
|
6060
6333
|
shouldSkipGeneratingVar: shouldSkipGeneratingVar$1 = shouldSkipGeneratingVar,
|
|
6061
6334
|
colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? "media" : void 0,
|
|
6062
6335
|
rootSelector = ":root",
|
|
@@ -6081,12 +6354,16 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
6081
6354
|
if (!defaultScheme) {
|
|
6082
6355
|
throw new Error(`MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid.`);
|
|
6083
6356
|
}
|
|
6084
|
-
|
|
6357
|
+
let colorSpace;
|
|
6358
|
+
if (nativeColor) {
|
|
6359
|
+
colorSpace = "oklch";
|
|
6360
|
+
}
|
|
6361
|
+
const muiTheme = attachColorScheme$1(colorSpace, colorSchemes, defaultScheme, input, defaultColorScheme);
|
|
6085
6362
|
if (builtInLight && !colorSchemes.light) {
|
|
6086
|
-
attachColorScheme$1(colorSchemes, builtInLight, void 0, "light");
|
|
6363
|
+
attachColorScheme$1(colorSpace, colorSchemes, builtInLight, void 0, "light");
|
|
6087
6364
|
}
|
|
6088
6365
|
if (builtInDark && !colorSchemes.dark) {
|
|
6089
|
-
attachColorScheme$1(colorSchemes, builtInDark, void 0, "dark");
|
|
6366
|
+
attachColorScheme$1(colorSpace, colorSchemes, builtInDark, void 0, "dark");
|
|
6090
6367
|
}
|
|
6091
6368
|
let theme = {
|
|
6092
6369
|
defaultColorScheme,
|
|
@@ -6118,12 +6395,28 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
6118
6395
|
setColor(palette.common, "background", "#000");
|
|
6119
6396
|
setColor(palette.common, "onBackground", "#fff");
|
|
6120
6397
|
}
|
|
6398
|
+
function colorMix(method, color2, coefficient) {
|
|
6399
|
+
if (colorSpace) {
|
|
6400
|
+
let mixer;
|
|
6401
|
+
if (method === private_safeAlpha) {
|
|
6402
|
+
mixer = `transparent ${((1 - coefficient) * 100).toFixed(0)}%`;
|
|
6403
|
+
}
|
|
6404
|
+
if (method === private_safeDarken) {
|
|
6405
|
+
mixer = `#000 ${(coefficient * 100).toFixed(0)}%`;
|
|
6406
|
+
}
|
|
6407
|
+
if (method === private_safeLighten) {
|
|
6408
|
+
mixer = `#fff ${(coefficient * 100).toFixed(0)}%`;
|
|
6409
|
+
}
|
|
6410
|
+
return `color-mix(in ${colorSpace}, ${color2}, ${mixer})`;
|
|
6411
|
+
}
|
|
6412
|
+
return method(color2, coefficient);
|
|
6413
|
+
}
|
|
6121
6414
|
assignNode(palette, ["Alert", "AppBar", "Avatar", "Button", "Chip", "FilledInput", "LinearProgress", "Skeleton", "Slider", "SnackbarContent", "SpeedDialAction", "StepConnector", "StepContent", "Switch", "TableCell", "Tooltip"]);
|
|
6122
6415
|
if (palette.mode === "light") {
|
|
6123
|
-
setColor(palette.Alert, "errorColor", private_safeDarken(palette.error.light, 0.6));
|
|
6124
|
-
setColor(palette.Alert, "infoColor", private_safeDarken(palette.info.light, 0.6));
|
|
6125
|
-
setColor(palette.Alert, "successColor", private_safeDarken(palette.success.light, 0.6));
|
|
6126
|
-
setColor(palette.Alert, "warningColor", private_safeDarken(palette.warning.light, 0.6));
|
|
6416
|
+
setColor(palette.Alert, "errorColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
|
|
6417
|
+
setColor(palette.Alert, "infoColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
|
|
6418
|
+
setColor(palette.Alert, "successColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
|
|
6419
|
+
setColor(palette.Alert, "warningColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
|
|
6127
6420
|
setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-main"));
|
|
6128
6421
|
setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-main"));
|
|
6129
6422
|
setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-main"));
|
|
@@ -6132,10 +6425,10 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
6132
6425
|
setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.main)));
|
|
6133
6426
|
setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.main)));
|
|
6134
6427
|
setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.main)));
|
|
6135
|
-
setColor(palette.Alert, "errorStandardBg", private_safeLighten(palette.error.light, 0.9));
|
|
6136
|
-
setColor(palette.Alert, "infoStandardBg", private_safeLighten(palette.info.light, 0.9));
|
|
6137
|
-
setColor(palette.Alert, "successStandardBg", private_safeLighten(palette.success.light, 0.9));
|
|
6138
|
-
setColor(palette.Alert, "warningStandardBg", private_safeLighten(palette.warning.light, 0.9));
|
|
6428
|
+
setColor(palette.Alert, "errorStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
|
|
6429
|
+
setColor(palette.Alert, "infoStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
|
|
6430
|
+
setColor(palette.Alert, "successStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
|
|
6431
|
+
setColor(palette.Alert, "warningStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
|
|
6139
6432
|
setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
|
|
6140
6433
|
setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
|
|
6141
6434
|
setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
|
|
@@ -6150,41 +6443,41 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
6150
6443
|
setColor(palette.FilledInput, "bg", "rgba(0, 0, 0, 0.06)");
|
|
6151
6444
|
setColor(palette.FilledInput, "hoverBg", "rgba(0, 0, 0, 0.09)");
|
|
6152
6445
|
setColor(palette.FilledInput, "disabledBg", "rgba(0, 0, 0, 0.12)");
|
|
6153
|
-
setColor(palette.LinearProgress, "primaryBg", private_safeLighten(palette.primary.main, 0.62));
|
|
6154
|
-
setColor(palette.LinearProgress, "secondaryBg", private_safeLighten(palette.secondary.main, 0.62));
|
|
6155
|
-
setColor(palette.LinearProgress, "errorBg", private_safeLighten(palette.error.main, 0.62));
|
|
6156
|
-
setColor(palette.LinearProgress, "infoBg", private_safeLighten(palette.info.main, 0.62));
|
|
6157
|
-
setColor(palette.LinearProgress, "successBg", private_safeLighten(palette.success.main, 0.62));
|
|
6158
|
-
setColor(palette.LinearProgress, "warningBg", private_safeLighten(palette.warning.main, 0.62));
|
|
6159
|
-
setColor(palette.Skeleton, "bg", `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.11)`);
|
|
6160
|
-
setColor(palette.Slider, "primaryTrack", private_safeLighten(palette.primary.main, 0.62));
|
|
6161
|
-
setColor(palette.Slider, "secondaryTrack", private_safeLighten(palette.secondary.main, 0.62));
|
|
6162
|
-
setColor(palette.Slider, "errorTrack", private_safeLighten(palette.error.main, 0.62));
|
|
6163
|
-
setColor(palette.Slider, "infoTrack", private_safeLighten(palette.info.main, 0.62));
|
|
6164
|
-
setColor(palette.Slider, "successTrack", private_safeLighten(palette.success.main, 0.62));
|
|
6165
|
-
setColor(palette.Slider, "warningTrack", private_safeLighten(palette.warning.main, 0.62));
|
|
6166
|
-
const snackbarContentBackground = private_safeEmphasize(palette.background.default, 0.8);
|
|
6446
|
+
setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
|
|
6447
|
+
setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
|
|
6448
|
+
setColor(palette.LinearProgress, "errorBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
|
|
6449
|
+
setColor(palette.LinearProgress, "infoBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
|
|
6450
|
+
setColor(palette.LinearProgress, "successBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
|
|
6451
|
+
setColor(palette.LinearProgress, "warningBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.62));
|
|
6452
|
+
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)`);
|
|
6453
|
+
setColor(palette.Slider, "primaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
|
|
6454
|
+
setColor(palette.Slider, "secondaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
|
|
6455
|
+
setColor(palette.Slider, "errorTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
|
|
6456
|
+
setColor(palette.Slider, "infoTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
|
|
6457
|
+
setColor(palette.Slider, "successTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
|
|
6458
|
+
setColor(palette.Slider, "warningTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
|
|
6459
|
+
const snackbarContentBackground = colorSpace ? colorMix(private_safeDarken, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.6825) : private_safeEmphasize(palette.background.default, 0.8);
|
|
6167
6460
|
setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
|
|
6168
|
-
setColor(palette.SnackbarContent, "color", silent(() => palette.getContrastText(snackbarContentBackground)));
|
|
6461
|
+
setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? dark.text.primary : palette.getContrastText(snackbarContentBackground)));
|
|
6169
6462
|
setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
|
|
6170
6463
|
setColor(palette.StepConnector, "border", setCssVarColor("palette-grey-400"));
|
|
6171
6464
|
setColor(palette.StepContent, "border", setCssVarColor("palette-grey-400"));
|
|
6172
6465
|
setColor(palette.Switch, "defaultColor", setCssVarColor("palette-common-white"));
|
|
6173
6466
|
setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-100"));
|
|
6174
|
-
setColor(palette.Switch, "primaryDisabledColor", private_safeLighten(palette.primary.main, 0.62));
|
|
6175
|
-
setColor(palette.Switch, "secondaryDisabledColor", private_safeLighten(palette.secondary.main, 0.62));
|
|
6176
|
-
setColor(palette.Switch, "errorDisabledColor", private_safeLighten(palette.error.main, 0.62));
|
|
6177
|
-
setColor(palette.Switch, "infoDisabledColor", private_safeLighten(palette.info.main, 0.62));
|
|
6178
|
-
setColor(palette.Switch, "successDisabledColor", private_safeLighten(palette.success.main, 0.62));
|
|
6179
|
-
setColor(palette.Switch, "warningDisabledColor", private_safeLighten(palette.warning.main, 0.62));
|
|
6180
|
-
setColor(palette.TableCell, "border", private_safeLighten
|
|
6181
|
-
setColor(palette.Tooltip, "bg", private_safeAlpha(palette.grey[700], 0.92));
|
|
6467
|
+
setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
|
|
6468
|
+
setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
|
|
6469
|
+
setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
|
|
6470
|
+
setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
|
|
6471
|
+
setColor(palette.Switch, "successDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
|
|
6472
|
+
setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
|
|
6473
|
+
setColor(palette.TableCell, "border", colorMix(private_safeLighten, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.88));
|
|
6474
|
+
setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
|
|
6182
6475
|
}
|
|
6183
6476
|
if (palette.mode === "dark") {
|
|
6184
|
-
setColor(palette.Alert, "errorColor", private_safeLighten(palette.error.light, 0.6));
|
|
6185
|
-
setColor(palette.Alert, "infoColor", private_safeLighten(palette.info.light, 0.6));
|
|
6186
|
-
setColor(palette.Alert, "successColor", private_safeLighten(palette.success.light, 0.6));
|
|
6187
|
-
setColor(palette.Alert, "warningColor", private_safeLighten(palette.warning.light, 0.6));
|
|
6477
|
+
setColor(palette.Alert, "errorColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
|
|
6478
|
+
setColor(palette.Alert, "infoColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
|
|
6479
|
+
setColor(palette.Alert, "successColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
|
|
6480
|
+
setColor(palette.Alert, "warningColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
|
|
6188
6481
|
setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-dark"));
|
|
6189
6482
|
setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-dark"));
|
|
6190
6483
|
setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-dark"));
|
|
@@ -6193,10 +6486,10 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
6193
6486
|
setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.dark)));
|
|
6194
6487
|
setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.dark)));
|
|
6195
6488
|
setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.dark)));
|
|
6196
|
-
setColor(palette.Alert, "errorStandardBg", private_safeDarken(palette.error.light, 0.9));
|
|
6197
|
-
setColor(palette.Alert, "infoStandardBg", private_safeDarken(palette.info.light, 0.9));
|
|
6198
|
-
setColor(palette.Alert, "successStandardBg", private_safeDarken(palette.success.light, 0.9));
|
|
6199
|
-
setColor(palette.Alert, "warningStandardBg", private_safeDarken(palette.warning.light, 0.9));
|
|
6489
|
+
setColor(palette.Alert, "errorStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
|
|
6490
|
+
setColor(palette.Alert, "infoStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
|
|
6491
|
+
setColor(palette.Alert, "successStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
|
|
6492
|
+
setColor(palette.Alert, "warningStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
|
|
6200
6493
|
setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
|
|
6201
6494
|
setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
|
|
6202
6495
|
setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
|
|
@@ -6213,44 +6506,46 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
6213
6506
|
setColor(palette.FilledInput, "bg", "rgba(255, 255, 255, 0.09)");
|
|
6214
6507
|
setColor(palette.FilledInput, "hoverBg", "rgba(255, 255, 255, 0.13)");
|
|
6215
6508
|
setColor(palette.FilledInput, "disabledBg", "rgba(255, 255, 255, 0.12)");
|
|
6216
|
-
setColor(palette.LinearProgress, "primaryBg", private_safeDarken(palette.primary.main, 0.5));
|
|
6217
|
-
setColor(palette.LinearProgress, "secondaryBg", private_safeDarken(palette.secondary.main, 0.5));
|
|
6218
|
-
setColor(palette.LinearProgress, "errorBg", private_safeDarken(palette.error.main, 0.5));
|
|
6219
|
-
setColor(palette.LinearProgress, "infoBg", private_safeDarken(palette.info.main, 0.5));
|
|
6220
|
-
setColor(palette.LinearProgress, "successBg", private_safeDarken(palette.success.main, 0.5));
|
|
6221
|
-
setColor(palette.LinearProgress, "warningBg", private_safeDarken(palette.warning.main, 0.5));
|
|
6222
|
-
setColor(palette.Skeleton, "bg", `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.13)`);
|
|
6223
|
-
setColor(palette.Slider, "primaryTrack", private_safeDarken(palette.primary.main, 0.5));
|
|
6224
|
-
setColor(palette.Slider, "secondaryTrack", private_safeDarken(palette.secondary.main, 0.5));
|
|
6225
|
-
setColor(palette.Slider, "errorTrack", private_safeDarken(palette.error.main, 0.5));
|
|
6226
|
-
setColor(palette.Slider, "infoTrack", private_safeDarken(palette.info.main, 0.5));
|
|
6227
|
-
setColor(palette.Slider, "successTrack", private_safeDarken(palette.success.main, 0.5));
|
|
6228
|
-
setColor(palette.Slider, "warningTrack", private_safeDarken(palette.warning.main, 0.5));
|
|
6229
|
-
const snackbarContentBackground = private_safeEmphasize(palette.background.default, 0.98);
|
|
6509
|
+
setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
|
|
6510
|
+
setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
|
|
6511
|
+
setColor(palette.LinearProgress, "errorBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
|
|
6512
|
+
setColor(palette.LinearProgress, "infoBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
|
|
6513
|
+
setColor(palette.LinearProgress, "successBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
|
|
6514
|
+
setColor(palette.LinearProgress, "warningBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.5));
|
|
6515
|
+
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)`);
|
|
6516
|
+
setColor(palette.Slider, "primaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
|
|
6517
|
+
setColor(palette.Slider, "secondaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
|
|
6518
|
+
setColor(palette.Slider, "errorTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
|
|
6519
|
+
setColor(palette.Slider, "infoTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
|
|
6520
|
+
setColor(palette.Slider, "successTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
|
|
6521
|
+
setColor(palette.Slider, "warningTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.5));
|
|
6522
|
+
const snackbarContentBackground = colorSpace ? colorMix(private_safeLighten, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.985) : private_safeEmphasize(palette.background.default, 0.98);
|
|
6230
6523
|
setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
|
|
6231
|
-
setColor(palette.SnackbarContent, "color", silent(() => palette.getContrastText(snackbarContentBackground)));
|
|
6524
|
+
setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? light.text.primary : palette.getContrastText(snackbarContentBackground)));
|
|
6232
6525
|
setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
|
|
6233
6526
|
setColor(palette.StepConnector, "border", setCssVarColor("palette-grey-600"));
|
|
6234
6527
|
setColor(palette.StepContent, "border", setCssVarColor("palette-grey-600"));
|
|
6235
6528
|
setColor(palette.Switch, "defaultColor", setCssVarColor("palette-grey-300"));
|
|
6236
6529
|
setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-600"));
|
|
6237
|
-
setColor(palette.Switch, "primaryDisabledColor", private_safeDarken(palette.primary.main, 0.55));
|
|
6238
|
-
setColor(palette.Switch, "secondaryDisabledColor", private_safeDarken(palette.secondary.main, 0.55));
|
|
6239
|
-
setColor(palette.Switch, "errorDisabledColor", private_safeDarken(palette.error.main, 0.55));
|
|
6240
|
-
setColor(palette.Switch, "infoDisabledColor", private_safeDarken(palette.info.main, 0.55));
|
|
6241
|
-
setColor(palette.Switch, "successDisabledColor", private_safeDarken(palette.success.main, 0.55));
|
|
6242
|
-
setColor(palette.Switch, "warningDisabledColor", private_safeDarken(palette.warning.main, 0.55));
|
|
6243
|
-
setColor(palette.TableCell, "border", private_safeDarken
|
|
6244
|
-
setColor(palette.Tooltip, "bg", private_safeAlpha(palette.grey[700], 0.92));
|
|
6245
|
-
}
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6530
|
+
setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.55));
|
|
6531
|
+
setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.55));
|
|
6532
|
+
setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.55));
|
|
6533
|
+
setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.55));
|
|
6534
|
+
setColor(palette.Switch, "successDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.55));
|
|
6535
|
+
setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.55));
|
|
6536
|
+
setColor(palette.TableCell, "border", colorMix(private_safeDarken, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.68));
|
|
6537
|
+
setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
|
|
6538
|
+
}
|
|
6539
|
+
if (!nativeColor) {
|
|
6540
|
+
setColorChannel(palette.background, "default");
|
|
6541
|
+
setColorChannel(palette.background, "paper");
|
|
6542
|
+
setColorChannel(palette.common, "background");
|
|
6543
|
+
setColorChannel(palette.common, "onBackground");
|
|
6544
|
+
setColorChannel(palette, "divider");
|
|
6545
|
+
}
|
|
6251
6546
|
Object.keys(palette).forEach((color2) => {
|
|
6252
6547
|
const colors = palette[color2];
|
|
6253
|
-
if (color2 !== "tonalOffset" && colors && typeof colors === "object") {
|
|
6548
|
+
if (color2 !== "tonalOffset" && !nativeColor && colors && typeof colors === "object") {
|
|
6254
6549
|
if (colors.main) {
|
|
6255
6550
|
setColor(palette[color2], "mainChannel", private_safeColorChannel(toRgb(colors.main)));
|
|
6256
6551
|
}
|
|
@@ -6279,11 +6574,16 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
6279
6574
|
});
|
|
6280
6575
|
});
|
|
6281
6576
|
theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
|
|
6577
|
+
const focusVisibleInput = mergeFocusVisibleInput(options.focusVisible, args);
|
|
6578
|
+
if (focusVisibleInput != null && focusVisibleInput !== false) {
|
|
6579
|
+
theme.focusVisible = resolveFocusVisible(focusVisibleInput, getCssVar("palette-primary-main"));
|
|
6580
|
+
}
|
|
6282
6581
|
const parserConfig = {
|
|
6283
6582
|
prefix: cssVarPrefix,
|
|
6284
6583
|
disableCssColorScheme,
|
|
6285
6584
|
shouldSkipGeneratingVar: shouldSkipGeneratingVar$1,
|
|
6286
|
-
getSelector: defaultGetSelector(theme)
|
|
6585
|
+
getSelector: defaultGetSelector(theme),
|
|
6586
|
+
enableContrastVars: nativeColor
|
|
6287
6587
|
};
|
|
6288
6588
|
const {
|
|
6289
6589
|
vars,
|
|
@@ -6312,6 +6612,7 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
6312
6612
|
theme: this
|
|
6313
6613
|
});
|
|
6314
6614
|
};
|
|
6615
|
+
theme.internal_cache = {};
|
|
6315
6616
|
theme.toRuntimeSource = stringifyTheme;
|
|
6316
6617
|
return theme;
|
|
6317
6618
|
}
|
|
@@ -6338,7 +6639,7 @@ function createTheme(options = {}, ...args) {
|
|
|
6338
6639
|
light: true
|
|
6339
6640
|
} : void 0,
|
|
6340
6641
|
defaultColorScheme: initialDefaultColorScheme = palette?.mode,
|
|
6341
|
-
...
|
|
6642
|
+
...other
|
|
6342
6643
|
} = options;
|
|
6343
6644
|
const defaultColorSchemeInput = initialDefaultColorScheme || "light";
|
|
6344
6645
|
const defaultScheme = initialColorSchemes?.[defaultColorSchemeInput];
|
|
@@ -6387,73 +6688,40 @@ function createTheme(options = {}, ...args) {
|
|
|
6387
6688
|
};
|
|
6388
6689
|
attachColorScheme(theme, "light", colorSchemesInput.light);
|
|
6389
6690
|
}
|
|
6691
|
+
if (theme.focusVisible != null && theme.focusVisible !== false) {
|
|
6692
|
+
let focusVisibleInput = theme.focusVisible;
|
|
6693
|
+
const rawFocusVisible = mergeFocusVisibleInput(options.focusVisible, args);
|
|
6694
|
+
const authoredColor = rawFocusVisible && typeof rawFocusVisible === "object" ? rawFocusVisible.outlineColor : void 0;
|
|
6695
|
+
if (!authoredColor || isResolvedFocusVisible(rawFocusVisible) && authoredColor === theme.palette.primary.main) {
|
|
6696
|
+
const {
|
|
6697
|
+
outlineColor: outlineColor2,
|
|
6698
|
+
...rest
|
|
6699
|
+
} = focusVisibleInput;
|
|
6700
|
+
focusVisibleInput = rest;
|
|
6701
|
+
}
|
|
6702
|
+
Object.keys(theme.colorSchemes).forEach((scheme) => {
|
|
6703
|
+
const schemePalette = theme.colorSchemes?.[scheme]?.palette;
|
|
6704
|
+
if (schemePalette?.primary) {
|
|
6705
|
+
theme.colorSchemes[scheme].focusVisible = resolveFocusVisible(focusVisibleInput, schemePalette.primary.main);
|
|
6706
|
+
}
|
|
6707
|
+
});
|
|
6708
|
+
}
|
|
6390
6709
|
return theme;
|
|
6391
6710
|
}
|
|
6392
6711
|
if (!palette && !("light" in colorSchemesInput) && defaultColorSchemeInput === "light") {
|
|
6393
6712
|
colorSchemesInput.light = true;
|
|
6394
6713
|
}
|
|
6395
6714
|
return createThemeWithVars({
|
|
6396
|
-
...
|
|
6715
|
+
...other,
|
|
6397
6716
|
colorSchemes: colorSchemesInput,
|
|
6398
6717
|
defaultColorScheme: defaultColorSchemeInput,
|
|
6399
6718
|
...typeof cssVariables !== "boolean" && cssVariables
|
|
6400
6719
|
}, ...args);
|
|
6401
6720
|
}
|
|
6402
|
-
|
|
6403
|
-
function
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
React.useDebugValue(theme);
|
|
6407
|
-
}
|
|
6408
|
-
return theme[THEME_ID] || theme;
|
|
6409
|
-
}
|
|
6410
|
-
function slotShouldForwardProp(prop) {
|
|
6411
|
-
return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
|
|
6412
|
-
}
|
|
6413
|
-
const rootShouldForwardProp = (prop) => slotShouldForwardProp(prop) && prop !== "classes";
|
|
6414
|
-
const styled = createStyled2({
|
|
6415
|
-
themeId: THEME_ID,
|
|
6416
|
-
defaultTheme,
|
|
6417
|
-
rootShouldForwardProp
|
|
6418
|
-
});
|
|
6419
|
-
const { makeStyles } = createMakeAndWithStyles({
|
|
6420
|
-
useTheme
|
|
6421
|
-
});
|
|
6422
|
-
const { tss } = createTss({
|
|
6423
|
-
"useContext": function useContext2() {
|
|
6424
|
-
const theme = useTheme();
|
|
6425
|
-
return { theme };
|
|
6426
|
-
},
|
|
6427
|
-
"usePlugin": useMuiThemeStyleOverridesPlugin
|
|
6428
|
-
});
|
|
6429
|
-
const useStyles$2 = tss.create({});
|
|
6430
|
-
function internal_createExtendSxProp() {
|
|
6431
|
-
return extendSxProp$1;
|
|
6432
|
-
}
|
|
6433
|
-
const memoTheme = unstable_memoTheme;
|
|
6434
|
-
({
|
|
6435
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
6436
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
6437
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
6438
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
6439
|
-
/**
|
|
6440
|
-
* @ignore
|
|
6441
|
-
*/
|
|
6442
|
-
children: PropTypes.node,
|
|
6443
|
-
/**
|
|
6444
|
-
* @ignore
|
|
6445
|
-
*/
|
|
6446
|
-
value: PropTypes.object.isRequired
|
|
6447
|
-
});
|
|
6448
|
-
function useDefaultProps(params) {
|
|
6449
|
-
return useDefaultProps$1(params);
|
|
6450
|
-
}
|
|
6451
|
-
function setRef$1(ref, value) {
|
|
6452
|
-
if (typeof ref === "function") {
|
|
6453
|
-
ref(value);
|
|
6454
|
-
} else if (ref) {
|
|
6455
|
-
ref.current = value;
|
|
6456
|
-
}
|
|
6721
|
+
function chainPropTypes(propType1, propType2) {
|
|
6722
|
+
return function validate(...args) {
|
|
6723
|
+
return propType1(...args) || propType2(...args);
|
|
6724
|
+
};
|
|
6457
6725
|
}
|
|
6458
6726
|
function useForkRef$1(...refs) {
|
|
6459
6727
|
const cleanupRef = React.useRef(void 0);
|
|
@@ -6493,22 +6761,93 @@ function useForkRef$1(...refs) {
|
|
|
6493
6761
|
};
|
|
6494
6762
|
}, refs);
|
|
6495
6763
|
}
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6764
|
+
const defaultTheme = createTheme();
|
|
6765
|
+
function useTheme() {
|
|
6766
|
+
const theme = useTheme$1(defaultTheme);
|
|
6767
|
+
{
|
|
6768
|
+
React.useDebugValue(theme);
|
|
6769
|
+
}
|
|
6770
|
+
return theme[THEME_ID] || theme;
|
|
6500
6771
|
}
|
|
6501
|
-
function
|
|
6502
|
-
return
|
|
6503
|
-
return t2.__proto__ = e2, t2;
|
|
6504
|
-
}, _setPrototypeOf(t, e);
|
|
6772
|
+
function slotShouldForwardProp(prop) {
|
|
6773
|
+
return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
|
|
6505
6774
|
}
|
|
6506
|
-
|
|
6507
|
-
|
|
6775
|
+
const rootShouldForwardProp = (prop) => slotShouldForwardProp(prop) && prop !== "classes";
|
|
6776
|
+
const styled = createStyled2({
|
|
6777
|
+
themeId: THEME_ID,
|
|
6778
|
+
defaultTheme,
|
|
6779
|
+
rootShouldForwardProp
|
|
6780
|
+
});
|
|
6781
|
+
const memoTheme = unstable_memoTheme;
|
|
6782
|
+
({
|
|
6783
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
6784
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
6785
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
6786
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
6787
|
+
/**
|
|
6788
|
+
* @ignore
|
|
6789
|
+
*/
|
|
6790
|
+
children: PropTypes.node,
|
|
6791
|
+
/**
|
|
6792
|
+
* @ignore
|
|
6793
|
+
*/
|
|
6794
|
+
value: PropTypes.object.isRequired
|
|
6795
|
+
});
|
|
6796
|
+
function useDefaultProps(params) {
|
|
6797
|
+
return useDefaultProps$1(params);
|
|
6508
6798
|
}
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6799
|
+
const defaultStyles = {
|
|
6800
|
+
transition: "none"
|
|
6801
|
+
};
|
|
6802
|
+
function resolveReducedMotionStyles(reducedMotion, styles) {
|
|
6803
|
+
if (reducedMotion === "always") {
|
|
6804
|
+
return styles;
|
|
6805
|
+
}
|
|
6806
|
+
if (reducedMotion === "system") {
|
|
6807
|
+
return {
|
|
6808
|
+
"@media (prefers-reduced-motion: reduce)": styles
|
|
6809
|
+
};
|
|
6810
|
+
}
|
|
6811
|
+
return null;
|
|
6812
|
+
}
|
|
6813
|
+
const EMPTY_STYLE = {};
|
|
6814
|
+
const DEFAULT_TRANSITION_PROPS = ["all"];
|
|
6815
|
+
const EMPTY_OPTIONS = {};
|
|
6816
|
+
function getReducedMotionStyles(theme, styles) {
|
|
6817
|
+
const resolvedStyles = defaultStyles;
|
|
6818
|
+
return resolveReducedMotionStyles(theme.motion?.reducedMotion, resolvedStyles);
|
|
6819
|
+
}
|
|
6820
|
+
function getTransitionStyles(theme, props = DEFAULT_TRANSITION_PROPS, options = EMPTY_OPTIONS) {
|
|
6821
|
+
const transition = theme.transitions?.create?.(props, options);
|
|
6822
|
+
const reducedMotionStyles = getReducedMotionStyles(theme);
|
|
6823
|
+
if (transition === void 0) {
|
|
6824
|
+
return reducedMotionStyles ?? EMPTY_STYLE;
|
|
6825
|
+
}
|
|
6826
|
+
const transitionStyles = {
|
|
6827
|
+
transition
|
|
6828
|
+
};
|
|
6829
|
+
return reducedMotionStyles ? {
|
|
6830
|
+
...transitionStyles,
|
|
6831
|
+
...reducedMotionStyles
|
|
6832
|
+
} : transitionStyles;
|
|
6833
|
+
}
|
|
6834
|
+
const { makeStyles } = createMakeAndWithStyles({
|
|
6835
|
+
useTheme
|
|
6836
|
+
});
|
|
6837
|
+
const { tss } = createTss({
|
|
6838
|
+
"useContext": function useContext2() {
|
|
6839
|
+
const theme = useTheme();
|
|
6840
|
+
return { theme };
|
|
6841
|
+
},
|
|
6842
|
+
"usePlugin": useMuiThemeStyleOverridesPlugin
|
|
6843
|
+
});
|
|
6844
|
+
const useStyles$2 = tss.create({});
|
|
6845
|
+
function setRef$1(ref, value) {
|
|
6846
|
+
if (typeof ref === "function") {
|
|
6847
|
+
ref(value);
|
|
6848
|
+
} else if (ref) {
|
|
6849
|
+
ref.current = value;
|
|
6850
|
+
}
|
|
6512
6851
|
}
|
|
6513
6852
|
function getTypeByValue(value) {
|
|
6514
6853
|
const valueType = typeof value;
|
|
@@ -6584,7 +6923,7 @@ const PaperRoot = styled("div", {
|
|
|
6584
6923
|
}) => ({
|
|
6585
6924
|
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
6586
6925
|
color: (theme.vars || theme).palette.text.primary,
|
|
6587
|
-
|
|
6926
|
+
...getTransitionStyles(theme, "box-shadow"),
|
|
6588
6927
|
variants: [{
|
|
6589
6928
|
props: ({
|
|
6590
6929
|
ownerState
|
|
@@ -6746,22 +7085,22 @@ function getReactElementRef(element) {
|
|
|
6746
7085
|
}
|
|
6747
7086
|
return element?.ref || null;
|
|
6748
7087
|
}
|
|
6749
|
-
function getContainer(
|
|
6750
|
-
return typeof
|
|
7088
|
+
function getContainer(container2) {
|
|
7089
|
+
return typeof container2 === "function" ? container2() : container2;
|
|
6751
7090
|
}
|
|
6752
7091
|
const Portal = /* @__PURE__ */ React.forwardRef(function Portal2(props, forwardedRef) {
|
|
6753
7092
|
const {
|
|
6754
7093
|
children,
|
|
6755
|
-
container,
|
|
7094
|
+
container: container2,
|
|
6756
7095
|
disablePortal = false
|
|
6757
7096
|
} = props;
|
|
6758
7097
|
const [mountNode, setMountNode] = React.useState(null);
|
|
6759
7098
|
const handleRef = useForkRef$1(/* @__PURE__ */ React.isValidElement(children) ? getReactElementRef(children) : null, forwardedRef);
|
|
6760
7099
|
useEnhancedEffect$1(() => {
|
|
6761
7100
|
if (!disablePortal) {
|
|
6762
|
-
setMountNode(getContainer(
|
|
7101
|
+
setMountNode(getContainer(container2) || document.body);
|
|
6763
7102
|
}
|
|
6764
|
-
}, [
|
|
7103
|
+
}, [container2, disablePortal]);
|
|
6765
7104
|
useEnhancedEffect$1(() => {
|
|
6766
7105
|
if (mountNode && !disablePortal) {
|
|
6767
7106
|
setRef$1(forwardedRef, mountNode);
|
|
@@ -6814,30 +7153,17 @@ Portal.propTypes = {
|
|
|
6814
7153
|
function getTypographyUtilityClass(slot) {
|
|
6815
7154
|
return generateUtilityClass("MuiTypography", slot);
|
|
6816
7155
|
}
|
|
6817
|
-
generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom"
|
|
6818
|
-
const v6Colors = {
|
|
6819
|
-
primary: true,
|
|
6820
|
-
secondary: true,
|
|
6821
|
-
error: true,
|
|
6822
|
-
info: true,
|
|
6823
|
-
success: true,
|
|
6824
|
-
warning: true,
|
|
6825
|
-
textPrimary: true,
|
|
6826
|
-
textSecondary: true,
|
|
6827
|
-
textDisabled: true
|
|
6828
|
-
};
|
|
6829
|
-
const extendSxProp = internal_createExtendSxProp();
|
|
7156
|
+
generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom"]);
|
|
6830
7157
|
const useUtilityClasses = (ownerState) => {
|
|
6831
7158
|
const {
|
|
6832
7159
|
align,
|
|
6833
7160
|
gutterBottom,
|
|
6834
7161
|
noWrap,
|
|
6835
|
-
paragraph,
|
|
6836
7162
|
variant,
|
|
6837
7163
|
classes
|
|
6838
7164
|
} = ownerState;
|
|
6839
7165
|
const slots = {
|
|
6840
|
-
root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap"
|
|
7166
|
+
root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize(align)}`, gutterBottom && "gutterBottom", noWrap && "noWrap"]
|
|
6841
7167
|
};
|
|
6842
7168
|
return composeClasses(slots, getTypographyUtilityClass, classes);
|
|
6843
7169
|
};
|
|
@@ -6848,7 +7174,7 @@ const TypographyRoot = styled("span", {
|
|
|
6848
7174
|
const {
|
|
6849
7175
|
ownerState
|
|
6850
7176
|
} = props;
|
|
6851
|
-
return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom
|
|
7177
|
+
return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom];
|
|
6852
7178
|
}
|
|
6853
7179
|
})(memoTheme(({
|
|
6854
7180
|
theme
|
|
@@ -6906,13 +7232,6 @@ const TypographyRoot = styled("span", {
|
|
|
6906
7232
|
style: {
|
|
6907
7233
|
marginBottom: "0.35em"
|
|
6908
7234
|
}
|
|
6909
|
-
}, {
|
|
6910
|
-
props: ({
|
|
6911
|
-
ownerState
|
|
6912
|
-
}) => ownerState.paragraph,
|
|
6913
|
-
style: {
|
|
6914
|
-
marginBottom: 16
|
|
6915
|
-
}
|
|
6916
7235
|
}]
|
|
6917
7236
|
})));
|
|
6918
7237
|
const defaultVariantMapping = {
|
|
@@ -6929,27 +7248,17 @@ const defaultVariantMapping = {
|
|
|
6929
7248
|
inherit: "p"
|
|
6930
7249
|
};
|
|
6931
7250
|
const Typography = /* @__PURE__ */ React.forwardRef(function Typography2(inProps, ref) {
|
|
6932
|
-
const {
|
|
6933
|
-
color: color2,
|
|
6934
|
-
...themeProps
|
|
6935
|
-
} = useDefaultProps({
|
|
7251
|
+
const props = useDefaultProps({
|
|
6936
7252
|
props: inProps,
|
|
6937
7253
|
name: "MuiTypography"
|
|
6938
7254
|
});
|
|
6939
|
-
const isSxColor = !v6Colors[color2];
|
|
6940
|
-
const props = extendSxProp({
|
|
6941
|
-
...themeProps,
|
|
6942
|
-
...isSxColor && {
|
|
6943
|
-
color: color2
|
|
6944
|
-
}
|
|
6945
|
-
});
|
|
6946
7255
|
const {
|
|
7256
|
+
color: color2,
|
|
6947
7257
|
align = "inherit",
|
|
6948
7258
|
className,
|
|
6949
7259
|
component,
|
|
6950
7260
|
gutterBottom = false,
|
|
6951
7261
|
noWrap = false,
|
|
6952
|
-
paragraph = false,
|
|
6953
7262
|
variant = "body1",
|
|
6954
7263
|
variantMapping = defaultVariantMapping,
|
|
6955
7264
|
...other
|
|
@@ -6962,11 +7271,10 @@ const Typography = /* @__PURE__ */ React.forwardRef(function Typography2(inProps
|
|
|
6962
7271
|
component,
|
|
6963
7272
|
gutterBottom,
|
|
6964
7273
|
noWrap,
|
|
6965
|
-
paragraph,
|
|
6966
7274
|
variant,
|
|
6967
7275
|
variantMapping
|
|
6968
7276
|
};
|
|
6969
|
-
const Component = component ||
|
|
7277
|
+
const Component = component || variantMapping[variant] || defaultVariantMapping[variant] || "span";
|
|
6970
7278
|
const classes = useUtilityClasses(ownerState);
|
|
6971
7279
|
return /* @__PURE__ */ jsx(TypographyRoot, {
|
|
6972
7280
|
as: Component,
|
|
@@ -7028,12 +7336,6 @@ Typography.propTypes = {
|
|
|
7028
7336
|
* @default false
|
|
7029
7337
|
*/
|
|
7030
7338
|
noWrap: PropTypes.bool,
|
|
7031
|
-
/**
|
|
7032
|
-
* If `true`, the element will be a paragraph element.
|
|
7033
|
-
* @default false
|
|
7034
|
-
* @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.
|
|
7035
|
-
*/
|
|
7036
|
-
paragraph: PropTypes.bool,
|
|
7037
7339
|
/**
|
|
7038
7340
|
* @ignore
|
|
7039
7341
|
*/
|
|
@@ -8663,7 +8965,7 @@ function getAnchorEl(anchorEl) {
|
|
|
8663
8965
|
const useEnhancedEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
8664
8966
|
const defaultPopperOptions = {};
|
|
8665
8967
|
const Popper = React.forwardRef((props, ref) => {
|
|
8666
|
-
const { anchorEl, children, container, disablePortal = false, keepMounted = false, modifiers: modifiers2, open, placement: initialPlacement = "bottom", popperOptions = defaultPopperOptions, popperRef: popperRefProp, style: style2, transition = false, ...other } = props;
|
|
8968
|
+
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;
|
|
8667
8969
|
const tooltipRef = React.useRef(null);
|
|
8668
8970
|
const ownRef = useForkRef(tooltipRef, ref);
|
|
8669
8971
|
const popperRef = React.useRef(null);
|
|
@@ -8760,7 +9062,7 @@ const Popper = React.forwardRef((props, ref) => {
|
|
|
8760
9062
|
onExited: handleExited
|
|
8761
9063
|
};
|
|
8762
9064
|
}
|
|
8763
|
-
return jsx(Portal, { disablePortal, container, children: jsx("div", { ref: handleRef, role: "tooltip", ...other, style: {
|
|
9065
|
+
return jsx(Portal, { disablePortal, container: container2, children: jsx("div", { ref: handleRef, role: "tooltip", ...other, style: {
|
|
8764
9066
|
// Prevents scroll issue, waiting for Popper.js to add this style once initiated.
|
|
8765
9067
|
position: "fixed",
|
|
8766
9068
|
// Fix Popper.js display issue
|
|
@@ -8770,6 +9072,18 @@ const Popper = React.forwardRef((props, ref) => {
|
|
|
8770
9072
|
...style2
|
|
8771
9073
|
}, children: typeof children === "function" ? children(childProps) : children }) });
|
|
8772
9074
|
});
|
|
9075
|
+
function _assertThisInitialized(e) {
|
|
9076
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
9077
|
+
return e;
|
|
9078
|
+
}
|
|
9079
|
+
function _setPrototypeOf(t, e) {
|
|
9080
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
|
|
9081
|
+
return t2.__proto__ = e2, t2;
|
|
9082
|
+
}, _setPrototypeOf(t, e);
|
|
9083
|
+
}
|
|
9084
|
+
function _inheritsLoose(t, o) {
|
|
9085
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
9086
|
+
}
|
|
8773
9087
|
var safeIsNaN = Number.isNaN || function ponyfill(value) {
|
|
8774
9088
|
return typeof value === "number" && value !== value;
|
|
8775
9089
|
};
|