altitude-design 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/README.md +46 -8
  2. package/dist/adapters/codemirror.cjs +88 -0
  3. package/dist/adapters/codemirror.cjs.map +7 -0
  4. package/dist/adapters/codemirror.js +67 -0
  5. package/dist/adapters/codemirror.js.map +7 -0
  6. package/dist/adapters/react-flow.css +102 -0
  7. package/dist/adapters/tiptap.css +71 -0
  8. package/dist/altitude.css +3165 -246
  9. package/dist/altitude.iife.js +33 -5
  10. package/dist/altitude.no-fonts.css +3165 -246
  11. package/dist/chart-themes.cjs +195 -0
  12. package/dist/chart-themes.cjs.map +7 -0
  13. package/dist/chart-themes.js +165 -0
  14. package/dist/chart-themes.js.map +7 -0
  15. package/dist/cli/altitude.mjs +134 -0
  16. package/dist/guidance/README.md +32 -0
  17. package/dist/guidance/agent-setup.md +22 -0
  18. package/dist/guidance/app-skeleton.md +17 -0
  19. package/dist/guidance/evidence.json +95 -0
  20. package/dist/guidance/index.json +493 -0
  21. package/dist/guidance/llms.txt +20 -0
  22. package/dist/guidance/manifest.json +92 -0
  23. package/dist/guidance/pattern.schema.json +181 -0
  24. package/dist/guidance/patterns/agent-action.json +77 -0
  25. package/dist/guidance/patterns/agent-action.md +39 -0
  26. package/dist/guidance/patterns/assistant-conversation.json +77 -0
  27. package/dist/guidance/patterns/assistant-conversation.md +50 -0
  28. package/dist/guidance/patterns/async-collection.json +71 -0
  29. package/dist/guidance/patterns/async-collection.md +29 -0
  30. package/dist/guidance/patterns/audit-log.json +75 -0
  31. package/dist/guidance/patterns/audit-log.md +27 -0
  32. package/dist/guidance/patterns/auth.json +86 -0
  33. package/dist/guidance/patterns/auth.md +29 -0
  34. package/dist/guidance/patterns/billing.json +80 -0
  35. package/dist/guidance/patterns/billing.md +29 -0
  36. package/dist/guidance/patterns/consequential-action.json +76 -0
  37. package/dist/guidance/patterns/consequential-action.md +27 -0
  38. package/dist/guidance/patterns/developer-settings.json +79 -0
  39. package/dist/guidance/patterns/developer-settings.md +29 -0
  40. package/dist/guidance/patterns/edit-record.json +74 -0
  41. package/dist/guidance/patterns/edit-record.md +51 -0
  42. package/dist/guidance/patterns/import.json +77 -0
  43. package/dist/guidance/patterns/import.md +31 -0
  44. package/dist/guidance/patterns/members.json +77 -0
  45. package/dist/guidance/patterns/members.md +27 -0
  46. package/dist/guidance/patterns/onboarding.json +78 -0
  47. package/dist/guidance/patterns/onboarding.md +31 -0
  48. package/dist/guidance/patterns/review-submit.json +72 -0
  49. package/dist/guidance/patterns/review-submit.md +27 -0
  50. package/dist/guidance/patterns/screen-layout.json +79 -0
  51. package/dist/guidance/patterns/screen-layout.md +40 -0
  52. package/dist/guidance/patterns/settings.json +78 -0
  53. package/dist/guidance/patterns/settings.md +32 -0
  54. package/dist/guidance/patterns/sync.json +77 -0
  55. package/dist/guidance/patterns/sync.md +31 -0
  56. package/dist/guidance/principles.md +23 -0
  57. package/dist/guidance/references/build/checks/agent-action-pattern.mjs +57 -0
  58. package/dist/guidance/references/build/checks/agent-setup.mjs +78 -0
  59. package/dist/guidance/references/build/checks/assistant-conversation-pattern.mjs +49 -0
  60. package/dist/guidance/references/build/checks/audit-log-pattern.mjs +63 -0
  61. package/dist/guidance/references/build/checks/auth-pattern.mjs +67 -0
  62. package/dist/guidance/references/build/checks/billing-pattern.mjs +63 -0
  63. package/dist/guidance/references/build/checks/developer-settings-pattern.mjs +76 -0
  64. package/dist/guidance/references/build/checks/guidance.mjs +71 -0
  65. package/dist/guidance/references/build/checks/import-pattern.mjs +69 -0
  66. package/dist/guidance/references/build/checks/members-pattern.mjs +71 -0
  67. package/dist/guidance/references/build/checks/onboarding-pattern.mjs +54 -0
  68. package/dist/guidance/references/build/checks/pattern-types.mjs +13 -0
  69. package/dist/guidance/references/build/checks/pattern-workflows.mjs +226 -0
  70. package/dist/guidance/references/build/checks/primary-scope.mjs +49 -0
  71. package/dist/guidance/references/build/checks/render-tells.mjs +72 -0
  72. package/dist/guidance/references/build/checks/screen-layout-pattern.mjs +111 -0
  73. package/dist/guidance/references/build/checks/semantics.mjs +72 -0
  74. package/dist/guidance/references/build/checks/settings-pattern.mjs +73 -0
  75. package/dist/guidance/references/build/checks/sync-pattern.mjs +62 -0
  76. package/dist/guidance/references/build/checks/tells-lint.mjs +164 -0
  77. package/dist/guidance/references/build/fixtures/pattern-workflows.tsx +83 -0
  78. package/dist/guidance/references/build/fixtures/patterns/agent-action.jsx +60 -0
  79. package/dist/guidance/references/build/fixtures/patterns/app-skeleton.jsx +94 -0
  80. package/dist/guidance/references/build/fixtures/patterns/assistant-conversation.jsx +79 -0
  81. package/dist/guidance/references/build/fixtures/patterns/audit-log.jsx +81 -0
  82. package/dist/guidance/references/build/fixtures/patterns/auth.jsx +150 -0
  83. package/dist/guidance/references/build/fixtures/patterns/billing.jsx +96 -0
  84. package/dist/guidance/references/build/fixtures/patterns/developer-settings.jsx +95 -0
  85. package/dist/guidance/references/build/fixtures/patterns/import.jsx +102 -0
  86. package/dist/guidance/references/build/fixtures/patterns/members.jsx +106 -0
  87. package/dist/guidance/references/build/fixtures/patterns/onboarding.jsx +70 -0
  88. package/dist/guidance/references/build/fixtures/patterns/screen-layout-decision.jsx +74 -0
  89. package/dist/guidance/references/build/fixtures/patterns/screen-layout-editor.jsx +56 -0
  90. package/dist/guidance/references/build/fixtures/patterns/screen-layout-report.jsx +42 -0
  91. package/dist/guidance/references/build/fixtures/patterns/settings.jsx +73 -0
  92. package/dist/guidance/references/build/fixtures/patterns/sync.jsx +78 -0
  93. package/dist/guidance/references/project/components/src/pattern-async-collection.tsx +57 -0
  94. package/dist/guidance/references/project/components/src/pattern-consequential-action.tsx +77 -0
  95. package/dist/guidance/references/project/components/src/pattern-edit-record.tsx +127 -0
  96. package/dist/guidance/references/project/components/src/pattern-review-submit.tsx +47 -0
  97. package/dist/guidance/references/project/components/src/settings.tsx +79 -0
  98. package/dist/guidance/references/scripts/build-framework-fixture.mjs +20 -0
  99. package/dist/guidance/rules.json +653 -0
  100. package/dist/guidance/visual/Elevation.md +194 -0
  101. package/dist/guidance/visual/Fundamentals.md +83 -0
  102. package/dist/guidance/visual/Research.md +1620 -0
  103. package/dist/index.cjs +19009 -1854
  104. package/dist/index.cjs.map +4 -4
  105. package/dist/index.js +19009 -1854
  106. package/dist/index.js.map +4 -4
  107. package/dist/tokens.css +84 -84
  108. package/dist/tokens.json +301 -128
  109. package/dist/types/adapter-codemirror.d.ts +13 -0
  110. package/dist/types/agent-fleet.d.ts +166 -0
  111. package/dist/types/ai-label.d.ts +30 -0
  112. package/dist/types/app-shell.d.ts +83 -0
  113. package/dist/types/area-chart.d.ts +80 -0
  114. package/dist/types/artifact.d.ts +65 -0
  115. package/dist/types/bar-chart.d.ts +83 -0
  116. package/dist/types/bar-list.d.ts +35 -0
  117. package/dist/types/breadcrumb.d.ts +62 -0
  118. package/dist/types/chart-brush.d.ts +35 -0
  119. package/dist/types/chart-themes.d.ts +229 -0
  120. package/dist/types/chart.d.ts +570 -0
  121. package/dist/types/checklist.d.ts +71 -0
  122. package/dist/types/code-block.d.ts +32 -0
  123. package/dist/types/collections.d.ts +116 -5
  124. package/dist/types/color-picker.d.ts +38 -0
  125. package/dist/types/command.d.ts +6 -3
  126. package/dist/types/comment-thread.d.ts +48 -0
  127. package/dist/types/confirmation.d.ts +60 -0
  128. package/dist/types/context-menu.d.ts +17 -0
  129. package/dist/types/controls.d.ts +134 -22
  130. package/dist/types/conversation.d.ts +130 -0
  131. package/dist/types/copy-button.d.ts +19 -0
  132. package/dist/types/core.d.ts +139 -10
  133. package/dist/types/data-grid.d.ts +76 -0
  134. package/dist/types/date-picker.d.ts +96 -0
  135. package/dist/types/diff-view.d.ts +54 -0
  136. package/dist/types/dot-plot.d.ts +54 -0
  137. package/dist/types/edit-region.d.ts +121 -0
  138. package/dist/types/feature-gate.d.ts +22 -0
  139. package/dist/types/filter-bar.d.ts +65 -0
  140. package/dist/types/formatted-number.d.ts +38 -0
  141. package/dist/types/heatmap.d.ts +64 -0
  142. package/dist/types/in-place.d.ts +24 -0
  143. package/dist/types/index.d.ts +159 -14
  144. package/dist/types/inline-citation.d.ts +35 -0
  145. package/dist/types/inline-edit.d.ts +71 -0
  146. package/dist/types/input-otp.d.ts +37 -0
  147. package/dist/types/item-group.d.ts +104 -0
  148. package/dist/types/line-chart.d.ts +116 -0
  149. package/dist/types/link.d.ts +11 -0
  150. package/dist/types/markdown.d.ts +88 -0
  151. package/dist/types/meter.d.ts +43 -0
  152. package/dist/types/modal-state.d.ts +62 -0
  153. package/dist/types/nav.d.ts +8 -1
  154. package/dist/types/notifications.d.ts +42 -0
  155. package/dist/types/number-input.d.ts +30 -0
  156. package/dist/types/overlays.d.ts +56 -15
  157. package/dist/types/page-header.d.ts +27 -0
  158. package/dist/types/pagination.d.ts +29 -0
  159. package/dist/types/palette.d.ts +64 -0
  160. package/dist/types/password-input.d.ts +22 -0
  161. package/dist/types/pattern-assistant-conversation.d.ts +55 -0
  162. package/dist/types/pattern-async-collection.d.ts +34 -0
  163. package/dist/types/pattern-consequential-action.d.ts +53 -0
  164. package/dist/types/pattern-edit-record.d.ts +72 -0
  165. package/dist/types/pattern-review-submit.d.ts +43 -0
  166. package/dist/types/permission-matrix.d.ts +34 -0
  167. package/dist/types/plan-picker.d.ts +40 -0
  168. package/dist/types/prompt-input.d.ts +106 -0
  169. package/dist/types/property-list.d.ts +67 -0
  170. package/dist/types/question.d.ts +64 -0
  171. package/dist/types/relative-time.d.ts +21 -0
  172. package/dist/types/removal-receipt.d.ts +1180 -0
  173. package/dist/types/resizable.d.ts +48 -0
  174. package/dist/types/roving.d.ts +44 -0
  175. package/dist/types/save-bar.d.ts +38 -0
  176. package/dist/types/saved-views.d.ts +72 -0
  177. package/dist/types/scatter-chart.d.ts +60 -0
  178. package/dist/types/schedule.d.ts +80 -0
  179. package/dist/types/secret-field.d.ts +33 -0
  180. package/dist/types/select.d.ts +44 -2
  181. package/dist/types/separator.d.ts +11 -0
  182. package/dist/types/settings.d.ts +39 -0
  183. package/dist/types/sheet.d.ts +1 -1
  184. package/dist/types/sparkline.d.ts +46 -0
  185. package/dist/types/split-button.d.ts +21 -0
  186. package/dist/types/stat.d.ts +54 -0
  187. package/dist/types/stepper.d.ts +6 -3
  188. package/dist/types/suggestions.d.ts +29 -0
  189. package/dist/types/suspense.d.ts +85 -0
  190. package/dist/types/sync-indicator.d.ts +24 -0
  191. package/dist/types/tag-input.d.ts +65 -0
  192. package/dist/types/terminal.d.ts +33 -0
  193. package/dist/types/thread-list.d.ts +58 -0
  194. package/dist/types/time-input.d.ts +33 -0
  195. package/dist/types/timeline.d.ts +38 -0
  196. package/dist/types/toggle.d.ts +46 -0
  197. package/dist/types/toolbar.d.ts +34 -0
  198. package/dist/types/tour.d.ts +23 -0
  199. package/dist/types/trace.d.ts +65 -0
  200. package/dist/types/tree.d.ts +71 -0
  201. package/dist/types-cjs/adapter-codemirror.d.cts +13 -0
  202. package/dist/types-cjs/agent-fleet.d.cts +166 -0
  203. package/dist/types-cjs/ai-label.d.cts +30 -0
  204. package/dist/types-cjs/app-shell.d.cts +83 -0
  205. package/dist/types-cjs/area-chart.d.cts +80 -0
  206. package/dist/types-cjs/artifact.d.cts +65 -0
  207. package/dist/types-cjs/bar-chart.d.cts +83 -0
  208. package/dist/types-cjs/bar-list.d.cts +35 -0
  209. package/dist/types-cjs/breadcrumb.d.cts +62 -0
  210. package/dist/types-cjs/chart-brush.d.cts +35 -0
  211. package/dist/types-cjs/chart-themes.d.cts +229 -0
  212. package/dist/types-cjs/chart.d.cts +570 -0
  213. package/dist/types-cjs/checklist.d.cts +71 -0
  214. package/dist/types-cjs/code-block.d.cts +32 -0
  215. package/dist/types-cjs/collections.d.cts +246 -0
  216. package/dist/types-cjs/color-picker.d.cts +38 -0
  217. package/dist/types-cjs/command.d.cts +66 -0
  218. package/dist/types-cjs/comment-thread.d.cts +48 -0
  219. package/dist/types-cjs/confirmation.d.cts +60 -0
  220. package/dist/types-cjs/context-menu.d.cts +17 -0
  221. package/dist/types-cjs/controls.d.cts +360 -0
  222. package/dist/types-cjs/conversation.d.cts +130 -0
  223. package/dist/types-cjs/copy-button.d.cts +19 -0
  224. package/dist/types-cjs/core.d.cts +256 -0
  225. package/dist/types-cjs/data-grid.d.cts +76 -0
  226. package/dist/types-cjs/date-picker.d.cts +96 -0
  227. package/dist/types-cjs/diff-view.d.cts +54 -0
  228. package/dist/types-cjs/dot-plot.d.cts +54 -0
  229. package/dist/types-cjs/edit-region.d.cts +121 -0
  230. package/dist/types-cjs/empty.d.cts +24 -0
  231. package/dist/types-cjs/feature-gate.d.cts +22 -0
  232. package/dist/types-cjs/filter-bar.d.cts +65 -0
  233. package/dist/types-cjs/formatted-number.d.cts +38 -0
  234. package/dist/types-cjs/heatmap.d.cts +64 -0
  235. package/dist/types-cjs/in-place.d.cts +24 -0
  236. package/dist/types-cjs/index.d.cts +154 -0
  237. package/dist/types-cjs/inline-citation.d.cts +35 -0
  238. package/dist/types-cjs/inline-edit.d.cts +71 -0
  239. package/dist/types-cjs/input-otp.d.cts +37 -0
  240. package/dist/types-cjs/item-group.d.cts +104 -0
  241. package/dist/types-cjs/line-chart.d.cts +116 -0
  242. package/dist/types-cjs/link.d.cts +11 -0
  243. package/dist/types-cjs/markdown.d.cts +88 -0
  244. package/dist/types-cjs/meter.d.cts +43 -0
  245. package/dist/types-cjs/modal-state.d.cts +62 -0
  246. package/dist/types-cjs/nav.d.cts +25 -0
  247. package/dist/types-cjs/notifications.d.cts +42 -0
  248. package/dist/types-cjs/number-input.d.cts +30 -0
  249. package/dist/types-cjs/overlays.d.cts +170 -0
  250. package/dist/types-cjs/page-header.d.cts +27 -0
  251. package/dist/types-cjs/pagination.d.cts +29 -0
  252. package/dist/types-cjs/palette.d.cts +64 -0
  253. package/dist/types-cjs/password-input.d.cts +22 -0
  254. package/dist/types-cjs/pattern-assistant-conversation.d.cts +55 -0
  255. package/dist/types-cjs/pattern-async-collection.d.cts +34 -0
  256. package/dist/types-cjs/pattern-consequential-action.d.cts +53 -0
  257. package/dist/types-cjs/pattern-edit-record.d.cts +72 -0
  258. package/dist/types-cjs/pattern-review-submit.d.cts +43 -0
  259. package/dist/types-cjs/permission-matrix.d.cts +34 -0
  260. package/dist/types-cjs/pile.d.cts +27 -0
  261. package/dist/types-cjs/plan-picker.d.cts +40 -0
  262. package/dist/types-cjs/prompt-input.d.cts +106 -0
  263. package/dist/types-cjs/property-list.d.cts +67 -0
  264. package/dist/types-cjs/question.d.cts +64 -0
  265. package/dist/types-cjs/relative-time.d.cts +21 -0
  266. package/dist/types-cjs/removal-receipt.d.cts +1180 -0
  267. package/dist/types-cjs/resizable.d.cts +48 -0
  268. package/dist/types-cjs/roving.d.cts +44 -0
  269. package/dist/types-cjs/save-bar.d.cts +38 -0
  270. package/dist/types-cjs/saved-views.d.cts +72 -0
  271. package/dist/types-cjs/scatter-chart.d.cts +60 -0
  272. package/dist/types-cjs/schedule.d.cts +80 -0
  273. package/dist/types-cjs/secret-field.d.cts +33 -0
  274. package/dist/types-cjs/select.d.cts +109 -0
  275. package/dist/types-cjs/separator.d.cts +11 -0
  276. package/dist/types-cjs/settings.d.cts +39 -0
  277. package/dist/types-cjs/sheet.d.cts +27 -0
  278. package/dist/types-cjs/sparkline.d.cts +46 -0
  279. package/dist/types-cjs/split-button.d.cts +21 -0
  280. package/dist/types-cjs/stat.d.cts +54 -0
  281. package/dist/types-cjs/stepper.d.cts +26 -0
  282. package/dist/types-cjs/suggestions.d.cts +29 -0
  283. package/dist/types-cjs/suspense.d.cts +85 -0
  284. package/dist/types-cjs/sync-indicator.d.cts +24 -0
  285. package/dist/types-cjs/tag-input.d.cts +65 -0
  286. package/dist/types-cjs/terminal.d.cts +33 -0
  287. package/dist/types-cjs/thread-list.d.cts +58 -0
  288. package/dist/types-cjs/time-input.d.cts +33 -0
  289. package/dist/types-cjs/timeline.d.cts +38 -0
  290. package/dist/types-cjs/toggle.d.cts +46 -0
  291. package/dist/types-cjs/toolbar.d.cts +34 -0
  292. package/dist/types-cjs/tour.d.cts +23 -0
  293. package/dist/types-cjs/trace.d.cts +65 -0
  294. package/dist/types-cjs/tree.d.cts +71 -0
  295. package/package.json +90 -9
@@ -0,0 +1,48 @@
1
+ import * as React from 'react';
2
+ export interface ResizablePanelGroupProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** horizontal (default): panes side by side; vertical: stacked. */
4
+ direction?: 'horizontal' | 'vertical';
5
+ /** Remembers the sizes in this browser under this name. */
6
+ autoSaveId?: string;
7
+ onLayout?: (sizes: number[]) => void;
8
+ /**
9
+ * Under 480px of its own width (#265). 'stack' (default): one panel at a time, `narrowPanel` (default the first), the
10
+ * list-and-detail pattern on phones, with the handles hidden. 'vertical': the panes stack with a horizontal grip.
11
+ * false: as on a wide screen.
12
+ */
13
+ narrow?: 'stack' | 'vertical' | false;
14
+ /** With narrow="stack", the panel shown while narrow (by index). Change it to move between list and detail. */
15
+ narrowPanel?: number;
16
+ /** Called when the group becomes narrow or wide again, so the app can show its way back (a Back button). */
17
+ onNarrowChange?: (narrow: boolean) => void;
18
+ }
19
+ /**
20
+ * Panes beside each other on the ground, parted by dividers you can drag. The panes never lift (a detail pane opening
21
+ * beside its list stays on the ground, unlike a Sheet); only the grip is live, and it floats while held.
22
+ */
23
+ export declare function ResizablePanelGroup({ direction: directionProp, autoSaveId, onLayout, narrow, narrowPanel, onNarrowChange, className, children, ...rest }: ResizablePanelGroupProps): React.JSX.Element;
24
+ export interface ResizablePanelProps extends React.HTMLAttributes<HTMLDivElement> {
25
+ /** Percent of the group. Panels without one share what's left. */
26
+ defaultSize?: number;
27
+ /** Percent. Default 10. */
28
+ minSize?: number;
29
+ /** Percent. Default 90. */
30
+ maxSize?: number;
31
+ /** Enter on the handle before it collapses it to nothing, and restores it. */
32
+ collapsible?: boolean;
33
+ /** Names the pane, and the handle that resizes it. */
34
+ 'aria-label'?: string;
35
+ }
36
+ /** A pane: settled, on the ground. A collapsed pane is inert. */
37
+ export declare function ResizablePanel({ defaultSize: _d, minSize: _min, maxSize: _max, collapsible: _c, className, style, id, ...rest }: ResizablePanelProps): React.JSX.Element;
38
+ export interface ResizableHandleProps extends React.HTMLAttributes<HTMLDivElement> {
39
+ /** Show the grip plate. Default true. */
40
+ withGrip?: boolean;
41
+ /** Its name. Default "Resize {the pane before it}". */
42
+ label?: string;
43
+ }
44
+ /**
45
+ * The divider between two panes: 1px of line with a grip. The grip is flush at rest, lifts one level when pointed at,
46
+ * and floats at level 3 while held. A window splitter: arrows resize, Home and End go to the limits, Enter collapses.
47
+ */
48
+ export declare function ResizableHandle({ withGrip, label, className, ...rest }: ResizableHandleProps): React.JSX.Element | null;
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+ /** True inside a roving container: its buttons mark themselves as items (data-roving-item). */
3
+ export declare const RovingCtx: React.Context<boolean>;
4
+ /** What a control looks like when a toolbar moves it into its "More" menu. */
5
+ export type OverflowEntry = {
6
+ label?: string;
7
+ onSelect: () => void;
8
+ checked?: boolean;
9
+ disabled?: boolean;
10
+ };
11
+ /** Set by a Toolbar with overflow="menu": its controls register how to show themselves in the menu. */
12
+ export declare const OverflowCtx: React.Context<React.MutableRefObject<Map<HTMLElement, OverflowEntry>> | null>;
13
+ /** Registers a control (by its element) with the nearest overflowing Toolbar. The entry is read when the menu renders. */
14
+ export declare function useOverflowEntry(el: React.RefObject<HTMLElement | null>, entry: OverflowEntry): void;
15
+ /** One ref for a forwarded ref and our own. */
16
+ export declare function useMergedRef<T>(forwarded: React.ForwardedRef<T>): readonly [React.RefObject<T | null>, (el: T | null) => void];
17
+ /** A control's name for a menu: its aria-label, else its text. */
18
+ export declare const nameOf: (el: HTMLElement | null) => string;
19
+ export interface RovingOptions {
20
+ orientation?: 'horizontal' | 'vertical';
21
+ /** Off: the items keep their own tab stops (a ToggleGroup inside a Toolbar leaves roving to the Toolbar). */
22
+ enabled?: boolean;
23
+ /** Moving also chooses (a radio group): called with the item focus moved to. */
24
+ onMove?: (el: HTMLElement) => void;
25
+ /** The item that holds the tab stop when focus hasn't been in the group yet (the chosen one). Default the first. */
26
+ initial?: (box: HTMLElement) => HTMLElement | null | undefined;
27
+ }
28
+ /**
29
+ * Spread the result onto the container. One item holds tabIndex 0: the last one focused, so returning to the group
30
+ * lands where you left it.
31
+ */
32
+ export declare function useRoving<T extends HTMLElement>({ orientation, enabled, onMove, initial }?: RovingOptions): {
33
+ ref: React.RefObject<T | null>;
34
+ 'data-roving'?: undefined;
35
+ 'aria-orientation'?: undefined;
36
+ onFocus?: undefined;
37
+ onKeyDown?: undefined;
38
+ } | {
39
+ ref: React.RefObject<T | null>;
40
+ 'data-roving': string;
41
+ 'aria-orientation': "horizontal" | "vertical";
42
+ onFocus: (e: React.FocusEvent) => void;
43
+ onKeyDown: (e: React.KeyboardEvent) => void;
44
+ };
@@ -0,0 +1,38 @@
1
+ import * as React from 'react';
2
+ /** What SaveBar reads from useEditRecord. */
3
+ interface RecordLike {
4
+ dirty: boolean;
5
+ phase: 'editing' | 'invalid' | 'submitting' | 'saved' | 'failed';
6
+ errors: object;
7
+ error?: string;
8
+ draft?: object;
9
+ baseline?: object;
10
+ submit: () => unknown;
11
+ reset: () => unknown;
12
+ }
13
+ export interface SaveBarProps {
14
+ /** A useEditRecord result: SaveBar reads dirty, phase and errors from it, and Save and Discard call submit and reset. */
15
+ record?: RecordLike;
16
+ dirty?: boolean;
17
+ saving?: boolean;
18
+ /** Why the last save failed. The draft is kept. */
19
+ error?: string;
20
+ /** Fields that need attention before saving. */
21
+ invalidCount?: number;
22
+ /** How many fields changed. Default: counted from the record. */
23
+ changedCount?: number;
24
+ onSave?: () => void;
25
+ onDiscard?: () => void;
26
+ /** The bar appears once a change has settled into the draft (this long without another), not on the first key. Default 600. */
27
+ delay?: number;
28
+ saveLabel?: string;
29
+ discardLabel?: string;
30
+ className?: string;
31
+ }
32
+ /**
33
+ * Unsaved changes on a page, held above it until saved or discarded. A draft is something in your hand, so the bar
34
+ * floats at level 3, docked to the bottom edge (below Sheets and Dialogs). Saving hovers as a pending write; a saved
35
+ * draft lowers away while the fields settle; a failed save drops the bar to a trench and keeps the draft.
36
+ */
37
+ export declare function SaveBar({ record, dirty: dirtyProp, saving: savingProp, error: errorProp, invalidCount: invalidProp, changedCount, onSave, onDiscard, delay, saveLabel, discardLabel, className }: SaveBarProps): React.JSX.Element;
38
+ export {};
@@ -0,0 +1,72 @@
1
+ import * as React from 'react';
2
+ import { Filter } from './filter-bar.js';
3
+ import { TableSort } from './collections.js';
4
+ /** What a view keeps: its filters, their match, the sort and the columns. */
5
+ export interface ViewState {
6
+ filters: Filter[];
7
+ match: 'all' | 'any';
8
+ sort: TableSort;
9
+ columnVisibility: Record<string, boolean>;
10
+ columnOrder?: string[];
11
+ }
12
+ export interface SavedView extends Partial<ViewState> {
13
+ id: string;
14
+ name: string;
15
+ }
16
+ export interface SavedViewsOptions {
17
+ views: SavedView[];
18
+ /** The view shown first. Default the first. */
19
+ defaultViewId?: string;
20
+ /** Saves the active view's changes over it. */
21
+ onSave?: (view: SavedView) => void;
22
+ /** Saves the active view's state as a new view with this name. */
23
+ onCreate?: (view: Omit<SavedView, 'id'>) => void;
24
+ onDelete?: (id: string) => void;
25
+ }
26
+ export interface SavedViewsApi {
27
+ views: SavedView[];
28
+ active: SavedView;
29
+ /** The view as it is now, with any unsaved changes. */
30
+ draft: ViewState;
31
+ /** The draft differs from what's saved. */
32
+ modified: boolean;
33
+ select: (id: string) => void;
34
+ save: () => void;
35
+ saveAsNew: (name: string) => void;
36
+ reset: () => void;
37
+ canSave: boolean;
38
+ canCreate: boolean;
39
+ /** Spread onto FilterBar. */
40
+ filterBarProps: {
41
+ value: Filter[];
42
+ onValueChange: (f: Filter[]) => void;
43
+ match: 'all' | 'any';
44
+ onMatchChange: (m: 'all' | 'any') => void;
45
+ };
46
+ /** Spread onto DataTable. */
47
+ tableProps: {
48
+ sort: TableSort;
49
+ onSortChange: (s: TableSort) => void;
50
+ columnVisibility: Record<string, boolean>;
51
+ onColumnVisibilityChange: (v: Record<string, boolean>) => void;
52
+ columnOrder?: string[];
53
+ onColumnOrderChange: (o: string[]) => void;
54
+ };
55
+ }
56
+ /**
57
+ * Named combinations of a FilterBar's filters and a DataTable's sort and columns. Each view keeps its own draft while
58
+ * you change it, so switching away and back doesn't lose work; `modified` says when the draft differs from what's saved.
59
+ */
60
+ export declare function useSavedViews({ views, defaultViewId, onSave, onCreate, onDelete: _onDelete }: SavedViewsOptions): SavedViewsApi;
61
+ export interface SavedViewsProps {
62
+ views: SavedViewsApi;
63
+ /** The FilterBar and DataTable the views drive: shown on the active tab's sheet. */
64
+ children: React.ReactNode;
65
+ 'aria-label'?: string;
66
+ className?: string;
67
+ }
68
+ /**
69
+ * Saved views as folder Tabs: the active tab and the table beneath it are one raised sheet. A view you've changed is a
70
+ * draft: its tab carries a dot and "modified", and Save view, Save as new view and Reset appear beside the tabs.
71
+ */
72
+ export declare function SavedViews({ views: v, children, 'aria-label': label, className }: SavedViewsProps): React.JSX.Element;
@@ -0,0 +1,60 @@
1
+ import * as React from 'react';
2
+ import { type ChartConfig, type ChartContextValue, type ChartDatum, type ChartEmpty, type ChartInfo, type ChartReadout } from './chart.js';
3
+ export interface ScatterChartProps {
4
+ /** The records: one dot each. */
5
+ data: ChartDatum[] | null | undefined | PromiseLike<ChartDatum[] | null>;
6
+ /** The key of each record's first measure, along the bottom. Name and format it in the container's config. */
7
+ x: string;
8
+ /** The key of each record's second measure, up the side. Name and format it in the container's config. */
9
+ y: string;
10
+ /** The key that sorts records into groups, each a colour and a marker shape. At most three; more belong in small multiples. */
11
+ group?: string;
12
+ /** Each record's stable identity, a key or a function: dots glide to new places when it's given, and cross-fade otherwise. */
13
+ id?: string | ((d: ChartDatum) => string);
14
+ /** Each record's name, a key or a function, for the readout, its name on the keyboard path and the table. */
15
+ name?: string | ((d: ChartDatum) => string);
16
+ /** Labels a few dots on the plot (outliers): return the words, or null for none. */
17
+ label?: (d: ChartDatum) => string | null | undefined;
18
+ /** A least-squares trend line, 1px ink-muted, named "Trend" (or the words you pass). */
19
+ trend?: boolean | string;
20
+ /** The dots' size in px. Default 8, the least. */
21
+ size?: number;
22
+ /** The readout. Default true. */
23
+ tooltip?: boolean;
24
+ /**
25
+ * What the chart is about (#188): groups that keep their colours while the rest take data-context, or a test for
26
+ * the records that keep theirs (on a one-series chart, the categories the takeaway names). The author's statement of
27
+ * importance, not a reader's filter (that's relevance).
28
+ */
29
+ focus?: string[] | ((d: ChartDatum) => boolean);
30
+ /** Filter in place: which records match. Misses recede to 35%, keeping their place and colour. */
31
+ relevance?: (d: ChartDatum) => 'match' | 'miss' | undefined;
32
+ /** With relevance: fit y to the matches. Default false: the axes hold. */
33
+ rescale?: boolean;
34
+ /** The selected record, or its id. The others recede; the frame says "Filtered to …". */
35
+ selected?: ChartDatum | string | null;
36
+ /** Makes dots selectable: called with the chosen record, or null when the selection clears. */
37
+ onSelect?: (d: ChartDatum | null) => void;
38
+ /** Makes dots open a level down, inside a Drilldown: return the id of the current node's child this record opens. */
39
+ drill?: (d: ChartDatum) => string | null | undefined;
40
+ /** What the plot says when there's no data. */
41
+ empty?: ChartEmpty;
42
+ /** A ChartTooltip or ChartLegend. */
43
+ children?: React.ReactNode;
44
+ }
45
+ /**
46
+ * Two measures per record, to see how they relate: payload against latency per endpoint, spend against usage per
47
+ * customer. Dots are the record, so they lie on the plot: at least 8px, a data-* fill and a marker shape per group, a
48
+ * 2px ring of the plot's own colour so overlapping dots stay apart. Never raised, never shaded. A few can be labelled
49
+ * in ink with a 1px leader, and a least-squares trend drawn as a 1px ink-muted line.
50
+ */
51
+ export declare function ScatterChart(props: ScatterChartProps): React.JSX.Element;
52
+ export declare namespace ScatterChart {
53
+ var chartPoint: (props: Record<string, unknown>, ctx: ChartContextValue, d: ChartDatum) => [number, number];
54
+ var chartMark: (props: Record<string, unknown>, ctx: ChartContextValue, d: ChartDatum) => string | null;
55
+ var chartNearest: (props: Record<string, unknown>, ctx: ChartContextValue, px: number, py: number) => number | null;
56
+ var chartMove: (props: Record<string, unknown>, ctx: ChartContextValue, i: number, e: React.KeyboardEvent) => number | null;
57
+ var chartName: (props: Record<string, unknown>, ctx: ChartContextValue, d: ChartDatum) => string;
58
+ var chartReadout: (props: Record<string, unknown>, ctx: ChartContextValue, d: ChartDatum) => ChartReadout;
59
+ var chartInfo: (props: Record<string, unknown>, config: ChartConfig) => ChartInfo;
60
+ }
@@ -0,0 +1,80 @@
1
+ import * as React from 'react';
2
+ /** A local date-time, 'YYYY-MM-DDTHH:mm': no time zone. Convert at your edges. */
3
+ export type LocalDateTime = string;
4
+ export type ScheduleResult = {
5
+ ok: true;
6
+ } | {
7
+ ok: false;
8
+ error: string;
9
+ };
10
+ export type ScheduleCreateResult<T> = {
11
+ ok: true;
12
+ value: T;
13
+ } | {
14
+ ok: false;
15
+ error: string;
16
+ };
17
+ export interface ScheduleSpan {
18
+ start: LocalDateTime;
19
+ end: LocalDateTime;
20
+ }
21
+ export interface ScheduleProps<T> {
22
+ /** Default 'week'. */
23
+ view?: 'day' | 'week' | 'workweek';
24
+ /**
25
+ * What it shows under 480px of its own width (#257). 'day' (default): one day at a time, paged with the header's
26
+ * previous and next, so events and slots keep a readable width. false: the view, squeezed.
27
+ */
28
+ narrowView?: 'day' | false;
29
+ /** Any day in the period shown, 'YYYY-MM-DD'. */
30
+ date: string;
31
+ onDateChange?: (date: string) => void;
32
+ events: T[];
33
+ getKey: (event: T) => string;
34
+ getStart: (event: T) => LocalDateTime;
35
+ getEnd: (event: T) => LocalDateTime;
36
+ getLabel: (event: T) => string;
37
+ /** Minutes per slot, and the snap for moves and resizes. Default 15. */
38
+ step?: number;
39
+ /** Default '08:00' and '19:00'. */
40
+ dayStart?: string;
41
+ dayEnd?: string;
42
+ /** Pixels per hour. Default 48, or 96 under a coarse pointer so a 15-minute slot is 24px tall. */
43
+ hourHeight?: number;
44
+ /** 0 Sunday … 6 Saturday. Default 1. */
45
+ weekStartsOn?: number;
46
+ /** A new event's length when made with Enter on an empty slot. Default 60 minutes. */
47
+ defaultDuration?: number;
48
+ renderEvent?: (event: T) => React.ReactNode;
49
+ /** Resolve after `events` includes the new event. */
50
+ onCreate?: (request: ScheduleSpan & {
51
+ title: string;
52
+ }) => ScheduleCreateResult<T> | Promise<ScheduleCreateResult<T>>;
53
+ /** A move or a resize. Resolve after `events` reflects it. */
54
+ onChange?: (next: ScheduleSpan & {
55
+ id: string;
56
+ }, previous: T) => ScheduleResult | Promise<ScheduleResult>;
57
+ onRename?: (event: T, title: string) => ScheduleResult | Promise<ScheduleResult>;
58
+ /** Enter on an event: show its details (in a Sheet, not a Dialog). */
59
+ onOpen?: (event: T) => void;
60
+ /** Delete. Your removal policy applies. */
61
+ onRemove?: (event: T) => void;
62
+ /** Someone else is moving this event: it can't be picked up. */
63
+ heldBy?: (event: T) => {
64
+ name: string;
65
+ presence?: 1 | 2 | 3;
66
+ } | null | undefined;
67
+ /** Refuse a span (outside hours, a closed room). */
68
+ isUnavailable?: (span: ScheduleSpan) => boolean;
69
+ /** The now line's time. Default: the clock. */
70
+ now?: LocalDateTime;
71
+ locale?: string;
72
+ 'aria-label'?: string;
73
+ className?: string;
74
+ }
75
+ /**
76
+ * A day or week of time whose events you handle directly. The grid is ground; events are live work items raised one
77
+ * level, like BoardCards. Time opens into wells only while something could land in it (carrying or drawing), and the
78
+ * slot under a carried event deepens to a trench the length of the event. A carried event floats at level 3, tilted.
79
+ */
80
+ export declare function Schedule<T>({ view: viewProp, narrowView, date, onDateChange, events, getKey, getStart, getEnd, getLabel, step, dayStart, dayEnd, hourHeight: hourHeightProp, weekStartsOn, defaultDuration, renderEvent, onCreate, onChange, onRename, onOpen, onRemove, heldBy, isUnavailable, now, locale, className, ...aria }: ScheduleProps<T>): React.JSX.Element;
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ export interface SecretFieldProps {
3
+ /** What the secret is ("Secret key"). It names the field. */
4
+ label: string;
5
+ /** The word used in the buttons and the warning: "Copy key", "Show key", "Revoke key". Default "key". */
6
+ noun?: string;
7
+ /** A secret just created: shown in full, once. */
8
+ value?: string;
9
+ /** With value: the secret is shown only now. It stays an opening until onAcknowledge, then masks. */
10
+ once?: boolean;
11
+ /** Called when the person confirms they've saved the secret. Gate closing on it. */
12
+ onAcknowledge?: () => void;
13
+ /** The confirmation's words. Default "I've saved this {noun}". */
14
+ acknowledgeLabel?: string;
15
+ /** The warning while the secret is new. Default "You won't see this {noun} again. Store it somewhere safe." */
16
+ warning?: React.ReactNode;
17
+ /** A stored secret: the part shown before the mask ("sk_live_"). */
18
+ prefix?: string;
19
+ /** A stored secret: its last characters ("4f2a"). */
20
+ maskedTail?: string;
21
+ /** A stored secret that may be shown again: returns it (it may be a promise). Without it there's no reveal. */
22
+ onReveal?: () => string | Promise<string>;
23
+ onRotate?: () => void;
24
+ /** Revoking is held, not clicked (HoldButton). */
25
+ onRevoke?: () => void;
26
+ className?: string;
27
+ }
28
+ /**
29
+ * A key or token: shown once when created, masked afterwards. A new secret is an opening, something to take away: a
30
+ * sunk well with copy beside it and a warning, until you say you've saved it; then it fills flush and masks. A stored
31
+ * secret is settled: flush, masked to its tail, with reveal (if allowed), rotate and a held revoke.
32
+ */
33
+ export declare function SecretField({ label, noun, value, once, onAcknowledge, acknowledgeLabel, warning, prefix, maskedTail, onReveal, onRotate, onRevoke, className }: SecretFieldProps): React.JSX.Element;
@@ -1,4 +1,6 @@
1
1
  import * as React from 'react';
2
+ import { type Presentation } from './core.js';
3
+ export declare const EXIT_3 = 160;
2
4
  export interface SelectOption {
3
5
  value: string;
4
6
  label: React.ReactNode;
@@ -18,6 +20,34 @@ export interface SelectItemProps {
18
20
  }
19
21
  /** Declares one option of a Select. It renders nothing itself; Select reads its props. */
20
22
  export declare function SelectItem(_: SelectItemProps): React.ReactElement | null;
23
+ export declare const textOf: (o: SelectOption) => string;
24
+ /** The Checkbox family's tick: the same path and stroke, here in accent-ink on the chosen row. */
25
+ export declare const Tick: () => React.JSX.Element;
26
+ /** Opens downward unless there's more room above the field than below it (within whatever clips it). */
27
+ export declare function useSide(open: boolean, anchor: React.RefObject<HTMLElement | null>, list: React.RefObject<HTMLElement | null>): "bottom" | "top";
28
+ /** Finds the label element that names a control by id, so the list can carry the same name. */
29
+ export declare function useLabelId(controlId: string, fallback: string): string | undefined;
30
+ type ListProps = {
31
+ id: string;
32
+ options: SelectOption[];
33
+ active: number;
34
+ value: string;
35
+ state: 'open' | 'closed';
36
+ side: 'bottom' | 'top';
37
+ query?: string;
38
+ empty?: React.ReactNode;
39
+ listRef: React.RefObject<HTMLDivElement | null>;
40
+ labelledBy?: string;
41
+ label?: string;
42
+ focusable: boolean;
43
+ onActive: (i: number) => void;
44
+ onChoose: (i: number) => void;
45
+ onKeyDown?: (e: React.KeyboardEvent) => void;
46
+ /** Presented as a bottom sheet (#249); Close calls onDismiss. */
47
+ sheet?: boolean;
48
+ onDismiss?: () => void;
49
+ };
50
+ export declare function OptionList({ id, options, active, value, state, side, query, empty, listRef, labelledBy, label, focusable, onActive, onChoose, onKeyDown, sheet, onDismiss }: ListProps): React.JSX.Element;
21
51
  interface FieldLike {
22
52
  id?: string;
23
53
  name?: string;
@@ -36,6 +66,13 @@ interface FieldLike {
36
66
  defaultOpen?: boolean;
37
67
  }
38
68
  export interface SelectProps extends FieldLike {
69
+ /**
70
+ * 'auto' (default): the list opens under the trigger, or on a narrow touch screen as a sheet at the bottom edge with
71
+ * the field's label and Close (#249). 'anchored' or 'sheet' forces one.
72
+ */
73
+ presentation?: Presentation;
74
+ /** Visible required-field feedback after native validation. Localize this for the application. */
75
+ requiredMessage?: string;
39
76
  value?: string;
40
77
  defaultValue?: string;
41
78
  onValueChange?: (value: string) => void;
@@ -48,8 +85,13 @@ export interface SelectProps extends FieldLike {
48
85
  * empty, its floor rises flush once a value is chosen, and it drops to trench depth when invalid. The list rises from
49
86
  * the field's edge at level 3 with one gliding highlight; the chosen option wears the Checkbox family's tick.
50
87
  */
51
- export declare function Select({ value, defaultValue, onValueChange, items, children, id, name, required, disabled, invalid, size, placeholder, defaultOpen, className, ...aria }: SelectProps): React.JSX.Element;
88
+ export declare function Select({ value, defaultValue, onValueChange, items, children, id, name, required, disabled, invalid, size, placeholder, requiredMessage, defaultOpen, className, presentation, ...aria }: SelectProps): React.JSX.Element;
52
89
  export interface ComboboxProps extends FieldLike {
90
+ /**
91
+ * 'auto' (default) and 'anchored': the list stays under the field you're typing in, so the on-screen keyboard never
92
+ * hides the list or the field. 'sheet' opens it at the bottom edge with the field's label and Close (#249).
93
+ */
94
+ presentation?: Presentation;
53
95
  items: SelectOption[];
54
96
  value?: string;
55
97
  defaultValue?: string;
@@ -63,5 +105,5 @@ export interface ComboboxProps extends FieldLike {
63
105
  * An editable Select: type to filter, choose to fill. What you type is a query, not yet a value, so the field stays an
64
106
  * opening (its back wall showing) until an option is chosen; then its floor rises flush.
65
107
  */
66
- export declare function Combobox({ items, value, defaultValue, onValueChange, filter, empty, id, name, required, disabled, invalid, size, placeholder, defaultOpen, className, ...aria }: ComboboxProps): React.JSX.Element;
108
+ export declare function Combobox({ items, value, defaultValue, onValueChange, filter, empty, id, name, required, disabled, invalid, size, placeholder, defaultOpen, className, presentation, ...aria }: ComboboxProps): React.JSX.Element;
67
109
  export {};
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ export interface SeparatorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
3
+ /** Default horizontal. A vertical one stretches to the height of the row it's in. */
4
+ orientation?: 'horizontal' | 'vertical';
5
+ /** Purely visual: hidden from assistive technology (role="none"). Use it when the layout already says what's parted. */
6
+ decorative?: boolean;
7
+ /** A word between two lines ("or"). It's read in the flow, so it's never decorative. */
8
+ label?: React.ReactNode;
9
+ }
10
+ /** A divider on the ground: 1px of `line`, never `line-control` and never a shadow. role="separator" unless decorative. */
11
+ export declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,39 @@
1
+ import * as React from 'react';
2
+ import type { DepthProps } from './core.js';
3
+ export interface SettingsSectionProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
4
+ /** Every section has a heading; it names the region. */
5
+ title: React.ReactNode;
6
+ description?: React.ReactNode;
7
+ /** 'critical': the danger zone. A critical rim and the same height as every other section. */
8
+ tone?: 'critical';
9
+ /** Default 2. */
10
+ headingLevel?: 2 | 3;
11
+ /** Why this person can't change these settings ("Only workspace admins can change billing details"). The rows are disabled and say why. */
12
+ readOnlyReason?: React.ReactNode;
13
+ }
14
+ /**
15
+ * One section of a settings page: a raised Card (level 1) with a heading and rows. The danger zone is the same card with
16
+ * a critical rim, never higher or louder: its consequences are said in its rows' words.
17
+ */
18
+ export declare function SettingsSection({ title, description, tone, headingLevel, readOnlyReason, className, children, ...rest }: SettingsSectionProps): React.JSX.Element;
19
+ export interface SettingsRowProps extends DepthProps {
20
+ label: React.ReactNode;
21
+ /** What the setting does, beside its label. */
22
+ description?: React.ReactNode;
23
+ /** Replaces the description and marks the control invalid. */
24
+ error?: React.ReactNode;
25
+ /**
26
+ * The words for an apply-now control's write. Defaults: pending "Saving…", committed "Saved", failed "Couldn't save
27
+ * this change. Try again." Pass the status of the write the control made; the row hovers while it's pending.
28
+ */
29
+ statusText?: Partial<Record<'pending' | 'committed' | 'failed', React.ReactNode>>;
30
+ className?: string;
31
+ /** Exactly one control: Switch, Select, Input, Button… It's labelled and described by the row. */
32
+ children: React.ReactElement<any>;
33
+ }
34
+ /**
35
+ * A setting: label and description on the start side, the control on the end side, stacked when the section is narrow.
36
+ * A control that applies immediately reports its write through `status` (pending hovers, committed lands, failed drops
37
+ * into a trench), with the state in words. Fields saved together belong to one draft with a SaveBar instead.
38
+ */
39
+ export declare function SettingsRow({ label, description, error, status, settle, heldBy, relevance, statusText, className, children }: SettingsRowProps): React.JSX.Element;
@@ -20,7 +20,7 @@ export interface SheetProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
20
20
  */
21
21
  export declare function Sheet({ open, defaultOpen, onOpenChange, trigger, side, size, modal, dismissible, className, style, children, ...rest }: SheetProps): React.JSX.Element;
22
22
  /** The title block. It stays at the top while the sheet scrolls, and rises once content passes under it. */
23
- export declare function SheetHeader({ className, ...p }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
23
+ export declare function SheetHeader({ className, children, ...p }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
24
24
  export declare function SheetTitle({ className, ...p }: React.HTMLAttributes<HTMLHeadingElement>): React.JSX.Element;
25
25
  export declare function SheetDescription({ className, ...p }: React.HTMLAttributes<HTMLParagraphElement>): React.JSX.Element;
26
26
  /** Actions, right-aligned. It stays at the bottom; where content continues beneath it, its top edge curves away. */
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ import { type ChartDatum } from './chart.js';
3
+ type SparkData = Array<number | null> | ChartDatum[];
4
+ export interface SparklineProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
5
+ /**
6
+ * The values, oldest first: numbers (a null is a gap), or records with `y` naming the value. Undefined while your
7
+ * data loads, or a promise: until it lands the sparkline is an imprint one line high and its own width.
8
+ */
9
+ data: SparkData | null | undefined | PromiseLike<SparkData | null>;
10
+ /** The key of each record's value, when `data` holds records. */
11
+ y?: string;
12
+ /** The key of each record's date, so the label can say "over 30 days" rather than "over 30 values". */
13
+ x?: string;
14
+ /** A line (default), or bars standing on zero for counts. */
15
+ kind?: 'line' | 'bar';
16
+ /**
17
+ * The colour. 'neutral' (default) is ink-muted: context for the number beside it. 'data' is data-1, when the
18
+ * sparkline is the series itself. A status hue only when the series means good or bad, and the text beside it says so.
19
+ */
20
+ tone?: 'neutral' | 'data' | 'positive' | 'caution' | 'critical';
21
+ /** A normal range, drawn as a flat band behind the line. The label says how many values fall outside it. */
22
+ band?: [number, number];
23
+ /** The width: a number of px or any CSS length. Default 5em. Its height is the line height of the text around it. */
24
+ width?: number | string;
25
+ /** Formats values in the generated label. Default: compact ("1.2K"). */
26
+ format?: (value: number) => string;
27
+ /** Replaces the generated label ("Up 12% over 30 days, from 1.2K to 1.4K."). */
28
+ summary?: string;
29
+ /** The text beside it already says what it shows: hide it from assistive technology. */
30
+ decorative?: boolean;
31
+ locale?: string;
32
+ }
33
+ /** "Up 12% over 30 days, from 1.2K to 1.4K." Direction in words, the first and last values, and the band if any. */
34
+ export declare function describeTrend(vals: Array<number | null>, opts: {
35
+ format: (v: number) => string;
36
+ span?: string;
37
+ band?: [number, number];
38
+ }): string;
39
+ /**
40
+ * A word-sized trend: rising, falling, spiky or flat at a glance, beside the number that gives the detail. It's the
41
+ * record in the row it sits in, so it lies flush on the ground like everything a chart draws: a 1.5px stroke (or flat
42
+ * bars), no axes, no gridlines, no readout, no fill under the line. Its height is the line height of the text beside
43
+ * it. The last point wears a 4px marker. Colour is context (ink-muted) unless you say it's the series or a status.
44
+ */
45
+ export declare function Sparkline({ data, ...props }: SparklineProps): React.JSX.Element;
46
+ export {};
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ import { ButtonProps } from './controls.js';
3
+ import { MenuEntry } from './overlays.js';
4
+ export interface SplitButtonProps extends Omit<ButtonProps, 'variant' | 'children' | 'square'> {
5
+ /** The default action's words ("Save changes"). They also name the group. */
6
+ label: React.ReactNode;
7
+ /** primary (default) or secondary. */
8
+ variant?: 'primary' | 'secondary';
9
+ /** The alternatives, in a DropdownMenu. */
10
+ items: MenuEntry[];
11
+ /** The chevron's name. Default "More options". Say what for: "More save options". */
12
+ menuLabel?: string;
13
+ /** Names the group when label isn't plain text. */
14
+ groupLabel?: string;
15
+ }
16
+ /**
17
+ * One action with its alternatives: two faces on one slab, sharing one wall and parted by a line notch. The slab lifts
18
+ * and presses as one whichever face is pointed at; the face under the pointer is tinted, so you can tell which action a
19
+ * click takes without the faces splitting into two heights. Alt+Down on the action opens the menu.
20
+ */
21
+ export declare const SplitButton: React.ForwardRefExoticComponent<SplitButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,54 @@
1
+ import * as React from 'react';
2
+ export interface StatChange {
3
+ /** The change. By default a fraction (0.08 is up 8%); with `format`, in whatever units you format. */
4
+ value: number;
5
+ /** What it's compared with, in words: "last month". */
6
+ vs?: string;
7
+ /** The value it's compared with, shown and announced as "vs last month: 11,556". Formatted like the value. */
8
+ previous?: number;
9
+ /** Formats the size of the change, without its sign: the stat says "Up" or "Down" in words. Default: a percentage. */
10
+ format?: (magnitude: number) => string;
11
+ }
12
+ export interface StatProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
13
+ /** What the number is: "Active users". It names the stat. */
14
+ label: React.ReactNode;
15
+ /**
16
+ * The number. Undefined while your data loads, or a promise: until it lands the value is an imprint of a number's
17
+ * width, with the label already in place. null: nothing to show (an em dash).
18
+ */
19
+ value: number | string | null | undefined | PromiseLike<number | string | null>;
20
+ /** Formats a numeric value and `change.previous`. Default: Intl.NumberFormat. */
21
+ format?: (value: number) => string;
22
+ /** How it changed, and against what. */
23
+ change?: StatChange;
24
+ /**
25
+ * Which direction is good. Without it the change is neutral, ink-muted text with an arrow, because up isn't always
26
+ * good (an error rate). With it, the change is a Badge plate whose lamp is positive or critical.
27
+ */
28
+ good?: 'up' | 'down';
29
+ /** A trend beside the value, usually a decorative Sparkline. */
30
+ trend?: React.ReactNode;
31
+ /** More context, in a caption under the change: "Signed in at least once in 28 days." */
32
+ help?: React.ReactNode;
33
+ /** 'hero' sets the value in text-display, for the one number a view leads with. Once per view. */
34
+ size?: 'default' | 'hero';
35
+ /** Announce a changed value politely: "Active users, 12,480, up 8% vs last month." */
36
+ live?: boolean;
37
+ locale?: string;
38
+ }
39
+ /**
40
+ * A headline number with how it changed and against what. A number is the record, so a stat lies flush on whatever
41
+ * it sits on (a Card, or the page): no level of its own. A changed value cross-fades and the stat gets the afterglow,
42
+ * within the attention budget; it never counts up. The change says its direction in words and with an arrow, and only
43
+ * takes a status colour when you say which direction is good.
44
+ */
45
+ export declare function Stat({ value, ...props }: StatProps): React.JSX.Element;
46
+ export interface StatGroupProps extends React.HTMLAttributes<HTMLDivElement> {
47
+ /** Names the row of stats for assistive technology: "This month". */
48
+ 'aria-label'?: string;
49
+ }
50
+ /**
51
+ * A row of stats that land together: their values stay imprints until the slowest arrives, then rise at once
52
+ * (RevealGroup). They wrap to fit, each at least 180px wide.
53
+ */
54
+ export declare function StatGroup({ className, children, ...rest }: StatGroupProps): React.JSX.Element;