mcr-design-systems 1.0.16 → 1.0.18
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/components/Box/helper/classMappings.d.ts +0 -2
- package/dist/components/Box/helper/classMappings.js +8 -10
- package/dist/components/Box/index.d.ts +1 -1
- package/dist/components/InputPassword/index.js +13 -13
- package/dist/components/TextField/HelperText.js +12 -12
- package/dist/tokens/semantic.d.ts +15 -30
- package/dist/tokens/semantic.js +15 -30
- package/dist/tokens/theme-types.d.ts +1 -1
- package/dist/tokens/utils.d.ts +1 -1
- package/dist/tokens/utils.js +16 -16
- package/package.json +3 -2
|
@@ -206,8 +206,6 @@ export declare const borderColorClasses: {
|
|
|
206
206
|
readonly 'active-strong': "border-active-strong";
|
|
207
207
|
readonly selected: "border-selected";
|
|
208
208
|
readonly 'selected-disabled': "border-selected-disabled";
|
|
209
|
-
readonly 'selected-secondary': "border-selected-secondary";
|
|
210
|
-
readonly 'selected-secondary-disabled': "border-selected-secondary-disabled";
|
|
211
209
|
readonly error: "border-error";
|
|
212
210
|
readonly 'error-light': "border-error-light";
|
|
213
211
|
readonly 'error-strong': "border-error-strong";
|
|
@@ -20,7 +20,7 @@ const s = {
|
|
|
20
20
|
xl: "px-xl",
|
|
21
21
|
"2xl": "px-2xl",
|
|
22
22
|
"3xl": "px-3xl"
|
|
23
|
-
},
|
|
23
|
+
}, r = {
|
|
24
24
|
xs: "py-xs",
|
|
25
25
|
"xs-2": "py-xs-2",
|
|
26
26
|
"sm-1": "py-sm-1",
|
|
@@ -31,7 +31,7 @@ const s = {
|
|
|
31
31
|
xl: "py-xl",
|
|
32
32
|
"2xl": "py-2xl",
|
|
33
33
|
"3xl": "py-3xl"
|
|
34
|
-
},
|
|
34
|
+
}, e = {
|
|
35
35
|
xs: "pt-xs",
|
|
36
36
|
"xs-2": "pt-xs-2",
|
|
37
37
|
"sm-1": "pt-sm-1",
|
|
@@ -111,7 +111,7 @@ const s = {
|
|
|
111
111
|
"2xl": "my-2xl",
|
|
112
112
|
"3xl": "my-3xl",
|
|
113
113
|
auto: "my-auto"
|
|
114
|
-
},
|
|
114
|
+
}, g = {
|
|
115
115
|
xs: "mt-xs",
|
|
116
116
|
"xs-2": "mt-xs-2",
|
|
117
117
|
"sm-1": "mt-sm-1",
|
|
@@ -123,7 +123,7 @@ const s = {
|
|
|
123
123
|
"2xl": "mt-2xl",
|
|
124
124
|
"3xl": "mt-3xl",
|
|
125
125
|
auto: "mt-auto"
|
|
126
|
-
},
|
|
126
|
+
}, d = {
|
|
127
127
|
xs: "mr-xs",
|
|
128
128
|
"xs-2": "mr-xs-2",
|
|
129
129
|
"sm-1": "mr-sm-1",
|
|
@@ -192,8 +192,6 @@ const s = {
|
|
|
192
192
|
"active-strong": "border-active-strong",
|
|
193
193
|
selected: "border-selected",
|
|
194
194
|
"selected-disabled": "border-selected-disabled",
|
|
195
|
-
"selected-secondary": "border-selected-secondary",
|
|
196
|
-
"selected-secondary-disabled": "border-selected-secondary-disabled",
|
|
197
195
|
// Accent borders
|
|
198
196
|
error: "border-error",
|
|
199
197
|
"error-light": "border-error-light",
|
|
@@ -233,16 +231,16 @@ export {
|
|
|
233
231
|
b as marginBottomClasses,
|
|
234
232
|
o as marginClasses,
|
|
235
233
|
c as marginLeftClasses,
|
|
236
|
-
|
|
237
|
-
|
|
234
|
+
d as marginRightClasses,
|
|
235
|
+
g as marginTopClasses,
|
|
238
236
|
n as marginXClasses,
|
|
239
237
|
a as marginYClasses,
|
|
240
238
|
m as paddingBottomClasses,
|
|
241
239
|
s as paddingClasses,
|
|
242
240
|
x as paddingLeftClasses,
|
|
243
241
|
t as paddingRightClasses,
|
|
244
|
-
|
|
242
|
+
e as paddingTopClasses,
|
|
245
243
|
l as paddingXClasses,
|
|
246
|
-
|
|
244
|
+
r as paddingYClasses,
|
|
247
245
|
p as textColorClasses
|
|
248
246
|
};
|
|
@@ -42,7 +42,7 @@ export interface BoxProps extends BaseProps, VariantProps<typeof box> {
|
|
|
42
42
|
/** Text color using semantic tokens */
|
|
43
43
|
color?: 'neutral-main' | 'neutral-subtle' | 'neutral-disabled' | 'brand-rest' | 'brand-hover' | 'accent-error' | 'accent-success' | 'accent-warning' | 'accent-info';
|
|
44
44
|
/** Border color using semantic tokens */
|
|
45
|
-
borderColor?: 'neutral' | 'neutral-light' | 'neutral-strong' | 'neutral-strongest' | 'active' | 'active-light' | 'active-strong' | 'selected' | 'selected-disabled' | '
|
|
45
|
+
borderColor?: 'neutral' | 'neutral-light' | 'neutral-strong' | 'neutral-strongest' | 'active' | 'active-light' | 'active-strong' | 'selected' | 'selected-disabled' | 'error' | 'error-light' | 'error-strong' | 'success' | 'success-light' | 'success-strong' | 'warning' | 'warning-light' | 'warning-strong' | 'info' | 'info-light' | 'info-strong' | 'violet' | 'violet-light' | 'violet-strong' | 'yellow' | 'yellow-light' | 'yellow-strong' | 'card' | 'dialog' | 'input' | 'input-active' | 'input-disabled' | 'table' | 'indicator' | 'indicator-disabled' | 'inverse' | 'inverse-static' | 'segment-control';
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Box Component
|
|
@@ -5,9 +5,9 @@ import I from "../TextField/HelperText.js";
|
|
|
5
5
|
import v from "../Icon/Icon.js";
|
|
6
6
|
const N = y(
|
|
7
7
|
({
|
|
8
|
-
helperText:
|
|
9
|
-
error:
|
|
10
|
-
showHelperIcon:
|
|
8
|
+
helperText: a,
|
|
9
|
+
error: i = !1,
|
|
10
|
+
showHelperIcon: r = !0,
|
|
11
11
|
helperIconCustom: l,
|
|
12
12
|
helperTextClassName: d,
|
|
13
13
|
defaultVisible: m = !1,
|
|
@@ -16,11 +16,11 @@ const N = y(
|
|
|
16
16
|
className: u,
|
|
17
17
|
...s
|
|
18
18
|
}, f) => {
|
|
19
|
-
const [p,
|
|
19
|
+
const [p, b] = g(m), o = t !== void 0 ? t : p, w = () => {
|
|
20
20
|
if (s.disabled)
|
|
21
21
|
return;
|
|
22
|
-
const
|
|
23
|
-
t === void 0 &&
|
|
22
|
+
const n = !o;
|
|
23
|
+
t === void 0 && b(n), c?.(n);
|
|
24
24
|
};
|
|
25
25
|
return /* @__PURE__ */ x("div", { className: "w-full [&_input[type='password']::-ms-reveal]:hidden [&_input[type='password']::-ms-clear]:hidden", children: [
|
|
26
26
|
/* @__PURE__ */ e(
|
|
@@ -29,25 +29,25 @@ const N = y(
|
|
|
29
29
|
...s,
|
|
30
30
|
ref: f,
|
|
31
31
|
type: o ? "text" : "password",
|
|
32
|
-
error:
|
|
32
|
+
error: i,
|
|
33
33
|
className: u,
|
|
34
34
|
clearText: !0,
|
|
35
35
|
endAdornment: /* @__PURE__ */ e(
|
|
36
36
|
v,
|
|
37
37
|
{
|
|
38
38
|
name: o ? "eye" : "eye-off",
|
|
39
|
-
className: `transition-colors ${s.disabled ? "bg-bg-input-disabled cursor-not-allowed" : "cursor-pointer hover:text-fg-neutral-rest text-fg-neutral-
|
|
40
|
-
onClick:
|
|
39
|
+
className: `transition-colors ${s.disabled ? "bg-bg-input-disabled cursor-not-allowed" : "cursor-pointer hover:text-fg-neutral-rest text-fg-neutral-subtle"}`,
|
|
40
|
+
onClick: w
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
}
|
|
44
44
|
),
|
|
45
|
-
|
|
45
|
+
a && /* @__PURE__ */ e("div", { className: "mt-1", children: /* @__PURE__ */ e(
|
|
46
46
|
I,
|
|
47
47
|
{
|
|
48
|
-
text:
|
|
49
|
-
error:
|
|
50
|
-
haveIcon:
|
|
48
|
+
text: a,
|
|
49
|
+
error: i,
|
|
50
|
+
haveIcon: r,
|
|
51
51
|
iconsCustom: l,
|
|
52
52
|
className: d
|
|
53
53
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Typography as
|
|
3
|
+
import { Typography as c } from "../Typography/index.js";
|
|
4
4
|
import s from "../Icon/Icon.js";
|
|
5
|
-
const
|
|
5
|
+
const x = ({
|
|
6
6
|
text: l,
|
|
7
7
|
error: a = !1,
|
|
8
8
|
haveIcon: i = !0,
|
|
@@ -13,8 +13,8 @@ const p = ({
|
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
15
15
|
className: `self-stretch inline-flex flex-col justify-start items-start ${n || ""}`,
|
|
16
|
-
children: /* @__PURE__ */
|
|
17
|
-
a && (r
|
|
16
|
+
children: /* @__PURE__ */ f("div", { className: "self-stretch inline-flex justify-start items-start gap-1", children: [
|
|
17
|
+
a && (r || /* @__PURE__ */ e(
|
|
18
18
|
s,
|
|
19
19
|
{
|
|
20
20
|
name: "alert-octagon",
|
|
@@ -22,8 +22,8 @@ const p = ({
|
|
|
22
22
|
variant: "solid",
|
|
23
23
|
size: typeof t == "number" ? t : 16
|
|
24
24
|
}
|
|
25
|
-
)
|
|
26
|
-
i && !a && /* @__PURE__ */ e(
|
|
25
|
+
)),
|
|
26
|
+
i && !a && /* @__PURE__ */ e(
|
|
27
27
|
s,
|
|
28
28
|
{
|
|
29
29
|
name: "help-circle",
|
|
@@ -31,13 +31,13 @@ const p = ({
|
|
|
31
31
|
className: "text-fg-neutral-subtle",
|
|
32
32
|
size: typeof t == "number" ? t : 16
|
|
33
33
|
}
|
|
34
|
-
)
|
|
34
|
+
),
|
|
35
35
|
/* @__PURE__ */ e("div", { className: "flex-1 justify-start text-left flex flex-wrap items-center gap-0", children: /* @__PURE__ */ e(
|
|
36
|
-
|
|
36
|
+
c,
|
|
37
37
|
{
|
|
38
38
|
variants: "body",
|
|
39
|
-
size: "
|
|
40
|
-
color: a ? "fg-accent-error
|
|
39
|
+
size: "sm",
|
|
40
|
+
color: a ? "fg-accent-error" : "fg-neutral-subtle",
|
|
41
41
|
className: "inline",
|
|
42
42
|
children: l
|
|
43
43
|
}
|
|
@@ -46,5 +46,5 @@ const p = ({
|
|
|
46
46
|
}
|
|
47
47
|
) : null;
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
x as default
|
|
50
50
|
};
|
|
@@ -181,9 +181,8 @@ export declare const semanticTokens: {
|
|
|
181
181
|
readonly 'neutral-strongest': "neutral-400";
|
|
182
182
|
readonly 'segment-control': "transparent";
|
|
183
183
|
readonly selected: "brand-700";
|
|
184
|
+
readonly 'selected-boldest': "brand-600";
|
|
184
185
|
readonly 'selected-disabled': "brand-300";
|
|
185
|
-
readonly 'selected-secondary': "brand-700";
|
|
186
|
-
readonly 'selected-secondary-disabled': "brand-300";
|
|
187
186
|
readonly success: "fg-accent-success";
|
|
188
187
|
readonly 'success-light': "fg-accent-success-disabled";
|
|
189
188
|
readonly 'success-strong': "fg-accent-success-strong";
|
|
@@ -198,19 +197,6 @@ export declare const semanticTokens: {
|
|
|
198
197
|
readonly 'yellow-light': "fg-accent-yellow-disabled";
|
|
199
198
|
readonly 'yellow-strong': "fg-accent-yellow-strong";
|
|
200
199
|
};
|
|
201
|
-
readonly brand: {
|
|
202
|
-
readonly 'brand-100': "#fffceb";
|
|
203
|
-
readonly 'brand-200': "#fff5c2";
|
|
204
|
-
readonly 'brand-300': "#ffed99";
|
|
205
|
-
readonly 'brand-400': "#ffe070";
|
|
206
|
-
readonly 'brand-50': "#fffcf0";
|
|
207
|
-
readonly 'brand-500': "#ffd147";
|
|
208
|
-
readonly 'brand-600': "#ffbf1f";
|
|
209
|
-
readonly 'brand-700': "#d9990f";
|
|
210
|
-
readonly 'brand-800': "#b37505";
|
|
211
|
-
readonly 'brand-900': "#8c5700";
|
|
212
|
-
readonly 'brand-950': "#663d00";
|
|
213
|
-
};
|
|
214
200
|
};
|
|
215
201
|
readonly dark: {
|
|
216
202
|
readonly bg: {
|
|
@@ -394,9 +380,8 @@ export declare const semanticTokens: {
|
|
|
394
380
|
readonly 'neutral-strongest': "neutral-500";
|
|
395
381
|
readonly 'segment-control': "neutral-700";
|
|
396
382
|
readonly selected: "brand-400";
|
|
383
|
+
readonly 'selected-boldest': "brand-400";
|
|
397
384
|
readonly 'selected-disabled': "brand-700";
|
|
398
|
-
readonly 'selected-secondary': "brand-400";
|
|
399
|
-
readonly 'selected-secondary-disabled': "brand-700";
|
|
400
385
|
readonly success: "fg-accent-success";
|
|
401
386
|
readonly 'success-light': "fg-accent-success-disabled";
|
|
402
387
|
readonly 'success-strong': "fg-accent-success-strong";
|
|
@@ -411,18 +396,18 @@ export declare const semanticTokens: {
|
|
|
411
396
|
readonly 'yellow-light': "fg-accent-yellow-disabled";
|
|
412
397
|
readonly 'yellow-strong': "fg-accent-yellow-strong";
|
|
413
398
|
};
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
399
|
+
};
|
|
400
|
+
readonly brand: {
|
|
401
|
+
readonly 100: "#FFFDEB";
|
|
402
|
+
readonly 200: "#FFF6C2";
|
|
403
|
+
readonly 300: "#FFEC99";
|
|
404
|
+
readonly 400: "#FFE070";
|
|
405
|
+
readonly 50: "#FFFDF0";
|
|
406
|
+
readonly 500: "#FFD147";
|
|
407
|
+
readonly 600: "#FFC01F";
|
|
408
|
+
readonly 700: "#D9990F";
|
|
409
|
+
readonly 800: "#B37504";
|
|
410
|
+
readonly 900: "#8C5600";
|
|
411
|
+
readonly 950: "#663C00";
|
|
427
412
|
};
|
|
428
413
|
};
|
package/dist/tokens/semantic.js
CHANGED
|
@@ -181,9 +181,8 @@ const e = {
|
|
|
181
181
|
"neutral-strongest": "neutral-400",
|
|
182
182
|
"segment-control": "transparent",
|
|
183
183
|
selected: "brand-700",
|
|
184
|
+
"selected-boldest": "brand-600",
|
|
184
185
|
"selected-disabled": "brand-300",
|
|
185
|
-
"selected-secondary": "brand-700",
|
|
186
|
-
"selected-secondary-disabled": "brand-300",
|
|
187
186
|
success: "fg-accent-success",
|
|
188
187
|
"success-light": "fg-accent-success-disabled",
|
|
189
188
|
"success-strong": "fg-accent-success-strong",
|
|
@@ -197,19 +196,6 @@ const e = {
|
|
|
197
196
|
yellow: "fg-accent-yellow",
|
|
198
197
|
"yellow-light": "fg-accent-yellow-disabled",
|
|
199
198
|
"yellow-strong": "fg-accent-yellow-strong"
|
|
200
|
-
},
|
|
201
|
-
brand: {
|
|
202
|
-
"brand-100": "#fffceb",
|
|
203
|
-
"brand-200": "#fff5c2",
|
|
204
|
-
"brand-300": "#ffed99",
|
|
205
|
-
"brand-400": "#ffe070",
|
|
206
|
-
"brand-50": "#fffcf0",
|
|
207
|
-
"brand-500": "#ffd147",
|
|
208
|
-
"brand-600": "#ffbf1f",
|
|
209
|
-
"brand-700": "#d9990f",
|
|
210
|
-
"brand-800": "#b37505",
|
|
211
|
-
"brand-900": "#8c5700",
|
|
212
|
-
"brand-950": "#663d00"
|
|
213
199
|
}
|
|
214
200
|
},
|
|
215
201
|
dark: {
|
|
@@ -394,9 +380,8 @@ const e = {
|
|
|
394
380
|
"neutral-strongest": "neutral-500",
|
|
395
381
|
"segment-control": "neutral-700",
|
|
396
382
|
selected: "brand-400",
|
|
383
|
+
"selected-boldest": "brand-400",
|
|
397
384
|
"selected-disabled": "brand-700",
|
|
398
|
-
"selected-secondary": "brand-400",
|
|
399
|
-
"selected-secondary-disabled": "brand-700",
|
|
400
385
|
success: "fg-accent-success",
|
|
401
386
|
"success-light": "fg-accent-success-disabled",
|
|
402
387
|
"success-strong": "fg-accent-success-strong",
|
|
@@ -410,20 +395,20 @@ const e = {
|
|
|
410
395
|
yellow: "fg-accent-yellow",
|
|
411
396
|
"yellow-light": "fg-accent-yellow-disabled",
|
|
412
397
|
"yellow-strong": "fg-accent-yellow-strong"
|
|
413
|
-
},
|
|
414
|
-
brand: {
|
|
415
|
-
"brand-100": "#fffceb",
|
|
416
|
-
"brand-200": "#fff5c2",
|
|
417
|
-
"brand-300": "#ffed99",
|
|
418
|
-
"brand-400": "#ffe070",
|
|
419
|
-
"brand-50": "#fffcf0",
|
|
420
|
-
"brand-500": "#ffd147",
|
|
421
|
-
"brand-600": "#ffbf1f",
|
|
422
|
-
"brand-700": "#d9990f",
|
|
423
|
-
"brand-800": "#b37505",
|
|
424
|
-
"brand-900": "#8c5700",
|
|
425
|
-
"brand-950": "#663d00"
|
|
426
398
|
}
|
|
399
|
+
},
|
|
400
|
+
brand: {
|
|
401
|
+
100: "#FFFDEB",
|
|
402
|
+
200: "#FFF6C2",
|
|
403
|
+
300: "#FFEC99",
|
|
404
|
+
400: "#FFE070",
|
|
405
|
+
50: "#FFFDF0",
|
|
406
|
+
500: "#FFD147",
|
|
407
|
+
600: "#FFC01F",
|
|
408
|
+
700: "#D9990F",
|
|
409
|
+
800: "#B37504",
|
|
410
|
+
900: "#8C5600",
|
|
411
|
+
950: "#663C00"
|
|
427
412
|
}
|
|
428
413
|
};
|
|
429
414
|
export {
|
package/dist/tokens/utils.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare const themeUtils: {
|
|
|
16
16
|
generateCSSVariables: (theme: ThemeName) => string;
|
|
17
17
|
generateCustomThemeCSSVariables: (themeData: SemanticTheme, brand?: Record<string, string>) => string;
|
|
18
18
|
applyTheme: (theme: ThemeName, customTheme?: Theme, enableCustomPersister?: boolean) => void;
|
|
19
|
-
getToken: (category: keyof typeof semanticTokens.light, token: string, theme?: ThemeName) =>
|
|
19
|
+
getToken: (category: keyof typeof semanticTokens.light, token: string, theme?: ThemeName) => "brand-300" | "brand-700" | "brand-200" | "neutral-400" | "neutral-500" | "brand-950";
|
|
20
20
|
getCustomToken: (customTheme: Theme, category: keyof SemanticTheme, token: string, theme?: ThemeName) => undefined;
|
|
21
21
|
getCSSVar: (category: string, token: string) => string;
|
|
22
22
|
};
|
package/dist/tokens/utils.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { baseColors as $, alphaColors as
|
|
2
|
-
import { semanticTokens as
|
|
1
|
+
import { baseColors as $, alphaColors as a, colorScales as g, ringColors as d } from "./primitives/colors.js";
|
|
2
|
+
import { semanticTokens as s } from "./semantic.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "./context.js";
|
|
6
|
-
const h = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light",
|
|
7
|
-
const c =
|
|
6
|
+
const h = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", u = (o = !1) => typeof window > "u" || o ? null : localStorage.getItem("mcr-theme") || null, i = (o) => {
|
|
7
|
+
const c = s[o];
|
|
8
8
|
let t = "";
|
|
9
9
|
return Object.entries($).forEach(([e, r]) => {
|
|
10
10
|
t += `--color-${e}: ${r};
|
|
11
11
|
`;
|
|
12
|
-
}), Object.entries(
|
|
12
|
+
}), Object.entries(a.white).forEach(([e, r]) => {
|
|
13
13
|
t += `--color-white-alpha-${e.replace(/[/.]/g, "-")}: ${r};
|
|
14
14
|
`;
|
|
15
|
-
}), Object.entries(
|
|
15
|
+
}), Object.entries(a.black).forEach(([e, r]) => {
|
|
16
16
|
t += `--color-black-alpha-${e.replace(/[/.]/g, "-")}: ${r};
|
|
17
17
|
`;
|
|
18
18
|
}), Object.entries(g).forEach(([e, r]) => {
|
|
@@ -32,8 +32,8 @@ const h = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-colo
|
|
|
32
32
|
}), Object.entries(d).forEach(([e, r]) => {
|
|
33
33
|
t += `--color-ring-${e}: ${r};
|
|
34
34
|
`;
|
|
35
|
-
}), Object.entries(
|
|
36
|
-
|
|
35
|
+
}), Object.entries(s.brand).forEach(([e, r]) => {
|
|
36
|
+
t += `--color-brand-${e}: ${r};
|
|
37
37
|
`;
|
|
38
38
|
}), t;
|
|
39
39
|
}, b = (o, c) => {
|
|
@@ -61,7 +61,7 @@ const h = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-colo
|
|
|
61
61
|
t += `--color-brand-${e}: ${r};
|
|
62
62
|
`;
|
|
63
63
|
}), t;
|
|
64
|
-
},
|
|
64
|
+
}, m = (o, c, t = !1) => {
|
|
65
65
|
if (typeof document > "u") return;
|
|
66
66
|
document.documentElement.setAttribute("data-theme", o);
|
|
67
67
|
let e = i(o);
|
|
@@ -81,24 +81,24 @@ const h = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-colo
|
|
|
81
81
|
${e}
|
|
82
82
|
}
|
|
83
83
|
`, document.head.appendChild(n), t || localStorage.setItem("mcr-theme", o);
|
|
84
|
-
},
|
|
84
|
+
}, y = {
|
|
85
85
|
getSystemTheme: h,
|
|
86
|
-
getStoredTheme:
|
|
86
|
+
getStoredTheme: u,
|
|
87
87
|
generateCSSVariables: i,
|
|
88
88
|
generateCustomThemeCSSVariables: b,
|
|
89
|
-
applyTheme:
|
|
89
|
+
applyTheme: m,
|
|
90
90
|
// Get token value for current theme
|
|
91
|
-
getToken: (o, c, t = "light") =>
|
|
91
|
+
getToken: (o, c, t = "light") => s[t][o]?.[c],
|
|
92
92
|
// Get token value from custom theme
|
|
93
93
|
getCustomToken: (o, c, t, e = "light") => o[e]?.[c]?.[t],
|
|
94
94
|
// Generate CSS custom property name
|
|
95
95
|
getCSSVar: (o, c) => `var(--color-${o}-${c})`
|
|
96
96
|
};
|
|
97
97
|
export {
|
|
98
|
-
|
|
98
|
+
m as applyTheme,
|
|
99
99
|
i as generateCSSVariables,
|
|
100
100
|
b as generateCustomThemeCSSVariables,
|
|
101
|
-
|
|
101
|
+
u as getStoredTheme,
|
|
102
102
|
h as getSystemTheme,
|
|
103
|
-
|
|
103
|
+
y as themeUtils
|
|
104
104
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcr-design-systems",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.18",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"storybook": "storybook dev -p 6006",
|
|
28
28
|
"build-storybook": "storybook build",
|
|
29
29
|
"generate-icons": "node tools/generate-icon-components.js",
|
|
30
|
-
"tokens": "node tools/convert-token.js"
|
|
30
|
+
"tokens": "node tools/convert-token.js",
|
|
31
|
+
"prepublish": "npm run build-lib"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"@radix-ui/react-dropdown-menu": "^2.1.15",
|