@wirecore/wirelayer-react 0.7.0 → 0.8.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.
Files changed (47) hide show
  1. package/dist/ContextMenu-C6ZaMtqf.js +1511 -0
  2. package/dist/{Input-C8T3WLd5.js → Input-CtYSQznO.js} +41 -40
  3. package/dist/{PasswordInput-SjO66gZB.js → PasswordInput-dpeKVREo.js} +67 -64
  4. package/dist/Select-C2CiPTCK.js +256 -0
  5. package/dist/components/Alert/Alert.d.ts +3 -1
  6. package/dist/components/Alert/Alert.d.ts.map +1 -1
  7. package/dist/components/Checkbox/Checkbox.d.ts +9 -5
  8. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  9. package/dist/components/Combobox/Combobox.d.ts +10 -1
  10. package/dist/components/Combobox/Combobox.d.ts.map +1 -1
  11. package/dist/components/ContextMenu/ContextMenu.d.ts +12 -3
  12. package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
  13. package/dist/components/Dialog/Dialog.d.ts +6 -1
  14. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  15. package/dist/components/Input/Input.d.ts +7 -2
  16. package/dist/components/Input/Input.d.ts.map +1 -1
  17. package/dist/components/Menu/Menu.d.ts +27 -3
  18. package/dist/components/Menu/Menu.d.ts.map +1 -1
  19. package/dist/components/NativeSelect/NativeSelect.d.ts +9 -6
  20. package/dist/components/NativeSelect/NativeSelect.d.ts.map +1 -1
  21. package/dist/components/NumberInput/NumberInput.d.ts +1 -1
  22. package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
  23. package/dist/components/PasswordInput/PasswordInput.d.ts +7 -2
  24. package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
  25. package/dist/components/Progress/Progress.d.ts +12 -1
  26. package/dist/components/Progress/Progress.d.ts.map +1 -1
  27. package/dist/components/RadioGroup/RadioGroup.d.ts +8 -6
  28. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  29. package/dist/components/RadioGroup/RadioGroupItem.d.ts +3 -2
  30. package/dist/components/RadioGroup/RadioGroupItem.d.ts.map +1 -1
  31. package/dist/components/RadioGroup/context.d.ts +3 -0
  32. package/dist/components/RadioGroup/context.d.ts.map +1 -0
  33. package/dist/components/SegmentedControl/SegmentedControl.d.ts +6 -5
  34. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  35. package/dist/components/Select/Select.d.ts +10 -1
  36. package/dist/components/Select/Select.d.ts.map +1 -1
  37. package/dist/components/Textarea/Textarea.d.ts +7 -2
  38. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  39. package/dist/data-table.js +3 -3
  40. package/dist/form.js +1 -1
  41. package/dist/index.js +803 -751
  42. package/dist/pdf.js +2 -2
  43. package/llms-full.txt +57 -22
  44. package/llms.txt +5 -4
  45. package/package.json +2 -2
  46. package/dist/ContextMenu-BD72S5n6.js +0 -1452
  47. package/dist/Select-7rfeNmJb.js +0 -242
@@ -1,1452 +0,0 @@
1
- "use client";
2
- import { a as e, i as t, n } from "./RecipesProvider-0idafuGm.js";
3
- import { r, t as i } from "./InputStatus-hVzkU_4q.js";
4
- import { t as a } from "./Input-C8T3WLd5.js";
5
- import { t as o } from "./Select-7rfeNmJb.js";
6
- import { t as s } from "./label-for-DYgV5EwH.js";
7
- import { a as c, c as l, n as u, o as d } from "./Highlight-43-H9459.js";
8
- import { SUBMENU_GUTTER as f, allListOptionsState as p, anchorBox as m, controlIds as h, createLongPress as g, datePicker as _, defaultNumberFormat as v, filterMenuEntries as ee, fromWallIso as y, highlightFirstMenuItem as b, indexListOptions as x, insertIntoTextControl as S, isoWeekday as C, linkTarget as w, localeWeekInfo as T, menu as E, menuSearchKey as D, multiSelect as O, numberInput as te, numberInputKey as k, pageForSize as A, pagination as j, parseLocaleNumber as M, parsePastedDate as ne, parsePastedRange as N, pluralText as re, rowWeekNumber as P, setTextControlValue as ie, skeleton as F, textarea as ae, textareaParts as I, timeSlots as oe, timeZoneLabel as se, timeZoneLongLabel as ce, toNumberInputValue as le, toOverlayAnchor as ue, toWallIso as de, todayIso as L, toggleAllListOptions as R, zonedToInstant as fe } from "@wirecore/wirelayer-recipes";
9
- import { CalendarDays as pe, Check as me, ChevronDown as he, ChevronLeft as ge, ChevronRight as z, ChevronUp as B, ChevronsLeft as _e, ChevronsRight as V, Circle as H, LoaderCircle as ve, Minus as ye, Plus as be, X as xe } from "lucide-react";
10
- import { Fragment as Se, createContext as Ce, createElement as U, useContext as we, useEffect as Te, useId as Ee, useImperativeHandle as De, useLayoutEffect as Oe, useMemo as ke, useRef as Ae, useState as W } from "react";
11
- import { useFilter as je } from "@ark-ui/react/locale";
12
- import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
13
- import { Menu as J } from "@ark-ui/react/menu";
14
- import { Portal as Me } from "@ark-ui/react/portal";
15
- import { Field as Y, useFieldContext as Ne } from "@ark-ui/react/field";
16
- import { Pagination as X } from "@ark-ui/react/pagination";
17
- import { createListCollection as Pe } from "@ark-ui/react/collection";
18
- import { Select as Z } from "@ark-ui/react/select";
19
- import { DatePicker as Q, useDatePickerContext as Fe } from "@ark-ui/react/date-picker";
20
- import { DateInput as Ie } from "@ark-ui/react/date-input";
21
- import { CalendarDateTime as Le, DateFormatter as Re, Time as ze, parseDate as Be, parseDateTime as Ve, toCalendarDateTime as He } from "@internationalized/date";
22
- import { NumberInput as $ } from "@ark-ui/react/number-input";
23
- //#region src/overlay.ts
24
- var Ue = (e) => e && "current" in e ? e.current : e ?? null, We = typeof document > "u" ? Te : Oe;
25
- function Ge(e) {
26
- let [t, n] = W(e.defaultOpen ?? !1), [r, i] = W(null), a = e.open ?? t, o = r ?? Ue(e.anchor), s = Ae(null), c = Ae(!1);
27
- c.current = !!o;
28
- let l = Ae(a);
29
- We(() => {
30
- if (l.current !== a) {
31
- if (l.current = a, a) s.current = document.activeElement;
32
- else if (e.restoreFocus) {
33
- let e = s.current, t = () => {
34
- if (l.current) return;
35
- let t = document.activeElement;
36
- (!t || t === document.body || !t.isConnected || t.closest("[data-scope=menu]")) && e?.focus();
37
- };
38
- requestAnimationFrame(() => {
39
- t(), setTimeout(t, 50);
40
- });
41
- }
42
- }
43
- }, [a]);
44
- let u = (t) => {
45
- n(t), e.onOpenChange?.(t);
46
- }, d = (e) => {
47
- e && i(null), u(e);
48
- }, f = {
49
- open(e) {
50
- i(ue(e)), u(!0);
51
- },
52
- close: () => u(!1),
53
- toggle(e) {
54
- a ? f.close() : f.open(e);
55
- }
56
- };
57
- return De(e.ref, () => f), {
58
- isOpen: a,
59
- anchor: o,
60
- anchorPoint: o && !("getBoundingClientRect" in o) ? o : void 0,
61
- onOpenChange: d,
62
- handle: f,
63
- positioning: (e) => o ? "getBoundingClientRect" in o ? {
64
- ...e,
65
- getAnchorElement: () => o
66
- } : {
67
- ...e,
68
- getAnchorRect: () => m(o)
69
- } : e,
70
- finalFocusEl: () => c.current ? s.current : null
71
- };
72
- }
73
- //#endregion
74
- //#region src/components/Menu/Menu.tsx
75
- var Ke = Ce(null);
76
- function qe(e) {
77
- let [t, n] = W({
78
- items: e.items,
79
- checked: {},
80
- radio: {}
81
- }), r = t.items === e.items ? t : {
82
- items: e.items,
83
- checked: {},
84
- radio: {}
85
- };
86
- return r !== t && n(r), {
87
- checked: (e) => r.checked[e.value] ?? e.checked ?? !1,
88
- setChecked: (t, i) => {
89
- n({
90
- ...r,
91
- checked: {
92
- ...r.checked,
93
- [t.value]: i
94
- }
95
- }), e.onCheckedChange?.(t.value, i);
96
- },
97
- radio: (e) => r.radio[e.name] ?? e.value,
98
- setRadio: (t, i) => {
99
- n({
100
- ...r,
101
- radio: {
102
- ...r.radio,
103
- [t.name]: i
104
- }
105
- }), e.onValueChange?.(t.name, i);
106
- },
107
- linkAs: e.linkAs ?? "a",
108
- renderItem: e.renderItem
109
- };
110
- }
111
- function Je({ children: e, ...t }) {
112
- return /* @__PURE__ */ K(Ke.Provider, {
113
- value: qe(t),
114
- children: e
115
- });
116
- }
117
- function Ye({ classes: t, items: r, onSelect: i, onCheckedChange: a, onValueChange: o, linkAs: s, renderItem: c, open: l, defaultOpen: u, onOpenChange: d, anchor: f, searchable: p, searchLabel: m, placement: h = "bottom-start", arrow: g, ref: _, children: v }) {
118
- let y = n("menu", E, t)(), x = e(), S = Ge({
119
- open: l,
120
- defaultOpen: u,
121
- anchor: f,
122
- onOpenChange: d,
123
- ref: _,
124
- restoreFocus: !0
125
- }), [C, w] = W(""), [T, O] = W(), te = je({
126
- sensitivity: "base",
127
- usage: "sort"
128
- }), k = p && C ? ee(r, (e) => te.contains(e, C)) : r, A = Ae(null), [j, M] = W(S.isOpen);
129
- j !== S.isOpen && (M(S.isOpen), w(""), O(void 0)), Te(() => {
130
- if (!S.isOpen || !p) return;
131
- let e = requestAnimationFrame(() => {
132
- e = requestAnimationFrame(() => A.current?.focus());
133
- });
134
- return () => cancelAnimationFrame(e);
135
- }, [S.isOpen, p]);
136
- let ne = m ?? x.menu.search;
137
- return /* @__PURE__ */ K(Je, {
138
- items: r,
139
- linkAs: s,
140
- renderItem: c,
141
- onCheckedChange: a,
142
- onValueChange: o,
143
- children: /* @__PURE__ */ q(J.Root, {
144
- open: S.isOpen,
145
- onOpenChange: (e) => S.onOpenChange(e.open),
146
- positioning: S.positioning({
147
- placement: h,
148
- gutter: g ? 10 : 8
149
- }),
150
- anchorPoint: S.anchorPoint,
151
- lazyMount: !0,
152
- unmountOnExit: !0,
153
- onSelect: (e) => i?.(e.value),
154
- children: [v && /* @__PURE__ */ K(J.Trigger, {
155
- asChild: !0,
156
- children: v
157
- }), /* @__PURE__ */ K(Me, { children: /* @__PURE__ */ K(J.Positioner, { children: /* @__PURE__ */ q(J.Content, {
158
- className: y.content(),
159
- children: [
160
- g && /* @__PURE__ */ K(J.Arrow, {
161
- className: y.arrow(),
162
- children: /* @__PURE__ */ K(J.ArrowTip, { className: y.arrowTip() })
163
- }),
164
- p && /* @__PURE__ */ K(J.Context, { children: (e) => /* @__PURE__ */ K("div", {
165
- role: "group",
166
- "aria-label": ne,
167
- className: y.search(),
168
- children: /* @__PURE__ */ K("input", {
169
- ref: A,
170
- type: "text",
171
- autoComplete: "off",
172
- className: y.searchInput(),
173
- placeholder: ne,
174
- "aria-label": ne,
175
- "aria-activedescendant": T,
176
- onChange: (t) => {
177
- let n = t.currentTarget;
178
- w(n.value), requestAnimationFrame(() => O(b(n, e)));
179
- },
180
- onKeyDown: (t) => {
181
- let n = D(t.nativeEvent, e);
182
- n && O(n);
183
- }
184
- })
185
- }) }),
186
- /* @__PURE__ */ K(Ze, {
187
- entries: k,
188
- onSelect: i
189
- }),
190
- p && !k.length && /* @__PURE__ */ K("div", {
191
- role: "group",
192
- className: y.empty(),
193
- children: /* @__PURE__ */ K("span", {
194
- role: "status",
195
- children: x.common.noResults
196
- })
197
- })
198
- ]
199
- }) }) })]
200
- })
201
- });
202
- }
203
- function Xe({ item: e, shortcut: t }) {
204
- let r = we(Ke), i = n("menu", E)();
205
- if (r?.renderItem) return r.renderItem(e);
206
- let a = e.icon;
207
- return /* @__PURE__ */ q(G, { children: [
208
- a && /* @__PURE__ */ K(a, {
209
- className: i.icon(),
210
- "aria-hidden": "true"
211
- }),
212
- /* @__PURE__ */ K("span", {
213
- className: i.label(),
214
- children: e.label
215
- }),
216
- t && /* @__PURE__ */ K("span", {
217
- className: i.shortcut(),
218
- "aria-hidden": "true",
219
- children: t
220
- })
221
- ] });
222
- }
223
- function Ze({ entries: e, onSelect: t }) {
224
- let r = n("menu", E), i = r(), a = we(Ke);
225
- return e.map((e, n) => {
226
- if ("type" in e) return e.type === "separator" ? /* @__PURE__ */ K(J.Separator, { className: i.separator() }, `separator-${n}`) : e.type === "checkbox" ? /* @__PURE__ */ q(J.CheckboxItem, {
227
- value: e.value,
228
- checked: a?.checked(e) ?? !!e.checked,
229
- onCheckedChange: (t) => a?.setChecked(e, t),
230
- disabled: e.disabled,
231
- closeOnSelect: e.closeOnSelect ?? !1,
232
- className: i.item(),
233
- children: [/* @__PURE__ */ K("span", {
234
- className: i.indicator(),
235
- children: /* @__PURE__ */ K(J.ItemIndicator, { children: /* @__PURE__ */ K(me, {
236
- className: i.indicatorIcon(),
237
- "aria-hidden": "true"
238
- }) })
239
- }), /* @__PURE__ */ K(Xe, { item: e })]
240
- }, e.value) : e.type === "radio" ? /* @__PURE__ */ q(J.RadioItemGroup, {
241
- value: a?.radio(e),
242
- onValueChange: (t) => a?.setRadio(e, t.value),
243
- children: [e.label && /* @__PURE__ */ K(J.ItemGroupLabel, {
244
- className: i.groupLabel(),
245
- children: e.label
246
- }), e.items.map((e) => /* @__PURE__ */ q(J.RadioItem, {
247
- value: e.value,
248
- disabled: e.disabled,
249
- closeOnSelect: e.closeOnSelect ?? !1,
250
- className: i.item(),
251
- children: [/* @__PURE__ */ K("span", {
252
- className: i.indicator(),
253
- children: /* @__PURE__ */ K(J.ItemIndicator, { children: /* @__PURE__ */ K(H, {
254
- className: i.indicatorDot(),
255
- "aria-hidden": "true"
256
- }) })
257
- }), /* @__PURE__ */ K(Xe, { item: e })]
258
- }, e.value))]
259
- }, `radio-${e.name}`) : /* @__PURE__ */ q(J.ItemGroup, { children: [/* @__PURE__ */ K(J.ItemGroupLabel, {
260
- className: i.groupLabel(),
261
- children: e.label
262
- }), /* @__PURE__ */ K(Ze, {
263
- entries: e.items,
264
- onSelect: t
265
- })] }, `group-${n}`);
266
- let o = e.icon;
267
- if (e.children) return /* @__PURE__ */ q(J.Root, {
268
- positioning: {
269
- placement: "right-start",
270
- offset: { mainAxis: f }
271
- },
272
- onSelect: (e) => t?.(e.value),
273
- children: [/* @__PURE__ */ q(J.TriggerItem, {
274
- className: i.item(),
275
- children: [
276
- o && /* @__PURE__ */ K(o, {
277
- className: i.icon(),
278
- "aria-hidden": "true"
279
- }),
280
- /* @__PURE__ */ K("span", {
281
- className: i.label(),
282
- children: e.label
283
- }),
284
- /* @__PURE__ */ K(z, {
285
- className: i.submenuIcon(),
286
- "aria-hidden": "true"
287
- })
288
- ]
289
- }), /* @__PURE__ */ K(Me, { children: /* @__PURE__ */ K(J.Positioner, { children: /* @__PURE__ */ K(J.Content, {
290
- className: i.content(),
291
- children: /* @__PURE__ */ K(Ze, {
292
- entries: e.children,
293
- onSelect: t
294
- })
295
- }) }) })]
296
- }, e.value);
297
- if (e.href || e.to) {
298
- let t = a?.linkAs ?? "a";
299
- return /* @__PURE__ */ K(J.Item, {
300
- value: e.value,
301
- disabled: e.disabled,
302
- closeOnSelect: e.closeOnSelect,
303
- asChild: !0,
304
- children: /* @__PURE__ */ K(t, {
305
- ...w(e.href, e.to),
306
- className: r({ danger: e.danger }).item(),
307
- children: /* @__PURE__ */ K(Xe, {
308
- item: e,
309
- shortcut: e.shortcut
310
- })
311
- })
312
- }, e.value);
313
- }
314
- return /* @__PURE__ */ K(Se, { children: /* @__PURE__ */ K(J.Item, {
315
- value: e.value,
316
- disabled: e.disabled,
317
- closeOnSelect: e.closeOnSelect,
318
- className: r({ danger: e.danger }).item(),
319
- children: /* @__PURE__ */ K(Xe, {
320
- item: e,
321
- shortcut: e.shortcut
322
- })
323
- }) }, e.value);
324
- });
325
- }
326
- //#endregion
327
- //#region src/components/Textarea/Textarea.tsx
328
- function Qe({ classes: t, size: a, invalid: o = !1, success: s = !1, disabled: c = !1, autoResize: l = !1, minRows: u, maxRows: d, showCount: f = !1, loading: p = !1, clearable: m = !1, clearLabel: h, className: g, style: _, onInput: v, onChange: ee, ...y }) {
329
- let b = n("textarea", ae, t), x = n("textareaParts", I, t), S = e(), C = Ne(), w = r(), T = o || !!C?.invalid, E = !T && (s || w.success), D = c || !!C?.disabled, O = !!y.readOnly || !!C?.readOnly, te = Ae(null), k = y.maxLength && y.maxLength > 0 ? y.maxLength : void 0, A = f && k !== void 0, j = p || m || E, M = A || p || m, [ne, N] = W(() => String(y.defaultValue ?? "").length), re = y.value === void 0 ? ne : String(y.value ?? "").length, P = () => {
330
- let e = te.current;
331
- if (!l || !e) return;
332
- e.style.height = "auto";
333
- let t = e.offsetHeight - e.clientHeight, n = e.scrollHeight + t;
334
- if (u || d) {
335
- let r = getComputedStyle(e), i = parseFloat(r.lineHeight) || parseFloat(r.fontSize) * 1.5, a = parseFloat(r.paddingTop) + parseFloat(r.paddingBottom) + t, o = d ? d * i + a : Infinity;
336
- e.style.overflowY = n > o ? "auto" : "", n = Math.min(Math.max(n, u ? u * i + a : 0), o);
337
- }
338
- e.style.height = `${n}px`;
339
- };
340
- Oe(P);
341
- let F = Ee(), [oe, se] = W(""), ce = Ae(void 0);
342
- Te(() => () => clearTimeout(ce.current), []);
343
- let le = (e) => {
344
- A && (clearTimeout(ce.current), ce.current = setTimeout(() => se(S.textarea.remaining(k - e, k)), 1e3));
345
- }, ue = () => {
346
- let e = te.current;
347
- e && (ie(e), e.focus());
348
- }, de = /* @__PURE__ */ K(Y.Textarea, {
349
- ...y,
350
- ref: te,
351
- rows: y.rows ?? u,
352
- className: b({
353
- size: a,
354
- invalid: T,
355
- success: E,
356
- disabled: D,
357
- autoResize: l,
358
- hasTrailing: M ? j : void 0,
359
- class: M ? void 0 : g
360
- }),
361
- style: M ? void 0 : _,
362
- disabled: D || void 0,
363
- "aria-invalid": T || void 0,
364
- ...M ? {
365
- "aria-describedby": [
366
- C?.ariaDescribedby,
367
- A && F,
368
- y["aria-describedby"]
369
- ].filter(Boolean).join(" ") || void 0,
370
- "aria-busy": p || void 0
371
- } : {},
372
- onInput: (e) => {
373
- P(), v?.(e);
374
- },
375
- onChange: (e) => {
376
- N(e.currentTarget.value.length), le(e.currentTarget.value.length), ee?.(e);
377
- }
378
- });
379
- if (!M) return de;
380
- let L = x();
381
- return /* @__PURE__ */ q("div", {
382
- className: L.base({ class: g }),
383
- style: _,
384
- children: [
385
- de,
386
- j && /* @__PURE__ */ K("div", {
387
- className: L.trailing(),
388
- children: /* @__PURE__ */ K(i, {
389
- loading: p,
390
- clear: m && re > 0 && !D && !O,
391
- clearLabel: h ?? S.field.clear,
392
- onClear: ue,
393
- success: E,
394
- classes: {
395
- spinner: L.spinner(),
396
- clear: L.clear(),
397
- clearIcon: L.clearIcon(),
398
- statusIcon: L.statusIcon()
399
- }
400
- })
401
- }),
402
- A && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("span", {
403
- id: F,
404
- className: L.counter(),
405
- "aria-hidden": "true",
406
- children: S.textarea.counter(re, k)
407
- }), /* @__PURE__ */ K("span", {
408
- className: L.status(),
409
- role: "status",
410
- children: oe
411
- })] })
412
- ]
413
- });
414
- }
415
- //#endregion
416
- //#region src/components/Pagination/Pagination.tsx
417
- function $e({ classes: t, count: r, pageSize: i = 10, onPageSizeChange: s, page: c, defaultPage: l, onPageChange: u, siblingCount: d = 1, boundaryCount: f, showSummary: p = !0, summary: m, pageSizes: h, jumper: g, variant: _ = "full", withEdges: v, hideSinglePage: ee, getPageHref: y, translations: b, className: x, ...S }) {
418
- let C = n("pagination", j, t)({ responsive: _ === "auto" }), w = e(), [T, E] = W(i), [D, O] = W(i);
419
- D !== i && (O(i), E(i));
420
- let te = (e) => ({
421
- start: Math.min((e - 1) * T + 1, r),
422
- end: Math.min(e * T, r),
423
- count: r
424
- });
425
- if (ee && r <= T) return null;
426
- let k = y ? "a" : "button", M = (e, t, n = !1) => U(k, {
427
- className: e,
428
- ...y && n ? {
429
- role: "link",
430
- "aria-disabled": "true"
431
- } : {}
432
- }, t), ne = (e, t) => {
433
- if (!t || t === T) return;
434
- let n = A(e.page, T, t);
435
- E(t), s?.(t), requestAnimationFrame(() => e.setPage(n));
436
- }, N = (e, t) => {
437
- if (e.key !== "Enter") return;
438
- let n = e.currentTarget, r = Number.parseInt(n.value, 10);
439
- Number.isNaN(r) || (e.preventDefault(), t.setPage(Math.min(Math.max(r, 1), t.totalPages)), n.value = "");
440
- };
441
- return /* @__PURE__ */ K(X.Root, {
442
- ...S,
443
- className: C.base({ class: x }),
444
- count: r,
445
- pageSize: T,
446
- page: c,
447
- defaultPage: l,
448
- onPageChange: (e) => u?.(e.page),
449
- siblingCount: d,
450
- boundaryCount: f,
451
- type: y ? "link" : "button",
452
- getPageUrl: y ? (e) => y(e.page) : void 0,
453
- translations: {
454
- ...w.pagination,
455
- ...b
456
- },
457
- children: /* @__PURE__ */ K(X.Context, { children: (e) => /* @__PURE__ */ q(G, { children: [
458
- p && /* @__PURE__ */ K("span", {
459
- className: C.summary(),
460
- "aria-live": "polite",
461
- children: (m ?? w.pagination.summary)(te(e.page))
462
- }),
463
- !!h?.length && /* @__PURE__ */ q("div", {
464
- className: C.pageSize(),
465
- children: [/* @__PURE__ */ K("span", {
466
- "aria-hidden": "true",
467
- children: w.pagination.pageSize
468
- }), /* @__PURE__ */ K(o, {
469
- className: C.pageSizeSelect(),
470
- size: "sm",
471
- items: h.map((e) => ({
472
- value: e,
473
- label: String(e)
474
- })),
475
- value: T,
476
- "aria-label": w.pagination.pageSize,
477
- onValueChange: (t) => ne(e, t)
478
- })]
479
- }),
480
- /* @__PURE__ */ q("div", {
481
- className: C.list(),
482
- children: [
483
- v && /* @__PURE__ */ K(X.FirstTrigger, {
484
- asChild: !0,
485
- children: M(C.trigger(), /* @__PURE__ */ K(_e, {
486
- className: C.triggerIcon(),
487
- "aria-hidden": "true"
488
- }), e.page === 1)
489
- }),
490
- /* @__PURE__ */ K(X.PrevTrigger, {
491
- asChild: !0,
492
- children: M(C.trigger(), /* @__PURE__ */ K(ge, {
493
- className: C.triggerIcon(),
494
- "aria-hidden": "true"
495
- }), e.page === 1)
496
- }),
497
- _ !== "full" && /* @__PURE__ */ K("span", {
498
- className: C.compact(),
499
- children: w.pagination.compact(e.page, e.totalPages)
500
- }),
501
- _ !== "compact" && e.pages.map((e, t) => e.type === "page" ? /* @__PURE__ */ K(X.Item, {
502
- ...e,
503
- asChild: !0,
504
- children: M(C.item(), e.value)
505
- }, t) : /* @__PURE__ */ K(X.Ellipsis, {
506
- index: t,
507
- className: C.ellipsis(),
508
- "aria-hidden": "true",
509
- children: "…"
510
- }, t)),
511
- /* @__PURE__ */ K(X.NextTrigger, {
512
- asChild: !0,
513
- children: M(C.trigger(), /* @__PURE__ */ K(z, {
514
- className: C.triggerIcon(),
515
- "aria-hidden": "true"
516
- }), e.page === e.totalPages)
517
- }),
518
- v && /* @__PURE__ */ K(X.LastTrigger, {
519
- asChild: !0,
520
- children: M(C.trigger(), /* @__PURE__ */ K(V, {
521
- className: C.triggerIcon(),
522
- "aria-hidden": "true"
523
- }), e.page === e.totalPages)
524
- })
525
- ]
526
- }),
527
- g && /* @__PURE__ */ q("div", {
528
- className: C.jumper(),
529
- children: [/* @__PURE__ */ K("span", {
530
- "aria-hidden": "true",
531
- children: w.pagination.jumper
532
- }), /* @__PURE__ */ K(a, {
533
- className: C.jumperInput(),
534
- size: "sm",
535
- inputMode: "numeric",
536
- autoComplete: "off",
537
- "aria-label": w.pagination.jumper,
538
- onKeyDown: (t) => N(t, e)
539
- })]
540
- })
541
- ] }) })
542
- });
543
- }
544
- //#endregion
545
- //#region src/components/Skeleton/Skeleton.tsx
546
- function et({ classes: e, shape: t, width: r, height: i, className: a, style: o, ...s }) {
547
- let c = n("skeleton", F, e);
548
- return /* @__PURE__ */ K("span", {
549
- "aria-hidden": "true",
550
- ...s,
551
- className: c({
552
- shape: t,
553
- class: a
554
- }),
555
- style: {
556
- width: r,
557
- height: i,
558
- ...o
559
- }
560
- });
561
- }
562
- //#endregion
563
- //#region src/components/DatePicker/dates.ts
564
- var tt = (e, t) => e ? e.toString().slice(0, t ? 16 : 10) : null;
565
- function nt(e, t, n) {
566
- return t ? e.includes("T") ? Ve(e.slice(0, 16)) : Ve(`${e}T${n === "max" ? "23:59" : "00:00"}`) : Be(e.slice(0, 10));
567
- }
568
- function rt(e, t, n, r) {
569
- let i = typeof e == "string" && !e.includes("T"), a = de(e, t && !i, n);
570
- return a ? nt(a, t, r) : void 0;
571
- }
572
- var it = (e, t, n, r) => y(tt(e, t), {
573
- valueType: n,
574
- timeZone: r,
575
- withTime: t
576
- }), at = (e, t, n) => de(e, t, n);
577
- function ot(e, t) {
578
- if (!e && !t?.length) return;
579
- let n = new Set(t?.map((e) => de(e, !1)));
580
- return (t) => {
581
- let r = tt(t, !1);
582
- return n.has(r) || !!e?.(r);
583
- };
584
- }
585
- function st(e, t) {
586
- if ("hour" in e) return e;
587
- let n = t && "hour" in t ? new ze(t.hour, t.minute) : new ze();
588
- return He(e, n);
589
- }
590
- var ct = {
591
- year: 2e3,
592
- month: 1,
593
- day: 1
594
- };
595
- function lt(e) {
596
- let [t = 0, n = 0, r = 0] = e.split(":").map(Number);
597
- return new Le(ct.year, ct.month, ct.day, t, n, r);
598
- }
599
- var ut = (e) => String(e).padStart(2, "0"), dt = (e, t = !1) => e && "hour" in e ? `${ut(e.hour)}:${ut(e.minute)}${t ? `:${ut(e.second)}` : ""}` : null, ft = (e, t, n, r = !1) => oe(e, t, n, r);
600
- //#endregion
601
- //#region src/components/DatePicker/DatePickerBase.tsx
602
- function pt({ mode: t, dates: r, onChange: i, withTime: a, min: o, max: s, isDateUnavailable: c, locale: l, disabled: u, readOnly: d, invalid: f, required: p, name: m, label: h, ownId: g, placeholder: v, className: ee, style: y, period: b, classes: x, presets: S, size: C, hideClear: w, firstDayOfWeek: E, timeZone: D, showTimeZone: O, responsive: te, ...k }) {
603
- let A = n("datePicker", _, x)({ size: C }), j = e(), M = Ee(), P = Ne(), ie = {
604
- disabled: u ?? P?.disabled,
605
- readOnly: d ?? P?.readOnly,
606
- invalid: f ?? P?.invalid,
607
- required: p ?? P?.required
608
- }, F = t === "range", ae = t === "multiple", I = F ? [0, 1] : [0], oe = [j.dateRange.start, j.dateRange.end], le = P || g ? {
609
- ...P ? { label: (e) => F ? `${P.ids.label} ${M}r${e}` : P.ids.label } : {},
610
- ...g ? { segmentGroup: (e) => e === 0 ? g : void 0 } : {}
611
- } : void 0, ue = (e) => P ? void 0 : F ? [h, oe[e]].filter(Boolean).join(", ") : h, de = F ? {
612
- ...j.datePicker,
613
- clearTrigger: j.dateRange.clearTrigger
614
- } : j.datePicker, L = b ? new Re(l, b === "month" ? {
615
- month: "2-digit",
616
- year: "numeric"
617
- } : { year: "numeric" }) : void 0, R = E ?? T(l).firstDay, me;
618
- if (O && D) {
619
- let e = r[0], t = e ? fe(e.toString().slice(0, 16), D) : /* @__PURE__ */ new Date();
620
- me = {
621
- short: se(D, l, t),
622
- long: j.calendar.timeZone(ce(D, l, t))
623
- };
624
- }
625
- let he = [P?.ariaDescribedby, me ? `${M}tz` : void 0].filter(Boolean).join(" ") || void 0, ge = (e) => I.every((t) => e.getSegments({ index: t }).every((e) => e.type === "literal" || e.isPlaceholder)), z = (e) => !!v && ge(e) && !e.focused, B = (e) => v && ge(e) ? [he, `${M}ph`].filter(Boolean).join(" ") : he, _e = (e) => i(a ? e.map((e, t) => st(e, r[t])) : e), V = (e, t) => {
626
- if (b) return !1;
627
- if (F) {
628
- let t = N(e, l, a);
629
- if (t) return i([nt(t.start, a), nt(t.end, a)]), !0;
630
- }
631
- let n = ne(e, l, a);
632
- if (!n) return !1;
633
- let o = [...r];
634
- return o[t] = nt(n, a), i(o.filter(Boolean)), !0;
635
- }, H = r.length ? r.length > 3 ? re(j.calendar.datesSelected, r.length, l) : r.map((e) => new Re(l, {
636
- day: "2-digit",
637
- month: "2-digit",
638
- year: "numeric",
639
- timeZone: "UTC"
640
- }).format(e.toDate("UTC"))).join(", ") : v ?? j.calendar.noDates;
641
- return /* @__PURE__ */ q(Q.Root, {
642
- className: A.base({ class: ee }),
643
- style: y,
644
- value: r,
645
- onValueChange: (e) => _e(e.value),
646
- selectionMode: t,
647
- min: o,
648
- max: s,
649
- isDateUnavailable: c,
650
- locale: l,
651
- startOfWeek: R,
652
- minView: b,
653
- defaultView: b,
654
- numOfMonths: k.numberOfMonths,
655
- timeZone: D,
656
- ...ie,
657
- positioning: {
658
- placement: "bottom-start",
659
- gutter: 4
660
- },
661
- translations: de,
662
- lazyMount: !0,
663
- unmountOnExit: !0,
664
- children: [/* @__PURE__ */ q(Q.Control, {
665
- className: A.control(),
666
- children: [
667
- ae ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("span", {
668
- id: `${M}v`,
669
- className: A.multiValue(),
670
- "data-placeholder": r.length ? void 0 : "",
671
- children: H
672
- }), m && r.map((e, t) => /* @__PURE__ */ K("input", {
673
- type: "hidden",
674
- name: `${m}[${t}]`,
675
- value: e.toString()
676
- }, e.toString()))] }) : /* @__PURE__ */ q(Ie.Root, {
677
- className: A.dateInput(),
678
- ids: le,
679
- value: r,
680
- onValueChange: (e) => i(e.value),
681
- selectionMode: F ? "range" : "single",
682
- granularity: a ? "minute" : "day",
683
- formatter: L,
684
- min: o,
685
- max: s,
686
- isDateUnavailable: c,
687
- locale: l,
688
- shouldForceLeadingZeros: !0,
689
- name: m,
690
- ...ie,
691
- translations: j.dateInput,
692
- children: [/* @__PURE__ */ K(Ie.Context, { children: (e) => /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(Ie.Control, {
693
- className: A.dateControl(),
694
- "data-placeholder-shown": z(e) || void 0,
695
- children: I.map((t) => /* @__PURE__ */ q(Se, { children: [
696
- t === 1 && /* @__PURE__ */ K("span", {
697
- className: A.rangeSeparator(),
698
- "aria-hidden": "true",
699
- children: "–"
700
- }),
701
- F && P && /* @__PURE__ */ K("span", {
702
- id: `${M}r${t}`,
703
- className: A.rangeLabel(),
704
- children: oe[t]
705
- }),
706
- /* @__PURE__ */ K(mt, {
707
- index: t,
708
- label: ue(t),
709
- describedby: B(e),
710
- paste: b ? void 0 : V,
711
- size: C
712
- })
713
- ] }, t))
714
- }), v && ge(e) && /* @__PURE__ */ K("span", {
715
- id: `${M}ph`,
716
- className: A.placeholder(),
717
- "data-hidden": z(e) ? void 0 : "",
718
- onClick: () => e.focus(),
719
- children: v
720
- })] }) }), I.map((e) => /* @__PURE__ */ K(Ie.HiddenInput, { index: e }, e))]
721
- }),
722
- me && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("span", {
723
- className: A.timeZone(),
724
- "aria-hidden": "true",
725
- children: me.short
726
- }), /* @__PURE__ */ K("span", {
727
- id: `${M}tz`,
728
- hidden: !0,
729
- children: me.long
730
- })] }),
731
- !w && /* @__PURE__ */ K(Q.ClearTrigger, {
732
- className: A.clear(),
733
- children: /* @__PURE__ */ K(xe, {
734
- className: A.clearIcon(),
735
- "aria-hidden": "true"
736
- })
737
- }),
738
- /* @__PURE__ */ K(Q.Trigger, {
739
- className: A.trigger(),
740
- ...ae ? { "aria-describedby": `${M}v` } : {},
741
- children: /* @__PURE__ */ K(pe, {
742
- className: A.triggerIcon(),
743
- "aria-hidden": "true"
744
- })
745
- })
746
- ]
747
- }), /* @__PURE__ */ K(gt, {
748
- presets: S,
749
- responsive: te,
750
- timeZone: D,
751
- ...k
752
- })]
753
- });
754
- }
755
- function mt({ index: t, label: r, describedby: i, paste: a, size: o }) {
756
- let s = n("datePicker", _)({ size: o }), c = e();
757
- return /* @__PURE__ */ K(Ie.SegmentGroup, {
758
- index: t,
759
- className: s.segments(),
760
- "aria-label": r,
761
- "aria-describedby": i,
762
- ...a ? { onPasteCapture: (e) => {
763
- a?.(e.clipboardData.getData("text/plain"), t) && (e.preventDefault(), e.stopPropagation());
764
- } } : {},
765
- children: /* @__PURE__ */ K(Ie.Context, { children: (e) => e.getSegments({ index: t }).map((e, t) => /* @__PURE__ */ K(Ie.Segment, {
766
- segment: e,
767
- className: s.segment(),
768
- "aria-label": c.dateSegments[e.type]
769
- }, t)) })
770
- });
771
- }
772
- function ht(e) {
773
- let [t, n] = W(!1);
774
- return Te(() => {
775
- if (!e || typeof window.matchMedia != "function") return;
776
- let t = window.matchMedia("(max-width: 639.98px)"), r = () => n(t.matches);
777
- return r(), t.addEventListener("change", r), () => t.removeEventListener("change", r);
778
- }, [e]), t;
779
- }
780
- function gt({ presets: e, responsive: t, ...r }) {
781
- let i = n("datePicker", _), a = i(), o = ht(t), s = (r.numberOfMonths ?? 1) > 1;
782
- return o ? /* @__PURE__ */ q(Me, { children: [/* @__PURE__ */ K(Q.Context, { children: (e) => e.open ? /* @__PURE__ */ K("div", {
783
- className: a.backdrop(),
784
- "aria-hidden": "true"
785
- }) : null }), /* @__PURE__ */ K("div", {
786
- className: a.sheet(),
787
- children: /* @__PURE__ */ K(Q.Content, {
788
- className: i({
789
- multiMonth: s,
790
- bottomSheet: !0
791
- }).content(),
792
- children: /* @__PURE__ */ K(vt, {
793
- presets: e,
794
- ...r
795
- })
796
- })
797
- })] }) : /* @__PURE__ */ K(Me, { children: /* @__PURE__ */ K(Q.Positioner, { children: /* @__PURE__ */ K(Q.Content, {
798
- className: s ? i({ multiMonth: s }).content() : a.content(),
799
- children: /* @__PURE__ */ K(vt, {
800
- presets: e,
801
- ...r
802
- })
803
- }) }) });
804
- }
805
- var _t = (e, t) => typeof e == "string" ? t.rangePresets[e] ?? e : e.label;
806
- function vt({ presets: t, showWeekNumbers: r, numberOfMonths: i, showButtonBar: a, plainToday: o, hideOutsideDays: s, weekendDays: c, allowDeselect: l, timeZone: u, renderDay: d }) {
807
- let f = n("datePicker", _)(), p = e(), m = Math.max(1, Math.floor(i ?? 1)), h = {
808
- showWeekNumbers: r,
809
- plainToday: o,
810
- hideOutsideDays: s || m > 1,
811
- weekendDays: c,
812
- allowDeselect: l,
813
- renderDay: d
814
- }, g = (e) => Array.from({ length: m }, (t, n) => {
815
- let r = e.getOffset({ months: n }), i = e.visibleRange.start.add({ months: n });
816
- return {
817
- title: r.visibleRangeText.start,
818
- weeks: r.weeks,
819
- visibleRange: {
820
- start: i,
821
- end: i.add({ months: 1 }).subtract({ days: 1 })
822
- }
823
- };
824
- }), v = (e) => {
825
- if (e.selectionMode === "single") return e.selectToday();
826
- let [t = 0, n = 1, r = 1] = L(u).split("-").map(Number);
827
- e.setFocusedValue(e.focusedValue.set({
828
- year: t,
829
- month: n,
830
- day: r
831
- }));
832
- };
833
- return /* @__PURE__ */ q(G, { children: [
834
- /* @__PURE__ */ K(Q.View, {
835
- view: "day",
836
- children: /* @__PURE__ */ K(Q.Context, { children: (e) => /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(Ct, {}), m > 1 ? /* @__PURE__ */ K("div", {
837
- className: f.months(),
838
- children: g(e).map((e) => /* @__PURE__ */ q("div", {
839
- className: f.month(),
840
- children: [/* @__PURE__ */ K("div", {
841
- className: f.monthTitle(),
842
- children: e.title
843
- }), /* @__PURE__ */ K(bt, {
844
- weeks: e.weeks,
845
- visibleRange: e.visibleRange,
846
- ...h
847
- })]
848
- }, e.title))
849
- }) : /* @__PURE__ */ K(bt, {
850
- weeks: e.weeks,
851
- ...h
852
- })] }) })
853
- }),
854
- /* @__PURE__ */ K(Q.View, {
855
- view: "month",
856
- children: /* @__PURE__ */ K(Q.Context, { children: (e) => /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(Ct, {}), /* @__PURE__ */ K(Q.Table, {
857
- className: f.table(),
858
- children: /* @__PURE__ */ K(Q.TableBody, { children: e.getMonthsGrid({
859
- columns: 4,
860
- format: "short"
861
- }).map((e) => /* @__PURE__ */ K(Q.TableRow, { children: e.map((e) => /* @__PURE__ */ K(Q.TableCell, {
862
- value: e.value,
863
- className: f.cell(),
864
- children: /* @__PURE__ */ K(Q.TableCellTrigger, {
865
- className: f.period(),
866
- children: e.label
867
- })
868
- }, e.value)) }, e[0]?.value)) })
869
- })] }) })
870
- }),
871
- /* @__PURE__ */ K(Q.View, {
872
- view: "year",
873
- children: /* @__PURE__ */ K(Q.Context, { children: (e) => /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(Ct, {}), /* @__PURE__ */ K(Q.Table, {
874
- className: f.table(),
875
- children: /* @__PURE__ */ K(Q.TableBody, { children: e.getYearsGrid({ columns: 4 }).map((e) => /* @__PURE__ */ K(Q.TableRow, { children: e.map((e) => /* @__PURE__ */ K(Q.TableCell, {
876
- value: e.value,
877
- className: f.cell(),
878
- children: /* @__PURE__ */ K(Q.TableCellTrigger, {
879
- className: f.period(),
880
- children: e.label
881
- })
882
- }, e.value)) }, e[0]?.value)) })
883
- })] }) })
884
- }),
885
- t?.length ? /* @__PURE__ */ K("div", {
886
- className: f.presets(),
887
- children: t.map((e) => /* @__PURE__ */ K(Q.PresetTrigger, {
888
- value: typeof e == "string" ? e : e.value,
889
- className: f.preset(),
890
- "aria-label": _t(e, p),
891
- children: _t(e, p)
892
- }, _t(e, p)))
893
- }) : null,
894
- a && /* @__PURE__ */ K(Q.Context, { children: (e) => /* @__PURE__ */ q("div", {
895
- className: f.buttonBar(),
896
- children: [/* @__PURE__ */ K("button", {
897
- type: "button",
898
- className: f.buttonBarButton(),
899
- onClick: () => v(e),
900
- children: p.calendar.today
901
- }), /* @__PURE__ */ K("button", {
902
- type: "button",
903
- className: f.buttonBarButton(),
904
- disabled: !e.value.length,
905
- onClick: () => e.clearValue({ focus: !1 }),
906
- children: p.calendar.clear
907
- })]
908
- }) })
909
- ] });
910
- }
911
- var yt = (e) => e.toString().slice(0, 10);
912
- function bt({ weeks: t, visibleRange: r, showWeekNumbers: i, plainToday: a, hideOutsideDays: o, weekendDays: s, allowDeselect: c, renderDay: l }) {
913
- let u = n("datePicker", _)({
914
- plainToday: a,
915
- hideOutsideDays: o
916
- }), d = e(), f = Fe(), p = (e) => P(e.map(yt)), m = (e) => !!r && (e.month !== r.start.month || e.year !== r.start.year), h = (e) => {
917
- let t = f.getDayTableCellState({
918
- value: e,
919
- visibleRange: r
920
- });
921
- return {
922
- day: e.day,
923
- today: t.today,
924
- selected: t.selected,
925
- outside: t.outsideRange,
926
- unavailable: t.unavailable || !!t.disabled,
927
- weekend: s ? s.includes(C(yt(e))) : t.weekend
928
- };
929
- }, g = (e, t) => {
930
- "key" in e && e.key !== "Enter" && e.key !== " " || f.selectionMode === "single" && f.getDayTableCellState({
931
- value: t,
932
- visibleRange: r
933
- }).selected && (e.preventDefault(), f.clearValue({ focus: !1 }));
934
- }, v = (e) => ({
935
- ...s?.includes(C(yt(e))) ? { "data-weekend": "" } : {},
936
- ...c ? {
937
- onClickCapture: (t) => g(t, e),
938
- onKeyDownCapture: (t) => g(t, e)
939
- } : {}
940
- });
941
- return /* @__PURE__ */ q(Q.Table, {
942
- className: u.table(),
943
- children: [/* @__PURE__ */ K(Q.TableHead, { children: /* @__PURE__ */ q(Q.TableRow, { children: [i && /* @__PURE__ */ K("th", {
944
- scope: "col",
945
- className: u.weekNumberHeader(),
946
- children: /* @__PURE__ */ K("abbr", {
947
- title: d.datePicker.weekColumnHeader,
948
- children: d.datePicker.weekColumnShort
949
- })
950
- }), f.weekDays.map((e) => /* @__PURE__ */ K(Q.TableHeader, {
951
- className: u.columnHeader(),
952
- children: /* @__PURE__ */ K("abbr", {
953
- title: e.long,
954
- children: e.short
955
- })
956
- }, e.long))] }) }), /* @__PURE__ */ K(Q.TableBody, { children: t.map((e) => /* @__PURE__ */ q(Q.TableRow, { children: [i && /* @__PURE__ */ K("th", {
957
- scope: "row",
958
- className: u.weekNumber(),
959
- "aria-label": d.datePicker.weekNumberCell(p(e)),
960
- children: p(e)
961
- }), e.map((e) => m(e) ? /* @__PURE__ */ K("td", { className: u.cell() }, e.toString()) : /* @__PURE__ */ K(Q.TableCell, {
962
- value: e,
963
- visibleRange: r,
964
- className: u.cell(),
965
- ...v(e),
966
- children: /* @__PURE__ */ K(Q.TableCellTrigger, {
967
- className: u.day(),
968
- children: l ? /* @__PURE__ */ K("span", {
969
- className: u.dayContent(),
970
- children: l(yt(e), h(e))
971
- }) : e.day
972
- })
973
- }, e.toString()))] }, e[0]?.toString())) })]
974
- });
975
- }
976
- var xt = {
977
- day: "month",
978
- month: "year",
979
- year: void 0
980
- }, St = (e, t, n) => `${e}, ${n.datePicker.viewTrigger(t, xt[t])}`;
981
- function Ct() {
982
- let t = n("datePicker", _)(), r = e();
983
- return /* @__PURE__ */ q(Q.ViewControl, {
984
- className: t.header(),
985
- children: [
986
- /* @__PURE__ */ K(Q.PrevTrigger, {
987
- className: t.nav(),
988
- children: /* @__PURE__ */ K(ge, {
989
- className: t.navIcon(),
990
- "aria-hidden": "true"
991
- })
992
- }),
993
- /* @__PURE__ */ K(Q.Context, { children: (e) => /* @__PURE__ */ K(Q.ViewTrigger, {
994
- className: t.viewTrigger(),
995
- "aria-label": St(e.numOfMonths > 1 && e.view === "day" ? e.visibleRangeText.formatted : e.visibleRangeText.start, e.view, r),
996
- children: /* @__PURE__ */ K(Q.RangeText, {})
997
- }) }),
998
- /* @__PURE__ */ K(Q.NextTrigger, {
999
- className: t.nav(),
1000
- children: /* @__PURE__ */ K(z, {
1001
- className: t.navIcon(),
1002
- "aria-hidden": "true"
1003
- })
1004
- })
1005
- ]
1006
- });
1007
- }
1008
- //#endregion
1009
- //#region src/components/DatePicker/DatePicker.tsx
1010
- function wt({ value: e, defaultValue: n, onValueChange: r, selectionMode: i = "single", valueType: a = "string", withTime: o = !1, min: c, max: l, isDateUnavailable: u, excludeDates: d, locale: f, "aria-label": p, id: m, clearable: h = !0, highlightToday: g = !0, ..._ }) {
1011
- s("DatePicker", m);
1012
- let v = t(), ee = f ?? v.locale, [y, b] = W(n ?? null), x = e === void 0 ? y : e, S = Array.isArray(x) ? x : x ? [x] : [], C = _.timeZone, w = (e) => e.map((e) => at(e, o, C)).join(), T = (e) => {
1013
- let t = e.map((e) => it(e, o, a, C));
1014
- if (w(t) === w(S)) return;
1015
- let n = i === "multiple" ? t : t[0] ?? null;
1016
- b(n), r?.(n);
1017
- };
1018
- return /* @__PURE__ */ K(pt, {
1019
- ..._,
1020
- mode: i,
1021
- dates: S.map((e) => rt(e, o, C)).filter((e) => !!e),
1022
- onChange: T,
1023
- withTime: o,
1024
- min: rt(c, o, C, "min"),
1025
- max: rt(l, o, C, "max"),
1026
- isDateUnavailable: ot(u, d),
1027
- locale: ee,
1028
- label: p,
1029
- ownId: m,
1030
- hideClear: !h,
1031
- plainToday: !g
1032
- });
1033
- }
1034
- //#endregion
1035
- //#region src/components/MultiSelect/MultiSelect.tsx
1036
- function Tt({ classes: t, items: r, value: i, defaultValue: a, onValueChange: o, placeholder: s, summary: f, maxShown: m = 2, disabled: g, invalid: _, required: v, name: ee, itemValue: y, itemLabel: b, itemDisabled: S, itemGroup: C, itemKeywords: w, valueKey: T, display: E = "text", checkboxes: D = !0, selectAll: te, max: k, clearable: A, loading: j, loadingText: M, size: ne, filter: N, manualFilter: re, onFilterChange: P, emptyText: ie, hasMore: F, onLoadMore: ae, dataSource: I, minSearchLength: oe, pageSize: se, renderItem: ce, renderValue: le, id: ue, className: de, style: L, onKeyDown: fe, ...pe }) {
1037
- let ge = n("multiSelect", O, t), z = E === "chips", B = ge({
1038
- size: ne,
1039
- clearable: A && !z
1040
- }), _e = Ne(), V = e(), H = V.select, be = {
1041
- itemValue: y,
1042
- itemLabel: b,
1043
- itemDisabled: S,
1044
- itemGroup: C,
1045
- itemKeywords: w,
1046
- valueKey: T
1047
- }, [Se, Ce] = W(""), U = l({
1048
- items: r,
1049
- source: I,
1050
- accessors: be,
1051
- pageSize: se,
1052
- minSearchLength: oe
1053
- }), { options: we, visible: De, groups: Oe, ordered: Ae, firstFor: je } = c(U.items, be, N && !re && !I ? Se : ""), J = ke(() => [...we, ...U.resolvedOptions], [we, U.resolvedOptions]), { selected: Y, keys: X, commit: Q } = d({
1054
- multiple: !0,
1055
- value: i,
1056
- defaultValue: a,
1057
- accessors: be,
1058
- items: J,
1059
- onChange: o,
1060
- check: {
1061
- component: "MultiSelect",
1062
- ready: !I && !j && r.length > 0
1063
- }
1064
- }), Fe = X.join("\0");
1065
- Te(() => {
1066
- U.resolve(X, J);
1067
- }, [Fe, I]);
1068
- let Ie = j || U.loading, Le = k !== void 0 && Y.length >= k, Re = X.join("\n"), ze = ke(() => {
1069
- let e = new Set(Re.split("\n"));
1070
- return Pe({
1071
- items: Ae,
1072
- itemToString: (e) => e.label,
1073
- itemToValue: (e) => e.key,
1074
- isItemDisabled: (t) => t.disabled || Le && !e.has(t.key)
1075
- });
1076
- }, [
1077
- Ae,
1078
- Le,
1079
- Re
1080
- ]), Be = N || te, Ve = Ee(), He = De.filter((e) => !e.disabled), $ = p(Y, He), [Ue, We] = W("");
1081
- function Ge(e) {
1082
- let t = k !== void 0 && e.length >= k && Y.length < k;
1083
- Q(e), t && We(H.maxReached(k));
1084
- }
1085
- function Ke(e) {
1086
- Q(Y.filter((t) => t.key !== e.key)), We(H.removed(e.label));
1087
- }
1088
- function qe(e) {
1089
- fe?.(e);
1090
- let t = Y.at(-1);
1091
- t && (z && e.key === "Backspace" ? (e.preventDefault(), Ke(t)) : A && (e.key === "Delete" || e.key === "Backspace") && (e.preventDefault(), Q([])));
1092
- }
1093
- function Je(e, t) {
1094
- Ce(t), P?.(t), I && U.search(t);
1095
- let n = re || I ? void 0 : je(t);
1096
- n && requestAnimationFrame(() => e.setHighlightValue(n.key));
1097
- }
1098
- let Ye = {
1099
- item: B.item(),
1100
- itemText: B.itemText(),
1101
- icon: B.icon(),
1102
- itemIndicator: B.itemIndicator(),
1103
- itemBody: B.itemBody(),
1104
- itemDescription: B.itemDescription(),
1105
- group: B.group(),
1106
- groupLabel: B.groupLabel(),
1107
- loading: B.loading(),
1108
- loadingIcon: B.loadingIcon(),
1109
- sentinel: B.sentinel(),
1110
- empty: B.empty(),
1111
- check: B.check(),
1112
- checkIcon: B.checkIcon()
1113
- }, Xe = /* @__PURE__ */ K(u, {
1114
- parts: Z,
1115
- groups: Oe,
1116
- classes: Ye,
1117
- checkbox: D,
1118
- loading: Ie,
1119
- loadingText: M ?? V.common.loading,
1120
- hasMore: F || U.hasMore,
1121
- onLoadMore: () => I ? U.loadMore() : ae?.(),
1122
- emptyText: ie ?? U.emptyText ?? (Se ? V.common.noResults : V.common.empty),
1123
- renderItem: ce
1124
- }), Ze = Y.length ? Y.length > m ? (f ?? V.common.selectedCount)(Y.length) : Y.map((e) => e.label).join(", ") : s ?? V.common.placeholder;
1125
- return /* @__PURE__ */ q(Z.Root, {
1126
- className: B.base({ class: de }),
1127
- style: L,
1128
- collection: ze,
1129
- multiple: !0,
1130
- closeOnSelect: !1,
1131
- value: X,
1132
- onValueChange: (e) => {
1133
- let t = x(J, e.items, Y);
1134
- Ge(e.value.map((e) => t.get(e)).filter((e) => e !== void 0));
1135
- },
1136
- onOpenChange: (e) => {
1137
- e.open && U.open(), !e.open && Se && (Ce(""), P?.(""), I && U.search(""));
1138
- },
1139
- disabled: g,
1140
- invalid: _,
1141
- required: v,
1142
- name: ee,
1143
- positioning: {
1144
- sameWidth: !0,
1145
- gutter: 4
1146
- },
1147
- composite: !Be,
1148
- ...h(ue, "trigger", {
1149
- label: _e?.ids.label,
1150
- hiddenSelect: _e?.ids.control
1151
- }),
1152
- lazyMount: !0,
1153
- unmountOnExit: !0,
1154
- children: [
1155
- /* @__PURE__ */ K(Z.Context, { children: (e) => /* @__PURE__ */ q(Z.Control, {
1156
- ...z || A ? { className: z ? B.chipsControl() : B.control() } : {},
1157
- children: [
1158
- z && Y.map((t) => /* @__PURE__ */ q("span", {
1159
- className: B.chip(),
1160
- children: [/* @__PURE__ */ K("span", {
1161
- className: B.chipText(),
1162
- children: t.label
1163
- }), !e.disabled && /* @__PURE__ */ K("button", {
1164
- type: "button",
1165
- tabIndex: -1,
1166
- className: B.chipRemove(),
1167
- "aria-label": H.removeItem(t.label),
1168
- onClick: () => Ke(t),
1169
- children: /* @__PURE__ */ K(xe, {
1170
- className: B.chipRemoveIcon(),
1171
- "aria-hidden": "true"
1172
- })
1173
- })]
1174
- }, t.key)),
1175
- /* @__PURE__ */ q(Z.Trigger, {
1176
- ...pe,
1177
- className: z ? B.chipsTrigger() : B.trigger(),
1178
- "aria-busy": j || void 0,
1179
- onKeyDown: qe,
1180
- children: [/* @__PURE__ */ K("span", {
1181
- className: B.value(),
1182
- "data-placeholder-shown": !Y.length || void 0,
1183
- children: z ? Y.length ? /* @__PURE__ */ K("span", {
1184
- className: B.hiddenValue(),
1185
- children: Y.map((e) => e.label).join(", ")
1186
- }) : s ?? V.common.placeholder : le && Y.length ? le(Y.map((e) => e.item)) : Ze
1187
- }), /* @__PURE__ */ K(Z.Indicator, {
1188
- className: B.indicator(),
1189
- children: j ? /* @__PURE__ */ K(ve, {
1190
- className: B.spinner(),
1191
- "aria-hidden": "true"
1192
- }) : /* @__PURE__ */ K(he, {
1193
- className: B.indicatorIcon(),
1194
- "aria-hidden": "true"
1195
- })
1196
- })]
1197
- }),
1198
- A && Y.length > 0 && !e.disabled && /* @__PURE__ */ K("button", {
1199
- type: "button",
1200
- tabIndex: -1,
1201
- className: z ? B.chipsClear() : B.clear(),
1202
- "aria-label": H.clear,
1203
- onClick: () => {
1204
- Q([]), e.focus();
1205
- },
1206
- children: /* @__PURE__ */ K(xe, {
1207
- className: B.clearIcon(),
1208
- "aria-hidden": "true"
1209
- })
1210
- })
1211
- ]
1212
- }) }),
1213
- (z || k !== void 0 || I) && /* @__PURE__ */ K("span", {
1214
- role: "status",
1215
- className: B.status(),
1216
- children: Ue || U.announcement
1217
- }),
1218
- /* @__PURE__ */ K(Me, { children: /* @__PURE__ */ K(Z.Positioner, { children: /* @__PURE__ */ K(Z.Content, {
1219
- className: B.content(),
1220
- "aria-busy": Ie || void 0,
1221
- "aria-label": Be ? pe["aria-label"] : void 0,
1222
- children: Be ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ q("div", {
1223
- className: B.header(),
1224
- children: [N && /* @__PURE__ */ K(Z.Context, { children: (e) => /* @__PURE__ */ K("input", {
1225
- type: "text",
1226
- role: "combobox",
1227
- autoComplete: "off",
1228
- "aria-autocomplete": "list",
1229
- "aria-expanded": "true",
1230
- "data-autofocus": "",
1231
- "aria-controls": Ve,
1232
- "aria-activedescendant": e.highlightedItem ? e.getItemProps({ item: e.highlightedItem }).id : void 0,
1233
- "aria-label": H.filter,
1234
- placeholder: V.combobox.search,
1235
- value: Se,
1236
- className: B.search(),
1237
- onChange: (t) => Je(e, t.target.value),
1238
- onKeyDown: (e) => {
1239
- [
1240
- " ",
1241
- "Home",
1242
- "End"
1243
- ].includes(e.key) && e.stopPropagation();
1244
- }
1245
- }) }), te && He.length > 0 && /* @__PURE__ */ q("button", {
1246
- type: "button",
1247
- role: "checkbox",
1248
- "aria-checked": $,
1249
- className: B.selectAll(),
1250
- onClick: () => Ge(R(Y, De, k)),
1251
- onKeyDown: (e) => {
1252
- (e.key === " " || e.key === "Enter") && e.stopPropagation();
1253
- },
1254
- children: [/* @__PURE__ */ K("span", {
1255
- className: B.check(),
1256
- "data-state": $ === "mixed" ? "indeterminate" : $ ? "checked" : "unchecked",
1257
- "aria-hidden": "true",
1258
- children: $ === "mixed" ? /* @__PURE__ */ K(ye, { className: B.checkIcon() }) : $ && /* @__PURE__ */ K(me, { className: B.checkIcon() })
1259
- }), H.selectAll]
1260
- })]
1261
- }), /* @__PURE__ */ K(Z.List, {
1262
- id: Ve,
1263
- className: B.list(),
1264
- "data-autofocus": N ? void 0 : "",
1265
- children: Xe
1266
- })] }) : Xe
1267
- }) }) }),
1268
- /* @__PURE__ */ K(Z.HiddenSelect, {})
1269
- ]
1270
- });
1271
- }
1272
- //#endregion
1273
- //#region src/components/NumberInput/NumberInput.tsx
1274
- function Et({ classes: a, value: o, defaultValue: s, onValueChange: c, min: l, max: u, step: d, formatOptions: f = v, locale: p, size: m, invalid: g, success: _, disabled: ee, readOnly: y, required: b, name: x, stepper: C = !0, stepperLayout: w = "inline", prefix: T, suffix: E, allowNegative: D = !0, allowDecimal: O = !0, decimals: A, clampBehavior: j = "blur", selectOnFocus: ne = !1, loading: N = !1, clearable: re = !1, clearLabel: P, id: F, className: ae, style: I, onKeyDown: oe, onPaste: se, onFocus: ce, ...ue }) {
1275
- let de = n("numberInput", te, a), L = t(), R = p ?? L.locale, fe = e(), pe = Ne(), me = r(), ge = !(g || pe?.invalid) && (!!_ || me.success), z = de({
1276
- size: m,
1277
- stacked: w === "stacked",
1278
- success: ge
1279
- }), _e = A === void 0 ? O ? f : {
1280
- ...f,
1281
- maximumFractionDigits: 0
1282
- } : {
1283
- ...f,
1284
- minimumFractionDigits: A,
1285
- maximumFractionDigits: A
1286
- }, V = D ? l : Math.max(l ?? 0, 0), [H, ve] = W(null), xe = o === void 0 ? void 0 : H && H.number === o ? H.text : le(o, R, _e), Se = xe ?? H?.text ?? le(s, R, _e) ?? "", Ce = Ee(), U = Ee(), we = T || E ? [
1287
- pe?.ariaDescribedby,
1288
- T && Ce,
1289
- E && U,
1290
- ue["aria-describedby"]
1291
- ].filter(Boolean).join(" ") : void 0, Te = Ae(null), De = () => {
1292
- let e = Te.current?.querySelector("input");
1293
- e && (ie(e), e.focus());
1294
- }, Oe = !!ee || !!y || !!pe?.disabled || !!pe?.readOnly;
1295
- return /* @__PURE__ */ K($.Root, {
1296
- className: z.base({ class: ae }),
1297
- style: I,
1298
- value: xe,
1299
- defaultValue: le(s, R, _e),
1300
- ...h(F, "input", {
1301
- label: pe?.ids.label,
1302
- input: pe?.ids.control
1303
- }),
1304
- onValueChange: (e) => {
1305
- let t = Number.isNaN(e.valueAsNumber) ? null : e.valueAsNumber;
1306
- ve({
1307
- text: e.value,
1308
- number: t
1309
- }), c?.(t);
1310
- },
1311
- min: V,
1312
- max: u,
1313
- step: d,
1314
- formatOptions: _e,
1315
- locale: R,
1316
- invalid: g,
1317
- disabled: ee,
1318
- readOnly: y,
1319
- required: b,
1320
- name: x,
1321
- clampValueOnBlur: j !== "none",
1322
- allowOverflow: j !== "strict",
1323
- translations: fe.numberInput,
1324
- children: /* @__PURE__ */ q($.Control, {
1325
- ref: Te,
1326
- className: z.control(),
1327
- children: [
1328
- T && /* @__PURE__ */ K("span", {
1329
- id: Ce,
1330
- className: z.prefix(),
1331
- children: T
1332
- }),
1333
- /* @__PURE__ */ K($.Input, {
1334
- ...ue,
1335
- ...we ? { "aria-describedby": we } : {},
1336
- className: z.input(),
1337
- "aria-busy": N || void 0,
1338
- onKeyDown: (e) => {
1339
- if (oe?.(e), e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey) return;
1340
- let t = e.currentTarget, n = t.selectionStart ?? t.value.length, r = t.value.slice(0, n) + t.value.slice(t.selectionEnd ?? n), i = k(e.key, r, R, {
1341
- allowDecimal: O && A !== 0,
1342
- allowNegative: D
1343
- });
1344
- i && (e.preventDefault(), i !== "block" && S(t, i.insert));
1345
- },
1346
- onPaste: (e) => {
1347
- se?.(e);
1348
- let t = e.currentTarget, n = (t.selectionStart ?? 0) === 0 && (t.selectionEnd ?? 0) === t.value.length, r = M(e.clipboardData.getData("text"), R);
1349
- !e.defaultPrevented && n && r !== null && (e.preventDefault(), ie(t, le(r, R, _e)));
1350
- },
1351
- onFocus: (e) => {
1352
- ce?.(e);
1353
- let t = e.currentTarget;
1354
- ne && requestAnimationFrame(() => t.select());
1355
- }
1356
- }),
1357
- (N || re || ge) && /* @__PURE__ */ K(i, {
1358
- loading: N,
1359
- clear: re && !!Se && !Oe,
1360
- clearLabel: P ?? fe.field.clear,
1361
- onClear: De,
1362
- success: ge,
1363
- classes: {
1364
- spinner: z.spinner(),
1365
- clear: z.clear(),
1366
- clearIcon: z.clearIcon(),
1367
- statusIcon: z.statusIcon()
1368
- }
1369
- }),
1370
- E && /* @__PURE__ */ K("span", {
1371
- id: U,
1372
- className: z.suffix(),
1373
- children: E
1374
- }),
1375
- C && w === "stacked" ? /* @__PURE__ */ q("div", {
1376
- className: z.stepper(),
1377
- children: [/* @__PURE__ */ K($.IncrementTrigger, {
1378
- className: z.button(),
1379
- children: /* @__PURE__ */ K(B, {
1380
- className: z.buttonIcon(),
1381
- "aria-hidden": "true"
1382
- })
1383
- }), /* @__PURE__ */ K($.DecrementTrigger, {
1384
- className: z.button(),
1385
- children: /* @__PURE__ */ K(he, {
1386
- className: z.buttonIcon(),
1387
- "aria-hidden": "true"
1388
- })
1389
- })]
1390
- }) : C && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K($.DecrementTrigger, {
1391
- className: z.button(),
1392
- children: /* @__PURE__ */ K(ye, {
1393
- className: z.buttonIcon(),
1394
- "aria-hidden": "true"
1395
- })
1396
- }), /* @__PURE__ */ K($.IncrementTrigger, {
1397
- className: z.button(),
1398
- children: /* @__PURE__ */ K(be, {
1399
- className: z.buttonIcon(),
1400
- "aria-hidden": "true"
1401
- })
1402
- })] })
1403
- ]
1404
- })
1405
- });
1406
- }
1407
- //#endregion
1408
- //#region src/components/ContextMenu/ContextMenu.tsx
1409
- function Dt({ classes: e, items: t, label: r, onSelect: i, onCheckedChange: a, onValueChange: o, linkAs: s, renderItem: c, ref: l, children: u }) {
1410
- let d = n("menu", E, e)(), f = Ge({
1411
- open: void 0,
1412
- anchor: void 0,
1413
- ref: l,
1414
- restoreFocus: !0
1415
- }), [p] = W(() => g((e) => f.handle.open(e)));
1416
- return Te(() => p.cancel, [p]), /* @__PURE__ */ K(Je, {
1417
- items: t,
1418
- linkAs: s,
1419
- renderItem: c,
1420
- onCheckedChange: a,
1421
- onValueChange: o,
1422
- children: /* @__PURE__ */ q(J.Root, {
1423
- open: f.isOpen,
1424
- onOpenChange: (e) => f.onOpenChange(e.open),
1425
- positioning: f.positioning({}),
1426
- anchorPoint: f.anchorPoint,
1427
- lazyMount: !0,
1428
- unmountOnExit: !0,
1429
- onSelect: (e) => i?.(e.value),
1430
- children: [/* @__PURE__ */ K(J.ContextTrigger, {
1431
- asChild: !0,
1432
- onPointerDown: (e) => p.down(e),
1433
- onPointerMove: (e) => p.move(e),
1434
- onPointerUp: () => p.cancel(),
1435
- onPointerCancel: () => p.cancel(),
1436
- children: u
1437
- }), /* @__PURE__ */ K(Me, { children: /* @__PURE__ */ K(J.Positioner, { children: /* @__PURE__ */ K(J.Content, {
1438
- className: d.content(),
1439
- ...r ? {
1440
- "aria-label": r,
1441
- "aria-labelledby": void 0
1442
- } : {},
1443
- children: /* @__PURE__ */ K(Ze, {
1444
- entries: t,
1445
- onSelect: i
1446
- })
1447
- }) }) })]
1448
- })
1449
- });
1450
- }
1451
- //#endregion
1452
- export { Ge as S, $e as _, vt as a, Ze as b, rt as c, ft as d, it as f, et as g, at as h, wt as i, nt as l, ot as m, Et as n, pt as o, dt as p, Tt as r, mt as s, Dt as t, lt as u, Qe as v, Je as x, Ye as y };