mcr-design-systems 1.0.18 → 1.0.20
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/Alert/helper/variants.js +1 -1
- package/dist/components/Dropdown/index.js +22 -24
- package/dist/components/MenuItem/helper/variants.js +2 -1
- package/dist/components/PhoneInput/index.d.ts +4 -0
- package/dist/components/PhoneInput/index.js +129 -95
- package/dist/tokens/tailwind-config.d.ts +1 -0
- package/dist/tokens/tailwind-config.js +16 -15
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, Fragment as te, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import { Root as re, Trigger as ae, Portal as ne, Content as le, Label as L, Separator as T } from "../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js";
|
|
4
4
|
import { useVirtualizer as oe } from "../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
@@ -31,43 +31,43 @@ const ce = s.forwardRef(
|
|
|
31
31
|
variant: q,
|
|
32
32
|
fullWidth: B,
|
|
33
33
|
state: G,
|
|
34
|
-
enableVirtualization:
|
|
34
|
+
enableVirtualization: m,
|
|
35
35
|
itemHeight: J = 40,
|
|
36
36
|
maxHeight: K = 300,
|
|
37
|
-
search:
|
|
37
|
+
search: h = !1,
|
|
38
38
|
searchPlaceholder: O = "Search...",
|
|
39
39
|
onSearchChange: z,
|
|
40
40
|
width: b,
|
|
41
41
|
...Q
|
|
42
42
|
}, U) => {
|
|
43
|
-
const n = ie({ size: S, variant: q, fullWidth: B, state: G }), d = s.useMemo(() =>
|
|
43
|
+
const n = ie({ size: S, variant: q, fullWidth: B, state: G }), d = s.useMemo(() => m !== void 0 ? m : c === void 0 ? (console.warn(
|
|
44
44
|
"Dropdown is not open, virtualization will not be applied. Please ensure the dropdown is open when using virtualization."
|
|
45
|
-
), !1) : a.reduce((t, l) => t + ("items" in l ? l.items.length : 1), 0) > 50, [
|
|
45
|
+
), !1) : a.reduce((t, l) => t + ("items" in l ? l.items.length : 1), 0) > 50, [m, a, c]), u = s.useMemo(() => {
|
|
46
46
|
if (!d) return [];
|
|
47
47
|
const e = [];
|
|
48
48
|
let t = 0;
|
|
49
|
-
return a.forEach((l,
|
|
49
|
+
return a.forEach((l, p) => {
|
|
50
50
|
"items" in l ? (l.label && e.push({
|
|
51
51
|
type: "group-label",
|
|
52
52
|
groupLabel: l.label,
|
|
53
53
|
index: t++,
|
|
54
|
-
key: `group-label-${
|
|
54
|
+
key: `group-label-${p}`
|
|
55
55
|
}), l.items.forEach((_, ee) => {
|
|
56
56
|
e.push({
|
|
57
57
|
type: "item",
|
|
58
58
|
data: _,
|
|
59
59
|
index: t++,
|
|
60
|
-
key: `group-${
|
|
60
|
+
key: `group-${p}-item-${ee}`
|
|
61
61
|
});
|
|
62
|
-
}),
|
|
62
|
+
}), p < a.length - 1 && e.push({
|
|
63
63
|
type: "separator",
|
|
64
64
|
index: t++,
|
|
65
|
-
key: `separator-${
|
|
65
|
+
key: `separator-${p}`
|
|
66
66
|
})) : e.push({
|
|
67
67
|
type: "item",
|
|
68
68
|
data: l,
|
|
69
69
|
index: t++,
|
|
70
|
-
key: `item-${
|
|
70
|
+
key: `item-${p}`
|
|
71
71
|
});
|
|
72
72
|
}), e;
|
|
73
73
|
}, [d, a]), y = s.useRef(null), g = oe({
|
|
@@ -124,7 +124,7 @@ const ce = s.forwardRef(
|
|
|
124
124
|
default:
|
|
125
125
|
return null;
|
|
126
126
|
}
|
|
127
|
-
}, X = () => H ? /* @__PURE__ */
|
|
127
|
+
}, X = () => H ? /* @__PURE__ */ f("div", { className: n.emptyState(), children: [
|
|
128
128
|
/* @__PURE__ */ r(k, { name: "loading-01", size: 16, className: "animate-spin mr-2" }),
|
|
129
129
|
"Loading..."
|
|
130
130
|
] }) : a.length === 0 ? /* @__PURE__ */ r("div", { className: n.emptyState(), children: Y }) : d && u.length > 0 ? /* @__PURE__ */ r(
|
|
@@ -154,11 +154,11 @@ const ce = s.forwardRef(
|
|
|
154
154
|
) : null;
|
|
155
155
|
})
|
|
156
156
|
}
|
|
157
|
-
) : a.map((e, t) => "items" in e ? /* @__PURE__ */
|
|
157
|
+
) : a.map((e, t) => "items" in e ? /* @__PURE__ */ f(s.Fragment, { children: [
|
|
158
158
|
e.label && /* @__PURE__ */ r(L, { className: n.label(), children: e.label }),
|
|
159
159
|
e.items.map(v),
|
|
160
160
|
t < a.length - 1 && /* @__PURE__ */ r(T, { className: n.separator() })
|
|
161
|
-
] }, `group-${t}`) : v(e)), Z = /* @__PURE__ */
|
|
161
|
+
] }, `group-${t}`) : v(e)), Z = /* @__PURE__ */ f(te, { children: [
|
|
162
162
|
/* @__PURE__ */ r(
|
|
163
163
|
"span",
|
|
164
164
|
{
|
|
@@ -171,9 +171,9 @@ const ce = s.forwardRef(
|
|
|
171
171
|
),
|
|
172
172
|
/* @__PURE__ */ r(k, { name: "chevron-down", size: 16, className: n.chevron() })
|
|
173
173
|
] });
|
|
174
|
-
return
|
|
174
|
+
return m && c === void 0 ? (console.error(
|
|
175
175
|
"Virtualization is enabled but the dropdown is not open. Please ensure the dropdown is open when using virtualization."
|
|
176
|
-
), null) : /* @__PURE__ */
|
|
176
|
+
), null) : /* @__PURE__ */ f(
|
|
177
177
|
re,
|
|
178
178
|
{
|
|
179
179
|
open: c,
|
|
@@ -193,10 +193,10 @@ const ce = s.forwardRef(
|
|
|
193
193
|
children: F || D || Z
|
|
194
194
|
}
|
|
195
195
|
),
|
|
196
|
-
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ f(
|
|
197
197
|
le,
|
|
198
198
|
{
|
|
199
|
-
className: n.content({ search:
|
|
199
|
+
className: n.content({ search: h }),
|
|
200
200
|
side: j,
|
|
201
201
|
align: A,
|
|
202
202
|
sideOffset: I,
|
|
@@ -205,7 +205,7 @@ const ce = s.forwardRef(
|
|
|
205
205
|
},
|
|
206
206
|
...i && R(`${i}-content`),
|
|
207
207
|
children: [
|
|
208
|
-
|
|
208
|
+
h && /* @__PURE__ */ r("div", { className: "px-xs-3 py-xs-3", children: /* @__PURE__ */ r(
|
|
209
209
|
"input",
|
|
210
210
|
{
|
|
211
211
|
autoFocus: !0,
|
|
@@ -221,11 +221,9 @@ const ce = s.forwardRef(
|
|
|
221
221
|
"div",
|
|
222
222
|
{
|
|
223
223
|
ref: y,
|
|
224
|
-
className: w("overflow-auto",
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
style: { maxHeight: `${K - (p ? 46 : 0)}px` },
|
|
228
|
-
"data-search": p ? "true" : "false",
|
|
224
|
+
className: w("overflow-auto p-xs-3"),
|
|
225
|
+
style: { maxHeight: `${K - (h ? 46 : 0)}px` },
|
|
226
|
+
"data-search": h ? "true" : "false",
|
|
229
227
|
children: X()
|
|
230
228
|
}
|
|
231
229
|
)
|
|
@@ -34,7 +34,8 @@ const s = e(
|
|
|
34
34
|
"data-[disabled]:opacity-50",
|
|
35
35
|
"data-[disabled]:cursor-not-allowed",
|
|
36
36
|
"data-[disabled]:pointer-events-none",
|
|
37
|
-
"data-[disabled]:text-fg-neutral-disabled"
|
|
37
|
+
"data-[disabled]:text-fg-neutral-disabled",
|
|
38
|
+
"rounded-sm"
|
|
38
39
|
],
|
|
39
40
|
indicator: [
|
|
40
41
|
"absolute",
|
|
@@ -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
|
};
|
|
@@ -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)"
|