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