altitude-design 0.2.1 → 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 +41 -6
  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 +3121 -244
  9. package/dist/altitude.iife.js +33 -5
  10. package/dist/altitude.no-fonts.css +3121 -244
  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 +18792 -1925
  104. package/dist/index.cjs.map +4 -4
  105. package/dist/index.js +18792 -1925
  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 +111 -4
  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 +100 -17
  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 +158 -15
  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 +51 -17
  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 +12 -1
  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 +89 -9
@@ -0,0 +1,570 @@
1
+ import * as React from 'react';
2
+ /** A categorical slot of the data palette. */
3
+ export type ChartSlot = `data-${1 | 2 | 3 | 4 | 5 | 6}` | 'data-other';
4
+ export interface ChartSeriesConfig {
5
+ /** The series' name, in the legend, the readout, the summary and the table. */
6
+ label: string;
7
+ /** Formats a value of this series: ticks, readouts, the summary. Default: Intl.NumberFormat. */
8
+ format?: (value: number) => string;
9
+ /** The series' colour slot. Default: its place in the config (the first is data-1); a seventh and later are data-other. */
10
+ color?: ChartSlot;
11
+ }
12
+ /** Each data key a chart draws, mapped to its label, format and colour slot. The order is the colour order, fixed for the chart's life. */
13
+ export type ChartConfig = Record<string, ChartSeriesConfig>;
14
+ export type ChartDatum = Record<string, unknown>;
15
+ /**
16
+ * Data that isn't yet the record (#67): `partial` is a period still being counted (this month so far), `projected` a
17
+ * value that hasn't happened (a forecast). Both are drawn hatched or dashed, never raised, and say so in words.
18
+ */
19
+ export type ChartStatus = 'partial' | 'projected';
20
+ /** The words each status says, in point names, the readout and the table. */
21
+ export declare const CHART_STATUS_WORDS: Record<ChartStatus, string>;
22
+ export interface ChartSeries {
23
+ key: string;
24
+ label: string;
25
+ slot: ChartSlot;
26
+ /** `var(--data-n)`: use it as a fill or stroke. The figure also sets `--color-<key>` to it. */
27
+ color: string;
28
+ format: (value: number) => string;
29
+ }
30
+ export interface LinearScale {
31
+ (value: number): number;
32
+ kind: 'linear';
33
+ domain: [number, number];
34
+ range: [number, number];
35
+ ticks: number[];
36
+ }
37
+ export interface TimeScale {
38
+ (value: string | number): number;
39
+ kind: 'time';
40
+ domain: [number, number];
41
+ range: [number, number];
42
+ ticks: number[];
43
+ }
44
+ export interface BandScale {
45
+ (value: string): number;
46
+ kind: 'band';
47
+ domain: string[];
48
+ range: [number, number];
49
+ ticks: string[];
50
+ bandwidth: number;
51
+ step: number;
52
+ }
53
+ export type ChartXScale = LinearScale | TimeScale | BandScale;
54
+ /** ISO 'YYYY-MM-DD' (or a full ISO timestamp), read as UTC, or epoch milliseconds. */
55
+ export declare function toTime(v: unknown): number;
56
+ export declare function textWidth(s: string): number;
57
+ /** A label cut with an ellipsis to fit max px. The full text stays in the summary, the readout and the table. */
58
+ export declare function fit(s: string, max: number, measure?: (s: string) => number): string;
59
+ export interface ChartContextValue {
60
+ /** The plot's size in px, inside the axes. Marks draw from (0, 0) at its top left. */
61
+ width: number;
62
+ height: number;
63
+ x: ChartXScale;
64
+ y: LinearScale;
65
+ /** Where a datum sits on x: a band's centre, or its time or value. */
66
+ xOf: (d: ChartDatum) => number;
67
+ /** The y of the ground line: y(0) when zero is in the domain, otherwise the plot's foot. */
68
+ ground: number;
69
+ /** The records as they're shown right now: while the data changes, values glide and leaving records linger. */
70
+ data: ChartDatum[];
71
+ xKey: string;
72
+ config: ChartConfig;
73
+ series: ChartSeries[];
74
+ /**
75
+ * How present a mark is, 0–1, while records or series enter and leave: multiply it into the mark's opacity. Pass
76
+ * the record, the series key, or both.
77
+ */
78
+ alpha: (d?: ChartDatum | null, seriesKey?: string) => number;
79
+ /** Formats a value of a series (by its key), or an x value. */
80
+ format: (key: string, value: number) => string;
81
+ formatX: (value: unknown) => string;
82
+ /**
83
+ * Categories run down the side and values along the bottom. `x` still places categories and `y` values; only their
84
+ * directions change: x(cat) is a distance from the top, y(v) from the left, and `ground` is y(0) across.
85
+ */
86
+ horizontal: boolean;
87
+ /** The series the keyboard is on, or null: chart types draw the others receded. */
88
+ emphasis: string | null;
89
+ /** The record the readout is on (pointed at, touched, or focused from the keyboard), or null. */
90
+ active: ChartDatum | null;
91
+ /** Put the readout on a record by its index in `data`, or take it away with null: for keyboard paths. */
92
+ setActive: (index: number | null) => void;
93
+ /**
94
+ * How to draw a series so it's told apart without colour: its fill (a hatch when patterns are on), stroke, dash and
95
+ * marker, fixed by its slot like its colour. Use these instead of `series.color` and every mode is handled. Pass the
96
+ * record for a mark that stands for one (a bar, a dot), so a record focus can set it in data-context.
97
+ */
98
+ encode: (seriesKey: string, d?: ChartDatum) => ChartEncoding;
99
+ /** Patterns are on: the `patterns` prop, forced colours or print. */
100
+ patterns: boolean;
101
+ /** Label series directly at their marks, not only in a legend: on under forced colours and in print. */
102
+ directLabels: boolean;
103
+ /** Line width (2, or 3 under contrast="more"), and the gap between adjacent marks (2, or 3). */
104
+ strokeWidth: number;
105
+ gap: number;
106
+ /** Whether a record is the record yet: undefined for settled data, or 'partial' / 'projected' (#67). */
107
+ status: (d: ChartDatum) => ChartStatus | undefined;
108
+ /** Some record has a status: chart types draw the not-yet-record parts with `encode(key).pending`. */
109
+ hasStatus: boolean;
110
+ /**
111
+ * The stretches of x that aren't yet the record, and those that are, in plot px, for clipping a line or an area: a
112
+ * segment is pending when either of its ends is. Empty `pending` when every record is settled.
113
+ */
114
+ statusRanges: {
115
+ record: Array<[number, number]>;
116
+ pending: Array<[number, number]>;
117
+ };
118
+ /** Filtered in place (#70): 'match', 'miss' or undefined (no filter). Misses recede; nothing is removed. */
119
+ relevance: (d: ChartDatum) => 'match' | 'miss' | undefined;
120
+ /** The chart was given a relevance: chart types wrap marks in a receding group (ChartRelevance) so changes cross-fade. */
121
+ hasRelevance: boolean;
122
+ /** For lines and areas: the stretch of x each record owns (to the midpoints with its neighbours), and whether it's a miss. */
123
+ relevanceRegions: Array<{
124
+ key: string;
125
+ x0: number;
126
+ x1: number;
127
+ miss: boolean;
128
+ }>;
129
+ /** Changed since a snapshot (#191): a mark's old value where it changed (null if it didn't, or is new), or null without `since`. */
130
+ sinceOld: ((d: ChartDatum, seriesKey: string) => number | null) | null;
131
+ }
132
+ export type ChartMarkerShape = 'circle' | 'square' | 'triangle' | 'diamond' | 'ring' | 'cross';
133
+ export interface ChartEncoding {
134
+ slot: ChartSlot;
135
+ /** Outside the chart's focus (#188): drawn in data-context (GrayText under forced colours), its label in ink-muted. */
136
+ context: boolean;
137
+ /** For bars and areas: the series colour, a hatch of it, or CanvasText under forced colours. */
138
+ fill: string;
139
+ /** For lines and outlines. */
140
+ stroke: string;
141
+ /** For a line: undefined is solid. Set only while patterns are on, except slot 1, which is always solid. */
142
+ dash?: string;
143
+ marker: ChartMarkerShape;
144
+ /** A 1px edge for a filled mark: ink under contrast="more", CanvasText under forced colours, otherwise none. */
145
+ edge?: string;
146
+ /**
147
+ * For a mark that isn't yet the record: a 45° hatch of the series colour on the plot's own colour, no solid fill.
148
+ * While patterns are on, a slot that already has a hatch keeps it, faded to `pendingOpacity`, so it stays told apart.
149
+ */
150
+ pending: string;
151
+ /** The fill-opacity to draw `pending` at: 1, or less for a slot's own hatch while patterns are on. */
152
+ pendingOpacity: number;
153
+ /** The dash a not-yet-record line takes: the slot's own dash while patterns are on, otherwise 5 4. */
154
+ pendingDash: string;
155
+ }
156
+ /** A series' marker, centred on (x, y): the shape its slot gives it, so points are told apart without colour. */
157
+ export declare function ChartMarker({ shape, x, y, size, color, ...rest }: {
158
+ shape: ChartMarkerShape;
159
+ x: number;
160
+ y: number;
161
+ size?: number;
162
+ color: string;
163
+ } & React.SVGProps<SVGElement>): React.JSX.Element;
164
+ /** A clip to stretches of x (from `statusRanges`), for drawing a line or an area's record and not-yet-record parts apart. */
165
+ export declare function ChartStatusClip({ id, ranges, height }: {
166
+ id: string;
167
+ ranges: Array<[number, number]>;
168
+ height: number;
169
+ }): React.JSX.Element;
170
+ /**
171
+ * A group that recedes when what it draws doesn't match the filter (#70): 35% opacity, cross-faded over dur-travel-1,
172
+ * never moved or recoloured. Wrap each mark (or each record's clipped stretch of a line) in one.
173
+ */
174
+ export declare function ChartRelevance({ miss, children, ...rest }: {
175
+ miss: boolean;
176
+ children?: React.ReactNode;
177
+ } & React.SVGProps<SVGGElement>): React.JSX.Element;
178
+ /** The scales, plot size and config of the nearest ChartContainer, for drawing your own marks. */
179
+ export declare function useChart(): ChartContextValue;
180
+ /**
181
+ * What a chart type tells its container, as a static `chartInfo` on the component: its name for the summary, how to
182
+ * place x, whether zero must be on y, and the y extent if it isn't the plain min and max of the series (a stack).
183
+ */
184
+ export interface ChartInfo {
185
+ kind?: string;
186
+ xScale?: 'band' | 'time' | 'linear';
187
+ zero?: boolean;
188
+ yExtent?: [number, number];
189
+ /** Categories down the side and values along the bottom (band x only). */
190
+ layout?: 'vertical' | 'horizontal';
191
+ /** The records as the chart wants them placed (sorted, say). Return the same array for the same input, or every render is a change. */
192
+ data?: ChartDatum[];
193
+ /** Formats the value axis only, when the axis isn't in the series' units (shares of a stack). */
194
+ yFormat?: (value: number) => string;
195
+ /** Formats every value (axis, readout, names, summary) of a series that has no format of its own. */
196
+ format?: (value: number) => string;
197
+ /**
198
+ * What the chart is about (#188): series keys that keep their colours while the rest take data-context, or a test
199
+ * for the records that keep theirs (bars, dots).
200
+ */
201
+ focus?: string[] | ((d: ChartDatum) => boolean);
202
+ /**
203
+ * Read against the record before (#189): the key holding each record's previous value, the series it's compared with
204
+ * (null: the stack's total), and the earlier period's name. Previous values join y and glide with the data.
205
+ */
206
+ compare?: {
207
+ key: string;
208
+ series: string | null;
209
+ label: string;
210
+ };
211
+ /** Readings can be pinned to the plot (#190): true for two, or how many. */
212
+ pinnable?: boolean | number;
213
+ /** The pinned readings' x values, controlled; and when they change. */
214
+ pins?: Array<string | number>;
215
+ onPinsChange?: (pins: Array<string | number>) => void;
216
+ /** Bank the plot's proportions to the data (#194): the chart type asked for aspect="banked". */
217
+ aspect?: 'banked';
218
+ /** Extra room at the plot's right edge, in px: for labels a chart sets beside its marks (a line's end label). */
219
+ right?: number;
220
+ /** How the legend draws this chart's series: a block (bars, areas) or a short line (lines). */
221
+ swatch?: 'rect' | 'line' | 'marker';
222
+ /** The imprint's shape while data loads. Default: a line for line swatches, bars otherwise. */
223
+ imprint?: 'bars' | 'line' | 'area' | 'grid' | 'dots';
224
+ /** Series are drawn bottom to top (a stack of areas): ↑ moves to the series above, ↓ to the one below. */
225
+ seriesUp?: boolean;
226
+ /** A stacked point names its share of the total ("31% of 3.9K") rather than only the total. */
227
+ share?: boolean;
228
+ /** Marks you can select (#69): the selected record's x, and what to do when a record is chosen (null clears). */
229
+ selected?: unknown;
230
+ onSelect?: (d: ChartDatum | null) => void;
231
+ /** Marks you drill into (#69): the id of the current Drilldown node's child that a record opens. */
232
+ drill?: (d: ChartDatum) => string | null | undefined;
233
+ /** Filter in place (#70): which records match. Misses recede to 35%, keeping their place and colour. */
234
+ relevance?: (d: ChartDatum) => 'match' | 'miss' | undefined;
235
+ /** Fit y to the matches rather than holding the axis. The rescale is staged as any is. */
236
+ rescale?: boolean;
237
+ /** Which records aren't yet the record (#67). */
238
+ status?: (d: ChartDatum) => ChartStatus | undefined;
239
+ /** The rule where the record ends and the rest begins: its word (default "Today"), or false for none. */
240
+ boundary?: string | false;
241
+ /** The x domain to show (a sliding window's span), instead of the records' extent. Time and linear x only. */
242
+ xDomain?: [number, number];
243
+ /** An uncertainty band around one series: its low and high keys, which also count toward y's extent. */
244
+ band?: {
245
+ series?: string;
246
+ low: string;
247
+ high: string;
248
+ label: string;
249
+ };
250
+ /** A record's identity, when x alone doesn't name it (a cell, a dot): keys motion, the table, selection and live changes. */
251
+ id?: (d: ChartDatum) => string;
252
+ /** A record's short name, for the readout's heading, the table and "Filtered to …". Default: its x, formatted. */
253
+ label?: (d: ChartDatum) => string;
254
+ /** The key the chart places along x, when it isn't an `x` prop (a calendar's date). */
255
+ x?: string;
256
+ /**
257
+ * The chart draws its own plot: 'grid' is cells over two categories, labelled by the chart, with no value axis,
258
+ * gridlines, ground line or crosshair; 'xy' is dots over two measures, found in two dimensions, with no crosshair.
259
+ * Either way the readout sits beside the mark.
260
+ */
261
+ plot?: 'grid' | 'xy';
262
+ /** Room above the plot for labels the chart sets itself (a measure's name over its axis), in px. */
263
+ top?: number;
264
+ /** Room below the axis for labels the chart sets itself (a measure's name under its axis), in px. */
265
+ bottom?: number;
266
+ /** Room at the plot's left for labels the chart sets itself (a grid's row names), in px. */
267
+ left?: number;
268
+ /** The plot's height for its width, when the content sets it (a calendar's weeks): replaces the aspect ratio. */
269
+ fitHeight?: (plotWidth: number) => number;
270
+ /** The keyboard goes from the summary straight to the records, without a series level (groups, or one value). */
271
+ flat?: boolean;
272
+ /**
273
+ * 'none': values change in place, and the chart type cross-fades its own marks (a heatmap's cells). 'fade': every
274
+ * change cross-fades, for records with no stable identity to glide by.
275
+ */
276
+ motion?: 'none' | 'fade';
277
+ /** Extra keys that glide with the values (a dot's x). */
278
+ glide?: string[];
279
+ /** The series, when they aren't the config's keys (a scatter's groups). The config then names the measures. */
280
+ series?: Array<{
281
+ key: string;
282
+ label: string;
283
+ color?: ChartSlot;
284
+ format?: (v: number) => string;
285
+ }>;
286
+ /** Formats x values (ticks, the readout), when the chart knows x's format (a measure in the config). */
287
+ xFormat?: (value: unknown) => string;
288
+ /** The table view's columns, when a column per series isn't the shape of the data. */
289
+ columns?: ChartColumn[];
290
+ /** The generated summary, when the chart type can say it better than a trend per series. */
291
+ summary?: string;
292
+ }
293
+ /** A column of the table view. */
294
+ export interface ChartColumn {
295
+ key: string;
296
+ header: string;
297
+ cell: (d: ChartDatum) => React.ReactNode;
298
+ sortValue?: (d: ChartDatum) => string | number;
299
+ align?: 'start' | 'end';
300
+ }
301
+ /** What a chart type puts in the readout instead of a row per series. */
302
+ export interface ChartReadout {
303
+ label: string;
304
+ items: ChartTooltipItem[];
305
+ indicator?: 'line' | 'dot';
306
+ }
307
+ export interface ChartTooltipItem {
308
+ key: string;
309
+ label: string;
310
+ value: number;
311
+ /** The value as its series formats it. */
312
+ text: string;
313
+ color: string;
314
+ dash?: string;
315
+ /** An uncertainty band's row ("80K–95K, Range"), keyed by a block of its fill rather than a stroke. */
316
+ range?: boolean;
317
+ }
318
+ export interface ChartTooltipContentProps {
319
+ /** How each row is keyed: a short stroke of the series colour (default), a dot, or a dashed stroke. */
320
+ indicator?: 'line' | 'dot' | 'dashed';
321
+ /** Formats the readout's heading, the x value. Default: the container's. */
322
+ labelFormat?: (x: unknown) => React.ReactNode;
323
+ hideLabel?: boolean;
324
+ hideIndicator?: boolean;
325
+ /** Filled in by the container: the x being read, and one item per shown series with a value there. */
326
+ label?: unknown;
327
+ payload?: ChartTooltipItem[];
328
+ /** Filled in by the container: formats x. */
329
+ formatX?: (x: unknown) => string;
330
+ /** Filled in by the container: "So far" or "Projected" when the record under the readout isn't yet the record. */
331
+ note?: string;
332
+ /** Filled in by the container: what a click does here ("Select to filter"), when marks act. Hover is a promise. */
333
+ action?: string;
334
+ }
335
+ /**
336
+ * The readout's rows: value first (ink, tabular), series name second (ink-muted), keyed by a short stroke of the
337
+ * series colour, which takes the series' dash when patterns are on. Labels are text, never HTML.
338
+ */
339
+ export declare function ChartTooltipContent({ indicator, labelFormat, hideLabel, hideIndicator, label, payload, formatX, note, action }: ChartTooltipContentProps): React.JSX.Element;
340
+ /**
341
+ * Puts your own content in a chart's readout. The readout is on for every chart by default; this only changes what it
342
+ * shows. Place it inside the chart type or the container: `<ChartTooltip content={<ChartTooltipContent indicator="dot" />} />`.
343
+ */
344
+ export declare function ChartTooltip(_: {
345
+ content?: React.ReactElement<ChartTooltipContentProps>;
346
+ }): null;
347
+ export declare namespace ChartTooltip {
348
+ var chartHtml: boolean;
349
+ var chartTooltip: boolean;
350
+ }
351
+ export interface ChartLegendItem {
352
+ key: string;
353
+ label: string;
354
+ fill: string;
355
+ stroke: string;
356
+ dash?: string;
357
+ hidden: boolean;
358
+ marker?: ChartMarkerShape;
359
+ /** Outside the chart's focus (#188): its label recedes to ink-muted. */
360
+ context?: boolean;
361
+ /** In the chart's focus: said as "highlighted". */
362
+ highlighted?: boolean;
363
+ }
364
+ export interface ChartLegendContentProps {
365
+ /** Let people hide and show series. Each key becomes a switch-like button in a toolbar. Default false: keys only name. */
366
+ toggle?: boolean;
367
+ /** The hidden series' keys, controlled. */
368
+ hidden?: string[];
369
+ /** The hidden series' keys to start with, uncontrolled. */
370
+ defaultHidden?: string[];
371
+ onHiddenChange?: (hidden: string[]) => void;
372
+ /** The toolbar's name. Default "Series". */
373
+ label?: string;
374
+ /** Filled in by the container. */
375
+ items?: ChartLegendItem[];
376
+ swatch?: 'rect' | 'line' | 'marker';
377
+ onToggle?: (key: string) => void;
378
+ }
379
+ /**
380
+ * The legend's keys. Without `toggle` they're labels, flush on the ground: a swatch in the series colour and its name
381
+ * in ink. With `toggle` each key is a choice, so it's built like a Checkbox: a trench the series colour pours into
382
+ * while the series is shown, inside a ghost button that lifts when pointed at. The keys form one toolbar (one Tab
383
+ * stop; ←/→ between keys), each an aria-pressed button; the last shown series can't be hidden.
384
+ */
385
+ export declare function ChartLegendContent({ toggle, label, items, swatch, onToggle }: ChartLegendContentProps): React.JSX.Element;
386
+ /** A legend for the chart: place it inside the chart type or the container, with its content. */
387
+ export declare function ChartLegend(_: {
388
+ content?: React.ReactElement<ChartLegendContentProps>;
389
+ }): null;
390
+ export declare namespace ChartLegend {
391
+ var chartHtml: boolean;
392
+ var chartLegend: boolean;
393
+ }
394
+ /**
395
+ * The record before, to read each value against (#189): a field on the same record (`key`), or records matched by x
396
+ * position (`data`, for a shifted period on a time axis), named by `label` ("August", "Last week"). `series` is the
397
+ * one compared, by default the first; a stack is compared by its total.
398
+ */
399
+ export interface ChartCompare {
400
+ key?: string;
401
+ data?: ChartDatum[];
402
+ label: string;
403
+ series?: string;
404
+ }
405
+ /** Where a matched earlier period's value is kept on each record. */
406
+ export declare const COMPARE_KEY = "__compare";
407
+ /**
408
+ * Each record with its earlier value under COMPARE_KEY: the sum of `keys` on the record at the same position in
409
+ * `before`. The same arrays give the same result, so it isn't mistaken for a change.
410
+ */
411
+ export declare function withCompare(rows: ChartDatum[], before: ChartDatum[], keys: string[]): ChartDatum[];
412
+ /** A change in words: "+10.6%", or the difference itself when the earlier value is zero. */
413
+ export declare function changeWords(now: number, before: number, format: (v: number) => string): string;
414
+ export interface ChartReferenceProps {
415
+ /** Where on the value axis: a value (a line), a range [low, high] (a band), or the 'mean' or 'median' of a series. */
416
+ y: number | [number, number] | 'mean' | 'median';
417
+ /** What it is, in words: "Target 99.9%", "Normal range", "Average". A mean or median adds its value. */
418
+ label: string;
419
+ /** A threshold that means good or bad: the line wears caution or critical, and its label the status icon. */
420
+ tone?: 'caution' | 'critical';
421
+ /** The series a mean or median is read from. Default: the first shown. */
422
+ series?: string;
423
+ }
424
+ /**
425
+ * Something to read the chart against: a target, a limit, a normal range, the average. A line is 1px ink-muted and
426
+ * solid (dashes mean "projected"), labelled at its right end; a band is a flat line-coloured fill, labelled inside.
427
+ * Place it inside the chart type or the container. The container draws it, so labels stay clear of each other and of
428
+ * the marks.
429
+ */
430
+ export declare function ChartReference(_: ChartReferenceProps): null;
431
+ export declare namespace ChartReference {
432
+ var chartHtml: boolean;
433
+ var chartReference: boolean;
434
+ }
435
+ export interface ChartAnnotationProps {
436
+ /** Where on x: a date, a number or a category, as the data's x values are written. */
437
+ x: string | number;
438
+ /** The event, in a few words: "v2 launch". */
439
+ label: string;
440
+ /** Makes the plate a button, which lifts one level when pointed at. */
441
+ onSelect?: () => void;
442
+ }
443
+ /**
444
+ * An event on x ("the day we shipped v2"): a Badge plate flush at the top of the plot with a 1px line-control leader
445
+ * down to its x. Plates that would overlap stack into rows, above the data. Listed after the summary for screen readers.
446
+ */
447
+ export declare function ChartAnnotation(_: ChartAnnotationProps): null;
448
+ export declare namespace ChartAnnotation {
449
+ var chartHtml: boolean;
450
+ var chartAnnotation: boolean;
451
+ }
452
+ /** Where a change is: the axis rescaling, the marks gliding to their values, or a cross-fade. */
453
+ export type ChartStage = 'rescale' | 'values' | 'fade';
454
+ export interface ChartContainerProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
455
+ config: ChartConfig;
456
+ /**
457
+ * The records. Optional when the chart inside takes `data` itself. `undefined` or a promise: the chart's imprint
458
+ * until they land. `null` or `[]`: an EmptyState. A rejected promise goes to your error boundary.
459
+ */
460
+ data?: ChartDatum[] | null | PromiseLike<ChartDatum[] | null>;
461
+ /** The key of x in each record. Optional when the chart inside takes `x`. */
462
+ x?: string;
463
+ /** How x is placed. Default: time for ISO dates, epoch numbers or Dates; linear for other numbers; band otherwise. */
464
+ xScale?: 'band' | 'time' | 'linear';
465
+ /**
466
+ * Width ÷ height of the plot. Default 2, unless `height` is set. 'banked' (#194): the line chart's segments set it,
467
+ * banked to an average of 45° so slopes read accurately, between 1 and 4 for the data area; the width is the card's.
468
+ */
469
+ aspect?: number | 'banked';
470
+ /** The plot's height in px, instead of an aspect ratio. */
471
+ height?: number;
472
+ /** A visible name, inside the figure. Leave it out when a CardTitle names the chart, and pass `aria-labelledby`. */
473
+ title?: React.ReactNode;
474
+ /**
475
+ * The one thing the chart says, as its heading: "Cedar shipped twice as often as Delta in March" (#187). The title
476
+ * then sits above it as a small label, so the chart is still named; screen readers hear the title, then this, then
477
+ * the summary. Write it from the data shown, a trend or a comparison rather than the encoding. It's never generated.
478
+ */
479
+ takeaway?: React.ReactNode;
480
+ description?: React.ReactNode;
481
+ /** What the chart shows, in a sentence or two: "Revenue rose 18% while costs held flat." Shown under the plot. Without it a summary is generated for screen readers. */
482
+ summary?: React.ReactNode;
483
+ /** Force zero onto y. Default true: bars always stand on the ground line, and lines read best against it too. */
484
+ zero?: boolean;
485
+ /** A fixed y domain, instead of the series' extent made nice. */
486
+ yDomain?: [number, number];
487
+ /** Formats y ticks. Default: the first series' format. */
488
+ yFormat?: (value: number) => string;
489
+ /** Formats x ticks and x values. Default: by the scale (dates in the reader's locale, numbers as numbers). */
490
+ xFormat?: (value: unknown) => string;
491
+ /** The gap between bands, as a fraction of a band's step. Default 0.2. */
492
+ bandPadding?: number;
493
+ /** Turns the axes off, for a chart that labels its marks directly. Gridlines and the ground line stay. */
494
+ axes?: boolean;
495
+ /**
496
+ * Where the value axis's labels go (#193). 'gutter' (default): a column at the plot's left. 'inline': each label sits
497
+ * just above its gridline at the plot's left, on a halo, so the plot runs the full width; the top label carries the
498
+ * unit, a label that would cover a mark is left out, and the ground line goes unlabelled (it is zero). Vertical
499
+ * cartesian charts only.
500
+ */
501
+ yLabels?: 'gutter' | 'inline';
502
+ /** The locale for numbers and dates. Default: the reader's. */
503
+ locale?: string;
504
+ /** The crosshair and readout. Default true; a chart type's `tooltip={false}` turns it off too. */
505
+ tooltip?: boolean;
506
+ /**
507
+ * Adds a Chart | Table control: the same data as a sortable table, in the chart's own box. true starts on the chart,
508
+ * 'table' on the table.
509
+ */
510
+ views?: boolean | 'chart' | 'table';
511
+ /** The view shown, controlled. */
512
+ view?: 'chart' | 'table';
513
+ onViewChange?: (view: 'chart' | 'table') => void;
514
+ /** The table's first column header. Default: the x key, capitalised. */
515
+ xLabel?: string;
516
+ /**
517
+ * Tell series apart by pattern as well as colour: a hatch per slot on fills, a dash on lines, a marker on points.
518
+ * Always on under forced colours and in print; turn it on anywhere else for readers who want it.
519
+ */
520
+ patterns?: boolean;
521
+ /**
522
+ * Fresh data is on its way while this data stays shown: after dur-grace the marks drop to half strength and the
523
+ * plot says "Updating". A new promise passed while data shows does the same by itself.
524
+ */
525
+ refreshing?: boolean;
526
+ /** What the plot says when the data is null or empty: an EmptyState at widget size. Default title "No data to show". */
527
+ empty?: ChartEmpty;
528
+ /**
529
+ * The data updates on its own (#66). New or changed marks get an afterglow (more than four at once, and the
530
+ * "Updated 12:04" caption gets it instead); a window that moves on glides one step; and while the pointer or focus is
531
+ * in the plot, updates wait until you leave, so nothing changes under what you're reading.
532
+ */
533
+ live?: boolean;
534
+ /** With `live`: a "Pause updates" switch in the frame, for WCAG 2.2.2 (Pause, Stop, Hide). */
535
+ pausable?: boolean;
536
+ /**
537
+ * What changed since a snapshot (#191): the records as they were (`data`, matched by x or the chart's id) and when,
538
+ * in words (`label`: "since Tuesday 09:00"). A changed bar carries a tick at its old value, a changed line point a
539
+ * hollow ring; the frame says "3 changed since Tuesday 09:00" in a switch that filters to them; up to four changed
540
+ * marks get the afterglow on arrival. Storing what a person last saw is the application's.
541
+ */
542
+ since?: {
543
+ data: ChartDatum[];
544
+ label: string;
545
+ };
546
+ /** Updates are paused, controlled. Uncontrolled with `pausable`. */
547
+ paused?: boolean;
548
+ onPausedChange?: (paused: boolean) => void;
549
+ /**
550
+ * With `live`: what to say when new data lands, or nothing. Nothing is announced per tick by default; return a
551
+ * sentence only for what matters ("Error rate crossed 2%"). It's said politely.
552
+ */
553
+ announce?: (data: ChartDatum[], previous: ChartDatum[] | null) => string | null | undefined;
554
+ /** While a chart type's `relevance` filters, how the frame says how many match. Default "4 of 12 match". */
555
+ countLabel?: (matches: number, total: number) => string;
556
+ }
557
+ export interface ChartEmpty {
558
+ title?: React.ReactNode;
559
+ description?: React.ReactNode;
560
+ action?: React.ReactNode;
561
+ }
562
+ /**
563
+ * The frame every chart shares (see ChartFrame), and what it shows while its data is on its way. `undefined` or a
564
+ * pending promise: an imprint in the chart's shape, pressed into the page, with the title, description and legend
565
+ * already in place. It lands by fading in place: a chart's marks never rise out of their imprint, because rising
566
+ * would lift bars off the ground line and misstate every value. `null` or `[]`: an EmptyState in the plot. A new
567
+ * promise (or `refreshing`) while data shows: the old chart stays, at half strength after dur-grace. A rejected
568
+ * promise goes to your error boundary.
569
+ */
570
+ export declare function ChartContainer(props: ChartContainerProps): React.JSX.Element;
@@ -0,0 +1,71 @@
1
+ import * as React from 'react';
2
+ export interface ChecklistPlace {
3
+ parentId: string | null;
4
+ index: number;
5
+ }
6
+ /** One change per action. The application applies it to `items` (synchronously, or before resolving). */
7
+ export type ChecklistOp = {
8
+ type: 'add';
9
+ id: string;
10
+ text: string;
11
+ done: boolean;
12
+ parentId: string | null;
13
+ index: number;
14
+ } | {
15
+ type: 'edit';
16
+ id: string;
17
+ text: string;
18
+ previous: string;
19
+ } | {
20
+ type: 'toggle';
21
+ id: string;
22
+ done: boolean;
23
+ } | {
24
+ type: 'remove';
25
+ id: string;
26
+ text: string;
27
+ done: boolean;
28
+ parentId: string | null;
29
+ index: number;
30
+ } | {
31
+ type: 'move' | 'indent' | 'outdent';
32
+ id: string;
33
+ parentId: string | null;
34
+ index: number;
35
+ from: ChecklistPlace;
36
+ };
37
+ export type ChecklistResult = {
38
+ ok: true;
39
+ } | {
40
+ ok: false;
41
+ error: string;
42
+ };
43
+ export interface ChecklistProps<T> {
44
+ 'aria-label'?: string;
45
+ 'aria-labelledby'?: string;
46
+ items: T[];
47
+ getKey: (item: T) => string;
48
+ getText: (item: T) => string;
49
+ isDone: (item: T) => boolean;
50
+ getChildren?: (item: T) => T[] | undefined;
51
+ /** Allow Tab and Shift+Tab to nest items. Default false: a flat list. */
52
+ nested?: boolean;
53
+ /** Show done items after the rest in each list. Default false. */
54
+ sortDone?: boolean;
55
+ /** Each action, as one op. Return a failure to mark the item and offer Retry. */
56
+ onChange: (op: ChecklistOp) => ChecklistResult | void | Promise<ChecklistResult | void>;
57
+ /** Ctrl/Cmd+Z: reverse the last structural op (add, remove, move, indent, outdent). A removal's announcement names the shortcut. */
58
+ onUndo?: (op: ChecklistOp) => void;
59
+ /** Ids for new items. Default: a random id. */
60
+ createId?: () => string;
61
+ /** The last, empty line's placeholder. Default “Add an item”. */
62
+ placeholder?: string;
63
+ disabled?: boolean;
64
+ className?: string;
65
+ }
66
+ /**
67
+ * A list you write into, one line per item. Each line is the editor (no Save, no read mode): it commits when you
68
+ * leave it. Items lie flush; the empty line at the end is an opening; the checkbox is a choice built like the Switch,
69
+ * and a done item is pressed into the record: muted and struck through, kept in place.
70
+ */
71
+ export declare function Checklist<T>({ items, getKey, getText, isDone, getChildren, nested, sortDone, onChange, onUndo, createId, placeholder, disabled, className, ...aria }: ChecklistProps<T>): React.JSX.Element;
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+ export interface CodeBlockTab {
3
+ label: string;
4
+ code: string;
5
+ language?: string;
6
+ }
7
+ export interface CodeBlockProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
8
+ /** The code, for a single block. */
9
+ code?: string;
10
+ language?: string;
11
+ /** A filename or what the code is ("Install"). Shown in the header and names the scroll region. */
12
+ title?: React.ReactNode;
13
+ /** The same thing in several forms (npm, pnpm; curl, Node, Python): a segmented switch in the header. */
14
+ tabs?: CodeBlockTab[];
15
+ /** Lines to highlight, counted from 1. */
16
+ highlight?: number[];
17
+ /** Your highlighter (Shiki, Prism): returns the code coloured. Altitude ships none. */
18
+ syntax?: (code: string, language?: string) => React.ReactNode;
19
+ /** Line numbers in a gutter (hidden from assistive technology). Default false. */
20
+ lineNumbers?: boolean;
21
+ /** The code is still arriving (from an agent): a dashed rule and "Writing…", aria-busy. */
22
+ streaming?: boolean;
23
+ /** Taller code scrolls. Default 360. */
24
+ maxHeight?: number | string;
25
+ /** Default true. */
26
+ copyable?: boolean;
27
+ }
28
+ /**
29
+ * Code shown to read and copy is the record: it lies flush on the ground with a line rim, in mono, with no shadow.
30
+ * Several forms of the same thing switch with segmented Tabs; copy is a CopyButton; code still arriving has a dashed rule.
31
+ */
32
+ export declare function CodeBlock({ code, language, title, tabs, highlight, syntax, lineNumbers, streaming, maxHeight, copyable, className, ...rest }: CodeBlockProps): React.JSX.Element;