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