@exponential_app/eui 0.0.0-stage → 0.2.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 (272) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +54 -0
  3. package/README.md +377 -2
  4. package/catalog/a11y.json +705 -0
  5. package/catalog/basic-map.json +104 -0
  6. package/catalog/code.json +58 -0
  7. package/catalog/core.catalog.json +5190 -0
  8. package/catalog/core.schema.json +24542 -0
  9. package/catalog/host.json +95 -0
  10. package/catalog/layout.json +20 -0
  11. package/catalog/limits.json +9 -0
  12. package/catalog/locale.json +48 -0
  13. package/catalog/macros.json +4152 -0
  14. package/catalog/recipes.json +64 -0
  15. package/catalog/strings.json +84 -0
  16. package/catalog/style.json +180 -0
  17. package/catalog/theme.schema.json +47754 -0
  18. package/catalog/tokens.json +47 -0
  19. package/conformance/README.md +218 -0
  20. package/conformance/baseline.ts +101 -0
  21. package/conformance/browser-page.ts +146 -0
  22. package/conformance/browser-suites.ts +699 -0
  23. package/conformance/compare.ts +201 -0
  24. package/conformance/dom.ts +97 -0
  25. package/conformance/dump.ts +163 -0
  26. package/conformance/fonts.json +157 -0
  27. package/conformance/manifest.json +233 -0
  28. package/conformance/parity-compare.ts +191 -0
  29. package/conformance/parity-report.schema.json +73 -0
  30. package/conformance/parity.ts +412 -0
  31. package/conformance/pixel.ts +177 -0
  32. package/conformance/primitives-page.ts +49 -0
  33. package/conformance/report.schema.json +66 -0
  34. package/conformance/run.ts +118 -0
  35. package/conformance/voice-wave-child.ts +102 -0
  36. package/dist/chunks/index-5fmaa0xq.js +8384 -0
  37. package/dist/chunks/index-5fmaa0xq.js.map +10 -0
  38. package/dist/chunks/index-62yzr94z.js +2784 -0
  39. package/dist/chunks/index-62yzr94z.js.map +10 -0
  40. package/dist/chunks/index-bg2jsgjq.js +8541 -0
  41. package/dist/chunks/index-bg2jsgjq.js.map +15 -0
  42. package/dist/chunks/index-fy7y2nz8.js +186 -0
  43. package/dist/chunks/index-fy7y2nz8.js.map +9 -0
  44. package/dist/chunks/index-gtk2gwsb.js +4555 -0
  45. package/dist/chunks/index-gtk2gwsb.js.map +31 -0
  46. package/dist/chunks/index-t6qz1770.js +95 -0
  47. package/dist/chunks/index-t6qz1770.js.map +11 -0
  48. package/dist/conformance.js +230462 -0
  49. package/dist/conformance.js.map +10 -0
  50. package/dist/entries/prompt.js +251 -0
  51. package/dist/entries/prompt.js.map +11 -0
  52. package/dist/entries/schema.js +1725 -0
  53. package/dist/entries/schema.js.map +11 -0
  54. package/dist/host/index.js +194 -0
  55. package/dist/host/index.js.map +9 -0
  56. package/dist/index.js +3840 -0
  57. package/dist/index.js.map +29 -0
  58. package/dist/types/src/a11y.d.ts +21 -0
  59. package/dist/types/src/animation.d.ts +76 -0
  60. package/dist/types/src/basic-map.d.ts +38 -0
  61. package/dist/types/src/builder.d.ts +50 -0
  62. package/dist/types/src/catalog.d.ts +54 -0
  63. package/dist/types/src/catalog.described.d.ts +33 -0
  64. package/dist/types/src/catalog.generated.d.ts +904 -0
  65. package/dist/types/src/chart.d.ts +46 -0
  66. package/dist/types/src/code.d.ts +44 -0
  67. package/dist/types/src/color.d.ts +20 -0
  68. package/dist/types/src/conformance.d.ts +39 -0
  69. package/dist/types/src/connector/app.d.ts +14 -0
  70. package/dist/types/src/connector/connector.d.ts +77 -0
  71. package/dist/types/src/connector/index.d.ts +4 -0
  72. package/dist/types/src/css.d.ts +27 -0
  73. package/dist/types/src/define.d.ts +66 -0
  74. package/dist/types/src/direction.d.ts +16 -0
  75. package/dist/types/src/dynamic.d.ts +161 -0
  76. package/dist/types/src/entries/prompt.d.ts +11 -0
  77. package/dist/types/src/entries/schema.d.ts +8 -0
  78. package/dist/types/src/expr.d.ts +71 -0
  79. package/dist/types/src/extension.d.ts +4 -0
  80. package/dist/types/src/format.d.ts +112 -0
  81. package/dist/types/src/geometry.d.ts +40 -0
  82. package/dist/types/src/host/contract.d.ts +225 -0
  83. package/dist/types/src/host/decoders.d.ts +61 -0
  84. package/dist/types/src/host/index.d.ts +15 -0
  85. package/dist/types/src/host/package.d.ts +102 -0
  86. package/dist/types/src/host/policy.d.ts +107 -0
  87. package/dist/types/src/host/record-store.d.ts +103 -0
  88. package/dist/types/src/host/records.d.ts +45 -0
  89. package/dist/types/src/host/router.d.ts +38 -0
  90. package/dist/types/src/host/runtime.d.ts +213 -0
  91. package/dist/types/src/host/signature.d.ts +52 -0
  92. package/dist/types/src/host/sources.d.ts +22 -0
  93. package/dist/types/src/host/tools.d.ts +42 -0
  94. package/dist/types/src/host/transports.d.ts +109 -0
  95. package/dist/types/src/index.d.ts +69 -0
  96. package/dist/types/src/layout.d.ts +20 -0
  97. package/dist/types/src/limits.d.ts +21 -0
  98. package/dist/types/src/list.d.ts +133 -0
  99. package/dist/types/src/locale.d.ts +22 -0
  100. package/dist/types/src/macros.d.ts +29 -0
  101. package/dist/types/src/overlay.d.ts +27 -0
  102. package/dist/types/src/prompt.d.ts +44 -0
  103. package/dist/types/src/qr-code.d.ts +30 -0
  104. package/dist/types/src/recipes.d.ts +17 -0
  105. package/dist/types/src/reducer.d.ts +41 -0
  106. package/dist/types/src/resizable.d.ts +38 -0
  107. package/dist/types/src/schema.d.ts +7 -0
  108. package/dist/types/src/strings.d.ts +13 -0
  109. package/dist/types/src/style.d.ts +201 -0
  110. package/dist/types/src/test-preload.d.ts +1 -0
  111. package/dist/types/src/text-shimmer.d.ts +24 -0
  112. package/dist/types/src/theme-types.d.ts +162 -0
  113. package/dist/types/src/theme.d.ts +75 -0
  114. package/dist/types/src/themes.d.ts +22 -0
  115. package/dist/types/src/tree-guides.d.ts +17 -0
  116. package/dist/types/src/types.d.ts +320 -0
  117. package/dist/types/src/validate.d.ts +31 -0
  118. package/dist/types/src/voice-wave.d.ts +181 -0
  119. package/dist/types/src/web/base-css.d.ts +1 -0
  120. package/dist/types/src/web/box-css.d.ts +63 -0
  121. package/dist/types/src/web/coerce.d.ts +32 -0
  122. package/dist/types/src/web/custom-icons.generated.d.ts +4 -0
  123. package/dist/types/src/web/data.d.ts +107 -0
  124. package/dist/types/src/web/dates.d.ts +12 -0
  125. package/dist/types/src/web/form.d.ts +44 -0
  126. package/dist/types/src/web/host-types.d.ts +126 -0
  127. package/dist/types/src/web/index.d.ts +35 -0
  128. package/dist/types/src/web/inputs.d.ts +55 -0
  129. package/dist/types/src/web/list.d.ts +16 -0
  130. package/dist/types/src/web/listbox.d.ts +14 -0
  131. package/dist/types/src/web/markdown.d.ts +96 -0
  132. package/dist/types/src/web/media.d.ts +63 -0
  133. package/dist/types/src/web/parts.d.ts +4 -0
  134. package/dist/types/src/web/primitives/alert-dialog.d.ts +10 -0
  135. package/dist/types/src/web/primitives/alert.d.ts +9 -0
  136. package/dist/types/src/web/primitives/avatar-color.d.ts +2 -0
  137. package/dist/types/src/web/primitives/avatar.d.ts +13 -0
  138. package/dist/types/src/web/primitives/badge.d.ts +10 -0
  139. package/dist/types/src/web/primitives/breadcrumb.d.ts +10 -0
  140. package/dist/types/src/web/primitives/button.d.ts +6 -0
  141. package/dist/types/src/web/primitives/calendar.d.ts +43 -0
  142. package/dist/types/src/web/primitives/card.d.ts +9 -0
  143. package/dist/types/src/web/primitives/checkbox.d.ts +5 -0
  144. package/dist/types/src/web/primitives/choice-tiles.d.ts +32 -0
  145. package/dist/types/src/web/primitives/cn.d.ts +3 -0
  146. package/dist/types/src/web/primitives/code-block.d.ts +24 -0
  147. package/dist/types/src/web/primitives/command.d.ts +134 -0
  148. package/dist/types/src/web/primitives/context-ring.d.ts +24 -0
  149. package/dist/types/src/web/primitives/dialog-arms.d.ts +6 -0
  150. package/dist/types/src/web/primitives/dialog.d.ts +24 -0
  151. package/dist/types/src/web/primitives/disclosure-header.d.ts +5 -0
  152. package/dist/types/src/web/primitives/dock.d.ts +42 -0
  153. package/dist/types/src/web/primitives/dropdown-menu.d.ts +14 -0
  154. package/dist/types/src/web/primitives/empty-state.d.ts +15 -0
  155. package/dist/types/src/web/primitives/glass-card.d.ts +4 -0
  156. package/dist/types/src/web/primitives/hover-card.d.ts +7 -0
  157. package/dist/types/src/web/primitives/icon-disc.d.ts +12 -0
  158. package/dist/types/src/web/primitives/index.d.ts +50 -0
  159. package/dist/types/src/web/primitives/input.d.ts +5 -0
  160. package/dist/types/src/web/primitives/kbd.d.ts +4 -0
  161. package/dist/types/src/web/primitives/label.d.ts +3 -0
  162. package/dist/types/src/web/primitives/measure.d.ts +16 -0
  163. package/dist/types/src/web/primitives/menu-surface.d.ts +17 -0
  164. package/dist/types/src/web/primitives/meter.d.ts +21 -0
  165. package/dist/types/src/web/primitives/popover.d.ts +3 -0
  166. package/dist/types/src/web/primitives/progress-ring.d.ts +5 -0
  167. package/dist/types/src/web/primitives/progress.d.ts +8 -0
  168. package/dist/types/src/web/primitives/scroll-area.d.ts +49 -0
  169. package/dist/types/src/web/primitives/segmented-control.d.ts +5 -0
  170. package/dist/types/src/web/primitives/select.d.ts +47 -0
  171. package/dist/types/src/web/primitives/separator.d.ts +3 -0
  172. package/dist/types/src/web/primitives/sheet-chrome.d.ts +4 -0
  173. package/dist/types/src/web/primitives/sheet.d.ts +20 -0
  174. package/dist/types/src/web/primitives/skeleton.d.ts +3 -0
  175. package/dist/types/src/web/primitives/spinner.d.ts +3 -0
  176. package/dist/types/src/web/primitives/switch.d.ts +4 -0
  177. package/dist/types/src/web/primitives/table.d.ts +11 -0
  178. package/dist/types/src/web/primitives/tabs.d.ts +13 -0
  179. package/dist/types/src/web/primitives/textarea.d.ts +3 -0
  180. package/dist/types/src/web/primitives/toast.d.ts +163 -0
  181. package/dist/types/src/web/primitives/tooltip.d.ts +3 -0
  182. package/dist/types/src/web/primitives/truncate.d.ts +7 -0
  183. package/dist/types/src/web/primitives/typeahead-portal.d.ts +12 -0
  184. package/dist/types/src/web/primitives/voice-wave.d.ts +50 -0
  185. package/dist/types/src/web/round5.d.ts +107 -0
  186. package/dist/types/src/web/share.d.ts +6 -0
  187. package/dist/types/src/web/table.d.ts +20 -0
  188. package/dist/types/src/web/theme-css.d.ts +69 -0
  189. package/dist/types/src/web/urls.d.ts +21 -0
  190. package/dist/web/index.js +2565 -0
  191. package/dist/web/index.js.map +28 -0
  192. package/dist/web/primitives/index.js +1476 -0
  193. package/dist/web/primitives/index.js.map +57 -0
  194. package/docs/components.generated.json +6783 -0
  195. package/docs/package-format.md +182 -0
  196. package/docs/round-1-contract.md +679 -0
  197. package/docs/round-2-contract.md +476 -0
  198. package/docs/round-3-contract.md +174 -0
  199. package/docs/round-5-contract.md +268 -0
  200. package/docs/themes.generated.json +3647 -0
  201. package/fixtures/animations.json +2890 -0
  202. package/fixtures/bench-list.json +58 -0
  203. package/fixtures/bind-time.json +54734 -0
  204. package/fixtures/catalog-basic-map.json +1692 -0
  205. package/fixtures/catalog-components.json +10293 -0
  206. package/fixtures/catalog-extension.json +620 -0
  207. package/fixtures/catalog-macros.json +51805 -0
  208. package/fixtures/code-tokens.json +1993 -0
  209. package/fixtures/conformance-baseline.json +59016 -0
  210. package/fixtures/conformance-cases.json +49 -0
  211. package/fixtures/conformance-known.json +2111 -0
  212. package/fixtures/control-geometry.json +5129 -0
  213. package/fixtures/dashboard.data.json +74 -0
  214. package/fixtures/dashboard.json +781 -0
  215. package/fixtures/demo-surface.json +47 -0
  216. package/fixtures/format.json +870 -0
  217. package/fixtures/host-package.json +1262 -0
  218. package/fixtures/host-policy.json +1209 -0
  219. package/fixtures/host-router.json +2034 -0
  220. package/fixtures/host-transport.json +590 -0
  221. package/fixtures/interactions-round1.json +1058 -0
  222. package/fixtures/kitchen-sink.expanded.json +11972 -0
  223. package/fixtures/kitchen-sink.json +3140 -0
  224. package/fixtures/layout-geometry-round1.json +7278 -0
  225. package/fixtures/layout-geometry.json +2072 -0
  226. package/fixtures/overlay-geometry.json +272 -0
  227. package/fixtures/pointer.json +89 -0
  228. package/fixtures/primitive-specimens.json +59 -0
  229. package/fixtures/prompt-budget.json +33 -0
  230. package/fixtures/qr-code.json +480 -0
  231. package/fixtures/resizable.json +714 -0
  232. package/fixtures/round4-contract.json +2985 -0
  233. package/fixtures/specimens.json +11168 -0
  234. package/fixtures/style-conditions.json +336 -0
  235. package/fixtures/template-items.json +2215 -0
  236. package/fixtures/text-direction.json +309 -0
  237. package/fixtures/text-shimmer.json +96 -0
  238. package/fixtures/theme-extends.json +573 -0
  239. package/fixtures/theme-invalid.json +1300 -0
  240. package/fixtures/theme-recipes.json +61762 -0
  241. package/fixtures/theme-resolved.json +25969 -0
  242. package/fixtures/toast-stack.json +215 -0
  243. package/fixtures/tree-guides.json +224 -0
  244. package/fixtures/virtual-list.json +733 -0
  245. package/fixtures/voice-wave.json +19236 -0
  246. package/generated/ExponentialUICatalog.generated.kt +67 -0
  247. package/generated/ExponentialUICatalog.generated.swift +67 -0
  248. package/generated/ExponentialUIThemes.generated.kt +23 -0
  249. package/generated/ExponentialUIThemes.generated.swift +23 -0
  250. package/generated/catalog.descriptions.generated.rs +6 -0
  251. package/generated/catalog.generated.rs +80 -0
  252. package/generated/catalog.themes.generated.rs +34 -0
  253. package/generated/core.descriptions.json +2726 -0
  254. package/generated/core.runtime.json +3944 -0
  255. package/package.json +87 -4
  256. package/themes/exponential.recipes.json +49 -0
  257. package/themes/exponential.theme.json +768 -0
  258. package/themes/neutral.theme.json +6178 -0
  259. package/themes/orange.theme.json +43 -0
  260. package/themes/playful.theme.json +219 -0
  261. package/vendor/a2ui/LICENSE.txt +203 -0
  262. package/vendor/a2ui/README.md +27 -0
  263. package/vendor/a2ui/v0_9/basic_catalog.json +1387 -0
  264. package/vendor/a2ui/v0_9/basic_catalog_rules.txt +5 -0
  265. package/vendor/a2ui/v0_9/client_capabilities.json +97 -0
  266. package/vendor/a2ui/v0_9/client_to_server.json +104 -0
  267. package/vendor/a2ui/v0_9/common_types.json +315 -0
  268. package/vendor/a2ui/v0_9/server_to_client.json +132 -0
  269. package/vendor/json-render/LICENSE.txt +201 -0
  270. package/vendor/json-render/README.md +13 -0
  271. package/vendor/nayuki-qr/LICENSE.txt +20 -0
  272. package/vendor/nayuki-qr/README.md +10 -0
@@ -0,0 +1,76 @@
1
+ import type { Easing, ResolvedTheme } from "./theme-types.js";
2
+ export interface Keyframe {
3
+ offset: number;
4
+ opacity?: number;
5
+ translateX?: number;
6
+ translateY?: number;
7
+ rotate?: number;
8
+ scale?: number;
9
+ band?: number;
10
+ }
11
+ export interface AnimationDef {
12
+ duration: string;
13
+ factor: number;
14
+ easing: string;
15
+ iterations: number | `infinite`;
16
+ rest: number;
17
+ keyframes: Keyframe[];
18
+ band?: {
19
+ color: string;
20
+ stops: {
21
+ offset: number;
22
+ alpha: number;
23
+ }[];
24
+ };
25
+ }
26
+ /** The keyframe sets by name (style.json `animations`, `$comment` aside). */
27
+ export declare const ANIMATIONS: Readonly<Record<string, AnimationDef>>;
28
+ export declare const ANIMATION_NAMES: readonly string[];
29
+ /** One frame: every channel at its value (`band` null = no shimmer band). */
30
+ export interface AnimationFrame {
31
+ opacity: number;
32
+ translateX: number;
33
+ translateY: number;
34
+ rotate: number;
35
+ scale: number;
36
+ band: number | null;
37
+ }
38
+ export interface AnimationTiming {
39
+ durationMs: number;
40
+ /** A cubic bezier or `linear`. */
41
+ easing: Easing | `linear`;
42
+ iterations: number | `infinite`;
43
+ }
44
+ /** Duration and easing of an animation under a theme: the `duration` token
45
+ * (or `durationToken`, the node's `animationDuration`) × `factor`. */
46
+ export declare function animationTiming(name: string, theme: ResolvedTheme, durationToken?: string): AnimationTiming | null;
47
+ /** y of a CSS cubic-bezier at x (bisection on x, 60 steps: deterministic). */
48
+ export declare function cubicBezier(curve: Easing, x: number): number;
49
+ /** The frame `elapsedMs` after the node entered the tree. Finished finite
50
+ * animations hold their last keyframe; reduced motion = the `rest`
51
+ * keyframe (no band). */
52
+ export declare function animationFrame(name: string, elapsedMs: number, theme: ResolvedTheme, options?: {
53
+ reducedMotion?: boolean;
54
+ durationToken?: string;
55
+ }): AnimationFrame | null;
56
+ /** What a painter shows: the node's own opacity × the frame's (an
57
+ * animation MULTIPLIES opacity; it never replaces it). */
58
+ export declare function paintedOpacity(own: number | undefined, frame: AnimationFrame | null): number;
59
+ /** The custom properties the keyframes animate, registered so they
60
+ * interpolate: `--xui-a-opacity` (the animation's opacity factor; the node's
61
+ * `opacity` = own × it, see css.ts styleToCss) and `--xui-band` (the shimmer
62
+ * band). A CSS renderer adds this ONCE per document beside the keyframes. */
63
+ export declare const ANIMATION_PROPERTIES_CSS = "@property --xui-a-opacity{syntax:\"<number>\";inherits:false;initial-value:1}@property --xui-band{syntax:\"<number>\";inherits:true;initial-value:1}";
64
+ /** Whether a keyframe set animates opacity (its node's CSS opacity then
65
+ * multiplies `--xui-a-opacity`). */
66
+ export declare function animatesOpacity(name: string): boolean;
67
+ /** The CSS `@keyframes xui-<name>` rule (individual `translate`/`rotate`/
68
+ * `scale` properties compose OUTSIDE the node's own `transform`; opacity
69
+ * moves `--xui-a-opacity`, which the node's `opacity` multiplies, so the
70
+ * author's opacity survives the `both` fill; the shimmer band moves
71
+ * `--xui-band`, which the renderer's overlay reads). Needs
72
+ * `ANIMATION_PROPERTIES_CSS`. */
73
+ export declare function keyframesCss(name: string): string;
74
+ /** The CSS `animation` shorthand for a resolved timing (per-segment easing
75
+ * is CSS's own semantics). */
76
+ export declare function animationCss(name: string, timing: AnimationTiming): string;
@@ -0,0 +1,38 @@
1
+ import type { Action, ChildTemplate, FlatComponent } from "./types.js";
2
+ interface PropRule {
3
+ from?: string;
4
+ map?: Record<string, unknown>;
5
+ default?: unknown;
6
+ const?: unknown;
7
+ }
8
+ interface ComponentRule {
9
+ to: string;
10
+ props: Record<string, string | PropRule>;
11
+ children?: `children` | `child`;
12
+ transform?: string;
13
+ }
14
+ export declare const basicMap: {
15
+ from: string;
16
+ to: string;
17
+ version: string;
18
+ placeholderIcon: string;
19
+ components: Record<string, ComponentRule>;
20
+ transforms: Record<string, string>;
21
+ icons: Record<string, string | null>;
22
+ functions: Record<string, string>;
23
+ };
24
+ /** What a basic component becomes before the reducer nests its children. */
25
+ export interface MappedComponent {
26
+ component: string;
27
+ props: Record<string, unknown>;
28
+ childrenIds: string[];
29
+ template?: ChildTemplate;
30
+ slots: Record<string, string>;
31
+ on?: Record<string, Action>;
32
+ style?: Record<string, unknown>;
33
+ }
34
+ export declare function mapBasicIcon(name: unknown): string;
35
+ /** Map one basic component; `null` when the table has no row (→ Unknown). */
36
+ export declare function mapBasicComponent(flat: FlatComponent, lookup: (id: string) => FlatComponent | undefined): MappedComponent | null;
37
+ export declare const BASIC_TRANSFORM_NAMES: readonly string[];
38
+ export {};
@@ -0,0 +1,50 @@
1
+ import type { ModeName, ResolvedTheme, Shadow, ThemeIssue, ThemeSource } from "./theme-types.js";
2
+ /** shadcn / tweakcn variable → theme colour name. */
3
+ export declare const SHADCN_COLOR_VARS: Record<string, string>;
4
+ export interface ThemeImport {
5
+ modes: Partial<Record<ModeName, {
6
+ color: Record<string, `#${string}`>;
7
+ shadow?: Record<string, Shadow[]>;
8
+ }>>;
9
+ tokens: {
10
+ radius?: Record<string, number>;
11
+ type?: {
12
+ family?: Record<string, string>;
13
+ };
14
+ };
15
+ fonts: Record<string, {
16
+ fallback?: string;
17
+ source: `host`;
18
+ }>;
19
+ /** Variables the importer did not understand (`--sidebar`, `var()` refs…). */
20
+ unmapped: string[];
21
+ }
22
+ /** `0 1px 2px 0 hsl(0 0% 0% / 0.05), …` → layers; null when not parseable. */
23
+ export declare function parseShadow(value: string): Shadow[] | null;
24
+ /** A shadcn `globals.css` (v4 oklch, v3 bare-HSL triplets) or a tweakcn
25
+ * export → the colours per mode, the radius ladder, the families and the
26
+ * shadows it carried. Everything else is listed under `unmapped`. */
27
+ export declare function importShadcnCss(css: string): ThemeImport;
28
+ /** The import as a theme file. With a `base` it becomes an `extends` theme
29
+ * carrying only what the CSS said; without one it is a root and the
30
+ * caller fills the rest (the builder starts from a built-in anyway). */
31
+ export declare function themeFromImport(imp: ThemeImport, meta: {
32
+ id: string;
33
+ name: string;
34
+ extends?: string;
35
+ }): ThemeSource;
36
+ /** The smallest theme that, extending `base`, resolves to `full`: only the
37
+ * values that differ. Recipes pass through as the draft's own rules (they
38
+ * are already overrides). */
39
+ export declare function diffTheme(full: ResolvedTheme | ThemeSource, base: ResolvedTheme, meta?: {
40
+ id?: string;
41
+ name?: string;
42
+ }): ThemeSource;
43
+ /** Pretty JSON with `$schema` first, the export the builder downloads. */
44
+ export declare function exportThemeJson(theme: ThemeSource): string;
45
+ /** `JSON.parse` + load, never throwing: the builder's "paste a theme" path. */
46
+ export declare function parseThemeJson(text: string, themes: readonly (ThemeSource | ResolvedTheme)[]): {
47
+ theme: ResolvedTheme | null;
48
+ source: ThemeSource | null;
49
+ issues: ThemeIssue[];
50
+ };
@@ -0,0 +1,54 @@
1
+ import type { CatalogSource, ComponentDef, DefSchema, ExtensionDef, MacroDef } from "./types.js";
2
+ /** The runtime catalog: no descriptions or examples until `describeCatalog()`
3
+ * (src/catalog.described.ts; the `./prompt` and `./schema` entries) attaches them. */
4
+ export declare const coreCatalog: CatalogSource;
5
+ /** `https://ui.exponential.at/catalogs/core/v1` */
6
+ export declare const CORE_CATALOG_ID: string;
7
+ /** The prompt-sized subset: the app-shaped vocabulary (no overlays, media,
8
+ * Chart, data tables or the rarer controls). A lite surface is a valid core
9
+ * surface, so it is a second id over the same definitions. */
10
+ export declare const CORE_LITE_CATALOG_ID: string;
11
+ /** The vendored A2UI basic catalog (vendor/a2ui/v0_9). */
12
+ export declare const A2UI_BASIC_CATALOG_ID: string;
13
+ /** The A2UI wire `version` the vendored schemas carry. */
14
+ export declare const A2UI_VERSION: string;
15
+ /** What a client sends as `supportedCatalogIds`. */
16
+ export declare const SUPPORTED_CATALOG_IDS: readonly string[];
17
+ export declare const UNKNOWN_COMPONENT: string;
18
+ export declare const coreMacros: Record<string, MacroDef>;
19
+ /** Token groups → names, flattened (`type.size`, not a nested object), so a
20
+ * reference `$<group>.<name>` resolves by one lookup. */
21
+ export declare const TOKEN_GROUPS: Record<string, readonly string[]>;
22
+ /** `$spacing.md` → `{ group: "spacing", name: "md" }`, or null when it is not
23
+ * a well-formed reference. */
24
+ export declare function parseTokenRef(value: unknown): {
25
+ group: string;
26
+ name: string;
27
+ } | null;
28
+ /** True when the reference names a token group AND a name in it. */
29
+ export declare function isKnownToken(value: unknown): boolean;
30
+ export interface CatalogView {
31
+ components: Record<string, ComponentDef>;
32
+ enums: Record<string, readonly string[]>;
33
+ defs: Record<string, DefSchema>;
34
+ macros: Record<string, MacroDef>;
35
+ }
36
+ /** The core merged with the given extensions. Extension names never shadow a
37
+ * core name (defineExtension refuses that), so a plain spread is exact. */
38
+ export declare function catalogView(extensions?: readonly ExtensionDef[]): CatalogView;
39
+ /** `catalogView`, built once per extension list and SHARED (VAPP-152: the
40
+ * reducer and the macro expander asked for a fresh copy of every table on
41
+ * each streamed `updateComponents`). Read-only; an empty list is the
42
+ * core's. */
43
+ export declare function sharedCatalogView(extensions?: readonly ExtensionDef[]): CatalogView;
44
+ export declare function componentDef(name: string, extensions?: readonly ExtensionDef[]): ComponentDef | undefined;
45
+ /** True for a component a model is offered: anything but the hidden
46
+ * placeholder. */
47
+ export declare function isOffered(def: ComponentDef): boolean;
48
+ /** Component names in source order, optionally the lite subset, never the
49
+ * hidden placeholder. */
50
+ export declare function componentNames(options?: {
51
+ lite?: boolean;
52
+ }): string[];
53
+ /** The lite subset's names. */
54
+ export declare function coreLite(): string[];
@@ -0,0 +1,33 @@
1
+ import type { CatalogSource } from "./types.js";
2
+ /** The text a prop schema carries (recursing into `items`). */
3
+ export interface PropDescription {
4
+ description?: string;
5
+ items?: PropDescription;
6
+ }
7
+ /** The text of the catalog, keyed like the catalog itself. */
8
+ export interface CatalogDescriptions {
9
+ components: Record<string, {
10
+ description?: string;
11
+ example?: Record<string, unknown>;
12
+ props: Record<string, PropDescription>;
13
+ }>;
14
+ defs: Record<string, {
15
+ description?: string;
16
+ properties: Record<string, PropDescription>;
17
+ }>;
18
+ functions: {
19
+ core: Record<string, string>;
20
+ basic: Record<string, string>;
21
+ };
22
+ }
23
+ /** The source catalog split into what the runtime needs and the text only
24
+ * the prompt, the schema and the docs read. Pure: the source stays as it is. */
25
+ export declare function splitDescriptions(source: CatalogSource): {
26
+ runtime: CatalogSource;
27
+ descriptions: CatalogDescriptions;
28
+ };
29
+ /** Puts the text back onto a runtime catalog, in place. */
30
+ export declare function applyDescriptions(target: CatalogSource, descriptions: CatalogDescriptions): void;
31
+ /** `coreCatalog` with its descriptions and examples attached (once per
32
+ * process); what the prompt, the schema emitter and the docs read. */
33
+ export declare function describeCatalog(): CatalogSource;