@alfadocs/ui-kit 0.23.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/{autocomplete-BxfabhZ8.js → autocomplete-C7xq06bP.js} +40 -40
- 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/editable-currency-cell-renderer-DJB5MxAI.js +2349 -0
- package/dist/_chunks/locale-picker-BxEUUPW7.js +638 -0
- package/dist/_chunks/{patient-shell-DavGODt9.js → patient-shell-B164drIa.js} +40 -55
- package/dist/_chunks/settings-ca2Yi9R8.js +21 -0
- package/dist/_chunks/sun-Eweh5fvi.js +50 -0
- package/dist/_chunks/{theme-toggle-BswYl0Yp.js → theme-toggle-FrotC2VI.js} +85 -127
- package/dist/_chunks/{timeline-Czeqr3HF.js → timeline-jmd7lfDf.js} +19 -12
- package/dist/_chunks/use-locale-BkCIHujH.js +20 -0
- package/dist/_chunks/use-scroll-to-first-error-BrK7dKB_.js +55 -0
- package/dist/_chunks/{whatsapp-button-CtlLwM3M.js → whatsapp-button-DUjlWGKf.js} +26 -25
- package/dist/_chunks/{workflow-map-712GL-8u.js → workflow-map-BR6txfFX.js} +2 -2
- package/dist/agent-catalog.json +59 -1
- package/dist/components/autocomplete/index.js +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/data-table/filters/number-filter.d.ts +56 -0
- package/dist/components/data-table/filters/text-filter.d.ts +49 -0
- package/dist/components/data-table/index.d.ts +4 -0
- package/dist/components/data-table/index.js +25 -21
- 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 +232 -0
- package/dist/components/locale-picker/index.js +7 -0
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/whatsapp-button/index.js +1 -1
- package/dist/components/whatsapp-button/whatsapp-button.d.ts +14 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/fonts/Lexend-VF-latin-ext.woff2 +0 -0
- package/dist/fonts/Lexend-VF-latin.woff2 +0 -0
- package/dist/fonts/Lexend-VF-vietnamese.woff2 +0 -0
- package/dist/fonts/NotoSansArabic-VF-arabic.woff2 +0 -0
- package/dist/fonts/NotoSansDevanagari-VF-devanagari.woff2 +0 -0
- package/dist/hooks/index.js +29 -28
- package/dist/i18n/config.js +2726 -134
- package/dist/i18n/locales/ar.d.ts +147 -3
- package/dist/i18n/locales/de.d.ts +147 -3
- package/dist/i18n/locales/el.d.ts +147 -3
- package/dist/i18n/locales/es.d.ts +147 -3
- package/dist/i18n/locales/fr.d.ts +147 -3
- package/dist/i18n/locales/hi.d.ts +147 -3
- package/dist/i18n/locales/ja.d.ts +147 -3
- package/dist/i18n/locales/nl.d.ts +147 -3
- package/dist/i18n/locales/pl.d.ts +149 -5
- package/dist/i18n/locales/pt.d.ts +147 -3
- package/dist/i18n/locales/ro.d.ts +147 -3
- package/dist/i18n/locales/ru.d.ts +148 -4
- package/dist/i18n/locales/sq.d.ts +147 -3
- package/dist/i18n/locales/sv.d.ts +147 -3
- package/dist/i18n/locales/tr.d.ts +147 -3
- package/dist/i18n/locales/zh.d.ts +147 -3
- package/dist/i18n/resources.d.ts +294 -6
- package/dist/index.js +512 -507
- package/dist/locales/ar.json +149 -5
- package/dist/locales/de.json +149 -5
- package/dist/locales/el.json +149 -5
- package/dist/locales/en.json +147 -3
- package/dist/locales/es.json +149 -5
- package/dist/locales/fr.json +149 -5
- package/dist/locales/hi.json +149 -5
- package/dist/locales/it.json +147 -3
- package/dist/locales/ja.json +149 -5
- package/dist/locales/nl.json +149 -5
- package/dist/locales/pl.json +151 -7
- package/dist/locales/pt.json +149 -5
- package/dist/locales/ro.json +149 -5
- package/dist/locales/ru.json +150 -6
- package/dist/locales/sq.json +149 -5
- package/dist/locales/sv.json +149 -5
- package/dist/locales/tr.json +149 -5
- package/dist/locales/zh.json +149 -5
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +2 -2
- package/package.json +10 -1
- package/dist/_chunks/carousel.agent-CQPFfppK.js +0 -1696
- package/dist/_chunks/description-list-y7Hk51KI.js +0 -191
- package/dist/_chunks/editable-currency-cell-renderer-1t42gENX.js +0 -1972
- package/dist/_chunks/use-locale-C5rS3Xon.js +0 -71
|
@@ -0,0 +1,638 @@
|
|
|
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
|
+
import { I as W } from "./icon-button-C4CGcYuz.js";
|
|
7
|
+
import { P as p } from "./popover--derJ_wq.js";
|
|
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 = {
|
|
16
|
+
en: {
|
|
17
|
+
code: "en",
|
|
18
|
+
nativeName: "English",
|
|
19
|
+
englishName: "English",
|
|
20
|
+
countryCode: "GB",
|
|
21
|
+
flag: "🇬🇧",
|
|
22
|
+
dir: "ltr"
|
|
23
|
+
},
|
|
24
|
+
it: {
|
|
25
|
+
code: "it",
|
|
26
|
+
nativeName: "Italiano",
|
|
27
|
+
englishName: "Italian",
|
|
28
|
+
countryCode: "IT",
|
|
29
|
+
flag: "🇮🇹",
|
|
30
|
+
dir: "ltr"
|
|
31
|
+
},
|
|
32
|
+
de: {
|
|
33
|
+
code: "de",
|
|
34
|
+
nativeName: "Deutsch",
|
|
35
|
+
englishName: "German",
|
|
36
|
+
countryCode: "DE",
|
|
37
|
+
flag: "🇩🇪",
|
|
38
|
+
dir: "ltr"
|
|
39
|
+
},
|
|
40
|
+
ar: {
|
|
41
|
+
code: "ar",
|
|
42
|
+
nativeName: "العربية",
|
|
43
|
+
englishName: "Arabic",
|
|
44
|
+
countryCode: "SA",
|
|
45
|
+
flag: "🇸🇦",
|
|
46
|
+
dir: "rtl"
|
|
47
|
+
},
|
|
48
|
+
fr: {
|
|
49
|
+
code: "fr",
|
|
50
|
+
nativeName: "Français",
|
|
51
|
+
englishName: "French",
|
|
52
|
+
countryCode: "FR",
|
|
53
|
+
flag: "🇫🇷",
|
|
54
|
+
dir: "ltr"
|
|
55
|
+
},
|
|
56
|
+
es: {
|
|
57
|
+
code: "es",
|
|
58
|
+
nativeName: "Español",
|
|
59
|
+
englishName: "Spanish",
|
|
60
|
+
countryCode: "ES",
|
|
61
|
+
flag: "🇪🇸",
|
|
62
|
+
dir: "ltr"
|
|
63
|
+
},
|
|
64
|
+
pt: {
|
|
65
|
+
code: "pt",
|
|
66
|
+
nativeName: "Português",
|
|
67
|
+
englishName: "Portuguese",
|
|
68
|
+
countryCode: "PT",
|
|
69
|
+
flag: "🇵🇹",
|
|
70
|
+
dir: "ltr"
|
|
71
|
+
},
|
|
72
|
+
nl: {
|
|
73
|
+
code: "nl",
|
|
74
|
+
nativeName: "Nederlands",
|
|
75
|
+
englishName: "Dutch",
|
|
76
|
+
countryCode: "NL",
|
|
77
|
+
flag: "🇳🇱",
|
|
78
|
+
dir: "ltr"
|
|
79
|
+
},
|
|
80
|
+
ro: {
|
|
81
|
+
code: "ro",
|
|
82
|
+
nativeName: "Română",
|
|
83
|
+
englishName: "Romanian",
|
|
84
|
+
countryCode: "RO",
|
|
85
|
+
flag: "🇷🇴",
|
|
86
|
+
dir: "ltr"
|
|
87
|
+
},
|
|
88
|
+
sq: {
|
|
89
|
+
code: "sq",
|
|
90
|
+
nativeName: "Shqip",
|
|
91
|
+
englishName: "Albanian",
|
|
92
|
+
countryCode: "AL",
|
|
93
|
+
flag: "🇦🇱",
|
|
94
|
+
dir: "ltr"
|
|
95
|
+
},
|
|
96
|
+
tr: {
|
|
97
|
+
code: "tr",
|
|
98
|
+
nativeName: "Türkçe",
|
|
99
|
+
englishName: "Turkish",
|
|
100
|
+
countryCode: "TR",
|
|
101
|
+
flag: "🇹🇷",
|
|
102
|
+
dir: "ltr"
|
|
103
|
+
},
|
|
104
|
+
pl: {
|
|
105
|
+
code: "pl",
|
|
106
|
+
nativeName: "Polski",
|
|
107
|
+
englishName: "Polish",
|
|
108
|
+
countryCode: "PL",
|
|
109
|
+
flag: "🇵🇱",
|
|
110
|
+
dir: "ltr"
|
|
111
|
+
},
|
|
112
|
+
sv: {
|
|
113
|
+
code: "sv",
|
|
114
|
+
nativeName: "Svenska",
|
|
115
|
+
englishName: "Swedish",
|
|
116
|
+
countryCode: "SE",
|
|
117
|
+
flag: "🇸🇪",
|
|
118
|
+
dir: "ltr"
|
|
119
|
+
},
|
|
120
|
+
ru: {
|
|
121
|
+
code: "ru",
|
|
122
|
+
nativeName: "Русский",
|
|
123
|
+
englishName: "Russian",
|
|
124
|
+
countryCode: "RU",
|
|
125
|
+
flag: "🇷🇺",
|
|
126
|
+
dir: "ltr"
|
|
127
|
+
},
|
|
128
|
+
el: {
|
|
129
|
+
code: "el",
|
|
130
|
+
nativeName: "Ελληνικά",
|
|
131
|
+
englishName: "Greek",
|
|
132
|
+
countryCode: "GR",
|
|
133
|
+
flag: "🇬🇷",
|
|
134
|
+
dir: "ltr"
|
|
135
|
+
},
|
|
136
|
+
ja: {
|
|
137
|
+
code: "ja",
|
|
138
|
+
nativeName: "日本語",
|
|
139
|
+
englishName: "Japanese",
|
|
140
|
+
countryCode: "JP",
|
|
141
|
+
flag: "🇯🇵",
|
|
142
|
+
dir: "ltr"
|
|
143
|
+
},
|
|
144
|
+
zh: {
|
|
145
|
+
code: "zh",
|
|
146
|
+
nativeName: "中文",
|
|
147
|
+
englishName: "Chinese",
|
|
148
|
+
countryCode: "CN",
|
|
149
|
+
flag: "🇨🇳",
|
|
150
|
+
dir: "ltr"
|
|
151
|
+
},
|
|
152
|
+
hi: {
|
|
153
|
+
code: "hi",
|
|
154
|
+
nativeName: "हिन्दी",
|
|
155
|
+
englishName: "Hindi",
|
|
156
|
+
countryCode: "IN",
|
|
157
|
+
flag: "🇮🇳",
|
|
158
|
+
dir: "ltr"
|
|
159
|
+
}
|
|
160
|
+
}, ae = G.map(
|
|
161
|
+
(e) => w[e]
|
|
162
|
+
), se = {
|
|
163
|
+
id: "locale-picker",
|
|
164
|
+
capabilities: ["view_change"],
|
|
165
|
+
state: {},
|
|
166
|
+
actions: {
|
|
167
|
+
set_locale: {
|
|
168
|
+
safety: "write",
|
|
169
|
+
argsType: "{ locale: string }",
|
|
170
|
+
descriptionKey: "ui.agent.localePicker.actions.setLocale",
|
|
171
|
+
description: "Switch the active locale to the given IETF tag.",
|
|
172
|
+
invoke: (e, a) => {
|
|
173
|
+
e.setLocale(a.locale);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
domHooks: {
|
|
178
|
+
root: {
|
|
179
|
+
attr: "data-component",
|
|
180
|
+
value: "locale-picker",
|
|
181
|
+
description: "Marks the LocalePicker wrapper."
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}, k = "alfadocs-ui.locale";
|
|
185
|
+
let z = !1;
|
|
186
|
+
function m(e) {
|
|
187
|
+
return typeof e == "string" && G.includes(e);
|
|
188
|
+
}
|
|
189
|
+
function te(e) {
|
|
190
|
+
if (typeof window > "u") return null;
|
|
191
|
+
try {
|
|
192
|
+
return window.localStorage.getItem(e);
|
|
193
|
+
} catch {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function I(e, a) {
|
|
198
|
+
if (!(typeof window > "u"))
|
|
199
|
+
try {
|
|
200
|
+
window.localStorage.setItem(e, a);
|
|
201
|
+
} catch {
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function oe() {
|
|
205
|
+
if (typeof navigator > "u") return "en";
|
|
206
|
+
const e = navigator.language;
|
|
207
|
+
if (!e) return "en";
|
|
208
|
+
const a = e.toLowerCase().split("-")[0];
|
|
209
|
+
return m(a) ? a : "en";
|
|
210
|
+
}
|
|
211
|
+
function P(e) {
|
|
212
|
+
if (typeof document > "u") return;
|
|
213
|
+
const a = document.documentElement;
|
|
214
|
+
a.lang = e, a.dir = w[e].dir;
|
|
215
|
+
}
|
|
216
|
+
function H() {
|
|
217
|
+
const { locale: e, setLocale: a } = Q(), d = m(e) ? e : "en", i = R(
|
|
218
|
+
(s) => {
|
|
219
|
+
m(s) && (a(s), P(s), I(k, s));
|
|
220
|
+
},
|
|
221
|
+
[a]
|
|
222
|
+
);
|
|
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);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
const r = oe();
|
|
232
|
+
a(r), P(r), I(k, r);
|
|
233
|
+
}, []), { locale: d, setLocale: i };
|
|
234
|
+
}
|
|
235
|
+
const U = O("ds:inline-flex ds:items-center", {
|
|
236
|
+
variants: {
|
|
237
|
+
variant: {
|
|
238
|
+
icon: "",
|
|
239
|
+
compact: ""
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
defaultVariants: { variant: "icon" }
|
|
243
|
+
}), ne = [
|
|
244
|
+
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
245
|
+
"ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-sm)]",
|
|
246
|
+
"ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
|
|
247
|
+
"ds:bg-transparent ds:text-foreground",
|
|
248
|
+
"ds:hover:bg-muted",
|
|
249
|
+
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
250
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
251
|
+
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
252
|
+
"ds:disabled:opacity-50 ds:disabled:cursor-not-allowed",
|
|
253
|
+
"type-body-sm"
|
|
254
|
+
].join(" "), D = [
|
|
255
|
+
"ds:w-[18rem] ds:rounded-[var(--radius-md)]",
|
|
256
|
+
"ds:bg-background ds:text-foreground ds:border ds:border-border",
|
|
257
|
+
"ds:shadow-[var(--shadow-lg)]",
|
|
258
|
+
"ds:overflow-hidden"
|
|
259
|
+
].join(" "), re = O("ds:flex ds:flex-col", {
|
|
260
|
+
variants: {
|
|
261
|
+
loading: {
|
|
262
|
+
true: "ds:opacity-60 ds:pointer-events-none",
|
|
263
|
+
false: ""
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
defaultVariants: { loading: !1 }
|
|
267
|
+
}), S = F(
|
|
268
|
+
({
|
|
269
|
+
value: e,
|
|
270
|
+
onValueChange: a,
|
|
271
|
+
inputId: d,
|
|
272
|
+
disabled: i = !1,
|
|
273
|
+
loading: s = !1,
|
|
274
|
+
className: r
|
|
275
|
+
}, l) => {
|
|
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));
|
|
279
|
+
},
|
|
280
|
+
[i, s, a, h]
|
|
281
|
+
);
|
|
282
|
+
return /* @__PURE__ */ t(
|
|
283
|
+
"div",
|
|
284
|
+
{
|
|
285
|
+
ref: l,
|
|
286
|
+
className: [re({ loading: s }), r].filter(Boolean).join(" "),
|
|
287
|
+
"data-component": "locale-picker-search-list",
|
|
288
|
+
children: /* @__PURE__ */ u(
|
|
289
|
+
y,
|
|
290
|
+
{
|
|
291
|
+
label: o("navigation.localePicker.commandLabel"),
|
|
292
|
+
filter: K,
|
|
293
|
+
shouldFilter: !0,
|
|
294
|
+
children: [
|
|
295
|
+
/* @__PURE__ */ u(
|
|
296
|
+
"div",
|
|
297
|
+
{
|
|
298
|
+
className: [
|
|
299
|
+
X,
|
|
300
|
+
Y.sm,
|
|
301
|
+
$.sm,
|
|
302
|
+
"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
303
|
+
"ds:m-[var(--spacing-xs)]"
|
|
304
|
+
].join(" "),
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ t(
|
|
307
|
+
A,
|
|
308
|
+
{
|
|
309
|
+
"aria-hidden": "true",
|
|
310
|
+
className: "ds:size-4 ds:text-muted-foreground ds:shrink-0"
|
|
311
|
+
}
|
|
312
|
+
),
|
|
313
|
+
/* @__PURE__ */ t(
|
|
314
|
+
y.Input,
|
|
315
|
+
{
|
|
316
|
+
id: C,
|
|
317
|
+
value: L,
|
|
318
|
+
onValueChange: g,
|
|
319
|
+
placeholder: o("navigation.localePicker.searchPlaceholder"),
|
|
320
|
+
"aria-label": o("navigation.localePicker.searchLabel"),
|
|
321
|
+
disabled: i || s,
|
|
322
|
+
className: [
|
|
323
|
+
"ds:peer ds:flex-1 ds:bg-transparent ds:border-0 ds:outline-none",
|
|
324
|
+
"ds:placeholder:text-muted-foreground ds:text-foreground",
|
|
325
|
+
"ds:text-[length:var(--font-size-sm)]"
|
|
326
|
+
].join(" ")
|
|
327
|
+
}
|
|
328
|
+
)
|
|
329
|
+
]
|
|
330
|
+
}
|
|
331
|
+
),
|
|
332
|
+
/* @__PURE__ */ u(
|
|
333
|
+
y.List,
|
|
334
|
+
{
|
|
335
|
+
className: [
|
|
336
|
+
"ds:max-h-[18rem] ds:overflow-y-auto",
|
|
337
|
+
"ds:p-[var(--spacing-xs)]"
|
|
338
|
+
].join(" "),
|
|
339
|
+
children: [
|
|
340
|
+
/* @__PURE__ */ t(
|
|
341
|
+
y.Empty,
|
|
342
|
+
{
|
|
343
|
+
className: [
|
|
344
|
+
"ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]",
|
|
345
|
+
"type-body-sm ds:text-muted-foreground"
|
|
346
|
+
].join(" "),
|
|
347
|
+
children: o("navigation.localePicker.empty")
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
ae.map((n) => {
|
|
351
|
+
const f = n.code === b;
|
|
352
|
+
return /* @__PURE__ */ u(
|
|
353
|
+
y.Item,
|
|
354
|
+
{
|
|
355
|
+
value: n.code,
|
|
356
|
+
keywords: [n.nativeName, n.englishName],
|
|
357
|
+
disabled: i || s,
|
|
358
|
+
onSelect: N,
|
|
359
|
+
className: [
|
|
360
|
+
"ds:relative ds:flex ds:cursor-pointer ds:select-none",
|
|
361
|
+
"ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
362
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
363
|
+
"ds:min-h-[var(--min-target-size)]",
|
|
364
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
365
|
+
"ds:text-foreground ds:outline-none",
|
|
366
|
+
"ds:data-[highlighted]:bg-muted",
|
|
367
|
+
"ds:aria-selected:bg-muted",
|
|
368
|
+
"ds:aria-disabled:opacity-50 ds:aria-disabled:cursor-not-allowed"
|
|
369
|
+
].join(" "),
|
|
370
|
+
"aria-selected": f || void 0,
|
|
371
|
+
"data-current": f ? "true" : void 0,
|
|
372
|
+
lang: n.code,
|
|
373
|
+
dir: n.dir,
|
|
374
|
+
children: [
|
|
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 }),
|
|
401
|
+
f ? /* @__PURE__ */ t(
|
|
402
|
+
ee,
|
|
403
|
+
{
|
|
404
|
+
"aria-hidden": "true",
|
|
405
|
+
className: "ds:size-4 ds:text-primary ds:shrink-0"
|
|
406
|
+
}
|
|
407
|
+
) : null,
|
|
408
|
+
f ? /* @__PURE__ */ t("span", { className: "ds:sr-only", children: o("navigation.localePicker.currentSelection") }) : null
|
|
409
|
+
]
|
|
410
|
+
},
|
|
411
|
+
n.code
|
|
412
|
+
);
|
|
413
|
+
})
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
)
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
)
|
|
420
|
+
}
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
S.displayName = "LocalePicker.SearchList";
|
|
425
|
+
function ie({
|
|
426
|
+
state: e,
|
|
427
|
+
rest: a,
|
|
428
|
+
forwardedRef: d,
|
|
429
|
+
className: i,
|
|
430
|
+
disabled: s,
|
|
431
|
+
loading: r
|
|
432
|
+
}) {
|
|
433
|
+
const { t: l } = x(), o = w[e.locale];
|
|
434
|
+
return /* @__PURE__ */ t(
|
|
435
|
+
"div",
|
|
436
|
+
{
|
|
437
|
+
ref: d,
|
|
438
|
+
"data-component": "locale-picker",
|
|
439
|
+
"data-component-id": a.id,
|
|
440
|
+
className: U({ variant: "icon", className: i }),
|
|
441
|
+
...a,
|
|
442
|
+
children: /* @__PURE__ */ u(p.Root, { children: [
|
|
443
|
+
/* @__PURE__ */ t(p.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
|
|
444
|
+
W,
|
|
445
|
+
{
|
|
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,
|
|
451
|
+
{
|
|
452
|
+
country: o.countryCode,
|
|
453
|
+
size: "sm",
|
|
454
|
+
shape: "rectangle",
|
|
455
|
+
rounded: "sm",
|
|
456
|
+
className: [
|
|
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(" ")
|
|
467
|
+
}
|
|
468
|
+
) : null
|
|
469
|
+
] }),
|
|
470
|
+
"aria-label": l("navigation.localePicker.trigger", {
|
|
471
|
+
locale: o.nativeName
|
|
472
|
+
})
|
|
473
|
+
}
|
|
474
|
+
) }),
|
|
475
|
+
/* @__PURE__ */ t(
|
|
476
|
+
p.Content,
|
|
477
|
+
{
|
|
478
|
+
align: "end",
|
|
479
|
+
sideOffset: 8,
|
|
480
|
+
className: D,
|
|
481
|
+
"aria-label": l("navigation.localePicker.popupLabel"),
|
|
482
|
+
children: /* @__PURE__ */ t(
|
|
483
|
+
S,
|
|
484
|
+
{
|
|
485
|
+
value: e.locale,
|
|
486
|
+
onValueChange: e.setLocale,
|
|
487
|
+
disabled: s,
|
|
488
|
+
loading: r
|
|
489
|
+
}
|
|
490
|
+
)
|
|
491
|
+
}
|
|
492
|
+
)
|
|
493
|
+
] })
|
|
494
|
+
}
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
function le({
|
|
498
|
+
state: e,
|
|
499
|
+
rest: a,
|
|
500
|
+
forwardedRef: d,
|
|
501
|
+
className: i,
|
|
502
|
+
disabled: s,
|
|
503
|
+
loading: r
|
|
504
|
+
}) {
|
|
505
|
+
const { t: l } = x(), o = w[e.locale];
|
|
506
|
+
return /* @__PURE__ */ t(
|
|
507
|
+
"div",
|
|
508
|
+
{
|
|
509
|
+
ref: d,
|
|
510
|
+
"data-component": "locale-picker",
|
|
511
|
+
"data-component-id": a.id,
|
|
512
|
+
className: U({ variant: "compact", className: i }),
|
|
513
|
+
...a,
|
|
514
|
+
children: /* @__PURE__ */ u(p.Root, { children: [
|
|
515
|
+
/* @__PURE__ */ t(p.Trigger, { asChild: !0, children: /* @__PURE__ */ u(
|
|
516
|
+
"button",
|
|
517
|
+
{
|
|
518
|
+
type: "button",
|
|
519
|
+
disabled: s || r,
|
|
520
|
+
className: ne,
|
|
521
|
+
"aria-label": l("navigation.localePicker.trigger", {
|
|
522
|
+
locale: o.nativeName
|
|
523
|
+
}),
|
|
524
|
+
children: [
|
|
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" }),
|
|
535
|
+
/* @__PURE__ */ t(
|
|
536
|
+
"span",
|
|
537
|
+
{
|
|
538
|
+
className: "ds:flex-1 ds:truncate type-body-sm",
|
|
539
|
+
lang: o.code,
|
|
540
|
+
children: o.nativeName
|
|
541
|
+
}
|
|
542
|
+
)
|
|
543
|
+
]
|
|
544
|
+
}
|
|
545
|
+
) }),
|
|
546
|
+
/* @__PURE__ */ t(
|
|
547
|
+
p.Content,
|
|
548
|
+
{
|
|
549
|
+
align: "end",
|
|
550
|
+
sideOffset: 8,
|
|
551
|
+
className: D,
|
|
552
|
+
"aria-label": l("navigation.localePicker.popupLabel"),
|
|
553
|
+
children: /* @__PURE__ */ t(
|
|
554
|
+
S,
|
|
555
|
+
{
|
|
556
|
+
value: e.locale,
|
|
557
|
+
onValueChange: e.setLocale,
|
|
558
|
+
disabled: s,
|
|
559
|
+
loading: r
|
|
560
|
+
}
|
|
561
|
+
)
|
|
562
|
+
}
|
|
563
|
+
)
|
|
564
|
+
] })
|
|
565
|
+
}
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
const V = F(
|
|
569
|
+
(e, a) => {
|
|
570
|
+
const {
|
|
571
|
+
variant: d = "icon",
|
|
572
|
+
value: i,
|
|
573
|
+
onValueChange: s,
|
|
574
|
+
disabled: r = !1,
|
|
575
|
+
loading: l = !1,
|
|
576
|
+
className: o,
|
|
577
|
+
id: h,
|
|
578
|
+
...b
|
|
579
|
+
} = e, v = H(), C = i ?? v.locale, L = R(
|
|
580
|
+
(c) => {
|
|
581
|
+
if (m(c)) {
|
|
582
|
+
if (s) {
|
|
583
|
+
s(c), P(c), I(k, c);
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
v.setLocale(c);
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
[s, v]
|
|
590
|
+
), g = _(
|
|
591
|
+
() => ({ locale: C, setLocale: L }),
|
|
592
|
+
[C, L]
|
|
593
|
+
), N = j(null);
|
|
594
|
+
q(a, () => N.current, []);
|
|
595
|
+
const n = j(g);
|
|
596
|
+
n.current = g;
|
|
597
|
+
const f = _(
|
|
598
|
+
() => ({
|
|
599
|
+
setLocale: (c) => {
|
|
600
|
+
m(c) && n.current.setLocale(c);
|
|
601
|
+
}
|
|
602
|
+
}),
|
|
603
|
+
[]
|
|
604
|
+
);
|
|
605
|
+
return Z(se, f, h), d === "compact" ? /* @__PURE__ */ t(
|
|
606
|
+
le,
|
|
607
|
+
{
|
|
608
|
+
state: g,
|
|
609
|
+
rest: b,
|
|
610
|
+
forwardedRef: N,
|
|
611
|
+
className: o,
|
|
612
|
+
disabled: r,
|
|
613
|
+
loading: l
|
|
614
|
+
}
|
|
615
|
+
) : /* @__PURE__ */ t(
|
|
616
|
+
ie,
|
|
617
|
+
{
|
|
618
|
+
state: g,
|
|
619
|
+
rest: b,
|
|
620
|
+
forwardedRef: N,
|
|
621
|
+
className: o,
|
|
622
|
+
disabled: r,
|
|
623
|
+
loading: l
|
|
624
|
+
}
|
|
625
|
+
);
|
|
626
|
+
}
|
|
627
|
+
);
|
|
628
|
+
V.displayName = "LocalePicker";
|
|
629
|
+
const ke = Object.assign(V, {
|
|
630
|
+
SearchList: S
|
|
631
|
+
});
|
|
632
|
+
export {
|
|
633
|
+
k as L,
|
|
634
|
+
ke as a,
|
|
635
|
+
S as b,
|
|
636
|
+
w as c
|
|
637
|
+
};
|
|
638
|
+
//# sourceMappingURL=locale-picker-BxEUUPW7.js.map
|