macbetter 0.0.0-stage → 0.1.0-beta.2

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 (310) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +92 -2
  3. package/dist/components/accessory-tile.d.ts +50 -0
  4. package/dist/components/accessory-tile.js +46 -0
  5. package/dist/components/activity-indicator.d.ts +15 -0
  6. package/dist/components/activity-indicator.js +15 -0
  7. package/dist/components/alert.d.ts +29 -0
  8. package/dist/components/alert.js +30 -0
  9. package/dist/components/artifact-card.d.ts +41 -0
  10. package/dist/components/artifact-card.js +57 -0
  11. package/dist/components/artwork.d.ts +44 -0
  12. package/dist/components/artwork.js +935 -0
  13. package/dist/components/attachment.d.ts +48 -0
  14. package/dist/components/attachment.js +65 -0
  15. package/dist/components/automation-row.d.ts +24 -0
  16. package/dist/components/automation-row.js +12 -0
  17. package/dist/components/avatar.d.ts +33 -0
  18. package/dist/components/avatar.js +45 -0
  19. package/dist/components/badge.d.ts +24 -0
  20. package/dist/components/badge.js +19 -0
  21. package/dist/components/button.d.ts +20 -0
  22. package/dist/components/button.js +10 -0
  23. package/dist/components/calendar.d.ts +30 -0
  24. package/dist/components/calendar.js +47 -0
  25. package/dist/components/camera-view.d.ts +40 -0
  26. package/dist/components/camera-view.js +44 -0
  27. package/dist/components/card.d.ts +14 -0
  28. package/dist/components/card.js +21 -0
  29. package/dist/components/carousel.d.ts +18 -0
  30. package/dist/components/carousel.js +33 -0
  31. package/dist/components/chat.d.ts +29 -0
  32. package/dist/components/chat.js +29 -0
  33. package/dist/components/checkbox.d.ts +13 -0
  34. package/dist/components/checkbox.js +16 -0
  35. package/dist/components/code-block.d.ts +39 -0
  36. package/dist/components/code-block.js +65 -0
  37. package/dist/components/code-field.d.ts +16 -0
  38. package/dist/components/code-field.js +29 -0
  39. package/dist/components/color-well.d.ts +23 -0
  40. package/dist/components/color-well.js +27 -0
  41. package/dist/components/combo-box.d.ts +42 -0
  42. package/dist/components/combo-box.js +102 -0
  43. package/dist/components/command-palette.d.ts +33 -0
  44. package/dist/components/command-palette.js +55 -0
  45. package/dist/components/confirmation.d.ts +24 -0
  46. package/dist/components/confirmation.js +50 -0
  47. package/dist/components/content-unavailable.d.ts +19 -0
  48. package/dist/components/content-unavailable.js +21 -0
  49. package/dist/components/context-menu.d.ts +9 -0
  50. package/dist/components/context-menu.js +15 -0
  51. package/dist/components/date-picker.d.ts +53 -0
  52. package/dist/components/date-picker.js +86 -0
  53. package/dist/components/description-list.d.ts +18 -0
  54. package/dist/components/description-list.js +17 -0
  55. package/dist/components/device-frame.d.ts +18 -0
  56. package/dist/components/device-frame.js +16 -0
  57. package/dist/components/dialog.d.ts +27 -0
  58. package/dist/components/dialog.js +35 -0
  59. package/dist/components/disclosure.d.ts +32 -0
  60. package/dist/components/disclosure.js +35 -0
  61. package/dist/components/dock.d.ts +28 -0
  62. package/dist/components/dock.js +80 -0
  63. package/dist/components/door-control.d.ts +20 -0
  64. package/dist/components/door-control.js +43 -0
  65. package/dist/components/energy-readout.d.ts +32 -0
  66. package/dist/components/energy-readout.js +27 -0
  67. package/dist/components/field.d.ts +28 -0
  68. package/dist/components/field.js +32 -0
  69. package/dist/components/gauge.d.ts +25 -0
  70. package/dist/components/gauge.js +42 -0
  71. package/dist/components/generated-image.d.ts +39 -0
  72. package/dist/components/generated-image.js +47 -0
  73. package/dist/components/glass.d.ts +34 -0
  74. package/dist/components/glass.js +31 -0
  75. package/dist/components/home-backdrop.d.ts +23 -0
  76. package/dist/components/home-backdrop.js +12 -0
  77. package/dist/components/home-section.d.ts +19 -0
  78. package/dist/components/home-section.js +21 -0
  79. package/dist/components/home-status.d.ts +24 -0
  80. package/dist/components/home-status.js +14 -0
  81. package/dist/components/hover-card.d.ts +14 -0
  82. package/dist/components/hover-card.js +16 -0
  83. package/dist/components/inspector.d.ts +29 -0
  84. package/dist/components/inspector.js +40 -0
  85. package/dist/components/level-control.d.ts +19 -0
  86. package/dist/components/level-control.js +13 -0
  87. package/dist/components/light-color-picker.d.ts +33 -0
  88. package/dist/components/light-color-picker.js +56 -0
  89. package/dist/components/list.d.ts +42 -0
  90. package/dist/components/list.js +42 -0
  91. package/dist/components/listbox.d.ts +16 -0
  92. package/dist/components/listbox.js +28 -0
  93. package/dist/components/lock-control.d.ts +20 -0
  94. package/dist/components/lock-control.js +35 -0
  95. package/dist/components/menu-bar.d.ts +14 -0
  96. package/dist/components/menu-bar.js +16 -0
  97. package/dist/components/menu.d.ts +40 -0
  98. package/dist/components/menu.js +54 -0
  99. package/dist/components/message.d.ts +65 -0
  100. package/dist/components/message.js +69 -0
  101. package/dist/components/model-picker.d.ts +61 -0
  102. package/dist/components/model-picker.js +59 -0
  103. package/dist/components/navigation-bar.d.ts +24 -0
  104. package/dist/components/navigation-bar.js +54 -0
  105. package/dist/components/outline.d.ts +21 -0
  106. package/dist/components/outline.js +40 -0
  107. package/dist/components/page-control.d.ts +10 -0
  108. package/dist/components/page-control.js +8 -0
  109. package/dist/components/plan.d.ts +25 -0
  110. package/dist/components/plan.js +43 -0
  111. package/dist/components/popover.d.ts +16 -0
  112. package/dist/components/popover.js +24 -0
  113. package/dist/components/progress.d.ts +27 -0
  114. package/dist/components/progress.js +27 -0
  115. package/dist/components/prompt-input.d.ts +93 -0
  116. package/dist/components/prompt-input.js +172 -0
  117. package/dist/components/radio.d.ts +16 -0
  118. package/dist/components/radio.js +13 -0
  119. package/dist/components/rating.d.ts +10 -0
  120. package/dist/components/rating.js +12 -0
  121. package/dist/components/reasoning.d.ts +28 -0
  122. package/dist/components/reasoning.js +52 -0
  123. package/dist/components/response.d.ts +14 -0
  124. package/dist/components/response.js +14 -0
  125. package/dist/components/scene-tile.d.ts +22 -0
  126. package/dist/components/scene-tile.js +13 -0
  127. package/dist/components/scroll-view.d.ts +21 -0
  128. package/dist/components/scroll-view.js +13 -0
  129. package/dist/components/search-field.d.ts +16 -0
  130. package/dist/components/search-field.js +12 -0
  131. package/dist/components/secure-field.d.ts +23 -0
  132. package/dist/components/secure-field.js +21 -0
  133. package/dist/components/segmented-control.d.ts +12 -0
  134. package/dist/components/segmented-control.js +10 -0
  135. package/dist/components/select.d.ts +45 -0
  136. package/dist/components/select.js +79 -0
  137. package/dist/components/sensor-readout.d.ts +29 -0
  138. package/dist/components/sensor-readout.js +12 -0
  139. package/dist/components/separator.d.ts +14 -0
  140. package/dist/components/separator.js +11 -0
  141. package/dist/components/setup-code.d.ts +29 -0
  142. package/dist/components/setup-code.js +47 -0
  143. package/dist/components/sheet.d.ts +31 -0
  144. package/dist/components/sheet.js +51 -0
  145. package/dist/components/shimmer.d.ts +18 -0
  146. package/dist/components/shimmer.js +17 -0
  147. package/dist/components/sidebar.d.ts +30 -0
  148. package/dist/components/sidebar.js +26 -0
  149. package/dist/components/slider.d.ts +27 -0
  150. package/dist/components/slider.js +43 -0
  151. package/dist/components/sources.d.ts +51 -0
  152. package/dist/components/sources.js +46 -0
  153. package/dist/components/split-view.d.ts +11 -0
  154. package/dist/components/split-view.js +13 -0
  155. package/dist/components/squircle.d.ts +41 -0
  156. package/dist/components/squircle.js +63 -0
  157. package/dist/components/stepper.d.ts +30 -0
  158. package/dist/components/stepper.js +28 -0
  159. package/dist/components/suggestion.d.ts +23 -0
  160. package/dist/components/suggestion.js +29 -0
  161. package/dist/components/switch.d.ts +10 -0
  162. package/dist/components/switch.js +10 -0
  163. package/dist/components/tab-bar.d.ts +20 -0
  164. package/dist/components/tab-bar.js +17 -0
  165. package/dist/components/table.d.ts +49 -0
  166. package/dist/components/table.js +179 -0
  167. package/dist/components/tabs.d.ts +16 -0
  168. package/dist/components/tabs.js +19 -0
  169. package/dist/components/text-area.d.ts +14 -0
  170. package/dist/components/text-area.js +9 -0
  171. package/dist/components/text-field.d.ts +26 -0
  172. package/dist/components/text-field.js +23 -0
  173. package/dist/components/thermostat-control.d.ts +30 -0
  174. package/dist/components/thermostat-control.js +139 -0
  175. package/dist/components/toast.d.ts +30 -0
  176. package/dist/components/toast.js +114 -0
  177. package/dist/components/toggle.d.ts +21 -0
  178. package/dist/components/toggle.js +19 -0
  179. package/dist/components/token-field.d.ts +31 -0
  180. package/dist/components/token-field.js +78 -0
  181. package/dist/components/tool-call.d.ts +48 -0
  182. package/dist/components/tool-call.js +77 -0
  183. package/dist/components/toolbar.d.ts +27 -0
  184. package/dist/components/toolbar.js +39 -0
  185. package/dist/components/tooltip.d.ts +11 -0
  186. package/dist/components/tooltip.js +18 -0
  187. package/dist/components/window.d.ts +56 -0
  188. package/dist/components/window.js +61 -0
  189. package/dist/index.d.ts +97 -0
  190. package/dist/index.js +98 -0
  191. package/dist/lib/agent-glyphs.d.ts +10 -0
  192. package/dist/lib/agent-glyphs.js +19 -0
  193. package/dist/lib/cx.d.ts +9 -0
  194. package/dist/lib/cx.js +14 -0
  195. package/dist/lib/derive.d.ts +53 -0
  196. package/dist/lib/derive.js +255 -0
  197. package/dist/lib/field-glyphs.d.ts +13 -0
  198. package/dist/lib/field-glyphs.js +28 -0
  199. package/dist/lib/menu-glyphs.d.ts +6 -0
  200. package/dist/lib/menu-glyphs.js +15 -0
  201. package/dist/lib/platform.d.ts +18 -0
  202. package/dist/lib/platform.js +17 -0
  203. package/dist/lib/squircle.d.ts +23 -0
  204. package/dist/lib/squircle.js +69 -0
  205. package/dist/lib/theme.d.ts +42 -0
  206. package/dist/lib/theme.js +62 -0
  207. package/dist/styles/base.css +115 -0
  208. package/dist/styles/components/accessory-tile.css +461 -0
  209. package/dist/styles/components/activity-indicator.css +63 -0
  210. package/dist/styles/components/alert.css +433 -0
  211. package/dist/styles/components/artifact-card.css +238 -0
  212. package/dist/styles/components/artwork.css +380 -0
  213. package/dist/styles/components/attachment.css +540 -0
  214. package/dist/styles/components/automation-row.css +52 -0
  215. package/dist/styles/components/avatar.css +230 -0
  216. package/dist/styles/components/badge.css +204 -0
  217. package/dist/styles/components/button.css +298 -0
  218. package/dist/styles/components/calendar.css +287 -0
  219. package/dist/styles/components/camera-view.css +239 -0
  220. package/dist/styles/components/card.css +100 -0
  221. package/dist/styles/components/carousel.css +210 -0
  222. package/dist/styles/components/chat.css +209 -0
  223. package/dist/styles/components/checkbox.css +212 -0
  224. package/dist/styles/components/code-block.css +162 -0
  225. package/dist/styles/components/code-field.css +163 -0
  226. package/dist/styles/components/color-well.css +452 -0
  227. package/dist/styles/components/combo-box.css +222 -0
  228. package/dist/styles/components/command-palette.css +379 -0
  229. package/dist/styles/components/confirmation.css +189 -0
  230. package/dist/styles/components/content-unavailable.css +105 -0
  231. package/dist/styles/components/context-menu.css +43 -0
  232. package/dist/styles/components/date-picker.css +356 -0
  233. package/dist/styles/components/description-list.css +92 -0
  234. package/dist/styles/components/device-frame.css +202 -0
  235. package/dist/styles/components/dialog.css +366 -0
  236. package/dist/styles/components/disclosure.css +197 -0
  237. package/dist/styles/components/dock.css +404 -0
  238. package/dist/styles/components/door-control.css +187 -0
  239. package/dist/styles/components/energy-readout.css +161 -0
  240. package/dist/styles/components/field.css +175 -0
  241. package/dist/styles/components/gauge.css +239 -0
  242. package/dist/styles/components/generated-image.css +248 -0
  243. package/dist/styles/components/glass.css +113 -0
  244. package/dist/styles/components/home-backdrop.css +81 -0
  245. package/dist/styles/components/home-section.css +100 -0
  246. package/dist/styles/components/home-status.css +215 -0
  247. package/dist/styles/components/hover-card.css +145 -0
  248. package/dist/styles/components/index.css +94 -0
  249. package/dist/styles/components/inspector.css +236 -0
  250. package/dist/styles/components/level-control.css +247 -0
  251. package/dist/styles/components/light-color-picker.css +94 -0
  252. package/dist/styles/components/list.css +411 -0
  253. package/dist/styles/components/listbox.css +168 -0
  254. package/dist/styles/components/lock-control.css +164 -0
  255. package/dist/styles/components/menu-bar.css +94 -0
  256. package/dist/styles/components/menu.css +454 -0
  257. package/dist/styles/components/message.css +236 -0
  258. package/dist/styles/components/model-picker.css +64 -0
  259. package/dist/styles/components/navigation-bar.css +249 -0
  260. package/dist/styles/components/outline.css +248 -0
  261. package/dist/styles/components/page-control.css +127 -0
  262. package/dist/styles/components/plan.css +212 -0
  263. package/dist/styles/components/popover.css +186 -0
  264. package/dist/styles/components/progress.css +228 -0
  265. package/dist/styles/components/prompt-input.css +503 -0
  266. package/dist/styles/components/radio.css +281 -0
  267. package/dist/styles/components/rating.css +122 -0
  268. package/dist/styles/components/reasoning.css +214 -0
  269. package/dist/styles/components/response.css +303 -0
  270. package/dist/styles/components/scene-tile.css +295 -0
  271. package/dist/styles/components/scroll-view.css +195 -0
  272. package/dist/styles/components/search-field.css +128 -0
  273. package/dist/styles/components/secure-field.css +189 -0
  274. package/dist/styles/components/segmented-control.css +183 -0
  275. package/dist/styles/components/select.css +290 -0
  276. package/dist/styles/components/sensor-readout.css +231 -0
  277. package/dist/styles/components/separator.css +62 -0
  278. package/dist/styles/components/setup-code.css +138 -0
  279. package/dist/styles/components/sheet.css +345 -0
  280. package/dist/styles/components/shimmer.css +60 -0
  281. package/dist/styles/components/sidebar.css +261 -0
  282. package/dist/styles/components/slider.css +208 -0
  283. package/dist/styles/components/sources.css +349 -0
  284. package/dist/styles/components/split-view.css +75 -0
  285. package/dist/styles/components/squircle.css +44 -0
  286. package/dist/styles/components/stepper.css +278 -0
  287. package/dist/styles/components/suggestion.css +203 -0
  288. package/dist/styles/components/switch.css +115 -0
  289. package/dist/styles/components/tab-bar.css +223 -0
  290. package/dist/styles/components/table.css +313 -0
  291. package/dist/styles/components/tabs.css +262 -0
  292. package/dist/styles/components/text-area.css +94 -0
  293. package/dist/styles/components/text-field.css +294 -0
  294. package/dist/styles/components/thermostat-control.css +214 -0
  295. package/dist/styles/components/toast.css +418 -0
  296. package/dist/styles/components/toggle.css +312 -0
  297. package/dist/styles/components/token-field.css +193 -0
  298. package/dist/styles/components/tool-call.css +391 -0
  299. package/dist/styles/components/toolbar.css +370 -0
  300. package/dist/styles/components/tooltip.css +69 -0
  301. package/dist/styles/components/window.css +428 -0
  302. package/dist/styles/index.css +17 -0
  303. package/dist/styles/materials.css +263 -0
  304. package/dist/styles/platforms.css +214 -0
  305. package/dist/styles/themes/ember.css +24 -0
  306. package/dist/styles/themes/graphite.css +16 -0
  307. package/dist/styles/themes/nebula.css +16 -0
  308. package/dist/styles/themes/system.css +28 -0
  309. package/dist/styles/tokens.css +299 -0
  310. package/package.json +82 -3
@@ -0,0 +1,59 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cx, join } from "../lib/cx.js";
5
+ import { Menu, MenuContent, MenuGroupLabel, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuTrigger, } from "./menu.js";
6
+ const ModelPickerContext = React.createContext(null);
7
+ function useModelPicker(part) {
8
+ const context = React.useContext(ModelPickerContext);
9
+ if (!context)
10
+ throw new Error(`${part} must be inside a ModelPicker.`);
11
+ return context;
12
+ }
13
+ function useControllable(value, defaultValue, onChange) {
14
+ const [own, setOwn] = React.useState(defaultValue);
15
+ const current = value !== undefined ? value : own;
16
+ const set = React.useCallback((next) => {
17
+ if (value === undefined)
18
+ setOwn(next);
19
+ onChange?.(next);
20
+ }, [value, onChange]);
21
+ return [current, set];
22
+ }
23
+ /** One compact control that shows the model and effort ("Atlas 4 · High") and opens a menu to change them. */
24
+ function ModelPicker({ models, efforts = [], value: valueProp, defaultValue, onValueChange, effort: effortProp, defaultEffort, onEffortChange, modelsLabel = "Model", effortLabel = "Effort", size = "md", disabled, "aria-label": ariaLabel, className, presentation = "auto", children, ...props }) {
25
+ const [value, setValue] = useControllable(valueProp, defaultValue ?? models[0]?.value ?? null, onValueChange);
26
+ const [effort, setEffort] = useControllable(effortProp, defaultEffort ?? efforts[0]?.value ?? null, onEffortChange);
27
+ const model = models.find((entry) => entry.value === value);
28
+ const level = efforts.find((entry) => entry.value === effort);
29
+ const context = {
30
+ models,
31
+ efforts,
32
+ value,
33
+ setValue,
34
+ effort,
35
+ setEffort,
36
+ modelsLabel,
37
+ effortLabel,
38
+ };
39
+ return (_jsx(ModelPickerContext.Provider, { value: context, children: _jsxs(Menu, { presentation: presentation, ...props, children: [_jsxs(MenuTrigger, { variant: "plain", tone: "neutral", size: size, disabled: disabled, "aria-label": ariaLabel, className: join("mb-model-picker", className), children: [_jsx("span", { className: "mb-model-picker-name", children: model?.label ?? modelsLabel }), level ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "mb-visually-hidden", children: ", " }), _jsx("span", { "aria-hidden": "true", className: "mb-model-picker-dot", children: "\u00B7" }), _jsx("span", { className: "mb-model-picker-effort", children: level.label })] })) : null] }), _jsx(MenuContent, { className: "mb-model-picker-content", children: children ?? (_jsxs(_Fragment, { children: [_jsx(ModelPickerGroup, { children: models.map((entry) => (_jsx(ModelPickerItem, { value: entry.value, description: entry.description, disabled: entry.disabled, children: entry.label }, entry.value))) }), efforts.length ? (_jsxs(_Fragment, { children: [_jsx(MenuSeparator, {}), _jsx(ModelPickerEffort, {})] })) : null] })) })] }) }));
40
+ }
41
+ /** The radio group of models. `ModelPickerItem`s go inside. */
42
+ function ModelPickerGroup({ label, className, children, ...props }) {
43
+ const { value, setValue, modelsLabel } = useModelPicker("ModelPickerGroup");
44
+ const heading = label === undefined ? modelsLabel : label;
45
+ return (_jsxs(MenuRadioGroup, { value: value, onValueChange: (next) => setValue(next), className: cx("mb-model-picker-group", className), ...props, children: [heading ? _jsx(MenuGroupLabel, { children: heading }) : null, children] }));
46
+ }
47
+ /** A model: its name, with a one-line description under it. */
48
+ function ModelPickerItem({ description, closeOnSelect = true, label, className, children, ...props }) {
49
+ return (_jsx(MenuRadioItem, { closeOnSelect: closeOnSelect, label: label ?? (typeof children === "string" ? children : undefined), className: cx("mb-model-picker-item", className), ...props, children: _jsxs("span", { className: "mb-model-picker-item-text", children: [_jsx("span", { className: "mb-model-picker-item-label", children: children }), description ? _jsx("span", { className: "mb-model-picker-item-description", children: description }) : null] }) }));
50
+ }
51
+ /** The radio group of effort levels, from the picker's `efforts`. */
52
+ function ModelPickerEffort({ label, className, ...props }) {
53
+ const { efforts, effort, setEffort, effortLabel } = useModelPicker("ModelPickerEffort");
54
+ const heading = label === undefined ? effortLabel : label;
55
+ return (_jsxs(MenuRadioGroup, { value: effort, onValueChange: (next) => setEffort(next), className: cx("mb-model-picker-group", className), ...props, children: [heading ? _jsx(MenuGroupLabel, { children: heading }) : null, efforts.map((entry) => (_jsx(ModelPickerItem, { value: entry.value, description: entry.description, closeOnSelect: false, children: entry.label }, entry.value)))] }));
56
+ }
57
+ /** A line between groups in a custom picker layout. */
58
+ const ModelPickerSeparator = MenuSeparator;
59
+ export { ModelPicker, ModelPickerEffort, ModelPickerGroup, ModelPickerItem, ModelPickerSeparator };
@@ -0,0 +1,24 @@
1
+ import { Button as ButtonPrimitive } from "@ui-sdk/react/button";
2
+ import * as React from "react";
3
+ /**
4
+ * The scroll view a navigation bar belongs to. Its scroll position drives the
5
+ * bar: the material fades in and a large title collapses as content passes under.
6
+ */
7
+ declare function NavigationStack({ className, ref: forwardedRef, ...props }: React.ComponentProps<"div">): React.JSX.Element;
8
+ type NavigationBarProps = Omit<React.ComponentProps<"div">, "title"> & {
9
+ title?: React.ReactNode;
10
+ /** Shows the title large below the bar, collapsing into the bar as content scrolls. */
11
+ largeTitle?: boolean;
12
+ /** The level of the screen's title heading. */
13
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
14
+ };
15
+ declare function NavigationBar({ title, largeTitle, headingLevel, className, children, ...props }: NavigationBarProps): React.JSX.Element;
16
+ declare function NavigationBarLeading({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
17
+ declare function NavigationBarTrailing({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
18
+ type NavigationBarBackButtonProps = Omit<React.ComponentProps<typeof ButtonPrimitive>, "children"> & {
19
+ children?: React.ReactNode;
20
+ };
21
+ /** The back button: a chevron and the previous screen's title. */
22
+ declare function NavigationBarBackButton({ className, children, ...props }: NavigationBarBackButtonProps): React.JSX.Element;
23
+ export { NavigationBar, NavigationBarBackButton, NavigationBarLeading, NavigationBarTrailing, NavigationStack };
24
+ export type { NavigationBarBackButtonProps, NavigationBarProps };
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Button as ButtonPrimitive } from "@ui-sdk/react/button";
4
+ import * as React from "react";
5
+ import { cx, join } from "../lib/cx.js";
6
+ /**
7
+ * The scroll view a navigation bar belongs to. Its scroll position drives the
8
+ * bar: the material fades in and a large title collapses as content passes under.
9
+ */
10
+ function NavigationStack({ className, ref: forwardedRef, ...props }) {
11
+ const ref = React.useRef(null);
12
+ React.useImperativeHandle(forwardedRef, () => ref.current);
13
+ React.useEffect(() => {
14
+ const stack = ref.current;
15
+ if (!stack || (typeof CSS !== "undefined" && CSS.supports("animation-timeline: scroll()")))
16
+ return;
17
+ // Browsers without scroll-driven animations (Safari before 26) get the same states from a scroll listener.
18
+ let frame = 0;
19
+ const update = () => {
20
+ frame = 0;
21
+ const large = stack.querySelector(".mb-navigation-bar-large-title");
22
+ // A hidden panel lays the title out at 0px; never call that "scrolled".
23
+ const threshold = Math.max(1, large ? large.offsetHeight - 8 : 1);
24
+ stack.style.setProperty("--mb-navigation-offset", `${Math.max(0, stack.scrollTop)}px`);
25
+ stack.toggleAttribute("data-scrolled", stack.scrollTop > threshold);
26
+ };
27
+ const schedule = () => {
28
+ if (!frame)
29
+ frame = requestAnimationFrame(update);
30
+ };
31
+ update();
32
+ stack.addEventListener("scroll", schedule, { passive: true });
33
+ return () => {
34
+ cancelAnimationFrame(frame);
35
+ stack.removeEventListener("scroll", schedule);
36
+ };
37
+ }, []);
38
+ return _jsx("div", { ...props, ref: ref, className: join("mb-navigation-stack", className) });
39
+ }
40
+ function NavigationBar({ title, largeTitle, headingLevel = 1, className, children, ...props }) {
41
+ const Heading = `h${headingLevel}`;
42
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { "data-large-title": largeTitle ? "" : undefined, className: join("mb-navigation-bar", className), ...props, children: [title && largeTitle ? (_jsx("div", { "aria-hidden": "true", "data-large-title": "", className: "mb-navigation-bar-title", children: title })) : title ? (_jsx(Heading, { className: "mb-navigation-bar-title", children: title })) : null, children] }), largeTitle && title ? _jsx(Heading, { className: "mb-navigation-bar-large-title", children: title }) : null] }));
43
+ }
44
+ function NavigationBarLeading({ className, ...props }) {
45
+ return _jsx("div", { className: join("mb-navigation-bar-leading", className), ...props });
46
+ }
47
+ function NavigationBarTrailing({ className, ...props }) {
48
+ return _jsx("div", { className: join("mb-navigation-bar-trailing", className), ...props });
49
+ }
50
+ /** The back button: a chevron and the previous screen's title. */
51
+ function NavigationBarBackButton({ className, children, ...props }) {
52
+ return (_jsxs(ButtonPrimitive, { className: cx("mb-navigation-bar-back", className), ...props, children: [_jsx("svg", { viewBox: "0 0 12 21", "aria-hidden": "true", className: "mb-navigation-bar-back-chevron", children: _jsx("path", { d: "M10 1.5 2 10.5l8 9" }) }), _jsx("span", { className: "mb-navigation-bar-back-label", children: children })] }));
53
+ }
54
+ export { NavigationBar, NavigationBarBackButton, NavigationBarLeading, NavigationBarTrailing, NavigationStack };
@@ -0,0 +1,21 @@
1
+ import { TreeGroup, TreeItem, TreeItemLabel, type TreeMode, type TreeProps } from "@ui-sdk/react/tree";
2
+ import * as React from "react";
3
+ type OutlineProps<Mode extends TreeMode = "single"> = TreeProps<Mode> & {
4
+ /** Draws a hairline down each open branch, linking children to their parent. */
5
+ guides?: boolean;
6
+ };
7
+ /** A macOS outline view, like Finder's list: rows that expand, select and move with the keyboard. */
8
+ declare function Outline<Mode extends TreeMode = "single">({ guides, activation, className, ...props }: OutlineProps<Mode>): React.JSX.Element;
9
+ declare function OutlineItem({ branch, className, children, ...props }: React.ComponentProps<typeof TreeItem>): React.JSX.Element;
10
+ type OutlineItemLabelProps = Omit<React.ComponentProps<typeof TreeItemLabel>, "children"> & {
11
+ children?: React.ReactNode;
12
+ };
13
+ /** The row: a disclosure triangle on branches, then whatever you put in it. */
14
+ declare function OutlineItemLabel({ className, children, ...props }: OutlineItemLabelProps): React.JSX.Element;
15
+ declare function OutlineItemIcon({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
16
+ declare function OutlineItemText({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
17
+ /** Secondary text at the trailing edge, like a file's size or a folder's item count. */
18
+ declare function OutlineItemDetail({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
19
+ declare function OutlineGroup({ className, ...props }: React.ComponentProps<typeof TreeGroup>): React.JSX.Element;
20
+ export { Outline, OutlineGroup, OutlineItem, OutlineItemDetail, OutlineItemIcon, OutlineItemLabel, OutlineItemText };
21
+ export type { OutlineItemLabelProps, OutlineProps };
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Tree, TreeGroup, TreeItem, TreeItemIndicator, TreeItemLabel, } from "@ui-sdk/react/tree";
3
+ import * as React from "react";
4
+ import { cx, join } from "../lib/cx.js";
5
+ /** A macOS outline view, like Finder's list: rows that expand, select and move with the keyboard. */
6
+ function Outline({ guides, activation = "automatic", className, ...props }) {
7
+ // Arrow keys move the selection, as in Finder.
8
+ return (_jsx(Tree, { activation: activation, "data-guides": guides ? "" : undefined, className: cx("mb-outline", className), ...props }));
9
+ }
10
+ function OutlineItem({ branch, className, children, ...props }) {
11
+ // ui-sdk reads a branch and its depth from a TreeGroup placed directly in the item,
12
+ // so hand it the real part rather than our wrapper.
13
+ let hasGroup = false;
14
+ const parts = React.Children.map(children, (child) => {
15
+ if (React.isValidElement(child) && child.type === OutlineGroup) {
16
+ hasGroup = true;
17
+ return _jsx(TreeGroup, { ...child.props, className: cx("mb-outline-group", child.props.className) });
18
+ }
19
+ return child;
20
+ });
21
+ return (_jsx(TreeItem, { branch: branch ?? (hasGroup || undefined), className: cx("mb-outline-item", className), ...props, children: parts }));
22
+ }
23
+ /** The row: a disclosure triangle on branches, then whatever you put in it. */
24
+ function OutlineItemLabel({ className, children, ...props }) {
25
+ return (_jsxs(TreeItemLabel, { className: cx("mb-outline-row", className), ...props, children: [_jsx(TreeItemIndicator, { className: "mb-outline-indicator", children: _jsx("svg", { viewBox: "0 0 8 14", "aria-hidden": "true", children: _jsx("path", { d: "M1.5 1.5 6.5 7l-5 5.5" }) }) }), children] }));
26
+ }
27
+ function OutlineItemIcon({ className, ...props }) {
28
+ return _jsx("span", { "aria-hidden": "true", className: join("mb-outline-icon", className), ...props });
29
+ }
30
+ function OutlineItemText({ className, ...props }) {
31
+ return _jsx("span", { className: join("mb-outline-text", className), ...props });
32
+ }
33
+ /** Secondary text at the trailing edge, like a file's size or a folder's item count. */
34
+ function OutlineItemDetail({ className, ...props }) {
35
+ return _jsx("span", { className: join("mb-outline-detail", className), ...props });
36
+ }
37
+ function OutlineGroup({ className, ...props }) {
38
+ return _jsx(TreeGroup, { className: cx("mb-outline-group", className), ...props });
39
+ }
40
+ export { Outline, OutlineGroup, OutlineItem, OutlineItemDetail, OutlineItemIcon, OutlineItemLabel, OutlineItemText };
@@ -0,0 +1,10 @@
1
+ import { Pagination } from "@ui-sdk/react/pagination";
2
+ import type * as React from "react";
3
+ type PageControlProps = Omit<React.ComponentProps<typeof Pagination>, "children" | "pageCount"> & {
4
+ pageCount: number;
5
+ /** `glass` sets the dots on a capsule of glass, for busy backgrounds. */
6
+ variant?: "plain" | "glass";
7
+ };
8
+ declare function PageControl({ pageCount, variant, className, ...props }: PageControlProps): React.JSX.Element;
9
+ export { PageControl };
10
+ export type { PageControlProps };
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Pagination, PaginationItem, PaginationLink, PaginationList } from "@ui-sdk/react/pagination";
3
+ import { cx } from "../lib/cx.js";
4
+ function PageControl({ pageCount, variant = "plain", className, ...props }) {
5
+ const pages = Array.from({ length: pageCount }, (_, index) => index + 1);
6
+ return (_jsx(Pagination, { pageCount: pageCount, siblings: pageCount, boundaries: pageCount, "data-variant": variant, className: cx("mb-page-control", className), ...props, children: _jsx(PaginationList, { className: "mb-page-control-list", children: pages.map((page) => (_jsx(PaginationItem, { className: "mb-page-control-item", children: _jsx(PaginationLink, { page: page, "aria-label": `Page ${page} of ${pageCount}`, className: "mb-page-control-dot", children: _jsx("span", { "aria-hidden": "true", className: "mb-page-control-dot-mark" }) }) }, page))) }) }));
7
+ }
8
+ export { PageControl };
@@ -0,0 +1,25 @@
1
+ import { Timeline, TimelineItem } from "@ui-sdk/react/timeline";
2
+ import * as React from "react";
3
+ type PlanStepStatus = "pending" | "active" | "done" | "skipped";
4
+ type PlanProps = Omit<React.ComponentProps<typeof Timeline>, "children"> & {
5
+ children?: React.ReactNode;
6
+ /** Shows "3 of 5" beside the title, counting done and skipped steps. */
7
+ progress?: boolean;
8
+ };
9
+ /**
10
+ * A task list for multi-step work. Put an optional PlanTitle first, then a PlanStep for each
11
+ * step. The steps are a list with one tab stop; the arrow keys move between them.
12
+ */
13
+ declare function Plan({ progress, className, children, "aria-label": label, ...props }: PlanProps): React.JSX.Element;
14
+ /** The plan's name, like "Move the billing tables". It names the list of steps. */
15
+ declare function PlanTitle({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
16
+ type PlanStepProps = Omit<React.ComponentProps<typeof TimelineItem>, "status" | "children"> & {
17
+ status?: PlanStepStatus;
18
+ /** One line under the title, like what the step found or why it was skipped. */
19
+ detail?: React.ReactNode;
20
+ children?: React.ReactNode;
21
+ };
22
+ /** One step: an empty circle, a turning accent ring, a filled check or a dash, then its title. */
23
+ declare function PlanStep({ status, detail, className, children, ...props }: PlanStepProps): React.JSX.Element;
24
+ export { Plan, PlanStep, PlanTitle };
25
+ export type { PlanProps, PlanStepProps, PlanStepStatus };
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Timeline, TimelineConnector, TimelineDescription, TimelineItem, TimelineMarker, TimelineTitle, } from "@ui-sdk/react/timeline";
4
+ import * as React from "react";
5
+ import { CheckGlyph, DashGlyph } from "../lib/agent-glyphs.js";
6
+ import { cx, join } from "../lib/cx.js";
7
+ function isStep(child) {
8
+ return React.isValidElement(child) && child.type === PlanStep;
9
+ }
10
+ /**
11
+ * A task list for multi-step work. Put an optional PlanTitle first, then a PlanStep for each
12
+ * step. The steps are a list with one tab stop; the arrow keys move between them.
13
+ */
14
+ function Plan({ progress = true, className, children, "aria-label": label, ...props }) {
15
+ const titleId = React.useId();
16
+ const all = React.Children.toArray(children);
17
+ const title = all.find((child) => React.isValidElement(child) && child.type === PlanTitle);
18
+ const steps = all.filter(isStep);
19
+ const rest = all.filter((child) => child !== title && !isStep(child));
20
+ const finished = steps.filter((step) => step.props.status === "done" || step.props.status === "skipped").length;
21
+ return (_jsxs("div", { className: join("mb-plan", typeof className === "string" ? className : undefined), children: [title ? (_jsxs("div", { className: "mb-plan-header", children: [_jsx("div", { id: titleId, className: "mb-plan-heading", children: title }), progress && steps.length > 0 ? (_jsxs("span", { className: "mb-plan-progress", children: [finished, " of ", steps.length] })) : null] })) : null, _jsx(Timeline, { "aria-label": label, "aria-labelledby": title && !label ? titleId : undefined, className: cx("mb-plan-steps", typeof className === "function" ? className : undefined), ...props, children: steps }), rest] }));
22
+ }
23
+ /** The plan's name, like "Move the billing tables". It names the list of steps. */
24
+ function PlanTitle({ className, ...props }) {
25
+ return _jsx("span", { className: join("mb-plan-title", className), ...props });
26
+ }
27
+ const timelineStatus = {
28
+ pending: "upcoming",
29
+ active: "current",
30
+ done: "complete",
31
+ skipped: "complete",
32
+ };
33
+ const statusWords = {
34
+ pending: "Not started",
35
+ active: "In progress",
36
+ done: "Done",
37
+ skipped: "Skipped",
38
+ };
39
+ /** One step: an empty circle, a turning accent ring, a filled check or a dash, then its title. */
40
+ function PlanStep({ status = "pending", detail, className, children, ...props }) {
41
+ return (_jsxs(TimelineItem, { status: timelineStatus[status], "data-status": status, className: cx("mb-plan-step", className), ...props, children: [_jsxs(TimelineMarker, { className: "mb-plan-marker", "data-status": status, children: [status === "done" ? _jsx(CheckGlyph, { className: "mb-plan-glyph" }) : null, status === "skipped" ? _jsx(DashGlyph, { className: "mb-plan-glyph" }) : null, status === "active" ? _jsx("span", { className: "mb-plan-ring", "data-motion": "essential" }) : null] }), _jsx(TimelineConnector, { className: "mb-plan-connector" }), _jsxs(TimelineTitle, { className: "mb-plan-step-title", children: [children, _jsxs("span", { className: "mb-visually-hidden", children: [", ", statusWords[status]] })] }), detail != null ? _jsx(TimelineDescription, { className: "mb-plan-step-detail", children: detail }) : null] }));
42
+ }
43
+ export { Plan, PlanStep, PlanTitle };
@@ -0,0 +1,16 @@
1
+ import { Popover as PopoverPrimitive, PopoverClose as PopoverClosePrimitive, PopoverContent as PopoverContentPrimitive, PopoverDescription as PopoverDescriptionPrimitive, PopoverTitle as PopoverTitlePrimitive, PopoverTrigger as PopoverTriggerPrimitive } from "@ui-sdk/react/popover";
2
+ import type * as React from "react";
3
+ type PopoverProps = React.ComponentProps<typeof PopoverPrimitive>;
4
+ declare function Popover(props: PopoverProps): React.JSX.Element;
5
+ declare function PopoverTrigger(props: React.ComponentProps<typeof PopoverTriggerPrimitive>): React.JSX.Element;
6
+ type PopoverContentProps<Payload = unknown> = React.ComponentProps<typeof PopoverContentPrimitive<Payload>> & {
7
+ /** Draws the arrow that points at the trigger. */
8
+ arrow?: boolean;
9
+ };
10
+ declare function PopoverContent<Payload = unknown>({ arrow, sideOffset, arrowPadding, className, children, ...props }: PopoverContentProps<Payload>): React.JSX.Element;
11
+ declare function PopoverTitle({ className, ...props }: React.ComponentProps<typeof PopoverTitlePrimitive>): React.JSX.Element;
12
+ declare function PopoverDescription({ className, ...props }: React.ComponentProps<typeof PopoverDescriptionPrimitive>): React.JSX.Element;
13
+ declare function PopoverClose({ className, ...props }: React.ComponentProps<typeof PopoverClosePrimitive>): React.JSX.Element;
14
+ export { createPopoverController } from "@ui-sdk/react/popover";
15
+ export { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
16
+ export type { PopoverContentProps, PopoverProps };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Popover as PopoverPrimitive, PopoverArrow, PopoverClose as PopoverClosePrimitive, PopoverContent as PopoverContentPrimitive, PopoverDescription as PopoverDescriptionPrimitive, PopoverTitle as PopoverTitlePrimitive, PopoverTrigger as PopoverTriggerPrimitive, } from "@ui-sdk/react/popover";
4
+ import { cx } from "../lib/cx.js";
5
+ function Popover(props) {
6
+ return _jsx(PopoverPrimitive, { ...props });
7
+ }
8
+ function PopoverTrigger(props) {
9
+ return _jsx(PopoverTriggerPrimitive, { ...props });
10
+ }
11
+ function PopoverContent({ arrow = true, sideOffset, arrowPadding = 14, className, children, ...props }) {
12
+ return (_jsx(PopoverContentPrimitive, { sideOffset: sideOffset ?? (arrow ? 12 : 6), arrowPadding: arrowPadding, "data-arrow": arrow ? "" : undefined, className: cx("mb-popover", className), ...props, children: (state) => (_jsxs(_Fragment, { children: [arrow ? _jsx(PopoverArrow, { className: "mb-popover-arrow" }) : null, typeof children === "function" ? children(state) : children] })) }));
13
+ }
14
+ function PopoverTitle({ className, ...props }) {
15
+ return _jsx(PopoverTitlePrimitive, { className: cx("mb-popover-title", className), ...props });
16
+ }
17
+ function PopoverDescription({ className, ...props }) {
18
+ return _jsx(PopoverDescriptionPrimitive, { className: cx("mb-popover-description", className), ...props });
19
+ }
20
+ function PopoverClose({ className, ...props }) {
21
+ return _jsx(PopoverClosePrimitive, { className: cx("mb-popover-close", className), ...props });
22
+ }
23
+ export { createPopoverController } from "@ui-sdk/react/popover";
24
+ export { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
@@ -0,0 +1,27 @@
1
+ import { ProgressLabel as ProgressLabelPrimitive, Progress as ProgressPrimitive, ProgressValue as ProgressValuePrimitive } from "@ui-sdk/react/progress";
2
+ import type * as React from "react";
3
+ type ProgressTone = "accent" | "neutral" | "destructive";
4
+ type ProgressProps = Omit<React.ComponentProps<typeof ProgressPrimitive>, "children"> & {
5
+ children?: React.ReactNode;
6
+ size?: "sm" | "md" | "lg";
7
+ tone?: ProgressTone;
8
+ };
9
+ /**
10
+ * The thin linear bar. Put a ProgressLabel and a ProgressValue inside; the
11
+ * track and its fill are drawn for you, below them.
12
+ */
13
+ declare function Progress({ size, tone, className, children, ...props }: ProgressProps): React.JSX.Element;
14
+ declare function ProgressLabel({ className, ...props }: React.ComponentProps<typeof ProgressLabelPrimitive>): React.JSX.Element;
15
+ declare function ProgressValue({ className, ...props }: React.ComponentProps<typeof ProgressValuePrimitive>): React.JSX.Element;
16
+ type ProgressCircleProps = Omit<React.ComponentProps<typeof ProgressPrimitive>, "children"> & {
17
+ children?: React.ReactNode;
18
+ size?: "sm" | "md" | "lg";
19
+ tone?: ProgressTone;
20
+ };
21
+ /**
22
+ * The circular determinate ring, like a download in the App Store. Anything
23
+ * you put inside sits in the middle, such as a stop button's square.
24
+ */
25
+ declare function ProgressCircle({ size, tone, value, min, max, className, children, ...props }: ProgressCircleProps): React.JSX.Element;
26
+ export { Progress, ProgressCircle, ProgressLabel, ProgressValue };
27
+ export type { ProgressCircleProps, ProgressProps, ProgressTone };
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ProgressIndicator, ProgressLabel as ProgressLabelPrimitive, Progress as ProgressPrimitive, ProgressTrack, ProgressValue as ProgressValuePrimitive, } from "@ui-sdk/react/progress";
3
+ import { cx } from "../lib/cx.js";
4
+ /**
5
+ * The thin linear bar. Put a ProgressLabel and a ProgressValue inside; the
6
+ * track and its fill are drawn for you, below them.
7
+ */
8
+ function Progress({ size = "md", tone = "accent", className, children, ...props }) {
9
+ return (_jsxs(ProgressPrimitive, { "data-size": size, "data-tone": tone, className: cx("mb-progress", className), ...props, children: [children, _jsx(ProgressTrack, { className: "mb-progress-track", children: _jsx(ProgressIndicator, { className: "mb-progress-indicator" }) })] }));
10
+ }
11
+ function ProgressLabel({ className, ...props }) {
12
+ return _jsx(ProgressLabelPrimitive, { className: cx("mb-progress-label", className), ...props });
13
+ }
14
+ function ProgressValue({ className, ...props }) {
15
+ return _jsx(ProgressValuePrimitive, { className: cx("mb-progress-value", className), ...props });
16
+ }
17
+ /**
18
+ * The circular determinate ring, like a download in the App Store. Anything
19
+ * you put inside sits in the middle, such as a stop button's square.
20
+ */
21
+ function ProgressCircle({ size = "md", tone = "accent", value, min = 0, max = 100, className, children, ...props }) {
22
+ const percent = value === null || value === undefined
23
+ ? null
24
+ : Math.min(Math.max(((value - min) / (max - min || 1)) * 100, 0), 100);
25
+ return (_jsxs(ProgressPrimitive, { value: value, min: min, max: max, "data-size": size, "data-tone": tone, className: cx("mb-progress-circle", className), ...props, children: [_jsxs("svg", { "aria-hidden": "true", viewBox: "0 0 36 36", className: "mb-progress-circle-ring", children: [_jsx("circle", { className: "mb-progress-circle-track", cx: "18", cy: "18", r: "15", pathLength: 100 }), _jsx("circle", { className: "mb-progress-circle-fill", cx: "18", cy: "18", r: "15", pathLength: 100, strokeDasharray: percent === null ? "28 100" : `${percent} 100` })] }), children] }));
26
+ }
27
+ export { Progress, ProgressCircle, ProgressLabel, ProgressValue };
@@ -0,0 +1,93 @@
1
+ import { FileInputList } from "@ui-sdk/react/file-input";
2
+ import { Textarea } from "@ui-sdk/react/textarea";
3
+ import { type TriggerDefinition } from "@ui-sdk/react/trigger-menu";
4
+ import * as React from "react";
5
+ import { type ButtonProps } from "./button.js";
6
+ import { type MenuProps } from "./menu.js";
7
+ /** A suggestion source for `PromptInputField`'s `triggers`: ui-sdk Trigger Menu's trigger definition. */
8
+ type PromptInputTrigger = TriggerDefinition;
9
+ type PromptInputStatus = "ready" | "submitted" | "streaming" | "error";
10
+ type PromptInputMessage = {
11
+ text: string;
12
+ files: File[];
13
+ };
14
+ type PromptInputProps = Omit<React.ComponentProps<"form">, "onSubmit" | "defaultValue"> & {
15
+ /** Where the reply is: `submitted` and `streaming` turn the submit button into Stop. */
16
+ status?: PromptInputStatus;
17
+ /** Runs with what's typed and attached when the person sends. The field and files clear after. */
18
+ onSubmit?: (message: PromptInputMessage) => void;
19
+ /** Runs when the person presses Stop while a reply is on its way. */
20
+ onStop?: () => void;
21
+ /** `lg` is the tall composer of a new chat; `md` starts at one line and grows. */
22
+ size?: "md" | "lg";
23
+ /** A soft moving halo in the theme's colors while the reply is on its way. Holds still under Reduce Motion. */
24
+ glow?: boolean;
25
+ /** Floats the composer over the bottom of a `Chat`, as on iOS. */
26
+ floating?: boolean;
27
+ value?: string;
28
+ defaultValue?: string;
29
+ onValueChange?: (text: string) => void;
30
+ files?: File[];
31
+ defaultFiles?: File[];
32
+ onFilesChange?: (files: File[]) => void;
33
+ /** The files it takes, like the `accept` attribute. Any file without it. */
34
+ accept?: string;
35
+ maxFiles?: number;
36
+ /** The largest file accepted, in bytes. */
37
+ maxSize?: number;
38
+ disabled?: boolean;
39
+ };
40
+ /**
41
+ * The composer. Return sends, Shift-Return adds a line, and files come in from the
42
+ * add button, a drop or a paste. `PromptInputAccessory` children are placed under it.
43
+ */
44
+ declare function PromptInput({ status, onSubmit, onStop, size, glow, floating, value: valueProp, defaultValue, onValueChange, files: filesProp, defaultFiles, onFilesChange, accept, maxFiles, maxSize, disabled, className, children, ...props }: PromptInputProps): React.JSX.Element;
45
+ type PromptInputFieldProps = Omit<React.ComponentProps<typeof Textarea>, "value" | "defaultValue" | "onValueChange" | "submitShortcut" | "onSubmit"> & {
46
+ /**
47
+ * Suggestions at the caret, like `@` for people or files and `/` for commands. Each is a
48
+ * ui-sdk Trigger Menu trigger: `{ char, items, boundary? }`, with items as data or a loader.
49
+ */
50
+ triggers?: PromptInputTrigger[];
51
+ /** What the suggestion list says when nothing matches. Leave out to close it instead. */
52
+ triggerEmpty?: React.ReactNode;
53
+ /** The most lines it grows to before it scrolls. */
54
+ maxRows?: number;
55
+ };
56
+ /** The text field. It grows with what's typed. */
57
+ declare function PromptInputField({ "aria-label": ariaLabel, triggers, triggerEmpty, maxRows, rows, ref, className, style, disabled, ...props }: PromptInputFieldProps): React.JSX.Element;
58
+ /** The files attached so far, as chips above the field. Arrow keys move between them; Delete removes one. */
59
+ declare function PromptInputAttachments({ "aria-label": ariaLabel, className, ...props }: Omit<React.ComponentProps<typeof FileInputList>, "children">): React.JSX.Element | null;
60
+ /** The row under the field: leading and trailing `PromptInputTools`. */
61
+ declare function PromptInputToolbar({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
62
+ /** A cluster of controls in the toolbar. The first sits at the leading edge, the last at the trailing edge. */
63
+ declare function PromptInputTools({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
64
+ type PromptInputButtonProps = ButtonProps & {
65
+ /** Names the icon-only button, like "Dictate". */
66
+ "aria-label": string;
67
+ };
68
+ /** A plain round icon button for the toolbar, like dictation or voice. */
69
+ declare function PromptInputButton({ variant, tone, shape, type, className, ...props }: PromptInputButtonProps): React.JSX.Element;
70
+ type PromptInputAddProps = Omit<MenuProps, "children"> & {
71
+ /** Names the button. */
72
+ label?: string;
73
+ /** The menu item that opens the file picker. */
74
+ filesLabel?: string;
75
+ /** Leaves out the built-in files item, for a menu of your own items only. */
76
+ hideFiles?: boolean;
77
+ disabled?: boolean;
78
+ className?: string;
79
+ /** More menu items, after Add photos and files. */
80
+ children?: React.ReactNode;
81
+ };
82
+ /** The add button. It opens a menu whose first item picks photos and files. */
83
+ declare function PromptInputAdd({ label, filesLabel, hideFiles, disabled, className, presentation, onAction, children, ...props }: PromptInputAddProps): React.JSX.Element;
84
+ type PromptInputSubmitProps = Omit<ButtonProps, "children" | "type"> & {
85
+ sendLabel?: string;
86
+ stopLabel?: string;
87
+ };
88
+ /** Sends the message. While a reply is on its way it's a Stop button that calls `onStop`. */
89
+ declare function PromptInputSubmit({ sendLabel, stopLabel, variant, tone, shape, size, disabled, className, onClick, ...props }: PromptInputSubmitProps): React.JSX.Element;
90
+ /** The strip attached under the composer: context chips on the leading side, an action on the trailing side. */
91
+ declare function PromptInputAccessory({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
92
+ export { PromptInput, PromptInputAccessory, PromptInputAdd, PromptInputAttachments, PromptInputButton, PromptInputField, PromptInputSubmit, PromptInputToolbar, PromptInputTools, };
93
+ export type { PromptInputAddProps, PromptInputButtonProps, PromptInputFieldProps, PromptInputMessage, PromptInputProps, PromptInputStatus, PromptInputSubmitProps, PromptInputTrigger, };