mcr-design-systems 1.0.17 → 1.0.19
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/PhoneInput/index.d.ts +4 -0
- package/dist/components/PhoneInput/index.js +129 -95
- 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/tailwind-config.d.ts +1 -0
- package/dist/tokens/tailwind-config.js +16 -15
- 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 +1 -1
|
@@ -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
|
}
|
|
@@ -49,6 +49,10 @@ export interface PhoneInputProps extends Omit<React.InputHTMLAttributes<HTMLInpu
|
|
|
49
49
|
* Test identifier
|
|
50
50
|
*/
|
|
51
51
|
'data-testid'?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the dropdown is open (controlled)
|
|
54
|
+
*/
|
|
55
|
+
clearText?: boolean;
|
|
52
56
|
}
|
|
53
57
|
/**
|
|
54
58
|
* A phone input component that combines a country selector dropdown with a phone number input field.
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as d, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import
|
|
4
|
-
import { cn as
|
|
5
|
-
import { COUNTRIES_DATA as
|
|
6
|
-
import { FLAG_POSITIONS as
|
|
7
|
-
import { FLAG_BASE64 as
|
|
8
|
-
import { phoneInputVariants as
|
|
9
|
-
import { Dropdown as
|
|
3
|
+
import Y from "../../node_modules/libphonenumber-js/examples.mobile.json.js";
|
|
4
|
+
import { cn as C } from "../../shared/utils/cn.js";
|
|
5
|
+
import { COUNTRIES_DATA as q } from "../../shared/flags/countries-data.js";
|
|
6
|
+
import { FLAG_POSITIONS as H } from "../../shared/flags/flag-positions.js";
|
|
7
|
+
import { FLAG_BASE64 as J } from "../../shared/flags/base64.js";
|
|
8
|
+
import { phoneInputVariants as K } from "./helper/variants.js";
|
|
9
|
+
import { Dropdown as X } from "../Dropdown/index.js";
|
|
10
10
|
import { Typography as v } from "../Typography/index.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { getExampleNumber as
|
|
14
|
-
import { AsYouType as
|
|
15
|
-
const
|
|
11
|
+
import P from "../Icon/Icon.js";
|
|
12
|
+
import Z from "./FagDefault.js";
|
|
13
|
+
import { getExampleNumber as ee } from "../../node_modules/libphonenumber-js/min/exports/getExampleNumber.js";
|
|
14
|
+
import { AsYouType as te } from "../../node_modules/libphonenumber-js/min/exports/AsYouType.js";
|
|
15
|
+
const D = ({
|
|
16
16
|
countryCode: o
|
|
17
17
|
}) => {
|
|
18
|
-
const t =
|
|
19
|
-
return /* @__PURE__ */
|
|
18
|
+
const t = H[o];
|
|
19
|
+
return /* @__PURE__ */ c("div", { className: "w-[30px] h-[20px] overflow-hidden rounded-xs", children: t === void 0 ? /* @__PURE__ */ c(Z, {}) : /* @__PURE__ */ c(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
|
-
className:
|
|
22
|
+
className: C(),
|
|
23
23
|
style: {
|
|
24
|
-
backgroundImage: `url('${
|
|
24
|
+
backgroundImage: `url('${J}')`,
|
|
25
25
|
backgroundPosition: `${t.x}px ${t.y}px`,
|
|
26
26
|
backgroundSize: "512px 512px",
|
|
27
27
|
width: "32px",
|
|
@@ -30,11 +30,11 @@ const F = ({
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
) });
|
|
33
|
-
},
|
|
33
|
+
}, oe = (o) => {
|
|
34
34
|
try {
|
|
35
|
-
const t =
|
|
35
|
+
const t = ee(
|
|
36
36
|
o.toUpperCase(),
|
|
37
|
-
|
|
37
|
+
Y
|
|
38
38
|
);
|
|
39
39
|
if (t)
|
|
40
40
|
return t.formatNational();
|
|
@@ -44,153 +44,187 @@ const F = ({
|
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
return "Enter phone number";
|
|
47
|
-
},
|
|
47
|
+
}, F = (o, t) => {
|
|
48
48
|
if (!o || !o.trim()) return "";
|
|
49
49
|
try {
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
let
|
|
53
|
-
for (const
|
|
54
|
-
|
|
55
|
-
return
|
|
50
|
+
const a = new te(t.toUpperCase()), l = o.replace(/[^\d]/g, "");
|
|
51
|
+
if (!l) return "";
|
|
52
|
+
let s = "";
|
|
53
|
+
for (const h of l)
|
|
54
|
+
s = a.input(h);
|
|
55
|
+
return s || l;
|
|
56
56
|
} catch {
|
|
57
57
|
return o.replace(/[^\d]/g, "") || "";
|
|
58
58
|
}
|
|
59
|
-
},
|
|
59
|
+
}, re = n.forwardRef(
|
|
60
60
|
({
|
|
61
61
|
onCountryChange: o,
|
|
62
62
|
value: t = "",
|
|
63
|
-
onValueChange:
|
|
64
|
-
placeholder:
|
|
65
|
-
countries:
|
|
66
|
-
showSearch:
|
|
63
|
+
onValueChange: a,
|
|
64
|
+
placeholder: l,
|
|
65
|
+
countries: s = q,
|
|
66
|
+
showSearch: h = !1,
|
|
67
67
|
searchPlaceholder: O = "Search countries",
|
|
68
|
-
className:
|
|
69
|
-
size:
|
|
70
|
-
"data-testid":
|
|
71
|
-
error:
|
|
68
|
+
className: T,
|
|
69
|
+
size: u = "md",
|
|
70
|
+
"data-testid": z,
|
|
71
|
+
error: R,
|
|
72
|
+
clearText: k,
|
|
72
73
|
// placeholder = 'Enter phone number',
|
|
73
74
|
...A
|
|
74
75
|
}, L) => {
|
|
75
|
-
const [y,
|
|
76
|
-
t ||
|
|
77
|
-
), [g,
|
|
78
|
-
|
|
76
|
+
const [y, M] = n.useState(!1), [_, w] = n.useState(!1), [i, $] = n.useState(
|
|
77
|
+
t || s[0]?.code || "us"
|
|
78
|
+
), [g, I] = n.useState(""), N = n.useRef(null), S = y, x = n.useCallback((e) => {
|
|
79
|
+
M(e), e || I("");
|
|
79
80
|
}, []), m = n.useMemo(
|
|
80
|
-
() =>
|
|
81
|
-
[
|
|
82
|
-
),
|
|
83
|
-
size:
|
|
84
|
-
opened:
|
|
85
|
-
inputFocused:
|
|
86
|
-
}),
|
|
81
|
+
() => s.find((e) => e.code === i) || s[0],
|
|
82
|
+
[s, i]
|
|
83
|
+
), B = n.useMemo(() => l || oe(i), [i, l]), b = K({
|
|
84
|
+
size: u,
|
|
85
|
+
opened: S,
|
|
86
|
+
inputFocused: _
|
|
87
|
+
}), E = n.useCallback(
|
|
87
88
|
(e) => {
|
|
88
|
-
if (o?.(e), x(!1),
|
|
89
|
-
const r =
|
|
89
|
+
if (o?.(e), x(!1), $(e.code), t && t.trim()) {
|
|
90
|
+
const r = F(
|
|
90
91
|
t,
|
|
91
92
|
e.code
|
|
92
93
|
);
|
|
93
|
-
|
|
94
|
+
a?.({
|
|
94
95
|
formatted: r,
|
|
95
96
|
raw: t,
|
|
96
97
|
country: e
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
100
|
},
|
|
100
|
-
[o, x, t,
|
|
101
|
-
),
|
|
101
|
+
[o, x, t, a]
|
|
102
|
+
), j = n.useMemo(() => s.filter(
|
|
102
103
|
(e) => e.name.toLowerCase().includes(g.toLowerCase()) || e.code.toLowerCase().includes(g.toLowerCase())
|
|
103
104
|
).map((e) => ({
|
|
104
105
|
label: e.name,
|
|
105
106
|
value: e.code,
|
|
106
|
-
icon: /* @__PURE__ */
|
|
107
|
+
icon: /* @__PURE__ */ c(D, { countryCode: e.code }),
|
|
107
108
|
startIconSize: "auto",
|
|
108
109
|
endIconSize: "auto",
|
|
109
|
-
endIcon: /* @__PURE__ */
|
|
110
|
+
endIcon: /* @__PURE__ */ d(v, { variants: "body", size: "sm", color: "fg-neutral-subtlest", children: [
|
|
110
111
|
"+",
|
|
111
112
|
e.dial_code
|
|
112
113
|
] })
|
|
113
|
-
})), [
|
|
114
|
+
})), [s, g]), U = k ? /* @__PURE__ */ c(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
onMouseDown: (e) => {
|
|
118
|
+
e.preventDefault(), e.stopPropagation(), setTimeout(() => {
|
|
119
|
+
a && a({
|
|
120
|
+
formatted: "",
|
|
121
|
+
raw: "",
|
|
122
|
+
country: m
|
|
123
|
+
});
|
|
124
|
+
}, 0);
|
|
125
|
+
},
|
|
126
|
+
className: "inline-flex items-center justify-center",
|
|
127
|
+
role: "button",
|
|
128
|
+
tabIndex: 0,
|
|
129
|
+
"aria-label": "Clear text",
|
|
130
|
+
children: /* @__PURE__ */ c(
|
|
131
|
+
P,
|
|
132
|
+
{
|
|
133
|
+
name: "x-circle",
|
|
134
|
+
variant: "solid",
|
|
135
|
+
size: {
|
|
136
|
+
sm: 16,
|
|
137
|
+
md: 20,
|
|
138
|
+
lg: 24
|
|
139
|
+
}[u],
|
|
140
|
+
className: "cursor-pointer text-fg-neutral-subtle"
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
) : null, V = n.useCallback(
|
|
114
145
|
(e) => {
|
|
115
|
-
const r = e.target.value, p = t,
|
|
146
|
+
const r = e.target.value, p = t, G = r.length < p.length;
|
|
116
147
|
if (r.length > 20) {
|
|
117
148
|
e.preventDefault();
|
|
118
149
|
return;
|
|
119
150
|
}
|
|
120
151
|
if (/^[0-9\s\-()+ ]*$/.test(r) || r === "") {
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
|
|
152
|
+
const f = r.replace(/[^\d]/g, ""), Q = p.replace(/[^\d]/g, "");
|
|
153
|
+
if (G && f === Q) {
|
|
154
|
+
a?.({
|
|
124
155
|
formatted: r,
|
|
125
156
|
raw: r.replace(/[^\d]/g, ""),
|
|
126
157
|
country: m
|
|
127
158
|
});
|
|
128
159
|
return;
|
|
129
160
|
}
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
formatted:
|
|
133
|
-
raw:
|
|
161
|
+
const W = f ? F(f, i) : "";
|
|
162
|
+
a?.({
|
|
163
|
+
formatted: W,
|
|
164
|
+
raw: f,
|
|
134
165
|
country: m
|
|
135
166
|
});
|
|
136
167
|
}
|
|
137
168
|
},
|
|
138
|
-
[m,
|
|
169
|
+
[m, a, i, t]
|
|
139
170
|
);
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
|
|
171
|
+
return /* @__PURE__ */ d("div", { className: C("flex items-center", T), ref: N, children: [
|
|
172
|
+
/* @__PURE__ */ c(
|
|
173
|
+
X,
|
|
143
174
|
{
|
|
144
175
|
open: y,
|
|
145
176
|
onOpenChange: x,
|
|
146
|
-
items:
|
|
177
|
+
items: j,
|
|
147
178
|
value: i,
|
|
148
179
|
onValueChange: (e) => {
|
|
149
|
-
const r =
|
|
180
|
+
const r = s.find(
|
|
150
181
|
(p) => p.code === e
|
|
151
182
|
);
|
|
152
|
-
r &&
|
|
183
|
+
r && E(r);
|
|
153
184
|
},
|
|
154
185
|
align: "start",
|
|
155
186
|
"data-testid": "align-start-dropdown",
|
|
156
|
-
search:
|
|
187
|
+
search: h,
|
|
157
188
|
searchPlaceholder: O,
|
|
158
189
|
enableVirtualization: !0,
|
|
159
190
|
onSearchChange: (e) => {
|
|
160
|
-
|
|
191
|
+
I(e);
|
|
161
192
|
},
|
|
162
|
-
width:
|
|
163
|
-
children: /* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
193
|
+
width: N.current?.clientWidth || "auto",
|
|
194
|
+
children: /* @__PURE__ */ d("div", { className: b.countryButton(), children: [
|
|
195
|
+
/* @__PURE__ */ c(D, { countryCode: i }),
|
|
196
|
+
/* @__PURE__ */ d("div", { className: "flex gap-xs-4", children: [
|
|
197
|
+
/* @__PURE__ */ d(v, { variants: "body", size: "md", children: [
|
|
167
198
|
"+",
|
|
168
199
|
m.dial_code
|
|
169
200
|
] }),
|
|
170
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ c(P, { name: S ? "chevron-up" : "chevron-down", size: 16 })
|
|
171
202
|
] })
|
|
172
203
|
] })
|
|
173
204
|
}
|
|
174
205
|
),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
206
|
+
/* @__PURE__ */ d("div", { className: b.inputContainer({ error: R, size: u }), children: [
|
|
207
|
+
/* @__PURE__ */ c(
|
|
208
|
+
"input",
|
|
209
|
+
{
|
|
210
|
+
...A,
|
|
211
|
+
ref: L,
|
|
212
|
+
className: C(b.input({ size: u })),
|
|
213
|
+
placeholder: B,
|
|
214
|
+
value: t,
|
|
215
|
+
onChange: V,
|
|
216
|
+
onFocus: () => w(!0),
|
|
217
|
+
onBlur: () => w(!1),
|
|
218
|
+
"data-testid": z
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
U
|
|
222
|
+
] })
|
|
189
223
|
] });
|
|
190
224
|
}
|
|
191
225
|
);
|
|
192
|
-
|
|
226
|
+
re.displayName = "PhoneInput";
|
|
193
227
|
export {
|
|
194
|
-
|
|
195
|
-
|
|
228
|
+
re as PhoneInput,
|
|
229
|
+
re as default
|
|
196
230
|
};
|
|
@@ -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 {
|
|
@@ -117,6 +117,7 @@ export declare const generateTailwindConfig: ({ brand, font, }: {
|
|
|
117
117
|
brand: Record<string | number, string>;
|
|
118
118
|
};
|
|
119
119
|
borderColor: Record<string, string>;
|
|
120
|
+
outline: Record<string, string>;
|
|
120
121
|
borderRadius: {
|
|
121
122
|
readonly none: "0rem";
|
|
122
123
|
readonly xs: "0.125rem";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { alphaColors as a, colorScales as
|
|
1
|
+
import { alphaColors as a, colorScales as g, baseColors as d } from "./primitives/colors.js";
|
|
2
2
|
import { typography as t } from "./primitives/typography.js";
|
|
3
|
-
import { zIndex as
|
|
3
|
+
import { zIndex as h, shadows as p, borderRadius as u, spacing as n } from "./primitives/layout.js";
|
|
4
4
|
import { semanticTokens as f } from "./semantic.js";
|
|
5
|
-
const i = /* @__PURE__ */ new Map(),
|
|
5
|
+
const i = /* @__PURE__ */ new Map(), x = () => ({
|
|
6
6
|
// Base colors
|
|
7
|
-
...
|
|
7
|
+
...d,
|
|
8
8
|
// Color scales
|
|
9
|
-
...
|
|
9
|
+
...g,
|
|
10
10
|
// Alpha colors
|
|
11
11
|
"white-alpha": a.white,
|
|
12
12
|
"black-alpha": a.black,
|
|
@@ -17,23 +17,23 @@ const i = /* @__PURE__ */ new Map(), u = () => ({
|
|
|
17
17
|
const e = `semantic-${o}`;
|
|
18
18
|
if (i.has(e))
|
|
19
19
|
return i.get(e);
|
|
20
|
-
const r =
|
|
20
|
+
const r = b(o);
|
|
21
21
|
return i.set(e, r), r;
|
|
22
|
-
},
|
|
22
|
+
}, b = (o) => {
|
|
23
23
|
const e = {};
|
|
24
24
|
try {
|
|
25
25
|
const r = f.light[o];
|
|
26
26
|
if (!r)
|
|
27
27
|
return console.warn(`No tokens found for category: ${o}`), e;
|
|
28
28
|
Object.keys(r).forEach((s) => {
|
|
29
|
-
const
|
|
30
|
-
e[s] = `var(${
|
|
29
|
+
const m = o === "border" ? `--color-border-${s}` : `--color-${o}-${s}`;
|
|
30
|
+
e[s] = `var(${m})`;
|
|
31
31
|
});
|
|
32
32
|
} catch (r) {
|
|
33
33
|
console.error(`Error generating semantic colors for ${o}:`, r);
|
|
34
34
|
}
|
|
35
35
|
return e;
|
|
36
|
-
},
|
|
36
|
+
}, l = () => c("border"), C = () => ({
|
|
37
37
|
sm: "640px",
|
|
38
38
|
// Small devices
|
|
39
39
|
md: "768px",
|
|
@@ -72,14 +72,15 @@ const i = /* @__PURE__ */ new Map(), u = () => ({
|
|
|
72
72
|
fontFamily: e || t.fontFamilies,
|
|
73
73
|
// Colors (optimized with caching)
|
|
74
74
|
colors: {
|
|
75
|
-
...
|
|
75
|
+
...x(),
|
|
76
76
|
brand: o
|
|
77
77
|
},
|
|
78
|
-
borderColor:
|
|
78
|
+
borderColor: l(),
|
|
79
|
+
outline: l(),
|
|
79
80
|
// Visual Effects
|
|
80
|
-
borderRadius:
|
|
81
|
-
boxShadow:
|
|
82
|
-
zIndex:
|
|
81
|
+
borderRadius: u,
|
|
82
|
+
boxShadow: p,
|
|
83
|
+
zIndex: h,
|
|
83
84
|
// Animation & Transitions
|
|
84
85
|
transitionTimingFunction: {
|
|
85
86
|
"bounce-gentle": "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
|
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
|
};
|