cortena-ui 1.3.0 → 1.4.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 (280) hide show
  1. package/README.md +74 -3
  2. package/dist/a2ui/catalogue-doc.d.ts +44 -0
  3. package/dist/a2ui/catalogue-doc.js +169 -0
  4. package/dist/a2ui/catalogue-doc.js.map +1 -0
  5. package/dist/a2ui/catalogue.d.ts +44 -0
  6. package/dist/a2ui/catalogue.js +942 -0
  7. package/dist/a2ui/catalogue.js.map +1 -0
  8. package/dist/a2ui/index.d.ts +7 -0
  9. package/dist/a2ui/message.d.ts +232 -0
  10. package/dist/a2ui/message.js +365 -0
  11. package/dist/a2ui/message.js.map +1 -0
  12. package/dist/a2ui/renderer.d.ts +46 -0
  13. package/dist/a2ui/renderer.js +252 -0
  14. package/dist/a2ui/renderer.js.map +1 -0
  15. package/dist/a2ui/views.d.ts +80 -0
  16. package/dist/a2ui/views.js +596 -0
  17. package/dist/a2ui/views.js.map +1 -0
  18. package/dist/a2ui.d.ts +8 -0
  19. package/dist/a2ui.js +7 -0
  20. package/dist/chart.d.ts +9 -0
  21. package/dist/chart.js +9 -0
  22. package/dist/components/accordion.d.ts +22 -0
  23. package/dist/components/accordion.js +63 -0
  24. package/dist/components/accordion.js.map +1 -0
  25. package/dist/components/alert.d.ts +15 -0
  26. package/dist/components/alert.js +64 -0
  27. package/dist/components/alert.js.map +1 -0
  28. package/dist/components/avatar.d.ts +18 -0
  29. package/dist/components/avatar.js +40 -0
  30. package/dist/components/avatar.js.map +1 -0
  31. package/dist/components/badge.d.ts +12 -0
  32. package/dist/components/badge.js +47 -0
  33. package/dist/components/badge.js.map +1 -0
  34. package/dist/components/breadcrumb.d.ts +71 -0
  35. package/dist/components/breadcrumb.js +123 -0
  36. package/dist/components/breadcrumb.js.map +1 -0
  37. package/dist/components/button-link.d.ts +28 -0
  38. package/dist/components/button-link.js +24 -0
  39. package/dist/components/button-link.js.map +1 -0
  40. package/dist/components/button.d.ts +24 -0
  41. package/dist/components/button.js +65 -0
  42. package/dist/components/button.js.map +1 -0
  43. package/dist/components/calendar.d.ts +28 -0
  44. package/dist/components/calendar.js +123 -0
  45. package/dist/components/calendar.js.map +1 -0
  46. package/dist/components/card.d.ts +32 -0
  47. package/dist/components/card.js +57 -0
  48. package/dist/components/card.js.map +1 -0
  49. package/dist/components/chart/chart.d.ts +71 -0
  50. package/dist/components/chart/chart.js +167 -0
  51. package/dist/components/chart/chart.js.map +1 -0
  52. package/dist/components/chart/container.d.ts +88 -0
  53. package/dist/components/chart/container.js +189 -0
  54. package/dist/components/chart/container.js.map +1 -0
  55. package/dist/components/chart/data.js +128 -0
  56. package/dist/components/chart/data.js.map +1 -0
  57. package/dist/components/chart/index.d.ts +9 -0
  58. package/dist/components/chart/index.js +10 -0
  59. package/dist/components/chart/nivo-charts.js +225 -0
  60. package/dist/components/chart/nivo-charts.js.map +1 -0
  61. package/dist/components/chart/nivo-lazy.js +50 -0
  62. package/dist/components/chart/nivo-lazy.js.map +1 -0
  63. package/dist/components/chart/nivo-theme.d.ts +156 -0
  64. package/dist/components/chart/nivo-theme.js +161 -0
  65. package/dist/components/chart/nivo-theme.js.map +1 -0
  66. package/dist/components/chart/recharts-charts.js +276 -0
  67. package/dist/components/chart/recharts-charts.js.map +1 -0
  68. package/dist/components/chart/recharts-lazy.js +58 -0
  69. package/dist/components/chart/recharts-lazy.js.map +1 -0
  70. package/dist/components/chart/recharts-parts.d.ts +10 -0
  71. package/dist/components/chart/recharts-parts.js +25 -0
  72. package/dist/components/chart/recharts-parts.js.map +1 -0
  73. package/dist/components/chart/tokens.d.ts +62 -0
  74. package/dist/components/chart/tokens.js +192 -0
  75. package/dist/components/chart/tokens.js.map +1 -0
  76. package/dist/components/chart/types.d.ts +114 -0
  77. package/dist/components/chart/types.js +27 -0
  78. package/dist/components/chart/types.js.map +1 -0
  79. package/dist/components/checkbox.d.ts +20 -0
  80. package/dist/components/checkbox.js +24 -0
  81. package/dist/components/checkbox.js.map +1 -0
  82. package/dist/components/chip.d.ts +17 -0
  83. package/dist/components/chip.js +47 -0
  84. package/dist/components/chip.js.map +1 -0
  85. package/dist/components/combobox.d.ts +76 -0
  86. package/dist/components/combobox.js +201 -0
  87. package/dist/components/combobox.js.map +1 -0
  88. package/dist/components/command.d.ts +50 -0
  89. package/dist/components/command.js +117 -0
  90. package/dist/components/command.js.map +1 -0
  91. package/dist/components/data-table/data-table.d.ts +65 -0
  92. package/dist/components/data-table/data-table.js +588 -0
  93. package/dist/components/data-table/data-table.js.map +1 -0
  94. package/dist/components/data-table/export.d.ts +23 -0
  95. package/dist/components/data-table/export.js +95 -0
  96. package/dist/components/data-table/export.js.map +1 -0
  97. package/dist/components/data-table/features.d.ts +66 -0
  98. package/dist/components/data-table/features.js +103 -0
  99. package/dist/components/data-table/features.js.map +1 -0
  100. package/dist/components/data-table/index.d.ts +8 -0
  101. package/dist/components/data-table/parts.d.ts +79 -0
  102. package/dist/components/data-table/parts.js +400 -0
  103. package/dist/components/data-table/parts.js.map +1 -0
  104. package/dist/components/data-table/system-columns.js +84 -0
  105. package/dist/components/data-table/system-columns.js.map +1 -0
  106. package/dist/components/data-table/types.d.ts +172 -0
  107. package/dist/components/data-table/use-data-table.d.ts +19 -0
  108. package/dist/components/data-table/use-data-table.js +171 -0
  109. package/dist/components/data-table/use-data-table.js.map +1 -0
  110. package/dist/components/data-table/use-server-source.js +200 -0
  111. package/dist/components/data-table/use-server-source.js.map +1 -0
  112. package/dist/components/date-field.d.ts +54 -0
  113. package/dist/components/date-field.js +235 -0
  114. package/dist/components/date-field.js.map +1 -0
  115. package/dist/components/date-picker.d.ts +42 -0
  116. package/dist/components/date-picker.js +125 -0
  117. package/dist/components/date-picker.js.map +1 -0
  118. package/dist/components/dialog.d.ts +36 -0
  119. package/dist/components/dialog.js +97 -0
  120. package/dist/components/dialog.js.map +1 -0
  121. package/dist/components/dropdown-menu.d.ts +54 -0
  122. package/dist/components/dropdown-menu.js +191 -0
  123. package/dist/components/dropdown-menu.js.map +1 -0
  124. package/dist/components/dropzone.d.ts +48 -0
  125. package/dist/components/dropzone.js +185 -0
  126. package/dist/components/dropzone.js.map +1 -0
  127. package/dist/components/empty-state.d.ts +22 -0
  128. package/dist/components/empty-state.js +46 -0
  129. package/dist/components/empty-state.js.map +1 -0
  130. package/dist/components/error-banner.d.ts +17 -0
  131. package/dist/components/error-banner.js +52 -0
  132. package/dist/components/error-banner.js.map +1 -0
  133. package/dist/components/field.d.ts +64 -0
  134. package/dist/components/field.js +133 -0
  135. package/dist/components/field.js.map +1 -0
  136. package/dist/components/form.d.ts +37 -0
  137. package/dist/components/form.js +103 -0
  138. package/dist/components/form.js.map +1 -0
  139. package/dist/components/input.d.ts +17 -0
  140. package/dist/components/input.js +26 -0
  141. package/dist/components/input.js.map +1 -0
  142. package/dist/components/kbd.d.ts +11 -0
  143. package/dist/components/kbd.js +20 -0
  144. package/dist/components/kbd.js.map +1 -0
  145. package/dist/components/label.d.ts +14 -0
  146. package/dist/components/label.js +28 -0
  147. package/dist/components/label.js.map +1 -0
  148. package/dist/components/loading-skeleton.d.ts +22 -0
  149. package/dist/components/loading-skeleton.js +123 -0
  150. package/dist/components/loading-skeleton.js.map +1 -0
  151. package/dist/components/markdown.d.ts +44 -0
  152. package/dist/components/markdown.js +231 -0
  153. package/dist/components/markdown.js.map +1 -0
  154. package/dist/components/page-header.d.ts +26 -0
  155. package/dist/components/page-header.js +53 -0
  156. package/dist/components/page-header.js.map +1 -0
  157. package/dist/components/popover.d.ts +29 -0
  158. package/dist/components/popover.js +74 -0
  159. package/dist/components/popover.js.map +1 -0
  160. package/dist/components/progress.d.ts +22 -0
  161. package/dist/components/progress.js +49 -0
  162. package/dist/components/progress.js.map +1 -0
  163. package/dist/components/radio-group.d.ts +20 -0
  164. package/dist/components/radio-group.js +29 -0
  165. package/dist/components/radio-group.js.map +1 -0
  166. package/dist/components/scroll-area.d.ts +25 -0
  167. package/dist/components/scroll-area.js +39 -0
  168. package/dist/components/scroll-area.js.map +1 -0
  169. package/dist/components/section-card.d.ts +29 -0
  170. package/dist/components/section-card.js +55 -0
  171. package/dist/components/section-card.js.map +1 -0
  172. package/dist/components/segmented.d.ts +27 -0
  173. package/dist/components/segmented.js +32 -0
  174. package/dist/components/segmented.js.map +1 -0
  175. package/dist/components/select.d.ts +62 -0
  176. package/dist/components/select.js +97 -0
  177. package/dist/components/select.js.map +1 -0
  178. package/dist/components/separator.d.ts +19 -0
  179. package/dist/components/separator.js +23 -0
  180. package/dist/components/separator.js.map +1 -0
  181. package/dist/components/sheet.d.ts +35 -0
  182. package/dist/components/sheet.js +131 -0
  183. package/dist/components/sheet.js.map +1 -0
  184. package/dist/components/skeleton.d.ts +12 -0
  185. package/dist/components/skeleton.js +22 -0
  186. package/dist/components/skeleton.js.map +1 -0
  187. package/dist/components/sortable-list.d.ts +67 -0
  188. package/dist/components/sortable-list.js +206 -0
  189. package/dist/components/sortable-list.js.map +1 -0
  190. package/dist/components/spinner.d.ts +29 -0
  191. package/dist/components/spinner.js +34 -0
  192. package/dist/components/spinner.js.map +1 -0
  193. package/dist/components/status-dot.d.ts +26 -0
  194. package/dist/components/status-dot.js +47 -0
  195. package/dist/components/status-dot.js.map +1 -0
  196. package/dist/components/switch.d.ts +21 -0
  197. package/dist/components/switch.js +21 -0
  198. package/dist/components/switch.js.map +1 -0
  199. package/dist/components/tabs.d.ts +24 -0
  200. package/dist/components/tabs.js +60 -0
  201. package/dist/components/tabs.js.map +1 -0
  202. package/dist/components/textarea.d.ts +19 -0
  203. package/dist/components/textarea.js +47 -0
  204. package/dist/components/textarea.js.map +1 -0
  205. package/dist/components/toast.d.ts +47 -0
  206. package/dist/components/toast.js +106 -0
  207. package/dist/components/toast.js.map +1 -0
  208. package/dist/components/toolbar.d.ts +19 -0
  209. package/dist/components/toolbar.js +45 -0
  210. package/dist/components/toolbar.js.map +1 -0
  211. package/dist/components/tooltip.d.ts +28 -0
  212. package/dist/components/tooltip.js +59 -0
  213. package/dist/components/tooltip.js.map +1 -0
  214. package/dist/core.d.ts +44 -0
  215. package/dist/core.js +44 -0
  216. package/dist/data-table.d.ts +9 -0
  217. package/dist/data-table.js +7 -0
  218. package/dist/form.d.ts +7 -0
  219. package/dist/form.js +7 -0
  220. package/dist/hooks/use-cortena-theme.d.ts +98 -0
  221. package/dist/hooks/use-cortena-theme.js +145 -0
  222. package/dist/hooks/use-cortena-theme.js.map +1 -0
  223. package/dist/index.d.ts +75 -2678
  224. package/dist/index.js +66 -8598
  225. package/dist/lib/cn.d.ts +10 -0
  226. package/dist/lib/cn.js +15 -0
  227. package/dist/lib/cn.js.map +1 -0
  228. package/dist/lib/render.d.ts +23 -0
  229. package/dist/lib/render.js +20 -0
  230. package/dist/lib/render.js.map +1 -0
  231. package/dist/lib/shakeable.js +39 -0
  232. package/dist/lib/shakeable.js.map +1 -0
  233. package/dist/markdown.d.ts +3 -0
  234. package/dist/markdown.js +3 -0
  235. package/dist/sortable-list.d.ts +3 -0
  236. package/dist/sortable-list.js +3 -0
  237. package/package.json +37 -14
  238. package/src/a2ui/catalogue.ts +140 -103
  239. package/src/a2ui/views.tsx +5 -2
  240. package/src/components/alert.tsx +1 -1
  241. package/src/components/badge.tsx +1 -1
  242. package/src/components/button.tsx +1 -1
  243. package/src/components/chart/chart.tsx +72 -25
  244. package/src/components/chart/container.tsx +24 -39
  245. package/src/components/chart/index.tsx +4 -2
  246. package/src/components/chart/nivo-charts.tsx +41 -13
  247. package/src/components/chart/nivo-lazy.tsx +52 -0
  248. package/src/components/chart/recharts-charts.tsx +98 -3
  249. package/src/components/chart/recharts-lazy.tsx +72 -0
  250. package/src/components/chart/recharts-parts.tsx +34 -0
  251. package/src/components/chart/tokens.ts +1 -1
  252. package/src/components/chart/types.ts +14 -0
  253. package/src/components/chip.tsx +1 -1
  254. package/src/components/combobox.tsx +2 -2
  255. package/src/components/data-table/export.ts +18 -2
  256. package/src/components/data-table/features.ts +77 -45
  257. package/src/components/data-table/parts.tsx +15 -0
  258. package/src/components/data-table/use-data-table.ts +7 -2
  259. package/src/components/data-table/use-server-source.ts +17 -4
  260. package/src/components/date-field.tsx +1 -1
  261. package/src/components/error-banner.tsx +1 -1
  262. package/src/components/field.tsx +2 -2
  263. package/src/components/form.tsx +2 -2
  264. package/src/components/input.tsx +1 -1
  265. package/src/components/label.tsx +1 -1
  266. package/src/components/markdown.tsx +5 -4
  267. package/src/components/sheet.tsx +2 -2
  268. package/src/components/sortable-list.tsx +2 -2
  269. package/src/components/textarea.tsx +1 -1
  270. package/src/components/toast.tsx +1 -1
  271. package/src/entries/a2ui.ts +11 -0
  272. package/src/entries/chart.ts +10 -0
  273. package/src/entries/core.ts +91 -0
  274. package/src/entries/data-table.ts +9 -0
  275. package/src/entries/form.ts +24 -0
  276. package/src/entries/markdown.ts +9 -0
  277. package/src/entries/sortable-list.ts +13 -0
  278. package/src/index.ts +32 -98
  279. package/src/lib/shakeable.ts +33 -0
  280. package/dist/index.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,2679 +1,76 @@
1
1
  "use client";
2
- import { ClassValue } from "clsx";
3
- import { z } from "zod";
4
- import * as React$1 from "react";
5
- import { ReactNode } from "react";
6
- import { VariantProps } from "class-variance-authority";
7
- import { Button as Button$1 } from "@base-ui/react/button";
8
- import { Area, AreaChart, Bar, BarChart, CartesianGrid, Cell, ComposedChart, Funnel, FunnelChart, LabelList, Legend as RechartsLegend, LegendPayload, LegendProps, Line, LineChart, Pie, PieChart, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart, ReferenceLine, ResponsiveContainer, Scatter, ScatterChart, Tooltip as RechartsTooltip, TooltipContentProps as TooltipContentProps$1, TooltipProps, XAxis, YAxis } from "recharts";
9
- import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
10
- import { Menu } from "@base-ui/react/menu";
11
- import { Select as Select$1 } from "@base-ui/react/select";
12
- import { Cell as Cell$2, Column, ColumnDef, ColumnHelper, ReactTable, Row, RowData, TableState } from "@tanstack/react-table";
13
- import { DateRange, DayButtonProps, DayPickerProps } from "react-day-picker";
14
- import { Popover as Popover$1 } from "@base-ui/react/popover";
15
- import { Field as Field$1 } from "@base-ui/react/field";
16
- import { Fieldset as Fieldset$1 } from "@base-ui/react/fieldset";
17
- import { Components, Options } from "react-markdown";
18
- import { Options as Options$1 } from "rehype-sanitize";
19
- import { Progress as Progress$1 } from "@base-ui/react/progress";
20
- import { Radio } from "@base-ui/react/radio";
21
- import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
22
- import { Separator as Separator$1 } from "@base-ui/react/separator";
23
- import { Switch as Switch$1 } from "@base-ui/react/switch";
24
- import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
25
- import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
26
- import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
27
- import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
28
- import { Command as Command$1 } from "cmdk";
29
- import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
30
- import { Accept, DropzoneState, FileRejection } from "react-dropzone";
31
- import { ControllerProps, FieldError as FieldError$1, FieldPath, FieldValues, SubmitHandler, UseFormReturn, useForm } from "react-hook-form";
32
- import { zodResolver } from "@hookform/resolvers/zod";
33
- import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
34
- import { DraggableAttributes, UniqueIdentifier } from "@dnd-kit/core";
35
- import { arrayMove } from "@dnd-kit/sortable";
36
- import { Toast as Toast$1 } from "@base-ui/react/toast";
37
- import { Tooltip as Tooltip$2 } from "@base-ui/react/tooltip";
38
- //#region src/lib/cn.d.ts
39
- /**
40
- * Merge class names the shadcn way: clsx for conditionals, tailwind-merge so a
41
- * consumer's `className` wins over a component's default for the same utility.
42
- */
43
- export declare function cn(...inputs: ClassValue[]): string;
44
- //#endregion
45
- //#region src/a2ui/message.d.ts
46
- /**
47
- * A2UI message layer.
48
- *
49
- * The wire format cortena-ui accepts, and the fold from a stream of messages
50
- * onto a set of surfaces. Deliberately free of React so it can be reused by a
51
- * canvas host, a test fixture, or the catalogue doc generator.
52
- *
53
- * ## Two dialects, one fold
54
- *
55
- * **v0.9** is the current A2UI protocol (`createSurface`, `updateComponents`,
56
- * `updateDataModel`, `deleteSurface`) and is what an agent should emit.
57
- *
58
- * **v0.8** is what Cortena already speaks: core bundles Google's A2UI Lit
59
- * renderer at `src/canvas-host/a2ui/` and its `A2uiMessageProcessor` handles
60
- * `beginRendering`, `surfaceUpdate`, `dataModelUpdate` and `deleteSurface`.
61
- * The `canvas` agent tool pushes exactly those, as JSON lines, through
62
- * `canvas.a2ui.pushJSONL`. Accepting both means one renderer serves the chat,
63
- * the web canvas panel and every payload already written against the native
64
- * nodes.
65
- *
66
- * ## Transport
67
- *
68
- * Per `05-agent-ui.md`, an A2UI block travels as an AG-UI `CUSTOM` event. The
69
- * event value is a message, an array of messages, or the JSONL text the canvas
70
- * tool sends; {@link parseA2UIMessages} takes all three.
71
- */
72
- /** Surface id used when a message omits one, matching core's Lit processor. */
73
- export declare const A2UI_DEFAULT_SURFACE_ID = "@default";
74
- /** Protocol version this package speaks. */
75
- export declare const A2UI_VERSION = "v0.9";
76
- /** A reference to a value in the surface's data model, as a JSON pointer. */
77
- interface A2UIDataBinding {
78
- path: string;
79
- }
80
- /**
81
- * A property value as an agent writes it: a literal, a data binding, or one of
82
- * the v0.8 literal wrappers the Lit renderer accepts.
83
- */
84
- type A2UIPropertyValue = string | number | boolean | null | A2UIDataBinding | {
85
- literal: unknown;
86
- } | {
87
- literalString: string;
88
- } | readonly A2UIPropertyValue[] | {
89
- readonly [key: string]: unknown;
90
- };
91
- /**
92
- * A component's children. v0.9 uses a plain id array or a `{ componentId, path }`
93
- * template; v0.8 wraps the same two in `explicitList` / `template`.
94
- */
95
- type A2UIChildList = readonly string[] | {
96
- componentId: string;
97
- path: string;
98
- } | {
99
- explicitList: readonly string[];
100
- } | {
101
- template: {
102
- componentId: string;
103
- dataBinding: string;
104
- };
105
- };
106
- /** An action an agent attaches to an interactive property. */
107
- type A2UIActionSpec = string | {
108
- event: {
109
- name: string;
110
- context?: Record<string, unknown>;
111
- };
112
- } | {
113
- name: string;
114
- context?: Record<string, unknown>;
115
- };
116
- /**
117
- * One component in a surface.
118
- *
119
- * v0.9 is flat — `{ id, component: "Text", text: "hi" }` — and v0.8 wraps the
120
- * properties under the type name — `{ id, component: { Text: { text: "hi" } } }`.
121
- */
122
- interface A2UIComponentSpec {
123
- id: string;
124
- component: string | Record<string, Record<string, unknown>>;
125
- children?: A2UIChildList;
126
- /** v0.8 flex weight; carried through but not used for layout here. */
127
- weight?: number | string;
128
- [property: string]: unknown;
129
- }
130
- interface A2UICreateSurface {
131
- surfaceId?: string;
132
- catalogId?: string;
133
- /** Not in the v0.9 schema; accepted so a single message can seed a surface. */
134
- root?: string;
135
- sendDataModel?: boolean;
136
- }
137
- interface A2UIUpdateComponents {
138
- surfaceId?: string;
139
- components: A2UIComponentSpec[];
140
- root?: string;
141
- }
142
- interface A2UIUpdateDataModel {
143
- surfaceId?: string;
144
- path?: string;
145
- value?: unknown;
146
- /** v0.8 spelling of `value`. */
147
- contents?: unknown;
148
- }
149
- interface A2UIBeginRendering {
150
- surfaceId?: string;
151
- root?: string;
152
- styles?: Record<string, unknown>;
153
- }
154
- interface A2UIDeleteSurface {
155
- surfaceId?: string;
156
- }
157
- /** One message on the wire. Exactly one operation key is read per message. */
158
- interface A2UIMessage {
159
- version?: string;
160
- createSurface?: A2UICreateSurface;
161
- updateComponents?: A2UIUpdateComponents;
162
- updateDataModel?: A2UIUpdateDataModel;
163
- deleteSurface?: A2UIDeleteSurface;
164
- /** v0.8 */
165
- beginRendering?: A2UIBeginRendering;
166
- /** v0.8 */
167
- surfaceUpdate?: A2UIUpdateComponents;
168
- /** v0.8 */
169
- dataModelUpdate?: A2UIUpdateDataModel;
170
- }
171
- /**
172
- * Everything the renderer's `message` prop takes: one message, a list of them
173
- * (the AG-UI `CUSTOM` payload), or JSONL / a JSON array as text (the canvas
174
- * tool's `a2ui_push`).
175
- */
176
- type A2UIMessageInput = A2UIMessage | readonly A2UIMessage[] | string | null | undefined;
177
- /** A folded surface: what the renderer draws. */
178
- interface A2UISurface {
179
- id: string;
180
- /** Id of the root component; `undefined` until a message names one. */
181
- root: string | undefined;
182
- components: ReadonlyMap<string, A2UIComponentSpec>;
183
- dataModel: Record<string, unknown>;
184
- styles: Record<string, unknown>;
185
- }
186
- interface A2UIFoldResult {
187
- surfaces: A2UISurface[];
188
- /** One line per malformed message; the renderer shows these in an error card. */
189
- errors: string[];
190
- }
191
- /** True when a value is a `{ path }` data binding rather than a literal object. */
192
- export declare function isDataBinding(value: unknown): value is A2UIDataBinding;
193
- /**
194
- * Parse whatever arrived into a message list.
195
- *
196
- * A string is tried as JSON first (an array or a single message) and then as
197
- * JSONL, which is the form `canvas.a2ui.pushJSONL` sends. A line that does not
198
- * parse is reported rather than dropped: silently rendering three of four
199
- * pushed messages is the failure mode this returns errors for.
200
- */
201
- export declare function parseA2UIMessages(input: A2UIMessageInput): {
202
- messages: A2UIMessage[];
203
- errors: string[];
204
- };
205
- /**
206
- * Fold a message stream onto surfaces.
207
- *
208
- * Updates accumulate: a later `updateComponents` replaces the components it
209
- * names and leaves the rest, and a later `updateDataModel` writes at its path
210
- * only. That is what makes the JSONL push form work — the agent sends the
211
- * shell, then the rows, then a correction, and each one folds onto the same
212
- * surface.
213
- */
214
- export declare function foldMessages(input: A2UIMessageInput): A2UIFoldResult;
215
- /** Split a JSON pointer into its unescaped segments. */
216
- export declare function pointerSegments(pointer: string): string[];
217
- /** Resolve a possibly relative pointer against a data context. */
218
- export declare function resolvePointer(path: string, contextPath: string): string;
219
- /** Read a JSON pointer out of the data model. */
220
- export declare function getAtPointer(model: unknown, pointer: string): unknown;
221
- /**
222
- * Write a JSON pointer into the data model, returning a new model.
223
- *
224
- * Immutable because the renderer keeps the model in React state: a mutation in
225
- * place would not re-render, which is the kind of silent nothing-happens bug
226
- * that is hard to see in a browser test.
227
- */
228
- export declare function setAtPointer(model: Record<string, unknown>, pointer: string, value: unknown): Record<string, unknown>;
229
- /** Normalise the children of a component spec into a single description. */
230
- type A2UIChildren = {
231
- kind: "list";
232
- ids: readonly string[];
233
- } | {
234
- kind: "template";
235
- componentId: string;
236
- path: string;
237
- } | {
238
- kind: "none";
239
- };
240
- export declare function readChildren(spec: A2UIComponentSpec, properties: Record<string, unknown>): A2UIChildren;
241
- /**
242
- * Split a component spec into its type name and its raw (unresolved) properties,
243
- * across both dialects. Returns `undefined` when the spec names no type.
244
- */
245
- export declare function readComponent(spec: A2UIComponentSpec): {
246
- name: string;
247
- properties: Record<string, unknown>;
248
- } | undefined;
249
- /**
250
- * Resolve one property value against the data model.
251
- *
252
- * `{ path }` reads the model, `{ literal }` / `{ literalString }` unwrap, and
253
- * everything else is returned as written, recursing through arrays and objects
254
- * so a binding nested inside a prop object still resolves.
255
- */
256
- export declare function resolveValue(value: unknown, model: Record<string, unknown>, contextPath: string): unknown;
257
- /** A user action leaving the renderer, shaped like A2UI's client-to-server action. */
258
- interface A2UIAction {
259
- surfaceId: string;
260
- componentId: string;
261
- name: string;
262
- payload: Record<string, unknown>;
263
- }
264
- /**
265
- * Normalise an action property into `{ name, context }`.
266
- *
267
- * Accepts v0.9's `{ event: { name, context } }`, the bare `{ name, context }`
268
- * shape, and a plain string, which is what an agent writes most often.
269
- */
270
- export declare function readAction(value: unknown): {
271
- name: string;
272
- context: Record<string, unknown>;
273
- } | undefined;
274
- //#endregion
275
- //#region src/components/chart/types.d.ts
276
- /**
277
- * Chart types and the data shape each one expects.
278
- *
279
- * Engine per type (see cortena-docs/cortenaUI&Design/03-charting.md):
280
- *
281
- * | type | engine |
282
- * | -------------------------------------------------------- | ------------------------- |
283
- * | bar, line, area, pie, donut, scatter, radar, funnel | Recharts (static import) |
284
- * | heatmap, calendar, treemap, sunburst | Nivo (lazy, per package) |
285
- *
286
- * Data shapes (the webchat renderer's legacy shapes are all accepted):
287
- *
288
- * - **bar**, **radar**: `ChartRow[]` — one object per category with a string
289
- * category key (`indexBy`, inferred as the first string field) and one
290
- * numeric field per series (`keys`, inferred as every numeric field).
291
- * `[{ month: "Jan", revenue: 12, cost: 8 }, …]`. The series shape below is
292
- * also accepted and pivoted.
293
- * - **line**, **area**: `ChartSeries[]` — `[{ id: "revenue", data: [{ x, y }] }]`
294
- * (the Nivo line shape the webchat emits). `ChartRow[]` is also accepted.
295
- * - **pie**, **donut**, **funnel**: `ChartSlice[]` — `[{ id, label?, value }]`.
296
- * - **scatter** (alias `scatterplot`): `ChartSeries[]` — one series per group.
297
- * - **heatmap**: `ChartSeries[]` — Nivo heatmap shape, `[{ id: row, data: [{ x: column, y: value }] }]` —
298
- * or `ChartMatrix`, the categorical form a correlation / confusion matrix
299
- * already has: `{ rows, columns, values }` with `values[r][c]` at
300
- * `rows[r] × columns[c]`.
301
- * - **calendar**: `ChartDay[]` — `[{ day: "2026-01-31", value }]`; `from`/`to`
302
- * default to the data's range.
303
- * - **treemap**, **sunburst**: `ChartTree` — Nivo tree, `{ id, children?: [...], value? }`
304
- * (`name` is accepted in place of `id`).
305
- */
306
- type ChartType = "bar" | "line" | "area" | "pie" | "donut" | "scatter" | "scatterplot" | "radar" | "funnel" | "heatmap" | "calendar" | "treemap" | "sunburst";
307
- /** The engine that draws a given type. */
308
- type ChartEngine = "recharts" | "nivo";
309
- /** Nivo renderer; only the Nivo types honour it (Recharts is SVG only). */
310
- type ChartRenderer = "svg" | "canvas";
311
- /** One category with a numeric value per series. */
312
- type ChartRow = Record<string, string | number | null | undefined>;
313
- /** One series of points; x may be a category or a number, y a number. */
314
- interface ChartPoint {
315
- x: string | number;
316
- y: number | null;
317
- }
318
- interface ChartSeries {
319
- id: string | number;
320
- data: ChartPoint[];
321
- }
322
- /** One slice of a pie, donut or funnel. */
323
- interface ChartSlice {
324
- id: string | number;
325
- label?: string;
326
- value: number;
327
- }
328
- /**
329
- * A categorical matrix: `values[r][c]` is the cell at `rows[r]` × `columns[c]`.
330
- * The shape a correlation matrix, a confusion matrix or a day × hour grid is
331
- * already in, so it needs no pivot at the call site. Short rows are padded
332
- * with `null` (drawn as the empty colour) rather than treated as zero.
333
- */
334
- interface ChartMatrix {
335
- rows: string[];
336
- columns: string[];
337
- values: Array<Array<number | null | undefined>>;
338
- }
339
- /** One day of a calendar heatmap. */
340
- interface ChartDay {
341
- day: string;
342
- value: number;
343
- }
344
- /** A Nivo tree node for treemap and sunburst. */
345
- interface ChartTree {
346
- id?: string | number;
347
- name?: string;
348
- value?: number;
349
- children?: ChartTree[];
350
- [key: string]: unknown;
351
- }
352
- /** The data type accepted for each chart type. */
353
- type ChartDataFor<T extends ChartType> = T extends "bar" | "radar" ? ChartRow[] | ChartSeries[] : T extends "line" | "area" ? ChartSeries[] | ChartRow[] : T extends "pie" | "donut" | "funnel" ? ChartSlice[] : T extends "heatmap" ? ChartSeries[] | ChartMatrix : T extends "scatter" | "scatterplot" ? ChartSeries[] : T extends "calendar" ? ChartDay[] : T extends "treemap" | "sunburst" ? ChartTree : never;
354
- /**
355
- * Per-series presentation, keyed by series id (the `keys` of a row chart, the
356
- * `id` of a series or slice). Colours default to `var(--ds-viz-1..n)` in key
357
- * order, so the same category index gets the same colour in every app; set
358
- * `color` only to pin a category to a semantic colour, and then only to a
359
- * token (`var(--ds-success)`), never a literal.
360
- */
361
- type ChartConfig = Record<string, {
362
- label?: React$1.ReactNode;
363
- icon?: React$1.ComponentType;
364
- color?: string;
365
- }>;
366
- /** Which continuous scale a heatmap or calendar uses. */
367
- type ChartScale = "sequential" | "diverging";
368
- export declare const RECHARTS_TYPES: ReadonlySet<ChartType>;
369
- export declare const NIVO_TYPES: ReadonlySet<ChartType>;
370
- /** The engine the package uses for a chart type. */
371
- export declare function chartEngine(type: ChartType): ChartEngine;
372
- //#endregion
373
- //#region src/components/chart/container.d.ts
374
- interface ChartContextValue {
375
- config: ChartConfig;
376
- /** The container element, so token resolution can honour a nested theme scope. */
377
- element: HTMLDivElement | null;
378
- }
379
- /** The nearest ChartContainer's config and element; null outside one. */
380
- export declare function useChart(): ChartContextValue | null;
381
- /**
382
- * Resolve the colour a series key paints with: `config[key].color` when set,
383
- * otherwise `var(--ds-viz-N)` by the key's position in the config (or the
384
- * `index` given). Recharts consumers reference it as `var(--color-<key>)`,
385
- * which ChartContainer defines on its element.
386
- */
387
- export declare function seriesColor(config: ChartConfig | undefined, key: string, index?: number): string;
388
- interface ChartContainerProps extends Omit<React$1.ComponentProps<"div">, "children"> {
389
- /** Series presentation; colours default to `--ds-viz-1..n` in key order. */
390
- config?: ChartConfig;
391
- /** Height of the drawing area; width is always 100% of the parent. Default 300. */
392
- height?: number | string;
393
- /**
394
- * Wrap children in Recharts' ResponsiveContainer (default). Nivo's
395
- * `Responsive*` components size themselves, so the Nivo renderers pass
396
- * `responsive={false}`.
397
- */
398
- responsive?: boolean;
399
- /**
400
- * Give the drawing area a floor of 600×300 so it draws where the layout
401
- * gives it none.
402
- *
403
- * Both engines size themselves from the parent box. Under jsdom nothing has
404
- * layout — every element measures 0×0 — so a page test that renders a screen
405
- * containing a Chart gets an empty `<div>` and can assert nothing about it.
406
- * `testMode` sets `min-width` / `min-height` on the container and hands the
407
- * same floor to Recharts' ResponsiveContainer, so the chart draws at
408
- * 600×300. It is a floor, not a fixed size: a parent that *does* give the
409
- * chart 900px still gets 900px, so a screenshot test is unaffected.
410
- */
411
- testMode?: boolean;
412
- children: React$1.ReactNode;
413
- }
414
- /**
415
- * ChartContainer — the sized, token-styled surface every chart draws in.
416
- *
417
- * It defines `--color-<key>` for each config key (so Recharts parts can say
418
- * `fill="var(--color-revenue)"`) and styles Recharts' axis, grid, tick and
419
- * cursor classes from tokens with a caption-sm floor for text, so a custom
420
- * chart composed inside it needs no local colours or fonts.
421
- */
422
- declare function ChartContainer({ config, height, responsive, testMode, className, style, children, ...props }: ChartContainerProps): React$1.JSX.Element;
423
- /** "No data" placeholder; rendered by Chart when the data is empty. */
424
- declare function ChartEmpty({ children, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
425
- /** Error placeholder; rendered by Chart for an `error` prop or a failed Nivo chunk. */
426
- declare function ChartError({ className, children, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
427
- /** Loading placeholder: a skeleton the size of the drawing area, shown while a Nivo chunk loads. */
428
- declare function ChartLoading({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
429
- interface ChartTooltipContentProps extends Partial<Pick<TooltipContentProps$1, "active" | "payload" | "label">> {
430
- className?: string;
431
- /** Hide the series label column. */
432
- hideLabel?: boolean;
433
- /** Hide the colour swatch. */
434
- hideIndicator?: boolean;
435
- /** Format a value; defaults to `toLocaleString`. */
436
- formatter?: (value: number | string, name: string) => React$1.ReactNode;
437
- /** Format the header (the category). */
438
- labelFormatter?: (label: React$1.ReactNode) => React$1.ReactNode;
439
- }
440
- /**
441
- * ChartTooltipContent — the popover body for Recharts' Tooltip, styled like
442
- * the package Tooltip on the popover tokens. Pass as `content` to
443
- * ChartTooltip; reads series labels and colours from the ChartContainer config.
444
- */
445
- declare function ChartTooltipContent({ active, payload, label, className, hideLabel, hideIndicator, formatter, labelFormatter }: ChartTooltipContentProps): React$1.JSX.Element | null;
446
- /** Recharts' Tooltip with the token-styled content and a subtle cursor. */
447
- declare function ChartTooltip(props: TooltipProps): React$1.JSX.Element;
448
- interface ChartLegendContentProps {
449
- payload?: readonly LegendPayload[];
450
- verticalAlign?: "top" | "bottom" | "middle";
451
- className?: string;
452
- hideIcon?: boolean;
453
- }
454
- /** ChartLegendContent — Recharts' legend on tokens; reads labels from the config. */
455
- declare function ChartLegendContent({ payload, verticalAlign, className, hideIcon }: ChartLegendContentProps): React$1.JSX.Element | null;
456
- /** Recharts' Legend with the token-styled content. */
457
- declare function ChartLegend(props: LegendProps): React$1.JSX.Element;
458
- //#endregion
459
- //#region src/components/chart/chart.d.ts
460
- interface ChartProps<T extends ChartType = ChartType> extends Omit<ChartContainerProps, "children" | "config" | "responsive"> {
461
- /** Which chart to draw; the package picks the engine. See {@link ChartType} for the data shape per type. */
462
- type: T;
463
- /** The data, in the shape documented on {@link ChartType}. */
464
- data: ChartDataFor<T>;
465
- /** Series presentation keyed by series id; colours default to `--ds-viz-1..n` in order. */
466
- config?: ChartConfig;
467
- /** Nivo renderer; `canvas` for large series. Ignored by the Recharts types and by sunburst. */
468
- renderer?: ChartRenderer;
469
- /** Category key for row data (bar, line, area, radar); inferred as the first string field. */
470
- indexBy?: string;
471
- /** Series keys for row data; inferred as every numeric field. */
472
- keys?: string[];
473
- /** Stack bars and areas instead of grouping them. */
474
- stacked?: boolean;
475
- /** Continuous scale for heatmap and calendar. Default sequential. */
476
- scale?: ChartScale;
477
- /** Show a legend. Default: when there is more than one series. */
478
- legend?: boolean;
479
- /** Draw grid lines (cartesian and radar types). Default true. */
480
- grid?: boolean;
481
- /** Show a tooltip on hover. Default true. */
482
- tooltip?: boolean;
483
- /** Format values in axes, tooltips and labels. */
484
- valueFormatter?: (value: number) => string;
485
- /** Calendar range (ISO dates); defaults to the data's extent. */
486
- from?: string;
487
- to?: string;
488
- /** Render the loading skeleton instead of the data. */
489
- loading?: boolean;
490
- /** Render the error state with this message instead of the data. */
491
- error?: React$1.ReactNode | Error | null;
492
- /** Content of the empty state. Default "No data". */
493
- emptyMessage?: React$1.ReactNode;
494
- }
495
- /**
496
- * Chart — one component for every chart type the fleet draws.
497
- *
498
- * `type` picks the engine: Recharts (bundled) for bar, line, area, pie, donut,
499
- * scatter, radar and funnel; Nivo, lazy-loaded per package, for heatmap,
500
- * calendar, treemap and sunburst, with `renderer="canvas"` for large series.
501
- * Colours, fonts, axes, grid, tooltip, legend and the empty, loading and
502
- * error states all come from cortena-design tokens; a consumer passes data
503
- * and, optionally, a `config` of labels.
504
- *
505
- * `heatmap` takes either the Nivo series shape or a categorical
506
- * {@link ChartMatrix} — `{ rows, columns, values }` — for the correlation and
507
- * confusion matrices that are already in that form.
508
- *
509
- * `testMode` gives the drawing area a 600×300 floor so a chart still draws
510
- * where the layout gives it no size; see {@link ChartContainerProps.testMode}
511
- * and README.md, "Charts in tests".
512
- */
513
- declare function Chart<T extends ChartType>({ type, data, config, renderer, indexBy, keys, stacked, scale, legend, grid, tooltip, valueFormatter, from, to, loading, error, emptyMessage, className, height, ...props }: ChartProps<T>): React$1.JSX.Element;
514
- //#endregion
515
- //#region src/components/chart/nivo-theme.d.ts
516
- /**
517
- * The Nivo theme object, typed structurally so no `@nivo/*` package is a
518
- * static import of this module (the Nivo packages are lazy-loaded). It is a
519
- * subset of `PartialTheme` from `@nivo/theming` and assignable to every
520
- * chart's `theme` prop.
521
- */
522
- interface NivoTheme {
523
- background: string;
524
- text: {
525
- fontFamily: string;
526
- fontSize: number;
527
- fill: string;
528
- };
529
- axis: {
530
- domain: {
531
- line: {
532
- stroke: string;
533
- strokeWidth: number;
534
- };
535
- };
536
- ticks: {
537
- line: {
538
- stroke: string;
539
- strokeWidth: number;
540
- };
541
- text: {
542
- fill: string;
543
- fontSize: number;
544
- };
545
- };
546
- legend: {
547
- text: {
548
- fill: string;
549
- fontSize: number;
550
- fontWeight: number;
551
- };
552
- };
553
- };
554
- grid: {
555
- line: {
556
- stroke: string;
557
- strokeWidth: number;
558
- };
559
- };
560
- crosshair: {
561
- line: {
562
- stroke: string;
563
- strokeWidth: number;
564
- strokeOpacity: number;
565
- strokeDasharray: string;
566
- };
567
- };
568
- legends: {
569
- text: {
570
- fill: string;
571
- fontSize: number;
572
- };
573
- title: {
574
- text: {
575
- fill: string;
576
- fontSize: number;
577
- };
578
- };
579
- ticks: {
580
- line: {
581
- stroke: string;
582
- strokeWidth: number;
583
- };
584
- text: {
585
- fill: string;
586
- fontSize: number;
587
- };
588
- };
589
- };
590
- labels: {
591
- text: {
592
- fill: string;
593
- fontSize: number;
594
- fontWeight: number;
595
- };
596
- };
597
- dots: {
598
- text: {
599
- fill: string;
600
- fontSize: number;
601
- };
602
- };
603
- markers: {
604
- lineColor: string;
605
- lineStrokeWidth: number;
606
- text: {
607
- fill: string;
608
- fontSize: number;
609
- };
610
- };
611
- annotations: {
612
- text: {
613
- fill: string;
614
- fontSize: number;
615
- outlineWidth: number;
616
- outlineColor: string;
617
- };
618
- link: {
619
- stroke: string;
620
- strokeWidth: number;
621
- outlineWidth: number;
622
- outlineColor: string;
623
- };
624
- outline: {
625
- stroke: string;
626
- strokeWidth: number;
627
- outlineWidth: number;
628
- outlineColor: string;
629
- };
630
- symbol: {
631
- fill: string;
632
- outlineWidth: number;
633
- outlineColor: string;
634
- };
635
- };
636
- tooltip: {
637
- container: {
638
- background: string;
639
- color: string;
640
- fontSize: number;
641
- fontFamily: string;
642
- borderRadius: number;
643
- boxShadow: string;
644
- border: string;
645
- padding: string;
646
- };
647
- chip: {
648
- borderRadius: number;
649
- };
650
- };
651
- }
652
- /**
653
- * Build the Nivo theme from the tokens, resolved on `el` (default `<html>`).
654
- * Every colour is read from a `--ds-*` custom property and converted to hex,
655
- * because Nivo's canvas renderer and its colour derivation cannot read
656
- * `var()`. Sizes come from the type scale with `--ds-text-caption-sm` (11px)
657
- * as the floor for ticks and labels.
658
- *
659
- * Moved here from cortenaweb's webchat renderer; nothing is hard-coded.
660
- */
661
- export declare function nivoTheme(el?: Element | null): NivoTheme;
662
- /**
663
- * The Nivo theme for the current theme, re-resolved when `data-theme` or the
664
- * OS scheme flips. Inside a ChartContainer the tokens are read on its element,
665
- * so a nested theme scope is honoured.
666
- */
667
- export declare function useNivoTheme(): NivoTheme;
668
- //#endregion
669
- //#region src/components/chart/tokens.d.ts
670
- /**
671
- * Token plumbing for the chart engines.
672
- *
673
- * Recharts draws SVG, so it can take `var(--ds-viz-1)` verbatim and the
674
- * browser resolves it. Nivo cannot: its canvas renderer hands colours to a
675
- * 2D context, and its SVG renderer runs colours through d3-color for label and
676
- * border derivation, and neither understands `var()`. So every Nivo value is
677
- * read from the `--ds-*` custom property at runtime and handed over as a
678
- * concrete hex. Nothing in this file is a literal; on the server (no DOM) the
679
- * `var()` form is returned so SSR markup still resolves in the browser.
680
- */
681
- /** Number of categorical series colours the design system defines (`--ds-viz-1..n`). */
682
- export declare const VIZ_SERIES_COUNT: number;
683
- /** `var(--ds-viz-N)` for a zero-based series index, wrapping past the palette. */
684
- export declare function vizVar(index: number): string;
685
- /** The categorical palette as `var()` references, in series order. */
686
- export declare const vizSeriesVars: readonly string[];
687
- /**
688
- * Convert any CSS colour the browser understands (oklch, color-mix, rgba…) to
689
- * `#rrggbb`, by painting it into an offscreen 2D context. Alpha is composited
690
- * against transparent, so translucent tokens come back opaque; chart fills
691
- * never use those.
692
- */
693
- export declare function toHex(css: string): string | undefined;
694
- /**
695
- * A token as a concrete colour. Returns hex in the browser; on the server the
696
- * `var()` form, which is fine for SVG markup and irrelevant for canvas.
697
- */
698
- export declare function resolveColor(token: string, el?: Element | null): string;
699
- /** The categorical palette resolved to concrete colours, in series order. */
700
- export declare function resolveVizSeries(el?: Element | null): string[];
701
- interface ChartScales {
702
- /** Low → high, as concrete hex stops. */
703
- sequential: string[];
704
- /** Negative → neutral → positive, as concrete hex stops. */
705
- diverging: string[];
706
- /** Interpolators over the stops, `t` in [0, 1], for Nivo's `interpolator` configs. */
707
- sequentialInterpolator: (t: number) => string;
708
- divergingInterpolator: (t: number) => string;
709
- /** `n` evenly spaced sequential swatches, for quantised fills like the calendar. */
710
- sequentialSteps: (n: number) => string[];
711
- /** Fill for cells with no value. */
712
- empty: string;
713
- /** The chart's surface (`--ds-background`), for the gaps between cells and arcs. */
714
- surface: string;
715
- }
716
- /**
717
- * Sequential and diverging scales from the tokens.
718
- *
719
- * The token set has only the eight categorical `--ds-viz-*` colours and no
720
- * sequential ramp, so the sequential scale is derived from the
721
- * `--ds-primary-100..900` ladder: light surfaces run 100 → 700 (pale to deep),
722
- * dark surfaces run 900 → 400 (deep to bright), so low values sit near the
723
- * background in both themes. The diverging scale runs `--ds-viz-5` (rose)
724
- * through the theme's neutral (`--ds-neutral-200` light, `--ds-neutral-700`
725
- * dark) to `--ds-viz-1` (blue).
726
- */
727
- export declare function chartScales(el?: Element | null): ChartScales;
728
- //#endregion
729
- //#region src/components/data-table/features.d.ts
730
- declare const baseFeatures: {
731
- columnFilteringFeature: import("@tanstack/react-table").TableFeature;
732
- globalFilteringFeature: import("@tanstack/react-table").TableFeature;
733
- columnFacetingFeature: import("@tanstack/react-table").TableFeature;
734
- rowSortingFeature: import("@tanstack/react-table").TableFeature;
735
- rowPaginationFeature: import("@tanstack/react-table").TableFeature;
736
- rowSelectionFeature: import("@tanstack/react-table").TableFeature;
737
- rowExpandingFeature: import("@tanstack/react-table").TableFeature;
738
- columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
739
- columnPinningFeature: import("@tanstack/react-table").TableFeature;
740
- columnSizingFeature: import("@tanstack/react-table").TableFeature;
741
- columnResizingFeature: import("@tanstack/react-table").TableFeature;
742
- filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
743
- sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
744
- paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
745
- expandedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
746
- facetedRowModel: (table: import("@tanstack/react-table").Table<any, any>, columnId: string) => () => import("@tanstack/react-table").RowModel<any, any>;
747
- facetedUniqueValues: (table: import("@tanstack/react-table").Table<import("@tanstack/react-table").TableFeatures, any>, columnId: string) => () => Map<any, number>;
748
- filterFns: {
749
- includesString: import("@tanstack/react-table").CreatedFilterFn<any, any>;
750
- equals: import("@tanstack/react-table").CreatedFilterFn<any, any>;
751
- equalsString: import("@tanstack/react-table").CreatedFilterFn<any, any>;
752
- inNumberRange: import("@tanstack/react-table").CreatedFilterFn<any, any>;
753
- arrIncludes: import("@tanstack/react-table").CreatedFilterFn<any, any>;
754
- arrIncludesSome: import("@tanstack/react-table").CreatedFilterFn<any, any>;
755
- inDateRange: import("@tanstack/react-table").CreatedFilterFn<any, any>;
756
- weakEquals: import("@tanstack/react-table").CreatedFilterFn<any, any>;
757
- oneOf: import("@tanstack/react-table").CreatedFilterFn<any, any>;
758
- };
759
- sortFns: {
760
- alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
761
- basic: import("@tanstack/react-table").CreatedSortFn<any, any>;
762
- datetime: import("@tanstack/react-table").CreatedSortFn<any, any>;
763
- text: import("@tanstack/react-table").CreatedSortFn<any, any>;
764
- };
765
- columnMeta: DataTableColumnMeta<any>;
766
- };
767
- /**
768
- * The registry type, re-keyed to the consumer's row type so `meta.onCommit`
769
- * receives a typed row. The runtime object is the same for every table.
770
- */
771
- type DataTableFeatures<Row extends RowData> = Omit<typeof baseFeatures, "columnMeta"> & {
772
- columnMeta: DataTableColumnMeta<Row>;
773
- };
774
- export declare function dataTableFeatures<Row extends RowData>(): DataTableFeatures<Row>;
775
- /**
776
- * `createColumnHelper` bound to the DataTable feature set. v9's helper takes
777
- * the features as its first type argument; this saves consumers from
778
- * importing the registry.
779
- *
780
- * @example
781
- * const helper = createColumnHelper<Contact>();
782
- * const columns = helper.columns([
783
- * helper.accessor("name", { header: "Name" }),
784
- * helper.accessor("status", { header: "Status", meta: { filter: "faceted" } }),
785
- * ]);
786
- */
787
- export declare function createColumnHelper<Row extends RowData>(): ColumnHelper<DataTableFeatures<Row>, Row>;
788
- //#endregion
789
- //#region src/components/data-table/types.d.ts
790
- /**
791
- * Data sources (the contract in cortenaUI&Design/04-data-tables.md).
792
- *
793
- * A client source hands the table every row and lets it filter, sort and page
794
- * in memory. A server source hands the table one page at a time: the table
795
- * owns the search box, filter, sort and page state, turns it into a
796
- * `TableQuery`, and the app answers with the already filtered, sorted page and
797
- * the total. `TableQuery` / `TableResult` are also the backend contract every
798
- * extension's list endpoint is expected to speak.
799
- */
800
- type ClientSource<Row> = {
801
- kind: "client";
802
- rows: Row[];
803
- };
804
- type ServerSource<Row> = {
805
- kind: "server";
806
- /**
807
- * Fetch one page. The optional `signal` is aborted when the query changes
808
- * before the request settles, so a fetch that forwards it to `fetch()` is
809
- * cancelled rather than raced.
810
- */
811
- fetch: (query: TableQuery, signal?: AbortSignal) => Promise<TableResult<Row>>;
812
- /**
813
- * TanStack Query cache scope. Two tables that share a key share pages;
814
- * defaults to a key private to the component instance.
815
- */
816
- queryKey?: readonly unknown[];
817
- };
818
- type DataSource<Row> = ClientSource<Row> | ServerSource<Row>;
819
- type TableQuery = {
820
- q?: string;
821
- filters?: Array<{
822
- id: string;
823
- value: unknown;
824
- }>;
825
- sort?: Array<{
826
- id: string;
827
- desc: boolean;
828
- }>;
829
- page: number;
830
- pageSize: number;
831
- };
832
- type TableResult<Row> = {
833
- rows: Row[];
834
- total: number;
835
- };
836
- /** Inline-editing options for a column (`meta.editable`). */
837
- interface DataTableEditable {
838
- /** Input type; `number` parses the draft with `Number()` before commit. */
839
- type?: "text" | "number";
840
- /** Turn the raw input string into the committed value. */
841
- parse?: (raw: string) => unknown;
842
- }
843
- /**
844
- * Per-column `meta`. Typed through the v9 `columnMeta` feature slot, so
845
- * `helper.accessor("x", { meta: { ... } })` is checked without declaration
846
- * merging.
847
- */
848
- interface DataTableColumnMeta<Row = unknown> {
849
- /**
850
- * Toolbar filter for this column. `faceted` renders a checkbox list of the
851
- * column's distinct values (or `filterOptions`) and filters with `oneOf`.
852
- */
853
- filter?: "faceted" | "text";
854
- /** Fixed facet options; required for a server source, where only one page is loaded. */
855
- filterOptions?: Array<{
856
- value: string | number | boolean;
857
- label?: string;
858
- icon?: React.ComponentType<{
859
- className?: string;
860
- }>;
861
- }>;
862
- /** Text alignment of the header and cells. Numbers usually want `end`. */
863
- align?: "start" | "center" | "end";
864
- /** Enter or double-click opens an editor; Enter commits, Escape cancels. */
865
- editable?: boolean | DataTableEditable;
866
- /** Receives the committed value. Falls back to the table's `onCellCommit`. */
867
- onCommit?: (row: Row, columnId: string, value: unknown) => void | Promise<void>;
868
- /** Column label for the view menu and exports when `header` is not a string. */
869
- label?: string;
870
- /** Set `false` to leave the column out of CSV / Excel exports. */
871
- exportable?: boolean;
872
- /** Value written to exports instead of the accessor value. */
873
- exportValue?: (row: Row) => string | number | boolean | Date | null | undefined;
874
- /** Extra classes for every cell in this column. */
875
- cellClassName?: string;
876
- /** Extra classes for the header cell. */
877
- headerClassName?: string;
878
- }
879
- type DataTableColumnDef<Row extends RowData, Value = unknown> = ColumnDef<DataTableFeatures<Row>, Row, Value>;
880
- type DataTableColumn<Row extends RowData, Value = unknown> = Column<DataTableFeatures<Row>, Row, Value>;
881
- type DataTableRow<Row$1 extends RowData> = Row<DataTableFeatures<Row$1>, Row$1>;
882
- type DataTableCell<Row extends RowData, Value = unknown> = Cell$2<DataTableFeatures<Row>, Row, Value>;
883
- type DataTableState<Row extends RowData> = TableState<DataTableFeatures<Row>>;
884
- /** The TanStack table instance every part takes as `table`. */
885
- type DataTableTable<Row extends RowData> = ReactTable<DataTableFeatures<Row>, Row>;
886
- type DataTablePaginationMode = "pages" | "infinite" | "none";
887
- interface UseDataTableOptions<Row extends RowData> {
888
- columns: ReadonlyArray<DataTableColumnDef<Row, any>>;
889
- dataSource: DataSource<Row>;
890
- /** Stable row identity; defaults to the row index. Needed for selection and editing to survive re-sorts. */
891
- getRowId?: (row: Row, index: number) => string;
892
- /** Tree data: return a row's children. */
893
- getSubRows?: (row: Row, index: number) => Row[] | undefined;
894
- /** `pages` (default) renders a pager; `infinite` appends pages on scroll; `none` shows every row. */
895
- pagination?: DataTablePaginationMode;
896
- /** @default 25 */
897
- pageSize?: number;
898
- /** Adds a checkbox column and enables `bulkActions`. */
899
- enableRowSelection?: boolean | ((row: DataTableRow<Row>) => boolean);
900
- /** Adds an expander column; set automatically by `renderSubComponent`. */
901
- enableExpanding?: boolean;
902
- getRowCanExpand?: (row: DataTableRow<Row>) => boolean;
903
- /** @default true */
904
- enableSorting?: boolean;
905
- /** @default false */
906
- enableMultiSort?: boolean;
907
- /** @default true */
908
- enableGlobalFilter?: boolean;
909
- /** @default true */
910
- enableColumnFilters?: boolean;
911
- /** @default true */
912
- enableHiding?: boolean;
913
- /** @default true */
914
- enableColumnPinning?: boolean;
915
- /** @default false */
916
- enableColumnResizing?: boolean;
917
- /** Starting sort, filters, visibility, pinning, sizing. */
918
- initialState?: Partial<DataTableState<Row>>;
919
- /** Table-wide commit handler for editable cells without their own `meta.onCommit`. */
920
- onCellCommit?: (row: Row, columnId: string, value: unknown) => void | Promise<void>;
921
- /** Fires with the selected original rows whenever selection changes. */
922
- onRowSelectionChange?: (rows: Row[]) => void;
923
- /** Debounce applied to the search box before it reaches a server source. @default 250 */
924
- searchDebounceMs?: number;
925
- }
926
- interface DataTableEditingCell {
927
- rowId: string;
928
- columnId: string;
929
- }
930
- interface DataTableInstance<Row extends RowData> {
931
- table: DataTableTable<Row>;
932
- dataSource: DataSource<Row>;
933
- paginationMode: DataTablePaginationMode;
934
- /** Rows currently in the table (the page, for a server source). */
935
- rows: Row[];
936
- /** Total matching rows (server `total`, or the filtered count for a client source). */
937
- total: number;
938
- /** True until the first server page arrives; never true for a client source. */
939
- isLoading: boolean;
940
- /** True while any server request is in flight, including background refetches. */
941
- isFetching: boolean;
942
- error: Error | null;
943
- refetch: () => void;
944
- /** Infinite mode: load the next page. No-op elsewhere. */
945
- fetchNextPage: () => void;
946
- hasNextPage: boolean;
947
- /** Search text the server last received (debounced), for consumers rendering their own toolbar. */
948
- searchQuery: string;
949
- editing: {
950
- cell: DataTableEditingCell | null;
951
- start: (cell: DataTableEditingCell) => void;
952
- stop: () => void;
953
- commit: (row: DataTableRow<Row>, columnId: string, value: unknown) => Promise<void>;
954
- };
955
- }
956
- //#endregion
957
- //#region src/components/data-table/data-table.d.ts
958
- interface DataTableViewProps<Row extends RowData> {
959
- className?: string;
960
- /** Height of the scrolling body. Required for virtualisation to mean anything; defaults to 600px when virtualised. */
961
- maxHeight?: number | string;
962
- /** Force virtualisation on or off; undefined virtualises above 100 rows. */
963
- virtualize?: boolean;
964
- /** Estimated row height in px for the virtualizer. @default 40 */
965
- rowHeight?: number;
966
- /** @default true */
967
- stickyHeader?: boolean;
968
- /** @default "default" */
969
- density?: "default" | "compact";
970
- /** Detail panel under an expanded row; enables the expander column. */
971
- renderSubComponent?: (row: DataTableRow<Row>) => React$1.ReactNode;
972
- /** `false` hides the toolbar; a function replaces it. */
973
- toolbar?: boolean | ((ctx: {
974
- instance: DataTableInstance<Row>;
975
- }) => React$1.ReactNode);
976
- /** Rendered in the toolbar while rows are selected. */
977
- bulkActions?: (ctx: {
978
- rows: Row[];
979
- table: DataTableTable<Row>;
980
- }) => React$1.ReactNode;
981
- /** Extra toolbar controls (right side). */
982
- toolbarActions?: React$1.ReactNode;
983
- searchPlaceholder?: string;
984
- emptyState?: React$1.ReactNode;
985
- /** @default "No results" */
986
- emptyMessage?: string;
987
- pageSizeOptions?: number[];
988
- /** @default true */
989
- enableExport?: boolean;
990
- /** @default "export" */
991
- exportFileName?: string;
992
- /** Show the loading skeleton regardless of the source's own state. */
993
- loading?: boolean;
994
- /** Error to show above the table, in addition to the server source's. */
995
- error?: string | Error | null;
996
- onRowClick?: (row: Row, event: React$1.MouseEvent<HTMLTableRowElement>) => void;
997
- /**
998
- * The row a detail pane is currently showing, matched against the row id
999
- * (`getRowId`, the row index when that is not set). It gets `data-active`
1000
- * and the `--ds-primary-soft` tint, independent of checkbox selection — a
1001
- * master/detail list highlights one row without selecting it, and a table
1002
- * with both can show a selected set and one open row at once.
1003
- */
1004
- activeRowId?: string | null;
1005
- /** Extra classes per row, e.g. to dim rows the app considers stale. */
1006
- rowClassName?: (row: Row) => string | undefined;
1007
- }
1008
- type DataTableProps<Row extends RowData> = DataTableViewProps<Row> & ({
1009
- instance: DataTableInstance<Row>;
1010
- } | UseDataTableOptions<Row>);
1011
- declare function DataTable<Row extends RowData>(props: DataTableProps<Row>): React$1.JSX.Element;
1012
- declare function DataTableView<Row extends RowData>({ instance, className, maxHeight, virtualize, rowHeight, stickyHeader, density, renderSubComponent, toolbar, bulkActions, toolbarActions, searchPlaceholder, emptyState, emptyMessage, pageSizeOptions, enableExport, exportFileName, loading, error, onRowClick, activeRowId, rowClassName }: DataTableViewProps<Row> & {
1013
- instance: DataTableInstance<Row>;
1014
- }): React$1.JSX.Element;
1015
- //#endregion
1016
- //#region src/components/data-table/parts.d.ts
1017
- interface DataTableColumnHeaderProps<Row extends RowData> extends Omit<React$1.ComponentProps<"div">, "title"> {
1018
- column: DataTableColumn<Row, any>;
1019
- title: React$1.ReactNode;
1020
- }
1021
- /**
1022
- * Header content for one column: the title as a sort toggle when the column
1023
- * sorts, and a menu with sort, pin and hide when any of those apply. The
1024
- * table renders it for every string `header` automatically; use it inside a
1025
- * custom header function to keep the same affordances.
1026
- */
1027
- declare function DataTableColumnHeader<Row extends RowData>({ column, title, className, ...props }: DataTableColumnHeaderProps<Row>): React$1.JSX.Element;
1028
- interface DataTableFacetedFilterOption {
1029
- value: string | number | boolean;
1030
- label?: string;
1031
- icon?: React$1.ComponentType<{
1032
- className?: string;
1033
- }>;
1034
- }
1035
- interface DataTableFacetedFilterProps<Row extends RowData> {
1036
- column: DataTableColumn<Row, any>;
1037
- title?: React$1.ReactNode;
1038
- /** Fixed options; defaults to the column's distinct values with counts (client source only). */
1039
- options?: DataTableFacetedFilterOption[];
1040
- className?: string;
1041
- }
1042
- /**
1043
- * A checkbox list of a column's values. The filter value is the array of
1044
- * picked values; the column's `filterFn` (`oneOf` by default for
1045
- * `meta.filter: "faceted"`) decides what that means, and a server source
1046
- * receives it verbatim in `TableQuery.filters`.
1047
- */
1048
- declare function DataTableFacetedFilter<Row extends RowData>({ column, title, options, className }: DataTableFacetedFilterProps<Row>): React$1.JSX.Element;
1049
- interface DataTableViewOptionsProps<Row extends RowData> {
1050
- table: DataTableTable<Row>;
1051
- className?: string;
1052
- }
1053
- /** Column visibility menu. */
1054
- declare function DataTableViewOptions<Row extends RowData>({ table, className }: DataTableViewOptionsProps<Row>): React$1.JSX.Element | null;
1055
- interface DataTableExportMenuProps<Row extends RowData> {
1056
- table: DataTableTable<Row>;
1057
- fileName?: string;
1058
- className?: string;
1059
- }
1060
- declare function DataTableExportMenu<Row extends RowData>({ table, fileName, className }: DataTableExportMenuProps<Row>): React$1.JSX.Element;
1061
- interface DataTableToolbarProps<Row extends RowData> extends Omit<React$1.ComponentProps<"div">, "children"> {
1062
- table: DataTableTable<Row>;
1063
- /** Placeholder for the search box. @default "Search…" */
1064
- searchPlaceholder?: string;
1065
- /** Rendered while rows are selected, in place of the filters. */
1066
- bulkActions?: (ctx: {
1067
- rows: Row[];
1068
- table: DataTableTable<Row>;
1069
- }) => React$1.ReactNode;
1070
- /** Extra controls on the right, before the view and export menus. */
1071
- children?: React$1.ReactNode;
1072
- /** @default true */
1073
- enableExport?: boolean;
1074
- exportFileName?: string;
1075
- }
1076
- /**
1077
- * Search box, one faceted filter per `meta.filter: "faceted"` column, a reset
1078
- * when anything is filtered, and the view / export menus. While rows are
1079
- * selected the left side becomes the selection summary and `bulkActions`.
1080
- */
1081
- declare function DataTableToolbar<Row extends RowData>({ table, searchPlaceholder, bulkActions, children, enableExport, exportFileName, className, ...props }: DataTableToolbarProps<Row>): React$1.JSX.Element;
1082
- interface DataTablePaginationProps<Row extends RowData> extends React$1.ComponentProps<"div"> {
1083
- table: DataTableTable<Row>;
1084
- /** @default [10, 25, 50, 100] */
1085
- pageSizeOptions?: number[];
1086
- }
1087
- declare function DataTablePagination<Row extends RowData>({ table, pageSizeOptions, className, ...props }: DataTablePaginationProps<Row>): React$1.JSX.Element;
1088
- //#endregion
1089
- //#region src/components/data-table/use-data-table.d.ts
1090
- /**
1091
- * Builds the table for a `dataSource`. This is where the design decision's
1092
- * "the component sets the manual flags itself" lives: a server source flips
1093
- * `manualFiltering`, `manualSorting` and `manualPagination` and feeds the
1094
- * table's own filter / sort / page state back out as a `TableQuery`; a client
1095
- * source leaves every row model in memory. Everything else (selection,
1096
- * expansion, visibility, pinning, sizing) is owned by the table.
1097
- *
1098
- * Use it directly when the default layout is not enough: pass the returned
1099
- * `table` to `DataTableToolbar`, `DataTablePagination` and friends, or the
1100
- * whole instance to `<DataTable instance={...} />`.
1101
- */
1102
- export declare function useDataTable<Row extends RowData>(options: UseDataTableOptions<Row>): DataTableInstance<Row>;
1103
- //#endregion
1104
- //#region src/components/data-table/export.d.ts
1105
- type ExportCell = string | number | boolean | Date | null;
1106
- interface ExportSheet {
1107
- headers: string[];
1108
- records: ExportCell[][];
1109
- }
1110
- export declare function toSheet<Row extends RowData>(table: DataTableTable<Row>, rows?: DataTableRow<Row>[]): ExportSheet;
1111
- /** RFC 4180 text: comma separated, CRLF lines, quotes doubled. */
1112
- export declare function toCsv<Row extends RowData>(table: DataTableTable<Row>, rows?: DataTableRow<Row>[]): string;
1113
- export declare function downloadCsv<Row extends RowData>(table: DataTableTable<Row>, fileName?: string, rows?: DataTableRow<Row>[]): void;
1114
- /**
1115
- * Excel through exceljs, loaded on first use so the workbook code (about
1116
- * 300 KB) never sits in a bundle that only ever exports CSV.
1117
- */
1118
- export declare function downloadExcel<Row extends RowData>(table: DataTableTable<Row>, fileName?: string, rows?: DataTableRow<Row>[]): Promise<void>;
1119
- //#endregion
1120
- //#region src/a2ui/views.d.ts
1121
- /** A row in an agent-drawn table. Every value is opaque until a column reads it. */
1122
- type A2UIRow = Record<string, unknown>;
1123
- /** Where a node sits, carried into every action the view emits. */
1124
- interface A2UINodeInfo {
1125
- surfaceId: string;
1126
- componentId: string;
1127
- /** JSON pointer this node's relative bindings resolve against. */
1128
- dataContextPath: string;
1129
- }
1130
- /** A normalised action attached to an interactive property. */
1131
- interface A2UIResolvedAction {
1132
- name: string;
1133
- context?: Record<string, unknown>;
1134
- }
1135
- /** What every view receives. */
1136
- interface A2UIViewProps<P> {
1137
- props: P;
1138
- node: A2UINodeInfo;
1139
- /** Already-rendered child nodes, in the order the component listed them. */
1140
- children: React$1.ReactNode[];
1141
- /** The surface data model, for actions that report the whole form. */
1142
- dataModel: Record<string, unknown>;
1143
- /**
1144
- * Send an action. `action` is what the agent attached to the property; when
1145
- * it is absent the event still fires under `fallbackName` so a host can
1146
- * observe interactions the agent did not ask for.
1147
- */
1148
- emit: (action: A2UIResolvedAction | undefined, fallbackName: string, payload?: Record<string, unknown>) => void;
1149
- /** Write a value back to the data model where this prop was bound. No-op for a literal. */
1150
- writeBack: (property: string, value: unknown) => void;
1151
- /** Resolve a `{ kind: "server", sourceId }` handle into a real data source. */
1152
- resolveDataSource: (sourceId: string) => DataSource<A2UIRow> | undefined;
1153
- /** Debounce applied to continuous inputs before they become actions. */
1154
- debounceMs: number;
1155
- }
1156
- type A2UIView<P> = React$1.FC<A2UIViewProps<P>>;
1157
- interface A2UIColumn {
1158
- id: string;
1159
- label?: string;
1160
- align?: "start" | "center" | "end";
1161
- filter?: "faceted" | "text";
1162
- width?: number;
1163
- }
1164
- /**
1165
- * Where a table's rows come from.
1166
- *
1167
- * `client` carries the rows inline, which suits a short result an agent
1168
- * already has. `server` carries a handle instead: the agent obtains a
1169
- * `sourceId` from a tool and the host resolves it through
1170
- * `resolveDataSource`, so search, sort and paging run on the backend and the
1171
- * agent never has to put ten thousand rows in a message.
1172
- */
1173
- type A2UITableSource = {
1174
- kind: "client";
1175
- rows: A2UIRow[];
1176
- } | {
1177
- kind: "server";
1178
- sourceId: string;
1179
- };
1180
- /**
1181
- * What the renderer draws instead of a component it cannot draw.
1182
- *
1183
- * Never raw markup and never the offending payload as HTML: the detail is set
1184
- * as text, so a malformed message cannot inject anything. This is the
1185
- * "fallback: an error card on malformed payloads" of `05-agent-ui.md`.
1186
- */
1187
- export declare function A2UIErrorCard({ title, detail, componentId }: {
1188
- title: string;
1189
- detail?: string;
1190
- componentId?: string;
1191
- }): React$1.JSX.Element;
1192
- //#endregion
1193
- //#region src/a2ui/catalogue.d.ts
1194
- /** The five families the doc and the prompt group components by. */
1195
- type A2UIGroup = "layout" | "text" | "input" | "feedback" | "data";
1196
- /** A ready-to-render example: the components, plus any data model they bind to. */
1197
- interface A2UIExample {
1198
- /** Components for this entry. The first is the one being demonstrated. */
1199
- components: A2UIComponentSpec[];
1200
- /** Seed data for `{ path }` bindings used by the example. */
1201
- data?: Record<string, unknown>;
1202
- }
1203
- interface A2UICatalogueEntry<P = unknown> {
1204
- /** The name an agent writes in `component`. */
1205
- name: string;
1206
- group: A2UIGroup;
1207
- /** One sentence, used verbatim in the generated prompt section. */
1208
- summary: string;
1209
- /** Schema of the resolved properties. */
1210
- props: z.ZodType<P>;
1211
- /** Event names this component can raise through `onAction`. */
1212
- events: readonly string[];
1213
- /** `many` takes a `children` list; `none` ignores one. */
1214
- children: "none" | "many";
1215
- example: A2UIExample;
1216
- view: A2UIView<P>;
1217
- }
1218
- type A2UICatalogue = Readonly<Record<string, A2UICatalogueEntry<never>>>;
1219
- /**
1220
- * The catalogue an agent draws from, and the renderer's default.
1221
- *
1222
- * A host may narrow it (hand the renderer a subset) but should not widen it
1223
- * with components the prompt does not describe: an agent can only usefully
1224
- * emit what `catalogue-doc.ts` told it about.
1225
- */
1226
- export declare const defaultCatalogue: A2UICatalogue;
1227
- /** Catalogue id an agent may echo in `createSurface.catalogId`. */
1228
- export declare const A2UI_CATALOGUE_ID = "https://cortena.ai/a2ui/catalogues/cortena-ui/v1.json";
1229
- /** Every component name in the catalogue, sorted. */
1230
- export declare function catalogueNames(catalogue?: A2UICatalogue): string[];
1231
- //#endregion
1232
- //#region src/a2ui/catalogue-doc.d.ts
1233
- /** A JSON Schema object, as far as this module cares. */
1234
- type JsonSchema = Record<string, unknown>;
1235
- interface A2UIComponentDoc {
1236
- name: string;
1237
- group: A2UIGroup;
1238
- summary: string;
1239
- /** Whether the component takes a `children` list. */
1240
- children: "none" | "many";
1241
- /** Event names the component raises through `onAction`. */
1242
- events: string[];
1243
- /** JSON Schema of the resolved properties, derived from the zod schema. */
1244
- props: JsonSchema;
1245
- /** Property names that must be present. */
1246
- required: string[];
1247
- /** A complete, renderable example: the components and any data they bind to. */
1248
- example: {
1249
- components: A2UIComponentSpec[];
1250
- data?: Record<string, unknown>;
1251
- };
1252
- }
1253
- interface A2UICatalogueDoc {
1254
- catalogueId: string;
1255
- protocol: string;
1256
- generator: string;
1257
- components: A2UIComponentDoc[];
1258
- }
1259
- /** Build the machine-readable catalogue document. */
1260
- export declare function buildCatalogueDoc(catalogue?: A2UICatalogue): A2UICatalogueDoc;
1261
- /**
1262
- * Render the catalogue document as markdown.
1263
- *
1264
- * The output is written to be pasted into a system prompt: one table per
1265
- * component listing every property with its type, whether it is required and
1266
- * what it means, then a fenced example an agent can copy.
1267
- */
1268
- export declare function catalogueMarkdown(doc?: A2UICatalogueDoc): string;
1269
- /** Turn an entry's example into the messages an agent would actually send. */
1270
- export declare function exampleMessages(component: A2UIComponentDoc): unknown[];
1271
- //#endregion
1272
- //#region src/a2ui/renderer.d.ts
1273
- interface A2UIRendererProps {
1274
- /**
1275
- * The payload. One message, the list an AG-UI `CUSTOM` event carries, or the
1276
- * JSONL text `canvas.a2ui.pushJSONL` sends. Later messages fold onto earlier
1277
- * ones, so a push stream can be accumulated by the host and handed here whole.
1278
- */
1279
- message: A2UIMessageInput;
1280
- /** The component vocabulary. Defaults to the whole cortena-ui catalogue. */
1281
- catalogue?: A2UICatalogue;
1282
- /** Receives every user event, shaped like A2UI's client-to-server action. */
1283
- onAction?: (action: A2UIAction) => void;
1284
- /**
1285
- * Resolves a `{ kind: "server", sourceId }` table handle into a real data
1286
- * source. Without it, a server table renders an error card rather than an
1287
- * empty one, because a silently empty table reads as "no results".
1288
- */
1289
- resolveDataSource?: (sourceId: string) => DataSource<A2UIRow> | undefined;
1290
- /** Render only this surface. Default: every surface, in arrival order. */
1291
- surfaceId?: string;
1292
- /** Debounce before a continuous input becomes an action. @default 300 */
1293
- debounceMs?: number;
1294
- className?: string;
1295
- }
1296
- /**
1297
- * A2UIRenderer — draws A2UI messages through cortena-ui.
1298
- *
1299
- * ```tsx
1300
- * <A2UIRenderer
1301
- * message={customEvent.value}
1302
- * catalogue={defaultCatalogue}
1303
- * onAction={(action) => agent.send(action)}
1304
- * resolveDataSource={(id) => sources[id]}
1305
- * />
1306
- * ```
1307
- */
1308
- export declare function A2UIRenderer({ message, catalogue, onAction, resolveDataSource, surfaceId, debounceMs, className }: A2UIRendererProps): React$1.JSX.Element;
1309
- //#endregion
1310
- //#region src/components/accordion.d.ts
1311
- /**
1312
- * Accordion.
1313
- *
1314
- * Base UI's Accordion is a list of Collapsibles: `Root > Item > Header > Trigger`
1315
- * plus `Panel`. The panel animates on height through Base UI's
1316
- * `--accordion-panel-height`, and marks its first/last frame with
1317
- * `data-starting-style` / `data-ending-style`, which is where it collapses to 0.
1318
- *
1319
- * Radix users: `type="single" | "multiple"` is now the boolean `multiple`, and
1320
- * `value` is always an array. `collapsible` is the default. `data-state="open"`
1321
- * is `data-open` on the item and panel, `data-panel-open` on the trigger.
1322
- */
1323
- declare function Accordion({ className, ...props }: Accordion$1.Root.Props): import("react").JSX.Element;
1324
- declare function AccordionItem({ className, ...props }: Accordion$1.Item.Props): import("react").JSX.Element;
1325
- declare function AccordionTrigger({ className, children, ...props }: Accordion$1.Trigger.Props): import("react").JSX.Element;
1326
- declare function AccordionContent({ className, children, ...props }: Accordion$1.Panel.Props): import("react").JSX.Element;
1327
- //#endregion
1328
- //#region src/components/alert.d.ts
1329
- declare const alertVariants: (props?: ({
1330
- variant?: "default" | "success" | "warn" | "destructive" | "danger" | "info" | null | undefined;
1331
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1332
- interface AlertProps extends React$1.ComponentProps<"div">, VariantProps<typeof alertVariants> {}
1333
- declare function Alert({ className, variant, ...props }: AlertProps): React$1.JSX.Element;
1334
- declare function AlertIcon({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1335
- declare function AlertTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1336
- declare function AlertDescription({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1337
- //#endregion
1338
- //#region src/components/avatar.d.ts
1339
- /**
1340
- * Avatar.
1341
- *
1342
- * Base UI preloads the image and only mounts `<img>` once it has loaded, so
1343
- * the fallback is what paints while loading and after an error. Initials sit
1344
- * on the primary fill in inverse text.
1345
- *
1346
- * Radix users: `delayMs` on the fallback is now `delay`.
1347
- */
1348
- declare function Avatar({ className, ...props }: Avatar$1.Root.Props): import("react").JSX.Element;
1349
- declare function AvatarImage({ className, ...props }: Avatar$1.Image.Props): import("react").JSX.Element;
1350
- declare function AvatarFallback({ className, ...props }: Avatar$1.Fallback.Props): import("react").JSX.Element;
1351
- //#endregion
1352
- //#region src/components/badge.d.ts
1353
- declare const badgeVariants: (props?: ({
1354
- variant?: "default" | "success" | "warn" | "destructive" | "danger" | "info" | "warning" | "neutral" | "secondary" | "outline" | null | undefined;
1355
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1356
- interface BadgeProps extends React$1.ComponentProps<"span">, VariantProps<typeof badgeVariants> {}
1357
- declare function Badge({ className, variant, ...props }: BadgeProps): React$1.JSX.Element;
1358
- //#endregion
1359
- //#region src/lib/render.d.ts
1360
- /**
1361
- * The `render` prop for the components that are plain markup rather than Base
1362
- * UI primitives (Card, SectionCard, ButtonLink, BreadcrumbLink).
1363
- *
1364
- * Base UI parts take their own `render` and need nothing from here. The rest
1365
- * are a `<div>` or an `<a>` this package writes itself, and a consumer
1366
- * sometimes needs a different element under the same styling: a Card that is
1367
- * the page's `<aside>` landmark, or a link that is the router's `<Link>`.
1368
- * Passing an element rather than a component keeps the call site readable and
1369
- * lets the caller set props on it (`render={<Link to="/x" />}`).
1370
- *
1371
- * `props` wins over the passed element's own props, so the `className` and
1372
- * handlers a component computed are not silently dropped, while the element's
1373
- * own props (`href`, `to`, `aria-labelledby`) come through untouched. What a
1374
- * component lets a *caller* override is decided by the order it builds `props`
1375
- * in, not here. Children are `children`, falling back to the element's.
1376
- */
1377
- type RenderProp = React$1.ReactElement<Record<string, unknown>>;
1378
- //#endregion
1379
- //#region src/components/breadcrumb.d.ts
1380
- /**
1381
- * Breadcrumb — the trail above a page title.
1382
- *
1383
- * A `<nav aria-label="Breadcrumb">` around an ordered list, which is what
1384
- * assistive technology expects: the list order is the hierarchy, so a screen
1385
- * reader announces "list, 4 items" and reads the path in order. Separators are
1386
- * decorative list items, not text inside the links, so a link's accessible
1387
- * name is the crumb and nothing else.
1388
- *
1389
- * The last crumb is `BreadcrumbPage`, not a link: it is the page you are on,
1390
- * so it carries `aria-current="page"` and is not focusable. Everything before
1391
- * it is a `BreadcrumbLink`.
1392
- *
1393
- * ```tsx
1394
- * <Breadcrumb>
1395
- * <BreadcrumbList>
1396
- * <BreadcrumbItem>
1397
- * <BreadcrumbLink href="/">Home</BreadcrumbLink>
1398
- * </BreadcrumbItem>
1399
- * <BreadcrumbSeparator />
1400
- * <BreadcrumbItem>
1401
- * <BreadcrumbEllipsis />
1402
- * </BreadcrumbItem>
1403
- * <BreadcrumbSeparator />
1404
- * <BreadcrumbItem>
1405
- * <BreadcrumbPage>Invoice 4021</BreadcrumbPage>
1406
- * </BreadcrumbItem>
1407
- * </BreadcrumbList>
1408
- * </Breadcrumb>
1409
- * ```
1410
- *
1411
- * **Router links.** `BreadcrumbLink` renders an `<a>` by default. Pass
1412
- * `render` with the router's link component and the class name, `href` and
1413
- * handlers are merged onto it, the same contract as `ButtonLink`:
1414
- * `render={<NextLink href="/projects" />}` or
1415
- * `render={<Link to="/projects" />}`. This is deliberately not Base UI's
1416
- * `render` — a breadcrumb is markup, not a Base UI primitive — but it takes
1417
- * the same shape so there is one thing to remember.
1418
- */
1419
- declare function Breadcrumb({ className, ...props }: React$1.ComponentProps<"nav">): React$1.JSX.Element;
1420
- declare function BreadcrumbList({ className, ...props }: React$1.ComponentProps<"ol">): React$1.JSX.Element;
1421
- declare function BreadcrumbItem({ className, ...props }: React$1.ComponentProps<"li">): React$1.JSX.Element;
1422
- interface BreadcrumbLinkProps extends React$1.ComponentProps<"a"> {
1423
- /** Replace the rendered `<a>` with a router link; props are merged onto it. */
1424
- render?: RenderProp;
1425
- }
1426
- declare function BreadcrumbLink({ className, render, children, ...props }: BreadcrumbLinkProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
1427
- /**
1428
- * The current page: the last crumb, which is not a link.
1429
- *
1430
- * A plain `<span aria-current="page">`, deliberately not `role="link"` with
1431
- * `aria-disabled` — a disabled link that cannot be focused is a fiction, and
1432
- * it makes `getByRole("link")` return a crumb that navigates nowhere. With a
1433
- * span, the roles in the trail are exactly the crumbs you can travel to.
1434
- */
1435
- declare function BreadcrumbPage({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
1436
- /** Decorative divider between two crumbs; a chevron unless children replace it. */
1437
- declare function BreadcrumbSeparator({ className, children, ...props }: React$1.ComponentProps<"li">): React$1.JSX.Element;
1438
- /**
1439
- * Stands in for the crumbs a long trail collapses; put it inside a
1440
- * BreadcrumbItem. The glyph is hidden and the label is not: an ellipsis that
1441
- * announces nothing leaves a screen-reader user with a gap in the path.
1442
- */
1443
- declare function BreadcrumbEllipsis({ className, children, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
1444
- //#endregion
1445
- //#region src/components/button.d.ts
1446
- /**
1447
- * Button.
1448
- *
1449
- * Base UI supplies the behaviour (native button semantics, `focusableWhenDisabled`,
1450
- * keyboard activation on non-button elements through `render`). Every visual
1451
- * value is a cortena-design token; nothing here is a literal the lint would flag.
1452
- *
1453
- * Radix users: `asChild` is gone. Pass `render={<a href=... />}` to change the
1454
- * rendered element, which is Base UI's equivalent.
1455
- */
1456
- declare const buttonVariants: (props?: ({
1457
- variant?: "link" | "destructive" | "secondary" | "outline" | "primary" | "ghost" | "soft" | null | undefined;
1458
- size?: "sm" | "md" | "lg" | "icon" | "icon-sm" | null | undefined;
1459
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1460
- interface ButtonProps extends React$1.ComponentProps<typeof Button$1>, VariantProps<typeof buttonVariants> {}
1461
- declare function Button({ className, variant, size, ...props }: ButtonProps): React$1.JSX.Element;
1462
- //#endregion
1463
- //#region src/components/button-link.d.ts
1464
- /**
1465
- * An anchor that looks like a Button and keeps link semantics.
1466
- *
1467
- * `Button render={<a />}` makes Base UI treat the anchor as a button (role,
1468
- * tabindex, its `nativeButton` warning), which demotes real navigation for
1469
- * assistive technology and breaks `getByRole("link")`. Navigation should stay
1470
- * an anchor. This is the migration target for every Radix-era
1471
- * `<Button asChild><Link /></Button>`.
1472
- *
1473
- * Framework routers: pass `render` with the router's link so the styling and
1474
- * `href` land on it, e.g. `render={<NextLink href="/x" />}`; otherwise it
1475
- * renders a plain `<a>`.
1476
- */
1477
- interface ButtonLinkProps extends Omit<React$1.ComponentProps<"a">, "children">, Pick<ButtonProps, "variant" | "size"> {
1478
- children?: React$1.ReactNode;
1479
- /** Replace the rendered `<a>` with a router link; props are merged onto it. */
1480
- render?: RenderProp;
1481
- disabled?: boolean;
1482
- }
1483
- declare function ButtonLink({ className, variant, size, render, disabled, children, ...props }: ButtonLinkProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
1484
- //#endregion
1485
- //#region src/components/calendar.d.ts
1486
- /**
1487
- * Calendar.
1488
- *
1489
- * The shadcn Calendar shape over react-day-picker 10. The library's stylesheet
1490
- * is not imported; every class comes from the `classNames` map below and every
1491
- * visual value in it is a cortena-design token. Structure (nav, caption, grid,
1492
- * dropdown caption) is DayPicker's; the day cells, nav buttons and chevrons are
1493
- * swapped for our Button and lucide icons through `components`.
1494
- *
1495
- * `showOutsideDays` defaults to true and `captionLayout` to `"label"`; pass
1496
- * `captionLayout="dropdown"` for native month/year selects in the caption.
1497
- */
1498
- type CalendarProps = DayPickerProps;
1499
- /**
1500
- * One day cell's button. Selection and range state are exposed as data
1501
- * attributes so the classes below (and a consumer's) can paint them; the
1502
- * `today` attribute is only set when the day is not selected, so the soft
1503
- * fill never competes with the selected fill.
1504
- */
1505
- declare function CalendarDayButton({ className, day, modifiers, ...props }: DayButtonProps): React$1.JSX.Element;
1506
- declare function Calendar({ className, classNames, components, showOutsideDays, captionLayout, formatters, ...props }: CalendarProps): React$1.JSX.Element;
1507
- //#endregion
1508
- //#region src/components/card.d.ts
1509
- interface CardProps extends React$1.ComponentProps<"div"> {
1510
- /** Lift the border and surface on hover, for clickable cards. */
1511
- hover?: boolean;
1512
- /** Draw the border in the ring colour, for a selected or highlighted card. */
1513
- accent?: boolean;
1514
- /**
1515
- * Replace the rendered `<div>` with another element, so a card can *be* the
1516
- * landmark rather than sit inside a wrapper that is one:
1517
- * `render={<aside />}` for a sidebar panel, `render={<section />}` (with an
1518
- * `aria-labelledby` pointing at its title) for a labelled region,
1519
- * `render={<article />}` for a self-contained item in a feed. Props set on
1520
- * the passed element come through; the card's own styling wins.
1521
- */
1522
- render?: RenderProp;
1523
- }
1524
- /**
1525
- * Card — the bordered surface everything else sits on. `render` changes the
1526
- * element without changing the look, which is how a card becomes a landmark.
1527
- */
1528
- declare function Card({ className, hover, accent, render, children, ...props }: CardProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
1529
- declare function CardHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1530
- declare function CardTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1531
- declare function CardDescription({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1532
- declare function CardContent({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1533
- declare function CardFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1534
- //#endregion
1535
- //#region src/components/checkbox.d.ts
1536
- /**
1537
- * Checkbox.
1538
- *
1539
- * Base UI renders a `<span role="checkbox">` with a hidden `<input>` beside
1540
- * it, so it submits with forms and takes `checked`/`defaultChecked`. The
1541
- * indicator only mounts while checked or indeterminate; the icon inside it is
1542
- * a lucide Check, or a Minus when `indeterminate` is set.
1543
- *
1544
- * The 16px box takes half the small radius: the 8px ladder step would round
1545
- * it into a circle.
1546
- */
1547
- interface CheckboxProps extends React$1.ComponentProps<typeof Checkbox$1.Root> {}
1548
- declare function Checkbox({ className, indeterminate, ...props }: CheckboxProps): React$1.JSX.Element;
1549
- //#endregion
1550
- //#region src/components/chip.d.ts
1551
- /**
1552
- * Chip — a pill for filters, tags and selected values. Unlike Badge it keeps
1553
- * sentence case and the body font.
1554
- */
1555
- declare const chipVariants: (props?: ({
1556
- variant?: "default" | "outline" | "accent" | null | undefined;
1557
- size?: "default" | "sm" | null | undefined;
1558
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1559
- interface ChipProps extends React$1.ComponentProps<"span">, VariantProps<typeof chipVariants> {}
1560
- declare function Chip({ className, variant, size, ...props }: ChipProps): React$1.JSX.Element;
1561
- //#endregion
1562
- //#region src/components/combobox.d.ts
1563
- /**
1564
- * Combobox: a filterable text input with a listbox popup, on Base UI.
1565
- *
1566
- * Give the Root `items` (an array, or `[{ value, label }]`) and render the
1567
- * list with `<ComboboxList>{(item) => <ComboboxItem value={item} />}</ComboboxList>`;
1568
- * Base UI filters `items` against the input as the user types. Without
1569
- * `items` nothing is filtered and `ComboboxEmpty` never shows.
1570
- *
1571
- * - `ComboboxInput` is our `Input` with a trailing open/close trigger and,
1572
- * with `clearable`, an X button that clears the value.
1573
- * - `ComboboxContent` composes Portal + Positioner + Popup + List so
1574
- * consumers write one element; positioning props go to the Positioner.
1575
- * - Multiple selection: set `multiple` on the Root and wrap `ComboboxValue`
1576
- * (rendering a `ComboboxChip` per value) plus `ComboboxInput` in
1577
- * `ComboboxChips`. Inside `ComboboxChips` the input drops its own frame;
1578
- * the chips container carries the field look and anchors the popup.
1579
- * - `useComboboxFilter` is Base UI's `useFilter` for external filtering via
1580
- * `filteredItems`.
1581
- *
1582
- * `onValueChange` receives `(value, eventDetails)`; `onInputValueChange`
1583
- * reports the typed text.
1584
- */
1585
- declare function Combobox<Value, Multiple extends boolean | undefined = false, Item = Value>(props: Combobox$1.Root.Props<Value, Multiple, Item>): import("react").JSX.Element;
1586
- declare function ComboboxTrigger({ className, children, ...props }: Combobox$1.Trigger.Props): import("react").JSX.Element;
1587
- declare function ComboboxClear({ className, children, ...props }: Combobox$1.Clear.Props): import("react").JSX.Element;
1588
- interface ComboboxInputProps extends Combobox$1.Input.Props {
1589
- /** Show an X button that clears the selection while there is one. */
1590
- clearable?: boolean;
1591
- /** Class for the wrapper that holds the input and its buttons. */
1592
- wrapperClassName?: string;
1593
- }
1594
- declare function ComboboxInput({ className, clearable, wrapperClassName, ...props }: ComboboxInputProps): import("react").JSX.Element;
1595
- declare function ComboboxValue(props: Combobox$1.Value.Props): import("react").JSX.Element;
1596
- interface ComboboxChipsProps extends Combobox$1.Chips.Props {
1597
- /** Class for the inner chip row; `className` styles the field frame. */
1598
- chipsClassName?: string;
1599
- }
1600
- declare function ComboboxChips({ className, chipsClassName, children, ...props }: ComboboxChipsProps): import("react").JSX.Element;
1601
- interface ComboboxChipProps extends Combobox$1.Chip.Props {
1602
- /** Hide the remove button. */
1603
- removable?: boolean;
1604
- }
1605
- declare function ComboboxChip({ className, children, removable, ...props }: ComboboxChipProps): import("react").JSX.Element;
1606
- type PositionerProps$4 = Pick<Combobox$1.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor" | "collisionBoundary" | "collisionPadding" | "collisionAvoidance" | "sticky" | "positionMethod">;
1607
- interface ComboboxContentProps extends Omit<Combobox$1.Popup.Props, "children">, PositionerProps$4 {
1608
- /** Items, or a render function called per filtered item (needs `items` on the Root). */
1609
- children?: Combobox$1.List.Props["children"];
1610
- /**
1611
- * Shown (via `ComboboxEmpty`, above the list) when nothing matches the query.
1612
- * Needs `items` on the Root.
1613
- */
1614
- empty?: ReactNode;
1615
- /** Class for the inner List element. */
1616
- listClassName?: string;
1617
- /** Keep the popup mounted in the DOM while hidden. */
1618
- keepMounted?: boolean;
1619
- /** Where to portal the popup; defaults to `<body>`. */
1620
- container?: Combobox$1.Portal.Props["container"];
1621
- }
1622
- declare function ComboboxContent({ className, children, empty, listClassName, side, align, sideOffset, alignOffset, anchor, collisionBoundary, collisionPadding, collisionAvoidance, sticky, positionMethod, keepMounted, container, ...props }: ComboboxContentProps): import("react").JSX.Element;
1623
- declare function ComboboxItem({ className, children, ...props }: Combobox$1.Item.Props): import("react").JSX.Element;
1624
- /** Renders per filtered item; use inside a `ComboboxGroup` given `items`, or for a flat list pass a function as `ComboboxContent` children instead. */
1625
- declare function ComboboxCollection(props: Combobox$1.Collection.Props): import("react").JSX.Element;
1626
- declare function ComboboxEmpty({ className, ...props }: Combobox$1.Empty.Props): import("react").JSX.Element;
1627
- declare function ComboboxStatus({ className, ...props }: Combobox$1.Status.Props): import("react").JSX.Element;
1628
- declare function ComboboxGroup({ className, ...props }: Combobox$1.Group.Props): import("react").JSX.Element;
1629
- declare function ComboboxGroupLabel({ className, ...props }: Combobox$1.GroupLabel.Props): import("react").JSX.Element;
1630
- declare function ComboboxSeparator({ className, ...props }: Combobox$1.Separator.Props): import("react").JSX.Element;
1631
- declare const useComboboxFilter: typeof Combobox$1.useFilter;
1632
- //#endregion
1633
- //#region src/components/dialog.d.ts
1634
- /**
1635
- * Dialog.
1636
- *
1637
- * `DialogContent` composes Base UI's Portal + Backdrop + Popup so consumers
1638
- * keep writing `<DialogContent>…</DialogContent>`. The Radix `Overlay` part is
1639
- * exported as `DialogOverlay` (a styled Backdrop) for anyone composing by hand.
1640
- *
1641
- * Radix users: `asChild` becomes `render={...}`; `onOpenChange` receives
1642
- * `(open, eventDetails)` rather than just `open`; the popup is only
1643
- * dismissable via pointer when `modal` is true (the default), and
1644
- * `disablePointerDismissal` replaces `onPointerDownOutside` preventDefault.
1645
- */
1646
- declare function Dialog(props: Dialog$1.Root.Props): React$1.JSX.Element;
1647
- declare function DialogTrigger(props: Dialog$1.Trigger.Props): React$1.JSX.Element;
1648
- declare function DialogPortal(props: Dialog$1.Portal.Props): React$1.JSX.Element;
1649
- declare function DialogClose(props: Dialog$1.Close.Props): React$1.JSX.Element;
1650
- declare function DialogOverlay({ className, ...props }: Dialog$1.Backdrop.Props): React$1.JSX.Element;
1651
- interface DialogContentProps extends Dialog$1.Popup.Props {
1652
- /** Keep the dialog mounted in the DOM while hidden. */
1653
- keepMounted?: boolean;
1654
- /** Where to portal the dialog; defaults to `<body>`. */
1655
- container?: Dialog$1.Portal.Props["container"];
1656
- }
1657
- declare function DialogContent({ className, children, keepMounted, container, ...props }: DialogContentProps): React$1.JSX.Element;
1658
- declare function DialogHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1659
- declare function DialogBody({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1660
- declare function DialogFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1661
- declare function DialogTitle({ className, ...props }: Dialog$1.Title.Props): React$1.JSX.Element;
1662
- declare function DialogDescription({ className, ...props }: Dialog$1.Description.Props): React$1.JSX.Element;
1663
- //#endregion
1664
- //#region src/components/command.d.ts
1665
- /**
1666
- * Command palette on cmdk, styled like DropdownMenu.
1667
- *
1668
- * cmdk filters and ranks items itself from each item's text (or `value` /
1669
- * `keywords`); `CommandEmpty` renders when nothing matches. The selected
1670
- * (keyboard-highlighted) item carries `data-selected="true"`; `onSelect` on
1671
- * `CommandItem` fires on click and on Enter.
1672
- *
1673
- * `CommandDialog` puts a palette inside our Dialog with no header padding;
1674
- * it needs a `title` (visually hidden) so the dialog is labelled. Wire
1675
- * `open` / `onOpenChange` to a global shortcut (⌘K) for the usual pattern.
1676
- */
1677
- declare function Command({ className, ...props }: React$1.ComponentProps<typeof Command$1>): React$1.JSX.Element;
1678
- interface CommandDialogProps extends React$1.ComponentProps<typeof Dialog> {
1679
- /** Accessible name for the dialog; visually hidden. */
1680
- title?: string;
1681
- /** Accessible description for the dialog; visually hidden. */
1682
- description?: string;
1683
- /** Class for the dialog popup. */
1684
- className?: string;
1685
- /** Class for the inner Command root. */
1686
- commandClassName?: string;
1687
- /** Where to portal the dialog; defaults to `<body>`. */
1688
- container?: DialogContentProps["container"];
1689
- /** Keep the dialog mounted in the DOM while hidden. */
1690
- keepMounted?: boolean;
1691
- /** Props for the inner cmdk root (`filter`, `shouldFilter`, `loop`, `value`, ...). */
1692
- commandProps?: Omit<React$1.ComponentProps<typeof Command$1>, "children" | "className">;
1693
- children?: React$1.ReactNode;
1694
- }
1695
- declare function CommandDialog({ title, description, className, commandClassName, container, keepMounted, commandProps, children, ...props }: CommandDialogProps): React$1.JSX.Element;
1696
- declare function CommandInput({ className, ...props }: React$1.ComponentProps<typeof Command$1.Input>): React$1.JSX.Element;
1697
- declare function CommandList({ className, ...props }: React$1.ComponentProps<typeof Command$1.List>): React$1.JSX.Element;
1698
- declare function CommandEmpty({ className, ...props }: React$1.ComponentProps<typeof Command$1.Empty>): React$1.JSX.Element;
1699
- declare function CommandGroup({ className, ...props }: React$1.ComponentProps<typeof Command$1.Group>): React$1.JSX.Element;
1700
- declare function CommandSeparator({ className, ...props }: React$1.ComponentProps<typeof Command$1.Separator>): React$1.JSX.Element;
1701
- interface CommandItemProps extends React$1.ComponentProps<typeof Command$1.Item> {
1702
- variant?: "default" | "destructive";
1703
- }
1704
- declare function CommandItem({ className, variant, ...props }: CommandItemProps): React$1.JSX.Element;
1705
- declare function CommandShortcut({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
1706
- declare function CommandLoading(props: React$1.ComponentProps<typeof Command$1.Loading>): React$1.JSX.Element;
1707
- //#endregion
1708
- //#region src/components/date-field.d.ts
1709
- /** `2026-01-05`. */
1710
- declare function formatDateISO(date: Date): string;
1711
- /** `5 Jan 2026` for en-GB; other locales via `Intl.DateTimeFormat`. */
1712
- declare function formatDateShort(date: Date, locale?: string): string;
1713
- /** `5 January 2026` for en-GB; other locales via `Intl.DateTimeFormat`. */
1714
- declare function formatDateLong(date: Date, locale?: string): string;
1715
- /**
1716
- * Calendar-day distance in words: `today`, `yesterday`, `tomorrow`, `3 days
1717
- * ago`, `in 2 weeks`, `4 months ago`, `in 2 years`. Compares local calendar
1718
- * days, so 23:59 to 00:01 is `tomorrow`. Other locales use
1719
- * `Intl.RelativeTimeFormat`.
1720
- */
1721
- declare function formatRelative(date: Date, options?: {
1722
- now?: Date;
1723
- locale?: string;
1724
- }): string;
1725
- /** Strict `yyyy-mm-dd`; rejects impossible days such as `2026-02-30`. */
1726
- declare function parseDateISO(text: string): Date | undefined;
1727
- /** ISO first, then the English `5 Jan 2026` / `5 January 2026` shapes. */
1728
- declare function parseDateDefault(text: string): Date | undefined;
1729
- type CalendarPassthrough$1 = Omit<CalendarProps, "mode" | "selected" | "onSelect" | "required" | "disabled">;
1730
- interface DateFieldProps extends Omit<React$1.ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "min" | "max" | "type"> {
1731
- /** The date (controlled). */
1732
- value?: Date | undefined;
1733
- /** The initial date (uncontrolled). */
1734
- defaultValue?: Date | undefined;
1735
- /** Called with the parsed or picked date, or `undefined` when the text is cleared or invalid. */
1736
- onValueChange?: (date: Date | undefined) => void;
1737
- /** Input placeholder; defaults to the ISO shape. */
1738
- placeholder?: string;
1739
- /** Formats the date into the input; defaults to ISO `yyyy-mm-dd`. */
1740
- formatDate?: (date: Date) => string;
1741
- /** Parses typed text; defaults to ISO plus the English day-month-year shapes. */
1742
- parseDate?: (text: string) => Date | undefined;
1743
- /** Earliest selectable day. */
1744
- min?: Date;
1745
- /** Latest selectable day. */
1746
- max?: Date;
1747
- disabled?: boolean;
1748
- /** Force the invalid look (e.g. from a form validator). */
1749
- invalid?: boolean;
1750
- /** Extra props for the Calendar (e.g. `captionLayout`, `today`). */
1751
- calendarProps?: CalendarPassthrough$1;
1752
- /** Class name for the wrapper; use `className` for the input itself. */
1753
- wrapperClassName?: string;
1754
- }
1755
- declare function DateField(props: DateFieldProps): React$1.JSX.Element;
1756
- //#endregion
1757
- //#region src/components/date-picker.d.ts
1758
- /** en-GB order, no library: `15 January 2026`. */
1759
- declare function formatDateDefault(date: Date): string;
1760
- type CalendarPassthrough = Omit<CalendarProps, "mode" | "selected" | "onSelect" | "required" | "disabled">;
1761
- interface DatePickerProps {
1762
- /** The selected date (controlled). */
1763
- value?: Date | undefined;
1764
- /** The initial date (uncontrolled). */
1765
- defaultValue?: Date | undefined;
1766
- /** Called with the picked date, or `undefined` when the selected day is clicked again. */
1767
- onValueChange?: (date: Date | undefined) => void;
1768
- /** Trigger text while nothing is selected. */
1769
- placeholder?: string;
1770
- /** Formats the trigger text; defaults to `15 January 2026`. */
1771
- formatDate?: (date: Date) => string;
1772
- /** Disables the trigger. */
1773
- disabled?: boolean;
1774
- /** Class name for the trigger button. */
1775
- className?: string;
1776
- /** Extra props for the Calendar (e.g. `startMonth`, `captionLayout`, `disabled` matchers via `calendarProps.hidden`). */
1777
- calendarProps?: CalendarPassthrough & {
1778
- disabled?: CalendarProps["disabled"];
1779
- };
1780
- /** Accessible name for the trigger. */
1781
- "aria-label"?: string;
1782
- }
1783
- declare function DatePicker(props: DatePickerProps): React$1.JSX.Element;
1784
- interface DateRangePickerProps extends Omit<DatePickerProps, "value" | "defaultValue" | "onValueChange"> {
1785
- value?: DateRange | undefined;
1786
- defaultValue?: DateRange | undefined;
1787
- onValueChange?: (range: DateRange | undefined) => void;
1788
- /** Separator between the two ends; defaults to an en dash. */
1789
- separator?: string;
1790
- }
1791
- declare function DateRangePicker(props: DateRangePickerProps): React$1.JSX.Element;
1792
- //#endregion
1793
- //#region src/components/dropdown-menu.d.ts
1794
- /**
1795
- * DropdownMenu over Base UI's Menu.
1796
- *
1797
- * `DropdownMenuContent` and `DropdownMenuSubContent` compose Portal +
1798
- * Positioner + Popup, so consumers keep writing one element; `side`, `align`
1799
- * and `sideOffset` are forwarded to the Positioner where Base UI reads them.
1800
- *
1801
- * Radix users: `asChild` on the trigger becomes `render={<Button />}`;
1802
- * `onSelect` on items is `onClick`; `DropdownMenuLabel` is Base UI's
1803
- * `Menu.GroupLabel` (place it inside a `DropdownMenuGroup` for the
1804
- * `aria-labelledby` wiring); `DropdownMenuCheckboxItem` reports through
1805
- * `onCheckedChange(checked, eventDetails)`; `DropdownMenuRadioGroup` through
1806
- * `onValueChange(value, eventDetails)`. Highlight state is `data-highlighted`,
1807
- * not `:focus`.
1808
- */
1809
- declare function DropdownMenu(props: Menu.Root.Props): React$1.JSX.Element;
1810
- declare function DropdownMenuTrigger(props: Menu.Trigger.Props): React$1.JSX.Element;
1811
- declare function DropdownMenuPortal(props: Menu.Portal.Props): React$1.JSX.Element;
1812
- declare function DropdownMenuGroup(props: Menu.Group.Props): React$1.JSX.Element;
1813
- declare function DropdownMenuSub(props: Menu.SubmenuRoot.Props): React$1.JSX.Element;
1814
- declare function DropdownMenuRadioGroup(props: Menu.RadioGroup.Props): React$1.JSX.Element;
1815
- type PositionerProps$3 = Pick<Menu.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor" | "collisionBoundary" | "collisionPadding" | "collisionAvoidance" | "sticky" | "positionMethod">;
1816
- interface DropdownMenuContentProps extends Menu.Popup.Props, PositionerProps$3 {
1817
- /** Keep the menu mounted in the DOM while hidden. */
1818
- keepMounted?: boolean;
1819
- /** Where to portal the menu; defaults to `<body>`. */
1820
- container?: Menu.Portal.Props["container"];
1821
- }
1822
- declare function DropdownMenuContent({ className, side, align, sideOffset, alignOffset, anchor, collisionBoundary, collisionPadding, collisionAvoidance, sticky, positionMethod, keepMounted, container, ...props }: DropdownMenuContentProps): React$1.JSX.Element;
1823
- declare function DropdownMenuSubContent({ className, side, align, sideOffset, alignOffset, anchor, collisionBoundary, collisionPadding, collisionAvoidance, sticky, positionMethod, keepMounted, container, ...props }: DropdownMenuContentProps): React$1.JSX.Element;
1824
- interface DropdownMenuItemProps extends Menu.Item.Props {
1825
- inset?: boolean;
1826
- variant?: "default" | "destructive";
1827
- }
1828
- declare function DropdownMenuItem({ className, inset, variant, ...props }: DropdownMenuItemProps): React$1.JSX.Element;
1829
- declare function DropdownMenuCheckboxItem({ className, children, ...props }: Menu.CheckboxItem.Props): React$1.JSX.Element;
1830
- declare function DropdownMenuRadioItem({ className, children, ...props }: Menu.RadioItem.Props): React$1.JSX.Element;
1831
- interface DropdownMenuLabelProps extends Menu.GroupLabel.Props {
1832
- inset?: boolean;
1833
- }
1834
- declare function DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps): React$1.JSX.Element;
1835
- declare function DropdownMenuSeparator({ className, ...props }: Menu.Separator.Props): React$1.JSX.Element;
1836
- interface DropdownMenuSubTriggerProps extends Menu.SubmenuTrigger.Props {
1837
- inset?: boolean;
1838
- }
1839
- declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: DropdownMenuSubTriggerProps): React$1.JSX.Element;
1840
- declare function DropdownMenuShortcut({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
1841
- //#endregion
1842
- //#region src/components/dropzone.d.ts
1843
- /** `1536` → `1.5 KB`, `0` → `0 B`; base 1024, one decimal above bytes. */
1844
- declare function formatFileSize(bytes: number): string;
1845
- interface DropzoneProps extends Omit<React$1.ComponentProps<"div">, "children" | "onDrop" | "onDragEnter" | "onDragOver" | "onDragLeave"> {
1846
- /** Called with the accepted files after a drop, a paste or the file dialog. */
1847
- onFiles: (files: File[]) => void;
1848
- /** Called with the rejected files and their reasons. */
1849
- onReject?: (rejections: FileRejection[]) => void;
1850
- /** MIME type to extension map, e.g. `{ "image/png": [".png"] }`. */
1851
- accept?: Accept;
1852
- /** Allow more than one file; defaults to true. */
1853
- multiple?: boolean;
1854
- /** Largest accepted file in bytes. */
1855
- maxSize?: number;
1856
- /** Most files accepted per drop; `0` means unlimited. */
1857
- maxFiles?: number;
1858
- disabled?: boolean;
1859
- /** Do not open the file dialog on click; for a zone that wraps clickable content. @default false */
1860
- noClick?: boolean;
1861
- /** Do not open the file dialog on Enter or Space; pair with `noClick`. @default false */
1862
- noKeyboard?: boolean;
1863
- /** Primary line of the default body. */
1864
- label?: React$1.ReactNode;
1865
- /** Muted second line of the default body; derived from `accept` and `maxSize` when omitted. */
1866
- hint?: React$1.ReactNode;
1867
- /** Replace the default body. A function receives react-dropzone's state. */
1868
- children?: React$1.ReactNode | ((state: DropzoneState) => React$1.ReactNode);
1869
- }
1870
- declare function Dropzone({ onFiles, onReject, accept, multiple, maxSize, maxFiles, disabled, noClick, noKeyboard, label, hint, children, className, ref, ...props }: DropzoneProps): React$1.JSX.Element;
1871
- interface FileListProps extends Omit<React$1.ComponentProps<"ul">, "children"> {
1872
- files: readonly File[];
1873
- /** Called with the file and its index when its remove button is pressed; the button is hidden when omitted. */
1874
- onRemove?: (file: File, index: number) => void;
1875
- /** Formats the size column; defaults to `formatFileSize`. */
1876
- formatSize?: (bytes: number) => string;
1877
- }
1878
- /**
1879
- * The files a Dropzone picked: name, size and a remove button per row. Rows
1880
- * are keyed by name, size and last-modified time so re-picking the same file
1881
- * keeps its row stable.
1882
- */
1883
- declare function FileList({ files, onRemove, formatSize, className, ...props }: FileListProps): React$1.JSX.Element | null;
1884
- //#endregion
1885
- //#region src/components/empty-state.d.ts
1886
- interface EmptyStateProps extends Omit<React$1.ComponentProps<"div">, "title"> {
1887
- /** A lucide icon; sized and coloured by the state. */
1888
- icon?: React$1.ReactNode;
1889
- title: React$1.ReactNode;
1890
- description?: React$1.ReactNode;
1891
- /** One or two buttons offering the next step. */
1892
- action?: React$1.ReactNode;
1893
- /** `compact` for an empty panel inside a card; `default` for an empty page. */
1894
- size?: "default" | "compact";
1895
- }
1896
- /**
1897
- * EmptyState — the centred, muted "nothing here yet" surface. The icon sits
1898
- * in a soft disc on the muted token; the title stays in the foreground so the
1899
- * eye lands on it, and everything else recedes.
1900
- */
1901
- declare function EmptyState({ className, icon, title, description, action, size, children, ...props }: EmptyStateProps): React$1.JSX.Element;
1902
- //#endregion
1903
- //#region src/components/error-banner.d.ts
1904
- interface ErrorBannerProps extends Omit<React$1.ComponentProps<"div">, "children"> {
1905
- message: string;
1906
- onDismiss?: () => void;
1907
- onRetry?: () => void;
1908
- }
1909
- /**
1910
- * ErrorBanner — the one error surface every screen uses: a warning icon, the
1911
- * message, and optional Retry / Dismiss actions. Renders nothing for an empty
1912
- * message so callers can pass their error state straight through.
1913
- */
1914
- declare function ErrorBanner({ message, onDismiss, onRetry, className, ...props }: ErrorBannerProps): React$1.JSX.Element | null;
1915
- //#endregion
1916
- //#region src/components/field.d.ts
1917
- /**
1918
- * Field.
1919
- *
1920
- * The shadcn Field shape over Base UI's Field and Fieldset. `Field` is
1921
- * `Field.Root`: it owns the label/control/description/error association, so a
1922
- * `FieldLabel` focuses its `FieldControl` (or any Base UI control such as
1923
- * Checkbox, Select, Switch) without an explicit `htmlFor`, and every message
1924
- * ends up in the control's `aria-describedby`.
1925
- *
1926
- * Validity: Base UI puts `data-invalid` on every part once the control fails
1927
- * native constraints or a `validate` callback, and adds `aria-invalid` to the
1928
- * control. Pass `invalid` on `Field` when an external library owns the state
1929
- * (the Form component does this from react-hook-form).
1930
- *
1931
- * `FieldError` follows the field's validity: static children show once the
1932
- * control is invalid or the Field is marked `invalid`; `match="valueMissing"`
1933
- * narrows that to one constraint. Given `errors` (a react-hook-form error
1934
- * list) it renders whenever the list has a message.
1935
- */
1936
- declare const fieldVariants: (props?: ({
1937
- orientation?: "horizontal" | "vertical" | null | undefined;
1938
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1939
- interface FieldProps extends React$1.ComponentProps<typeof Field$1.Root>, VariantProps<typeof fieldVariants> {}
1940
- declare function Field({ className, orientation, invalid, ...props }: FieldProps): React$1.JSX.Element;
1941
- /** Stacks a label and description beside a control in a horizontal Field. */
1942
- declare function FieldContent({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1943
- interface FieldLabelProps extends React$1.ComponentProps<typeof Field$1.Label> {}
1944
- declare function FieldLabel({ className, ...props }: FieldLabelProps): React$1.JSX.Element;
1945
- interface FieldControlProps extends React$1.ComponentProps<typeof Field$1.Control> {}
1946
- /**
1947
- * The field's `<input>`, styled like Input. Swap the element with `render`
1948
- * (`render={<Textarea />}`); the input styling still applies unless the
1949
- * rendered element's own className wins in tailwind-merge.
1950
- */
1951
- declare function FieldControl({ className, ...props }: FieldControlProps): React$1.JSX.Element;
1952
- interface FieldDescriptionProps extends React$1.ComponentProps<typeof Field$1.Description> {}
1953
- declare function FieldDescription({ className, ...props }: FieldDescriptionProps): React$1.JSX.Element;
1954
- /** The shape react-hook-form gives for a field error; only `message` is read. */
1955
- interface FieldErrorItem {
1956
- message?: string | undefined;
1957
- }
1958
- interface FieldErrorProps extends React$1.ComponentProps<typeof Field$1.Error> {
1959
- /**
1960
- * Errors from an external validator. Duplicate messages collapse; one message
1961
- * renders as text, several as a list.
1962
- */
1963
- errors?: ReadonlyArray<FieldErrorItem | undefined> | undefined;
1964
- }
1965
- declare function FieldError({ className, children, errors, match, ...props }: FieldErrorProps): React$1.JSX.Element | null;
1966
- interface FieldsetProps extends React$1.ComponentProps<typeof Fieldset$1.Root> {}
1967
- declare function Fieldset({ className, ...props }: FieldsetProps): React$1.JSX.Element;
1968
- interface FieldsetLegendProps extends React$1.ComponentProps<typeof Fieldset$1.Legend> {}
1969
- declare function FieldsetLegend({ className, ...props }: FieldsetLegendProps): React$1.JSX.Element;
1970
- /** A vertical stack of Fields with the spacing a form uses between rows. */
1971
- declare function FieldGroup({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
1972
- //#endregion
1973
- //#region src/components/form.d.ts
1974
- declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getErrors, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
1975
- declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TTransformedValues = TFieldValues>(props: ControllerProps<TFieldValues, TName, TTransformedValues>): React$1.JSX.Element;
1976
- interface UseFormFieldReturn {
1977
- id: string;
1978
- name: string;
1979
- formItemId: string;
1980
- formDescriptionId: string;
1981
- formMessageId: string;
1982
- invalid: boolean;
1983
- isDirty: boolean;
1984
- isTouched: boolean;
1985
- isValidating: boolean;
1986
- error?: FieldError$1 | undefined;
1987
- }
1988
- declare function useFormField(): UseFormFieldReturn;
1989
- interface FormItemProps extends Omit<FieldProps, "invalid" | "name"> {}
1990
- declare function FormItem({ className, ...props }: FormItemProps): React$1.JSX.Element;
1991
- interface FormLabelProps extends FieldLabelProps {}
1992
- declare function FormLabel({ className, ...props }: FormLabelProps): React$1.JSX.Element;
1993
- interface FormControlProps extends React$1.HTMLAttributes<HTMLElement> {
1994
- /** The single control element; it receives `id`, `aria-describedby` and `aria-invalid`. */
1995
- children: React$1.ReactElement;
1996
- }
1997
- declare function FormControl({ children, ...props }: FormControlProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
1998
- interface FormDescriptionProps extends FieldDescriptionProps {}
1999
- declare function FormDescription({ className, ...props }: FormDescriptionProps): React$1.JSX.Element;
2000
- interface FormMessageProps extends Omit<FieldErrorProps, "errors" | "match"> {}
2001
- declare function FormMessage({ className, children, ...props }: FormMessageProps): React$1.JSX.Element | null;
2002
- //#endregion
2003
- //#region src/components/input.d.ts
2004
- /**
2005
- * Input.
2006
- *
2007
- * A plain `<input>`; Base UI has no primitive for it and none is needed. The
2008
- * look is cortenaweb's: sunken surface, subtle border that strengthens on hover
2009
- * and takes the ring colour on focus. `aria-invalid` swaps the border and ring
2010
- * for the destructive pair so a Field can mark errors without extra classes.
2011
- */
2012
- declare const inputClassName: string;
2013
- interface InputProps extends React$1.ComponentProps<"input"> {}
2014
- declare function Input({ className, type, ...props }: InputProps): React$1.JSX.Element;
2015
- //#endregion
2016
- //#region src/components/kbd.d.ts
2017
- /**
2018
- * Kbd — an inline keyboard-key cap. Mono caption-sm text on the sunken
2019
- * surface, with a heavier bottom border for the key-cap read.
2020
- */
2021
- declare function Kbd({ className, ...props }: React$1.ComponentProps<"kbd">): React$1.JSX.Element;
2022
- //#endregion
2023
- //#region src/components/label.d.ts
2024
- /**
2025
- * Label — a plain `<label>`. Base UI's Label lives inside Field, so this is
2026
- * the standalone form caption for anything that is not a Field.
2027
- */
2028
- declare const labelVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
2029
- interface LabelProps extends React$1.ComponentProps<"label">, VariantProps<typeof labelVariants> {}
2030
- declare function Label({ className, ...props }: LabelProps): React$1.JSX.Element;
2031
- //#endregion
2032
- //#region src/components/loading-skeleton.d.ts
2033
- type LoadingSkeletonPreset = "list" | "table" | "card" | "form";
2034
- interface LoadingSkeletonProps extends React$1.ComponentProps<"div"> {
2035
- /** Which shape of content is loading. */
2036
- preset?: LoadingSkeletonPreset;
2037
- /** Rows (list, table, form) or cards. Each preset has a sensible default. */
2038
- rows?: number;
2039
- /** Columns for `table` and `card`. */
2040
- columns?: number;
2041
- }
2042
- /**
2043
- * LoadingSkeleton — page-level placeholders assembled from Skeleton, one per
2044
- * shape of content: a list of rows with an avatar, a table with a header row,
2045
- * a grid of cards, or a stacked form. Announces itself as busy so assistive
2046
- * technology knows the region is loading; the blocks themselves are hidden.
2047
- */
2048
- declare function LoadingSkeleton({ className, preset, rows, columns, ...props }: LoadingSkeletonProps): React$1.JSX.Element;
2049
- //#endregion
2050
- //#region src/components/markdown.d.ts
2051
- /** The GitHub schema, plus `class="language-*"` on code and `checked` on task boxes. */
2052
- declare const markdownSanitizeSchema: Options$1;
2053
- interface CodeRendererProps {
2054
- /** The fenced block's text, without a trailing newline. */
2055
- code: string;
2056
- /** From the fence's info string, e.g. `ts` for ```ts. */
2057
- language: string | undefined;
2058
- }
2059
- interface MarkdownProps extends Omit<React$1.ComponentProps<"div">, "children"> {
2060
- /** The markdown source. */
2061
- children: string | null | undefined;
2062
- /** Tighter rhythm and smaller headings, for chat bubbles. */
2063
- compact?: boolean;
2064
- /** Renders fenced code blocks; the copy button is still added. Use for syntax highlighting. */
2065
- codeRenderer?: (props: CodeRendererProps) => React$1.ReactNode;
2066
- /** Override or extend the element map. */
2067
- components?: Components;
2068
- /** Extra remark plugins, appended after GFM. */
2069
- remarkPlugins?: NonNullable<Options["remarkPlugins"]>;
2070
- /** Extra rehype plugins, appended after sanitize. */
2071
- rehypePlugins?: NonNullable<Options["rehypePlugins"]>;
2072
- /**
2073
- * Rehype plugins that must run BEFORE sanitize. The one legitimate use is
2074
- * `rehype-raw` in a host that embeds trusted custom tags in markdown (the
2075
- * webchat's `<cortena-*>` blocks): raw HTML has to become nodes before the
2076
- * sanitizer sees it, and the sanitize schema then decides what survives.
2077
- * Anything placed here widens what reaches the sanitizer, so keep the
2078
- * schema strict when you use it.
2079
- */
2080
- rehypePluginsBeforeSanitize?: NonNullable<Options["rehypePlugins"]>;
2081
- /** Replace the sanitize schema; defaults to `markdownSanitizeSchema`. */
2082
- sanitizeSchema?: Options$1;
2083
- /** Rewrite URLs; defaults to react-markdown's, which drops non-http(s)/mailto/tel schemes. */
2084
- urlTransform?: Options["urlTransform"];
2085
- }
2086
- declare function Markdown({ children, compact, codeRenderer, components, remarkPlugins, rehypePlugins, rehypePluginsBeforeSanitize, sanitizeSchema, urlTransform, className, ...props }: MarkdownProps): React$1.JSX.Element;
2087
- //#endregion
2088
- //#region src/components/page-header.d.ts
2089
- interface PageHeaderProps extends Omit<React$1.ComponentProps<"header">, "title"> {
2090
- /** The page title. Rendered as the h1; use `titleAs` to demote it. */
2091
- title: React$1.ReactNode;
2092
- description?: React$1.ReactNode;
2093
- /** Buttons for the page, right-aligned on wide viewports. */
2094
- actions?: React$1.ReactNode;
2095
- /** Short uppercase label above the title, e.g. a section or product name. */
2096
- eyebrow?: React$1.ReactNode;
2097
- /** A Breadcrumb or any navigation rendered above the eyebrow. */
2098
- breadcrumb?: React$1.ReactNode;
2099
- /** Heading level when the page already has an h1. */
2100
- titleAs?: "h1" | "h2" | "h3";
2101
- }
2102
- /**
2103
- * PageHeader — the top of every screen: breadcrumb, eyebrow, title,
2104
- * description, and an actions slot. The title is an h1 on the h2 step of the
2105
- * type scale in the display face, so screens read as one product rather than
2106
- * as a stack of card titles.
2107
- */
2108
- declare function PageHeader({ className, title, description, actions, eyebrow, breadcrumb, titleAs: Title, children, ...props }: PageHeaderProps): React$1.JSX.Element;
2109
- //#endregion
2110
- //#region src/components/popover.d.ts
2111
- /**
2112
- * Popover.
2113
- *
2114
- * `PopoverContent` composes Base UI's Portal + Positioner + Popup so consumers
2115
- * keep writing `<PopoverContent side="bottom" align="start">`; the positioning
2116
- * props are forwarded to the Positioner, which is where Base UI reads them.
2117
- *
2118
- * Radix users: `asChild` on the trigger becomes `render={<Button />}`;
2119
- * `PopoverAnchor` is gone — pass `anchor={ref}` to `PopoverContent` instead.
2120
- */
2121
- declare function Popover(props: Popover$1.Root.Props): import("react").JSX.Element;
2122
- declare function PopoverTrigger(props: Popover$1.Trigger.Props): import("react").JSX.Element;
2123
- declare function PopoverClose(props: Popover$1.Close.Props): import("react").JSX.Element;
2124
- declare function PopoverTitle({ className, ...props }: Popover$1.Title.Props): import("react").JSX.Element;
2125
- declare function PopoverDescription({ className, ...props }: Popover$1.Description.Props): import("react").JSX.Element;
2126
- type PositionerProps$2 = Pick<Popover$1.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor" | "collisionBoundary" | "collisionPadding" | "collisionAvoidance" | "sticky" | "positionMethod">;
2127
- interface PopoverContentProps extends Popover$1.Popup.Props, PositionerProps$2 {
2128
- /** Keep the popup mounted in the DOM while hidden. */
2129
- keepMounted?: boolean;
2130
- /** Where to portal the popup; defaults to `<body>`. */
2131
- container?: Popover$1.Portal.Props["container"];
2132
- }
2133
- declare function PopoverContent({ className, side, align, sideOffset, alignOffset, anchor, collisionBoundary, collisionPadding, collisionAvoidance, sticky, positionMethod, keepMounted, container, ...props }: PopoverContentProps): import("react").JSX.Element;
2134
- //#endregion
2135
- //#region src/components/progress.d.ts
2136
- /**
2137
- * Progress.
2138
- *
2139
- * `Progress` renders the Base UI root (a `<div role="progressbar">` carrying
2140
- * `aria-valuenow`) with the track and indicator already inside; Base UI sizes
2141
- * the indicator to `value` as a percentage of `min`..`max`. Put a
2142
- * `ProgressLabel` and `ProgressValue` in `children` for a captioned bar; they
2143
- * render in a row above the track. `value={null}` gives an indeterminate bar.
2144
- */
2145
- interface ProgressProps extends React$1.ComponentProps<typeof Progress$1.Root> {}
2146
- declare function Progress({ className, children, ...props }: ProgressProps): React$1.JSX.Element;
2147
- declare function ProgressTrack({ className, ...props }: React$1.ComponentProps<typeof Progress$1.Track>): React$1.JSX.Element;
2148
- declare function ProgressIndicator({ className, ...props }: React$1.ComponentProps<typeof Progress$1.Indicator>): React$1.JSX.Element;
2149
- declare function ProgressLabel({ className, ...props }: React$1.ComponentProps<typeof Progress$1.Label>): React$1.JSX.Element;
2150
- declare function ProgressValue({ className, ...props }: React$1.ComponentProps<typeof Progress$1.Value>): React$1.JSX.Element;
2151
- //#endregion
2152
- //#region src/components/radio-group.d.ts
2153
- /**
2154
- * Radio group.
2155
- *
2156
- * `RadioGroup` owns the value (`value` / `defaultValue` / `onValueChange`) and
2157
- * renders a `<div role="radiogroup">`; each `RadioGroupItem` is a Base UI
2158
- * `Radio.Root` (`<span role="radio">`) with a dot indicator that only mounts
2159
- * while checked. Arrow keys move the selection, as the ARIA pattern requires.
2160
- */
2161
- interface RadioGroupProps extends React$1.ComponentProps<typeof RadioGroup$1> {}
2162
- declare function RadioGroup({ className, ...props }: RadioGroupProps): React$1.JSX.Element;
2163
- interface RadioGroupItemProps extends React$1.ComponentProps<typeof Radio.Root> {}
2164
- declare function RadioGroupItem({ className, ...props }: RadioGroupItemProps): React$1.JSX.Element;
2165
- //#endregion
2166
- //#region src/components/scroll-area.d.ts
2167
- /**
2168
- * ScrollArea.
2169
- *
2170
- * Base UI positions the scrollbar and thumb itself (absolute inside the root,
2171
- * thumb size in `--scroll-area-thumb-*`); this file only sets the track width,
2172
- * the thumb colour and the hover/scroll reveal. Base UI also unmounts the
2173
- * scrollbar when there is nothing to scroll, so an empty list shows no track.
2174
- *
2175
- * Radix users: the `display: table` wrapper is gone, so `truncate` works
2176
- * inside the viewport without the `[&>div]:!block` override cortenaweb needed.
2177
- * `type="always" | "hover"` is gone too; the scrollbar shows on hover and while
2178
- * scrolling, and `keepMounted` on `ScrollBar` keeps it in the DOM otherwise.
2179
- */
2180
- interface ScrollAreaProps extends ScrollArea$1.Root.Props {
2181
- /** Which scrollbars to render. Defaults to vertical only. */
2182
- orientation?: "vertical" | "horizontal" | "both";
2183
- }
2184
- declare function ScrollArea({ className, children, orientation, ...props }: ScrollAreaProps): import("react").JSX.Element;
2185
- declare function ScrollBar({ className, orientation, ...props }: ScrollArea$1.Scrollbar.Props): import("react").JSX.Element;
2186
- //#endregion
2187
- //#region src/components/section-card.d.ts
2188
- interface SectionCardProps extends Omit<CardProps, "title"> {
2189
- title: React$1.ReactNode;
2190
- description?: React$1.ReactNode;
2191
- /** Controls for the section, right-aligned in the header row. */
2192
- actions?: React$1.ReactNode;
2193
- /** Rendered in a CardFooter under the body. */
2194
- footer?: React$1.ReactNode;
2195
- /** Remove the body padding, for a table or list that fills the card. */
2196
- flush?: boolean;
2197
- /** Class on the body wrapper. */
2198
- bodyClassName?: string;
2199
- }
2200
- /**
2201
- * SectionCard — a Card with a header row (title, description, actions), a
2202
- * body and an optional footer. It composes the Card parts rather than
2203
- * restyling them, so a SectionCard and a hand-built Card look identical.
2204
- *
2205
- * `render` is Card's and reaches the outer element, so a section card can be
2206
- * the landmark it is named after: `render={<section aria-labelledby={id} />}`
2207
- * with the same `id` on the title, or `render={<aside />}` for a side panel.
2208
- */
2209
- declare function SectionCard({ title, description, actions, footer, flush, bodyClassName, children, ...props }: SectionCardProps): React$1.JSX.Element;
2210
- //#endregion
2211
- //#region src/components/segmented.d.ts
2212
- /**
2213
- * Segmented control.
2214
- *
2215
- * A single-select row of options exposed as a radiogroup: the same semantics
2216
- * cortenaweb shipped, which screen readers announce as "1 of 3, selected".
2217
- * The active segment lifts onto the raised surface with the small shadow; the
2218
- * others read as muted text until hovered.
2219
- */
2220
- interface SegmentedOption<T extends string = string> {
2221
- value: T;
2222
- label: React$1.ReactNode;
2223
- icon?: React$1.ReactNode;
2224
- disabled?: boolean;
2225
- }
2226
- interface SegmentedProps<T extends string = string> extends Omit<React$1.ComponentProps<"div">, "onChange"> {
2227
- value: T;
2228
- onValueChange: (value: T) => void;
2229
- options: readonly SegmentedOption<T>[];
2230
- "aria-label"?: string;
2231
- }
2232
- declare function Segmented<T extends string = string>({ className, value, onValueChange, options, "aria-label": ariaLabel, ...props }: SegmentedProps<T>): React$1.JSX.Element;
2233
- //#endregion
2234
- //#region src/components/select.d.ts
2235
- /**
2236
- * Select.
2237
- *
2238
- * `SelectContent` composes Base UI's Portal + Positioner + Popup so consumers
2239
- * keep writing `<SelectContent side="bottom" align="start">`; positioning
2240
- * props are forwarded to the Positioner, which is where Base UI reads them.
2241
- *
2242
- * Radix users:
2243
- * - `SelectValue` shows the raw value unless the Root is given `items`
2244
- * (`{ [value]: label }` or `[{ value, label }]`) or `itemToStringLabel`;
2245
- * Base UI does not read the label out of an unmounted `SelectItem`.
2246
- * - `onValueChange` receives `(value, eventDetails)`.
2247
- * - `SelectContent` defaults to the dropdown layout; pass
2248
- * `alignItemWithTrigger` for Base UI's native-like overlay of the selected item.
2249
- *
2250
- * ## Typing the value
2251
- *
2252
- * `null` is the cleared / placeholder state, so `onValueChange` always hands
2253
- * back `Value | null`, never bare `Value`. Name the value type on the element
2254
- * to keep that union at `string | null` instead of letting inference widen it:
2255
- *
2256
- * ```tsx
2257
- * const [status, setStatus] = useState("");
2258
- *
2259
- * <Select<string>
2260
- * // "" is not a value any item carries; `|| null` is the placeholder state,
2261
- * // which is what makes SelectValue fall back to its `placeholder`.
2262
- * value={status || null}
2263
- * onValueChange={(next) => setStatus(next ?? "")} // next: string | null
2264
- * >
2265
- * ```
2266
- *
2267
- * Without the explicit `<string>` the type argument is inferred from `value`,
2268
- * so a `string | null` value widens `Value` and the handler's parameter turns
2269
- * into `string | null | null`. Multi-select narrows too:
2270
- * `<Select<string, true> multiple>` hands back `string[]`, never `null`.
2271
- *
2272
- * `SelectProps` is the same props type, for a wrapper that forwards them.
2273
- */
2274
- type SelectProps<Value = string, Multiple extends boolean | undefined = false> = Select$1.Root.Props<Value, Multiple>;
2275
- declare function Select<Value, Multiple extends boolean | undefined = false>(props: SelectProps<Value, Multiple>): import("react").JSX.Element;
2276
- declare function SelectGroup({ className, ...props }: Select$1.Group.Props): import("react").JSX.Element;
2277
- declare function SelectValue({ className, ...props }: Select$1.Value.Props): import("react").JSX.Element;
2278
- interface SelectTriggerProps extends Select$1.Trigger.Props {
2279
- size?: "sm" | "md";
2280
- }
2281
- declare function SelectTrigger({ className, size, children, ...props }: SelectTriggerProps): import("react").JSX.Element;
2282
- type PositionerProps$1 = Pick<Select$1.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor" | "collisionBoundary" | "collisionPadding" | "collisionAvoidance" | "sticky" | "positionMethod" | "alignItemWithTrigger">;
2283
- interface SelectContentProps extends Select$1.Popup.Props, PositionerProps$1 {
2284
- /** Where to portal the popup; defaults to `<body>`. */
2285
- container?: Select$1.Portal.Props["container"];
2286
- }
2287
- declare function SelectContent({ className, children, side, align, sideOffset, alignOffset, anchor, collisionBoundary, collisionPadding, collisionAvoidance, sticky, positionMethod, alignItemWithTrigger, container, ...props }: SelectContentProps): import("react").JSX.Element;
2288
- declare function SelectLabel({ className, ...props }: Select$1.GroupLabel.Props): import("react").JSX.Element;
2289
- declare function SelectItem({ className, children, ...props }: Select$1.Item.Props): import("react").JSX.Element;
2290
- declare function SelectSeparator({ className, ...props }: Select$1.Separator.Props): import("react").JSX.Element;
2291
- //#endregion
2292
- //#region src/components/separator.d.ts
2293
- interface SeparatorProps extends React$1.ComponentProps<typeof Separator$1> {
2294
- /**
2295
- * Purely visual: renders with `role="none"` so screen readers skip it.
2296
- * Defaults to true, matching the Radix component this replaces.
2297
- */
2298
- decorative?: boolean;
2299
- }
2300
- /**
2301
- * Separator — a one-pixel rule on the border token. Base UI supplies the
2302
- * `role="separator"` and `aria-orientation` semantics when not decorative.
2303
- */
2304
- declare function Separator({ className, orientation, decorative, ...props }: SeparatorProps): React$1.JSX.Element;
2305
- //#endregion
2306
- //#region src/components/sheet.d.ts
2307
- interface SheetProps extends Dialog$1.Root.Props {
2308
- /**
2309
- * `true` (default) traps focus, locks page scroll and draws a backdrop.
2310
- * `false` draws no backdrop and traps nothing, for a panel read alongside
2311
- * the app. `"trap-focus"` keeps focus in but leaves the page scrollable.
2312
- */
2313
- modal?: boolean | "trap-focus";
2314
- }
2315
- declare function Sheet({ modal, ...props }: SheetProps): React$1.JSX.Element;
2316
- declare function SheetTrigger(props: Dialog$1.Trigger.Props): React$1.JSX.Element;
2317
- declare function SheetClose(props: Dialog$1.Close.Props): React$1.JSX.Element;
2318
- declare function SheetPortal(props: Dialog$1.Portal.Props): React$1.JSX.Element;
2319
- declare function SheetOverlay({ className, ...props }: Dialog$1.Backdrop.Props): React$1.JSX.Element;
2320
- declare const sheetVariants: (props?: ({
2321
- side?: "top" | "bottom" | "left" | "right" | null | undefined;
2322
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
2323
- interface SheetContentProps extends Dialog$1.Popup.Props, VariantProps<typeof sheetVariants> {
2324
- /** Keep the sheet mounted in the DOM while hidden. */
2325
- keepMounted?: boolean;
2326
- /** Where to portal the sheet; defaults to `<body>`. */
2327
- container?: Dialog$1.Portal.Props["container"];
2328
- }
2329
- declare function SheetContent({ side, className, children, keepMounted, container, ...props }: SheetContentProps): React$1.JSX.Element;
2330
- declare function SheetHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
2331
- declare function SheetFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
2332
- declare function SheetTitle({ className, ...props }: Dialog$1.Title.Props): React$1.JSX.Element;
2333
- declare function SheetDescription({ className, ...props }: Dialog$1.Description.Props): React$1.JSX.Element;
2334
- //#endregion
2335
- //#region src/components/skeleton.d.ts
2336
- /**
2337
- * Skeleton — a pulsing placeholder block. Sized by the consumer (`h-4 w-40`);
2338
- * the fill is the border token, which reads on the canvas, a card and a
2339
- * popover in both themes.
2340
- */
2341
- declare function Skeleton({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
2342
- //#endregion
2343
- //#region src/components/sortable-list.d.ts
2344
- /** Spread onto the element that should start a drag. */
2345
- interface SortableHandleProps extends Partial<DraggableAttributes> {
2346
- ref: (element: HTMLElement | null) => void;
2347
- onKeyDown?: React$1.KeyboardEventHandler<HTMLElement>;
2348
- onPointerDown?: React$1.PointerEventHandler<HTMLElement>;
2349
- onMouseDown?: React$1.MouseEventHandler<HTMLElement>;
2350
- onTouchStart?: React$1.TouchEventHandler<HTMLElement>;
2351
- }
2352
- interface SortableRenderState {
2353
- /** Attributes, listeners and ref for a custom drag handle. */
2354
- handleProps: SortableHandleProps;
2355
- /** True for the item being dragged (and for the overlay copy). */
2356
- isDragging: boolean;
2357
- }
2358
- /** What moved where, passed to `onReorder` alongside the reordered array. */
2359
- interface SortableReorderDetails {
2360
- /** Index the item came from, in the array as it was passed in. */
2361
- from: number;
2362
- /** Index it landed on. */
2363
- to: number;
2364
- /** Id of the item that moved (`getId` of the dragged item). */
2365
- activeId: UniqueIdentifier;
2366
- /** Id of the item it was dropped onto. */
2367
- overId: UniqueIdentifier;
2368
- }
2369
- interface SortableListProps<T> extends Omit<React$1.ComponentProps<"ul">, "children"> {
2370
- items: readonly T[];
2371
- /** Stable id per item; must be unique within the list. */
2372
- getId: (item: T) => UniqueIdentifier;
2373
- /**
2374
- * Called with the reordered array after a successful drop, and with the move
2375
- * itself — `{ from, to, activeId, overId }` — for a server that persists a
2376
- * position rather than the whole list.
2377
- */
2378
- onReorder: (next: T[], details: SortableReorderDetails) => void;
2379
- renderItem: (item: T, state: SortableRenderState) => React$1.ReactNode;
2380
- /** Layout axis; also selects the sorting strategy. */
2381
- orientation?: "vertical" | "horizontal";
2382
- /** Only a `<SortableHandle>` (or an element given `handleProps`) starts a drag. */
2383
- handle?: boolean;
2384
- /**
2385
- * Let a finger scroll the page over the rows. Defaults to `handle`: `true`
2386
- * in handle mode, `false` in whole-row mode, which is what each already did.
2387
- * `true` on a whole-row list drops `touch-none` and uses a TouchSensor with
2388
- * delay activation, so a swipe scrolls and a held press drags.
2389
- */
2390
- touchScroll?: boolean;
2391
- /** Disables every sensor and hides the handles. */
2392
- disabled?: boolean;
2393
- /** Class name for each item wrapper. */
2394
- itemClassName?: string;
2395
- }
2396
- /**
2397
- * A grip button that starts the drag for its row. Reads the row's activator
2398
- * props from context, so it needs no wiring beyond being rendered inside
2399
- * `renderItem`. Hidden (kept in layout) when the list is disabled.
2400
- */
2401
- declare function SortableHandle({ className, children, ...props }: React$1.ComponentProps<"button">): React$1.JSX.Element;
2402
- declare function SortableList<T>({ items, getId, onReorder, renderItem, orientation, handle, disabled, touchScroll, itemClassName: itemClass, className, ...props }: SortableListProps<T>): React$1.JSX.Element;
2403
- //#endregion
2404
- //#region src/components/spinner.d.ts
2405
- interface SpinnerProps extends React$1.ComponentProps<"span"> {
2406
- /** Diameter in px. Defaults to 16. */
2407
- size?: number;
2408
- /**
2409
- * `inverse` for a spinner on a filled surface — inside a primary or
2410
- * destructive Button, on a toast, on any `-foreground` pairing. The default
2411
- * ring is `--ds-border` with a `--ds-primary` leading edge, which all but
2412
- * disappears on a primary fill; `inverse` draws both from
2413
- * `--ds-primary-foreground` instead.
2414
- */
2415
- tone?: "default" | "inverse";
2416
- }
2417
- /**
2418
- * Spinner — a ring with a coloured leading edge. Announces itself as
2419
- * `role="status"` with a "Loading" label; pass `aria-label` to override.
2420
- *
2421
- * ```tsx
2422
- * <Button disabled>
2423
- * <Spinner tone="inverse" /> Saving…
2424
- * </Button>
2425
- * ```
2426
- */
2427
- declare function Spinner({ className, size, tone, style, ...props }: SpinnerProps): React$1.JSX.Element;
2428
- //#endregion
2429
- //#region src/components/status-dot.d.ts
2430
- /**
2431
- * The error tone is `destructive`, the same spelling Button, Alert and Badge
2432
- * use. `danger` is a deprecated alias of it and paints the same.
2433
- */
2434
- type StatusDotTone = "accent" | "success" | "warning" | "destructive" |
2435
- /** @deprecated Use `destructive`; this alias paints the same. */
2436
- "danger" | "info" | "neutral";
2437
- interface StatusDotProps extends Omit<React$1.ComponentProps<"span">, "children"> {
2438
- tone?: StatusDotTone;
2439
- /** Adds a pinging halo behind the dot for "currently active" states. */
2440
- live?: boolean;
2441
- label?: React$1.ReactNode;
2442
- /** Dot diameter in px. Defaults to 7. */
2443
- size?: number;
2444
- }
2445
- /**
2446
- * StatusDot — a coloured dot with an optional caption. `live` layers a ping
2447
- * ring in the same tone behind the dot.
2448
- */
2449
- declare function StatusDot({ className, tone, live, label, size, style, ...props }: StatusDotProps): React$1.JSX.Element;
2450
- //#endregion
2451
- //#region src/components/switch.d.ts
2452
- /**
2453
- * Switch.
2454
- *
2455
- * Base UI renders a `<span role="switch">` with a hidden `<input>` beside it,
2456
- * so the control submits with forms and takes `checked`/`defaultChecked`
2457
- * exactly like a checkbox. State is exposed as `data-checked` /
2458
- * `data-unchecked` / `data-disabled`, which is what the classes key on.
2459
- *
2460
- * cortenaweb users: `checked` and `onCheckedChange` keep their names, but the
2461
- * control is now uncontrolled by default; pass `defaultChecked` if you do not
2462
- * hold the state yourself.
2463
- */
2464
- interface SwitchProps extends React$1.ComponentProps<typeof Switch$1.Root> {}
2465
- declare function Switch({ className, ...props }: SwitchProps): React$1.JSX.Element;
2466
- //#endregion
2467
- //#region src/components/tabs.d.ts
2468
- /**
2469
- * Tabs — the underlined pattern (primary-coloured underline under the active
2470
- * tab). For the inset segmented style use Segmented.
2471
- *
2472
- * The underline is a Base UI `Tabs.Indicator` rendered inside `TabsList`, so it
2473
- * slides between tabs instead of snapping. Base UI exposes the active tab's
2474
- * box as `--active-tab-left` / `--active-tab-width` on the indicator.
2475
- *
2476
- * Radix users: `data-state="active"` is now `data-active`; `TabsTrigger` and
2477
- * `TabsContent` are Base UI's `Tab` and `Panel` under the shadcn names. Arrow
2478
- * keys activate as they move (Radix's `activationMode="automatic"`); pass
2479
- * `activateOnFocus={false}` on `TabsList` for manual activation.
2480
- */
2481
- declare function Tabs({ className, ...props }: Tabs$1.Root.Props): import("react").JSX.Element;
2482
- declare function TabsList({ className, children, activateOnFocus, ...props }: Tabs$1.List.Props): import("react").JSX.Element;
2483
- declare function TabsIndicator({ className, ...props }: Tabs$1.Indicator.Props): import("react").JSX.Element;
2484
- declare function TabsTrigger({ className, ...props }: Tabs$1.Tab.Props): import("react").JSX.Element;
2485
- declare function TabsContent({ className, ...props }: Tabs$1.Panel.Props): import("react").JSX.Element;
2486
- //#endregion
2487
- //#region src/components/textarea.d.ts
2488
- /**
2489
- * Textarea.
2490
- *
2491
- * Same surface, border, focus ring and invalid state as Input so the two sit
2492
- * together in a form. `autoGrow` resizes the element to its content on every
2493
- * change (and on mount), which is how chat composers and note fields use it.
2494
- */
2495
- declare const textareaClassName: string;
2496
- interface TextareaProps extends React$1.ComponentProps<"textarea"> {
2497
- /** When true the textarea grows to fit its content instead of scrolling. */
2498
- autoGrow?: boolean;
2499
- }
2500
- declare function Textarea({ className, autoGrow, onChange, ref, ...props }: TextareaProps): React$1.JSX.Element;
2501
- //#endregion
2502
- //#region src/components/toast.d.ts
2503
- /**
2504
- * Toast.
2505
- *
2506
- * Base UI toasts are imperative: `useToast().add({ title, description, type })`
2507
- * from anywhere under the provider. `Toaster` mounts `Toast.Provider` and the
2508
- * `Toast.Viewport`, and renders every toast the manager holds, so it must wrap
2509
- * the part of the tree that calls `useToast` (usually the whole app).
2510
- *
2511
- * The `type` field on a toast picks the variant: `default`, `success`,
2512
- * `warning` or `destructive`, painted from the semantic soft tokens. Anything
2513
- * else falls back to `default`.
2514
- *
2515
- * sonner / Radix users: there is no `toast()` module singleton. Get the manager
2516
- * from `useToast()` inside a component, or build one with
2517
- * `createToastManager()` from `@base-ui/react/toast` and pass it as
2518
- * `toastManager` to `Toaster` when you need to fire toasts outside React.
2519
- */
2520
- declare const toastVariants: (props?: ({
2521
- variant?: "default" | "success" | "destructive" | "warning" | null | undefined;
2522
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
2523
- /** The Base UI toast manager: `{ toasts, add, close, update, promise }`. */
2524
- declare const useToast: typeof Toast$1.useToastManager;
2525
- interface ToastProps extends Omit<Toast$1.Root.Props, "toast">, VariantProps<typeof toastVariants> {
2526
- toast: Toast$1.Root.ToastObject;
2527
- }
2528
- /** One toast. Rendered by `Toaster`; exported for custom viewports. */
2529
- declare function Toast({ className, variant, toast, ...props }: ToastProps): React$1.JSX.Element;
2530
- interface ToasterProps extends Toast$1.Provider.Props {
2531
- /** Corner of the screen the stack grows from. */
2532
- position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
2533
- /** Extra classes on the viewport. */
2534
- className?: string;
2535
- children?: React$1.ReactNode;
2536
- }
2537
- /**
2538
- * Provider + viewport. Wrap the app in it once; `useToast()` works anywhere
2539
- * beneath. Toasts render in a fixed corner as a flat stack (newest last).
2540
- */
2541
- declare function Toaster({ position, className, children, ...props }: ToasterProps): React$1.JSX.Element;
2542
- //#endregion
2543
- //#region src/components/toolbar.d.ts
2544
- interface ToolbarProps extends React$1.ComponentProps<"div"> {
2545
- /** Draw a rule under the row, for a toolbar that sits above a table or list. */
2546
- bordered?: boolean;
2547
- }
2548
- /**
2549
- * Toolbar — a single flex row of controls above content. `ToolbarStart` and
2550
- * `ToolbarEnd` group the two ends; `ToolbarSeparator` is a short vertical rule
2551
- * between clusters of controls in the same group.
2552
- */
2553
- declare function Toolbar({ className, bordered, ...props }: ToolbarProps): React$1.JSX.Element;
2554
- declare function ToolbarStart({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
2555
- declare function ToolbarEnd({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
2556
- declare function ToolbarSeparator({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
2557
- //#endregion
2558
- //#region src/components/tooltip.d.ts
2559
- /**
2560
- * Tooltip.
2561
- *
2562
- * Base UI's Tooltip opens on hover and focus (never on click). Radix users:
2563
- * `asChild` on the trigger becomes `render={<Button />}`, and the delay moves
2564
- * from `delayDuration` on the Provider to `delay` on the Provider or Trigger.
2565
- * `TooltipContent` composes Portal + Positioner + Popup so the consumer still
2566
- * writes one element; `side`, `align` and `sideOffset` are forwarded to the
2567
- * Positioner where Base UI expects them. Base UI sets no ARIA role on the
2568
- * popup; `role="tooltip"` is added here so it reads like the Radix version.
2569
- */
2570
- declare function TooltipProvider(props: Tooltip$2.Provider.Props): import("react").JSX.Element;
2571
- declare function Tooltip(props: Tooltip$2.Root.Props): import("react").JSX.Element;
2572
- declare function TooltipTrigger(props: Tooltip$2.Trigger.Props): import("react").JSX.Element;
2573
- type PositionerProps = Pick<Tooltip$2.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor" | "collisionBoundary" | "collisionPadding" | "collisionAvoidance" | "sticky" | "positionMethod">;
2574
- interface TooltipContentProps extends Tooltip$2.Popup.Props, PositionerProps {
2575
- /** Keep the popup mounted in the DOM while hidden. */
2576
- keepMounted?: boolean;
2577
- /** Where to portal the popup; defaults to `<body>`. */
2578
- container?: Tooltip$2.Portal.Props["container"];
2579
- }
2580
- declare function TooltipContent({ className, side, align, sideOffset, alignOffset, anchor, collisionBoundary, collisionPadding, collisionAvoidance, sticky, positionMethod, keepMounted, container, ...props }: TooltipContentProps): import("react").JSX.Element;
2581
- //#endregion
2582
- //#region src/hooks/use-cortena-theme.d.ts
2583
- /**
2584
- * useCortenaTheme — the one theme bridge for every Cortena surface.
2585
- *
2586
- * cortena-design drives dark mode off `data-theme="light" | "dark"` on <html>
2587
- * and falls back to `prefers-color-scheme` when the attribute is absent. So the
2588
- * hook has exactly three jobs, consolidated from the flux and engram copies:
2589
- *
2590
- * 1. Remember the last choice in localStorage and put it back before the
2591
- * first paint (`applyStoredTheme`, or `themeInitScript` as a blocking
2592
- * <script> for apps that cannot run a module that early).
2593
- * 2. Listen for the message cortenaweb posts into an extension iframe on load
2594
- * and on every theme change:
2595
- *
2596
- * iframe.contentWindow.postMessage({ type: "cortena-theme", colors }, "*")
2597
- *
2598
- * and apply the *mode* it implies. The host may say `mode` or `theme`
2599
- * explicitly; otherwise the background colour's luminance decides.
2600
- * 3. Expose `{ theme, resolvedTheme, setTheme }` so a settings toggle can
2601
- * drive the same state.
2602
- *
2603
- * What it deliberately does NOT do is apply the individual colours in the
2604
- * host's message. The palette comes from cortena-design tokens, the single
2605
- * source of truth; writing the host's raw values onto `--ds-*` or `--color-*`
2606
- * would silently override every token the design system publishes. The
2607
- * `colors` object is read for its luminance only, never written to the DOM.
2608
- */
2609
- type CortenaTheme = "light" | "dark" | "system";
2610
- type ResolvedCortenaTheme = "light" | "dark";
2611
- /** The message cortenaweb posts into an embedded iframe. */
2612
- interface CortenaThemeMessage {
2613
- type: "cortena-theme";
2614
- /** Explicit mode. Preferred when present. */
2615
- theme?: CortenaTheme;
2616
- /** Older name for `theme`, sent by some hosts. */
2617
- mode?: CortenaTheme;
2618
- /** Raw palette. Only `background` is read, and only to infer the mode. */
2619
- colors?: Record<string, unknown>;
2620
- }
2621
- interface UseCortenaThemeOptions {
2622
- /** localStorage key the choice persists under. Defaults to `"cortena.theme"`. */
2623
- storageKey?: string;
2624
- /**
2625
- * Origins allowed to push a theme via postMessage. When omitted or empty,
2626
- * every origin is accepted — matching cortenaweb, which posts with `"*"`
2627
- * to cross-origin extensions. A same-origin embed should pass
2628
- * `[window.location.origin]`.
2629
- */
2630
- allowedOrigins?: readonly string[];
2631
- /** Set false to keep the state and DOM sync but ignore host messages. */
2632
- listen?: boolean;
2633
- }
2634
- interface UseCortenaThemeResult {
2635
- /** The stored choice; `"system"` when nothing has been chosen. */
2636
- theme: CortenaTheme;
2637
- /** What is actually painted: `theme`, or the OS scheme when `theme` is `"system"`. */
2638
- resolvedTheme: ResolvedCortenaTheme;
2639
- setTheme: (theme: CortenaTheme) => void;
2640
- }
2641
- export declare const DEFAULT_THEME_STORAGE_KEY = "cortena.theme";
2642
- export declare const THEME_MESSAGE_TYPE = "cortena-theme";
2643
- /**
2644
- * Write the mode onto <html>. `"system"` removes the attribute so
2645
- * cortena-design's `:root:not([data-theme])` fallback follows the OS.
2646
- */
2647
- export declare function applyTheme(theme: CortenaTheme, root?: HTMLElement): void;
2648
- export declare function readStoredTheme(storageKey?: string): CortenaTheme;
2649
- /**
2650
- * Put the remembered mode back on <html>. Tiny and synchronous on purpose:
2651
- * call it at the top of the app entry, before `createRoot`, so a reload does
2652
- * not flash the light palette at somebody reading in the dark. Returns what
2653
- * it applied.
2654
- */
2655
- export declare function applyStoredTheme(storageKey?: string): CortenaTheme;
2656
- /**
2657
- * The same logic as `applyStoredTheme` as a self-contained IIFE string, for
2658
- * consumers that inject a blocking `<script>` into <head> (Next.js
2659
- * `dangerouslySetInnerHTML`, or a Vite index.html). It cannot import anything,
2660
- * which is why it is duplicated rather than derived.
2661
- */
2662
- export declare function getThemeInitScript(storageKey?: string): string;
2663
- /** `getThemeInitScript()` for the default storage key. */
2664
- export declare const themeInitScript: string;
2665
- /**
2666
- * Infer the mode from a hex background colour by relative luminance. Any
2667
- * other colour syntax is ignored, since the host only ever sends hex and a
2668
- * wrong guess is worse than no change.
2669
- */
2670
- export declare function themeFromBackground(background: unknown): ResolvedCortenaTheme | null;
2671
- /**
2672
- * The mode a host message asks for, or null when it does not carry one.
2673
- * Explicit `theme` / `mode` win; otherwise the background luminance decides.
2674
- */
2675
- export declare function themeFromMessage(data: unknown): CortenaTheme | null;
2676
- export declare function useCortenaTheme(options?: UseCortenaThemeOptions): UseCortenaThemeResult;
2677
- //#endregion
2678
- export { type A2UIAction, type A2UIActionSpec, type A2UIBeginRendering, type A2UICatalogue, type A2UICatalogueDoc, type A2UICatalogueEntry, type A2UIChildList, type A2UIChildren, type A2UIColumn, type A2UIComponentDoc, type A2UIComponentSpec, type A2UICreateSurface, type A2UIDataBinding, type A2UIDeleteSurface, type A2UIExample, type A2UIFoldResult, type A2UIGroup, type A2UIMessage, type A2UIMessageInput, type A2UINodeInfo, type A2UIPropertyValue, type A2UIRendererProps, type A2UIResolvedAction, type A2UIRow, type A2UISurface, type A2UITableSource, type A2UIUpdateComponents, type A2UIUpdateDataModel, type A2UIView, type A2UIViewProps, type Accept, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertIcon, type AlertProps, AlertTitle, Area, AreaChart, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Bar, BarChart, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonLink, type ButtonLinkProps, type ButtonProps, Calendar, CalendarDayButton, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, CartesianGrid, Cell, Chart, type ChartConfig, ChartContainer, type ChartContainerProps, type ChartDataFor, type ChartDay, ChartEmpty, type ChartEngine, ChartError, ChartLegend, ChartLegendContent, type ChartLegendContentProps, ChartLoading, type ChartMatrix, type ChartPoint, type ChartProps, type ChartRenderer, type ChartRow, type ChartScale, type ChartScales, type ChartSeries, type ChartSlice, ChartTooltip, ChartTooltipContent, type ChartTooltipContentProps, type ChartTree, type ChartType, Checkbox, type CheckboxProps, Chip, type ChipProps, type ClientSource, type CodeRendererProps, Combobox, ComboboxChip, type ComboboxChipProps, ComboboxChips, type ComboboxChipsProps, ComboboxClear, ComboboxCollection, ComboboxContent, type ComboboxContentProps, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, type ComboboxInputProps, ComboboxItem, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, Command, CommandDialog, type CommandDialogProps, CommandEmpty, CommandGroup, CommandInput, CommandItem, type CommandItemProps, CommandList, CommandLoading, CommandSeparator, CommandShortcut, ComposedChart, type CortenaTheme, type CortenaThemeMessage, type DataSource, DataTable, type DataTableCell, type DataTableColumn, type DataTableColumnDef, DataTableColumnHeader, type DataTableColumnHeaderProps, type DataTableColumnMeta, type DataTableEditable, type DataTableEditingCell, DataTableExportMenu, type DataTableExportMenuProps, DataTableFacetedFilter, type DataTableFacetedFilterOption, type DataTableFacetedFilterProps, type DataTableFeatures, type DataTableInstance, DataTablePagination, type DataTablePaginationMode, type DataTablePaginationProps, type DataTableProps, type DataTableRow, type DataTableState, type DataTableTable, DataTableToolbar, type DataTableToolbarProps, DataTableView, DataTableViewOptions, type DataTableViewOptionsProps, type DataTableViewProps, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, Dropzone, type DropzoneProps, type DropzoneState, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ExportCell, type ExportSheet, Field, FieldContent, FieldControl, type FieldControlProps, FieldDescription, type FieldDescriptionProps, FieldError, type FieldErrorItem, type FieldErrorProps, FieldGroup, FieldLabel, type FieldLabelProps, type FieldProps, Fieldset, FieldsetLegend, type FieldsetLegendProps, type FieldsetProps, FileList, type FileListProps, type FileRejection, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, Funnel, FunnelChart, Input, type InputProps, type JsonSchema, Kbd, Label, LabelList, type LabelProps, Line, LineChart, LoadingSkeleton, type LoadingSkeletonPreset, type LoadingSkeletonProps, Markdown, type Components as MarkdownComponents, type MarkdownProps, type NivoTheme, PageHeader, type PageHeaderProps, Pie, PieChart, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Popover, PopoverClose, PopoverContent, type PopoverContentProps, PopoverDescription, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, type ProgressProps, ProgressTrack, ProgressValue, Radar, RadarChart, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, RechartsLegend, RechartsTooltip, ReferenceLine, type ResolvedCortenaTheme, ResponsiveContainer, Scatter, ScatterChart, ScrollArea, type ScrollAreaProps, ScrollBar, SectionCard, type SectionCardProps, Segmented, type SegmentedOption, type SegmentedProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, type SelectProps, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, type SeparatorProps, type ServerSource, Sheet, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, type SheetProps, SheetTitle, SheetTrigger, Skeleton, SortableHandle, type SortableHandleProps, SortableList, type SortableListProps, type SortableRenderState, type SortableReorderDetails, Spinner, type SpinnerProps, StatusDot, type StatusDotProps, type StatusDotTone, type SubmitHandler, Switch, type SwitchProps, type TableQuery, type TableResult, Tabs, TabsContent, TabsIndicator, TabsList, TabsTrigger, Textarea, type TextareaProps, Toast, type ToastProps, Toaster, type ToasterProps, Toolbar, ToolbarEnd, type ToolbarProps, ToolbarSeparator, ToolbarStart, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, type UseCortenaThemeOptions, type UseCortenaThemeResult, type UseDataTableOptions, type UseFormFieldReturn, type UseFormReturn, XAxis, YAxis, alertVariants, arrayMove, badgeVariants, buttonVariants, chipVariants, fieldVariants, formatDateDefault, formatDateISO, formatDateLong, formatDateShort, formatFileSize, formatRelative, inputClassName, labelVariants, markdownSanitizeSchema, parseDateDefault, parseDateISO, sheetVariants, textareaClassName, toastVariants, useComboboxFilter, useForm, useFormField, useToast, zodResolver };
2679
- //# sourceMappingURL=index.d.ts.map
2
+ import { A2UIAction, A2UIActionSpec, A2UIBeginRendering, A2UIChildList, A2UIChildren, A2UIComponentSpec, A2UICreateSurface, A2UIDataBinding, A2UIDeleteSurface, A2UIFoldResult, A2UIMessage, A2UIMessageInput, A2UIPropertyValue, A2UISurface, A2UIUpdateComponents, A2UIUpdateDataModel, A2UI_DEFAULT_SURFACE_ID, A2UI_VERSION, foldMessages, getAtPointer, isDataBinding, parseA2UIMessages, pointerSegments, readAction, readChildren, readComponent, resolvePointer, resolveValue, setAtPointer } from "./a2ui/message.js";
3
+ import { ChartConfig, ChartDataFor, ChartDay, ChartEngine, ChartLabels, ChartMatrix, ChartPoint, ChartRenderer, ChartRow, ChartScale, ChartSeries, ChartSlice, ChartTree, ChartType, NIVO_TYPES, RECHARTS_TYPES, chartEngine } from "./components/chart/types.js";
4
+ import { DataTableFeatures, createColumnHelper, dataTableFeatures } from "./components/data-table/features.js";
5
+ import { ClientSource, DataSource, DataTableCell, DataTableColumn, DataTableColumnDef, DataTableColumnMeta, DataTableEditable, DataTableEditingCell, DataTableInstance, DataTablePaginationMode, DataTableRow, DataTableState, DataTableTable, ServerSource, TableQuery, TableResult, UseDataTableOptions } from "./components/data-table/types.js";
6
+ import { DataTable, DataTableProps, DataTableView, DataTableViewProps } from "./components/data-table/data-table.js";
7
+ import { DataTableColumnHeader, DataTableColumnHeaderProps, DataTableExportMenu, DataTableExportMenuProps, DataTableFacetedFilter, DataTableFacetedFilterOption, DataTableFacetedFilterProps, DataTablePagination, DataTablePaginationProps, DataTableToolbar, DataTableToolbarProps, DataTableViewOptions, DataTableViewOptionsProps } from "./components/data-table/parts.js";
8
+ import { useDataTable } from "./components/data-table/use-data-table.js";
9
+ import { ExportCell, ExportSheet, downloadCsv, downloadExcel, toCsv, toSheet } from "./components/data-table/export.js";
10
+ import { A2UIColumn, A2UIErrorCard, A2UINodeInfo, A2UIResolvedAction, A2UIRow, A2UITableSource, A2UIView, A2UIViewProps } from "./a2ui/views.js";
11
+ import { A2UICatalogue, A2UICatalogueEntry, A2UIExample, A2UIGroup, A2UI_CATALOGUE_ID, catalogueNames, defaultCatalogue } from "./a2ui/catalogue.js";
12
+ import { A2UICatalogueDoc, A2UIComponentDoc, JsonSchema, buildCatalogueDoc, catalogueMarkdown, exampleMessages } from "./a2ui/catalogue-doc.js";
13
+ import { A2UIRenderer, A2UIRendererProps } from "./a2ui/renderer.js";
14
+ import "./a2ui.js";
15
+ import { ChartContainer, ChartContainerProps, ChartEmpty, ChartError, ChartLegendContent, ChartLegendContentProps, ChartLoading, ChartTooltipContent, ChartTooltipContentProps, seriesColor, useChart } from "./components/chart/container.js";
16
+ import { Chart, ChartProps } from "./components/chart/chart.js";
17
+ import { ChartLegend, ChartTooltip } from "./components/chart/recharts-parts.js";
18
+ import { NivoTheme, nivoTheme, useNivoTheme } from "./components/chart/nivo-theme.js";
19
+ import { ChartScales, VIZ_SERIES_COUNT, chartScales, resolveColor, resolveVizSeries, toHex, vizSeriesVars, vizVar } from "./components/chart/tokens.js";
20
+ import { Area, AreaChart, Bar, BarChart, CartesianGrid, Cell, ComposedChart, Funnel, FunnelChart, LabelList, Line, LineChart, Pie, PieChart, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart, RechartsLegend, RechartsTooltip, ReferenceLine, ResponsiveContainer, Scatter, ScatterChart, XAxis, YAxis } from "./components/chart/index.js";
21
+ import "./chart.js";
22
+ import { Alert, AlertDescription, AlertIcon, AlertProps, AlertTitle, alertVariants } from "./components/alert.js";
23
+ import { Badge, BadgeProps, badgeVariants } from "./components/badge.js";
24
+ import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbLinkProps, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./components/breadcrumb.js";
25
+ import { Button, ButtonProps, buttonVariants } from "./components/button.js";
26
+ import { ButtonLink, ButtonLinkProps } from "./components/button-link.js";
27
+ import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardProps, CardTitle } from "./components/card.js";
28
+ import { Checkbox, CheckboxProps } from "./components/checkbox.js";
29
+ import { Chip, ChipProps, chipVariants } from "./components/chip.js";
30
+ import { Combobox, ComboboxChip, ComboboxChipProps, ComboboxChips, ComboboxChipsProps, ComboboxClear, ComboboxCollection, ComboboxContent, ComboboxContentProps, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxInputProps, ComboboxItem, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, useComboboxFilter } from "./components/combobox.js";
31
+ import { Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/dialog.js";
32
+ import { Command, CommandDialog, CommandDialogProps, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandItemProps, CommandList, CommandLoading, CommandSeparator, CommandShortcut } from "./components/command.js";
33
+ import { CortenaTheme, CortenaThemeMessage, DEFAULT_THEME_STORAGE_KEY, ResolvedCortenaTheme, THEME_MESSAGE_TYPE, UseCortenaThemeOptions, UseCortenaThemeResult, applyStoredTheme, applyTheme, getThemeInitScript, readStoredTheme, themeFromBackground, themeFromMessage, themeInitScript, useCortenaTheme } from "./hooks/use-cortena-theme.js";
34
+ import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuSubTriggerProps, DropdownMenuTrigger } from "./components/dropdown-menu.js";
35
+ import { EmptyState, EmptyStateProps } from "./components/empty-state.js";
36
+ import { ErrorBanner, ErrorBannerProps } from "./components/error-banner.js";
37
+ import { Field, FieldContent, FieldControl, FieldControlProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorItem, FieldErrorProps, FieldGroup, FieldLabel, FieldLabelProps, FieldProps, Fieldset, FieldsetLegend, FieldsetLegendProps, FieldsetProps, fieldVariants } from "./components/field.js";
38
+ import { Input, InputProps, inputClassName } from "./components/input.js";
39
+ import { Label, LabelProps, labelVariants } from "./components/label.js";
40
+ import { LoadingSkeleton, LoadingSkeletonPreset, LoadingSkeletonProps } from "./components/loading-skeleton.js";
41
+ import { PageHeader, PageHeaderProps } from "./components/page-header.js";
42
+ import { Popover, PopoverClose, PopoverContent, PopoverContentProps, PopoverDescription, PopoverTitle, PopoverTrigger } from "./components/popover.js";
43
+ import { Progress, ProgressIndicator, ProgressLabel, ProgressProps, ProgressTrack, ProgressValue } from "./components/progress.js";
44
+ import { RadioGroup, RadioGroupItem, RadioGroupItemProps, RadioGroupProps } from "./components/radio-group.js";
45
+ import { ScrollArea, ScrollAreaProps, ScrollBar } from "./components/scroll-area.js";
46
+ import { SectionCard, SectionCardProps } from "./components/section-card.js";
47
+ import { Segmented, SegmentedOption, SegmentedProps } from "./components/segmented.js";
48
+ import { Select, SelectContent, SelectContentProps, SelectGroup, SelectItem, SelectLabel, SelectProps, SelectSeparator, SelectTrigger, SelectTriggerProps, SelectValue } from "./components/select.js";
49
+ import { Separator, SeparatorProps } from "./components/separator.js";
50
+ import { Sheet, SheetClose, SheetContent, SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetProps, SheetTitle, SheetTrigger, sheetVariants } from "./components/sheet.js";
51
+ import { Spinner, SpinnerProps } from "./components/spinner.js";
52
+ import { StatusDot, StatusDotProps, StatusDotTone } from "./components/status-dot.js";
53
+ import { Switch, SwitchProps } from "./components/switch.js";
54
+ import { Textarea, TextareaProps, textareaClassName } from "./components/textarea.js";
55
+ import { Toast, ToastProps, Toaster, ToasterProps, toastVariants, useToast } from "./components/toast.js";
56
+ import { Toolbar, ToolbarEnd, ToolbarProps, ToolbarSeparator, ToolbarStart } from "./components/toolbar.js";
57
+ import { Tooltip, TooltipContent, TooltipContentProps, TooltipProvider, TooltipTrigger } from "./components/tooltip.js";
58
+ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./components/accordion.js";
59
+ import { Avatar, AvatarFallback, AvatarImage } from "./components/avatar.js";
60
+ import { Kbd } from "./components/kbd.js";
61
+ import { Skeleton } from "./components/skeleton.js";
62
+ import { Tabs, TabsContent, TabsIndicator, TabsList, TabsTrigger } from "./components/tabs.js";
63
+ import { cn } from "./lib/cn.js";
64
+ import "./core.js";
65
+ import "./data-table.js";
66
+ import { Accept, Dropzone, DropzoneProps, DropzoneState, FileList, FileListProps, FileRejection, formatFileSize } from "./components/dropzone.js";
67
+ import { Calendar, CalendarDayButton, CalendarProps } from "./components/calendar.js";
68
+ import { DateField, DateFieldProps, formatDateISO, formatDateLong, formatDateShort, formatRelative, parseDateDefault, parseDateISO } from "./components/date-field.js";
69
+ import { DatePicker, DatePickerProps, DateRangePicker, DateRangePickerProps, formatDateDefault } from "./components/date-picker.js";
70
+ import { Form, FormControl, FormControlProps, FormDescription, FormDescriptionProps, FormField, FormItem, FormItemProps, FormLabel, FormLabelProps, FormMessage, FormMessageProps, SubmitHandler, UseFormFieldReturn, UseFormReturn, useForm, useFormField, zodResolver } from "./components/form.js";
71
+ import "./form.js";
72
+ import { CodeRendererProps, Markdown, MarkdownComponents as Components, MarkdownProps, markdownSanitizeSchema } from "./components/markdown.js";
73
+ import "./markdown.js";
74
+ import { SortableHandle, SortableHandleProps, SortableList, SortableListProps, SortableRenderState, SortableReorderDetails, arrayMove } from "./components/sortable-list.js";
75
+ import "./sortable-list.js";
76
+ export { type A2UIAction, type A2UIActionSpec, type A2UIBeginRendering, type A2UICatalogue, type A2UICatalogueDoc, type A2UICatalogueEntry, type A2UIChildList, type A2UIChildren, type A2UIColumn, type A2UIComponentDoc, type A2UIComponentSpec, type A2UICreateSurface, type A2UIDataBinding, type A2UIDeleteSurface, A2UIErrorCard, type A2UIExample, type A2UIFoldResult, type A2UIGroup, type A2UIMessage, type A2UIMessageInput, type A2UINodeInfo, type A2UIPropertyValue, A2UIRenderer, type A2UIRendererProps, type A2UIResolvedAction, type A2UIRow, type A2UISurface, type A2UITableSource, type A2UIUpdateComponents, type A2UIUpdateDataModel, type A2UIView, type A2UIViewProps, A2UI_CATALOGUE_ID, A2UI_DEFAULT_SURFACE_ID, A2UI_VERSION, type Accept, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertIcon, type AlertProps, AlertTitle, Area, AreaChart, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Bar, BarChart, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonLink, type ButtonLinkProps, type ButtonProps, Calendar, CalendarDayButton, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, CartesianGrid, Cell, Chart, type ChartConfig, ChartContainer, type ChartContainerProps, type ChartDataFor, type ChartDay, ChartEmpty, type ChartEngine, ChartError, type ChartLabels, ChartLegend, ChartLegendContent, type ChartLegendContentProps, ChartLoading, type ChartMatrix, type ChartPoint, type ChartProps, type ChartRenderer, type ChartRow, type ChartScale, type ChartScales, type ChartSeries, type ChartSlice, ChartTooltip, ChartTooltipContent, type ChartTooltipContentProps, type ChartTree, type ChartType, Checkbox, type CheckboxProps, Chip, type ChipProps, type ClientSource, type CodeRendererProps, Combobox, ComboboxChip, type ComboboxChipProps, ComboboxChips, type ComboboxChipsProps, ComboboxClear, ComboboxCollection, ComboboxContent, type ComboboxContentProps, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, type ComboboxInputProps, ComboboxItem, ComboboxSeparator, ComboboxStatus, ComboboxTrigger, ComboboxValue, Command, CommandDialog, type CommandDialogProps, CommandEmpty, CommandGroup, CommandInput, CommandItem, type CommandItemProps, CommandList, CommandLoading, CommandSeparator, CommandShortcut, ComposedChart, type CortenaTheme, type CortenaThemeMessage, DEFAULT_THEME_STORAGE_KEY, type DataSource, DataTable, type DataTableCell, type DataTableColumn, type DataTableColumnDef, DataTableColumnHeader, type DataTableColumnHeaderProps, type DataTableColumnMeta, type DataTableEditable, type DataTableEditingCell, DataTableExportMenu, type DataTableExportMenuProps, DataTableFacetedFilter, type DataTableFacetedFilterOption, type DataTableFacetedFilterProps, type DataTableFeatures, type DataTableInstance, DataTablePagination, type DataTablePaginationMode, type DataTablePaginationProps, type DataTableProps, type DataTableRow, type DataTableState, type DataTableTable, DataTableToolbar, type DataTableToolbarProps, DataTableView, DataTableViewOptions, type DataTableViewOptionsProps, type DataTableViewProps, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, Dropzone, type DropzoneProps, type DropzoneState, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ExportCell, type ExportSheet, Field, FieldContent, FieldControl, type FieldControlProps, FieldDescription, type FieldDescriptionProps, FieldError, type FieldErrorItem, type FieldErrorProps, FieldGroup, FieldLabel, type FieldLabelProps, type FieldProps, Fieldset, FieldsetLegend, type FieldsetLegendProps, type FieldsetProps, FileList, type FileListProps, type FileRejection, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, Funnel, FunnelChart, Input, type InputProps, type JsonSchema, Kbd, Label, LabelList, type LabelProps, Line, LineChart, LoadingSkeleton, type LoadingSkeletonPreset, type LoadingSkeletonProps, Markdown, type Components as MarkdownComponents, type MarkdownProps, NIVO_TYPES, type NivoTheme, PageHeader, type PageHeaderProps, Pie, PieChart, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Popover, PopoverClose, PopoverContent, type PopoverContentProps, PopoverDescription, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, type ProgressProps, ProgressTrack, ProgressValue, RECHARTS_TYPES, Radar, RadarChart, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, RechartsLegend, RechartsTooltip, ReferenceLine, type ResolvedCortenaTheme, ResponsiveContainer, Scatter, ScatterChart, ScrollArea, type ScrollAreaProps, ScrollBar, SectionCard, type SectionCardProps, Segmented, type SegmentedOption, type SegmentedProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, SelectLabel, type SelectProps, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, type SeparatorProps, type ServerSource, Sheet, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, type SheetProps, SheetTitle, SheetTrigger, Skeleton, SortableHandle, type SortableHandleProps, SortableList, type SortableListProps, type SortableRenderState, type SortableReorderDetails, Spinner, type SpinnerProps, StatusDot, type StatusDotProps, type StatusDotTone, type SubmitHandler, Switch, type SwitchProps, THEME_MESSAGE_TYPE, type TableQuery, type TableResult, Tabs, TabsContent, TabsIndicator, TabsList, TabsTrigger, Textarea, type TextareaProps, Toast, type ToastProps, Toaster, type ToasterProps, Toolbar, ToolbarEnd, type ToolbarProps, ToolbarSeparator, ToolbarStart, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, type UseCortenaThemeOptions, type UseCortenaThemeResult, type UseDataTableOptions, type UseFormFieldReturn, type UseFormReturn, VIZ_SERIES_COUNT, XAxis, YAxis, alertVariants, applyStoredTheme, applyTheme, arrayMove, badgeVariants, buildCatalogueDoc, buttonVariants, catalogueMarkdown, catalogueNames, chartEngine, chartScales, chipVariants, cn, createColumnHelper, dataTableFeatures, defaultCatalogue, downloadCsv, downloadExcel, exampleMessages, fieldVariants, foldMessages, formatDateDefault, formatDateISO, formatDateLong, formatDateShort, formatFileSize, formatRelative, getAtPointer, getThemeInitScript, inputClassName, isDataBinding, labelVariants, markdownSanitizeSchema, nivoTheme, parseA2UIMessages, parseDateDefault, parseDateISO, pointerSegments, readAction, readChildren, readComponent, readStoredTheme, resolveColor, resolvePointer, resolveValue, resolveVizSeries, seriesColor, setAtPointer, sheetVariants, textareaClassName, themeFromBackground, themeFromMessage, themeInitScript, toCsv, toHex, toSheet, toastVariants, useChart, useComboboxFilter, useCortenaTheme, useDataTable, useForm, useFormField, useNivoTheme, useToast, vizSeriesVars, vizVar, zodResolver };