@metamorph-labs/polymorph-engine 0.0.0-stage → 1.0.16

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 (407) hide show
  1. package/CHANGELOG.md +1056 -0
  2. package/LICENSE +21 -0
  3. package/README.md +156 -2
  4. package/dist/agent/bridge.js +307 -0
  5. package/dist/agent/bridge.js.map +1 -0
  6. package/dist/agent/context.js +21 -0
  7. package/dist/agent/context.js.map +1 -0
  8. package/dist/agent/definitions.js +85 -0
  9. package/dist/agent/definitions.js.map +1 -0
  10. package/dist/agent/name.js +71 -0
  11. package/dist/agent/name.js.map +1 -0
  12. package/dist/agent/on-call.js +9 -0
  13. package/dist/agent/on-call.js.map +1 -0
  14. package/dist/agent/setting.js +18 -0
  15. package/dist/agent/setting.js.map +1 -0
  16. package/dist/agent/tools.js +28 -0
  17. package/dist/agent/tools.js.map +1 -0
  18. package/dist/agent/webmcp.js +80 -0
  19. package/dist/agent/webmcp.js.map +1 -0
  20. package/dist/agent.js +3 -0
  21. package/dist/charts/annotations.js +141 -0
  22. package/dist/charts/annotations.js.map +1 -0
  23. package/dist/charts/area-chart.js +173 -0
  24. package/dist/charts/area-chart.js.map +1 -0
  25. package/dist/charts/bar-chart.js +187 -0
  26. package/dist/charts/bar-chart.js.map +1 -0
  27. package/dist/charts/brush.js +77 -0
  28. package/dist/charts/brush.js.map +1 -0
  29. package/dist/charts/cap.js +12 -0
  30. package/dist/charts/cap.js.map +1 -0
  31. package/dist/charts/cartesian.js +135 -0
  32. package/dist/charts/cartesian.js.map +1 -0
  33. package/dist/charts/donut-chart.js +131 -0
  34. package/dist/charts/donut-chart.js.map +1 -0
  35. package/dist/charts/format.js +80 -0
  36. package/dist/charts/format.js.map +1 -0
  37. package/dist/charts/frame.js +39 -0
  38. package/dist/charts/frame.js.map +1 -0
  39. package/dist/charts/funnel-chart.js +165 -0
  40. package/dist/charts/funnel-chart.js.map +1 -0
  41. package/dist/charts/geometry.js +56 -0
  42. package/dist/charts/geometry.js.map +1 -0
  43. package/dist/charts/grid.js +90 -0
  44. package/dist/charts/grid.js.map +1 -0
  45. package/dist/charts/heatmap.js +137 -0
  46. package/dist/charts/heatmap.js.map +1 -0
  47. package/dist/charts/histogram.js +116 -0
  48. package/dist/charts/histogram.js.map +1 -0
  49. package/dist/charts/line-chart.js +171 -0
  50. package/dist/charts/line-chart.js.map +1 -0
  51. package/dist/charts/measured-box.js +25 -0
  52. package/dist/charts/measured-box.js.map +1 -0
  53. package/dist/charts/messages.js +42 -0
  54. package/dist/charts/messages.js.map +1 -0
  55. package/dist/charts/paths.js +37 -0
  56. package/dist/charts/paths.js.map +1 -0
  57. package/dist/charts/polar.js +31 -0
  58. package/dist/charts/polar.js.map +1 -0
  59. package/dist/charts/radar-chart.js +165 -0
  60. package/dist/charts/radar-chart.js.map +1 -0
  61. package/dist/charts/reading.js +89 -0
  62. package/dist/charts/reading.js.map +1 -0
  63. package/dist/charts/readout.js +55 -0
  64. package/dist/charts/readout.js.map +1 -0
  65. package/dist/charts/scales.js +155 -0
  66. package/dist/charts/scales.js.map +1 -0
  67. package/dist/charts/scatter-chart.js +190 -0
  68. package/dist/charts/scatter-chart.js.map +1 -0
  69. package/dist/charts/series.js +115 -0
  70. package/dist/charts/series.js.map +1 -0
  71. package/dist/charts/sparkline.js +26 -0
  72. package/dist/charts/sparkline.js.map +1 -0
  73. package/dist/charts/sync.js +35 -0
  74. package/dist/charts/sync.js.map +1 -0
  75. package/dist/charts/treemap.js +292 -0
  76. package/dist/charts/treemap.js.map +1 -0
  77. package/dist/charts/types.js +21 -0
  78. package/dist/charts/types.js.map +1 -0
  79. package/dist/charts/warnings.js +13 -0
  80. package/dist/charts/warnings.js.map +1 -0
  81. package/dist/charts.js +31 -0
  82. package/dist/conventions/agent.js +48 -0
  83. package/dist/conventions/agent.js.map +1 -0
  84. package/dist/conventions/attrs.js +25 -0
  85. package/dist/conventions/attrs.js.map +1 -0
  86. package/dist/conventions/audio.js +21 -0
  87. package/dist/conventions/audio.js.map +1 -0
  88. package/dist/conventions/autosize.js +12 -0
  89. package/dist/conventions/autosize.js.map +1 -0
  90. package/dist/conventions/avatar.js +21 -0
  91. package/dist/conventions/avatar.js.map +1 -0
  92. package/dist/conventions/chart-legend.js +30 -0
  93. package/dist/conventions/chart-legend.js.map +1 -0
  94. package/dist/conventions/chart-marks.js +66 -0
  95. package/dist/conventions/chart-marks.js.map +1 -0
  96. package/dist/conventions/chart-range.js +26 -0
  97. package/dist/conventions/chart-range.js.map +1 -0
  98. package/dist/conventions/color-input.js +6 -0
  99. package/dist/conventions/color-input.js.map +1 -0
  100. package/dist/conventions/countdown-clock.js +49 -0
  101. package/dist/conventions/countdown-clock.js.map +1 -0
  102. package/dist/conventions/countdown.js +29 -0
  103. package/dist/conventions/countdown.js.map +1 -0
  104. package/dist/conventions/dev.js +8 -0
  105. package/dist/conventions/dev.js.map +1 -0
  106. package/dist/conventions/diff.js +75 -0
  107. package/dist/conventions/diff.js.map +1 -0
  108. package/dist/conventions/direction.js +34 -0
  109. package/dist/conventions/direction.js.map +1 -0
  110. package/dist/conventions/duration.js +175 -0
  111. package/dist/conventions/duration.js.map +1 -0
  112. package/dist/conventions/files.js +37 -0
  113. package/dist/conventions/files.js.map +1 -0
  114. package/dist/conventions/follow.js +34 -0
  115. package/dist/conventions/follow.js.map +1 -0
  116. package/dist/conventions/highlight.js +69 -0
  117. package/dist/conventions/highlight.js.map +1 -0
  118. package/dist/conventions/json-tree-branches.js +38 -0
  119. package/dist/conventions/json-tree-branches.js.map +1 -0
  120. package/dist/conventions/kind.js +12 -0
  121. package/dist/conventions/kind.js.map +1 -0
  122. package/dist/conventions/list-items.js +34 -0
  123. package/dist/conventions/list-items.js.map +1 -0
  124. package/dist/conventions/master-detail.js +36 -0
  125. package/dist/conventions/master-detail.js.map +1 -0
  126. package/dist/conventions/menu-choices.js +53 -0
  127. package/dist/conventions/menu-choices.js.map +1 -0
  128. package/dist/conventions/menubar.js +94 -0
  129. package/dist/conventions/menubar.js.map +1 -0
  130. package/dist/conventions/modal-focus.js +24 -0
  131. package/dist/conventions/modal-focus.js.map +1 -0
  132. package/dist/conventions/pagination.js +20 -0
  133. package/dist/conventions/pagination.js.map +1 -0
  134. package/dist/conventions/phone.js +127 -0
  135. package/dist/conventions/phone.js.map +1 -0
  136. package/dist/conventions/prompt-token.js +32 -0
  137. package/dist/conventions/prompt-token.js.map +1 -0
  138. package/dist/conventions/rail-destinations.js +45 -0
  139. package/dist/conventions/rail-destinations.js.map +1 -0
  140. package/dist/conventions/rating.js +66 -0
  141. package/dist/conventions/rating.js.map +1 -0
  142. package/dist/conventions/relative-time.js +100 -0
  143. package/dist/conventions/relative-time.js.map +1 -0
  144. package/dist/conventions/reveal.js +18 -0
  145. package/dist/conventions/reveal.js.map +1 -0
  146. package/dist/conventions/roving.js +36 -0
  147. package/dist/conventions/roving.js.map +1 -0
  148. package/dist/conventions/sections.js +116 -0
  149. package/dist/conventions/sections.js.map +1 -0
  150. package/dist/conventions/size.js +10 -0
  151. package/dist/conventions/size.js.map +1 -0
  152. package/dist/conventions/slug.js +8 -0
  153. package/dist/conventions/slug.js.map +1 -0
  154. package/dist/conventions/spacing.js +14 -0
  155. package/dist/conventions/spacing.js.map +1 -0
  156. package/dist/conventions/table-sort.js +59 -0
  157. package/dist/conventions/table-sort.js.map +1 -0
  158. package/dist/conventions/theme-values.js +220 -0
  159. package/dist/conventions/theme-values.js.map +1 -0
  160. package/dist/conventions/time-text.js +37 -0
  161. package/dist/conventions/time-text.js.map +1 -0
  162. package/dist/conventions/tooltip.js +6 -0
  163. package/dist/conventions/tooltip.js.map +1 -0
  164. package/dist/conventions/tour.js +126 -0
  165. package/dist/conventions/tour.js.map +1 -0
  166. package/dist/conventions/trigger-anchor.js +52 -0
  167. package/dist/conventions/trigger-anchor.js.map +1 -0
  168. package/dist/conventions/variants.js +11 -0
  169. package/dist/conventions/variants.js.map +1 -0
  170. package/dist/dates/agent.js +56 -0
  171. package/dist/dates/agent.js.map +1 -0
  172. package/dist/dates/segments.js +241 -0
  173. package/dist/dates/segments.js.map +1 -0
  174. package/dist/design/icons.js +598 -0
  175. package/dist/design/icons.js.map +1 -0
  176. package/dist/design/motion/motion.js +467 -0
  177. package/dist/design/motion/motion.js.map +1 -0
  178. package/dist/design/palettes/amethyst.js +17 -0
  179. package/dist/design/palettes/amethyst.js.map +1 -0
  180. package/dist/design/systems/pastel.js +27 -0
  181. package/dist/design/systems/pastel.js.map +1 -0
  182. package/dist/icon/brands.js +64 -0
  183. package/dist/icon/brands.js.map +1 -0
  184. package/dist/icon/roles.js +10 -0
  185. package/dist/icon/roles.js.map +1 -0
  186. package/dist/index.js +79 -0
  187. package/dist/markdown/parse.js +427 -0
  188. package/dist/markdown/parse.js.map +1 -0
  189. package/dist/markdown.js +2 -0
  190. package/dist/motion/animate.js +100 -0
  191. package/dist/motion/animate.js.map +1 -0
  192. package/dist/motion/environment.js +109 -0
  193. package/dist/motion/environment.js.map +1 -0
  194. package/dist/motion/patterns.js +175 -0
  195. package/dist/motion/patterns.js.map +1 -0
  196. package/dist/motion/values.js +43 -0
  197. package/dist/motion/values.js.map +1 -0
  198. package/dist/motion.js +5 -0
  199. package/dist/packages/theme/src/admit.js +143 -0
  200. package/dist/packages/theme/src/admit.js.map +1 -0
  201. package/dist/packages/theme/src/axes.js +74 -0
  202. package/dist/packages/theme/src/axes.js.map +1 -0
  203. package/dist/packages/theme/src/coherence.js +33 -0
  204. package/dist/packages/theme/src/coherence.js.map +1 -0
  205. package/dist/packages/theme/src/color/apca.js +23 -0
  206. package/dist/packages/theme/src/color/apca.js.map +1 -0
  207. package/dist/packages/theme/src/color/chart-wheel.js +273 -0
  208. package/dist/packages/theme/src/color/chart-wheel.js.map +1 -0
  209. package/dist/packages/theme/src/color/chart.js +164 -0
  210. package/dist/packages/theme/src/color/chart.js.map +1 -0
  211. package/dist/packages/theme/src/color/contrast.js +56 -0
  212. package/dist/packages/theme/src/color/contrast.js.map +1 -0
  213. package/dist/packages/theme/src/color/index.js +7 -0
  214. package/dist/packages/theme/src/color/ramp.js +176 -0
  215. package/dist/packages/theme/src/color/ramp.js.map +1 -0
  216. package/dist/packages/theme/src/color/resolve.js +276 -0
  217. package/dist/packages/theme/src/color/resolve.js.map +1 -0
  218. package/dist/packages/theme/src/color/role-map.js +364 -0
  219. package/dist/packages/theme/src/color/role-map.js.map +1 -0
  220. package/dist/packages/theme/src/css-vars.js +29 -0
  221. package/dist/packages/theme/src/css-vars.js.map +1 -0
  222. package/dist/packages/theme/src/derive.js +701 -0
  223. package/dist/packages/theme/src/derive.js.map +1 -0
  224. package/dist/packages/theme/src/emit-dart.js +67 -0
  225. package/dist/packages/theme/src/emit-dart.js.map +1 -0
  226. package/dist/packages/theme/src/emit-kotlin.js +83 -0
  227. package/dist/packages/theme/src/emit-kotlin.js.map +1 -0
  228. package/dist/packages/theme/src/emit-swift.js +276 -0
  229. package/dist/packages/theme/src/emit-swift.js.map +1 -0
  230. package/dist/packages/theme/src/emit-tokens.js +517 -0
  231. package/dist/packages/theme/src/emit-tokens.js.map +1 -0
  232. package/dist/packages/theme/src/emit.js +178 -0
  233. package/dist/packages/theme/src/emit.js.map +1 -0
  234. package/dist/packages/theme/src/examples.js +72 -0
  235. package/dist/packages/theme/src/examples.js.map +1 -0
  236. package/dist/packages/theme/src/index.js +29 -0
  237. package/dist/packages/theme/src/native-model.js +305 -0
  238. package/dist/packages/theme/src/native-model.js.map +1 -0
  239. package/dist/packages/theme/src/pairings.js +193 -0
  240. package/dist/packages/theme/src/pairings.js.map +1 -0
  241. package/dist/packages/theme/src/platforms.js +28 -0
  242. package/dist/packages/theme/src/platforms.js.map +1 -0
  243. package/dist/packages/theme/src/resolve-theme.js +36 -0
  244. package/dist/packages/theme/src/resolve-theme.js.map +1 -0
  245. package/dist/packages/theme/src/roles.js +159 -0
  246. package/dist/packages/theme/src/roles.js.map +1 -0
  247. package/dist/packages/theme/src/runtime.js +144 -0
  248. package/dist/packages/theme/src/runtime.js.map +1 -0
  249. package/dist/packages/theme/src/seeds.js +86 -0
  250. package/dist/packages/theme/src/seeds.js.map +1 -0
  251. package/dist/packages/theme/src/systems.js +201 -0
  252. package/dist/packages/theme/src/systems.js.map +1 -0
  253. package/dist/packages/theme/src/theme.js +11 -0
  254. package/dist/packages/theme/src/theme.js.map +1 -0
  255. package/dist/packages/theme/src/tokens.js +92 -0
  256. package/dist/packages/theme/src/tokens.js.map +1 -0
  257. package/dist/qr/encode.js +599 -0
  258. package/dist/qr/encode.js.map +1 -0
  259. package/dist/qr.js +2 -0
  260. package/dist/runtime.js +3 -0
  261. package/dist/testing.js +40 -0
  262. package/dist/testing.js.map +1 -0
  263. package/dist/toast/agent.js +39 -0
  264. package/dist/toast/agent.js.map +1 -0
  265. package/dist/toast/store.js +107 -0
  266. package/dist/toast/store.js.map +1 -0
  267. package/dist/types/_internal/theme/admit.d.ts +103 -0
  268. package/dist/types/_internal/theme/axes.d.ts +155 -0
  269. package/dist/types/_internal/theme/coherence.d.ts +26 -0
  270. package/dist/types/_internal/theme/color/apca.d.ts +18 -0
  271. package/dist/types/_internal/theme/color/apca.reference.d.ts +11 -0
  272. package/dist/types/_internal/theme/color/chart-wheel.d.ts +228 -0
  273. package/dist/types/_internal/theme/color/chart.d.ts +92 -0
  274. package/dist/types/_internal/theme/color/contrast.d.ts +41 -0
  275. package/dist/types/_internal/theme/color/index.d.ts +12 -0
  276. package/dist/types/_internal/theme/color/ramp.d.ts +122 -0
  277. package/dist/types/_internal/theme/color/resolve.d.ts +136 -0
  278. package/dist/types/_internal/theme/color/role-map.d.ts +89 -0
  279. package/dist/types/_internal/theme/css-vars.d.ts +89 -0
  280. package/dist/types/_internal/theme/derive.d.ts +139 -0
  281. package/dist/types/_internal/theme/emit-dart.d.ts +9 -0
  282. package/dist/types/_internal/theme/emit-kotlin.d.ts +57 -0
  283. package/dist/types/_internal/theme/emit-swift.d.ts +130 -0
  284. package/dist/types/_internal/theme/emit-tokens.d.ts +396 -0
  285. package/dist/types/_internal/theme/emit.d.ts +14 -0
  286. package/dist/types/_internal/theme/examples.d.ts +54 -0
  287. package/dist/types/_internal/theme/index.d.ts +44 -0
  288. package/dist/types/_internal/theme/native-model.d.ts +162 -0
  289. package/dist/types/_internal/theme/pairings.d.ts +107 -0
  290. package/dist/types/_internal/theme/platforms.d.ts +40 -0
  291. package/dist/types/_internal/theme/resolve-theme.d.ts +19 -0
  292. package/dist/types/_internal/theme/roles.d.ts +137 -0
  293. package/dist/types/_internal/theme/runtime.d.ts +152 -0
  294. package/dist/types/_internal/theme/seeds.d.ts +252 -0
  295. package/dist/types/_internal/theme/systems.d.ts +920 -0
  296. package/dist/types/_internal/theme/theme.d.ts +95 -0
  297. package/dist/types/_internal/theme/tokens.d.ts +379 -0
  298. package/dist/types/agent/bridge.d.ts +164 -0
  299. package/dist/types/agent/context.d.ts +33 -0
  300. package/dist/types/agent/definitions.d.ts +29 -0
  301. package/dist/types/agent/index.d.ts +16 -0
  302. package/dist/types/agent/name.d.ts +26 -0
  303. package/dist/types/agent/on-call.d.ts +15 -0
  304. package/dist/types/agent/setting.d.ts +38 -0
  305. package/dist/types/agent/tools.d.ts +31 -0
  306. package/dist/types/agent/webmcp.d.ts +54 -0
  307. package/dist/types/charts/anatomy.d.ts +63 -0
  308. package/dist/types/charts/annotations.d.ts +136 -0
  309. package/dist/types/charts/area-chart.d.ts +128 -0
  310. package/dist/types/charts/bar-chart.d.ts +195 -0
  311. package/dist/types/charts/brush.d.ts +75 -0
  312. package/dist/types/charts/cap.d.ts +21 -0
  313. package/dist/types/charts/cartesian.d.ts +190 -0
  314. package/dist/types/charts/donut-chart.d.ts +131 -0
  315. package/dist/types/charts/format.d.ts +49 -0
  316. package/dist/types/charts/frame.d.ts +30 -0
  317. package/dist/types/charts/funnel-chart.d.ts +146 -0
  318. package/dist/types/charts/geometry.d.ts +141 -0
  319. package/dist/types/charts/grid.d.ts +99 -0
  320. package/dist/types/charts/heatmap.d.ts +139 -0
  321. package/dist/types/charts/histogram.d.ts +126 -0
  322. package/dist/types/charts/index.d.ts +77 -0
  323. package/dist/types/charts/line-chart.d.ts +235 -0
  324. package/dist/types/charts/measured-box.d.ts +50 -0
  325. package/dist/types/charts/messages.d.ts +22 -0
  326. package/dist/types/charts/paths.d.ts +98 -0
  327. package/dist/types/charts/polar.d.ts +47 -0
  328. package/dist/types/charts/radar-chart.d.ts +152 -0
  329. package/dist/types/charts/reading.d.ts +101 -0
  330. package/dist/types/charts/readout.d.ts +50 -0
  331. package/dist/types/charts/scales.d.ts +177 -0
  332. package/dist/types/charts/scatter-chart.d.ts +154 -0
  333. package/dist/types/charts/series.d.ts +133 -0
  334. package/dist/types/charts/sparkline.d.ts +20 -0
  335. package/dist/types/charts/sync.d.ts +49 -0
  336. package/dist/types/charts/treemap.d.ts +159 -0
  337. package/dist/types/charts/types.d.ts +379 -0
  338. package/dist/types/charts/warnings.d.ts +18 -0
  339. package/dist/types/conventions/agent.d.ts +104 -0
  340. package/dist/types/conventions/attrs.d.ts +44 -0
  341. package/dist/types/conventions/audio.d.ts +22 -0
  342. package/dist/types/conventions/autosize.d.ts +18 -0
  343. package/dist/types/conventions/avatar.d.ts +22 -0
  344. package/dist/types/conventions/chart-legend.d.ts +39 -0
  345. package/dist/types/conventions/chart-marks.d.ts +91 -0
  346. package/dist/types/conventions/chart-range.d.ts +51 -0
  347. package/dist/types/conventions/color-input.d.ts +8 -0
  348. package/dist/types/conventions/countdown-clock.d.ts +45 -0
  349. package/dist/types/conventions/countdown.d.ts +35 -0
  350. package/dist/types/conventions/dev.d.ts +13 -0
  351. package/dist/types/conventions/diff.d.ts +57 -0
  352. package/dist/types/conventions/direction.d.ts +33 -0
  353. package/dist/types/conventions/duration.d.ts +193 -0
  354. package/dist/types/conventions/files.d.ts +41 -0
  355. package/dist/types/conventions/follow.d.ts +62 -0
  356. package/dist/types/conventions/highlight.d.ts +34 -0
  357. package/dist/types/conventions/json-tree-branches.d.ts +31 -0
  358. package/dist/types/conventions/kind.d.ts +31 -0
  359. package/dist/types/conventions/list-items.d.ts +35 -0
  360. package/dist/types/conventions/master-detail.d.ts +30 -0
  361. package/dist/types/conventions/menu-choices.d.ts +57 -0
  362. package/dist/types/conventions/menubar.d.ts +109 -0
  363. package/dist/types/conventions/modal-focus.d.ts +17 -0
  364. package/dist/types/conventions/pagination.d.ts +15 -0
  365. package/dist/types/conventions/phone.d.ts +136 -0
  366. package/dist/types/conventions/prompt-token.d.ts +45 -0
  367. package/dist/types/conventions/rail-destinations.d.ts +45 -0
  368. package/dist/types/conventions/rating.d.ts +88 -0
  369. package/dist/types/conventions/relative-time.d.ts +50 -0
  370. package/dist/types/conventions/reveal.d.ts +28 -0
  371. package/dist/types/conventions/roving.d.ts +17 -0
  372. package/dist/types/conventions/sections.d.ts +82 -0
  373. package/dist/types/conventions/size.d.ts +11 -0
  374. package/dist/types/conventions/slug.d.ts +5 -0
  375. package/dist/types/conventions/spacing.d.ts +33 -0
  376. package/dist/types/conventions/table-sort.d.ts +40 -0
  377. package/dist/types/conventions/theme-values.d.ts +122 -0
  378. package/dist/types/conventions/time-text.d.ts +51 -0
  379. package/dist/types/conventions/tooltip.d.ts +12 -0
  380. package/dist/types/conventions/tour.d.ts +69 -0
  381. package/dist/types/conventions/trigger-anchor.d.ts +23 -0
  382. package/dist/types/conventions/variants.d.ts +59 -0
  383. package/dist/types/dates/agent.d.ts +37 -0
  384. package/dist/types/dates/segments.d.ts +158 -0
  385. package/dist/types/icon/brands.d.ts +27 -0
  386. package/dist/types/icon/roles.d.ts +623 -0
  387. package/dist/types/index.d.ts +132 -0
  388. package/dist/types/markdown/index.d.ts +13 -0
  389. package/dist/types/markdown/parse.d.ts +110 -0
  390. package/dist/types/motion/animate.d.ts +49 -0
  391. package/dist/types/motion/environment.d.ts +63 -0
  392. package/dist/types/motion/index.d.ts +29 -0
  393. package/dist/types/motion/patterns.d.ts +138 -0
  394. package/dist/types/motion/values.d.ts +542 -0
  395. package/dist/types/qr/encode.d.ts +59 -0
  396. package/dist/types/qr/index.d.ts +10 -0
  397. package/dist/types/runtime.d.ts +11 -0
  398. package/dist/types/testing.d.ts +28 -0
  399. package/dist/types/toast/agent.d.ts +40 -0
  400. package/dist/types/toast/store.d.ts +142 -0
  401. package/dist/types/vite-env.d.ts +12 -0
  402. package/dist/types/vite.d.ts +51 -0
  403. package/dist/types/webmcp.d.ts +17 -0
  404. package/dist/vite.js +144 -0
  405. package/dist/vite.js.map +1 -0
  406. package/dist/webmcp.js +3 -0
  407. package/package.json +81 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,1056 @@
1
+ # @polymorph/engine
2
+
3
+ ## 1.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - 2f0ddd2: **The contrast law computes APCA itself.** `@polymorph/engine` and `@polymorph/theme` no longer
8
+ depend on `apca-w3`, whose licence limits it to web content, or on `colorparsley`, which that
9
+ package pulled in under the AGPL. The theme holds the published formula (0.0.98G-4g) in
10
+ `packages/theme/src/color/apca.ts`, and a test pins it to a table of values computed with the
11
+ reference implementation, so every pairing's Lc and every emitted token is unchanged. A consumer
12
+ installs two packages fewer, and every remaining production dependency is under a permissive
13
+ licence.
14
+ - Updated dependencies [2f0ddd2]
15
+ - @polymorph/theme@1.0.16
16
+
17
+ ## 1.0.15
18
+
19
+ ### Patch Changes
20
+
21
+ - @polymorph/theme@1.0.15
22
+
23
+ ## 1.0.14
24
+
25
+ ### Patch Changes
26
+
27
+ - 9b60a94: **`ScatterChart` reports nothing where it draws no point.** A row whose x, y or bubble value is
28
+ `null` draws no point for that series. The arrow keys still reach that position, and the live
29
+ region still says it, but Enter, Space and a click there no longer call `onSelect`. Before, they
30
+ called it with `{ index, key, datum }` for a point the plot did not draw. An agent does not list
31
+ such a position among the chart's `items`, and its `choose` refuses one. The engine's
32
+ `scatterChartSelection` returns `null` there, as `heatmapSelection` does at an absent cell.
33
+
34
+ **`BarChart` reports nothing at a walked bar that is not drawn.** With the reading walked to one
35
+ series (Up and Down) at a band where that series' value is `null`, Enter, Space or a click called
36
+ `onSelect` for a bar the plot does not draw. `barChartSelection` returns `null` there. A whole-band
37
+ reading reports the band as before.
38
+
39
+ **An agent action names the list it chooses among.** The agent fence's grammar has an optional
40
+ clause, `action <name> <id|ids> among <state> …`, which names the `choices` state whose choices
41
+ the argument names. A handle's action may carry it (`{ argument: 'id', among: 'series', run }`),
42
+ and so may a description's `agent` block, which every renderer hands to `agentMember` as written.
43
+ With `among`, the bridge checks the value, and whether a choice is marked destructive, against
44
+ that state's choices only, and refuses an id of another list with `invalid-value`. The snapshot
45
+ lists it beside the argument (`{ name: 'toggle', argument: 'id', among: 'series' }`). Without it
46
+ nothing changes, and no existing fence, handle or description changes meaning.
47
+
48
+ - `pnpm registry` fails on `among` on an action that takes no id, on `among` naming a state that
49
+ is not one of the fence's `choices` states, and on an `id` or `ids` action with no `among` in a
50
+ fence that declares more than one `choices` state.
51
+ - The staleness law holds the React member's and the description's `among` to the fence's.
52
+ - The agent conformance law draws an action's probe from the state it chooses among, checks that
53
+ the snapshot lists the same `among`, and checks that an id of another `choices` state is
54
+ refused and changes nothing.
55
+
56
+ **An agent hides and shows a chart's series with its legend.** `AreaChart`, `BarChart`,
57
+ `LineChart`, `RadarChart` and `ScatterChart` draw a legend whose keys hide and show a series. An
58
+ agent now reads them as two states and runs one action, in every web framework:
59
+
60
+ - `series` lists the legend's keys in the legend's order, each `{ id, label }`: the id is the
61
+ series' `key`, and the label is what its key says. `hidden` lists the ids of the series now
62
+ hidden. A chart with one series draws no legend, so both are empty there.
63
+ - `toggle` takes the id of one of `series` (`among series`) and presses its key with the key's own
64
+ click, as a person does, so the chart refits its domains as it does for a person.
65
+ - `choose` takes the id of one of `items` (`among items`), so a series' id is refused there, and
66
+ a mark's id is refused by `toggle`.
67
+ - Such a chart is listed for an agent while a person has something to operate in it: `onSelect`,
68
+ or a legend. A chart with a legend and no `onSelect` is listed now, with `items` empty and
69
+ `choose` refused, where before it registered nothing. `DonutChart` and `Treemap` draw a legend
70
+ that only labels, so nothing changes for them.
71
+
72
+ The engine exports `chartSeries`, `chartHiddenSeries` and `toggleChartSeries`, which read a
73
+ chart's legend keys from its element and press one, for every renderer, and the types
74
+ `ChartSeriesChoice` and `ChartLegendSeries`; each web framework's foundation re-exports them.
75
+
76
+ **An agent brushes a range on a `LineChart` or an `AreaChart`.** A chart with `onBrushEnd` on an
77
+ x it brushes (`time` or `linear` for `LineChart`, `time` for `AreaChart`) has a brush, and an agent
78
+ now reads and uses it through the machine a person's keys drive:
79
+
80
+ - `range-start` and `range-end` are the range a person sees drawn, in rows, the unit `position`
81
+ uses: the row the range was begun on and the row it ends on, or `null` while there is none.
82
+ - `brush` takes the row the range ends on, presses Shift and the arrow toward it once per row,
83
+ as a person does, and commits with Enter, so `onBrushEnd` receives what a person's committed
84
+ range reports. The range starts where a person's would: at the start of a range a person has
85
+ begun, else at the reading position, which `read` sets, else at an end of the chart.
86
+ - A chart without a brush lists both states as `null`, and `brush` throws, saying why. A number
87
+ that is not a row, and a range of one row, are refused too.
88
+ - A chart with a brush is listed for an agent with no `onSelect` and no legend.
89
+
90
+ The engine exports `chartRange` and `brushChartRange`, and the types `ChartRange` and
91
+ `ChartRangeSource`; each web framework's foundation re-exports them. `LineChart` and `AreaChart`
92
+ have a states fixture entry `brushable`.
93
+ - @polymorph/theme@1.0.14
94
+
95
+ ## 1.0.13
96
+
97
+ ### Patch Changes
98
+
99
+ - d84171d: An agent on a running page can read and operate the mounted members through an API, instead of
100
+ clicking or reading screenshots. A member's spec declares what an agent may read and do in an
101
+ `## Agent` section, and nothing else grants access. The bridge is opt-in: a page that does not
102
+ import `@polymorph/engine/agent` does not ship it. `docs/agents.md` describes the bridge for an
103
+ application and the section for a member's author.
104
+
105
+ **The bridge.**
106
+
107
+ `@polymorph/engine/agent` is a new entry point. `createAgentBridge({ confirm, policy, settleMs })`
108
+ returns a bridge with `snapshot()`, `query({ name, text, member })`, `act(steps)`,
109
+ `subscribe(listener)`, `acting` and `dispose()`.
110
+
111
+ - An action the spec does not declare is refused, and the error lists the actions that are
112
+ allowed.
113
+ - A secret value is reported as `{ secret: true }`, and so is any value that holds the text of a
114
+ password field.
115
+ - An action of a destructive instance runs only after `confirm` resolves true. Without a
116
+ `confirm`, it is refused.
117
+ - A policy can hide a member or deny an action. It cannot add either.
118
+ - A member is listed only while its element is in the document, so a closed Dialog, Drawer,
119
+ Popover or ConfirmDialog is not listed, and a step on it answers `unknown-member`. A member in
120
+ content marked `hidden` is not listed either, so a closed panel a renderer keeps in the
121
+ document gives an agent what a removed one does. A step that removes its member's element
122
+ still reports what changed.
123
+ - Each member carries `description`, the text of the elements its control names with
124
+ `aria-describedby`, such as a field's hint and error, when there is any. `query`'s `text`
125
+ matches it. A member that holds a secret, or a password field, gives none.
126
+ - A step that succeeds dispatches `polymorph:agentchange`, bubbling, on the element its member
127
+ names after the step, else on the one it named before if that is still in the document, else
128
+ on the document, with `detail: { id, member, action, changed, source: 'agent' }`, and
129
+ `bridge.acting` is true while its action runs, so a handler can tell an agent's change from a
130
+ person's.
131
+ - `agentTools(bridge)` returns the bridge as three tools, `polymorph_snapshot`,
132
+ `polymorph_query` and `polymorph_act`, for an application's own agent.
133
+ `registerWebMCP(bridge)` registers them with the browser's WebMCP API on
134
+ `document.modelContext` or `navigator.modelContext` and returns the function that unregisters
135
+ them. Where the API is absent it does nothing.
136
+
137
+ **Registration.**
138
+
139
+ `agentMember(handle)`, `agentFill(element, text)` and `agentPress(element)` are new exports of
140
+ `@polymorph/engine` and of every foundation, with the types `AgentHandle`, `AgentAction`,
141
+ `AgentArgumentType` and `AgentArgumentValues`. A member registers a handle while it is mounted.
142
+ `useAgentMember(handle)` in `@polymorph/react` registers a React member on mount, removes it on
143
+ unmount and calls the latest render's closures; `useAgentMember(handle, { unless })` registers
144
+ nothing while `unless` is true. The engine and every foundation also export
145
+ what several renderers share: `menuChoices`, `chooseMenuEntry`, `menubarChoices` and
146
+ `chooseMenubarEntry`; `railDestinations`, `currentRailDestination` and `goToRailDestination`,
147
+ which read an AppShell's destinations from its navigation in the document and press one, with
148
+ the types `RailClasses` and `RailDestination`; `listItems`, `currentListItem` and
149
+ `chooseListItem`, which read a List's items from its list in the document and press one, with
150
+ the type `ListItemChoice`; `jsonTreeBranches`, `jsonTreeExpanded` and `setJsonTreeBranch`, which
151
+ read a JsonTree's branches from its toggles by their JSON Pointer and press one, with the type
152
+ `JsonTreeBranch`; `chartMarks`, `chartPosition`, `readChartPosition` and `chooseChartMark`,
153
+ which read a window of at most `CHART_MARK_CAP` of a chart's marks through its reading, read and
154
+ move the reading's position, and pick a mark as Enter does, with the types `ChartMarkChoice`,
155
+ `ChartMarkReading` and `ChartMarkSource`; a
156
+ Table's sortable headers and its sort
157
+ (`tableSortColumns`, `tableSort`, `pressTableSort`); the notices of the toast store and an answer to
158
+ one (`toastNotices`, `toastDetails`, `dismissToastNotice`, `actOnToastNotice`); and the readers of
159
+ the text an agent sets on a date or duration field (`agentDate`, `agentDateTime`, `agentTime`,
160
+ `agentMonth`, `agentDateRange`, `agentDuration`).
161
+
162
+ A handle may give `withholds`, the element or elements whose registered members are not an
163
+ agent's. The bridge lists, matches and runs none of them, the policy cannot list them, and the
164
+ member is listed in their place. A member that holds a secret withholds its own element.
165
+
166
+ A custom element of `@polymorph/elements-ui` renders its Solid member, so the member inside it
167
+ registers too, and a page that builds the elements with a bundler creates a bridge as any
168
+ application does. A page with no build loads the bridge with `loadAgentBridge`, which
169
+ `polymorph.js` and `polymorph-all.js` export: it resolves to `@polymorph/engine/agent`, built with
170
+ the elements so it reads the registry they write to, and `polymorph.js` fetches it as a chunk of
171
+ its own on the first call.
172
+
173
+ **Registering before the bridge loads.**
174
+
175
+ `@polymorph/engine/webmcp` is a new entry point, an addition that changes no existing one, and
176
+ holds none of the bridge. `registerWebMCPOnCall(load, options)` registers the three tools with the
177
+ browser's WebMCP API at once, and on the first call of any of them calls `load`, a dynamic import
178
+ of `@polymorph/engine/agent`, once, and creates the bridge with `options`. A load that fails
179
+ resolves the call to `{ error: { code: 'failed', message } }`, and the next call loads again.
180
+ `applyAgentSetting(value)` and `AGENT_ATTRIBUTE` (`data-agent`) do what a page's agent setting
181
+ says: nothing without one, `on-call` as `registerWebMCPOnCall`, and `eager`, which loads the
182
+ bridge at once; another value warns, and without a WebMCP API neither registers nor loads
183
+ anything. `agentTools` and the new registration read one list of the tools' names, titles,
184
+ descriptions, schemas and hints.
185
+
186
+ One registration of the tools stands on a page at a time. While one does, a second
187
+ `registerWebMCP`, a `registerWebMCPOnCall` or a page's setting registers nothing and warns in the
188
+ console, where before the browser refused the second registration's names without a word.
189
+
190
+ A page with no build states `<html data-agent="on-call">` or `data-agent="eager"` and writes no
191
+ script: `polymorph.js` and `polymorph-all.js` read it as they load. `polymorph init --framework
192
+ elements` names the setting in the app's `AGENTS.md`, and its example page states none.
193
+
194
+ **The members.**
195
+
196
+ These members register, in every web vocabulary. Their props, markup and defaults are
197
+ unchanged. The system card lists each one's actions and states.
198
+
199
+ - Controls: Button, AvatarButton, ProviderButton, RecordButton, SplitButton, Link, Input,
200
+ Textarea, SearchInput, NumberInput, PhoneInput, PasswordInput, OTPInput, TagInput, InlineEdit,
201
+ ColorInput, Select, Combobox, MultiSelect, TreeSelect, Checkbox, CheckboxGroup, RadioGroup,
202
+ ChoiceCard, SegmentedControl, ModeSwitch, Switch, Slider, Rating, Calendar, DatePicker,
203
+ DateRangePicker, MonthInput, TimeInput, DurationInput, FileUpload and ImageEditor. A Button
204
+ reads `pressed` as `aria-pressed` says it, and as `null` on a Button that is not a toggle, and
205
+ `expanded` as `aria-expanded` says it, and as `null` on a Button that discloses nothing.
206
+ - Overlays: Dialog, ConfirmDialog, Drawer, Popover, Lightbox, Tour, Menu, ContextMenu, Menubar,
207
+ Command, Tabs and Toast. Toast registers on its viewport, which reads the notices on screen
208
+ and dismisses one or runs its action through the toast store.
209
+ - Structure: Accordion, Collapsible, Alert, Banner, Pagination, CursorPagination, Table,
210
+ DataTable, Tree, Stepper, Carousel, FilterBar, SectionNav, TableOfContents, Breadcrumbs, List
211
+ and AudioPlayer. A Table reads its own sortable headers, and its `sort` presses a header's
212
+ control once, so its caller decides the order; the Table a DataTable draws registers nothing. A
213
+ List reads the items that navigate or are picked from its list, with the current one, and its
214
+ `choose` presses an item's link or button, so `onSelect`, `onNavigate` or the browser takes it
215
+ as a person's press; an item that is only read is not a choice.
216
+ A Card with `href` registers its stretched link, which an agent presses as a person clicks
217
+ it, and ErrorSummary lists its errors and follows one to its field with `choose`, reading its
218
+ links with List's `listItems`. A JsonTree reads its open branches and the branches a reader can
219
+ see, each by the JSON Pointer of its value, and its `expand` and `collapse` press a branch's
220
+ toggle.
221
+ - Layout: SplitPane reads its divider's position in percent, as `aria-valuenow` reports it, and
222
+ its `set` moves the divider within the bounds its floors give and commits, as a key press does.
223
+ - Charts: AreaChart, BarChart, DonutChart, FunnelChart, Heatmap, Histogram, LineChart,
224
+ RadarChart, ScatterChart and Treemap, while they have `onSelect`. `items` lists the marks the
225
+ keys reach, labelled with what the live region says there, at most `CHART_MARK_CAP` of them:
226
+ the whole positions around the reading position. `position`, which the figure shows as
227
+ `data-position`, and `count` say where the reading is and how many positions the chart has,
228
+ `read` moves the reading as Left and Right do, and `choose` moves it to a listed mark and
229
+ activates it as Enter does, so `onSelect` receives a person's payload. A chart without
230
+ `onSelect` registers nothing, and Sparkline, which takes none, never does.
231
+ - Conversation: PromptInput, ChatThread, ToolCall, ReasoningDisclosure, AttachmentChip,
232
+ ArtifactPane and ApprovalCard. AppShell registers too: an agent collapses and expands its rail,
233
+ opens and closes its drawer below the breakpoint, reads the application's destinations from
234
+ its navigation, with the current one, and goes to one by pressing its NavItem, so `onNavigate`
235
+ or the browser takes it as a person's press.
236
+
237
+ What an agent is not given:
238
+
239
+ - A password and a one-time code are secret, and no action writes them. PasswordInput's reveal
240
+ toggle is not an agent's.
241
+ - No action confirms for a person. ConfirmDialog declares `cancel` only and withholds its
242
+ confirm Button, its phrase field and the Dialog it draws. ApprovalCard declares no action and
243
+ withholds its Buttons.
244
+ - A Button with `tone="danger"`, and a `danger`-toned entry of a Menu, ContextMenu, Menubar or
245
+ SplitButton, asks a person to confirm.
246
+ - RecordButton lets an agent stop a recording and never start one. FileUpload lets an agent
247
+ remove or retry a file and never add one. AudioPlayer and ImageEditor are read only.
248
+ - CopyButton, Tooltip, HoverCard and FormField give an agent nothing, and each spec says why.
249
+ Plan and ChatMessage are not registered, so they stay server components.
250
+ Citation and SourceList are not registered either: each of their links opens a new tab,
251
+ which an agent's press cannot open, and their words are on the page.
252
+ - The Popover ColorInput draws for its picker registers nothing, and ColorInput withholds its
253
+ panel, so an agent sees one ColorInput.
254
+
255
+ A React member that passed `value` or `defaultValue` straight to its substrate now holds the
256
+ value itself and keeps the substrate controlled, controlled when the prop is given, so an
257
+ agent's action and a person's reach the same handler in both forms: Checkbox, Switch,
258
+ RadioGroup, SegmentedControl, ChoiceCard, Select, Slider, Tabs, ReasoningDisclosure and
259
+ ToolCall. A native `form.reset()` now resets a Checkbox row's state attribute too.
260
+
261
+ **The tooling.**
262
+
263
+ - `@polymorph/registry`: each member carries an `agent` field, the statements of its spec's
264
+ `agent` fence, or `null` for a member agents cannot see. `@polymorph/registry/agent` exports
265
+ the grammar, in which a `number` state reads `null` while the member holds none, as an `id`
266
+ state does, and an action may say `presses <part>`, the part whose element it presses with the
267
+ element's own click. The coverage law fails on a control or an overlay whose spec has no decided
268
+ `## Agent` section, and the staleness law on a fence the code does not match.
269
+ - `@polymorph/shells`: a description takes an `agent` block (`on` or `element`, `state`,
270
+ `actions`, `secret`, `destructive`, `withholds`), which each renderer writes as a mount effect
271
+ that registers the instance. A compound part may give the block instead, which registers under
272
+ its member's name (Toast's viewport). A member that lends its identity reads the element the member it
273
+ lends to hands back, as `borrowed`; the Solid foundation exports `BORROWED` and
274
+ `BorrowedHolder`, and the Angular foundation `BORROWED`, `BorrowedHolder`, `handBack`,
275
+ `borrowedHolder`, `lenderHolder` and `KEEPS_HOLDER`.
276
+ - `@polymorph/conformance`: the runner executes every statement of an agent fence against every
277
+ renderer, with a bridge installed; `agentConformanceLaw` holds a shell's fences, and
278
+ `conformanceLaw` calls it. `WINDOW_SIZES` lists the fixture entries the runner mounts at a
279
+ window size other than the default, through the harness's new `viewport`, so an action that
280
+ exists only below a breakpoint is checked there.
281
+ - `@polymorph/engine/testing` exports `agentRegistrations()`, every registered member's id, name
282
+ and elements, withheld ones included.
283
+ - `pnpm new:member` writes the `## Agent` section with a placeholder the coverage law refuses.
284
+
285
+ - 508275a: No chart draws an x-axis label past its own box. A label is centred on its tick, and the labels
286
+ on a tick at either end of the plot were drawn half outside the chart: the last value label of a
287
+ horizontal or diverging `BarChart`, the last x label of `LineChart`, `AreaChart`, `ScatterChart`
288
+ and `Histogram`, and in a right-to-left document the first. A band label wider than the room
289
+ beside its band did the same on `BarChart` and `Heatmap`. Such a label is now anchored at its end
290
+ of the plot: its start sits on a tick at the plot's start and its end on a tick at the plot's
291
+ end. Ticks, gridlines and marks do not move. The label beside an anchored one gives way when the
292
+ two would come nearer than the gap that keeps two labels from reading as one. On an axis that
293
+ drops whole labels to keep them apart (a band axis, `Histogram`'s edges) its tick is dropped with
294
+ it. On a value or a time axis the tick and its gridline stay, and the tick draws no label.
295
+
296
+ The engine's `AxisTick` has an optional `align` (`'start' | 'end'`), which the chart frame of
297
+ every web framework renders as `data-align` on the tick, and the chart axis recipe anchors the
298
+ label from it.
299
+
300
+ Band labels thinned to fit no longer put the last label one band after the label before it, where
301
+ the two touched or overlapped. The last label takes the place of the one before it instead.
302
+
303
+ - 73837b5: `MasterDetailPage` is a new page archetype: a list of items of one kind beside the detail of the
304
+ selected one, for an inbox, a notifications page, an audit log or a file browser. It takes
305
+ `title`, `description` and `actions` as PageHeader does, the `list` (a List, Table or Tree with its
306
+ FilterBar and pagination, the selected item marked `current`) named by `listLabel`, the selected
307
+ item's `detail`, an `emptyState` for the detail pane while nothing is selected, and `backLabel`
308
+ and `onBack` for the way back on a phone. It fills AppShell's content region, as ConversationPage
309
+ does, and the list and the detail scroll on their own. At or above a 48rem page the two sit side
310
+ by side in a SplitPane; below it the page draws the list, or the detail under the way back, and
311
+ `onBack` is where the application clears its selection. Focus moves only when the element that
312
+ held it is no longer drawn. A page that draws the selected item under a table can move to it.
313
+
314
+ The engine and every foundation export `masterDetailFocus`, `masterDetailHolds` and
315
+ `MASTER_DETAIL_PART`, the focus rule every renderer's MasterDetailPage shares. The SwiftUI and
316
+ Compose contracts gain `PMMasterDetailPageProps` and its rendering protocol, and both platforms
317
+ draw the page: two panes from a 48rem page, and below it the list, or the detail under the way
318
+ back. On iOS the way back is the page's own button and no system gesture. The elements vocabulary
319
+ has it as `<poly-master-detail-page>`.
320
+
321
+ - 709d7b3: A `TableOfContents` marks a section that is drawn after the list without waiting for a scroll.
322
+ `watchSections` now watches the document while an item's section is missing, and decides the
323
+ current section again when it appears. Before, a list drawn ahead of its page's sections marked
324
+ nothing until the reader scrolled, which is what a page of `<poly-table-of-contents>` and
325
+ `<poly-heading id>` elements showed. A list whose sections are all in the document is unchanged.
326
+ - @polymorph/theme@1.0.13
327
+
328
+ ## 1.0.12
329
+
330
+ ### Patch Changes
331
+
332
+ - 6d714a7: `clockTime(seconds, locale?)`, `spokenDuration(seconds, locale?)` and
333
+ `pauseOtherPlayers(audio)` are new exports of the engine, and of every foundation, which
334
+ re-exports the engine.
335
+
336
+ `clockTime` writes a length as a media clock: `65` is `1:05`, and from an hour on the hours come
337
+ first, `3725` is `1:02:05`. The digits are the locale's numerals. `spokenDuration` writes the
338
+ same length in the locale's words, from `Intl`'s unit names joined as a list: `65` is
339
+ `1 minute, 5 seconds` in English. Both drop the fraction of a second, and both read a value that
340
+ is not a finite length above zero as zero.
341
+
342
+ `pauseOtherPlayers` pauses every other AudioPlayer's recording in the document, in whatever
343
+ framework it is drawn. Media the application plays itself is left alone. AudioPlayer calls it
344
+ when it starts, so one recording plays at a time.
345
+
346
+ - 28aeda0: `BarChart` takes `lines`: series drawn as lines over the bars, on the bars' value axis and in
347
+ their unit, such as a moving average of the bars' own measure that the app computes. Each line
348
+ is LineChart's 2px stroke through the categories' centres, with a ringed point at every value,
349
+ drawn over the bars and the annotation ink. A `null` breaks the line.
350
+
351
+ The lines take the slots after the bars' and count toward the eight. They join the legend with a
352
+ line key, the tooltip, the live region, the Up/Down walk after the bar series, `onSelect`, the
353
+ table twin and the summary, all in the chart's `y.format`. `mode` stacks the bars only, and a
354
+ line reads against the stack's total. A horizontal chart draws no lines and warns.
355
+
356
+ A chart has one value axis. A second measure in another unit, such as a rate beside counts, is a
357
+ second chart over the same rows (`docs/charts.md`). A constant target is still `baseline`.
358
+
359
+ A chart without `lines` draws exactly what it drew before. The engine exports `barLinePoints`,
360
+ the line's points over the band axis, and the `BarLine` and `BarLinePoint` types. The SwiftUI
361
+ `PMBarChart` draws the lines with Swift Charts. Android has no chart rendering, as before.
362
+
363
+ - f918ed3: A chart label is no longer cut by the top edge of its plot.
364
+
365
+ - A `LineChart` end label sits above its endpoint, and below it where the plot has no room above. Before, a series that ended at the top of its domain lost its end label: the plot cut it.
366
+ - The label of a `line`, `band` or `point` annotation, and of a `baseline`, follows the same rule in `LineChart`, `AreaChart`, `BarChart` and `ScatterChart`. A band that reaches the top of the domain now carries its label inside the band.
367
+ - End labels are still dropped together when two would collide. The collision is now decided between the labels' positions, so a label drawn below its endpoint that meets the next series' label drops the set.
368
+ - `endLabelsFor` returns one more field on each label, `baseline`, the text's baseline in px. `y` is still the endpoint.
369
+
370
+ Every web renderer draws these labels from the engine's model, so the change reaches React, Vue, Svelte, Solid and Angular.
371
+
372
+ - b209e98: `Countdown` is a new member in every web vocabulary: the time left until a moment, ticking each
373
+ second, for a code that expires, a session that ends, or a retry or a resend that unlocks. It
374
+ writes `4:59`, then `1:02:05` from an hour, in tabular figures and the locale's numerals, until
375
+ `0:00`, and calls `onEnd` once when the moment is reached, or once after mount when the moment
376
+ has already passed. It is not RelativeTime, which writes a moment as words and never refreshes.
377
+
378
+ `Countdown` takes `until` (an ISO-8601 instant, not a number of seconds), `label` (what it counts
379
+ to, the timer's accessible name), `onEnd`, `announce`, `locale` and `messages`. The timer is
380
+ `role="timer"` and says the time in words, so a screen reader does not hear every second. With
381
+ `announce`, a polite line says the time left at one minute and at ten seconds. The member holds
382
+ no button: the control that waits for the end is the application's, enabled from `onEnd`.
383
+
384
+ Every Countdown on a page shares one clock with one timer, which wakes on the second of each
385
+ countdown's time left, waits only for an end while the document is hidden, and reads the time
386
+ again when the document is shown. The engine exports what the members use: `countdownMoment`,
387
+ `countdownLeft`, `countdownClock`, `countdownSpoken` and `followCountdown`.
388
+
389
+ The SwiftUI and Compose renderings of `Countdown` are not written yet. `Countdown` is in both
390
+ platforms' pending lists, and both contracts are generated.
391
+
392
+ - 51e8566: `diffLines(before, after)` and `diffRuns(rows, context)` are new exports of the engine, and of
393
+ every foundation, which re-exports the engine.
394
+
395
+ `diffLines` compares two texts line by line and returns one row for each line:
396
+ `{ kind: 'same' | 'added' | 'removed', text, beforeLine?, afterLine? }`. A missing, `null` or
397
+ empty text has no lines. `\r\n` ends a line as `\n` does, and a final line ending adds no empty
398
+ line. The rows are a longest common subsequence of the lines, so the same texts always give the
399
+ same rows. Within one change, the removed lines come before the added ones. The comparison
400
+ between the lines the two texts start and end with is bounded: past `DIFF_LINES_LIMIT`
401
+ (1,000,000) old lines × new lines, every old line there is removed and every new line added.
402
+
403
+ `diffRuns` groups those rows for a reader. It keeps `context` unchanged lines beside each change
404
+ (3 by default) and returns the rest as collapsed runs, each `{ key, collapsed, rows }`. A run
405
+ collapses only when it hides two lines or more. `Infinity` collapses nothing.
406
+
407
+ `Diff` draws both. An application that needs the rows for something else, such as a count of
408
+ changed lines, calls them directly. The types are `DiffRow`, `DiffRowKind` and `DiffRun`.
409
+
410
+ - e708348: `DurationInput` is a new member in every web vocabulary: a field for a length of time, such as
411
+ a session lifetime, a retention period or a timeout. It holds whole seconds and shows them as
412
+ counts of days, hours, minutes or seconds, each a spinbutton with its unit's word beside it,
413
+ so a reader sees "7 days" where a number field labelled "(seconds)" shows 604800.
414
+
415
+ `value`, `defaultValue` and `onChange` are whole seconds, and `null` is the empty field.
416
+ `onChange` reports committed values, as NumberInput's does: an arrow key commits at once, and
417
+ typed digits commit when focus leaves the field or on Enter. `min` (0 by default) and `max`
418
+ hold every commit, and the arrows stop at them. `units` chooses the counts, days, hours and
419
+ minutes by default. The largest count shown has no ceiling, so 36 hours is lawful when hours
420
+ are the largest. An arrow carries into the next count: one minute more than 59 minutes is an
421
+ hour. A typed count stays under the next unit: 90 cannot be typed into the minutes while hours
422
+ show. A value the counts cannot write exactly is drawn rounded to the smallest unit and kept
423
+ as it was until the reader changes it. `name` posts whole seconds as a decimal string. The
424
+ unit words, the digits and each count's name come from `Intl` in `locale`, and the one word
425
+ the member writes itself, what an empty count says, is `messages.empty`. The label, the
426
+ description and the error are FormField's.
427
+
428
+ It is not TimeInput, which holds a time of day, and it has no presets: a screen that offers a
429
+ few fixed lengths uses `Select` or `RadioGroup`.
430
+
431
+ The arithmetic is new in the engine, and so in every foundation, which re-exports it:
432
+ `durationKey` (what a key does in a count), `durationSegments` (the counts a draft draws),
433
+ `durationDraft` (seconds as counts), `typeIntoDuration` and `commitDuration`, with the types
434
+ `DurationUnit`, `DurationDraft`, `DurationFieldOptions`, `DurationSegment`, `DurationKey`,
435
+ `DurationKeyResult` and `DurationMessages`.
436
+
437
+ The SwiftUI and Compose renderings are not written yet. `DurationInput` is in both platforms'
438
+ pending lists, and both contracts are generated.
439
+
440
+ - f69f55e: `followEnd(region, content, report)` and `jumpToEnd(region)` are new exports of the engine, and
441
+ of every foundation, which re-exports the engine. `ChatThread` follows its newest turn with them
442
+ in every web vocabulary, and `LogView` follows its newest line with them.
443
+
444
+ `followEnd` keeps a scroll container at its end while the element inside it grows, for as long
445
+ as the reader is at the end: within `FOLLOW_SLACK_PX` (24) of it. A reader who scrolls away is
446
+ left where they scrolled. `report` receives `{ detached, overflowing }` once at the start and
447
+ again each time either changes, and `overflowing` counts both axes. It returns the function that
448
+ stops following. Without a container, without content or without `ResizeObserver` it does
449
+ nothing. `jumpToEnd` moves the container to its end and follows again from that call, which is
450
+ what a "Jump to latest" control does.
451
+
452
+ `ChatThread`'s jump control now follows from the press, so a turn that grows in the frame
453
+ before the browser reports the jump's scroll is followed too. A thread that is wider than its
454
+ box is a tab stop, as a taller one already was.
455
+
456
+ - 766b5fd: `FunnelChart` is a new chart member in every web vocabulary: the count that survives each stage
457
+ of an ordered process, such as a signup, a checkout or a ticket from opened to resolved. It
458
+ takes `label` and `stages`, where a `FunnelStage` is `{ key, label, value }`, and the tier's
459
+ `format`, `size`, `locale`, `tooltip`, `onSelect`, `loading` and `messages`.
460
+
461
+ Each stage is one horizontal bar from the inline start, its length its value against the
462
+ largest stage, with its label in a column before it and its value and share of the first stage
463
+ after it. Between two bars it writes the share of the stage above that reached the stage below:
464
+ "62% continued". Stages are drawn as given. A stage larger than the one before it dev-warns and
465
+ is not clamped or reordered. A first stage of zero has no shares, and a stage of zero has no
466
+ step after it. The tooltip, the live region and the table twin (stage, value, share,
467
+ continued) state every number the plot has no room for. It is one series, so it has one colour
468
+ and no legend.
469
+
470
+ `funnelChartModel`, `funnelChartReadout` and `funnelChartSelection` are new exports of
471
+ `@polymorph/engine/charts`, and of every foundation, which re-exports it, with the types
472
+ `FunnelStage`, `FunnelChartInput`, `FunnelChartModel`, `FunnelPlot`, `FunnelBar` and
473
+ `FunnelText`.
474
+
475
+ `ChartMessages` has four new keys, with English defaults in `DEFAULT_CHART_MESSAGES`:
476
+ `funnelSummary`, `stageColumn`, `continuedColumn` and `continued`. A host that spreads the
477
+ defaults is unaffected. A host that writes its own whole catalog adds the four keys, because the
478
+ catalog takes all keys or none.
479
+
480
+ On iOS, `PMChartMessages` takes the same four, and `PMSpecDefault.chartMessages` gives their
481
+ English. `FunnelChart` is native on iOS and its SwiftUI rendering is not written yet: it is in
482
+ the pending list, and its contract is generated. Android marks it absent, with `Table`, as it
483
+ does every chart member.
484
+
485
+ - 982e684: `Highlight` is a new member: the parts of a text that match a search, marked. It is phrasing
486
+ content, so it sits inside a Text, a table cell or a description's detail and takes the font
487
+ around it. The app passes `text` and either `query`, one term or several, matched as written and
488
+ never as a pattern, with case folded by `locale`, or `ranges`, the `[start, end]` offsets its
489
+ search engine returned, which take the query's place. Marks that overlap or touch are one mark,
490
+ and a range is cut at the text's end. An app that printed its search engine's highlight data as
491
+ JSON, because nothing drew it, passes it here.
492
+
493
+ A mark is a `<mark>` in `warning.text` on `warning.subtle`, a pair the contrast law measures in
494
+ every pairing, at the emphasis weight, so it is marked by more than colour. A screen reader reads
495
+ the text once, as it is, and hears no mark.
496
+
497
+ `highlightRuns(text, { query, ranges, locale })` is a new export of the engine, and of every
498
+ foundation, which re-exports the engine. It returns the text as runs, `{ text, marked }`, which
499
+ every framework's Highlight draws.
500
+
501
+ The SwiftUI and Compose renderings are pending.
502
+
503
+ - 2ffb66b: `Menubar` is a new member in every web vocabulary: an application's command menus in one row, as
504
+ a desktop application's File, Edit and View. It is for an editor, a canvas or a document tool
505
+ whose commands are too many for one Menu. It is not navigation: a title never links.
506
+
507
+ `Menubar` takes `label`, which names the bar, `menus`, each a `MenubarMenu` with a `label`, Menu's
508
+ `entries` and an optional `disabled`, and `defaultOpen`, the title whose menu is open on mount.
509
+ Each menu is Menu's panel with Menu's entries, and each entry reports through its own handler, as
510
+ in Menu. The bar is one tab stop. ArrowRight and ArrowLeft move along the row in the reading
511
+ direction and stop at the ends, Home and End go to the first and the last title, and a letter
512
+ goes to the title that starts with it. ArrowDown, Enter and Space open a menu on its first entry
513
+ and ArrowUp on its last. In an open menu, ArrowRight and ArrowLeft open the neighbour's menu.
514
+ While a menu is open, the title a mouse moves onto opens its own. A long row scrolls inside its
515
+ box. Below `30rem` the bar is one Menu behind one overflow Button named by `label`, each menu a
516
+ group under its title. The member is absent on iOS and Android, where the substitute is Menu.
517
+
518
+ The engine exports the model every framework's Menubar runs: `menubarStep`, `menubarStop`,
519
+ `menubarOpens`, `menubarHandOff`, `menubarEntries`, `roveMenubar`, `menubarNeighbour` and
520
+ `menubarEdge`, with their types. Each foundation re-exports them.
521
+
522
+ In the Vue, Svelte, Solid and Angular vocabularies, a Menu's, a ContextMenu's and a SplitButton's
523
+ submenu row now takes focus when the keys highlight it, as every other row does, and closing the
524
+ submenu returns focus to its row when focus is still in the submenu, as Radix's submenu does.
525
+
526
+ - d9713d4: `monthDraft(value)`, `monthFieldValue(draft)`, `monthOutOfBounds(value, { min, max })` and
527
+ `segmentValueText(segment, locale, empty)` are new exports of the engine, and of every
528
+ foundation, which re-exports the engine. The first three read and write a month field's
529
+ `YYYY-MM` text over the segmented field's draft, and compare it with its bounds. The last is what
530
+ a segment says as its value: its text, a month's number and name (`7 – July`), or the caller's
531
+ word for an empty segment.
532
+ - 49ab024: The React packages render on a server and run in Next.js's App Router, built by Turbopack or by webpack. `docs/consuming.md` has a section for a Next.js application, and `pnpm gate:next` builds one from the published builds as the last step of `pnpm gate`.
533
+
534
+ - **Each module is built once.** `@polymorph/react-ui` no longer ships a second copy of its modules without their stylesheet imports under `dist/node/`, and its `exports` have no `node` condition. A built module imports its stylesheet through the package's `imports` map (`#stylesheet/controls/button.css`), which hands a bundler the stylesheet and Node an empty module. Before, Next.js resolved a client component by the `node` condition while it built its server and carried that copy to the browser. A page whose members only server components imported then shipped no member CSS, and a page could hold two copies of a member and of its context. Vitest, jsdom and a plain server render load the package as they did, with no configuration.
535
+ - **An entry point has no side effect.** Each member's stylesheet module imports the base layer, and `Icon` imports its own stylesheet, so no entry point imports one and a bundler that follows a name to its module loads nothing else. No application needs to import `@polymorph/react/style.css`. The entry stays, and an application that imports it loads the same file once.
536
+ - **Every state of every member renders on a server.** The presence components behind the overlays read the theme from the document during render, and `MultiSelect` read its list's elements. The presence components now render without motion on a server and for the hydration of that markup, and read the theme once mounted, and `MultiSelect` reads its list in an effect. `@polymorph/engine/motion` exports `stillMotionEnvironment`, the environment they render with, and `readMotionEnvironment` returns it where there is no document.
537
+ - **A server component reads a compound member's parts.** `Tabs.Content`, `Table.Row` and Table's other parts, `Avatar.Group`, `SettingsRow.Group` and AppShell's parts were `undefined` in a server component, because the member attached them in a client module. Each of these members is now two modules: the member, which a server component can read, and its parts (`overlays/tabs-parts.tsx`), which carry `'use client'`. A vendored install receives the parts modules on `polymorph update`.
538
+ - **A member reads an element a server component passed it.** A FormField's control, a Dialog's `trigger` and a SettingsRow's `control` arrive in a client member as a reference React may still be loading. Reading one threw in Next.js's development server, and could in production while a client module loaded. `@polymorph/react` exports `useSupplied`, which returns the element once it has loaded. A member of your own that reads or clones an element it is passed calls it first.
539
+
540
+ A Next.js application that builds with webpack lists the vocabulary in `experimental.optimizePackageImports`. Without it the pages render correctly and each loads the whole vocabulary.
541
+
542
+ - b9e5208: `PhoneInput` is a new member in every web vocabulary: a phone number, entered as a country and
543
+ a national number and reported as one E.164 string (`+442079460958`). It takes `value`,
544
+ `defaultValue` and `onChange`, `defaultCountry` (ISO 3166-1 alpha-2), `countries` to restrict
545
+ and order the list, `locale` for the country names, and Input's `size`, `disabled`,
546
+ `readOnly`, `invalid`, `name` and `id`. FormField names, describes and marks it, as it does
547
+ TimeInput. The words it writes itself are in `messages` (`country`, `showCountries`,
548
+ `countriesShown`, `noCountry`), with English defaults.
549
+
550
+ `onChange` reports commits, never drafts, as NumberInput does: the reader leaving the number or
551
+ pressing Enter in it, choosing a country, or pasting a number written with its calling code. It
552
+ reports the empty string while the national number has no digits. The national field keeps
553
+ digits within the E.164 limit of fifteen, and one leading trunk zero is dropped in a region
554
+ that dials one, so "020 7946 0958" in the United Kingdom is `+442079460958`. A pasted
555
+ `+44 20 7946 0958` sets the country and the number. A calling code that several regions share
556
+ keeps the field's country when it has the code, else takes the first of `countries` with it,
557
+ else the code's main region. `name` serializes the E.164 value, and the number carries
558
+ `autocomplete="tel-national"`.
559
+
560
+ The country is a Combobox of every region's calling code and name, in `locale`, from
561
+ `Intl.DisplayNames`; no flag is drawn. PhoneInput checks the form of a number only: whether it
562
+ exists, and its length in its country, are the application's to check.
563
+
564
+ `@polymorph/engine` exports the model every framework's PhoneInput calls: `phoneCallingCode`,
565
+ `phoneCountries`, `phoneCountryOptions`, `phoneDefaultCountry`, `phoneDraft`, `phoneNational`,
566
+ `phoneValue`, `splitPhone`, `readPhone`, `commitPhone`, `isPhoneValue` and
567
+ `PHONE_MAX_DIGITS`. An application can call `splitPhone` and `phoneValue` to read and build an
568
+ E.164 string the way the member does.
569
+
570
+ The SwiftUI and Compose renderings are not written yet. `PhoneInput` is in both platforms'
571
+ pending lists, and both contracts are generated.
572
+
573
+ - 3dc5f0f: `PromptInput` takes `triggers`, in every web vocabulary: characters that open a list of the app's
574
+ suggestions, such as `@` for people and `/` for commands. A composer without `triggers` is
575
+ unchanged.
576
+
577
+ ```tsx
578
+ <PromptInput
579
+ label="Message"
580
+ onSubmit={send}
581
+ triggers={[
582
+ {
583
+ char: '@',
584
+ label: 'People',
585
+ options: people,
586
+ onSelect: (person) => mention(person.id),
587
+ },
588
+ { char: '/', label: 'Commands', at: 'start', options: commands },
589
+ ]}
590
+ />
591
+ ```
592
+
593
+ A trigger is `{ char, label, options, at?, filter?, loading?, onQueryChange?, onSelect? }`, and
594
+ an option `{ id, label, description?, icon?, insert? }`. The list opens while the caret is in a
595
+ token: the character at the start of the prompt or after whitespace (`at: 'word'`, the default),
596
+ or only as the prompt's first character (`at: 'start'`), followed by the query, which holds no
597
+ whitespace. The member filters the options by the query as Combobox does; `filter: false` shows
598
+ the app's own results, which it loads from `onQueryChange` while `loading` is set.
599
+
600
+ The prompt stays plain text. Enter, Tab or a press picks the active option: the typed token is
601
+ replaced by the option's `insert`, or by the character and the label (`@Ada Lovelace`), and a
602
+ space, and the trigger's `onSelect` is called with the option. `insert: ''` removes the token and
603
+ writes nothing, for a command the app runs at once. The composer reports picks only: an app that
604
+ sends mentions checks, when the prompt is sent, which picked options' text is still in it.
605
+
606
+ While the list is open, ArrowUp and ArrowDown move the active option. Enter does nothing while the
607
+ trigger is `loading` with no option shown, and sends the prompt when nothing matches, as with the
608
+ list closed. Escape closes the list and keeps the text; inside a Dialog the dialog stays open until
609
+ the next Escape. Focus stays in the field, which carries
610
+ `aria-autocomplete="list"`, `aria-haspopup="listbox"`, and, while the list is open,
611
+ `aria-controls` and `aria-activedescendant`. A polite live region says how many options there
612
+ are. `PromptInputMessages` gains three optional strings: `suggestions(count)`,
613
+ `loadingSuggestions` and `noSuggestions`. The list opens above the composer, or below it when the
614
+ viewport has more room below, at the composer's width at every width. It is drawn in the
615
+ composer's root, so the composer's container must not clip it. The types are `PromptTrigger` and
616
+ `PromptTriggerOption`.
617
+
618
+ A composer focused on mount by `autoFocus` now has its caret at the end of its prompt in React,
619
+ as it already had in the other vocabularies.
620
+
621
+ `promptToken(text, caret, triggers)` and `promptPick(text, token, caret, insertion)` are new
622
+ exports of the engine, and of every foundation, which re-exports the engine: the token the caret
623
+ is in, and the text and caret a pick leaves. The types are `PromptToken` and
624
+ `PromptTokenTrigger`.
625
+
626
+ The SwiftUI and Compose contracts carry `triggers`, `PMPromptTrigger` and
627
+ `PMPromptTriggerOption`, and neither rendering draws a list: an `@` or a `/` stays text in the
628
+ prompt on iOS and Android.
629
+
630
+ - 9f8c97f: `rating` is a new icon role: one mark of a score. It draws lucide's `star`, and on Apple and
631
+ Android platforms the `star` symbol. It shares the glyph with `favorite`, as `close` and
632
+ `clear` share theirs: marking a thing to keep is not scoring it, and either can change glyph
633
+ without the other. `IconRole` includes it and every foundation's `Icon` draws it. The icon
634
+ rule no longer rewrites an import of the star glyph, because two roles draw it: it reports the
635
+ import and names both. Rating draws it.
636
+ - 9f8c97f: `Rating` is a new member in every web vocabulary: a score out of a few marks, five stars by
637
+ default, that a reader sets ("Rate this answer") or reads ("Average rating: 4.3 out of 5").
638
+
639
+ Set, it is a radio group with one radio per mark, named for the value it sets ("3 stars").
640
+ `value`, `defaultValue` and `onChange` are a whole number from 1 to `max`, and `null` for no
641
+ rating. A press on the chosen mark clears it, unless the rating is required (`aria-required`,
642
+ which FormField sets). The arrows move and choose, following the document's direction, Home
643
+ and End choose the first and the last mark, and the arrows stop at the ends. `name` posts the
644
+ value. Shown (`readOnly`), it is one image named by a sentence, and it draws any value to one
645
+ decimal place, with the mark the fraction lands in part filled. `max` is 2 to 10, `size` is the
646
+ marks' icon size, and `messages` with `locale` writes the marks' names and the sentence. Filled
647
+ and empty marks differ in shape, a solid star against an outline.
648
+
649
+ It is not RadioGroup, whose options are labelled rows, and not Meter, which measures against a
650
+ limit. Thumbs up and down under a reply are two pressed Buttons.
651
+
652
+ Its model is new in the engine, and so in every foundation, which re-exports it: `ratingModel`
653
+ (the marks, their fills and names, and the shown sentence), `ratingPress` (the clear rule),
654
+ `ratingStep` and `roveRating` (the keys), `ratingMax` and `RATING_DEFAULT_MAX`, with the types
655
+ `RatingModel`, `RatingMark`, `RatingFill`, `RatingOptions`, `RatingWords` and
656
+ `RatingKeyEvent`.
657
+
658
+ The SwiftUI and Compose renderings are not written yet. `Rating` is in both platforms' pending
659
+ lists, and both contracts are generated.
660
+
661
+ - 96daa65: `record` is a new icon role: start a recording of the reader's voice. It draws lucide's `mic`,
662
+ and on Apple and Android platforms the `mic` symbol. `IconRole` includes it, every foundation's
663
+ `Icon` draws it, and the icon rule's fix names it for an import of the microphone glyph.
664
+ RecordButton draws it at rest.
665
+ - 3b0b47f: A selected table row can be read in a system with no hue. `plain`, and any system on the
666
+ `neutral` or `zinc` palette, draws `selection.bg` as its ink, the colour of primary text. Table
667
+ filled a selected row with it and left the cells their own colours, so the row's text, its links
668
+ and the box of its checkbox could not be seen. DataTable's bulk bar had the same fill under its
669
+ buttons.
670
+
671
+ The selection family has two more roles, `selection.surface` and `selection.surfaceHover`
672
+ (`--pm-selection-surface`, `--pm-selection-surface-hover`). They are the fill of a selected part
673
+ that holds content of its own, and the contrast law holds `text.primary`, `text.secondary`,
674
+ `text.muted` and `accent.text` on them, as on a background. With a hue they are the colours
675
+ `selection.bg` and `selection.bgHover` already have, so nothing drawn changes. With none they are
676
+ a neutral wash past the deepest background of the mode, two steps in light and one in dark, the
677
+ same at rest and under the pointer. A law holds the wash a lightness step (ΔL ≥ 0.025) from every
678
+ background, so a selected row can be told from a hovered one. The wash goes no deeper than the
679
+ temperament's text can be read on, which leaves a `soft` and `tinted` system (`flint`,
680
+ `glassmorphic`) one step from its hover fill on the `neutral` and `zinc` palettes in light mode.
681
+ `selection.bg` stays the fill of a part that holds one label in `selection.text`: a
682
+ calendar day, a nav item, a command.
683
+
684
+ - Table's selected row, DataTable's bulk bar, List's current item and a chart's brushed range
685
+ fill with the selected surface. The bulk bar's count takes `accent.text`. The SwiftUI and
686
+ Compose Table, DataTable and LineChart do the same, and their cells no longer switch to
687
+ `selection.text`.
688
+ - Selected text (`::selection`) takes `selection.text` on `selection.bg`. Before, it kept its own
689
+ colour, which is the fill's colour in a system with no hue. In a system with a hue, selected
690
+ text is now drawn in the selection's text colour.
691
+ - Because the new fills bear text, the engine moves `text.secondary` where it would fall under
692
+ its floor on them. On the `neutral` and `zinc` palettes in light mode it is darker by two or
693
+ three hundredths of lightness in `flint`, `glassmorphic`, `harbor`, `journal`, `pastel`, `pop`,
694
+ `press` and `terminal`. In `journal` it is darker by one hundredth on every other palette in
695
+ light mode. In dark mode `text.secondary` and `text.muted` are lighter by one or two hundredths
696
+ on `neutral` and `zinc` in `flint`, `glassmorphic` and `journal`. `plain`, `desktop`, `dew` and
697
+ `pebble` keep every text colour on every palette.
698
+ - A native theme written by `pnpm emit:native` or `polymorph emit` has two more colours. Emit it
699
+ again with this release: `PMColors` takes `selectionSurface` and `selectionSurfaceHover` on
700
+ SwiftUI, Compose and Dart.
701
+
702
+ A recipe that fills with `--pm-selection-bg` must set `--pm-selection-text` in the same rule. A
703
+ law reads every recipe for it.
704
+
705
+ - 0936316: `TableOfContents` is a new member in every web vocabulary: the list of links to the sections of
706
+ one long page ("On this page"), with the section the reader is in marked. It takes `label` (the
707
+ landmark's name, drawn above the list), `items` (`{ id, label, level? }`, where `id` is the id of
708
+ the section's element in the document and `level: 2` draws a subsection one step in, in a list
709
+ inside its section's item) and `onCurrentChange`, called with the current section's id or
710
+ `null`. Each item is a real `<a href="#id">`; the current one carries `aria-current="location"`
711
+ and the selection treatment SectionNav gives its current item.
712
+
713
+ The current section is the last one whose top has reached a line a quarter of the way down the
714
+ page that scrolls around the sections, or the last section when the page is scrolled to its end.
715
+ A click marks its item at once, holds the mark while the browser scrolls to the section, and
716
+ moves focus to the section, which takes `tabindex="-1"` only while it has focus. An item whose
717
+ section is not in the document is drawn and never marked. The member does not scroll and does
718
+ not stay in view on its own: the page's CSS owns `scroll-behavior`, and the app places the list.
719
+
720
+ It is not SectionNav, whose items are pages the router marks.
721
+
722
+ `watchSections(owner, ids, report)` and `jumpToSection(owner, id, event)` are new exports of the
723
+ engine, and of every foundation, which re-exports the engine, with `SECTION_LINE` (0.25), the
724
+ line's place as a fraction of the page's height. Every framework's TableOfContents follows the
725
+ page with them.
726
+
727
+ The SwiftUI and Compose renderings are not written yet. `TableOfContents` is in both platforms'
728
+ pending lists, and both contracts are generated, with the item's shape.
729
+
730
+ - b88e331: The theme is readable as data. `readThemeValues(element?)` in `@polymorph/engine` returns what
731
+ an element resolves a pairing's tokens to, as the values a JavaScript API takes: a colour role
732
+ as `#rrggbb` (or `rgba()` when translucent) and as channels, a space step, a radius and a control
733
+ height in pixels, a type step, a font slot, a duration in milliseconds, the colour mode the
734
+ element is drawn in and the document's reading direction. A reading is a snapshot: it keeps each
735
+ value, the mode and the direction as it first read them. An element that is not in the document
736
+ reads as the document root.
737
+
738
+ `watchTheme(listener)` calls back when the system, palette, mode, density, motion temperament,
739
+ contrast preference or direction changes, when an element enters or leaves an inverse tone, and
740
+ when a pairing's sheet is installed, installed again or removed. A tone or a mode that a member
741
+ writes for its own variant does not call back. `themeVersion()` grows with each call back and
742
+ when `watchTheme` takes its first listener, so a store that keeps a reading knows when to take
743
+ another. `UNTHEMED_VALUES` is the reading a server render gets: every colour the empty string and
744
+ every number 0.
745
+
746
+ Each foundation wraps these as `useThemeValues`: a hook in React, a `ShallowRef` in Vue, a
747
+ `current` getter in Svelte, an accessor in Solid and a signal in Angular. It is for another
748
+ library's component that cannot be styled through CSS, such as a map, a canvas grid or a code
749
+ editor, inside a `<ThirdParty>` boundary (`docs/rules.md`). A value is read where the framework
750
+ renders or in an effect. In React, Vue and Solid the render that hydrates a server's markup gets
751
+ the server's empty values, and the component gets the document's once it has hydrated. React's
752
+ hook takes a ref, reads the ref's element after each commit of the component, and renders the
753
+ component again when the element is another one. Svelte's `current` is a new reading each time it
754
+ is read outside an effect. Outside a component, Vue's follows the theme in an effect scope and
755
+ Solid's under a root.
756
+
757
+ `@polymorph/engine/runtime` also exports `cssVarName` and `MORE_CONTRAST_QUERY`. Nothing is
758
+ renamed or removed.
759
+
760
+ - 00bce31: `Tour` is a new member in every web vocabulary: a short walk through the parts of a page, one
761
+ step at a time, that a reader goes through once and can leave at any step. It takes `steps`,
762
+ where a `TourStep` is `{ id, target?, title, body, side? }`. A step names the part it points at
763
+ by the `name` of a `Tour.Target`, which the application puts around that part and which adds no
764
+ box (`display: contents`). A step with no `target`, or whose target is not drawn when it opens,
765
+ is drawn centred.
766
+
767
+ The application opens the tour (`open`, `defaultOpen`) and records that it was seen: the member
768
+ stores nothing, and `onEnd(reason)` says why the reader ended it, `finished` from the last
769
+ step's Done or `dismissed` from Escape or the close control. The step is `step`, `defaultStep`
770
+ and `onStepChange`. The words it writes itself are in `messages` (`next`, `previous`, `done`,
771
+ `close`, `position`), with English defaults.
772
+
773
+ Each step's panel is a modal dialog, named by the step's title and described by its body and
774
+ its position ("Step 2 of 3"). Focus moves to the panel when each step opens and returns to where
775
+ it was when the tour ends. The rest of the page is hidden from assistive technology and takes no
776
+ presses, and the target is cut out of the scrim. The page keeps its scroll: the target is
777
+ scrolled into view when its step opens, and the panel and the cut-out follow it.
778
+
779
+ The engine, and every foundation, which re-exports it, has five new exports for it:
780
+ `tourTarget(name)` finds a step's target, `tourTargetRect(element)` measures the boxes inside
781
+ it, `revealTourTarget(element)` scrolls it into view, `tourViewport()` is the window's size, and
782
+ `tourPlacement(target, box, viewport, side)` places a panel beside a rectangle and inside the
783
+ window. The types are `TourPlacement`, `TourRect`, `TourSide` and `TourSize`, and the attribute
784
+ a target carries is `TOUR_TARGET_ATTRIBUTE`.
785
+
786
+ - 59658db: `Treemap` is a new chart member in every web vocabulary: parts of a whole as rectangles that
787
+ tile the plot, each with an area proportional to its value, such as storage by kind or tickets
788
+ by team and channel. It takes `label` and `items`, where a `TreemapItem` is
789
+ `{ key, label, value, children? }`, and the tier's `format`, `size`, `locale`, `tooltip`,
790
+ `onSelect`, `loading` and `messages`.
791
+
792
+ The layout is squarified, largest first from the inline start, and the same items and size
793
+ always give the same tiles. An item with `children` is a group, drawn as the sum of its
794
+ children; two levels are drawn, and deeper items are summed into the second with a dev
795
+ warning. With groups, each group takes a chart slot and its items its colour, with a legend of
796
+ the groups and a wider gap between them; with one level every tile is one colour. An item with
797
+ no positive value takes no area: the twin lists it and the summary counts it. A tile shows its
798
+ label and value on a plate of the surface colour, and only where both fit; the tooltip, the
799
+ live region and the twin name every item.
800
+
801
+ `squarify`, `treemapModel`, `treemapReadout` and `treemapSelection` are new exports of
802
+ `@polymorph/engine/charts`, and of every foundation, which re-exports it, with the types
803
+ `TreemapItem`, `TreemapInput`, `TreemapModel`, `TreemapPlot`, `TreemapTile`, `TreemapPlate`,
804
+ `TreemapLeaf` and `TreemapRect`.
805
+
806
+ `ChartMessages` has three new keys, with English defaults in `DEFAULT_CHART_MESSAGES`:
807
+ `treemapSummary`, `groupColumn` and `itemColumn`. A host that spreads the defaults is
808
+ unaffected. A host that writes its own whole catalog adds the three keys.
809
+
810
+ On iOS, `PMChartMessages` takes the same three, and `PMSpecDefault.chartMessages` gives their
811
+ English. `Treemap` is adapted on iOS, drawn with SwiftUI shapes because Swift Charts has no mark
812
+ that tiles a box by area; its rendering is not written yet, so it is in the pending list, and
813
+ its contract is generated. Android marks it absent, with `Table`, as it does every chart member.
814
+
815
+ - 4902f58: The colour mode is readable and followable. `readMode()` in `@polymorph/engine/runtime` (and the
816
+ engine's root) returns `{ preference, mode }`: the preference, `light`, `dark` or `system`, and
817
+ the mode it resolves to. It returns the same object until one of the two changes.
818
+ `watchMode(listener)` calls back after each `setMode`, from any caller, and each time the
819
+ operating system's mode changes while `system` is applied. `SERVER_MODE` is the reading a server
820
+ render gets, `system` and `light`, because a server stores no preference.
821
+
822
+ Each foundation wraps these as `useMode`: a hook in React, a `ShallowRef` in Vue, a `current`
823
+ getter in Svelte, an accessor in Solid and a signal in Angular. An application's Menu or command
824
+ palette reads the preference from it to mark the current choice, and sets the mode with
825
+ `setMode`, which every foundation already re-exports. In React, Vue and Solid the render that
826
+ hydrates a server's markup gets `SERVER_MODE`, and the component reads the document once it has
827
+ hydrated.
828
+
829
+ `getModePreference()` now returns the preference the last `setMode` applied to the document, and
830
+ the stored one before any call. It used to read storage each time, so it answered `system` where
831
+ storage refuses writes, and another tab's choice where one had stored it, while the document wore
832
+ something else. `teardownTheme()` also forgets the applied preference. Nothing is renamed or
833
+ removed.
834
+ - @polymorph/theme@1.0.12
835
+
836
+ ## 1.0.10
837
+
838
+ ### Patch Changes
839
+
840
+ - 7019d6f: Focus returns where it should in Safari and Firefox on the Vue, Svelte, Solid and Angular members, as it already did on the React ones.
841
+
842
+ - A Dialog returns focus to the control whose press opened it. Before, it returned focus to where focus was before the press, which is nowhere in Safari, where a press leaves a button unfocused.
843
+ - A ContextMenu opened by a press on a focused button returns focus to that button in Safari. Before, focus was lost when the menu closed, because Safari takes focus off a button on `mousedown`.
844
+ - A Popover, Menu, DatePicker or DateRangePicker that closes within a frame of opening keeps focus on its trigger. Before, the focus the overlay gives its panel could arrive after the close and be lost with the panel.
845
+
846
+ - cb0d0a3: Members follow a right-to-left document. With `dir="rtl"` on `<html>` or `<body>`, every member built on Radix or Zag now takes that direction: its root says `dir="rtl"`, and the arrow keys, a Slider's track, a submenu's side and a Tabs strip turn with the page. Before, those members wrote `dir="ltr"` on their root and ran left to right inside a right-to-left page. A member already on the page follows a change to the attribute. There is no new prop, and a left-to-right page renders as it did.
847
+
848
+ Each foundation exports `useDirection`, which returns the document's direction and keeps it current, and `@polymorph/engine` exports `readDirection` and `watchDirection` beneath it.
849
+
850
+ The page-transition indicator's right-to-left rule now reads `dir` instead of `:dir()`, which the published build's minifier had rewritten as a list of languages.
851
+ - @polymorph/theme@1.0.10
852
+
853
+ ## 1.0.9
854
+
855
+ ### Patch Changes
856
+
857
+ - @polymorph/theme@1.0.9
858
+
859
+ ## 1.0.8
860
+
861
+ ### Patch Changes
862
+
863
+ - 820c836: Every package now carries the release's version, and the release tag is `v` and that version.
864
+ Until this release each package kept its own number, so one release installed the engine at one
865
+ version, the foundations at another and the tag named a third. From this release on, pin every
866
+ `@polymorph/*` package you install at the same version, and check the native packages out at the
867
+ tag of that version.
868
+
869
+ This package's version jumps to the release's number. The jump carries no change of its own: the
870
+ versions it skips were never published.
871
+
872
+ - e1c80b3: A horizontal `Tabs` list wider than its container now scrolls inside it instead of running past it. There is no new prop, and a list that fits looks as it did.
873
+
874
+ - An edge with more tabs beyond it fades out, and an edge with nothing beyond it does not. A browser without scroll-driven animations shows a thin scrollbar instead.
875
+ - The current tab is scrolled inside the list when the list is laid out, when its box changes size and when the value changes. Only the list scrolls, never the page. The move for a new value is smooth unless the motion temperament is `none` or the reader asked for reduced motion.
876
+ - A tab that takes keyboard focus is scrolled into view, clear of the fade, and its focus ring is not clipped.
877
+ - The indicator stays under its tab while the list is scrolled. In React it now also follows a `value` the caller changes without a press.
878
+
879
+ Remove any workaround that sets `overflow` on the tablist, such as a `Bespoke` zone around the member. The baseline rule is now drawn by the root, not by the list's border, so a stylesheet that restyled that border no longer reaches it.
880
+
881
+ `@polymorph/engine` exports `revealInline`, which every framework's `Tabs` calls, and each foundation re-exports it. A vendored `Tabs` gets the scrolling, the fade and the focus room from the recipe alone, and the scroll to the current tab after `polymorph update`.
882
+
883
+ - Updated dependencies [820c836]
884
+ - @polymorph/theme@1.0.8
885
+
886
+ ## 1.0.6
887
+
888
+ ### Patch Changes
889
+
890
+ - 22f607b: The base type size is a system decision. `overrides.type.base` sets the md step, the paragraph
891
+ size, between 12 and 20px on the half-pixel grid; `overrides.type.sm` and `overrides.type.xs`
892
+ set the two working steps under it (controls, table cells, menus and labels read `sm`; captions
893
+ and badges read `xs`), so a product whose sizes are 12, 13 and 13 says so in three numbers. The
894
+ steps above the base still derive from `type.ratio`, and the merged ladder stays in order with
895
+ `xs` never under 10px.
896
+
897
+ A base under 16px is lawful because the focus-zoom floor is now a token of its own. iOS Safari
898
+ zooms the viewport when a focused field's font-size is under 16px, so below `30rem` every
899
+ text-entry recipe (Input, Textarea, TagInput, Combobox, MultiSelect, NumberInput, OTPInput,
900
+ Command and PromptInput) reads `--pm-text-entry-size` and `--pm-text-entry-line-height` instead
901
+ of a type step. The engine derives the size as the md step or 16px, whichever is larger. No
902
+ application needs a viewport `maximum-scale` or a CSS `zoom` to keep a small field from
903
+ zooming. The recipes read the new tokens, so this release of `@polymorph/recipes` needs this release of the engine or later; a vendored member's recipe picks them up through `polymorph update`.
904
+
905
+ - Updated dependencies [22f607b]
906
+ - @polymorph/theme@1.0.1
907
+
908
+ ## 1.0.5
909
+
910
+ ### Patch Changes
911
+
912
+ - 1b900d8: CursorPagination has a "Load more" form, and RelativeTime writes the moment itself as well as the distance from now.
913
+
914
+ **`CursorPagination mode="append"` is "Load more".** It draws one `outline` Button, "Load more", that calls `onNext`; the app adds the window it fetches below the ones on screen. While `pending` the Button is busy and ignores presses. When `hasNext` turns false after a press, the list has run out: the Button leaves and an end line says "No more to load" through a status region, so a screen reader hears it. The form remembers that it asked for a window and does not read `hasPrevious`, so pass your query library's flags as they are. A list with no next window that the reader has not paged renders nothing, as one window does in the default form. `position` is what is on screen in your words ("50 shown"). In a DataTable, set the pager's `pending` while the next rows load, not the table's `loading`, which replaces the rows with skeletons. A hand-built "Load more" can be replaced with `<CursorPagination mode="append" hasPrevious={false} hasNext={hasNextPage} pending={isFetchingNextPage} onNext={fetchNextPage} />`; a list started again under a new query takes a new pager (`key={query}`).
915
+
916
+ In React the props are a union on `mode`: the default form still requires `onPrevious`, so every pager written before stays valid, and the append form takes none, because it has no previous direction. In Vue, Svelte, Solid and Angular `onPrevious` is an optional event, and the default form warns in development when `hasPrevious` has no `onPrevious`.
917
+
918
+ `CursorPaginationMessages` takes two optional words, `more` and `end`; an app that localizes the pager passes them, and the append form warns in development when `messages` leaves them out. Every web framework's CursorPagination takes `mode`, and so do `PMCursorPagination` on iOS and Android.
919
+
920
+ The Svelte foundation's `Held` takes `presses`, and the Angular foundation exports `pressOnce`: a states fixture entry presses a control once it is in the document, as the append form's "the list ran out" entry presses "Load more". An app has no use for either.
921
+
922
+ `@polymorph/recipes`' `structure/cursor-pagination.module.css` lays `.pagination` out as a column (`display: inline-flex; flex-direction: column`), so the append form's end line takes a line of its own under the row; the default form's one row looks as it did. It adds `.end`, the end line, in the position's type and colour. A vendored CursorPagination takes both with the recipe.
923
+
924
+ **`RelativeTime mode="absolute"` and `mode="both"`.** `absolute` writes the moment with `Intl.DateTimeFormat` in the member's `locale`: the medium date and the short time ("Aug 4, 2026, 2:05 PM"), or with `format="long"` the long date. An instant is written in the time zone of whatever renders the member: the reader's in a browser, the server's under server rendering or in a React server component. An app that renders on a server and must show the reader's zone renders the absolute forms in the browser, from a client component once it has mounted. A calendar date (`2026-08-04`) is the date alone, the same day everywhere. `both` writes the moment and the distance joined by `messages.both`, by default the moment, then the distance in parentheses ("Aug 4, 2026, 2:05 PM (2h ago)"); a localized app passes `messages={{ both: (moment, distance) => … }}` from its catalog, so its locale orders and punctuates the two. The default stays `relative`. Replace a hand-formatted timestamp in JSX with the member, which also writes the moment in `dateTime`.
925
+
926
+ **`relativeTimePhrase` takes `mode` and `messages`.** `relativeTimePhrase(value, { locale, numeric, format, mode, messages })` from `@polymorph/engine`, which every foundation re-exports, returns the text RelativeTime renders for those props, or `null` for a value that is not a moment. Use it where a member takes app-formatted text, such as Timeline's `time`, so the words match RelativeTime's ([design/components/relative-time.md](../design/components/relative-time.md)).
927
+
928
+ **On iOS and Android**, `PMRelativeTimeProps` gains `messages`, the same `both`. **On Android**, `PMRelativeTimeWords` gains `absolute(moment, long, locale)`, which an app implements to write the moment with the platform's formatter in the reader's zone. Without it the member writes Material 3's medium date and an instant's 24-hour time in UTC, said as UTC, because the member module reaches no time zone. The words are `PMStrings.relativeUtc`, a default only Android's `PMStrings` declares, so iOS's string catalog does not carry it; an app translates it through `LocalPMStrings`.
929
+
930
+ - 1b900d8: A palette can state its brand's exact accent and focus colours, a system can choose how a focused field and an unfilled Button look, and a palette can name the palette a reader who asks for more contrast gets. Each was a stylesheet an application wrote by hand; each is now a field in the system or palette document, held by the laws that hold a derived value.
931
+
932
+ **Pins.** A palette document takes `pins`: exact colours per mode for `accent.bg`, `accent.bgHover`, `accent.bgActive`, `accent.contrast`, `border.focus` and `border.focusSolid`. Each is an opaque `#rrggbb`; `border.focus` may also be `rgb(r g b / a)`. The stylesheet carries a pin as stated, an unpinned `accent.contrast` is chosen against a pinned fill, and the contrast law never moves a pin. Admission refuses a pin that fails its floor, with the measured value and the pin named: a label under Lc 60 on a pinned fill, or a pinned focus colour that does not stand out. Move an application's `--pm-accent-*` and `--pm-border-focus*` declarations into the palette's `pins` and delete them.
933
+
934
+ **A focus floor.** `border.focus` (composited) and `border.focusSolid` must now separate from every text-bearing background by ΔL 0.08 (`FOCUS_MIN_DELTA_L`), in every pairing. Every house pairing already does. A guest palette whose derived focus colours fall short is repaired like any other role; a pinned one is refused.
935
+
936
+ **Two system choices.** `overrides.focus.field: "border"` draws a focused field's focus inside its edge, at the system's focus width, in `border.focusSolid`, over the field's seat shadow, instead of the ring around it; an invalid field keeps the ring. `overrides.hover.unfilled: "none"` gives `outline` and `ghost` Buttons no wash under the pointer; the press and a toggle's on state keep theirs. Both are emitted as flags (`--pm-focus-field`, `--pm-hover-unfilled`) that `@polymorph/recipes`' focus convention and Button recipe read, so every web framework's members follow them with no member change. Delete application CSS that replaced field focus rings or removed outline and ghost hover backgrounds, and set the choice in the system file. The SwiftUI and Compose members do not read either choice, because no native theme has a field for them.
937
+
938
+ **More contrast.** A palette document takes `moreContrast`, the name of another palette. Admitted with it (`admitTheme({ system, palette, moreContrast })`, or by listing both palettes in `polymorphTheme`), the pairing's stylesheet carries the partner's colours under `@media (prefers-contrast: more), (forced-colors: active)`, so the switch follows the reader's setting before first paint with no script. `polymorphTheme` fails the build when a palette names a partner that is not in `palettes`, and `admitTheme` refuses a palette that names a partner it is not given, with a `schema` fault. `polymorph theme validate|emit` reads the partner from a third path or from the file named for it beside the palette; a vendored install installs the partner with the palette, and the registry's palette entry names it; the MCP's `save_theme` reads it from the `palettes` directory it saves into, so save the partner first. An app that emits its own catalogue passes `moreContrastOf(system, palette, palettes)` to `emitThemeCSS`. A second system and a hand-mapped palette for high contrast can be replaced by one partner palette. The partner reaches the web only: the token document a native app reads names no partner, and no SwiftUI or Compose member reads the platform's contrast setting. An iOS app that wants it loads a second token document, admitted with the partner palette, and installs it while `colorSchemeContrast` is `.increased` (`docs/native.md`).
939
+
940
+ **The base type size stays 16px.** A system document's `overrides.type.base` is refused with its reason: the 16px base is the text-entry floor that stops iOS zooming the page on focus. A steeper `type.ratio` gives smaller `sm` and `xs` steps.
941
+
942
+ **Admission reports a hairline in ΔL.** A failing border, underline or focus pairing now reads `reached ΔL 0.031, floor is 0.04` rather than an Lc measured against a floor of 0.
943
+
944
+ - 1b900d8: A toast tells its owner when it leaves, its tone sets how long it stays, a success notice leaves on its own, and the registry publishes Toast as each framework ships it.
945
+
946
+ **`onDismiss` on a toast.** `toast()` takes `onDismiss`, called once when the toast leaves for a reason other than its owner's: the reader dismissed it, its time ran out, `toast.dismiss` closed it, or newer toasts evicted it. Removing a toast and updating it in place do not call it. Every framework's `toast()` takes it, because every foundation's store is the engine's. A declared Toast in Vue, Svelte, Solid and Angular emits `dismiss` (`@dismiss`, `onDismiss`, `(dismiss)`), and `PMToast` on iOS and Android calls `onDismiss` when its card leaves by its close button, a swipe, the escape gesture or its time.
947
+
948
+ **A toast takes its lifetime from its tone.** The store every web framework shares gives a toast whose call sets neither `retained` nor `durationMs` its tone's lifetime. A `danger` or `warning` toast is retained and pinned: it stays until it is dismissed or removed, and newer toasts do not evict it. A `success`, `info` or `neutral` toast leaves after `TOAST_DEFAULT_DURATION_MS` and may be evicted, as every toast did before. So `toast.danger(…)`, `toast.warning(…)` and `toast.promise`'s error face now stay until the reader dismisses them; a call that wants the old five seconds passes `durationMs: TOAST_DEFAULT_DURATION_MS`. A call that sets either option keeps what it sets. `ToastNotice` and a declared `Toast` in Vue, Svelte, Solid and Angular follow the same rule, so a `danger` or `warning` notice stays until it is resolved or dismissed, as every notice did before, and a `success`, `info` or `neutral` notice now leaves on its own. A screen that kept a success notice on screen with a button whose only job was to dismiss it can delete the button. `ToastNotice` also takes `onDismiss`, so a screen can clear the state that renders a notice once the notice has left; unmounting a notice does not call it. A notice that must stay whatever its tone takes `dismissible={false}`. `PMToast` on iOS and Android takes the same lifetime from its tone when its props set neither `retained` nor `durationMs`: a native danger or warning toast now stays until it is dismissed, and one that should leave passes `durationMs: 5000`.
949
+
950
+ **A notice with nowhere to show warns in development.** A `ToastNotice` rendered while no `ToastHost` or `Toaster` is mounted logs a warning naming it, because nothing draws its toast. A declared `Toast` in Vue, Svelte, Solid and Angular logs the same warning when no `Toast.Viewport` is in the document once it has mounted. The usual cause is an error boundary whose fallback renders outside the viewport: mount `ToastHost`, or `Toast.Viewport`, outside the boundary.
951
+
952
+ **The registry and the system card publish Toast's real API and every compound part.** Each component carries `parts`, every compound part its export carries with the part's props (`AppShell.NavItem`, `AppShell.NavGroup`, `AppShell.UserCard`, `Dashboard.Panel`, `Avatar.Group`, `Table.Head`, `Table.Body` and `Table.Foot` among them, which the card left out), and `exports`, the member's other callable exports (Toast's `toast`, `ToastHost`, `ToastNotice` and `ToastViewportTarget`; Tooltip's `TooltipProvider`; FormField's `ToastFormField`). The React card lists Toast as `toast()` with its options and shorthands beside the components a screen mounts, rather than as a `<Toast>` with props; another framework's card lists the parts its shell ships, `Toast.Viewport` included. Toast's purpose reads "Notifications that report the outcome of an action" in place of "The toast viewport". A card rendered for `ios` or `android` lists a member's props and the parts its native contract carries, and none of React's exports: SwiftUI's and Compose's Toast is a member whose props are the options.
953
+
954
+ **The spec-staleness law reads every compound part.** `@polymorph/rules/spec-api` compares each part a member's export carries with its spec, reading the parts with `compoundParts`, the function the registry's `parts` come from, in place of the hand list `COMPOUND_PARTS`, which is removed. A part's props table goes in `## API` under a `Component` column, or under a heading with the part's name (`## AppShell.NavItem`).
955
+
956
+ ## 1.0.4
957
+
958
+ ### Patch Changes
959
+
960
+ - 700e130: `@polymorph/core` is split, and its framework-free half is `@polymorph/engine`, published as `@metamorph-labs/polymorph-engine`. It holds the theme engine with its laws and emitters, the conventions, the icon roles, the motion engine (`./motion`), the runtime (`./runtime`), the Vite plugin (`./vite`, `./vite-env`) and `./testing`. It has no React in it, so every web framework's foundation imports it: `@polymorph/react`, `@polymorph/vue`, `@polymorph/svelte`, `@polymorph/solid` and `@polymorph/angular` each re-export it.
961
+
962
+ **To upgrade**, install `@polymorph/engine` in place of `@polymorph/core`, and import `@polymorph/engine/vite`, `/vite-env`, `/runtime` and `/testing` where you imported them from `@polymorph/core`. A React application installs `@polymorph/react` too, which re-exports everything the engine's root does. The ESLint and Stylelint entries are in `@polymorph/rules`.
963
+
964
+ **What the engine holds that every framework's members share**, so a React member and a Vue member make the same decision from the same function:
965
+
966
+ - At the root: the layout conventions (`spacingAttrs`, `LayoutPatch`, `SpacingProps`), `fitTextarea`, `modalFocusTarget`, `avatarTone` and `initialsOf`, `paginationWindow` with `PAGINATION_ELLIPSIS`, `TOOLTIP_DELAY_MS` with `TOOLTIP_SKIP_DELAY_MS`; the file gate and size format (`gateFiles`, `formatBytes`, `FileRejection`, `FileRejectionReason`); RelativeTime's phrase (`relativeTimePhrase`); ColorInput's rest value (`COLOR_INPUT_REST`); the brand marks' data (`BRAND_MARKS`, `BRAND_DRAWINGS`, `isBrandName`); the toast store (`createToastStore`, `TOAST_DEFAULT_DURATION_MS`, `TOAST_MAX_VISIBLE`, `TOAST_TONE_ICON`); and the segmented date and time field's model (`fieldSegments`, `stepSegment`, `typeIntoSegment`, `eraseSegment`, `timeDraft`, `timeOfDraft`, `timeFieldValue`, `dateFieldDraft`, `dateFieldValue`, `calendarDateOf`, `dateOutOfBounds`, and the `DateFieldValue` and `DateBounds` types).
967
+ - The date and time values every framework's date fields take and report, `Time`, `CalendarDate` and `CalendarDateTime`, re-exported from `@internationalized/date`.
968
+ - The focus and key handling a Zag machine leaves to its renderer (`roveRadio`, `followHighlight`, `returnFocus`), an overlay's trigger anchor (`syncTriggerAnchor`, `anchorFocusReturns`, the rule for when focus goes back to the trigger as its overlay closes, and `anchorProps`, which takes an optional `FocusHandlerNames` for the way a framework spells the `focusin` and `focusout` handlers) and `devWarning`.
969
+ - On subpaths of their own, so an application that imports the engine for its theme does not load them: `@polymorph/engine/qr` (the QR encoder: `qrSymbol`, `qrPath`, `encodeQr`), `@polymorph/engine/markdown` (the Markdown parser: `parseMarkdown`, `parseInlines`, `safeHref`, `inlineText`, and the heading-level and caret decisions) and `@polymorph/engine/charts`.
970
+
971
+ **The chart engine** is `@polymorph/engine/charts`: the chart grammar's types (`ChartSeries`, `ChartDatum`, `ChartXAxis`, `ValueFormat`, `ChartMessages`, `DEFAULT_CHART_MESSAGES` and the rest), the scales over `d3-scale` and `d3-array`, the marks' paths over `d3-shape` (`linePath`, `areaPath`, `ringArcs`, `sparklineGeometry`), formatting, the cartesian, grid and polar geometry, the readout and table-twin text, the annotation layers, each chart member's model (`barChartModel`, `barChartReadout`, `barChartSelection`, and the same three for every chart member), and the state machines of the chart frame's interaction: `observeBox` and `measureBox` (the plot's layout box, so a chart inside an overlay that enters scaled is laid out at its full size), `createReading`, `createBrush`, `createSyncMember` (the `syncId` registry, which skips a member whose element has left the document), `syncValueAt` and `syncIndexOf`, `readChartCap` and `createWarningLog`, which logs a warning once while it stays. The engine depends on `d3-scale`, `d3-array`, `d3-shape` and `@internationalized/date`; an application's bundle carries the d3 packages only when it imports a chart.
972
+
973
+ **Tokens for every platform.**
974
+
975
+ - Each pairing's stylesheet declares `--pm-hit-target`: the smallest area a pointer or a finger has to hit, 24px at every density (WCAG 2.5.8). A pressable element smaller than that extends its hit area to at least it and keeps its drawn size.
976
+ - `emitTokenDocument(resolved, { platform })` and `emitTokenDocumentJSON` give a resolved pairing as plain JSON for an emitter that is not CSS: every reference resolved, every value structured (lengths with their unit, colours as channels, shadows and gradients as layers and stops, springs with their exact damping ratio), and keys that are the stylesheet's token paths. `TOKEN_DOCUMENT_FORMAT`, `TOKEN_DOCUMENT_SCHEMA` (zod) and `tokenDocumentJsonSchema()` describe it, and the document's types are exported beside it. `PLATFORMS` and `PLATFORM_FLOORS` name the platforms (`web`, `ios`, `android`, `dart`) and their floors. A platform's minimum is a hit area, so the document raises the hit target to it (44 on iOS, 48 on Android and in Flutter) and records each raise in `floor.raised`; control heights keep the density's values on every platform.
977
+ - `emitSwift(resolved)` writes a pairing as Swift source: one `PMTheme` value for the `PolymorphTokens` library in `platforms/ios`. Lengths are points, colours are dynamic (light and dark, resolved by the environment's colour scheme), motion is seconds, curve control points and spring parameters. `emitSwiftFiles(resolved[])` writes a set of pairings and a `Catalogue.swift` listing them, which declares `PMTheme.default`. `swiftMember`, `swiftThemeName` and `swiftFileName` expose the naming rules.
978
+ - `emitKotlin(resolved)` and `emitDart(resolved)` write the same pairing as framework-free Kotlin (`platforms/android/tokens`) and Dart (`platforms/dart`, with no Flutter dependency). Both share one tree, so they differ only in literals; `nativeName` and `nativePairingNames` expose the naming rules they share with Swift. `emitKotlin` names a pairing's icon sizes `PMIconScale`, as `emitSwift` does, because `PMIcon` is the Icon member in the SwiftUI and Compose vocabularies. `pnpm emit:native` writes every native package's committed sources, and a freshness law fails when a committed file differs from a fresh emission.
979
+
980
+ **Fixes.** Each pairing's stylesheet declares the inset classes (`--pm-inset-*`), the halos (`--pm-glow-*`) and the shell surfaces (`--pm-shell-*`) again on every density and mode scope inside it, so a `DensityScope` or a nested `[data-mode]` resolves them against its own spacing and colours; they kept the outer scope's values. A page texture that is the same in both modes is declared once, in the pairing's own block.
981
+
982
+ ## 1.0.3
983
+
984
+ ### Patch Changes
985
+
986
+ - de7af02: Add the `ai` tier — the conversation vocabulary for AI products — and the `ConversationPage` archetype.
987
+
988
+ New members in `@polymorph/ui`: `ChatThread`, `ChatMessage`, `PromptInput`, `AttachmentChip`, `StreamingText`, `Markdown`, `ToolCall`, `ApprovalCard`, `Citation`, `SourceList`, `ReasoningDisclosure`, `ArtifactPane`, and the `ConversationPage` archetype. `docs/conversation.md` is the tier's model; every member has a spec under `design/components/`.
989
+
990
+ New icon roles in `@polymorph/core`: `send`, `stop`, `attach`, `helpful`, `unhelpful`, `reasoning`, `cite`, `artifact`. New motion bindings: `chat.message`, `streaming.pending`, `toolcall.status`. `StateName` gains `streaming` and `detached`.
991
+
992
+ Additive only: no existing export, prop or token changes.
993
+
994
+ ## 1.0.2
995
+
996
+ ### Patch Changes
997
+
998
+ - 9ad1cfe: Themes compile at build time, and what an application ships is smaller.
999
+
1000
+ **Build-time theming.** `@polymorph/core/vite` exports `polymorphTheme`, a Vite plugin (`vite`
1001
+ `>=6`, an optional peer) that admits your systems and palettes when the application builds — a
1002
+ law fault fails the build, with the law's own sentence — and serves them as CSS. Each system with
1003
+ its own default palette goes into the main stylesheet; every other pairing compiles to its own
1004
+ small sheet. `@polymorph/core/runtime` is the theme runtime without the engine (`setSystem`,
1005
+ `setPalette`, `setMode`, `hydrateTheme`, `PREPAINT_SCRIPT`, `DATA_ATTRS` and the rest), and
1006
+ `@polymorph/core/vite-env` types the virtual module. To move an application from runtime
1007
+ admission:
1008
+
1009
+ 1. Add the plugin to `vite.config.ts`:
1010
+ `polymorphTheme({ systems: ['design/system.json'], palettes: ['design/palette.json'] })`.
1011
+ 2. Replace the `admitTheme(...)` and `installThemeCSS(...)` calls at your entry with
1012
+ `import 'virtual:polymorph/theme'`, which imports the stylesheet and the pairings' fonts and
1013
+ applies the stored choice.
1014
+ 3. Drop any pre-paint script you inline yourself: the plugin inlines `PREPAINT_SCRIPT` and writes
1015
+ the default `data-system` and `data-palette` on `<html>`.
1016
+ 4. Import the setters from `@polymorph/core/runtime`, and before switching to a pairing that is
1017
+ not a system's own default, `await ensurePairing(system, palette)` from
1018
+ `virtual:polymorph/theme`.
1019
+ 5. Reference the types once from a `.d.ts`: `/// <reference types="@polymorph/core/vite-env" />`.
1020
+
1021
+ `admitTheme` and `installThemeCSS` are unchanged and remain the way to install a theme known only
1022
+ at run time, such as one per tenant; that path ships the theme engine to the browser.
1023
+
1024
+ **Motion runs on the Web Animations API.** `@polymorph/core/motion` no longer depends on the
1025
+ `motion` package: springs are simulated and played as `linear()` easings, every animation starts
1026
+ from the value on screen, and an interrupted spring keeps its velocity. The exports and props are
1027
+ the same, so nothing in your code changes.
1028
+
1029
+ **Icons are drawn from glyph data.** `@polymorph/core` depends on `lucide` (glyph data only) in
1030
+ place of `lucide-react`, and draws each glyph's SVG itself. `Icon`'s props are the same.
1031
+
1032
+ **Vendored themes are compiled at install time.** `polymorph add theme:…` and `palette:…` write
1033
+ `themes/theme.css`, and for every other pairing `themes/pairings/<system>--<palette>.css` with a
1034
+ small loader module beside it. `themes/index.ts` uses only `@polymorph/core/runtime`, and its
1035
+ `ensurePairing()` now returns a Promise: await it before `setSystem` or `setPalette`. Run
1036
+ `polymorph update` once to regenerate an existing install, and again after editing a vendored
1037
+ system or palette JSON. The output works with any bundler.
1038
+
1039
+ **Measured** by `pnpm size` (gzipped JavaScript, theme compiled at build time): React alone
1040
+ 57.5 kB; a `Button` 63.7 kB; a `ListPage` with a `Table` 73.1 kB; a `Dialog` 83.8 kB — each with
1041
+ 4.5–6.1 kB of CSS. Admitting a theme in the browser costs 49.4 kB of JavaScript on its own.
1042
+
1043
+ ## 1.0.1
1044
+
1045
+ ### Patch Changes
1046
+
1047
+ - 9b7ea37: The published declarations no longer import files the package does not ship.
1048
+ `icon/roles.d.ts` and `motion/values.d.ts` imported `design/icons.json` and
1049
+ `design/motion/motion.json`, so a consumer typechecking with `skipLibCheck: false` got TS2307
1050
+ and TS2677, and `IconRole`, `DurationClass` and the other motion names widened to
1051
+ `string | number | symbol` — an invented icon role stopped being a type error. They are closed
1052
+ unions now, with nothing to change in your code.
1053
+
1054
+ ## 1.0.0
1055
+
1056
+ The first versioned release. Earlier history is in git.