@actioneer/ads 0.1.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 (231) hide show
  1. package/LICENSE +21 -0
  2. package/bin/ads-init.mjs +314 -0
  3. package/components/accordion.d.ts +13 -0
  4. package/components/accordion.js +91 -0
  5. package/components/agents-ui/agent-audio-visualizer-aura.d.ts +11 -0
  6. package/components/agents-ui/agent-audio-visualizer-aura.js +277 -0
  7. package/components/agents-ui/agent-audio-visualizer-wave.d.ts +12 -0
  8. package/components/agents-ui/agent-audio-visualizer-wave.js +203 -0
  9. package/components/agents-ui/react-shader-toy.d.ts +87 -0
  10. package/components/agents-ui/react-shader-toy.js +531 -0
  11. package/components/ai-elements/chain-of-thought.d.ts +30 -0
  12. package/components/ai-elements/chain-of-thought.js +182 -0
  13. package/components/ai-elements/index.d.ts +11 -0
  14. package/components/ai-elements/inline-citation.d.ts +44 -0
  15. package/components/ai-elements/inline-citation.js +314 -0
  16. package/components/ai-elements/message.d.ts +96 -0
  17. package/components/ai-elements/message.js +308 -0
  18. package/components/ai-elements/queue.d.ts +60 -0
  19. package/components/ai-elements/queue.js +193 -0
  20. package/components/ai-elements/reasoning.d.ts +26 -0
  21. package/components/ai-elements/reasoning.js +131 -0
  22. package/components/ai-elements/shimmer.d.ts +25 -0
  23. package/components/ai-elements/shimmer.js +44 -0
  24. package/components/ai-elements/speech-input.d.ts +16 -0
  25. package/components/ai-elements/speech-input.js +151 -0
  26. package/components/ai-elements/task-progress.d.ts +41 -0
  27. package/components/ai-elements/task-progress.js +211 -0
  28. package/components/ai-elements/task.d.ts +35 -0
  29. package/components/ai-elements/task.js +73 -0
  30. package/components/ai-elements/tool.d.ts +53 -0
  31. package/components/ai-elements/tool.js +116 -0
  32. package/components/ai-elements/voice.d.ts +74 -0
  33. package/components/ai-elements/voice.js +875 -0
  34. package/components/alert.d.ts +21 -0
  35. package/components/alert.js +76 -0
  36. package/components/answer.d.ts +984 -0
  37. package/components/answer.js +543 -0
  38. package/components/assistant-ui/action-bar.d.ts +3 -0
  39. package/components/assistant-ui/action-bar.js +57 -0
  40. package/components/assistant-ui/answer-tool-ui.d.ts +5 -0
  41. package/components/assistant-ui/answer-tool-ui.js +42 -0
  42. package/components/assistant-ui/attachment.d.ts +50 -0
  43. package/components/assistant-ui/attachment.js +353 -0
  44. package/components/assistant-ui/badge.d.ts +11 -0
  45. package/components/assistant-ui/badge.js +54 -0
  46. package/components/assistant-ui/branch-picker.d.ts +3 -0
  47. package/components/assistant-ui/branch-picker.js +36 -0
  48. package/components/assistant-ui/chain-of-thought.d.ts +46 -0
  49. package/components/assistant-ui/composer-add-context.d.ts +50 -0
  50. package/components/assistant-ui/composer-add-context.js +209 -0
  51. package/components/assistant-ui/composer-deep-research.d.ts +16 -0
  52. package/components/assistant-ui/composer-deep-research.js +38 -0
  53. package/components/assistant-ui/composer-harness.d.ts +18 -0
  54. package/components/assistant-ui/composer-harness.js +186 -0
  55. package/components/assistant-ui/composer-trigger-popover.d.ts +47 -0
  56. package/components/assistant-ui/composer-trigger-popover.js +147 -0
  57. package/components/assistant-ui/composer.d.ts +8 -0
  58. package/components/assistant-ui/composer.js +276 -0
  59. package/components/assistant-ui/directive-text.d.ts +16 -0
  60. package/components/assistant-ui/directive-text.js +40 -0
  61. package/components/assistant-ui/error.d.ts +6 -0
  62. package/components/assistant-ui/error.js +39 -0
  63. package/components/assistant-ui/file.d.ts +37 -0
  64. package/components/assistant-ui/file.js +159 -0
  65. package/components/assistant-ui/follow-up-suggestions.d.ts +7 -0
  66. package/components/assistant-ui/follow-up-suggestions.js +44 -0
  67. package/components/assistant-ui/image.d.ts +46 -0
  68. package/components/assistant-ui/image.js +351 -0
  69. package/components/assistant-ui/index.d.ts +28 -0
  70. package/components/assistant-ui/markdown-text.d.ts +1 -0
  71. package/components/assistant-ui/markdown-text.js +242 -0
  72. package/components/assistant-ui/message-timing.d.ts +25 -0
  73. package/components/assistant-ui/message-timing.js +56 -0
  74. package/components/assistant-ui/message.d.ts +4 -0
  75. package/components/assistant-ui/message.js +159 -0
  76. package/components/assistant-ui/primitives.d.ts +2 -0
  77. package/components/assistant-ui/quote.d.ts +37 -0
  78. package/components/assistant-ui/quote.js +150 -0
  79. package/components/assistant-ui/reasoning.d.ts +44 -0
  80. package/components/assistant-ui/reasoning.js +261 -0
  81. package/components/assistant-ui/selection-toolbar.d.ts +29 -0
  82. package/components/assistant-ui/selection-toolbar.js +91 -0
  83. package/components/assistant-ui/smart-message-text.d.ts +15 -0
  84. package/components/assistant-ui/smart-message-text.js +29 -0
  85. package/components/assistant-ui/sources.d.ts +17 -0
  86. package/components/assistant-ui/sources.js +121 -0
  87. package/components/assistant-ui/suggestions.d.ts +7 -0
  88. package/components/assistant-ui/suggestions.js +19 -0
  89. package/components/assistant-ui/thread-context.d.ts +37 -0
  90. package/components/assistant-ui/thread-context.js +8 -0
  91. package/components/assistant-ui/thread.d.ts +5 -0
  92. package/components/assistant-ui/thread.js +77 -0
  93. package/components/assistant-ui/tool-fallback.d.ts +36 -0
  94. package/components/assistant-ui/tool-fallback.js +428 -0
  95. package/components/assistant-ui/tool-group.d.ts +33 -0
  96. package/components/assistant-ui/tool-group.js +173 -0
  97. package/components/assistant-ui/tooltip-icon-button.d.ts +7 -0
  98. package/components/assistant-ui/tooltip-icon-button.js +31 -0
  99. package/components/assistant-ui/voice.d.ts +18 -0
  100. package/components/autocomplete.d.ts +18 -0
  101. package/components/autocomplete.js +162 -0
  102. package/components/avatar.d.ts +26 -0
  103. package/components/avatar.js +92 -0
  104. package/components/badge.d.ts +10 -0
  105. package/components/badge.js +83 -0
  106. package/components/brand-loader.d.ts +16 -0
  107. package/components/brand-loader.js +64 -0
  108. package/components/breadcrumbs.d.ts +8 -0
  109. package/components/breadcrumbs.js +58 -0
  110. package/components/button.d.ts +13 -0
  111. package/components/button.js +100 -0
  112. package/components/card.d.ts +19 -0
  113. package/components/card.js +82 -0
  114. package/components/carousel.d.ts +31 -0
  115. package/components/carousel.js +351 -0
  116. package/components/chart.d.ts +165 -0
  117. package/components/chart.js +841 -0
  118. package/components/checkbox.d.ts +13 -0
  119. package/components/checkbox.js +84 -0
  120. package/components/chip.d.ts +13 -0
  121. package/components/chip.js +112 -0
  122. package/components/collapsible.d.ts +5 -0
  123. package/components/collapsible.js +31 -0
  124. package/components/connector-card.d.ts +62 -0
  125. package/components/connector-card.js +154 -0
  126. package/components/divider.d.ts +23 -0
  127. package/components/divider.js +69 -0
  128. package/components/drawer.d.ts +45 -0
  129. package/components/drawer.js +234 -0
  130. package/components/dropdown.d.ts +33 -0
  131. package/components/dropdown.js +198 -0
  132. package/components/empty-state.d.ts +8 -0
  133. package/components/empty-state.js +30 -0
  134. package/components/field.d.ts +20 -0
  135. package/components/field.js +74 -0
  136. package/components/index.d.ts +56 -0
  137. package/components/index.js +444 -0
  138. package/components/input-field.d.ts +22 -0
  139. package/components/input-field.js +91 -0
  140. package/components/input.d.ts +8 -0
  141. package/components/input.js +61 -0
  142. package/components/kbd.d.ts +6 -0
  143. package/components/kbd.js +26 -0
  144. package/components/link.d.ts +14 -0
  145. package/components/link.js +72 -0
  146. package/components/modal.d.ts +18 -0
  147. package/components/modal.js +156 -0
  148. package/components/navbar.d.ts +15 -0
  149. package/components/navbar.js +68 -0
  150. package/components/number-field.d.ts +11 -0
  151. package/components/number-field.js +89 -0
  152. package/components/pagination.d.ts +28 -0
  153. package/components/pagination.js +179 -0
  154. package/components/panel.d.ts +14 -0
  155. package/components/panel.js +71 -0
  156. package/components/pixel-blast-svg.d.ts +22 -0
  157. package/components/pixel-blast-svg.js +154 -0
  158. package/components/popover.d.ts +20 -0
  159. package/components/popover.js +101 -0
  160. package/components/progress-circle.d.ts +11 -0
  161. package/components/progress-circle.js +75 -0
  162. package/components/progress.d.ts +22 -0
  163. package/components/progress.js +66 -0
  164. package/components/radio.d.ts +16 -0
  165. package/components/radio.js +101 -0
  166. package/components/segmented.d.ts +16 -0
  167. package/components/segmented.js +103 -0
  168. package/components/select.d.ts +28 -0
  169. package/components/select.js +180 -0
  170. package/components/selection-action-bar.d.ts +11 -0
  171. package/components/selection-action-bar.js +59 -0
  172. package/components/sidebar.d.ts +118 -0
  173. package/components/sidebar.js +375 -0
  174. package/components/skeleton.d.ts +6 -0
  175. package/components/skeleton.js +26 -0
  176. package/components/slider.d.ts +11 -0
  177. package/components/slider.js +62 -0
  178. package/components/spinner.d.ts +11 -0
  179. package/components/spinner.js +62 -0
  180. package/components/switch.d.ts +7 -0
  181. package/components/switch.js +61 -0
  182. package/components/table.d.ts +59 -0
  183. package/components/table.js +254 -0
  184. package/components/tabs.d.ts +29 -0
  185. package/components/tabs.js +371 -0
  186. package/components/textarea.d.ts +5 -0
  187. package/components/textarea.js +24 -0
  188. package/components/timeline.d.ts +7 -0
  189. package/components/timeline.js +47 -0
  190. package/components/toast.d.ts +74 -0
  191. package/components/toast.js +211 -0
  192. package/components/tooltip.d.ts +11 -0
  193. package/components/tooltip.js +143 -0
  194. package/components/tree.d.ts +42 -0
  195. package/components/tree.js +86 -0
  196. package/components/typography.d.ts +33 -0
  197. package/components/typography.js +65 -0
  198. package/components/ui/avatar.d.ts +11 -0
  199. package/components/ui/avatar.js +56 -0
  200. package/components/ui/button.d.ts +10 -0
  201. package/components/ui/button.js +57 -0
  202. package/components/ui/collapsible.d.ts +5 -0
  203. package/components/ui/collapsible.js +35 -0
  204. package/components/ui/dialog.d.ts +17 -0
  205. package/components/ui/dialog.js +93 -0
  206. package/components/ui/tabs.d.ts +22 -0
  207. package/components/ui/tooltip.d.ts +7 -0
  208. package/components/ui/tooltip.js +56 -0
  209. package/fonts/aribau-grotesk-400.otf +0 -0
  210. package/fonts/aribau-grotesk-700.otf +0 -0
  211. package/fonts.css +21 -0
  212. package/hooks/agents-ui/use-agent-audio-visualizer-aura.d.ts +8 -0
  213. package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +62 -0
  214. package/hooks/agents-ui/use-agent-audio-visualizer-wave.d.ts +7 -0
  215. package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +60 -0
  216. package/hooks/agents-ui/voice-visualizer-types.d.ts +9 -0
  217. package/lib/cn.d.ts +3 -0
  218. package/lib/cn.js +9 -0
  219. package/lib/icons.d.ts +378 -0
  220. package/lib/icons.js +119 -0
  221. package/lib/interactive.d.ts +24 -0
  222. package/lib/interactive.js +36 -0
  223. package/lib/motion.d.ts +58 -0
  224. package/lib/motion.js +70 -0
  225. package/lib/router.d.ts +3 -0
  226. package/lib/utils.d.ts +6 -0
  227. package/llms.txt +537 -0
  228. package/manifest.json +5085 -0
  229. package/package.json +60 -0
  230. package/styles.css +653 -0
  231. package/theme.css +273 -0
@@ -0,0 +1,211 @@
1
+ "use client";
2
+ import { jsxs as T, jsx as a } from "react/jsx-runtime";
3
+ import * as o from "react";
4
+ import { createPortal as A } from "react-dom";
5
+ import { MotionConfig as O, AnimatePresence as W, motion as F } from "motion/react";
6
+ import { WarningCircle as B, Warning as D, Info as N, CheckCircle as U, Close as V } from "../lib/icons.js";
7
+ import { cn as g } from "../lib/cn.js";
8
+ import { toastSpring as q, EASE_OUT as G } from "../lib/motion.js";
9
+ import { Button as J } from "./button.js";
10
+ import { Spinner as K } from "./spinner.js";
11
+ const z = o.createContext(null);
12
+ function at() {
13
+ const x = o.useContext(z);
14
+ if (!x)
15
+ throw new Error("useToast must be used within a <ToastProvider>.");
16
+ const { push: c, close: m, clear: f } = x;
17
+ return { toast: o.useMemo(() => {
18
+ const s = ((r, i) => {
19
+ if (r !== null && typeof r == "object" && !o.isValidElement(r)) {
20
+ const { title: d, ...p } = r;
21
+ return c(d, { ...p, ...i });
22
+ }
23
+ return c(r, i);
24
+ }), l = (r) => (i, d) => c(i, { ...d, variant: r });
25
+ return s.success = l("success"), s.info = l("info"), s.warning = l("warning"), s.danger = l("danger"), s.close = m, s.clear = f, s.promise = (r, i) => {
26
+ const d = c(i.loading, { isLoading: !0, timeout: 0 });
27
+ return r.then((p) => {
28
+ m(d), c(
29
+ typeof i.success == "function" ? i.success(p) : i.success,
30
+ { variant: "success" }
31
+ );
32
+ }).catch((p) => {
33
+ m(d), c(
34
+ typeof i.error == "function" ? i.error(p) : i.error,
35
+ { variant: "danger" }
36
+ );
37
+ }), r;
38
+ }, s;
39
+ }, [c, m, f]) };
40
+ }
41
+ const Q = {
42
+ default: { icon: N, accent: "text-foreground" },
43
+ success: { icon: U, accent: "text-success-700" },
44
+ info: { icon: N, accent: "text-info-700" },
45
+ warning: { icon: D, accent: "text-warning-700" },
46
+ danger: { icon: B, accent: "text-danger-700" }
47
+ }, X = {
48
+ "bottom-end": "bottom-4 right-4",
49
+ bottom: "bottom-4 left-1/2 -translate-x-1/2",
50
+ "bottom-start": "bottom-4 left-4",
51
+ "top-end": "top-4 right-4",
52
+ top: "top-4 left-1/2 -translate-x-1/2",
53
+ "top-start": "top-4 left-4"
54
+ }, S = 12, Y = 0.05;
55
+ function ct({
56
+ children: x,
57
+ placement: c = "bottom-end",
58
+ maxVisible: m = 3
59
+ }) {
60
+ var k;
61
+ const [f, b] = o.useState([]), s = o.useRef(/* @__PURE__ */ new Map()), l = o.useRef(/* @__PURE__ */ new Map()), r = o.useCallback((t) => {
62
+ b((u) => u.filter((h) => h.id !== t));
63
+ const n = s.current.get(t);
64
+ n && (clearTimeout(n), s.current.delete(t));
65
+ const e = l.current.get(t);
66
+ l.current.delete(t), e == null || e();
67
+ }, []), i = o.useCallback(() => {
68
+ b((t) => (t.forEach((n) => {
69
+ var u;
70
+ const e = s.current.get(n.id);
71
+ e && clearTimeout(e), s.current.delete(n.id), (u = l.current.get(n.id)) == null || u(), l.current.delete(n.id);
72
+ }), []));
73
+ }, []), d = o.useCallback(
74
+ (t, n = {}) => {
75
+ const e = Math.random().toString(36).slice(2), u = { variant: "default", ...n, id: e, title: t };
76
+ b((v) => [...v, u]), l.current.set(e, n.onClose);
77
+ const h = n.timeout ?? n.duration ?? (n.isLoading ? 0 : 5e3);
78
+ return h > 0 && s.current.set(e, setTimeout(() => r(e), h)), e;
79
+ },
80
+ [r]
81
+ );
82
+ o.useEffect(() => {
83
+ const t = s.current;
84
+ return () => {
85
+ t.forEach((n) => clearTimeout(n)), t.clear();
86
+ };
87
+ }, []);
88
+ const p = o.useMemo(() => ({ push: d, close: r, clear: i }), [d, r, i]), [L, R] = o.useState(!1);
89
+ o.useEffect(() => R(!0), []);
90
+ const [y, P] = o.useState(null), E = o.useRef(null), j = (k = f[f.length - 1]) == null ? void 0 : k.id;
91
+ o.useLayoutEffect(() => {
92
+ const t = E.current;
93
+ if (!t) {
94
+ P(null);
95
+ return;
96
+ }
97
+ const n = () => P(t.offsetHeight);
98
+ n();
99
+ const e = new ResizeObserver(n);
100
+ return e.observe(t), () => e.disconnect();
101
+ }, [j]);
102
+ const w = c.startsWith("top"), H = w ? 1 : -1, _ = Math.min(m, Math.max(f.length, 1)), I = y != null ? y + S * (_ - 1) : void 0;
103
+ return /* @__PURE__ */ T(z.Provider, { value: p, children: [
104
+ x,
105
+ L && A(
106
+ /* @__PURE__ */ a(
107
+ "div",
108
+ {
109
+ className: g(
110
+ "pointer-events-none fixed z-50 w-full max-w-sm",
111
+ X[c]
112
+ ),
113
+ style: { height: I },
114
+ role: "region",
115
+ "aria-label": "Notifications",
116
+ children: /* @__PURE__ */ a(O, { reducedMotion: "user", children: /* @__PURE__ */ a(W, { children: f.map((t, n) => {
117
+ const e = f.length - 1 - n, u = e === 0, h = e >= m, v = Q[t.variant ?? "default"], $ = v.icon;
118
+ return /* @__PURE__ */ T(
119
+ F.div,
120
+ {
121
+ ref: u ? E : void 0,
122
+ layout: !1,
123
+ role: "status",
124
+ "aria-live": "polite",
125
+ initial: {
126
+ opacity: 0,
127
+ transform: `translate3d(0, ${w ? -16 : 16}px, 0) scale(0.98)`
128
+ },
129
+ animate: {
130
+ opacity: h ? 0 : 1,
131
+ transform: `translate3d(0, ${H * e * S}px, 0) scale(${1 - e * Y})`
132
+ },
133
+ exit: {
134
+ opacity: 0,
135
+ transform: `translate3d(0, ${w ? -16 : 16}px, 0) scale(0.98)`,
136
+ transition: { duration: 0.14, ease: G }
137
+ },
138
+ transition: q,
139
+ className: g(
140
+ "group/toast absolute inset-x-0 flex items-start gap-1.5",
141
+ w ? "top-0" : "bottom-0",
142
+ "rounded-2xl bg-elevated px-4 py-3 shadow-elevation",
143
+ u ? "pointer-events-auto" : "pointer-events-none overflow-hidden"
144
+ ),
145
+ style: {
146
+ zIndex: 100 - e,
147
+ // Behind layers freeze at the front card's height so
148
+ // only their top edge shows as a clean sliver.
149
+ height: !u && y != null ? y : void 0
150
+ },
151
+ children: [
152
+ /* @__PURE__ */ a(
153
+ "span",
154
+ {
155
+ className: g(
156
+ "flex shrink-0 select-none items-center justify-center p-1 [&_svg]:size-4",
157
+ v.accent
158
+ ),
159
+ children: t.isLoading ? /* @__PURE__ */ a(K, { size: "sm", "aria-label": "Loading" }) : t.indicator ?? /* @__PURE__ */ a($, { "aria-hidden": !0 })
160
+ }
161
+ ),
162
+ /* @__PURE__ */ T("div", { className: "flex min-w-0 grow flex-col items-start self-center", children: [
163
+ /* @__PURE__ */ a("p", { className: g("text-xs font-medium leading-5", v.accent), children: t.title }),
164
+ t.description && /* @__PURE__ */ a("p", { className: "text-xs text-muted-foreground", children: t.description })
165
+ ] }),
166
+ t.actionProps && /* @__PURE__ */ a(
167
+ J,
168
+ {
169
+ size: "sm",
170
+ variant: t.actionProps.variant ?? "soft",
171
+ className: g("ml-2 shrink-0 self-center rounded-full", t.actionProps.className),
172
+ onClick: () => {
173
+ var C, M;
174
+ return (M = (C = t.actionProps) == null ? void 0 : C.onClick) == null ? void 0 : M.call(C);
175
+ },
176
+ children: t.actionProps.children
177
+ }
178
+ ),
179
+ /* @__PURE__ */ a(
180
+ "button",
181
+ {
182
+ type: "button",
183
+ onClick: () => r(t.id),
184
+ "aria-label": "Dismiss",
185
+ className: g(
186
+ "absolute -right-1 -top-1 inline-flex size-5 items-center justify-center",
187
+ "rounded-full border border-border bg-elevated text-muted-foreground shadow-elevation",
188
+ "opacity-0 transition-opacity duration-(--duration-fast) ease-out",
189
+ "group-hover/toast:opacity-100 focus-visible:opacity-100",
190
+ "hover:bg-muted hover:text-foreground",
191
+ "outline-none focus-visible:ring-2 focus-visible:ring-ring",
192
+ "[&_svg]:size-3 [&_svg]:shrink-0"
193
+ ),
194
+ children: /* @__PURE__ */ a(V, { "aria-hidden": !0 })
195
+ }
196
+ )
197
+ ]
198
+ },
199
+ t.id
200
+ );
201
+ }) }) })
202
+ }
203
+ ),
204
+ document.body
205
+ )
206
+ ] });
207
+ }
208
+ export {
209
+ ct as ToastProvider,
210
+ at as useToast
211
+ };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ type TooltipSide = "top" | "bottom" | "left" | "right";
3
+ export interface TooltipProps {
4
+ content: React.ReactNode;
5
+ children: React.ReactElement;
6
+ side?: TooltipSide;
7
+ delay?: number;
8
+ className?: string;
9
+ }
10
+ export declare function Tooltip({ content, children, side, delay, className, }: TooltipProps): React.JSX.Element;
11
+ export {};
@@ -0,0 +1,143 @@
1
+ "use client";
2
+ import { jsxs as L, Fragment as D, jsx as b } from "react/jsx-runtime";
3
+ import * as r from "react";
4
+ import { createPortal as F } from "react-dom";
5
+ import { MotionConfig as H, AnimatePresence as I, motion as N } from "motion/react";
6
+ import { cn as k } from "../lib/cn.js";
7
+ import { tooltipVariants as O } from "../lib/motion.js";
8
+ const j = {
9
+ top: "bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",
10
+ bottom: "top-0 left-1/2 -translate-x-1/2 -translate-y-1/2",
11
+ left: "right-0 top-1/2 translate-x-1/2 -translate-y-1/2",
12
+ right: "left-0 top-1/2 -translate-x-1/2 -translate-y-1/2"
13
+ }, _ = {
14
+ top: "bottom",
15
+ bottom: "top",
16
+ left: "right",
17
+ right: "left"
18
+ };
19
+ let S = 0;
20
+ const V = 300;
21
+ function U({
22
+ content: W,
23
+ children: z,
24
+ side: d = "top",
25
+ delay: B = 300,
26
+ className: P
27
+ }) {
28
+ const [a, g] = r.useState(!1), [T, x] = r.useState(!1), [i, A] = r.useState(null), v = r.useRef(null), M = r.useRef(null), f = r.useRef(null), y = r.useId(), w = () => {
29
+ f.current && (clearTimeout(f.current), f.current = null);
30
+ }, E = () => {
31
+ if (w(), Date.now() - S < V) {
32
+ x(!0), g(!0);
33
+ return;
34
+ }
35
+ x(!1), f.current = setTimeout(() => g(!0), B);
36
+ }, R = () => {
37
+ w(), a && (S = Date.now()), g(!1);
38
+ };
39
+ r.useEffect(() => () => w(), []), r.useLayoutEffect(() => {
40
+ if (!a) return;
41
+ const n = v.current, e = M.current;
42
+ if (!n || !e) return;
43
+ const t = () => {
44
+ const o = n.getBoundingClientRect(), p = e.offsetWidth, m = e.offsetHeight, h = 6, s = 8;
45
+ let c = 0, u = 0;
46
+ switch (d) {
47
+ case "top":
48
+ c = o.top - m - h, u = o.left + o.width / 2 - p / 2;
49
+ break;
50
+ case "bottom":
51
+ c = o.bottom + h, u = o.left + o.width / 2 - p / 2;
52
+ break;
53
+ case "left":
54
+ c = o.top + o.height / 2 - m / 2, u = o.left - p - h;
55
+ break;
56
+ case "right":
57
+ c = o.top + o.height / 2 - m / 2, u = o.right + h;
58
+ break;
59
+ }
60
+ A({
61
+ top: Math.min(
62
+ Math.max(c, s),
63
+ Math.max(s, window.innerHeight - m - s)
64
+ ),
65
+ left: Math.min(
66
+ Math.max(u, s),
67
+ Math.max(s, window.innerWidth - p - s)
68
+ )
69
+ });
70
+ };
71
+ return t(), window.addEventListener("resize", t), window.addEventListener("scroll", t, !0), () => {
72
+ window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
73
+ };
74
+ }, [a, d]);
75
+ const l = z, C = r.cloneElement(l, {
76
+ ref: v,
77
+ "aria-describedby": a ? y : void 0,
78
+ onMouseEnter: (n) => {
79
+ var e, t;
80
+ (t = (e = l.props).onMouseEnter) == null || t.call(e, n), E();
81
+ },
82
+ onMouseLeave: (n) => {
83
+ var e, t;
84
+ (t = (e = l.props).onMouseLeave) == null || t.call(e, n), R();
85
+ },
86
+ onFocus: (n) => {
87
+ var e, t;
88
+ (t = (e = l.props).onFocus) == null || t.call(e, n), E();
89
+ },
90
+ onBlur: (n) => {
91
+ var e, t;
92
+ (t = (e = l.props).onBlur) == null || t.call(e, n), R();
93
+ }
94
+ });
95
+ return /* @__PURE__ */ L(D, { children: [
96
+ C,
97
+ F(
98
+ /* @__PURE__ */ b(H, { reducedMotion: "user", children: /* @__PURE__ */ b(I, { children: a && /* @__PURE__ */ L(
99
+ N.div,
100
+ {
101
+ ref: M,
102
+ role: "tooltip",
103
+ id: y,
104
+ variants: O,
105
+ initial: "hidden",
106
+ animate: "visible",
107
+ exit: "hidden",
108
+ transition: T ? { duration: 0 } : void 0,
109
+ style: {
110
+ position: "fixed",
111
+ top: (i == null ? void 0 : i.top) ?? 0,
112
+ left: (i == null ? void 0 : i.left) ?? 0,
113
+ visibility: i ? "visible" : "hidden",
114
+ transformOrigin: _[d]
115
+ },
116
+ className: k(
117
+ "relative z-50 max-w-xs rounded-md bg-foreground px-2 py-1",
118
+ "text-xs text-background",
119
+ "pointer-events-none select-none",
120
+ P
121
+ ),
122
+ children: [
123
+ /* @__PURE__ */ b(
124
+ "span",
125
+ {
126
+ "aria-hidden": !0,
127
+ className: k(
128
+ "absolute size-2 rotate-45 rounded-[1px] bg-foreground",
129
+ j[d]
130
+ )
131
+ }
132
+ ),
133
+ W
134
+ ]
135
+ }
136
+ ) }) }),
137
+ document.body
138
+ )
139
+ ] });
140
+ }
141
+ export {
142
+ U as Tooltip
143
+ };
@@ -0,0 +1,42 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Tree — a nestable disclosure list where children link back to their parent by
4
+ * an L-shaped connector "branch": a vertical rail drops from the parent and a
5
+ * curved elbow reaches each child, with the last child's rail stopping at its
6
+ * elbow. A `TreeItem` with children is a collapsible branch (chevron + optional
7
+ * count); without children it's a leaf (optionally a link).
8
+ *
9
+ * Compose:
10
+ * <Tree>
11
+ * <TreeItem label="Skills" icon={<BookOpen/>} defaultExpanded>
12
+ * <TreeItem label="forecasting" />
13
+ * <TreeItem label="cohort-analysis" />
14
+ * </TreeItem>
15
+ * </Tree>
16
+ *
17
+ * The connector is a functional stroke (like Divider), not a surface border —
18
+ * the one sanctioned place strokes belong (principle 1).
19
+ */
20
+ export declare const Tree: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
21
+ export interface TreeItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
22
+ /** Row label. */
23
+ label: React.ReactNode;
24
+ /** Leading icon. Leaves default to a file glyph; branches usually pass one. */
25
+ icon?: React.ReactNode;
26
+ /** Trailing count shown on a branch. Defaults to the child count. */
27
+ count?: number;
28
+ /** Trailing content on the row (e.g. a badge), before the chevron. */
29
+ endContent?: React.ReactNode;
30
+ /** Uncontrolled initial expanded state (branches only). */
31
+ defaultExpanded?: boolean;
32
+ /** Controlled expanded state. */
33
+ expanded?: boolean;
34
+ onExpandedChange?: (expanded: boolean) => void;
35
+ /** Render a leaf as a link. */
36
+ href?: string;
37
+ /** Selected/active leaf. */
38
+ isActive?: boolean;
39
+ /** Fires when a leaf row is activated. */
40
+ onSelect?: () => void;
41
+ }
42
+ export declare const TreeItem: React.ForwardRefExoticComponent<TreeItemProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,86 @@
1
+ "use client";
2
+ import { jsx as e, jsxs as b, Fragment as v } from "react/jsx-runtime";
3
+ import * as r from "react";
4
+ import { cn as s } from "../lib/cn.js";
5
+ import { ChevronRight as j, FileText as F } from "../lib/icons.js";
6
+ const _ = r.forwardRef(({ className: l, ...i }, d) => /* @__PURE__ */ e(
7
+ "div",
8
+ {
9
+ ref: d,
10
+ role: "tree",
11
+ className: s("text-xs", l),
12
+ ...i
13
+ }
14
+ ));
15
+ _.displayName = "Tree";
16
+ const z = r.forwardRef(
17
+ ({
18
+ className: l,
19
+ label: i,
20
+ icon: d,
21
+ count: h,
22
+ endContent: N,
23
+ defaultExpanded: w = !1,
24
+ expanded: p,
25
+ onExpandedChange: c,
26
+ href: x,
27
+ isActive: f,
28
+ onSelect: y,
29
+ children: o,
30
+ ...C
31
+ }, I) => {
32
+ const t = r.Children.count(o) > 0, g = p !== void 0, [k, T] = r.useState(w), n = g ? p : k, R = (a) => {
33
+ g || T(a), c == null || c(a);
34
+ }, m = s(
35
+ "flex h-8 w-full items-center gap-2 rounded-md px-2 text-left",
36
+ "outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring",
37
+ "[&_svg]:size-4 [&_svg]:shrink-0",
38
+ f ? "bg-fill font-medium text-foreground" : "text-muted-foreground hover:bg-fill/60 hover:text-foreground"
39
+ ), u = /* @__PURE__ */ b(v, { children: [
40
+ d ?? (t ? null : /* @__PURE__ */ e(F, { className: "text-tertiary" })),
41
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: i }),
42
+ N,
43
+ t && /* @__PURE__ */ b(v, { children: [
44
+ (h ?? r.Children.count(o)) > 0 && /* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums text-xs text-tertiary", children: h ?? r.Children.count(o) }),
45
+ /* @__PURE__ */ e(
46
+ j,
47
+ {
48
+ className: s(
49
+ "text-muted-foreground transition-transform duration-(--duration-fast) motion-reduce:transition-none",
50
+ n && "rotate-90"
51
+ ),
52
+ strokeWidth: 2
53
+ }
54
+ )
55
+ ] })
56
+ ] });
57
+ return /* @__PURE__ */ b("div", { ref: I, role: "treeitem", "aria-expanded": t ? n : void 0, "aria-selected": f, className: l, ...C, children: [
58
+ t ? /* @__PURE__ */ e("button", { type: "button", className: m, onClick: () => R(!n), children: u }) : x ? /* @__PURE__ */ e("a", { href: x, className: m, "aria-current": f ? "page" : void 0, children: u }) : /* @__PURE__ */ e("button", { type: "button", className: m, onClick: y, children: u }),
59
+ t && n && // ml-4 aligns the rail under the parent icon; each child carries the
60
+ // elbow (before) + rail continuation (after), hidden on the last.
61
+ /* @__PURE__ */ e("div", { role: "group", className: "ml-4", children: r.Children.map(o, (a) => /* @__PURE__ */ e(
62
+ "div",
63
+ {
64
+ className: s(
65
+ "relative ps-5",
66
+ // Continuous vertical rail — a straight line (no radius) so it
67
+ // never breaks between children. The LAST child needs no rail
68
+ // at all: the elbow's own left border draws its final vertical
69
+ // segment, so a rail there would poke through the curve.
70
+ "before:absolute before:left-0 before:top-0 before:bottom-0 before:border-l before:border-border before:content-['']",
71
+ "last:before:hidden",
72
+ // Rounded elbow branching off the rail to this child. Its own
73
+ // left border overlaps the rail, so the curve reads cleanly.
74
+ "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-['']"
75
+ ),
76
+ children: a
77
+ }
78
+ )) })
79
+ ] });
80
+ }
81
+ );
82
+ z.displayName = "TreeItem";
83
+ export {
84
+ _ as Tree,
85
+ z as TreeItem
86
+ };
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
3
+ level?: 1 | 2 | 3 | 4;
4
+ }
5
+ export declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
6
+ declare const textSizes: {
7
+ readonly xs: "text-xs";
8
+ readonly sm: "text-xs";
9
+ readonly md: "text-base";
10
+ readonly lg: "text-lg";
11
+ };
12
+ declare const textWeights: {
13
+ readonly regular: "font-normal";
14
+ readonly bold: "font-bold";
15
+ };
16
+ declare const textColors: {
17
+ readonly primary: "text-primary";
18
+ readonly secondary: "text-secondary";
19
+ readonly tertiary: "text-tertiary";
20
+ };
21
+ export interface TextProps extends React.HTMLAttributes<HTMLElement> {
22
+ size?: keyof typeof textSizes;
23
+ /** One of the three accessible text levels. Defaults to `primary`. */
24
+ color?: keyof typeof textColors;
25
+ /** Shorthand for `color="tertiary"`. */
26
+ muted?: boolean;
27
+ weight?: keyof typeof textWeights;
28
+ /** Render as `p` (default) or `span`. */
29
+ as?: "p" | "span";
30
+ }
31
+ export declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLElement>>;
32
+ export declare const Code: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
33
+ export {};
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { jsx as c } from "react/jsx-runtime";
3
+ import * as m from "react";
4
+ import { cn as x } from "../lib/cn.js";
5
+ const p = {
6
+ 1: { tag: "h1", className: "text-2xl font-bold tracking-tight" },
7
+ 2: { tag: "h2", className: "text-xl font-bold tracking-tight" },
8
+ 3: { tag: "h3", className: "text-lg font-bold" },
9
+ 4: { tag: "h4", className: "text-base font-bold" }
10
+ }, y = m.forwardRef(
11
+ ({ className: e, level: a = 1, children: t, ...o }, s) => {
12
+ const { tag: r, className: l } = p[a];
13
+ return /* @__PURE__ */ c(r, { ref: s, className: x(l, e), ...o, children: t });
14
+ }
15
+ );
16
+ y.displayName = "Heading";
17
+ const N = {
18
+ xs: "text-xs",
19
+ sm: "text-xs",
20
+ md: "text-base",
21
+ lg: "text-lg"
22
+ }, b = {
23
+ regular: "font-normal",
24
+ bold: "font-bold"
25
+ }, n = {
26
+ primary: "text-primary",
27
+ secondary: "text-secondary",
28
+ tertiary: "text-tertiary"
29
+ }, u = m.forwardRef(
30
+ ({ className: e, size: a = "md", color: t, muted: o = !1, weight: s, as: r = "p", children: l, ...d }, i) => {
31
+ const g = r, f = t ? n[t] : o ? n.tertiary : n.primary;
32
+ return /* @__PURE__ */ c(
33
+ g,
34
+ {
35
+ ref: i,
36
+ className: x(
37
+ N[a],
38
+ s && b[s],
39
+ f,
40
+ e
41
+ ),
42
+ ...d,
43
+ children: l
44
+ }
45
+ );
46
+ }
47
+ );
48
+ u.displayName = "Text";
49
+ const h = m.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ c(
50
+ "code",
51
+ {
52
+ ref: t,
53
+ className: x(
54
+ "rounded bg-muted px-1.5 py-0.5 tabular-nums text-xs",
55
+ e
56
+ ),
57
+ ...a
58
+ }
59
+ ));
60
+ h.displayName = "Code";
61
+ export {
62
+ h as Code,
63
+ y as Heading,
64
+ u as Text
65
+ };
@@ -0,0 +1,11 @@
1
+ import { Avatar as AvatarPrimitive } from 'radix-ui';
2
+ import * as React from "react";
3
+ declare function Avatar({ className, size, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root> & {
4
+ size?: "default" | "sm" | "lg";
5
+ }): React.JSX.Element;
6
+ declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): React.JSX.Element;
7
+ declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): React.JSX.Element;
8
+ declare function AvatarBadge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
9
+ declare function AvatarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ export { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount, };
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ import { Avatar as r } from "radix-ui";
4
+ import { cn as s } from "../../lib/cn.js";
5
+ function n({
6
+ className: a,
7
+ size: t = "default",
8
+ ...l
9
+ }) {
10
+ return /* @__PURE__ */ e(
11
+ r.Root,
12
+ {
13
+ "data-slot": "avatar",
14
+ "data-size": t,
15
+ className: s(
16
+ "group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",
17
+ a
18
+ ),
19
+ ...l
20
+ }
21
+ );
22
+ }
23
+ function d({
24
+ className: a,
25
+ ...t
26
+ }) {
27
+ return /* @__PURE__ */ e(
28
+ r.Image,
29
+ {
30
+ "data-slot": "avatar-image",
31
+ className: s("aspect-square size-full", a),
32
+ ...t
33
+ }
34
+ );
35
+ }
36
+ function f({
37
+ className: a,
38
+ ...t
39
+ }) {
40
+ return /* @__PURE__ */ e(
41
+ r.Fallback,
42
+ {
43
+ "data-slot": "avatar-fallback",
44
+ className: s(
45
+ "flex size-full items-center justify-center rounded-full bg-muted text-xs text-muted-foreground group-data-[size=sm]/avatar:text-xs",
46
+ a
47
+ ),
48
+ ...t
49
+ }
50
+ );
51
+ }
52
+ export {
53
+ n as Avatar,
54
+ f as AvatarFallback,
55
+ d as AvatarImage
56
+ };
@@ -0,0 +1,10 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from "react";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "link" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | "xs" | "icon" | "icon-sm" | "icon-xs" | "icon-lg" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ }): React.JSX.Element;
10
+ export { Button, buttonVariants };