@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,46 +1,37 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useEffect, useRef, } from "react";
4
- import { DayPicker, getDefaultClassNames, useDayPicker, } from "react-day-picker";
5
- import { ChevronDown } from "reicon-react/icons/ChevronDown";
6
- import { ChevronLeft } from "reicon-react/icons/ChevronLeft";
7
- import { ChevronRight } from "reicon-react/icons/ChevronRight";
8
- import { cn } from "../internal/classes.js";
9
- import { Button, buttonVariants } from "./button.js";
10
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "./select.js";
11
- export const calendarCaptionLayoutNames = [
12
- "label",
13
- "dropdown",
14
- "dropdown-months",
15
- "dropdown-years",
16
- ];
3
+ import { useEffect, useRef } from 'react';
4
+ import { DayPicker, getDefaultClassNames, useDayPicker, } from 'react-day-picker';
5
+ import { ChevronDown } from 'reicon-react/icons/ChevronDown';
6
+ import { ChevronLeft } from 'reicon-react/icons/ChevronLeft';
7
+ import { ChevronRight } from 'reicon-react/icons/ChevronRight';
8
+ import { cn } from '../internal/classes.js';
9
+ import { Button, buttonVariants } from './button.js';
10
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select.js';
11
+ export const calendarCaptionLayoutNames = ['label', 'dropdown', 'dropdown-months', 'dropdown-years'];
17
12
  function CalendarRoot({ className, rootRef, ...props }) {
18
- return (_jsx("div", { "data-slot": "calendar", ref: rootRef, className: className, ...props }));
13
+ return _jsx("div", { "data-slot": "calendar", ref: rootRef, className: className, ...props });
19
14
  }
20
15
  function CalendarChevron({ className, orientation, size: _size, disabled: _disabled, ...props }) {
21
- const Icon = orientation === "left"
22
- ? ChevronLeft
23
- : orientation === "right"
24
- ? ChevronRight
25
- : ChevronDown;
26
- return (_jsx(Icon, { "aria-hidden": "true", className: cn("sprout-calendar-chevron", className), ...props }));
16
+ const Icon = orientation === 'left' ? ChevronLeft : orientation === 'right' ? ChevronRight : ChevronDown;
17
+ return _jsx(Icon, { "aria-hidden": "true", className: cn('sprout-calendar-chevron', className), ...props });
27
18
  }
28
19
  function CalendarWeekNumber({ children, week: _week, ...props }) {
29
20
  return (_jsx("th", { ...props, children: _jsx("div", { className: "sprout-calendar-week-number-cell", children: children }) }));
30
21
  }
31
22
  /** Month and year pickers use a Base UI select, never a native `<select>`. */
32
- function CalendarDropdown({ options = [], value, onChange, disabled, className, style, "aria-label": label, }) {
33
- const items = options.map((option) => ({
23
+ function CalendarDropdown({ options = [], value, onChange, disabled, className, style, 'aria-label': label, }) {
24
+ const items = options.map(option => ({
34
25
  value: option.value,
35
26
  label: option.label,
36
27
  }));
37
- return (_jsxs(Select, { items: items, value: Number(value), disabled: disabled, onValueChange: (next) => {
28
+ return (_jsxs(Select, { items: items, value: Number(value), disabled: disabled, onValueChange: next => {
38
29
  if (next === null)
39
30
  return;
40
31
  onChange?.({
41
32
  target: { value: String(next) },
42
33
  });
43
- }, children: [_jsx(SelectTrigger, { size: "sm", "aria-label": label, style: style, className: cn("sprout-calendar-dropdown", className), children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { className: "sprout-calendar-dropdown-content", children: options.map((option) => (_jsx(SelectItem, { value: option.value, disabled: option.disabled, children: option.label }, option.value))) })] }));
34
+ }, children: [_jsx(SelectTrigger, { size: "sm", "aria-label": label, style: style, className: cn('sprout-calendar-dropdown', className), children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { className: "sprout-calendar-dropdown-content", children: options.map(option => (_jsx(SelectItem, { value: option.value, disabled: option.disabled, children: option.label }, option.value))) })] }));
44
35
  }
45
36
  /**
46
37
  * A month grid for picking one date, several dates, or a range. It takes every
@@ -48,38 +39,38 @@ function CalendarDropdown({ options = [], value, onChange, disabled, className,
48
39
  * `defaultMonth`, `disabled`, `weekStartsOn`, `showWeekNumber`, and
49
40
  * `numberOfMonths`.
50
41
  */
51
- export function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale, formatters, components, ...props }) {
42
+ export function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'ghost', locale, formatters, components, ...props }) {
52
43
  const defaults = getDefaultClassNames();
53
- const navButton = cn(buttonVariants({ variant: buttonVariant, size: "icon-sm" }), "sprout-calendar-nav-button");
54
- return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn("sprout-calendar", className), "data-button-variant": buttonVariant, "data-caption-layout": captionLayout, captionLayout: captionLayout, locale: locale, formatters: {
55
- formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: "short" }),
44
+ const navButton = cn(buttonVariants({ variant: buttonVariant, size: 'icon-sm' }), 'sprout-calendar-nav-button');
45
+ return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('sprout-calendar', className), "data-button-variant": buttonVariant, "data-caption-layout": captionLayout, captionLayout: captionLayout, locale: locale, formatters: {
46
+ formatMonthDropdown: date => date.toLocaleString(locale?.code, { month: 'short' }),
56
47
  ...formatters,
57
48
  }, classNames: {
58
- root: cn("sprout-calendar-root", defaults.root),
59
- months: cn("sprout-calendar-months", defaults.months),
60
- month: cn("sprout-calendar-month", defaults.month),
61
- nav: cn("sprout-calendar-nav", defaults.nav),
49
+ root: cn('sprout-calendar-root', defaults.root),
50
+ months: cn('sprout-calendar-months', defaults.months),
51
+ month: cn('sprout-calendar-month', defaults.month),
52
+ nav: cn('sprout-calendar-nav', defaults.nav),
62
53
  button_previous: cn(navButton, defaults.button_previous),
63
54
  button_next: cn(navButton, defaults.button_next),
64
- month_caption: cn("sprout-calendar-caption", defaults.month_caption),
65
- dropdowns: cn("sprout-calendar-dropdowns", defaults.dropdowns),
66
- dropdown_root: cn("sprout-calendar-dropdown-root", defaults.dropdown_root),
55
+ month_caption: cn('sprout-calendar-caption', defaults.month_caption),
56
+ dropdowns: cn('sprout-calendar-dropdowns', defaults.dropdowns),
57
+ dropdown_root: cn('sprout-calendar-dropdown-root', defaults.dropdown_root),
67
58
  dropdown: cn(defaults.dropdown),
68
- caption_label: cn("sprout-calendar-caption-label", defaults.caption_label),
69
- month_grid: cn("sprout-calendar-grid", defaults.month_grid),
70
- weekdays: cn("sprout-calendar-weekdays", defaults.weekdays),
71
- weekday: cn("sprout-calendar-weekday", defaults.weekday),
72
- week: cn("sprout-calendar-week", defaults.week),
73
- week_number_header: cn("sprout-calendar-week-number-header", defaults.week_number_header),
74
- week_number: cn("sprout-calendar-week-number", defaults.week_number),
75
- day: cn("sprout-calendar-day", defaults.day),
76
- range_start: cn("sprout-calendar-range-start", defaults.range_start),
77
- range_middle: cn("sprout-calendar-range-middle", defaults.range_middle),
78
- range_end: cn("sprout-calendar-range-end", defaults.range_end),
79
- today: cn("sprout-calendar-today", defaults.today),
80
- outside: cn("sprout-calendar-outside", defaults.outside),
81
- disabled: cn("sprout-calendar-disabled", defaults.disabled),
82
- hidden: cn("sprout-calendar-hidden", defaults.hidden),
59
+ caption_label: cn('sprout-calendar-caption-label', defaults.caption_label),
60
+ month_grid: cn('sprout-calendar-grid', defaults.month_grid),
61
+ weekdays: cn('sprout-calendar-weekdays', defaults.weekdays),
62
+ weekday: cn('sprout-calendar-weekday', defaults.weekday),
63
+ week: cn('sprout-calendar-week', defaults.week),
64
+ week_number_header: cn('sprout-calendar-week-number-header', defaults.week_number_header),
65
+ week_number: cn('sprout-calendar-week-number', defaults.week_number),
66
+ day: cn('sprout-calendar-day', defaults.day),
67
+ range_start: cn('sprout-calendar-range-start', defaults.range_start),
68
+ range_middle: cn('sprout-calendar-range-middle', defaults.range_middle),
69
+ range_end: cn('sprout-calendar-range-end', defaults.range_end),
70
+ today: cn('sprout-calendar-today', defaults.today),
71
+ outside: cn('sprout-calendar-outside', defaults.outside),
72
+ disabled: cn('sprout-calendar-disabled', defaults.disabled),
73
+ hidden: cn('sprout-calendar-hidden', defaults.hidden),
83
74
  ...classNames,
84
75
  }, components: {
85
76
  Root: CalendarRoot,
@@ -103,5 +94,5 @@ export function CalendarDayButton({ className, day, modifiers, locale, ...props
103
94
  ref.current?.focus();
104
95
  }, [modifiers.focused]);
105
96
  const range = modifiers.range_start || modifiers.range_end || modifiers.range_middle;
106
- return (_jsx(Button, { ref: ref, variant: "ghost", size: "icon", "data-slot": "calendar-day-button", "data-day": day.date.toLocaleDateString((locale ?? calendarLocale)?.code), "data-selected-single": Boolean(modifiers.selected && !range), "data-range-start": Boolean(modifiers.range_start), "data-range-end": Boolean(modifiers.range_end), "data-range-middle": Boolean(modifiers.range_middle), className: cn("sprout-calendar-day-button", getDefaultClassNames().day_button, className), ...props }));
97
+ return (_jsx(Button, { ref: ref, variant: "ghost", size: "icon", "data-slot": "calendar-day-button", "data-day": day.date.toLocaleDateString((locale ?? calendarLocale)?.code), "data-selected-single": Boolean(modifiers.selected && !range), "data-range-start": Boolean(modifiers.range_start), "data-range-end": Boolean(modifiers.range_end), "data-range-middle": Boolean(modifiers.range_middle), className: cn('sprout-calendar-day-button', getDefaultClassNames().day_button, className), ...props }));
107
98
  }
@@ -1,4 +1,4 @@
1
- import { type ComponentType, type ReactNode } from "react";
1
+ import { type ComponentType, type ReactNode } from 'react';
2
2
  /** Below this split width (px), the canvas opens as a full-screen sheet. */
3
3
  export declare const canvasSplitMinWidth = 720;
4
4
  export interface CanvasTab {
@@ -25,7 +25,7 @@ export interface ChatSplitProps {
25
25
  * sheet. The canvas moves between both without remounting, so drafts,
26
26
  * reviews, and scroll survive.
27
27
  */
28
- export declare function ChatSplit({ open, onOpenChange, chat, canvas, layoutId, className, }: ChatSplitProps): import("react").JSX.Element;
28
+ export declare function ChatSplit({ open, onOpenChange, chat, canvas, layoutId, className }: ChatSplitProps): import("react").JSX.Element;
29
29
  export interface CanvasPanelProps {
30
30
  /** Open results. With none, the header reads “Canvas”. */
31
31
  tabs: readonly CanvasTab[];
@@ -53,7 +53,7 @@ export interface CanvasToggleProps {
53
53
  className?: string | undefined;
54
54
  }
55
55
  /** A header button that shows or hides the canvas. */
56
- export declare function CanvasToggle({ open, count, onToggle, className, }: CanvasToggleProps): import("react").JSX.Element;
56
+ export declare function CanvasToggle({ open, count, onToggle, className }: CanvasToggleProps): import("react").JSX.Element;
57
57
  export interface CanvasSectionProps {
58
58
  title?: string | undefined;
59
59
  /** A short line under the title, such as a row count, source, or URL. */
@@ -64,7 +64,7 @@ export interface CanvasSectionProps {
64
64
  className?: string | undefined;
65
65
  }
66
66
  /** Padded content for one result, with an optional title, meta, and actions. */
67
- export declare function CanvasSection({ title, meta, actions, children, className, }: CanvasSectionProps): import("react").JSX.Element;
67
+ export declare function CanvasSection({ title, meta, actions, children, className }: CanvasSectionProps): import("react").JSX.Element;
68
68
  export interface CanvasFrameProps {
69
69
  src: string;
70
70
  /** Names the frame for assistive tech, such as the page title. */
@@ -1,23 +1,23 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { createContext, useContext, useEffect, useId, useLayoutEffect, useRef, useState, useSyncExternalStore, } from "react";
4
- import { createPortal } from "react-dom";
5
- import { ArrowLeft } from "reicon-react/icons/ArrowLeft";
6
- import { SidebarRight } from "reicon-react/icons/SidebarRight";
7
- import { X } from "reicon-react/icons/X";
8
- import { cn } from "../internal/classes.js";
9
- import { Button } from "./button.js";
10
- import { Spinner } from "./spinner.js";
11
- import { ResizableHandle, ResizablePanel, ResizablePanelGroup, useResizableLayout, } from "./resizable.js";
12
- import { Sheet, SheetContent, SheetDescription, SheetTitle } from "./sheet.js";
3
+ import { createContext, useContext, useEffect, useId, useLayoutEffect, useRef, useState, useSyncExternalStore, } from 'react';
4
+ import { createPortal } from 'react-dom';
5
+ import { ArrowLeft } from 'reicon-react/icons/ArrowLeft';
6
+ import { SidebarRight } from 'reicon-react/icons/SidebarRight';
7
+ import { X } from 'reicon-react/icons/X';
8
+ import { cn } from '../internal/classes.js';
9
+ import { Button } from './button.js';
10
+ import { Spinner } from './spinner.js';
11
+ import { ResizableHandle, ResizablePanel, ResizablePanelGroup, useResizableLayout } from './resizable.js';
12
+ import { Sheet, SheetContent, SheetDescription, SheetTitle } from './sheet.js';
13
13
  /** Below this split width (px), the canvas opens as a full-screen sheet. */
14
14
  export const canvasSplitMinWidth = 720;
15
- const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
16
- const mobileQuery = "(max-width: 767px)";
15
+ const useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;
16
+ const mobileQuery = '(max-width: 767px)';
17
17
  function subscribeMobile(callback) {
18
18
  const media = window.matchMedia(mobileQuery);
19
- media.addEventListener("change", callback);
20
- return () => media.removeEventListener("change", callback);
19
+ media.addEventListener('change', callback);
20
+ return () => media.removeEventListener('change', callback);
21
21
  }
22
22
  function useViewportMobile() {
23
23
  return useSyncExternalStore(subscribeMobile, () => window.matchMedia(mobileQuery).matches, () => false);
@@ -29,12 +29,11 @@ const CanvasNarrowContext = createContext(null);
29
29
  * sheet. The canvas moves between both without remounting, so drafts,
30
30
  * reviews, and scroll survive.
31
31
  */
32
- export function ChatSplit({ open, onOpenChange, chat, canvas, layoutId = "chat-canvas", className, }) {
32
+ export function ChatSplit({ open, onOpenChange, chat, canvas, layoutId = 'chat-canvas', className }) {
33
33
  const viewportMobile = useViewportMobile();
34
34
  const container = useRef(null);
35
35
  const [availableWidth, setAvailableWidth] = useState(null);
36
- const mobile = viewportMobile ||
37
- (availableWidth !== null && availableWidth < canvasSplitMinWidth);
36
+ const mobile = viewportMobile || (availableWidth !== null && availableWidth < canvasSplitMinWidth);
38
37
  const split = open && !mobile;
39
38
  useIsomorphicLayoutEffect(() => {
40
39
  const element = container.current;
@@ -48,15 +47,15 @@ export function ChatSplit({ open, onOpenChange, chat, canvas, layoutId = "chat-c
48
47
  }, []);
49
48
  const layout = useResizableLayout({
50
49
  id: layoutId,
51
- panelIds: split ? ["chat", "canvas"] : ["chat"],
50
+ panelIds: split ? ['chat', 'canvas'] : ['chat'],
52
51
  onlySaveAfterUserInteractions: true,
53
52
  });
54
53
  const [desktopHost, setDesktopHost] = useState(null);
55
54
  const [mobileHost, setMobileHost] = useState(null);
56
55
  const [target, setTarget] = useState(null);
57
56
  useIsomorphicLayoutEffect(() => {
58
- const element = document.createElement("div");
59
- element.className = "sprout-canvas-host";
57
+ const element = document.createElement('div');
58
+ element.className = 'sprout-canvas-host';
60
59
  setTarget(element);
61
60
  }, []);
62
61
  useIsomorphicLayoutEffect(() => {
@@ -65,7 +64,7 @@ export function ChatSplit({ open, onOpenChange, chat, canvas, layoutId = "chat-c
65
64
  (mobile ? mobileHost : desktopHost)?.append(target);
66
65
  return () => target.remove();
67
66
  }, [mobile, open, target, mobileHost, desktopHost]);
68
- return (_jsx(CanvasNarrowContext, { value: mobile, children: _jsxs("div", { ref: container, "data-slot": "chat-split", "data-layout": mobile ? "sheet" : "split", "data-open": open ? "" : undefined, className: cn("sprout-chat-split", className), children: [target && createPortal(canvas, target), _jsxs(ResizablePanelGroup, { orientation: "horizontal", defaultLayout: layout.defaultLayout, onLayoutChanged: layout.onLayoutChanged, children: [_jsx(ResizablePanel, { id: "chat", minSize: "40%", defaultSize: split ? "55%" : "100%", children: _jsx("div", { className: "sprout-chat-split-pane", children: chat }) }), split && (_jsxs(_Fragment, { children: [_jsx(ResizableHandle, { withHandle: true, "aria-label": "Resize canvas" }), _jsx(ResizablePanel, { id: "canvas", minSize: "320px", defaultSize: "45%", children: _jsx("div", { ref: setDesktopHost, className: "sprout-chat-split-pane" }) })] }))] }), _jsx(Sheet, { open: open && mobile, onOpenChange: (next) => onOpenChange(next), children: _jsxs(SheetContent, { side: "right", size: "full", showCloseButton: false, keepMounted: true, finalFocus: !open, className: "sprout-canvas-sheet", children: [_jsxs("div", { className: "sprout-canvas-sr-only", children: [_jsx(SheetTitle, { children: "Canvas" }), _jsx(SheetDescription, { children: "Detailed result. Return to chat to continue the conversation." })] }), _jsx("div", { ref: setMobileHost, className: "sprout-chat-split-pane" })] }) })] }) }));
67
+ return (_jsx(CanvasNarrowContext, { value: mobile, children: _jsxs("div", { ref: container, "data-slot": "chat-split", "data-layout": mobile ? 'sheet' : 'split', "data-open": open ? '' : undefined, className: cn('sprout-chat-split', className), children: [target && createPortal(canvas, target), _jsxs(ResizablePanelGroup, { orientation: "horizontal", defaultLayout: layout.defaultLayout, onLayoutChanged: layout.onLayoutChanged, children: [_jsx(ResizablePanel, { id: "chat", minSize: "40%", defaultSize: split ? '55%' : '100%', children: _jsx("div", { className: "sprout-chat-split-pane", children: chat }) }), split && (_jsxs(_Fragment, { children: [_jsx(ResizableHandle, { withHandle: true, "aria-label": "Resize canvas" }), _jsx(ResizablePanel, { id: "canvas", minSize: "320px", defaultSize: "45%", children: _jsx("div", { ref: setDesktopHost, className: "sprout-chat-split-pane" }) })] }))] }), _jsx(Sheet, { open: open && mobile, onOpenChange: next => onOpenChange(next), children: _jsxs(SheetContent, { side: "right", size: "full", showCloseButton: false, keepMounted: true, finalFocus: !open, className: "sprout-canvas-sheet", children: [_jsxs("div", { className: "sprout-canvas-sr-only", children: [_jsx(SheetTitle, { children: "Canvas" }), _jsx(SheetDescription, { children: "Detailed result. Return to chat to continue the conversation." })] }), _jsx("div", { ref: setMobileHost, className: "sprout-chat-split-pane" })] }) })] }) }));
69
68
  }
70
69
  /**
71
70
  * The canvas surface: a tab per open result, a close button, and the active
@@ -83,7 +82,7 @@ export function CanvasPanel({ tabs, activeId, onSelect, onCloseTab, onClose, chi
83
82
  const heading = useRef(null);
84
83
  const refocus = useRef(null);
85
84
  const [hovered, setHovered] = useState(null);
86
- const activeIndex = tabs.findIndex((tab) => tab.id === activeId);
85
+ const activeIndex = tabs.findIndex(tab => tab.id === activeId);
87
86
  const tabId = (index) => `${base}-tab-${index}`;
88
87
  const bodyId = `${base}-body`;
89
88
  useEffect(() => {
@@ -104,9 +103,7 @@ export function CanvasPanel({ tabs, activeId, onSelect, onCloseTab, onClose, chi
104
103
  return;
105
104
  refocus.current = null;
106
105
  const next = tabs[Math.min(index, tabs.length - 1)];
107
- const target = (next && tabButtons.current.get(next.id)) ??
108
- closeButton.current ??
109
- heading.current;
106
+ const target = (next && tabButtons.current.get(next.id)) ?? closeButton.current ?? heading.current;
110
107
  target?.focus();
111
108
  }, [tabs]);
112
109
  const closeTab = (index) => {
@@ -117,18 +114,18 @@ export function CanvasPanel({ tabs, activeId, onSelect, onCloseTab, onClose, chi
117
114
  onCloseTab(tab.id);
118
115
  };
119
116
  const onTabKeyDown = (event, index) => {
120
- if (event.key === "Delete") {
117
+ if (event.key === 'Delete') {
121
118
  event.preventDefault();
122
119
  closeTab(index);
123
120
  return;
124
121
  }
125
- const next = event.key === "ArrowRight"
122
+ const next = event.key === 'ArrowRight'
126
123
  ? index + 1
127
- : event.key === "ArrowLeft"
124
+ : event.key === 'ArrowLeft'
128
125
  ? index - 1
129
- : event.key === "Home"
126
+ : event.key === 'Home'
130
127
  ? 0
131
- : event.key === "End"
128
+ : event.key === 'End'
132
129
  ? tabs.length - 1
133
130
  : null;
134
131
  if (next === null || tabs.length === 0)
@@ -140,41 +137,37 @@ export function CanvasPanel({ tabs, activeId, onSelect, onCloseTab, onClose, chi
140
137
  onSelect(target.id);
141
138
  tabButtons.current.get(target.id)?.focus();
142
139
  };
143
- return (_jsxs("section", { "data-slot": "canvas", "data-layout": mobile ? "sheet" : "split", "aria-label": "Canvas", className: cn("sprout-canvas", className), onKeyDown: (event) => {
144
- if (event.key === "Escape" && !event.defaultPrevented) {
140
+ return (_jsxs("section", { "data-slot": "canvas", "data-layout": mobile ? 'sheet' : 'split', "aria-label": "Canvas", className: cn('sprout-canvas', className), onKeyDown: event => {
141
+ if (event.key === 'Escape' && !event.defaultPrevented) {
145
142
  event.preventDefault();
146
143
  onClose();
147
144
  }
148
145
  }, children: [mobile && (_jsx("div", { className: "sprout-canvas-back", children: _jsxs(Button, { variant: "ghost", size: "sm", onClick: onClose, children: [_jsx(ArrowLeft, { size: 16, "aria-hidden": "true" }), "Back to chat"] }) })), _jsxs("header", { className: "sprout-canvas-header", children: [tabs.length === 0 ? (_jsx("h2", { ref: heading, tabIndex: -1, className: "sprout-canvas-heading", children: "Canvas" })) : (_jsxs("div", { ref: list, className: "sprout-canvas-tabs", children: [_jsx("div", { role: "tablist", "aria-label": "Open in canvas", className: "sprout-canvas-tablist", children: tabs.map((tab, index) => {
149
146
  const active = index === activeIndex;
150
147
  const Icon = tab.icon;
151
- return (_jsxs("button", { type: "button", role: "tab", id: tabId(index), ref: (node) => {
148
+ return (_jsxs("button", { type: "button", role: "tab", id: tabId(index), ref: node => {
152
149
  if (node)
153
150
  tabButtons.current.set(tab.id, node);
154
151
  else
155
152
  tabButtons.current.delete(tab.id);
156
- }, "data-slot": "canvas-tab", "data-active": active ? "" : undefined, "data-busy": tab.busy ? "" : undefined, "data-hover": hovered === tab.id ? "" : undefined, "aria-label": tab.busy ? `${tab.title}, loading` : undefined, "aria-selected": active, "aria-controls": bodyId, tabIndex: active || (activeIndex === -1 && index === 0) ? 0 : -1, style: { order: index * 2 }, onClick: () => onSelect(tab.id), onKeyDown: (event) => onTabKeyDown(event, index), onPointerEnter: () => setHovered(tab.id), onPointerLeave: () => setHovered(null), className: "sprout-canvas-tab", children: [tab.busy ? (_jsx(Spinner, { size: "sm", "aria-hidden": "true" })) : (Icon && (_jsx("span", { "aria-hidden": "true", className: "sprout-canvas-tab-icon", children: _jsx(Icon, { size: 14 }) }))), _jsx("span", { className: "sprout-canvas-tab-title", children: tab.title })] }, tab.id));
153
+ }, "data-slot": "canvas-tab", "data-active": active ? '' : undefined, "data-busy": tab.busy ? '' : undefined, "data-hover": hovered === tab.id ? '' : undefined, "aria-label": tab.busy ? `${tab.title}, loading` : undefined, "aria-selected": active, "aria-controls": bodyId, tabIndex: active || (activeIndex === -1 && index === 0) ? 0 : -1, style: { order: index * 2 }, onClick: () => onSelect(tab.id), onKeyDown: event => onTabKeyDown(event, index), onPointerEnter: () => setHovered(tab.id), onPointerLeave: () => setHovered(null), className: "sprout-canvas-tab", children: [tab.busy ? (_jsx(Spinner, { size: "sm", "aria-hidden": "true" })) : (Icon && (_jsx("span", { "aria-hidden": "true", className: "sprout-canvas-tab-icon", children: _jsx(Icon, { size: 14 }) }))), _jsx("span", { className: "sprout-canvas-tab-title", children: tab.title })] }, tab.id));
157
154
  }) }), tabs.map((tab, index) => {
158
155
  const active = index === activeIndex;
159
- return (_jsx("button", { type: "button", "aria-label": `Close ${tab.title}`, "data-active": active ? "" : undefined, "data-hover": hovered === tab.id ? "" : undefined, tabIndex: active ? 0 : -1, style: { order: index * 2 + 1 }, onClick: () => closeTab(index), onPointerEnter: () => setHovered(tab.id), onPointerLeave: () => setHovered(null), className: "sprout-canvas-tab-close", children: _jsx(X, { size: 12, "aria-hidden": "true" }) }, tab.id));
160
- })] })), !mobile && (_jsx(Button, { ref: closeButton, variant: "ghost", size: "icon-sm", "aria-label": "Close canvas", title: "Close canvas (Esc)", onClick: onClose, children: _jsx(X, { size: 16, "aria-hidden": "true" }) }))] }), activity, _jsx("div", { id: bodyId, role: tabs.length ? "tabpanel" : undefined, "aria-labelledby": activeIndex === -1 ? undefined : tabId(activeIndex), tabIndex: tabs.length ? 0 : undefined, className: "sprout-canvas-body", children: children })] }));
156
+ return (_jsx("button", { type: "button", "aria-label": `Close ${tab.title}`, "data-active": active ? '' : undefined, "data-hover": hovered === tab.id ? '' : undefined, tabIndex: active ? 0 : -1, style: { order: index * 2 + 1 }, onClick: () => closeTab(index), onPointerEnter: () => setHovered(tab.id), onPointerLeave: () => setHovered(null), className: "sprout-canvas-tab-close", children: _jsx(X, { size: 12, "aria-hidden": "true" }) }, tab.id));
157
+ })] })), !mobile && (_jsx(Button, { ref: closeButton, variant: "ghost", size: "icon-sm", "aria-label": "Close canvas", title: "Close canvas (Esc)", onClick: onClose, children: _jsx(X, { size: 16, "aria-hidden": "true" }) }))] }), activity, _jsx("div", { id: bodyId, role: tabs.length ? 'tabpanel' : undefined, "aria-labelledby": activeIndex === -1 ? undefined : tabId(activeIndex), tabIndex: tabs.length ? 0 : undefined, className: "sprout-canvas-body", children: children })] }));
161
158
  }
162
159
  /** A header button that shows or hides the canvas. */
163
- export function CanvasToggle({ open, count, onToggle, className, }) {
164
- return (_jsxs(Button, { variant: "ghost", size: "sm", "data-slot": "canvas-toggle", "aria-pressed": open, "aria-label": open
165
- ? "Hide canvas"
166
- : count
167
- ? `Show canvas, ${count} open`
168
- : "Show canvas", title: "Open detailed results without leaving your chat", onClick: onToggle, className: cn("sprout-canvas-toggle", className), children: [_jsx(SidebarRight, { size: 16, "aria-hidden": "true" }), _jsx("span", { className: "sprout-canvas-toggle-label", children: open ? "Hide results" : "View results" }), count > 0 && (_jsx("span", { "aria-hidden": "true", className: "sprout-canvas-toggle-count", children: count }))] }));
160
+ export function CanvasToggle({ open, count, onToggle, className }) {
161
+ return (_jsxs(Button, { variant: "ghost", size: "sm", "data-slot": "canvas-toggle", "aria-pressed": open, "aria-label": open ? 'Hide canvas' : count ? `Show canvas, ${count} open` : 'Show canvas', title: "Open detailed results without leaving your chat", onClick: onToggle, className: cn('sprout-canvas-toggle', className), children: [_jsx(SidebarRight, { size: 16, "aria-hidden": "true" }), _jsx("span", { className: "sprout-canvas-toggle-label", children: open ? 'Hide results' : 'View results' }), count > 0 && (_jsx("span", { "aria-hidden": "true", className: "sprout-canvas-toggle-count", children: count }))] }));
169
162
  }
170
163
  /** Padded content for one result, with an optional title, meta, and actions. */
171
- export function CanvasSection({ title, meta, actions, children, className, }) {
172
- return (_jsxs("div", { "data-slot": "canvas-section", className: cn("sprout-canvas-section", className), children: [(title || actions) && (_jsxs("div", { className: "sprout-canvas-section-header", children: [_jsxs("div", { className: "sprout-canvas-section-text", children: [title && _jsx("h3", { className: "sprout-canvas-section-title", children: title }), meta && _jsx("p", { className: "sprout-canvas-section-meta", children: meta })] }), actions && (_jsx("div", { className: "sprout-canvas-section-actions", children: actions }))] })), children] }));
164
+ export function CanvasSection({ title, meta, actions, children, className }) {
165
+ return (_jsxs("div", { "data-slot": "canvas-section", className: cn('sprout-canvas-section', className), children: [(title || actions) && (_jsxs("div", { className: "sprout-canvas-section-header", children: [_jsxs("div", { className: "sprout-canvas-section-text", children: [title && _jsx("h3", { className: "sprout-canvas-section-title", children: title }), meta && _jsx("p", { className: "sprout-canvas-section-meta", children: meta })] }), actions && _jsx("div", { className: "sprout-canvas-section-actions", children: actions })] })), children] }));
173
166
  }
174
167
  /**
175
168
  * A sandboxed page preview. Scripts and popups run; same-origin access,
176
169
  * forms, and top navigation are blocked, and no referrer is sent.
177
170
  */
178
171
  export function CanvasFrame({ src, title, className }) {
179
- return (_jsx("div", { "data-slot": "canvas-frame", className: cn("sprout-canvas-frame", className), children: _jsx("iframe", { src: src, title: title, sandbox: "allow-scripts allow-popups", referrerPolicy: "no-referrer", loading: "lazy" }) }));
172
+ return (_jsx("div", { "data-slot": "canvas-frame", className: cn('sprout-canvas-frame', className), children: _jsx("iframe", { src: src, title: title, sandbox: "allow-scripts allow-popups", referrerPolicy: "no-referrer", loading: "lazy" }) }));
180
173
  }
@@ -1,5 +1,5 @@
1
- import { useRender } from "@base-ui/react/use-render";
2
- export declare const cardSizeNames: readonly ["default", "sm"];
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ export declare const cardSizeNames: readonly ["md", "sm"];
3
3
  export declare const cardSurfaceNames: readonly ["default", "raised"];
4
4
  export type CardSize = (typeof cardSizeNames)[number];
5
5
  export type CardSurface = (typeof cardSurfaceNames)[number];
@@ -8,13 +8,13 @@ export interface CardVariantOptions {
8
8
  surface?: CardSurface | null;
9
9
  className?: string;
10
10
  }
11
- export declare function cardVariants({ size, surface, className, }?: CardVariantOptions): string;
11
+ export declare function cardVariants({ size, surface, className }?: CardVariantOptions): string;
12
12
  export interface CardState extends Record<string, unknown> {
13
- slot: "card";
13
+ slot: 'card';
14
14
  size: CardSize;
15
15
  surface: CardSurface;
16
16
  }
17
- export interface CardProps extends useRender.ComponentProps<"div", CardState> {
17
+ export interface CardProps extends useRender.ComponentProps<'div', CardState> {
18
18
  /** `sm` tightens padding and gaps from 16px to 12px and shrinks the title. */
19
19
  size?: CardSize;
20
20
  /** `raised` lifts the card off a surface of the same color. */
@@ -25,11 +25,11 @@ export interface CardProps extends useRender.ComponentProps<"div", CardState> {
25
25
  * `CardHeader`, `CardContent`, and `CardFooter`.
26
26
  */
27
27
  export declare function Card({ className, size, surface, render, ref, ...props }: CardProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
28
- type PartSlot = "card-header" | "card-title" | "card-description" | "card-action" | "card-content" | "card-footer";
28
+ type PartSlot = 'card-header' | 'card-title' | 'card-description' | 'card-action' | 'card-content' | 'card-footer';
29
29
  export interface CardPartState extends Record<string, unknown> {
30
30
  slot: PartSlot;
31
31
  }
32
- export type CardPartProps = useRender.ComponentProps<"div", CardPartState>;
32
+ export type CardPartProps = useRender.ComponentProps<'div', CardPartState>;
33
33
  /** Lays out the title, description, and an optional `CardAction`. */
34
34
  export declare const CardHeader: ({ className, render, ref, ...props }: CardPartProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
35
35
  /** A `div` by default. Pass `render={<h3 />}` to put it in the outline. */
@@ -1,28 +1,28 @@
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 cardSizeNames = ["default", "sm"];
5
- export const cardSurfaceNames = ["default", "raised"];
6
- export function cardVariants({ size, surface, className, } = {}) {
7
- return cn("sprout-card", size === "sm" && "sprout-card-sm", surface === "raised" && "sprout-card-raised", 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 cardSizeNames = ['md', 'sm'];
5
+ export const cardSurfaceNames = ['default', 'raised'];
6
+ export function cardVariants({ size, surface, className } = {}) {
7
+ return cn('sprout-card', size === 'sm' && 'sprout-card-sm', surface === 'raised' && 'sprout-card-raised', className);
8
8
  }
9
9
  /**
10
10
  * A bordered panel that groups related content. Compose it with
11
11
  * `CardHeader`, `CardContent`, and `CardFooter`.
12
12
  */
13
- export function Card({ className, size = "default", surface = "default", render, ref, ...props }) {
13
+ export function Card({ className, size = 'md', surface = 'default', render, ref, ...props }) {
14
14
  return useRender({
15
- defaultTagName: "div",
15
+ defaultTagName: 'div',
16
16
  ref,
17
17
  render,
18
18
  props: mergeProps({ className: cardVariants({ size, surface, className }) }, props),
19
- state: { slot: "card", size, surface },
19
+ state: { slot: 'card', size, surface },
20
20
  });
21
21
  }
22
22
  function part(slot, base) {
23
23
  return function CardPart({ className, render, ref, ...props }) {
24
24
  return useRender({
25
- defaultTagName: "div",
25
+ defaultTagName: 'div',
26
26
  ref,
27
27
  render,
28
28
  props: mergeProps({ className: cn(base, className) }, props),
@@ -31,12 +31,12 @@ function part(slot, base) {
31
31
  };
32
32
  }
33
33
  /** Lays out the title, description, and an optional `CardAction`. */
34
- export const CardHeader = part("card-header", "sprout-card-header");
34
+ export const CardHeader = part('card-header', 'sprout-card-header');
35
35
  /** A `div` by default. Pass `render={<h3 />}` to put it in the outline. */
36
- export const CardTitle = part("card-title", "sprout-card-title");
37
- export const CardDescription = part("card-description", "sprout-card-description");
36
+ export const CardTitle = part('card-title', 'sprout-card-title');
37
+ export const CardDescription = part('card-description', 'sprout-card-description');
38
38
  /** Pins a badge or compact control to the header's top-right corner. */
39
- export const CardAction = part("card-action", "sprout-card-action");
40
- export const CardContent = part("card-content", "sprout-card-content");
39
+ export const CardAction = part('card-action', 'sprout-card-action');
40
+ export const CardContent = part('card-content', 'sprout-card-content');
41
41
  /** A tinted bar along the bottom edge for actions and status. */
42
- export const CardFooter = part("card-footer", "sprout-card-footer");
42
+ export const CardFooter = part('card-footer', 'sprout-card-footer');
@@ -1,10 +1,10 @@
1
- import { type ComponentProps, type RefCallback } from "react";
2
- import { type ButtonProps } from "./button.js";
1
+ import { type ComponentProps, type RefCallback } from 'react';
2
+ import { type ButtonProps } from './button.js';
3
3
  export declare const carouselOrientationNames: readonly ["horizontal", "vertical"];
4
4
  export declare const carouselAlignNames: readonly ["start", "center", "end"];
5
5
  export type CarouselOrientation = (typeof carouselOrientationNames)[number];
6
6
  export type CarouselAlign = (typeof carouselAlignNames)[number];
7
- export type CarouselEvent = "select" | "reInit";
7
+ export type CarouselEvent = 'select' | 'reInit';
8
8
  export interface CarouselOptions {
9
9
  /** Where a slide lands in the viewport when it is the current one. Default `start`. */
10
10
  align?: CarouselAlign | undefined;
@@ -28,7 +28,7 @@ export interface CarouselApi {
28
28
  on(event: CarouselEvent, listener: (api: CarouselApi) => void): CarouselApi;
29
29
  off(event: CarouselEvent, listener: (api: CarouselApi) => void): CarouselApi;
30
30
  }
31
- export interface CarouselProps extends ComponentProps<"div"> {
31
+ export interface CarouselProps extends ComponentProps<'div'> {
32
32
  opts?: CarouselOptions | undefined;
33
33
  orientation?: CarouselOrientation | undefined;
34
34
  /** Receives the carousel API once it mounts. */
@@ -50,8 +50,8 @@ export interface CarouselContextValue {
50
50
  }
51
51
  export declare function useCarousel(): CarouselContextValue;
52
52
  export declare function Carousel({ orientation, opts, setApi, className, children, onKeyDownCapture, ...props }: CarouselProps): import("react").JSX.Element;
53
- export declare function CarouselContent({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
54
- export declare function CarouselItem({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
55
- export type CarouselButtonProps = Omit<ButtonProps, "state" | "pendingLabel">;
53
+ export declare function CarouselContent({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
54
+ export declare function CarouselItem({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
55
+ export type CarouselButtonProps = Omit<ButtonProps, 'state' | 'pendingLabel'>;
56
56
  export declare function CarouselPrevious({ className, variant, size, children, ...props }: CarouselButtonProps): import("react").JSX.Element;
57
57
  export declare function CarouselNext({ className, variant, size, children, ...props }: CarouselButtonProps): import("react").JSX.Element;