@cmdless/ui-runtime 0.0.4 → 0.0.5

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.
@@ -0,0 +1,995 @@
1
+ import { r as requireReact, a as reactExports, j as jsxRuntimeExports } from "./Mantine.context-oJEjRkJu.js";
2
+ var reactDom = { exports: {} };
3
+ var reactDom_production = {};
4
+ var hasRequiredReactDom_production;
5
+ function requireReactDom_production() {
6
+ if (hasRequiredReactDom_production) return reactDom_production;
7
+ hasRequiredReactDom_production = 1;
8
+ var React = requireReact();
9
+ function formatProdErrorMessage(code) {
10
+ var url = "https://react.dev/errors/" + code;
11
+ if (1 < arguments.length) {
12
+ url += "?args[]=" + encodeURIComponent(arguments[1]);
13
+ for (var i = 2; i < arguments.length; i++)
14
+ url += "&args[]=" + encodeURIComponent(arguments[i]);
15
+ }
16
+ return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
17
+ }
18
+ function noop() {
19
+ }
20
+ var Internals = {
21
+ d: {
22
+ f: noop,
23
+ r: function() {
24
+ throw Error(formatProdErrorMessage(522));
25
+ },
26
+ D: noop,
27
+ C: noop,
28
+ L: noop,
29
+ m: noop,
30
+ X: noop,
31
+ S: noop,
32
+ M: noop
33
+ },
34
+ p: 0,
35
+ findDOMNode: null
36
+ }, REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_RECOVERABLE_TYPE = /* @__PURE__ */ Symbol.for("react.recoverable"), REACT_OPTIMISTIC_KEY = /* @__PURE__ */ Symbol.for("react.optimistic_key");
37
+ function createPortal$1(children, containerInfo, implementation) {
38
+ var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
39
+ return {
40
+ $$typeof: REACT_PORTAL_TYPE,
41
+ key: null == key ? null : key === REACT_OPTIMISTIC_KEY ? REACT_OPTIMISTIC_KEY : "" + key,
42
+ children,
43
+ containerInfo,
44
+ implementation
45
+ };
46
+ }
47
+ var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
48
+ function getCrossOriginStringAs(as, input) {
49
+ if ("font" === as) return "";
50
+ if ("string" === typeof input)
51
+ return "use-credentials" === input ? input : "";
52
+ }
53
+ reactDom_production.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
54
+ reactDom_production.browser = function(reason) {
55
+ return { $$typeof: REACT_RECOVERABLE_TYPE, _reason: reason };
56
+ };
57
+ reactDom_production.createPortal = function(children, container) {
58
+ var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
59
+ if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
60
+ throw Error(formatProdErrorMessage(299));
61
+ return createPortal$1(children, container, null, key);
62
+ };
63
+ reactDom_production.flushSync = function(fn) {
64
+ var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
65
+ try {
66
+ if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
67
+ } finally {
68
+ ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
69
+ }
70
+ };
71
+ reactDom_production.preconnect = function(href, options) {
72
+ "string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
73
+ };
74
+ reactDom_production.prefetchDNS = function(href) {
75
+ "string" === typeof href && Internals.d.D(href);
76
+ };
77
+ reactDom_production.preinit = function(href, options) {
78
+ if ("string" === typeof href && options && "string" === typeof options.as) {
79
+ var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
80
+ "style" === as ? Internals.d.S(
81
+ href,
82
+ "string" === typeof options.precedence ? options.precedence : void 0,
83
+ {
84
+ crossOrigin,
85
+ integrity,
86
+ fetchPriority
87
+ }
88
+ ) : "script" === as && Internals.d.X(href, {
89
+ crossOrigin,
90
+ integrity,
91
+ fetchPriority,
92
+ nonce: "string" === typeof options.nonce ? options.nonce : void 0
93
+ });
94
+ }
95
+ };
96
+ reactDom_production.preinitModule = function(href, options) {
97
+ if ("string" === typeof href)
98
+ if ("object" === typeof options && null !== options) {
99
+ if (null == options.as || "script" === options.as) {
100
+ var crossOrigin = getCrossOriginStringAs(
101
+ options.as,
102
+ options.crossOrigin
103
+ );
104
+ Internals.d.M(href, {
105
+ crossOrigin,
106
+ integrity: "string" === typeof options.integrity ? options.integrity : void 0,
107
+ nonce: "string" === typeof options.nonce ? options.nonce : void 0,
108
+ fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0
109
+ });
110
+ }
111
+ } else null == options && Internals.d.M(href);
112
+ };
113
+ reactDom_production.preload = function(href, options) {
114
+ if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
115
+ var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
116
+ Internals.d.L(href, as, {
117
+ crossOrigin,
118
+ integrity: "string" === typeof options.integrity ? options.integrity : void 0,
119
+ nonce: "string" === typeof options.nonce ? options.nonce : void 0,
120
+ type: "string" === typeof options.type ? options.type : void 0,
121
+ fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
122
+ referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
123
+ imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
124
+ imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
125
+ media: "string" === typeof options.media ? options.media : void 0
126
+ });
127
+ }
128
+ };
129
+ reactDom_production.preloadModule = function(href, options) {
130
+ if ("string" === typeof href)
131
+ if (options) {
132
+ var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
133
+ Internals.d.m(href, {
134
+ as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
135
+ crossOrigin,
136
+ integrity: "string" === typeof options.integrity ? options.integrity : void 0,
137
+ nonce: "string" === typeof options.nonce ? options.nonce : void 0,
138
+ fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0
139
+ });
140
+ } else Internals.d.m(href);
141
+ };
142
+ reactDom_production.requestFormReset = function(form) {
143
+ Internals.d.r(form);
144
+ };
145
+ reactDom_production.unstable_batchedUpdates = function(fn, a) {
146
+ return fn(a);
147
+ };
148
+ reactDom_production.useFormState = function(action, initialState, permalink) {
149
+ return ReactSharedInternals.H.useFormState(action, initialState, permalink);
150
+ };
151
+ reactDom_production.useFormStatus = function() {
152
+ return ReactSharedInternals.H.useHostTransitionStatus();
153
+ };
154
+ reactDom_production.version = "19.3.1";
155
+ return reactDom_production;
156
+ }
157
+ var hasRequiredReactDom;
158
+ function requireReactDom() {
159
+ if (hasRequiredReactDom) return reactDom.exports;
160
+ hasRequiredReactDom = 1;
161
+ function checkDCE() {
162
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
163
+ return;
164
+ }
165
+ try {
166
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
167
+ } catch (err) {
168
+ console.error(err);
169
+ }
170
+ }
171
+ {
172
+ checkDCE();
173
+ reactDom.exports = requireReactDom_production();
174
+ }
175
+ return reactDom.exports;
176
+ }
177
+ function keys(object) {
178
+ return Object.keys(object);
179
+ }
180
+ function isObject(item) {
181
+ return item && typeof item === "object" && !Array.isArray(item);
182
+ }
183
+ function deepMerge(target, source) {
184
+ const result = { ...target };
185
+ const _source = source;
186
+ if (isObject(target) && isObject(source)) Object.keys(source).forEach((key) => {
187
+ if (isObject(_source[key])) {
188
+ if (!(key in target)) result[key] = _source[key];
189
+ else result[key] = deepMerge(result[key], _source[key]);
190
+ } else result[key] = _source[key];
191
+ });
192
+ return result;
193
+ }
194
+ function getTransformedScaledValue(value) {
195
+ if (typeof value !== "string" || !value.includes("var(--mantine-scale)")) return value;
196
+ return value.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim();
197
+ }
198
+ function px(value) {
199
+ const transformedValue = getTransformedScaledValue(value);
200
+ if (typeof transformedValue === "number") return transformedValue;
201
+ if (typeof transformedValue === "string") {
202
+ if (transformedValue.includes("calc") || transformedValue.includes("var")) return transformedValue;
203
+ if (transformedValue.includes("px")) return Number(transformedValue.replace("px", ""));
204
+ if (transformedValue.includes("rem")) return Number(transformedValue.replace("rem", "")) * 16;
205
+ if (transformedValue.includes("em")) return Number(transformedValue.replace("em", "")) * 16;
206
+ return Number(transformedValue);
207
+ }
208
+ return NaN;
209
+ }
210
+ function scaleRem(remValue) {
211
+ if (remValue === "0rem") return "0rem";
212
+ return `calc(${remValue} * var(--mantine-scale))`;
213
+ }
214
+ function createConverter(units, { shouldScale = false } = {}) {
215
+ function converter(value) {
216
+ if (value === 0 || value === "0") return `0${units}`;
217
+ if (typeof value === "number") {
218
+ const val = `${value / 16}${units}`;
219
+ return shouldScale ? scaleRem(val) : val;
220
+ }
221
+ if (typeof value === "string") {
222
+ if (value === "") return value;
223
+ if (value.startsWith("calc(") || value.startsWith("clamp(") || value.includes("rgba(")) return value;
224
+ if (value.includes(",")) return value.split(",").map((val) => converter(val)).join(",");
225
+ if (value.includes(" ")) return value.split(" ").map((val) => converter(val)).join(" ");
226
+ const replaced = value.replace("px", "");
227
+ if (!Number.isNaN(Number(replaced))) {
228
+ const val = `${Number(replaced) / 16}${units}`;
229
+ return shouldScale ? scaleRem(val) : val;
230
+ }
231
+ }
232
+ return value;
233
+ }
234
+ return converter;
235
+ }
236
+ const rem = createConverter("rem", { shouldScale: true });
237
+ const em = createConverter("em");
238
+ const useIsomorphicEffect = typeof document !== "undefined" ? reactExports.useLayoutEffect : reactExports.useEffect;
239
+ function getPrimaryShade(theme, colorScheme) {
240
+ if (typeof theme.primaryShade === "number") return theme.primaryShade;
241
+ if (colorScheme === "dark") return theme.primaryShade.dark;
242
+ return theme.primaryShade.light;
243
+ }
244
+ function isHexColor(hex) {
245
+ return /^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(hex);
246
+ }
247
+ function hexToRgba(color) {
248
+ let hexString = color.replace("#", "");
249
+ if (hexString.length === 3) {
250
+ const shorthandHex = hexString.split("");
251
+ hexString = [
252
+ shorthandHex[0],
253
+ shorthandHex[0],
254
+ shorthandHex[1],
255
+ shorthandHex[1],
256
+ shorthandHex[2],
257
+ shorthandHex[2]
258
+ ].join("");
259
+ }
260
+ if (hexString.length === 8) {
261
+ const alpha2 = parseInt(hexString.slice(6, 8), 16) / 255;
262
+ return {
263
+ r: parseInt(hexString.slice(0, 2), 16),
264
+ g: parseInt(hexString.slice(2, 4), 16),
265
+ b: parseInt(hexString.slice(4, 6), 16),
266
+ a: alpha2
267
+ };
268
+ }
269
+ const parsed = parseInt(hexString, 16);
270
+ return {
271
+ r: parsed >> 16 & 255,
272
+ g: parsed >> 8 & 255,
273
+ b: parsed & 255,
274
+ a: 1
275
+ };
276
+ }
277
+ function rgbStringToRgba(color) {
278
+ const [r, g, b, a] = color.replace(/[^0-9,./]/g, "").split(/[/,]/).map(Number);
279
+ return {
280
+ r,
281
+ g,
282
+ b,
283
+ a: a === void 0 ? 1 : a
284
+ };
285
+ }
286
+ function hslStringToRgba(hslaString) {
287
+ const matches = hslaString.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);
288
+ if (!matches) return {
289
+ r: 0,
290
+ g: 0,
291
+ b: 0,
292
+ a: 1
293
+ };
294
+ const h = parseInt(matches[1], 10);
295
+ const s = parseInt(matches[2], 10) / 100;
296
+ const l = parseInt(matches[3], 10) / 100;
297
+ const a = matches[5] ? parseFloat(matches[5]) : void 0;
298
+ const chroma = (1 - Math.abs(2 * l - 1)) * s;
299
+ const huePrime = h / 60;
300
+ const x = chroma * (1 - Math.abs(huePrime % 2 - 1));
301
+ const m = l - chroma / 2;
302
+ let r;
303
+ let g;
304
+ let b;
305
+ if (huePrime >= 0 && huePrime < 1) {
306
+ r = chroma;
307
+ g = x;
308
+ b = 0;
309
+ } else if (huePrime >= 1 && huePrime < 2) {
310
+ r = x;
311
+ g = chroma;
312
+ b = 0;
313
+ } else if (huePrime >= 2 && huePrime < 3) {
314
+ r = 0;
315
+ g = chroma;
316
+ b = x;
317
+ } else if (huePrime >= 3 && huePrime < 4) {
318
+ r = 0;
319
+ g = x;
320
+ b = chroma;
321
+ } else if (huePrime >= 4 && huePrime < 5) {
322
+ r = x;
323
+ g = 0;
324
+ b = chroma;
325
+ } else {
326
+ r = chroma;
327
+ g = 0;
328
+ b = x;
329
+ }
330
+ return {
331
+ r: Math.round((r + m) * 255),
332
+ g: Math.round((g + m) * 255),
333
+ b: Math.round((b + m) * 255),
334
+ a: a || 1
335
+ };
336
+ }
337
+ function toRgba(color) {
338
+ if (isHexColor(color)) return hexToRgba(color);
339
+ if (color.startsWith("rgb")) return rgbStringToRgba(color);
340
+ if (color.startsWith("hsl")) return hslStringToRgba(color);
341
+ return {
342
+ r: 0,
343
+ g: 0,
344
+ b: 0,
345
+ a: 1
346
+ };
347
+ }
348
+ function gammaCorrect(c) {
349
+ return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
350
+ }
351
+ function getLightnessFromOklch(oklchColor) {
352
+ const match = oklchColor.match(/oklch\((.*?)%\s/);
353
+ return match ? parseFloat(match[1]) : null;
354
+ }
355
+ function luminance(color) {
356
+ if (color.startsWith("oklch(")) return (getLightnessFromOklch(color) || 0) / 100;
357
+ const { r, g, b } = toRgba(color);
358
+ const sR = r / 255;
359
+ const sG = g / 255;
360
+ const sB = b / 255;
361
+ const rLinear = gammaCorrect(sR);
362
+ const gLinear = gammaCorrect(sG);
363
+ const bLinear = gammaCorrect(sB);
364
+ return 0.2126 * rLinear + 0.7152 * gLinear + 0.0722 * bLinear;
365
+ }
366
+ function isLightColor(color, luminanceThreshold = 0.179) {
367
+ if (color.startsWith("var(")) return false;
368
+ return luminance(color) > luminanceThreshold;
369
+ }
370
+ function parseThemeColor({ color, theme, colorScheme }) {
371
+ if (typeof color !== "string") throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof color}`);
372
+ if (color === "bright") return {
373
+ color,
374
+ value: colorScheme === "dark" ? theme.white : theme.black,
375
+ shade: void 0,
376
+ isThemeColor: false,
377
+ isLight: isLightColor(colorScheme === "dark" ? theme.white : theme.black, theme.luminanceThreshold),
378
+ variable: "--mantine-color-bright"
379
+ };
380
+ if (color === "dimmed") return {
381
+ color,
382
+ value: colorScheme === "dark" ? theme.colors.dark[2] : theme.colors.gray[7],
383
+ shade: void 0,
384
+ isThemeColor: false,
385
+ isLight: isLightColor(colorScheme === "dark" ? theme.colors.dark[2] : theme.colors.gray[6], theme.luminanceThreshold),
386
+ variable: "--mantine-color-dimmed"
387
+ };
388
+ if (color === "white" || color === "black") return {
389
+ color,
390
+ value: color === "white" ? theme.white : theme.black,
391
+ shade: void 0,
392
+ isThemeColor: false,
393
+ isLight: isLightColor(color === "white" ? theme.white : theme.black, theme.luminanceThreshold),
394
+ variable: `--mantine-color-${color}`
395
+ };
396
+ const [_color, shade] = color.split(".");
397
+ const colorShade = shade ? Number(shade) : void 0;
398
+ const isThemeColor = _color in theme.colors;
399
+ if (isThemeColor) {
400
+ const colorValue = colorShade !== void 0 ? theme.colors[_color][colorShade] : theme.colors[_color][getPrimaryShade(theme, colorScheme || "light")];
401
+ return {
402
+ color: _color,
403
+ value: colorValue,
404
+ shade: colorShade,
405
+ isThemeColor,
406
+ isLight: isLightColor(colorValue, theme.luminanceThreshold),
407
+ variable: shade ? `--mantine-color-${_color}-${colorShade}` : `--mantine-color-${_color}-filled`
408
+ };
409
+ }
410
+ return {
411
+ color,
412
+ value: color,
413
+ isThemeColor,
414
+ isLight: isLightColor(color, theme.luminanceThreshold),
415
+ shade: colorShade,
416
+ variable: void 0
417
+ };
418
+ }
419
+ function getThemeColor(color, theme) {
420
+ const parsed = parseThemeColor({
421
+ color: color || theme.primaryColor,
422
+ theme
423
+ });
424
+ return parsed.variable ? `var(${parsed.variable})` : color;
425
+ }
426
+ function isVirtualColor(value) {
427
+ return !!value && typeof value === "object" && "mantine-virtual-color" in value;
428
+ }
429
+ function darken(color, alpha2) {
430
+ if (color.startsWith("var(")) return `color-mix(in srgb, ${color}, black ${alpha2 * 100}%)`;
431
+ const { r, g, b, a } = toRgba(color);
432
+ const f = 1 - alpha2;
433
+ const dark = (input) => Math.round(input * f);
434
+ return `rgba(${dark(r)}, ${dark(g)}, ${dark(b)}, ${a})`;
435
+ }
436
+ function getGradient(gradient, theme) {
437
+ const merged = {
438
+ from: gradient?.from || theme.defaultGradient.from,
439
+ to: gradient?.to || theme.defaultGradient.to,
440
+ deg: gradient?.deg ?? theme.defaultGradient.deg ?? 0
441
+ };
442
+ const fromColor = getThemeColor(merged.from, theme);
443
+ const toColor = getThemeColor(merged.to, theme);
444
+ return `linear-gradient(${merged.deg}deg, ${fromColor} 0%, ${toColor} 100%)`;
445
+ }
446
+ function rgba(color, alpha2) {
447
+ if (typeof color !== "string" || alpha2 > 1 || alpha2 < 0) return "rgba(0, 0, 0, 1)";
448
+ if (color.startsWith("var(")) return `color-mix(in srgb, ${color}, transparent ${(1 - alpha2) * 100}%)`;
449
+ if (color.startsWith("oklch")) {
450
+ if (color.includes("/")) return color.replace(/\/\s*[\d.]+\s*\)/, `/ ${alpha2})`);
451
+ return color.replace(")", ` / ${alpha2})`);
452
+ }
453
+ const { r, g, b } = toRgba(color);
454
+ return `rgba(${r}, ${g}, ${b}, ${alpha2})`;
455
+ }
456
+ const alpha = rgba;
457
+ const defaultVariantColorsResolver = ({ color, theme, variant, gradient, autoContrast }) => {
458
+ const parsed = parseThemeColor({
459
+ color,
460
+ theme
461
+ });
462
+ const _autoContrast = typeof autoContrast === "boolean" ? autoContrast : theme.autoContrast;
463
+ if (variant === "none") return {
464
+ background: "transparent",
465
+ hover: "transparent",
466
+ color: "inherit",
467
+ border: "none"
468
+ };
469
+ if (variant === "filled") {
470
+ const isVirtual = parsed.isThemeColor && parsed.shade === void 0 && isVirtualColor(theme.colors[parsed.color]);
471
+ const textColor = _autoContrast ? isVirtual ? `var(--mantine-color-${parsed.color}-contrast)` : parsed.isLight ? "var(--mantine-color-black)" : "var(--mantine-color-white)" : "var(--mantine-color-white)";
472
+ if (parsed.isThemeColor) {
473
+ if (parsed.shade === void 0) return {
474
+ background: `var(--mantine-color-${color}-filled)`,
475
+ hover: `var(--mantine-color-${color}-filled-hover)`,
476
+ color: textColor,
477
+ border: `${rem(1)} solid transparent`
478
+ };
479
+ return {
480
+ background: `var(--mantine-color-${parsed.color}-${parsed.shade})`,
481
+ hover: `var(--mantine-color-${parsed.color}-${parsed.shade === 9 ? 8 : parsed.shade + 1})`,
482
+ color: textColor,
483
+ border: `${rem(1)} solid transparent`
484
+ };
485
+ }
486
+ return {
487
+ background: color,
488
+ hover: darken(color, 0.1),
489
+ color: textColor,
490
+ border: `${rem(1)} solid transparent`
491
+ };
492
+ }
493
+ if (variant === "light") {
494
+ if (parsed.isThemeColor) {
495
+ if (parsed.shade === void 0) return {
496
+ background: `var(--mantine-color-${color}-light)`,
497
+ hover: `var(--mantine-color-${color}-light-hover)`,
498
+ color: `var(--mantine-color-${color}-light-color)`,
499
+ border: `${rem(1)} solid transparent`
500
+ };
501
+ const parsedColor = theme.colors[parsed.color][parsed.shade];
502
+ return {
503
+ background: parsedColor,
504
+ hover: darken(parsedColor, 0.1),
505
+ color: `var(--mantine-color-${parsed.color}-light-color)`,
506
+ border: `${rem(1)} solid transparent`
507
+ };
508
+ }
509
+ return {
510
+ background: rgba(color, 0.1),
511
+ hover: rgba(color, 0.12),
512
+ color,
513
+ border: `${rem(1)} solid transparent`
514
+ };
515
+ }
516
+ if (variant === "outline") {
517
+ if (parsed.isThemeColor) {
518
+ if (parsed.shade === void 0) return {
519
+ background: "transparent",
520
+ hover: `var(--mantine-color-${color}-outline-hover)`,
521
+ color: `var(--mantine-color-${color}-outline)`,
522
+ border: `${rem(1)} solid var(--mantine-color-${color}-outline)`
523
+ };
524
+ return {
525
+ background: "transparent",
526
+ hover: rgba(theme.colors[parsed.color][parsed.shade], 0.05),
527
+ color: `var(--mantine-color-${parsed.color}-${parsed.shade})`,
528
+ border: `${rem(1)} solid var(--mantine-color-${parsed.color}-${parsed.shade})`
529
+ };
530
+ }
531
+ return {
532
+ background: "transparent",
533
+ hover: rgba(color, 0.05),
534
+ color,
535
+ border: `${rem(1)} solid ${color}`
536
+ };
537
+ }
538
+ if (variant === "subtle") {
539
+ if (parsed.isThemeColor) {
540
+ if (parsed.shade === void 0) return {
541
+ background: "transparent",
542
+ hover: `var(--mantine-color-${color}-light-hover)`,
543
+ color: `var(--mantine-color-${color}-light-color)`,
544
+ border: `${rem(1)} solid transparent`
545
+ };
546
+ const parsedColor = theme.colors[parsed.color][parsed.shade];
547
+ return {
548
+ background: "transparent",
549
+ hover: rgba(parsedColor, 0.12),
550
+ color: `var(--mantine-color-${parsed.color}-${Math.min(parsed.shade, 6)})`,
551
+ border: `${rem(1)} solid transparent`
552
+ };
553
+ }
554
+ return {
555
+ background: "transparent",
556
+ hover: rgba(color, 0.12),
557
+ color,
558
+ border: `${rem(1)} solid transparent`
559
+ };
560
+ }
561
+ if (variant === "transparent") {
562
+ if (parsed.isThemeColor) {
563
+ if (parsed.shade === void 0) return {
564
+ background: "transparent",
565
+ hover: "transparent",
566
+ color: `var(--mantine-color-${color}-light-color)`,
567
+ border: `${rem(1)} solid transparent`
568
+ };
569
+ return {
570
+ background: "transparent",
571
+ hover: "transparent",
572
+ color: `var(--mantine-color-${parsed.color}-${Math.min(parsed.shade, 6)})`,
573
+ border: `${rem(1)} solid transparent`
574
+ };
575
+ }
576
+ return {
577
+ background: "transparent",
578
+ hover: "transparent",
579
+ color,
580
+ border: `${rem(1)} solid transparent`
581
+ };
582
+ }
583
+ if (variant === "white") {
584
+ if (parsed.isThemeColor) {
585
+ if (parsed.shade === void 0) return {
586
+ background: "var(--mantine-color-white)",
587
+ hover: darken(theme.white, 0.01),
588
+ color: `var(--mantine-color-${color}-filled)`,
589
+ border: `${rem(1)} solid transparent`
590
+ };
591
+ return {
592
+ background: "var(--mantine-color-white)",
593
+ hover: darken(theme.white, 0.01),
594
+ color: `var(--mantine-color-${parsed.color}-${parsed.shade})`,
595
+ border: `${rem(1)} solid transparent`
596
+ };
597
+ }
598
+ return {
599
+ background: "var(--mantine-color-white)",
600
+ hover: darken(theme.white, 0.01),
601
+ color,
602
+ border: `${rem(1)} solid transparent`
603
+ };
604
+ }
605
+ if (variant === "gradient") return {
606
+ background: getGradient(gradient, theme),
607
+ hover: getGradient(gradient, theme),
608
+ color: "var(--mantine-color-white)",
609
+ border: "none"
610
+ };
611
+ if (variant === "default") return {
612
+ background: "var(--mantine-color-default)",
613
+ hover: "var(--mantine-color-default-hover)",
614
+ color: "var(--mantine-color-default-color)",
615
+ border: `${rem(1)} solid var(--mantine-color-default-border)`
616
+ };
617
+ return {};
618
+ };
619
+ function getContrastColor({ color, theme, autoContrast, colorScheme }) {
620
+ if (!(typeof autoContrast === "boolean" ? autoContrast : theme.autoContrast)) return "var(--mantine-color-white)";
621
+ return parseThemeColor({
622
+ color: color || theme.primaryColor,
623
+ theme,
624
+ colorScheme
625
+ }).isLight ? "var(--mantine-color-black)" : "var(--mantine-color-white)";
626
+ }
627
+ function getVirtualColorContrast(value, theme, colorScheme) {
628
+ return getContrastColor({
629
+ color: colorScheme === "dark" ? value.dark : value.light,
630
+ theme,
631
+ colorScheme,
632
+ autoContrast: true
633
+ });
634
+ }
635
+ function getPrimaryContrastColor(theme, colorScheme) {
636
+ const primaryColor = theme.colors[theme.primaryColor];
637
+ if (isVirtualColor(primaryColor)) {
638
+ if (!theme.autoContrast) return "var(--mantine-color-white)";
639
+ return getVirtualColorContrast(primaryColor, theme, colorScheme);
640
+ }
641
+ return getContrastColor({
642
+ color: primaryColor[getPrimaryShade(theme, colorScheme)],
643
+ theme,
644
+ autoContrast: null
645
+ });
646
+ }
647
+ const DEFAULT_COLORS = {
648
+ dark: [
649
+ "#C9C9C9",
650
+ "#b8b8b8",
651
+ "#828282",
652
+ "#696969",
653
+ "#424242",
654
+ "#3b3b3b",
655
+ "#2e2e2e",
656
+ "#242424",
657
+ "#1f1f1f",
658
+ "#141414"
659
+ ],
660
+ gray: [
661
+ "#f8f9fa",
662
+ "#f1f3f5",
663
+ "#e9ecef",
664
+ "#dee2e6",
665
+ "#ced4da",
666
+ "#adb5bd",
667
+ "#868e96",
668
+ "#495057",
669
+ "#343a40",
670
+ "#212529"
671
+ ],
672
+ red: [
673
+ "#fff5f5",
674
+ "#ffe3e3",
675
+ "#ffc9c9",
676
+ "#ffa8a8",
677
+ "#ff8787",
678
+ "#ff6b6b",
679
+ "#fa5252",
680
+ "#f03e3e",
681
+ "#e03131",
682
+ "#c92a2a"
683
+ ],
684
+ pink: [
685
+ "#fff0f6",
686
+ "#ffdeeb",
687
+ "#fcc2d7",
688
+ "#faa2c1",
689
+ "#f783ac",
690
+ "#f06595",
691
+ "#e64980",
692
+ "#d6336c",
693
+ "#c2255c",
694
+ "#a61e4d"
695
+ ],
696
+ grape: [
697
+ "#f8f0fc",
698
+ "#f3d9fa",
699
+ "#eebefa",
700
+ "#e599f7",
701
+ "#da77f2",
702
+ "#cc5de8",
703
+ "#be4bdb",
704
+ "#ae3ec9",
705
+ "#9c36b5",
706
+ "#862e9c"
707
+ ],
708
+ violet: [
709
+ "#f3f0ff",
710
+ "#e5dbff",
711
+ "#d0bfff",
712
+ "#b197fc",
713
+ "#9775fa",
714
+ "#845ef7",
715
+ "#7950f2",
716
+ "#7048e8",
717
+ "#6741d9",
718
+ "#5f3dc4"
719
+ ],
720
+ indigo: [
721
+ "#edf2ff",
722
+ "#dbe4ff",
723
+ "#bac8ff",
724
+ "#91a7ff",
725
+ "#748ffc",
726
+ "#5c7cfa",
727
+ "#4c6ef5",
728
+ "#4263eb",
729
+ "#3b5bdb",
730
+ "#364fc7"
731
+ ],
732
+ blue: [
733
+ "#e7f5ff",
734
+ "#d0ebff",
735
+ "#a5d8ff",
736
+ "#74c0fc",
737
+ "#4dabf7",
738
+ "#339af0",
739
+ "#228be6",
740
+ "#1c7ed6",
741
+ "#1971c2",
742
+ "#1864ab"
743
+ ],
744
+ cyan: [
745
+ "#e3fafc",
746
+ "#c5f6fa",
747
+ "#99e9f2",
748
+ "#66d9e8",
749
+ "#3bc9db",
750
+ "#22b8cf",
751
+ "#15aabf",
752
+ "#1098ad",
753
+ "#0c8599",
754
+ "#0b7285"
755
+ ],
756
+ teal: [
757
+ "#e6fcf5",
758
+ "#c3fae8",
759
+ "#96f2d7",
760
+ "#63e6be",
761
+ "#38d9a9",
762
+ "#20c997",
763
+ "#12b886",
764
+ "#0ca678",
765
+ "#099268",
766
+ "#087f5b"
767
+ ],
768
+ green: [
769
+ "#ebfbee",
770
+ "#d3f9d8",
771
+ "#b2f2bb",
772
+ "#8ce99a",
773
+ "#69db7c",
774
+ "#51cf66",
775
+ "#40c057",
776
+ "#37b24d",
777
+ "#2f9e44",
778
+ "#2b8a3e"
779
+ ],
780
+ lime: [
781
+ "#f4fce3",
782
+ "#e9fac8",
783
+ "#d8f5a2",
784
+ "#c0eb75",
785
+ "#a9e34b",
786
+ "#94d82d",
787
+ "#82c91e",
788
+ "#74b816",
789
+ "#66a80f",
790
+ "#5c940d"
791
+ ],
792
+ yellow: [
793
+ "#fff9db",
794
+ "#fff3bf",
795
+ "#ffec99",
796
+ "#ffe066",
797
+ "#ffd43b",
798
+ "#fcc419",
799
+ "#fab005",
800
+ "#f59f00",
801
+ "#f08c00",
802
+ "#e67700"
803
+ ],
804
+ orange: [
805
+ "#fff4e6",
806
+ "#ffe8cc",
807
+ "#ffd8a8",
808
+ "#ffc078",
809
+ "#ffa94d",
810
+ "#ff922b",
811
+ "#fd7e14",
812
+ "#f76707",
813
+ "#e8590c",
814
+ "#d9480f"
815
+ ]
816
+ };
817
+ const DEFAULT_FONT_FAMILY = "-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji";
818
+ const DEFAULT_THEME = {
819
+ scale: 1,
820
+ fontSmoothing: true,
821
+ focusRing: "auto",
822
+ white: "#fff",
823
+ black: "#000",
824
+ colors: DEFAULT_COLORS,
825
+ primaryShade: {
826
+ light: 6,
827
+ dark: 8
828
+ },
829
+ primaryColor: "blue",
830
+ variantColorResolver: defaultVariantColorsResolver,
831
+ autoContrast: false,
832
+ luminanceThreshold: 0.3,
833
+ fontFamily: DEFAULT_FONT_FAMILY,
834
+ fontFamilyMonospace: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",
835
+ respectReducedMotion: false,
836
+ cursorType: "default",
837
+ defaultGradient: {
838
+ from: "blue",
839
+ to: "cyan",
840
+ deg: 45
841
+ },
842
+ defaultRadius: "md",
843
+ activeClassName: "mantine-active",
844
+ focusClassName: "",
845
+ headings: {
846
+ fontFamily: DEFAULT_FONT_FAMILY,
847
+ fontWeight: "700",
848
+ textWrap: "wrap",
849
+ sizes: {
850
+ h1: {
851
+ fontSize: rem(34),
852
+ lineHeight: "1.3"
853
+ },
854
+ h2: {
855
+ fontSize: rem(26),
856
+ lineHeight: "1.35"
857
+ },
858
+ h3: {
859
+ fontSize: rem(22),
860
+ lineHeight: "1.4"
861
+ },
862
+ h4: {
863
+ fontSize: rem(18),
864
+ lineHeight: "1.45"
865
+ },
866
+ h5: {
867
+ fontSize: rem(16),
868
+ lineHeight: "1.5"
869
+ },
870
+ h6: {
871
+ fontSize: rem(14),
872
+ lineHeight: "1.5"
873
+ }
874
+ }
875
+ },
876
+ fontSizes: {
877
+ xs: rem(12),
878
+ sm: rem(14),
879
+ md: rem(16),
880
+ lg: rem(18),
881
+ xl: rem(20)
882
+ },
883
+ lineHeights: {
884
+ xs: "1.4",
885
+ sm: "1.45",
886
+ md: "1.55",
887
+ lg: "1.6",
888
+ xl: "1.65"
889
+ },
890
+ fontWeights: {
891
+ regular: "400",
892
+ medium: "600",
893
+ bold: "700"
894
+ },
895
+ radius: {
896
+ xs: rem(2),
897
+ sm: rem(4),
898
+ md: rem(8),
899
+ lg: rem(16),
900
+ xl: rem(32)
901
+ },
902
+ spacing: {
903
+ xs: rem(10),
904
+ sm: rem(12),
905
+ md: rem(16),
906
+ lg: rem(20),
907
+ xl: rem(32)
908
+ },
909
+ breakpoints: {
910
+ xs: "36em",
911
+ sm: "48em",
912
+ md: "62em",
913
+ lg: "75em",
914
+ xl: "88em"
915
+ },
916
+ shadows: {
917
+ xs: `0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), 0 ${rem(1)} ${rem(2)} rgba(0, 0, 0, 0.1)`,
918
+ sm: `0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(10)} ${rem(15)} ${rem(-5)}, rgba(0, 0, 0, 0.04) 0 ${rem(7)} ${rem(7)} ${rem(-5)}`,
919
+ md: `0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(20)} ${rem(25)} ${rem(-5)}, rgba(0, 0, 0, 0.04) 0 ${rem(10)} ${rem(10)} ${rem(-5)}`,
920
+ lg: `0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(28)} ${rem(23)} ${rem(-7)}, rgba(0, 0, 0, 0.04) 0 ${rem(12)} ${rem(12)} ${rem(-7)}`,
921
+ xl: `0 ${rem(1)} ${rem(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${rem(36)} ${rem(28)} ${rem(-7)}, rgba(0, 0, 0, 0.04) 0 ${rem(17)} ${rem(17)} ${rem(-7)}`
922
+ },
923
+ other: {},
924
+ components: {}
925
+ };
926
+ const INVALID_PRIMARY_COLOR_ERROR = "[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color";
927
+ const INVALID_PRIMARY_SHADE_ERROR = "[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";
928
+ function isValidPrimaryShade(shade) {
929
+ if (shade < 0 || shade > 9) return false;
930
+ return parseInt(shade.toString(), 10) === shade;
931
+ }
932
+ function validateMantineTheme(theme) {
933
+ if (!(theme.primaryColor in theme.colors)) throw new Error(INVALID_PRIMARY_COLOR_ERROR);
934
+ if (typeof theme.primaryShade === "object") {
935
+ if (!isValidPrimaryShade(theme.primaryShade.dark) || !isValidPrimaryShade(theme.primaryShade.light)) throw new Error(INVALID_PRIMARY_SHADE_ERROR);
936
+ }
937
+ if (typeof theme.primaryShade === "number" && !isValidPrimaryShade(theme.primaryShade)) throw new Error(INVALID_PRIMARY_SHADE_ERROR);
938
+ }
939
+ function mergeMantineTheme(currentTheme, themeOverride) {
940
+ if (!themeOverride) {
941
+ validateMantineTheme(currentTheme);
942
+ return currentTheme;
943
+ }
944
+ const result = deepMerge(currentTheme, themeOverride);
945
+ if (themeOverride.fontFamily && !themeOverride.headings?.fontFamily) result.headings = {
946
+ ...result.headings,
947
+ fontFamily: themeOverride.fontFamily
948
+ };
949
+ validateMantineTheme(result);
950
+ return result;
951
+ }
952
+ const MantineThemeContext = reactExports.createContext(null);
953
+ const useSafeMantineTheme = () => reactExports.use(MantineThemeContext) || DEFAULT_THEME;
954
+ function useMantineTheme() {
955
+ const ctx = reactExports.use(MantineThemeContext);
956
+ if (!ctx) throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");
957
+ return ctx;
958
+ }
959
+ function MantineThemeProvider({ theme, children, inherit = true }) {
960
+ const parentTheme = useSafeMantineTheme();
961
+ const mergedTheme = reactExports.useMemo(() => mergeMantineTheme(inherit ? parentTheme : DEFAULT_THEME, theme), [
962
+ theme,
963
+ parentTheme,
964
+ inherit
965
+ ]);
966
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(MantineThemeContext, {
967
+ value: mergedTheme,
968
+ children
969
+ });
970
+ }
971
+ MantineThemeProvider.displayName = "@mantine/core/MantineThemeProvider";
972
+ export {
973
+ DEFAULT_THEME as D,
974
+ MantineThemeProvider as M,
975
+ alpha as a,
976
+ rem as b,
977
+ getPrimaryContrastColor as c,
978
+ darken as d,
979
+ getVirtualColorContrast as e,
980
+ useMantineTheme as f,
981
+ getPrimaryShade as g,
982
+ em as h,
983
+ isVirtualColor as i,
984
+ deepMerge as j,
985
+ keys as k,
986
+ parseThemeColor as l,
987
+ rgba as m,
988
+ getThemeColor as n,
989
+ getGradient as o,
990
+ px as p,
991
+ getContrastColor as q,
992
+ requireReactDom as r,
993
+ luminance as s,
994
+ useIsomorphicEffect as u
995
+ };