@wirecore/wirelayer-react 0.8.0 → 0.9.1

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.
Files changed (47) hide show
  1. package/README.md +5 -0
  2. package/dist/ContextMenu-GCeoPu8T.js +1523 -0
  3. package/dist/PasswordInput-CxZXGV2m.js +449 -0
  4. package/dist/{Select-C2CiPTCK.js → Select-CGyqfOm3.js} +65 -65
  5. package/dist/components/Avatar/Avatar.d.ts +3 -1
  6. package/dist/components/Avatar/Avatar.d.ts.map +1 -1
  7. package/dist/components/Card/Card.d.ts +3 -1
  8. package/dist/components/Card/Card.d.ts.map +1 -1
  9. package/dist/components/Code/Code.d.ts +11 -0
  10. package/dist/components/Code/Code.d.ts.map +1 -0
  11. package/dist/components/ContextMenu/ContextMenu.d.ts +4 -3
  12. package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
  13. package/dist/components/Dialog/Dialog.d.ts +7 -3
  14. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  15. package/dist/components/NativeSelect/NativeSelect.d.ts +9 -6
  16. package/dist/components/NativeSelect/NativeSelect.d.ts.map +1 -1
  17. package/dist/components/NumberInput/NumberInput.d.ts +11 -3
  18. package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
  19. package/dist/components/Progress/Progress.d.ts +5 -2
  20. package/dist/components/Progress/Progress.d.ts.map +1 -1
  21. package/dist/components/RadioGroup/RadioGroup.d.ts +12 -5
  22. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  23. package/dist/components/SegmentedControl/SegmentedControl.d.ts +12 -4
  24. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  25. package/dist/components/Select/Select.d.ts +11 -5
  26. package/dist/components/Select/Select.d.ts.map +1 -1
  27. package/dist/components/Stepper/Stepper.d.ts +3 -1
  28. package/dist/components/Stepper/Stepper.d.ts.map +1 -1
  29. package/dist/components/Tabs/Tabs.d.ts +11 -2
  30. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  31. package/dist/components/Wizard/Wizard.d.ts +11 -3
  32. package/dist/components/Wizard/Wizard.d.ts.map +1 -1
  33. package/dist/data-table.js +2 -2
  34. package/dist/hooks/index.d.ts +1 -1
  35. package/dist/hooks/index.d.ts.map +1 -1
  36. package/dist/hooks/media.d.ts +7 -0
  37. package/dist/hooks/media.d.ts.map +1 -1
  38. package/dist/index.d.ts +5 -3
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +1931 -1898
  41. package/dist/pdf.js +2 -2
  42. package/dist/sources/Code.css +2 -0
  43. package/llms-full.txt +63 -17
  44. package/llms.txt +1 -0
  45. package/package.json +3 -3
  46. package/dist/ContextMenu-C6ZaMtqf.js +0 -1511
  47. package/dist/PasswordInput-dpeKVREo.js +0 -425
@@ -0,0 +1,449 @@
1
+ "use client";
2
+ import { a as e, n as t } from "./RecipesProvider-0idafuGm.js";
3
+ import { r as n, t as r } from "./InputStatus-hVzkU_4q.js";
4
+ import { autoselectElement as i, checkPasswordRequirements as a, clampDialogOffset as o, closeTab as s, controlIds as c, dialog as l, dialogMoveForKey as u, dialogMoveKeys as d, passwordInput as f, passwordStrength as p, scrollEdges as m, setTextControlValue as h, tabs as g } from "@wirecore/wirelayer-recipes";
5
+ import { Check as _, ChevronLeft as v, ChevronRight as y, Circle as b, Eye as x, EyeOff as S, Maximize2 as ee, Minimize2 as te, X as C } from "lucide-react";
6
+ import { createContext as w, useContext as T, useEffect as E, useId as D, useLayoutEffect as O, useRef as k, useState as A } from "react";
7
+ import { jsx as j, jsxs as M } from "react/jsx-runtime";
8
+ import { Portal as N } from "@ark-ui/react/portal";
9
+ import { useFieldContext as P } from "@ark-ui/react/field";
10
+ import { Tabs as F } from "@ark-ui/react/tabs";
11
+ import { Dialog as I, useDialogContext as ne } from "@ark-ui/react/dialog";
12
+ import { PasswordInput as L } from "@ark-ui/react/password-input";
13
+ //#region src/components/Tabs/Tabs.tsx
14
+ var R = typeof document > "u" ? E : O, z = w(!1);
15
+ function B({ classes: e, value: n, defaultValue: r, onValueChange: i, label: a, orientation: o, activationMode: s, lazyMount: c, unmountOnExit: l, className: u, ...d }) {
16
+ let f = t("tabs", g, e)();
17
+ return /* @__PURE__ */ j(z, {
18
+ value: n === null,
19
+ children: /* @__PURE__ */ j(F.Root, {
20
+ ...d,
21
+ className: f.base({ class: u }),
22
+ value: n,
23
+ defaultValue: r,
24
+ onValueChange: (e) => i?.(e.value),
25
+ orientation: o,
26
+ activationMode: s,
27
+ lazyMount: c,
28
+ unmountOnExit: l,
29
+ translations: a ? { listLabel: a } : void 0
30
+ })
31
+ });
32
+ }
33
+ function V({ scrollable: e = !1, className: n, children: r, ...i }) {
34
+ let a = t("tabs", g)(), o = k(null), [s, c] = A({
35
+ start: !1,
36
+ end: !1
37
+ }), l = () => o.current && c(m(o.current));
38
+ E(() => {
39
+ if (!e || !o.current) return;
40
+ l();
41
+ let t = new ResizeObserver(l);
42
+ return t.observe(o.current), () => t.disconnect();
43
+ }, [e]);
44
+ let u = (e) => {
45
+ let t = o.current;
46
+ if (!t) return;
47
+ let n = getComputedStyle(t).direction === "rtl", r = t.clientWidth * .8 * (e ? 1 : -1) * (n ? -1 : 1), i = !matchMedia("(prefers-reduced-motion: reduce)").matches;
48
+ t.scrollBy({
49
+ left: r,
50
+ behavior: i ? "smooth" : "auto"
51
+ });
52
+ };
53
+ return e ? /* @__PURE__ */ M("div", {
54
+ className: a.scroller(),
55
+ children: [
56
+ s.start && /* @__PURE__ */ j("button", {
57
+ type: "button",
58
+ tabIndex: -1,
59
+ "aria-hidden": "true",
60
+ "data-side": "start",
61
+ className: a.scrollButton(),
62
+ onClick: () => u(!1),
63
+ children: /* @__PURE__ */ j(v, { className: a.scrollIcon() })
64
+ }),
65
+ /* @__PURE__ */ j(F.List, {
66
+ ...i,
67
+ ref: o,
68
+ className: a.list({ class: [a.scrollList(), n] }),
69
+ onScroll: (e) => {
70
+ l(), i.onScroll?.(e);
71
+ },
72
+ children: r
73
+ }),
74
+ s.end && /* @__PURE__ */ j("button", {
75
+ type: "button",
76
+ tabIndex: -1,
77
+ "aria-hidden": "true",
78
+ "data-side": "end",
79
+ className: a.scrollButton(),
80
+ onClick: () => u(!0),
81
+ children: /* @__PURE__ */ j(y, { className: a.scrollIcon() })
82
+ })
83
+ ]
84
+ }) : /* @__PURE__ */ j(F.List, {
85
+ ...i,
86
+ className: a.list({ class: n }),
87
+ children: r
88
+ });
89
+ }
90
+ function H({ classes: e, value: n, icon: r, disabled: i, closable: a = !1, onClose: o, controls: c, className: l, children: u, onKeyDown: d, ref: f, ...p }) {
91
+ let m = t("tabs", g, e)({ closable: a }), h = T(z), _ = k(null), [v, y] = A(!1);
92
+ R(() => {
93
+ let e = _.current;
94
+ y(!!e && e.closest("[role=tablist]")?.querySelector("[role=tab]:not([disabled])") === e);
95
+ });
96
+ let b = /* @__PURE__ */ M(F.Trigger, {
97
+ ...p,
98
+ ref: (e) => {
99
+ if (_.current = e, typeof f == "function") return f(e);
100
+ f && (f.current = e);
101
+ },
102
+ ...c === void 0 ? {} : { "aria-controls": c },
103
+ ...h && v ? { tabIndex: 0 } : {},
104
+ className: m.trigger({ class: l }),
105
+ value: n,
106
+ disabled: i,
107
+ ...a ? {
108
+ "aria-keyshortcuts": "Delete",
109
+ onKeyDown: (e) => {
110
+ d?.(e), !(e.key !== "Delete" || e.defaultPrevented || i) && (e.preventDefault(), s(e.currentTarget, () => o?.(n)));
111
+ }
112
+ } : { onKeyDown: d },
113
+ children: [r && /* @__PURE__ */ j(r, {
114
+ className: m.icon(),
115
+ "aria-hidden": "true"
116
+ }), u]
117
+ });
118
+ return a ? /* @__PURE__ */ M("span", {
119
+ role: "presentation",
120
+ className: m.tab(),
121
+ children: [b, /* @__PURE__ */ j("button", {
122
+ type: "button",
123
+ tabIndex: -1,
124
+ "aria-hidden": "true",
125
+ className: m.close(),
126
+ disabled: i,
127
+ onClick: (e) => {
128
+ let t = e.currentTarget.parentElement?.querySelector("[role=tab]");
129
+ t && s(t, () => o?.(n));
130
+ },
131
+ children: /* @__PURE__ */ j(C, { className: m.closeIcon() })
132
+ })]
133
+ }) : b;
134
+ }
135
+ function U({ classes: e, value: n, className: r, ...i }) {
136
+ let a = t("tabs", g, e)();
137
+ return /* @__PURE__ */ j(F.Content, {
138
+ ...i,
139
+ className: a.content({ class: r }),
140
+ value: n
141
+ });
142
+ }
143
+ //#endregion
144
+ //#region src/components/Dialog/Dialog.tsx
145
+ var W = w({ modal: !0 });
146
+ function G({ open: e, defaultOpen: t, onOpenChange: n, role: r = "dialog", modal: a = !0, closeOnEscape: o = !0, closeOnInteractOutside: s, children: c }) {
147
+ let l = k(null);
148
+ return /* @__PURE__ */ j(W.Provider, {
149
+ value: {
150
+ modal: a,
151
+ contentRef: l
152
+ },
153
+ children: /* @__PURE__ */ j(I.Root, {
154
+ open: e,
155
+ defaultOpen: t,
156
+ onOpenChange: (e) => n?.(e.open),
157
+ role: r,
158
+ modal: a,
159
+ closeOnEscape: o,
160
+ closeOnInteractOutside: s,
161
+ initialFocusEl: () => i(l.current) ?? (r === "alertdialog" ? l.current?.querySelector("[data-part=close-trigger]") : null) ?? null,
162
+ lazyMount: !0,
163
+ unmountOnExit: !0,
164
+ children: c
165
+ })
166
+ });
167
+ }
168
+ function K({ children: e }) {
169
+ return /* @__PURE__ */ j(I.Trigger, {
170
+ asChild: !0,
171
+ children: e
172
+ });
173
+ }
174
+ function q({ children: e }) {
175
+ return /* @__PURE__ */ j(I.CloseTrigger, {
176
+ asChild: !0,
177
+ children: e
178
+ });
179
+ }
180
+ function J(e, t) {
181
+ let [n, r] = A({
182
+ x: 0,
183
+ y: 0
184
+ }), i = k(null), [a, s] = A(t);
185
+ a !== t && (s(t), t || r({
186
+ x: 0,
187
+ y: 0
188
+ }));
189
+ let c = (e, t, n) => {
190
+ let i = t.getBoundingClientRect(), a = {
191
+ x: i.x - n.x,
192
+ y: i.y - n.y,
193
+ width: i.width,
194
+ height: i.height
195
+ };
196
+ r(o(e, a, {
197
+ width: innerWidth,
198
+ height: innerHeight
199
+ }));
200
+ };
201
+ return {
202
+ header: {
203
+ onPointerDown(t) {
204
+ if (!e || t.button !== 0 || t.target.closest("button, a, input")) return;
205
+ let r = t.currentTarget.closest("[data-part=content]");
206
+ r && (i.current = {
207
+ id: t.pointerId,
208
+ x: t.clientX,
209
+ y: t.clientY,
210
+ origin: n,
211
+ content: r
212
+ }, t.currentTarget.setPointerCapture?.(t.pointerId), t.preventDefault());
213
+ },
214
+ onPointerMove(e) {
215
+ let t = i.current;
216
+ t && e.pointerId === t.id && c({
217
+ x: t.origin.x + e.clientX - t.x,
218
+ y: t.origin.y + e.clientY - t.y
219
+ }, t.content, n);
220
+ },
221
+ onPointerUp() {
222
+ i.current = null;
223
+ },
224
+ onPointerCancel() {
225
+ i.current = null;
226
+ }
227
+ },
228
+ onKeyDown: (t) => {
229
+ if (!e) return;
230
+ let r = u(t);
231
+ r && (t.preventDefault(), c({
232
+ x: n.x + r.x,
233
+ y: n.y + r.y
234
+ }, t.currentTarget, n));
235
+ },
236
+ style: e && (n.x || n.y) ? { translate: `${n.x}px ${n.y}px` } : void 0
237
+ };
238
+ }
239
+ function Y({ classes: n, title: r, hideTitle: i, titlePosition: a = "body", description: o, icon: s, status: c, size: u, position: f, fullscreen: p, maximizable: m, maximized: h, defaultMaximized: g, onMaximizedChange: _, draggable: v, closable: y = !0, scrollBehavior: b, responsive: x = !0, closeLabel: S, maximizeLabel: w, restoreLabel: E, footer: D, portalTarget: O, className: k, style: P, onKeyDown: F, children: L, ref: R, ...z }) {
240
+ let B = t("dialog", l, n), V = e(), { modal: H, contentRef: U } = T(W), G = ne(), [K, q] = A(g ?? !1), Y = h ?? K, X = () => {
241
+ q(!Y), _?.(!Y);
242
+ }, Z = J(!!v && !Y && !p, G.open), Q = B({
243
+ status: c,
244
+ size: u,
245
+ position: f,
246
+ scrollBehavior: b,
247
+ fullscreen: p || Y,
248
+ responsive: x,
249
+ draggable: v && !Y,
250
+ maximizable: m,
251
+ hideTitle: i,
252
+ titleInHeader: a === "header"
253
+ }), $ = /* @__PURE__ */ j(I.Title, {
254
+ className: Q.title(),
255
+ children: r
256
+ }), re = Y ? te : ee;
257
+ return /* @__PURE__ */ M(N, {
258
+ ...O ? { container: { current: O } } : {},
259
+ children: [H && /* @__PURE__ */ j(I.Backdrop, { className: Q.backdrop() }), /* @__PURE__ */ j(I.Positioner, {
260
+ className: Q.positioner(),
261
+ children: /* @__PURE__ */ M(I.Content, {
262
+ ...z,
263
+ ref: (e) => {
264
+ if (U && (U.current = e), typeof R == "function") return R(e);
265
+ R && (R.current = e);
266
+ },
267
+ ...v ? { "aria-keyshortcuts": d } : {},
268
+ className: Q.content({ class: k }),
269
+ style: Z.style ? {
270
+ ...P,
271
+ ...Z.style
272
+ } : P,
273
+ onKeyDown: (e) => {
274
+ F?.(e), v && Z.onKeyDown(e);
275
+ },
276
+ children: [
277
+ /* @__PURE__ */ M("div", {
278
+ className: Q.header(),
279
+ ...v ? Z.header : {},
280
+ children: [
281
+ s && /* @__PURE__ */ j("span", {
282
+ className: Q.iconBox(),
283
+ children: /* @__PURE__ */ j(s, {
284
+ className: Q.icon(),
285
+ "aria-hidden": "true"
286
+ })
287
+ }),
288
+ a === "header" && $,
289
+ m && /* @__PURE__ */ j("button", {
290
+ type: "button",
291
+ className: Q.maximize(),
292
+ "aria-label": Y ? E ?? V.dialog.restore : w ?? V.dialog.maximize,
293
+ onClick: X,
294
+ children: /* @__PURE__ */ j(re, {
295
+ className: Q.maximizeIcon(),
296
+ "aria-hidden": "true"
297
+ })
298
+ }),
299
+ y && /* @__PURE__ */ j(I.CloseTrigger, {
300
+ className: Q.close(),
301
+ "aria-label": S ?? V.common.close,
302
+ children: /* @__PURE__ */ j(C, {
303
+ className: Q.closeIcon(),
304
+ "aria-hidden": "true"
305
+ })
306
+ })
307
+ ]
308
+ }),
309
+ /* @__PURE__ */ M("div", {
310
+ className: Q.body(),
311
+ children: [
312
+ a === "body" && $,
313
+ o && /* @__PURE__ */ j(I.Description, {
314
+ className: Q.description(),
315
+ children: o
316
+ }),
317
+ L
318
+ ]
319
+ }),
320
+ D && /* @__PURE__ */ j("div", {
321
+ className: Q.footer(),
322
+ children: D
323
+ })
324
+ ]
325
+ })
326
+ })]
327
+ });
328
+ }
329
+ //#endregion
330
+ //#region src/components/PasswordInput/PasswordInput.tsx
331
+ function X({ classes: i, size: o, invalid: s, success: l, disabled: u, readOnly: d, required: m, name: g, defaultVisible: v, visible: y, onVisibleChange: ee, autoComplete: te = "current-password", strength: C = !1, requirements: w, loading: T = !1, clearable: E = !1, clearLabel: O, mono: N = !1, id: F, className: I, style: ne, ...R }) {
332
+ let z = t("passwordInput", f, i), B = e(), V = P(), H = n(), U = !(s || V?.invalid) && (!!l || H.success), W = z({
333
+ size: o,
334
+ success: U,
335
+ mono: N
336
+ }), G = D(), [K, q] = A(String(R.defaultValue ?? "")), J = R.value === void 0 ? K : String(R.value), Y = p(J), X = J ? B.passwordStrength.levels[Y] : "", Z = a(J, w ?? []), Q = C || w?.length ? [
337
+ V?.ariaDescribedby,
338
+ C && `${G}strength`,
339
+ w?.length && `${G}requirements`
340
+ ].filter(Boolean).join(" ") : void 0, $ = k(null), re = () => {
341
+ let e = $.current?.querySelector("input");
342
+ e && (h(e), e.focus());
343
+ };
344
+ return /* @__PURE__ */ M(L.Root, {
345
+ className: W.base({ class: I }),
346
+ style: ne,
347
+ invalid: s,
348
+ disabled: u,
349
+ readOnly: d,
350
+ required: m,
351
+ name: g,
352
+ defaultVisible: v,
353
+ visible: y,
354
+ onVisibilityChange: (e) => ee?.(e.visible),
355
+ autoComplete: te,
356
+ translations: B.passwordInput,
357
+ ...c(F, "input", { input: V?.ids.control }),
358
+ children: [
359
+ /* @__PURE__ */ M(L.Control, {
360
+ ref: $,
361
+ className: W.control(),
362
+ children: [
363
+ /* @__PURE__ */ j(L.Input, {
364
+ ...R,
365
+ "aria-describedby": Q,
366
+ "aria-busy": T || void 0,
367
+ className: W.input(),
368
+ onChange: (e) => {
369
+ q(e.target.value), R.onChange?.(e);
370
+ }
371
+ }),
372
+ (T || E || U) && /* @__PURE__ */ j(r, {
373
+ loading: T,
374
+ clear: E && !!J && !(u || V?.disabled) && !(d || V?.readOnly),
375
+ clearLabel: O ?? B.field.clear,
376
+ onClear: re,
377
+ success: U,
378
+ classes: {
379
+ spinner: W.spinner(),
380
+ clear: W.clear(),
381
+ clearIcon: W.clearIcon(),
382
+ statusIcon: W.statusIcon()
383
+ }
384
+ }),
385
+ /* @__PURE__ */ j(L.VisibilityTrigger, {
386
+ className: W.toggle(),
387
+ children: /* @__PURE__ */ j(L.Indicator, {
388
+ fallback: /* @__PURE__ */ j(x, {
389
+ className: W.toggleIcon(),
390
+ "aria-hidden": "true"
391
+ }),
392
+ children: /* @__PURE__ */ j(S, {
393
+ className: W.toggleIcon(),
394
+ "aria-hidden": "true"
395
+ })
396
+ })
397
+ })
398
+ ]
399
+ }),
400
+ C && /* @__PURE__ */ M("div", {
401
+ className: W.strength(),
402
+ children: [/* @__PURE__ */ j("div", {
403
+ className: W.meter(),
404
+ "aria-hidden": "true",
405
+ children: [
406
+ 1,
407
+ 2,
408
+ 3,
409
+ 4
410
+ ].map((e) => /* @__PURE__ */ j("span", {
411
+ className: W.bar(),
412
+ "data-level": Y,
413
+ "data-filled": e <= Y || void 0
414
+ }, e))
415
+ }), /* @__PURE__ */ j("span", {
416
+ id: `${G}strength`,
417
+ className: W.strengthText(),
418
+ "aria-live": "polite",
419
+ children: X && B.passwordStrength.label(X)
420
+ })]
421
+ }),
422
+ !!w?.length && /* @__PURE__ */ j("ul", {
423
+ id: `${G}requirements`,
424
+ className: W.requirements(),
425
+ "aria-label": B.passwordRequirements.label,
426
+ children: w.map((e, t) => /* @__PURE__ */ M("li", {
427
+ className: W.requirement(),
428
+ "data-met": Z[t] || void 0,
429
+ children: [
430
+ Z[t] ? /* @__PURE__ */ j(_, {
431
+ className: W.requirementIcon(),
432
+ "aria-hidden": "true"
433
+ }) : /* @__PURE__ */ j(b, {
434
+ className: W.requirementIcon(),
435
+ "aria-hidden": "true"
436
+ }),
437
+ e.label,
438
+ /* @__PURE__ */ j("span", {
439
+ className: W.requirementState(),
440
+ children: `: ${Z[t] ? B.passwordRequirements.met : B.passwordRequirements.unmet}`
441
+ })
442
+ ]
443
+ }, e.label))
444
+ })
445
+ ]
446
+ });
447
+ }
448
+ //#endregion
449
+ export { W as a, U as c, Y as i, V as l, G as n, K as o, q as r, B as s, X as t, H as u };
@@ -61,44 +61,44 @@ function b({ classes: n, size: r, label: i, value: a, className: o, ...s }) {
61
61
  }
62
62
  //#endregion
63
63
  //#region src/components/Select/Select.tsx
64
- function x({ classes: c, items: y, value: b, defaultValue: x, onValueChange: oe, placeholder: se, disabled: ce, invalid: le, required: ue, name: de, itemValue: fe, itemLabel: pe, itemDisabled: me, itemGroup: he, itemKeywords: ge, valueKey: _e, clearable: S, loading: C, loadingText: ve, size: ye, filter: w, manualFilter: T, onFilterChange: E, emptyText: be, hasMore: xe, onLoadMore: Se, dataSource: D, minSearchLength: Ce, pageSize: we, standalone: O, open: k, onOpenChange: Te, stopKeyPropagation: A = !1, renderItem: Ee, renderValue: j, id: De, className: Oe, style: ke, onKeyDown: Ae, ...M }) {
64
+ function x({ classes: c, items: y, value: b, defaultValue: x, onValueChange: S, emptyValue: C, placeholder: oe, disabled: se, invalid: ce, required: le, name: ue, itemValue: de, itemLabel: fe, itemDisabled: pe, itemGroup: me, itemKeywords: he, valueKey: ge, clearable: w, loading: T, loadingText: _e, size: ve, filter: E, manualFilter: D, onFilterChange: O, emptyText: ye, hasMore: be, onLoadMore: xe, dataSource: k, minSearchLength: Se, pageSize: Ce, standalone: we, open: Te, onOpenChange: Ee, stopKeyPropagation: A = !1, renderItem: De, renderValue: j, id: Oe, className: ke, style: Ae, onKeyDown: je, ...M }) {
65
65
  let N = t("select", s, c)({
66
- size: ye,
67
- clearable: S
66
+ size: ve,
67
+ clearable: w
68
68
  }), P = ie(), F = e(), I = F.select, L = {
69
- itemValue: fe,
70
- itemLabel: pe,
71
- itemDisabled: me,
72
- itemGroup: he,
73
- itemKeywords: ge,
74
- valueKey: _e
69
+ itemValue: de,
70
+ itemLabel: fe,
71
+ itemDisabled: pe,
72
+ itemGroup: me,
73
+ itemKeywords: he,
74
+ valueKey: ge
75
75
  }, [R, z] = ne(""), B = r({
76
76
  items: y,
77
- source: D,
77
+ source: k,
78
78
  accessors: L,
79
- pageSize: we,
80
- minSearchLength: Ce
81
- }), { options: V, groups: je, ordered: H, firstFor: Me } = n(B.items, L, w && !T && !D ? R : ""), U = m(() => [...V, ...B.resolvedOptions], [V, B.resolvedOptions]), { selected: W, keys: G, commit: K, commitKeys: Ne } = a({
79
+ pageSize: Ce,
80
+ minSearchLength: Se
81
+ }), { options: V, groups: Me, ordered: H, firstFor: Ne } = n(B.items, L, E && !D && !k ? R : ""), U = m(() => [...V, ...B.resolvedOptions], [V, B.resolvedOptions]), W = (e) => C !== void 0 && e === C ? null : e, { selected: G, keys: K, commit: q, commitKeys: Pe } = a({
82
82
  multiple: !1,
83
- value: b,
84
- defaultValue: x,
83
+ value: W(b),
84
+ defaultValue: W(x),
85
85
  accessors: L,
86
86
  items: U,
87
- onChange: oe,
87
+ onChange: S && ((e) => S(e === null ? C ?? null : e)),
88
88
  check: {
89
89
  component: "Select",
90
- ready: !D && !C && y.length > 0
90
+ ready: !k && !T && y.length > 0
91
91
  }
92
- }), Pe = G.join("\0");
92
+ }), Fe = K.join("\0");
93
93
  p(() => {
94
- B.resolve(G, U);
95
- }, [Pe, D]);
96
- let q = C || B.loading, J = W[0], Y = m(() => ae({
94
+ B.resolve(K, U);
95
+ }, [Fe, k]);
96
+ let J = T || B.loading, Y = G[0], Ie = m(() => ae({
97
97
  items: H,
98
98
  itemToString: (e) => e.label,
99
99
  itemToValue: (e) => e.key,
100
100
  isItemDisabled: (e) => e.disabled
101
- }), [H]), X = ee(), Z = J?.icon, Fe = {
101
+ }), [H]), X = ee(), Z = Y?.icon, Le = {
102
102
  item: N.item(),
103
103
  itemText: N.itemText(),
104
104
  icon: N.icon(),
@@ -113,77 +113,77 @@ function x({ classes: c, items: y, value: b, defaultValue: x, onValueChange: oe,
113
113
  empty: N.empty()
114
114
  }, Q = /* @__PURE__ */ g(i, {
115
115
  parts: v,
116
- groups: je,
117
- classes: Fe,
118
- loading: q,
119
- loadingText: ve ?? F.common.loading,
120
- hasMore: xe || B.hasMore,
121
- onLoadMore: () => D ? B.loadMore() : Se?.(),
122
- emptyText: be ?? B.emptyText ?? (R ? F.common.noResults : F.common.empty),
123
- renderItem: Ee
116
+ groups: Me,
117
+ classes: Le,
118
+ loading: J,
119
+ loadingText: _e ?? F.common.loading,
120
+ hasMore: be || B.hasMore,
121
+ onLoadMore: () => k ? B.loadMore() : xe?.(),
122
+ emptyText: ye ?? B.emptyText ?? (R ? F.common.noResults : F.common.empty),
123
+ renderItem: De
124
124
  });
125
- function Ie(e) {
126
- Ae?.(e), A && e.key === "Enter" && e.stopPropagation(), S && W.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), K([]));
125
+ function Re(e) {
126
+ je?.(e), A && e.key === "Enter" && e.stopPropagation(), w && G.length && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), q([]));
127
127
  }
128
128
  let $ = te(A);
129
129
  p(() => {
130
130
  $.current = A;
131
131
  });
132
- let Le = f((e) => {
132
+ let ze = f((e) => {
133
133
  e?.addEventListener("keydown", (e) => {
134
134
  $.current && e.key === "Escape" && e.stopPropagation();
135
135
  });
136
136
  }, []);
137
- function Re(e, t) {
138
- z(t), E?.(t), D && B.search(t);
139
- let n = T || D ? void 0 : Me(t);
137
+ function Be(e, t) {
138
+ z(t), O?.(t), k && B.search(t);
139
+ let n = D || k ? void 0 : Ne(t);
140
140
  n && requestAnimationFrame(() => e.setHighlightValue(n.key));
141
141
  }
142
142
  return /* @__PURE__ */ _(v.Root, {
143
- className: N.base({ class: Oe }),
144
- style: ke,
145
- collection: Y,
146
- value: G,
147
- onValueChange: (e) => Ne(e.value, e.items),
148
- open: k,
143
+ className: N.base({ class: ke }),
144
+ style: Ae,
145
+ collection: Ie,
146
+ value: K,
147
+ onValueChange: (e) => Pe(e.value, e.items),
148
+ open: Te,
149
149
  onOpenChange: (e) => {
150
- Te?.(e.open), e.open && B.open(), !e.open && R && (z(""), E?.(""), D && B.search(""));
150
+ Ee?.(e.open), e.open && B.open(), !e.open && R && (z(""), O?.(""), k && B.search(""));
151
151
  },
152
- disabled: ce,
153
- invalid: le,
154
- required: ue,
155
- name: de,
156
- ...o(De, "trigger", {
152
+ disabled: se,
153
+ invalid: ce,
154
+ required: le,
155
+ name: ue,
156
+ ...o(Oe, "trigger", {
157
157
  label: P?.ids.label,
158
158
  hiddenSelect: P?.ids.control
159
- }, O),
159
+ }, we),
160
160
  positioning: {
161
161
  sameWidth: !0,
162
162
  gutter: 4
163
163
  },
164
- composite: !w,
164
+ composite: !E,
165
165
  lazyMount: !0,
166
166
  unmountOnExit: !0,
167
167
  children: [
168
168
  /* @__PURE__ */ _(v.Control, {
169
- ...S ? { className: N.control() } : {},
169
+ ...w ? { className: N.control() } : {},
170
170
  children: [/* @__PURE__ */ _(v.Trigger, {
171
171
  ...M,
172
172
  className: N.trigger(),
173
- "aria-busy": C || void 0,
174
- onKeyDown: Ie,
173
+ "aria-busy": T || void 0,
174
+ onKeyDown: Re,
175
175
  children: [/* @__PURE__ */ g("span", {
176
176
  className: N.value(),
177
- children: j && J ? j(J.item) : /* @__PURE__ */ _(h, { children: [Z && /* @__PURE__ */ g(Z, {
177
+ children: j && Y ? j(Y.item) : /* @__PURE__ */ _(h, { children: [Z && /* @__PURE__ */ g(Z, {
178
178
  className: N.icon(),
179
179
  "aria-hidden": "true"
180
180
  }), /* @__PURE__ */ g(v.ValueText, {
181
- placeholder: se ?? F.common.placeholder,
182
- children: J?.label || void 0
181
+ placeholder: oe ?? F.common.placeholder,
182
+ children: Y?.label || void 0
183
183
  })] })
184
184
  }), /* @__PURE__ */ g(v.Indicator, {
185
185
  className: N.indicator(),
186
- children: C ? /* @__PURE__ */ g(u, {
186
+ children: T ? /* @__PURE__ */ g(u, {
187
187
  className: N.spinner(),
188
188
  "aria-hidden": "true"
189
189
  }) : /* @__PURE__ */ g(l, {
@@ -191,13 +191,13 @@ function x({ classes: c, items: y, value: b, defaultValue: x, onValueChange: oe,
191
191
  "aria-hidden": "true"
192
192
  })
193
193
  })]
194
- }), S && /* @__PURE__ */ g(v.Context, { children: (e) => J && !e.disabled && /* @__PURE__ */ g("button", {
194
+ }), w && /* @__PURE__ */ g(v.Context, { children: (e) => Y && !e.disabled && /* @__PURE__ */ g("button", {
195
195
  type: "button",
196
196
  tabIndex: -1,
197
197
  className: N.clear(),
198
198
  "aria-label": I.clear,
199
199
  onClick: () => {
200
- K([]), e.focus();
200
+ q([]), e.focus();
201
201
  },
202
202
  children: /* @__PURE__ */ g(d, {
203
203
  className: N.clearIcon(),
@@ -207,13 +207,13 @@ function x({ classes: c, items: y, value: b, defaultValue: x, onValueChange: oe,
207
207
  }),
208
208
  /* @__PURE__ */ g(re, { children: /* @__PURE__ */ g(v.Positioner, { children: /* @__PURE__ */ g(v.Content, {
209
209
  className: N.content(),
210
- "aria-busy": q || void 0,
211
- "aria-label": w ? M["aria-label"] : void 0,
212
- ref: Le,
210
+ "aria-busy": J || void 0,
211
+ "aria-label": E ? M["aria-label"] : void 0,
212
+ ref: ze,
213
213
  onKeyDown: (e) => {
214
214
  A && (e.key === "Enter" || e.key === "Tab") && e.stopPropagation();
215
215
  },
216
- children: w ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
216
+ children: E ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
217
217
  className: N.header(),
218
218
  children: /* @__PURE__ */ g(v.Context, { children: (e) => /* @__PURE__ */ g("input", {
219
219
  type: "text",
@@ -228,7 +228,7 @@ function x({ classes: c, items: y, value: b, defaultValue: x, onValueChange: oe,
228
228
  placeholder: F.combobox.search,
229
229
  value: R,
230
230
  className: N.search(),
231
- onChange: (t) => Re(e, t.target.value),
231
+ onChange: (t) => Be(e, t.target.value),
232
232
  onKeyDown: (e) => {
233
233
  [
234
234
  " ",
@@ -244,7 +244,7 @@ function x({ classes: c, items: y, value: b, defaultValue: x, onValueChange: oe,
244
244
  })] }) : Q
245
245
  }) }) }),
246
246
  /* @__PURE__ */ g(v.HiddenSelect, {}),
247
- D && /* @__PURE__ */ g("span", {
247
+ k && /* @__PURE__ */ g("span", {
248
248
  role: "status",
249
249
  className: N.status(),
250
250
  children: B.announcement