@alfadocs/ui-kit 0.24.0 → 0.25.0
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/_chunks/{card-CWzuTLYE.js → card-C353dU-H.js} +21 -13
- package/dist/_chunks/carousel.agent-DnPiqijR.js +1733 -0
- package/dist/_chunks/{contact-card-DTQUMetD.js → contact-card-CjG7c-1q.js} +2 -2
- package/dist/_chunks/description-list-Bsga4IW8.js +309 -0
- package/dist/_chunks/{locale-picker-CYBhgSHR.js → locale-picker-BxEUUPW7.js} +212 -149
- package/dist/_chunks/{timeline-Czeqr3HF.js → timeline-jmd7lfDf.js} +19 -12
- package/dist/_chunks/{workflow-map-712GL-8u.js → workflow-map-BR6txfFX.js} +2 -2
- package/dist/agent-catalog.json +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/carousel/carousel.d.ts +21 -0
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/contact-card/index.js +1 -1
- package/dist/components/description-list/description-list.d.ts +40 -0
- package/dist/components/description-list/index.d.ts +1 -1
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/header-settings/index.js +123 -96
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/index.js +6 -6
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/carousel.agent-CQPFfppK.js +0 -1696
- package/dist/_chunks/description-list-y7Hk51KI.js +0 -191
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { _ as
|
|
1
|
+
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as F, useId as B, useState as M, useCallback as R, useMemo as _, useRef as j, useImperativeHandle as q, useEffect as J } from "react";
|
|
3
|
+
import { c as O } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as x } from "react-i18next";
|
|
5
|
+
import { _ as y, R as K } from "./index-4xgbg-sn.js";
|
|
6
6
|
import { I as W } from "./icon-button-C4CGcYuz.js";
|
|
7
7
|
import { P as p } from "./popover--derJ_wq.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
8
|
+
import { h as E, a as T } from "./flag-DZ6V7-hU.js";
|
|
9
|
+
import { c as X, a as Y, d as $ } from "./input-surface-xyERuLU_.js";
|
|
10
|
+
import { LOCALES_WITH_BUNDLES as G } from "../i18n/config.js";
|
|
11
|
+
import { u as Q } from "./use-locale-BkCIHujH.js";
|
|
12
|
+
import { u as Z } from "./registry-C9nwlNyL.js";
|
|
13
|
+
import { G as A } from "./globe-BkEFMNSg.js";
|
|
14
|
+
import { C as ee } from "./check-DPdL_Sm7.js";
|
|
15
|
+
const w = {
|
|
14
16
|
en: {
|
|
15
17
|
code: "en",
|
|
16
18
|
nativeName: "English",
|
|
17
19
|
englishName: "English",
|
|
20
|
+
countryCode: "GB",
|
|
18
21
|
flag: "🇬🇧",
|
|
19
22
|
dir: "ltr"
|
|
20
23
|
},
|
|
@@ -22,6 +25,7 @@ const P = {
|
|
|
22
25
|
code: "it",
|
|
23
26
|
nativeName: "Italiano",
|
|
24
27
|
englishName: "Italian",
|
|
28
|
+
countryCode: "IT",
|
|
25
29
|
flag: "🇮🇹",
|
|
26
30
|
dir: "ltr"
|
|
27
31
|
},
|
|
@@ -29,6 +33,7 @@ const P = {
|
|
|
29
33
|
code: "de",
|
|
30
34
|
nativeName: "Deutsch",
|
|
31
35
|
englishName: "German",
|
|
36
|
+
countryCode: "DE",
|
|
32
37
|
flag: "🇩🇪",
|
|
33
38
|
dir: "ltr"
|
|
34
39
|
},
|
|
@@ -36,6 +41,7 @@ const P = {
|
|
|
36
41
|
code: "ar",
|
|
37
42
|
nativeName: "العربية",
|
|
38
43
|
englishName: "Arabic",
|
|
44
|
+
countryCode: "SA",
|
|
39
45
|
flag: "🇸🇦",
|
|
40
46
|
dir: "rtl"
|
|
41
47
|
},
|
|
@@ -43,6 +49,7 @@ const P = {
|
|
|
43
49
|
code: "fr",
|
|
44
50
|
nativeName: "Français",
|
|
45
51
|
englishName: "French",
|
|
52
|
+
countryCode: "FR",
|
|
46
53
|
flag: "🇫🇷",
|
|
47
54
|
dir: "ltr"
|
|
48
55
|
},
|
|
@@ -50,6 +57,7 @@ const P = {
|
|
|
50
57
|
code: "es",
|
|
51
58
|
nativeName: "Español",
|
|
52
59
|
englishName: "Spanish",
|
|
60
|
+
countryCode: "ES",
|
|
53
61
|
flag: "🇪🇸",
|
|
54
62
|
dir: "ltr"
|
|
55
63
|
},
|
|
@@ -57,6 +65,7 @@ const P = {
|
|
|
57
65
|
code: "pt",
|
|
58
66
|
nativeName: "Português",
|
|
59
67
|
englishName: "Portuguese",
|
|
68
|
+
countryCode: "PT",
|
|
60
69
|
flag: "🇵🇹",
|
|
61
70
|
dir: "ltr"
|
|
62
71
|
},
|
|
@@ -64,6 +73,7 @@ const P = {
|
|
|
64
73
|
code: "nl",
|
|
65
74
|
nativeName: "Nederlands",
|
|
66
75
|
englishName: "Dutch",
|
|
76
|
+
countryCode: "NL",
|
|
67
77
|
flag: "🇳🇱",
|
|
68
78
|
dir: "ltr"
|
|
69
79
|
},
|
|
@@ -71,6 +81,7 @@ const P = {
|
|
|
71
81
|
code: "ro",
|
|
72
82
|
nativeName: "Română",
|
|
73
83
|
englishName: "Romanian",
|
|
84
|
+
countryCode: "RO",
|
|
74
85
|
flag: "🇷🇴",
|
|
75
86
|
dir: "ltr"
|
|
76
87
|
},
|
|
@@ -78,6 +89,7 @@ const P = {
|
|
|
78
89
|
code: "sq",
|
|
79
90
|
nativeName: "Shqip",
|
|
80
91
|
englishName: "Albanian",
|
|
92
|
+
countryCode: "AL",
|
|
81
93
|
flag: "🇦🇱",
|
|
82
94
|
dir: "ltr"
|
|
83
95
|
},
|
|
@@ -85,6 +97,7 @@ const P = {
|
|
|
85
97
|
code: "tr",
|
|
86
98
|
nativeName: "Türkçe",
|
|
87
99
|
englishName: "Turkish",
|
|
100
|
+
countryCode: "TR",
|
|
88
101
|
flag: "🇹🇷",
|
|
89
102
|
dir: "ltr"
|
|
90
103
|
},
|
|
@@ -92,6 +105,7 @@ const P = {
|
|
|
92
105
|
code: "pl",
|
|
93
106
|
nativeName: "Polski",
|
|
94
107
|
englishName: "Polish",
|
|
108
|
+
countryCode: "PL",
|
|
95
109
|
flag: "🇵🇱",
|
|
96
110
|
dir: "ltr"
|
|
97
111
|
},
|
|
@@ -99,6 +113,7 @@ const P = {
|
|
|
99
113
|
code: "sv",
|
|
100
114
|
nativeName: "Svenska",
|
|
101
115
|
englishName: "Swedish",
|
|
116
|
+
countryCode: "SE",
|
|
102
117
|
flag: "🇸🇪",
|
|
103
118
|
dir: "ltr"
|
|
104
119
|
},
|
|
@@ -106,6 +121,7 @@ const P = {
|
|
|
106
121
|
code: "ru",
|
|
107
122
|
nativeName: "Русский",
|
|
108
123
|
englishName: "Russian",
|
|
124
|
+
countryCode: "RU",
|
|
109
125
|
flag: "🇷🇺",
|
|
110
126
|
dir: "ltr"
|
|
111
127
|
},
|
|
@@ -113,6 +129,7 @@ const P = {
|
|
|
113
129
|
code: "el",
|
|
114
130
|
nativeName: "Ελληνικά",
|
|
115
131
|
englishName: "Greek",
|
|
132
|
+
countryCode: "GR",
|
|
116
133
|
flag: "🇬🇷",
|
|
117
134
|
dir: "ltr"
|
|
118
135
|
},
|
|
@@ -120,6 +137,7 @@ const P = {
|
|
|
120
137
|
code: "ja",
|
|
121
138
|
nativeName: "日本語",
|
|
122
139
|
englishName: "Japanese",
|
|
140
|
+
countryCode: "JP",
|
|
123
141
|
flag: "🇯🇵",
|
|
124
142
|
dir: "ltr"
|
|
125
143
|
},
|
|
@@ -127,6 +145,7 @@ const P = {
|
|
|
127
145
|
code: "zh",
|
|
128
146
|
nativeName: "中文",
|
|
129
147
|
englishName: "Chinese",
|
|
148
|
+
countryCode: "CN",
|
|
130
149
|
flag: "🇨🇳",
|
|
131
150
|
dir: "ltr"
|
|
132
151
|
},
|
|
@@ -134,12 +153,13 @@ const P = {
|
|
|
134
153
|
code: "hi",
|
|
135
154
|
nativeName: "हिन्दी",
|
|
136
155
|
englishName: "Hindi",
|
|
156
|
+
countryCode: "IN",
|
|
137
157
|
flag: "🇮🇳",
|
|
138
158
|
dir: "ltr"
|
|
139
159
|
}
|
|
140
|
-
},
|
|
141
|
-
(e) =>
|
|
142
|
-
),
|
|
160
|
+
}, ae = G.map(
|
|
161
|
+
(e) => w[e]
|
|
162
|
+
), se = {
|
|
143
163
|
id: "locale-picker",
|
|
144
164
|
capabilities: ["view_change"],
|
|
145
165
|
state: {},
|
|
@@ -161,12 +181,12 @@ const P = {
|
|
|
161
181
|
description: "Marks the LocalePicker wrapper."
|
|
162
182
|
}
|
|
163
183
|
}
|
|
164
|
-
},
|
|
165
|
-
let
|
|
166
|
-
function
|
|
167
|
-
return typeof e == "string" &&
|
|
184
|
+
}, k = "alfadocs-ui.locale";
|
|
185
|
+
let z = !1;
|
|
186
|
+
function m(e) {
|
|
187
|
+
return typeof e == "string" && G.includes(e);
|
|
168
188
|
}
|
|
169
|
-
function
|
|
189
|
+
function te(e) {
|
|
170
190
|
if (typeof window > "u") return null;
|
|
171
191
|
try {
|
|
172
192
|
return window.localStorage.getItem(e);
|
|
@@ -174,45 +194,45 @@ function X(e) {
|
|
|
174
194
|
return null;
|
|
175
195
|
}
|
|
176
196
|
}
|
|
177
|
-
function
|
|
197
|
+
function I(e, a) {
|
|
178
198
|
if (!(typeof window > "u"))
|
|
179
199
|
try {
|
|
180
200
|
window.localStorage.setItem(e, a);
|
|
181
201
|
} catch {
|
|
182
202
|
}
|
|
183
203
|
}
|
|
184
|
-
function
|
|
204
|
+
function oe() {
|
|
185
205
|
if (typeof navigator > "u") return "en";
|
|
186
206
|
const e = navigator.language;
|
|
187
207
|
if (!e) return "en";
|
|
188
208
|
const a = e.toLowerCase().split("-")[0];
|
|
189
|
-
return
|
|
209
|
+
return m(a) ? a : "en";
|
|
190
210
|
}
|
|
191
|
-
function
|
|
211
|
+
function P(e) {
|
|
192
212
|
if (typeof document > "u") return;
|
|
193
213
|
const a = document.documentElement;
|
|
194
|
-
a.lang = e, a.dir =
|
|
214
|
+
a.lang = e, a.dir = w[e].dir;
|
|
195
215
|
}
|
|
196
|
-
function
|
|
197
|
-
const { locale: e, setLocale: a } =
|
|
216
|
+
function H() {
|
|
217
|
+
const { locale: e, setLocale: a } = Q(), d = m(e) ? e : "en", i = R(
|
|
198
218
|
(s) => {
|
|
199
|
-
|
|
219
|
+
m(s) && (a(s), P(s), I(k, s));
|
|
200
220
|
},
|
|
201
221
|
[a]
|
|
202
222
|
);
|
|
203
|
-
return
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
const s =
|
|
207
|
-
if (
|
|
208
|
-
s !== e && a(s),
|
|
223
|
+
return J(() => {
|
|
224
|
+
if (z) return;
|
|
225
|
+
z = !0;
|
|
226
|
+
const s = te(k);
|
|
227
|
+
if (m(s)) {
|
|
228
|
+
s !== e && a(s), P(s);
|
|
209
229
|
return;
|
|
210
230
|
}
|
|
211
|
-
const
|
|
212
|
-
a(
|
|
213
|
-
}, []), { locale: d, setLocale:
|
|
231
|
+
const r = oe();
|
|
232
|
+
a(r), P(r), I(k, r);
|
|
233
|
+
}, []), { locale: d, setLocale: i };
|
|
214
234
|
}
|
|
215
|
-
const
|
|
235
|
+
const U = O("ds:inline-flex ds:items-center", {
|
|
216
236
|
variants: {
|
|
217
237
|
variant: {
|
|
218
238
|
icon: "",
|
|
@@ -220,7 +240,7 @@ const F = _("ds:inline-flex ds:items-center", {
|
|
|
220
240
|
}
|
|
221
241
|
},
|
|
222
242
|
defaultVariants: { variant: "icon" }
|
|
223
|
-
}),
|
|
243
|
+
}), ne = [
|
|
224
244
|
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
225
245
|
"ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-sm)]",
|
|
226
246
|
"ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
|
|
@@ -231,12 +251,12 @@ const F = _("ds:inline-flex ds:items-center", {
|
|
|
231
251
|
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
232
252
|
"ds:disabled:opacity-50 ds:disabled:cursor-not-allowed",
|
|
233
253
|
"type-body-sm"
|
|
234
|
-
].join(" "),
|
|
254
|
+
].join(" "), D = [
|
|
235
255
|
"ds:w-[18rem] ds:rounded-[var(--radius-md)]",
|
|
236
256
|
"ds:bg-background ds:text-foreground ds:border ds:border-border",
|
|
237
257
|
"ds:shadow-[var(--shadow-lg)]",
|
|
238
258
|
"ds:overflow-hidden"
|
|
239
|
-
].join(" "),
|
|
259
|
+
].join(" "), re = O("ds:flex ds:flex-col", {
|
|
240
260
|
variants: {
|
|
241
261
|
loading: {
|
|
242
262
|
true: "ds:opacity-60 ds:pointer-events-none",
|
|
@@ -244,71 +264,73 @@ const F = _("ds:inline-flex ds:items-center", {
|
|
|
244
264
|
}
|
|
245
265
|
},
|
|
246
266
|
defaultVariants: { loading: !1 }
|
|
247
|
-
}), S =
|
|
267
|
+
}), S = F(
|
|
248
268
|
({
|
|
249
269
|
value: e,
|
|
250
270
|
onValueChange: a,
|
|
251
271
|
inputId: d,
|
|
252
|
-
disabled:
|
|
272
|
+
disabled: i = !1,
|
|
253
273
|
loading: s = !1,
|
|
254
|
-
className:
|
|
274
|
+
className: r
|
|
255
275
|
}, l) => {
|
|
256
|
-
const { t:
|
|
257
|
-
(
|
|
258
|
-
!
|
|
276
|
+
const { t: o } = x(), h = H(), b = e ?? h.locale, v = B(), C = d ?? `${v}-search`, [L, g] = M(""), N = R(
|
|
277
|
+
(n) => {
|
|
278
|
+
!m(n) || i || s || (a ? a(n) : h.setLocale(n));
|
|
259
279
|
},
|
|
260
|
-
[
|
|
280
|
+
[i, s, a, h]
|
|
261
281
|
);
|
|
262
282
|
return /* @__PURE__ */ t(
|
|
263
283
|
"div",
|
|
264
284
|
{
|
|
265
285
|
ref: l,
|
|
266
|
-
className: [
|
|
286
|
+
className: [re({ loading: s }), r].filter(Boolean).join(" "),
|
|
267
287
|
"data-component": "locale-picker-search-list",
|
|
268
|
-
children: /* @__PURE__ */
|
|
269
|
-
|
|
288
|
+
children: /* @__PURE__ */ u(
|
|
289
|
+
y,
|
|
270
290
|
{
|
|
271
|
-
label:
|
|
291
|
+
label: o("navigation.localePicker.commandLabel"),
|
|
272
292
|
filter: K,
|
|
273
293
|
shouldFilter: !0,
|
|
274
294
|
children: [
|
|
275
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ u(
|
|
276
296
|
"div",
|
|
277
297
|
{
|
|
278
298
|
className: [
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
299
|
+
X,
|
|
300
|
+
Y.sm,
|
|
301
|
+
$.sm,
|
|
302
|
+
"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
303
|
+
"ds:m-[var(--spacing-xs)]"
|
|
282
304
|
].join(" "),
|
|
283
305
|
children: [
|
|
284
306
|
/* @__PURE__ */ t(
|
|
285
|
-
|
|
307
|
+
A,
|
|
286
308
|
{
|
|
287
309
|
"aria-hidden": "true",
|
|
288
310
|
className: "ds:size-4 ds:text-muted-foreground ds:shrink-0"
|
|
289
311
|
}
|
|
290
312
|
),
|
|
291
313
|
/* @__PURE__ */ t(
|
|
292
|
-
|
|
314
|
+
y.Input,
|
|
293
315
|
{
|
|
294
|
-
id:
|
|
295
|
-
value:
|
|
316
|
+
id: C,
|
|
317
|
+
value: L,
|
|
296
318
|
onValueChange: g,
|
|
297
|
-
placeholder:
|
|
298
|
-
"aria-label":
|
|
299
|
-
disabled:
|
|
319
|
+
placeholder: o("navigation.localePicker.searchPlaceholder"),
|
|
320
|
+
"aria-label": o("navigation.localePicker.searchLabel"),
|
|
321
|
+
disabled: i || s,
|
|
300
322
|
className: [
|
|
301
|
-
"ds:flex-1 ds:bg-transparent ds:border-0 ds:outline-none",
|
|
323
|
+
"ds:peer ds:flex-1 ds:bg-transparent ds:border-0 ds:outline-none",
|
|
302
324
|
"ds:placeholder:text-muted-foreground ds:text-foreground",
|
|
303
|
-
"
|
|
325
|
+
"ds:text-[length:var(--font-size-sm)]"
|
|
304
326
|
].join(" ")
|
|
305
327
|
}
|
|
306
328
|
)
|
|
307
329
|
]
|
|
308
330
|
}
|
|
309
331
|
),
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
|
|
332
|
+
/* @__PURE__ */ u(
|
|
333
|
+
y.List,
|
|
312
334
|
{
|
|
313
335
|
className: [
|
|
314
336
|
"ds:max-h-[18rem] ds:overflow-y-auto",
|
|
@@ -316,23 +338,23 @@ const F = _("ds:inline-flex ds:items-center", {
|
|
|
316
338
|
].join(" "),
|
|
317
339
|
children: [
|
|
318
340
|
/* @__PURE__ */ t(
|
|
319
|
-
|
|
341
|
+
y.Empty,
|
|
320
342
|
{
|
|
321
343
|
className: [
|
|
322
344
|
"ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]",
|
|
323
345
|
"type-body-sm ds:text-muted-foreground"
|
|
324
346
|
].join(" "),
|
|
325
|
-
children:
|
|
347
|
+
children: o("navigation.localePicker.empty")
|
|
326
348
|
}
|
|
327
349
|
),
|
|
328
|
-
|
|
329
|
-
const f =
|
|
330
|
-
return /* @__PURE__ */
|
|
331
|
-
|
|
350
|
+
ae.map((n) => {
|
|
351
|
+
const f = n.code === b;
|
|
352
|
+
return /* @__PURE__ */ u(
|
|
353
|
+
y.Item,
|
|
332
354
|
{
|
|
333
|
-
value:
|
|
334
|
-
keywords: [
|
|
335
|
-
disabled:
|
|
355
|
+
value: n.code,
|
|
356
|
+
keywords: [n.nativeName, n.englishName],
|
|
357
|
+
disabled: i || s,
|
|
336
358
|
onSelect: N,
|
|
337
359
|
className: [
|
|
338
360
|
"ds:relative ds:flex ds:cursor-pointer ds:select-none",
|
|
@@ -347,22 +369,46 @@ const F = _("ds:inline-flex ds:items-center", {
|
|
|
347
369
|
].join(" "),
|
|
348
370
|
"aria-selected": f || void 0,
|
|
349
371
|
"data-current": f ? "true" : void 0,
|
|
350
|
-
lang:
|
|
351
|
-
dir:
|
|
372
|
+
lang: n.code,
|
|
373
|
+
dir: n.dir,
|
|
352
374
|
children: [
|
|
353
|
-
/* @__PURE__ */ t(
|
|
354
|
-
|
|
375
|
+
E(n.countryCode) ? /* @__PURE__ */ t(
|
|
376
|
+
T,
|
|
377
|
+
{
|
|
378
|
+
country: n.countryCode,
|
|
379
|
+
size: "sm",
|
|
380
|
+
shape: "rectangle",
|
|
381
|
+
rounded: "sm",
|
|
382
|
+
className: "ds:shrink-0"
|
|
383
|
+
}
|
|
384
|
+
) : (
|
|
385
|
+
/* hasFlag fallback: render the emoji glyph only
|
|
386
|
+
when the kit doesn't ship an SVG for this
|
|
387
|
+
country code. All 18 bundled locales currently
|
|
388
|
+
have SVG flags, so this is dead code on the
|
|
389
|
+
canonical set — kept for resilience when
|
|
390
|
+
consumers extend the registry. */
|
|
391
|
+
/* @__PURE__ */ t(
|
|
392
|
+
"span",
|
|
393
|
+
{
|
|
394
|
+
"aria-hidden": "true",
|
|
395
|
+
className: "ds:text-base ds:shrink-0",
|
|
396
|
+
children: n.flag
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
),
|
|
400
|
+
/* @__PURE__ */ t("span", { className: "ds:flex-1 ds:min-w-0 ds:truncate type-body-sm", children: n.nativeName }),
|
|
355
401
|
f ? /* @__PURE__ */ t(
|
|
356
|
-
|
|
402
|
+
ee,
|
|
357
403
|
{
|
|
358
404
|
"aria-hidden": "true",
|
|
359
405
|
className: "ds:size-4 ds:text-primary ds:shrink-0"
|
|
360
406
|
}
|
|
361
407
|
) : null,
|
|
362
|
-
f ? /* @__PURE__ */ t("span", { className: "ds:sr-only", children:
|
|
408
|
+
f ? /* @__PURE__ */ t("span", { className: "ds:sr-only", children: o("navigation.localePicker.currentSelection") }) : null
|
|
363
409
|
]
|
|
364
410
|
},
|
|
365
|
-
|
|
411
|
+
n.code
|
|
366
412
|
);
|
|
367
413
|
})
|
|
368
414
|
]
|
|
@@ -376,45 +422,53 @@ const F = _("ds:inline-flex ds:items-center", {
|
|
|
376
422
|
}
|
|
377
423
|
);
|
|
378
424
|
S.displayName = "LocalePicker.SearchList";
|
|
379
|
-
function
|
|
425
|
+
function ie({
|
|
380
426
|
state: e,
|
|
381
427
|
rest: a,
|
|
382
428
|
forwardedRef: d,
|
|
383
|
-
className:
|
|
429
|
+
className: i,
|
|
384
430
|
disabled: s,
|
|
385
|
-
loading:
|
|
431
|
+
loading: r
|
|
386
432
|
}) {
|
|
387
|
-
const { t: l } =
|
|
433
|
+
const { t: l } = x(), o = w[e.locale];
|
|
388
434
|
return /* @__PURE__ */ t(
|
|
389
435
|
"div",
|
|
390
436
|
{
|
|
391
437
|
ref: d,
|
|
392
438
|
"data-component": "locale-picker",
|
|
393
439
|
"data-component-id": a.id,
|
|
394
|
-
className:
|
|
440
|
+
className: U({ variant: "icon", className: i }),
|
|
395
441
|
...a,
|
|
396
|
-
children: /* @__PURE__ */
|
|
442
|
+
children: /* @__PURE__ */ u(p.Root, { children: [
|
|
397
443
|
/* @__PURE__ */ t(p.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
398
444
|
W,
|
|
399
445
|
{
|
|
400
|
-
disabled: s ||
|
|
401
|
-
icon: /* @__PURE__ */
|
|
402
|
-
/* @__PURE__ */ t(
|
|
403
|
-
/* @__PURE__ */ t(
|
|
404
|
-
|
|
446
|
+
disabled: s || r,
|
|
447
|
+
icon: /* @__PURE__ */ u("span", { className: "ds:relative ds:inline-flex ds:items-center ds:justify-center", children: [
|
|
448
|
+
/* @__PURE__ */ t(A, { "aria-hidden": !0, className: "ds:size-5" }),
|
|
449
|
+
E(o.countryCode) ? /* @__PURE__ */ t(
|
|
450
|
+
T,
|
|
405
451
|
{
|
|
406
|
-
|
|
452
|
+
country: o.countryCode,
|
|
453
|
+
size: "sm",
|
|
454
|
+
shape: "rectangle",
|
|
455
|
+
rounded: "sm",
|
|
407
456
|
className: [
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
457
|
+
// Corner chip overlaying the globe glyph.
|
|
458
|
+
// `outline` paints a thin background-coloured
|
|
459
|
+
// ring around the flag so it reads as a chip
|
|
460
|
+
// rather than blending into the globe edge.
|
|
461
|
+
"ds:absolute ds:bottom-[-3px] ds:end-[-5px]",
|
|
462
|
+
"ds:outline ds:outline-2 ds:outline-background",
|
|
463
|
+
// Scale down to chip size — Flag's sm tile is
|
|
464
|
+
// larger than the original emoji glyph.
|
|
465
|
+
"ds:scale-75 ds:origin-bottom-end"
|
|
466
|
+
].join(" ")
|
|
413
467
|
}
|
|
414
|
-
)
|
|
468
|
+
) : null
|
|
415
469
|
] }),
|
|
416
470
|
"aria-label": l("navigation.localePicker.trigger", {
|
|
417
|
-
locale:
|
|
471
|
+
locale: o.nativeName
|
|
418
472
|
})
|
|
419
473
|
}
|
|
420
474
|
) }),
|
|
@@ -423,7 +477,7 @@ function se({
|
|
|
423
477
|
{
|
|
424
478
|
align: "end",
|
|
425
479
|
sideOffset: 8,
|
|
426
|
-
className:
|
|
480
|
+
className: D,
|
|
427
481
|
"aria-label": l("navigation.localePicker.popupLabel"),
|
|
428
482
|
children: /* @__PURE__ */ t(
|
|
429
483
|
S,
|
|
@@ -431,7 +485,7 @@ function se({
|
|
|
431
485
|
value: e.locale,
|
|
432
486
|
onValueChange: e.setLocale,
|
|
433
487
|
disabled: s,
|
|
434
|
-
loading:
|
|
488
|
+
loading: r
|
|
435
489
|
}
|
|
436
490
|
)
|
|
437
491
|
}
|
|
@@ -440,41 +494,50 @@ function se({
|
|
|
440
494
|
}
|
|
441
495
|
);
|
|
442
496
|
}
|
|
443
|
-
function
|
|
497
|
+
function le({
|
|
444
498
|
state: e,
|
|
445
499
|
rest: a,
|
|
446
500
|
forwardedRef: d,
|
|
447
|
-
className:
|
|
501
|
+
className: i,
|
|
448
502
|
disabled: s,
|
|
449
|
-
loading:
|
|
503
|
+
loading: r
|
|
450
504
|
}) {
|
|
451
|
-
const { t: l } =
|
|
505
|
+
const { t: l } = x(), o = w[e.locale];
|
|
452
506
|
return /* @__PURE__ */ t(
|
|
453
507
|
"div",
|
|
454
508
|
{
|
|
455
509
|
ref: d,
|
|
456
510
|
"data-component": "locale-picker",
|
|
457
511
|
"data-component-id": a.id,
|
|
458
|
-
className:
|
|
512
|
+
className: U({ variant: "compact", className: i }),
|
|
459
513
|
...a,
|
|
460
|
-
children: /* @__PURE__ */
|
|
461
|
-
/* @__PURE__ */ t(p.Trigger, { asChild: !0, children: /* @__PURE__ */
|
|
514
|
+
children: /* @__PURE__ */ u(p.Root, { children: [
|
|
515
|
+
/* @__PURE__ */ t(p.Trigger, { asChild: !0, children: /* @__PURE__ */ u(
|
|
462
516
|
"button",
|
|
463
517
|
{
|
|
464
518
|
type: "button",
|
|
465
|
-
disabled: s ||
|
|
466
|
-
className:
|
|
519
|
+
disabled: s || r,
|
|
520
|
+
className: ne,
|
|
467
521
|
"aria-label": l("navigation.localePicker.trigger", {
|
|
468
|
-
locale:
|
|
522
|
+
locale: o.nativeName
|
|
469
523
|
}),
|
|
470
524
|
children: [
|
|
471
|
-
/* @__PURE__ */ t(
|
|
525
|
+
E(o.countryCode) ? /* @__PURE__ */ t(
|
|
526
|
+
T,
|
|
527
|
+
{
|
|
528
|
+
country: o.countryCode,
|
|
529
|
+
size: "sm",
|
|
530
|
+
shape: "rectangle",
|
|
531
|
+
rounded: "sm",
|
|
532
|
+
className: "ds:shrink-0"
|
|
533
|
+
}
|
|
534
|
+
) : /* @__PURE__ */ t(A, { "aria-hidden": !0, className: "ds:size-4 ds:shrink-0" }),
|
|
472
535
|
/* @__PURE__ */ t(
|
|
473
536
|
"span",
|
|
474
537
|
{
|
|
475
538
|
className: "ds:flex-1 ds:truncate type-body-sm",
|
|
476
|
-
lang:
|
|
477
|
-
children:
|
|
539
|
+
lang: o.code,
|
|
540
|
+
children: o.nativeName
|
|
478
541
|
}
|
|
479
542
|
)
|
|
480
543
|
]
|
|
@@ -485,7 +548,7 @@ function te({
|
|
|
485
548
|
{
|
|
486
549
|
align: "end",
|
|
487
550
|
sideOffset: 8,
|
|
488
|
-
className:
|
|
551
|
+
className: D,
|
|
489
552
|
"aria-label": l("navigation.localePicker.popupLabel"),
|
|
490
553
|
children: /* @__PURE__ */ t(
|
|
491
554
|
S,
|
|
@@ -493,7 +556,7 @@ function te({
|
|
|
493
556
|
value: e.locale,
|
|
494
557
|
onValueChange: e.setLocale,
|
|
495
558
|
disabled: s,
|
|
496
|
-
loading:
|
|
559
|
+
loading: r
|
|
497
560
|
}
|
|
498
561
|
)
|
|
499
562
|
}
|
|
@@ -502,74 +565,74 @@ function te({
|
|
|
502
565
|
}
|
|
503
566
|
);
|
|
504
567
|
}
|
|
505
|
-
const
|
|
568
|
+
const V = F(
|
|
506
569
|
(e, a) => {
|
|
507
570
|
const {
|
|
508
571
|
variant: d = "icon",
|
|
509
|
-
value:
|
|
572
|
+
value: i,
|
|
510
573
|
onValueChange: s,
|
|
511
|
-
disabled:
|
|
574
|
+
disabled: r = !1,
|
|
512
575
|
loading: l = !1,
|
|
513
|
-
className:
|
|
576
|
+
className: o,
|
|
514
577
|
id: h,
|
|
515
|
-
...
|
|
516
|
-
} = e, v =
|
|
578
|
+
...b
|
|
579
|
+
} = e, v = H(), C = i ?? v.locale, L = R(
|
|
517
580
|
(c) => {
|
|
518
|
-
if (
|
|
581
|
+
if (m(c)) {
|
|
519
582
|
if (s) {
|
|
520
|
-
s(c),
|
|
583
|
+
s(c), P(c), I(k, c);
|
|
521
584
|
return;
|
|
522
585
|
}
|
|
523
586
|
v.setLocale(c);
|
|
524
587
|
}
|
|
525
588
|
},
|
|
526
589
|
[s, v]
|
|
527
|
-
), g =
|
|
528
|
-
() => ({ locale:
|
|
529
|
-
[
|
|
530
|
-
), N =
|
|
590
|
+
), g = _(
|
|
591
|
+
() => ({ locale: C, setLocale: L }),
|
|
592
|
+
[C, L]
|
|
593
|
+
), N = j(null);
|
|
531
594
|
q(a, () => N.current, []);
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
const f =
|
|
595
|
+
const n = j(g);
|
|
596
|
+
n.current = g;
|
|
597
|
+
const f = _(
|
|
535
598
|
() => ({
|
|
536
599
|
setLocale: (c) => {
|
|
537
|
-
|
|
600
|
+
m(c) && n.current.setLocale(c);
|
|
538
601
|
}
|
|
539
602
|
}),
|
|
540
603
|
[]
|
|
541
604
|
);
|
|
542
|
-
return
|
|
543
|
-
|
|
605
|
+
return Z(se, f, h), d === "compact" ? /* @__PURE__ */ t(
|
|
606
|
+
le,
|
|
544
607
|
{
|
|
545
608
|
state: g,
|
|
546
|
-
rest:
|
|
609
|
+
rest: b,
|
|
547
610
|
forwardedRef: N,
|
|
548
|
-
className:
|
|
549
|
-
disabled:
|
|
611
|
+
className: o,
|
|
612
|
+
disabled: r,
|
|
550
613
|
loading: l
|
|
551
614
|
}
|
|
552
615
|
) : /* @__PURE__ */ t(
|
|
553
|
-
|
|
616
|
+
ie,
|
|
554
617
|
{
|
|
555
618
|
state: g,
|
|
556
|
-
rest:
|
|
619
|
+
rest: b,
|
|
557
620
|
forwardedRef: N,
|
|
558
|
-
className:
|
|
559
|
-
disabled:
|
|
621
|
+
className: o,
|
|
622
|
+
disabled: r,
|
|
560
623
|
loading: l
|
|
561
624
|
}
|
|
562
625
|
);
|
|
563
626
|
}
|
|
564
627
|
);
|
|
565
|
-
|
|
566
|
-
const
|
|
628
|
+
V.displayName = "LocalePicker";
|
|
629
|
+
const ke = Object.assign(V, {
|
|
567
630
|
SearchList: S
|
|
568
631
|
});
|
|
569
632
|
export {
|
|
570
|
-
|
|
571
|
-
|
|
633
|
+
k as L,
|
|
634
|
+
ke as a,
|
|
572
635
|
S as b,
|
|
573
|
-
|
|
636
|
+
w as c
|
|
574
637
|
};
|
|
575
|
-
//# sourceMappingURL=locale-picker-
|
|
638
|
+
//# sourceMappingURL=locale-picker-BxEUUPW7.js.map
|