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,13 @@
1
+ import { HighlightStyle } from '@codemirror/language';
2
+ import type { Extension } from '@codemirror/state';
3
+ /**
4
+ * The editor is an opening: a well with its inside wall, the floor lit while focused and a 2px neutral rim for keyboard
5
+ * focus. Gutter and lines are ground; the active line is a tint, never a height; the selection is accent. Lint errors
6
+ * sink their gutter marker into a trench on critical-soft and say the problem in words. Tooltips and completion lists
7
+ * float at level 3.
8
+ */
9
+ export declare const altitudeEditorTheme: Extension;
10
+ /** Syntax in ink, ink-muted and accent-ink only: code is text to read, not data to compare, so no data-* hues. */
11
+ export declare const altitudeHighlightStyle: HighlightStyle;
12
+ /** The whole adapter: `new EditorView({ extensions: [altitudeTheme(), …] })`. */
13
+ export declare function altitudeTheme(): Extension;
@@ -0,0 +1,166 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Where an agent is in its run. Needing you is one state with three reasons (`needs`); failed also waits on you, since
4
+ * nothing happens until someone retries or stops it. Stalled is a suspicion, not a request: the agent is still working
5
+ * but has made no progress, or keeps retrying the same thing.
6
+ */
7
+ export type AgentState = 'queued' | 'working' | 'needs-input' | 'blocked' | 'stalled' | 'failed' | 'done' | 'stopped';
8
+ export type AgentNeeds = 'approval' | 'question' | 'review';
9
+ type Time = Date | string | number;
10
+ /** "under a minute", "4 min", "1 h 5 min": a span in words, never a ticking counter. */
11
+ export declare function formatSpan(span: number): string;
12
+ /** Whether a state is waiting on a person: these lead the fleet and fill the requests. */
13
+ export declare const needsYou: (state: AgentState) => state is "failed" | "needs-input";
14
+ export interface AgentFleetProps extends React.HTMLAttributes<HTMLDivElement> {
15
+ /** Names the fleet: "Agents". */
16
+ 'aria-label'?: string;
17
+ /** The time the rows measure waits and runs from. Default: now, refreshed every 30 seconds. */
18
+ now?: Time;
19
+ /** The counts in words above the groups: "2 need you · 3 working · 4 done" (`summarizeFleet` writes it). */
20
+ summary?: React.ReactNode;
21
+ /** AgentFleetGroups. */
22
+ children: React.ReactNode;
23
+ }
24
+ /**
25
+ * Every agent in a run of work, grouped by what they need from you: the ones waiting on you first,
26
+ * longest wait at the top, then the ones working, then the finished ones folded away. Rows are the record, flush, each
27
+ * saying its state in words with a lamp that only repeats it; the one open beside the fleet is selected (tinted and
28
+ * raised a level, as a table's selected row). An agent that starts needing you is announced once.
29
+ */
30
+ export declare function AgentFleet({ 'aria-label': label, now, summary, className, children, ...rest }: AgentFleetProps): React.JSX.Element;
31
+ export interface AgentFleetGroupProps {
32
+ /** "Needs you", "Working", "Done". */
33
+ label: string;
34
+ /** Shown after the label and in its name; default: the number of rows in it. null: no count (a group of one, like a lead agent). */
35
+ count?: number | null;
36
+ /** Folds the group under its heading, a lid that opens it: for finished agents. */
37
+ collapsible?: boolean;
38
+ defaultOpen?: boolean;
39
+ /** What to say when the group is empty: "Nothing needs you." Without it an empty group isn't drawn. */
40
+ empty?: React.ReactNode;
41
+ children?: React.ReactNode;
42
+ className?: string;
43
+ }
44
+ /** A run of agents under a heading, with its count. */
45
+ export declare function AgentFleetGroup({ label, count, collapsible, defaultOpen, empty, children, className }: AgentFleetGroupProps): React.JSX.Element | null;
46
+ export interface AgentFleetItemProps {
47
+ name: string;
48
+ state: AgentState;
49
+ /** For 'needs-input': what it needs. Default 'approval'. */
50
+ needs?: AgentNeeds;
51
+ /** One line: what it's doing now, the question it's asking, or what it finished with. */
52
+ activity?: React.ReactNode;
53
+ /** When it entered this state: how long it's been waiting on you, stalled or blocked. */
54
+ since?: Time;
55
+ /** When it started: how long it's been running (or took, once done). */
56
+ startedAt?: Time;
57
+ /** When it finished, for "took 9 min". */
58
+ endedAt?: Time;
59
+ /** Where it is in its plan: "Step 3 of 5". */
60
+ step?: {
61
+ current: number;
62
+ total: number;
63
+ };
64
+ /** For 'blocked': who or what it's waiting on. "Billing API". */
65
+ blockedBy?: string;
66
+ /** Another agent is changing the same file: said on the row, so the clash is caught before either merges. */
67
+ conflict?: {
68
+ file: string;
69
+ with: string;
70
+ };
71
+ /** For 'stalled': why. Default "No progress for <since>". */
72
+ stalledReason?: string;
73
+ /** Spend so far, already formatted: "$0.42" or "38k tokens". */
74
+ cost?: string;
75
+ /** What it produced: a pull request plate, a link. */
76
+ output?: React.ReactNode;
77
+ /** Open beside the fleet. */
78
+ selected?: boolean;
79
+ onSelect?: () => void;
80
+ /** Agents it started, as AgentFleetItems: a bracketed list under it. */
81
+ children?: React.ReactNode;
82
+ className?: string;
83
+ }
84
+ /** One agent: its name, its state in words, what it's doing, how long, and anything about to go wrong. */
85
+ export declare function AgentFleetItem(props: AgentFleetItemProps): React.JSX.Element;
86
+ /** "2 need you · 3 working · 1 stalled · 4 done": the fleet in words, for its summary, a page title or a tab. */
87
+ export declare function summarizeFleet(states: AgentState[]): string;
88
+ /**
89
+ * Sorts agents into the fleet's three groups: needs you (longest wait first), working (stalled first, then running,
90
+ * then blocked and queued), and finished (newest first).
91
+ */
92
+ export declare function groupAgents<T>(agents: T[], get: (a: T) => {
93
+ state: AgentState;
94
+ since?: Time;
95
+ endedAt?: Time;
96
+ }): {
97
+ needsYou: T[];
98
+ working: T[];
99
+ finished: T[];
100
+ };
101
+ export interface AgentRequestsProps extends React.HTMLAttributes<HTMLElement> {
102
+ /** Default "Needs you". */
103
+ title?: string;
104
+ now?: Time;
105
+ /** Said when nothing is waiting. Default "Nothing needs you. Agents ask here when they need a decision." */
106
+ empty?: React.ReactNode;
107
+ /** AgentRequests, in any order: they're shown longest wait first. */
108
+ children?: React.ReactNode;
109
+ }
110
+ /**
111
+ * Every decision your agents are waiting on, in one queue, so you can answer them without opening
112
+ * each agent: oldest first, because a wait costs the most the longer it runs. Each request asks for action, so it's a
113
+ * raised card that arrives lifted and settles; nothing in it has been dispatched. A new one is announced once.
114
+ */
115
+ export declare function AgentRequests({ title, now, empty, className, children, ...rest }: AgentRequestsProps): React.JSX.Element;
116
+ export interface AgentRequestProps {
117
+ /** Which agent is asking. */
118
+ agent: string;
119
+ /** 'failed' is an agent that stopped on an error and waits for Retry or Stop. */
120
+ kind: AgentNeeds | 'failed';
121
+ /** The ask in a sentence: "Run the migration on staging?" */
122
+ title: React.ReactNode;
123
+ /** What happens if you say yes, or what went wrong. */
124
+ detail?: React.ReactNode;
125
+ /** When it started waiting. */
126
+ since: Time;
127
+ /** The answers you can give here: Buttons, secondary and ghost (the view's one primary stays where it is). */
128
+ actions?: React.ReactNode;
129
+ /** Opens the agent beside the queue, for anything that needs more than the actions. */
130
+ onOpen?: () => void;
131
+ className?: string;
132
+ }
133
+ /** One decision an agent is waiting on: who's asking, what, for how long, and the answers you can give in place. */
134
+ export declare function AgentRequest({ agent, kind, title, detail, since, actions, onOpen, className }: AgentRequestProps): React.JSX.Element;
135
+ /** What a stretch of an agent's time was spent on. 'waiting' is waiting on you; 'blocked' is waiting on another agent. */
136
+ export type AgentLaneState = 'working' | 'waiting' | 'blocked' | 'failed';
137
+ export interface AgentLane {
138
+ id: string;
139
+ name: string;
140
+ /** Stretches of time; one without `to` runs to now. Gaps are time it wasn't running (queued, or finished). */
141
+ segments: {
142
+ from: Time;
143
+ to?: Time;
144
+ state: AgentLaneState;
145
+ }[];
146
+ }
147
+ export interface AgentLanesProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
148
+ lanes: AgentLane[];
149
+ /** Where the axis starts. Default: the earliest segment. */
150
+ start?: Time;
151
+ now?: Time;
152
+ /** The sentence above the lanes. Default: how long agents waited on you, and the longest wait. */
153
+ takeaway?: React.ReactNode;
154
+ /** Names the figure. Default "Where the agents' time went". */
155
+ 'aria-label'?: string;
156
+ selected?: string;
157
+ onSelect?: (id: string) => void;
158
+ }
159
+ /**
160
+ * Where each agent's time went, one lane per agent on a shared clock: the time they spent waiting on
161
+ * you is the bottleneck a fleet hides, so the takeaway says it first. A chart, so its marks are flat (Charts): the
162
+ * stretches are equal-height bars on each lane's ground line, told apart by fill and pattern (waiting is hatched,
163
+ * blocked an outline) and named in a legend in words; a 1px "Now" rule ends the record. A table says the same.
164
+ */
165
+ export declare function AgentLanes({ lanes, start, now, takeaway, 'aria-label': label, selected, onSelect, className, ...rest }: AgentLanesProps): React.JSX.Element;
166
+ export {};
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ export interface AISource {
3
+ title: string;
4
+ url?: string;
5
+ }
6
+ export interface AILabelProps {
7
+ /** What it marks ("Summary", "Reply"), for its name: "Summary generated with AI". Default "Content". */
8
+ subject?: string;
9
+ /** The model that produced it. */
10
+ model?: string;
11
+ generatedAt?: Date | string | number;
12
+ /** What it was based on. */
13
+ sources?: AISource[];
14
+ /** Confidence, in words ("Medium: two sources disagreed"). */
15
+ confidence?: string;
16
+ /** A person who reviewed and accepted it: the plate reads "Drafted with AI". */
17
+ reviewedBy?: string;
18
+ /** A person who changed it after it was generated. */
19
+ editedBy?: string;
20
+ /** Anything else about how it was made. */
21
+ children?: React.ReactNode;
22
+ className?: string;
23
+ }
24
+ /**
25
+ * Marks what AI made, and explains it when asked. A label is part of the record, so it's a flush Badge plate ("AI", or
26
+ * "Drafted with AI" once a person has reviewed it), with no gradient and no glow: the light never moves. It acts, so it
27
+ * lifts one level when pointed at and opens a Popover saying how the content was produced. Provenance stays on the
28
+ * accepted record.
29
+ */
30
+ export declare function AILabel({ subject, model, generatedAt, sources, confidence, reviewedBy, editedBy, children, className }: AILabelProps): React.JSX.Element;
@@ -0,0 +1,83 @@
1
+ import * as React from 'react';
2
+ type SidebarCtxT = {
3
+ collapsed: boolean;
4
+ setCollapsed: (c: boolean) => void;
5
+ mobile: boolean;
6
+ drawer: boolean;
7
+ setDrawer: (o: boolean) => void;
8
+ toggle: () => void;
9
+ };
10
+ /** The sidebar's state: collapsed to a rail (desktop) or open as a drawer (narrow screens), and how to toggle it. */
11
+ export declare const useSidebar: () => SidebarCtxT;
12
+ export interface SidebarProviderProps {
13
+ /** Collapsed to a rail of icons. Persisting it (a cookie, localStorage) is up to your app. */
14
+ collapsed?: boolean;
15
+ defaultCollapsed?: boolean;
16
+ onCollapsedChange?: (collapsed: boolean) => void;
17
+ /** Below this width the sidebar becomes a drawer. Default 640, the compact breakpoint (`breakpoint-compact`). */
18
+ mobileBreakpoint?: number;
19
+ children: React.ReactNode;
20
+ }
21
+ /** Holds the sidebar's state, and toggles it with ⌘B / Ctrl+B. */
22
+ export declare function SidebarProvider({ collapsed, defaultCollapsed, onCollapsedChange, mobileBreakpoint, children }: SidebarProviderProps): React.JSX.Element;
23
+ export interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
24
+ /** 'icon' (default) collapses to a rail of icons; 'none' never collapses. */
25
+ collapsible?: 'icon' | 'none';
26
+ /** The navigation landmark's name. Default "Main". */
27
+ 'aria-label'?: string;
28
+ }
29
+ /**
30
+ * Where you are is part of the record, so the frame lies on the ground: the sidebar is a nav on surface-ground divided
31
+ * from the page by a line. Only what's in it acts. On narrow screens it moves into a Sheet drawer.
32
+ */
33
+ export declare function Sidebar({ collapsible, className, children, 'aria-label': label, ...rest }: SidebarProps): React.JSX.Element;
34
+ export declare function SidebarHeader({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
35
+ export declare function SidebarFooter({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
36
+ /** The scrolling middle. The current item's raised pill glides here from item to item, as segmented Tabs' does. */
37
+ export declare function SidebarContent({ className, children, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
38
+ export interface SidebarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
39
+ /** The group's name, shown above it. */
40
+ label?: React.ReactNode;
41
+ /** The label is a disclosure button that shows and hides the group. */
42
+ collapsible?: boolean;
43
+ defaultOpen?: boolean;
44
+ }
45
+ /** Destinations that belong together, under a label in ink-muted. A collapsible group is a disclosure. */
46
+ export declare function SidebarGroup({ label, collapsible, defaultOpen, className, children, ...rest }: SidebarGroupProps): React.JSX.Element;
47
+ export declare function SidebarGroupLabel({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
48
+ export declare function SidebarMenu({ className, ...rest }: React.HTMLAttributes<HTMLUListElement>): React.JSX.Element;
49
+ /** One destination. A SidebarMenuBadge inside it is said as part of the button's name. */
50
+ export declare function SidebarMenuItem({ className, children, ...rest }: React.LiHTMLAttributes<HTMLLIElement>): React.JSX.Element;
51
+ export interface SidebarMenuButtonProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
52
+ /** The page you're on: aria-current="page", and the raised pill. */
53
+ current?: boolean;
54
+ icon?: React.ReactNode;
55
+ /** Styles your own link element (a router's Link). Pass exactly one element; its children are the label. */
56
+ asChild?: boolean;
57
+ }
58
+ /** A destination: flush at rest, lifts one level when pointed at; the current one sits on the raised pill. */
59
+ export declare const SidebarMenuButton: React.ForwardRefExoticComponent<SidebarMenuButtonProps & React.RefAttributes<HTMLAnchorElement>>;
60
+ export interface SidebarMenuBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
61
+ children: React.ReactNode;
62
+ /** What the count is, for its name: "4 unread". Default: the number alone. */
63
+ label?: string;
64
+ }
65
+ /** A count on a destination. Only a count floats (Badge variant="count"); it's part of the destination's name. */
66
+ export declare function SidebarMenuBadge({ label, className, children, ...rest }: SidebarMenuBadgeProps): React.JSX.Element;
67
+ /** Collapses the sidebar to a rail (desktop) or opens the drawer (narrow screens). ⌘B / Ctrl+B does the same. */
68
+ export declare function SidebarTrigger({ className, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement>): React.JSX.Element;
69
+ /** The page beside the sidebar: the main landmark, with --alt-page-pad set for PageHeader. */
70
+ export declare function SidebarInset({ className, ...rest }: React.HTMLAttributes<HTMLElement>): React.JSX.Element;
71
+ export interface AppShellProps extends Omit<SidebarProviderProps, 'children'> {
72
+ sidebar: React.ReactNode;
73
+ /** The top bar's contents (search, the user's menu). A SidebarTrigger comes first by itself. */
74
+ topBar?: React.ReactNode;
75
+ children: React.ReactNode;
76
+ className?: string;
77
+ }
78
+ /**
79
+ * The frame of an app: a sidebar of destinations, a top bar and the page, all on the ground and divided by lines.
80
+ * The top bar rises when content passes under it. A skip link jumps to the page.
81
+ */
82
+ export declare function AppShell({ sidebar, topBar, children, className, ...provider }: AppShellProps): React.JSX.Element;
83
+ export {};
@@ -0,0 +1,80 @@
1
+ import * as React from 'react';
2
+ import { type ChartConfig, type ChartContextValue, type ChartDatum, type ChartInfo, type ChartStatus } from './chart.js';
3
+ import { type ChartWindow } from './line-chart.js';
4
+ export interface AreaChartProps {
5
+ /** The records, in x order: one per time or value of x. */
6
+ data: ChartDatum[] | null | undefined | PromiseLike<ChartDatum[] | null>;
7
+ /** The key of each record's x: an ISO date, a timestamp or a number. */
8
+ x: string;
9
+ /**
10
+ * Stack the series into bands that add up to the total, in config order from the bottom. 'expand' stacks them as
11
+ * shares of 100%. Default: one area (or several overlapping, though a LineChart compares those better).
12
+ */
13
+ stack?: boolean | 'expand';
14
+ /** 'linear' joins points with straight lines; 'monotone' curves through them without overshooting. Default 'linear'. */
15
+ curve?: 'linear' | 'monotone';
16
+ /** Formats values (the axis, the readout, the names and the summary) of series that have no format of their own. */
17
+ y?: {
18
+ format?: (value: number) => string;
19
+ };
20
+ /** Name each band inside itself where it's tall and wide enough. Default: on when stacked. */
21
+ labels?: boolean;
22
+ /** The crosshair and readout. Default true. */
23
+ tooltip?: boolean;
24
+ /**
25
+ * Which records aren't yet the record: 'partial' for a period still being counted, 'projected' for a forecast. From
26
+ * the last settled point on, bands are hatched rather than filled and their top line is dashed.
27
+ */
28
+ status?: (d: ChartDatum) => ChartStatus | undefined;
29
+ /** The rule where the record ends: its word (default "Today"), or false for none. */
30
+ boundary?: string | false;
31
+ /**
32
+ * Let people pin a reading to the plot (#190): with the readout open, a click (or P on the keyboard path, or a tap
33
+ * while the touch readout is open) sets it down as a plate. true allows two, which compare in words; a number allows
34
+ * that many. Escape removes the last.
35
+ */
36
+ pinnable?: boolean | number;
37
+ /** The pinned readings' x values, controlled (to keep them in the URL, say); and when they change. */
38
+ pins?: Array<string | number>;
39
+ onPinsChange?: (pins: Array<string | number>) => void;
40
+ /**
41
+ * What the chart is about (#188): these series keep their colours and the rest are drawn in data-context, their
42
+ * labels in ink-muted. The author's statement of importance, not a reader's filter (that's relevance).
43
+ */
44
+ focus?: string[];
45
+ /**
46
+ * Filter in place: which records match. The bands recede to 35% around its misses (each record owns its stretch of
47
+ * x), keeping its place and colour; the frame says how many match. Nothing is removed.
48
+ */
49
+ relevance?: (d: ChartDatum) => 'match' | 'miss' | undefined;
50
+ /** With relevance: fit the axis to the matches. Default false: the axis holds, so positions survive. */
51
+ rescale?: boolean;
52
+ /** The selected record's x value, for marks you can select. The others recede; the frame says "Filtered to …". */
53
+ selected?: unknown;
54
+ /** Makes marks selectable: called with the chosen record, or null when the selection clears (Escape, Clear, or choosing it again). */
55
+ onSelect?: (d: ChartDatum | null) => void;
56
+ /** Makes marks open a level down, inside a Drilldown: return the id of the current node's child this record opens. */
57
+ drill?: (d: ChartDatum) => string | null | undefined;
58
+ /** Show only the latest stretch of x, as LineChart's `window`: it glides one step in a `live` container. */
59
+ window?: ChartWindow;
60
+ /** Called with the new { start, end } when a ChartBrush moves the window. Without `window`, the brush keeps its own. */
61
+ onWindowChange?: (window: {
62
+ start: string | number;
63
+ end: string | number;
64
+ }) => void;
65
+ /** A ChartTooltip or ChartLegend. */
66
+ children?: React.ReactNode;
67
+ /** What the plot says when there's no data: an EmptyState at widget size. */
68
+ empty?: import('./chart.js').ChartEmpty;
69
+ }
70
+ /**
71
+ * A total over time and what it's made of. Bands are the record: flat data-* fills stacked on the ground line in config
72
+ * order (the order never changes, so a band never jumps), each parted from the one above by a 2px line in the plot's
73
+ * own colour, with a 2px top line on the topmost. A single area is a flat data-1 fill at reduced opacity under a 2px
74
+ * line. No gradient fill: the only face gradient in Altitude is the sheen, and it means "press it".
75
+ */
76
+ export declare function AreaChart({ stack, curve, labels }: AreaChartProps): React.JSX.Element;
77
+ export declare namespace AreaChart {
78
+ var chartPoint: (props: Record<string, unknown>, ctx: ChartContextValue, d: ChartDatum, key: string) => [number, number];
79
+ var chartInfo: (props: Record<string, unknown>, config: ChartConfig) => ChartInfo;
80
+ }
@@ -0,0 +1,65 @@
1
+ import * as React from 'react';
2
+ export type ArtifactStatus = 'writing' | 'complete' | 'failed';
3
+ export interface ArtifactProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
4
+ /** Names the pane: "Pricing page". */
5
+ title: string;
6
+ /** Default 'complete'. */
7
+ status?: ArtifactStatus;
8
+ /** The latest version's number: "Writing… version 3". */
9
+ version?: number;
10
+ onRetry?: () => void;
11
+ /** Its id, shared with ArtifactReference's aria-controls. Default generated. */
12
+ id?: string;
13
+ }
14
+ /**
15
+ * What an agent is making, beside the conversation (#271): a pane on the ground, named by its title. While it's
16
+ * written it isn't the record yet (a dashed rule at the pane's edge, "Writing… version 3"); complete, the rule goes
17
+ * solid with one afterglow; failed, "Couldn't finish" with a mark and Retry, the last whole version still there (no coloured edge: #374). Viewing an earlier
18
+ * version is a mode, so it's a strip and words across the pane's top, not a lift.
19
+ */
20
+ export declare function Artifact({ title, status, version, onRetry, id: given, className, children, ...rest }: ArtifactProps): React.JSX.Element;
21
+ export interface ArtifactHeaderProps {
22
+ /** Copy (the whole artifact, or this value). */
23
+ onCopy?: boolean | (() => string);
24
+ onDownload?: () => void;
25
+ /** Opens it on its own (a new tab). */
26
+ onOpen?: () => void;
27
+ onClose?: () => void;
28
+ /** Extra tools, before the standard ones. */
29
+ children?: React.ReactNode;
30
+ }
31
+ /** The title, its state in words, and ghost tools. */
32
+ export declare function ArtifactHeader({ onCopy, onDownload, onOpen, onClose, children }: ArtifactHeaderProps): React.JSX.Element;
33
+ export interface ArtifactVersionsProps {
34
+ /** How many versions there are. */
35
+ versions: number;
36
+ /** The one shown, from 1. */
37
+ current: number;
38
+ onChange: (version: number) => void;
39
+ /** Make the version shown the latest again. */
40
+ onRestore?: (version: number) => void;
41
+ }
42
+ /** Previous and next version, and, when an earlier one is shown, a strip that says so with a way back. */
43
+ export declare function ArtifactVersions({ versions, current, onChange, onRestore }: ArtifactVersionsProps): React.JSX.Element | null;
44
+ export interface ArtifactContentProps {
45
+ /** The ways to see it. With more than one, a segmented switch picks between them. */
46
+ views: {
47
+ preview?: React.ReactNode;
48
+ source?: React.ReactNode;
49
+ changes?: React.ReactNode;
50
+ };
51
+ /** Default the first given. */
52
+ defaultView?: 'preview' | 'source' | 'changes';
53
+ }
54
+ /** The artifact itself: Preview, Source and Changes, as segmented Tabs when there's more than one. */
55
+ export declare function ArtifactContent({ views, defaultView }: ArtifactContentProps): React.JSX.Element;
56
+ export interface ArtifactReferenceProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {
57
+ title: string;
58
+ version?: number;
59
+ status?: ArtifactStatus;
60
+ /** The Artifact's id, for aria-controls and to return focus on Escape. */
61
+ controls: string;
62
+ onOpen: () => void;
63
+ }
64
+ /** The plate in a message that opens the artifact; a plate that acts, lifting one level when pointed at. */
65
+ export declare function ArtifactReference({ title, version, status, controls, onOpen, className, ...rest }: ArtifactReferenceProps): React.JSX.Element;
@@ -0,0 +1,83 @@
1
+ import * as React from 'react';
2
+ import { type ChartCompare, type ChartConfig, type ChartContextValue, type ChartDatum, type ChartInfo, type ChartStatus } from './chart.js';
3
+ import { type ChartWindow } from './line-chart.js';
4
+ export interface BarChartProps {
5
+ /** The records: one per category. */
6
+ data: ChartDatum[] | null | undefined | PromiseLike<ChartDatum[] | null>;
7
+ /** The key of each record's category. */
8
+ x: string;
9
+ /** Order the categories by their total: 'desc' puts the largest first. Default: the data's order. */
10
+ sort?: 'asc' | 'desc';
11
+ /** Stack the series into one bar per category (parts of a total); 'expand' stacks them as shares of 100%. Default: side by side. */
12
+ stack?: boolean | 'expand';
13
+ /** 'horizontal' runs categories down the side, for long category names or many of them. Default 'vertical'. */
14
+ layout?: 'vertical' | 'horizontal';
15
+ /** Label values at their bars, selectively: the largest, or the last category. Never every bar. Default 'none'. */
16
+ labels?: 'max' | 'last' | 'none';
17
+ /** The crosshair and readout. Default true. */
18
+ tooltip?: boolean;
19
+ /**
20
+ * Which categories aren't yet the record: 'partial' for a period still being counted (this month so far), 'projected'
21
+ * for a forecast. Their bars are hatched, never solid, and say "So far" or "Projected". When a partial period
22
+ * completes, its hatching fills in solid.
23
+ */
24
+ status?: (d: ChartDatum) => ChartStatus | undefined;
25
+ /** The rule where the record ends: its word (default "Today"), or false for none. */
26
+ boundary?: string | false;
27
+ /**
28
+ * Read each value against the record before (#189): `{ key: 'lastMonth', label: 'August' }` for a field on the same
29
+ * record, or `{ data: lastWeek, label: 'Last week' }` for records matched by position. The earlier value is a 2px ink
30
+ * tick across the bar (the bullet graph's comparative measure); a stack is compared by its total.
31
+ */
32
+ compare?: ChartCompare;
33
+ /**
34
+ * Let people pin a reading to the plot (#190): with the readout open, a click (or P on the keyboard path, or a tap
35
+ * while the touch readout is open) sets it down as a plate. true allows two, which compare in words; a number allows
36
+ * that many. Escape removes the last.
37
+ */
38
+ pinnable?: boolean | number;
39
+ /** The pinned readings' x values, controlled (to keep them in the URL, say); and when they change. */
40
+ pins?: Array<string | number>;
41
+ onPinsChange?: (pins: Array<string | number>) => void;
42
+ /**
43
+ * What the chart is about (#188): series keys that keep their colours while the rest take data-context, or a test for
44
+ * the records that keep theirs (on a one-series chart, the categories the takeaway names). The author's statement of
45
+ * importance, not a reader's filter (that's relevance).
46
+ */
47
+ focus?: string[] | ((d: ChartDatum) => boolean);
48
+ /**
49
+ * Filter in place: which categories match. Misses recede to 35% and keep their place and colour; the frame says how
50
+ * many match. Nothing is removed.
51
+ */
52
+ relevance?: (d: ChartDatum) => 'match' | 'miss' | undefined;
53
+ /** With relevance: fit the axis to the matches. Default false: the axis holds, so positions survive. */
54
+ rescale?: boolean;
55
+ /** The selected record's x value, for marks you can select. The others recede; the frame says "Filtered to …". */
56
+ selected?: unknown;
57
+ /** Makes marks selectable: called with the chosen record, or null when the selection clears (Escape, Clear, or choosing it again). */
58
+ onSelect?: (d: ChartDatum | null) => void;
59
+ /** Makes marks open a level down, inside a Drilldown: return the id of the current node's child this record opens. */
60
+ drill?: (d: ChartDatum) => string | null | undefined;
61
+ /** Bars over time: show only a stretch of the categories, by their dates ({ start, end }) or the last { points }. A ChartBrush sets it. */
62
+ window?: ChartWindow;
63
+ /** Called with the new { start, end } when a ChartBrush moves the window. Without `window`, the brush keeps its own. */
64
+ onWindowChange?: (window: {
65
+ start: string | number;
66
+ end: string | number;
67
+ }) => void;
68
+ /** A ChartTooltip, to change what the readout shows. */
69
+ children?: React.ReactNode;
70
+ /** What the plot says when there's no data: an EmptyState at widget size. */
71
+ empty?: import('./chart.js').ChartEmpty;
72
+ }
73
+ /**
74
+ * Amounts compared across categories, as lengths standing on the ground line. Bars are the record: flat fills in
75
+ * their series' colours, square at the ground and rounded only at the data end, never shadowed or lifted. One
76
+ * series, several side by side, or stacked into a total.
77
+ */
78
+ export declare function BarChart({ stack, labels, compare }: BarChartProps): React.JSX.Element | null;
79
+ export declare namespace BarChart {
80
+ var chartPoint: (props: Record<string, unknown>, ctx: ChartContextValue, d: ChartDatum, key: string) => [number, number];
81
+ var chartMark: (props: Record<string, unknown>, ctx: ChartContextValue, d: ChartDatum, key: string) => string | null;
82
+ var chartInfo: (props: Record<string, unknown>, config: ChartConfig) => ChartInfo;
83
+ }
@@ -0,0 +1,35 @@
1
+ import * as React from 'react';
2
+ export interface BarListItem {
3
+ /** The row's label: a page, a referrer, a customer. Also its key unless `key` is given. */
4
+ name: string;
5
+ value: number;
6
+ key?: string;
7
+ /** Makes the row a link. */
8
+ href?: string;
9
+ }
10
+ export interface BarListProps extends Omit<React.HTMLAttributes<HTMLOListElement>, 'onSelect'> {
11
+ /** The rows. Undefined while your data loads: until they land the list is imprinted rows. */
12
+ data: BarListItem[] | null | undefined;
13
+ /** Formats values. Default: Intl.NumberFormat. */
14
+ format?: (value: number) => string;
15
+ /** Show at most this many rows; the rest fold into one "Other" row, with a "Show all" button. */
16
+ limit?: number;
17
+ /** After each value, show its share of the total ("22%"). */
18
+ share?: boolean;
19
+ /** Rank by value, largest first (default), or keep the data's order. */
20
+ sort?: 'desc' | false;
21
+ /** What the rows are, in the plural, for "Other (14 pages)" and "Show all 52 pages". */
22
+ noun?: string;
23
+ /** Makes each row a button (rows with `href` are links). */
24
+ onSelect?: (item: BarListItem) => void;
25
+ /** Filter in place: matches rise one level, misses sink into a well and say "Not matching". Nothing is removed. */
26
+ relevance?: (item: BarListItem) => 'match' | 'miss' | undefined;
27
+ locale?: string;
28
+ }
29
+ /**
30
+ * A ranked list whose rows are their own bars. Rows are the record, flush on the ground with line dividers, like a
31
+ * table's; each carries a flat data-1 bar behind its label, its length the row's value against the largest, faint
32
+ * enough that ink holds 4.5:1 over it. A row that does something (a link, a button) lifts one level when pointed at,
33
+ * as Table's rows do; its bar stays flat on it. When values change, rows are carried to their new ranks all at once.
34
+ */
35
+ export declare function BarList(props: BarListProps): React.JSX.Element;
@@ -0,0 +1,62 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * One step of the staircase Breadcrumb and Drilldown share: every step stands on the same ground line, and the deeper
4
+ * it is, the taller its slab (its wall grows 3px a level). Not exported from the package.
5
+ */
6
+ export declare function CrumbStep({ depth, current, isNew, children }: {
7
+ depth: number;
8
+ current?: boolean;
9
+ isNew?: boolean;
10
+ children: React.ReactNode;
11
+ }): React.JSX.Element;
12
+ export interface BreadcrumbEntry {
13
+ label: React.ReactNode;
14
+ /** Where the step goes. The last entry is the current page and never a link. */
15
+ href?: string;
16
+ onClick?: (e: React.MouseEvent) => void;
17
+ }
18
+ export interface BreadcrumbProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
19
+ items?: BreadcrumbEntry[];
20
+ /** Deeper paths keep the first step and the last (maxItems − 1), with the middle in a menu behind "…". */
21
+ maxItems?: number;
22
+ /** Renders a step's link your way (a router's Link). Spread the props onto it. */
23
+ renderLink?: (item: BreadcrumbEntry, props: React.AnchorHTMLAttributes<HTMLAnchorElement> & {
24
+ className: string;
25
+ }) => React.ReactElement;
26
+ /**
27
+ * 'collapse' (default): when the trail doesn't fit on one line, steps from the second onward move behind "…" until it
28
+ * does, keeping the first step and the current page (#263). 'wrap': it wraps onto more lines, as before.
29
+ */
30
+ fit?: 'collapse' | 'wrap';
31
+ /** Called when a step in the "…" menu is chosen. Default: follow its href. */
32
+ onNavigate?: (item: BreadcrumbEntry) => void;
33
+ /** Composable parts (BreadcrumbList, BreadcrumbItem, …), instead of items. */
34
+ children?: React.ReactNode;
35
+ }
36
+ /**
37
+ * Where you are, as a staircase: every step stands on one ground line and each deeper place is a taller step, as in
38
+ * Drilldown (without its pile: a route change lays no sheet). Steps you can go back to lift when pointed at; the current
39
+ * page is a step that doesn't press. A route change re-renders it without motion: a new route isn't an arrival.
40
+ */
41
+ export declare function Breadcrumb({ items, maxItems, fit, renderLink, onNavigate, className, children, 'aria-label': label, ...rest }: BreadcrumbProps): React.JSX.Element;
42
+ /** The ordered list of steps. Each BreadcrumbItem inside it gets its depth from its place. */
43
+ export declare function BreadcrumbList({ children, className, ...rest }: React.OlHTMLAttributes<HTMLOListElement>): React.JSX.Element;
44
+ export interface BreadcrumbItemProps {
45
+ depth?: number;
46
+ children: React.ReactNode;
47
+ }
48
+ /** One step. The step holding a BreadcrumbPage is the current one. */
49
+ export declare function BreadcrumbItem({ depth, children }: BreadcrumbItemProps): React.JSX.Element;
50
+ /** A step you can go back to. */
51
+ export declare const BreadcrumbLink: React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLAnchorElement>>;
52
+ /** The current page: a step that doesn't press. */
53
+ export declare function BreadcrumbPage({ className, ...rest }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
54
+ /** The staircase needs no separators: each step's height already says it's deeper. Kept for code written for shadcn/ui; it renders nothing. */
55
+ export declare function BreadcrumbSeparator(_: {
56
+ children?: React.ReactNode;
57
+ }): null;
58
+ /** Collapsed steps behind "…", in a menu. */
59
+ export declare function BreadcrumbEllipsis({ items, onNavigate }: {
60
+ items: BreadcrumbEntry[];
61
+ onNavigate?: (item: BreadcrumbEntry) => void;
62
+ }): React.JSX.Element;