@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.
Files changed (123) hide show
  1. package/DESIGN.md +597 -0
  2. package/components/ai-elements/agent-trace.d.ts +2 -2
  3. package/components/ai-elements/agent-trace.js +164 -105
  4. package/components/ai-elements/chain-of-thought.d.ts +2 -2
  5. package/components/ai-elements/chain-of-thought.js +1 -1
  6. package/components/ai-elements/index.d.ts +0 -5
  7. package/components/ai-elements/inline-citation.js +1 -1
  8. package/components/alert.d.ts +6 -6
  9. package/components/alert.js +89 -53
  10. package/components/answer-sources.d.ts +2 -6
  11. package/components/answer-sources.js +58 -60
  12. package/components/answer.d.ts +5 -0
  13. package/components/answer.js +311 -271
  14. package/components/assistant-ui/action-bar.js +1 -1
  15. package/components/assistant-ui/attachment.js +11 -11
  16. package/components/assistant-ui/badge.js +18 -18
  17. package/components/assistant-ui/composer-harness.js +15 -20
  18. package/components/assistant-ui/composer-trigger-popover.js +9 -9
  19. package/components/assistant-ui/composer.d.ts +3 -1
  20. package/components/assistant-ui/composer.js +148 -144
  21. package/components/assistant-ui/image.js +61 -61
  22. package/components/assistant-ui/index.d.ts +0 -3
  23. package/components/assistant-ui/message-timing.js +1 -1
  24. package/components/assistant-ui/selection-toolbar.js +7 -7
  25. package/components/assistant-ui/thread-context.d.ts +3 -1
  26. package/components/assistant-ui/thread.js +50 -42
  27. package/components/avatar.js +42 -42
  28. package/components/badge.d.ts +5 -6
  29. package/components/badge.js +13 -76
  30. package/components/body-page-header.d.ts +15 -0
  31. package/components/body-page-header.js +24 -0
  32. package/components/brand-loader.d.ts +0 -3
  33. package/components/brand-loader.js +10 -32
  34. package/components/breadcrumbs.d.ts +0 -7
  35. package/components/breadcrumbs.js +54 -71
  36. package/components/button.d.ts +1 -1
  37. package/components/button.js +55 -49
  38. package/components/chart.js +298 -296
  39. package/components/chip.d.ts +13 -1
  40. package/components/chip.js +93 -80
  41. package/components/collection-header.d.ts +17 -0
  42. package/components/collection-header.js +31 -0
  43. package/components/connector-card.d.ts +6 -6
  44. package/components/connector-card.js +31 -32
  45. package/components/date-range-picker.d.ts +2 -1
  46. package/components/date-range-picker.js +158 -122
  47. package/components/divider.js +25 -25
  48. package/components/drawer.d.ts +6 -2
  49. package/components/drawer.js +61 -58
  50. package/components/dropdown.d.ts +1 -2
  51. package/components/dropdown.js +88 -89
  52. package/components/field.js +41 -36
  53. package/components/file-dropzone.js +1 -1
  54. package/components/index.d.ts +4 -4
  55. package/components/index.js +501 -549
  56. package/components/infinite-canvas.js +24 -24
  57. package/components/input-field.d.ts +18 -3
  58. package/components/input-field.js +88 -72
  59. package/components/input.js +32 -29
  60. package/components/modal.d.ts +31 -3
  61. package/components/modal.js +244 -170
  62. package/components/number-field.js +45 -42
  63. package/components/page-body.d.ts +12 -0
  64. package/components/page-body.js +18 -0
  65. package/components/pagination.js +36 -36
  66. package/components/pixel-blast-svg.js +71 -73
  67. package/components/select.d.ts +21 -0
  68. package/components/select.js +189 -148
  69. package/components/setting-row.d.ts +6 -5
  70. package/components/setting-row.js +33 -32
  71. package/components/sidebar.d.ts +2 -0
  72. package/components/sidebar.js +151 -141
  73. package/components/skeleton.js +8 -7
  74. package/components/slider.js +1 -1
  75. package/components/surface-loader.d.ts +11 -0
  76. package/components/surface-loader.js +35 -0
  77. package/components/table.d.ts +16 -10
  78. package/components/table.js +427 -412
  79. package/components/tabs.d.ts +2 -0
  80. package/components/tabs.js +160 -295
  81. package/components/textarea.js +9 -9
  82. package/components/toast.d.ts +1 -1
  83. package/components/toast.js +181 -118
  84. package/components/tree.d.ts +5 -1
  85. package/components/tree.js +54 -49
  86. package/components/typography.d.ts +4 -4
  87. package/components/typography.js +13 -13
  88. package/components/ui/button.d.ts +1 -1
  89. package/components/ui/button.js +4 -4
  90. package/components/ui/dialog.js +25 -25
  91. package/demo/components/add-to-artifact.js +6 -10
  92. package/lib/cn.js +11 -4
  93. package/lib/icons.d.ts +4 -0
  94. package/lib/icons.js +103 -102
  95. package/lib/interactive.d.ts +1 -1
  96. package/llms.txt +132 -188
  97. package/manifest.json +1719 -2831
  98. package/package.json +2 -2
  99. package/styles.css +362 -233
  100. package/theme.css +312 -177
  101. package/components/agent-icon.d.ts +0 -76
  102. package/components/agent-icon.js +0 -265
  103. package/components/ai-elements/queue.d.ts +0 -60
  104. package/components/ai-elements/queue.js +0 -193
  105. package/components/ai-elements/speech-input.d.ts +0 -16
  106. package/components/ai-elements/speech-input.js +0 -151
  107. package/components/ai-elements/task-progress.d.ts +0 -41
  108. package/components/ai-elements/task-progress.js +0 -224
  109. package/components/ai-elements/task.d.ts +0 -39
  110. package/components/ai-elements/task.js +0 -105
  111. package/components/ai-elements/voice.d.ts +0 -90
  112. package/components/ai-elements/voice.js +0 -496
  113. package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
  114. package/components/assistant-ui/follow-up-suggestions.js +0 -72
  115. package/components/assistant-ui/suggestions.d.ts +0 -7
  116. package/components/assistant-ui/suggestions.js +0 -19
  117. package/components/assistant-ui/voice.d.ts +0 -18
  118. package/components/link.d.ts +0 -14
  119. package/components/link.js +0 -72
  120. package/components/navbar.d.ts +0 -15
  121. package/components/navbar.js +0 -68
  122. package/components/pixel-icon.d.ts +0 -37
  123. package/components/pixel-icon.js +0 -859
@@ -1,190 +1,253 @@
1
1
  "use client";
2
- import { jsxs as P, jsx as c } from "react/jsx-runtime";
3
- import * as o from "react";
4
- import { createPortal as W } from "react-dom";
5
- import { MotionConfig as A, AnimatePresence as F, motion as B } from "motion/react";
6
- import { WarningCircle as D, Warning as V, Info as E, CheckCircle as q, Close as G } from "../lib/icons.js";
7
- import { cn as g } from "../lib/cn.js";
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 J } from "./ripple.js";
10
- import { Button as K } from "./button.js";
11
- import { Spinner as Q } from "./spinner.js";
12
- const S = o.createContext(null);
13
- function at() {
14
- const b = o.useContext(S);
15
- if (!b)
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: a, close: p, clear: d } = b;
18
- return { toast: o.useMemo(() => {
19
- const s = ((r, i) => {
20
- if (r !== null && typeof r == "object" && !o.isValidElement(r)) {
21
- const { title: f, ...m } = r;
22
- return a(f, { ...m, ...i });
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 a(r, i);
25
- }), l = (r) => (i, f) => a(i, { ...f, variant: r });
26
- return s.success = l("success"), s.info = l("info"), s.warning = l("warning"), s.danger = l("danger"), s.close = p, s.clear = d, s.promise = (r, i) => {
27
- const f = a(i.loading, { isLoading: !0, timeout: 0 });
28
- return r.then((m) => {
29
- p(f), a(
30
- typeof i.success == "function" ? i.success(m) : i.success,
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((m) => {
34
- p(f), a(
35
- typeof i.error == "function" ? i.error(m) : i.error,
33
+ }).catch((h) => {
34
+ g(i), l(
35
+ typeof a.error == "function" ? a.error(h) : a.error,
36
36
  { variant: "danger" }
37
37
  );
38
- }), r;
39
- }, s;
40
- }, [a, p, d]) };
38
+ }), s;
39
+ }, u;
40
+ }, [l, g, d]) };
41
41
  }
42
- const U = {
43
- default: { icon: E, accent: "text-foreground" },
44
- success: { icon: q, accent: "text-success-700" },
45
- info: { icon: E, accent: "text-info-700" },
46
- warning: { icon: V, accent: "text-warning-700" },
47
- danger: { icon: D, accent: "text-danger-700" }
48
- }, X = {
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
- }, R = 12, Y = 0.05;
56
- function lt({
57
- children: b,
58
- placement: a = "bottom-end",
59
- maxVisible: p = 3
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, 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));
64
- const n = s.current.get(t);
65
- n && (clearTimeout(n), s.current.delete(t));
66
- const e = l.current.get(t);
67
- l.current.delete(t), e == null || e();
68
- }, []), i = o.useCallback(() => {
69
- y((t) => (t.forEach((n) => {
70
- var u;
71
- const e = s.current.get(n.id);
72
- e && clearTimeout(e), s.current.delete(n.id), (u = l.current.get(n.id)) == null || u(), l.current.delete(n.id);
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
- }, []), f = o.useCallback(
75
- (t, n = {}) => {
76
- const e = Math.random().toString(36).slice(2), u = { variant: "default", ...n, id: e, title: t };
77
- y((x) => [...x, u]), l.current.set(e, n.onClose);
78
- const h = n.timeout ?? n.duration ?? (n.isLoading ? 0 : 5e3);
79
- return h > 0 && s.current.set(e, setTimeout(() => r(e), h)), e;
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
- [r]
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
- o.useEffect(() => {
84
- const t = s.current;
118
+ r.useEffect(() => {
119
+ const e = s.current;
85
120
  return () => {
86
- t.forEach((n) => clearTimeout(n)), t.clear();
121
+ e.forEach((t) => {
122
+ t.handle && clearTimeout(t.handle);
123
+ }), e.clear();
87
124
  };
88
125
  }, []);
89
- const m = o.useMemo(() => ({ push: f, close: r, clear: i }), [f, r, i]), [j, H] = o.useState(!1);
90
- o.useEffect(() => H(!0), []);
91
- const [w, T] = o.useState(null), k = o.useRef(null), L = (M = d[d.length - 1]) == null ? void 0 : M.id;
92
- o.useLayoutEffect(() => {
93
- const t = k.current;
94
- if (!t) {
95
- T(null);
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 n = () => T(t.offsetHeight);
99
- n();
100
- const e = new ResizeObserver(n);
101
- return e.observe(t), () => e.disconnect();
102
- }, [L]);
103
- const v = a.startsWith("top"), I = v ? 1 : -1, _ = Math.min(p, Math.max(d.length, 1)), $ = w != null ? w + R * (_ - 1) : void 0;
104
- return /* @__PURE__ */ P(S.Provider, { value: m, children: [
105
- b,
106
- j && d.length > 0 && W(
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: g(
147
+ className: p(
111
148
  "pointer-events-none fixed z-50 w-full max-w-sm",
112
- X[a]
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(A, { reducedMotion: "user", children: /* @__PURE__ */ c(F, { children: d.map((t, n) => {
118
- const e = d.length - 1 - n, u = e === 0, h = e >= p, x = U[t.variant ?? "default"], O = x.icon;
119
- return /* @__PURE__ */ P(
120
- B.div,
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: u ? k : void 0,
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, ${v ? -16 : 16}px, 0) scale(0.98)`
165
+ transform: `translate3d(0, ${x ? -16 : 16}px, 0) scale(0.98)`
129
166
  },
130
167
  animate: {
131
- opacity: h ? 0 : 1,
132
- transform: `translate3d(0, ${I * e * R}px, 0) scale(${1 - e * Y})`
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, ${v ? -16 : 16}px, 0) scale(0.98)`,
173
+ transform: `translate3d(0, ${x ? -16 : 16}px, 0) scale(0.98)`,
137
174
  transition: z
138
175
  },
139
176
  transition: z,
140
- className: g(
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
- v ? "top-0" : "bottom-0",
143
- "rounded-2xl bg-elevated px-4 py-3 shadow-elevation",
144
- u ? "pointer-events-auto" : "pointer-events-none overflow-hidden"
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 - e,
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: !u && w != null ? w : void 0
189
+ height: !o && y != null ? y : void 0
151
190
  },
152
191
  children: [
153
- /* @__PURE__ */ c(J, { origin: v ? "top" : "bottom" }),
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: g(
220
+ className: p(
158
221
  "flex shrink-0 select-none items-center justify-center p-1 [&_svg]:size-4",
159
- x.accent
222
+ b.accent
160
223
  ),
161
- children: t.isLoading ? /* @__PURE__ */ c(Q, { variant: "action", size: "sm", "aria-hidden": !0 }) : t.indicator ?? /* @__PURE__ */ c(O, { "aria-hidden": !0 })
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__ */ P("div", { className: "flex min-w-0 grow flex-col items-start self-center", children: [
165
- /* @__PURE__ */ c("p", { className: g("text-xs font-normal leading-5", x.accent), children: t.title }),
166
- t.description && /* @__PURE__ */ c("p", { className: "text-xs text-muted-foreground", children: t.description })
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
- t.actionProps && /* @__PURE__ */ c(
169
- K,
231
+ e.actionProps && /* @__PURE__ */ c(
232
+ Y,
170
233
  {
171
234
  size: "sm",
172
- variant: t.actionProps.variant ?? "soft",
173
- className: g("ml-2 shrink-0 self-center rounded-full", t.actionProps.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 = t.actionProps) == null ? void 0 : C.onClick) == null ? void 0 : N.call(C);
239
+ return (N = (C = e.actionProps) == null ? void 0 : C.onClick) == null ? void 0 : N.call(C);
177
240
  },
178
- children: t.actionProps.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: () => r(t.id),
248
+ onClick: () => i(e.id),
186
249
  "aria-label": "Dismiss",
187
- className: g(
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(G, { "aria-hidden": !0 })
259
+ children: /* @__PURE__ */ c(U, { "aria-hidden": !0 })
197
260
  }
198
261
  )
199
262
  ]
200
263
  },
201
- t.id
264
+ e.id
202
265
  );
203
266
  }) }) })
204
267
  }
@@ -208,6 +271,6 @@ function lt({
208
271
  ] });
209
272
  }
210
273
  export {
211
- lt as ToastProvider,
212
- at as useToast
274
+ he as ToastProvider,
275
+ fe as useToast
213
276
  };
@@ -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 declare const Tree: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
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;
@@ -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 _, AnimatePresence as $, motion as D } from "motion/react";
5
- import { cn as d } from "../lib/cn.js";
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(({ className: f, ...o }, m) => /* @__PURE__ */ e(
9
- "div",
10
- {
11
- ref: m,
12
- role: "tree",
13
- className: d("flex flex-col gap-0.5 text-xs", f),
14
- ...o
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: f,
21
- label: o,
23
+ className: u,
24
+ label: a,
22
25
  icon: m,
23
- count: g,
24
- endContent: x,
26
+ count: n,
27
+ endContent: v,
25
28
  defaultExpanded: R = !1,
26
- expanded: v,
27
- onExpandedChange: u,
28
- href: y,
29
+ expanded: x,
30
+ onExpandedChange: g,
31
+ href: w,
29
32
  isActive: s,
30
33
  onSelect: b,
31
34
  children: l,
32
- ...j
33
- }, z) => {
34
- const n = t.Children.count(l) > 0, N = v !== void 0, [F, M] = t.useState(R), r = N ? v : F, w = (c) => {
35
- N || M(c), u == null || u(c);
36
- }, a = d(
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
- s ? "bg-fill font-normal text-foreground" : "text-muted-foreground hover:bg-fill/60 hover:text-foreground"
41
- ), h = m ?? (n ? null : /* @__PURE__ */ e(W, { className: "text-tertiary" })), C = s && t.isValidElement(h) ? t.cloneElement(
42
- h,
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
- ) : h, k = /* @__PURE__ */ e(
49
+ ) : p, C = /* @__PURE__ */ e(
45
50
  V,
46
51
  {
47
- className: d(
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 = (g ?? t.Children.count(l)) > 0 && /* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums text-xs text-tertiary", children: g ?? t.Children.count(l) }), p = /* @__PURE__ */ i(T, { children: [
54
- C,
55
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: o }),
56
- x,
57
- n && /* @__PURE__ */ i(T, { children: [
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
- k
64
+ C
60
65
  ] })
61
66
  ] });
62
- return /* @__PURE__ */ i("div", { ref: z, role: "treeitem", "aria-expanded": n ? r : void 0, "aria-selected": s, className: f, ...j, children: [
63
- n && b ? /* @__PURE__ */ i("div", { className: a, children: [
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
- C,
72
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: o })
76
+ k,
77
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: a })
73
78
  ]
74
79
  }
75
80
  ),
76
- x,
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 o == "string" ? o : "tree item"}`,
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: () => w(!r),
86
- children: k
90
+ onClick: () => N(!r),
91
+ children: C
87
92
  }
88
93
  )
89
- ] }) : n ? /* @__PURE__ */ e("button", { type: "button", className: a, onClick: () => w(!r), children: p }) : y ? /* @__PURE__ */ e("a", { href: y, className: a, "aria-current": s ? "page" : void 0, children: p }) : /* @__PURE__ */ e("button", { type: "button", className: a, onClick: b, children: p }),
90
- /* @__PURE__ */ e(_, { reducedMotion: "user", children: /* @__PURE__ */ e($, { initial: !1, children: n && r && /* @__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: d(
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-border before:content-['']",
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-border after:content-['']"
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-xs";
8
- readonly sm: "text-xs";
9
- readonly md: "text-base";
10
- readonly lg: "text-lg";
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";