altitude-design 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/README.md +46 -8
  2. package/dist/adapters/codemirror.cjs +88 -0
  3. package/dist/adapters/codemirror.cjs.map +7 -0
  4. package/dist/adapters/codemirror.js +67 -0
  5. package/dist/adapters/codemirror.js.map +7 -0
  6. package/dist/adapters/react-flow.css +102 -0
  7. package/dist/adapters/tiptap.css +71 -0
  8. package/dist/altitude.css +3165 -246
  9. package/dist/altitude.iife.js +33 -5
  10. package/dist/altitude.no-fonts.css +3165 -246
  11. package/dist/chart-themes.cjs +195 -0
  12. package/dist/chart-themes.cjs.map +7 -0
  13. package/dist/chart-themes.js +165 -0
  14. package/dist/chart-themes.js.map +7 -0
  15. package/dist/cli/altitude.mjs +134 -0
  16. package/dist/guidance/README.md +32 -0
  17. package/dist/guidance/agent-setup.md +22 -0
  18. package/dist/guidance/app-skeleton.md +17 -0
  19. package/dist/guidance/evidence.json +95 -0
  20. package/dist/guidance/index.json +493 -0
  21. package/dist/guidance/llms.txt +20 -0
  22. package/dist/guidance/manifest.json +92 -0
  23. package/dist/guidance/pattern.schema.json +181 -0
  24. package/dist/guidance/patterns/agent-action.json +77 -0
  25. package/dist/guidance/patterns/agent-action.md +39 -0
  26. package/dist/guidance/patterns/assistant-conversation.json +77 -0
  27. package/dist/guidance/patterns/assistant-conversation.md +50 -0
  28. package/dist/guidance/patterns/async-collection.json +71 -0
  29. package/dist/guidance/patterns/async-collection.md +29 -0
  30. package/dist/guidance/patterns/audit-log.json +75 -0
  31. package/dist/guidance/patterns/audit-log.md +27 -0
  32. package/dist/guidance/patterns/auth.json +86 -0
  33. package/dist/guidance/patterns/auth.md +29 -0
  34. package/dist/guidance/patterns/billing.json +80 -0
  35. package/dist/guidance/patterns/billing.md +29 -0
  36. package/dist/guidance/patterns/consequential-action.json +76 -0
  37. package/dist/guidance/patterns/consequential-action.md +27 -0
  38. package/dist/guidance/patterns/developer-settings.json +79 -0
  39. package/dist/guidance/patterns/developer-settings.md +29 -0
  40. package/dist/guidance/patterns/edit-record.json +74 -0
  41. package/dist/guidance/patterns/edit-record.md +51 -0
  42. package/dist/guidance/patterns/import.json +77 -0
  43. package/dist/guidance/patterns/import.md +31 -0
  44. package/dist/guidance/patterns/members.json +77 -0
  45. package/dist/guidance/patterns/members.md +27 -0
  46. package/dist/guidance/patterns/onboarding.json +78 -0
  47. package/dist/guidance/patterns/onboarding.md +31 -0
  48. package/dist/guidance/patterns/review-submit.json +72 -0
  49. package/dist/guidance/patterns/review-submit.md +27 -0
  50. package/dist/guidance/patterns/screen-layout.json +79 -0
  51. package/dist/guidance/patterns/screen-layout.md +40 -0
  52. package/dist/guidance/patterns/settings.json +78 -0
  53. package/dist/guidance/patterns/settings.md +32 -0
  54. package/dist/guidance/patterns/sync.json +77 -0
  55. package/dist/guidance/patterns/sync.md +31 -0
  56. package/dist/guidance/principles.md +23 -0
  57. package/dist/guidance/references/build/checks/agent-action-pattern.mjs +57 -0
  58. package/dist/guidance/references/build/checks/agent-setup.mjs +78 -0
  59. package/dist/guidance/references/build/checks/assistant-conversation-pattern.mjs +49 -0
  60. package/dist/guidance/references/build/checks/audit-log-pattern.mjs +63 -0
  61. package/dist/guidance/references/build/checks/auth-pattern.mjs +67 -0
  62. package/dist/guidance/references/build/checks/billing-pattern.mjs +63 -0
  63. package/dist/guidance/references/build/checks/developer-settings-pattern.mjs +76 -0
  64. package/dist/guidance/references/build/checks/guidance.mjs +71 -0
  65. package/dist/guidance/references/build/checks/import-pattern.mjs +69 -0
  66. package/dist/guidance/references/build/checks/members-pattern.mjs +71 -0
  67. package/dist/guidance/references/build/checks/onboarding-pattern.mjs +54 -0
  68. package/dist/guidance/references/build/checks/pattern-types.mjs +13 -0
  69. package/dist/guidance/references/build/checks/pattern-workflows.mjs +226 -0
  70. package/dist/guidance/references/build/checks/primary-scope.mjs +49 -0
  71. package/dist/guidance/references/build/checks/render-tells.mjs +72 -0
  72. package/dist/guidance/references/build/checks/screen-layout-pattern.mjs +111 -0
  73. package/dist/guidance/references/build/checks/semantics.mjs +72 -0
  74. package/dist/guidance/references/build/checks/settings-pattern.mjs +73 -0
  75. package/dist/guidance/references/build/checks/sync-pattern.mjs +62 -0
  76. package/dist/guidance/references/build/checks/tells-lint.mjs +164 -0
  77. package/dist/guidance/references/build/fixtures/pattern-workflows.tsx +83 -0
  78. package/dist/guidance/references/build/fixtures/patterns/agent-action.jsx +60 -0
  79. package/dist/guidance/references/build/fixtures/patterns/app-skeleton.jsx +94 -0
  80. package/dist/guidance/references/build/fixtures/patterns/assistant-conversation.jsx +79 -0
  81. package/dist/guidance/references/build/fixtures/patterns/audit-log.jsx +81 -0
  82. package/dist/guidance/references/build/fixtures/patterns/auth.jsx +150 -0
  83. package/dist/guidance/references/build/fixtures/patterns/billing.jsx +96 -0
  84. package/dist/guidance/references/build/fixtures/patterns/developer-settings.jsx +95 -0
  85. package/dist/guidance/references/build/fixtures/patterns/import.jsx +102 -0
  86. package/dist/guidance/references/build/fixtures/patterns/members.jsx +106 -0
  87. package/dist/guidance/references/build/fixtures/patterns/onboarding.jsx +70 -0
  88. package/dist/guidance/references/build/fixtures/patterns/screen-layout-decision.jsx +74 -0
  89. package/dist/guidance/references/build/fixtures/patterns/screen-layout-editor.jsx +56 -0
  90. package/dist/guidance/references/build/fixtures/patterns/screen-layout-report.jsx +42 -0
  91. package/dist/guidance/references/build/fixtures/patterns/settings.jsx +73 -0
  92. package/dist/guidance/references/build/fixtures/patterns/sync.jsx +78 -0
  93. package/dist/guidance/references/project/components/src/pattern-async-collection.tsx +57 -0
  94. package/dist/guidance/references/project/components/src/pattern-consequential-action.tsx +77 -0
  95. package/dist/guidance/references/project/components/src/pattern-edit-record.tsx +127 -0
  96. package/dist/guidance/references/project/components/src/pattern-review-submit.tsx +47 -0
  97. package/dist/guidance/references/project/components/src/settings.tsx +79 -0
  98. package/dist/guidance/references/scripts/build-framework-fixture.mjs +20 -0
  99. package/dist/guidance/rules.json +653 -0
  100. package/dist/guidance/visual/Elevation.md +194 -0
  101. package/dist/guidance/visual/Fundamentals.md +83 -0
  102. package/dist/guidance/visual/Research.md +1620 -0
  103. package/dist/index.cjs +19009 -1854
  104. package/dist/index.cjs.map +4 -4
  105. package/dist/index.js +19009 -1854
  106. package/dist/index.js.map +4 -4
  107. package/dist/tokens.css +84 -84
  108. package/dist/tokens.json +301 -128
  109. package/dist/types/adapter-codemirror.d.ts +13 -0
  110. package/dist/types/agent-fleet.d.ts +166 -0
  111. package/dist/types/ai-label.d.ts +30 -0
  112. package/dist/types/app-shell.d.ts +83 -0
  113. package/dist/types/area-chart.d.ts +80 -0
  114. package/dist/types/artifact.d.ts +65 -0
  115. package/dist/types/bar-chart.d.ts +83 -0
  116. package/dist/types/bar-list.d.ts +35 -0
  117. package/dist/types/breadcrumb.d.ts +62 -0
  118. package/dist/types/chart-brush.d.ts +35 -0
  119. package/dist/types/chart-themes.d.ts +229 -0
  120. package/dist/types/chart.d.ts +570 -0
  121. package/dist/types/checklist.d.ts +71 -0
  122. package/dist/types/code-block.d.ts +32 -0
  123. package/dist/types/collections.d.ts +116 -5
  124. package/dist/types/color-picker.d.ts +38 -0
  125. package/dist/types/command.d.ts +6 -3
  126. package/dist/types/comment-thread.d.ts +48 -0
  127. package/dist/types/confirmation.d.ts +60 -0
  128. package/dist/types/context-menu.d.ts +17 -0
  129. package/dist/types/controls.d.ts +134 -22
  130. package/dist/types/conversation.d.ts +130 -0
  131. package/dist/types/copy-button.d.ts +19 -0
  132. package/dist/types/core.d.ts +139 -10
  133. package/dist/types/data-grid.d.ts +76 -0
  134. package/dist/types/date-picker.d.ts +96 -0
  135. package/dist/types/diff-view.d.ts +54 -0
  136. package/dist/types/dot-plot.d.ts +54 -0
  137. package/dist/types/edit-region.d.ts +121 -0
  138. package/dist/types/feature-gate.d.ts +22 -0
  139. package/dist/types/filter-bar.d.ts +65 -0
  140. package/dist/types/formatted-number.d.ts +38 -0
  141. package/dist/types/heatmap.d.ts +64 -0
  142. package/dist/types/in-place.d.ts +24 -0
  143. package/dist/types/index.d.ts +159 -14
  144. package/dist/types/inline-citation.d.ts +35 -0
  145. package/dist/types/inline-edit.d.ts +71 -0
  146. package/dist/types/input-otp.d.ts +37 -0
  147. package/dist/types/item-group.d.ts +104 -0
  148. package/dist/types/line-chart.d.ts +116 -0
  149. package/dist/types/link.d.ts +11 -0
  150. package/dist/types/markdown.d.ts +88 -0
  151. package/dist/types/meter.d.ts +43 -0
  152. package/dist/types/modal-state.d.ts +62 -0
  153. package/dist/types/nav.d.ts +8 -1
  154. package/dist/types/notifications.d.ts +42 -0
  155. package/dist/types/number-input.d.ts +30 -0
  156. package/dist/types/overlays.d.ts +56 -15
  157. package/dist/types/page-header.d.ts +27 -0
  158. package/dist/types/pagination.d.ts +29 -0
  159. package/dist/types/palette.d.ts +64 -0
  160. package/dist/types/password-input.d.ts +22 -0
  161. package/dist/types/pattern-assistant-conversation.d.ts +55 -0
  162. package/dist/types/pattern-async-collection.d.ts +34 -0
  163. package/dist/types/pattern-consequential-action.d.ts +53 -0
  164. package/dist/types/pattern-edit-record.d.ts +72 -0
  165. package/dist/types/pattern-review-submit.d.ts +43 -0
  166. package/dist/types/permission-matrix.d.ts +34 -0
  167. package/dist/types/plan-picker.d.ts +40 -0
  168. package/dist/types/prompt-input.d.ts +106 -0
  169. package/dist/types/property-list.d.ts +67 -0
  170. package/dist/types/question.d.ts +64 -0
  171. package/dist/types/relative-time.d.ts +21 -0
  172. package/dist/types/removal-receipt.d.ts +1180 -0
  173. package/dist/types/resizable.d.ts +48 -0
  174. package/dist/types/roving.d.ts +44 -0
  175. package/dist/types/save-bar.d.ts +38 -0
  176. package/dist/types/saved-views.d.ts +72 -0
  177. package/dist/types/scatter-chart.d.ts +60 -0
  178. package/dist/types/schedule.d.ts +80 -0
  179. package/dist/types/secret-field.d.ts +33 -0
  180. package/dist/types/select.d.ts +44 -2
  181. package/dist/types/separator.d.ts +11 -0
  182. package/dist/types/settings.d.ts +39 -0
  183. package/dist/types/sheet.d.ts +1 -1
  184. package/dist/types/sparkline.d.ts +46 -0
  185. package/dist/types/split-button.d.ts +21 -0
  186. package/dist/types/stat.d.ts +54 -0
  187. package/dist/types/stepper.d.ts +6 -3
  188. package/dist/types/suggestions.d.ts +29 -0
  189. package/dist/types/suspense.d.ts +85 -0
  190. package/dist/types/sync-indicator.d.ts +24 -0
  191. package/dist/types/tag-input.d.ts +65 -0
  192. package/dist/types/terminal.d.ts +33 -0
  193. package/dist/types/thread-list.d.ts +58 -0
  194. package/dist/types/time-input.d.ts +33 -0
  195. package/dist/types/timeline.d.ts +38 -0
  196. package/dist/types/toggle.d.ts +46 -0
  197. package/dist/types/toolbar.d.ts +34 -0
  198. package/dist/types/tour.d.ts +23 -0
  199. package/dist/types/trace.d.ts +65 -0
  200. package/dist/types/tree.d.ts +71 -0
  201. package/dist/types-cjs/adapter-codemirror.d.cts +13 -0
  202. package/dist/types-cjs/agent-fleet.d.cts +166 -0
  203. package/dist/types-cjs/ai-label.d.cts +30 -0
  204. package/dist/types-cjs/app-shell.d.cts +83 -0
  205. package/dist/types-cjs/area-chart.d.cts +80 -0
  206. package/dist/types-cjs/artifact.d.cts +65 -0
  207. package/dist/types-cjs/bar-chart.d.cts +83 -0
  208. package/dist/types-cjs/bar-list.d.cts +35 -0
  209. package/dist/types-cjs/breadcrumb.d.cts +62 -0
  210. package/dist/types-cjs/chart-brush.d.cts +35 -0
  211. package/dist/types-cjs/chart-themes.d.cts +229 -0
  212. package/dist/types-cjs/chart.d.cts +570 -0
  213. package/dist/types-cjs/checklist.d.cts +71 -0
  214. package/dist/types-cjs/code-block.d.cts +32 -0
  215. package/dist/types-cjs/collections.d.cts +246 -0
  216. package/dist/types-cjs/color-picker.d.cts +38 -0
  217. package/dist/types-cjs/command.d.cts +66 -0
  218. package/dist/types-cjs/comment-thread.d.cts +48 -0
  219. package/dist/types-cjs/confirmation.d.cts +60 -0
  220. package/dist/types-cjs/context-menu.d.cts +17 -0
  221. package/dist/types-cjs/controls.d.cts +360 -0
  222. package/dist/types-cjs/conversation.d.cts +130 -0
  223. package/dist/types-cjs/copy-button.d.cts +19 -0
  224. package/dist/types-cjs/core.d.cts +256 -0
  225. package/dist/types-cjs/data-grid.d.cts +76 -0
  226. package/dist/types-cjs/date-picker.d.cts +96 -0
  227. package/dist/types-cjs/diff-view.d.cts +54 -0
  228. package/dist/types-cjs/dot-plot.d.cts +54 -0
  229. package/dist/types-cjs/edit-region.d.cts +121 -0
  230. package/dist/types-cjs/empty.d.cts +24 -0
  231. package/dist/types-cjs/feature-gate.d.cts +22 -0
  232. package/dist/types-cjs/filter-bar.d.cts +65 -0
  233. package/dist/types-cjs/formatted-number.d.cts +38 -0
  234. package/dist/types-cjs/heatmap.d.cts +64 -0
  235. package/dist/types-cjs/in-place.d.cts +24 -0
  236. package/dist/types-cjs/index.d.cts +154 -0
  237. package/dist/types-cjs/inline-citation.d.cts +35 -0
  238. package/dist/types-cjs/inline-edit.d.cts +71 -0
  239. package/dist/types-cjs/input-otp.d.cts +37 -0
  240. package/dist/types-cjs/item-group.d.cts +104 -0
  241. package/dist/types-cjs/line-chart.d.cts +116 -0
  242. package/dist/types-cjs/link.d.cts +11 -0
  243. package/dist/types-cjs/markdown.d.cts +88 -0
  244. package/dist/types-cjs/meter.d.cts +43 -0
  245. package/dist/types-cjs/modal-state.d.cts +62 -0
  246. package/dist/types-cjs/nav.d.cts +25 -0
  247. package/dist/types-cjs/notifications.d.cts +42 -0
  248. package/dist/types-cjs/number-input.d.cts +30 -0
  249. package/dist/types-cjs/overlays.d.cts +170 -0
  250. package/dist/types-cjs/page-header.d.cts +27 -0
  251. package/dist/types-cjs/pagination.d.cts +29 -0
  252. package/dist/types-cjs/palette.d.cts +64 -0
  253. package/dist/types-cjs/password-input.d.cts +22 -0
  254. package/dist/types-cjs/pattern-assistant-conversation.d.cts +55 -0
  255. package/dist/types-cjs/pattern-async-collection.d.cts +34 -0
  256. package/dist/types-cjs/pattern-consequential-action.d.cts +53 -0
  257. package/dist/types-cjs/pattern-edit-record.d.cts +72 -0
  258. package/dist/types-cjs/pattern-review-submit.d.cts +43 -0
  259. package/dist/types-cjs/permission-matrix.d.cts +34 -0
  260. package/dist/types-cjs/pile.d.cts +27 -0
  261. package/dist/types-cjs/plan-picker.d.cts +40 -0
  262. package/dist/types-cjs/prompt-input.d.cts +106 -0
  263. package/dist/types-cjs/property-list.d.cts +67 -0
  264. package/dist/types-cjs/question.d.cts +64 -0
  265. package/dist/types-cjs/relative-time.d.cts +21 -0
  266. package/dist/types-cjs/removal-receipt.d.cts +1180 -0
  267. package/dist/types-cjs/resizable.d.cts +48 -0
  268. package/dist/types-cjs/roving.d.cts +44 -0
  269. package/dist/types-cjs/save-bar.d.cts +38 -0
  270. package/dist/types-cjs/saved-views.d.cts +72 -0
  271. package/dist/types-cjs/scatter-chart.d.cts +60 -0
  272. package/dist/types-cjs/schedule.d.cts +80 -0
  273. package/dist/types-cjs/secret-field.d.cts +33 -0
  274. package/dist/types-cjs/select.d.cts +109 -0
  275. package/dist/types-cjs/separator.d.cts +11 -0
  276. package/dist/types-cjs/settings.d.cts +39 -0
  277. package/dist/types-cjs/sheet.d.cts +27 -0
  278. package/dist/types-cjs/sparkline.d.cts +46 -0
  279. package/dist/types-cjs/split-button.d.cts +21 -0
  280. package/dist/types-cjs/stat.d.cts +54 -0
  281. package/dist/types-cjs/stepper.d.cts +26 -0
  282. package/dist/types-cjs/suggestions.d.cts +29 -0
  283. package/dist/types-cjs/suspense.d.cts +85 -0
  284. package/dist/types-cjs/sync-indicator.d.cts +24 -0
  285. package/dist/types-cjs/tag-input.d.cts +65 -0
  286. package/dist/types-cjs/terminal.d.cts +33 -0
  287. package/dist/types-cjs/thread-list.d.cts +58 -0
  288. package/dist/types-cjs/time-input.d.cts +33 -0
  289. package/dist/types-cjs/timeline.d.cts +38 -0
  290. package/dist/types-cjs/toggle.d.cts +46 -0
  291. package/dist/types-cjs/toolbar.d.cts +34 -0
  292. package/dist/types-cjs/tour.d.cts +23 -0
  293. package/dist/types-cjs/trace.d.cts +65 -0
  294. package/dist/types-cjs/tree.d.cts +71 -0
  295. package/package.json +90 -9
@@ -0,0 +1,360 @@
1
+ import * as React from 'react';
2
+ import { DepthProps } from './core.cjs';
3
+ import { Promised, SkeletonOption } from './suspense.cjs';
4
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
+ variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
6
+ size?: 'sm' | 'md' | 'lg';
7
+ /** Icon-only: a square button. Give it an aria-label. */
8
+ square?: boolean;
9
+ loading?: boolean;
10
+ leading?: React.ReactNode;
11
+ trailing?: React.ReactNode;
12
+ }
13
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
14
+ export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, DepthProps {
15
+ /** Lifts on hover and presses on click. Only set it when the whole card does something. */
16
+ interactive?: boolean;
17
+ /**
18
+ * The card holds a Suspense boundary: while anything of yours inside it suspends, the card stays up and its body is an
19
+ * imprint (a title line and `lines` lines of text, default 3). `false` lets it suspend to your own boundary.
20
+ * It's also a loading scope: its optional parts (description, body text) wait while its required parts do.
21
+ */
22
+ skeleton?: SkeletonOption;
23
+ }
24
+ export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
25
+ export declare const CardHeader: ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
26
+ /**
27
+ * Text that may still be on its way: `undefined` while your data loads (`{user?.name}`), a promise, or one promise among
28
+ * plain text. `null` renders nothing.
29
+ */
30
+ type PromisedText<E> = Omit<React.HTMLAttributes<E>, 'children'> & {
31
+ children?: React.ReactNode | PromiseLike<React.ReactNode> | Array<React.ReactNode | PromiseLike<React.ReactNode>>;
32
+ /** While the text is on its way, its imprint: `lines` (one for a title, two for a description) and `width`. `false`: render what you pass as it is, and let promises suspend to your own boundary. */
33
+ skeleton?: SkeletonOption;
34
+ };
35
+ export declare const CardTitle: ({ className, children, skeleton, ...p }: PromisedText<HTMLHeadingElement>) => React.JSX.Element;
36
+ export declare const CardDescription: ({ className, children, skeleton, ...p }: PromisedText<HTMLParagraphElement>) => React.JSX.Element;
37
+ export interface CardContentProps extends React.HTMLAttributes<HTMLDivElement> {
38
+ /** The body holds a Suspense boundary: while anything of yours inside it suspends, or its text (`{user?.bio}`) is undefined while the card's other parts are, it's `lines` lines of imprint (default 3). `false` suspends to your own boundary. */
39
+ skeleton?: SkeletonOption;
40
+ }
41
+ export declare const CardContent: ({ className, skeleton, children, ...p }: CardContentProps) => React.JSX.Element;
42
+ export declare const CardFooter: ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
43
+ export interface SuggestionProps {
44
+ /**
45
+ * A value proposed for this field (by an AI feature, autofill, a template), drawn as a ghost of the value in ink-faint:
46
+ * the whole value while the field is empty (or the rest of it while what's typed matches its start), or after the text
47
+ * with suggestionMode="append". Tab accepts, Escape dismisses, typing carries on past it. It's never put in the value,
48
+ * so an empty field with a ghost is still an opening.
49
+ */
50
+ suggestion?: string;
51
+ /** 'replace' (default): the suggestion is the whole value. 'append': it continues the text. */
52
+ suggestionMode?: 'replace' | 'append';
53
+ /** Called with the new value when Tab accepts (onChange is called too). */
54
+ onAcceptSuggestion?: (value: string) => void;
55
+ }
56
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, SuggestionProps {
57
+ invalid?: boolean;
58
+ leading?: React.ReactNode;
59
+ trailing?: React.ReactNode;
60
+ size?: 'sm' | 'md';
61
+ }
62
+ export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
63
+ export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, SuggestionProps {
64
+ invalid?: boolean;
65
+ /** With maxLength, the well fills from the bottom as the text approaches the limit, and shows a count. Default true. */
66
+ showFill?: boolean;
67
+ }
68
+ /** A deep well. With a maxLength it shows how full it is: a fill line rises from the floor as you type. */
69
+ export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
70
+ export interface FieldProps {
71
+ label: React.ReactNode;
72
+ hint?: React.ReactNode;
73
+ /** When set, the control turns invalid and the message emerges beneath it. */
74
+ error?: React.ReactNode;
75
+ required?: boolean;
76
+ className?: string;
77
+ children: React.ReactElement<any>;
78
+ }
79
+ export declare function Field({ label, hint, error, required, className, children }: FieldProps): React.JSX.Element;
80
+ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange'> {
81
+ label?: React.ReactNode;
82
+ description?: React.ReactNode;
83
+ indeterminate?: boolean;
84
+ onCheckedChange?: (checked: boolean) => void;
85
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
86
+ }
87
+ /** Built like the Switch and RadioGroup: an empty trench when off; checking pours the accent in and sets a raised white check on it. */
88
+ export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
89
+ export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
90
+ value?: string;
91
+ defaultValue?: string;
92
+ onValueChange?: (v: string) => void;
93
+ name?: string;
94
+ disabled?: boolean;
95
+ orientation?: 'vertical' | 'horizontal';
96
+ }
97
+ /** A switch with several positions: one raised thumb slides to the chosen option and the accent pours in behind it. */
98
+ export declare function RadioGroup({ value, defaultValue, onValueChange, name, disabled, orientation, className, children, ...rest }: RadioGroupProps): React.JSX.Element;
99
+ export interface RadioProps {
100
+ value: string;
101
+ label?: React.ReactNode;
102
+ description?: React.ReactNode;
103
+ disabled?: boolean;
104
+ className?: string;
105
+ }
106
+ export declare function Radio({ value, label, description, disabled, className }: RadioProps): React.JSX.Element;
107
+ export interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
108
+ checked?: boolean;
109
+ defaultChecked?: boolean;
110
+ onCheckedChange?: (v: boolean) => void;
111
+ label?: React.ReactNode;
112
+ }
113
+ export declare function Switch({ checked, defaultChecked, onCheckedChange, label, className, disabled, ...rest }: SwitchProps): React.JSX.Element;
114
+ export interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {
115
+ value?: string;
116
+ defaultValue?: string;
117
+ onValueChange?: (v: string) => void;
118
+ /**
119
+ * folder (default): each tab is the top edge of its own sheet; the chosen tab and its panel are one raised piece.
120
+ * Put TabsContent directly after TabsList. segmented: the options sit in a well and a raised pill glides between them.
121
+ */
122
+ variant?: 'folder' | 'segmented';
123
+ }
124
+ export declare function Tabs({ value, defaultValue, onValueChange, variant, className, children, ...rest }: TabsProps): React.JSX.Element;
125
+ export declare function TabsList({ className, children, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
126
+ export declare function TabsTrigger({ value, className, children, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
127
+ value: string;
128
+ }): React.JSX.Element;
129
+ export declare function TabsContent({ value, forceMount, className, ...rest }: React.HTMLAttributes<HTMLDivElement> & {
130
+ value: string;
131
+ forceMount?: boolean;
132
+ }): React.JSX.Element | null;
133
+ export interface SliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
134
+ value?: number;
135
+ defaultValue?: number;
136
+ onValueChange?: (v: number) => void;
137
+ min?: number;
138
+ max?: number;
139
+ step?: number;
140
+ disabled?: boolean;
141
+ /** Format the value shown in the bubble that floats above the thumb while dragging. */
142
+ format?: (v: number) => React.ReactNode;
143
+ 'aria-label'?: string;
144
+ }
145
+ /** A range: two thumbs with the raised fill between them. */
146
+ export interface SliderRangeProps extends Omit<SliderProps, 'value' | 'defaultValue' | 'onValueChange' | 'aria-label'> {
147
+ value?: [number, number];
148
+ defaultValue?: [number, number];
149
+ onValueChange?: (v: [number, number]) => void;
150
+ /** Steps the thumbs keep between them, so they can't meet. Default 0. */
151
+ minStepsBetween?: number;
152
+ /** A name per thumb, or one name for the pair (each thumb is then "<name>, minimum" and "<name>, maximum"). */
153
+ 'aria-label'?: string | [string, string];
154
+ }
155
+ export declare function Slider(props: SliderProps): React.ReactElement;
156
+ export declare function Slider(props: SliderRangeProps): React.ReactElement;
157
+ /** Two values on one track: what the range Slider and ChartBrush share. A thumb can't cross the other or come within
158
+ * `minStepsBetween` of it; dragging between the thumbs pans both; pressing outside them moves the nearer one there,
159
+ * or with `outside: 'centre'` centres the pair there and pans from it. */
160
+ export declare function useRange({ value, defaultValue, onValueChange, min, max, step, minStepsBetween, disabled, outside }: {
161
+ value?: [number, number];
162
+ defaultValue?: [number, number];
163
+ onValueChange?: (v: [number, number]) => void;
164
+ min: number;
165
+ max: number;
166
+ step: number;
167
+ minStepsBetween?: number;
168
+ disabled?: boolean;
169
+ outside?: 'nearer' | 'centre';
170
+ }): {
171
+ value: [number, number];
172
+ set: (v: [number, number]) => void;
173
+ held: 0 | 1 | "both" | "tie" | null;
174
+ track: React.RefObject<HTMLDivElement | null>;
175
+ bounds: (i: 0 | 1) => [number, number];
176
+ pct: (n: number) => number;
177
+ press: (e: React.PointerEvent<HTMLElement>, thumb?: 0 | 1) => 0 | 1 | "both" | undefined;
178
+ drag: (e: React.PointerEvent<HTMLElement>) => void;
179
+ release: () => void;
180
+ keys: (i: 0 | 1) => (e: React.KeyboardEvent) => void;
181
+ shift: (d: number) => void;
182
+ };
183
+ export interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
184
+ value?: number | null;
185
+ max?: number;
186
+ 'aria-label'?: string;
187
+ }
188
+ export declare function Progress({ value, max, className, ...rest }: ProgressProps): React.JSX.Element;
189
+ export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
190
+ tone?: 'neutral' | 'accent' | 'positive' | 'caution' | 'critical';
191
+ /**
192
+ * plate (default): an indicator plate set flush into the page. tinted: the plate takes its tone's colour.
193
+ * outline: a hairline only. count: a number that wants attention; it floats above the page and pops when it changes.
194
+ * ('soft' is the old name for tinted.)
195
+ */
196
+ variant?: 'plate' | 'tinted' | 'outline' | 'count' | 'soft';
197
+ /** The indicator lamp. On by default for positive, caution and critical; true on a neutral badge shows an unlit lamp. 'pulse' breathes, for something in progress. */
198
+ lamp?: boolean | 'pulse';
199
+ /** @deprecated Use `lamp`. */
200
+ dot?: boolean;
201
+ /** The label. Undefined while your data loads, or a promise: until it arrives the badge is a plate-shaped imprint. */
202
+ children?: React.ReactNode | PromiseLike<React.ReactNode> | Array<React.ReactNode | PromiseLike<React.ReactNode>>;
203
+ /** While the label is on its way: the imprint's `width` (default 64px; a count is round). `false`: render what you pass as it is, and let promises suspend to your own boundary. */
204
+ skeleton?: SkeletonOption;
205
+ }
206
+ /** A label stamped into the record. Status carries a lamp that relights when it changes; a changed label is re-stamped. */
207
+ export declare function Badge({ children, skeleton, ...props }: BadgeProps): React.JSX.Element;
208
+ export interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {
209
+ /** The accessible label. Undefined while your data loads (`user?.name`), or a promise: until it arrives the avatar is an imprint of its size and shape. */
210
+ name: Promised<string> | undefined;
211
+ /** May be a promise, like `name`. If the image fails to load, the initials show instead. */
212
+ src?: Promised<string | undefined>;
213
+ /** In pixels. Default 36. */
214
+ size?: number;
215
+ /** `circle` (default) for a person; `square` for a team, an organisation, a bot or an agent. */
216
+ shape?: 'circle' | 'square';
217
+ /** Presence: active and idle people are here, so they rest on the page (a filled lamp or an empty one says which); offline people lie flat in it, grey. */
218
+ status?: 'active' | 'idle' | 'offline';
219
+ /** Speaking, typing or presenting right now: the face leaves the ground and drifts above its shadow. */
220
+ live?: boolean;
221
+ /** Ties the person to their presence colour, the same ring they wear on anything they're holding. */
222
+ presence?: 1 | 2 | 3;
223
+ /** The status lamp (filled green active, empty amber ring idle). Default: shown when there is a status and the avatar is 24px or larger. Never shown inside AvatarGroup. */
224
+ lamp?: boolean;
225
+ /** `false`: no imprint. An undefined `name` renders an empty face; a promised one suspends to your own boundary. */
226
+ skeleton?: boolean;
227
+ }
228
+ /** A disc resting on the page while the person is here, flush in it when they're not; live, it lifts off its shadow. */
229
+ export declare function Avatar({ skeleton, ...props }: AvatarProps): React.JSX.Element;
230
+ export interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
231
+ /** Show at most this many faces; the rest become a "+N" plate that names them. */
232
+ max?: number;
233
+ /** In pixels, for every face that doesn't set its own. Default: the first face's size, or 36. */
234
+ size?: number;
235
+ }
236
+ /** Faces standing on one ground line, each cut out of the one before it. */
237
+ export declare function AvatarGroup({ className, children, max, size: groupSize, style, ...rest }: AvatarGroupProps): React.JSX.Element;
238
+ export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
239
+ /** When it turns true, the children rise out of the imprint into place. */
240
+ loaded?: boolean;
241
+ shape?: 'block' | 'text' | 'circle';
242
+ /** For shape="text": how many lines to imprint. */
243
+ lines?: number;
244
+ width?: number | string;
245
+ height?: number | string;
246
+ radius?: string;
247
+ }
248
+ /** An imprint of the content to come, pressed into the page; when the content arrives it rises out of its imprint. */
249
+ export declare function Skeleton({ loaded, shape, lines, width, height, radius, className, style, children, ...rest }: SkeletonProps): React.JSX.Element;
250
+ export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>, Pick<DepthProps, 'settle'> {
251
+ tone?: 'neutral' | 'accent' | 'positive' | 'caution' | 'critical';
252
+ /** flat (default): a sheet laid on the page, it informs. raised: a card above the page, it asks you to act. */
253
+ variant?: 'flat' | 'raised';
254
+ title?: React.ReactNode;
255
+ action?: React.ReactNode;
256
+ icon?: React.ReactNode;
257
+ /** Shows a dismiss button; the sheet lifts off the page and the gap closes, then this is called. */
258
+ onDismiss?: () => void;
259
+ /** The dismiss button's words ("Remind me tomorrow"). Default: an × named "Dismiss". */
260
+ dismissLabel?: string;
261
+ /** 'page': a banner for the whole app or page, edge to edge with no side rounding, in a labelled region. Default 'inline'. */
262
+ placement?: 'inline' | 'page';
263
+ /** With placement="page": stays at the top while the page scrolls. */
264
+ sticky?: boolean;
265
+ }
266
+ /** Status as a sheet laid on the page: it rests on the ground (you can see its edge and its contact shadow) and never floats. When it asks the person to act it becomes a raised card. */
267
+ export declare function Alert({ tone, variant, title, action, icon, onDismiss, dismissLabel, placement, sticky, settle, className, style, children, ...rest }: AlertProps): React.JSX.Element;
268
+ export interface AlertStackProps extends React.HTMLAttributes<HTMLDivElement> {
269
+ /** Alert elements, most important first. Give each a key. */
270
+ children: React.ReactNode;
271
+ expanded?: boolean;
272
+ defaultExpanded?: boolean;
273
+ onExpandedChange?: (expanded: boolean) => void;
274
+ /** Label for the count while stacked. Default "+N more". */
275
+ moreLabel?: (hidden: number) => React.ReactNode;
276
+ /** Label for collapsing. Default "Show less". */
277
+ lessLabel?: React.ReactNode;
278
+ /** 'page': a stack of page banners, edge to edge. Give each Alert placement="page" too. */
279
+ placement?: 'inline' | 'page';
280
+ }
281
+ /**
282
+ * Several alerts as a stack of sheets: the first lies on top and the others peek out beneath it, each tinted by its
283
+ * own tone, with a count. Opening the stack fans them out; dismissing the top one lifts it off and the next comes up.
284
+ */
285
+ export declare function AlertStack({ children, expanded, defaultExpanded, onExpandedChange, moreLabel, lessLabel, placement, className, ...rest }: AlertStackProps): React.JSX.Element;
286
+ export interface AccordionItem {
287
+ value: string;
288
+ title: React.ReactNode;
289
+ content: React.ReactNode;
290
+ }
291
+ export interface AccordionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {
292
+ items: AccordionItem[];
293
+ type?: 'single' | 'multiple';
294
+ defaultValue?: string[];
295
+ }
296
+ export declare function Accordion({ items, type, defaultValue, className, ...rest }: AccordionProps): React.JSX.Element;
297
+ export interface HoldButtonProps extends Omit<ButtonProps, 'loading'> {
298
+ /** Called once the button has been held for `duration`. */
299
+ onConfirm: () => void;
300
+ /** Milliseconds. Default 1000 (dur-hold). */
301
+ duration?: number;
302
+ holdingLabel?: React.ReactNode;
303
+ doneLabel?: React.ReactNode;
304
+ /**
305
+ * By default a completed hold is final: the button settles flat, shows doneLabel and can't be pressed again.
306
+ * Set true for actions that can be repeated; the button re-arms after a moment.
307
+ */
308
+ repeatable?: boolean;
309
+ }
310
+ /** Commitment as depth: holding pushes the button down through the ground into a trench. Let go early and it springs back. */
311
+ export declare function HoldButton({ onConfirm, duration, variant, holdingLabel, doneLabel, repeatable, className, children, style, disabled, onClick, ...rest }: HoldButtonProps): React.JSX.Element;
312
+ export interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {
313
+ /** A header that sits flush at the top and rises once content scrolls beneath it. */
314
+ header?: React.ReactNode;
315
+ maxHeight?: number | string;
316
+ 'aria-label'?: string;
317
+ }
318
+ /** Overflow as depth: where content continues past an edge, the edge curves away (an inner lip); content passing under the header lifts it. */
319
+ export declare function ScrollArea({ header, maxHeight, className, children, ...rest }: ScrollAreaProps): React.JSX.Element;
320
+ export interface DropZoneProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onDrop'> {
321
+ onFiles?: (files: File[]) => void;
322
+ accept?: string;
323
+ multiple?: boolean;
324
+ /** Force a visual state, for documentation: idle, armed (a file is being dragged somewhere on the page) or over. */
325
+ state?: 'idle' | 'armed' | 'over';
326
+ /** The files you're handling, shown as slats under the zone: uploading (a Progress fill), processing (hovering, pending), done (lands and settles) or failed (a trench with Retry). */
327
+ queue?: UploadItem[];
328
+ onRetry?: (id: string) => void;
329
+ onCancel?: (id: string) => void;
330
+ onRemove?: (id: string) => void;
331
+ }
332
+ export interface UploadItem {
333
+ id: string;
334
+ name: string;
335
+ /** Bytes. */
336
+ size?: number;
337
+ state: 'uploading' | 'processing' | 'done' | 'failed';
338
+ /** 0–100, while uploading. */
339
+ progress?: number;
340
+ /** Why it failed, in words. */
341
+ error?: string;
342
+ }
343
+ /** Receptacles open when they're needed: a drop zone is flush until a file is dragged anywhere on the page, then sinks open; over it, it deepens. */
344
+ export declare function DropZone({ onFiles, accept, multiple, state, queue, onRetry, onCancel, onRemove, className, children, ...rest }: DropZoneProps): React.JSX.Element;
345
+ export interface SortableListProps<T> {
346
+ items: T[];
347
+ getKey: (item: T) => string;
348
+ onReorder: (items: T[]) => void;
349
+ renderItem: (item: T, state: {
350
+ held: boolean;
351
+ }) => React.ReactNode;
352
+ /** Accessible name for each item, used in announcements. */
353
+ getLabel?: (item: T) => string;
354
+ gap?: number;
355
+ className?: string;
356
+ 'aria-label'?: string;
357
+ }
358
+ /** Possession as depth: the item you pick up comes into your hand (level 3), the slot it will land in opens as a well, and it lands with a settle. */
359
+ export declare function SortableList<T>({ items, getKey, onReorder, renderItem, getLabel, gap, className, ...rest }: SortableListProps<T>): React.JSX.Element;
360
+ export {};
@@ -0,0 +1,130 @@
1
+ import * as React from 'react';
2
+ export interface ConversationProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ 'aria-label': string;
4
+ }
5
+ /**
6
+ * The thread between a person and an assistant. Settled messages are the record. It follows new text to the bottom
7
+ * until the person scrolls up, then offers "Jump to latest". A streamed answer is announced once, when it completes,
8
+ * never token by token.
9
+ */
10
+ export declare function Conversation({ className, children, 'aria-label': label, ...rest }: ConversationProps): React.JSX.Element;
11
+ /** The messages, in order. */
12
+ export declare function ConversationContent({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
13
+ /** "Jump to latest message": floats at level 3 once the person has scrolled up from the bottom. */
14
+ export declare function ConversationScrollButton({ className }: {
15
+ className?: string;
16
+ }): React.JSX.Element | null;
17
+ export type MessageStatus = 'streaming' | 'complete' | 'stopped' | 'error';
18
+ export interface MessageProps extends React.HTMLAttributes<HTMLElement> {
19
+ from: 'user' | 'assistant';
20
+ /** An assistant message: streaming rests on the ground with a dashed rule, "Generating…" and a caret; complete settles with one afterglow; stopped and error are kept, with Retry. Default 'complete'. */
21
+ status?: MessageStatus;
22
+ /** Who's speaking. Default "You" or "Assistant". */
23
+ name?: string;
24
+ onRetry?: () => void;
25
+ /** A person's message that was edited and resent: "Edited" in its caption. */
26
+ edited?: boolean;
27
+ }
28
+ /**
29
+ * One message. A person's is a flush accent-soft sheet; an assistant's is flush, no bubble. While an answer streams it
30
+ * isn't the record yet: it rests on the ground with a dashed rule down its edge (charts' "not yet the record"), never
31
+ * hovering, because nothing you sent is in flight. When it completes the rule goes solid and it settles once.
32
+ */
33
+ export declare function Message({ from, status, name, onRetry, edited, className, children, ...rest }: MessageProps): React.JSX.Element;
34
+ export interface MessageAttachment {
35
+ name: string;
36
+ /** Its MIME type: image/* with a `url` shows as a thumbnail; anything else as a file plate. */
37
+ type?: string;
38
+ /** In bytes, shown on a file plate. */
39
+ size?: number;
40
+ /** An image's thumbnail. */
41
+ url?: string;
42
+ /** An image's text alternative. Default its name. */
43
+ alt?: string;
44
+ /** Opens the file as a link. */
45
+ href?: string;
46
+ /** Opens the file in the app (a preview Dialog, say). */
47
+ onOpen?: () => void;
48
+ /** Expired or deleted: "No longer available", and it doesn't act. */
49
+ unavailable?: boolean;
50
+ }
51
+ export interface MessageAttachmentsProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'children'> {
52
+ items: MessageAttachment[];
53
+ }
54
+ /**
55
+ * What went with a message: the files the composer showed as plates, now settled into the record. Images are 64px
56
+ * thumbnails, other files Tag plates with name, type and size; those with href or onOpen act (and lift one level when
57
+ * pointed at). Put it before MessageContent. A sent attachment was uploaded before the message went, so it's never
58
+ * pending.
59
+ */
60
+ export declare function MessageAttachments({ items, className, ...rest }: MessageAttachmentsProps): React.JSX.Element | null;
61
+ /** The message's text. Text arrives without per-word animation; a caret marks the end while it streams. */
62
+ export declare function MessageContent({ className, children, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
63
+ export interface ConversationCheckpointProps {
64
+ /** What the point is before: "Before editing 6 files". */
65
+ label: string;
66
+ /** When it was made. */
67
+ at?: Date | string | number;
68
+ /** What restoring does, in words: "The 4 messages after this and the changes to 6 files will be set aside. You can return to them." */
69
+ consequence: string;
70
+ /** Restore: resolve when done, reject (with a message) when it couldn't. */
71
+ onRestore: () => void | Promise<unknown>;
72
+ /**
73
+ * Real recovery: bring back what restoring set aside. With it, Restore runs at once and leaves "Return to where you
74
+ * were"; without it, Restore asks first in a Dialog.
75
+ */
76
+ onReturn?: () => void | Promise<unknown>;
77
+ locale?: string;
78
+ className?: string;
79
+ }
80
+ /**
81
+ * A point in the conversation to go back to (#277): a divider with a word between its lines ("Checkpoint · Before
82
+ * editing 6 files · 2:14 PM") and Restore. Restoring follows the consequential-action contract: with onReturn it runs at
83
+ * once and leaves "Return to where you were"; without, it asks in a stationary Dialog. While restoring the label hovers
84
+ * as pending; restored, it settles once; failed, it sinks into a trench with Retry. Set the later turns aside as a
85
+ * branch (the next message's versions) rather than deleting them.
86
+ */
87
+ export declare function ConversationCheckpoint({ label, at, consequence, onRestore, onReturn, locale, className }: ConversationCheckpointProps): React.JSX.Element;
88
+ export interface QueuedMessage {
89
+ id: string;
90
+ text: string;
91
+ }
92
+ export interface ConversationQueueProps {
93
+ /** Messages written while the agent worked, in the order they'll be sent. */
94
+ items: QueuedMessage[];
95
+ /** Stop the current turn and send this one now. */
96
+ onSendNow?: (id: string) => void;
97
+ /** Edit opens it in place; called with the new text. */
98
+ onEdit?: (id: string, text: string) => void;
99
+ onRemove?: (id: string) => void;
100
+ className?: string;
101
+ }
102
+ /**
103
+ * Messages queued while the agent works (#276), between the thread and the composer, in order, each with Send now,
104
+ * Edit and Remove. A queued message is written but not dispatched, so it doesn't hover (pending is for a write in
105
+ * flight): it's the person's sheet on the ground with a dashed rim, "Queued · 1 of 2". Your app sends the first when
106
+ * the turn ends, and it becomes an ordinary message in the log.
107
+ */
108
+ export declare function ConversationQueue({ items, onSendNow, onEdit, onRemove, className }: ConversationQueueProps): React.JSX.Element | null;
109
+ export interface MessageActionsProps {
110
+ /** Shows Copy (the message's text, or this value). */
111
+ onCopy?: boolean | (() => string);
112
+ onRegenerate?: () => void;
113
+ /** Shows good / bad response toggles; null when cleared. */
114
+ onFeedback?: (value: 'up' | 'down' | null) => void;
115
+ feedback?: 'up' | 'down' | null;
116
+ /**
117
+ * Regenerated answers, or a person's edited message, are kept as versions, never overwritten: "Version 2 of 2".
118
+ * Switching is announced ("Showing version 1 of 2").
119
+ */
120
+ versions?: {
121
+ index: number;
122
+ total: number;
123
+ onChange: (index: number) => void;
124
+ };
125
+ /** A person's message: an Edit action that opens it in place; sending the edit calls this with the new text (start a branch from it). */
126
+ onEdit?: (text: string) => void;
127
+ className?: string;
128
+ }
129
+ /** Copy, regenerate, feedback and versions: ghost buttons that lift when pointed at. Hidden while the message streams. */
130
+ export declare function MessageActions({ onCopy, onRegenerate, onFeedback, feedback, versions, onEdit, className }: MessageActionsProps): React.JSX.Element | null;
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import { ButtonProps } from './controls.cjs';
3
+ export interface CopyButtonProps extends Omit<ButtonProps, 'value' | 'onCopy' | 'onError' | 'square' | 'loading' | 'leading'> {
4
+ /** What's copied, or a function that returns it (it may return a promise). */
5
+ value: string | (() => string | Promise<string>);
6
+ /** The button's name: its aria-label and Tooltip when it's icon-only, and kept as its name while it says "Copied". Default "Copy". */
7
+ label?: string;
8
+ /** Shown for dur-linger once copied. Default "Copied". */
9
+ copiedLabel?: string;
10
+ /** Shown for dur-linger when copying fails. Default "Couldn't copy". */
11
+ failedLabel?: string;
12
+ onCopy?: (value: string) => void;
13
+ onError?: (error: unknown) => void;
14
+ }
15
+ /**
16
+ * Copies a value and says so in words: pressed to the ground with a check and "Copied" for dur-linger, announced
17
+ * politely while the button keeps its name. No rise and no afterglow: nothing new arrived on the page.
18
+ */
19
+ export declare const CopyButton: React.ForwardRefExoticComponent<CopyButtonProps & React.RefAttributes<HTMLButtonElement>>;