@wirecore/wirelayer-react 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/ContextMenu-C6ZaMtqf.js +1511 -0
  2. package/dist/{Input-C8T3WLd5.js → Input-CtYSQznO.js} +41 -40
  3. package/dist/{PasswordInput-SjO66gZB.js → PasswordInput-dpeKVREo.js} +67 -64
  4. package/dist/Select-C2CiPTCK.js +256 -0
  5. package/dist/components/Alert/Alert.d.ts +3 -1
  6. package/dist/components/Alert/Alert.d.ts.map +1 -1
  7. package/dist/components/Checkbox/Checkbox.d.ts +9 -5
  8. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  9. package/dist/components/Combobox/Combobox.d.ts +10 -1
  10. package/dist/components/Combobox/Combobox.d.ts.map +1 -1
  11. package/dist/components/ContextMenu/ContextMenu.d.ts +12 -3
  12. package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
  13. package/dist/components/Dialog/Dialog.d.ts +6 -1
  14. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  15. package/dist/components/Input/Input.d.ts +7 -2
  16. package/dist/components/Input/Input.d.ts.map +1 -1
  17. package/dist/components/Menu/Menu.d.ts +27 -3
  18. package/dist/components/Menu/Menu.d.ts.map +1 -1
  19. package/dist/components/NativeSelect/NativeSelect.d.ts +9 -6
  20. package/dist/components/NativeSelect/NativeSelect.d.ts.map +1 -1
  21. package/dist/components/NumberInput/NumberInput.d.ts +1 -1
  22. package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
  23. package/dist/components/PasswordInput/PasswordInput.d.ts +7 -2
  24. package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
  25. package/dist/components/Progress/Progress.d.ts +12 -1
  26. package/dist/components/Progress/Progress.d.ts.map +1 -1
  27. package/dist/components/RadioGroup/RadioGroup.d.ts +8 -6
  28. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  29. package/dist/components/RadioGroup/RadioGroupItem.d.ts +3 -2
  30. package/dist/components/RadioGroup/RadioGroupItem.d.ts.map +1 -1
  31. package/dist/components/RadioGroup/context.d.ts +3 -0
  32. package/dist/components/RadioGroup/context.d.ts.map +1 -0
  33. package/dist/components/SegmentedControl/SegmentedControl.d.ts +6 -5
  34. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  35. package/dist/components/Select/Select.d.ts +10 -1
  36. package/dist/components/Select/Select.d.ts.map +1 -1
  37. package/dist/components/Textarea/Textarea.d.ts +7 -2
  38. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  39. package/dist/data-table.js +3 -3
  40. package/dist/form.js +1 -1
  41. package/dist/index.js +803 -751
  42. package/dist/pdf.js +2 -2
  43. package/llms-full.txt +57 -22
  44. package/llms.txt +5 -4
  45. package/package.json +2 -2
  46. package/dist/ContextMenu-BD72S5n6.js +0 -1452
  47. package/dist/Select-7rfeNmJb.js +0 -242
@@ -46,70 +46,71 @@ function y({ classes: e, icon: n, iconProps: r, label: s, variant: c, color: u,
46
46
  }
47
47
  //#endregion
48
48
  //#region src/components/Input/Input.tsx
49
- function b({ classes: i, size: a, invalid: o = !1, success: l = !1, loading: d = !1, clearable: y = !1, clearLabel: b, disabled: x = !1, leadingIcon: S, prefix: C, suffix: w, className: T, style: E, onChange: D, ...O }) {
50
- let k = t("input", s, i), A = e(), j = v(), M = n(), N = o || !!j?.invalid, P = !N && (l || M.success), F = x || !!j?.disabled, I = !!O.readOnly || !!j?.readOnly, L = k({
49
+ function b({ classes: i, size: a, invalid: o = !1, success: l = !1, loading: d = !1, clearable: y = !1, clearLabel: b, disabled: x = !1, leadingIcon: S, prefix: C, suffix: w, mono: T = !1, className: E, style: D, onChange: O, ...k }) {
50
+ let A = t("input", s, i), j = e(), M = v(), N = n(), P = o || !!M?.invalid, F = !P && (l || N.success), I = x || !!M?.disabled, L = !!k.readOnly || !!M?.readOnly, R = A({
51
51
  size: a,
52
- invalid: N,
53
- success: P,
54
- disabled: F,
52
+ invalid: P,
53
+ success: F,
54
+ disabled: I,
55
55
  hasIcon: !!S,
56
- hasStatusIcon: N || P || d || y
57
- }), [R, z] = m(() => String(O.defaultValue ?? "") !== ""), B = O.value === void 0 ? R : String(O.value ?? "") !== "", V = p(null), H = () => {
58
- let e = V.current?.querySelector("input");
56
+ hasStatusIcon: P || F || d || y,
57
+ mono: T
58
+ }), [z, B] = m(() => String(k.defaultValue ?? "") !== ""), V = k.value === void 0 ? z : String(k.value ?? "") !== "", H = p(null), U = () => {
59
+ let e = H.current?.querySelector("input");
59
60
  e && (c(e), e.focus());
60
- }, U = f(), W = f(), G = [
61
- j?.ariaDescribedby,
62
- C && U,
63
- w && W,
64
- O["aria-describedby"]
61
+ }, W = f(), G = f(), K = [
62
+ M?.ariaDescribedby,
63
+ C && W,
64
+ w && G,
65
+ k["aria-describedby"]
65
66
  ].filter(Boolean).join(" ") || void 0;
66
67
  return /* @__PURE__ */ g("div", {
67
- ref: V,
68
- className: L.base({ class: T }),
69
- style: E,
70
- "data-invalid": N || void 0,
71
- "data-disabled": F || void 0,
68
+ ref: H,
69
+ className: R.base({ class: E }),
70
+ style: D,
71
+ "data-invalid": P || void 0,
72
+ "data-disabled": I || void 0,
72
73
  children: [
73
74
  C && /* @__PURE__ */ h("span", {
74
- id: U,
75
- className: L.prefix(),
75
+ id: W,
76
+ className: R.prefix(),
76
77
  children: C
77
78
  }),
78
79
  S && /* @__PURE__ */ h(S, {
79
- className: L.icon(),
80
+ className: R.icon(),
80
81
  "aria-hidden": "true"
81
82
  }),
82
83
  /* @__PURE__ */ h(_.Input, {
83
- ...O,
84
- className: L.control(),
85
- disabled: F || void 0,
86
- "aria-invalid": N || void 0,
87
- "aria-describedby": G,
84
+ ...k,
85
+ className: R.control(),
86
+ disabled: I || void 0,
87
+ "aria-invalid": P || void 0,
88
+ "aria-describedby": K,
88
89
  "aria-busy": d || void 0,
89
90
  onChange: (e) => {
90
- z(e.currentTarget.value !== ""), D?.(e);
91
+ B(e.currentTarget.value !== ""), O?.(e);
91
92
  }
92
93
  }),
93
- (d || y || P) && /* @__PURE__ */ h(r, {
94
+ (d || y || F) && /* @__PURE__ */ h(r, {
94
95
  loading: d,
95
- clear: y && B && !F && !I,
96
- clearLabel: b ?? A.field.clear,
97
- onClear: H,
98
- success: P,
96
+ clear: y && V && !I && !L,
97
+ clearLabel: b ?? j.field.clear,
98
+ onClear: U,
99
+ success: F,
99
100
  classes: {
100
- spinner: L.spinner(),
101
- clear: L.clear(),
102
- clearIcon: L.clearIcon(),
103
- statusIcon: L.statusIcon()
101
+ spinner: R.spinner(),
102
+ clear: R.clear(),
103
+ clearIcon: R.clearIcon(),
104
+ statusIcon: R.statusIcon()
104
105
  }
105
106
  }),
106
- N && /* @__PURE__ */ h(u, {
107
- className: L.statusIcon(),
107
+ P && /* @__PURE__ */ h(u, {
108
+ className: R.statusIcon(),
108
109
  "aria-hidden": "true"
109
110
  }),
110
111
  w && /* @__PURE__ */ h("span", {
111
- id: W,
112
- className: L.suffix(),
112
+ id: G,
113
+ className: R.suffix(),
113
114
  children: w
114
115
  })
115
116
  ]
@@ -8,10 +8,10 @@ import { jsx as j, jsxs as M } from "react/jsx-runtime";
8
8
  import { Portal as N } from "@ark-ui/react/portal";
9
9
  import { useFieldContext as P } from "@ark-ui/react/field";
10
10
  import { Tabs as F } from "@ark-ui/react/tabs";
11
- import { Dialog as I, useDialogContext as L } from "@ark-ui/react/dialog";
12
- import { PasswordInput as R } from "@ark-ui/react/password-input";
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
13
  //#region src/components/Tabs/Tabs.tsx
14
- function z({ classes: e, value: n, defaultValue: r, onValueChange: i, label: a, orientation: o, activationMode: s, lazyMount: c, unmountOnExit: l, className: u, ...d }) {
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
15
  let f = t("tabs", h, e)();
16
16
  return /* @__PURE__ */ j(F.Root, {
17
17
  ...d,
@@ -26,7 +26,7 @@ function z({ classes: e, value: n, defaultValue: r, onValueChange: i, label: a,
26
26
  translations: a ? { listLabel: a } : void 0
27
27
  });
28
28
  }
29
- function B({ scrollable: e = !1, className: n, children: r, ...i }) {
29
+ function z({ scrollable: e = !1, className: n, children: r, ...i }) {
30
30
  let a = t("tabs", h)(), o = k(null), [s, c] = A({
31
31
  start: !1,
32
32
  end: !1
@@ -83,7 +83,7 @@ function B({ scrollable: e = !1, className: n, children: r, ...i }) {
83
83
  children: r
84
84
  });
85
85
  }
86
- function V({ classes: e, value: n, icon: r, disabled: i, closable: a = !1, onClose: s, className: c, children: l, onKeyDown: u, ...d }) {
86
+ function B({ classes: e, value: n, icon: r, disabled: i, closable: a = !1, onClose: s, className: c, children: l, onKeyDown: u, ...d }) {
87
87
  let f = t("tabs", h, e)({ closable: a }), p = /* @__PURE__ */ M(F.Trigger, {
88
88
  ...d,
89
89
  className: f.trigger({ class: c }),
@@ -117,7 +117,7 @@ function V({ classes: e, value: n, icon: r, disabled: i, closable: a = !1, onClo
117
117
  })]
118
118
  }) : p;
119
119
  }
120
- function H({ classes: e, value: n, className: r, ...i }) {
120
+ function V({ classes: e, value: n, className: r, ...i }) {
121
121
  let a = t("tabs", h, e)();
122
122
  return /* @__PURE__ */ j(F.Content, {
123
123
  ...i,
@@ -127,9 +127,9 @@ function H({ classes: e, value: n, className: r, ...i }) {
127
127
  }
128
128
  //#endregion
129
129
  //#region src/components/Dialog/Dialog.tsx
130
- var U = T({ modal: !0 });
131
- function W({ open: e, defaultOpen: t, onOpenChange: n, role: r = "dialog", modal: i = !0, closeOnEscape: a = !0, closeOnInteractOutside: o, children: s }) {
132
- return /* @__PURE__ */ j(U.Provider, {
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
133
  value: { modal: i },
134
134
  children: /* @__PURE__ */ j(I.Root, {
135
135
  open: e,
@@ -145,19 +145,19 @@ function W({ open: e, defaultOpen: t, onOpenChange: n, role: r = "dialog", modal
145
145
  })
146
146
  });
147
147
  }
148
- function G({ children: e }) {
148
+ function W({ children: e }) {
149
149
  return /* @__PURE__ */ j(I.Trigger, {
150
150
  asChild: !0,
151
151
  children: e
152
152
  });
153
153
  }
154
- function K({ children: e }) {
154
+ function G({ children: e }) {
155
155
  return /* @__PURE__ */ j(I.CloseTrigger, {
156
156
  asChild: !0,
157
157
  children: e
158
158
  });
159
159
  }
160
- function q(e, t) {
160
+ function K(e, t) {
161
161
  let [n, r] = A({
162
162
  x: 0,
163
163
  y: 0
@@ -216,60 +216,65 @@ function q(e, t) {
216
216
  style: e && (n.x || n.y) ? { translate: `${n.x}px ${n.y}px` } : void 0
217
217
  };
218
218
  }
219
- function J({ classes: n, title: r, hideTitle: i, description: a, icon: o, status: s, size: l, position: d, fullscreen: f, maximizable: p, maximized: m, defaultMaximized: h, onMaximizedChange: g, draggable: _, closable: v = !0, scrollBehavior: y, responsive: b = !0, closeLabel: x, maximizeLabel: T, restoreLabel: D, footer: O, portalTarget: k, className: P, style: F, onKeyDown: R, children: z, ...B }) {
220
- let V = t("dialog", c, n), H = e(), { modal: W } = E(U), G = L(), [K, J] = A(h ?? !1), Y = m ?? K, X = () => {
221
- J(!Y), g?.(!Y);
222
- }, Z = q(!!_ && !Y && !f, G.open), Q = V({
223
- status: s,
224
- size: l,
225
- position: d,
226
- scrollBehavior: y,
227
- fullscreen: f || Y,
228
- responsive: b,
229
- draggable: _ && !Y,
230
- maximizable: p,
231
- hideTitle: i
232
- }), $ = Y ? C : S;
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;
233
237
  return /* @__PURE__ */ M(N, {
234
- ...k ? { container: { current: k } } : {},
238
+ ...P ? { container: { current: P } } : {},
235
239
  children: [W && /* @__PURE__ */ j(I.Backdrop, { className: Q.backdrop() }), /* @__PURE__ */ j(I.Positioner, {
236
240
  className: Q.positioner(),
237
241
  children: /* @__PURE__ */ M(I.Content, {
238
242
  ...B,
239
- ..._ ? { "aria-keyshortcuts": u } : {},
240
- className: Q.content({ class: P }),
243
+ ...v ? { "aria-keyshortcuts": u } : {},
244
+ className: Q.content({ class: F }),
241
245
  style: Z.style ? {
242
- ...F,
246
+ ...L,
243
247
  ...Z.style
244
- } : F,
248
+ } : L,
245
249
  onKeyDown: (e) => {
246
- R?.(e), _ && Z.onKeyDown(e);
250
+ R?.(e), v && Z.onKeyDown(e);
247
251
  },
248
252
  children: [
249
253
  /* @__PURE__ */ M("div", {
250
254
  className: Q.header(),
251
- ..._ ? Z.header : {},
255
+ ...v ? Z.header : {},
252
256
  children: [
253
- o && /* @__PURE__ */ j("span", {
257
+ s && /* @__PURE__ */ j("span", {
254
258
  className: Q.iconBox(),
255
- children: /* @__PURE__ */ j(o, {
259
+ children: /* @__PURE__ */ j(s, {
256
260
  className: Q.icon(),
257
261
  "aria-hidden": "true"
258
262
  })
259
263
  }),
260
- p && /* @__PURE__ */ j("button", {
264
+ a === "header" && $,
265
+ m && /* @__PURE__ */ j("button", {
261
266
  type: "button",
262
267
  className: Q.maximize(),
263
- "aria-label": Y ? D ?? H.dialog.restore : T ?? H.dialog.maximize,
268
+ "aria-label": Y ? O ?? U.dialog.restore : D ?? U.dialog.maximize,
264
269
  onClick: X,
265
- children: /* @__PURE__ */ j($, {
270
+ children: /* @__PURE__ */ j(te, {
266
271
  className: Q.maximizeIcon(),
267
272
  "aria-hidden": "true"
268
273
  })
269
274
  }),
270
- v && /* @__PURE__ */ j(I.CloseTrigger, {
275
+ y && /* @__PURE__ */ j(I.CloseTrigger, {
271
276
  className: Q.close(),
272
- "aria-label": x ?? H.common.close,
277
+ "aria-label": T ?? U.common.close,
273
278
  children: /* @__PURE__ */ j(w, {
274
279
  className: Q.closeIcon(),
275
280
  "aria-hidden": "true"
@@ -280,20 +285,17 @@ function J({ classes: n, title: r, hideTitle: i, description: a, icon: o, status
280
285
  /* @__PURE__ */ M("div", {
281
286
  className: Q.body(),
282
287
  children: [
283
- /* @__PURE__ */ j(I.Title, {
284
- className: Q.title(),
285
- children: r
286
- }),
287
- a && /* @__PURE__ */ j(I.Description, {
288
+ a === "body" && $,
289
+ o && /* @__PURE__ */ j(I.Description, {
288
290
  className: Q.description(),
289
- children: a
291
+ children: o
290
292
  }),
291
293
  z
292
294
  ]
293
295
  }),
294
- O && /* @__PURE__ */ j("div", {
296
+ k && /* @__PURE__ */ j("div", {
295
297
  className: Q.footer(),
296
- children: O
298
+ children: k
297
299
  })
298
300
  ]
299
301
  })
@@ -302,20 +304,21 @@ function J({ classes: n, title: r, hideTitle: i, description: a, icon: o, status
302
304
  }
303
305
  //#endregion
304
306
  //#region src/components/PasswordInput/PasswordInput.tsx
305
- function Y({ 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, id: I, className: L, style: z, ...B }) {
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 }) {
306
308
  let V = t("passwordInput", d, a), H = e(), U = P(), W = n(), G = !(c || U?.invalid) && (!!l || W.success), K = V({
307
309
  size: o,
308
- success: G
309
- }), 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 ?? []), ee = T || E?.length ? [
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 ? [
310
313
  U?.ariaDescribedby,
311
314
  T && `${q}strength`,
312
315
  E?.length && `${q}requirements`
313
- ].filter(Boolean).join(" ") : void 0, te = k(null), ne = () => {
314
- let e = te.current?.querySelector("input");
316
+ ].filter(Boolean).join(" ") : void 0, ne = k(null), re = () => {
317
+ let e = ne.current?.querySelector("input");
315
318
  e && (m(e), e.focus());
316
319
  };
317
- return /* @__PURE__ */ M(R.Root, {
318
- className: K.base({ class: L }),
320
+ return /* @__PURE__ */ M(L.Root, {
321
+ className: K.base({ class: R }),
319
322
  style: z,
320
323
  invalid: c,
321
324
  disabled: u,
@@ -327,15 +330,15 @@ function Y({ classes: a, size: o, invalid: c, success: l, disabled: u, readOnly:
327
330
  onVisibilityChange: (e) => C?.(e.visible),
328
331
  autoComplete: w,
329
332
  translations: H.passwordInput,
330
- ...s(I, "input", { input: U?.ids.control }),
333
+ ...s(ee, "input", { input: U?.ids.control }),
331
334
  children: [
332
- /* @__PURE__ */ M(R.Control, {
333
- ref: te,
335
+ /* @__PURE__ */ M(L.Control, {
336
+ ref: ne,
334
337
  className: K.control(),
335
338
  children: [
336
- /* @__PURE__ */ j(R.Input, {
339
+ /* @__PURE__ */ j(L.Input, {
337
340
  ...B,
338
- "aria-describedby": ee,
341
+ "aria-describedby": te,
339
342
  "aria-busy": D || void 0,
340
343
  className: K.input(),
341
344
  onChange: (e) => {
@@ -346,7 +349,7 @@ function Y({ classes: a, size: o, invalid: c, success: l, disabled: u, readOnly:
346
349
  loading: D,
347
350
  clear: N && !!X && !(u || U?.disabled) && !(p || U?.readOnly),
348
351
  clearLabel: F ?? H.field.clear,
349
- onClear: ne,
352
+ onClear: re,
350
353
  success: G,
351
354
  classes: {
352
355
  spinner: K.spinner(),
@@ -355,9 +358,9 @@ function Y({ classes: a, size: o, invalid: c, success: l, disabled: u, readOnly:
355
358
  statusIcon: K.statusIcon()
356
359
  }
357
360
  }),
358
- /* @__PURE__ */ j(R.VisibilityTrigger, {
361
+ /* @__PURE__ */ j(L.VisibilityTrigger, {
359
362
  className: K.toggle(),
360
- children: /* @__PURE__ */ j(R.Indicator, {
363
+ children: /* @__PURE__ */ j(L.Indicator, {
361
364
  fallback: /* @__PURE__ */ j(b, {
362
365
  className: K.toggleIcon(),
363
366
  "aria-hidden": "true"
@@ -419,4 +422,4 @@ function Y({ classes: a, size: o, invalid: c, success: l, disabled: u, readOnly:
419
422
  });
420
423
  }
421
424
  //#endregion
422
- export { U as a, H as c, J as i, B as l, W as n, G as o, K as r, z as s, Y as t, V as u };
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 };
@@ -16,9 +16,11 @@ export interface AlertProps extends Omit<ComponentProps<'div'>, 'title'> {
16
16
  */
17
17
  duration?: number;
18
18
  onDismiss?: () => void;
19
+ /** Buttons in the message, e.g. "Unlock" or "Reconnect" – beside the text, below it when there is little room */
20
+ actions?: ReactNode;
19
21
  /** Extra classes per part of the component, e.g. { base: "…" } (see the recipe) */
20
22
  classes?: RecipeClasses<typeof alertRecipe>;
21
23
  }
22
24
  /** Message box with status colour, icon, title and text; role="alert" for errors and warnings, optionally dismissible */
23
- export declare function Alert({ classes, status, variant, size, title, dismissible, dismissLabel, duration, onDismiss, className, children, onMouseEnter, onMouseLeave, onFocus, onBlur, ...props }: AlertProps): import("react").JSX.Element;
25
+ export declare function Alert({ classes, status, variant, size, title, dismissible, dismissLabel, duration, onDismiss, actions, className, children, onMouseEnter, onMouseLeave, onFocus, onBlur, ...props }: AlertProps): import("react").JSX.Element;
24
26
  //# sourceMappingURL=Alert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,IAAI,WAAW,EAEpB,KAAK,WAAW,EAChB,KAAK,YAAY,EAEjB,KAAK,aAAa,EACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAqB,KAAK,cAAc,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIhG,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACpE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,mGAAmG;IACnG,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kDAAkD;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,mFAAmF;IACnF,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,WAAW,CAAC,CAAC;CAC/C;AAID,yHAAyH;AACzH,wBAAgB,KAAK,CAAC,EAClB,OAAO,EACP,MAAe,EACf,OAAO,EACP,IAAI,EACJ,KAAK,EACL,WAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACX,EAAE,UAAU,+BAoEZ"}
1
+ {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,IAAI,WAAW,EAEpB,KAAK,WAAW,EAChB,KAAK,YAAY,EAEjB,KAAK,aAAa,EACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAqB,KAAK,cAAc,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIhG,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACpE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,mGAAmG;IACnG,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kDAAkD;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,iHAAiH;IACjH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,mFAAmF;IACnF,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,WAAW,CAAC,CAAC;CAC/C;AAID,yHAAyH;AACzH,wBAAgB,KAAK,CAAC,EAClB,OAAO,EACP,MAAe,EACf,OAAO,EACP,IAAI,EACJ,KAAK,EACL,WAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACX,EAAE,UAAU,+BA+EZ"}