@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,18 +1,13 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
4
- import { mergeProps } from "@base-ui/react/merge-props";
5
- import { useRender } from "@base-ui/react/use-render";
6
- import { X } from "reicon-react/icons/X";
7
- import { cn, stateClassName } from "../internal/classes.js";
8
- import { Button } from "./button.js";
9
- export const dialogSizeNames = [
10
- "default",
11
- "form",
12
- "split",
13
- "fullscreen",
14
- ];
15
- export const dialogPlacementNames = ["center", "top"];
3
+ import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
4
+ import { mergeProps } from '@base-ui/react/merge-props';
5
+ import { useRender } from '@base-ui/react/use-render';
6
+ import { X } from 'reicon-react/icons/X';
7
+ import { cn, stateClassName } from '../internal/classes.js';
8
+ import { Button } from './button.js';
9
+ export const dialogSizeNames = ['default', 'form', 'split', 'fullscreen'];
10
+ export const dialogPlacementNames = ['center', 'top'];
16
11
  export function Dialog(props) {
17
12
  return _jsx(DialogPrimitive.Root, { ...props });
18
13
  }
@@ -26,54 +21,54 @@ export function DialogClose(props) {
26
21
  return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
27
22
  }
28
23
  export function DialogOverlay({ className, ...props }) {
29
- return (_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-overlay", ...props, className: stateClassName("sprout-dialog-overlay", className) }));
24
+ return (_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-overlay", ...props, className: stateClassName('sprout-dialog-overlay', className) }));
30
25
  }
31
26
  /**
32
27
  * The dialog surface. It renders its own portal and overlay, so place it
33
28
  * directly inside `Dialog`.
34
29
  */
35
- export function DialogContent({ className, children, showCloseButton = true, closeLabel = "Close", size = "default", placement = "center", container, ...props }) {
36
- return (_jsxs(DialogPortal, { container: container, children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Popup, { "data-slot": "dialog-content", "data-size": size, "data-placement": size === "fullscreen" ? undefined : placement, ...props, className: stateClassName(cn("sprout-dialog-content", `sprout-dialog-${size}`), className), children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "sprout-dialog-close", "aria-label": closeLabel, render: _jsx(Button, { variant: "ghost", size: "icon-sm" }), children: _jsx(X, { size: 16, "aria-hidden": "true" }) }))] })] }));
30
+ export function DialogContent({ className, children, showCloseButton = true, closeLabel = 'Close', size = 'default', placement = 'center', container, ...props }) {
31
+ return (_jsxs(DialogPortal, { container: container, children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Popup, { "data-slot": "dialog-content", "data-size": size, "data-placement": size === 'fullscreen' ? undefined : placement, ...props, className: stateClassName(cn('sprout-dialog-content', `sprout-dialog-${size}`), className), children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "sprout-dialog-close", "aria-label": closeLabel, render: _jsx(Button, { variant: "ghost", size: "icon-sm" }), children: _jsx(X, { size: 16, "aria-hidden": "true" }) }))] })] }));
37
32
  }
38
33
  function part(slot, base) {
39
34
  return function DialogPart({ className, render, ref, ...props }) {
40
35
  return useRender({
41
- defaultTagName: "div",
36
+ defaultTagName: 'div',
42
37
  ref,
43
38
  render,
44
- props: mergeProps({ "data-slot": slot, className: cn(base, className) }, props),
39
+ props: mergeProps({ 'data-slot': slot, className: cn(base, className) }, props),
45
40
  state: { slot },
46
41
  });
47
42
  };
48
43
  }
49
44
  /** Stacks the title and description. */
50
- export const DialogHeader = part("dialog-header", "sprout-dialog-header");
45
+ export const DialogHeader = part('dialog-header', 'sprout-dialog-header');
51
46
  /**
52
47
  * The scrolling middle of a `form` dialog. It bleeds to the dialog edges so
53
48
  * scrollbars and focus rings are not clipped.
54
49
  */
55
- export const DialogBody = part("dialog-body", "sprout-dialog-body");
50
+ export const DialogBody = part('dialog-body', 'sprout-dialog-body');
56
51
  /**
57
52
  * A tinted action bar pinned to the bottom edge. Actions stack in reverse
58
53
  * order on narrow screens and align right from 640px. A leading `<p>` becomes
59
54
  * a hint that sits at the start.
60
55
  */
61
- export function DialogFooter({ className, render, ref, showCloseButton = false, closeLabel = "Close", children, ...props }) {
56
+ export function DialogFooter({ className, render, ref, showCloseButton = false, closeLabel = 'Close', children, ...props }) {
62
57
  return useRender({
63
- defaultTagName: "div",
58
+ defaultTagName: 'div',
64
59
  ref,
65
60
  render,
66
61
  props: mergeProps({
67
- "data-slot": "dialog-footer",
68
- className: cn("sprout-dialog-footer", className),
62
+ 'data-slot': 'dialog-footer',
63
+ className: cn('sprout-dialog-footer', className),
69
64
  children: (_jsxs(_Fragment, { children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { render: _jsx(Button, { variant: "outline" }), children: closeLabel }))] })),
70
65
  }, props),
71
- state: { slot: "dialog-footer" },
66
+ state: { slot: 'dialog-footer' },
72
67
  });
73
68
  }
74
69
  export function DialogTitle({ className, ...props }) {
75
- return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", ...props, className: stateClassName("sprout-dialog-title", className) }));
70
+ return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", ...props, className: stateClassName('sprout-dialog-title', className) }));
76
71
  }
77
72
  export function DialogDescription({ className, ...props }) {
78
- return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", ...props, className: stateClassName("sprout-dialog-description", className) }));
73
+ return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", ...props, className: stateClassName('sprout-dialog-description', className) }));
79
74
  }
@@ -3,4 +3,4 @@
3
3
  * indicators, and popup sides follow it. It does not set the `dir` attribute;
4
4
  * set `dir` on a wrapping element so CSS and the browser follow the same way.
5
5
  */
6
- export { DirectionProvider, useDirection, type DirectionProviderProps, type TextDirection, } from "@base-ui/react/direction-provider";
6
+ export { DirectionProvider, useDirection, type DirectionProviderProps, type TextDirection, } from '@base-ui/react/direction-provider';
@@ -3,4 +3,4 @@
3
3
  * indicators, and popup sides follow it. It does not set the `dir` attribute;
4
4
  * set `dir` on a wrapping element so CSS and the browser follow the same way.
5
5
  */
6
- export { DirectionProvider, useDirection, } from "@base-ui/react/direction-provider";
6
+ export { DirectionProvider, useDirection, } from '@base-ui/react/direction-provider';
@@ -1,5 +1,5 @@
1
- import type { ComponentProps } from "react";
2
- import { Menu as MenuPrimitive } from "@base-ui/react/menu";
1
+ import type { ComponentProps } from 'react';
2
+ import { Menu as MenuPrimitive } from '@base-ui/react/menu';
3
3
  export declare const dropdownMenuContentSizeNames: readonly ["anchor", "menu"];
4
4
  export declare const dropdownMenuItemVariantNames: readonly ["default", "destructive"];
5
5
  export type DropdownMenuContentSize = (typeof dropdownMenuContentSizeNames)[number];
@@ -10,7 +10,7 @@ export type DropdownMenuPortalProps = MenuPrimitive.Portal.Props;
10
10
  export declare function DropdownMenuPortal(props: DropdownMenuPortalProps): import("react").JSX.Element;
11
11
  export type DropdownMenuTriggerProps = MenuPrimitive.Trigger.Props;
12
12
  export declare function DropdownMenuTrigger(props: DropdownMenuTriggerProps): import("react").JSX.Element;
13
- type PositionerProps = Pick<MenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset" | "collisionPadding" | "collisionAvoidance" | "sticky" | "positionMethod">;
13
+ type PositionerProps = Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset' | 'collisionPadding' | 'collisionAvoidance' | 'sticky' | 'positionMethod'>;
14
14
  export interface DropdownMenuContentProps extends MenuPrimitive.Popup.Props, PositionerProps {
15
15
  /**
16
16
  * `anchor` matches the trigger width (at least 8rem). `menu` is a fixed
@@ -18,7 +18,7 @@ export interface DropdownMenuContentProps extends MenuPrimitive.Popup.Props, Pos
18
18
  */
19
19
  size?: DropdownMenuContentSize;
20
20
  /** Where the portal renders. Defaults to `document.body`. */
21
- container?: MenuPrimitive.Portal.Props["container"];
21
+ container?: MenuPrimitive.Portal.Props['container'];
22
22
  }
23
23
  /**
24
24
  * The menu surface. It renders its own portal and positioner, so place it
@@ -56,7 +56,7 @@ export interface DropdownMenuRadioItemProps extends MenuPrimitive.RadioItem.Prop
56
56
  export declare function DropdownMenuRadioItem({ className, inset, children, ...props }: DropdownMenuRadioItemProps): import("react").JSX.Element;
57
57
  export type DropdownMenuSeparatorProps = MenuPrimitive.Separator.Props;
58
58
  export declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): import("react").JSX.Element;
59
- export type DropdownMenuShortcutProps = ComponentProps<"span">;
59
+ export type DropdownMenuShortcutProps = ComponentProps<'span'>;
60
60
  /** Right-aligned hint text, such as a keyboard shortcut. It does not bind keys. */
61
61
  export declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): import("react").JSX.Element;
62
62
  export {};
@@ -1,11 +1,11 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Menu as MenuPrimitive } from "@base-ui/react/menu";
4
- import { Check } from "reicon-react/icons/Check";
5
- import { ChevronRight } from "reicon-react/icons/ChevronRight";
6
- import { cn, stateClassName } from "../internal/classes.js";
7
- export const dropdownMenuContentSizeNames = ["anchor", "menu"];
8
- export const dropdownMenuItemVariantNames = ["default", "destructive"];
3
+ import { Menu as MenuPrimitive } from '@base-ui/react/menu';
4
+ import { Check } from 'reicon-react/icons/Check';
5
+ import { ChevronRight } from 'reicon-react/icons/ChevronRight';
6
+ import { cn, stateClassName } from '../internal/classes.js';
7
+ export const dropdownMenuContentSizeNames = ['anchor', 'menu'];
8
+ export const dropdownMenuItemVariantNames = ['default', 'destructive'];
9
9
  export function DropdownMenu(props) {
10
10
  return _jsx(MenuPrimitive.Root, { ...props });
11
11
  }
@@ -19,41 +19,41 @@ export function DropdownMenuTrigger(props) {
19
19
  * The menu surface. It renders its own portal and positioner, so place it
20
20
  * directly inside `DropdownMenu` or `DropdownMenuSub`.
21
21
  */
22
- export function DropdownMenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, collisionPadding = 8, collisionAvoidance, sticky, positionMethod, size = "anchor", container, className, ...props }) {
23
- return (_jsx(MenuPrimitive.Portal, { container: container, children: _jsx(MenuPrimitive.Positioner, { className: "sprout-dropdown-menu-positioner", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, collisionPadding: collisionPadding, collisionAvoidance: collisionAvoidance, sticky: sticky, positionMethod: positionMethod, children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", "data-size": size, ...props, className: stateClassName(cn("sprout-dropdown-menu-content", `sprout-dropdown-menu-${size}`), className) }) }) }));
22
+ export function DropdownMenuContent({ align = 'start', alignOffset = 0, side = 'bottom', sideOffset = 4, collisionPadding = 8, collisionAvoidance, sticky, positionMethod, size = 'anchor', container, className, ...props }) {
23
+ return (_jsx(MenuPrimitive.Portal, { container: container, children: _jsx(MenuPrimitive.Positioner, { className: "sprout-dropdown-menu-positioner", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, collisionPadding: collisionPadding, collisionAvoidance: collisionAvoidance, sticky: sticky, positionMethod: positionMethod, children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", "data-size": size, ...props, className: stateClassName(cn('sprout-dropdown-menu-content', `sprout-dropdown-menu-${size}`), className) }) }) }));
24
24
  }
25
25
  export function DropdownMenuGroup(props) {
26
26
  return _jsx(MenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
27
27
  }
28
28
  export function DropdownMenuLabel({ className, inset, ...props }) {
29
- return (_jsx(MenuPrimitive.GroupLabel, { "data-slot": "dropdown-menu-label", "data-inset": inset || undefined, ...props, className: stateClassName("sprout-dropdown-menu-label", className) }));
29
+ return (_jsx(MenuPrimitive.GroupLabel, { "data-slot": "dropdown-menu-label", "data-inset": inset || undefined, ...props, className: stateClassName('sprout-dropdown-menu-label', className) }));
30
30
  }
31
- export function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
32
- return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset || undefined, "data-variant": variant, ...props, className: stateClassName("sprout-dropdown-menu-item", className) }));
31
+ export function DropdownMenuItem({ className, inset, variant = 'default', ...props }) {
32
+ return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset || undefined, "data-variant": variant, ...props, className: stateClassName('sprout-dropdown-menu-item', className) }));
33
33
  }
34
34
  export function DropdownMenuSub(props) {
35
35
  return _jsx(MenuPrimitive.SubmenuRoot, { ...props });
36
36
  }
37
37
  export function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
38
- return (_jsxs(MenuPrimitive.SubmenuTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset || undefined, ...props, className: stateClassName("sprout-dropdown-menu-item sprout-dropdown-menu-sub-trigger", className), children: [children, _jsx(ChevronRight, { size: 16, "aria-hidden": "true", className: "sprout-dropdown-menu-sub-chevron" })] }));
38
+ return (_jsxs(MenuPrimitive.SubmenuTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset || undefined, ...props, className: stateClassName('sprout-dropdown-menu-item sprout-dropdown-menu-sub-trigger', className), children: [children, _jsx(ChevronRight, { size: 16, "aria-hidden": "true", className: "sprout-dropdown-menu-sub-chevron" })] }));
39
39
  }
40
40
  /** A nested menu surface. It opens to the side and sizes to its content. */
41
- export function DropdownMenuSubContent({ align = "start", alignOffset = -5, side = "right", sideOffset = 0, className, ...props }) {
42
- return (_jsx(DropdownMenuContent, { "data-slot": "dropdown-menu-sub-content", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, ...props, className: stateClassName("sprout-dropdown-menu-sub-content", className) }));
41
+ export function DropdownMenuSubContent({ align = 'start', alignOffset = -5, side = 'right', sideOffset = 0, className, ...props }) {
42
+ return (_jsx(DropdownMenuContent, { "data-slot": "dropdown-menu-sub-content", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, ...props, className: stateClassName('sprout-dropdown-menu-sub-content', className) }));
43
43
  }
44
44
  export function DropdownMenuCheckboxItem({ className, inset, children, ...props }) {
45
- return (_jsxs(MenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", "data-inset": inset || undefined, ...props, className: stateClassName("sprout-dropdown-menu-item sprout-dropdown-menu-choice", className), children: [_jsx("span", { className: "sprout-dropdown-menu-indicator", "data-slot": "dropdown-menu-checkbox-item-indicator", children: _jsx(MenuPrimitive.CheckboxItemIndicator, { children: _jsx(Check, { size: 16, "aria-hidden": "true" }) }) }), children] }));
45
+ return (_jsxs(MenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", "data-inset": inset || undefined, ...props, className: stateClassName('sprout-dropdown-menu-item sprout-dropdown-menu-choice', className), children: [_jsx("span", { className: "sprout-dropdown-menu-indicator", "data-slot": "dropdown-menu-checkbox-item-indicator", children: _jsx(MenuPrimitive.CheckboxItemIndicator, { children: _jsx(Check, { size: 16, "aria-hidden": "true" }) }) }), children] }));
46
46
  }
47
47
  export function DropdownMenuRadioGroup(props) {
48
- return (_jsx(MenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
48
+ return _jsx(MenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props });
49
49
  }
50
50
  export function DropdownMenuRadioItem({ className, inset, children, ...props }) {
51
- return (_jsxs(MenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", "data-inset": inset || undefined, ...props, className: stateClassName("sprout-dropdown-menu-item sprout-dropdown-menu-choice", className), children: [_jsx("span", { className: "sprout-dropdown-menu-indicator", "data-slot": "dropdown-menu-radio-item-indicator", children: _jsx(MenuPrimitive.RadioItemIndicator, { children: _jsx(Check, { size: 16, "aria-hidden": "true" }) }) }), children] }));
51
+ return (_jsxs(MenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", "data-inset": inset || undefined, ...props, className: stateClassName('sprout-dropdown-menu-item sprout-dropdown-menu-choice', className), children: [_jsx("span", { className: "sprout-dropdown-menu-indicator", "data-slot": "dropdown-menu-radio-item-indicator", children: _jsx(MenuPrimitive.RadioItemIndicator, { children: _jsx(Check, { size: 16, "aria-hidden": "true" }) }) }), children] }));
52
52
  }
53
53
  export function DropdownMenuSeparator({ className, ...props }) {
54
- return (_jsx(MenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", ...props, className: stateClassName("sprout-dropdown-menu-separator", className) }));
54
+ return (_jsx(MenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", ...props, className: stateClassName('sprout-dropdown-menu-separator', className) }));
55
55
  }
56
56
  /** Right-aligned hint text, such as a keyboard shortcut. It does not bind keys. */
57
57
  export function DropdownMenuShortcut({ className, ...props }) {
58
- return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", ...props, className: cn("sprout-dropdown-menu-shortcut", className) }));
58
+ return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", ...props, className: cn('sprout-dropdown-menu-shortcut', className) }));
59
59
  }
@@ -1,5 +1,5 @@
1
- import { type AriaAttributes, type ReactElement, type ReactNode } from "react";
2
- import { type SeparatorLabelProps } from "./separator.js";
1
+ import { type AriaAttributes, type ReactElement, type ReactNode } from 'react';
2
+ import { type SeparatorLabelProps } from './separator.js';
3
3
  export declare const fieldLabelVisibilityNames: readonly ["visible", "screen-reader"];
4
4
  export declare const choiceGroupTypeNames: readonly ["checkbox", "radio"];
5
5
  export declare const choiceGroupLayoutNames: readonly ["list", "columns"];
@@ -24,11 +24,11 @@ export declare const FieldsDisabled: import("react").Context<boolean>;
24
24
  export interface FieldControlProps {
25
25
  id?: string | undefined;
26
26
  disabled?: boolean | undefined;
27
- "aria-describedby"?: string | undefined;
28
- "aria-invalid"?: AriaAttributes["aria-invalid"];
29
- "aria-required"?: AriaAttributes["aria-required"];
30
- "aria-label"?: string | undefined;
31
- "aria-labelledby"?: string | undefined;
27
+ 'aria-describedby'?: string | undefined;
28
+ 'aria-invalid'?: AriaAttributes['aria-invalid'];
29
+ 'aria-required'?: AriaAttributes['aria-required'];
30
+ 'aria-label'?: string | undefined;
31
+ 'aria-labelledby'?: string | undefined;
32
32
  }
33
33
  /**
34
34
  * Connects a control to the Field around it. Pass the control's props; it
@@ -79,11 +79,11 @@ export type ChoiceGroupProps<V extends string> = Requirement & {
79
79
  id?: string | undefined;
80
80
  className?: string | undefined;
81
81
  } & ({
82
- type: "checkbox";
82
+ type: 'checkbox';
83
83
  value: readonly V[];
84
84
  onValueChange: (value: V[]) => void;
85
85
  } | {
86
- type: "radio";
86
+ type: 'radio';
87
87
  value: V;
88
88
  onValueChange: (value: V) => void;
89
89
  });
@@ -107,8 +107,8 @@ export interface CheckboxFieldProps {
107
107
  }
108
108
  /** One checkbox with its label and a helper or error line, for consent and on/off settings. */
109
109
  export declare function CheckboxField({ label, helper, error, checked, onCheckedChange, disabled, id, variant, className, }: CheckboxFieldProps): import("react").JSX.Element;
110
- export type FieldSeparatorProps = Omit<SeparatorLabelProps, "variant" | "children"> & {
111
- children?: SeparatorLabelProps["children"];
110
+ export type FieldSeparatorProps = Omit<SeparatorLabelProps, 'variant' | 'children'> & {
111
+ children?: SeparatorLabelProps['children'];
112
112
  };
113
113
  /**
114
114
  * A labeled separator sized for a field stack: it pulls in the stack gap so
@@ -1,16 +1,16 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { createContext, useContext, useId, } from "react";
4
- import { Checkbox as BaseCheckbox } from "@base-ui/react/checkbox";
5
- import { Check } from "reicon-react/icons/Check";
6
- import { cn } from "../internal/classes.js";
7
- import { Badge } from "./badge.js";
8
- import { RadioGroup, RadioGroupItem } from "./radio-group.js";
9
- import { Separator } from "./separator.js";
10
- export const fieldLabelVisibilityNames = ["visible", "screen-reader"];
11
- export const choiceGroupTypeNames = ["checkbox", "radio"];
12
- export const choiceGroupLayoutNames = ["list", "columns"];
13
- export const checkboxFieldVariantNames = ["default", "neutral"];
3
+ import { createContext, useContext, useId } from 'react';
4
+ import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';
5
+ import { Check } from 'reicon-react/icons/Check';
6
+ import { cn } from '../internal/classes.js';
7
+ import { Badge } from './badge.js';
8
+ import { RadioGroup, RadioGroupItem } from './radio-group.js';
9
+ import { Separator } from './separator.js';
10
+ export const fieldLabelVisibilityNames = ['visible', 'screen-reader'];
11
+ export const choiceGroupTypeNames = ['checkbox', 'radio'];
12
+ export const choiceGroupLayoutNames = ['list', 'columns'];
13
+ export const checkboxFieldVariantNames = ['default', 'neutral'];
14
14
  /**
15
15
  * Locks every Field, ChoiceGroup, and CheckboxField below it. Render it as a
16
16
  * provider: `<FieldsDisabled value={saving}>…</FieldsDisabled>`.
@@ -25,40 +25,34 @@ const FieldControlContext = createContext(null);
25
25
  */
26
26
  export function useFieldControl(props) {
27
27
  const field = useContext(FieldControlContext);
28
- if (!field ||
29
- props["aria-label"] !== undefined ||
30
- props["aria-labelledby"] !== undefined)
28
+ if (!field || props['aria-label'] !== undefined || props['aria-labelledby'] !== undefined)
31
29
  return props;
32
30
  return {
33
31
  ...props,
34
32
  id: field.id,
35
33
  disabled: field.disabled || props.disabled,
36
- "aria-describedby": ids(field.describedBy, props["aria-describedby"]),
37
- "aria-invalid": field.invalid || props["aria-invalid"],
38
- "aria-required": field.required || props["aria-required"],
34
+ 'aria-describedby': ids(field.describedBy, props['aria-describedby']),
35
+ 'aria-invalid': field.invalid || props['aria-invalid'],
36
+ 'aria-required': field.required || props['aria-required'],
39
37
  };
40
38
  }
41
39
  // Deduped so a control that applies useFieldControl twice keeps one copy of each id.
42
40
  function ids(...values) {
43
- const tokens = values.flatMap((value) => (value ? value.split(/\s+/) : []));
44
- return [...new Set(tokens.filter(Boolean))].join(" ") || undefined;
41
+ const tokens = values.flatMap(value => (value ? value.split(/\s+/) : []));
42
+ return [...new Set(tokens.filter(Boolean))].join(' ') || undefined;
45
43
  }
46
- function RequirementMarker({ required, id, }) {
47
- return (_jsx("span", { id: id, "aria-hidden": id ? undefined : true, "data-slot": "requirement", className: "sprout-field-requirement", children: required ? "Required" : "Optional" }));
44
+ function RequirementMarker({ required, id }) {
45
+ return (_jsx("span", { id: id, "aria-hidden": id ? undefined : true, "data-slot": "requirement", className: "sprout-field-requirement", children: required ? 'Required' : 'Optional' }));
48
46
  }
49
47
  /**
50
48
  * A labeled form row for one control: label, required or optional marker,
51
49
  * optional counter, the control, and a helper or error line.
52
50
  */
53
- export function Field({ label, labelVisibility = "visible", helper, error, counter, id, disabled, required, className, children, }) {
51
+ export function Field({ label, labelVisibility = 'visible', helper, error, counter, id, disabled, required, className, children, }) {
54
52
  const generatedId = useId();
55
53
  const controlId = id ?? generatedId;
56
54
  const locked = useContext(FieldsDisabled) || disabled === true;
57
- const lineId = error
58
- ? `${controlId}-error`
59
- : helper
60
- ? `${controlId}-helper`
61
- : undefined;
55
+ const lineId = error ? `${controlId}-error` : helper ? `${controlId}-helper` : undefined;
62
56
  const markerId = required ? undefined : `${controlId}-requirement`;
63
57
  const counterId = counter ? `${controlId}-counter` : undefined;
64
58
  const control = {
@@ -68,23 +62,21 @@ export function Field({ label, labelVisibility = "visible", helper, error, count
68
62
  required: required === true,
69
63
  disabled: locked,
70
64
  };
71
- return (_jsxs("div", { "data-slot": "field", "data-disabled": locked || undefined, "data-invalid": error ? true : undefined, className: cn("sprout-field", className), children: [_jsxs("div", { "data-slot": "field-header", className: labelVisibility === "screen-reader"
72
- ? "sprout-field-sr-only"
73
- : "sprout-field-header", children: [_jsxs("div", { className: "sprout-field-heading", children: [_jsx("label", { "data-slot": "label", htmlFor: controlId, className: "sprout-field-label", children: label }), _jsx(RequirementMarker, { required: required === true, id: markerId })] }), counter && (_jsx("p", { id: counterId, "data-slot": "field-counter", className: "sprout-field-counter", children: counter }))] }), _jsx(FieldControlContext, { value: control, children: children }), error ? (_jsx("p", { id: lineId, "data-slot": "field-error", className: "sprout-field-message sprout-field-error", children: error })) : helper ? (_jsx("p", { id: lineId, "data-slot": "field-helper", className: "sprout-field-message", children: helper })) : null] }));
65
+ return (_jsxs("div", { "data-slot": "field", "data-disabled": locked || undefined, "data-invalid": error ? true : undefined, className: cn('sprout-field', className), children: [_jsxs("div", { "data-slot": "field-header", className: labelVisibility === 'screen-reader' ? 'sprout-field-sr-only' : 'sprout-field-header', children: [_jsxs("div", { className: "sprout-field-heading", children: [_jsx("label", { "data-slot": "label", htmlFor: controlId, className: "sprout-field-label", children: label }), _jsx(RequirementMarker, { required: required === true, id: markerId })] }), counter && (_jsx("p", { id: counterId, "data-slot": "field-counter", className: "sprout-field-counter", children: counter }))] }), _jsx(FieldControlContext, { value: control, children: children }), error ? (_jsx("p", { id: lineId, "data-slot": "field-error", className: "sprout-field-message sprout-field-error", children: error })) : helper ? (_jsx("p", { id: lineId, "data-slot": "field-helper", className: "sprout-field-message", children: helper })) : null] }));
74
66
  }
75
- function FieldCheckbox({ variant = "default", className, ...props }) {
76
- return (_jsx(BaseCheckbox.Root, { "data-slot": "checkbox", "data-variant": variant, className: cn("sprout-field-checkbox", className), ...props, children: _jsx(BaseCheckbox.Indicator, { "data-slot": "checkbox-indicator", className: "sprout-field-checkbox-indicator", children: _jsx(Check, { "aria-hidden": "true" }) }) }));
67
+ function FieldCheckbox({ variant = 'default', className, ...props }) {
68
+ return (_jsx(BaseCheckbox.Root, { "data-slot": "checkbox", "data-variant": variant, className: cn('sprout-field-checkbox', className), ...props, children: _jsx(BaseCheckbox.Indicator, { "data-slot": "checkbox-indicator", className: "sprout-field-checkbox-indicator", children: _jsx(Check, { "aria-hidden": "true" }) }) }));
77
69
  }
78
70
  /**
79
71
  * A labeled set of checkboxes (many values) or radios (one value), with
80
72
  * optional descriptions per option, a helper, a warning badge, and an error.
81
73
  */
82
74
  export function ChoiceGroup(props) {
83
- const { legend, legendVisibility = "visible", helper, error, warning, options, layout = "list", required, className, } = props;
75
+ const { legend, legendVisibility = 'visible', helper, error, warning, options, layout = 'list', required, className, } = props;
84
76
  const generatedId = useId();
85
77
  const groupId = props.id ?? generatedId;
86
78
  const locked = useContext(FieldsDisabled) || props.disabled === true;
87
- const radio = props.type === "radio";
79
+ const radio = props.type === 'radio';
88
80
  const legendId = `${groupId}-legend`;
89
81
  const errorId = error ? `${groupId}-error` : undefined;
90
82
  const helperId = helper ? `${groupId}-helper` : undefined;
@@ -92,37 +84,29 @@ export function ChoiceGroup(props) {
92
84
  const markerId = radio && required ? undefined : `${groupId}-requirement`;
93
85
  const labelling = {
94
86
  id: groupId,
95
- "aria-labelledby": legendId,
96
- "aria-describedby": ids(errorId, helperId, markerId),
87
+ 'aria-labelledby': legendId,
88
+ 'aria-describedby': ids(errorId, helperId, markerId),
97
89
  };
98
90
  const rows = options.map((option, index) => {
99
- const checked = props.type === "checkbox"
100
- ? props.value.includes(option.value)
101
- : props.value === option.value;
91
+ const checked = props.type === 'checkbox' ? props.value.includes(option.value) : props.value === option.value;
102
92
  const disabled = locked || option.disabled === true;
103
- const descriptionId = option.description
104
- ? `${groupId}-option-${index}-description`
105
- : undefined;
93
+ const descriptionId = option.description ? `${groupId}-option-${index}-description` : undefined;
106
94
  let control;
107
- if (props.type === "checkbox") {
95
+ if (props.type === 'checkbox') {
108
96
  const { value, onValueChange } = props;
109
- control = (_jsx(FieldCheckbox, { checked: checked, disabled: disabled, "aria-describedby": descriptionId, "aria-invalid": error ? true : undefined, onCheckedChange: (next) => onValueChange(next
110
- ? [...value, option.value]
111
- : value.filter((item) => item !== option.value)) }));
97
+ control = (_jsx(FieldCheckbox, { checked: checked, disabled: disabled, "aria-describedby": descriptionId, "aria-invalid": error ? true : undefined, onCheckedChange: next => onValueChange(next ? [...value, option.value] : value.filter(item => item !== option.value)) }));
112
98
  }
113
99
  else {
114
100
  control = (_jsx(RadioGroupItem, { className: "sprout-field-radio", value: option.value, disabled: disabled, "aria-describedby": descriptionId }));
115
101
  }
116
102
  return (_jsxs("div", { "data-slot": "choice-option", "data-checked": checked || undefined, "data-disabled": disabled || undefined, className: "sprout-choice-option", children: [_jsxs("label", { className: "sprout-choice-option-label", children: [control, _jsx("span", { className: "sprout-choice-option-text", children: option.label })] }), option.description && (_jsx("p", { id: descriptionId, className: "sprout-choice-option-description", children: option.description }))] }, option.value));
117
103
  });
118
- const content = (_jsxs(_Fragment, { children: [_jsxs("div", { className: legendVisibility === "screen-reader"
119
- ? "sprout-field-sr-only"
120
- : "sprout-choice-group-legend", children: [_jsx("p", { id: legendId, className: "sprout-choice-group-legend-text", children: legend }), _jsx(RequirementMarker, { required: required === true, id: markerId }), warning && _jsx(Badge, { variant: "warning", children: warning })] }), helper && (_jsx("p", { id: helperId, className: "sprout-field-message", children: helper })), _jsx("div", { "data-slot": "choice-group-options", "data-layout": layout, className: "sprout-choice-group-options", children: rows }), error && (_jsx("p", { id: errorId, className: "sprout-field-message sprout-field-error", children: error }))] }));
121
- const classes = cn("sprout-choice-group", className);
122
- if (props.type === "radio") {
104
+ const content = (_jsxs(_Fragment, { children: [_jsxs("div", { className: legendVisibility === 'screen-reader' ? 'sprout-field-sr-only' : 'sprout-choice-group-legend', children: [_jsx("p", { id: legendId, className: "sprout-choice-group-legend-text", children: legend }), _jsx(RequirementMarker, { required: required === true, id: markerId }), warning && _jsx(Badge, { variant: "warning", children: warning })] }), helper && (_jsx("p", { id: helperId, className: "sprout-field-message", children: helper })), _jsx("div", { "data-slot": "choice-group-options", "data-layout": layout, className: "sprout-choice-group-options", children: rows }), error && (_jsx("p", { id: errorId, className: "sprout-field-message sprout-field-error", children: error }))] }));
105
+ const classes = cn('sprout-choice-group', className);
106
+ if (props.type === 'radio') {
123
107
  const { onValueChange } = props;
124
- return (_jsx(RadioGroup, { "data-slot": "choice-group", "data-type": "radio", className: classes, value: props.value, disabled: locked, "aria-required": required || undefined, "aria-invalid": error ? true : undefined, ...labelling, onValueChange: (next) => {
125
- const option = options.find((item) => item.value === next);
108
+ return (_jsx(RadioGroup, { "data-slot": "choice-group", "data-type": "radio", className: classes, value: props.value, disabled: locked, "aria-required": required || undefined, "aria-invalid": error ? true : undefined, ...labelling, onValueChange: next => {
109
+ const option = options.find(item => item.value === next);
126
110
  if (option)
127
111
  onValueChange(option.value);
128
112
  }, children: content }));
@@ -134,17 +118,13 @@ export function CheckboxField({ label, helper, error, checked, onCheckedChange,
134
118
  const generatedId = useId();
135
119
  const fieldId = id ?? generatedId;
136
120
  const locked = useContext(FieldsDisabled) || disabled === true;
137
- const lineId = error
138
- ? `${fieldId}-error`
139
- : helper
140
- ? `${fieldId}-helper`
141
- : undefined;
142
- return (_jsxs("div", { id: fieldId, "data-slot": "checkbox-field", "data-disabled": locked || undefined, className: cn("sprout-checkbox-field", className), children: [_jsxs("label", { className: "sprout-checkbox-field-label", children: [_jsx(FieldCheckbox, { variant: variant, checked: checked, disabled: locked, "aria-describedby": lineId, "aria-invalid": error ? true : undefined, onCheckedChange: (next) => onCheckedChange(next) }), _jsx("span", { className: "sprout-checkbox-field-text", children: label })] }), error ? (_jsx("p", { id: lineId, className: "sprout-field-message sprout-field-error sprout-checkbox-field-message", children: error })) : helper ? (_jsx("p", { id: lineId, className: "sprout-field-message sprout-checkbox-field-message", children: helper })) : null] }));
121
+ const lineId = error ? `${fieldId}-error` : helper ? `${fieldId}-helper` : undefined;
122
+ return (_jsxs("div", { id: fieldId, "data-slot": "checkbox-field", "data-disabled": locked || undefined, className: cn('sprout-checkbox-field', className), children: [_jsxs("label", { className: "sprout-checkbox-field-label", children: [_jsx(FieldCheckbox, { variant: variant, checked: checked, disabled: locked, "aria-describedby": lineId, "aria-invalid": error ? true : undefined, onCheckedChange: next => onCheckedChange(next) }), _jsx("span", { className: "sprout-checkbox-field-text", children: label })] }), error ? (_jsx("p", { id: lineId, className: "sprout-field-message sprout-field-error sprout-checkbox-field-message", children: error })) : helper ? (_jsx("p", { id: lineId, className: "sprout-field-message sprout-checkbox-field-message", children: helper })) : null] }));
143
123
  }
144
124
  /**
145
125
  * A labeled separator sized for a field stack: it pulls in the stack gap so
146
126
  * the line sits evenly between fields. Text such as "or" is optional.
147
127
  */
148
128
  export function FieldSeparator({ className, children = null, ...props }) {
149
- return (_jsx(Separator, { "data-slot": "field-separator", className: cn("sprout-field-separator", className), ...props, children: children }));
129
+ return (_jsx(Separator, { "data-slot": "field-separator", className: cn('sprout-field-separator', className), ...props, children: children }));
150
130
  }
@@ -1,4 +1,4 @@
1
- import { type HTMLAttributes } from "react";
1
+ import { type HTMLAttributes } from 'react';
2
2
  export interface FileExplorerTextFile {
3
3
  /** A slash-separated path, such as `agents/scout/persona.md`. Folders come from the paths. */
4
4
  path: string;
@@ -10,7 +10,7 @@ export interface FileExplorerUnavailableFile {
10
10
  unavailable: string;
11
11
  }
12
12
  export type FileExplorerFile = FileExplorerTextFile | FileExplorerUnavailableFile;
13
- export interface FileExplorerProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
13
+ export interface FileExplorerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
14
14
  files: FileExplorerFile[];
15
15
  /** Heads the sidebar and names the tree, such as “Soul”. */
16
16
  label?: string | undefined;