@tulipfarm/sprout 0.3.1 → 0.5.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 (355) hide show
  1. package/README.md +75 -68
  2. package/dist/components/accordion.d.ts +2 -2
  3. package/dist/components/accordion.js +9 -9
  4. package/dist/components/agent-avatar.d.ts +27 -0
  5. package/dist/components/agent-avatar.js +67 -0
  6. package/dist/components/agent-fanout.d.ts +2 -2
  7. package/dist/components/agent-fanout.js +65 -87
  8. package/dist/components/alert-dialog.d.ts +8 -8
  9. package/dist/components/alert-dialog.js +21 -21
  10. package/dist/components/alert.d.ts +6 -6
  11. package/dist/components/alert.js +13 -13
  12. package/dist/components/aspect-ratio.d.ts +2 -2
  13. package/dist/components/aspect-ratio.js +2 -2
  14. package/dist/components/attachment.d.ts +18 -18
  15. package/dist/components/attachment.js +82 -115
  16. package/dist/components/avatar.d.ts +9 -17
  17. package/dist/components/avatar.js +14 -51
  18. package/dist/components/badge.d.ts +4 -4
  19. package/dist/components/badge.js +18 -18
  20. package/dist/components/board.d.ts +107 -0
  21. package/dist/components/board.js +640 -0
  22. package/dist/components/brand-icon.d.ts +6 -6
  23. package/dist/components/brand-icon.js +55 -63
  24. package/dist/components/breadcrumb.d.ts +11 -11
  25. package/dist/components/breadcrumb.js +16 -18
  26. package/dist/components/button-group.d.ts +6 -6
  27. package/dist/components/button-group.js +14 -14
  28. package/dist/components/button.d.ts +13 -13
  29. package/dist/components/button.js +31 -57
  30. package/dist/components/calendar.d.ts +5 -5
  31. package/dist/components/calendar.js +44 -53
  32. package/dist/components/canvas.d.ts +4 -4
  33. package/dist/components/canvas.js +39 -46
  34. package/dist/components/card.d.ts +7 -7
  35. package/dist/components/card.js +17 -17
  36. package/dist/components/carousel.d.ts +7 -7
  37. package/dist/components/carousel.js +57 -75
  38. package/dist/components/chart.d.ts +5 -112
  39. package/dist/components/chart.js +5 -172
  40. package/dist/components/chat-confirmation.d.ts +10 -10
  41. package/dist/components/chat-confirmation.js +32 -38
  42. package/dist/components/chat-input.d.ts +4 -4
  43. package/dist/components/chat-input.js +74 -81
  44. package/dist/components/chat-plan.d.ts +2 -2
  45. package/dist/components/chat-plan.js +15 -20
  46. package/dist/components/chat-sources.d.ts +8 -8
  47. package/dist/components/chat-sources.js +18 -27
  48. package/dist/components/checkbox.d.ts +1 -1
  49. package/dist/components/checkbox.js +9 -9
  50. package/dist/components/choice-list.d.ts +2 -2
  51. package/dist/components/choice-list.js +16 -18
  52. package/dist/components/code-block.d.ts +5 -5
  53. package/dist/components/code-block.js +26 -26
  54. package/dist/components/collapsible.d.ts +1 -1
  55. package/dist/components/collapsible.js +7 -11
  56. package/dist/components/combobox.d.ts +12 -6
  57. package/dist/components/combobox.js +27 -26
  58. package/dist/components/command.d.ts +13 -13
  59. package/dist/components/command.js +61 -73
  60. package/dist/components/context-menu.d.ts +5 -5
  61. package/dist/components/context-menu.js +22 -22
  62. package/dist/components/dialog.d.ts +6 -6
  63. package/dist/components/dialog.js +23 -28
  64. package/dist/components/direction.d.ts +1 -1
  65. package/dist/components/direction.js +1 -1
  66. package/dist/components/dropdown-menu.d.ts +5 -5
  67. package/dist/components/dropdown-menu.js +20 -20
  68. package/dist/components/field.d.ts +11 -11
  69. package/dist/components/field.js +41 -61
  70. package/dist/components/file-explorer.d.ts +2 -2
  71. package/dist/components/file-explorer.js +89 -105
  72. package/dist/components/file-viewer.d.ts +10 -10
  73. package/dist/components/file-viewer.js +112 -140
  74. package/dist/components/form.d.ts +7 -7
  75. package/dist/components/form.js +24 -28
  76. package/dist/components/glass-banner.d.ts +3 -3
  77. package/dist/components/glass-banner.js +21 -24
  78. package/dist/components/gradient-banner.d.ts +7 -7
  79. package/dist/components/gradient-banner.js +13 -22
  80. package/dist/components/hover-card.d.ts +4 -4
  81. package/dist/components/hover-card.js +6 -6
  82. package/dist/components/input-group.d.ts +18 -18
  83. package/dist/components/input-group.js +25 -39
  84. package/dist/components/input-otp.d.ts +14 -10
  85. package/dist/components/input-otp.js +15 -15
  86. package/dist/components/input.d.ts +3 -3
  87. package/dist/components/input.js +7 -7
  88. package/dist/components/kbd.d.ts +3 -3
  89. package/dist/components/kbd.js +5 -5
  90. package/dist/components/label.d.ts +2 -2
  91. package/dist/components/label.js +2 -2
  92. package/dist/components/mention-list.d.ts +3 -3
  93. package/dist/components/mention-list.js +10 -10
  94. package/dist/components/menubar.d.ts +6 -6
  95. package/dist/components/menubar.js +22 -22
  96. package/dist/components/message-actions.d.ts +2 -2
  97. package/dist/components/message-actions.js +29 -31
  98. package/dist/components/message-response.d.ts +3 -3
  99. package/dist/components/message-response.js +18 -18
  100. package/dist/components/message-scroller.d.ts +12 -12
  101. package/dist/components/message-scroller.js +44 -56
  102. package/dist/components/message.d.ts +11 -11
  103. package/dist/components/message.js +25 -25
  104. package/dist/components/navigation-menu.d.ts +2 -2
  105. package/dist/components/navigation-menu.js +15 -15
  106. package/dist/components/notice-banner.d.ts +2 -2
  107. package/dist/components/notice-banner.js +2 -2
  108. package/dist/components/page-content.d.ts +2 -2
  109. package/dist/components/page-content.js +2 -2
  110. package/dist/components/page-header.d.ts +1 -1
  111. package/dist/components/page-header.js +17 -17
  112. package/dist/components/pagination.d.ts +9 -9
  113. package/dist/components/pagination.js +17 -17
  114. package/dist/components/plan-outline.d.ts +2 -2
  115. package/dist/components/plan-outline.js +43 -60
  116. package/dist/components/popover.d.ts +6 -6
  117. package/dist/components/popover.js +15 -15
  118. package/dist/components/presence-cursor.d.ts +2 -2
  119. package/dist/components/presence-cursor.js +3 -3
  120. package/dist/components/progress.d.ts +1 -1
  121. package/dist/components/progress.js +8 -8
  122. package/dist/components/prompt-list.d.ts +3 -3
  123. package/dist/components/prompt-list.js +6 -6
  124. package/dist/components/questionnaire.d.ts +19 -19
  125. package/dist/components/questionnaire.js +183 -242
  126. package/dist/components/radio-group.d.ts +2 -2
  127. package/dist/components/radio-group.js +6 -6
  128. package/dist/components/reasoning-effort.d.ts +3 -3
  129. package/dist/components/reasoning-effort.js +9 -12
  130. package/dist/components/record-list.d.ts +66 -0
  131. package/dist/components/record-list.js +151 -0
  132. package/dist/components/resizable.d.ts +5 -5
  133. package/dist/components/resizable.js +76 -102
  134. package/dist/components/result-card.d.ts +4 -4
  135. package/dist/components/result-card.js +42 -53
  136. package/dist/components/result-notice.d.ts +18 -0
  137. package/dist/components/result-notice.js +29 -0
  138. package/dist/components/review-card.d.ts +6 -6
  139. package/dist/components/review-card.js +18 -18
  140. package/dist/components/rich-text-editor.d.ts +5 -5
  141. package/dist/components/rich-text-editor.js +56 -72
  142. package/dist/components/schema-diagram.d.ts +3 -3
  143. package/dist/components/schema-diagram.js +39 -53
  144. package/dist/components/scroll-area.d.ts +3 -3
  145. package/dist/components/scroll-area.js +10 -14
  146. package/dist/components/search-dialog.d.ts +6 -6
  147. package/dist/components/search-dialog.js +16 -16
  148. package/dist/components/search-field.d.ts +1 -1
  149. package/dist/components/search-field.js +11 -11
  150. package/dist/components/select.d.ts +5 -9
  151. package/dist/components/select.js +20 -20
  152. package/dist/components/selection-slot.d.ts +2 -2
  153. package/dist/components/selection-slot.js +6 -9
  154. package/dist/components/separator.d.ts +15 -15
  155. package/dist/components/separator.js +22 -27
  156. package/dist/components/settings-list.d.ts +3 -3
  157. package/dist/components/settings-list.js +5 -5
  158. package/dist/components/sheet.d.ts +6 -6
  159. package/dist/components/sheet.js +27 -27
  160. package/dist/components/sidebar.d.ts +22 -22
  161. package/dist/components/sidebar.js +57 -58
  162. package/dist/components/skeleton.d.ts +5 -5
  163. package/dist/components/skeleton.js +14 -21
  164. package/dist/components/slider.d.ts +2 -2
  165. package/dist/components/slider.js +6 -6
  166. package/dist/components/spinner.d.ts +7 -7
  167. package/dist/components/spinner.js +22 -26
  168. package/dist/components/sql-viewer.d.ts +14 -14
  169. package/dist/components/sql-viewer.js +99 -128
  170. package/dist/components/state-panel-samples.d.ts +2 -2
  171. package/dist/components/state-panel-samples.js +209 -245
  172. package/dist/components/state-panel.d.ts +2 -35
  173. package/dist/components/state-panel.js +2 -29
  174. package/dist/components/state-sample.d.ts +8 -8
  175. package/dist/components/state-sample.js +18 -31
  176. package/dist/components/switch.d.ts +3 -3
  177. package/dist/components/switch.js +7 -7
  178. package/dist/components/table-nuqs.d.ts +2 -2
  179. package/dist/components/table-nuqs.js +11 -12
  180. package/dist/components/table.d.ts +4 -4
  181. package/dist/components/table.js +166 -235
  182. package/dist/components/tabs.d.ts +2 -2
  183. package/dist/components/tabs.js +12 -12
  184. package/dist/components/textarea.d.ts +2 -2
  185. package/dist/components/textarea.js +6 -8
  186. package/dist/components/timeline.d.ts +3 -0
  187. package/dist/components/timeline.js +3 -0
  188. package/dist/components/toast.d.ts +2 -2
  189. package/dist/components/toast.js +19 -25
  190. package/dist/components/toggle-group.d.ts +4 -4
  191. package/dist/components/toggle-group.js +18 -20
  192. package/dist/components/toggle.d.ts +4 -4
  193. package/dist/components/toggle.js +8 -8
  194. package/dist/components/tool-activity.d.ts +1 -1
  195. package/dist/components/tool-activity.js +83 -110
  196. package/dist/components/toolbar-status.d.ts +2 -2
  197. package/dist/components/toolbar-status.js +7 -7
  198. package/dist/components/tooltip.d.ts +5 -5
  199. package/dist/components/tooltip.js +12 -11
  200. package/dist/components/typed-text.d.ts +2 -2
  201. package/dist/components/typed-text.js +10 -12
  202. package/dist/components/view-switcher.d.ts +51 -0
  203. package/dist/components/view-switcher.js +114 -0
  204. package/dist/index.d.ts +99 -93
  205. package/dist/index.js +99 -93
  206. package/dist/internal/agent-avatar-artwork.d.ts +4 -0
  207. package/dist/internal/agent-avatar-artwork.js +219 -0
  208. package/dist/internal/chart-kit.d.ts +142 -0
  209. package/dist/internal/chart-kit.js +200 -0
  210. package/dist/internal/charts/bars.d.ts +61 -0
  211. package/dist/internal/charts/bars.js +86 -0
  212. package/dist/internal/charts/lines.d.ts +67 -0
  213. package/dist/internal/charts/lines.js +70 -0
  214. package/dist/internal/charts/more.d.ts +77 -0
  215. package/dist/internal/charts/more.js +68 -0
  216. package/dist/internal/charts/parts.d.ts +54 -0
  217. package/dist/internal/charts/parts.js +82 -0
  218. package/dist/internal/charts/timeline-dates.d.ts +38 -0
  219. package/dist/internal/charts/timeline-dates.js +113 -0
  220. package/dist/internal/charts/timeline-window.d.ts +31 -0
  221. package/dist/internal/charts/timeline-window.js +26 -0
  222. package/dist/internal/charts/timeline.d.ts +72 -0
  223. package/dist/internal/charts/timeline.js +287 -0
  224. package/dist/internal/classes.d.ts +1 -1
  225. package/dist/internal/classes.js +7 -9
  226. package/dist/internal/code-tokens.d.ts +2 -2
  227. package/dist/internal/code-tokens.js +12 -12
  228. package/dist/internal/fieldset.d.ts +1 -1
  229. package/dist/internal/fieldset.js +6 -6
  230. package/dist/internal/file-kind.d.ts +1 -1
  231. package/dist/internal/file-kind.js +43 -51
  232. package/dist/internal/flow.d.ts +4 -4
  233. package/dist/internal/flow.js +20 -23
  234. package/dist/internal/hash.d.ts +1 -0
  235. package/dist/internal/hash.js +9 -0
  236. package/dist/internal/languages.js +999 -999
  237. package/dist/internal/message-scroller.d.ts +3 -3
  238. package/dist/internal/message-scroller.js +64 -112
  239. package/dist/internal/pressable.d.ts +1 -1
  240. package/dist/internal/pressable.js +7 -7
  241. package/dist/internal/state-panel.d.ts +35 -0
  242. package/dist/internal/state-panel.js +22 -0
  243. package/dist/internal/syntax.d.ts +2 -2
  244. package/dist/internal/syntax.js +36 -47
  245. package/dist/styles/accordion.css +3 -5
  246. package/dist/styles/agent-fanout.css +64 -60
  247. package/dist/styles/alert-dialog.css +12 -26
  248. package/dist/styles/alert.css +10 -15
  249. package/dist/styles/attachment.css +56 -98
  250. package/dist/styles/avatar.css +14 -33
  251. package/dist/styles/badge.css +11 -36
  252. package/dist/styles/board.css +571 -0
  253. package/dist/styles/brand-icon.css +7 -8
  254. package/dist/styles/breadcrumb.css +4 -7
  255. package/dist/styles/button-group.css +9 -15
  256. package/dist/styles/button.css +45 -175
  257. package/dist/styles/calendar.css +24 -36
  258. package/dist/styles/canvas.css +2 -3
  259. package/dist/styles/card.css +7 -23
  260. package/dist/styles/carousel.css +11 -12
  261. package/dist/styles/chart.css +215 -31
  262. package/dist/styles/chat-input.css +15 -39
  263. package/dist/styles/chat-plan.css +3 -4
  264. package/dist/styles/chat-sources.css +4 -6
  265. package/dist/styles/checkbox.css +11 -25
  266. package/dist/styles/choice-list.css +17 -31
  267. package/dist/styles/code-block.css +11 -25
  268. package/dist/styles/collapsible.css +10 -15
  269. package/dist/styles/combobox.css +24 -17
  270. package/dist/styles/command.css +8 -9
  271. package/dist/styles/context-menu.css +4 -2
  272. package/dist/styles/dialog.css +5 -16
  273. package/dist/styles/dropdown-menu.css +4 -2
  274. package/dist/styles/field.css +15 -21
  275. package/dist/styles/file-explorer.css +19 -33
  276. package/dist/styles/file-viewer.css +13 -17
  277. package/dist/styles/form.css +3 -3
  278. package/dist/styles/glass-banner.css +12 -47
  279. package/dist/styles/gradient-banner.css +16 -39
  280. package/dist/styles/hover-card.css +9 -15
  281. package/dist/styles/index.css +121 -112
  282. package/dist/styles/input-group.css +61 -69
  283. package/dist/styles/input-otp.css +18 -9
  284. package/dist/styles/input.css +19 -11
  285. package/dist/styles/kbd.css +1 -1
  286. package/dist/styles/label.css +9 -30
  287. package/dist/styles/mention-list.css +6 -8
  288. package/dist/styles/menubar.css +9 -8
  289. package/dist/styles/message-actions.css +1 -1
  290. package/dist/styles/message-response.css +3 -5
  291. package/dist/styles/message-scroller.css +14 -21
  292. package/dist/styles/message.css +23 -60
  293. package/dist/styles/navigation-menu.css +15 -30
  294. package/dist/styles/notice-banner.css +1 -2
  295. package/dist/styles/page-header.css +11 -10
  296. package/dist/styles/pagination.css +12 -6
  297. package/dist/styles/plan-outline.css +20 -37
  298. package/dist/styles/popover.css +10 -19
  299. package/dist/styles/presence-cursor.css +1 -2
  300. package/dist/styles/progress.css +2 -4
  301. package/dist/styles/prompt-list.css +6 -17
  302. package/dist/styles/questionnaire.css +16 -40
  303. package/dist/styles/radio-group.css +12 -23
  304. package/dist/styles/reasoning-effort.css +8 -15
  305. package/dist/styles/record-list.css +243 -0
  306. package/dist/styles/resizable.css +10 -11
  307. package/dist/styles/result-card.css +4 -4
  308. package/dist/styles/result-notice.css +80 -0
  309. package/dist/styles/review-card.css +2 -3
  310. package/dist/styles/rich-text-editor.css +4 -5
  311. package/dist/styles/schema-diagram.css +12 -17
  312. package/dist/styles/scroll-area.css +8 -10
  313. package/dist/styles/search-dialog.css +1 -5
  314. package/dist/styles/search-field.css +1 -2
  315. package/dist/styles/select.css +15 -19
  316. package/dist/styles/selection-slot.css +1 -2
  317. package/dist/styles/separator.css +7 -8
  318. package/dist/styles/settings-list.css +1 -2
  319. package/dist/styles/sheet.css +40 -73
  320. package/dist/styles/sidebar.css +32 -34
  321. package/dist/styles/skeleton.css +9 -11
  322. package/dist/styles/slider.css +11 -21
  323. package/dist/styles/spinner.css +2 -2
  324. package/dist/styles/sql-viewer.css +29 -29
  325. package/dist/styles/state-panel.css +8 -9
  326. package/dist/styles/state-sample.css +20 -33
  327. package/dist/styles/switch.css +11 -18
  328. package/dist/styles/table.css +62 -81
  329. package/dist/styles/tabs.css +13 -19
  330. package/dist/styles/textarea.css +3 -3
  331. package/dist/styles/themes/chatgpt.css +11 -23
  332. package/dist/styles/themes/claude.css +12 -24
  333. package/dist/styles/themes/cloudflare.css +11 -23
  334. package/dist/styles/themes/discord.css +11 -23
  335. package/dist/styles/themes/github.css +11 -23
  336. package/dist/styles/themes/grok.css +11 -23
  337. package/dist/styles/themes/linear.css +12 -25
  338. package/dist/styles/themes/neutral.css +11 -23
  339. package/dist/styles/themes/notion.css +11 -23
  340. package/dist/styles/themes/perplexity.css +11 -23
  341. package/dist/styles/themes/raycast.css +11 -23
  342. package/dist/styles/themes/spotify.css +11 -23
  343. package/dist/styles/themes/stripe.css +11 -23
  344. package/dist/styles/themes/supabase.css +11 -23
  345. package/dist/styles/themes/tulipfarm.css +9 -10
  346. package/dist/styles/themes/vercel.css +12 -25
  347. package/dist/styles/timeline.css +276 -0
  348. package/dist/styles/toast.css +13 -20
  349. package/dist/styles/toggle-group.css +23 -29
  350. package/dist/styles/toggle.css +14 -14
  351. package/dist/styles/tool-activity.css +7 -13
  352. package/dist/styles/toolbar-status.css +2 -7
  353. package/dist/styles/tooltip.css +15 -21
  354. package/dist/styles/view-switcher.css +297 -0
  355. package/package.json +25 -1
@@ -1,58 +1,52 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { BaseEdge, EdgeLabelRenderer, Handle, Position, ReactFlow, } from "@xyflow/react";
4
- import { useLayoutEffect, useRef, useState, } from "react";
5
- import { Check } from "reicon-react/icons/Check";
6
- import { ChevronDown } from "reicon-react/icons/ChevronDown";
7
- import { Danger } from "reicon-react/icons/Danger";
8
- import { MinusCircle } from "reicon-react/icons/MinusCircle";
9
- import { RotateLeft } from "reicon-react/icons/RotateLeft";
10
- import { Sparkle } from "reicon-react/icons/Sparkle";
11
- import { cn } from "../internal/classes.js";
12
- import { Button } from "./button.js";
13
- import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "./collapsible.js";
14
- export const agentFanoutStatusNames = [
15
- "queued",
16
- "working",
17
- "done",
18
- "failed",
19
- "stopped",
20
- ];
21
- export const agentFanoutStateNames = ["running", "done", "stopped"];
3
+ import { BaseEdge, EdgeLabelRenderer, Handle, Position, ReactFlow, } from '@xyflow/react';
4
+ import { useLayoutEffect, useRef, useState } from 'react';
5
+ import { Check } from 'reicon-react/icons/Check';
6
+ import { ChevronDown } from 'reicon-react/icons/ChevronDown';
7
+ import { Danger } from 'reicon-react/icons/Danger';
8
+ import { MinusCircle } from 'reicon-react/icons/MinusCircle';
9
+ import { RotateLeft } from 'reicon-react/icons/RotateLeft';
10
+ import { Sparkle } from 'reicon-react/icons/Sparkle';
11
+ import { cn } from '../internal/classes.js';
12
+ import { Button } from './button.js';
13
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './collapsible.js';
14
+ export const agentFanoutStatusNames = ['queued', 'working', 'done', 'failed', 'stopped'];
15
+ export const agentFanoutStateNames = ['running', 'done', 'stopped'];
22
16
  const rootTop = 12;
23
17
  const rootSize = 44;
24
18
  const levelTop = 120;
25
19
  const levelGap = 108;
26
20
  const nodeLabel = 22;
27
21
  const bottomGap = 36;
28
- const colorCount = 5;
22
+ const colorCount = 10;
29
23
  const statusText = {
30
- queued: "Queued",
31
- working: "Working",
32
- done: "Done",
33
- failed: "Failed",
34
- stopped: "Stopped",
24
+ queued: 'Queued',
25
+ working: 'Working',
26
+ done: 'Done',
27
+ failed: 'Failed',
28
+ stopped: 'Stopped',
35
29
  };
36
30
  const seconds = (ms) => `${(ms / 1000).toFixed(1)}s`;
37
31
  function phaseText(agents, state, elapsed) {
38
- const time = elapsed === undefined ? "" : seconds(elapsed);
39
- if (state === "done") {
40
- const merged = agents.filter((agent) => agent.status === "done").length;
32
+ const time = elapsed === undefined ? '' : seconds(elapsed);
33
+ if (state === 'done') {
34
+ const merged = agents.filter(agent => agent.status === 'done').length;
41
35
  return {
42
- text: `Merged ${merged} ${merged === 1 ? "result" : "results"}${time && ` in ${time}`}`,
43
- time: "",
36
+ text: `Merged ${merged} ${merged === 1 ? 'result' : 'results'}${time && ` in ${time}`}`,
37
+ time: '',
44
38
  };
45
39
  }
46
- if (state === "stopped")
47
- return { text: time ? `Stopped after ${time}` : "Stopped", time: "" };
48
- const settled = agents.filter((agent) => agent.status === "done" || agent.status === "failed").length;
49
- const text = agents.every((agent) => agent.status === "queued")
50
- ? "Delegating work"
40
+ if (state === 'stopped')
41
+ return { text: time ? `Stopped after ${time}` : 'Stopped', time: '' };
42
+ const settled = agents.filter(agent => agent.status === 'done' || agent.status === 'failed').length;
43
+ const text = agents.every(agent => agent.status === 'queued')
44
+ ? 'Delegating work'
51
45
  : settled === agents.length
52
- ? "Composing answer"
46
+ ? 'Composing answer'
53
47
  : settled > 0
54
- ? "Merging results"
55
- : "Specialists working";
48
+ ? 'Merging results'
49
+ : 'Specialists working';
56
50
  return { text, time };
57
51
  }
58
52
  function useWidth() {
@@ -79,31 +73,22 @@ function flatten(agents, initial, parent = rootId, depth = 1, color) {
79
73
  parent,
80
74
  depth,
81
75
  changed: changed || undefined,
82
- trip: !changed
83
- ? null
84
- : agent.status === "working"
85
- ? "out"
86
- : agent.status === "done"
87
- ? "back"
88
- : null,
76
+ trip: !changed ? null : agent.status === 'working' ? 'out' : agent.status === 'done' ? 'back' : null,
89
77
  style: {
90
- "--sprout-agent-fanout-color": own,
91
- "--sprout-agent-fanout-index": index,
92
- "--sprout-agent-fanout-depth": depth - 1,
78
+ '--sprout-agent-fanout-color': own,
79
+ '--sprout-agent-fanout-index': index,
80
+ '--sprout-agent-fanout-depth': depth - 1,
93
81
  },
94
82
  };
95
- return [
96
- line,
97
- ...flatten(agent.agents ?? [], initial, agent.id, depth + 1, own),
98
- ];
83
+ return [line, ...flatten(agent.agents ?? [], initial, agent.id, depth + 1, own)];
99
84
  });
100
85
  }
101
- const rootId = "agent-fanout-root";
86
+ const rootId = 'agent-fanout-root';
102
87
  // Fresh node objects every render drop React Flow's measured handles, which
103
88
  // unmounts the edges and restarts their pulses. Declared handles survive.
104
89
  const handle = (type, x, y) => ({
105
90
  type,
106
- position: type === "source" ? Position.Bottom : Position.Top,
91
+ position: type === 'source' ? Position.Bottom : Position.Top,
107
92
  x,
108
93
  y,
109
94
  width: 0,
@@ -114,49 +99,46 @@ function layout(lines, width, state, rootChanged) {
114
99
  const children = new Map();
115
100
  for (const line of lines)
116
101
  children.set(line.parent, [...(children.get(line.parent) ?? []), line]);
117
- const leaves = lines.filter((line) => !children.has(line.agent.id)).length;
102
+ const leaves = lines.filter(line => !children.has(line.agent.id)).length;
118
103
  const column = width / Math.max(leaves, 1);
119
104
  const centers = new Map();
120
105
  let leaf = 0;
121
106
  const place = (id) => {
122
107
  const kids = children.get(id);
123
- const xs = kids?.map((kid) => place(kid.agent.id));
108
+ const xs = kids?.map(kid => place(kid.agent.id));
124
109
  const x = xs ? (xs[0] + xs.at(-1)) / 2 : (leaf++ + 0.5) * column;
125
110
  centers.set(id, x);
126
111
  return x;
127
112
  };
128
113
  place(rootId);
129
- const depth = Math.max(0, ...lines.map((line) => line.depth));
114
+ const depth = Math.max(0, ...lines.map(line => line.depth));
130
115
  const dot = width ? Math.min(40, Math.max(28, column - 12)) : 40;
131
116
  const nodes = [
132
117
  {
133
118
  id: rootId,
134
- type: "root",
119
+ type: 'root',
135
120
  position: { x: width / 2 - rootSize / 2, y: rootTop },
136
121
  width: rootSize,
137
122
  height: rootSize,
138
- handles: [handle("source", rootSize / 2, rootSize)],
123
+ handles: [handle('source', rootSize / 2, rootSize)],
139
124
  data: { state, changed: rootChanged },
140
125
  },
141
126
  ...lines.map((line) => ({
142
127
  id: line.agent.id,
143
- type: "agent",
128
+ type: 'agent',
144
129
  position: {
145
130
  x: centers.get(line.agent.id) - column / 2,
146
131
  y: levelTop + (line.depth - 1) * levelGap,
147
132
  },
148
133
  width: column,
149
134
  height: dot + nodeLabel,
150
- handles: [
151
- handle("target", column / 2, 0),
152
- handle("source", column / 2, dot),
153
- ],
135
+ handles: [handle('target', column / 2, 0), handle('source', column / 2, dot)],
154
136
  data: line,
155
137
  })),
156
138
  ];
157
- const edges = lines.map((line) => ({
139
+ const edges = lines.map(line => ({
158
140
  id: `${line.parent}-${line.agent.id}`,
159
- type: "trip",
141
+ type: 'trip',
160
142
  source: line.parent,
161
143
  target: line.agent.id,
162
144
  data: { trip: line.trip, style: line.style },
@@ -165,20 +147,16 @@ function layout(lines, width, state, rootChanged) {
165
147
  nodes,
166
148
  edges,
167
149
  dot,
168
- height: levelTop +
169
- Math.max(depth - 1, 0) * levelGap +
170
- dot +
171
- nodeLabel +
172
- bottomGap,
150
+ height: levelTop + Math.max(depth - 1, 0) * levelGap + dot + nodeLabel + bottomGap,
173
151
  };
174
152
  }
175
153
  function RootMark({ data: { state, changed } }) {
176
- return (_jsxs("span", { "data-slot": "agent-fanout-root", "data-state": state, "data-changed": changed, className: "sprout-agent-fanout-root", children: [state === "done" ? (_jsx(Check, { size: 18 })) : state === "stopped" ? (_jsx(MinusCircle, { size: 18 })) : (_jsx(Sparkle, { size: 18 })), _jsx(Handle, { type: "source", position: Position.Bottom, isConnectable: false, className: "sprout-agent-fanout-handle" })] }));
154
+ return (_jsxs("span", { "data-slot": "agent-fanout-root", "data-state": state, "data-changed": changed, className: "sprout-agent-fanout-root", children: [state === 'done' ? _jsx(Check, { size: 18 }) : state === 'stopped' ? _jsx(MinusCircle, { size: 18 }) : _jsx(Sparkle, { size: 18 }), _jsx(Handle, { type: "source", position: Position.Bottom, isConnectable: false, className: "sprout-agent-fanout-handle" })] }));
177
155
  }
178
156
  function AgentMark({ data: { agent, changed, style } }) {
179
157
  return (_jsxs("div", { "data-slot": "agent-fanout-node", "data-status": agent.status, "data-changed": changed, className: "sprout-agent-fanout-node", style: style, children: [_jsxs("span", { className: "sprout-agent-fanout-dot", children: [_jsx(NodeMark, { agent: agent }), _jsx(Handle, { type: "target", position: Position.Top, isConnectable: false, className: "sprout-agent-fanout-handle" }), agent.agents && agent.agents.length > 0 && (_jsx(Handle, { type: "source", position: Position.Bottom, isConnectable: false, className: "sprout-agent-fanout-handle" }))] }), _jsx("span", { className: "sprout-agent-fanout-node-name", children: agent.name })] }));
180
158
  }
181
- function TripLine({ id, sourceX, sourceY, targetX, targetY, data, }) {
159
+ function TripLine({ id, sourceX, sourceY, targetX, targetY, data }) {
182
160
  const drop = targetY - sourceY;
183
161
  const d = `M ${sourceX} ${sourceY} C ${sourceX} ${sourceY + drop * 0.5}, ${targetX} ${sourceY + drop * 0.2}, ${targetX} ${targetY}`;
184
162
  const trip = data?.trip;
@@ -188,16 +166,16 @@ const nodeTypes = { root: RootMark, agent: AgentMark };
188
166
  const edgeTypes = { trip: TripLine };
189
167
  const viewport = { x: 0, y: 0, zoom: 1 };
190
168
  function NodeMark({ agent }) {
191
- if (agent.status === "done")
192
- return _jsx(Check, { size: 16, "aria-hidden": "true" });
193
- if (agent.status === "failed")
169
+ if (agent.status === 'done')
170
+ return _jsx(Check, { size: 16, strokeWidth: 2.5, "aria-hidden": "true" });
171
+ if (agent.status === 'failed')
194
172
  return _jsx(Danger, { size: 16, "aria-hidden": "true" });
195
173
  return _jsx("span", { "aria-hidden": "true", children: agent.icon });
196
174
  }
197
175
  function StatusMark({ agent }) {
198
- if (agent.status === "done")
199
- return (_jsxs(_Fragment, { children: [_jsx(Check, { size: 12, "aria-hidden": "true" }), agent.duration === undefined ? "Done" : seconds(agent.duration)] }));
200
- if (agent.status === "working")
176
+ if (agent.status === 'done')
177
+ return (_jsxs(_Fragment, { children: [_jsx(Check, { size: 12, "aria-hidden": "true" }), agent.duration === undefined ? 'Done' : seconds(agent.duration)] }));
178
+ if (agent.status === 'working')
201
179
  return (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", className: "sprout-agent-fanout-pulse" }), "Working"] }));
202
180
  return _jsx(_Fragment, { children: statusText[agent.status] });
203
181
  }
@@ -206,7 +184,7 @@ function StatusMark({ agent }) {
206
184
  * they find. Each status change sends a pulse along the subagent's line:
207
185
  * down when it starts, back up when it finishes.
208
186
  */
209
- export function AgentFanout({ task, agents, state = "running", elapsed, label, defaultOpen = false, onStop, onRestart, className, }) {
187
+ export function AgentFanout({ task, agents, state = 'running', elapsed, label, defaultOpen = false, onStop, onRestart, className, }) {
210
188
  const [graphRef, width] = useWidth();
211
189
  // Only changes after the first render animate, so a finished fanout
212
190
  // renders still instead of replaying every pulse.
@@ -217,12 +195,12 @@ export function AgentFanout({ task, agents, state = "running", elapsed, label, d
217
195
  const phase = phaseText(agents, state, elapsed);
218
196
  const lines = flatten(agents, initial.statuses);
219
197
  const graph = layout(lines, width, state, initial.state !== state || undefined);
220
- const finished = lines.filter(({ agent }) => agent.status === "done" || agent.status === "failed").length;
221
- return (_jsxs("section", { "data-slot": "agent-fanout", "data-state": state, "aria-label": "Subagents", className: cn("sprout-agent-fanout", className), children: [_jsxs("div", { className: "sprout-agent-fanout-panel", children: [_jsx("div", { className: "sprout-agent-fanout-task", children: _jsx("span", { className: "sprout-agent-fanout-task-text", children: task }) }), _jsx("div", { ref: graphRef, "aria-hidden": "true", "data-slot": "agent-fanout-graph", className: "sprout-agent-fanout-graph", style: {
198
+ const finished = lines.filter(({ agent }) => agent.status === 'done' || agent.status === 'failed').length;
199
+ return (_jsxs("section", { "data-slot": "agent-fanout", "data-state": state, "aria-label": "Subagents", className: cn('sprout-agent-fanout', className), children: [_jsxs("div", { className: "sprout-agent-fanout-panel", children: [_jsx("div", { className: "sprout-agent-fanout-task", children: _jsx("span", { className: "sprout-agent-fanout-task-text", children: task }) }), _jsx("div", { ref: graphRef, "aria-hidden": "true", "data-slot": "agent-fanout-graph", className: "sprout-agent-fanout-graph", style: {
222
200
  height: graph.height,
223
- "--sprout-agent-fanout-dot": `${graph.dot}px`,
201
+ '--sprout-agent-fanout-dot': `${graph.dot}px`,
224
202
  }, children: width > 0 && (_jsx(ReactFlow, { className: "sprout-agent-fanout-flow", nodes: graph.nodes, edges: graph.edges, nodeTypes: nodeTypes, edgeTypes: edgeTypes, defaultViewport: viewport, minZoom: 1, maxZoom: 1, panOnDrag: false, panOnScroll: false, zoomOnScroll: false, zoomOnPinch: false, zoomOnDoubleClick: false, preventScrolling: false, nodesDraggable: false, nodesConnectable: false, nodesFocusable: false, edgesFocusable: false, elementsSelectable: false, proOptions: { hideAttribution: true } })) }), _jsxs(Collapsible, { defaultOpen: defaultOpen, className: "sprout-agent-fanout-details", children: [_jsxs(CollapsibleTrigger, { className: "sprout-agent-fanout-trigger", children: [_jsx("span", { className: "sprout-agent-fanout-trigger-label", children: "Details" }), _jsx("span", { className: "sprout-agent-fanout-trigger-count", children: `${finished} of ${lines.length} finished` }), _jsx(ChevronDown, { size: 14, "aria-hidden": "true", "data-slot": "collapsible-indicator" })] }), _jsx(CollapsibleContent, { keepMounted: true, children: _jsx("ul", { "aria-label": "Subagent status", className: "sprout-agent-fanout-rows", children: lines.map(({ agent, changed, style }) => {
225
- const settled = agent.status === "done" || agent.status === "failed";
226
- return (_jsxs("li", { "data-slot": "agent-fanout-row", "data-status": agent.status, className: "sprout-agent-fanout-row", style: style, children: [_jsx("span", { className: "sprout-agent-fanout-row-name", children: agent.name }), _jsx("span", { "data-changed": changed, className: "sprout-agent-fanout-row-detail", children: settled && agent.result ? agent.result : agent.task }, settled && agent.result ? "result" : "task"), _jsx("span", { "data-changed": changed, className: "sprout-agent-fanout-row-status", children: _jsx(StatusMark, { agent: agent }) }, agent.status)] }, agent.id));
227
- }) }) })] })] }), _jsxs("div", { className: "sprout-agent-fanout-footer", children: [_jsxs("p", { className: "sprout-agent-fanout-phase", children: [_jsx("span", { role: "status", children: label ?? phase.text }), !label && phase.time && (_jsx("span", { className: "sprout-agent-fanout-time", children: phase.time }))] }), state === "running" && onStop && (_jsxs(Button, { variant: "outline", size: "sm", onClick: onStop, className: "sprout-agent-fanout-action", children: [_jsx(MinusCircle, { size: 14, "aria-hidden": "true" }), "Stop"] })), state !== "running" && onRestart && (_jsxs(Button, { variant: "outline", size: "sm", onClick: onRestart, className: "sprout-agent-fanout-action", children: [_jsx(RotateLeft, { size: 14, "aria-hidden": "true" }), "Run again"] }))] })] }));
203
+ const settled = agent.status === 'done' || agent.status === 'failed';
204
+ return (_jsxs("li", { "data-slot": "agent-fanout-row", "data-status": agent.status, className: "sprout-agent-fanout-row", style: style, children: [_jsx("span", { className: "sprout-agent-fanout-row-name", children: agent.name }), _jsx("span", { "data-changed": changed, className: "sprout-agent-fanout-row-detail", children: settled && agent.result ? agent.result : agent.task }, settled && agent.result ? 'result' : 'task'), _jsx("span", { "data-changed": changed, className: "sprout-agent-fanout-row-status", children: _jsx(StatusMark, { agent: agent }) }, agent.status)] }, agent.id));
205
+ }) }) })] })] }), _jsxs("div", { className: "sprout-agent-fanout-footer", children: [_jsxs("p", { className: "sprout-agent-fanout-phase", children: [_jsx("span", { role: "status", children: label ?? phase.text }), !label && phase.time && _jsx("span", { className: "sprout-agent-fanout-time", children: phase.time })] }), state === 'running' && onStop && (_jsxs(Button, { variant: "outline", size: "sm", onClick: onStop, className: "sprout-agent-fanout-action", children: [_jsx(MinusCircle, { size: 14, "aria-hidden": "true" }), "Stop"] })), state !== 'running' && onRestart && (_jsxs(Button, { variant: "outline", size: "sm", onClick: onRestart, className: "sprout-agent-fanout-action", children: [_jsx(RotateLeft, { size: 14, "aria-hidden": "true" }), "Run again"] }))] })] }));
228
206
  }
@@ -1,7 +1,7 @@
1
- import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
2
- import { useRender } from "@base-ui/react/use-render";
3
- import { type ButtonProps, type ButtonSize, type ButtonVariant } from "./button.js";
4
- export declare const alertDialogSizeNames: readonly ["default", "sm"];
1
+ import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import { type ButtonProps, type ButtonSize, type ButtonVariant } from './button.js';
4
+ export declare const alertDialogSizeNames: readonly ["md", "sm"];
5
5
  export type AlertDialogSize = (typeof alertDialogSizeNames)[number];
6
6
  export type AlertDialogProps = AlertDialogPrimitive.Root.Props;
7
7
  export declare function AlertDialog(props: AlertDialogProps): import("react").JSX.Element;
@@ -15,21 +15,21 @@ export interface AlertDialogContentProps extends AlertDialogPrimitive.Popup.Prop
15
15
  /** `sm` centers the header and splits the footer into two equal buttons. */
16
16
  size?: AlertDialogSize;
17
17
  /** Where the portal renders. Defaults to `document.body`. */
18
- container?: AlertDialogPrimitive.Portal.Props["container"];
18
+ container?: AlertDialogPrimitive.Portal.Props['container'];
19
19
  }
20
20
  /**
21
21
  * The alert dialog surface. It renders its own portal and overlay, so place
22
22
  * it directly inside `AlertDialog`.
23
23
  */
24
24
  export declare function AlertDialogContent({ className, size, container, ...props }: AlertDialogContentProps): import("react").JSX.Element;
25
- type PartSlot = "alert-dialog-header" | "alert-dialog-footer" | "alert-dialog-media";
25
+ type PartSlot = 'alert-dialog-header' | 'alert-dialog-footer' | 'alert-dialog-media';
26
26
  export interface AlertDialogPartState extends Record<string, unknown> {
27
27
  slot: PartSlot;
28
28
  }
29
- export type AlertDialogPartProps = useRender.ComponentProps<"div", AlertDialogPartState>;
29
+ export type AlertDialogPartProps = useRender.ComponentProps<'div', AlertDialogPartState>;
30
30
  /**
31
31
  * Groups media, title, and description. Centered on narrow screens and in
32
- * `sm` dialogs; from 640px a `default` dialog aligns it to the start with the
32
+ * `sm` dialogs; from 640px an `md` dialog aligns it to the start with the
33
33
  * media beside the text.
34
34
  */
35
35
  export declare const AlertDialogHeader: ({ className, render, ref, ...props }: AlertDialogPartProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
@@ -1,60 +1,60 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
4
- import { mergeProps } from "@base-ui/react/merge-props";
5
- import { useRender } from "@base-ui/react/use-render";
6
- import { cn, stateClassName } from "../internal/classes.js";
7
- import { Button, } from "./button.js";
8
- export const alertDialogSizeNames = ["default", "sm"];
3
+ import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
4
+ import { mergeProps } from '@base-ui/react/merge-props';
5
+ import { useRender } from '@base-ui/react/use-render';
6
+ import { cn, stateClassName } from '../internal/classes.js';
7
+ import { Button } from './button.js';
8
+ export const alertDialogSizeNames = ['md', 'sm'];
9
9
  export function AlertDialog(props) {
10
10
  return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
11
11
  }
12
12
  export function AlertDialogTrigger(props) {
13
- return (_jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props }));
13
+ return _jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
14
14
  }
15
15
  export function AlertDialogPortal(props) {
16
- return (_jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props }));
16
+ return _jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
17
17
  }
18
18
  export function AlertDialogOverlay({ className, ...props }) {
19
- return (_jsx(AlertDialogPrimitive.Backdrop, { "data-slot": "alert-dialog-overlay", ...props, className: stateClassName("sprout-alert-dialog-overlay", className) }));
19
+ return (_jsx(AlertDialogPrimitive.Backdrop, { "data-slot": "alert-dialog-overlay", ...props, className: stateClassName('sprout-alert-dialog-overlay', className) }));
20
20
  }
21
21
  /**
22
22
  * The alert dialog surface. It renders its own portal and overlay, so place
23
23
  * it directly inside `AlertDialog`.
24
24
  */
25
- export function AlertDialogContent({ className, size = "default", container, ...props }) {
26
- return (_jsxs(AlertDialogPortal, { container: container, children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Popup, { "data-slot": "alert-dialog-content", "data-size": size, ...props, className: stateClassName("sprout-alert-dialog-content", className) })] }));
25
+ export function AlertDialogContent({ className, size = 'md', container, ...props }) {
26
+ return (_jsxs(AlertDialogPortal, { container: container, children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Popup, { "data-slot": "alert-dialog-content", "data-size": size, ...props, className: stateClassName('sprout-alert-dialog-content', className) })] }));
27
27
  }
28
28
  function part(slot, base) {
29
29
  return function AlertDialogPart({ className, render, ref, ...props }) {
30
30
  return useRender({
31
- defaultTagName: "div",
31
+ defaultTagName: 'div',
32
32
  ref,
33
33
  render,
34
- props: mergeProps({ "data-slot": slot, className: cn(base, className) }, props),
34
+ props: mergeProps({ 'data-slot': slot, className: cn(base, className) }, props),
35
35
  state: { slot },
36
36
  });
37
37
  };
38
38
  }
39
39
  /**
40
40
  * Groups media, title, and description. Centered on narrow screens and in
41
- * `sm` dialogs; from 640px a `default` dialog aligns it to the start with the
41
+ * `sm` dialogs; from 640px an `md` dialog aligns it to the start with the
42
42
  * media beside the text.
43
43
  */
44
- export const AlertDialogHeader = part("alert-dialog-header", "sprout-alert-dialog-header");
44
+ export const AlertDialogHeader = part('alert-dialog-header', 'sprout-alert-dialog-header');
45
45
  /**
46
46
  * A tinted action bar pinned to the bottom edge. Actions stack in reverse
47
47
  * order on narrow screens and align right from 640px; `sm` dialogs always
48
48
  * split it into two equal columns.
49
49
  */
50
- export const AlertDialogFooter = part("alert-dialog-footer", "sprout-alert-dialog-footer");
50
+ export const AlertDialogFooter = part('alert-dialog-footer', 'sprout-alert-dialog-footer');
51
51
  /** A 40px tile for an icon above or beside the title. */
52
- export const AlertDialogMedia = part("alert-dialog-media", "sprout-alert-dialog-media");
52
+ export const AlertDialogMedia = part('alert-dialog-media', 'sprout-alert-dialog-media');
53
53
  export function AlertDialogTitle({ className, ...props }) {
54
- return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", ...props, className: stateClassName("sprout-alert-dialog-title", className) }));
54
+ return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", ...props, className: stateClassName('sprout-alert-dialog-title', className) }));
55
55
  }
56
56
  export function AlertDialogDescription({ className, ...props }) {
57
- return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", ...props, className: stateClassName("sprout-alert-dialog-description", className) }));
57
+ return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", ...props, className: stateClassName('sprout-alert-dialog-description', className) }));
58
58
  }
59
59
  /**
60
60
  * The confirming button. It does not close the dialog by itself, so the
@@ -64,6 +64,6 @@ export function AlertDialogAction(props) {
64
64
  return _jsx(Button, { "data-slot": "alert-dialog-action", ...props });
65
65
  }
66
66
  /** Closes the dialog. An outline button unless `variant` says otherwise. */
67
- export function AlertDialogCancel({ variant = "outline", size = "default", ...props }) {
67
+ export function AlertDialogCancel({ variant = 'outline', size = 'md', ...props }) {
68
68
  return (_jsx(AlertDialogPrimitive.Close, { "data-slot": "alert-dialog-cancel", render: _jsx(Button, { variant: variant, size: size }), ...props }));
69
69
  }
@@ -1,16 +1,16 @@
1
- import { useRender } from "@base-ui/react/use-render";
1
+ import { useRender } from '@base-ui/react/use-render';
2
2
  export declare const alertVariantNames: readonly ["default", "destructive"];
3
3
  export type AlertVariant = (typeof alertVariantNames)[number];
4
4
  export interface AlertVariantOptions {
5
5
  variant?: AlertVariant | null;
6
6
  className?: string;
7
7
  }
8
- export declare function alertVariants({ variant, className, }?: AlertVariantOptions): string;
8
+ export declare function alertVariants({ variant, className }?: AlertVariantOptions): string;
9
9
  export interface AlertState extends Record<string, unknown> {
10
- slot: "alert";
10
+ slot: 'alert';
11
11
  variant: AlertVariant;
12
12
  }
13
- export interface AlertProps extends useRender.ComponentProps<"div", AlertState> {
13
+ export interface AlertProps extends useRender.ComponentProps<'div', AlertState> {
14
14
  variant?: AlertVariant;
15
15
  }
16
16
  /**
@@ -18,11 +18,11 @@ export interface AlertProps extends useRender.ComponentProps<"div", AlertState>
18
18
  * pass `role="status"` or `role="note"` for messages that should not interrupt.
19
19
  */
20
20
  export declare function Alert({ className, variant, render, ref, role, ...props }: AlertProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
21
- type PartSlot = "alert-title" | "alert-description" | "alert-action";
21
+ type PartSlot = 'alert-title' | 'alert-description' | 'alert-action';
22
22
  export interface AlertPartState extends Record<string, unknown> {
23
23
  slot: PartSlot;
24
24
  }
25
- export type AlertPartProps = useRender.ComponentProps<"div", AlertPartState>;
25
+ export type AlertPartProps = useRender.ComponentProps<'div', AlertPartState>;
26
26
  export declare const AlertTitle: ({ className, render, ref, ...props }: AlertPartProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
27
27
  export declare const AlertDescription: ({ className, render, ref, ...props }: AlertPartProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
28
28
  /** Pins a compact control, such as an Undo button, to the top-right corner. */
@@ -1,27 +1,27 @@
1
- import { mergeProps } from "@base-ui/react/merge-props";
2
- import { useRender } from "@base-ui/react/use-render";
3
- import { cn } from "../internal/classes.js";
4
- export const alertVariantNames = ["default", "destructive"];
5
- export function alertVariants({ variant, className, } = {}) {
6
- return cn("sprout-alert", `sprout-alert-${variant ?? "default"}`, className);
1
+ import { mergeProps } from '@base-ui/react/merge-props';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import { cn } from '../internal/classes.js';
4
+ export const alertVariantNames = ['default', 'destructive'];
5
+ export function alertVariants({ variant, className } = {}) {
6
+ return cn('sprout-alert', `sprout-alert-${variant ?? 'default'}`, className);
7
7
  }
8
8
  /**
9
9
  * A static message block. It announces itself with `role="alert"` by default;
10
10
  * pass `role="status"` or `role="note"` for messages that should not interrupt.
11
11
  */
12
- export function Alert({ className, variant = "default", render, ref, role = "alert", ...props }) {
12
+ export function Alert({ className, variant = 'default', render, ref, role = 'alert', ...props }) {
13
13
  return useRender({
14
- defaultTagName: "div",
14
+ defaultTagName: 'div',
15
15
  ref,
16
16
  render,
17
17
  props: mergeProps({ role, className: alertVariants({ variant, className }) }, props),
18
- state: { slot: "alert", variant },
18
+ state: { slot: 'alert', variant },
19
19
  });
20
20
  }
21
21
  function part(slot, base) {
22
22
  return function AlertPart({ className, render, ref, ...props }) {
23
23
  return useRender({
24
- defaultTagName: "div",
24
+ defaultTagName: 'div',
25
25
  ref,
26
26
  render,
27
27
  props: mergeProps({ className: cn(base, className) }, props),
@@ -29,7 +29,7 @@ function part(slot, base) {
29
29
  });
30
30
  };
31
31
  }
32
- export const AlertTitle = part("alert-title", "sprout-alert-title");
33
- export const AlertDescription = part("alert-description", "sprout-alert-description");
32
+ export const AlertTitle = part('alert-title', 'sprout-alert-title');
33
+ export const AlertDescription = part('alert-description', 'sprout-alert-description');
34
34
  /** Pins a compact control, such as an Undo button, to the top-right corner. */
35
- export const AlertAction = part("alert-action", "sprout-alert-action");
35
+ export const AlertAction = part('alert-action', 'sprout-alert-action');
@@ -1,5 +1,5 @@
1
- import type { ComponentProps } from "react";
2
- export interface AspectRatioProps extends ComponentProps<"div"> {
1
+ import type { ComponentProps } from 'react';
2
+ export interface AspectRatioProps extends ComponentProps<'div'> {
3
3
  /** Width divided by height, such as `16 / 9`, `4 / 3`, or `1`. */
4
4
  ratio: number;
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "../internal/classes.js";
2
+ import { cn } from '../internal/classes.js';
3
3
  /** Keeps its content at a fixed width-to-height ratio as its width changes. */
4
4
  export function AspectRatio({ ratio, className, style, ...props }) {
5
- return (_jsx("div", { "data-slot": "aspect-ratio", className: cn("sprout-aspect-ratio", className), style: { ...style, "--sprout-aspect-ratio": ratio }, ...props }));
5
+ return (_jsx("div", { "data-slot": "aspect-ratio", className: cn('sprout-aspect-ratio', className), style: { ...style, '--sprout-aspect-ratio': ratio }, ...props }));
6
6
  }
@@ -1,9 +1,9 @@
1
- import { type ComponentProps, type ReactElement } from "react";
2
- import { useRender } from "@base-ui/react/use-render";
3
- import { type FileKind } from "../internal/file-kind.js";
4
- import { type ButtonProps } from "./button.js";
1
+ import { type ComponentProps, type ReactElement } from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import { type FileKind } from '../internal/file-kind.js';
4
+ import { type ButtonProps } from './button.js';
5
5
  export declare const attachmentStateNames: readonly ["idle", "uploading", "processing", "error", "done"];
6
- export declare const attachmentSizeNames: readonly ["default", "sm", "xs"];
6
+ export declare const attachmentSizeNames: readonly ["lg", "md", "sm"];
7
7
  export declare const attachmentOrientationNames: readonly ["horizontal", "vertical"];
8
8
  export declare const attachmentMediaVariantNames: readonly ["icon", "image"];
9
9
  export declare const attachmentGroupVariantNames: readonly ["carousel", "grid", "inline", "list"];
@@ -19,7 +19,7 @@ export type FileAttachmentVariant = (typeof fileAttachmentVariantNames)[number];
19
19
  export type FileAttachmentState = (typeof fileAttachmentStateNames)[number];
20
20
  export type FileTypeIconSize = (typeof fileTypeIconSizeNames)[number];
21
21
  export type { FileKind };
22
- export interface AttachmentProps extends ComponentProps<"div"> {
22
+ export interface AttachmentProps extends ComponentProps<'div'> {
23
23
  /** `idle` dashes the border, `uploading` and `processing` shimmer the title and dim image media, `error` turns it red. */
24
24
  state?: AttachmentState | undefined;
25
25
  size?: AttachmentSize | undefined;
@@ -27,23 +27,23 @@ export interface AttachmentProps extends ComponentProps<"div"> {
27
27
  }
28
28
  /** A file card built from media, content, and actions. */
29
29
  export declare function Attachment({ className, state, size, orientation, ...props }: AttachmentProps): import("react").JSX.Element;
30
- export interface AttachmentMediaProps extends ComponentProps<"div"> {
30
+ export interface AttachmentMediaProps extends ComponentProps<'div'> {
31
31
  /** `icon` centers an icon or spinner; `image` crops an `img` to the square. */
32
32
  variant?: AttachmentMediaVariant | undefined;
33
33
  }
34
34
  export declare function AttachmentMedia({ className, variant, ...props }: AttachmentMediaProps): import("react").JSX.Element;
35
- export declare function AttachmentContent({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
35
+ export declare function AttachmentContent({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
36
36
  /** A single-line name. It shimmers while the attachment uploads or processes. */
37
- export declare function AttachmentTitle({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
38
- export declare function AttachmentDescription({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
37
+ export declare function AttachmentTitle({ className, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
38
+ export declare function AttachmentDescription({ className, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
39
39
  /** Sits above the trigger. Vertical attachments float it over the media corner. */
40
- export declare function AttachmentActions({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
40
+ export declare function AttachmentActions({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
41
41
  /** A ghost `icon-xs` Button. Give icon-only actions an `aria-label`. */
42
42
  export declare function AttachmentAction({ variant, size, ...props }: ButtonProps): import("react").JSX.Element;
43
- export type AttachmentTriggerProps = useRender.ComponentProps<"button">;
43
+ export type AttachmentTriggerProps = useRender.ComponentProps<'button'>;
44
44
  /** Stretches over the whole attachment so a click anywhere opens it. Name it with `aria-label`. */
45
45
  export declare function AttachmentTrigger({ className, render, type, ...props }: AttachmentTriggerProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
46
- export interface AttachmentGroupProps extends ComponentProps<"div"> {
46
+ export interface AttachmentGroupProps extends ComponentProps<'div'> {
47
47
  /**
48
48
  * `carousel` scrolls one row sideways with edge arrows, `grid` makes two
49
49
  * columns (three from 640px), `inline` wraps, and `list` stacks.
@@ -51,7 +51,7 @@ export interface AttachmentGroupProps extends ComponentProps<"div"> {
51
51
  variant?: AttachmentGroupVariant | undefined;
52
52
  }
53
53
  export declare function AttachmentGroup(props: AttachmentGroupProps): import("react").JSX.Element;
54
- export interface FileTypeIconProps extends Omit<ComponentProps<"svg">, "children"> {
54
+ export interface FileTypeIconProps extends Omit<ComponentProps<'svg'>, 'children'> {
55
55
  name: string;
56
56
  mediaType: string;
57
57
  /** `sm` is 20 × 24px for rows and chips; `lg` is 30 × 36px for grid previews. */
@@ -60,10 +60,10 @@ export interface FileTypeIconProps extends Omit<ComponentProps<"svg">, "children
60
60
  /** A paper glyph with a colored extension badge, such as PDF or XLSX. Decorative. */
61
61
  export declare function FileTypeIcon({ name, mediaType, size, className, ...props }: FileTypeIconProps): import("react").JSX.Element;
62
62
  export type AttachmentFileSource = {
63
- kind: "local";
63
+ kind: 'local';
64
64
  file: File;
65
65
  } | {
66
- kind: "remote";
66
+ kind: 'remote';
67
67
  url: string;
68
68
  };
69
69
  export interface AttachmentFile {
@@ -93,7 +93,7 @@ export interface FileAttachmentProps {
93
93
  /** Peeks at images, text, code, JSON, and Markdown in a card on hover or focus. Needs a `source` or `url`. */
94
94
  preview?: boolean | undefined;
95
95
  /** The verb in the open button's name, such as “Download report.pdf”. */
96
- actionLabel?: "Inspect" | "Download" | undefined;
96
+ actionLabel?: 'Inspect' | 'Download' | undefined;
97
97
  className?: string | undefined;
98
98
  }
99
99
  /** A ready-made file row, card, inline mention, or chip with upload states, retry, and remove. */
@@ -115,4 +115,4 @@ export interface LocalFileAttachmentProps {
115
115
  preview?: boolean | undefined;
116
116
  }
117
117
  /** A chip for a `File` still in browser memory, with a live image preview. */
118
- export declare function LocalFileAttachment({ file, onRemove, onOpen, viewable, preview, }: LocalFileAttachmentProps): import("react").JSX.Element;
118
+ export declare function LocalFileAttachment({ file, onRemove, onOpen, viewable, preview }: LocalFileAttachmentProps): import("react").JSX.Element;