@yahoo/uds-create-config 2.45.0 → 3.0.1

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 (376) hide show
  1. package/README.md +129 -0
  2. package/dist/ai-lanes.d.ts +23 -0
  3. package/dist/ai-lanes.js +34 -0
  4. package/dist/authoring/define-component.d.ts +85 -0
  5. package/dist/configs/CanvasConfig.d.ts +3237 -0
  6. package/dist/configs/CanvasConfig.js +332 -0
  7. package/dist/configs/build-options.d.ts +10 -0
  8. package/dist/configs/build-options.js +68 -0
  9. package/dist/configs/platform.d.ts +15 -0
  10. package/dist/configs/platform.js +17 -0
  11. package/dist/configs/react-native-system.d.ts +3026 -0
  12. package/dist/configs/react-native-system.js +64 -0
  13. package/dist/configs/system.d.ts +2771 -0
  14. package/dist/configs/system.js +74 -0
  15. package/dist/css/properties.generated.d.ts +14 -0
  16. package/dist/css/properties.generated.js +6260 -0
  17. package/dist/css/value-type.d.ts +48 -0
  18. package/dist/css/value-type.js +131 -0
  19. package/dist/css/values.d.ts +33 -0
  20. package/dist/css/values.js +116 -0
  21. package/dist/entities/native/NativeModifier.d.ts +25 -0
  22. package/dist/entities/native/NativeModifier.js +41 -0
  23. package/dist/entities/native/NativeSettings.d.ts +44 -0
  24. package/dist/entities/native/NativeSettings.js +39 -0
  25. package/dist/entities/native/NativeStyleProperty.d.ts +355 -0
  26. package/dist/entities/native/NativeStyleProperty.js +28 -0
  27. package/dist/entities/native/NativeToken.d.ts +31 -0
  28. package/dist/entities/native/NativeToken.js +49 -0
  29. package/dist/entities/system/CanvasRole.d.ts +34 -0
  30. package/dist/entities/system/CanvasRole.js +45 -0
  31. package/dist/entities/system/Component.d.ts +1287 -0
  32. package/dist/entities/system/Component.js +1840 -0
  33. package/dist/entities/system/Composite.d.ts +12 -0
  34. package/dist/entities/system/Composite.js +26 -0
  35. package/dist/entities/system/Device.d.ts +11 -0
  36. package/dist/entities/system/Device.js +18 -0
  37. package/dist/entities/system/File.d.ts +72 -0
  38. package/dist/entities/system/File.js +136 -0
  39. package/dist/entities/system/Font.d.ts +48 -0
  40. package/dist/entities/system/Font.js +56 -0
  41. package/dist/entities/system/GlobalStyle.d.ts +26 -0
  42. package/dist/entities/system/GlobalStyle.js +54 -0
  43. package/dist/entities/system/Guidance.d.ts +85 -0
  44. package/dist/entities/system/Guidance.js +59 -0
  45. package/dist/entities/system/GuidanceStyle.d.ts +14 -0
  46. package/dist/entities/system/GuidanceStyle.js +8 -0
  47. package/dist/entities/system/Icon.d.ts +46 -0
  48. package/dist/entities/system/Icon.js +46 -0
  49. package/dist/entities/system/LinkedSystem.d.ts +504 -0
  50. package/dist/entities/system/LinkedSystem.js +814 -0
  51. package/dist/entities/system/Modifier.d.ts +92 -0
  52. package/dist/entities/system/Modifier.js +120 -0
  53. package/dist/entities/system/Motion.d.ts +28 -0
  54. package/dist/entities/system/Motion.js +48 -0
  55. package/dist/entities/system/Operation.d.ts +100 -0
  56. package/dist/entities/system/Operation.js +236 -0
  57. package/dist/entities/system/Package.d.ts +42 -0
  58. package/dist/entities/system/Package.js +75 -0
  59. package/dist/entities/system/Settings.d.ts +94 -0
  60. package/dist/entities/system/Settings.js +166 -0
  61. package/dist/entities/system/StyleProperty.d.ts +135 -0
  62. package/dist/entities/system/StyleProperty.js +438 -0
  63. package/dist/entities/system/Token.d.ts +67 -0
  64. package/dist/entities/system/Token.js +129 -0
  65. package/dist/entities/system/Tool.d.ts +134 -0
  66. package/dist/entities/system/Tool.js +124 -0
  67. package/dist/entities/system/color.d.ts +64 -0
  68. package/dist/entities/system/color.js +123 -0
  69. package/dist/entities/system/component-module.d.ts +63 -0
  70. package/dist/entities/system/component-module.js +258 -0
  71. package/dist/entities/system/copy-plan.d.ts +98 -0
  72. package/dist/entities/system/copy-plan.js +451 -0
  73. package/dist/entities/system/defineComponent.d.ts +428 -0
  74. package/dist/entities/system/defineComponent.js +337 -0
  75. package/dist/entities/system/element.d.ts +101 -0
  76. package/dist/entities/system/element.js +171 -0
  77. package/dist/entities/system/icon-library.d.ts +64 -0
  78. package/dist/entities/system/icon-library.js +112 -0
  79. package/dist/entities/system/icon-metadata.d.ts +72 -0
  80. package/dist/entities/system/icon-metadata.js +111 -0
  81. package/dist/entities/system/link-declaration.d.ts +27 -0
  82. package/dist/entities/system/link-declaration.js +64 -0
  83. package/dist/entities/system/link-plan.d.ts +160 -0
  84. package/dist/entities/system/link-plan.js +770 -0
  85. package/dist/entities/system/runtime-modules.d.ts +25 -0
  86. package/dist/entities/system/runtime-modules.js +38 -0
  87. package/dist/entities/system/style-bag.d.ts +20 -0
  88. package/dist/entities/system/style-bag.js +246 -0
  89. package/dist/entities/system/token-index.d.ts +89 -0
  90. package/dist/entities/system/token-index.js +112 -0
  91. package/dist/framework/Config.d.ts +2472 -0
  92. package/dist/framework/Config.js +5023 -0
  93. package/dist/framework/Entity.d.ts +127 -0
  94. package/dist/framework/Entity.js +125 -0
  95. package/dist/framework/authoring.d.ts +24 -0
  96. package/dist/framework/authoring.js +7 -0
  97. package/dist/framework/change-hooks.d.ts +119 -0
  98. package/dist/framework/change-hooks.js +131 -0
  99. package/dist/framework/changes.d.ts +88 -0
  100. package/dist/framework/changes.js +246 -0
  101. package/dist/framework/class-names.d.ts +260 -0
  102. package/dist/framework/class-names.js +630 -0
  103. package/dist/framework/coalesce.d.ts +25 -0
  104. package/dist/framework/coalesce.js +60 -0
  105. package/dist/framework/config-op.d.ts +76 -0
  106. package/dist/framework/config-op.js +43 -0
  107. package/dist/framework/config-operation-kind.d.ts +14 -0
  108. package/dist/framework/config-operation-kind.js +14 -0
  109. package/dist/framework/config-ops.d.ts +34 -0
  110. package/dist/framework/config-ops.js +187 -0
  111. package/dist/framework/defineConfig.d.ts +196 -0
  112. package/dist/framework/defineConfig.js +100 -0
  113. package/dist/framework/defineDerivedEntity.d.ts +74 -0
  114. package/dist/framework/defineDerivedEntity.js +83 -0
  115. package/dist/framework/defineEntity.d.ts +318 -0
  116. package/dist/framework/defineEntity.js +183 -0
  117. package/dist/framework/defineSubEntity.d.ts +148 -0
  118. package/dist/framework/defineSubEntity.js +121 -0
  119. package/dist/framework/derived-mutations.d.ts +20 -0
  120. package/dist/framework/derived-mutations.js +38 -0
  121. package/dist/framework/entity-search.d.ts +29 -0
  122. package/dist/framework/entity-search.js +117 -0
  123. package/dist/framework/inline-sources.d.ts +49 -0
  124. package/dist/framework/inline-sources.js +388 -0
  125. package/dist/framework/layer-styles.d.ts +25 -0
  126. package/dist/framework/layer-styles.js +49 -0
  127. package/dist/framework/memo.d.ts +48 -0
  128. package/dist/framework/memo.js +84 -0
  129. package/dist/framework/overlay.d.ts +49 -0
  130. package/dist/framework/overlay.js +17 -0
  131. package/dist/framework/plan.d.ts +49 -0
  132. package/dist/framework/plan.js +73 -0
  133. package/dist/framework/projections.d.ts +480 -0
  134. package/dist/framework/projections.js +974 -0
  135. package/dist/framework/prop-surface.d.ts +132 -0
  136. package/dist/framework/prop-surface.js +278 -0
  137. package/dist/framework/ref-graph.d.ts +71 -0
  138. package/dist/framework/ref-graph.js +158 -0
  139. package/dist/framework/ref-integrity.d.ts +55 -0
  140. package/dist/framework/ref-integrity.js +171 -0
  141. package/dist/framework/registered.d.ts +95 -0
  142. package/dist/framework/registry-dir.d.ts +42 -0
  143. package/dist/framework/registry-dir.js +48 -0
  144. package/dist/framework/registry.d.ts +300 -0
  145. package/dist/framework/registry.js +104 -0
  146. package/dist/framework/rejection.d.ts +58 -0
  147. package/dist/framework/rejection.js +111 -0
  148. package/dist/framework/rename-inference.d.ts +26 -0
  149. package/dist/framework/rename-inference.js +50 -0
  150. package/dist/framework/render-spec.d.ts +296 -0
  151. package/dist/framework/render-spec.js +809 -0
  152. package/dist/framework/schema-version.d.ts +140 -0
  153. package/dist/framework/schema-version.js +214 -0
  154. package/dist/framework/schemas.d.ts +109 -0
  155. package/dist/framework/schemas.js +615 -0
  156. package/dist/framework/session.d.ts +196 -0
  157. package/dist/framework/session.js +367 -0
  158. package/dist/framework/signature.d.ts +15 -0
  159. package/dist/framework/signature.js +83 -0
  160. package/dist/framework/snapshot.d.ts +115 -0
  161. package/dist/framework/snapshot.js +277 -0
  162. package/dist/framework/source-integrity.d.ts +226 -0
  163. package/dist/framework/source-integrity.js +478 -0
  164. package/dist/framework/sources.d.ts +211 -0
  165. package/dist/framework/sources.js +89 -0
  166. package/dist/framework/utils/compiled-schema.d.ts +23 -0
  167. package/dist/framework/utils/compiled-schema.js +46 -0
  168. package/dist/framework/utils/content-key.d.ts +15 -0
  169. package/dist/framework/utils/content-key.js +33 -0
  170. package/dist/framework/utils/enumerated.d.ts +13 -0
  171. package/dist/framework/utils/enumerated.js +19 -0
  172. package/dist/framework/utils/field-path.d.ts +95 -0
  173. package/dist/framework/utils/field-path.js +136 -0
  174. package/dist/framework/utils/field-schema.d.ts +55 -0
  175. package/dist/framework/utils/field-schema.js +183 -0
  176. package/dist/framework/utils/group.d.ts +37 -0
  177. package/dist/framework/utils/group.js +13 -0
  178. package/dist/framework/utils/package-path.d.ts +37 -0
  179. package/dist/framework/utils/package-path.js +61 -0
  180. package/dist/framework/utils/refs.d.ts +194 -0
  181. package/dist/framework/utils/refs.js +403 -0
  182. package/dist/framework/validate-spec.d.ts +27 -0
  183. package/dist/framework/validate-spec.js +45 -0
  184. package/dist/framework/value-domain.d.ts +26 -0
  185. package/dist/framework/value-domain.js +202 -0
  186. package/dist/framework/views-facade.d.ts +15 -0
  187. package/dist/framework/views-facade.js +19 -0
  188. package/dist/index.d.ts +90 -42
  189. package/dist/index.js +86 -37
  190. package/dist/migrations/2.0.0/raw-css.d.ts +11 -0
  191. package/dist/migrations/2.0.0/raw-css.js +72 -0
  192. package/dist/migrations/2.0.0/v1-artifact.d.ts +1559 -0
  193. package/dist/migrations/2.0.0/v1-artifact.js +1018 -0
  194. package/dist/migrations/20260908171448_settings_as_kind.d.ts +22 -0
  195. package/dist/migrations/20260908171448_settings_as_kind.js +89 -0
  196. package/dist/migrations/20260908194245_visible_state_pointer.d.ts +19 -0
  197. package/dist/migrations/20260908194245_visible_state_pointer.js +115 -0
  198. package/dist/migrations/20260909183001_icon_knockout_variants.d.ts +18 -0
  199. package/dist/migrations/20260909183001_icon_knockout_variants.js +8 -0
  200. package/dist/migrations/20260910212453_linked_system_link_ops.d.ts +13 -0
  201. package/dist/migrations/20260910212453_linked_system_link_ops.js +8 -0
  202. package/dist/migrations/index.d.ts +2 -0
  203. package/dist/migrations/index.js +2 -0
  204. package/dist/react-native/style-keys.generated.d.ts +10 -0
  205. package/dist/react-native/style-keys.generated.js +167 -0
  206. package/dist/renderer/RendererErrorBoundary.d.ts +32 -5
  207. package/dist/renderer/RendererErrorBoundary.js +59 -10
  208. package/dist/renderer/UdsRenderer.d.ts +11 -10
  209. package/dist/renderer/UdsRenderer.js +1 -1
  210. package/dist/renderer/assetEntries.d.ts +37 -0
  211. package/dist/renderer/assetEntries.js +39 -0
  212. package/dist/renderer/assetRenderable.d.ts +14 -6
  213. package/dist/renderer/assetRenderable.js +8 -2
  214. package/dist/renderer/componentEntry.d.ts +58 -0
  215. package/dist/renderer/componentEntry.js +71 -0
  216. package/dist/renderer/icon-library.d.ts +20 -0
  217. package/dist/renderer/index.d.ts +7 -7
  218. package/dist/renderer/index.js +5 -5
  219. package/dist/renderer/primitives/SlotRenderer.d.ts +1 -1
  220. package/dist/renderer/primitives/SlotRenderer.js +1 -1
  221. package/dist/renderer/runtimeComponent.d.ts +33 -0
  222. package/dist/renderer/runtimeComponent.js +113 -0
  223. package/dist/renderer/spec-content.d.ts +43 -0
  224. package/dist/renderer/spec-content.js +95 -0
  225. package/dist/renderer/wrapRegistry.d.ts +22 -37
  226. package/dist/renderer/wrapRegistry.js +10 -20
  227. package/dist/renderer/wrappers/event-bridge.js +6 -5
  228. package/dist/renderer/wrappers/hex-normalize.js +6 -5
  229. package/dist/renderer/wrappers/html-aliases.d.ts +7 -2
  230. package/dist/renderer/wrappers/html-aliases.js +36 -19
  231. package/dist/renderer/wrappers/inline-styles.js +7 -6
  232. package/dist/spec/asset-jsx.d.ts +18 -5
  233. package/dist/spec/asset-jsx.js +27 -16
  234. package/dist/spec/collapse-text-labels.d.ts +5 -15
  235. package/dist/spec/collapse-text-labels.js +26 -19
  236. package/dist/spec/empty-node-slots.d.ts +56 -34
  237. package/dist/spec/empty-node-slots.js +87 -47
  238. package/dist/spec/index.d.ts +21 -10
  239. package/dist/spec/index.js +21 -10
  240. package/dist/spec/jsxToSpec.d.ts +14 -9
  241. package/dist/spec/jsxToSpec.js +20 -3
  242. package/dist/spec/preview-elements.d.ts +63 -0
  243. package/dist/spec/preview-elements.js +89 -0
  244. package/dist/spec/rewrite-refs.d.ts +58 -0
  245. package/dist/spec/rewrite-refs.js +250 -0
  246. package/dist/spec/specToJsx.js +18 -29
  247. package/dist/tsconfig.tsbuildinfo +1 -1
  248. package/package.json +39 -52
  249. package/dist/AssetGroup.d.ts +0 -77
  250. package/dist/AssetGroup.js +0 -125
  251. package/dist/Component.d.ts +0 -333
  252. package/dist/Component.js +0 -1061
  253. package/dist/ComponentGroup.d.ts +0 -22
  254. package/dist/ComponentGroup.js +0 -51
  255. package/dist/CompositeStyle.d.ts +0 -30
  256. package/dist/CompositeStyle.js +0 -59
  257. package/dist/Config.d.ts +0 -528
  258. package/dist/Config.js +0 -1712
  259. package/dist/Mode.d.ts +0 -41
  260. package/dist/Mode.js +0 -81
  261. package/dist/Modifier.d.ts +0 -51
  262. package/dist/Modifier.js +0 -97
  263. package/dist/MotionDef.d.ts +0 -81
  264. package/dist/MotionDef.js +0 -212
  265. package/dist/Props.d.ts +0 -332
  266. package/dist/Props.js +0 -35
  267. package/dist/Provider.d.ts +0 -20
  268. package/dist/Provider.js +0 -14
  269. package/dist/StyleProp.d.ts +0 -145
  270. package/dist/StyleProp.js +0 -239
  271. package/dist/Token.d.ts +0 -76
  272. package/dist/Token.js +0 -133
  273. package/dist/TokenGroup.d.ts +0 -33
  274. package/dist/TokenGroup.js +0 -69
  275. package/dist/asset-kind.d.ts +0 -55
  276. package/dist/asset-kind.js +0 -29
  277. package/dist/asset-value.d.ts +0 -23
  278. package/dist/asset-value.js +0 -40
  279. package/dist/brands.d.ts +0 -30
  280. package/dist/brands.js +0 -20
  281. package/dist/captureCallerPath.d.ts +0 -48
  282. package/dist/captureCallerPath.js +0 -95
  283. package/dist/colorExpressions.d.ts +0 -131
  284. package/dist/colorExpressions.js +0 -148
  285. package/dist/component-referrers.d.ts +0 -30
  286. package/dist/component-referrers.js +0 -40
  287. package/dist/config-diagnostics.d.ts +0 -21
  288. package/dist/config-diagnostics.js +0 -12
  289. package/dist/defineAssetGroup.d.ts +0 -200
  290. package/dist/defineAssetGroup.js +0 -323
  291. package/dist/defineProvider.d.ts +0 -29
  292. package/dist/defineProvider.js +0 -60
  293. package/dist/element-marker.d.ts +0 -63
  294. package/dist/element-marker.js +0 -113
  295. package/dist/entity-utils.d.ts +0 -56
  296. package/dist/entity-utils.js +0 -105
  297. package/dist/extension.d.ts +0 -55
  298. package/dist/extension.js +0 -214
  299. package/dist/factories.d.ts +0 -863
  300. package/dist/factories.js +0 -475
  301. package/dist/font-face.d.ts +0 -25
  302. package/dist/font-face.js +0 -72
  303. package/dist/foreign-component-name.d.ts +0 -21
  304. package/dist/foreign-component-name.js +0 -42
  305. package/dist/interpolate.d.ts +0 -20
  306. package/dist/interpolate.js +0 -10
  307. package/dist/jsx/__fixtures__/cross-component-preview.d.ts +0 -3
  308. package/dist/jsx/__fixtures__/cross-component-preview.js +0 -15
  309. package/dist/jsx/jsx-dev-runtime.d.ts +0 -15
  310. package/dist/jsx/jsx-dev-runtime.js +0 -11
  311. package/dist/jsx/jsx-runtime.d.ts +0 -48
  312. package/dist/jsx/jsx-runtime.js +0 -305
  313. package/dist/linked-system-pins.d.ts +0 -30
  314. package/dist/linked-system-pins.js +0 -45
  315. package/dist/linkedNodePrefixes.d.ts +0 -73
  316. package/dist/linkedNodePrefixes.js +0 -99
  317. package/dist/markers.d.ts +0 -235
  318. package/dist/markers.js +0 -70
  319. package/dist/motion-constants.d.ts +0 -37
  320. package/dist/motion-constants.js +0 -61
  321. package/dist/native/NativeConfig.d.ts +0 -56
  322. package/dist/native/NativeConfig.js +0 -162
  323. package/dist/native/assets.d.ts +0 -20
  324. package/dist/native/assets.js +0 -17
  325. package/dist/native/components.d.ts +0 -139
  326. package/dist/native/components.js +0 -67
  327. package/dist/native/index.d.ts +0 -18
  328. package/dist/native/index.js +0 -17
  329. package/dist/native/modes.d.ts +0 -10
  330. package/dist/native/modes.js +0 -11
  331. package/dist/native/types.d.ts +0 -95
  332. package/dist/native/types.js +0 -0
  333. package/dist/native/validation.d.ts +0 -8
  334. package/dist/native/validation.js +0 -885
  335. package/dist/native/values.d.ts +0 -7
  336. package/dist/native/values.js +0 -15
  337. package/dist/native.d.ts +0 -12
  338. package/dist/native.js +0 -10
  339. package/dist/refs.d.ts +0 -204
  340. package/dist/refs.js +0 -129
  341. package/dist/registry-aliases.d.ts +0 -33
  342. package/dist/registry-aliases.js +0 -35
  343. package/dist/registry-dir.d.ts +0 -22
  344. package/dist/registry-dir.js +0 -10
  345. package/dist/renderer/makeRegistry.d.ts +0 -34
  346. package/dist/renderer/makeRegistry.js +0 -52
  347. package/dist/renderer/makeUdsRenderer.d.ts +0 -13
  348. package/dist/renderer/makeUdsRenderer.js +0 -51
  349. package/dist/renderer/wrappers/component-slots.d.ts +0 -41
  350. package/dist/renderer/wrappers/component-slots.js +0 -66
  351. package/dist/renderer/wrappers/slot-resolution.d.ts +0 -25
  352. package/dist/renderer/wrappers/slot-resolution.js +0 -68
  353. package/dist/renderer/wrappers/void-elements.d.ts +0 -37
  354. package/dist/renderer/wrappers/void-elements.js +0 -40
  355. package/dist/spec/layer-props.d.ts +0 -52
  356. package/dist/spec/layer-props.js +0 -149
  357. package/dist/spec/preview-controls.d.ts +0 -44
  358. package/dist/spec/preview-controls.js +0 -139
  359. package/dist/spec/slot-refs.d.ts +0 -39
  360. package/dist/spec/slot-refs.js +0 -56
  361. package/dist/token-override-rows.d.ts +0 -68
  362. package/dist/token-override-rows.js +0 -233
  363. package/dist/tokenValueType.d.ts +0 -34
  364. package/dist/tokenValueType.js +0 -138
  365. package/dist/types/css-properties.d.ts +0 -233
  366. package/dist/types/css-properties.js +0 -14
  367. package/dist/types/css-property-keywords.d.ts +0 -156
  368. package/dist/types/css-property-keywords.js +0 -616
  369. package/dist/types/css-values.d.ts +0 -63
  370. package/dist/types/css-values.js +0 -16
  371. package/dist/types.d.ts +0 -1138
  372. package/dist/types.js +0 -12
  373. package/dist/units.d.ts +0 -14
  374. package/dist/units.js +0 -16
  375. package/dist/utils/index.d.ts +0 -4
  376. package/dist/utils/index.js +0 -4
@@ -0,0 +1,428 @@
1
+ import { Ref } from "../../framework/utils/refs.js";
2
+ import { Authored } from "../../framework/authoring.js";
3
+ import { StyleValue } from "./style-bag.js";
4
+ import { VariantValues } from "./Component.js";
5
+ import { ComponentPropsWithoutRef, JSX, ReactNode } from "react";
6
+
7
+ //#region src/entities/system/defineComponent.d.ts
8
+ /**
9
+ * Enough of another component to BE a layer's element — the handle `defineComponent` returns, with
10
+ * its declarations forgotten so a builder of any shape fits.
11
+ *
12
+ * Named separately from `AuthoredComponent` because that one fixes the declarations at their widest,
13
+ * and a layer must keep the ones the referenced component actually made: they're where its props come
14
+ * from. `ComponentBuilder<{root:'button'}, …>` satisfies this; it does not satisfy `AuthoredComponent`.
15
+ */
16
+ interface ComponentElement extends Authored {
17
+ readonly kind: 'component';
18
+ readonly path?: string;
19
+ }
20
+ /**
21
+ * A PACKAGE element — a component imported from a package (`import { View } from 'react-native'`).
22
+ * TypeScript sees the real package's own component type here, so a typo'd export is a compile
23
+ * error against the package's actual surface; at config runtime the loader binds the import to
24
+ * the `package:` ref the config stores. The shape is broad on purpose: which function/class shape
25
+ * a package exports is its business, and the check that matters (does this export exist) already
26
+ * ran at compile time against the real types.
27
+ */
28
+ type PackageElement = ((...args: never[]) => unknown) | (abstract new (...args: never[]) => unknown);
29
+ /**
30
+ * A layer IS its element: a native tag, another component, a ref to one, or a package export.
31
+ *
32
+ * The component and the ref to it are the same thing stored — `toStored` turns the first into the
33
+ * second. They differ only in what a COMPILER can see: a ref is a string, so the props the component
34
+ * it names exposes are gone by the time anything could read them, and a component built on `Pressable`
35
+ * typed `onClick` as nothing at all.
36
+ */
37
+ type LayerElement = string | ComponentElement | Ref | PackageElement;
38
+ /**
39
+ * A component's layers. `root` is REQUIRED and is the element a consumer addresses: its React props
40
+ * are the component's props, and a component that doesn't declare one has no element to be.
41
+ *
42
+ * That requirement is what removes a decision. Without it the addressable element had to be named
43
+ * separately, and a component whose root was a wrapper (`Input`'s root a `div`, its `input` on an
44
+ * inner layer) typed `onChange` against the wrong element. The answer is to author the root as the
45
+ * element being addressed, not to add a second way of saying which one it is.
46
+ */
47
+ type LayerMap = {
48
+ root: LayerElement;
49
+ } & Record<string, LayerElement>;
50
+ /**
51
+ * A `<layer>/<prop>` address into one of a component's OWN layers — what a forward routes into.
52
+ *
53
+ * The whole reason `.props()` used to take a callback: `layerRef('icon')` is a free function over
54
+ * `string`, so it could name a layer that doesn't exist. Handed to the props parameter as a TYPE
55
+ * instead, the same check applies to a plain object, and the helper it existed to type has nothing
56
+ * left to do.
57
+ *
58
+ * Falls back to `string` where the layers aren't known — a body read back from the config, or the
59
+ * erased builder the callable form returns.
60
+ */
61
+ type LayerPath<L extends LayerMap = LayerMap> = `${keyof L & string}/${string}`;
62
+ /**
63
+ * A CONTENT HOLE — a prop the render places itself, carrying no route.
64
+ *
65
+ * It used to carry `target`/`into` as well, which made one type mean two things: a hole, and a prop
66
+ * piped into a layer. That second meaning IS a forward — it routes this prop into another prop, and
67
+ * the target happening to be a slot is incidental — so it lives there now and this type is only the
68
+ * hole. `{ type: 'forward', target: 'label/children' }`, which produced a targeted slot, is `{ type: 'forward', target:
69
+ * 'label/children' }`.
70
+ *
71
+ * Named as its own interface, rather than inlined in {@link PropDecl}, so `ValueOf` can tell a slot
72
+ * from anything else: a widened union left a slot prop inferring as `unknown` where the same prop
73
+ * written by hand stayed a `ReactNode`.
74
+ */
75
+ interface SlotDecl {
76
+ type: 'slot';
77
+ /**
78
+ * What may FILL this hole, as refs. Two shapes, both in this repo:
79
+ *
80
+ * - an icon LIBRARY — `Button.startIcon` accepts `Icon.ref('phosphor')`, so any glyph that library
81
+ * registers can be dropped in
82
+ * - a COMPONENT — `PanelSegment` accepts `Component.ref('studio/PanelSegment/PanelSegmentCell')`
83
+ *
84
+ * Both reach the same picker; they differ in what gets written (a glyph name versus a placed element).
85
+ *
86
+ * Meaningful only where content lands, which is why a route carries it too — but only when it routes
87
+ * into a hole. A route into a value prop has nothing to narrow: which values are valid is that prop's
88
+ * own declaration.
89
+ */
90
+ accepts?: Ref | Ref[];
91
+ text?: boolean;
92
+ required?: boolean;
93
+ }
94
+ /**
95
+ * A prop routed to a prop of one of the component's own layers — `<Field disabled />` setting the
96
+ * `input` layer's `disabled`, instead of a caller reaching through `layerProps`.
97
+ *
98
+ * Named separately from {@link SlotDecl} because a slot carries CONTENT and owns `accepts` / `text`,
99
+ * and because a slot may be a plain hole the render places itself. A forward has no meaning except
100
+ * as a route, so both halves are required.
101
+ */
102
+ /**
103
+ * What one layer forwards — `'*'` for every prop that layer's element exposes, or the names of the
104
+ * props to take.
105
+ *
106
+ * Authored as NAMES and stored as member refs (`component:Input#props/disabled`), the same
107
+ * normalization {@link ForwardDecl}'s `into` gets: a name is invisible to the dependency graph, so
108
+ * storing refs is what makes a rename cascade and a delete refuse.
109
+ */
110
+ type Forwarded = '*' | readonly string[];
111
+ /**
112
+ * A prop ROUTED into a prop of one of this component's own layers — `<Field disabled />` setting the
113
+ * `input` layer's `disabled`, `<Button>text</Button>` filling the `label` layer's `children`. One
114
+ * declaration for both, because they are the same act: this prop becomes that one.
115
+ *
116
+ * AUTHORED as a single `<layer>/<prop>` path, typed against the layers just declared. STORED as the
117
+ * pair the readers want — the layer as a `layerRef`, and the target prop as a MEMBER ref, so the
118
+ * dependency graph sees the edge and a rename of that prop cascades into this declaration.
119
+ */
120
+ interface ForwardDecl<Path extends string = string> {
121
+ type: 'forward';
122
+ /** `<layer>/<prop>` as authored; a `layerRef` once stored, with the prop moved to `into`. */
123
+ target: Path | Ref;
124
+ /** STORED only — a member ref at the prop on that layer's element
125
+ * (`component:Input#props/disabled`). Minted at registration, when the layer's element has a path. */
126
+ into?: string | Ref;
127
+ /** Only where this route LANDS on a hole — it means exactly what {@link SlotDecl.accepts} means.
128
+ * That the target is a hole is computed from it (`routesContent`), so the rule is checked rather
129
+ * than trusted, and a route into a value prop is refused by name. */
130
+ accepts?: Ref | Ref[];
131
+ text?: boolean;
132
+ required?: boolean;
133
+ }
134
+ /**
135
+ * One prop's declaration, in both the form it is AUTHORED in and the form it is STORED in.
136
+ *
137
+ * Written out rather than taken from the schema (`AuthoredPropBody` is exactly that) for one reason:
138
+ * a variant's rendered prop should be the union of its values, and that needs the literal tuple an
139
+ * author wrote — `['sm','lg'] as const` — which a zod-inferred `string[]` has already widened away.
140
+ * So the two coexist and {@link SchemaAccepts} pins this one to what the schema takes, which is the
141
+ * part that could otherwise drift.
142
+ *
143
+ * A variant's `value` therefore has three forms: the list an author writes, the keyed collection it
144
+ * is stored as (each value a member with a name, an order and a body), and a ref that delegates the
145
+ * whole domain to whatever owns it.
146
+ *
147
+ * `required` is on every arm because the SCHEMA has always accepted it on every arm — a slot can be
148
+ * mandatory (a Card that makes no sense without its content) exactly as a variant can. It was spelled
149
+ * on `variant` alone, so a consumer reading a stored prop had to widen the exported type by hand to
150
+ * see a field the config was already storing.
151
+ */
152
+ type PropDecl<Path extends string = string> = SlotDecl | ForwardDecl<Path> | {
153
+ type: 'variant';
154
+ value: readonly string[] | VariantValues | Ref;
155
+ required?: boolean;
156
+ } | {
157
+ type: 'styleProperty';
158
+ value: Ref;
159
+ required?: boolean;
160
+ } | {
161
+ type: 'composite';
162
+ value: Ref;
163
+ required?: boolean;
164
+ } | {
165
+ type: 'motion';
166
+ required?: boolean;
167
+ } | {
168
+ type: 'string' | 'number' | 'boolean';
169
+ required?: boolean;
170
+ };
171
+ /**
172
+ * One prop as AUTHORED — a declaration, or one of the two bare forms that already say what they are:
173
+ *
174
+ * `bg: StyleProperty.ref('bg')` a bare REF. It names a kind, so a `type` beside it would say the
175
+ * same thing twice; `toStored` derives the tag from that kind.
176
+ * `size: ['sm', 'lg']` a bare LIST — an enumerated variant. The values ARE the
177
+ * declaration.
178
+ *
179
+ * Only authoring is widened: the STORED form is always the tagged {@link PropDecl}, which is what
180
+ * every reader switches on. (v1 did the same in its authoring adapter — it just assumed every bare ref
181
+ * was a style property, where this reads the kind.)
182
+ */
183
+ type AuthoredProp<Path extends string = string> = PropDecl<Path> | Ref | readonly string[];
184
+ /**
185
+ * A component's prop declarations. `null` is the OMIT tombstone the stored schema already accepts: a
186
+ * component that `.forwards({ root: '*' })` drops one of the base's props by declaring it `null`, which is
187
+ * how `Image` extends a `Box` and still refuses children.
188
+ */
189
+ type PropMap<Path extends string = string> = Record<string, AuthoredProp<Path> | null>;
190
+ /** The arm of a declaration union whose `type` this body claims — so exactness below is judged against
191
+ * ONE shape rather than against the intersection of every arm's fields. */
192
+ type ArmFor<D, U> = D extends {
193
+ type: infer T;
194
+ } ? Extract<U, {
195
+ type: T;
196
+ }> : never;
197
+ /**
198
+ * `D`, with every key its own arm does not declare BANNED.
199
+ *
200
+ * Necessary because `.props()` takes a generic (`const P extends PropMap<…>`), and a generic constraint
201
+ * is an assignability check — excess property checking never runs, so a field the arm doesn't declare
202
+ * is simply invisible. That let `{ type: 'slot', target: 'icon/children' }` compile on a component with
203
+ * no `icon` layer, and a misspelt `txt: true` compile as nothing at all.
204
+ *
205
+ * Mapping the stray keys to `never` is what makes them errors: the value written there — a string, an
206
+ * object — is not assignable to `never`. Generic over the union, so it holds for every arm rather than
207
+ * naming the fields one shape happens to forbid.
208
+ *
209
+ * A body with no `type` (a bare ref, a bare list of variant values, the `null` tombstone) selects no
210
+ * arm and is handed back untouched — those forms say what they are by their shape.
211
+ */
212
+ type Exact<D, U> = [ArmFor<D, U>] extends [never] ? D : D & { [K in Exclude<keyof D, keyof ArmFor<D, U>>]: never };
213
+ /** A style rule: what to apply, and the prop values it applies under. */
214
+ interface StyleRuleInput<L extends LayerMap> {
215
+ /** Prop → value, all of which must hold. Absent means unconditional. A value is whatever the prop
216
+ * it names offers, so a boolean prop's condition is a boolean. */
217
+ readonly when?: Record<string, string | number | boolean>;
218
+ /** Per layer — and only a layer this component declared. */
219
+ readonly layers: Partial<Record<keyof L & string, Record<string, StyleValue>>>;
220
+ }
221
+ /** The TS type one prop declaration produces on the rendered component. */
222
+ type ValueOf<D> = D extends readonly (infer Member)[] ? Member : D extends {
223
+ type: 'variant';
224
+ value: infer V;
225
+ } ? V extends readonly (infer Member)[] ? Member : V extends VariantValues ? keyof V & string : string : D extends {
226
+ type: 'string';
227
+ } ? string : D extends {
228
+ type: 'number';
229
+ } ? number : D extends {
230
+ type: 'boolean';
231
+ } ? boolean : D extends {
232
+ type: 'slot';
233
+ } ? ReactNode : D extends {
234
+ type: 'forward';
235
+ target: `${string}/children`;
236
+ } ? ReactNode : unknown;
237
+ /**
238
+ * A prop type's DECLARED props — everything but its index signature.
239
+ *
240
+ * A component's props end in `Record<string, unknown>`, so `keyof` them is `string`, and anything
241
+ * key-driven downstream sees that one open key instead of the declared ones. `Omit` is the case that
242
+ * matters: it's how a component's own props shadow the ones it takes from its element, and over an
243
+ * open type it kept everything as `unknown` — a component built on `Pressable` typed `onClick`'s
244
+ * parameter as `any` and accepted any value at all for `tone`.
245
+ */
246
+ type Declared<T> = { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K] };
247
+ /** What a prop map really exposes: each declaration's value type, with the `null` tombstones — the
248
+ * props it DROPS from what it inherits — gone from the surface entirely. */
249
+ type DeclaredProps<P> = { [K in keyof P as P[K] extends null ? never : K]: ValueOf<P[K]> };
250
+ /**
251
+ * The props the rendered ELEMENT contributes.
252
+ *
253
+ * That element's React props are part of the component's surface — `<Pressable onClick={e => …}>`
254
+ * types `e` because `Pressable` renders a `button`. Left out, every handler a consumer passed fell
255
+ * into the open index signature and its parameter had no contextual type, which turned ~75 untouched
256
+ * call sites into implicit-`any` errors.
257
+ */
258
+ type ElementPropsOf<Element> = Element extends keyof JSX.IntrinsicElements ? ComponentPropsWithoutRef<Element> : Element extends ((props: infer PropsOfComponent) => unknown) ? Declared<PropsOfComponent> : Record<never, never>;
259
+ /**
260
+ * Which element that is: the one a `defaultProps.as` FIXES, else the root layer.
261
+ *
262
+ * Two ways of saying it because they say different things. A root layer is what the component is
263
+ * ARRANGED from — it may be another component, and then the element is whatever that one renders.
264
+ * `as` is what a component PINS: `Input` is a Box in every other respect and an `<input>` in this
265
+ * one, so the layer stays the component it extends while `as` names the tag. Reading only the layer
266
+ * typed `Input`'s `onChange` against a `div` and lost `event.target.value` at every call site.
267
+ */
268
+ type ElementOf<L extends LayerMap, D> = D extends {
269
+ as: infer As;
270
+ } ? As : L['root'];
271
+ /**
272
+ * The props a consumer may pass — the declared ones, the rendered element's, and the style props.
273
+ *
274
+ * The element contributes only what the component didn't already name, because a name the component
275
+ * declares is a REDEFINITION of it. Intersected instead, the two meanings met and cancelled:
276
+ * `Input`'s `size` offers `'xs' | 'sm' | 'md' | 'lg'` while `<input size>` is a `number`, so
277
+ * `size="sm"` failed with "string is not assignable to undefined" — an empty intersection, which is
278
+ * the type saying no value could ever satisfy both.
279
+ *
280
+ * Open at the end on purpose: a component's style-prop surface is the system's, not this file's.
281
+ */
282
+ type ComponentPropsOf<L extends LayerMap, P extends PropMap, D = Record<never, never>, E = Record<never, never>, F extends string = never> = Partial<DeclaredProps<P>> & Partial<E> & Omit<ElementPropsOf<ElementOf<L, D>>, keyof P | keyof E> & Omit<ForwardedPropsOf<L, F>, keyof P | keyof E> & Record<string, unknown>;
283
+ /**
284
+ * The props a component picks up from the layers it FORWARDS.
285
+ *
286
+ * `Partial`, and permissive about which forwarded layer a prop came from: the surface is already open
287
+ * at the end (`Record<string, unknown>`), so this changes no assignability — what it changes is that a
288
+ * forwarded prop is DISCOVERABLE on the handle instead of vanishing into the tail.
289
+ *
290
+ * Root is excluded here because {@link ElementOf} already contributes the element a consumer really
291
+ * addresses. Counting root again is not harmless when `defaultProps.as` pins a different element:
292
+ * Input is Box-backed but renders an input, and intersecting both event surfaces makes every handler
293
+ * accept `HTMLDivElement | HTMLInputElement` instead of the input it actually receives.
294
+ */
295
+ type NonRootForward<L extends LayerMap, F extends string> = Exclude<F, 'root'> & keyof L;
296
+ type ForwardedPropsOf<L extends LayerMap, F extends string> = [NonRootForward<L, F>] extends [never] ? Record<never, never> : Partial<ElementPropsOf<L[NonRootForward<L, F>]>>;
297
+ /**
298
+ * Defaults a component applies with nothing set — its declared props, typed, plus the style props it
299
+ * may also default.
300
+ *
301
+ * The open half is `unknown`, not `StyleValue`. Intersected with `Record<string, StyleValue>` every
302
+ * DECLARED prop had to satisfy both, so a slot defaulting to an element was rejected for not being a
303
+ * style value — which is the intersection checking the wrong half.
304
+ */
305
+ type DefaultsOf<P extends PropMap> = Partial<DeclaredProps<P>> & {
306
+ [key: string]: unknown;
307
+ };
308
+ /** What a render receives: the generated per-layer bundle, plus the props the component declared. */
309
+ type RenderArgs<L extends LayerMap, P extends PropMap> = {
310
+ readonly props: Record<keyof L & string, Record<string, unknown>>;
311
+ } & DeclaredProps<P> & Record<string, unknown>;
312
+ interface ComponentBuilder<L extends LayerMap, P extends PropMap,
313
+ /** Props the RENDER takes that the config doesn't describe — React handlers, mostly (`onPress`).
314
+ * They're part of the component's surface but not of its data, which is why they're declared at
315
+ * `.render()` rather than in `.props()`. */
316
+ E = Record<never, never>,
317
+ /** The defaults as AUTHORED, kept because one of them decides the type of every other prop: an
318
+ * `as` fixes which element this renders. See {@link ElementOf}. */
319
+ D = Record<never, never>,
320
+ /** The layers this component FORWARDS from, as a union of their names. Accumulates through
321
+ * `.forwards()` so `ComponentPropsOf` can union each forwarded layer's element props — `root` is
322
+ * already covered structurally by {@link ElementOf}, so for a root-only forward this changes no
323
+ * inferred type, which is what makes replacing `inherits` a no-op at every call site. */
324
+ F extends string = never> extends Authored {
325
+ /**
326
+ * A phantom call signature — the authored value is NEVER rendered (the build substitutes the
327
+ * emitted module), but `export type ButtonProps = ComponentProps<typeof Button>` is how a consumer
328
+ * names its props, and that reads this type.
329
+ */
330
+ (props: ComponentPropsOf<L, P, D, E, F>): null;
331
+ readonly kind: 'component';
332
+ /** The authored body, readable so codegen can pair it with the render found in the source. */
333
+ readonly body: Record<string, unknown>;
334
+ readonly path?: string;
335
+ layers<const L2 extends LayerMap>(layers: L2): ComponentBuilder<L2, P, E, D, F>;
336
+ /**
337
+ * This component's props.
338
+ *
339
+ * A plain object, typed against the layers just declared: a forward's `target` must be a
340
+ * `<layer>/<prop>` of THIS component, which is the one check the `.props()` callback existed to
341
+ * provide. The callback and its `layer`/`bind` helpers are gone — they only ever split a path string
342
+ * that the parameter's own type now checks.
343
+ */
344
+ props<const P2 extends PropMap<LayerPath<L>>>(props: P2 & NoInfer<{ [K in keyof P2]: Exact<P2[K], AuthoredProp<LayerPath<L>>> }>): ComponentBuilder<L, P2, E, D, F>;
345
+ styles(rules: readonly StyleRuleInput<L>[]): ComponentBuilder<L, P, E, D, F>;
346
+ /**
347
+ * What this component applies with nothing set.
348
+ *
349
+ * Typed against the props just declared, so a default names a real prop and takes a value that
350
+ * prop accepts — `{ size: 'md' }` is an error when `size` offers `'sm' | 'lg'`. Style props stay
351
+ * open, since a component's style-prop surface is the system's, not this file's.
352
+ *
353
+ * `const`, so an `as` keeps its literal type: without it `{ as: 'input' }` widens to `string` and
354
+ * there's no tag left to resolve the element's props against.
355
+ */
356
+ defaultProps<const D2 extends DefaultsOf<P>>(defaults: D2): ComponentBuilder<L, P, E, D2, F>;
357
+ /**
358
+ * The layers whose element props this component ALSO exposes, keyed by layer.
359
+ *
360
+ * The CONFIG props those layers' components expose, not their element props — those come from the
361
+ * element this renders. `'*'` takes the whole surface; a list of names takes those props only, and
362
+ * is an ALLOWLIST: dropping a forwarded prop is `.props({ x: null })`.
363
+ *
364
+ * One call taking a record, not a repeatable per-layer call, because `emit-config` writes authoring
365
+ * source FROM stored config — every keyed collection there is one call with a record literal, and a
366
+ * second authored form would make generated source drift from what a person writes.
367
+ */
368
+ forwards<const F2 extends Readonly<Partial<Record<keyof L & string, Forwarded>>>>(forwards: F2): ComponentBuilder<L, P, E, D, F | (keyof F2 & string)>;
369
+ /**
370
+ * What a person is told about this component: the label a picker shows, and what it's for.
371
+ * `guidance` is for a model composing with it, in the imperative voice of a rule; the guidance
372
+ * document collects it into its Components topic. `hidden` and `deprecated` retire it short of
373
+ * deleting it, the same two flags every entity carries.
374
+ */
375
+ metadata(meta: {
376
+ label?: string;
377
+ description?: string;
378
+ guidance?: string;
379
+ hidden?: boolean;
380
+ deprecated?: boolean;
381
+ }): ComponentBuilder<L, P, E, D, F>;
382
+ /**
383
+ * The anatomy: which elements this component renders, in what order and nesting.
384
+ *
385
+ * Never called and never stored. A component's data says what its layers ARE; only this says how
386
+ * they're arranged, and that is CODE — it can read a context or declare a handler. The build reads
387
+ * it from the source and copies it verbatim, so what it returns is irrelevant; declaring it is
388
+ * what puts it in the file.
389
+ */
390
+ render<E2 = E>(fn: (args: RenderArgs<L, P> & E2) => unknown): ComponentBuilder<L, P, E2, D, F>;
391
+ /**
392
+ * An optional browser-canvas anatomy for a native component.
393
+ *
394
+ * Native components normally reuse {@link render} through React Native Web on the design canvas.
395
+ * Use this only when the phone anatomy is a poor fit for a browser canvas (a full-screen safe-area
396
+ * wrapper, for example). Like `render`, it is source-read build input and stores no config data.
397
+ */
398
+ renderCanvas<E2 extends E = E>(fn: (args: RenderArgs<L, P> & E2) => unknown): ComponentBuilder<L, P, E, D, F>;
399
+ /**
400
+ * What a preview of this component STARTS from — the props a single tile is rendered with.
401
+ *
402
+ * Only `defaultProps`, because the grid itself is derived: every axis a matrix could sweep is
403
+ * already declared in `styles`, as the conditions the rules apply under, and the modifier columns
404
+ * are the `_hover`/`_active` blocks those rules contain. An authored matrix restated all of it and
405
+ * could disagree with it — a variant added to `styles` and forgotten in the matrix simply never
406
+ * appeared. See `previewMatrix`.
407
+ */
408
+ preview(spec: {
409
+ defaultProps?: DefaultsOf<P>;
410
+ }): ComponentBuilder<L, P, E, D, F>;
411
+ toStored(): Record<string, unknown>;
412
+ assignPath(path: string): void;
413
+ }
414
+ /** A component under authorship, with its declarations forgotten — what a registry holds. */
415
+ type AuthoredComponent = ComponentBuilder<LayerMap, PropMap, unknown, unknown>;
416
+ interface DefineComponent {
417
+ /** The one-layer form: the element IS the component. */
418
+ <const El extends LayerElement>(element: El): ComponentBuilder<{
419
+ root: El;
420
+ }, Record<never, never>>;
421
+ /** The whole body at once, for a component with nothing to narrow step by step. */
422
+ (body?: Record<string, unknown>): AuthoredComponent;
423
+ layers<const L extends LayerMap>(layers: L): ComponentBuilder<L, Record<never, never>>;
424
+ props<const P extends PropMap<LayerPath>>(props: P & NoInfer<{ [K in keyof P]: Exact<P[K], AuthoredProp<LayerPath>> }>): ComponentBuilder<LayerMap, P>;
425
+ }
426
+ declare const defineComponent: DefineComponent;
427
+ //#endregion
428
+ export { AuthoredComponent, AuthoredProp, ComponentBuilder, ComponentPropsOf, LayerElement, LayerMap, PropDecl, PropMap, RenderArgs, StyleRuleInput, defineComponent };