@alfadocs/ui-kit 0.17.1 → 0.17.2

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 (100) hide show
  1. package/dist/_chunks/{accordion-DOmxGEWU.js → accordion-CNcodXuO.js} +6 -6
  2. package/dist/_chunks/{ai-prompt-input-DEiQwIMn.js → ai-prompt-input-B-w5Rx3V.js} +184 -181
  3. package/dist/_chunks/{alert-pgdXrEO5.js → alert-DBnawbmf.js} +64 -59
  4. package/dist/_chunks/{audio-recorder-CRh4uyFL.js → audio-recorder-DNkQLW1G.js} +3 -3
  5. package/dist/_chunks/{autocomplete-mOg7WLOh.js → autocomplete-BxfabhZ8.js} +167 -164
  6. package/dist/_chunks/{balance-cell-renderer-DWWtX-VM.js → balance-cell-renderer-DJB6WDPe.js} +2 -2
  7. package/dist/_chunks/{chat-input-UK-bXU7u.js → chat-input-B3XmFGDw.js} +123 -122
  8. package/dist/_chunks/checkbox-group-Bwmt1ovQ.js +213 -0
  9. package/dist/_chunks/{checkbox-D5EHnB14.js → checkbox-mwbrPZDY.js} +75 -70
  10. package/dist/_chunks/{collapsible-CuxUBoHJ.js → collapsible-hHiyZp0b.js} +61 -63
  11. package/dist/_chunks/{color-picker-BPfcByHH.js → color-picker-Bm-gzpsh.js} +2 -2
  12. package/dist/_chunks/{combobox-D5tWe0t_.js → combobox-Da9eq00i.js} +214 -211
  13. package/dist/_chunks/{copy-field-BCHAZ8QV.js → copy-field-BAF4mt9h.js} +95 -132
  14. package/dist/_chunks/{date-picker-BlhtBhPo.js → date-picker-BIoSLRly.js} +222 -219
  15. package/dist/_chunks/{date-range-picker-C2hRu_Ke.js → date-range-picker-9gANFNG9.js} +81 -78
  16. package/dist/_chunks/{date-time-picker-B67mPZmP.js → date-time-picker-DG7BiGdb.js} +98 -95
  17. package/dist/_chunks/{dialog-DRp6Dejy.js → dialog-DUomPCRS.js} +69 -71
  18. package/dist/_chunks/{dropdown-menu-dyV7gHh_.js → dropdown-menu-DZxwF23X.js} +108 -110
  19. package/dist/_chunks/{freemium-paywall-BTEiVkes.js → freemium-paywall-DXc7XlGE.js} +98 -97
  20. package/dist/_chunks/{leo-sidebar-D3TuyH5_.js → leo-sidebar-DIsiTju3.js} +2 -2
  21. package/dist/_chunks/{list-DcjV0m5B.js → list-BdvDctBz.js} +184 -180
  22. package/dist/_chunks/{message-tray-Fsend-du.js → message-tray-BNAS8al4.js} +111 -111
  23. package/dist/_chunks/{multi-select-DooDzQIp.js → multi-select-CyspR5ZF.js} +157 -154
  24. package/dist/_chunks/{navigation-menu-DdufF-_4.js → navigation-menu-CyS1fBJ7.js} +85 -87
  25. package/dist/_chunks/{notification-tray-C3dYdLAF.js → notification-tray-D_69dXFY.js} +114 -114
  26. package/dist/_chunks/{number-input-DH00o0DN.js → number-input-BZXu6bPY.js} +92 -89
  27. package/dist/_chunks/{otp-input-BBXYvLx5.js → otp-input-BDF_iNpa.js} +92 -93
  28. package/dist/_chunks/{pagination-F1ei4khE.js → pagination-BWaXF7W0.js} +194 -211
  29. package/dist/_chunks/{patient-shell-BE0CdPOJ.js → patient-shell-BOOaWZA9.js} +3 -3
  30. package/dist/_chunks/{payment-form-CI77oIx1.js → payment-form-BjkuQeqR.js} +2 -2
  31. package/dist/_chunks/{pdf-viewer-CnEJvmXC.js → pdf-viewer-BG_nsFT5.js} +2 -2
  32. package/dist/_chunks/{radio-group-Cz1a4QCA.js → radio-group-BHZOxrIK.js} +4 -4
  33. package/dist/_chunks/{select-Ca6ibiDL.js → select-C92AT_OZ.js} +7 -7
  34. package/dist/_chunks/{sidebar-D8Lq065m.js → sidebar-BqzlRBvC.js} +271 -291
  35. package/dist/_chunks/{slider-CkR6CLun.js → slider-CfEzeseL.js} +4 -4
  36. package/dist/_chunks/{tabs-CRCyPpJo.js → tabs-aEQfQV3x.js} +8 -8
  37. package/dist/_chunks/{theme-toggle-B3meAb3y.js → theme-toggle-BswYl0Yp.js} +2 -2
  38. package/dist/_chunks/use-controllable-state-BiY4xTzM.js +23 -0
  39. package/dist/_chunks/use-copy-to-clipboard-Cyfc_dlv.js +43 -0
  40. package/dist/_chunks/use-persistent-state-i23OWy6G.js +24 -0
  41. package/dist/_chunks/{warning-stack-CeRihME9.js → warning-stack-CDH9TudY.js} +2 -2
  42. package/dist/_chunks/{workflow-map-D3MvrsZV.js → workflow-map-BeKe23uw.js} +3 -3
  43. package/dist/agent-catalog.json +1 -1
  44. package/dist/components/_shared/use-debounced-callback.d.ts +1 -5
  45. package/dist/components/_shared/use-direction.d.ts +1 -18
  46. package/dist/components/_shared/use-focus-trap.d.ts +1 -31
  47. package/dist/components/accordion/index.js +1 -1
  48. package/dist/components/ai-prompt-input/index.js +1 -1
  49. package/dist/components/alert/index.js +1 -1
  50. package/dist/components/audio-recorder/index.js +1 -1
  51. package/dist/components/autocomplete/index.js +1 -1
  52. package/dist/components/chat-input/index.js +1 -1
  53. package/dist/components/checkbox/index.js +1 -1
  54. package/dist/components/checkbox-group/index.js +1 -1
  55. package/dist/components/collapsible/index.js +1 -1
  56. package/dist/components/color-picker/index.js +1 -1
  57. package/dist/components/combobox/index.js +1 -1
  58. package/dist/components/command-palette/command-palette.d.ts +1 -1
  59. package/dist/components/copy-field/index.js +1 -1
  60. package/dist/components/data-table/index.js +1 -1
  61. package/dist/components/date-picker/index.js +1 -1
  62. package/dist/components/date-range-picker/index.js +1 -1
  63. package/dist/components/date-time-picker/index.js +1 -1
  64. package/dist/components/dialog/index.js +1 -1
  65. package/dist/components/dropdown-menu/index.js +1 -1
  66. package/dist/components/freemium-paywall/index.js +1 -1
  67. package/dist/components/icon-button-group/icon-button-group.d.ts +14 -14
  68. package/dist/components/list/index.js +1 -1
  69. package/dist/components/message-tray/index.js +1 -1
  70. package/dist/components/multi-select/index.js +1 -1
  71. package/dist/components/navigation-menu/index.js +1 -1
  72. package/dist/components/notification-tray/index.js +1 -1
  73. package/dist/components/number-input/index.js +1 -1
  74. package/dist/components/otp-input/index.js +1 -1
  75. package/dist/components/pagination/index.js +1 -1
  76. package/dist/components/payment-form/index.js +1 -1
  77. package/dist/components/pdf-viewer/index.js +1 -1
  78. package/dist/components/radio-group/index.js +1 -1
  79. package/dist/components/select/index.js +1 -1
  80. package/dist/components/sidebar/index.js +8 -7
  81. package/dist/components/sidebar/sidebar.d.ts +1 -1
  82. package/dist/components/slider/index.js +1 -1
  83. package/dist/components/tabs/index.js +1 -1
  84. package/dist/components/theme-toggle/index.js +1 -1
  85. package/dist/components/warning-stack/index.js +1 -1
  86. package/dist/components/workflow/index.js +1 -1
  87. package/dist/hooks/index.d.ts +8 -0
  88. package/dist/hooks/index.js +98 -15
  89. package/dist/hooks/use-debounced-callback.d.ts +19 -0
  90. package/dist/hooks/use-debounced-value.d.ts +16 -0
  91. package/dist/hooks/use-direction.d.ts +19 -0
  92. package/dist/hooks/use-focus-trap.d.ts +32 -0
  93. package/dist/hooks/use-isomorphic-layout-effect.d.ts +13 -0
  94. package/dist/hooks/use-persistent-state.d.ts +16 -0
  95. package/dist/index.js +493 -492
  96. package/dist/patterns/leo-assistant/index.js +1 -1
  97. package/dist/patterns/patient-shell/index.js +1 -1
  98. package/dist/tokens.css +1 -1
  99. package/package.json +4 -2
  100. package/dist/_chunks/checkbox-group-Qkm3Rg1S.js +0 -208
@@ -1,49 +1,12 @@
1
- import { jsxs as P, jsx as p } from "react/jsx-runtime";
2
- import { useRef as m, useEffect as V, useState as A, useCallback as y, forwardRef as _, useMemo as H } from "react";
3
- import { c as x } from "./index-D2ZczOXr.js";
4
- import { useTranslation as O } from "react-i18next";
5
- import { B as W } from "./button-DD_0Xdmr.js";
6
- import { u as q } from "./registry-C9nwlNyL.js";
7
- import { C as D } from "./check-DPdL_Sm7.js";
8
- import { C as G } from "./copy-B00HK7tj.js";
9
- const J = typeof navigator < "u" && typeof navigator.clipboard < "u" && typeof navigator.clipboard.writeText == "function";
10
- function Q(t = {}) {
11
- const { resetAfterMs: e = 2e3, writer: s } = t, o = m(s);
12
- V(() => {
13
- o.current = s;
14
- }, [s]);
15
- const [C, i] = A("idle"), [T, u] = A(null), n = m(null), a = y(() => {
16
- n.current !== null && (clearTimeout(n.current), n.current = null);
17
- }, []), d = y(() => {
18
- a(), i("idle"), u(null);
19
- }, [a]), z = y(
20
- async (c) => {
21
- a();
22
- const h = o.current;
23
- let l = !1;
24
- if (h)
25
- try {
26
- l = await h(c);
27
- } catch {
28
- l = !1;
29
- }
30
- else {
31
- if (!(J || typeof navigator < "u" && typeof navigator.clipboard < "u" && typeof navigator.clipboard.writeText == "function"))
32
- return i("error"), u(null), !1;
33
- try {
34
- await navigator.clipboard.writeText(c), l = !0;
35
- } catch {
36
- l = !1;
37
- }
38
- }
39
- return l ? (i("copied"), u(c), e > 0 && (n.current = setTimeout(() => {
40
- n.current = null, i("idle");
41
- }, e)), !0) : (i("error"), u(null), !1);
42
- },
43
- [a, e]
44
- );
45
- return V(() => a, [a]), { status: C, copiedValue: T, copy: z, reset: d };
46
- }
1
+ import { jsxs as M, jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as P, useRef as v, useState as E, useEffect as H, useCallback as z, useMemo as O } from "react";
3
+ import { c as u } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as _ } from "react-i18next";
5
+ import { B as q } from "./button-DD_0Xdmr.js";
6
+ import { u as D } from "./use-copy-to-clipboard-Cyfc_dlv.js";
7
+ import { u as G } from "./registry-C9nwlNyL.js";
8
+ import { C as J } from "./check-DPdL_Sm7.js";
9
+ import { C as Q } from "./copy-B00HK7tj.js";
47
10
  const U = {
48
11
  id: "copy-field",
49
12
  capabilities: [],
@@ -52,13 +15,13 @@ const U = {
52
15
  type: "string",
53
16
  descriptionKey: "ui.agent.copyField.state.value",
54
17
  description: "The value displayed in the read-only field.",
55
- read: (t) => t.getValue()
18
+ read: (e) => e.getValue()
56
19
  },
57
20
  copied: {
58
21
  type: "boolean",
59
22
  descriptionKey: "ui.agent.copyField.state.copied",
60
23
  description: "True for the brief window after a successful copy.",
61
- read: (t) => t.isCopied()
24
+ read: (e) => e.isCopied()
62
25
  }
63
26
  },
64
27
  actions: {
@@ -66,7 +29,7 @@ const U = {
66
29
  safety: "write",
67
30
  descriptionKey: "ui.agent.copyField.actions.copy",
68
31
  description: "Programmatically trigger the clipboard write.",
69
- invoke: (t) => t.copy()
32
+ invoke: (e) => e.copy()
70
33
  }
71
34
  },
72
35
  domHooks: {
@@ -82,25 +45,25 @@ const U = {
82
45
  }
83
46
  }
84
47
  };
85
- async function X(t) {
48
+ async function W(e) {
86
49
  var o;
87
50
  if (typeof navigator < "u" && ((o = navigator.clipboard) != null && o.writeText))
88
51
  try {
89
- return await navigator.clipboard.writeText(t), !0;
52
+ return await navigator.clipboard.writeText(e), !0;
90
53
  } catch {
91
54
  }
92
55
  if (typeof document > "u") return !1;
93
- const e = document.createElement("textarea");
94
- e.value = t, e.setAttribute("readonly", ""), e.style.position = "absolute", e.style.setProperty("inset-inline-start", "-9999px"), document.body.appendChild(e), e.select();
95
- let s = !1;
56
+ const s = document.createElement("textarea");
57
+ s.value = e, s.setAttribute("readonly", ""), s.style.position = "absolute", s.style.setProperty("inset-inline-start", "-9999px"), document.body.appendChild(s), s.select();
58
+ let i = !1;
96
59
  try {
97
- s = document.execCommand("copy");
60
+ i = document.execCommand("copy");
98
61
  } catch {
99
- s = !1;
62
+ i = !1;
100
63
  }
101
- return document.body.removeChild(e), s;
64
+ return document.body.removeChild(s), i;
102
65
  }
103
- const Y = x(
66
+ const X = u(
104
67
  [
105
68
  "ds:inline-flex ds:items-stretch ds:w-full",
106
69
  "ds:rounded-[var(--radius-sm)] ds:bg-input ds:text-foreground",
@@ -126,7 +89,7 @@ const Y = x(
126
89
  },
127
90
  defaultVariants: { size: "md", disabled: !1 }
128
91
  }
129
- ), Z = x(
92
+ ), Y = u(
130
93
  [
131
94
  "ds:flex-1 ds:min-w-0 ds:bg-transparent ds:border-0 ds:outline-none",
132
95
  "ds:text-foreground",
@@ -172,7 +135,7 @@ const Y = x(
172
135
  hasStartIcon: !1
173
136
  }
174
137
  }
175
- ), $ = x(
138
+ ), Z = u(
176
139
  [
177
140
  "ds:inline-flex ds:items-center ds:justify-center ds:shrink-0",
178
141
  "ds:text-muted-foreground",
@@ -188,111 +151,111 @@ const Y = x(
188
151
  },
189
152
  defaultVariants: { size: "md" }
190
153
  }
191
- ), ee = x(
154
+ ), $ = u(
192
155
  [
193
156
  "ds:shrink-0 ds:rounded-none",
194
157
  "ds:focus-visible:outline-none",
195
158
  "ds:h-full",
196
159
  "ds:gap-[var(--spacing-xs)]"
197
160
  ].join(" ")
198
- ), te = _(
161
+ ), ee = P(
199
162
  ({
200
- value: t,
201
- size: e = "md",
202
- intent: s = "default",
163
+ value: e,
164
+ size: s = "md",
165
+ intent: i = "default",
203
166
  startIcon: o,
204
- wrap: C = !1,
205
- copyLabel: i,
206
- copiedLabel: T,
207
- copiedDuration: u = 2e3,
208
- ariaLabel: n,
209
- onCopy: a,
210
- disabled: d = !1,
211
- className: z,
212
- id: c,
213
- ...h
214
- }, l) => {
215
- const { t: r } = O(), g = m(t);
216
- g.current = t;
217
- const v = m(a);
218
- v.current = a;
219
- const { status: w, copy: I } = Q({
220
- resetAfterMs: u,
221
- writer: X
222
- }), f = w === "copied", R = m(!1);
223
- R.current = f;
224
- const [B, F] = A("");
225
- V(() => {
226
- F(w === "copied" ? r("copyField.copySuccess") : w === "error" ? r("copyField.copyFailed") : "");
227
- }, [w, r]);
228
- const b = y(async () => {
229
- var j;
230
- if (d) return !1;
231
- const L = await I(g.current);
232
- return L && ((j = v.current) == null || j.call(v, g.current)), L;
233
- }, [d, I]), N = y(() => {
234
- b();
235
- }, [b]), K = H(
167
+ wrap: F = !1,
168
+ copyLabel: T,
169
+ copiedLabel: k,
170
+ copiedDuration: S = 2e3,
171
+ ariaLabel: I,
172
+ onCopy: g,
173
+ disabled: r = !1,
174
+ className: V,
175
+ id: f,
176
+ ...j
177
+ }, N) => {
178
+ const { t } = _(), d = v(e);
179
+ d.current = e;
180
+ const c = v(g);
181
+ c.current = g;
182
+ const { status: l, copy: w } = D({
183
+ resetAfterMs: S,
184
+ writer: W
185
+ }), n = l === "copied", b = v(!1);
186
+ b.current = n;
187
+ const [A, m] = E("");
188
+ H(() => {
189
+ m(l === "copied" ? t("copyField.copySuccess") : l === "error" ? t("copyField.copyFailed") : "");
190
+ }, [l, t]);
191
+ const p = z(async () => {
192
+ var C;
193
+ if (r) return !1;
194
+ const x = await w(d.current);
195
+ return x && ((C = c.current) == null || C.call(c, d.current)), x;
196
+ }, [r, w]), R = z(() => {
197
+ p();
198
+ }, [p]), B = O(
236
199
  () => ({
237
- getValue: () => g.current,
238
- copy: () => b(),
239
- isCopied: () => R.current
200
+ getValue: () => d.current,
201
+ copy: () => p(),
202
+ isCopied: () => b.current
240
203
  }),
241
- [b]
204
+ [p]
242
205
  );
243
- q(U, K, c);
244
- const M = n ?? r("copyField.valueLabel"), S = i ?? r("copyField.copy"), k = T ?? r("copyField.copied"), E = f ? typeof k == "string" ? k : r("copyField.copied") : typeof S == "string" ? S : r("copyField.copy");
245
- return /* @__PURE__ */ P(
206
+ G(U, B, f);
207
+ const L = I ?? t("copyField.valueLabel"), y = T ?? t("copyField.copy"), h = k ?? t("copyField.copied"), K = n ? typeof h == "string" ? h : t("copyField.copied") : typeof y == "string" ? y : t("copyField.copy");
208
+ return /* @__PURE__ */ M(
246
209
  "div",
247
210
  {
248
- ref: l,
249
- className: Y({ size: e, disabled: d, className: z }),
211
+ ref: N,
212
+ className: X({ size: s, disabled: r, className: V }),
250
213
  "data-component": "copy-field",
251
- "data-component-id": c,
252
- "data-copied": f ? "true" : void 0,
253
- ...h,
214
+ "data-component-id": f,
215
+ "data-copied": n ? "true" : void 0,
216
+ ...j,
254
217
  children: [
255
- o ? /* @__PURE__ */ p("span", { "aria-hidden": "true", className: $({ size: e }), children: o }) : null,
256
- /* @__PURE__ */ p(
218
+ o ? /* @__PURE__ */ a("span", { "aria-hidden": "true", className: Z({ size: s }), children: o }) : null,
219
+ /* @__PURE__ */ a(
257
220
  "input",
258
221
  {
259
- id: c,
222
+ id: f,
260
223
  type: "text",
261
224
  readOnly: !0,
262
- value: t,
263
- disabled: d,
264
- "aria-label": M,
265
- className: Z({
266
- intent: s,
267
- size: e,
268
- wrap: C,
225
+ value: e,
226
+ disabled: r,
227
+ "aria-label": L,
228
+ className: Y({
229
+ intent: i,
230
+ size: s,
231
+ wrap: F,
269
232
  hasStartIcon: !!o
270
233
  })
271
234
  }
272
235
  ),
273
- /* @__PURE__ */ p(
274
- W,
236
+ /* @__PURE__ */ a(
237
+ q,
275
238
  {
276
239
  type: "button",
277
240
  intent: "ghost",
278
- size: e,
279
- onClick: N,
280
- disabled: d,
281
- "aria-label": E,
282
- className: ee(),
283
- startIcon: f ? /* @__PURE__ */ p(D, { "aria-hidden": "true" }) : /* @__PURE__ */ p(G, { "aria-hidden": "true" }),
284
- children: /* @__PURE__ */ p("span", { className: "type-label", children: f ? k : S })
241
+ size: s,
242
+ onClick: R,
243
+ disabled: r,
244
+ "aria-label": K,
245
+ className: $(),
246
+ startIcon: n ? /* @__PURE__ */ a(J, { "aria-hidden": "true" }) : /* @__PURE__ */ a(Q, { "aria-hidden": "true" }),
247
+ children: /* @__PURE__ */ a("span", { className: "type-label", children: n ? h : y })
285
248
  }
286
249
  ),
287
- /* @__PURE__ */ p("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: B })
250
+ /* @__PURE__ */ a("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: A })
288
251
  ]
289
252
  }
290
253
  );
291
254
  }
292
255
  );
293
- te.displayName = "CopyField";
256
+ ee.displayName = "CopyField";
294
257
  export {
295
- te as C,
258
+ ee as C,
296
259
  U as c
297
260
  };
298
- //# sourceMappingURL=copy-field-BCHAZ8QV.js.map
261
+ //# sourceMappingURL=copy-field-BAF4mt9h.js.map