@actioneer/ads 0.5.4 → 0.5.6
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/components/accordion.js +15 -15
- package/components/agent-icon.d.ts +64 -0
- package/components/agent-icon.js +251 -0
- package/components/ai-elements/agent-trace.d.ts +8 -1
- package/components/ai-elements/agent-trace.js +164 -129
- package/components/ai-elements/chain-of-thought-icon.d.ts +42 -0
- package/components/ai-elements/chain-of-thought-icon.js +283 -0
- package/components/ai-elements/chain-of-thought.js +7 -7
- package/components/ai-elements/chart.js +38 -35
- package/components/ai-elements/index.d.ts +1 -0
- package/components/ai-elements/inline-citation.js +40 -40
- package/components/ai-elements/message.js +5 -5
- package/components/ai-elements/queue.js +1 -1
- package/components/ai-elements/research-activity.d.ts +2 -0
- package/components/ai-elements/research-activity.js +79 -81
- package/components/ai-elements/task-progress.js +2 -2
- package/components/ai-elements/tool.d.ts +4 -2
- package/components/ai-elements/tool.js +74 -54
- package/components/ai-elements/transcript.js +1 -1
- package/components/alert.js +1 -1
- package/components/answer.d.ts +2644 -311
- package/components/answer.js +1776 -371
- package/components/assistant-ui/answer-tool-ui.js +27 -28
- package/components/assistant-ui/chain-of-thought.d.ts +7 -2
- package/components/assistant-ui/composer-harness.js +20 -16
- package/components/assistant-ui/follow-up-suggestions.d.ts +5 -1
- package/components/assistant-ui/follow-up-suggestions.js +47 -19
- package/components/assistant-ui/reasoning.js +35 -31
- package/components/assistant-ui/tool-fallback.js +125 -122
- package/components/assistant-ui/tool-group.d.ts +3 -1
- package/components/assistant-ui/tool-group.js +48 -43
- package/components/audio-waveform.js +14 -14
- package/components/autocomplete.js +52 -48
- package/components/avatar.js +58 -44
- package/components/badge.js +3 -3
- package/components/brand-texture.js +1 -1
- package/components/breadcrumbs.d.ts +27 -1
- package/components/breadcrumbs.js +94 -42
- package/components/button.js +15 -15
- package/components/carousel.js +10 -10
- package/components/chart.js +77 -77
- package/components/chip.js +3 -3
- package/components/code-block.d.ts +39 -17
- package/components/code-block.js +153 -104
- package/components/command-palette.js +27 -25
- package/components/connector-card.js +2 -2
- package/components/dropdown.js +65 -61
- package/components/empty-state.js +15 -15
- package/components/field.js +16 -16
- package/components/index.d.ts +4 -0
- package/components/index.js +525 -478
- package/components/infinite-canvas.js +60 -60
- package/components/kbd.js +6 -6
- package/components/link.js +6 -6
- package/components/modal.js +22 -20
- package/components/page-header.js +1 -1
- package/components/pagination.js +22 -22
- package/components/pixel-blast-svg.js +1 -1
- package/components/pixel-icon.d.ts +31 -0
- package/components/pixel-icon.js +733 -0
- package/components/popover.js +46 -42
- package/components/ripple.d.ts +29 -0
- package/components/ripple.js +17 -0
- package/components/segmented.js +24 -23
- package/components/select.js +71 -67
- package/components/selection-action-bar.js +22 -22
- package/components/sidebar.d.ts +11 -3
- package/components/sidebar.js +161 -148
- package/components/stepper.d.ts +2 -0
- package/components/stepper.js +80 -43
- package/components/table.d.ts +7 -0
- package/components/table.js +223 -155
- package/components/tabs.d.ts +3 -1
- package/components/tabs.js +165 -144
- package/components/textarea.js +10 -8
- package/components/toast.js +48 -46
- package/components/tooltip.js +61 -59
- package/components/tree.js +44 -41
- package/components/typography.d.ts +1 -1
- package/components/typography.js +25 -25
- package/components/viz-charts.js +133 -133
- package/fonts/aribau-grotesk-500.otf +0 -0
- package/fonts/aribau-grotesk-600.woff2 +0 -0
- package/fonts.css +6 -4
- package/lib/icons.d.ts +411 -402
- package/lib/icons.js +109 -107
- package/llms.txt +98 -8
- package/manifest.json +1012 -96
- package/package.json +5 -5
- package/styles.css +206 -81
- package/theme.css +200 -77
- package/fonts/aribau-grotesk-400.otf +0 -0
- package/fonts/aribau-grotesk-700.otf +0 -0
package/components/toast.js
CHANGED
|
@@ -6,66 +6,67 @@ import { MotionConfig as O, AnimatePresence as W, motion as F } from "motion/rea
|
|
|
6
6
|
import { WarningCircle as B, Warning as D, Info as N, CheckCircle as U, Close as V } from "../lib/icons.js";
|
|
7
7
|
import { cn as g } from "../lib/cn.js";
|
|
8
8
|
import { toastSpring as q, EASE_OUT as G } from "../lib/motion.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { Ripple as J } from "./ripple.js";
|
|
10
|
+
import { Button as K } from "./button.js";
|
|
11
|
+
import { Spinner as Q } from "./spinner.js";
|
|
11
12
|
const z = o.createContext(null);
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
13
|
+
function lt() {
|
|
14
|
+
const b = o.useContext(z);
|
|
15
|
+
if (!b)
|
|
15
16
|
throw new Error("useToast must be used within a <ToastProvider>.");
|
|
16
|
-
const { push: c, close:
|
|
17
|
+
const { push: c, close: p, clear: f } = b;
|
|
17
18
|
return { toast: o.useMemo(() => {
|
|
18
19
|
const s = ((r, i) => {
|
|
19
20
|
if (r !== null && typeof r == "object" && !o.isValidElement(r)) {
|
|
20
|
-
const { title: d, ...
|
|
21
|
-
return c(d, { ...
|
|
21
|
+
const { title: d, ...m } = r;
|
|
22
|
+
return c(d, { ...m, ...i });
|
|
22
23
|
}
|
|
23
24
|
return c(r, i);
|
|
24
25
|
}), l = (r) => (i, d) => c(i, { ...d, variant: r });
|
|
25
|
-
return s.success = l("success"), s.info = l("info"), s.warning = l("warning"), s.danger = l("danger"), s.close =
|
|
26
|
+
return s.success = l("success"), s.info = l("info"), s.warning = l("warning"), s.danger = l("danger"), s.close = p, s.clear = f, s.promise = (r, i) => {
|
|
26
27
|
const d = c(i.loading, { isLoading: !0, timeout: 0 });
|
|
27
|
-
return r.then((
|
|
28
|
-
|
|
29
|
-
typeof i.success == "function" ? i.success(
|
|
28
|
+
return r.then((m) => {
|
|
29
|
+
p(d), c(
|
|
30
|
+
typeof i.success == "function" ? i.success(m) : i.success,
|
|
30
31
|
{ variant: "success" }
|
|
31
32
|
);
|
|
32
|
-
}).catch((
|
|
33
|
-
|
|
34
|
-
typeof i.error == "function" ? i.error(
|
|
33
|
+
}).catch((m) => {
|
|
34
|
+
p(d), c(
|
|
35
|
+
typeof i.error == "function" ? i.error(m) : i.error,
|
|
35
36
|
{ variant: "danger" }
|
|
36
37
|
);
|
|
37
38
|
}), r;
|
|
38
39
|
}, s;
|
|
39
|
-
}, [c,
|
|
40
|
+
}, [c, p, f]) };
|
|
40
41
|
}
|
|
41
|
-
const
|
|
42
|
+
const X = {
|
|
42
43
|
default: { icon: N, accent: "text-foreground" },
|
|
43
44
|
success: { icon: U, accent: "text-success-700" },
|
|
44
45
|
info: { icon: N, accent: "text-info-700" },
|
|
45
46
|
warning: { icon: D, accent: "text-warning-700" },
|
|
46
47
|
danger: { icon: B, accent: "text-danger-700" }
|
|
47
|
-
},
|
|
48
|
+
}, Y = {
|
|
48
49
|
"bottom-end": "bottom-4 right-4",
|
|
49
50
|
bottom: "bottom-4 left-1/2 -translate-x-1/2",
|
|
50
51
|
"bottom-start": "bottom-4 left-4",
|
|
51
52
|
"top-end": "top-4 right-4",
|
|
52
53
|
top: "top-4 left-1/2 -translate-x-1/2",
|
|
53
54
|
"top-start": "top-4 left-4"
|
|
54
|
-
}, S = 12,
|
|
55
|
-
function
|
|
56
|
-
children:
|
|
55
|
+
}, S = 12, Z = 0.05;
|
|
56
|
+
function ut({
|
|
57
|
+
children: b,
|
|
57
58
|
placement: c = "bottom-end",
|
|
58
|
-
maxVisible:
|
|
59
|
+
maxVisible: p = 3
|
|
59
60
|
}) {
|
|
60
61
|
var k;
|
|
61
|
-
const [f,
|
|
62
|
-
|
|
62
|
+
const [f, y] = o.useState([]), s = o.useRef(/* @__PURE__ */ new Map()), l = o.useRef(/* @__PURE__ */ new Map()), r = o.useCallback((t) => {
|
|
63
|
+
y((u) => u.filter((h) => h.id !== t));
|
|
63
64
|
const n = s.current.get(t);
|
|
64
65
|
n && (clearTimeout(n), s.current.delete(t));
|
|
65
66
|
const e = l.current.get(t);
|
|
66
67
|
l.current.delete(t), e == null || e();
|
|
67
68
|
}, []), i = o.useCallback(() => {
|
|
68
|
-
|
|
69
|
+
y((t) => (t.forEach((n) => {
|
|
69
70
|
var u;
|
|
70
71
|
const e = s.current.get(n.id);
|
|
71
72
|
e && clearTimeout(e), s.current.delete(n.id), (u = l.current.get(n.id)) == null || u(), l.current.delete(n.id);
|
|
@@ -73,7 +74,7 @@ function ct({
|
|
|
73
74
|
}, []), d = o.useCallback(
|
|
74
75
|
(t, n = {}) => {
|
|
75
76
|
const e = Math.random().toString(36).slice(2), u = { variant: "default", ...n, id: e, title: t };
|
|
76
|
-
|
|
77
|
+
y((x) => [...x, u]), l.current.set(e, n.onClose);
|
|
77
78
|
const h = n.timeout ?? n.duration ?? (n.isLoading ? 0 : 5e3);
|
|
78
79
|
return h > 0 && s.current.set(e, setTimeout(() => r(e), h)), e;
|
|
79
80
|
},
|
|
@@ -85,9 +86,9 @@ function ct({
|
|
|
85
86
|
t.forEach((n) => clearTimeout(n)), t.clear();
|
|
86
87
|
};
|
|
87
88
|
}, []);
|
|
88
|
-
const
|
|
89
|
-
o.useEffect(() =>
|
|
90
|
-
const [
|
|
89
|
+
const m = o.useMemo(() => ({ push: d, close: r, clear: i }), [d, r, i]), [R, L] = o.useState(!1);
|
|
90
|
+
o.useEffect(() => L(!0), []);
|
|
91
|
+
const [w, P] = o.useState(null), E = o.useRef(null), j = (k = f[f.length - 1]) == null ? void 0 : k.id;
|
|
91
92
|
o.useLayoutEffect(() => {
|
|
92
93
|
const t = E.current;
|
|
93
94
|
if (!t) {
|
|
@@ -99,22 +100,22 @@ function ct({
|
|
|
99
100
|
const e = new ResizeObserver(n);
|
|
100
101
|
return e.observe(t), () => e.disconnect();
|
|
101
102
|
}, [j]);
|
|
102
|
-
const
|
|
103
|
-
return /* @__PURE__ */ T(z.Provider, { value:
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
const v = c.startsWith("top"), H = v ? 1 : -1, _ = Math.min(p, Math.max(f.length, 1)), I = w != null ? w + S * (_ - 1) : void 0;
|
|
104
|
+
return /* @__PURE__ */ T(z.Provider, { value: m, children: [
|
|
105
|
+
b,
|
|
106
|
+
R && A(
|
|
106
107
|
/* @__PURE__ */ a(
|
|
107
108
|
"div",
|
|
108
109
|
{
|
|
109
110
|
className: g(
|
|
110
111
|
"pointer-events-none fixed z-50 w-full max-w-sm",
|
|
111
|
-
|
|
112
|
+
Y[c]
|
|
112
113
|
),
|
|
113
114
|
style: { height: I },
|
|
114
115
|
role: "region",
|
|
115
116
|
"aria-label": "Notifications",
|
|
116
117
|
children: /* @__PURE__ */ a(O, { reducedMotion: "user", children: /* @__PURE__ */ a(W, { children: f.map((t, n) => {
|
|
117
|
-
const e = f.length - 1 - n, u = e === 0, h = e >=
|
|
118
|
+
const e = f.length - 1 - n, u = e === 0, h = e >= p, x = X[t.variant ?? "default"], $ = x.icon;
|
|
118
119
|
return /* @__PURE__ */ T(
|
|
119
120
|
F.div,
|
|
120
121
|
{
|
|
@@ -124,21 +125,21 @@ function ct({
|
|
|
124
125
|
"aria-live": "polite",
|
|
125
126
|
initial: {
|
|
126
127
|
opacity: 0,
|
|
127
|
-
transform: `translate3d(0, ${
|
|
128
|
+
transform: `translate3d(0, ${v ? -16 : 16}px, 0) scale(0.98)`
|
|
128
129
|
},
|
|
129
130
|
animate: {
|
|
130
131
|
opacity: h ? 0 : 1,
|
|
131
|
-
transform: `translate3d(0, ${H * e * S}px, 0) scale(${1 - e *
|
|
132
|
+
transform: `translate3d(0, ${H * e * S}px, 0) scale(${1 - e * Z})`
|
|
132
133
|
},
|
|
133
134
|
exit: {
|
|
134
135
|
opacity: 0,
|
|
135
|
-
transform: `translate3d(0, ${
|
|
136
|
+
transform: `translate3d(0, ${v ? -16 : 16}px, 0) scale(0.98)`,
|
|
136
137
|
transition: { duration: 0.14, ease: G }
|
|
137
138
|
},
|
|
138
139
|
transition: q,
|
|
139
140
|
className: g(
|
|
140
141
|
"group/toast absolute inset-x-0 flex items-start gap-1.5",
|
|
141
|
-
|
|
142
|
+
v ? "top-0" : "bottom-0",
|
|
142
143
|
"rounded-2xl bg-elevated px-4 py-3 shadow-elevation",
|
|
143
144
|
u ? "pointer-events-auto" : "pointer-events-none overflow-hidden"
|
|
144
145
|
),
|
|
@@ -146,25 +147,26 @@ function ct({
|
|
|
146
147
|
zIndex: 100 - e,
|
|
147
148
|
// Behind layers freeze at the front card's height so
|
|
148
149
|
// only their top edge shows as a clean sliver.
|
|
149
|
-
height: !u &&
|
|
150
|
+
height: !u && w != null ? w : void 0
|
|
150
151
|
},
|
|
151
152
|
children: [
|
|
153
|
+
/* @__PURE__ */ a(J, { origin: v ? "top" : "bottom" }),
|
|
152
154
|
/* @__PURE__ */ a(
|
|
153
155
|
"span",
|
|
154
156
|
{
|
|
155
157
|
className: g(
|
|
156
158
|
"flex shrink-0 select-none items-center justify-center p-1 [&_svg]:size-4",
|
|
157
|
-
|
|
159
|
+
x.accent
|
|
158
160
|
),
|
|
159
|
-
children: t.isLoading ? /* @__PURE__ */ a(
|
|
161
|
+
children: t.isLoading ? /* @__PURE__ */ a(Q, { size: "sm", "aria-label": "Loading" }) : t.indicator ?? /* @__PURE__ */ a($, { "aria-hidden": !0 })
|
|
160
162
|
}
|
|
161
163
|
),
|
|
162
164
|
/* @__PURE__ */ T("div", { className: "flex min-w-0 grow flex-col items-start self-center", children: [
|
|
163
|
-
/* @__PURE__ */ a("p", { className: g("text-xs font-
|
|
165
|
+
/* @__PURE__ */ a("p", { className: g("text-xs font-normal leading-5", x.accent), children: t.title }),
|
|
164
166
|
t.description && /* @__PURE__ */ a("p", { className: "text-xs text-muted-foreground", children: t.description })
|
|
165
167
|
] }),
|
|
166
168
|
t.actionProps && /* @__PURE__ */ a(
|
|
167
|
-
|
|
169
|
+
K,
|
|
168
170
|
{
|
|
169
171
|
size: "sm",
|
|
170
172
|
variant: t.actionProps.variant ?? "soft",
|
|
@@ -206,6 +208,6 @@ function ct({
|
|
|
206
208
|
] });
|
|
207
209
|
}
|
|
208
210
|
export {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
ut as ToastProvider,
|
|
212
|
+
lt as useToast
|
|
211
213
|
};
|
package/components/tooltip.js
CHANGED
|
@@ -1,69 +1,70 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as k, Fragment as F, jsx as g } from "react/jsx-runtime";
|
|
3
3
|
import * as r from "react";
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { MotionConfig as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { tooltipVariants as
|
|
8
|
-
|
|
4
|
+
import { createPortal as H } from "react-dom";
|
|
5
|
+
import { MotionConfig as I, AnimatePresence as N, motion as O } from "motion/react";
|
|
6
|
+
import { cn as S } from "../lib/cn.js";
|
|
7
|
+
import { tooltipVariants as j } from "../lib/motion.js";
|
|
8
|
+
import { Ripple as _ } from "./ripple.js";
|
|
9
|
+
const V = {
|
|
9
10
|
top: "bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",
|
|
10
11
|
bottom: "top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
11
12
|
left: "right-0 top-1/2 translate-x-1/2 -translate-y-1/2",
|
|
12
13
|
right: "left-0 top-1/2 -translate-x-1/2 -translate-y-1/2"
|
|
13
|
-
},
|
|
14
|
+
}, W = {
|
|
14
15
|
top: "bottom",
|
|
15
16
|
bottom: "top",
|
|
16
17
|
left: "right",
|
|
17
18
|
right: "left"
|
|
18
19
|
};
|
|
19
|
-
let
|
|
20
|
-
const
|
|
21
|
-
function
|
|
22
|
-
content:
|
|
23
|
-
children:
|
|
24
|
-
side:
|
|
25
|
-
delay:
|
|
26
|
-
className:
|
|
20
|
+
let z = 0;
|
|
21
|
+
const q = 300;
|
|
22
|
+
function Y({
|
|
23
|
+
content: B,
|
|
24
|
+
children: P,
|
|
25
|
+
side: a = "top",
|
|
26
|
+
delay: T = 300,
|
|
27
|
+
className: A
|
|
27
28
|
}) {
|
|
28
|
-
const [
|
|
29
|
-
|
|
29
|
+
const [l, w] = r.useState(!1), [x, v] = r.useState(!1), [i, C] = r.useState(null), M = r.useRef(null), y = r.useRef(null), d = r.useRef(null), R = r.useId(), b = () => {
|
|
30
|
+
d.current && (clearTimeout(d.current), d.current = null);
|
|
30
31
|
}, E = () => {
|
|
31
|
-
if (
|
|
32
|
-
|
|
32
|
+
if (b(), Date.now() - z < q) {
|
|
33
|
+
v(!0), w(!0);
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
36
|
+
v(!1), d.current = setTimeout(() => w(!0), T);
|
|
37
|
+
}, L = () => {
|
|
38
|
+
b(), l && (z = Date.now()), w(!1);
|
|
38
39
|
};
|
|
39
|
-
r.useEffect(() => () =>
|
|
40
|
-
if (!
|
|
41
|
-
const n =
|
|
40
|
+
r.useEffect(() => () => b(), []), r.useLayoutEffect(() => {
|
|
41
|
+
if (!l) return;
|
|
42
|
+
const n = M.current, e = y.current;
|
|
42
43
|
if (!n || !e) return;
|
|
43
44
|
const t = () => {
|
|
44
45
|
const o = n.getBoundingClientRect(), p = e.offsetWidth, m = e.offsetHeight, h = 6, s = 8;
|
|
45
|
-
let
|
|
46
|
-
switch (
|
|
46
|
+
let u = 0, f = 0;
|
|
47
|
+
switch (a) {
|
|
47
48
|
case "top":
|
|
48
|
-
|
|
49
|
+
u = o.top - m - h, f = o.left + o.width / 2 - p / 2;
|
|
49
50
|
break;
|
|
50
51
|
case "bottom":
|
|
51
|
-
|
|
52
|
+
u = o.bottom + h, f = o.left + o.width / 2 - p / 2;
|
|
52
53
|
break;
|
|
53
54
|
case "left":
|
|
54
|
-
|
|
55
|
+
u = o.top + o.height / 2 - m / 2, f = o.left - p - h;
|
|
55
56
|
break;
|
|
56
57
|
case "right":
|
|
57
|
-
|
|
58
|
+
u = o.top + o.height / 2 - m / 2, f = o.right + h;
|
|
58
59
|
break;
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
+
C({
|
|
61
62
|
top: Math.min(
|
|
62
|
-
Math.max(
|
|
63
|
+
Math.max(u, s),
|
|
63
64
|
Math.max(s, window.innerHeight - m - s)
|
|
64
65
|
),
|
|
65
66
|
left: Math.min(
|
|
66
|
-
Math.max(
|
|
67
|
+
Math.max(f, s),
|
|
67
68
|
Math.max(s, window.innerWidth - p - s)
|
|
68
69
|
)
|
|
69
70
|
});
|
|
@@ -71,66 +72,67 @@ function U({
|
|
|
71
72
|
return t(), window.addEventListener("resize", t), window.addEventListener("scroll", t, !0), () => {
|
|
72
73
|
window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
|
|
73
74
|
};
|
|
74
|
-
}, [
|
|
75
|
-
const
|
|
76
|
-
ref:
|
|
77
|
-
"aria-describedby":
|
|
75
|
+
}, [l, a]);
|
|
76
|
+
const c = P, D = r.cloneElement(c, {
|
|
77
|
+
ref: M,
|
|
78
|
+
"aria-describedby": l ? R : void 0,
|
|
78
79
|
onMouseEnter: (n) => {
|
|
79
80
|
var e, t;
|
|
80
|
-
(t = (e =
|
|
81
|
+
(t = (e = c.props).onMouseEnter) == null || t.call(e, n), E();
|
|
81
82
|
},
|
|
82
83
|
onMouseLeave: (n) => {
|
|
83
84
|
var e, t;
|
|
84
|
-
(t = (e =
|
|
85
|
+
(t = (e = c.props).onMouseLeave) == null || t.call(e, n), L();
|
|
85
86
|
},
|
|
86
87
|
onFocus: (n) => {
|
|
87
88
|
var e, t;
|
|
88
|
-
(t = (e =
|
|
89
|
+
(t = (e = c.props).onFocus) == null || t.call(e, n), E();
|
|
89
90
|
},
|
|
90
91
|
onBlur: (n) => {
|
|
91
92
|
var e, t;
|
|
92
|
-
(t = (e =
|
|
93
|
+
(t = (e = c.props).onBlur) == null || t.call(e, n), L();
|
|
93
94
|
}
|
|
94
95
|
});
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
96
|
+
return /* @__PURE__ */ k(F, { children: [
|
|
97
|
+
D,
|
|
98
|
+
H(
|
|
99
|
+
/* @__PURE__ */ g(I, { reducedMotion: "user", children: /* @__PURE__ */ g(N, { children: l && /* @__PURE__ */ k(
|
|
100
|
+
O.div,
|
|
100
101
|
{
|
|
101
|
-
ref:
|
|
102
|
+
ref: y,
|
|
102
103
|
role: "tooltip",
|
|
103
|
-
id:
|
|
104
|
-
variants:
|
|
104
|
+
id: R,
|
|
105
|
+
variants: j,
|
|
105
106
|
initial: "hidden",
|
|
106
107
|
animate: "visible",
|
|
107
108
|
exit: "hidden",
|
|
108
|
-
transition:
|
|
109
|
+
transition: x ? { duration: 0 } : void 0,
|
|
109
110
|
style: {
|
|
110
111
|
position: "fixed",
|
|
111
112
|
top: (i == null ? void 0 : i.top) ?? 0,
|
|
112
113
|
left: (i == null ? void 0 : i.left) ?? 0,
|
|
113
114
|
visibility: i ? "visible" : "hidden",
|
|
114
|
-
transformOrigin:
|
|
115
|
+
transformOrigin: W[a]
|
|
115
116
|
},
|
|
116
|
-
className:
|
|
117
|
+
className: S(
|
|
117
118
|
"relative z-50 max-w-xs rounded-md bg-foreground px-2 py-1",
|
|
118
119
|
"text-xs text-background",
|
|
119
120
|
"pointer-events-none select-none",
|
|
120
|
-
|
|
121
|
+
A
|
|
121
122
|
),
|
|
122
123
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
+
!x && /* @__PURE__ */ g(_, { origin: W[a] }),
|
|
125
|
+
/* @__PURE__ */ g(
|
|
124
126
|
"span",
|
|
125
127
|
{
|
|
126
128
|
"aria-hidden": !0,
|
|
127
|
-
className:
|
|
129
|
+
className: S(
|
|
128
130
|
"absolute size-2 rotate-45 rounded-[1px] bg-foreground",
|
|
129
|
-
|
|
131
|
+
V[a]
|
|
130
132
|
)
|
|
131
133
|
}
|
|
132
134
|
),
|
|
133
|
-
|
|
135
|
+
B
|
|
134
136
|
]
|
|
135
137
|
}
|
|
136
138
|
) }) }),
|
|
@@ -139,5 +141,5 @@ function U({
|
|
|
139
141
|
] });
|
|
140
142
|
}
|
|
141
143
|
export {
|
|
142
|
-
|
|
144
|
+
Y as Tooltip
|
|
143
145
|
};
|
package/components/tree.js
CHANGED
|
@@ -1,64 +1,67 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsx as e, jsxs as x, Fragment as N } from "react/jsx-runtime";
|
|
3
|
+
import * as t from "react";
|
|
4
4
|
import { cn as s } from "../lib/cn.js";
|
|
5
|
-
import { ChevronRight as
|
|
6
|
-
const
|
|
5
|
+
import { ChevronRight as _, FileText as z } from "../lib/icons.js";
|
|
6
|
+
const S = t.forwardRef(({ className: i, ...d }, f) => /* @__PURE__ */ e(
|
|
7
7
|
"div",
|
|
8
8
|
{
|
|
9
|
-
ref:
|
|
9
|
+
ref: f,
|
|
10
10
|
role: "tree",
|
|
11
|
-
className: s("text-xs",
|
|
12
|
-
...
|
|
11
|
+
className: s("flex flex-col gap-0.5 text-xs", i),
|
|
12
|
+
...d
|
|
13
13
|
}
|
|
14
14
|
));
|
|
15
|
-
|
|
16
|
-
const
|
|
15
|
+
S.displayName = "Tree";
|
|
16
|
+
const V = t.forwardRef(
|
|
17
17
|
({
|
|
18
|
-
className:
|
|
19
|
-
label:
|
|
20
|
-
icon:
|
|
21
|
-
count:
|
|
22
|
-
endContent:
|
|
23
|
-
defaultExpanded:
|
|
24
|
-
expanded:
|
|
18
|
+
className: i,
|
|
19
|
+
label: d,
|
|
20
|
+
icon: f,
|
|
21
|
+
count: p,
|
|
22
|
+
endContent: w,
|
|
23
|
+
defaultExpanded: y = !1,
|
|
24
|
+
expanded: h,
|
|
25
25
|
onExpandedChange: c,
|
|
26
|
-
href:
|
|
27
|
-
isActive:
|
|
28
|
-
onSelect:
|
|
29
|
-
children:
|
|
30
|
-
...
|
|
31
|
-
},
|
|
32
|
-
const
|
|
33
|
-
|
|
26
|
+
href: g,
|
|
27
|
+
isActive: o,
|
|
28
|
+
onSelect: C,
|
|
29
|
+
children: n,
|
|
30
|
+
...I
|
|
31
|
+
}, k) => {
|
|
32
|
+
const r = t.Children.count(n) > 0, v = h !== void 0, [T, R] = t.useState(y), l = v ? h : T, j = (a) => {
|
|
33
|
+
v || R(a), c == null || c(a);
|
|
34
34
|
}, m = s(
|
|
35
|
-
"flex h-
|
|
35
|
+
"flex h-9 w-full items-center gap-2 rounded-md px-2 text-left",
|
|
36
36
|
"outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring",
|
|
37
37
|
"[&_svg]:size-4 [&_svg]:shrink-0",
|
|
38
|
-
|
|
39
|
-
), u = /* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
o ? "bg-fill font-normal text-foreground" : "text-muted-foreground hover:bg-fill/60 hover:text-foreground"
|
|
39
|
+
), u = f ?? (r ? null : /* @__PURE__ */ e(z, { className: "text-tertiary" })), F = o && t.isValidElement(u) ? t.cloneElement(
|
|
40
|
+
u,
|
|
41
|
+
{ weight: "fill" }
|
|
42
|
+
) : u, b = /* @__PURE__ */ x(N, { children: [
|
|
43
|
+
F,
|
|
44
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: d }),
|
|
45
|
+
w,
|
|
46
|
+
r && /* @__PURE__ */ x(N, { children: [
|
|
47
|
+
(p ?? t.Children.count(n)) > 0 && /* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums text-xs text-tertiary", children: p ?? t.Children.count(n) }),
|
|
45
48
|
/* @__PURE__ */ e(
|
|
46
|
-
|
|
49
|
+
_,
|
|
47
50
|
{
|
|
48
51
|
className: s(
|
|
49
52
|
"text-muted-foreground transition-transform duration-(--duration-fast) motion-reduce:transition-none",
|
|
50
|
-
|
|
53
|
+
l && "rotate-90"
|
|
51
54
|
),
|
|
52
55
|
strokeWidth: 2
|
|
53
56
|
}
|
|
54
57
|
)
|
|
55
58
|
] })
|
|
56
59
|
] });
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
return /* @__PURE__ */ x("div", { ref: k, role: "treeitem", "aria-expanded": r ? l : void 0, "aria-selected": o, className: i, ...I, children: [
|
|
61
|
+
r ? /* @__PURE__ */ e("button", { type: "button", className: m, onClick: () => j(!l), children: b }) : g ? /* @__PURE__ */ e("a", { href: g, className: m, "aria-current": o ? "page" : void 0, children: b }) : /* @__PURE__ */ e("button", { type: "button", className: m, onClick: C, children: b }),
|
|
62
|
+
r && l && // ml-4 aligns the rail under the parent icon; each child carries the
|
|
60
63
|
// elbow (before) + rail continuation (after), hidden on the last.
|
|
61
|
-
/* @__PURE__ */ e("div", { role: "group", className: "ml-4", children:
|
|
64
|
+
/* @__PURE__ */ e("div", { role: "group", className: "ml-4 flex flex-col gap-0.5", children: t.Children.map(n, (a) => /* @__PURE__ */ e(
|
|
62
65
|
"div",
|
|
63
66
|
{
|
|
64
67
|
className: s(
|
|
@@ -79,8 +82,8 @@ const z = r.forwardRef(
|
|
|
79
82
|
] });
|
|
80
83
|
}
|
|
81
84
|
);
|
|
82
|
-
|
|
85
|
+
V.displayName = "TreeItem";
|
|
83
86
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
S as Tree,
|
|
88
|
+
V as TreeItem
|
|
86
89
|
};
|
package/components/typography.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import * as i from "react";
|
|
4
|
+
import { cn as c } from "../lib/cn.js";
|
|
5
5
|
const p = {
|
|
6
|
-
1: { tag: "h1", className: "text-2xl font-
|
|
7
|
-
2: { tag: "h2", className: "text-xl font-
|
|
8
|
-
3: { tag: "h3", className: "text-lg font-
|
|
9
|
-
4: { tag: "h4", className: "text-base font-
|
|
10
|
-
}, y =
|
|
11
|
-
({ className: e, level:
|
|
12
|
-
const { tag: r, className: l } = p[
|
|
13
|
-
return /* @__PURE__ */
|
|
6
|
+
1: { tag: "h1", className: "text-2xl font-semibold tracking-tight" },
|
|
7
|
+
2: { tag: "h2", className: "text-xl font-semibold tracking-tight" },
|
|
8
|
+
3: { tag: "h3", className: "text-lg font-semibold" },
|
|
9
|
+
4: { tag: "h4", className: "text-base font-semibold" }
|
|
10
|
+
}, y = i.forwardRef(
|
|
11
|
+
({ className: e, level: s = 1, children: t, ...o }, a) => {
|
|
12
|
+
const { tag: r, className: l } = p[s];
|
|
13
|
+
return /* @__PURE__ */ n(r, { ref: a, className: c(l, e), ...o, children: t });
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
16
|
y.displayName = "Heading";
|
|
@@ -21,40 +21,40 @@ const N = {
|
|
|
21
21
|
lg: "text-lg"
|
|
22
22
|
}, b = {
|
|
23
23
|
regular: "font-normal",
|
|
24
|
-
bold: "font-
|
|
25
|
-
},
|
|
24
|
+
bold: "font-semibold"
|
|
25
|
+
}, m = {
|
|
26
26
|
primary: "text-primary",
|
|
27
27
|
secondary: "text-secondary",
|
|
28
28
|
tertiary: "text-tertiary"
|
|
29
|
-
}, u =
|
|
30
|
-
({ className: e, size:
|
|
31
|
-
const g = r, f = t ?
|
|
32
|
-
return /* @__PURE__ */
|
|
29
|
+
}, u = i.forwardRef(
|
|
30
|
+
({ className: e, size: s = "md", color: t, muted: o = !1, weight: a, as: r = "p", children: l, ...x }, d) => {
|
|
31
|
+
const g = r, f = t ? m[t] : o ? m.tertiary : m.primary;
|
|
32
|
+
return /* @__PURE__ */ n(
|
|
33
33
|
g,
|
|
34
34
|
{
|
|
35
|
-
ref:
|
|
36
|
-
className:
|
|
37
|
-
N[
|
|
38
|
-
|
|
35
|
+
ref: d,
|
|
36
|
+
className: c(
|
|
37
|
+
N[s],
|
|
38
|
+
a && b[a],
|
|
39
39
|
f,
|
|
40
40
|
e
|
|
41
41
|
),
|
|
42
|
-
...
|
|
42
|
+
...x,
|
|
43
43
|
children: l
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
48
|
u.displayName = "Text";
|
|
49
|
-
const h =
|
|
49
|
+
const h = i.forwardRef(({ className: e, ...s }, t) => /* @__PURE__ */ n(
|
|
50
50
|
"code",
|
|
51
51
|
{
|
|
52
52
|
ref: t,
|
|
53
|
-
className:
|
|
53
|
+
className: c(
|
|
54
54
|
"rounded bg-muted px-1.5 py-0.5 tabular-nums text-xs",
|
|
55
55
|
e
|
|
56
56
|
),
|
|
57
|
-
...
|
|
57
|
+
...s
|
|
58
58
|
}
|
|
59
59
|
));
|
|
60
60
|
h.displayName = "Code";
|