altitude-design 0.4.0 → 0.4.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 (280) hide show
  1. package/README.md +1 -0
  2. package/dist/guidance/components/AILabel/README.md +35 -0
  3. package/dist/guidance/components/Accordion/README.md +25 -0
  4. package/dist/guidance/components/AgentFleet/README.md +48 -1
  5. package/dist/guidance/components/AgentLanes/README.md +32 -0
  6. package/dist/guidance/components/AgentRequests/README.md +47 -0
  7. package/dist/guidance/components/Alert/README.md +49 -0
  8. package/dist/guidance/components/AltitudeProvider/README.md +63 -0
  9. package/dist/guidance/components/AppShell/README.md +70 -0
  10. package/dist/guidance/components/AreaChart/README.md +58 -0
  11. package/dist/guidance/components/Artifact/README.md +69 -0
  12. package/dist/guidance/components/Avatar/README.md +41 -0
  13. package/dist/guidance/components/Await/README.md +48 -0
  14. package/dist/guidance/components/Badge/README.md +44 -0
  15. package/dist/guidance/components/BarChart/README.md +62 -0
  16. package/dist/guidance/components/BarList/README.md +58 -0
  17. package/dist/guidance/components/Board/README.md +67 -0
  18. package/dist/guidance/components/Breadcrumb/README.md +31 -0
  19. package/dist/guidance/components/Button/README.md +41 -0
  20. package/dist/guidance/components/Card/README.md +38 -0
  21. package/dist/guidance/components/ChartBrush/README.md +57 -0
  22. package/dist/guidance/components/ChartContainer/README.md +77 -0
  23. package/dist/guidance/components/ChartLegend/README.md +43 -0
  24. package/dist/guidance/components/ChartReference/README.md +74 -0
  25. package/dist/guidance/components/ChartTooltip/README.md +63 -0
  26. package/dist/guidance/components/Checkbox/README.md +35 -0
  27. package/dist/guidance/components/Checklist/README.md +66 -0
  28. package/dist/guidance/components/CodeBlock/README.md +44 -0
  29. package/dist/guidance/components/ColorPicker/README.md +39 -0
  30. package/dist/guidance/components/Combobox/README.md +35 -0
  31. package/dist/guidance/components/CommandPalette/README.md +177 -0
  32. package/dist/guidance/components/CommentThread/README.md +51 -0
  33. package/dist/guidance/components/Confirmation/README.md +60 -0
  34. package/dist/guidance/components/ContextMenu/README.md +51 -0
  35. package/dist/guidance/components/Conversation/README.md +124 -0
  36. package/dist/guidance/components/CopyButton/README.md +31 -0
  37. package/dist/guidance/components/DataGrid/README.md +75 -0
  38. package/dist/guidance/components/DatePicker/README.md +49 -0
  39. package/dist/guidance/components/Dialog/README.md +175 -0
  40. package/dist/guidance/components/DiffView/README.md +77 -0
  41. package/dist/guidance/components/DotPlot/README.md +44 -0
  42. package/dist/guidance/components/Drilldown/README.md +28 -0
  43. package/dist/guidance/components/DropZone/README.md +50 -0
  44. package/dist/guidance/components/DropdownMenu/README.md +44 -0
  45. package/dist/guidance/components/EditRegion/README.md +159 -0
  46. package/dist/guidance/components/EmptyState/README.md +49 -0
  47. package/dist/guidance/components/FeatureGate/README.md +39 -0
  48. package/dist/guidance/components/Field/README.md +36 -0
  49. package/dist/guidance/components/FilterBar/README.md +63 -0
  50. package/dist/guidance/components/FormattedNumber/README.md +44 -0
  51. package/dist/guidance/components/Heatmap/README.md +71 -0
  52. package/dist/guidance/components/HoldButton/README.md +32 -0
  53. package/dist/guidance/components/HoverCard/README.md +53 -0
  54. package/dist/guidance/components/InlineCitation/README.md +32 -0
  55. package/dist/guidance/components/InlineEdit/README.md +247 -1
  56. package/dist/guidance/components/Input/README.md +36 -0
  57. package/dist/guidance/components/InputOTP/README.md +46 -0
  58. package/dist/guidance/components/ItemGroup/README.md +100 -0
  59. package/dist/guidance/components/Kbd/README.md +27 -0
  60. package/dist/guidance/components/LineChart/README.md +62 -0
  61. package/dist/guidance/components/Link/README.md +41 -0
  62. package/dist/guidance/components/Markdown/README.md +81 -0
  63. package/dist/guidance/components/Meter/README.md +52 -0
  64. package/dist/guidance/components/NotificationCenter/README.md +39 -0
  65. package/dist/guidance/components/NumberInput/README.md +37 -0
  66. package/dist/guidance/components/PageHeader/README.md +45 -0
  67. package/dist/guidance/components/Pagination/README.md +33 -0
  68. package/dist/guidance/components/PasswordInput/README.md +36 -0
  69. package/dist/guidance/components/PermissionMatrix/README.md +40 -0
  70. package/dist/guidance/components/Pile/README.md +42 -0
  71. package/dist/guidance/components/PlanPicker/README.md +37 -0
  72. package/dist/guidance/components/Popover/README.md +36 -0
  73. package/dist/guidance/components/Progress/README.md +31 -0
  74. package/dist/guidance/components/PromptInput/README.md +98 -0
  75. package/dist/guidance/components/PropertyList/README.md +80 -0
  76. package/dist/guidance/components/Question/README.md +54 -0
  77. package/dist/guidance/components/RadioGroup/README.md +37 -0
  78. package/dist/guidance/components/RelativeTime/README.md +47 -0
  79. package/dist/guidance/components/RemovalReceipt/README.md +77 -0
  80. package/dist/guidance/components/Resizable/README.md +29 -0
  81. package/dist/guidance/components/SaveBar/README.md +38 -0
  82. package/dist/guidance/components/SavedViews/README.md +58 -0
  83. package/dist/guidance/components/ScatterChart/README.md +63 -0
  84. package/dist/guidance/components/Schedule/README.md +66 -0
  85. package/dist/guidance/components/ScrollArea/README.md +28 -0
  86. package/dist/guidance/components/SecretField/README.md +46 -0
  87. package/dist/guidance/components/Select/README.md +70 -0
  88. package/dist/guidance/components/Separator/README.md +44 -0
  89. package/dist/guidance/components/Sheet/README.md +94 -0
  90. package/dist/guidance/components/Skeleton/README.md +36 -0
  91. package/dist/guidance/components/Slider/README.md +35 -0
  92. package/dist/guidance/components/SortableList/README.md +34 -0
  93. package/dist/guidance/components/Sparkline/README.md +58 -0
  94. package/dist/guidance/components/SplitButton/README.md +39 -0
  95. package/dist/guidance/components/Stat/README.md +61 -0
  96. package/dist/guidance/components/Stepper/README.md +61 -0
  97. package/dist/guidance/components/Suggestions/README.md +58 -0
  98. package/dist/guidance/components/Surface/README.md +28 -0
  99. package/dist/guidance/components/Switch/README.md +29 -0
  100. package/dist/guidance/components/SyncIndicator/README.md +54 -0
  101. package/dist/guidance/components/Table/README.md +62 -0
  102. package/dist/guidance/components/Tabs/README.md +55 -0
  103. package/dist/guidance/components/TagInput/README.md +50 -0
  104. package/dist/guidance/components/Terminal/README.md +42 -0
  105. package/dist/guidance/components/ThreadList/README.md +73 -0
  106. package/dist/guidance/components/TimeInput/README.md +37 -0
  107. package/dist/guidance/components/Timeline/README.md +55 -0
  108. package/dist/guidance/components/Toaster/README.md +38 -0
  109. package/dist/guidance/components/Toggle/README.md +52 -0
  110. package/dist/guidance/components/Toolbar/README.md +69 -0
  111. package/dist/guidance/components/Tooltip/README.md +29 -0
  112. package/dist/guidance/components/Tour/README.md +44 -0
  113. package/dist/guidance/components/Trace/README.md +92 -0
  114. package/dist/guidance/components/Tree/README.md +85 -0
  115. package/dist/guidance/index.json +117 -117
  116. package/dist/guidance/llms.txt +1 -1
  117. package/dist/guidance/manifest.json +120 -120
  118. package/dist/guidance/visual/ActionsInPlace.md +5 -5
  119. package/dist/guidance/visual/Distinctiveness.md +6 -2
  120. package/dist/guidance/visual/Research.md +14 -2
  121. package/dist/guidance/visual/Theming.md +1 -1
  122. package/dist/types/agent-fleet.d.ts +28 -0
  123. package/dist/types/ai-label.d.ts +7 -0
  124. package/dist/types/app-shell.d.ts +23 -0
  125. package/dist/types/area-chart.d.ts +8 -0
  126. package/dist/types/artifact.d.ts +14 -0
  127. package/dist/types/bar-chart.d.ts +6 -0
  128. package/dist/types/bar-list.d.ts +6 -0
  129. package/dist/types/breadcrumb.d.ts +6 -0
  130. package/dist/types/chart-brush.d.ts +6 -0
  131. package/dist/types/chart.d.ts +29 -1
  132. package/dist/types/checklist.d.ts +6 -0
  133. package/dist/types/code-block.d.ts +6 -0
  134. package/dist/types/collections.d.ts +15 -0
  135. package/dist/types/color-picker.d.ts +6 -0
  136. package/dist/types/command.d.ts +13 -0
  137. package/dist/types/comment-thread.d.ts +11 -0
  138. package/dist/types/confirmation.d.ts +8 -0
  139. package/dist/types/context-menu.d.ts +11 -0
  140. package/dist/types/controls.d.ts +174 -10
  141. package/dist/types/conversation.d.ts +21 -0
  142. package/dist/types/copy-button.d.ts +6 -0
  143. package/dist/types/core.d.ts +31 -0
  144. package/dist/types/data-grid.d.ts +25 -0
  145. package/dist/types/date-picker.d.ts +6 -0
  146. package/dist/types/diff-view.d.ts +8 -0
  147. package/dist/types/dot-plot.d.ts +6 -0
  148. package/dist/types/edit-region.d.ts +23 -0
  149. package/dist/types/empty.d.ts +9 -0
  150. package/dist/types/feature-gate.d.ts +8 -0
  151. package/dist/types/filter-bar.d.ts +8 -0
  152. package/dist/types/formatted-number.d.ts +6 -0
  153. package/dist/types/heatmap.d.ts +6 -0
  154. package/dist/types/inline-citation.d.ts +6 -0
  155. package/dist/types/inline-edit.d.ts +7 -0
  156. package/dist/types/input-otp.d.ts +11 -0
  157. package/dist/types/item-group.d.ts +29 -0
  158. package/dist/types/line-chart.d.ts +6 -0
  159. package/dist/types/link.d.ts +8 -1
  160. package/dist/types/markdown.d.ts +6 -0
  161. package/dist/types/meter.d.ts +6 -0
  162. package/dist/types/nav.d.ts +6 -0
  163. package/dist/types/notifications.d.ts +6 -0
  164. package/dist/types/number-input.d.ts +6 -0
  165. package/dist/types/overlays.d.ts +61 -0
  166. package/dist/types/page-header.d.ts +14 -0
  167. package/dist/types/pagination.d.ts +6 -0
  168. package/dist/types/password-input.d.ts +6 -0
  169. package/dist/types/permission-matrix.d.ts +7 -0
  170. package/dist/types/pile.d.ts +6 -0
  171. package/dist/types/plan-picker.d.ts +6 -0
  172. package/dist/types/prompt-input.d.ts +11 -0
  173. package/dist/types/property-list.d.ts +17 -0
  174. package/dist/types/question.d.ts +11 -0
  175. package/dist/types/relative-time.d.ts +8 -1
  176. package/dist/types/removal-receipt.d.ts +18 -1
  177. package/dist/types/save-bar.d.ts +6 -0
  178. package/dist/types/saved-views.d.ts +12 -0
  179. package/dist/types/scatter-chart.d.ts +8 -0
  180. package/dist/types/schedule.d.ts +21 -0
  181. package/dist/types/secret-field.d.ts +6 -0
  182. package/dist/types/select.d.ts +12 -0
  183. package/dist/types/separator.d.ts +8 -1
  184. package/dist/types/sheet.d.ts +19 -0
  185. package/dist/types/sparkline.d.ts +6 -0
  186. package/dist/types/split-button.d.ts +7 -0
  187. package/dist/types/stat.d.ts +7 -0
  188. package/dist/types/stepper.d.ts +12 -0
  189. package/dist/types/suggestions.d.ts +10 -0
  190. package/dist/types/sync-indicator.d.ts +8 -0
  191. package/dist/types/tag-input.d.ts +8 -0
  192. package/dist/types/terminal.d.ts +6 -0
  193. package/dist/types/thread-list.d.ts +16 -0
  194. package/dist/types/time-input.d.ts +6 -0
  195. package/dist/types/timeline.d.ts +9 -0
  196. package/dist/types/toggle.d.ts +6 -0
  197. package/dist/types/toolbar.d.ts +20 -0
  198. package/dist/types/tour.d.ts +10 -0
  199. package/dist/types/trace.d.ts +16 -0
  200. package/dist/types/tree.d.ts +21 -0
  201. package/dist/types-cjs/agent-fleet.d.cts +28 -0
  202. package/dist/types-cjs/ai-label.d.cts +7 -0
  203. package/dist/types-cjs/app-shell.d.cts +23 -0
  204. package/dist/types-cjs/area-chart.d.cts +8 -0
  205. package/dist/types-cjs/artifact.d.cts +14 -0
  206. package/dist/types-cjs/bar-chart.d.cts +6 -0
  207. package/dist/types-cjs/bar-list.d.cts +6 -0
  208. package/dist/types-cjs/breadcrumb.d.cts +6 -0
  209. package/dist/types-cjs/chart-brush.d.cts +6 -0
  210. package/dist/types-cjs/chart.d.cts +29 -1
  211. package/dist/types-cjs/checklist.d.cts +6 -0
  212. package/dist/types-cjs/code-block.d.cts +6 -0
  213. package/dist/types-cjs/collections.d.cts +15 -0
  214. package/dist/types-cjs/color-picker.d.cts +6 -0
  215. package/dist/types-cjs/command.d.cts +13 -0
  216. package/dist/types-cjs/comment-thread.d.cts +11 -0
  217. package/dist/types-cjs/confirmation.d.cts +8 -0
  218. package/dist/types-cjs/context-menu.d.cts +11 -0
  219. package/dist/types-cjs/controls.d.cts +174 -10
  220. package/dist/types-cjs/conversation.d.cts +21 -0
  221. package/dist/types-cjs/copy-button.d.cts +6 -0
  222. package/dist/types-cjs/core.d.cts +31 -0
  223. package/dist/types-cjs/data-grid.d.cts +25 -0
  224. package/dist/types-cjs/date-picker.d.cts +6 -0
  225. package/dist/types-cjs/diff-view.d.cts +8 -0
  226. package/dist/types-cjs/dot-plot.d.cts +6 -0
  227. package/dist/types-cjs/edit-region.d.cts +23 -0
  228. package/dist/types-cjs/empty.d.cts +9 -0
  229. package/dist/types-cjs/feature-gate.d.cts +8 -0
  230. package/dist/types-cjs/filter-bar.d.cts +8 -0
  231. package/dist/types-cjs/formatted-number.d.cts +6 -0
  232. package/dist/types-cjs/heatmap.d.cts +6 -0
  233. package/dist/types-cjs/inline-citation.d.cts +6 -0
  234. package/dist/types-cjs/inline-edit.d.cts +7 -0
  235. package/dist/types-cjs/input-otp.d.cts +11 -0
  236. package/dist/types-cjs/item-group.d.cts +29 -0
  237. package/dist/types-cjs/line-chart.d.cts +6 -0
  238. package/dist/types-cjs/link.d.cts +8 -1
  239. package/dist/types-cjs/markdown.d.cts +6 -0
  240. package/dist/types-cjs/meter.d.cts +6 -0
  241. package/dist/types-cjs/nav.d.cts +6 -0
  242. package/dist/types-cjs/notifications.d.cts +6 -0
  243. package/dist/types-cjs/number-input.d.cts +6 -0
  244. package/dist/types-cjs/overlays.d.cts +61 -0
  245. package/dist/types-cjs/page-header.d.cts +14 -0
  246. package/dist/types-cjs/pagination.d.cts +6 -0
  247. package/dist/types-cjs/password-input.d.cts +6 -0
  248. package/dist/types-cjs/permission-matrix.d.cts +7 -0
  249. package/dist/types-cjs/pile.d.cts +6 -0
  250. package/dist/types-cjs/plan-picker.d.cts +6 -0
  251. package/dist/types-cjs/prompt-input.d.cts +11 -0
  252. package/dist/types-cjs/property-list.d.cts +17 -0
  253. package/dist/types-cjs/question.d.cts +11 -0
  254. package/dist/types-cjs/relative-time.d.cts +8 -1
  255. package/dist/types-cjs/removal-receipt.d.cts +18 -1
  256. package/dist/types-cjs/save-bar.d.cts +6 -0
  257. package/dist/types-cjs/saved-views.d.cts +12 -0
  258. package/dist/types-cjs/scatter-chart.d.cts +8 -0
  259. package/dist/types-cjs/schedule.d.cts +21 -0
  260. package/dist/types-cjs/secret-field.d.cts +6 -0
  261. package/dist/types-cjs/select.d.cts +12 -0
  262. package/dist/types-cjs/separator.d.cts +8 -1
  263. package/dist/types-cjs/sheet.d.cts +19 -0
  264. package/dist/types-cjs/sparkline.d.cts +6 -0
  265. package/dist/types-cjs/split-button.d.cts +7 -0
  266. package/dist/types-cjs/stat.d.cts +7 -0
  267. package/dist/types-cjs/stepper.d.cts +12 -0
  268. package/dist/types-cjs/suggestions.d.cts +10 -0
  269. package/dist/types-cjs/sync-indicator.d.cts +8 -0
  270. package/dist/types-cjs/tag-input.d.cts +8 -0
  271. package/dist/types-cjs/terminal.d.cts +6 -0
  272. package/dist/types-cjs/thread-list.d.cts +16 -0
  273. package/dist/types-cjs/time-input.d.cts +6 -0
  274. package/dist/types-cjs/timeline.d.cts +9 -0
  275. package/dist/types-cjs/toggle.d.cts +6 -0
  276. package/dist/types-cjs/toolbar.d.cts +20 -0
  277. package/dist/types-cjs/tour.d.cts +10 -0
  278. package/dist/types-cjs/trace.d.cts +16 -0
  279. package/dist/types-cjs/tree.d.cts +21 -0
  280. package/package.json +1 -1
@@ -160,6 +160,21 @@ export declare const LoadingStyleContext: React.Context<"sweep" | "breath">;
160
160
  export declare const ModeContext: React.Context<AppMode | null>;
161
161
  /** The mode's name as a plate, for headers of things that float above the page (Dialog, Sheet). */
162
162
  export declare function ModePlate(): React.JSX.Element | null;
163
+ /**
164
+ * @example
165
+ * ```tsx
166
+ * import { AltitudeProvider, Badge, Button, Input, Switch } from 'altitude-design';
167
+ *
168
+ * <AltitudeProvider key={i} scheme={s} accent={accent} className="shell"><div className="scheme">
169
+ * <h4>{typeof s === 'string' ? s[0].toUpperCase() + s.slice(1) : 'Custom'}</h4>
170
+ * <small>{accent ? 'accent="' + accent + '"' : typeof s === 'string' ? 'scheme="' + s + '"' : 'scheme={paper}'}</small>
171
+ * <Button variant="primary" size="sm">Publish</Button>
172
+ * <Input size="sm" placeholder="Search" aria-label="Search" />
173
+ * <div style={{ display: 'flex', gap: 10, alignItems: 'center' }}><Switch defaultChecked aria-label="Enabled" /><Badge tone="accent">Beta</Badge></div>
174
+ * <div className="series">{[1, 2, 3, 4, 5, 6].map((n) => <span key={n} style={{ background: `var(--data-${n})` }} />)}<small>{accent ? 'data-1…6, led by the accent' : 'data-1…6'}</small></div>
175
+ * </div></AltitudeProvider>
176
+ * ```
177
+ */
163
178
  export declare function AltitudeProvider({ scheme, accent, motion, contrast, density, recede, approach, loading, mode, devChecks, className, style, children, ...rest }: AltitudeProviderProps): React.JSX.Element;
164
179
  /** Renders into the provider's layer host (inside the theme, outside the receding stage), else document.body. */
165
180
  export declare function Layer({ children }: {
@@ -207,6 +222,14 @@ export interface SurfaceProps extends React.HTMLAttributes<HTMLElement>, DepthPr
207
222
  href?: string;
208
223
  as?: keyof React.JSX.IntrinsicElements;
209
224
  }
225
+ /**
226
+ * @example
227
+ * ```tsx
228
+ * import { Surface } from 'altitude-design';
229
+ *
230
+ * <Surface level={-1} className="s"><b>level={'{-1}'}</b><span>A well. Holds things; never lifts.</span></Surface>
231
+ * ```
232
+ */
210
233
  export declare const Surface: React.ForwardRefExoticComponent<SurfaceProps & React.RefAttributes<HTMLElement>>;
211
234
  /**
212
235
  * Keep an anchored floating panel (a tooltip, popover, menu, hover card, list) inside the viewport (#248): when it
@@ -252,5 +275,13 @@ export interface KbdProps extends React.HTMLAttributes<HTMLElement> {
252
275
  */
253
276
  hideOnTouch?: boolean;
254
277
  }
278
+ /**
279
+ * @example
280
+ * ```tsx
281
+ * import { Kbd } from 'altitude-design';
282
+ *
283
+ * <Kbd listen="Meta">⌘</Kbd>
284
+ * ```
285
+ */
255
286
  export declare function Kbd({ listen, hideOnTouch, className, children, ...rest }: KbdProps): React.JSX.Element | null;
256
287
  export {};
@@ -72,5 +72,30 @@ export interface DataGridProps<T> {
72
72
  * edited opens into a well clipped to the cell; an invalid value deepens to a trench; when a value lands the floor
73
73
  * rises flush and the cell settles. A pending cell holds a small raised plate; a failed one drops to a trench. Range
74
74
  * selection is a tint, not a height: choosing a target isn't live content.
75
+ * @example
76
+ * ```tsx
77
+ * import { Badge, DataGrid, Select } from 'altitude-design';
78
+ *
79
+ * <DataGrid aria-label="Inventory" rows={rows} getRowId={r => r.id} getRowLabel={r => r.name}
80
+ * columns={[
81
+ * { key: 'name', header: 'Name', editable: true, validate: v => String(v).trim() ? undefined : 'Enter a name.' },
82
+ * { key: 'sku', header: 'SKU' },
83
+ * { key: 'price', header: 'Price', align: 'end', editable: true, parse: t => t.trim() === '' ? '' : Number(t), format: dgMoney,
84
+ * validate: v => v === '' || !Number.isFinite(v) || v < 0 ? 'Use a price of 0 or more.' : undefined, cell: r => `$${r.price}` },
85
+ * { key: 'stock', header: 'Stock', align: 'end', editable: true, parse: t => t.trim() === '' ? 0 : Number(t), format: dgMoney,
86
+ * validate: v => Number.isInteger(v) && v >= 0 ? undefined : 'Use a whole number, 0 or more.' },
87
+ * { key: 'status', header: 'Status', editable: true, format: v => DG_STATUS.find(s => s.value === v)?.label ?? '',
88
+ * cell: r => <Badge tone={r.status === 'active' ? 'positive' : r.status === 'paused' ? 'caution' : 'neutral'}>{DG_STATUS.find(s => s.value === r.status).label}</Badge>,
89
+ * editor: control => <Select {...control} items={DG_STATUS} size="sm" defaultOpen /> },
90
+ * ]}
91
+ * onCellSave={async change => {
92
+ * await dgWait(250);
93
+ * // The demo service locks the lamp's price during a sale.
94
+ * if (change.rowId === 'p1' && change.key === 'price') return { ok: false, error: 'The Desk lamp price is locked during the sale.' };
95
+ * apply([change]); return { ok: true };
96
+ * }}
97
+ * onCellsSave={async changes => { await dgWait(300); apply(changes); return { ok: true }; }}
98
+ * onUndo={last => apply(last.map(c => ({ ...c, draft: c.previousValue })))} />
99
+ * ```
75
100
  */
76
101
  export declare function DataGrid<T>({ rows, columns, getRowId, getRowLabel, onCellSave, onCellsSave, onUndo, showInvalid, maxHeight, className, ...aria }: DataGridProps<T>): React.JSX.Element;
@@ -89,6 +89,12 @@ export interface DateRangePickerProps extends PickerBase {
89
89
  /**
90
90
  * A date in a field, typed or picked. The field is an opening built like Select; its floor rises flush once it holds a
91
91
  * date. The calendar floats at level 3; days are flush and the chosen one carries the raised accent mark.
92
+ * @example
93
+ * ```tsx
94
+ * import { DatePicker } from 'altitude-design';
95
+ *
96
+ * <DatePicker value={due} onValueChange={setDue} min={DP_TODAY} isUnavailable={weekend} locale="en-GB" defaultOpen />
97
+ * ```
92
98
  */
93
99
  export declare function DatePicker({ value, defaultValue, onValueChange, min, max, isUnavailable, locale, weekStartsOn, id, name, disabled, required, invalid, size, className, defaultOpen, ...aria }: DatePickerProps): React.JSX.Element;
94
100
  /** Two dates as one span. In the calendar the span is a sunk track between two raised ends, the Slider's build. */
@@ -49,6 +49,14 @@ export declare function diffChanges(ops: Op[]): Change[];
49
49
  * What changed between two versions, in signs and words. Both versions are the record, so it lies flush. Additions are
50
50
  * positive-soft with a + sign and "Added", removals critical-soft, struck through, with − and "Removed"; a changed
51
51
  * property shows the old value struck through beside the new. Long unchanged runs fold behind lids. Never colour alone.
52
+ * @example
53
+ * ```tsx
54
+ * import { DiffView, diffChanges, diffLines } from 'altitude-design';
55
+ *
56
+ * <DiffView caption="src/pricing.ts · proposed by the assistant" before={pricingBefore} after={pricingAfter} review decisions={decisions}
57
+ * onDecide={(id, d) => setDecisions({ ...decisions, [id]: d })}
58
+ * onDecideAll={(d) => setDecisions(Object.fromEntries(diffChanges(diffLines(pricingBefore, pricingAfter)).map((c) => [c.id, decisions[c.id] ?? d])))} />
59
+ * ```
52
60
  */
53
61
  export declare function DiffView({ mode, before, after, fields, context, caption, hunks, review, decisions, onDecide, onDecideAll, className }: DiffViewProps): React.JSX.Element;
54
62
  export {};
@@ -47,6 +47,12 @@ export interface DotPlotProps {
47
47
  * the ground, as a ScatterChart's do: at least 8px, a marker shape per series, ringed 2px in the plot's colour. With no
48
48
  * zero there's no ground line. A spread is a flat band behind its dot, never error bars; a dumbbell joins a hollow
49
49
  * "from" dot to a filled "to" dot with a 2px ink-muted link.
50
+ * @example
51
+ * ```tsx
52
+ * import { DotPlot } from 'altitude-design';
53
+ *
54
+ * <DotPlot data={services} x="service" range={['p10', 'p90']} rangeLabel="10th–90th percentile" sort="desc" />
55
+ * ```
50
56
  */
51
57
  export declare function DotPlot(props: DotPlotProps): React.JSX.Element | null;
52
58
  export declare namespace DotPlot {
@@ -83,6 +83,29 @@ export interface EditRegionBinder<T> {
83
83
  * record on the ground; Edit lifts it into a static raised editor holding the fields. The editor's padding is there in
84
84
  * both modes (with a negative margin), so lifting changes colour and shadow, never position. The session follows
85
85
  * InlineEdit: no save on blur, one write in flight, a known failure keeps the draft, and an outside change blocks Save.
86
+ * @example
87
+ * ```tsx
88
+ * import { EditRegion, EditRegionForm, EditRegionValue, EditRegionView, Field, Input, Select, Switch } from 'altitude-design';
89
+ *
90
+ * <EditRegion layout="in-place" label={person.name} editLabel={`Edit ${person.name}`} value={erFields(person)} validate={validate}
91
+ * onValueChange={canonical => setPeople(people => people.map(p => p.id === person.id ? { ...server.current.get(person.id), ...canonical } : p))}
92
+ * onSave={save(person)}>
93
+ * <EditRegionView>
94
+ * <span className="er-name"><EditRegionValue field="name">{person.name}</EditRegionValue></span>
95
+ * <span className="er-meta"><EditRegionValue field="email">{person.email}</EditRegionValue> · <EditRegionValue field="role">{ER_ROLES.find(r => r.value === person.role).label}</EditRegionValue>{person.notify ? <> · <EditRegionValue field="notify">Gets updates</EditRegionValue></> : ''}</span>
96
+ * </EditRegionView>
97
+ * <EditRegionForm>
98
+ * {field => <>
99
+ * <div className="er-name-edit"><Field label="Name" required error={field.error('name')}><Input {...field('name')} autoComplete="off" /></Field></div>
100
+ * <div className="er-meta-edit">
101
+ * <Field label="Email" required error={field.error('email')}><Input {...field('email')} type="email" autoComplete="off" /></Field>
102
+ * <Field label="Role"><Select {...field.value('role')} items={ER_ROLES} /></Field>
103
+ * <Switch {...field.checked('notify')} label="Gets updates" />
104
+ * </div>
105
+ * </>}
106
+ * </EditRegionForm>
107
+ * </EditRegion>
108
+ * ```
86
109
  */
87
110
  export declare function EditRegion<T extends Record<string, unknown>>({ label, value, onValueChange, onSave, validate, open: openProp, defaultOpen, onOpenChange, disabled, initialFocus, focusFallback, isEqual, editLabel, saveLabel, cancelLabel, settleDuration, layout, className, children }: EditRegionProps<T>): React.JSX.Element;
88
111
  /** Read mode: the record as text. Shows an Edit button after it unless `trigger={false}` (then place EditRegionTrigger yourself). */
@@ -20,5 +20,14 @@ export interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLElement>,
20
20
  /**
21
21
  * An opening the first record will fill. Nothing here yet is a well cut into the page (not a raised card, not an
22
22
  * alert), with a dashed rim, a title that names what's empty and one next action standing in it.
23
+ * @example
24
+ * ```tsx
25
+ * import { Button, EmptyState } from 'altitude-design';
26
+ *
27
+ * <EmptyState icon={<Gift />} title="No gift ideas yet" headingLevel={2}
28
+ * description="Ideas you save stay private to you until you share them."
29
+ * action={<Button variant="primary">Add idea</Button>}
30
+ * secondary={<Button variant="ghost">Import a list</Button>} />
31
+ * ```
23
32
  */
24
33
  export declare function EmptyState({ icon, title, description, action, secondary, size, headingLevel, announce, className, children, ...rest }: EmptyStateProps): React.JSX.Element;
@@ -18,5 +18,13 @@ export interface FeatureGateProps {
18
18
  * A feature that needs another plan, shown as locked rather than disabled. Disabled means nothing happens; a locked
19
19
  * control does something (it explains the plan and offers the upgrade), so it stays live: normal ink, it lifts when
20
20
  * pointed at, it's reachable, and it carries a lock and a plan plate. Pressing it opens a Popover.
21
+ * @example
22
+ * ```tsx
23
+ * import { Button, FeatureGate } from 'altitude-design';
24
+ *
25
+ * <FeatureGate requires="Business" description="Export any view to CSV, and schedule exports by email." onUpgrade={() => setSaid('Opening plans…')} compareHref="#/billing/plans">
26
+ * <Button variant="secondary">Export to CSV</Button>
27
+ * </FeatureGate>
28
+ * ```
21
29
  */
22
30
  export declare function FeatureGate({ requires, description, onUpgrade, compareHref, canUpgrade, children, className }: FeatureGateProps): React.JSX.Element;
@@ -62,4 +62,12 @@ export declare const filterValueText: (f: FilterField, v: FilterValue) => string
62
62
  */
63
63
  /** The whole expression in words: "Plan is Pro and any of: Country is Germany, Seats > 50". */
64
64
  export declare function filterSentence(fields: FilterField[], value: Filter[] | FilterTree, match?: 'all' | 'any'): string;
65
+ /**
66
+ * @example
67
+ * ```tsx
68
+ * import { FilterBar } from 'altitude-design';
69
+ *
70
+ * <FilterBar aria-label="Filter issues" fields={FB_FIELDS} value={filters} onValueChange={setFilters} match={match} onMatchChange={setMatch} resultCount={count} />
71
+ * ```
72
+ */
65
73
  export declare function FilterBar(props: FilterBarProps): React.JSX.Element;
@@ -34,5 +34,11 @@ export interface FormattedNumberProps extends FormatNumberOptions {
34
34
  /**
35
35
  * A number is the record, so it lies flush: tabular figures, the exact value on hand when it's rounded or abbreviated,
36
36
  * and units spoken in words. A changed value cross-fades and settles with the afterglow; it never counts.
37
+ * @example
38
+ * ```tsx
39
+ * import { FormattedNumber } from 'altitude-design';
40
+ *
41
+ * <FormattedNumber value={4900} format="currency" currency="EUR" locale="en-IE" />
42
+ * ```
37
43
  */
38
44
  export declare function FormattedNumber({ value, className, style, id, title, ...options }: FormattedNumberProps): React.JSX.Element;
@@ -50,6 +50,12 @@ export interface HeatmapProps {
50
50
  * record, so they lie flat on the plot: a data-seq step (or data-div around a midpoint), parted by 2px of the plot's
51
51
  * own colour, never raised, never shaded. Each step also has a pattern density for forced colours and print, and its
52
52
  * range in words in the legend, the cell's name and the table.
53
+ * @example
54
+ * ```tsx
55
+ * import { Heatmap } from 'altitude-design';
56
+ *
57
+ * <Heatmap variant="calendar" data={commits} date="day" value="count" bins={[0, 1, 4, 10]} />
58
+ * ```
53
59
  */
54
60
  export declare function Heatmap(props: HeatmapProps): React.JSX.Element | null;
55
61
  export declare namespace Heatmap {
@@ -21,6 +21,12 @@ export interface InlineCitationProps {
21
21
  * A numbered source marker in generated text. A citation is part of the record, so it's a small flush plate (the
22
22
  * ChartAnnotation build) in the text; it acts, so it lifts one level when pointed at, and a HoverCard previews the
23
23
  * source on hover and on focus. Named "Source 2: Billing FAQ", never "[2]".
24
+ * @example
25
+ * ```tsx
26
+ * import { InlineCitation } from 'altitude-design';
27
+ *
28
+ * <InlineCitation index={1} source={sources[0]} />
29
+ * ```
24
30
  */
25
31
  export declare function InlineCitation({ index, source, href, idPrefix, className }: InlineCitationProps): React.JSX.Element;
26
32
  export interface SourcesProps {
@@ -67,5 +67,12 @@ export interface InlineEditProps<V = string> {
67
67
  * One local editing session. The application remains the sole owner of the committed value and write. Editing happens
68
68
  * in place: the value's text sits in a slot with the control's own inset and font, so when the control opens there, the
69
69
  * text doesn't move; only the well (floor, walls, border) fades in around it. Whatever still changes size glides.
70
+ * @example
71
+ * ```tsx
72
+ * import { InlineEdit } from 'altitude-design';
73
+ *
74
+ * <InlineEdit label="Description" value={task.description} onValueChange={publish('description')} onSave={save('description')}
75
+ * multiline rows={3} maxRows={8} maxLength={500} />
76
+ * ```
70
77
  */
71
78
  export declare function InlineEdit<V = string>({ value, onValueChange, onSave, label, validate, required, maxLength, disabled, editLabel, saveLabel, cancelLabel, focusFallback, className, renderValue, editor, commit, isEqual, multiline, rows, maxRows, trigger: triggerMode, hint, emptyLabel, shortcut, settleDuration }: InlineEditProps<V>): React.ReactElement;
@@ -22,6 +22,17 @@ export interface InputOTPProps extends Omit<React.InputHTMLAttributes<HTMLInputE
22
22
  * A one-time code as a row of openings that fill. One real input (inputmode numeric, autocomplete one-time-code) drives
23
23
  * the slots, so autofill, paste and screen readers see one field; each slot is a well whose floor rises flush as its
24
24
  * character lands, and a rejected code drops the whole row to a trench.
25
+ * @example
26
+ * ```tsx
27
+ * import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from 'altitude-design';
28
+ *
29
+ * <InputOTP maxLength={6} value={code} verifying={state === 'verifying'}
30
+ * onChange={(c) => { setCode(c); if (state === 'wrong') setState('idle'); }} onComplete={verify}>
31
+ * <InputOTPGroup>{[0, 1, 2].map((i) => <InputOTPSlot key={i} index={i} />)}</InputOTPGroup>
32
+ * <InputOTPSeparator />
33
+ * <InputOTPGroup>{[3, 4, 5].map((i) => <InputOTPSlot key={i} index={i} />)}</InputOTPGroup>
34
+ * </InputOTP>
35
+ * ```
25
36
  */
26
37
  export declare const InputOTP: React.ForwardRefExoticComponent<InputOTPProps & React.RefAttributes<HTMLInputElement>>;
27
38
  /** Slots that sit together, parted from the next group by an InputOTPSeparator. */
@@ -80,6 +80,35 @@ export interface ItemGroupProps<T extends Record<string, unknown>> {
80
80
  * A list of slats changed in the list itself. Slats are the record, flush on the ground with line dividers. One slat
81
81
  * at a time lifts into its editor (EditRegion), its neighbours flush and readable; the add slat is an opening; a slat
82
82
  * picked up to reorder floats at level 3 over its slot. Removal follows the application's stated policy.
83
+ * @example
84
+ * ```tsx
85
+ * import { Button, Field, Input, Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle } from 'altitude-design';
86
+ *
87
+ * <ItemGroup aria-labelledby="ig-hooks" items={hooks} getKey={h => h.id} getLabel={h => h.name}
88
+ * renderItem={(h, { editProps, removeProps }) => <Item>
89
+ * <ItemMedia><HookIcon /></ItemMedia>
90
+ * <ItemContent><ItemTitle>{h.name}</ItemTitle><ItemDescription className="ig-url">{h.url}</ItemDescription></ItemContent>
91
+ * <ItemActions><Button size="sm" variant="ghost" {...editProps}>Edit</Button><Button size="sm" variant="ghost" {...removeProps}>Remove</Button></ItemActions>
92
+ * </Item>}
93
+ * renderEditor={field => <>
94
+ * <Field label="Name" required error={field.error('name')}><Input {...field('name')} /></Field>
95
+ * <Field label="Endpoint URL" required error={field.error('url')}><Input {...field('url')} type="url" /></Field>
96
+ * </>}
97
+ * onSave={async (draft, { previousValue }) => {
98
+ * const errors = validate(draft); if (Object.keys(errors).length) return { ok: false, error: 'Check the highlighted fields.', fieldErrors: errors };
99
+ * await igWait(300); return { ok: true, value: { ...draft, name: draft.name.trim(), revision: previousValue.revision + 1 } };
100
+ * }}
101
+ * onItemChange={h => setHooks(list => list.map(x => x.id === h.id ? h : x))}
102
+ * newItem={() => ({ id: '', name: '', url: 'https://', revision: 0 })}
103
+ * onCreate={async draft => {
104
+ * const errors = validate(draft); if (Object.keys(errors).length) return { ok: false, error: 'Check the highlighted fields.', fieldErrors: errors };
105
+ * await igWait(300); const hook = { ...draft, id: 'n' + ++seq.current, name: draft.name.trim(), revision: 1 }; setHooks(list => [...list, hook]); return { ok: true, value: hook };
106
+ * }}
107
+ * addLabel="Add webhook"
108
+ * onReorder={async next => { await igWait(200); setHooks(next); }}
109
+ * onRemove={async h => { await igWait(200); trash.current.set(h.id, hooks.indexOf(h)); setHooks(list => list.filter(x => x.id !== h.id)); }}
110
+ * removal={{ kind: 'recoverable', undo: h => setHooks(list => { const next = [...list]; next.splice(trash.current.get(h.id) ?? next.length, 0, h); return next; }) }} />
111
+ * ```
83
112
  */
84
113
  export declare function ItemGroup<T extends Record<string, unknown>>({ items, getKey, getLabel, renderItem, renderEditor, onSave, onItemChange, newItem, onCreate, addLabel, onReorder, onRemove, removal, empty, className, ...aria }: ItemGroupProps<T>): React.JSX.Element;
85
114
  export declare function Item({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
@@ -109,6 +109,12 @@ export declare function linePath(points: Array<[number, number] | null>, curve?:
109
109
  * Change over time for one to four series. Lines are the record: 2px strokes in their series' colours, round joins,
110
110
  * no fill, no glow. A missing value breaks the line. The last point carries a marker and each line is named at its
111
111
  * end, so the legend is the lines themselves.
112
+ * @example
113
+ * ```tsx
114
+ * import { LineChart } from 'altitude-design';
115
+ *
116
+ * <LineChart data={latency} x="t" y={{ format: (ms) => `${ms} ms` }} />
117
+ * ```
112
118
  */
113
119
  export declare function LineChart({ curve, endLabels, band, compare }: LineChartProps): React.JSX.Element;
114
120
  export declare namespace LineChart {
@@ -7,5 +7,12 @@ export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
7
7
  /** Mark links already followed: their underline turns ink-muted. Off by default; use it in long lists of documents. */
8
8
  visited?: boolean;
9
9
  }
10
- /** Navigation in accent-ink with an underline. A link is text in the record, so it never lifts: hover thickens the underline. */
10
+ /** Navigation in accent-ink with an underline. A link is text in the record, so it never lifts: hover thickens the underline.
11
+ * @example
12
+ * ```tsx
13
+ * import { Link } from 'altitude-design';
14
+ *
15
+ * <Link href="#webhooks">Read about webhooks</Link>
16
+ * ```
17
+ */
11
18
  export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
@@ -83,6 +83,12 @@ export declare function parseMarkdown(source: string, { streaming, allowHtml }?:
83
83
  * An answer's Markdown, set as Altitude prose: the record's typography, adding no height. Code is CodeBlock, links are
84
84
  * Link, `[n]` markers are InlineCitation, tables use Table's flush rows, images rise from an imprint. While
85
85
  * `streaming`, unfinished constructs render as unfinished rather than as raw text.
86
+ * @example
87
+ * ```tsx
88
+ * import { Markdown } from 'altitude-design';
89
+ *
90
+ * <Markdown citations={sources}>{done}</Markdown>
91
+ * ```
86
92
  */
87
93
  export declare const Markdown: React.ForwardRefExoticComponent<MarkdownProps & React.RefAttributes<HTMLDivElement>>;
88
94
  export {};
@@ -39,5 +39,11 @@ export interface MeterProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
39
39
  * rises out of a trench because a task under way is live). Thresholds are 1px notches at the track's rim; past them
40
40
  * the fill turns caution or critical and the state is said in words, with a lamp that relights when it changes.
41
41
  * Segments show parts of a whole, the honest replacement for a donut.
42
+ * @example
43
+ * ```tsx
44
+ * import { Meter } from 'altitude-design';
45
+ *
46
+ * <Meter label="Storage" value={used} max={100} high={80} format={gb} />
47
+ * ```
42
48
  */
43
49
  export declare function Meter(props: MeterProps): React.JSX.Element;
@@ -21,5 +21,11 @@ export interface DrilldownProps extends React.HTMLAttributes<HTMLDivElement> {
21
21
  * Hierarchy as a stack. Each place you go into is laid on top of the one before: the breadcrumb
22
22
  * builds a staircase — every step stands on the same ground line and each deeper place is a taller
23
23
  * step — and the view sits on a pile whose thickness is how deep you are. Going back lifts sheets off the top.
24
+ * @example
25
+ * ```tsx
26
+ * import { Drilldown } from 'altitude-design';
27
+ *
28
+ * <Drilldown root={tree} />
29
+ * ```
24
30
  */
25
31
  export declare function Drilldown({ root, className, ...rest }: DrilldownProps): React.JSX.Element;
@@ -38,5 +38,11 @@ export interface NotificationCenterProps extends NotificationListProps {
38
38
  * A bell with a count that opens the list. The bell is live (a ghost button), the count floats (only a count wants
39
39
  * you), the panel floats at level 3 (a Sheet at level 4 on narrow screens), and the list in it lies on the ground.
40
40
  * New notifications are announced, batched, whether or not the panel is open.
41
+ * @example
42
+ * ```tsx
43
+ * import { NotificationCenter } from 'altitude-design';
44
+ *
45
+ * <NotificationCenter items={items} onMarkRead={markRead} onMarkAllRead={() => setItems((xs) => xs.map((x) => ({ ...x, read: true })))} preferencesHref="#/settings/notifications" />
46
+ * ```
41
47
  */
42
48
  export declare function NotificationCenter({ mobileBreakpoint, className, ...list }: NotificationCenterProps): React.JSX.Element;
@@ -26,5 +26,11 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
26
26
  * A number field: an opening that fills, with two small raised steppers in its end cap (push up, fill down). It reads
27
27
  * what's typed in the locale's own way, clamps to min and max when committed, and is a spinbutton with its unit in
28
28
  * aria-valuetext. The steppers aren't tab stops: the arrow keys step.
29
+ * @example
30
+ * ```tsx
31
+ * import { NumberInput } from 'altitude-design';
32
+ *
33
+ * <NumberInput value={seats} onValueChange={setSeats} min={1} max={500} incrementLabel="Increase seats" decrementLabel="Decrease seats" />
34
+ * ```
29
35
  */
30
36
  export declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -11,6 +11,14 @@ export interface TooltipProps {
11
11
  defaultOpen?: boolean;
12
12
  children: React.ReactElement<any>;
13
13
  }
14
+ /**
15
+ * @example
16
+ * ```tsx
17
+ * import { Button, Tooltip } from 'altitude-design';
18
+ *
19
+ * <Tooltip content="Bold ⌘B" defaultOpen><Button square variant="ghost" aria-label="Bold"><b>B</b></Button></Tooltip>
20
+ * ```
21
+ */
14
22
  export declare function Tooltip({ content, side, delay, defaultOpen, children }: TooltipProps): React.JSX.Element;
15
23
  export interface PopoverProps {
16
24
  trigger: React.ReactElement<any>;
@@ -23,6 +31,20 @@ export interface PopoverProps {
23
31
  className?: string;
24
32
  'aria-label'?: string;
25
33
  }
34
+ /**
35
+ * @example
36
+ * ```tsx
37
+ * import { Button, Field, Input, Popover } from 'altitude-design';
38
+ *
39
+ * <Popover defaultOpen aria-label="Share" trigger={<Button>Share</Button>}>
40
+ * <div className="col" style={{ width: 280, gap: 12 }}>
41
+ * <b style={{ font: '600 14px/20px var(--font-sans)' }}>Invite to project</b>
42
+ * <Field label="Email address"><Input size="sm" type="email" placeholder="name@company.com" /></Field>
43
+ * <div className="row" style={{ justifyContent: 'flex-end', gap: 8 }}><Button size="sm" variant="primary">Send invite</Button></div>
44
+ * </div>
45
+ * </Popover>
46
+ * ```
47
+ */
26
48
  export declare function Popover({ trigger, children, open, defaultOpen, onOpenChange, side, align, className, ...rest }: PopoverProps): React.JSX.Element;
27
49
  export interface MenuItem {
28
50
  type?: 'item';
@@ -77,6 +99,14 @@ export declare function MenuPanel({ items, id, state, side, align, className, st
77
99
  sheet?: boolean;
78
100
  title?: React.ReactNode;
79
101
  }): React.JSX.Element;
102
+ /**
103
+ * @example
104
+ * ```tsx
105
+ * import { Button, DropdownMenu, Icons } from 'altitude-design';
106
+ *
107
+ * <DropdownMenu defaultOpen items={items} trigger={<Button trailing={<Icons.ChevronDown />}>Actions</Button>} />
108
+ * ```
109
+ */
80
110
  export declare function DropdownMenu({ trigger, items, align, side, defaultOpen, className, presentation, title }: DropdownMenuProps): React.JSX.Element;
81
111
  export interface HoverCardProps {
82
112
  /** What you hover or focus: usually a link or an avatar. It must do its own job (navigate, open) without the card. */
@@ -98,6 +128,14 @@ export interface HoverCardProps {
98
128
  /**
99
129
  * A richer preview that rises from its trigger at level 3, after hover intent or on keyboard focus. It shares Tooltip's
100
130
  * warm-up: once one has shown, a neighbour opens at once. Its content is supplementary, never the only way to reach anything.
131
+ * @example
132
+ * ```tsx
133
+ * import { HoverCard } from 'altitude-design';
134
+ *
135
+ * <HoverCard defaultOpen={true} trigger={<a href="#mara">Mara Quist</a>}>
136
+ * <Card p={people.mara} />
137
+ * </HoverCard>
138
+ * ```
101
139
  */
102
140
  export declare function HoverCard({ trigger, children, side, align, openDelay, closeDelay, open, defaultOpen, onOpenChange, className }: HoverCardProps): React.JSX.Element;
103
141
  /** The summit is shared by every provider in the same document. */
@@ -147,6 +185,21 @@ export interface DialogProps {
147
185
  returnFocus?: () => HTMLElement | null;
148
186
  className?: string;
149
187
  }
188
+ /**
189
+ * @example
190
+ * ```tsx
191
+ * import { Alert, Button, Dialog } from 'altitude-design';
192
+ *
193
+ * <Dialog open={open} onOpenChange={setOpen} background={background} size="sm" title="Delete this file permanently?"
194
+ * description={`“${target?.name || ''}” will be removed. You won’t be able to restore it.`} focusSelector="[data-cancel]" returnFocus={() => heading.current}
195
+ * footer={<><Button data-cancel variant="ghost" onClick={() => setOpen(false)}>{busy ? 'Close' : 'Cancel'}</Button>
196
+ * <Button data-confirm variant="danger" disabled={busy || operation?.state === 'conflict'} onClick={confirm}>{busy ? operation?.state === 'checking' ? 'Checking deletion…' : 'Deleting…' : failed ? 'Try deleting again' : 'Delete permanently'}</Button></>}>
197
+ * <p className="body dialog-target">{target?.name}<br /><span className="cap">{target?.folder}</span></p>
198
+ * {busy && <p role="status">Deletion is in progress. Closing this dialog won’t cancel it.</p>}
199
+ * {failed && <Alert tone="critical" title="File not deleted">{operation.message}{operation.state === 'conflict' && <p>Latest file: {operation.current?.name || 'No longer available'}</p>}</Alert>}
200
+ * </Dialog>
201
+ * ```
202
+ */
150
203
  export declare function Dialog({ open, defaultOpen, onOpenChange, trigger, title, description, children, footer, size, dismissible, initialFocus, focusSelector, background, returnFocus, className }: DialogProps): React.JSX.Element;
151
204
  export type ToastTone = 'neutral' | 'positive' | 'caution' | 'critical';
152
205
  export interface ToastOptions {
@@ -165,6 +218,14 @@ export declare function toast(input: ToastOptions | string): number;
165
218
  export declare namespace toast {
166
219
  var dismiss: (id: number) => void;
167
220
  }
221
+ /**
222
+ * @example
223
+ * ```tsx
224
+ * import { Toaster } from 'altitude-design';
225
+ *
226
+ * <Toaster />
227
+ * ```
228
+ */
168
229
  export declare function Toaster({ className }: {
169
230
  className?: string;
170
231
  }): React.JSX.Element;
@@ -19,6 +19,20 @@ export interface PageHeaderProps extends Omit<React.HTMLAttributes<HTMLElement>,
19
19
  /**
20
20
  * The block every page opens with: breadcrumb, title, description, actions and tabs. The page's name is the record, so
21
21
  * the block lies on the ground; only its actions are live, and it has one slot for the primary action (law 1).
22
+ * @example
23
+ * ```tsx
24
+ * import { Breadcrumb, Button, PageHeader, PageHeaderDescription, PageHeaderTitle, Tabs, TabsList, TabsTrigger } from 'altitude-design';
25
+ *
26
+ * <PageHeader sticky
27
+ * breadcrumb={<Breadcrumb items={[{ label: 'Settings', href: '#/settings' }, { label: 'Members' }]} />}
28
+ * primary={<Button variant="primary">Invite members</Button>}
29
+ * actions={<Button variant="secondary">Export list</Button>}
30
+ * overflow={[{ label: 'Download audit log' }, { label: 'Members settings' }]}
31
+ * tabs={<Tabs variant="segmented" value={tab} onValueChange={setTab}><TabsList aria-label="Members sections"><TabsTrigger value="members">Members</TabsTrigger><TabsTrigger value="invites">Invitations</TabsTrigger><TabsTrigger value="roles">Roles</TabsTrigger></TabsList></Tabs>}>
32
+ * <PageHeaderTitle>Members</PageHeaderTitle>
33
+ * <PageHeaderDescription>People who can see and edit this workspace.</PageHeaderDescription>
34
+ * </PageHeader>
35
+ * ```
22
36
  */
23
37
  export declare function PageHeader({ breadcrumb, primary, actions, overflow, tabs, sticky, className, children, ...rest }: PageHeaderProps): React.JSX.Element;
24
38
  /** The page's h1. */
@@ -25,5 +25,11 @@ export interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>,
25
25
  /**
26
26
  * Move through pages of a collection. The page numbers sit in a trench and the current page is one raised thumb that
27
27
  * travels to it, as RadioGroup's does: "you are here, among these". They stay links (or buttons) in plain Tab order.
28
+ * @example
29
+ * ```tsx
30
+ * import { Pagination } from 'altitude-design';
31
+ *
32
+ * <Pagination page={page} pageCount={11} onPageChange={go} total={214} pageSize={20} noun="invoices" loading={loading} />
33
+ * ```
28
34
  */
29
35
  export declare function Pagination({ page, pageCount, onPageChange, total, pageSize, hrefFor, hasNext, siblings, loading, noun, locale, className, 'aria-label': label, ...rest }: PaginationProps): React.JSX.Element;
@@ -18,5 +18,11 @@ export interface PasswordInputProps extends Omit<InputProps, 'type' | 'trailing'
18
18
  * A password field: an Input with a reveal Toggle in its end cap, a caps-lock notice, and, when creating one, its
19
19
  * strength as a reading (a Meter, never a Progress) and its requirements stamped as met. Strength and requirements
20
20
  * describe the field and are announced politely once typing pauses.
21
+ * @example
22
+ * ```tsx
23
+ * import { PasswordInput } from 'altitude-design';
24
+ *
25
+ * <PasswordInput defaultValue="correct horse" />
26
+ * ```
21
27
  */
22
28
  export declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -30,5 +30,12 @@ export interface PermissionMatrixProps {
30
30
  * Roles against permissions. The grid is settled (the record of who can do what). An editable grant is a choice, built
31
31
  * like a Checkbox (a trench the accent pours into); an inherited or fixed grant is already decided, so it's a flush
32
32
  * stamped check, not a disabled box. The active cell is a ring, never a height. A grid: arrows move, Space toggles.
33
+ * @example
34
+ * ```tsx
35
+ * import { PermissionMatrix } from 'altitude-design';
36
+ *
37
+ * <PermissionMatrix aria-label="Role permissions" roles={roles} permissions={perms} value={grants} inherited={inherited}
38
+ * onChange={(role, perm, on) => new Promise((r) => setTimeout(() => { setGrants((g) => ({ ...g, [role]: { ...g[role], [perm]: on } })); r(); }, 600))} />
39
+ * ```
33
40
  */
34
41
  export declare function PermissionMatrix({ roles, permissions, value, inherited, onChange, 'aria-label': label, className }: PermissionMatrixProps): React.JSX.Element;
@@ -23,5 +23,11 @@ export interface PileProps<T = unknown> extends Omit<React.HTMLAttributes<HTMLDi
23
23
  * (the badge says exactly); reaching for it fans them a little. Click it and the items slide out from under
24
24
  * the top card over the page below it, each casting its own shadow; click one to choose it; click the top,
25
25
  * press Escape or click away and they slide back.
26
+ * @example
27
+ * ```tsx
28
+ * import { Pile } from 'altitude-design';
29
+ *
30
+ * <Pile count={1} className="p"><div className="face"><b>Drafts</b><span>1 document</span></div></Pile>
31
+ * ```
26
32
  */
27
33
  export declare function Pile<T>({ count, interactive, items, renderItem, getKey, onSelect, open, defaultOpen, onOpenChange, maxHeight, className, children, ...rest }: PileProps<T>): React.JSX.Element;
@@ -36,5 +36,11 @@ export interface PlanPickerProps {
36
36
  * Choose a plan. The plans are positions in one choice, so the cards lie flush and one raised mark travels to the chosen
37
37
  * one, as RadioGroup's thumb does. "Current plan" and "Recommended" are plates, not height: marketing emphasis isn't
38
38
  * importance. The only level-2 slab is your Continue button, outside it.
39
+ * @example
40
+ * ```tsx
41
+ * import { PlanPicker } from 'altitude-design';
42
+ *
43
+ * <PlanPicker plans={plans} value={plan} onValueChange={setPlan} current="free" recommended="pro" period={period} onPeriodChange={setPeriod} locale="en-IE" aria-label="Choose a plan" />
44
+ * ```
39
45
  */
40
46
  export declare function PlanPicker({ plans, value, defaultValue, onValueChange, current, recommended, period, onPeriodChange, locale, 'aria-label': label, className }: PlanPickerProps): React.JSX.Element;
@@ -57,6 +57,17 @@ export interface PromptInputProps extends Omit<React.FormHTMLAttributes<HTMLForm
57
57
  * deepens as the pointer nears, and once it holds text the floor rises flush. Send is the level-2 primary; while a
58
58
  * response is generating it becomes Stop in the same slot and size, so nothing moves. Enter sends, Shift+Enter adds a
59
59
  * line, and Enter during IME composition never sends.
60
+ * @example
61
+ * ```tsx
62
+ * import { PromptInput, PromptInputSubmit, PromptInputTextarea, PromptInputToolbar } from 'altitude-design';
63
+ *
64
+ * <PromptInput onSubmit={({ text, mentions, command }) => setSent(`${command ? `/${command} · ` : ''}${text}${mentions ? ` · context: ${mentions.map((m) => m.label).join(', ')}` : ''}`)}
65
+ * mentionable={(q) => new Promise((r) => setTimeout(() => r(context.filter((c) => c.label.toLowerCase().includes(q.toLowerCase()))), 250))}
66
+ * commands={[{ name: 'review', description: 'Review the current changes' }, { name: 'compact', description: 'Summarise the conversation so far' }, { name: 'clear', description: 'Start a new conversation' }]}>
67
+ * <PromptInputTextarea placeholder="@ to add context, / for commands" />
68
+ * <PromptInputToolbar><PromptInputSubmit /></PromptInputToolbar>
69
+ * </PromptInput>
70
+ * ```
60
71
  */
61
72
  export declare function PromptInput({ onSubmit, status, onStop, onQueue, mentionable, commands, value, onValueChange, onAttach, accept, className, children, ...rest }: PromptInputProps): React.JSX.Element;
62
73
  export interface PromptInputTextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'onChange'> {