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,172 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { createFileInputController, FileInput, FileInputDropzone, FileInputItem, FileInputItemRemove, FileInputList, formatFileSize, } from "@ui-sdk/react/file-input";
4
+ import { Textarea } from "@ui-sdk/react/textarea";
5
+ import { TriggerMenu, TriggerMenuContent, TriggerMenuEmpty, TriggerMenuList, TriggerMenuStatus, textFieldAdapter, } from "@ui-sdk/react/trigger-menu";
6
+ import * as React from "react";
7
+ import { cx, join } from "../lib/cx.js";
8
+ import { Attachment, AttachmentMeta, AttachmentName, AttachmentPreview } from "./attachment.js";
9
+ import { Button } from "./button.js";
10
+ import { Menu, MenuContent, MenuItem, MenuItemIcon, MenuTrigger } from "./menu.js";
11
+ const PromptInputContext = React.createContext(null);
12
+ function usePromptInput(part) {
13
+ const context = React.useContext(PromptInputContext);
14
+ if (!context)
15
+ throw new Error(`${part} must be inside a PromptInput.`);
16
+ return context;
17
+ }
18
+ /**
19
+ * The composer. Return sends, Shift-Return adds a line, and files come in from the
20
+ * add button, a drop or a paste. `PromptInputAccessory` children are placed under it.
21
+ */
22
+ function PromptInput({ status = "ready", onSubmit, onStop, size = "md", glow, floating, value: valueProp, defaultValue = "", onValueChange, files: filesProp, defaultFiles, onFilesChange, accept, maxFiles, maxSize, disabled = false, className, children, ...props }) {
23
+ const [ownText, setOwnText] = React.useState(defaultValue);
24
+ const text = valueProp ?? ownText;
25
+ const [ownFiles, setOwnFiles] = React.useState(defaultFiles ?? []);
26
+ const files = filesProp ?? ownFiles;
27
+ const [controller] = React.useState(createFileInputController);
28
+ const fieldRef = React.useRef(null);
29
+ const formRef = React.useRef(null);
30
+ // A floating composer tells its Chat how much room it covers, so the last turn and the
31
+ // jump button clear it however many lines the field has grown to.
32
+ React.useEffect(() => {
33
+ const form = formRef.current;
34
+ const chat = floating ? form?.closest(".mb-chat") : null;
35
+ if (!form || !chat || typeof ResizeObserver === "undefined")
36
+ return;
37
+ const measure = () => {
38
+ const room = chat.getBoundingClientRect().bottom - form.getBoundingClientRect().top;
39
+ chat.style.setProperty("--mb-chat-inset-bottom", `${Math.max(0, Math.round(room))}px`);
40
+ };
41
+ measure();
42
+ const observer = new ResizeObserver(measure);
43
+ observer.observe(form);
44
+ observer.observe(chat);
45
+ return () => {
46
+ observer.disconnect();
47
+ chat.style.removeProperty("--mb-chat-inset-bottom");
48
+ };
49
+ }, [floating]);
50
+ const setText = React.useCallback((next) => {
51
+ if (valueProp === undefined)
52
+ setOwnText(next);
53
+ onValueChange?.(next);
54
+ }, [valueProp, onValueChange]);
55
+ const setFiles = (next) => {
56
+ if (filesProp === undefined)
57
+ setOwnFiles(next);
58
+ onFilesChange?.(next);
59
+ };
60
+ const busy = status === "submitted" || status === "streaming";
61
+ const empty = text.trim() === "" && files.length === 0;
62
+ const glowing = Boolean(glow) && busy;
63
+ const context = {
64
+ status,
65
+ busy,
66
+ empty,
67
+ disabled,
68
+ text,
69
+ setText,
70
+ files,
71
+ fieldRef,
72
+ openFiles: () => controller.open(),
73
+ stop: () => onStop?.(),
74
+ };
75
+ const inside = [];
76
+ const under = [];
77
+ React.Children.forEach(children, (child) => {
78
+ if (React.isValidElement(child) && child.type === PromptInputAccessory)
79
+ under.push(child);
80
+ else
81
+ inside.push(child);
82
+ });
83
+ return (_jsx(PromptInputContext.Provider, { value: context, children: _jsxs("form", { noValidate: true, "data-size": size, "data-status": status, "data-glow": glow ? "" : undefined, "data-glowing": glowing ? "" : undefined, "data-floating": floating ? "" : undefined, "data-disabled": disabled ? "" : undefined, className: join("mb-prompt-input", className), ...props, ref: formRef, onSubmit: (event) => {
84
+ event.preventDefault();
85
+ if (busy || empty || disabled)
86
+ return;
87
+ onSubmit?.({ text, files: [...files] });
88
+ setText("");
89
+ setFiles([]);
90
+ }, children: [_jsx(FileInput, { multiple: true, accept: accept, maxFiles: maxFiles, maxSize: maxSize, disabled: disabled, controller: controller, value: files, onValueChange: (next) => setFiles([...next]), className: "mb-prompt-input-files", children: _jsx(FileInputDropzone, { className: "mb-prompt-input-box", pasteTarget: () => fieldRef.current, children: inside }) }), under] }) }));
91
+ }
92
+ function assignRef(ref, value) {
93
+ if (typeof ref === "function")
94
+ ref(value);
95
+ else if (ref)
96
+ ref.current = value;
97
+ }
98
+ /** The text field. It grows with what's typed. */
99
+ function PromptInputField({ "aria-label": ariaLabel = "Message", triggers, triggerEmpty, maxRows, rows, ref, className, style, disabled, ...props }) {
100
+ const context = usePromptInput("PromptInputField");
101
+ const [editor, setEditor] = React.useState();
102
+ const lines = maxRows ? { "--mb-prompt-input-max-rows": maxRows } : undefined;
103
+ const field = (_jsx(Textarea, { ref: (element) => {
104
+ context.fieldRef.current = element;
105
+ assignRef(ref, element);
106
+ if (triggers && element && editor?.element !== element)
107
+ setEditor(textFieldAdapter(element));
108
+ }, autoResize: true, rows: rows ?? 1, submitShortcut: "enter", "aria-label": ariaLabel, disabled: disabled ?? context.disabled, value: context.text, onValueChange: (next) => context.setText(next), className: cx("mb-prompt-input-field", className), style: lines
109
+ ? typeof style === "function"
110
+ ? (state) => ({ ...lines, ...style(state) })
111
+ : { ...lines, ...style }
112
+ : style, ...props }));
113
+ if (!triggers)
114
+ return field;
115
+ return (_jsxs(TriggerMenu, { editor: editor, triggers: triggers, children: [field, _jsx(TriggerMenuStatus, { className: "mb-visually-hidden" }), _jsxs(TriggerMenuContent, { side: "top", align: "start", sideOffset: 6, className: "mb-menu-content mb-prompt-input-suggestions", children: [triggerEmpty ? _jsx(TriggerMenuEmpty, { className: "mb-prompt-input-suggestions-empty", children: triggerEmpty }) : null, _jsx(TriggerMenuList, { className: "mb-prompt-input-suggestions-list" })] })] }));
116
+ }
117
+ /** The files attached so far, as chips above the field. Arrow keys move between them; Delete removes one. */
118
+ function PromptInputAttachments({ "aria-label": ariaLabel = "Attachments", className, ...props }) {
119
+ const { files } = usePromptInput("PromptInputAttachments");
120
+ if (files.length === 0)
121
+ return null;
122
+ return (_jsx(FileInputList, { "aria-label": ariaLabel, className: cx("mb-prompt-input-attachments", className), ...props, children: _jsx(FileInputItem, { className: "mb-prompt-input-attachment", children: ({ file }) => _jsx(PromptInputAttachmentChip, { file: file }) }) }));
123
+ }
124
+ function PromptInputAttachmentChip({ file }) {
125
+ const image = file.type.startsWith("image/");
126
+ const [url, setUrl] = React.useState();
127
+ React.useEffect(() => {
128
+ if (!image || typeof URL.createObjectURL !== "function")
129
+ return;
130
+ const next = URL.createObjectURL(file);
131
+ setUrl(next);
132
+ return () => URL.revokeObjectURL(next);
133
+ }, [file, image]);
134
+ const extension = file.name.includes(".") ? file.name.split(".").pop()?.toUpperCase().slice(0, 4) : undefined;
135
+ return (_jsxs(Attachment, { variant: "chip", children: [_jsx(AttachmentPreview, { src: url, extension: image ? undefined : extension }), _jsx(AttachmentName, { children: file.name }), _jsx(AttachmentMeta, { children: formatFileSize(file.size) }), _jsx(FileInputItemRemove, { className: "mb-attachment-remove", children: _jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "m4.75 4.75 6.5 6.5m0-6.5-6.5 6.5" }) }) })] }));
136
+ }
137
+ /** The row under the field: leading and trailing `PromptInputTools`. */
138
+ function PromptInputToolbar({ className, ...props }) {
139
+ return _jsx("div", { className: join("mb-prompt-input-toolbar", className), ...props });
140
+ }
141
+ /** A cluster of controls in the toolbar. The first sits at the leading edge, the last at the trailing edge. */
142
+ function PromptInputTools({ className, ...props }) {
143
+ return _jsx("div", { className: join("mb-prompt-input-tools", className), ...props });
144
+ }
145
+ /** A plain round icon button for the toolbar, like dictation or voice. */
146
+ function PromptInputButton({ variant = "plain", tone = "neutral", shape = "circle", type = "button", className, ...props }) {
147
+ return (_jsx(Button, { variant: variant, tone: tone, shape: shape, type: type, className: cx("mb-prompt-input-button", className), ...props }));
148
+ }
149
+ /** The add button. It opens a menu whose first item picks photos and files. */
150
+ function PromptInputAdd({ label = "Add", filesLabel = "Add photos and files", hideFiles, disabled, className, presentation = "auto", onAction, children, ...props }) {
151
+ const context = usePromptInput("PromptInputAdd");
152
+ return (_jsxs(Menu, { presentation: presentation, onAction: (value, details) => {
153
+ if (value === "mb-prompt-input-files")
154
+ context.openFiles();
155
+ return onAction?.(value, details);
156
+ }, ...props, children: [_jsx(MenuTrigger, { variant: "plain", tone: "neutral", shape: "circle", indicator: false, "aria-label": label, disabled: disabled ?? context.disabled, className: join("mb-prompt-input-button mb-prompt-input-add", className), children: _jsx("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "M8 2.75v10.5M2.75 8h10.5", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }) }) }), _jsxs(MenuContent, { side: "top", align: "start", className: "mb-prompt-input-add-menu", children: [hideFiles ? null : (_jsxs(MenuItem, { value: "mb-prompt-input-files", children: [_jsx(MenuItemIcon, { children: _jsx("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "m13.2 7.6-5.15 5.15a3.25 3.25 0 0 1-4.6-4.6l5.3-5.3a2.17 2.17 0 0 1 3.07 3.07L6.6 11.15a1.08 1.08 0 0 1-1.53-1.53l4.8-4.8", stroke: "currentColor", strokeWidth: "1.35", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), filesLabel] })), children] })] }));
157
+ }
158
+ /** Sends the message. While a reply is on its way it's a Stop button that calls `onStop`. */
159
+ function PromptInputSubmit({ sendLabel = "Send", stopLabel = "Stop", variant = "filled", tone = "accent", shape = "circle", size = "sm", disabled, className, onClick, ...props }) {
160
+ const context = usePromptInput("PromptInputSubmit");
161
+ const stopping = context.busy;
162
+ return (_jsx(Button, { type: stopping ? "button" : "submit", variant: variant, tone: stopping ? "neutral" : tone, shape: shape, size: size, "aria-label": stopping ? stopLabel : sendLabel, disabled: disabled ?? (context.disabled || (!stopping && context.empty)), "data-status": context.status, className: cx("mb-prompt-input-submit", className), onClick: (event, ...rest) => {
163
+ onClick?.(event, ...rest);
164
+ if (stopping && !event.defaultPrevented)
165
+ context.stop();
166
+ }, ...props, children: stopping ? (_jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: _jsx("rect", { x: "4", y: "4", width: "8", height: "8", rx: "1.75", fill: "currentColor" }) })) : (_jsx("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "M8 13.25V2.9M3.6 7.2 8 2.75l4.4 4.45", stroke: "currentColor", strokeWidth: "1.9", strokeLinecap: "round", strokeLinejoin: "round" }) })) }));
167
+ }
168
+ /** The strip attached under the composer: context chips on the leading side, an action on the trailing side. */
169
+ function PromptInputAccessory({ className, ...props }) {
170
+ return _jsx("div", { className: join("mb-prompt-input-accessory", className), ...props });
171
+ }
172
+ export { PromptInput, PromptInputAccessory, PromptInputAdd, PromptInputAttachments, PromptInputButton, PromptInputField, PromptInputSubmit, PromptInputToolbar, PromptInputTools, };
@@ -0,0 +1,16 @@
1
+ import { Radio as RadioPrimitive, RadioGroup as RadioGroupPrimitive } from "@ui-sdk/react/radio";
2
+ import type * as React from "react";
3
+ type RadioGroupProps = React.ComponentProps<typeof RadioGroupPrimitive> & {
4
+ /** `list` draws each choice as a row with a checkmark on the trailing edge, as iOS Settings does. */
5
+ variant?: "default" | "list";
6
+ };
7
+ declare function RadioGroup({ variant, className, ...props }: RadioGroupProps): React.JSX.Element;
8
+ type RadioProps = Omit<React.ComponentProps<typeof RadioPrimitive>, "children"> & {
9
+ /** The radio's title. With it, the button and its text are one label. */
10
+ children?: React.ReactNode;
11
+ /** A line of secondary text under the title. */
12
+ description?: React.ReactNode;
13
+ };
14
+ declare function Radio({ className, children, description, ...props }: RadioProps): React.JSX.Element;
15
+ export { Radio, RadioGroup };
16
+ export type { RadioGroupProps, RadioProps };
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Radio as RadioPrimitive, RadioGroup as RadioGroupPrimitive, RadioIndicator as RadioIndicatorPrimitive, } from "@ui-sdk/react/radio";
3
+ import { cx } from "../lib/cx.js";
4
+ function RadioGroup({ variant = "default", className, ...props }) {
5
+ return (_jsx(RadioGroupPrimitive, { "data-variant": variant, className: cx("mb-radio-group", className), ...props }));
6
+ }
7
+ function Radio({ className, children, description, ...props }) {
8
+ const button = (_jsx(RadioPrimitive, { className: cx("mb-radio", className), ...props, children: _jsx(RadioIndicatorPrimitive, { keepMounted: true, className: "mb-radio-indicator", children: _jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: "mb-radio-check", children: _jsx("path", { d: "M3.5 8.6 6.6 11.6 12.5 4.6" }) }) }) }));
9
+ if (children == null && description == null)
10
+ return button;
11
+ return (_jsxs("label", { className: "mb-radio-label", children: [button, _jsxs("span", { className: "mb-radio-text", children: [_jsx("span", { className: "mb-radio-title", children: children }), description == null ? null : _jsx("span", { className: "mb-radio-description", children: description })] })] }));
12
+ }
13
+ export { Radio, RadioGroup };
@@ -0,0 +1,10 @@
1
+ import { Rating as RatingPrimitive, RatingItem as RatingItemPrimitive } from "@ui-sdk/react/rating";
2
+ import type * as React from "react";
3
+ type RatingProps = React.ComponentProps<typeof RatingPrimitive> & {
4
+ size?: "sm" | "md" | "lg";
5
+ };
6
+ declare function Rating({ size, className, children, ...props }: RatingProps): React.JSX.Element;
7
+ /** One star. Rating repeats it; pass children to draw a different symbol. */
8
+ declare function RatingItem({ className, children, ...props }: React.ComponentProps<typeof RatingItemPrimitive>): React.JSX.Element;
9
+ export { Rating, RatingItem };
10
+ export type { RatingProps };
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Rating as RatingPrimitive, RatingItem as RatingItemPrimitive } from "@ui-sdk/react/rating";
3
+ import { cx } from "../lib/cx.js";
4
+ const star = "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z";
5
+ function Rating({ size = "md", className, children, ...props }) {
6
+ return (_jsx(RatingPrimitive, { "data-size": size, className: cx("mb-rating", className), ...props, children: children ?? _jsx(RatingItem, {}) }));
7
+ }
8
+ /** One star. Rating repeats it; pass children to draw a different symbol. */
9
+ function RatingItem({ className, children, ...props }) {
10
+ return (_jsx(RatingItemPrimitive, { className: cx("mb-rating-item", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", className: "mb-rating-symbol", "data-part": "empty", children: _jsx("path", { d: star }) }), _jsx("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", className: "mb-rating-symbol", "data-part": "fill", children: _jsx("path", { d: star }) })] })) }));
11
+ }
12
+ export { Rating, RatingItem };
@@ -0,0 +1,28 @@
1
+ import { Collapsible, CollapsiblePanel, CollapsibleTrigger } from "@ui-sdk/react/collapsible";
2
+ import * as React from "react";
3
+ type ReasoningState = "running" | "done";
4
+ /** Seconds as people say them: `12s`, `2m 1s`, `1h 4m`. */
5
+ declare function formatDuration(seconds: number): string;
6
+ type ReasoningProps = React.ComponentProps<typeof Collapsible> & {
7
+ /** `running` shimmers "Thinking…"; `done` says how long it took. */
8
+ state?: ReasoningState;
9
+ /** How long the model worked, in seconds. */
10
+ duration?: number;
11
+ /** Opens while running and closes when `state` turns `done`. Only when uncontrolled. */
12
+ autoCollapse?: boolean;
13
+ /** A soft moving glow behind the line while running. It holds still under Reduce Motion. */
14
+ glow?: boolean;
15
+ };
16
+ declare function Reasoning({ state, duration, autoCollapse, glow, open, defaultOpen, onOpenChange, className, ...props }: ReasoningProps): React.JSX.Element;
17
+ type ReasoningTriggerProps = Omit<React.ComponentProps<typeof CollapsibleTrigger>, "children"> & {
18
+ /** Replaces the label. It still shimmers while running. */
19
+ children?: React.ReactNode;
20
+ };
21
+ /** The line itself: "Thinking…" while running, then "Thought for 12s", with a chevron that turns down when open. */
22
+ declare function ReasoningTrigger({ className, children, ...props }: ReasoningTriggerProps): React.JSX.Element;
23
+ /** The reasoning text or steps, behind a leading hairline. */
24
+ declare function ReasoningContent({ className, children, ...props }: Omit<React.ComponentProps<typeof CollapsiblePanel>, "children"> & {
25
+ children?: React.ReactNode;
26
+ }): React.JSX.Element;
27
+ export { formatDuration, Reasoning, ReasoningContent, ReasoningTrigger };
28
+ export type { ReasoningProps, ReasoningState, ReasoningTriggerProps };
@@ -0,0 +1,52 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Collapsible, CollapsiblePanel, CollapsibleTrigger } from "@ui-sdk/react/collapsible";
4
+ import * as React from "react";
5
+ import { DisclosureChevron } from "../lib/agent-glyphs.js";
6
+ import { cx } from "../lib/cx.js";
7
+ import { Shimmer } from "./shimmer.js";
8
+ const ReasoningContext = React.createContext({ state: "done", duration: undefined });
9
+ /** Seconds as people say them: `12s`, `2m 1s`, `1h 4m`. */
10
+ function formatDuration(seconds) {
11
+ const total = Math.max(0, Math.round(seconds));
12
+ if (total < 60)
13
+ return `${total}s`;
14
+ const hours = Math.floor(total / 3600);
15
+ const minutes = Math.floor((total % 3600) / 60);
16
+ const rest = total % 60;
17
+ if (hours > 0)
18
+ return minutes > 0 ? `${hours}h ${minutes}m` : `${hours}h`;
19
+ return rest > 0 ? `${minutes}m ${rest}s` : `${minutes}m`;
20
+ }
21
+ function Reasoning({ state = "done", duration, autoCollapse, glow, open, defaultOpen, onOpenChange, className, ...props }) {
22
+ const [ownOpen, setOwnOpen] = React.useState(defaultOpen ?? (autoCollapse ? state === "running" : false));
23
+ const previous = React.useRef(state);
24
+ React.useEffect(() => {
25
+ if (!autoCollapse || previous.current === state)
26
+ return;
27
+ previous.current = state;
28
+ setOwnOpen(state === "running");
29
+ }, [autoCollapse, state]);
30
+ const context = React.useMemo(() => ({ state, duration }), [state, duration]);
31
+ return (_jsx(ReasoningContext.Provider, { value: context, children: _jsx(Collapsible, { "data-state": state, "data-glow": glow ? "" : undefined, "aria-busy": state === "running" ? true : undefined, open: open ?? ownOpen, onOpenChange: (next, details) => {
32
+ onOpenChange?.(next, details);
33
+ if (open === undefined && !details.canceled)
34
+ setOwnOpen(next);
35
+ }, className: cx("mb-reasoning", className), ...props }) }));
36
+ }
37
+ /** The line itself: "Thinking…" while running, then "Thought for 12s", with a chevron that turns down when open. */
38
+ function ReasoningTrigger({ className, children, ...props }) {
39
+ const { state, duration } = React.useContext(ReasoningContext);
40
+ const label = children ??
41
+ (state === "running"
42
+ ? "Thinking…"
43
+ : duration !== undefined
44
+ ? `Thought for ${formatDuration(duration)}`
45
+ : "Thought for a few seconds");
46
+ return (_jsxs(CollapsibleTrigger, { className: cx("mb-reasoning-trigger", className), ...props, children: [_jsx(Shimmer, { active: state === "running", className: "mb-reasoning-label", children: label }), _jsx(DisclosureChevron, { className: "mb-reasoning-chevron" })] }));
47
+ }
48
+ /** The reasoning text or steps, behind a leading hairline. */
49
+ function ReasoningContent({ className, children, ...props }) {
50
+ return (_jsx(CollapsiblePanel, { className: cx("mb-reasoning-panel", className), ...props, children: _jsx("div", { className: "mb-reasoning-content", children: children }) }));
51
+ }
52
+ export { formatDuration, Reasoning, ReasoningContent, ReasoningTrigger };
@@ -0,0 +1,14 @@
1
+ import type * as React from "react";
2
+ type ResponseProps = React.ComponentProps<"div"> & {
3
+ /** Set while the reply is still arriving. Pair it with a `ResponseCaret` at the end. */
4
+ streaming?: boolean;
5
+ };
6
+ /**
7
+ * Typography for the assistant's reply. It styles the elements you give it —
8
+ * paragraphs, headings, lists, tables, code — and leaves nested macbetter components alone.
9
+ */
10
+ declare function Response({ streaming, className, ...props }: ResponseProps): React.JSX.Element;
11
+ /** The blinking mark at the end of a reply that's still streaming. It holds still under Reduce Motion. */
12
+ declare function ResponseCaret({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
13
+ export { Response, ResponseCaret };
14
+ export type { ResponseProps };
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { join } from "../lib/cx.js";
3
+ /**
4
+ * Typography for the assistant's reply. It styles the elements you give it —
5
+ * paragraphs, headings, lists, tables, code — and leaves nested macbetter components alone.
6
+ */
7
+ function Response({ streaming, className, ...props }) {
8
+ return (_jsx("div", { "data-streaming": streaming ? "" : undefined, "aria-busy": streaming || undefined, className: join("mb-response", className), ...props }));
9
+ }
10
+ /** The blinking mark at the end of a reply that's still streaming. It holds still under Reduce Motion. */
11
+ function ResponseCaret({ className, ...props }) {
12
+ return _jsx("span", { "aria-hidden": "true", className: join("mb-response-caret", className), ...props });
13
+ }
14
+ export { Response, ResponseCaret };
@@ -0,0 +1,22 @@
1
+ import { Button as ButtonPrimitive } from "@ui-sdk/react/button";
2
+ import type * as React from "react";
3
+ type SceneTileProps = React.ComponentProps<typeof ButtonPrimitive> & {
4
+ icon?: React.ReactNode;
5
+ /** The scene's name. Children work too. */
6
+ name?: React.ReactNode;
7
+ /** Every accessory in the scene is set the way the scene sets it. */
8
+ active?: boolean;
9
+ /** The scene is running: its accessories are still changing. */
10
+ running?: boolean;
11
+ size?: "sm" | "md";
12
+ /** What assistive tech hears for `active`, in the page's language. */
13
+ activeLabel?: string;
14
+ /** Art behind the tile for the scene's mood, like `<Artwork variant="horizon" time="dawn" />`. Decorative. */
15
+ background?: React.ReactNode;
16
+ };
17
+ /** Runs a scene: a group of actions, like Good Morning or Movie Time. */
18
+ declare function SceneTile({ icon, name, active, running, size, activeLabel, background, className, children, ...props }: SceneTileProps): React.JSX.Element;
19
+ /** The Home tab's row of scenes: it scrolls sideways on iPhone and wraps on iPad and Mac. Name it with `aria-label`. */
20
+ declare function SceneRow({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
21
+ export { SceneRow, SceneTile };
22
+ export type { SceneTileProps };
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button as ButtonPrimitive } from "@ui-sdk/react/button";
3
+ import { cx, join } from "../lib/cx.js";
4
+ import { ActivityIndicator } from "./activity-indicator.js";
5
+ /** Runs a scene: a group of actions, like Good Morning or Movie Time. */
6
+ function SceneTile({ icon, name, active, running, size = "md", activeLabel = "On", background, className, children, ...props }) {
7
+ return (_jsxs(ButtonPrimitive, { "data-size": size, "data-active": active ? "" : undefined, "data-running": running ? "" : undefined, "data-background": background ? "" : undefined, "aria-busy": running ? true : undefined, className: cx("mb-scene-tile", className), ...props, children: [background ? (_jsx("span", { className: "mb-scene-tile-background", "aria-hidden": "true", children: background })) : null, _jsx("span", { className: "mb-scene-tile-icon", "aria-hidden": "true", children: running ? _jsx(ActivityIndicator, { size: "sm", "aria-hidden": "true", className: "mb-scene-tile-spinner" }) : icon }), _jsx("span", { className: "mb-scene-tile-name", children: name ?? children }), active ? _jsx("span", { className: "mb-visually-hidden", children: `, ${activeLabel}` }) : null] }));
8
+ }
9
+ /** The Home tab's row of scenes: it scrolls sideways on iPhone and wraps on iPad and Mac. Name it with `aria-label`. */
10
+ function SceneRow({ className, ...props }) {
11
+ return _jsx("div", { role: "group", className: join("mb-scene-row", className), ...props });
12
+ }
13
+ export { SceneRow, SceneTile };
@@ -0,0 +1,21 @@
1
+ import { ScrollArea, ScrollAreaViewport } from "@ui-sdk/react/scroll-area";
2
+ import type * as React from "react";
3
+ type ScrollViewOrientation = "vertical" | "horizontal" | "both";
4
+ type ScrollViewProps = Omit<React.ComponentProps<typeof ScrollArea>, "children"> & {
5
+ children?: React.ReactNode;
6
+ /** The axes that scroll. */
7
+ orientation?: ScrollViewOrientation;
8
+ /** Fades content out at an edge while there's more to scroll that way. */
9
+ fade?: boolean;
10
+ /** `bordered` frames the view with a hairline, like a macOS table or text view. */
11
+ variant?: "plain" | "bordered";
12
+ /** Props for the element that scrolls, like `tabIndex` or `onScroll`. */
13
+ viewportProps?: React.ComponentProps<typeof ScrollAreaViewport>;
14
+ };
15
+ /**
16
+ * A scrolling region with Apple's overlay scrollbars: a thin thumb that shows
17
+ * while you scroll or point at it, and widens under the pointer on macOS.
18
+ */
19
+ declare function ScrollView({ orientation, fade, variant, type, className, children, viewportProps, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }: ScrollViewProps): React.JSX.Element;
20
+ export { ScrollView };
21
+ export type { ScrollViewOrientation, ScrollViewProps };
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, } from "@ui-sdk/react/scroll-area";
3
+ import { cx } from "../lib/cx.js";
4
+ /**
5
+ * A scrolling region with Apple's overlay scrollbars: a thin thumb that shows
6
+ * while you scroll or point at it, and widens under the pointer on macOS.
7
+ */
8
+ function ScrollView({ orientation = "vertical", fade = true, variant = "plain", type = "hover", className, children, viewportProps, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props }) {
9
+ const named = ariaLabel !== undefined || ariaLabelledby !== undefined;
10
+ const { className: viewportClassName, ...viewportRest } = viewportProps ?? {};
11
+ return (_jsxs(ScrollArea, { type: type, "data-orientation": orientation, "data-fade": fade ? "" : undefined, "data-variant": variant, className: cx("mb-scroll-view", className), ...props, children: [_jsx(ScrollAreaViewport, { role: named ? "region" : undefined, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, className: cx("mb-scroll-view-viewport", viewportClassName), ...viewportRest, children: _jsx(ScrollAreaContent, { className: "mb-scroll-view-content", children: children }) }), orientation !== "horizontal" ? (_jsx(ScrollAreaScrollbar, { orientation: "vertical", className: "mb-scroll-view-scrollbar", children: _jsx(ScrollAreaThumb, { className: "mb-scroll-view-thumb" }) })) : null, orientation !== "vertical" ? (_jsx(ScrollAreaScrollbar, { orientation: "horizontal", className: "mb-scroll-view-scrollbar", children: _jsx(ScrollAreaThumb, { className: "mb-scroll-view-thumb" }) })) : null, orientation === "both" ? _jsx(ScrollAreaCorner, { className: "mb-scroll-view-corner" }) : null] }));
12
+ }
13
+ export { ScrollView };
@@ -0,0 +1,16 @@
1
+ import { Input } from "@ui-sdk/react/input";
2
+ import type * as React from "react";
3
+ type SearchFieldProps = Omit<React.ComponentProps<typeof Input>, "size"> & {
4
+ size?: "sm" | "md" | "lg";
5
+ /** The clear button's name. */
6
+ clearLabel?: string;
7
+ /** Class for the field's box, which holds the glyph, the input and the clear button. */
8
+ groupClassName?: string;
9
+ };
10
+ /**
11
+ * The Apple search field: a magnifier, a "Search" prompt and a clear button.
12
+ * A rounded rectangle on macOS, a gray capsule on touch. Props go to the input.
13
+ */
14
+ declare function SearchField({ size, clearLabel, placeholder, groupClassName, className, ...props }: SearchFieldProps): React.JSX.Element;
15
+ export { SearchField };
16
+ export type { SearchFieldProps };
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Input, InputClear, InputGroup } from "@ui-sdk/react/input";
3
+ import { cx, join } from "../lib/cx.js";
4
+ import { ClearGlyph, MagnifierGlyph } from "../lib/field-glyphs.js";
5
+ /**
6
+ * The Apple search field: a magnifier, a "Search" prompt and a clear button.
7
+ * A rounded rectangle on macOS, a gray capsule on touch. Props go to the input.
8
+ */
9
+ function SearchField({ size = "md", clearLabel = "Clear search", placeholder = "Search", groupClassName, className, ...props }) {
10
+ return (_jsxs(InputGroup, { "data-size": size, className: join("mb-search-field", groupClassName), children: [_jsx(MagnifierGlyph, { className: "mb-search-field-glyph" }), _jsx(Input, { type: "search", placeholder: placeholder, enterKeyHint: "search", className: cx("mb-search-field-input", className), ...props }), _jsx(InputClear, { "aria-label": clearLabel, className: "mb-search-field-clear", children: _jsx(ClearGlyph, {}) })] }));
11
+ }
12
+ export { SearchField };
@@ -0,0 +1,23 @@
1
+ import { PasswordInput, PasswordInputControl, PasswordInputToggle } from "@ui-sdk/react/password-input";
2
+ import type * as React from "react";
3
+ type SecureFieldProps = React.ComponentProps<typeof PasswordInput> & {
4
+ size?: "sm" | "md" | "lg";
5
+ /** `auto` is bordered on macOS and filled on touch, like `TextField`. */
6
+ variant?: "auto" | "bordered" | "filled" | "plain";
7
+ placeholder?: string;
8
+ /** Shows the eye button that reveals the password. */
9
+ toggle?: boolean;
10
+ /** The toggle's name. */
11
+ toggleLabel?: string;
12
+ };
13
+ /**
14
+ * A password field with a show and hide button. Form options go on the root;
15
+ * `placeholder`, `id`, `autoFocus` and ARIA names go to the input. Pass
16
+ * children to compose `SecureFieldInput` and `SecureFieldToggle` yourself.
17
+ */
18
+ declare function SecureField({ size, variant, placeholder, toggle, toggleLabel, id, autoFocus, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, className, children, ...props }: SecureFieldProps): React.JSX.Element;
19
+ declare function SecureFieldInput({ className, ...props }: React.ComponentProps<typeof PasswordInputControl>): React.JSX.Element;
20
+ /** The eye button. It shows eye.slash while the password is visible. */
21
+ declare function SecureFieldToggle({ className, children, "aria-label": label, ...props }: React.ComponentProps<typeof PasswordInputToggle>): React.JSX.Element;
22
+ export { SecureField, SecureFieldInput, SecureFieldToggle };
23
+ export type { SecureFieldProps };
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { PasswordInput, PasswordInputControl, PasswordInputToggle, } from "@ui-sdk/react/password-input";
4
+ import { cx } from "../lib/cx.js";
5
+ import { EyeGlyph, EyeSlashGlyph } from "../lib/field-glyphs.js";
6
+ /**
7
+ * A password field with a show and hide button. Form options go on the root;
8
+ * `placeholder`, `id`, `autoFocus` and ARIA names go to the input. Pass
9
+ * children to compose `SecureFieldInput` and `SecureFieldToggle` yourself.
10
+ */
11
+ function SecureField({ size = "md", variant = "auto", placeholder, toggle = true, toggleLabel = "Show password", id, autoFocus, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, className, children, ...props }) {
12
+ return (_jsx(PasswordInput, { "data-size": size, "data-variant": variant, className: cx("mb-secure-field", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(SecureFieldInput, { id: id, autoFocus: autoFocus, placeholder: placeholder, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy }), toggle ? _jsx(SecureFieldToggle, { "aria-label": toggleLabel }) : null] })) }));
13
+ }
14
+ function SecureFieldInput({ className, ...props }) {
15
+ return _jsx(PasswordInputControl, { className: cx("mb-secure-field-input", className), ...props });
16
+ }
17
+ /** The eye button. It shows eye.slash while the password is visible. */
18
+ function SecureFieldToggle({ className, children, "aria-label": label = "Show password", ...props }) {
19
+ return (_jsx(PasswordInputToggle, { "aria-label": label, className: cx("mb-secure-field-toggle", className), ...props, children: children ?? ((state) => (state.visible ? _jsx(EyeSlashGlyph, {}) : _jsx(EyeGlyph, {}))) }));
20
+ }
21
+ export { SecureField, SecureFieldInput, SecureFieldToggle };
@@ -0,0 +1,12 @@
1
+ import { SegmentedControl as SegmentedControlPrimitive, SegmentedControlItem as SegmentedControlItemPrimitive } from "@ui-sdk/react/segmented-control";
2
+ import type * as React from "react";
3
+ type SegmentedControlProps = Omit<React.ComponentProps<typeof SegmentedControlPrimitive>, "children"> & {
4
+ children?: React.ReactNode;
5
+ size?: "sm" | "md" | "lg";
6
+ /** Stretches across the container with equal-width segments. */
7
+ block?: boolean;
8
+ };
9
+ declare function SegmentedControl({ size, block, className, children, ...props }: SegmentedControlProps): React.JSX.Element;
10
+ declare function SegmentedControlItem({ className, ...props }: React.ComponentProps<typeof SegmentedControlItemPrimitive>): React.JSX.Element;
11
+ export { SegmentedControl, SegmentedControlItem };
12
+ export type { SegmentedControlProps };
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SegmentedControl as SegmentedControlPrimitive, SegmentedControlIndicator, SegmentedControlItem as SegmentedControlItemPrimitive, } from "@ui-sdk/react/segmented-control";
3
+ import { cx } from "../lib/cx.js";
4
+ function SegmentedControl({ size = "md", block, className, children, ...props }) {
5
+ return (_jsxs(SegmentedControlPrimitive, { "data-size": size, "data-block": block ? "" : undefined, className: cx("mb-segmented-control", className), ...props, children: [_jsx(SegmentedControlIndicator, { className: "mb-segmented-control-indicator" }), children] }));
6
+ }
7
+ function SegmentedControlItem({ className, ...props }) {
8
+ return _jsx(SegmentedControlItemPrimitive, { className: cx("mb-segmented-control-item", className), ...props });
9
+ }
10
+ export { SegmentedControl, SegmentedControlItem };
@@ -0,0 +1,45 @@
1
+ import { createSelectController, SelectClear as SelectClearPrimitive, SelectContent as SelectContentPrimitive, SelectEmpty as SelectEmptyPrimitive, SelectGroup as SelectGroupPrimitive, SelectGroupLabel as SelectGroupLabelPrimitive, SelectInput as SelectInputPrimitive, SelectItem as SelectItemPrimitive, SelectItemIcon as SelectItemIconPrimitive, SelectItemIndicator as SelectItemIndicatorPrimitive, SelectItems, SelectItemText as SelectItemTextPrimitive, SelectLabel as SelectLabelPrimitive, SelectList as SelectListPrimitive, SelectSeparator as SelectSeparatorPrimitive, SelectStatus as SelectStatusPrimitive, SelectTrigger as SelectTriggerPrimitive, SelectValue as SelectValuePrimitive, SelectValueIcon as SelectValueIconPrimitive } from "@ui-sdk/react/select";
2
+ import type { ListData, SelectProps } from "@ui-sdk/react/select";
3
+ import * as React from "react";
4
+ declare function Select<T = string, Multiple extends boolean | undefined = false>(props: SelectProps<T, Multiple>): React.JSX.Element;
5
+ type SelectTriggerVariant = "auto" | "bezeled" | "plain";
6
+ type SelectTriggerProps = Omit<React.ComponentProps<typeof SelectTriggerPrimitive>, "children"> & {
7
+ children?: React.ReactNode;
8
+ /**
9
+ * `bezeled` is the Mac's pop-up button; `plain` is the iOS menu picker: accent text and an
10
+ * up-and-down chevron. `auto` picks the one that fits the platform.
11
+ */
12
+ variant?: SelectTriggerVariant;
13
+ size?: "sm" | "md" | "lg";
14
+ };
15
+ /** The pop-up button. Shows the value and renders its own chevron cap; put a `SelectValue` inside. */
16
+ declare function SelectTrigger({ variant, size, className, children, onPointerDown, onFocus, ...props }: SelectTriggerProps): React.JSX.Element;
17
+ declare function SelectValue({ className, ...props }: React.ComponentProps<typeof SelectValuePrimitive>): React.JSX.Element;
18
+ declare function SelectValueIcon({ className, ...props }: React.ComponentProps<typeof SelectValueIconPrimitive>): React.JSX.Element;
19
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectLabelPrimitive>): React.JSX.Element;
20
+ type SelectContentProps = Omit<React.ComponentProps<typeof SelectContentPrimitive>, "alignItemWithTrigger"> & {
21
+ /**
22
+ * Open over the trigger with the selected item on top of it. `auto` does that on the Mac only;
23
+ * iOS and iPadOS menus open from the button.
24
+ */
25
+ alignItemWithTrigger?: boolean | "auto";
26
+ };
27
+ /** The menu. On the Mac it opens over the trigger with the selected item on top of it. */
28
+ declare function SelectContent({ alignItemWithTrigger, sideOffset, className, ...props }: SelectContentProps): React.JSX.Element;
29
+ declare function SelectList({ className, ...props }: React.ComponentProps<typeof SelectListPrimitive>): React.JSX.Element;
30
+ /** An option. Renders its own checkmark in the leading column. */
31
+ declare function SelectItem<T = string>({ className, children, ...props }: Omit<React.ComponentProps<typeof SelectItemPrimitive<T>>, "children"> & {
32
+ children?: React.ReactNode;
33
+ }): React.JSX.Element;
34
+ declare function SelectItemIndicator({ keepMounted, className, children, ...props }: React.ComponentProps<typeof SelectItemIndicatorPrimitive>): React.JSX.Element;
35
+ declare function SelectItemIcon({ className, ...props }: React.ComponentProps<typeof SelectItemIconPrimitive>): React.JSX.Element;
36
+ declare function SelectItemText({ className, ...props }: React.ComponentProps<typeof SelectItemTextPrimitive>): React.JSX.Element;
37
+ declare function SelectGroup({ className, ...props }: React.ComponentProps<typeof SelectGroupPrimitive>): React.JSX.Element;
38
+ declare function SelectGroupLabel({ className, ...props }: React.ComponentProps<typeof SelectGroupLabelPrimitive>): React.JSX.Element;
39
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectSeparatorPrimitive>): React.JSX.Element;
40
+ declare function SelectInput({ className, ...props }: React.ComponentProps<typeof SelectInputPrimitive>): React.JSX.Element;
41
+ declare function SelectEmpty({ className, ...props }: React.ComponentProps<typeof SelectEmptyPrimitive>): React.JSX.Element;
42
+ declare function SelectStatus({ className, ...props }: React.ComponentProps<typeof SelectStatusPrimitive>): React.JSX.Element;
43
+ declare function SelectClear({ className, ...props }: React.ComponentProps<typeof SelectClearPrimitive>): React.JSX.Element;
44
+ export { createSelectController, Select, SelectClear, SelectContent, SelectEmpty, SelectGroup, SelectGroupLabel, SelectInput, SelectItem, SelectItemIcon, SelectItemIndicator, SelectItems, SelectItemText, SelectLabel, SelectList, SelectSeparator, SelectStatus, SelectTrigger, SelectValue, SelectValueIcon, };
45
+ export type { ListData, SelectContentProps, SelectProps, SelectTriggerProps, SelectTriggerVariant };