@actioneer/ads 0.5.7 → 0.5.9
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/bin/ads-init.mjs +6 -0
- package/components/accordion.js +50 -48
- package/components/agent-icon.d.ts +12 -0
- package/components/agent-icon.js +133 -120
- package/components/ai-elements/chain-of-thought.d.ts +1 -1
- package/components/ai-elements/chain-of-thought.js +108 -108
- package/components/ai-elements/chart.js +16 -14
- package/components/ai-elements/inline-citation.js +41 -41
- package/components/ai-elements/message.js +4 -4
- package/components/ai-elements/queue.js +7 -7
- package/components/ai-elements/research-activity.js +114 -114
- package/components/ai-elements/shimmer.d.ts +2 -2
- package/components/ai-elements/speech-input.js +28 -28
- package/components/ai-elements/task-progress.js +26 -16
- package/components/ai-elements/task.js +17 -17
- package/components/ai-elements/tool.js +6 -6
- package/components/ai-elements/transcript.js +6 -5
- package/components/ai-elements/voice.js +1 -1
- package/components/alert.js +10 -10
- package/components/answer-sources.js +1 -1
- package/components/answer.js +115 -114
- package/components/assistant-ui/action-bar.js +94 -48
- package/components/assistant-ui/attachment.js +103 -75
- package/components/assistant-ui/badge.d.ts +1 -1
- package/components/assistant-ui/badge.js +17 -17
- package/components/assistant-ui/chain-of-thought.d.ts +1 -1
- package/components/assistant-ui/composer-add-context.js +9 -9
- package/components/assistant-ui/composer-deep-research.js +5 -5
- package/components/assistant-ui/composer-harness.js +11 -9
- package/components/assistant-ui/composer-trigger-popover.js +45 -34
- package/components/assistant-ui/composer.js +59 -59
- package/components/assistant-ui/error.js +14 -14
- package/components/assistant-ui/file.d.ts +1 -1
- package/components/assistant-ui/image.d.ts +1 -1
- package/components/assistant-ui/image.js +113 -103
- package/components/assistant-ui/markdown-text.js +18 -18
- package/components/assistant-ui/message.js +46 -45
- package/components/assistant-ui/quote.js +1 -1
- package/components/assistant-ui/reasoning.d.ts +1 -1
- package/components/assistant-ui/reasoning.js +66 -77
- package/components/assistant-ui/suggestions.js +4 -4
- package/components/assistant-ui/thread.js +22 -22
- package/components/assistant-ui/tool-fallback.js +60 -63
- package/components/assistant-ui/tool-group.d.ts +1 -1
- package/components/assistant-ui/tool-group.js +36 -42
- package/components/audio-waveform.js +25 -24
- package/components/autocomplete.d.ts +1 -0
- package/components/autocomplete.js +45 -43
- package/components/avatar.d.ts +1 -0
- package/components/avatar.js +27 -26
- package/components/badge.d.ts +1 -1
- package/components/breadcrumbs.d.ts +2 -0
- package/components/breadcrumbs.js +52 -50
- package/components/button.d.ts +2 -2
- package/components/button.js +22 -20
- package/components/card.js +8 -8
- package/components/carousel.js +105 -104
- package/components/chart.d.ts +6 -0
- package/components/chart.js +743 -672
- package/components/checkbox.js +74 -38
- package/components/chip.d.ts +1 -1
- package/components/code-block.js +3 -3
- package/components/collapsible.js +67 -23
- package/components/connector-card.js +6 -6
- package/components/drawer.d.ts +18 -11
- package/components/drawer.js +81 -78
- package/components/dropdown.d.ts +2 -0
- package/components/dropdown.js +88 -79
- package/components/empty-state.d.ts +1 -1
- package/components/empty-state.js +7 -7
- package/components/field.d.ts +4 -0
- package/components/field.js +45 -34
- package/components/file-dropzone.js +12 -12
- package/components/index.d.ts +3 -0
- package/components/index.js +584 -558
- package/components/input-field.js +51 -46
- package/components/input.js +20 -20
- package/components/link.js +9 -9
- package/components/modal.d.ts +5 -1
- package/components/modal.js +121 -76
- package/components/navbar.d.ts +1 -1
- package/components/navbar.js +1 -1
- package/components/number-field.js +38 -29
- package/components/page-header.js +12 -12
- package/components/pagination.js +19 -19
- package/components/panel.js +2 -2
- package/components/pixel-blast-svg.js +3 -3
- package/components/pixel-icon.d.ts +4 -0
- package/components/pixel-icon.js +210 -164
- package/components/popover.d.ts +1 -1
- package/components/popover.js +66 -64
- package/components/progress-circle.js +36 -32
- package/components/progress.js +28 -24
- package/components/radio.js +59 -49
- package/components/resizable-panel.js +1 -1
- package/components/reveal.d.ts +2 -2
- package/components/ripple.d.ts +3 -3
- package/components/scroll-area.js +17 -16
- package/components/segmented.d.ts +1 -0
- package/components/segmented.js +39 -36
- package/components/select.d.ts +7 -0
- package/components/select.js +186 -137
- package/components/setting-row.js +45 -42
- package/components/sidebar.js +131 -127
- package/components/skeleton.js +5 -5
- package/components/spinner.d.ts +13 -4
- package/components/spinner.js +42 -42
- package/components/stepper.js +21 -21
- package/components/switch.js +41 -39
- package/components/table.d.ts +16 -0
- package/components/table.js +393 -260
- package/components/tabs.js +149 -137
- package/components/toast.js +66 -66
- package/components/tooltip.js +2 -2
- package/components/tree.js +62 -51
- package/components/typography.d.ts +2 -1
- package/components/typography.js +33 -32
- package/components/ui/button.d.ts +2 -2
- package/components/ui/button.js +19 -19
- package/components/ui/collapsible.d.ts +1 -5
- package/components/ui/dialog.d.ts +3 -3
- package/components/ui/dialog.js +95 -58
- package/components/ui/tooltip.d.ts +2 -2
- package/components/ui/tooltip.js +67 -33
- package/components/viz-charts.js +95 -95
- package/demo/components/add-to-artifact.js +363 -0
- package/demo/lib/artifact-library.js +142 -0
- package/demo/lib/artifact-pin-guard.js +12 -0
- package/fonts/aribau-grotesk-medium.woff2 +0 -0
- package/fonts/aribau-grotesk-regular.woff2 +0 -0
- package/fonts.css +11 -11
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +17 -16
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +21 -20
- package/lib/icons.d.ts +24 -0
- package/lib/icons.js +114 -108
- package/lib/motion.d.ts +42 -39
- package/lib/motion.js +112 -52
- package/lib/spinner-mark.d.ts +9 -0
- package/lib/spinner-mark.js +98 -0
- package/llms.txt +53 -19
- package/manifest.json +258 -36
- package/package.json +1 -1
- package/styles.css +143 -124
- package/theme.css +90 -93
- package/components/ui/collapsible.js +0 -35
- package/fonts/aribau-grotesk-500.otf +0 -0
- package/fonts/aribau-grotesk-600.woff2 +0 -0
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import * as u from "react";
|
|
4
4
|
import { Button as ee, buttonVariants as re } from "./button.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Spinner as te } from "./spinner.js";
|
|
6
|
+
import { Warning as ae, Pause as ne, Play as oe, Download as ie } from "../lib/icons.js";
|
|
7
|
+
import { cn as se } from "../lib/cn.js";
|
|
7
8
|
function A(t) {
|
|
8
9
|
if (!t || !Number.isFinite(t) || t < 0) return "0:00";
|
|
9
10
|
const e = Math.floor(t), a = Math.floor(e / 3600), c = Math.floor(e % 3600 / 60), d = e % 60;
|
|
@@ -18,7 +19,7 @@ function le(t, e, a) {
|
|
|
18
19
|
const c = e != null && e.includes("wav") ? "wav" : e != null && e.includes("mpeg") ? "mp3" : "audio", d = ((m = t.split("/").filter(Boolean).at(-1)) == null ? void 0 : m.split("?")[0]) || "recording";
|
|
19
20
|
return `${decodeURIComponent(d)}.${c}`;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function ge({
|
|
22
23
|
src: t,
|
|
23
24
|
durationSeconds: e,
|
|
24
25
|
contentType: a,
|
|
@@ -28,20 +29,20 @@ function fe({
|
|
|
28
29
|
downloadName: U,
|
|
29
30
|
className: V
|
|
30
31
|
}) {
|
|
31
|
-
const F = u.useRef(null), p = u.useRef(null), [G, b] = u.useState(0), [
|
|
32
|
+
const F = u.useRef(null), p = u.useRef(null), [G, b] = u.useState(0), [q, D] = u.useState(e ?? 0), [k, C] = u.useState(!1), [E, x] = u.useState(!1), [f, R] = u.useState(null), v = (c ?? 0) > 1, J = le(t, a, U);
|
|
32
33
|
u.useEffect(() => {
|
|
33
34
|
const o = F.current;
|
|
34
35
|
if (!o) return;
|
|
35
36
|
let M = !1;
|
|
36
37
|
return b(0), D(e ?? 0), C(!1), x(!1), R(null), o.replaceChildren(), (async () => {
|
|
37
38
|
try {
|
|
38
|
-
const [{ default: w }, { default:
|
|
39
|
+
const [{ default: w }, { default: L }] = await Promise.all([
|
|
39
40
|
import("wavesurfer.js"),
|
|
40
41
|
import("wavesurfer.js/dist/plugins/hover.esm.js")
|
|
41
42
|
]);
|
|
42
43
|
if (M) return;
|
|
43
|
-
const N = B(o, "--foreground", "currentColor"), O = B(o, "--muted-foreground", "currentColor"), Q = B(o, "--background", "Canvas"), X = (
|
|
44
|
-
const Y =
|
|
44
|
+
const N = B(o, "--foreground", "currentColor"), O = B(o, "--muted-foreground", "currentColor"), Q = B(o, "--background", "Canvas"), X = (s, P) => {
|
|
45
|
+
const Y = s[0] ?? [], Z = s[1] ?? s[0] ?? [], { width: _, height: T } = P.canvas, S = T / 2, y = 4, I = 2, $ = Math.max(1, Math.floor(_ / (y + I))), H = (n, g) => {
|
|
45
46
|
if (!n.length) return 0;
|
|
46
47
|
const h = Math.floor(g / $ * n.length), j = Math.max(h + 1, Math.floor((g + 1) / $ * n.length));
|
|
47
48
|
let W = 0;
|
|
@@ -49,10 +50,10 @@ function fe({
|
|
|
49
50
|
return W;
|
|
50
51
|
};
|
|
51
52
|
for (let n = 0; n < $; n++) {
|
|
52
|
-
const g = n * (
|
|
53
|
-
P.fillRect(g,
|
|
53
|
+
const g = n * (y + I), h = Math.max(1, H(Y, n) * (S - 2)), j = Math.max(1, H(Z, n) * (S - 2));
|
|
54
|
+
P.fillRect(g, S - h, y, h), P.fillRect(g, S + 1, y, j);
|
|
54
55
|
}
|
|
55
|
-
},
|
|
56
|
+
}, i = w.create({
|
|
56
57
|
container: o,
|
|
57
58
|
url: t,
|
|
58
59
|
duration: e,
|
|
@@ -70,7 +71,7 @@ function fe({
|
|
|
70
71
|
hideScrollbar: !0,
|
|
71
72
|
renderFunction: v ? X : void 0,
|
|
72
73
|
plugins: [
|
|
73
|
-
|
|
74
|
+
L.create({
|
|
74
75
|
lineColor: N,
|
|
75
76
|
labelColor: Q,
|
|
76
77
|
labelBackground: N,
|
|
@@ -79,11 +80,11 @@ function fe({
|
|
|
79
80
|
})
|
|
80
81
|
]
|
|
81
82
|
});
|
|
82
|
-
p.current =
|
|
83
|
-
D(
|
|
84
|
-
}),
|
|
85
|
-
x(!1), b(
|
|
86
|
-
}),
|
|
83
|
+
p.current = i, i.on("ready", (s) => {
|
|
84
|
+
D(s), C(!0);
|
|
85
|
+
}), i.on("timeupdate", (s) => b(s)), i.on("seeking", (s) => b(s)), i.on("play", () => x(!0)), i.on("pause", () => x(!1)), i.on("finish", () => {
|
|
86
|
+
x(!1), b(i.getDuration());
|
|
87
|
+
}), i.on("error", () => {
|
|
87
88
|
R("Recording could not be loaded."), C(!1);
|
|
88
89
|
});
|
|
89
90
|
} catch {
|
|
@@ -94,17 +95,17 @@ function fe({
|
|
|
94
95
|
M = !0, (w = p.current) == null || w.destroy(), p.current = null;
|
|
95
96
|
};
|
|
96
97
|
}, [t, e, v]);
|
|
97
|
-
const
|
|
98
|
+
const K = () => {
|
|
98
99
|
var o;
|
|
99
100
|
!k || f || (o = p.current) == null || o.playPause();
|
|
100
101
|
};
|
|
101
|
-
return /* @__PURE__ */ l("div", { className:
|
|
102
|
+
return /* @__PURE__ */ l("div", { className: se("space-y-3", V), "data-slot": "audio-waveform", children: [
|
|
102
103
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-3", children: [
|
|
103
104
|
/* @__PURE__ */ l("div", { className: "min-w-0", children: [
|
|
104
105
|
/* @__PURE__ */ r("p", { className: "text-base font-normal", children: "Recording" }),
|
|
105
106
|
/* @__PURE__ */ r("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: v ? `${d} above · ${m.toLowerCase()} below` : a ?? "Audio" })
|
|
106
107
|
] }),
|
|
107
|
-
/* @__PURE__ */ r("p", { className: "font-mono text-xs tabular-nums text-muted-foreground", children: A(
|
|
108
|
+
/* @__PURE__ */ r("p", { className: "font-mono text-xs tabular-nums text-muted-foreground", children: A(q) })
|
|
108
109
|
] }),
|
|
109
110
|
/* @__PURE__ */ l("div", { className: "relative overflow-hidden py-2", children: [
|
|
110
111
|
v && /* @__PURE__ */ l("div", { className: "pointer-events-none absolute inset-x-0 top-2 z-10 flex h-[92px] flex-col items-center justify-between text-xs font-normal uppercase tracking-wide text-muted-foreground", children: [
|
|
@@ -113,7 +114,7 @@ function fe({
|
|
|
113
114
|
] }),
|
|
114
115
|
/* @__PURE__ */ r("div", { ref: F, className: "min-h-[92px]" }),
|
|
115
116
|
!k && !f && /* @__PURE__ */ r("div", { className: "absolute inset-0 flex items-center justify-center bg-background/70", children: /* @__PURE__ */ l("div", { className: "inline-flex items-center gap-2 rounded-md bg-background px-3 py-1.5 text-xs text-muted-foreground", children: [
|
|
116
|
-
/* @__PURE__ */ r(te, {
|
|
117
|
+
/* @__PURE__ */ r(te, { variant: "content", size: "xs", "aria-hidden": !0 }),
|
|
117
118
|
"Loading waveform"
|
|
118
119
|
] }) }),
|
|
119
120
|
f && /* @__PURE__ */ r("div", { className: "absolute inset-0 flex items-center justify-center bg-background/80", children: /* @__PURE__ */ l("div", { className: "inline-flex items-center gap-2 rounded-md bg-background px-3 py-1.5 text-xs text-muted-foreground", children: [
|
|
@@ -127,7 +128,7 @@ function fe({
|
|
|
127
128
|
{
|
|
128
129
|
type: "button",
|
|
129
130
|
variant: "secondary",
|
|
130
|
-
onClick:
|
|
131
|
+
onClick: K,
|
|
131
132
|
disabled: !k || !!f,
|
|
132
133
|
"aria-label": E ? "Pause recording" : "Play recording",
|
|
133
134
|
startContent: E ? /* @__PURE__ */ r(ne, { "aria-hidden": "true" }) : /* @__PURE__ */ r(oe, { "aria-hidden": "true" }),
|
|
@@ -135,13 +136,13 @@ function fe({
|
|
|
135
136
|
children: A(G)
|
|
136
137
|
}
|
|
137
138
|
),
|
|
138
|
-
/* @__PURE__ */ l("a", { href: t, download:
|
|
139
|
-
/* @__PURE__ */ r(
|
|
139
|
+
/* @__PURE__ */ l("a", { href: t, download: J, className: re({ variant: "ghost" }), children: [
|
|
140
|
+
/* @__PURE__ */ r(ie, { "aria-hidden": "true", className: "size-4" }),
|
|
140
141
|
"Audio"
|
|
141
142
|
] })
|
|
142
143
|
] })
|
|
143
144
|
] });
|
|
144
145
|
}
|
|
145
146
|
export {
|
|
146
|
-
|
|
147
|
+
ge as AudioWaveform
|
|
147
148
|
};
|
|
@@ -14,5 +14,6 @@ export interface AutocompleteProps {
|
|
|
14
14
|
allowsCustomValue?: boolean;
|
|
15
15
|
className?: string;
|
|
16
16
|
id?: string;
|
|
17
|
+
"aria-describedby"?: string;
|
|
17
18
|
}
|
|
18
19
|
export declare const Autocomplete: React.ForwardRefExoticComponent<AutocompleteProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,56 +1,57 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as x, jsx as c } from "react/jsx-runtime";
|
|
3
3
|
import * as o from "react";
|
|
4
|
-
import { MotionConfig as
|
|
5
|
-
import { Search as
|
|
4
|
+
import { MotionConfig as z, AnimatePresence as q, motion as O } from "motion/react";
|
|
5
|
+
import { Search as P, Check as B } from "../lib/icons.js";
|
|
6
6
|
import { cn as y } from "../lib/cn.js";
|
|
7
|
-
import { inputBaseClass as
|
|
8
|
-
import { floatVariants as
|
|
9
|
-
import { Ripple as
|
|
10
|
-
const
|
|
7
|
+
import { inputBaseClass as F } from "./field.js";
|
|
8
|
+
import { floatVariants as K } from "../lib/motion.js";
|
|
9
|
+
import { Ripple as Q } from "./ripple.js";
|
|
10
|
+
const T = o.forwardRef(
|
|
11
11
|
({
|
|
12
12
|
items: u,
|
|
13
13
|
value: f,
|
|
14
|
-
onChange:
|
|
14
|
+
onChange: s,
|
|
15
15
|
placeholder: A = "Search…",
|
|
16
16
|
disabled: E,
|
|
17
17
|
isInvalid: R,
|
|
18
18
|
allowsCustomValue: p = !1,
|
|
19
19
|
className: S,
|
|
20
|
-
id: I
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
id: I,
|
|
21
|
+
"aria-describedby": M
|
|
22
|
+
}, L) => {
|
|
23
|
+
const d = u.find((e) => e.value === f), [m, h] = o.useState((d == null ? void 0 : d.label) ?? ""), [r, a] = o.useState(!1), [l, w] = o.useState(-1), N = o.useRef(null), k = o.useRef(null), b = o.useId();
|
|
23
24
|
o.useEffect(() => {
|
|
24
25
|
h((d == null ? void 0 : d.label) ?? (p ? f ?? "" : ""));
|
|
25
26
|
}, [d, f, p]);
|
|
26
|
-
const
|
|
27
|
+
const n = o.useMemo(() => {
|
|
27
28
|
const e = m.trim().toLowerCase();
|
|
28
29
|
return e ? u.filter((t) => t.label.toLowerCase().includes(e)) : u;
|
|
29
30
|
}, [u, m]);
|
|
30
31
|
o.useEffect(() => {
|
|
31
32
|
if (!r) return;
|
|
32
33
|
const e = (t) => {
|
|
33
|
-
var
|
|
34
|
-
(
|
|
34
|
+
var i;
|
|
35
|
+
(i = N.current) != null && i.contains(t.target) || a(!1);
|
|
35
36
|
};
|
|
36
37
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
37
38
|
}, [r]), o.useEffect(() => {
|
|
38
39
|
var t;
|
|
39
|
-
if (!r ||
|
|
40
|
-
const e = (t = k.current) == null ? void 0 : t.children[
|
|
40
|
+
if (!r || l < 0) return;
|
|
41
|
+
const e = (t = k.current) == null ? void 0 : t.children[l];
|
|
41
42
|
e == null || e.scrollIntoView({ block: "nearest" });
|
|
42
|
-
}, [r,
|
|
43
|
+
}, [r, l]);
|
|
43
44
|
const g = (e) => {
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
for (let v = 0; v <
|
|
47
|
-
if (
|
|
45
|
+
n.length !== 0 && w((t) => {
|
|
46
|
+
let i = t;
|
|
47
|
+
for (let v = 0; v < n.length; v++)
|
|
48
|
+
if (i = (i + e + n.length) % n.length, !n[i].disabled) return i;
|
|
48
49
|
return t;
|
|
49
50
|
});
|
|
50
51
|
}, D = (e) => {
|
|
51
|
-
const t =
|
|
52
|
-
!t || t.disabled || (
|
|
53
|
-
},
|
|
52
|
+
const t = n[e];
|
|
53
|
+
!t || t.disabled || (s == null || s(t.value), h(t.label), a(!1));
|
|
54
|
+
}, $ = (e) => {
|
|
54
55
|
switch (e.key) {
|
|
55
56
|
case "ArrowDown":
|
|
56
57
|
e.preventDefault(), r ? g(1) : a(!0);
|
|
@@ -59,7 +60,7 @@ const Q = o.forwardRef(
|
|
|
59
60
|
e.preventDefault(), r ? g(-1) : a(!0);
|
|
60
61
|
break;
|
|
61
62
|
case "Enter":
|
|
62
|
-
r &&
|
|
63
|
+
r && l >= 0 ? (e.preventDefault(), D(l)) : p && (s == null || s(m), a(!1));
|
|
63
64
|
break;
|
|
64
65
|
case "Escape":
|
|
65
66
|
r && (e.preventDefault(), a(!1));
|
|
@@ -72,16 +73,16 @@ const Q = o.forwardRef(
|
|
|
72
73
|
return /* @__PURE__ */ x("div", { ref: N, className: "relative", children: [
|
|
73
74
|
/* @__PURE__ */ x("div", { className: "group/field relative", children: [
|
|
74
75
|
/* @__PURE__ */ c(
|
|
75
|
-
|
|
76
|
+
P,
|
|
76
77
|
{
|
|
77
|
-
className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground transition-colors duration-
|
|
78
|
+
className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground transition-colors duration-150 group-focus-within/field:text-foreground group-hover/field:text-foreground",
|
|
78
79
|
"aria-hidden": !0
|
|
79
80
|
}
|
|
80
81
|
),
|
|
81
82
|
/* @__PURE__ */ c(
|
|
82
83
|
"input",
|
|
83
84
|
{
|
|
84
|
-
ref:
|
|
85
|
+
ref: L,
|
|
85
86
|
id: I,
|
|
86
87
|
type: "text",
|
|
87
88
|
role: "combobox",
|
|
@@ -90,27 +91,28 @@ const Q = o.forwardRef(
|
|
|
90
91
|
"aria-haspopup": "listbox",
|
|
91
92
|
"aria-expanded": r,
|
|
92
93
|
"aria-controls": b,
|
|
93
|
-
"aria-activedescendant": r &&
|
|
94
|
+
"aria-activedescendant": r && l >= 0 ? `${b}-opt-${l}` : void 0,
|
|
94
95
|
"aria-invalid": R || void 0,
|
|
96
|
+
"aria-describedby": M,
|
|
95
97
|
disabled: E,
|
|
96
98
|
placeholder: A,
|
|
97
99
|
value: m,
|
|
98
100
|
onChange: (e) => {
|
|
99
|
-
h(e.target.value), a(!0), w(-1), p && (
|
|
101
|
+
h(e.target.value), a(!0), w(-1), p && (s == null || s(e.target.value));
|
|
100
102
|
},
|
|
101
103
|
onFocus: () => a(!0),
|
|
102
|
-
onKeyDown:
|
|
103
|
-
className: y(
|
|
104
|
+
onKeyDown: $,
|
|
105
|
+
className: y(F, "h-10 pl-9", S)
|
|
104
106
|
}
|
|
105
107
|
)
|
|
106
108
|
] }),
|
|
107
|
-
/* @__PURE__ */ c(
|
|
108
|
-
|
|
109
|
+
/* @__PURE__ */ c(z, { reducedMotion: "user", children: /* @__PURE__ */ c(q, { children: r && /* @__PURE__ */ x(
|
|
110
|
+
O.ul,
|
|
109
111
|
{
|
|
110
112
|
ref: k,
|
|
111
113
|
id: b,
|
|
112
114
|
role: "listbox",
|
|
113
|
-
variants:
|
|
115
|
+
variants: K,
|
|
114
116
|
initial: "hidden",
|
|
115
117
|
animate: "visible",
|
|
116
118
|
exit: "hidden",
|
|
@@ -120,25 +122,25 @@ const Q = o.forwardRef(
|
|
|
120
122
|
"rounded-md border border-border bg-elevated shadow-elevation"
|
|
121
123
|
),
|
|
122
124
|
children: [
|
|
123
|
-
/* @__PURE__ */ c(
|
|
124
|
-
|
|
125
|
+
/* @__PURE__ */ c(Q, { origin: "top" }),
|
|
126
|
+
n.length === 0 ? /* @__PURE__ */ c(
|
|
125
127
|
"li",
|
|
126
128
|
{
|
|
127
129
|
role: "presentation",
|
|
128
130
|
className: "px-2 py-6 text-center text-xs text-muted-foreground",
|
|
129
131
|
children: "No results"
|
|
130
132
|
}
|
|
131
|
-
) :
|
|
132
|
-
const
|
|
133
|
+
) : n.map((e, t) => {
|
|
134
|
+
const i = e.value === f, v = t === l;
|
|
133
135
|
return /* @__PURE__ */ x(
|
|
134
136
|
"li",
|
|
135
137
|
{
|
|
136
138
|
id: `${b}-opt-${t}`,
|
|
137
139
|
role: "option",
|
|
138
|
-
"aria-selected":
|
|
140
|
+
"aria-selected": i,
|
|
139
141
|
"aria-disabled": e.disabled || void 0,
|
|
140
142
|
onMouseEnter: () => !e.disabled && w(t),
|
|
141
|
-
onMouseDown: (
|
|
143
|
+
onMouseDown: (j) => j.preventDefault(),
|
|
142
144
|
onClick: () => D(t),
|
|
143
145
|
className: y(
|
|
144
146
|
"flex cursor-pointer items-center justify-between gap-2",
|
|
@@ -148,7 +150,7 @@ const Q = o.forwardRef(
|
|
|
148
150
|
),
|
|
149
151
|
children: [
|
|
150
152
|
/* @__PURE__ */ c("span", { className: "truncate", children: e.label }),
|
|
151
|
-
|
|
153
|
+
i && /* @__PURE__ */ c(B, { className: "size-4 shrink-0", "aria-hidden": !0 })
|
|
152
154
|
]
|
|
153
155
|
},
|
|
154
156
|
e.value
|
|
@@ -160,7 +162,7 @@ const Q = o.forwardRef(
|
|
|
160
162
|
] });
|
|
161
163
|
}
|
|
162
164
|
);
|
|
163
|
-
|
|
165
|
+
T.displayName = "Autocomplete";
|
|
164
166
|
export {
|
|
165
|
-
|
|
167
|
+
T as Autocomplete
|
|
166
168
|
};
|
package/components/avatar.d.ts
CHANGED
package/components/avatar.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as n, jsxs as b } from "react/jsx-runtime";
|
|
3
3
|
import * as f from "react";
|
|
4
4
|
import { cn as i } from "../lib/cn.js";
|
|
5
5
|
const g = {
|
|
6
|
+
xs: "size-5 text-[10px]",
|
|
6
7
|
sm: "size-8 text-xs",
|
|
7
8
|
md: "size-10 text-xs",
|
|
8
9
|
lg: "size-12 text-base",
|
|
9
10
|
xl: "size-16 text-lg"
|
|
10
|
-
},
|
|
11
|
+
}, h = {
|
|
11
12
|
full: "rounded-full",
|
|
12
13
|
lg: "rounded-lg"
|
|
13
14
|
};
|
|
@@ -16,21 +17,21 @@ function v(r) {
|
|
|
16
17
|
return e.length === 0 ? "" : e.length === 1 ? e[0].slice(0, 2).toUpperCase() : (e[0][0] + e[e.length - 1][0]).toUpperCase();
|
|
17
18
|
}
|
|
18
19
|
const m = [
|
|
19
|
-
"bg-(--color-cyan-soft) text-
|
|
20
|
-
"bg-(--color-lime-soft) text-
|
|
21
|
-
"bg-(--color-amber-soft) text-
|
|
22
|
-
"bg-info-100 text-
|
|
20
|
+
"bg-(--color-cyan-soft) text-ink-950",
|
|
21
|
+
"bg-(--color-lime-soft) text-ink-950",
|
|
22
|
+
"bg-(--color-amber-soft) text-ink-950",
|
|
23
|
+
"bg-info-100 text-ink-950",
|
|
23
24
|
"bg-ink-300 text-ink-950"
|
|
24
25
|
];
|
|
25
|
-
function
|
|
26
|
+
function k(r) {
|
|
26
27
|
let e = 0;
|
|
27
28
|
for (const t of r) e = e * 31 + t.charCodeAt(0) >>> 0;
|
|
28
29
|
return m[e % m.length];
|
|
29
30
|
}
|
|
30
31
|
const N = f.forwardRef(
|
|
31
|
-
({ className: r, src: e, name: t, size:
|
|
32
|
-
const
|
|
33
|
-
return /* @__PURE__ */
|
|
32
|
+
({ className: r, src: e, name: t, size: s = "md", radius: o = "full", ...a }, c) => {
|
|
33
|
+
const l = t ? v(t) : "";
|
|
34
|
+
return /* @__PURE__ */ n(
|
|
34
35
|
"span",
|
|
35
36
|
{
|
|
36
37
|
ref: c,
|
|
@@ -40,47 +41,47 @@ const N = f.forwardRef(
|
|
|
40
41
|
"relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden font-normal",
|
|
41
42
|
// Images sit on the neutral fill; initials take a deterministic
|
|
42
43
|
// per-name identity tint so a roster reads multi-color.
|
|
43
|
-
e || !t ? "bg-fill text-fill-foreground" :
|
|
44
|
-
g[
|
|
45
|
-
|
|
44
|
+
e || !t ? "bg-fill text-fill-foreground" : k(t),
|
|
45
|
+
g[s],
|
|
46
|
+
h[o],
|
|
46
47
|
r
|
|
47
48
|
),
|
|
48
49
|
...a,
|
|
49
|
-
children: e ? /* @__PURE__ */
|
|
50
|
+
children: e ? /* @__PURE__ */ n(
|
|
50
51
|
"img",
|
|
51
52
|
{
|
|
52
53
|
src: e,
|
|
53
54
|
alt: t ?? "",
|
|
54
55
|
className: "size-full object-cover"
|
|
55
56
|
}
|
|
56
|
-
) : /* @__PURE__ */
|
|
57
|
+
) : /* @__PURE__ */ n("span", { "aria-hidden": !0, children: l })
|
|
57
58
|
}
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
61
|
);
|
|
61
62
|
N.displayName = "Avatar";
|
|
62
|
-
const
|
|
63
|
-
({ className: r, max: e, size: t = "md", radius:
|
|
64
|
-
const
|
|
65
|
-
return /* @__PURE__ */
|
|
63
|
+
const y = f.forwardRef(
|
|
64
|
+
({ className: r, max: e, size: t = "md", radius: s = "full", children: o, ...a }, c) => {
|
|
65
|
+
const l = f.Children.toArray(o), d = typeof e == "number" ? l.length - e : 0, p = typeof e == "number" ? l.slice(0, e) : l;
|
|
66
|
+
return /* @__PURE__ */ b(
|
|
66
67
|
"div",
|
|
67
68
|
{
|
|
68
69
|
ref: c,
|
|
69
70
|
className: i("flex items-center", r),
|
|
70
71
|
...a,
|
|
71
72
|
children: [
|
|
72
|
-
|
|
73
|
+
p.map((x, u) => /* @__PURE__ */ n(
|
|
73
74
|
"div",
|
|
74
75
|
{
|
|
75
76
|
className: i(
|
|
76
77
|
"ring-2 ring-background rounded-full",
|
|
77
78
|
u > 0 && "-ml-2"
|
|
78
79
|
),
|
|
79
|
-
children:
|
|
80
|
+
children: x
|
|
80
81
|
},
|
|
81
82
|
u
|
|
82
83
|
)),
|
|
83
|
-
d > 0 && /* @__PURE__ */
|
|
84
|
+
d > 0 && /* @__PURE__ */ n("div", { className: i("ring-2 ring-background rounded-full -ml-2"), children: /* @__PURE__ */ n(
|
|
84
85
|
"span",
|
|
85
86
|
{
|
|
86
87
|
role: "img",
|
|
@@ -89,9 +90,9 @@ const k = f.forwardRef(
|
|
|
89
90
|
"relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden font-normal",
|
|
90
91
|
"bg-muted text-muted-foreground",
|
|
91
92
|
g[t],
|
|
92
|
-
|
|
93
|
+
h[s]
|
|
93
94
|
),
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ n("span", { "aria-hidden": !0, children: `+${d}` })
|
|
95
96
|
}
|
|
96
97
|
) })
|
|
97
98
|
]
|
|
@@ -99,8 +100,8 @@ const k = f.forwardRef(
|
|
|
99
100
|
);
|
|
100
101
|
}
|
|
101
102
|
);
|
|
102
|
-
|
|
103
|
+
y.displayName = "AvatarGroup";
|
|
103
104
|
export {
|
|
104
105
|
N as Avatar,
|
|
105
|
-
|
|
106
|
+
y as AvatarGroup
|
|
106
107
|
};
|
package/components/badge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "soft" | "
|
|
4
|
+
variant?: "soft" | "outline" | "solid" | "dot" | null | undefined;
|
|
5
5
|
color?: "success" | "warning" | "danger" | "info" | "default" | "primary" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color">, VariantProps<typeof badgeVariants> {
|
|
@@ -18,6 +18,8 @@ export interface BreadcrumbsProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
18
18
|
* overflow menu) — they ride along when the trail is sticky.
|
|
19
19
|
*/
|
|
20
20
|
actions?: React.ReactNode;
|
|
21
|
+
/** Controls pinned to the true horizontal center of the trail row. */
|
|
22
|
+
center?: React.ReactNode;
|
|
21
23
|
/**
|
|
22
24
|
* Supporting metadata stitched inline right after the trail (schema name,
|
|
23
25
|
* sync status…). Muted, truncates before the trail does.
|