@alfadocs/ui-kit 1.81.0 → 1.83.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/{anamnesis-summary-rows-BYtpwCyn.js → anamnesis-summary-rows-6gMuu0ZK.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-NoEPeFdj.js → balance-badge-cell-BHXJS8Ga.js} +2 -2
- package/dist/_chunks/booking-dsgiuhKg.js +4304 -0
- package/dist/_chunks/{link-cell-renderer-Dwp_DCYT.js → link-cell-renderer-C0ynDik7.js} +2 -2
- package/dist/_chunks/login-dev-card-DYwbL5sD.js +385 -0
- package/dist/_chunks/{multi-select-IOVnOGlP.js → multi-select-i5MFRpXg.js} +153 -146
- package/dist/_chunks/{otp-input-BgEZi0py.js → otp-input-gV1446Dw.js} +70 -70
- package/dist/_chunks/{registration-form-e9oYscB7.js → registration-form-DmP3YUfp.js} +2 -2
- package/dist/agent-catalog.json +5 -5
- package/dist/agent-i18n/en.json +2 -2
- package/dist/components/booking/booking-types.d.ts +35 -2
- package/dist/components/booking/code-step.d.ts +4 -2
- package/dist/components/booking/details-form.d.ts +2 -0
- package/dist/components/booking/handover.d.ts +12 -0
- package/dist/components/booking/index.js +1 -1
- package/dist/components/booking/reserved.d.ts +24 -0
- package/dist/components/booking/use-booking-payment.d.ts +3 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +8 -0
- package/dist/i18n/locales/ar.js +8 -0
- package/dist/i18n/locales/de.d.ts +8 -0
- package/dist/i18n/locales/de.js +8 -0
- package/dist/i18n/locales/el.d.ts +8 -0
- package/dist/i18n/locales/el.js +8 -0
- package/dist/i18n/locales/en.d.ts +8 -0
- package/dist/i18n/locales/en.js +8 -0
- package/dist/i18n/locales/es.d.ts +8 -0
- package/dist/i18n/locales/es.js +8 -0
- package/dist/i18n/locales/fr.d.ts +8 -0
- package/dist/i18n/locales/fr.js +8 -0
- package/dist/i18n/locales/hi.d.ts +8 -0
- package/dist/i18n/locales/hi.js +8 -0
- package/dist/i18n/locales/it.d.ts +8 -0
- package/dist/i18n/locales/it.js +8 -0
- package/dist/i18n/locales/ja.d.ts +8 -0
- package/dist/i18n/locales/ja.js +8 -0
- package/dist/i18n/locales/nl.d.ts +8 -0
- package/dist/i18n/locales/nl.js +8 -0
- package/dist/i18n/locales/pl.d.ts +8 -0
- package/dist/i18n/locales/pl.js +8 -0
- package/dist/i18n/locales/pt.d.ts +8 -0
- package/dist/i18n/locales/pt.js +8 -0
- package/dist/i18n/locales/ro.d.ts +8 -0
- package/dist/i18n/locales/ro.js +8 -0
- package/dist/i18n/locales/ru.d.ts +8 -0
- package/dist/i18n/locales/ru.js +8 -0
- package/dist/i18n/locales/sq.d.ts +8 -0
- package/dist/i18n/locales/sq.js +8 -0
- package/dist/i18n/locales/sv.d.ts +8 -0
- package/dist/i18n/locales/sv.js +8 -0
- package/dist/i18n/locales/tr.d.ts +8 -0
- package/dist/i18n/locales/tr.js +8 -0
- package/dist/i18n/locales/zh.d.ts +8 -0
- package/dist/i18n/locales/zh.js +8 -0
- package/dist/index.js +8 -8
- package/dist/locales/ar.json +8 -0
- package/dist/locales/de.json +8 -0
- package/dist/locales/el.json +8 -0
- package/dist/locales/en.json +8 -0
- package/dist/locales/es.json +8 -0
- package/dist/locales/fr.json +8 -0
- package/dist/locales/hi.json +8 -0
- package/dist/locales/it.json +8 -0
- package/dist/locales/ja.json +8 -0
- package/dist/locales/nl.json +8 -0
- package/dist/locales/pl.json +8 -0
- package/dist/locales/pt.json +8 -0
- package/dist/locales/ro.json +8 -0
- package/dist/locales/ru.json +8 -0
- package/dist/locales/sq.json +8 -0
- package/dist/locales/sv.json +8 -0
- package/dist/locales/tr.json +8 -0
- package/dist/locales/zh.json +8 -0
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/login-form/login-form.d.ts +7 -0
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/booking-CxrB0e6d.js +0 -4079
- package/dist/_chunks/login-dev-card-CvLHj-_N.js +0 -353
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import * as
|
|
1
|
+
import { jsx as r, jsxs as g, Fragment as tt } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as st, useContext as rt, useState as R, useRef as S, useId as nt, useMemo as T, useEffect as W, useCallback as fe } from "react";
|
|
3
|
+
import * as z from "@radix-ui/react-popover";
|
|
4
4
|
import { _ as c } from "./index-4xgbg-sn.js";
|
|
5
5
|
import { c as ve } from "./index-D2ZczOXr.js";
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { u as
|
|
6
|
+
import { useTranslation as it } from "react-i18next";
|
|
7
|
+
import { u as at, F as ot, b as lt } from "./form-field-context-DtiROUJV.js";
|
|
8
8
|
import { T as he } from "./tooltip-uEBdD1-5.js";
|
|
9
|
-
import { c as
|
|
10
|
-
import { u as
|
|
11
|
-
import { u as
|
|
12
|
-
import { g as
|
|
9
|
+
import { c as dt } from "./compose-refs-C0k0tdqF.js";
|
|
10
|
+
import { u as ct } from "./use-controllable-state-BiY4xTzM.js";
|
|
11
|
+
import { u as E } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
12
|
+
import { g as ut } from "./group-options-BvKhQ3xb.js";
|
|
13
13
|
import { b as ye } from "./menu-row-BAr8bx1I.js";
|
|
14
|
-
import { O as
|
|
15
|
-
import { b as X, c as
|
|
16
|
-
import { u as
|
|
17
|
-
import { X as
|
|
18
|
-
import { C as
|
|
19
|
-
const
|
|
14
|
+
import { O as mt, a as pt, o as ft, b as ht, c as bt } from "./option-row-Dc7BrbK8.js";
|
|
15
|
+
import { b as X, c as gt } from "./input-surface-iBmxVBfr.js";
|
|
16
|
+
import { u as vt } from "./registry-DvAUVLHh.js";
|
|
17
|
+
import { X as yt } from "./x-B5YnXwCz.js";
|
|
18
|
+
import { C as St } from "./check-DrFSN__t.js";
|
|
19
|
+
const It = {
|
|
20
20
|
id: "multi-select",
|
|
21
21
|
// Persisted multi-choice (selection state + set_selection) → select_multiple,
|
|
22
22
|
// plus type-to-filter and open/close of the option list.
|
|
@@ -129,10 +129,10 @@ const yt = {
|
|
|
129
129
|
description: "Each option emits its value as data-option-id."
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
},
|
|
132
|
+
}, xt = ve(
|
|
133
133
|
[
|
|
134
134
|
"ds:inline-flex ds:flex-wrap ds:items-center ds:gap-1 ds:w-full",
|
|
135
|
-
|
|
135
|
+
gt,
|
|
136
136
|
"ds:aria-[invalid=true]:border-destructive",
|
|
137
137
|
"ds:aria-disabled:cursor-not-allowed ds:aria-disabled:opacity-50"
|
|
138
138
|
],
|
|
@@ -146,7 +146,7 @@ const yt = {
|
|
|
146
146
|
},
|
|
147
147
|
defaultVariants: { size: "md" }
|
|
148
148
|
}
|
|
149
|
-
),
|
|
149
|
+
), be = ve(
|
|
150
150
|
[
|
|
151
151
|
"ds:inline-flex ds:items-center ds:gap-1",
|
|
152
152
|
"ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-muted",
|
|
@@ -166,7 +166,7 @@ const yt = {
|
|
|
166
166
|
},
|
|
167
167
|
defaultVariants: { size: "md" }
|
|
168
168
|
}
|
|
169
|
-
),
|
|
169
|
+
), Nt = [
|
|
170
170
|
"ds:inline-flex ds:items-center ds:justify-center ds:shrink-0",
|
|
171
171
|
"ds:rounded-[var(--radius-sm)]",
|
|
172
172
|
"ds:text-muted-foreground ds:hover:text-foreground",
|
|
@@ -175,7 +175,7 @@ const yt = {
|
|
|
175
175
|
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
176
176
|
"ds:size-4",
|
|
177
177
|
'ds:relative ds:before:absolute ds:before:inset-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""]'
|
|
178
|
-
].join(" "),
|
|
178
|
+
].join(" "), wt = [
|
|
179
179
|
"ds:z-[var(--z-dropdown)] ds:overflow-hidden",
|
|
180
180
|
// At least as wide as the field, at most as wide as the screen allows: a
|
|
181
181
|
// long option wraps or ends in an ellipsis instead of running off the
|
|
@@ -190,31 +190,31 @@ const yt = {
|
|
|
190
190
|
"ds:data-[side=bottom]:slide-in-from-top-2",
|
|
191
191
|
"ds:data-[side=top]:slide-in-from-bottom-2",
|
|
192
192
|
"ds:motion-reduce:animate-none"
|
|
193
|
-
].join(" "),
|
|
193
|
+
].join(" "), Ct = [
|
|
194
194
|
"ds:relative ds:flex ds:cursor-pointer ds:items-center",
|
|
195
195
|
"ds:rounded-[var(--radius-sm)] ds:ps-2 ds:pe-2 ds:py-1.5",
|
|
196
196
|
"ds:text-[var(--font-size-sm)] ds:text-foreground ds:outline-none ds:select-none",
|
|
197
197
|
ye.selected,
|
|
198
198
|
"ds:aria-[disabled=true]:pointer-events-none ds:aria-[disabled=true]:opacity-50",
|
|
199
199
|
"ds:data-[disabled=true]:pointer-events-none ds:data-[disabled=true]:opacity-50"
|
|
200
|
-
].join(" "),
|
|
200
|
+
].join(" "), ge = [
|
|
201
201
|
"ds:relative ds:flex ds:cursor-pointer ds:items-center",
|
|
202
202
|
"ds:rounded-[var(--radius-sm)] ds:ps-2 ds:pe-2 ds:py-1.5",
|
|
203
203
|
"ds:text-[var(--font-size-sm)] ds:font-medium ds:text-primary ds:outline-none ds:select-none",
|
|
204
204
|
ye.selected
|
|
205
|
-
].join(" "),
|
|
205
|
+
].join(" "), At = "__ui-multiselect-select-all__", _t = "__ui-multiselect-clear-all__", Se = st(
|
|
206
206
|
function({
|
|
207
207
|
options: l,
|
|
208
|
-
value:
|
|
209
|
-
defaultValue:
|
|
208
|
+
value: Ie,
|
|
209
|
+
defaultValue: xe,
|
|
210
210
|
onChange: Ne,
|
|
211
|
-
onComplete:
|
|
211
|
+
onComplete: P,
|
|
212
212
|
placeholder: we,
|
|
213
|
-
maxSelections:
|
|
213
|
+
maxSelections: x,
|
|
214
214
|
allowSelectAll: J = !1,
|
|
215
215
|
allowClear: Z = !1,
|
|
216
|
-
filter:
|
|
217
|
-
size:
|
|
216
|
+
filter: B,
|
|
217
|
+
size: O = "md",
|
|
218
218
|
disabled: Ce,
|
|
219
219
|
wrapOptionLabels: ee = !1,
|
|
220
220
|
className: Ae,
|
|
@@ -229,23 +229,30 @@ const yt = {
|
|
|
229
229
|
"aria-label": te,
|
|
230
230
|
..._e
|
|
231
231
|
}, ke) {
|
|
232
|
-
const { t: u } =
|
|
233
|
-
value:
|
|
234
|
-
defaultValue:
|
|
232
|
+
const { t: u } = it("ui"), m = at(), I = rt(ot) !== null, [Re, K] = ct({
|
|
233
|
+
value: Ie,
|
|
234
|
+
defaultValue: xe ?? [],
|
|
235
235
|
onChange: Ne
|
|
236
|
-
}), i = Re ?? [], [w, p] =
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
}), i = Re ?? [], [w, p] = R(!1), [f, $] = R(""), v = S(null), se = `${nt()}-count`, N = S([]), F = S(null), Te = dt(ke, F), [Ee, Oe] = R(!1);
|
|
237
|
+
E(() => {
|
|
238
|
+
var e;
|
|
239
|
+
Oe(
|
|
240
|
+
!!((e = F.current) != null && e.closest("fieldset:disabled"))
|
|
241
|
+
);
|
|
242
|
+
});
|
|
243
|
+
const y = I && m.disabled || !!Ce || Ee, Fe = I && m.required, re = I && m.invalid, Ve = I && m.describedBy ? m.describedBy : void 0, Le = j ?? (I ? m.id : void 0);
|
|
244
|
+
lt(m, v);
|
|
245
|
+
const De = T(() => {
|
|
239
246
|
const e = /* @__PURE__ */ new Map();
|
|
240
247
|
for (const t of l) e.set(t.value, t.label);
|
|
241
248
|
return e;
|
|
242
|
-
}, [l]),
|
|
249
|
+
}, [l]), qe = T(() => {
|
|
243
250
|
const e = /* @__PURE__ */ new Map();
|
|
244
251
|
for (const t of l) e.set(t.value, t.dir);
|
|
245
252
|
return e;
|
|
246
|
-
}, [l]), ne = typeof
|
|
247
|
-
|
|
248
|
-
},
|
|
253
|
+
}, [l]), ne = typeof x == "number" && i.length >= x, C = (e) => {
|
|
254
|
+
K(e);
|
|
255
|
+
}, Me = (e) => {
|
|
249
256
|
if (i.includes(e)) {
|
|
250
257
|
C(i.filter((t) => t !== e));
|
|
251
258
|
return;
|
|
@@ -254,58 +261,58 @@ const yt = {
|
|
|
254
261
|
}, U = (e) => {
|
|
255
262
|
const t = i.filter((n, a) => a !== e);
|
|
256
263
|
return C(t), t;
|
|
257
|
-
},
|
|
258
|
-
const e = l.filter((n) => !n.disabled).map((n) => n.value), t = typeof
|
|
264
|
+
}, ze = () => {
|
|
265
|
+
const e = l.filter((n) => !n.disabled).map((n) => n.value), t = typeof x == "number" ? x : e.length;
|
|
259
266
|
C(e.slice(0, t));
|
|
260
|
-
},
|
|
267
|
+
}, Pe = () => {
|
|
261
268
|
C([]);
|
|
262
|
-
}, ie =
|
|
269
|
+
}, ie = S(i);
|
|
263
270
|
W(() => {
|
|
264
271
|
ie.current = i;
|
|
265
272
|
}, [i]);
|
|
266
|
-
const ae =
|
|
273
|
+
const ae = S(f);
|
|
267
274
|
W(() => {
|
|
268
275
|
ae.current = f;
|
|
269
276
|
}, [f]);
|
|
270
|
-
const oe =
|
|
277
|
+
const oe = S(w);
|
|
271
278
|
W(() => {
|
|
272
279
|
oe.current = w;
|
|
273
280
|
}, [w]);
|
|
274
281
|
const H = fe(
|
|
275
282
|
(e) => {
|
|
276
|
-
|
|
283
|
+
K(e);
|
|
277
284
|
},
|
|
278
|
-
[
|
|
279
|
-
),
|
|
285
|
+
[K]
|
|
286
|
+
), Be = T(
|
|
280
287
|
() => ({
|
|
281
288
|
getSelection: () => [...ie.current],
|
|
282
289
|
getQuery: () => ae.current,
|
|
283
290
|
getIsOpen: () => oe.current,
|
|
284
291
|
setSelection: (e) => H(e),
|
|
285
292
|
clearSelection: () => H([]),
|
|
286
|
-
setQuery: (e) =>
|
|
293
|
+
setQuery: (e) => $(e),
|
|
287
294
|
open: () => p(!0),
|
|
288
295
|
close: () => p(!1)
|
|
289
296
|
}),
|
|
290
297
|
[H]
|
|
291
298
|
);
|
|
292
|
-
|
|
293
|
-
const le = we ?? u("inputs.multiSelect.placeholder", "Select…"), de =
|
|
299
|
+
vt(It, Be, j);
|
|
300
|
+
const le = we ?? u("inputs.multiSelect.placeholder", "Select…"), de = T(() => {
|
|
294
301
|
if (!f) return l;
|
|
295
302
|
const e = f.toLowerCase();
|
|
296
|
-
return l.filter((t) =>
|
|
297
|
-
}, [l, f,
|
|
298
|
-
() =>
|
|
303
|
+
return l.filter((t) => B ? B(f, t) : t.label.toLowerCase().includes(e));
|
|
304
|
+
}, [l, f, B]), je = T(
|
|
305
|
+
() => ut(de),
|
|
299
306
|
[de]
|
|
300
|
-
),
|
|
307
|
+
), Ke = (e) => {
|
|
301
308
|
var a;
|
|
302
309
|
const t = e.currentTarget;
|
|
303
310
|
if (e.key === "Backspace" && f === "" && i.length > 0) {
|
|
304
311
|
e.preventDefault();
|
|
305
312
|
const s = i.length - 1, d = U(s).length - 1;
|
|
306
313
|
d >= 0 && requestAnimationFrame(() => {
|
|
307
|
-
var
|
|
308
|
-
(
|
|
314
|
+
var b;
|
|
315
|
+
(b = N.current[d]) == null || b.focus();
|
|
309
316
|
});
|
|
310
317
|
return;
|
|
311
318
|
}
|
|
@@ -324,44 +331,44 @@ const yt = {
|
|
|
324
331
|
return;
|
|
325
332
|
}
|
|
326
333
|
!w && (e.key === "ArrowDown" || e.key === "Enter") && p(!0);
|
|
327
|
-
},
|
|
328
|
-
var h, d,
|
|
334
|
+
}, $e = (e) => (t) => {
|
|
335
|
+
var h, d, b, _;
|
|
329
336
|
if (t.key === "Backspace" || t.key === "Delete" || t.key === "Enter" || t.key === " ") {
|
|
330
337
|
t.preventDefault(), t.stopPropagation();
|
|
331
|
-
const
|
|
332
|
-
if (
|
|
338
|
+
const M = U(e);
|
|
339
|
+
if (M.length === 0) {
|
|
333
340
|
requestAnimationFrame(() => {
|
|
334
341
|
var k;
|
|
335
342
|
return (k = v.current) == null ? void 0 : k.focus();
|
|
336
343
|
});
|
|
337
344
|
return;
|
|
338
345
|
}
|
|
339
|
-
const
|
|
346
|
+
const et = Math.min(e, M.length - 1);
|
|
340
347
|
requestAnimationFrame(() => {
|
|
341
348
|
var k;
|
|
342
|
-
(k = N.current[
|
|
349
|
+
(k = N.current[et]) == null || k.focus();
|
|
343
350
|
});
|
|
344
351
|
return;
|
|
345
352
|
}
|
|
346
353
|
const n = document.dir === "rtl", a = n ? "ArrowRight" : "ArrowLeft", s = n ? "ArrowLeft" : "ArrowRight";
|
|
347
354
|
if (t.key === a) {
|
|
348
355
|
t.preventDefault();
|
|
349
|
-
const
|
|
350
|
-
(h = N.current[
|
|
356
|
+
const M = Math.max(0, e - 1);
|
|
357
|
+
(h = N.current[M]) == null || h.focus();
|
|
351
358
|
return;
|
|
352
359
|
}
|
|
353
360
|
if (t.key === s) {
|
|
354
|
-
t.preventDefault(), e < i.length - 1 ? (d = N.current[e + 1]) == null || d.focus() : (
|
|
361
|
+
t.preventDefault(), e < i.length - 1 ? (d = N.current[e + 1]) == null || d.focus() : (b = v.current) == null || b.focus();
|
|
355
362
|
return;
|
|
356
363
|
}
|
|
357
364
|
t.key === "Escape" && (p(!1), (_ = v.current) == null || _.focus());
|
|
358
|
-
}, [
|
|
365
|
+
}, [V, Y] = R(
|
|
359
366
|
Number.POSITIVE_INFINITY
|
|
360
|
-
), [
|
|
361
|
-
Y(Number.POSITIVE_INFINITY),
|
|
367
|
+
), [Ue, He] = R(0), ce = S(-1), L = fe(() => {
|
|
368
|
+
Y(Number.POSITIVE_INFINITY), He((e) => e + 1);
|
|
362
369
|
}, []);
|
|
363
|
-
|
|
364
|
-
const e =
|
|
370
|
+
E(() => {
|
|
371
|
+
const e = F.current;
|
|
365
372
|
if (!e) return;
|
|
366
373
|
const t = Array.from(
|
|
367
374
|
e.querySelectorAll('[data-ui-chip="true"]')
|
|
@@ -378,78 +385,78 @@ const yt = {
|
|
|
378
385
|
Y(
|
|
379
386
|
a === t.length ? Number.POSITIVE_INFINITY : Math.max(1, a - 1)
|
|
380
387
|
);
|
|
381
|
-
}, [
|
|
382
|
-
|
|
383
|
-
}, [i.length,
|
|
384
|
-
const e =
|
|
388
|
+
}, [Ue]), E(() => {
|
|
389
|
+
L();
|
|
390
|
+
}, [i.length, O, L]), E(() => {
|
|
391
|
+
const e = F.current;
|
|
385
392
|
if (!e) return;
|
|
386
393
|
const t = new ResizeObserver((n) => {
|
|
387
394
|
var s;
|
|
388
395
|
const a = Math.round(
|
|
389
396
|
((s = n[0]) == null ? void 0 : s.contentRect.width) ?? e.clientWidth
|
|
390
397
|
);
|
|
391
|
-
a !== ce.current && (ce.current = a,
|
|
398
|
+
a !== ce.current && (ce.current = a, L());
|
|
392
399
|
});
|
|
393
400
|
return t.observe(e), () => t.disconnect();
|
|
394
|
-
}, [
|
|
395
|
-
const
|
|
401
|
+
}, [L]);
|
|
402
|
+
const D = i.map((e) => ({
|
|
396
403
|
value: e,
|
|
397
|
-
label:
|
|
398
|
-
})), ue =
|
|
404
|
+
label: De.get(e) ?? e
|
|
405
|
+
})), ue = V === Number.POSITIVE_INFINITY || V >= D.length, Ye = ue ? D : D.slice(0, V), me = ue ? [] : D.slice(V), A = me.length, Ge = (e) => {
|
|
399
406
|
var n;
|
|
400
|
-
if (
|
|
407
|
+
if (y) return;
|
|
401
408
|
const t = e.target;
|
|
402
409
|
t.closest('[data-ui-chip="true"]') || t.closest('[data-ui-chip-dismiss="true"]') || (p(!0), (n = v.current) == null || n.focus());
|
|
403
|
-
},
|
|
404
|
-
if (
|
|
410
|
+
}, Qe = (e) => {
|
|
411
|
+
if (y) {
|
|
405
412
|
p(!1);
|
|
406
413
|
return;
|
|
407
414
|
}
|
|
408
|
-
p(e), e || (
|
|
409
|
-
},
|
|
415
|
+
p(e), e || ($(""), P == null || P(i));
|
|
416
|
+
}, We = J || Z, Xe = u("inputs.multiSelect.selected", {
|
|
410
417
|
count: i.length,
|
|
411
418
|
defaultValue: `${i.length} selected`
|
|
412
|
-
}), pe =
|
|
413
|
-
|
|
419
|
+
}), pe = I && m.label || te || le, Je = [se, Ve].filter(Boolean).join(" "), G = I ? `${m.id}-label` : void 0, q = S(null);
|
|
420
|
+
E(() => {
|
|
414
421
|
const e = v.current;
|
|
415
422
|
if (!e) return;
|
|
416
423
|
const t = e.getAttribute("aria-labelledby");
|
|
417
424
|
if (G) {
|
|
418
425
|
if (t === G) return;
|
|
419
|
-
|
|
420
|
-
} else
|
|
426
|
+
q.current = t, e.setAttribute("aria-labelledby", G);
|
|
427
|
+
} else q.current !== null && (e.setAttribute("aria-labelledby", q.current), q.current = null);
|
|
421
428
|
});
|
|
422
|
-
const { onClick: Q, ...
|
|
423
|
-
return /* @__PURE__ */ r(c, { shouldFilter: !1, label: pe, children: /* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */ r(
|
|
429
|
+
const { onClick: Q, ...Ze } = _e;
|
|
430
|
+
return /* @__PURE__ */ r(c, { shouldFilter: !1, label: pe, children: /* @__PURE__ */ g(z.Root, { open: w, onOpenChange: Qe, children: [
|
|
431
|
+
/* @__PURE__ */ r(z.Anchor, { asChild: !0, children: /* @__PURE__ */ g(
|
|
425
432
|
"div",
|
|
426
433
|
{
|
|
427
434
|
ref: Te,
|
|
428
|
-
className:
|
|
429
|
-
"aria-disabled":
|
|
435
|
+
className: xt({ size: O, className: Ae }),
|
|
436
|
+
"aria-disabled": y || void 0,
|
|
430
437
|
"aria-invalid": re || void 0,
|
|
431
438
|
"data-component": "multi-select",
|
|
432
439
|
"data-component-id": j,
|
|
433
440
|
onClick: (e) => {
|
|
434
|
-
Q == null || Q(e),
|
|
441
|
+
Q == null || Q(e), Ge(e);
|
|
435
442
|
},
|
|
436
|
-
...
|
|
443
|
+
...Ze,
|
|
437
444
|
children: [
|
|
438
|
-
|
|
445
|
+
Ye.map((e, t) => (
|
|
439
446
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- chip pill receives focus via roving tabindex; chip removal uses an inner button
|
|
440
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ g(
|
|
441
448
|
"span",
|
|
442
449
|
{
|
|
443
450
|
ref: (n) => {
|
|
444
451
|
N.current[t] = n;
|
|
445
452
|
},
|
|
446
|
-
tabIndex:
|
|
453
|
+
tabIndex: y ? -1 : 0,
|
|
447
454
|
"data-ui-chip": "true",
|
|
448
|
-
className:
|
|
449
|
-
onKeyDown:
|
|
455
|
+
className: be({ size: O }),
|
|
456
|
+
onKeyDown: $e(t),
|
|
450
457
|
"aria-label": e.label,
|
|
451
458
|
children: [
|
|
452
|
-
/* @__PURE__ */ r("span", { dir:
|
|
459
|
+
/* @__PURE__ */ r("span", { dir: qe.get(e.value), children: e.label }),
|
|
453
460
|
/* @__PURE__ */ r(
|
|
454
461
|
"button",
|
|
455
462
|
{
|
|
@@ -460,15 +467,15 @@ const yt = {
|
|
|
460
467
|
label: e.label,
|
|
461
468
|
defaultValue: `Remove ${e.label}`
|
|
462
469
|
}),
|
|
463
|
-
disabled:
|
|
470
|
+
disabled: y,
|
|
464
471
|
onClick: (n) => {
|
|
465
472
|
n.stopPropagation(), U(t), requestAnimationFrame(() => {
|
|
466
473
|
var a;
|
|
467
474
|
return (a = v.current) == null ? void 0 : a.focus();
|
|
468
475
|
});
|
|
469
476
|
},
|
|
470
|
-
className:
|
|
471
|
-
children: /* @__PURE__ */ r(
|
|
477
|
+
className: Nt,
|
|
478
|
+
children: /* @__PURE__ */ r(yt, { "aria-hidden": "true", className: "ds:size-3.5" })
|
|
472
479
|
}
|
|
473
480
|
)
|
|
474
481
|
]
|
|
@@ -484,8 +491,8 @@ const yt = {
|
|
|
484
491
|
children: /* @__PURE__ */ r(
|
|
485
492
|
"span",
|
|
486
493
|
{
|
|
487
|
-
className:
|
|
488
|
-
tabIndex: 0,
|
|
494
|
+
className: be({ size: O }),
|
|
495
|
+
tabIndex: y ? -1 : 0,
|
|
489
496
|
role: "button",
|
|
490
497
|
"aria-label": u("inputs.multiSelect.overflow", {
|
|
491
498
|
count: A,
|
|
@@ -504,17 +511,17 @@ const yt = {
|
|
|
504
511
|
{
|
|
505
512
|
ref: v,
|
|
506
513
|
value: f,
|
|
507
|
-
onValueChange:
|
|
508
|
-
onKeyDown:
|
|
514
|
+
onValueChange: $,
|
|
515
|
+
onKeyDown: Ke,
|
|
509
516
|
onFocus: () => {
|
|
510
|
-
|
|
517
|
+
y || p(!0);
|
|
511
518
|
},
|
|
512
519
|
placeholder: i.length === 0 ? le : "",
|
|
513
|
-
id:
|
|
514
|
-
"aria-describedby":
|
|
520
|
+
id: Le,
|
|
521
|
+
"aria-describedby": Je,
|
|
515
522
|
"aria-invalid": re || void 0,
|
|
516
|
-
"aria-required":
|
|
517
|
-
disabled:
|
|
523
|
+
"aria-required": Fe || void 0,
|
|
524
|
+
disabled: y,
|
|
518
525
|
className: [
|
|
519
526
|
"ds:flex-1 ds:min-w-[6rem] ds:bg-transparent ds:outline-none",
|
|
520
527
|
"ds:placeholder:text-muted-foreground ds:text-start",
|
|
@@ -522,12 +529,12 @@ const yt = {
|
|
|
522
529
|
].join(" ")
|
|
523
530
|
}
|
|
524
531
|
),
|
|
525
|
-
/* @__PURE__ */ r("span", { id: se, hidden: !0, children:
|
|
532
|
+
/* @__PURE__ */ r("span", { id: se, hidden: !0, children: Xe })
|
|
526
533
|
]
|
|
527
534
|
}
|
|
528
535
|
) }),
|
|
529
|
-
/* @__PURE__ */ r(
|
|
530
|
-
|
|
536
|
+
/* @__PURE__ */ r(z.Portal, { children: /* @__PURE__ */ r(
|
|
537
|
+
z.Content,
|
|
531
538
|
{
|
|
532
539
|
"data-component": "multi-select-list",
|
|
533
540
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
@@ -535,8 +542,8 @@ const yt = {
|
|
|
535
542
|
align: "start",
|
|
536
543
|
sideOffset: 4,
|
|
537
544
|
collisionPadding: 8,
|
|
538
|
-
className:
|
|
539
|
-
children: /* @__PURE__ */
|
|
545
|
+
className: wt,
|
|
546
|
+
children: /* @__PURE__ */ g(
|
|
540
547
|
c.List,
|
|
541
548
|
{
|
|
542
549
|
role: "listbox",
|
|
@@ -544,41 +551,41 @@ const yt = {
|
|
|
544
551
|
label: pe,
|
|
545
552
|
className: "ds:max-h-[20rem] ds:overflow-y-auto ds:p-1",
|
|
546
553
|
children: [
|
|
547
|
-
|
|
554
|
+
We ? /* @__PURE__ */ g(c.Group, { children: [
|
|
548
555
|
J ? /* @__PURE__ */ r(
|
|
549
556
|
c.Item,
|
|
550
557
|
{
|
|
551
|
-
value:
|
|
552
|
-
onSelect:
|
|
553
|
-
className:
|
|
558
|
+
value: At,
|
|
559
|
+
onSelect: ze,
|
|
560
|
+
className: ge,
|
|
554
561
|
children: u("inputs.multiSelect.selectAll", "Select all")
|
|
555
562
|
}
|
|
556
563
|
) : null,
|
|
557
564
|
Z ? /* @__PURE__ */ r(
|
|
558
565
|
c.Item,
|
|
559
566
|
{
|
|
560
|
-
value:
|
|
561
|
-
onSelect:
|
|
562
|
-
className:
|
|
567
|
+
value: _t,
|
|
568
|
+
onSelect: Pe,
|
|
569
|
+
className: ge,
|
|
563
570
|
children: u("inputs.multiSelect.clearAll", "Clear all")
|
|
564
571
|
}
|
|
565
572
|
) : null
|
|
566
573
|
] }) : null,
|
|
567
574
|
/* @__PURE__ */ r(c.Empty, { className: "ds:ps-2 ds:pe-2 ds:py-2 type-body-sm ds:text-muted-foreground", children: u("inputs.multiSelect.noOptions", "No options found") }),
|
|
568
|
-
|
|
575
|
+
je.map(({ group: e, items: t }, n) => {
|
|
569
576
|
const a = t.map((s) => {
|
|
570
|
-
const h = i.includes(s.value), d = !h && ne,
|
|
577
|
+
const h = i.includes(s.value), d = !h && ne, b = !!s.disabled || d, _ = /* @__PURE__ */ g(
|
|
571
578
|
c.Item,
|
|
572
579
|
{
|
|
573
580
|
value: s.value,
|
|
574
581
|
"data-option-id": s.value,
|
|
575
|
-
disabled:
|
|
582
|
+
disabled: b,
|
|
576
583
|
onSelect: () => {
|
|
577
|
-
|
|
584
|
+
b || Me(s.value);
|
|
578
585
|
},
|
|
579
586
|
"aria-selected": h,
|
|
580
|
-
"aria-disabled":
|
|
581
|
-
className:
|
|
587
|
+
"aria-disabled": b || void 0,
|
|
588
|
+
className: Ct,
|
|
582
589
|
children: [
|
|
583
590
|
/* @__PURE__ */ r(
|
|
584
591
|
"span",
|
|
@@ -589,7 +596,7 @@ const yt = {
|
|
|
589
596
|
h ? "ds:bg-primary ds:border-primary ds:text-primary-foreground" : "ds:bg-background ds:border-[color:var(--control-border)]"
|
|
590
597
|
].join(" "),
|
|
591
598
|
"aria-hidden": "true",
|
|
592
|
-
children: h ? /* @__PURE__ */ r(
|
|
599
|
+
children: h ? /* @__PURE__ */ r(St, { className: "ds:size-3.5" }) : null
|
|
593
600
|
}
|
|
594
601
|
),
|
|
595
602
|
s.startAdornment ? (
|
|
@@ -608,13 +615,13 @@ const yt = {
|
|
|
608
615
|
// Stacked, as in Combobox: the label and its end
|
|
609
616
|
// content on one row, the description under them.
|
|
610
617
|
// The option's name reads in that order.
|
|
611
|
-
/* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ g("span", { className: mt, children: [
|
|
619
|
+
/* @__PURE__ */ g("span", { className: pt, children: [
|
|
613
620
|
/* @__PURE__ */ r(
|
|
614
621
|
"span",
|
|
615
622
|
{
|
|
616
623
|
dir: s.dir,
|
|
617
|
-
className:
|
|
624
|
+
className: ft({
|
|
618
625
|
wrap: ee,
|
|
619
626
|
className: "ds:flex-1 ds:text-start"
|
|
620
627
|
}),
|
|
@@ -623,13 +630,13 @@ const yt = {
|
|
|
623
630
|
),
|
|
624
631
|
s.endContent ? (
|
|
625
632
|
// Announced, as below.
|
|
626
|
-
/* @__PURE__ */ r("span", { className:
|
|
633
|
+
/* @__PURE__ */ r("span", { className: ht, children: s.endContent })
|
|
627
634
|
) : null
|
|
628
635
|
] }),
|
|
629
636
|
s.description ? /* @__PURE__ */ r(
|
|
630
637
|
"span",
|
|
631
638
|
{
|
|
632
|
-
className:
|
|
639
|
+
className: bt({
|
|
633
640
|
tone: s.descriptionTone,
|
|
634
641
|
className: "ds:text-start"
|
|
635
642
|
}),
|
|
@@ -637,7 +644,7 @@ const yt = {
|
|
|
637
644
|
}
|
|
638
645
|
) : null
|
|
639
646
|
] })
|
|
640
|
-
) : /* @__PURE__ */
|
|
647
|
+
) : /* @__PURE__ */ g(tt, { children: [
|
|
641
648
|
/* @__PURE__ */ r(
|
|
642
649
|
"span",
|
|
643
650
|
{
|
|
@@ -663,8 +670,8 @@ const yt = {
|
|
|
663
670
|
he,
|
|
664
671
|
{
|
|
665
672
|
label: u("inputs.multiSelect.maxReached", {
|
|
666
|
-
count:
|
|
667
|
-
defaultValue: `Maximum ${
|
|
673
|
+
count: x,
|
|
674
|
+
defaultValue: `Maximum ${x} selections`
|
|
668
675
|
}),
|
|
669
676
|
delayDuration: 200,
|
|
670
677
|
children: _
|
|
@@ -691,10 +698,10 @@ const yt = {
|
|
|
691
698
|
}
|
|
692
699
|
);
|
|
693
700
|
Se.displayName = "MultiSelect";
|
|
694
|
-
const
|
|
701
|
+
const Ut = Se;
|
|
695
702
|
export {
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
703
|
+
Ut as M,
|
|
704
|
+
xt as a,
|
|
705
|
+
It as m
|
|
699
706
|
};
|
|
700
|
-
//# sourceMappingURL=multi-select-
|
|
707
|
+
//# sourceMappingURL=multi-select-i5MFRpXg.js.map
|