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