@plyaz/ui 0.6.5 → 0.6.7
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/client.cjs.js +1 -0
- package/dist/client.es.js +5056 -0
- package/dist/index.cjs.js +105 -0
- package/dist/index.es.js +915 -0
- package/dist/types/client.d.ts +2 -0
- package/dist/ui.css +1 -1
- package/dist/{ui.es.js → utils-BlazSa45.js} +499 -1409
- package/dist/utils-D4NY0-fZ.cjs +1 -0
- package/package.json +5 -7
- package/dist/ui.cjs.js +0 -105
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,915 @@
|
|
|
1
|
+
var Q = Object.defineProperty;
|
|
2
|
+
var Z = (t, e, a) => e in t ? Q(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
3
|
+
var k = (t, e, a) => Z(t, typeof e != "symbol" ? e + "" : e, a);
|
|
4
|
+
import { jsx as o, jsxs as y } from "react/jsx-runtime";
|
|
5
|
+
import { c } from "./utils-BlazSa45.js";
|
|
6
|
+
import { clsx as J } from "clsx";
|
|
7
|
+
import { Slot as X } from "@radix-ui/react-slot";
|
|
8
|
+
import Y, { memo as ee } from "react";
|
|
9
|
+
import * as d from "@radix-ui/react-select";
|
|
10
|
+
import { CheckIcon as te, ChevronDownIcon as F, ChevronUpIcon as ae } from "lucide-react";
|
|
11
|
+
import { useTranslations as M } from "next-intl";
|
|
12
|
+
const w = ({ children: t, element: e = "div", className: a = "", ...r }) => /* @__PURE__ */ o(e, { className: a, ...r, "data-testid": "box", children: t }), je = ({ className: t = "", children: e, element: a, ...r }) => /* @__PURE__ */ o(
|
|
13
|
+
w,
|
|
14
|
+
{
|
|
15
|
+
element: a,
|
|
16
|
+
className: c("mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl", t),
|
|
17
|
+
...r,
|
|
18
|
+
children: e
|
|
19
|
+
}
|
|
20
|
+
), A = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, C = J, re = (t, e) => (a) => {
|
|
21
|
+
var r;
|
|
22
|
+
if ((e == null ? void 0 : e.variants) == null) return C(t, a == null ? void 0 : a.class, a == null ? void 0 : a.className);
|
|
23
|
+
const { variants: n, defaultVariants: s } = e, l = Object.keys(n).map((m) => {
|
|
24
|
+
const x = a == null ? void 0 : a[m], h = s == null ? void 0 : s[m];
|
|
25
|
+
if (x === null) return null;
|
|
26
|
+
const b = A(x) || A(h);
|
|
27
|
+
return n[m][b];
|
|
28
|
+
}), u = a && Object.entries(a).reduce((m, x) => {
|
|
29
|
+
let [h, b] = x;
|
|
30
|
+
return b === void 0 || (m[h] = b), m;
|
|
31
|
+
}, {}), f = e == null || (r = e.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((m, x) => {
|
|
32
|
+
let { class: h, className: b, ...H } = x;
|
|
33
|
+
return Object.entries(H).every((q) => {
|
|
34
|
+
let [T, S] = q;
|
|
35
|
+
return Array.isArray(S) ? S.includes({
|
|
36
|
+
...s,
|
|
37
|
+
...u
|
|
38
|
+
}[T]) : {
|
|
39
|
+
...s,
|
|
40
|
+
...u
|
|
41
|
+
}[T] === S;
|
|
42
|
+
}) ? [
|
|
43
|
+
...m,
|
|
44
|
+
h,
|
|
45
|
+
b
|
|
46
|
+
] : m;
|
|
47
|
+
}, []);
|
|
48
|
+
return C(t, l, f, a == null ? void 0 : a.class, a == null ? void 0 : a.className);
|
|
49
|
+
}, j = {
|
|
50
|
+
start: "justify-start",
|
|
51
|
+
end: "justify-end",
|
|
52
|
+
center: "justify-center",
|
|
53
|
+
between: "justify-between",
|
|
54
|
+
around: "justify-around",
|
|
55
|
+
evenly: "justify-evenly",
|
|
56
|
+
stretch: "justify-stretch"
|
|
57
|
+
}, D = {
|
|
58
|
+
start: "items-start",
|
|
59
|
+
end: "items-end",
|
|
60
|
+
center: "items-center",
|
|
61
|
+
baseline: "items-baseline",
|
|
62
|
+
stretch: "items-stretch"
|
|
63
|
+
}, ne = {
|
|
64
|
+
body: "font-general",
|
|
65
|
+
heading: "font-general",
|
|
66
|
+
caption: "font-general"
|
|
67
|
+
}, se = {
|
|
68
|
+
xs: "text-xs",
|
|
69
|
+
sm: "text-sm",
|
|
70
|
+
base: "text-base",
|
|
71
|
+
lg: "text-lg",
|
|
72
|
+
xl: "text-xl",
|
|
73
|
+
"2xl": "text-2xl",
|
|
74
|
+
"3xl": "text-3xl",
|
|
75
|
+
"4xl": "text-4xl",
|
|
76
|
+
"5xl": "text-5xl",
|
|
77
|
+
"6xl": "text-6xl",
|
|
78
|
+
"7xl": "text-7xl",
|
|
79
|
+
"8xl": "text-8xl",
|
|
80
|
+
"9xl": "text-9xl"
|
|
81
|
+
}, oe = {
|
|
82
|
+
normal: "font-normal",
|
|
83
|
+
medium: "font-medium",
|
|
84
|
+
semibold: "font-semibold",
|
|
85
|
+
bold: "font-bold",
|
|
86
|
+
light: "font-light"
|
|
87
|
+
}, le = {
|
|
88
|
+
1: "grid-cols-1",
|
|
89
|
+
2: "grid-cols-2",
|
|
90
|
+
3: "grid-cols-3",
|
|
91
|
+
4: "grid-cols-4",
|
|
92
|
+
5: "grid-cols-5",
|
|
93
|
+
6: "grid-cols-6",
|
|
94
|
+
7: "grid-cols-7",
|
|
95
|
+
8: "grid-cols-8",
|
|
96
|
+
9: "grid-cols-9"
|
|
97
|
+
}, ie = {
|
|
98
|
+
1: "grid-rows-1",
|
|
99
|
+
2: "grid-rows-2",
|
|
100
|
+
3: "grid-rows-3",
|
|
101
|
+
4: "grid-rows-4",
|
|
102
|
+
5: "grid-rows-5",
|
|
103
|
+
6: "grid-rows-6",
|
|
104
|
+
7: "grid-rows-7",
|
|
105
|
+
8: "grid-rows-8",
|
|
106
|
+
9: "grid-rows-9"
|
|
107
|
+
}, V = {
|
|
108
|
+
1: "gap-1",
|
|
109
|
+
2: "gap-2",
|
|
110
|
+
3: "gap-3",
|
|
111
|
+
4: "gap-4",
|
|
112
|
+
5: "gap-5",
|
|
113
|
+
6: "gap-6",
|
|
114
|
+
7: "gap-7",
|
|
115
|
+
8: "gap-8",
|
|
116
|
+
9: "gap-9"
|
|
117
|
+
}, ce = re(
|
|
118
|
+
"inline-flex justify-center items-center gap-2 disabled:opacity-50 aria-invalid:border-destructive focus-visible:border-ring rounded-md outline-none aria-invalid:ring-destructive/20 focus-visible:ring-[3px] focus-visible:ring-ring/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 font-medium text-sm whitespace-nowrap transition-all [&_svg]:pointer-events-none disabled:pointer-events-none shrink-0 [&_svg]:shrink-0",
|
|
119
|
+
{
|
|
120
|
+
variants: {
|
|
121
|
+
variant: {
|
|
122
|
+
default: `
|
|
123
|
+
bg-primary text-primary-foreground shadow-xs
|
|
124
|
+
hover:bg-primary/90
|
|
125
|
+
`,
|
|
126
|
+
destructive: `
|
|
127
|
+
bg-destructive text-white shadow-xs
|
|
128
|
+
hover:bg-destructive/90
|
|
129
|
+
focus-visible:ring-destructive/20
|
|
130
|
+
dark:bg-destructive/60 dark:focus-visible:ring-destructive/40
|
|
131
|
+
`,
|
|
132
|
+
outline: `
|
|
133
|
+
border bg-background shadow-xs
|
|
134
|
+
hover:bg-accent hover:text-accent-foreground
|
|
135
|
+
dark:border-input dark:bg-input/30 dark:hover:bg-input/50
|
|
136
|
+
`,
|
|
137
|
+
secondary: `
|
|
138
|
+
bg-secondary text-secondary-foreground shadow-xs
|
|
139
|
+
hover:bg-secondary/80
|
|
140
|
+
`,
|
|
141
|
+
ghost: `
|
|
142
|
+
hover:bg-accent hover:text-accent-foreground
|
|
143
|
+
dark:hover:bg-accent/50
|
|
144
|
+
`,
|
|
145
|
+
link: `
|
|
146
|
+
text-primary underline-offset-4
|
|
147
|
+
hover:underline
|
|
148
|
+
`
|
|
149
|
+
},
|
|
150
|
+
size: {
|
|
151
|
+
default: `
|
|
152
|
+
h-9 px-4 py-2
|
|
153
|
+
has-[>svg]:px-3
|
|
154
|
+
`,
|
|
155
|
+
sm: `
|
|
156
|
+
h-8 gap-1.5 rounded-md px-3
|
|
157
|
+
has-[>svg]:px-2.5
|
|
158
|
+
`,
|
|
159
|
+
lg: `
|
|
160
|
+
h-10 rounded-md px-6
|
|
161
|
+
has-[>svg]:px-4
|
|
162
|
+
`,
|
|
163
|
+
icon: "size-9"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
defaultVariants: {
|
|
167
|
+
variant: "default",
|
|
168
|
+
size: "default"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
), de = {
|
|
172
|
+
row: "flex-row",
|
|
173
|
+
col: "flex-col",
|
|
174
|
+
row_reverse: "flex-row-reverse",
|
|
175
|
+
col_reverse: "flex-col-reverse"
|
|
176
|
+
}, ue = {
|
|
177
|
+
wrap: "flex-wrap",
|
|
178
|
+
nowrap: "flex-nowrap",
|
|
179
|
+
wrap_reverse: "flex-wrap-reverse"
|
|
180
|
+
}, De = ({
|
|
181
|
+
children: t,
|
|
182
|
+
gap: e,
|
|
183
|
+
direction: a,
|
|
184
|
+
justify: r,
|
|
185
|
+
align: n,
|
|
186
|
+
wrap: s,
|
|
187
|
+
className: l = "",
|
|
188
|
+
element: u,
|
|
189
|
+
...f
|
|
190
|
+
}) => /* @__PURE__ */ o(
|
|
191
|
+
w,
|
|
192
|
+
{
|
|
193
|
+
element: u,
|
|
194
|
+
className: c(
|
|
195
|
+
"flex",
|
|
196
|
+
a && de[a],
|
|
197
|
+
r && j[r],
|
|
198
|
+
n && D[n],
|
|
199
|
+
s && ue[s],
|
|
200
|
+
e && V[e],
|
|
201
|
+
l
|
|
202
|
+
),
|
|
203
|
+
...f,
|
|
204
|
+
children: t
|
|
205
|
+
}
|
|
206
|
+
), Ve = ({
|
|
207
|
+
children: t,
|
|
208
|
+
className: e,
|
|
209
|
+
cols: a,
|
|
210
|
+
rows: r,
|
|
211
|
+
gap: n,
|
|
212
|
+
justify: s,
|
|
213
|
+
align: l,
|
|
214
|
+
element: u,
|
|
215
|
+
...f
|
|
216
|
+
}) => /* @__PURE__ */ o(
|
|
217
|
+
w,
|
|
218
|
+
{
|
|
219
|
+
element: u,
|
|
220
|
+
className: c(
|
|
221
|
+
"grid",
|
|
222
|
+
a && le[a],
|
|
223
|
+
r && ie[r],
|
|
224
|
+
n && V[n],
|
|
225
|
+
s && j[s],
|
|
226
|
+
l && D[l],
|
|
227
|
+
e
|
|
228
|
+
),
|
|
229
|
+
...f,
|
|
230
|
+
children: t
|
|
231
|
+
}
|
|
232
|
+
), ge = {
|
|
233
|
+
xs: "xs",
|
|
234
|
+
sm: "sm",
|
|
235
|
+
base: "base",
|
|
236
|
+
lg: "lg",
|
|
237
|
+
xl: "xl",
|
|
238
|
+
"2xl": "2xl",
|
|
239
|
+
"3xl": "3xl",
|
|
240
|
+
"4xl": "4xl"
|
|
241
|
+
}, $e = ({ children: t, element: e, className: a, size: r, ...n }) => /* @__PURE__ */ o(
|
|
242
|
+
N,
|
|
243
|
+
{
|
|
244
|
+
className: a,
|
|
245
|
+
element: e,
|
|
246
|
+
size: ge[r],
|
|
247
|
+
variant: "heading",
|
|
248
|
+
weight: "medium",
|
|
249
|
+
...n,
|
|
250
|
+
children: t
|
|
251
|
+
}
|
|
252
|
+
), Be = ({ children: t, className: e, href: a, ...r }) => /* @__PURE__ */ o(
|
|
253
|
+
"a",
|
|
254
|
+
{
|
|
255
|
+
"data-testid": "link",
|
|
256
|
+
href: a,
|
|
257
|
+
rel: "noopener noreferrer",
|
|
258
|
+
target: "_blank",
|
|
259
|
+
className: c(
|
|
260
|
+
"focus:outline-none text-blue-600 active:text-blue-900 visited:text-purple-600 hover:underline",
|
|
261
|
+
e
|
|
262
|
+
),
|
|
263
|
+
...r,
|
|
264
|
+
children: t
|
|
265
|
+
}
|
|
266
|
+
), me = {
|
|
267
|
+
xs: "xs",
|
|
268
|
+
sm: "sm",
|
|
269
|
+
base: "base",
|
|
270
|
+
lg: "lg"
|
|
271
|
+
}, Ke = ({ children: t, className: e, size: a, ...r }) => /* @__PURE__ */ o(
|
|
272
|
+
N,
|
|
273
|
+
{
|
|
274
|
+
className: e,
|
|
275
|
+
element: "p",
|
|
276
|
+
size: me[a],
|
|
277
|
+
variant: "body",
|
|
278
|
+
weight: "normal",
|
|
279
|
+
...r,
|
|
280
|
+
children: t
|
|
281
|
+
}
|
|
282
|
+
), Ue = ({ className: t = "", children: e, ...a }) => /* @__PURE__ */ o(w, { element: "section", className: t, ...a, children: e }), Ge = ({
|
|
283
|
+
children: t,
|
|
284
|
+
direction: e = "horizontal",
|
|
285
|
+
spacing: a = "space-x-2",
|
|
286
|
+
element: r,
|
|
287
|
+
className: n,
|
|
288
|
+
...s
|
|
289
|
+
}) => /* @__PURE__ */ o(w, { className: c("flex", e === "vertical" ? "flex-col" : "flex-row", a, n), element: r, ...s, children: t }), N = ({
|
|
290
|
+
className: t,
|
|
291
|
+
children: e,
|
|
292
|
+
element: a,
|
|
293
|
+
weight: r,
|
|
294
|
+
variant: n,
|
|
295
|
+
size: s,
|
|
296
|
+
...l
|
|
297
|
+
}) => /* @__PURE__ */ o(
|
|
298
|
+
a,
|
|
299
|
+
{
|
|
300
|
+
"data-testid": "text",
|
|
301
|
+
className: c(
|
|
302
|
+
"font-normal text-base",
|
|
303
|
+
s && se[s],
|
|
304
|
+
r && oe[r],
|
|
305
|
+
n && ne[n],
|
|
306
|
+
t
|
|
307
|
+
),
|
|
308
|
+
...l,
|
|
309
|
+
children: e
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
function Oe({
|
|
313
|
+
className: t,
|
|
314
|
+
variant: e,
|
|
315
|
+
size: a,
|
|
316
|
+
asChild: r = !1,
|
|
317
|
+
...n
|
|
318
|
+
}) {
|
|
319
|
+
return /* @__PURE__ */ o(
|
|
320
|
+
r ? X : "button",
|
|
321
|
+
{
|
|
322
|
+
"data-slot": "button",
|
|
323
|
+
className: c(ce({ variant: e, size: a, className: t })),
|
|
324
|
+
...n,
|
|
325
|
+
"data-testid": "button"
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
function We({ className: t, type: e, ...a }) {
|
|
330
|
+
return /* @__PURE__ */ o(
|
|
331
|
+
"input",
|
|
332
|
+
{
|
|
333
|
+
type: e,
|
|
334
|
+
"data-slot": "input",
|
|
335
|
+
className: c(
|
|
336
|
+
`
|
|
337
|
+
flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent
|
|
338
|
+
px-3 py-1 text-base shadow-xs transition-[color,box-shadow]
|
|
339
|
+
outline-none
|
|
340
|
+
selection:bg-primary selection:text-primary-foreground
|
|
341
|
+
file:inline-flex file:h-7 file:border-0 file:bg-transparent
|
|
342
|
+
file:text-sm file:font-medium file:text-foreground
|
|
343
|
+
placeholder:text-muted-foreground
|
|
344
|
+
disabled:pointer-events-none disabled:cursor-not-allowed
|
|
345
|
+
disabled:opacity-50
|
|
346
|
+
md:text-sm
|
|
347
|
+
dark:bg-input/30
|
|
348
|
+
`,
|
|
349
|
+
`
|
|
350
|
+
focus-visible:border-ring focus-visible:ring-[3px]
|
|
351
|
+
focus-visible:ring-ring/50
|
|
352
|
+
`,
|
|
353
|
+
`
|
|
354
|
+
aria-invalid:border-destructive aria-invalid:ring-destructive/20
|
|
355
|
+
dark:aria-invalid:ring-destructive/40
|
|
356
|
+
`,
|
|
357
|
+
t
|
|
358
|
+
),
|
|
359
|
+
...a,
|
|
360
|
+
"data-testid": "input"
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
const fe = ee(
|
|
365
|
+
({
|
|
366
|
+
children: t,
|
|
367
|
+
className: e = "",
|
|
368
|
+
colors: a = ["#FF0080", "#7928CA", "#0070F3", "#38bdf8"],
|
|
369
|
+
speed: r = 1
|
|
370
|
+
}) => {
|
|
371
|
+
const n = {
|
|
372
|
+
backgroundImage: `linear-gradient(135deg, ${a.join(", ")}, ${a[0]})`,
|
|
373
|
+
WebkitBackgroundClip: "text",
|
|
374
|
+
WebkitTextFillColor: "transparent",
|
|
375
|
+
animationDuration: `${10 / r}s`
|
|
376
|
+
};
|
|
377
|
+
return /* @__PURE__ */ y(
|
|
378
|
+
"span",
|
|
379
|
+
{
|
|
380
|
+
className: `
|
|
381
|
+
relative inline-block
|
|
382
|
+
${e}
|
|
383
|
+
`,
|
|
384
|
+
"data-testid": "auroraText",
|
|
385
|
+
children: [
|
|
386
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: t }),
|
|
387
|
+
/* @__PURE__ */ o(
|
|
388
|
+
"span",
|
|
389
|
+
{
|
|
390
|
+
className: `
|
|
391
|
+
relative animate-aurora bg-clip-text text-transparent
|
|
392
|
+
bg-[length:200%_auto]
|
|
393
|
+
`,
|
|
394
|
+
style: n,
|
|
395
|
+
"aria-hidden": "true",
|
|
396
|
+
children: t
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
);
|
|
404
|
+
fe.displayName = "AuroraText";
|
|
405
|
+
function pe({ ...t }) {
|
|
406
|
+
return /* @__PURE__ */ o(d.Root, { "data-slot": "select", ...t });
|
|
407
|
+
}
|
|
408
|
+
function He({ ...t }) {
|
|
409
|
+
return /* @__PURE__ */ o(d.Group, { "data-slot": "select-group", ...t });
|
|
410
|
+
}
|
|
411
|
+
function xe({ ...t }) {
|
|
412
|
+
return /* @__PURE__ */ o(d.Value, { "data-slot": "select-value", ...t });
|
|
413
|
+
}
|
|
414
|
+
function be({
|
|
415
|
+
className: t,
|
|
416
|
+
size: e = "default",
|
|
417
|
+
children: a,
|
|
418
|
+
...r
|
|
419
|
+
}) {
|
|
420
|
+
return /* @__PURE__ */ y(
|
|
421
|
+
d.Trigger,
|
|
422
|
+
{
|
|
423
|
+
"data-slot": "select-trigger",
|
|
424
|
+
"data-size": e,
|
|
425
|
+
className: c(
|
|
426
|
+
`
|
|
427
|
+
flex w-fit items-center justify-between gap-2 rounded-md border
|
|
428
|
+
border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap
|
|
429
|
+
shadow-xs transition-[color,box-shadow] outline-none
|
|
430
|
+
focus-visible:border-ring focus-visible:ring-[3px]
|
|
431
|
+
focus-visible:ring-ring/50
|
|
432
|
+
disabled:cursor-not-allowed disabled:opacity-50
|
|
433
|
+
aria-invalid:border-destructive aria-invalid:ring-destructive/20
|
|
434
|
+
data-[placeholder]:text-muted-foreground
|
|
435
|
+
data-[size=default]:h-9
|
|
436
|
+
data-[size=sm]:h-8
|
|
437
|
+
*:data-[slot=select-value]:line-clamp-1
|
|
438
|
+
*:data-[slot=select-value]:flex
|
|
439
|
+
*:data-[slot=select-value]:items-center
|
|
440
|
+
*:data-[slot=select-value]:gap-2
|
|
441
|
+
dark:bg-input/30 dark:hover:bg-input/50
|
|
442
|
+
dark:aria-invalid:ring-destructive/40
|
|
443
|
+
[&_svg]:pointer-events-none [&_svg]:shrink-0
|
|
444
|
+
[&_svg:not([class*='size-'])]:size-4
|
|
445
|
+
[&_svg:not([class*='text-'])]:text-muted-foreground
|
|
446
|
+
`,
|
|
447
|
+
t
|
|
448
|
+
),
|
|
449
|
+
...r,
|
|
450
|
+
children: [
|
|
451
|
+
a,
|
|
452
|
+
/* @__PURE__ */ o(d.Icon, { asChild: !0, children: /* @__PURE__ */ o(F, { className: "size-4 opacity-50" }) })
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
function ve({
|
|
458
|
+
className: t,
|
|
459
|
+
children: e,
|
|
460
|
+
position: a = "popper",
|
|
461
|
+
...r
|
|
462
|
+
}) {
|
|
463
|
+
return /* @__PURE__ */ o(d.Portal, { "data-testid": "select", children: /* @__PURE__ */ y(
|
|
464
|
+
d.Content,
|
|
465
|
+
{
|
|
466
|
+
"data-slot": "select-content",
|
|
467
|
+
className: c(
|
|
468
|
+
`
|
|
469
|
+
relative z-50 max-h-(--radix-select-content-available-height)
|
|
470
|
+
min-w-[8rem] origin-(--radix-select-content-transform-origin)
|
|
471
|
+
overflow-x-hidden overflow-y-auto rounded-md border bg-popover
|
|
472
|
+
text-popover-foreground shadow-md
|
|
473
|
+
data-[side=bottom]:slide-in-from-top-2
|
|
474
|
+
data-[side=left]:slide-in-from-right-2
|
|
475
|
+
data-[side=right]:slide-in-from-left-2
|
|
476
|
+
data-[side=top]:slide-in-from-bottom-2
|
|
477
|
+
data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|
|
478
|
+
data-[state=closed]:zoom-out-95
|
|
479
|
+
data-[state=open]:animate-in data-[state=open]:fade-in-0
|
|
480
|
+
data-[state=open]:zoom-in-95
|
|
481
|
+
`,
|
|
482
|
+
a === "popper" && `
|
|
483
|
+
data-[side=bottom]:translate-y-1
|
|
484
|
+
data-[side=left]:-translate-x-1
|
|
485
|
+
data-[side=right]:translate-x-1
|
|
486
|
+
data-[side=top]:-translate-y-1
|
|
487
|
+
`,
|
|
488
|
+
t
|
|
489
|
+
),
|
|
490
|
+
position: a,
|
|
491
|
+
...r,
|
|
492
|
+
children: [
|
|
493
|
+
/* @__PURE__ */ o(ye, {}),
|
|
494
|
+
/* @__PURE__ */ o(
|
|
495
|
+
d.Viewport,
|
|
496
|
+
{
|
|
497
|
+
className: c(
|
|
498
|
+
"p-1",
|
|
499
|
+
a === "popper" && `
|
|
500
|
+
h-[var(--radix-select-trigger-height)] w-full
|
|
501
|
+
min-w-[var(--radix-select-trigger-width)] scroll-my-1
|
|
502
|
+
`
|
|
503
|
+
),
|
|
504
|
+
children: e
|
|
505
|
+
}
|
|
506
|
+
),
|
|
507
|
+
/* @__PURE__ */ o(we, {})
|
|
508
|
+
]
|
|
509
|
+
}
|
|
510
|
+
) });
|
|
511
|
+
}
|
|
512
|
+
function qe({ className: t, ...e }) {
|
|
513
|
+
return /* @__PURE__ */ o(
|
|
514
|
+
d.Label,
|
|
515
|
+
{
|
|
516
|
+
"data-slot": "select-label",
|
|
517
|
+
className: c("px-2 py-1.5 text-xs text-muted-foreground", t),
|
|
518
|
+
...e
|
|
519
|
+
}
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
function he({
|
|
523
|
+
className: t,
|
|
524
|
+
children: e,
|
|
525
|
+
...a
|
|
526
|
+
}) {
|
|
527
|
+
return /* @__PURE__ */ y(
|
|
528
|
+
d.Item,
|
|
529
|
+
{
|
|
530
|
+
"data-slot": "select-item",
|
|
531
|
+
className: c(
|
|
532
|
+
`
|
|
533
|
+
relative flex w-full cursor-default items-center gap-2 rounded-sm
|
|
534
|
+
py-1.5 pr-8 pl-2 text-sm outline-hidden select-none
|
|
535
|
+
focus:bg-accent focus:text-accent-foreground
|
|
536
|
+
data-[disabled]:pointer-events-none data-[disabled]:opacity-50
|
|
537
|
+
[&_svg]:pointer-events-none [&_svg]:shrink-0
|
|
538
|
+
[&_svg:not([class*='size-'])]:size-4
|
|
539
|
+
[&_svg:not([class*='text-'])]:text-muted-foreground
|
|
540
|
+
*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2
|
|
541
|
+
`,
|
|
542
|
+
t
|
|
543
|
+
),
|
|
544
|
+
...a,
|
|
545
|
+
children: [
|
|
546
|
+
/* @__PURE__ */ o("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ o(d.ItemIndicator, { children: /* @__PURE__ */ o(te, { className: "size-4" }) }) }),
|
|
547
|
+
/* @__PURE__ */ o(d.ItemText, { children: e })
|
|
548
|
+
]
|
|
549
|
+
}
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
function Qe({
|
|
553
|
+
className: t,
|
|
554
|
+
...e
|
|
555
|
+
}) {
|
|
556
|
+
return /* @__PURE__ */ o(
|
|
557
|
+
d.Separator,
|
|
558
|
+
{
|
|
559
|
+
"data-slot": "select-separator",
|
|
560
|
+
className: c("pointer-events-none -mx-1 my-1 h-px bg-border", t),
|
|
561
|
+
...e
|
|
562
|
+
}
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
function ye({
|
|
566
|
+
className: t,
|
|
567
|
+
...e
|
|
568
|
+
}) {
|
|
569
|
+
return /* @__PURE__ */ o(
|
|
570
|
+
d.ScrollUpButton,
|
|
571
|
+
{
|
|
572
|
+
"data-slot": "select-scroll-up-button",
|
|
573
|
+
className: c("flex cursor-default items-center justify-center py-1", t),
|
|
574
|
+
...e,
|
|
575
|
+
children: /* @__PURE__ */ o(ae, { className: "size-4" })
|
|
576
|
+
}
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
function we({
|
|
580
|
+
className: t,
|
|
581
|
+
...e
|
|
582
|
+
}) {
|
|
583
|
+
return /* @__PURE__ */ o(
|
|
584
|
+
d.ScrollDownButton,
|
|
585
|
+
{
|
|
586
|
+
"data-slot": "select-scroll-down-button",
|
|
587
|
+
className: c("flex cursor-default items-center justify-center py-1", t),
|
|
588
|
+
...e,
|
|
589
|
+
children: /* @__PURE__ */ o(F, { className: "size-4" })
|
|
590
|
+
}
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
const Ze = ({
|
|
594
|
+
translationKey: t,
|
|
595
|
+
translationOptions: e,
|
|
596
|
+
namespace: a,
|
|
597
|
+
...r
|
|
598
|
+
}) => {
|
|
599
|
+
const s = M(a)(
|
|
600
|
+
t,
|
|
601
|
+
e == null ? void 0 : e.args
|
|
602
|
+
);
|
|
603
|
+
return /* @__PURE__ */ o(N, { ...r, children: s });
|
|
604
|
+
}, Je = ({
|
|
605
|
+
translationKey: t,
|
|
606
|
+
translationOptions: e,
|
|
607
|
+
namespace: a,
|
|
608
|
+
className: r,
|
|
609
|
+
tag: n = "div"
|
|
610
|
+
}) => {
|
|
611
|
+
const l = M(a)(
|
|
612
|
+
t,
|
|
613
|
+
e == null ? void 0 : e.args
|
|
614
|
+
);
|
|
615
|
+
return Y.createElement(n, { className: r, "data-testid": "translated-html" }, l);
|
|
616
|
+
};
|
|
617
|
+
var Ne = Object.defineProperty, i = (t, e) => Ne(t, "name", { value: e, configurable: !0 }), E = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
|
|
618
|
+
function I(t, e) {
|
|
619
|
+
return `${t}:${JSON.stringify(e ?? {})}`;
|
|
620
|
+
}
|
|
621
|
+
i(I, "getFormatterKey");
|
|
622
|
+
function $(t) {
|
|
623
|
+
const e = typeof t == "string" || typeof t == "number" ? new Date(t) : t;
|
|
624
|
+
return e instanceof Date && !Number.isNaN(e.getTime()) ? e : null;
|
|
625
|
+
}
|
|
626
|
+
i($, "parseDate");
|
|
627
|
+
function B(t, e = "en", a) {
|
|
628
|
+
var s;
|
|
629
|
+
const r = $(t);
|
|
630
|
+
if (!r)
|
|
631
|
+
return "";
|
|
632
|
+
const n = I(e, a);
|
|
633
|
+
return E.has(n) || E.set(n, new Intl.DateTimeFormat(e, a)), ((s = E.get(n)) == null ? void 0 : s.format(r)) ?? "";
|
|
634
|
+
}
|
|
635
|
+
i(B, "formatDate");
|
|
636
|
+
function K(t, e = "en", a) {
|
|
637
|
+
var n;
|
|
638
|
+
if (typeof t != "number" || Number.isNaN(t))
|
|
639
|
+
return "";
|
|
640
|
+
const r = I(e, a);
|
|
641
|
+
return _.has(r) || _.set(r, new Intl.NumberFormat(e, a)), ((n = _.get(r)) == null ? void 0 : n.format(t)) ?? "";
|
|
642
|
+
}
|
|
643
|
+
i(K, "formatNumber");
|
|
644
|
+
var P = {
|
|
645
|
+
defaultLocale: "en",
|
|
646
|
+
supportedLocales: ["en", "es", "fr", "it", "pt-BR", "pt-PT"],
|
|
647
|
+
fallbackLocale: "en"
|
|
648
|
+
};
|
|
649
|
+
function ke() {
|
|
650
|
+
return P.supportedLocales;
|
|
651
|
+
}
|
|
652
|
+
i(ke, "getSupportedLanguages");
|
|
653
|
+
function Le() {
|
|
654
|
+
return P.defaultLocale;
|
|
655
|
+
}
|
|
656
|
+
i(Le, "getDefaultLanguage");
|
|
657
|
+
function Pe() {
|
|
658
|
+
return P.fallbackLocale;
|
|
659
|
+
}
|
|
660
|
+
i(Pe, "getFallbackLanguage");
|
|
661
|
+
function Se(t) {
|
|
662
|
+
return P.supportedLocales.includes(t);
|
|
663
|
+
}
|
|
664
|
+
i(Se, "isSupportedLanguage");
|
|
665
|
+
var p = /* @__PURE__ */ new Map();
|
|
666
|
+
function Ee({
|
|
667
|
+
value: t,
|
|
668
|
+
forms: e,
|
|
669
|
+
lang: a,
|
|
670
|
+
type: r = "cardinal"
|
|
671
|
+
}) {
|
|
672
|
+
if (!G(t, e))
|
|
673
|
+
return "";
|
|
674
|
+
if (t === 0 && e.zero)
|
|
675
|
+
return z(e.zero, t);
|
|
676
|
+
const s = O(a, r).select(t), l = U(e, s) ?? e.other ?? Object.values(e)[0];
|
|
677
|
+
return l ? z(l, t) : "";
|
|
678
|
+
}
|
|
679
|
+
i(Ee, "pluralize");
|
|
680
|
+
function R(t, e) {
|
|
681
|
+
return `${t}:${e}`;
|
|
682
|
+
}
|
|
683
|
+
i(R, "getPluralRulesKey");
|
|
684
|
+
var _e = /{count}|#/g;
|
|
685
|
+
function U(t, e) {
|
|
686
|
+
switch (e) {
|
|
687
|
+
case "zero":
|
|
688
|
+
return t.zero;
|
|
689
|
+
case "one":
|
|
690
|
+
return t.one;
|
|
691
|
+
case "two":
|
|
692
|
+
return t.two;
|
|
693
|
+
case "few":
|
|
694
|
+
return t.few;
|
|
695
|
+
case "many":
|
|
696
|
+
return t.many;
|
|
697
|
+
case "other":
|
|
698
|
+
return t.other;
|
|
699
|
+
default:
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
i(U, "selectTemplate");
|
|
704
|
+
function G(t, e) {
|
|
705
|
+
return typeof t == "number" && e && typeof e == "object";
|
|
706
|
+
}
|
|
707
|
+
i(G, "isValidInput");
|
|
708
|
+
function z(t, e) {
|
|
709
|
+
return t.replaceAll(_e, e.toString());
|
|
710
|
+
}
|
|
711
|
+
i(z, "replacePlaceholders");
|
|
712
|
+
function O(t, e) {
|
|
713
|
+
const a = R(t, e);
|
|
714
|
+
if (!p.has(a))
|
|
715
|
+
try {
|
|
716
|
+
p.set(a, new Intl.PluralRules(t, { type: e }));
|
|
717
|
+
} catch {
|
|
718
|
+
return L(a, e);
|
|
719
|
+
}
|
|
720
|
+
return p.get(a) ?? L(a, e);
|
|
721
|
+
}
|
|
722
|
+
i(O, "getPluralRules");
|
|
723
|
+
function L(t, e) {
|
|
724
|
+
const a = R("en", e);
|
|
725
|
+
p.has(a) || p.set(a, new Intl.PluralRules("en", { type: e }));
|
|
726
|
+
const r = p.get(a) ?? L(a, e);
|
|
727
|
+
return p.set(t, r), r;
|
|
728
|
+
}
|
|
729
|
+
i(L, "getFallbackPluralRules");
|
|
730
|
+
var g;
|
|
731
|
+
g = class {
|
|
732
|
+
constructor() {
|
|
733
|
+
k(this, "fallbackLocale");
|
|
734
|
+
this.fallbackLocale = "en";
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Get the singleton instance of LocaleDetector.
|
|
738
|
+
* @returns {LocaleDetector} The singleton instance.
|
|
739
|
+
*/
|
|
740
|
+
static getInstance() {
|
|
741
|
+
return g.instance || (g.instance = new g()), g.instance;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Detect locale using server-side request or client-side settings.
|
|
745
|
+
* @param {any} [request] - Optional server request object.
|
|
746
|
+
* @returns {string} Detected locale string.
|
|
747
|
+
*/
|
|
748
|
+
detectLocale(e) {
|
|
749
|
+
return e ? this.detectFromRequest(e) : this.fallbackLocale;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Detect locale from a server request (query, headers, cookies).
|
|
753
|
+
* @param {any} request - Server request object.
|
|
754
|
+
* @returns {string} Detected locale string.
|
|
755
|
+
* @private
|
|
756
|
+
*/
|
|
757
|
+
detectFromRequest(e) {
|
|
758
|
+
var s, l, u;
|
|
759
|
+
const a = (s = e.url.split("?")[1]) == null ? void 0 : s.split("=")[1], r = e.headers.get("accept-language"), n = (u = (l = e.headers.get("cookie")) == null ? void 0 : l.split("; ").find((f) => f.startsWith("locale="))) == null ? void 0 : u.split("=")[1];
|
|
760
|
+
return a ?? n ?? this.parseAcceptLanguage(r ?? "") ?? this.fallbackLocale;
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Parse Accept-Language header and return the highest priority language.
|
|
764
|
+
* @param {string} header - Accept-Language header value.
|
|
765
|
+
* @returns {string|null} Best language or null.
|
|
766
|
+
* @private
|
|
767
|
+
*/
|
|
768
|
+
parseAcceptLanguage(e) {
|
|
769
|
+
if (!e)
|
|
770
|
+
return null;
|
|
771
|
+
let a = null, r = 0;
|
|
772
|
+
for (const n of e.split(",")) {
|
|
773
|
+
const { lang: s, q: l } = this.parseLangAndQ(n.trim());
|
|
774
|
+
if (l > r && (r = l, a = s, l === 1))
|
|
775
|
+
break;
|
|
776
|
+
}
|
|
777
|
+
return a;
|
|
778
|
+
}
|
|
779
|
+
parseLangAndQ(e) {
|
|
780
|
+
const a = e.indexOf(";"), r = a === -1 ? e : e.slice(0, Math.max(0, a));
|
|
781
|
+
let n = 1;
|
|
782
|
+
if (a !== -1) {
|
|
783
|
+
const s = /q=(?<q>[\d.]+)/.exec(e.slice(a + 1));
|
|
784
|
+
n = s != null && s.groups ? Number.parseFloat(s.groups.q) || 0 : 1;
|
|
785
|
+
}
|
|
786
|
+
return { lang: r, q: n };
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Set the fallback locale.
|
|
790
|
+
* @param {string} locale - Fallback locale string.
|
|
791
|
+
* @internal
|
|
792
|
+
*/
|
|
793
|
+
setFallbackLocale(e) {
|
|
794
|
+
this.fallbackLocale = e;
|
|
795
|
+
}
|
|
796
|
+
}, i(g, "LocaleDetector"), k(g, "instance");
|
|
797
|
+
var v;
|
|
798
|
+
v = class {
|
|
799
|
+
constructor(e) {
|
|
800
|
+
k(this, "namespaces");
|
|
801
|
+
this.namespaces = e ? new Map(e) : /* @__PURE__ */ new Map();
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Add a namespace with its translations.
|
|
805
|
+
* @param {string} name - Namespace name.
|
|
806
|
+
* @param {Record<string, string>} translations - Translation key-value pairs.
|
|
807
|
+
* @throws {Error} If the namespace name is invalid.
|
|
808
|
+
*/
|
|
809
|
+
addNamespace(e, a) {
|
|
810
|
+
if (!W(e))
|
|
811
|
+
throw new Error("Invalid namespace name");
|
|
812
|
+
this.namespaces.set(e, a);
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Get a namespace by name.
|
|
816
|
+
* @param {string} name - Namespace name.
|
|
817
|
+
* @returns {Record<string, string> | undefined} Namespace translations or undefined.
|
|
818
|
+
*/
|
|
819
|
+
getNamespace(e) {
|
|
820
|
+
return this.namespaces.get(e);
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Get all namespace names.
|
|
824
|
+
* @returns {string[]} Array of namespace names.
|
|
825
|
+
*/
|
|
826
|
+
getAllNamespaces() {
|
|
827
|
+
return [...this.namespaces.keys()];
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Merge two namespaces into the target.
|
|
831
|
+
* @param {string} target - Target namespace name.
|
|
832
|
+
* @param {string} source - Source namespace name.
|
|
833
|
+
*/
|
|
834
|
+
mergeNamespaces(e, a) {
|
|
835
|
+
const r = this.namespaces.get(e) ?? {}, n = this.namespaces.get(a) ?? {};
|
|
836
|
+
this.namespaces.set(e, { ...r, ...n });
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Validate a namespace against a schema.
|
|
840
|
+
* @param {string} name - Namespace name.
|
|
841
|
+
* @param {Record<string, string>} [schema] - Optional schema to validate against.
|
|
842
|
+
* @returns {boolean} True if valid, false otherwise.
|
|
843
|
+
*/
|
|
844
|
+
validateNamespace(e, a) {
|
|
845
|
+
const r = this.namespaces.get(e);
|
|
846
|
+
return r ? a ? Object.entries(a).every(([n, s]) => {
|
|
847
|
+
var u;
|
|
848
|
+
const l = (u = Object.getOwnPropertyDescriptor(r, n)) == null ? void 0 : u.value;
|
|
849
|
+
return l !== void 0 && typeof l === s;
|
|
850
|
+
}) : !0 : !1;
|
|
851
|
+
}
|
|
852
|
+
}, i(v, "NamespaceManager");
|
|
853
|
+
function W(t) {
|
|
854
|
+
return /^\w+$/.test(t);
|
|
855
|
+
}
|
|
856
|
+
i(W, "isSafeKey");
|
|
857
|
+
const Xe = ({
|
|
858
|
+
date: t,
|
|
859
|
+
formatOptions: e,
|
|
860
|
+
locale: a,
|
|
861
|
+
...r
|
|
862
|
+
}) => {
|
|
863
|
+
const n = B(t, a, e);
|
|
864
|
+
return /* @__PURE__ */ o(N, { ...r, children: n });
|
|
865
|
+
}, Ye = ({
|
|
866
|
+
value: t,
|
|
867
|
+
formatOptions: e,
|
|
868
|
+
locale: a,
|
|
869
|
+
...r
|
|
870
|
+
}) => {
|
|
871
|
+
const n = K(t, a, e);
|
|
872
|
+
return /* @__PURE__ */ o(N, { ...r, children: n });
|
|
873
|
+
};
|
|
874
|
+
function et({
|
|
875
|
+
locale: t,
|
|
876
|
+
locales: e,
|
|
877
|
+
onChange: a,
|
|
878
|
+
getLabel: r,
|
|
879
|
+
disabled: n
|
|
880
|
+
}) {
|
|
881
|
+
return /* @__PURE__ */ y(pe, { value: t, onValueChange: a, disabled: n, children: [
|
|
882
|
+
/* @__PURE__ */ o(be, { children: /* @__PURE__ */ o(xe, { placeholder: r(t) }) }),
|
|
883
|
+
/* @__PURE__ */ o(ve, { children: e.map((s) => /* @__PURE__ */ o(he, { value: s, children: r(s) }, s)) })
|
|
884
|
+
] });
|
|
885
|
+
}
|
|
886
|
+
export {
|
|
887
|
+
fe as AuroraText,
|
|
888
|
+
w as Box,
|
|
889
|
+
Oe as Button,
|
|
890
|
+
je as Container,
|
|
891
|
+
Be as ExternalLink,
|
|
892
|
+
De as Flex,
|
|
893
|
+
Xe as FormattedDate,
|
|
894
|
+
Ye as FormattedNumber,
|
|
895
|
+
Ve as Grid,
|
|
896
|
+
$e as Heading,
|
|
897
|
+
We as Input,
|
|
898
|
+
et as LanguageSelector,
|
|
899
|
+
Ke as Paragraph,
|
|
900
|
+
Ue as Section,
|
|
901
|
+
pe as Select,
|
|
902
|
+
ve as SelectContent,
|
|
903
|
+
He as SelectGroup,
|
|
904
|
+
he as SelectItem,
|
|
905
|
+
qe as SelectLabel,
|
|
906
|
+
we as SelectScrollDownButton,
|
|
907
|
+
ye as SelectScrollUpButton,
|
|
908
|
+
Qe as SelectSeparator,
|
|
909
|
+
be as SelectTrigger,
|
|
910
|
+
xe as SelectValue,
|
|
911
|
+
Ge as Stack,
|
|
912
|
+
N as Text,
|
|
913
|
+
Je as TranslatedHtml,
|
|
914
|
+
Ze as TranslatedText
|
|
915
|
+
};
|