@actioneer/ads 0.6.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.
- package/DESIGN.md +597 -0
- package/components/ai-elements/agent-trace.d.ts +2 -2
- package/components/ai-elements/agent-trace.js +164 -105
- package/components/ai-elements/chain-of-thought.d.ts +2 -2
- package/components/ai-elements/chain-of-thought.js +1 -1
- package/components/ai-elements/index.d.ts +0 -5
- package/components/ai-elements/inline-citation.js +1 -1
- package/components/alert.d.ts +6 -6
- package/components/alert.js +89 -53
- package/components/answer-sources.d.ts +2 -6
- package/components/answer-sources.js +58 -60
- package/components/answer.d.ts +5 -0
- package/components/answer.js +311 -271
- package/components/assistant-ui/action-bar.js +1 -1
- package/components/assistant-ui/attachment.js +11 -11
- package/components/assistant-ui/badge.js +18 -18
- package/components/assistant-ui/composer-harness.js +15 -20
- package/components/assistant-ui/composer-trigger-popover.js +9 -9
- package/components/assistant-ui/composer.d.ts +3 -1
- package/components/assistant-ui/composer.js +148 -144
- package/components/assistant-ui/image.js +61 -61
- package/components/assistant-ui/index.d.ts +0 -3
- package/components/assistant-ui/message-timing.js +1 -1
- package/components/assistant-ui/selection-toolbar.js +7 -7
- package/components/assistant-ui/thread-context.d.ts +3 -1
- package/components/assistant-ui/thread.js +50 -42
- package/components/avatar.js +42 -42
- package/components/badge.d.ts +5 -6
- package/components/badge.js +13 -76
- package/components/body-page-header.d.ts +15 -0
- package/components/body-page-header.js +24 -0
- package/components/brand-loader.d.ts +0 -3
- package/components/brand-loader.js +10 -32
- package/components/breadcrumbs.d.ts +0 -7
- package/components/breadcrumbs.js +54 -71
- package/components/button.d.ts +1 -1
- package/components/button.js +55 -49
- package/components/chart.js +298 -296
- package/components/chip.d.ts +13 -1
- package/components/chip.js +93 -80
- package/components/collection-header.d.ts +17 -0
- package/components/collection-header.js +31 -0
- package/components/connector-card.d.ts +6 -6
- package/components/connector-card.js +31 -32
- package/components/date-range-picker.d.ts +2 -1
- package/components/date-range-picker.js +158 -122
- package/components/divider.js +25 -25
- package/components/drawer.d.ts +6 -2
- package/components/drawer.js +61 -58
- package/components/dropdown.d.ts +1 -2
- package/components/dropdown.js +88 -89
- package/components/field.js +41 -36
- package/components/file-dropzone.js +1 -1
- package/components/index.d.ts +4 -4
- package/components/index.js +501 -549
- package/components/infinite-canvas.js +24 -24
- package/components/input-field.d.ts +18 -3
- package/components/input-field.js +88 -72
- package/components/input.js +32 -29
- package/components/modal.d.ts +31 -3
- package/components/modal.js +244 -170
- package/components/number-field.js +45 -42
- package/components/page-body.d.ts +12 -0
- package/components/page-body.js +18 -0
- package/components/pagination.js +36 -36
- package/components/pixel-blast-svg.js +71 -73
- package/components/select.d.ts +21 -0
- package/components/select.js +189 -148
- package/components/setting-row.d.ts +6 -5
- package/components/setting-row.js +33 -32
- package/components/sidebar.d.ts +2 -0
- package/components/sidebar.js +151 -141
- package/components/skeleton.js +8 -7
- package/components/slider.js +1 -1
- package/components/surface-loader.d.ts +11 -0
- package/components/surface-loader.js +35 -0
- package/components/table.d.ts +16 -10
- package/components/table.js +427 -412
- package/components/tabs.d.ts +2 -0
- package/components/tabs.js +160 -295
- package/components/textarea.js +9 -9
- package/components/toast.d.ts +1 -1
- package/components/toast.js +181 -118
- package/components/tree.d.ts +5 -1
- package/components/tree.js +54 -49
- package/components/typography.d.ts +4 -4
- package/components/typography.js +13 -13
- package/components/ui/button.d.ts +1 -1
- package/components/ui/button.js +4 -4
- package/components/ui/dialog.js +25 -25
- package/demo/components/add-to-artifact.js +6 -10
- package/lib/cn.js +11 -4
- package/lib/icons.d.ts +4 -0
- package/lib/icons.js +103 -102
- package/lib/interactive.d.ts +1 -1
- package/llms.txt +132 -188
- package/manifest.json +1719 -2831
- package/package.json +2 -2
- package/styles.css +362 -233
- package/theme.css +312 -177
- package/components/agent-icon.d.ts +0 -76
- package/components/agent-icon.js +0 -265
- package/components/ai-elements/queue.d.ts +0 -60
- package/components/ai-elements/queue.js +0 -193
- package/components/ai-elements/speech-input.d.ts +0 -16
- package/components/ai-elements/speech-input.js +0 -151
- package/components/ai-elements/task-progress.d.ts +0 -41
- package/components/ai-elements/task-progress.js +0 -224
- package/components/ai-elements/task.d.ts +0 -39
- package/components/ai-elements/task.js +0 -105
- package/components/ai-elements/voice.d.ts +0 -90
- package/components/ai-elements/voice.js +0 -496
- package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
- package/components/assistant-ui/follow-up-suggestions.js +0 -72
- package/components/assistant-ui/suggestions.d.ts +0 -7
- package/components/assistant-ui/suggestions.js +0 -19
- package/components/assistant-ui/voice.d.ts +0 -18
- package/components/link.d.ts +0 -14
- package/components/link.js +0 -72
- package/components/navbar.d.ts +0 -15
- package/components/navbar.js +0 -68
- package/components/pixel-icon.d.ts +0 -37
- package/components/pixel-icon.js +0 -859
package/components/toast.js
CHANGED
|
@@ -1,190 +1,253 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { MotionConfig as
|
|
6
|
-
import { WarningCircle as
|
|
7
|
-
import { cn as
|
|
2
|
+
import { jsxs as T, jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { createPortal as B } from "react-dom";
|
|
5
|
+
import { MotionConfig as V, AnimatePresence as q, motion as G } from "motion/react";
|
|
6
|
+
import { WarningCircle as J, Warning as K, Info as E, CheckCircle as Q, Close as U } from "../lib/icons.js";
|
|
7
|
+
import { cn as p } from "../lib/cn.js";
|
|
8
8
|
import { springOverlay as z } from "../lib/motion.js";
|
|
9
|
-
import { Ripple as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { Spinner as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
9
|
+
import { Ripple as X } from "./ripple.js";
|
|
10
|
+
import { Button as Y } from "./button.js";
|
|
11
|
+
import { Spinner as Z } from "./spinner.js";
|
|
12
|
+
const R = r.createContext(null);
|
|
13
|
+
function fe() {
|
|
14
|
+
const v = r.useContext(R);
|
|
15
|
+
if (!v)
|
|
16
16
|
throw new Error("useToast must be used within a <ToastProvider>.");
|
|
17
|
-
const { push:
|
|
18
|
-
return { toast:
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
const { title:
|
|
22
|
-
return
|
|
17
|
+
const { push: l, close: g, clear: d } = v;
|
|
18
|
+
return { toast: r.useMemo(() => {
|
|
19
|
+
const u = ((s, a) => {
|
|
20
|
+
if (s !== null && typeof s == "object" && !r.isValidElement(s)) {
|
|
21
|
+
const { title: i, ...h } = s;
|
|
22
|
+
return l(i, { ...h, ...a });
|
|
23
23
|
}
|
|
24
|
-
return
|
|
25
|
-
}),
|
|
26
|
-
return
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
typeof
|
|
24
|
+
return l(s, a);
|
|
25
|
+
}), f = (s) => (a, i) => l(a, { ...i, variant: s });
|
|
26
|
+
return u.success = f("success"), u.info = f("info"), u.warning = f("warning"), u.danger = f("danger"), u.close = g, u.clear = d, u.promise = (s, a) => {
|
|
27
|
+
const i = l(a.loading, { isLoading: !0, timeout: 0 });
|
|
28
|
+
return s.then((h) => {
|
|
29
|
+
g(i), l(
|
|
30
|
+
typeof a.success == "function" ? a.success(h) : a.success,
|
|
31
31
|
{ variant: "success" }
|
|
32
32
|
);
|
|
33
|
-
}).catch((
|
|
34
|
-
|
|
35
|
-
typeof
|
|
33
|
+
}).catch((h) => {
|
|
34
|
+
g(i), l(
|
|
35
|
+
typeof a.error == "function" ? a.error(h) : a.error,
|
|
36
36
|
{ variant: "danger" }
|
|
37
37
|
);
|
|
38
|
-
}),
|
|
39
|
-
},
|
|
40
|
-
}, [
|
|
38
|
+
}), s;
|
|
39
|
+
}, u;
|
|
40
|
+
}, [l, g, d]) };
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
default: { icon: E, accent: "text-foreground" },
|
|
44
|
-
success: { icon:
|
|
45
|
-
info: { icon: E, accent: "text-info-700" },
|
|
46
|
-
warning: { icon:
|
|
47
|
-
danger: { icon:
|
|
48
|
-
},
|
|
42
|
+
const ee = {
|
|
43
|
+
default: { icon: E, accent: "text-foreground", progress: "bg-action-primary" },
|
|
44
|
+
success: { icon: Q, accent: "text-success-700", progress: "bg-success-700" },
|
|
45
|
+
info: { icon: E, accent: "text-info-700", progress: "bg-info-700" },
|
|
46
|
+
warning: { icon: K, accent: "text-warning-700", progress: "bg-warning-700" },
|
|
47
|
+
danger: { icon: J, accent: "text-danger-700", progress: "bg-danger-700" }
|
|
48
|
+
}, te = {
|
|
49
49
|
"bottom-end": "bottom-4 right-4",
|
|
50
50
|
bottom: "bottom-4 left-1/2 -translate-x-1/2",
|
|
51
51
|
"bottom-start": "bottom-4 left-4",
|
|
52
52
|
"top-end": "top-4 right-4",
|
|
53
53
|
top: "top-4 left-1/2 -translate-x-1/2",
|
|
54
54
|
"top-start": "top-4 left-4"
|
|
55
|
-
},
|
|
56
|
-
function
|
|
57
|
-
children:
|
|
58
|
-
placement:
|
|
59
|
-
maxVisible:
|
|
55
|
+
}, A = 12, ne = 0.05;
|
|
56
|
+
function he({
|
|
57
|
+
children: v,
|
|
58
|
+
placement: l = "bottom-end",
|
|
59
|
+
maxVisible: g = 3
|
|
60
60
|
}) {
|
|
61
61
|
var M;
|
|
62
|
-
const [d,
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
const [d, w] = r.useState([]), [u, f] = r.useState(/* @__PURE__ */ new Set()), s = r.useRef(/* @__PURE__ */ new Map()), a = r.useRef(/* @__PURE__ */ new Map()), i = r.useCallback((e) => {
|
|
63
|
+
w((o) => o.filter((m) => m.id !== e));
|
|
64
|
+
const t = s.current.get(e);
|
|
65
|
+
t != null && t.handle && clearTimeout(t.handle), s.current.delete(e), f((o) => {
|
|
66
|
+
if (!o.has(e)) return o;
|
|
67
|
+
const m = new Set(o);
|
|
68
|
+
return m.delete(e), m;
|
|
69
|
+
});
|
|
70
|
+
const n = a.current.get(e);
|
|
71
|
+
a.current.delete(e), n == null || n();
|
|
72
|
+
}, []), h = r.useCallback(() => {
|
|
73
|
+
f(/* @__PURE__ */ new Set()), w((e) => (e.forEach((t) => {
|
|
74
|
+
var o;
|
|
75
|
+
const n = s.current.get(t.id);
|
|
76
|
+
n != null && n.handle && clearTimeout(n.handle), s.current.delete(t.id), (o = a.current.get(t.id)) == null || o(), a.current.delete(t.id);
|
|
73
77
|
}), []));
|
|
74
|
-
}, []),
|
|
75
|
-
(
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
}, []), k = r.useCallback(
|
|
79
|
+
(e, t = {}) => {
|
|
80
|
+
const n = Math.random().toString(36).slice(2), o = t.timeout ?? t.duration ?? (t.isLoading ? 0 : 5e3), m = {
|
|
81
|
+
variant: "default",
|
|
82
|
+
...t,
|
|
83
|
+
id: n,
|
|
84
|
+
title: e,
|
|
85
|
+
dismissAfter: o
|
|
86
|
+
};
|
|
87
|
+
return w((b) => [...b, m]), a.current.set(n, t.onClose), o > 0 && s.current.set(n, {
|
|
88
|
+
handle: setTimeout(() => i(n), o),
|
|
89
|
+
remaining: o,
|
|
90
|
+
startedAt: Date.now()
|
|
91
|
+
}), n;
|
|
80
92
|
},
|
|
81
|
-
[
|
|
93
|
+
[i]
|
|
94
|
+
), I = r.useCallback((e) => {
|
|
95
|
+
const t = s.current.get(e);
|
|
96
|
+
t != null && t.handle && (clearTimeout(t.handle), t.remaining = Math.max(0, t.remaining - (Date.now() - t.startedAt)), t.handle = null, f((n) => {
|
|
97
|
+
if (n.has(e)) return n;
|
|
98
|
+
const o = new Set(n);
|
|
99
|
+
return o.add(e), o;
|
|
100
|
+
}));
|
|
101
|
+
}, []), L = r.useCallback(
|
|
102
|
+
(e) => {
|
|
103
|
+
const t = s.current.get(e);
|
|
104
|
+
if (!(!t || t.handle)) {
|
|
105
|
+
if (f((n) => {
|
|
106
|
+
if (!n.has(e)) return n;
|
|
107
|
+
const o = new Set(n);
|
|
108
|
+
return o.delete(e), o;
|
|
109
|
+
}), t.remaining <= 0) {
|
|
110
|
+
i(e);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
t.startedAt = Date.now(), t.handle = setTimeout(() => i(e), t.remaining);
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
[i]
|
|
82
117
|
);
|
|
83
|
-
|
|
84
|
-
const
|
|
118
|
+
r.useEffect(() => {
|
|
119
|
+
const e = s.current;
|
|
85
120
|
return () => {
|
|
86
|
-
|
|
121
|
+
e.forEach((t) => {
|
|
122
|
+
t.handle && clearTimeout(t.handle);
|
|
123
|
+
}), e.clear();
|
|
87
124
|
};
|
|
88
125
|
}, []);
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
const [
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
if (!
|
|
95
|
-
|
|
126
|
+
const j = r.useMemo(() => ({ push: k, close: i, clear: h }), [k, i, h]), [H, $] = r.useState(!1);
|
|
127
|
+
r.useEffect(() => $(!0), []);
|
|
128
|
+
const [y, P] = r.useState(null), S = r.useRef(null), D = (M = d[d.length - 1]) == null ? void 0 : M.id;
|
|
129
|
+
r.useLayoutEffect(() => {
|
|
130
|
+
const e = S.current;
|
|
131
|
+
if (!e) {
|
|
132
|
+
P(null);
|
|
96
133
|
return;
|
|
97
134
|
}
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
return
|
|
102
|
-
}, [
|
|
103
|
-
const
|
|
104
|
-
return /* @__PURE__ */
|
|
105
|
-
|
|
106
|
-
|
|
135
|
+
const t = () => P(e.offsetHeight);
|
|
136
|
+
t();
|
|
137
|
+
const n = new ResizeObserver(t);
|
|
138
|
+
return n.observe(e), () => n.disconnect();
|
|
139
|
+
}, [D]);
|
|
140
|
+
const x = l.startsWith("top"), _ = x ? 1 : -1, O = Math.min(g, Math.max(d.length, 1)), W = y != null ? y + A * (O - 1) : void 0;
|
|
141
|
+
return /* @__PURE__ */ T(R.Provider, { value: j, children: [
|
|
142
|
+
v,
|
|
143
|
+
H && d.length > 0 && B(
|
|
107
144
|
/* @__PURE__ */ c(
|
|
108
145
|
"div",
|
|
109
146
|
{
|
|
110
|
-
className:
|
|
147
|
+
className: p(
|
|
111
148
|
"pointer-events-none fixed z-50 w-full max-w-sm",
|
|
112
|
-
|
|
149
|
+
te[l]
|
|
113
150
|
),
|
|
114
|
-
style: { height:
|
|
151
|
+
style: { height: W },
|
|
115
152
|
role: "region",
|
|
116
153
|
"aria-label": "Notifications",
|
|
117
|
-
children: /* @__PURE__ */ c(
|
|
118
|
-
const
|
|
119
|
-
return /* @__PURE__ */
|
|
120
|
-
|
|
154
|
+
children: /* @__PURE__ */ c(V, { reducedMotion: "user", children: /* @__PURE__ */ c(q, { children: d.map((e, t) => {
|
|
155
|
+
const n = d.length - 1 - t, o = n === 0, m = n >= g, b = ee[e.variant ?? "default"], F = b.icon;
|
|
156
|
+
return /* @__PURE__ */ T(
|
|
157
|
+
G.div,
|
|
121
158
|
{
|
|
122
|
-
ref:
|
|
159
|
+
ref: o ? S : void 0,
|
|
123
160
|
layout: !1,
|
|
124
161
|
role: "status",
|
|
125
162
|
"aria-live": "polite",
|
|
126
163
|
initial: {
|
|
127
164
|
opacity: 0,
|
|
128
|
-
transform: `translate3d(0, ${
|
|
165
|
+
transform: `translate3d(0, ${x ? -16 : 16}px, 0) scale(0.98)`
|
|
129
166
|
},
|
|
130
167
|
animate: {
|
|
131
|
-
opacity:
|
|
132
|
-
transform: `translate3d(0, ${
|
|
168
|
+
opacity: m ? 0 : 1,
|
|
169
|
+
transform: `translate3d(0, ${_ * n * A}px, 0) scale(${1 - n * ne})`
|
|
133
170
|
},
|
|
134
171
|
exit: {
|
|
135
172
|
opacity: 0,
|
|
136
|
-
transform: `translate3d(0, ${
|
|
173
|
+
transform: `translate3d(0, ${x ? -16 : 16}px, 0) scale(0.98)`,
|
|
137
174
|
transition: z
|
|
138
175
|
},
|
|
139
176
|
transition: z,
|
|
140
|
-
|
|
177
|
+
onMouseEnter: () => I(e.id),
|
|
178
|
+
onMouseLeave: () => L(e.id),
|
|
179
|
+
className: p(
|
|
141
180
|
"group/toast absolute inset-x-0 flex items-start gap-1.5",
|
|
142
|
-
|
|
143
|
-
"rounded-2xl bg-elevated px-4 py-3 shadow-
|
|
144
|
-
|
|
181
|
+
x ? "top-0" : "bottom-0",
|
|
182
|
+
"rounded-2xl border border-toast-stroke bg-elevated px-4 py-3 shadow-300",
|
|
183
|
+
o ? "pointer-events-auto" : "pointer-events-none overflow-hidden"
|
|
145
184
|
),
|
|
146
185
|
style: {
|
|
147
|
-
zIndex: 100 -
|
|
186
|
+
zIndex: 100 - n,
|
|
148
187
|
// Behind layers freeze at the front card's height so
|
|
149
188
|
// only their top edge shows as a clean sliver.
|
|
150
|
-
height: !
|
|
189
|
+
height: !o && y != null ? y : void 0
|
|
151
190
|
},
|
|
152
191
|
children: [
|
|
153
|
-
/* @__PURE__ */ c(
|
|
192
|
+
/* @__PURE__ */ c(X, { origin: x ? "top" : "bottom" }),
|
|
193
|
+
e.dismissAfter > 0 && // The countdown reads as the card's bottom bar stroke:
|
|
194
|
+
// a full-bleed edge bar clipped by the card's radius,
|
|
195
|
+
// not an inset line element floating inside the toast.
|
|
196
|
+
/* @__PURE__ */ T(
|
|
197
|
+
"span",
|
|
198
|
+
{
|
|
199
|
+
"aria-hidden": !0,
|
|
200
|
+
className: "pointer-events-none absolute inset-0 overflow-hidden rounded-2xl",
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ c("span", { className: "absolute inset-x-0 bottom-0 h-0.5 bg-toast-stroke" }),
|
|
203
|
+
/* @__PURE__ */ c(
|
|
204
|
+
"span",
|
|
205
|
+
{
|
|
206
|
+
"data-toast-progress": !0,
|
|
207
|
+
className: p("absolute inset-x-0 bottom-0 block h-0.5 origin-left", b.progress),
|
|
208
|
+
style: {
|
|
209
|
+
animation: `ads-toast-progress ${e.dismissAfter}ms linear forwards`,
|
|
210
|
+
animationPlayState: u.has(e.id) ? "paused" : "running"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
),
|
|
154
217
|
/* @__PURE__ */ c(
|
|
155
218
|
"span",
|
|
156
219
|
{
|
|
157
|
-
className:
|
|
220
|
+
className: p(
|
|
158
221
|
"flex shrink-0 select-none items-center justify-center p-1 [&_svg]:size-4",
|
|
159
|
-
|
|
222
|
+
b.accent
|
|
160
223
|
),
|
|
161
|
-
children:
|
|
224
|
+
children: e.isLoading ? /* @__PURE__ */ c(Z, { variant: "action", size: "sm", "aria-hidden": !0 }) : e.indicator ?? /* @__PURE__ */ c(F, { "aria-hidden": !0 })
|
|
162
225
|
}
|
|
163
226
|
),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */ c("p", { className:
|
|
166
|
-
|
|
227
|
+
/* @__PURE__ */ T("div", { className: "flex min-w-0 grow flex-col items-start self-center", children: [
|
|
228
|
+
/* @__PURE__ */ c("p", { className: p("text-m font-medium", b.accent), children: e.title }),
|
|
229
|
+
e.description && /* @__PURE__ */ c("p", { className: "text-xs text-muted-foreground", children: e.description })
|
|
167
230
|
] }),
|
|
168
|
-
|
|
169
|
-
|
|
231
|
+
e.actionProps && /* @__PURE__ */ c(
|
|
232
|
+
Y,
|
|
170
233
|
{
|
|
171
234
|
size: "sm",
|
|
172
|
-
variant:
|
|
173
|
-
className:
|
|
235
|
+
variant: e.actionProps.variant ?? "secondary",
|
|
236
|
+
className: p("ml-2 shrink-0 self-center rounded-full", e.actionProps.className),
|
|
174
237
|
onClick: () => {
|
|
175
238
|
var C, N;
|
|
176
|
-
return (N = (C =
|
|
239
|
+
return (N = (C = e.actionProps) == null ? void 0 : C.onClick) == null ? void 0 : N.call(C);
|
|
177
240
|
},
|
|
178
|
-
children:
|
|
241
|
+
children: e.actionProps.children
|
|
179
242
|
}
|
|
180
243
|
),
|
|
181
244
|
/* @__PURE__ */ c(
|
|
182
245
|
"button",
|
|
183
246
|
{
|
|
184
247
|
type: "button",
|
|
185
|
-
onClick: () =>
|
|
248
|
+
onClick: () => i(e.id),
|
|
186
249
|
"aria-label": "Dismiss",
|
|
187
|
-
className:
|
|
250
|
+
className: p(
|
|
188
251
|
"absolute -right-1 -top-1 inline-flex size-5 items-center justify-center",
|
|
189
252
|
"rounded-full border border-border bg-elevated text-muted-foreground shadow-elevation",
|
|
190
253
|
"opacity-0 transition-opacity duration-150 ease-out",
|
|
@@ -193,12 +256,12 @@ function lt({
|
|
|
193
256
|
"outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
194
257
|
"[&_svg]:size-3 [&_svg]:shrink-0"
|
|
195
258
|
),
|
|
196
|
-
children: /* @__PURE__ */ c(
|
|
259
|
+
children: /* @__PURE__ */ c(U, { "aria-hidden": !0 })
|
|
197
260
|
}
|
|
198
261
|
)
|
|
199
262
|
]
|
|
200
263
|
},
|
|
201
|
-
|
|
264
|
+
e.id
|
|
202
265
|
);
|
|
203
266
|
}) }) })
|
|
204
267
|
}
|
|
@@ -208,6 +271,6 @@ function lt({
|
|
|
208
271
|
] });
|
|
209
272
|
}
|
|
210
273
|
export {
|
|
211
|
-
|
|
212
|
-
|
|
274
|
+
he as ToastProvider,
|
|
275
|
+
fe as useToast
|
|
213
276
|
};
|
package/components/tree.d.ts
CHANGED
|
@@ -17,7 +17,11 @@ import * as React from "react";
|
|
|
17
17
|
* The connector is a functional stroke (like Divider), not a surface border —
|
|
18
18
|
* the one sanctioned place strokes belong (principle 1).
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export interface TreeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
/** Match Tree rows to Sidebar navigation styling. */
|
|
22
|
+
variant?: "default" | "sidebar";
|
|
23
|
+
}
|
|
24
|
+
export declare const Tree: React.ForwardRefExoticComponent<TreeProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
25
|
export interface TreeItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
22
26
|
/** Row label. */
|
|
23
27
|
label: React.ReactNode;
|
package/components/tree.js
CHANGED
|
@@ -1,93 +1,98 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as i, Fragment as T } from "react/jsx-runtime";
|
|
3
3
|
import * as t from "react";
|
|
4
|
-
import { MotionConfig as
|
|
5
|
-
import { cn as
|
|
4
|
+
import { MotionConfig as M, AnimatePresence as $, motion as D } from "motion/react";
|
|
5
|
+
import { cn as f } from "../lib/cn.js";
|
|
6
6
|
import { ChevronRight as V, FileText as W } from "../lib/icons.js";
|
|
7
7
|
import { springDisclosure as q } from "../lib/motion.js";
|
|
8
|
-
const B = t.forwardRef(
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const B = t.forwardRef(
|
|
9
|
+
({ className: u, variant: a = "default", ...m }, n) => /* @__PURE__ */ e(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
ref: n,
|
|
13
|
+
role: "tree",
|
|
14
|
+
"data-variant": a,
|
|
15
|
+
className: f("group/tree flex flex-col gap-0.5 text-xs", u),
|
|
16
|
+
...m
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
);
|
|
17
20
|
B.displayName = "Tree";
|
|
18
21
|
const E = t.forwardRef(
|
|
19
22
|
({
|
|
20
|
-
className:
|
|
21
|
-
label:
|
|
23
|
+
className: u,
|
|
24
|
+
label: a,
|
|
22
25
|
icon: m,
|
|
23
|
-
count:
|
|
24
|
-
endContent:
|
|
26
|
+
count: n,
|
|
27
|
+
endContent: v,
|
|
25
28
|
defaultExpanded: R = !1,
|
|
26
|
-
expanded:
|
|
27
|
-
onExpandedChange:
|
|
28
|
-
href:
|
|
29
|
+
expanded: x,
|
|
30
|
+
onExpandedChange: g,
|
|
31
|
+
href: w,
|
|
29
32
|
isActive: s,
|
|
30
33
|
onSelect: b,
|
|
31
34
|
children: l,
|
|
32
|
-
...
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
"flex h-9 w-full items-center gap-1.5 rounded-md px-2 text-left",
|
|
35
|
+
..._
|
|
36
|
+
}, j) => {
|
|
37
|
+
const o = t.Children.count(l) > 0, y = x !== void 0, [z, F] = t.useState(R), r = y ? x : z, N = (c) => {
|
|
38
|
+
y || F(c), g == null || g(c);
|
|
39
|
+
}, d = f(
|
|
40
|
+
"group/tree-row flex h-9 w-full items-center gap-1.5 rounded-md px-2 text-left",
|
|
38
41
|
"outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring",
|
|
39
42
|
"[&_svg]:size-4 [&_svg]:shrink-0",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
"group-data-[variant=sidebar]/tree:border group-data-[variant=sidebar]/tree:border-transparent group-data-[variant=sidebar]/tree:text-wg11",
|
|
44
|
+
"group-data-[variant=sidebar]/tree:[&_svg]:size-5 group-data-[variant=sidebar]/tree:[&_svg]:text-wg11",
|
|
45
|
+
s ? "bg-fill font-normal text-foreground group-data-[variant=sidebar]/tree:border-wg4 group-data-[variant=sidebar]/tree:bg-wg2 group-data-[variant=sidebar]/tree:text-wg11" : "text-muted-foreground hover:bg-fill/60 hover:text-foreground group-data-[variant=sidebar]/tree:hover:bg-wg1 group-data-[variant=sidebar]/tree:hover:text-wg11"
|
|
46
|
+
), p = m ?? (o ? null : /* @__PURE__ */ e(W, { className: "text-tertiary" })), k = s && t.isValidElement(p) ? t.cloneElement(
|
|
47
|
+
p,
|
|
43
48
|
{ weight: "fill" }
|
|
44
|
-
) :
|
|
49
|
+
) : p, C = /* @__PURE__ */ e(
|
|
45
50
|
V,
|
|
46
51
|
{
|
|
47
|
-
className:
|
|
52
|
+
className: f(
|
|
48
53
|
"text-muted-foreground transition-transform duration-150 motion-reduce:transition-none",
|
|
49
54
|
r && "rotate-90"
|
|
50
55
|
),
|
|
51
56
|
strokeWidth: 2
|
|
52
57
|
}
|
|
53
|
-
), I = (
|
|
54
|
-
|
|
55
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
), I = (n ?? t.Children.count(l)) > 0 && /* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums text-xs text-tertiary", children: n ?? t.Children.count(l) }), h = /* @__PURE__ */ i(T, { children: [
|
|
59
|
+
k,
|
|
60
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: a }),
|
|
61
|
+
v,
|
|
62
|
+
o && /* @__PURE__ */ i(T, { children: [
|
|
58
63
|
I,
|
|
59
|
-
|
|
64
|
+
C
|
|
60
65
|
] })
|
|
61
66
|
] });
|
|
62
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
63
|
-
|
|
67
|
+
return /* @__PURE__ */ i("div", { ref: j, role: "treeitem", "aria-expanded": o ? r : void 0, "aria-selected": s, className: u, ..._, children: [
|
|
68
|
+
o && b ? /* @__PURE__ */ i("div", { className: d, children: [
|
|
64
69
|
/* @__PURE__ */ i(
|
|
65
70
|
"button",
|
|
66
71
|
{
|
|
67
72
|
type: "button",
|
|
68
|
-
className: "flex min-w-0 flex-1 items-center gap-1.5 rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
73
|
+
className: "flex min-w-0 flex-1 items-center gap-1.5 rounded-sm text-left outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
69
74
|
onClick: b,
|
|
70
75
|
children: [
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children:
|
|
76
|
+
k,
|
|
77
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: a })
|
|
73
78
|
]
|
|
74
79
|
}
|
|
75
80
|
),
|
|
76
|
-
|
|
81
|
+
v,
|
|
77
82
|
I,
|
|
78
83
|
/* @__PURE__ */ e(
|
|
79
84
|
"button",
|
|
80
85
|
{
|
|
81
86
|
type: "button",
|
|
82
|
-
"aria-label": `${r ? "Collapse" : "Expand"} ${typeof
|
|
87
|
+
"aria-label": `${r ? "Collapse" : "Expand"} ${typeof a == "string" ? a : "tree item"}`,
|
|
83
88
|
"aria-expanded": r,
|
|
84
89
|
className: "inline-flex size-7 shrink-0 items-center justify-center rounded-sm outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring",
|
|
85
|
-
onClick: () =>
|
|
86
|
-
children:
|
|
90
|
+
onClick: () => N(!r),
|
|
91
|
+
children: C
|
|
87
92
|
}
|
|
88
93
|
)
|
|
89
|
-
] }) :
|
|
90
|
-
/* @__PURE__ */ e(
|
|
94
|
+
] }) : o ? /* @__PURE__ */ e("button", { type: "button", className: d, onClick: () => N(!r), children: h }) : w ? /* @__PURE__ */ e("a", { href: w, className: d, "aria-current": s ? "page" : void 0, children: h }) : /* @__PURE__ */ e("button", { type: "button", className: d, onClick: b, children: h }),
|
|
95
|
+
/* @__PURE__ */ e(M, { reducedMotion: "user", children: /* @__PURE__ */ e($, { initial: !1, children: o && r && /* @__PURE__ */ e(
|
|
91
96
|
D.div,
|
|
92
97
|
{
|
|
93
98
|
role: "group",
|
|
@@ -99,7 +104,7 @@ const E = t.forwardRef(
|
|
|
99
104
|
children: t.Children.map(l, (c) => /* @__PURE__ */ e(
|
|
100
105
|
"div",
|
|
101
106
|
{
|
|
102
|
-
className:
|
|
107
|
+
className: f(
|
|
103
108
|
"relative ps-5",
|
|
104
109
|
// Continuous vertical rail — a straight line (no radius) so it
|
|
105
110
|
// never breaks between children. The LAST child needs no rail
|
|
@@ -107,11 +112,11 @@ const E = t.forwardRef(
|
|
|
107
112
|
// segment, so a rail there would poke through the curve.
|
|
108
113
|
// Extend through the group's 2px row gap so the shared
|
|
109
114
|
// spine remains visually continuous between elbows.
|
|
110
|
-
"before:absolute before:left-0 before:top-0 before:-bottom-0.5 before:border-l before:border-
|
|
115
|
+
"before:absolute before:left-0 before:top-0 before:-bottom-0.5 before:border-l before:border-tree-stroke before:content-['']",
|
|
111
116
|
"last:before:hidden",
|
|
112
117
|
// Rounded elbow branching off the rail to this child. Its own
|
|
113
118
|
// left border overlaps the rail, so the curve reads cleanly.
|
|
114
|
-
"after:absolute after:left-0 after:top-0 after:h-4 after:w-4 after:rounded-bl-[9px] after:border-b after:border-l after:border-
|
|
119
|
+
"after:absolute after:left-0 after:top-0 after:h-4 after:w-4 after:rounded-bl-[9px] after:border-b after:border-l after:border-tree-stroke after:content-['']"
|
|
115
120
|
),
|
|
116
121
|
children: c
|
|
117
122
|
}
|
|
@@ -4,10 +4,10 @@ export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
|
4
4
|
}
|
|
5
5
|
export declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
6
6
|
declare const textSizes: {
|
|
7
|
-
readonly xs: "text-
|
|
8
|
-
readonly sm: "text-
|
|
9
|
-
readonly md: "text-
|
|
10
|
-
readonly lg: "text-
|
|
7
|
+
readonly xs: "text-s";
|
|
8
|
+
readonly sm: "text-s";
|
|
9
|
+
readonly md: "text-m";
|
|
10
|
+
readonly lg: "text-l";
|
|
11
11
|
};
|
|
12
12
|
declare const textWeights: {
|
|
13
13
|
readonly regular: "font-normal";
|