@actioneer/ads 0.5.9 → 0.7.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 (116) hide show
  1. package/components/ai-elements/agent-trace.d.ts +2 -2
  2. package/components/ai-elements/agent-trace.js +163 -104
  3. package/components/ai-elements/chain-of-thought.d.ts +2 -2
  4. package/components/ai-elements/chain-of-thought.js +1 -1
  5. package/components/ai-elements/index.d.ts +0 -5
  6. package/components/ai-elements/inline-citation.js +1 -1
  7. package/components/alert.d.ts +6 -6
  8. package/components/alert.js +89 -53
  9. package/components/answer-sources.d.ts +2 -6
  10. package/components/answer-sources.js +58 -60
  11. package/components/answer.d.ts +5 -0
  12. package/components/answer.js +311 -271
  13. package/components/assistant-ui/composer-harness.js +11 -14
  14. package/components/assistant-ui/composer.d.ts +3 -1
  15. package/components/assistant-ui/composer.js +148 -144
  16. package/components/assistant-ui/index.d.ts +0 -3
  17. package/components/assistant-ui/thread-context.d.ts +3 -1
  18. package/components/assistant-ui/thread.js +50 -42
  19. package/components/avatar.js +42 -42
  20. package/components/badge.d.ts +5 -6
  21. package/components/badge.js +13 -76
  22. package/components/body-page-header.d.ts +15 -0
  23. package/components/body-page-header.js +24 -0
  24. package/components/brand-loader.d.ts +0 -3
  25. package/components/brand-loader.js +10 -32
  26. package/components/breadcrumbs.d.ts +1 -8
  27. package/components/breadcrumbs.js +65 -78
  28. package/components/button.d.ts +1 -1
  29. package/components/button.js +55 -49
  30. package/components/card.js +19 -18
  31. package/components/chart.js +526 -503
  32. package/components/chip.d.ts +13 -1
  33. package/components/chip.js +93 -80
  34. package/components/collection-header.d.ts +17 -0
  35. package/components/collection-header.js +31 -0
  36. package/components/connector-card.d.ts +6 -6
  37. package/components/connector-card.js +31 -32
  38. package/components/date-range-picker.d.ts +26 -0
  39. package/components/date-range-picker.js +223 -0
  40. package/components/drawer.d.ts +19 -3
  41. package/components/drawer.js +143 -116
  42. package/components/dropdown.d.ts +1 -2
  43. package/components/dropdown.js +88 -89
  44. package/components/field.js +39 -34
  45. package/components/file-dropzone.js +1 -1
  46. package/components/index.d.ts +5 -4
  47. package/components/index.js +501 -546
  48. package/components/infinite-canvas.js +24 -24
  49. package/components/input-field.d.ts +18 -3
  50. package/components/input-field.js +88 -72
  51. package/components/input.js +16 -15
  52. package/components/modal.d.ts +31 -3
  53. package/components/modal.js +243 -169
  54. package/components/number-field.js +45 -42
  55. package/components/page-body.d.ts +12 -0
  56. package/components/page-body.js +18 -0
  57. package/components/pagination.js +36 -36
  58. package/components/panel.js +31 -28
  59. package/components/select.d.ts +21 -0
  60. package/components/select.js +189 -148
  61. package/components/setting-row.d.ts +6 -5
  62. package/components/setting-row.js +33 -32
  63. package/components/sidebar.d.ts +2 -0
  64. package/components/sidebar.js +165 -155
  65. package/components/skeleton.js +8 -7
  66. package/components/slider.js +1 -1
  67. package/components/surface-loader.d.ts +11 -0
  68. package/components/surface-loader.js +35 -0
  69. package/components/table.d.ts +16 -10
  70. package/components/table.js +426 -410
  71. package/components/tabs.d.ts +2 -0
  72. package/components/tabs.js +159 -294
  73. package/components/textarea.js +9 -9
  74. package/components/toast.d.ts +1 -1
  75. package/components/toast.js +181 -118
  76. package/components/tree.d.ts +5 -1
  77. package/components/tree.js +96 -63
  78. package/components/typography.d.ts +4 -4
  79. package/components/typography.js +13 -13
  80. package/components/ui/button.d.ts +1 -1
  81. package/components/ui/dialog.js +33 -33
  82. package/components/viz-charts.js +186 -183
  83. package/demo/components/add-to-artifact.js +8 -10
  84. package/fonts.css +2 -0
  85. package/lib/cn.js +11 -4
  86. package/lib/icons.d.ts +4 -0
  87. package/lib/icons.js +107 -106
  88. package/lib/interactive.d.ts +1 -1
  89. package/llms.txt +115 -152
  90. package/manifest.json +13730 -1084
  91. package/package.json +4 -2
  92. package/styles.css +365 -225
  93. package/theme.css +315 -176
  94. package/components/agent-icon.d.ts +0 -76
  95. package/components/agent-icon.js +0 -265
  96. package/components/ai-elements/queue.d.ts +0 -60
  97. package/components/ai-elements/queue.js +0 -193
  98. package/components/ai-elements/speech-input.d.ts +0 -16
  99. package/components/ai-elements/speech-input.js +0 -151
  100. package/components/ai-elements/task-progress.d.ts +0 -41
  101. package/components/ai-elements/task-progress.js +0 -224
  102. package/components/ai-elements/task.d.ts +0 -39
  103. package/components/ai-elements/task.js +0 -105
  104. package/components/ai-elements/voice.d.ts +0 -90
  105. package/components/ai-elements/voice.js +0 -496
  106. package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
  107. package/components/assistant-ui/follow-up-suggestions.js +0 -72
  108. package/components/assistant-ui/suggestions.d.ts +0 -7
  109. package/components/assistant-ui/suggestions.js +0 -19
  110. package/components/assistant-ui/voice.d.ts +0 -18
  111. package/components/link.d.ts +0 -14
  112. package/components/link.js +0 -72
  113. package/components/navbar.d.ts +0 -15
  114. package/components/navbar.js +0 -68
  115. package/components/pixel-icon.d.ts +0 -37
  116. 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,91 +1,124 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as h, Fragment as y } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as n, Fragment as T } from "react/jsx-runtime";
3
3
  import * as t from "react";
4
- import { MotionConfig as M, AnimatePresence as _, motion as z } from "motion/react";
5
- import { cn as a } from "../lib/cn.js";
6
- import { ChevronRight as D, FileText as S } from "../lib/icons.js";
7
- import { springDisclosure as V } from "../lib/motion.js";
8
- const W = t.forwardRef(({ className: s, ...c }, d) => /* @__PURE__ */ e(
9
- "div",
10
- {
11
- ref: d,
12
- role: "tree",
13
- className: a("flex flex-col gap-0.5 text-xs", s),
14
- ...c
15
- }
16
- ));
17
- W.displayName = "Tree";
18
- const q = t.forwardRef(
4
+ import { MotionConfig as M, AnimatePresence as $, motion as D } from "motion/react";
5
+ import { cn as f } from "../lib/cn.js";
6
+ import { ChevronRight as V, FileText as W } from "../lib/icons.js";
7
+ import { springDisclosure as q } from "../lib/motion.js";
8
+ const B = t.forwardRef(
9
+ ({ className: u, variant: a = "default", ...m }, i) => /* @__PURE__ */ e(
10
+ "div",
11
+ {
12
+ ref: i,
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
+ );
20
+ B.displayName = "Tree";
21
+ const E = t.forwardRef(
19
22
  ({
20
- className: s,
21
- label: c,
22
- icon: d,
23
- count: p,
24
- endContent: N,
25
- defaultExpanded: w = !1,
23
+ className: u,
24
+ label: a,
25
+ icon: m,
26
+ count: i,
27
+ endContent: v,
28
+ defaultExpanded: R = !1,
26
29
  expanded: x,
27
- onExpandedChange: f,
28
- href: g,
29
- isActive: o,
30
- onSelect: C,
31
- children: n,
32
- ...I
33
- }, k) => {
34
- const r = t.Children.count(n) > 0, v = x !== void 0, [T, R] = t.useState(w), i = v ? x : T, j = (l) => {
35
- v || R(l), f == null || f(l);
36
- }, m = a(
37
- "flex h-9 w-full items-center gap-2 rounded-md px-2 text-left",
30
+ onExpandedChange: g,
31
+ href: y,
32
+ isActive: s,
33
+ onSelect: b,
34
+ children: l,
35
+ ..._
36
+ }, j) => {
37
+ const o = t.Children.count(l) > 0, N = x !== void 0, [z, F] = t.useState(R), r = N ? x : z, w = (c) => {
38
+ N || 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
- o ? "bg-fill font-normal text-foreground" : "text-muted-foreground hover:bg-fill/60 hover:text-foreground"
41
- ), u = d ?? (r ? null : /* @__PURE__ */ e(S, { className: "text-tertiary" })), F = o && t.isValidElement(u) ? t.cloneElement(
42
- u,
43
+ "group-data-[variant=sidebar]/tree:border group-data-[variant=sidebar]/tree:border-transparent group-data-[variant=sidebar]/tree:text-ng11",
44
+ "group-data-[variant=sidebar]/tree:[&_svg]:size-5 group-data-[variant=sidebar]/tree:[&_svg]:text-ng11",
45
+ s ? "bg-fill font-normal text-foreground group-data-[variant=sidebar]/tree:border-ng4 group-data-[variant=sidebar]/tree:bg-ng2 group-data-[variant=sidebar]/tree:text-ng11" : "text-muted-foreground hover:bg-fill/60 hover:text-foreground group-data-[variant=sidebar]/tree:hover:bg-ng1 group-data-[variant=sidebar]/tree:hover:text-ng11"
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
- ) : u, b = /* @__PURE__ */ h(y, { children: [
45
- F,
46
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: c }),
47
- N,
48
- r && /* @__PURE__ */ h(y, { children: [
49
- (p ?? t.Children.count(n)) > 0 && /* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums text-xs text-tertiary", children: p ?? t.Children.count(n) }),
49
+ ) : p, C = /* @__PURE__ */ e(
50
+ V,
51
+ {
52
+ className: f(
53
+ "text-muted-foreground transition-transform duration-150 motion-reduce:transition-none",
54
+ r && "rotate-90"
55
+ ),
56
+ strokeWidth: 2
57
+ }
58
+ ), I = (i ?? t.Children.count(l)) > 0 && /* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums text-xs text-tertiary", children: i ?? t.Children.count(l) }), h = /* @__PURE__ */ n(T, { children: [
59
+ k,
60
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: a }),
61
+ v,
62
+ o && /* @__PURE__ */ n(T, { children: [
63
+ I,
64
+ C
65
+ ] })
66
+ ] });
67
+ return /* @__PURE__ */ n("div", { ref: j, role: "treeitem", "aria-expanded": o ? r : void 0, "aria-selected": s, className: u, ..._, children: [
68
+ o && b ? /* @__PURE__ */ n("div", { className: d, children: [
69
+ /* @__PURE__ */ n(
70
+ "button",
71
+ {
72
+ type: "button",
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",
74
+ onClick: b,
75
+ children: [
76
+ k,
77
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: a })
78
+ ]
79
+ }
80
+ ),
81
+ v,
82
+ I,
50
83
  /* @__PURE__ */ e(
51
- D,
84
+ "button",
52
85
  {
53
- className: a(
54
- "text-muted-foreground transition-transform duration-150 motion-reduce:transition-none",
55
- i && "rotate-90"
56
- ),
57
- strokeWidth: 2
86
+ type: "button",
87
+ "aria-label": `${r ? "Collapse" : "Expand"} ${typeof a == "string" ? a : "tree item"}`,
88
+ "aria-expanded": r,
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",
90
+ onClick: () => w(!r),
91
+ children: C
58
92
  }
59
93
  )
60
- ] })
61
- ] });
62
- return /* @__PURE__ */ h("div", { ref: k, role: "treeitem", "aria-expanded": r ? i : void 0, "aria-selected": o, className: s, ...I, children: [
63
- r ? /* @__PURE__ */ e("button", { type: "button", className: m, onClick: () => j(!i), 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 }),
64
- /* @__PURE__ */ e(M, { reducedMotion: "user", children: /* @__PURE__ */ e(_, { initial: !1, children: r && i && /* @__PURE__ */ e(
65
- z.div,
94
+ ] }) : o ? /* @__PURE__ */ e("button", { type: "button", className: d, onClick: () => w(!r), children: h }) : y ? /* @__PURE__ */ e("a", { href: y, 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(
96
+ D.div,
66
97
  {
67
98
  role: "group",
68
99
  initial: { height: 0, opacity: 0, y: -4 },
69
100
  animate: { height: "auto", opacity: 1, y: 0 },
70
101
  exit: { height: 0, opacity: 0, y: -4 },
71
- transition: V,
102
+ transition: q,
72
103
  className: "ml-4 flex flex-col gap-0.5 overflow-hidden",
73
- children: t.Children.map(n, (l) => /* @__PURE__ */ e(
104
+ children: t.Children.map(l, (c) => /* @__PURE__ */ e(
74
105
  "div",
75
106
  {
76
- className: a(
107
+ className: f(
77
108
  "relative ps-5",
78
109
  // Continuous vertical rail — a straight line (no radius) so it
79
110
  // never breaks between children. The LAST child needs no rail
80
111
  // at all: the elbow's own left border draws its final vertical
81
112
  // segment, so a rail there would poke through the curve.
82
- "before:absolute before:left-0 before:top-0 before:bottom-0 before:border-l before:border-border before:content-['']",
113
+ // Extend through the group's 2px row gap so the shared
114
+ // spine remains visually continuous between elbows.
115
+ "before:absolute before:left-0 before:top-0 before:-bottom-0.5 before:border-l before:border-tree-stroke before:content-['']",
83
116
  "last:before:hidden",
84
117
  // Rounded elbow branching off the rail to this child. Its own
85
118
  // left border overlaps the rail, so the curve reads cleanly.
86
- "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-['']"
87
120
  ),
88
- children: l
121
+ children: c
89
122
  }
90
123
  ))
91
124
  }
@@ -93,8 +126,8 @@ const q = t.forwardRef(
93
126
  ] });
94
127
  }
95
128
  );
96
- q.displayName = "TreeItem";
129
+ E.displayName = "TreeItem";
97
130
  export {
98
- W as Tree,
99
- q as TreeItem
131
+ B as Tree,
132
+ E as TreeItem
100
133
  };
@@ -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";