@alfadocs/ui-kit 0.17.1 → 0.17.3
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.
- package/dist/_chunks/{accordion-DOmxGEWU.js → accordion-CNcodXuO.js} +6 -6
- package/dist/_chunks/{ai-prompt-input-DEiQwIMn.js → ai-prompt-input-B-w5Rx3V.js} +184 -181
- package/dist/_chunks/{alert-pgdXrEO5.js → alert-DBnawbmf.js} +64 -59
- package/dist/_chunks/{audio-recorder-CRh4uyFL.js → audio-recorder-DNkQLW1G.js} +3 -3
- package/dist/_chunks/{autocomplete-mOg7WLOh.js → autocomplete-BxfabhZ8.js} +167 -164
- package/dist/_chunks/{balance-cell-renderer-DWWtX-VM.js → balance-cell-renderer-DJB6WDPe.js} +2 -2
- package/dist/_chunks/{chat-input-UK-bXU7u.js → chat-input-B3XmFGDw.js} +123 -122
- package/dist/_chunks/checkbox-group-Bwmt1ovQ.js +213 -0
- package/dist/_chunks/{checkbox-D5EHnB14.js → checkbox-mwbrPZDY.js} +75 -70
- package/dist/_chunks/{collapsible-CuxUBoHJ.js → collapsible-hHiyZp0b.js} +61 -63
- package/dist/_chunks/{color-picker-BPfcByHH.js → color-picker-Bm-gzpsh.js} +2 -2
- package/dist/_chunks/{combobox-D5tWe0t_.js → combobox-Da9eq00i.js} +214 -211
- package/dist/_chunks/{copy-field-BCHAZ8QV.js → copy-field-BAF4mt9h.js} +95 -132
- package/dist/_chunks/{date-picker-BlhtBhPo.js → date-picker-BIoSLRly.js} +222 -219
- package/dist/_chunks/{date-range-picker-C2hRu_Ke.js → date-range-picker-9gANFNG9.js} +81 -78
- package/dist/_chunks/{date-time-picker-B67mPZmP.js → date-time-picker-DG7BiGdb.js} +98 -95
- package/dist/_chunks/{dialog-DRp6Dejy.js → dialog-DUomPCRS.js} +69 -71
- package/dist/_chunks/{dropdown-menu-dyV7gHh_.js → dropdown-menu-DZxwF23X.js} +108 -110
- package/dist/_chunks/{freemium-paywall-BTEiVkes.js → freemium-paywall-DXc7XlGE.js} +98 -97
- package/dist/_chunks/{leo-sidebar-D3TuyH5_.js → leo-sidebar-DIsiTju3.js} +2 -2
- package/dist/_chunks/{list-DcjV0m5B.js → list-BdvDctBz.js} +184 -180
- package/dist/_chunks/{message-tray-Fsend-du.js → message-tray-BNAS8al4.js} +111 -111
- package/dist/_chunks/{multi-select-DooDzQIp.js → multi-select-CyspR5ZF.js} +157 -154
- package/dist/_chunks/{navigation-menu-DdufF-_4.js → navigation-menu-CyS1fBJ7.js} +85 -87
- package/dist/_chunks/{notification-tray-C3dYdLAF.js → notification-tray-D_69dXFY.js} +114 -114
- package/dist/_chunks/{number-input-DH00o0DN.js → number-input-BZXu6bPY.js} +92 -89
- package/dist/_chunks/{otp-input-BBXYvLx5.js → otp-input-BDF_iNpa.js} +92 -93
- package/dist/_chunks/{pagination-F1ei4khE.js → pagination-BWaXF7W0.js} +194 -211
- package/dist/_chunks/{patient-shell-BE0CdPOJ.js → patient-shell-BOOaWZA9.js} +3 -3
- package/dist/_chunks/{payment-form-CI77oIx1.js → payment-form-BjkuQeqR.js} +2 -2
- package/dist/_chunks/{pdf-viewer-CnEJvmXC.js → pdf-viewer-BG_nsFT5.js} +2 -2
- package/dist/_chunks/{radio-group-Cz1a4QCA.js → radio-group-BHZOxrIK.js} +4 -4
- package/dist/_chunks/{select-Ca6ibiDL.js → select-C92AT_OZ.js} +7 -7
- package/dist/_chunks/{sidebar-D8Lq065m.js → sidebar-BqzlRBvC.js} +271 -291
- package/dist/_chunks/{slider-CkR6CLun.js → slider-CfEzeseL.js} +4 -4
- package/dist/_chunks/{tabs-CRCyPpJo.js → tabs-aEQfQV3x.js} +8 -8
- package/dist/_chunks/{theme-toggle-B3meAb3y.js → theme-toggle-BswYl0Yp.js} +2 -2
- package/dist/_chunks/use-controllable-state-BiY4xTzM.js +23 -0
- package/dist/_chunks/use-copy-to-clipboard-Cyfc_dlv.js +43 -0
- package/dist/_chunks/use-persistent-state-i23OWy6G.js +24 -0
- package/dist/_chunks/{warning-stack-CeRihME9.js → warning-stack-CDH9TudY.js} +2 -2
- package/dist/_chunks/{workflow-map-D3MvrsZV.js → workflow-map-BeKe23uw.js} +3 -3
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/use-debounced-callback.d.ts +1 -5
- package/dist/components/_shared/use-direction.d.ts +1 -18
- package/dist/components/_shared/use-focus-trap.d.ts +1 -31
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/command-palette.d.ts +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/icon-button-group/icon-button-group.d.ts +14 -14
- package/dist/components/list/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sidebar/index.js +8 -7
- package/dist/components/sidebar/sidebar.d.ts +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.js +98 -15
- package/dist/hooks/use-debounced-callback.d.ts +19 -0
- package/dist/hooks/use-debounced-value.d.ts +16 -0
- package/dist/hooks/use-direction.d.ts +19 -0
- package/dist/hooks/use-focus-trap.d.ts +32 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +13 -0
- package/dist/hooks/use-persistent-state.d.ts +16 -0
- package/dist/index.js +493 -492
- package/dist/patterns/leo-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +4 -2
- package/dist/_chunks/checkbox-group-Qkm3Rg1S.js +0 -208
|
@@ -1,49 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { B as
|
|
6
|
-
import { u as
|
|
7
|
-
import {
|
|
8
|
-
import { C as
|
|
9
|
-
|
|
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: (
|
|
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: (
|
|
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: (
|
|
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
|
|
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(
|
|
52
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
90
53
|
} catch {
|
|
91
54
|
}
|
|
92
55
|
if (typeof document > "u") return !1;
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
let
|
|
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
|
-
|
|
60
|
+
i = document.execCommand("copy");
|
|
98
61
|
} catch {
|
|
99
|
-
|
|
62
|
+
i = !1;
|
|
100
63
|
}
|
|
101
|
-
return document.body.removeChild(
|
|
64
|
+
return document.body.removeChild(s), i;
|
|
102
65
|
}
|
|
103
|
-
const
|
|
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
|
-
),
|
|
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
|
-
),
|
|
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
|
-
),
|
|
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
|
-
),
|
|
161
|
+
), ee = P(
|
|
199
162
|
({
|
|
200
|
-
value:
|
|
201
|
-
size:
|
|
202
|
-
intent:
|
|
163
|
+
value: e,
|
|
164
|
+
size: s = "md",
|
|
165
|
+
intent: i = "default",
|
|
203
166
|
startIcon: o,
|
|
204
|
-
wrap:
|
|
205
|
-
copyLabel:
|
|
206
|
-
copiedLabel:
|
|
207
|
-
copiedDuration:
|
|
208
|
-
ariaLabel:
|
|
209
|
-
onCopy:
|
|
210
|
-
disabled:
|
|
211
|
-
className:
|
|
212
|
-
id:
|
|
213
|
-
...
|
|
214
|
-
},
|
|
215
|
-
const { t
|
|
216
|
-
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
const { status:
|
|
220
|
-
resetAfterMs:
|
|
221
|
-
writer:
|
|
222
|
-
}),
|
|
223
|
-
|
|
224
|
-
const [
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}, [
|
|
228
|
-
const
|
|
229
|
-
var
|
|
230
|
-
if (
|
|
231
|
-
const
|
|
232
|
-
return
|
|
233
|
-
}, [
|
|
234
|
-
|
|
235
|
-
}, [
|
|
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: () =>
|
|
238
|
-
copy: () =>
|
|
239
|
-
isCopied: () =>
|
|
200
|
+
getValue: () => d.current,
|
|
201
|
+
copy: () => p(),
|
|
202
|
+
isCopied: () => b.current
|
|
240
203
|
}),
|
|
241
|
-
[
|
|
204
|
+
[p]
|
|
242
205
|
);
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
return /* @__PURE__ */
|
|
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:
|
|
249
|
-
className:
|
|
211
|
+
ref: N,
|
|
212
|
+
className: X({ size: s, disabled: r, className: V }),
|
|
250
213
|
"data-component": "copy-field",
|
|
251
|
-
"data-component-id":
|
|
252
|
-
"data-copied":
|
|
253
|
-
...
|
|
214
|
+
"data-component-id": f,
|
|
215
|
+
"data-copied": n ? "true" : void 0,
|
|
216
|
+
...j,
|
|
254
217
|
children: [
|
|
255
|
-
o ? /* @__PURE__ */
|
|
256
|
-
/* @__PURE__ */
|
|
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:
|
|
222
|
+
id: f,
|
|
260
223
|
type: "text",
|
|
261
224
|
readOnly: !0,
|
|
262
|
-
value:
|
|
263
|
-
disabled:
|
|
264
|
-
"aria-label":
|
|
265
|
-
className:
|
|
266
|
-
intent:
|
|
267
|
-
size:
|
|
268
|
-
wrap:
|
|
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__ */
|
|
274
|
-
|
|
236
|
+
/* @__PURE__ */ a(
|
|
237
|
+
q,
|
|
275
238
|
{
|
|
276
239
|
type: "button",
|
|
277
240
|
intent: "ghost",
|
|
278
|
-
size:
|
|
279
|
-
onClick:
|
|
280
|
-
disabled:
|
|
281
|
-
"aria-label":
|
|
282
|
-
className:
|
|
283
|
-
startIcon:
|
|
284
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
256
|
+
ee.displayName = "CopyField";
|
|
294
257
|
export {
|
|
295
|
-
|
|
258
|
+
ee as C,
|
|
296
259
|
U as c
|
|
297
260
|
};
|
|
298
|
-
//# sourceMappingURL=copy-field-
|
|
261
|
+
//# sourceMappingURL=copy-field-BAF4mt9h.js.map
|