@mechane-ai/elements 0.45.0 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (340) hide show
  1. package/README.md +353 -50
  2. package/bin/mechane-elements-catalog.mjs +42 -4
  3. package/dist/ai.js +268 -202
  4. package/dist/catalog.json +2480 -71
  5. package/dist/categorical-values-DdfGIowV.js +107 -0
  6. package/dist/cells--Bd1fQFR.js +384 -0
  7. package/dist/chart-cursor-1mFd48Jc.js +23 -0
  8. package/dist/chart-link-AE_xuxiP.js +35 -0
  9. package/dist/chart-tones-ei3BC2AL.js +27 -0
  10. package/dist/charts/cartesian.js +1 -2792
  11. package/dist/charts/cells.js +1 -0
  12. package/dist/charts/comparison.js +1 -0
  13. package/dist/charts/distribution.js +1 -709
  14. package/dist/charts/figure.js +3404 -0
  15. package/dist/charts/graph.js +1 -641
  16. package/dist/charts/hierarchy.js +1 -112
  17. package/dist/charts/image.js +1 -0
  18. package/dist/charts/matrix.js +3 -637
  19. package/dist/charts/plot.js +15 -0
  20. package/dist/charts/relationship.js +1 -0
  21. package/dist/charts/text.js +1 -0
  22. package/dist/charts/timeline.js +1 -233
  23. package/dist/charts/transforms.js +677 -0
  24. package/dist/charts/trend.js +1 -0
  25. package/dist/charts.js +8 -3
  26. package/dist/{code-block-Cpfr7B6a.js → code-block-DioAM2bZ.js} +67 -52
  27. package/dist/collections.js +1 -1735
  28. package/dist/color-legend-CIo7DhXB.js +62 -0
  29. package/dist/content/code.js +1 -1
  30. package/dist/content/diff.js +67 -66
  31. package/dist/content/link.js +1 -1
  32. package/dist/content/markdown.js +2 -2
  33. package/dist/content/tree.js +2 -2
  34. package/dist/{content-link-CGeFFb9F.js → content-link-NWuHp5rC.js} +1 -1
  35. package/dist/content.js +1 -1
  36. package/dist/csp.js +6 -11
  37. package/dist/dates-Cww8UR_n.js +810 -0
  38. package/dist/dumbbell-plot-B2ZTgQaI.js +508 -0
  39. package/dist/embedding-map-CGM_k6lC.js +1929 -0
  40. package/dist/feedback.js +1 -1
  41. package/dist/figure-format-B8kRZMlo.js +36 -0
  42. package/dist/figure-frame-wRkIEAwe.js +270 -0
  43. package/dist/forms/dates.js +1 -750
  44. package/dist/{forms-DeU0Tiv3.js → forms-CEbwzlRR.js} +50 -41
  45. package/dist/forms.js +3 -3
  46. package/dist/heatmap-scale-Zte6Ya-g.js +20 -0
  47. package/dist/image-grid-CVA4SOy_.js +598 -0
  48. package/dist/index.js +1 -1
  49. package/dist/kits/evaluation.js +431 -0
  50. package/dist/kits/explainers.js +452 -0
  51. package/dist/kits/interpretability.js +1033 -0
  52. package/dist/kits/operations.js +239 -0
  53. package/dist/kits/training.js +335 -0
  54. package/dist/label-place-Z0fryBZb.js +42 -0
  55. package/dist/layout.js +207 -207
  56. package/dist/locate-Bcg3QcP4.js +11 -0
  57. package/dist/navigation.js +4 -3
  58. package/dist/packages/ai/src/conversation.d.ts +2 -0
  59. package/dist/packages/ai/src/prompt-input.d.ts +7 -2
  60. package/dist/packages/charts/src/cartesian/bar-chart.d.ts +40 -21
  61. package/dist/packages/charts/src/cartesian/bar-data.d.ts +15 -4
  62. package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +7 -3
  63. package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +10 -8
  64. package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +20 -16
  65. package/dist/packages/charts/src/cartesian/bridge-data.d.ts +5 -4
  66. package/dist/packages/charts/src/cartesian/composition-bars.d.ts +8 -4
  67. package/dist/packages/charts/src/cartesian/index.d.ts +6 -5
  68. package/dist/packages/charts/src/cartesian/reference-lines.d.ts +25 -18
  69. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +37 -26
  70. package/dist/packages/charts/src/cartesian/sparkline.d.ts +14 -2
  71. package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +3 -2
  72. package/dist/packages/charts/src/cartesian/time-series-data.d.ts +12 -2
  73. package/dist/packages/charts/src/cartesian/time-series-line.d.ts +2 -2
  74. package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +6 -4
  75. package/dist/packages/charts/src/cartesian/time-series.d.ts +61 -27
  76. package/dist/packages/charts/src/cartesian/value-labels.d.ts +22 -0
  77. package/dist/packages/charts/src/categorical-values.d.ts +15 -10
  78. package/dist/packages/charts/src/cells/bar-cell.d.ts +13 -0
  79. package/dist/packages/charts/src/cells/cell-layout.d.ts +81 -0
  80. package/dist/packages/charts/src/cells/change-cell.d.ts +17 -0
  81. package/dist/packages/charts/src/cells/heat-cell.d.ts +19 -0
  82. package/dist/packages/charts/src/cells/index.d.ts +11 -0
  83. package/dist/packages/charts/src/cells/interval-cell.d.ts +16 -0
  84. package/dist/packages/charts/src/cells/spark-cell.d.ts +22 -0
  85. package/dist/packages/charts/src/chart-frame.d.ts +17 -12
  86. package/dist/packages/charts/src/chart-grid.d.ts +19 -0
  87. package/dist/packages/charts/src/chart-input.d.ts +1 -9
  88. package/dist/packages/charts/src/chart-inspection.d.ts +1 -2
  89. package/dist/packages/charts/src/chart-link.d.ts +56 -0
  90. package/dist/packages/charts/src/chart-range.d.ts +33 -0
  91. package/dist/packages/charts/src/chart-rows.d.ts +20 -0
  92. package/dist/packages/charts/src/chart-theme.d.ts +17 -0
  93. package/dist/packages/charts/src/chart.d.ts +73 -0
  94. package/dist/packages/charts/src/comparison/bullet-bar.d.ts +34 -0
  95. package/dist/packages/charts/src/comparison/comparison-plot.d.ts +54 -0
  96. package/dist/packages/charts/src/comparison/dot-plot.d.ts +41 -0
  97. package/dist/packages/charts/src/comparison/dumbbell-plot.d.ts +33 -0
  98. package/dist/packages/charts/src/comparison/index.d.ts +6 -0
  99. package/dist/packages/charts/src/distribution/box-plot.d.ts +40 -0
  100. package/dist/packages/charts/src/distribution/distribution-input.d.ts +5 -3
  101. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +28 -161
  102. package/dist/packages/charts/src/distribution/ecdf.d.ts +16 -15
  103. package/dist/packages/charts/src/distribution/group-plot-input.d.ts +35 -0
  104. package/dist/packages/charts/src/distribution/group-plot-layout.d.ts +79 -0
  105. package/dist/packages/charts/src/distribution/group-plot.d.ts +73 -0
  106. package/dist/packages/charts/src/distribution/histogram.d.ts +16 -16
  107. package/dist/packages/charts/src/distribution/index.d.ts +11 -0
  108. package/dist/packages/charts/src/distribution/interval-plot.d.ts +16 -13
  109. package/dist/packages/charts/src/distribution/ranked-bars.d.ts +17 -14
  110. package/dist/packages/charts/src/distribution/ridgeline.d.ts +34 -0
  111. package/dist/packages/charts/src/distribution/strip-plot.d.ts +37 -0
  112. package/dist/packages/charts/src/distribution/violin-plot.d.ts +34 -0
  113. package/dist/packages/charts/src/figure/figure-format.d.ts +34 -0
  114. package/dist/packages/charts/src/figure/figure-frame.d.ts +47 -0
  115. package/dist/packages/charts/src/figure/figure-props.d.ts +54 -0
  116. package/dist/packages/charts/src/figure/tone-scope.d.ts +32 -0
  117. package/dist/packages/charts/src/graph/attribution-graph.d.ts +62 -0
  118. package/dist/packages/charts/src/graph/attribution-layout.d.ts +88 -0
  119. package/dist/packages/charts/src/graph/flow-diagram.d.ts +14 -15
  120. package/dist/packages/charts/src/graph/flow-layout.d.ts +4 -2
  121. package/dist/packages/charts/src/graph/graph-canvas.d.ts +33 -0
  122. package/dist/packages/charts/src/graph/index.d.ts +6 -2
  123. package/dist/packages/charts/src/graph/relation-graph.d.ts +24 -13
  124. package/dist/packages/charts/src/graph/tree-diagram.d.ts +41 -0
  125. package/dist/packages/charts/src/graph/tree-layout.d.ts +71 -0
  126. package/dist/packages/charts/src/hierarchy/area-mark.d.ts +17 -0
  127. package/dist/packages/charts/src/hierarchy/icicle.d.ts +35 -0
  128. package/dist/packages/charts/src/hierarchy/index.d.ts +2 -0
  129. package/dist/packages/charts/src/hierarchy/partition-layout.d.ts +25 -0
  130. package/dist/packages/charts/src/hierarchy/treemap-layout.d.ts +26 -0
  131. package/dist/packages/charts/src/hierarchy/treemap.d.ts +11 -9
  132. package/dist/packages/charts/src/image/attribution-legend.d.ts +13 -0
  133. package/dist/packages/charts/src/image/attribution-overlay.d.ts +50 -0
  134. package/dist/packages/charts/src/image/attribution-ramp.d.ts +16 -0
  135. package/dist/packages/charts/src/image/image-atlas.d.ts +37 -0
  136. package/dist/packages/charts/src/image/image-fill.d.ts +9 -0
  137. package/dist/packages/charts/src/image/image-grid.d.ts +26 -0
  138. package/dist/packages/charts/src/image/image-input.d.ts +27 -0
  139. package/dist/packages/charts/src/image/image-tile.d.ts +27 -0
  140. package/dist/packages/charts/src/image/index.d.ts +7 -0
  141. package/dist/packages/charts/src/index.d.ts +16 -1
  142. package/dist/packages/charts/src/matrix/attention-matrix.d.ts +41 -0
  143. package/dist/packages/charts/src/matrix/calendar-heatmap.d.ts +37 -0
  144. package/dist/packages/charts/src/matrix/color-legend.d.ts +9 -2
  145. package/dist/packages/charts/src/matrix/confusion-matrix.d.ts +36 -0
  146. package/dist/packages/charts/src/matrix/correlation-matrix.d.ts +34 -0
  147. package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -2
  148. package/dist/packages/charts/src/matrix/index.d.ts +14 -3
  149. package/dist/packages/charts/src/matrix/matrix-cells.d.ts +27 -3
  150. package/dist/packages/charts/src/matrix/matrix-figure.d.ts +50 -0
  151. package/dist/packages/charts/src/matrix/matrix-mark.d.ts +34 -0
  152. package/dist/packages/charts/src/matrix/matrix-presets.d.ts +20 -0
  153. package/dist/packages/charts/src/matrix/matrix-range.d.ts +45 -0
  154. package/dist/packages/charts/src/matrix/matrix-strip.d.ts +13 -14
  155. package/dist/packages/charts/src/matrix/matrix-types.d.ts +40 -0
  156. package/dist/packages/charts/src/matrix/matrix.d.ts +13 -11
  157. package/dist/packages/charts/src/matrix/token-heatmap.d.ts +16 -10
  158. package/dist/packages/charts/src/plot/contours.d.ts +45 -0
  159. package/dist/packages/charts/src/plot/index.d.ts +49 -0
  160. package/dist/packages/charts/src/plot/label-place.d.ts +35 -0
  161. package/dist/packages/charts/src/plot/locate.d.ts +18 -0
  162. package/dist/packages/charts/src/plot/path.d.ts +39 -0
  163. package/dist/packages/charts/src/plot/plot-axes.d.ts +20 -0
  164. package/dist/packages/charts/src/plot/plot-layout.d.ts +221 -0
  165. package/dist/packages/charts/src/plot/plot-marks.d.ts +124 -0
  166. package/dist/packages/charts/src/plot/plot-surface.d.ts +32 -0
  167. package/dist/packages/charts/src/plot/render/density-layer.d.ts +17 -0
  168. package/dist/packages/charts/src/plot/render/hit-index.d.ts +37 -0
  169. package/dist/packages/charts/src/plot/render/plot-viewport.d.ts +39 -0
  170. package/dist/packages/charts/src/plot/render/point-layer.d.ts +41 -0
  171. package/dist/packages/charts/src/plot/render/theme-colors.d.ts +15 -0
  172. package/dist/packages/charts/src/plot/scale.d.ts +48 -0
  173. package/dist/packages/charts/src/plot/ticks.d.ts +34 -0
  174. package/dist/packages/charts/src/plot-width.d.ts +3 -3
  175. package/dist/packages/charts/src/relationship/contour-plot.d.ts +61 -0
  176. package/dist/packages/charts/src/relationship/density-map.d.ts +45 -0
  177. package/dist/packages/charts/src/relationship/embedding-map.d.ts +75 -0
  178. package/dist/packages/charts/src/relationship/index.d.ts +11 -0
  179. package/dist/packages/charts/src/relationship/level-legend.d.ts +11 -0
  180. package/dist/packages/charts/src/relationship/measures.d.ts +85 -0
  181. package/dist/packages/charts/src/relationship/parallel-coordinates.d.ts +30 -0
  182. package/dist/packages/charts/src/relationship/range-controls.d.ts +20 -0
  183. package/dist/packages/charts/src/relationship/scatter-matrix.d.ts +20 -0
  184. package/dist/packages/charts/src/spec/chart-guide.d.ts +21 -0
  185. package/dist/packages/charts/src/spec/figure-registry.d.ts +44 -0
  186. package/dist/packages/charts/src/spec/figure-spec.d.ts +147 -0
  187. package/dist/packages/charts/src/spec/figure-text.d.ts +8 -0
  188. package/dist/packages/charts/src/spec/figure.d.ts +12 -0
  189. package/dist/packages/charts/src/spec/guide-data.d.ts +85 -0
  190. package/dist/packages/charts/src/spec/index.d.ts +10 -0
  191. package/dist/packages/charts/src/spec/validate-figure.d.ts +15 -0
  192. package/dist/packages/charts/src/text/index.d.ts +11 -0
  193. package/dist/packages/charts/src/text/token-examples.d.ts +42 -0
  194. package/dist/packages/charts/src/text/token-grid.d.ts +47 -0
  195. package/dist/packages/charts/src/text/token-links.d.ts +49 -0
  196. package/dist/packages/charts/src/text/token-predictions.d.ts +38 -0
  197. package/dist/packages/charts/src/text/token-scale.d.ts +20 -0
  198. package/dist/packages/charts/src/text/token-text.d.ts +39 -0
  199. package/dist/packages/charts/src/timeline/event-strip.d.ts +70 -0
  200. package/dist/packages/charts/src/timeline/index.d.ts +3 -1
  201. package/dist/packages/charts/src/timeline/waterfall.d.ts +29 -14
  202. package/dist/packages/charts/src/transforms/bins.d.ts +91 -0
  203. package/dist/packages/charts/src/transforms/density.d.ts +53 -0
  204. package/dist/packages/charts/src/transforms/fits.d.ts +50 -0
  205. package/dist/packages/charts/src/transforms/index.d.ts +19 -0
  206. package/dist/packages/charts/src/transforms/matrices.d.ts +49 -0
  207. package/dist/packages/charts/src/transforms/quantiles.d.ts +96 -0
  208. package/dist/packages/charts/src/transforms/ranks.d.ts +44 -0
  209. package/dist/packages/charts/src/transforms/runs.d.ts +47 -0
  210. package/dist/packages/charts/src/transforms/sampling.d.ts +75 -0
  211. package/dist/packages/charts/src/transforms/smoothing.d.ts +41 -0
  212. package/dist/packages/charts/src/transforms/values.d.ts +70 -0
  213. package/dist/packages/charts/src/trend/bump-chart.d.ts +33 -0
  214. package/dist/packages/charts/src/trend/column-figure.d.ts +38 -0
  215. package/dist/packages/charts/src/trend/column-positions.d.ts +21 -0
  216. package/dist/packages/charts/src/trend/curve-chart.d.ts +69 -0
  217. package/dist/packages/charts/src/trend/end-labels.d.ts +40 -0
  218. package/dist/packages/charts/src/trend/horizon-chart.d.ts +37 -0
  219. package/dist/packages/charts/src/trend/index.d.ts +10 -0
  220. package/dist/packages/charts/src/trend/line-locate.d.ts +21 -0
  221. package/dist/packages/charts/src/trend/runs-chart.d.ts +50 -0
  222. package/dist/packages/charts/src/trend/slope-chart.d.ts +35 -0
  223. package/dist/packages/collections/src/collection-controls.d.ts +5 -1
  224. package/dist/packages/collections/src/collection-filters.d.ts +4 -1
  225. package/dist/packages/collections/src/control-toolbar.d.ts +13 -0
  226. package/dist/packages/collections/src/data-table-layout.d.ts +78 -0
  227. package/dist/packages/collections/src/data-table-rows.d.ts +54 -0
  228. package/dist/packages/collections/src/data-table-styles.d.ts +340 -0
  229. package/dist/packages/collections/src/data-table-text.d.ts +13 -0
  230. package/dist/packages/collections/src/data-table-trigger.d.ts +23 -0
  231. package/dist/packages/collections/src/data-table.d.ts +3 -85
  232. package/dist/packages/collections/src/index.d.ts +11 -6
  233. package/dist/packages/collections/src/query-controls.d.ts +6 -2
  234. package/dist/packages/collections/src/table-results.d.ts +47 -13
  235. package/dist/packages/collections/src/timeline.d.ts +1 -0
  236. package/dist/packages/collections/src/use-collection-controls.d.ts +2 -1
  237. package/dist/packages/collections/src/use-table-window.d.ts +25 -0
  238. package/dist/packages/content/src/viewer.d.ts +8 -0
  239. package/dist/packages/core/src/disclosure.d.ts +9 -1
  240. package/dist/packages/core/src/index.d.ts +1 -0
  241. package/dist/packages/core/src/route-link.d.ts +11 -0
  242. package/dist/packages/forms/src/dates/date-inputs.d.ts +3 -1
  243. package/dist/packages/forms/src/file-picker.d.ts +15 -0
  244. package/dist/packages/forms/src/form-controls.d.ts +1 -6
  245. package/dist/packages/forms/src/forms.d.ts +4 -1
  246. package/dist/packages/forms/src/index.d.ts +4 -2
  247. package/dist/packages/forms/src/selection.d.ts +14 -0
  248. package/dist/packages/foundations/src/csp/index.d.ts +1 -1
  249. package/dist/packages/foundations/src/csp/provider.d.ts +7 -2
  250. package/dist/packages/kits/src/evaluation/evaluation-data.d.ts +31 -0
  251. package/dist/packages/kits/src/evaluation/index.d.ts +8 -0
  252. package/dist/packages/kits/src/evaluation/leaderboard-cells.d.ts +62 -0
  253. package/dist/packages/kits/src/evaluation/leaderboard.d.ts +59 -0
  254. package/dist/packages/kits/src/evaluation/model-comparison.d.ts +59 -0
  255. package/dist/packages/kits/src/evaluation/score-breakdown.d.ts +33 -0
  256. package/dist/packages/kits/src/explainers/bound-value.d.ts +29 -0
  257. package/dist/packages/kits/src/explainers/figures.d.ts +31 -0
  258. package/dist/packages/kits/src/explainers/index.d.ts +8 -0
  259. package/dist/packages/kits/src/explainers/linked-target.d.ts +22 -0
  260. package/dist/packages/kits/src/explainers/story-steps.d.ts +46 -0
  261. package/dist/packages/kits/src/explainers/term.d.ts +29 -0
  262. package/dist/packages/kits/src/interpretability/attention-head-grid.d.ts +56 -0
  263. package/dist/packages/kits/src/interpretability/attribution-workbench.d.ts +29 -0
  264. package/dist/packages/kits/src/interpretability/embedding-atlas.d.ts +41 -0
  265. package/dist/packages/kits/src/interpretability/feature-card.d.ts +33 -0
  266. package/dist/packages/kits/src/interpretability/feature-list.d.ts +51 -0
  267. package/dist/packages/kits/src/interpretability/feature-logits.d.ts +23 -0
  268. package/dist/packages/kits/src/interpretability/features.d.ts +70 -0
  269. package/dist/packages/kits/src/interpretability/index.d.ts +16 -0
  270. package/dist/packages/kits/src/interpretability/kit-styles.d.ts +118 -0
  271. package/dist/packages/kits/src/interpretability/logit-lens.d.ts +50 -0
  272. package/dist/packages/kits/src/interpretability/node-panel.d.ts +32 -0
  273. package/dist/packages/kits/src/interpretability/shared-link.d.ts +8 -0
  274. package/dist/packages/kits/src/interpretability/steering-panel.d.ts +52 -0
  275. package/dist/packages/kits/src/operations/budget-board.d.ts +49 -0
  276. package/dist/packages/kits/src/operations/incident-timeline.d.ts +30 -0
  277. package/dist/packages/kits/src/operations/index.d.ts +6 -0
  278. package/dist/packages/kits/src/operations/service-health.d.ts +66 -0
  279. package/dist/packages/kits/src/training/index.d.ts +8 -0
  280. package/dist/packages/kits/src/training/run-dashboard.d.ts +49 -0
  281. package/dist/packages/kits/src/training/run-legend.d.ts +21 -0
  282. package/dist/packages/kits/src/training/run-marker.d.ts +5 -0
  283. package/dist/packages/kits/src/training/run-state.d.ts +7 -0
  284. package/dist/packages/kits/src/training/run-table.d.ts +63 -0
  285. package/dist/packages/kits/src/training/runs-overview.d.ts +20 -0
  286. package/dist/packages/kits/src/training/runs.d.ts +34 -0
  287. package/dist/packages/navigation/src/index.d.ts +1 -1
  288. package/dist/path-BglsXpnO.js +59 -0
  289. package/dist/{pierre-diff-B3tD3-6z.js → pierre-diff-DlvjyuJn.js} +1 -1
  290. package/dist/plot-axes-DJkLW4wk.js +100 -0
  291. package/dist/plot-layout-BEuoOHbs.js +911 -0
  292. package/dist/plot-marks-A64v7aTw.js +226 -0
  293. package/dist/plot-surface-CJTIqtck.js +51 -0
  294. package/dist/{plot-width-CIqBiHcd.js → plot-width-DcqtSgzb.js} +22 -3
  295. package/dist/point-layer-C-EYETAt.js +655 -0
  296. package/dist/reference-lines-CWA8VeUR.js +82 -0
  297. package/dist/scale-C2xgZyZN.js +63 -0
  298. package/dist/slope-chart-DT22h_ym.js +1279 -0
  299. package/dist/{src-gqEebHEa.js → src-1EHkSFS-.js} +395 -274
  300. package/dist/{src-DBNncL7_.js → src-BPTDJqt0.js} +48 -68
  301. package/dist/{src-Dcs3SZ9V.js → src-CExIrXPC.js} +170 -194
  302. package/dist/src-CGc_hjxJ.js +409 -0
  303. package/dist/{src-DcW_gMX8.js → src-CpdJlDhO.js} +480 -362
  304. package/dist/src-D5NXRJZe.js +2195 -0
  305. package/dist/src-DIS0YOj0.js +44 -0
  306. package/dist/styles2.css +574 -161
  307. package/dist/time-series-IB3CB93O.js +2668 -0
  308. package/dist/token-heatmap-C00DnoNO.js +1354 -0
  309. package/dist/token-predictions-Cxx29iDr.js +1093 -0
  310. package/dist/tone-scope-DKiSw-JR.js +32 -0
  311. package/dist/tree-diagram-DsckNKaW.js +1629 -0
  312. package/dist/treemap-9_DpLCW9.js +472 -0
  313. package/dist/values-963L6n1m.js +65 -0
  314. package/dist/violin-plot-BhPHKXsN.js +1291 -0
  315. package/dist/waterfall-CGksuTy5.js +576 -0
  316. package/package.json +57 -7
  317. package/recipes/allocation-report.tsx +15 -7
  318. package/skills/extend-elements/SKILL.md +134 -0
  319. package/skills/review-elements/SKILL.md +118 -0
  320. package/skills/upgrade-elements/SKILL.md +36 -0
  321. package/skills/upgrade-elements/references/releases.md +242 -0
  322. package/skills/use-elements/SKILL.md +70 -13
  323. package/skills/use-elements/references/agent.md +57 -0
  324. package/skills/use-elements/references/charts.md +384 -0
  325. package/skills/use-elements/references/collections.md +89 -0
  326. package/skills/use-elements/references/conversations.md +47 -0
  327. package/skills/use-elements/references/figures.md +173 -0
  328. package/skills/use-elements/references/forms.md +81 -0
  329. package/skills/use-elements/references/kits.md +198 -0
  330. package/skills/use-elements/references/styling.md +70 -0
  331. package/skills/use-elements/references/workspace.md +3 -3
  332. package/dist/categorical-values-DZLGQVW1.js +0 -63
  333. package/dist/chart-frame-Ztktqs1b.js +0 -255
  334. package/dist/chart-input-BO3BqlFO.js +0 -22
  335. package/dist/chart-navigation-BAbb5PV9.js +0 -154
  336. package/dist/header-styles-COxCYFZx.js +0 -90
  337. package/dist/packages/charts/src/chart-navigation.d.ts +0 -39
  338. package/dist/packages/charts/src/chart-surface.d.ts +0 -27
  339. package/dist/packages/navigation/src/route-link.d.ts +0 -2
  340. package/dist/src-Bk7M67zy.js +0 -396
@@ -1,5 +1,6 @@
1
1
  import { Stack, Text } from '@mechane-ai/elements';
2
- import type { ChartTone } from '@mechane-ai/elements/charts';
2
+ import { formatValue } from '@mechane-ai/elements/charts';
3
+ import type { ChartTone, ValueFormat } from '@mechane-ai/elements/charts';
3
4
  import { BreakdownBar, BridgeChart } from '@mechane-ai/elements/charts/cartesian';
4
5
  import type { BridgeStep, ChartReferenceLine } from '@mechane-ai/elements/charts/cartesian';
5
6
  import { FlowDiagram } from '@mechane-ai/elements/charts/graph';
@@ -19,7 +20,10 @@ type AllocationProps = {
19
20
  readonly remainderLabel: string;
20
21
  readonly target?: ChartReferenceLine;
21
22
  readonly explanation: 'bridge' | 'flow';
22
- readonly formatValue: (value: number) => string;
23
+ /** How every amount is written, such as `{ style: 'currency', currency: 'USD' }`. */
24
+ readonly valueFormat: ValueFormat;
25
+ /** The locale every amount is written in. */
26
+ readonly locale: string;
23
27
  };
24
28
 
25
29
  const REMAINDER_ID = 'remainder';
@@ -39,7 +43,8 @@ export function AllocationReport({
39
43
  remainderLabel,
40
44
  target,
41
45
  explanation,
42
- formatValue,
46
+ valueFormat,
47
+ locale,
43
48
  }: AllocationProps) {
44
49
  const remainder = total - commitments.reduce((sum, commitment) => sum + commitment.amount, 0);
45
50
  const report = { summary: <Text>{headline}</Text> };
@@ -83,29 +88,32 @@ export function AllocationReport({
83
88
  <PageContent>
84
89
  <Stack>
85
90
  <BreakdownBar
86
- title={`${totalLabel}: ${formatValue(total)}`}
91
+ title={`${totalLabel}: ${formatValue({ value: total, locale, format: valueFormat })}`}
92
+ locale={locale}
87
93
  items={[
88
94
  ...commitments.map(({ id, label, amount, tone }) => ({ id, label, value: amount, tone })),
89
95
  { id: REMAINDER_ID, label: remainderLabel, value: remainder, tone: REMAINDER_TONE },
90
96
  ]}
91
97
  total={total}
92
- formatValue={formatValue}
98
+ valueFormat={valueFormat}
93
99
  />
94
100
  {explanation === 'bridge' ? (
95
101
  <BridgeChart
96
102
  title={`From ${totalLabel.toLowerCase()} to ${remainderLabel.toLowerCase()}`}
103
+ locale={locale}
97
104
  report={report}
98
105
  steps={steps}
99
- formatValue={formatValue}
106
+ valueFormat={valueFormat}
100
107
  referenceLines={target === undefined ? [] : [target]}
101
108
  />
102
109
  ) : (
103
110
  <FlowDiagram
104
111
  title={`Where ${totalLabel.toLowerCase()} goes`}
112
+ locale={locale}
105
113
  report={report}
106
114
  nodes={nodes}
107
115
  links={links}
108
- formatValue={formatValue}
116
+ valueFormat={valueFormat}
109
117
  />
110
118
  )}
111
119
  </Stack>
@@ -16,6 +16,80 @@ is the guide for the pinned SDK. Use an existing UI SDK behavior where one fits.
16
16
  and agent actions. Use the family's StyleX tokens and density choices and export the supported API from its public
17
17
  entry.
18
18
 
19
+ ## A UI SDK component first
20
+
21
+ Wrap the SDK component when one names the interaction, and add only the Elements styling and the supported props.
22
+
23
+ | The interaction | Start from |
24
+ | ----------------------------------------------- | ---------------------------------------------------------------------------------------- |
25
+ | A row of controls with one Tab stop | `@ui-sdk/react/toolbar`, as `packages/collections/src/control-toolbar.tsx` |
26
+ | One choice from a short row | `@ui-sdk/react/segmented-control`, as `packages/forms/src/selection.tsx` |
27
+ | Choosing, dropping or pasting files | `@ui-sdk/react/file-input`, as `packages/forms/src/file-picker.tsx` |
28
+ | A typed date | `@ui-sdk/react/date-input`, as `packages/forms/src/dates/date-inputs.tsx` |
29
+ | A region that follows new content to its end | `@ui-sdk/react/scroll-area`, as `packages/ai/src/conversation.tsx` |
30
+ | Rows or cells with one Tab stop and a selection | `createGridFocus` and `createSelection`, as `packages/collections/src/table-results.tsx` |
31
+ | A long list that renders only what shows | `createVirtualizer`, as `packages/collections/src/use-table-window.ts` |
32
+
33
+ A control that can sit in a toolbar or outside one reads the toolbar around it, as `useToolbarButton` does. A part of
34
+ the SDK toolbar throws outside its root.
35
+
36
+ ## A primitive of your own
37
+
38
+ When no UI SDK component fits, define one primitive beside the component and keep every rule of the interaction in it.
39
+ `packages/charts/src/chart.tsx` and `packages/core/src/route-link.tsx` are the references.
40
+
41
+ ```tsx
42
+ import { createChange, definePrimitive } from '@ui-sdk/core';
43
+ import type { ChangeDetails } from '@ui-sdk/core';
44
+ import { createParts } from '@ui-sdk/react/primitive';
45
+
46
+ type RatingOptions = {
47
+ readonly value?: number | undefined;
48
+ readonly defaultValue?: number | undefined;
49
+ readonly onValueChange?: ((value: number, details: ChangeDetails<'item-press'>) => void) | undefined;
50
+ };
51
+
52
+ const rating = definePrimitive({
53
+ name: 'rating',
54
+ options: { value: 'number', defaultValue: 'number', onValueChange: 'callback' },
55
+ controlled: ['value'],
56
+ state: (options: RatingOptions) => ({ value: options.value ?? options.defaultValue ?? 0 }),
57
+ sync: (options) => (options.value === undefined ? {} : { value: options.value }),
58
+ api: (context) => {
59
+ const change = createChange(context);
60
+
61
+ return {
62
+ setValue: (value: number, event?: Event) =>
63
+ change('value', value, event === undefined ? { reason: 'item-press' } : { reason: 'item-press', event }),
64
+ };
65
+ },
66
+ slots: (slot) => ({
67
+ root: slot({ role: 'group' }),
68
+ star: slot<{ value: string }>({
69
+ props: { value: 'string' },
70
+ attrs: (state, { key }) => ({ 'data-filled': Number(key) <= state.value ? '' : undefined }),
71
+ press: ({ api, key }, event) => api.setValue(Number(key), event),
72
+ }),
73
+ }),
74
+ agent: { actions: ['setValue'] },
75
+ });
76
+
77
+ const parts = createParts(rating, { root: 'div', star: 'button' });
78
+ ```
79
+
80
+ - Name the primitive for what a reader calls it. An agent finds it by that name and by its accessible label.
81
+ - State an application owns goes in `controlled`, and every change to it goes through `createChange` with a reason and
82
+ the event, leaving `event` out when there is none. Use `dispatch` for a request that is not state, such as asking the
83
+ application to select a record.
84
+ - Put the role on the slot with `role`, never in `attrs`. Attribute values are strings. Style states through the data
85
+ attributes the slot writes, such as `':is([data-filled])'` in StyleX.
86
+ - Always write the `agent` key. A component an agent only reads declares `agent: { actions: [] }`. One whose value is
87
+ always one of its items adds `closed: true`, and returns the items as data when they are not rendered.
88
+ - Give a composite one Tab stop and move a cursor inside it. A press on a part leaves focus on the composite.
89
+ - Merge incoming props with `mergeProps` from `@ui-sdk/react/primitive`, with the StyleX output first.
90
+ - Keep the `definePrimitive` result private to its module. Export typed parts or a hook with an explicit return type,
91
+ because the package build cannot name the primitive's inferred type.
92
+
19
93
  Give interactive components a meaningful accessible name. Advertise actions only when the visible control can perform
20
94
  them. Derive visible items and readings from the authorized data currently on screen. Route actions through the same
21
95
  selection, navigation, or submit callback used by a person. The application supplies permissions, pending state,
@@ -26,3 +100,63 @@ Check a representative task in the family story with keyboard and the public `/a
26
100
  once the control is disabled, its selection changes, or its data is loading. For sensitive controls also inspect
27
101
  compound snapshots and action results for private values. Update the page recipe if the preferred consumer composition
28
102
  changes.
103
+
104
+ ## A chart
105
+
106
+ Read contract `workspaces/core/.contracts/140-ui-data-display/CONTRACT.md` and the chart guide
107
+ `workspaces/core/docs/ui-charts.md` first. Copy the structure of `packages/charts/src/trend/curve-chart.tsx` and its
108
+ story.
109
+
110
+ 1. Choose the family by the reader's question. A chart that no family fits needs a new kernel part first, and only when
111
+ a named chart needs it. Add the part to `packages/charts/src/plot` or `figure`, keep the edit additive, and export it
112
+ from `plot/index.ts`, which is the public kernel entry `@mechane-ai/elements/charts/plot`.
113
+ 2. Draw with the kernel only: `numericPlot` or `categoryPlot`, `PlotSurface`, `PlotAxes`, `PlotClip` and the marks
114
+ (`LineMark`, `AreaMark`, `BandMark`, `DotMark`, `BarMark`, `RuleMark`, `IntervalMark`, `LabelMark`, `SymbolMark`,
115
+ `RingMark`, `LinkMark`, `ConnectorMark`, `GuideMark`). Do not write a scale, a tick, an axis or a path again, and do
116
+ not restyle a mark. The marks carry the channel meanings.
117
+ 3. Take `FigureProps`, plus `FigureSelectionProps` when a record can be selected. Name state the way the others do:
118
+ `selected` with `onSelectedChange`, `range` with `onRangeChange`. No `format*` function props: use `PlotAxis`,
119
+ `valueFormat` and `timeFormat`, and write text with `formatValue` and `formatTime`. `locale` is required. Height is a
120
+ `PlotHeight`.
121
+ 4. Write ticks with `axisTicks` or `timeAxisTicks` and `tickTexts` from `plot`, and place labels with `freeLabelSpot`.
122
+ Give `FigureFrame` a `seriesLegend` for a legend that names things (above the plot) and a `scaleLegend` for a color
123
+ or size scale (below it). Resolve tones with `useTones()` and never hard-code a color. Spread `useLinkedInspection()`
124
+ into `Chart` when item ids mean the same thing in other charts.
125
+ 5. Validate first and return `FigureInvalid` with the reason. Never repair, clamp, reorder or drop. Refuse input above a
126
+ `<chart>Limits` object with a message that names it. Handle `status`, empty input and `coverage`.
127
+ 6. Keep every prop except callbacks and `ReactNode` slots plain JSON, then register the chart so a figure spec can name
128
+ it. In `packages/charts/src/spec/figure-spec.ts`, add its props to `FigureChartProps`, and a new family to
129
+ `FigureFamily`. In `spec/figure-registry.tsx`, add an entry with the component, its family, its required props with
130
+ their JSON kinds and `isSelectable`. Render the chart from its spec and compare it with the direct call.
131
+ 7. Keep statistics out. If the chart needs a bin, quantile, density or fit, add a named function to
132
+ `packages/charts/src/transforms` with a `describe...` footnote, and take the result as props.
133
+ 8. Add a guide entry in `spec/chart-guide.tsx`: the `question` the chart answers in a reader's words, `use` for when to
134
+ choose it, `avoid` for the chart that is better otherwise, and a small valid `example` spec. Build the data with the
135
+ helpers in `spec/guide-data.ts` where they fit. The types require one entry for every registered chart. The entry
136
+ feeds the wall. Write the chart into the chooser tables of the package `README.md`, `docs/ui-charts.md` and the
137
+ `use-elements` charts reference, which are the guide written out.
138
+ 9. Write the stories: `Charts/<ChartName>` with a default, an interactive story and a `States` story, in `en-US` with
139
+ deterministic data.
140
+ 10. Check the wall. `Charts/Wall`, in `spec/wall.stories.tsx`, draws every registered chart from its guide example
141
+ through `Figure`, so the new chart appears in its family story and in `All` with no further edit. A new family also
142
+ needs a title and a place in the wall's list. Review it in light and dark themes and at phone width. Inspect a
143
+ record by pointer, touch and keyboard. Compare the frame, axes, ticks, legend, readout, footnote and each state with
144
+ its neighbors.
145
+ 11. Add the chart to the family `index.ts`, with its types and its limits. Run `mise run fix` and `mise run check` from
146
+ the factory root.
147
+
148
+ ## A kit component
149
+
150
+ A kit under `packages/kits/src/<kit>` composes charts and collections for a domain question. It adds no marks, scales,
151
+ axes or colors. If you want to draw an SVG mark, use or request a chart instead.
152
+
153
+ - Follow contract `workspaces/core/.contracts/141-ui-domain-kits/CONTRACT.md`. Import other families only through their
154
+ public `index.ts` entries.
155
+ - Take `locale` and declared formats. Take the state the application owns as a value with a change callback. Take the
156
+ words as one partial `labels` prop with English defaults.
157
+ - Use one `ToneScope` over the things shown in more than one figure, and one `ChartLink` or `ChartGrid` where figures
158
+ share ids. Use the table cells from `charts/cells` inside `DataTable` columns.
159
+ - Handle `status`, empty, partial and invalid input. Refuse bad input with a sentence.
160
+ - Compute no statistic. The application supplies means, intervals, ranks and deltas.
161
+ - Write one stories file titled `Kits/<Kit name>` with a story per component, one page that composes them and a `States`
162
+ story. Export the components from the kit's `index.ts` and add the entry to `package.json`.
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: review-elements
3
+ description:
4
+ Review a page built with Mechane Elements before it ships. Use after building or changing UI with
5
+ `@mechane-ai/elements`, or when asked to check keyboard access, loading states, narrow layouts, themes or agent
6
+ access.
7
+ ---
8
+
9
+ # Review an Elements page
10
+
11
+ Run the page in a browser and use it. A passing type check says nothing about focus, loading or layout. Report what you
12
+ checked, what failed and what you could not check.
13
+
14
+ ## 1. Keyboard alone
15
+
16
+ Put the pointer away and complete the page's main task.
17
+
18
+ - Tab reaches every control once, in reading order, with a visible focus ring.
19
+ - A table's row actions, a control row, a chart, a timeline, tabs and a segmented control are each **one** Tab stop.
20
+ Arrow keys move inside them. Another Tab stop inside one of these means a wrapper is fighting the component.
21
+ - Enter or Space activates. Escape closes the top layer only: a readout before its dialog, a menu before its drawer.
22
+ - Closing a dialog, menu or popover returns focus to what opened it. After a save, focus lands on the result.
23
+ - Text entry keeps its keys. A shortcut does not fire while the reader types.
24
+
25
+ ## 2. Every read state
26
+
27
+ Hold a slow read, fail one, and return an empty result.
28
+
29
+ - Pending reserves the result's geometry with a matching placeholder. Nothing jumps when the content arrives.
30
+ - A refresh keeps the last result, its focus and any draft on screen, with progress or the failure beside it.
31
+ - A failed first read shows a `Notice` with Retry in place. A successful empty result shows an `EmptyState`.
32
+ - Each failure has one presentation. Not a banner and a toast for the same error.
33
+ - Navigate away mid-read. A late response must not replace the new selection's content.
34
+ - A pending save disables a second submit. A failed save keeps the draft.
35
+
36
+ ## 3. Width and pointer
37
+
38
+ Check 360 pixels wide, a tablet width and a wide desktop.
39
+
40
+ - The page never scrolls sideways. A wide table or plot scrolls inside its own region.
41
+ - Toolbar actions wrap below their title. Long labels wrap or truncate with the full value available elsewhere.
42
+ - With a coarse pointer, standalone controls give 44px targets and text fields use 16px text.
43
+ - At a wide viewport, the right edges of a report header, its table and the pane line up.
44
+
45
+ ## 4. Theme and motion
46
+
47
+ - Switch to the dark theme and open every menu, dialog, popover and tooltip. A portaled panel in the wrong theme means
48
+ the theme is not on the document root.
49
+ - Turn on reduced motion. Fades and slides stop, and nothing waits for an animation to finish.
50
+
51
+ ## 5. Honest content
52
+
53
+ - Unknown is not zero. A missing value shows as unavailable, and a chart draws a gap.
54
+ - Try the longest real name, a large number, an empty optional field and a single row.
55
+ - Dates and numbers carry a unit, and come from a formatter with an explicit locale and time zone.
56
+ - An icon-only button has an accessible name. A chart's title says what was measured and for which period. Review a
57
+ chart further in section 8.
58
+
59
+ ## 6. What an agent sees
60
+
61
+ When the app enables the bridge from `/agent`, print `agent.snapshot()` on the page.
62
+
63
+ - Every component has a label a person would recognize.
64
+ - The listed actions match what the visible controls can do right now. A disabled control offers no action.
65
+ - No credential, private draft or hidden record appears in a label, an item or a result.
66
+ - A step an agent takes produces the same request and the same pending state as a person's press.
67
+
68
+ ## 7. Read the code once
69
+
70
+ - Imports come from `@mechane-ai/elements` entries. No second component library renders the same kind of control.
71
+ - No class or inline style changes a control's size, padding, radius or focus ring. `xstyle` carries placement only.
72
+ - No custom `onKeyDown`, tooltip or scroll effect duplicates what the component already does.
73
+ - Each value has one owner: controlled with its callback, or an uncontrolled default.
74
+ - The server authorizes every read and mutation. The UI's disabled state is not the permission check.
75
+
76
+ ## 8. Figures
77
+
78
+ Run this pass on every page with a chart, a kit component or a figure spec. Look at the figure, then read its footnote
79
+ and its readout.
80
+
81
+ - **After a chart change, look at the wall first.** When you changed a chart in the Elements source, open `Charts/Wall`
82
+ in the Elements Storybook before the page. It is one page that draws every registered chart from its `chartGuide`
83
+ example through `Figure`, with one story per family and an `All` story. Compare the changed chart's frame, axes,
84
+ ticks, legend, readout, footnote and states with its neighbors, in the light and dark themes and at phone width. A
85
+ chart that looks different from the others there is wrong before any page uses it. The wall is part of the Elements
86
+ Storybook, so an app with only the installed package has no wall. There, compare the figure with its `example` in
87
+ `chartGuide`.
88
+ - **One hue per thing.** The same model, run or series has the same hue in every figure, table and sentence on the page.
89
+ A `ToneScope` names the ids. A hue that changes between figures means an id differs or a scope is missing.
90
+ - **Linked figures answer together.** Inside a `ChartLink`, hover a row or a point and check that the same id is marked
91
+ in each other figure. A figure that stays still has a different id for the same thing.
92
+ - **A spec from JSON validates.** For a figure drawn from a spec, `validateFigureSpec` returns `ok`, or the page shows
93
+ its `message`. An invalid spec in the figure itself shows the same reason in place of the chart.
94
+ - **Declared formats and units.** Every number comes from a declared format with a `locale`, and every axis title names
95
+ its unit. A time format names its time zone. No formatter function appears in the props.
96
+ - **Bars start at zero.** A bar, histogram or area that starts elsewhere misleads. Dots and lines may use a fitted
97
+ range.
98
+ - **Log axes are named.** A log or symlog axis says so in its title. A log axis holds no zero or negative value.
99
+ - **Missing is hollow.** A missing value is a hollow mark, a gap or "Unavailable", never zero. A zero is drawn as zero.
100
+ - **Partial data states its coverage.** A sample or a window shows how much it draws, such as "1,000 of 48,000 points",
101
+ beside the title.
102
+ - **Source and transforms in the footnote.** The footnote names where the data came from and each step the app applied:
103
+ smoothing, binning, quantile method, sample.
104
+ - **One meaning per channel.** A dashed stroke is modelled, a pale band is uncertainty, gray is context, and size has a
105
+ legend. No second value axis on one plot.
106
+ - **Reachable by keyboard.** The plot is one Tab stop. Arrow keys inspect, Enter selects, and Escape closes the readout.
107
+ A range or a pan has a keyboard path.
108
+ - **Readout text is present.** The inspected record states its exact values in text, and the exact-value table lists
109
+ every record.
110
+ - **Limits are respected.** The page stays inside each chart's `<chart>Limits` and names its window or aggregate. A
111
+ chart that refuses input shows the reason, not a blank.
112
+ - **States match.** Loading holds the final geometry, empty says why, and invalid names the problem.
113
+ - **Dark theme and phone width.** In the dark theme, marks and labels keep their contrast. At 360 pixels, labels do not
114
+ overlap, the readout stays in view, and the plot does not scroll the page sideways.
115
+ - **No statistic in the chart.** The app computed every quantile, density, bin and fit, with a named transform.
116
+
117
+ Not covered by this review: a real screen reader, a physical touch device and right-to-left text. Say so in the report
118
+ unless you ran them.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: upgrade-elements
3
+ description:
4
+ Upgrade `@mechane-ai/elements` in an app. Use when changing the package version, or when types, keyboard behavior or
5
+ agent output changed after an upgrade.
6
+ ---
7
+
8
+ # Upgrade Elements
9
+
10
+ Elements is below 1.0, so a minor version can remove or change an API. Upgrade one minor version at a time when the gap
11
+ is large.
12
+
13
+ 1. Read the installed version: `pnpm exec mechane-elements-catalog` prints it first.
14
+ 2. Change the version, install, and run this command so the skills match the new package:
15
+
16
+ ```sh
17
+ pnpm exec mechane-elements-catalog --install-skills .claude/skills
18
+ ```
19
+
20
+ Use the directory the skills were installed in before.
21
+
22
+ 3. Read [the release notes](references/releases.md) for every version between the old one and the new one.
23
+ 4. Run the app's type check. Fix each error from the notes. For a removed or renamed export, look up its replacement:
24
+
25
+ ```sh
26
+ pnpm exec mechane-elements-catalog filepicker
27
+ ```
28
+
29
+ 5. Search the app for what the type check cannot see: agent component names in an `allow` function, role or Tab-order
30
+ assumptions in tests, and CSS that targets Elements internals. After 0.47, also search for `MAX_` limit constants,
31
+ `selection={` and `ChartSelection`, `@visx` imports your app relied on Elements to install, chart `height` numbers,
32
+ and `format` function props or missing `locale` props passed through spread objects.
33
+ 6. Review each changed page with the `review-elements` skill. Behavior changes show in the browser, not in types.
34
+
35
+ Do not pin an old behavior back with a wrapper or a patch. Move the call site to the new API, and report anything the
36
+ new version cannot do.
@@ -0,0 +1,242 @@
1
+ # Release notes for applications
2
+
3
+ Newest first. Each section lists what an application must change, then what it may adopt.
4
+
5
+ ## 0.47
6
+
7
+ Elements has a data display system. Every chart is built from one plot kernel and takes the same figure props. This
8
+ release breaks the API of every existing chart. There are no aliases: change each call site.
9
+
10
+ Elements no longer depends on `@visx/hierarchy`, `@visx/scale` or `@visx/shape`, and no chart uses them. If your app
11
+ imports `@visx/*` itself, add it to your own `package.json`: it no longer arrives through Elements. No export moved from
12
+ one entry to another in this release. The names that left an entry are listed under "Removed exports".
13
+
14
+ ### Change
15
+
16
+ - **`locale` is required on every chart.** A number or a date is written from a declared format and the figure's
17
+ `locale`, so a server and a browser render alike. Pass a BCP 47 tag such as `"en-US"`.
18
+ - **Formatter functions are gone.** `formatValue`, `formatX`, `formatY`, `formatTick`, `formatTimestamp`,
19
+ `formatChange`, `formatCount`, `formatProbability` and `formatOffset` are replaced by declared formats: `Intl` options
20
+ as a `ValueFormat` or a `TimeFormat` (which names its `timeZone`). A function is still accepted where no option can
21
+ write the text. Ticks use the compact form of the format unless you set `tickFormat`.
22
+
23
+ ```tsx
24
+ // Before
25
+ <BarChart formatValue={(value) => `${value.toFixed(1)} ms`} formatTick={(value) => `${value}`} />
26
+ // After
27
+ <BarChart locale="en-US" valueFormat={{ style: 'unit', unit: 'millisecond', maximumFractionDigits: 1 }} />
28
+ ```
29
+
30
+ - **Selection is `selected` and `onSelectedChange`.** The `selection={{ selectedId, onSelect }}` object is removed, and
31
+ so is the `ChartSelection` type.
32
+
33
+ ```tsx
34
+ // Before
35
+ <Histogram selection={{ selectedId, onSelect: (id) => setSelectedId(id) }} />
36
+ // After
37
+ <Histogram selected={selectedId} onSelectedChange={(id) => setSelectedId(id)} />
38
+ ```
39
+
40
+ - **Heights are named.** `height` takes `'compact'` (160 px), `'regular'` (260 px) or `'tall'` (380 px), not a number.
41
+ `RelationGraph` `width` and `height` stay numbers: they are the extent of your node positions.
42
+ - **Limits are objects.** Every `MAX_*` export is removed, as the table under "Removed exports" shows.
43
+ - **`description` is a string** on every chart. It was a `ReactNode` on the time-series charts, `BarChart` and
44
+ `FlowDiagram`.
45
+ - **Records take an optional `tone`.** An absent tone comes from the enclosing `ToneScope`, then from the record's
46
+ place.
47
+ - **Removed exports.** Each name below left the entry shown and has the replacement beside it.
48
+
49
+ | Entry | Removed | Use instead |
50
+ | ------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
51
+ | `/charts` | type `ChartSelection` | `selected` and `onSelectedChange` props, and type `FigureSelectionProps` |
52
+ | `/charts/cartesian` | types `ScatterRangeSelection` and `TimeRangeSelection` | `range`, `onRangeChange` and `rangeStep` props |
53
+ | `/charts/cartesian` | `MAX_SCATTER_POINTS` | `scatterLimits.points` |
54
+ | `/charts/matrix` | `MAX_MATRIX_CELLS` | `matrixLimits.cells` |
55
+ | `/charts/matrix` | `MAX_HEATMAP_TOKENS` | `tokenHeatmapLimits.tokens` |
56
+ | `/charts/graph` | `MAX_FLOW_NODES` and `MAX_FLOW_LINKS` | `flowLimits.nodes` and `flowLimits.links` |
57
+ | `/charts/graph` | `MAX_RELATION_NODES`, `MAX_RELATION_EDGES`, `MAX_RELATION_GROUPS`, `MAX_RELATION_DIMENSION` | `relationGraphLimits.nodes`, `.edges`, `.groups` and `.dimension` |
58
+
59
+ `ChartInputError` and `colorTone` were helpers inside the package and were never exported from an entry, so an app
60
+ could not import them. They are gone. A chart now shows an invalid input with `FigureInvalid`, which `/charts/plot`
61
+ exports for a chart you build yourself, and takes a hue from `ToneScope` or a record's `tone`.
62
+
63
+ #### Migration by chart
64
+
65
+ | Chart | Before | After |
66
+ | --------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
67
+ | `LineChart`, `AreaChart` | `formatTimestamp`, `formatValue`, `formatTick`, `rangeSelection={{ value, onChange, step }}` | `timeFormat`, `valueFormat`, `tickFormat`, `range`, `onRangeChange`, `rangeStep`, and `locale` |
68
+ | `SmallMultiples` | `formatTimestamp` on the group, `formatValue` and `formatTick` per panel | `timeFormat` and `locale` on the group, `valueFormat` and `tickFormat` per panel. Panels take no `locale`. |
69
+ | `Sparkline` | No change | No change |
70
+ | `BarChart` | `domain` required, `formatValue`, `formatTick`, `highlightedSeriesId`, `selection`, `height` number | `domain` optional (fitted from zero), `valueFormat`, `tickFormat`, `highlighted`, `selected`, `onSelectedChange`, `height` name |
71
+ | `BreakdownBar`, `Treemap` | `formatValue`, `selection` | `valueFormat`, `selected`, `onSelectedChange`. `Treemap` `height` is a name. |
72
+ | `BridgeChart` | `formatValue`, `formatChange`, `formatTick`, `selection` | `valueFormat`, `changeFormat`, `tickFormat`, `selected`, `onSelectedChange` |
73
+ | `ScatterPlot` | `xDomain`, `xLabel`, `formatX`, `yDomain`, `yLabel`, `formatY`, `rangeSelection` | `x` and `y` as `PlotAxis`, `range`, `onRangeChange`, `rangeStep={{ x, y }}`. A point `tone` is optional. |
74
+ | `Histogram` | `domain`, `valueLabel`, `formatValue`, `maximumCount`, `countLabel`, `formatCount` | `value` and `count` as `PlotAxis`. The count domain starts at zero and is fitted when absent. |
75
+ | `ECDF` | `domain`, `valueLabel`, `formatValue`, `probabilityLabel`, `formatProbability` | `value` and `probability` as `PlotAxis`. The probability domain is `[0, 1]` when absent. |
76
+ | `IntervalPlot`, `RankedBars` | `domain`, `valueLabel`, `formatValue` | `value` as `PlotAxis`. `intervalLabel` stays on `IntervalPlot`. |
77
+ | `Matrix`, `TokenHeatmap` | `formatValue`, `selection`, required `description` and `emptyLabel` | `valueFormat`, `selected`, `onSelectedChange`. `description` and `emptyLabel` are optional. |
78
+ | `ColorLegend` | `formatValue` | `valueFormat` and `locale` |
79
+ | `RelationGraph` | `selection`, required `description` and `emptyLabel`, node `tone` required | `selected`, `onSelectedChange`. `description` and `emptyLabel` optional, node `tone` optional. |
80
+ | `FlowDiagram` | `formatValue`, `selection`, `height` number | `valueFormat`, `selected`, `onSelectedChange`, `height` name |
81
+ | `Waterfall` | `label`, `selectedId`, `onSelect`, `formatOffset`, `emptyLabel` required | `title`, `selected`, `onSelectedChange`, `offsetFormat`, `locale`. `emptyLabel` is optional. Item `tone` is optional. |
82
+ | `TimeSeriesChartPlaceholder`, `BarChartPlaceholder` | Frame props without `locale` | Same frame props and `locale`. `BarChartPlaceholder` `height` is a name. |
83
+ | `SmallMultiplesPlaceholder` | `charts`, `height` number | `charts`, `locale`, `height` name |
84
+
85
+ The most common calls, before and after:
86
+
87
+ ```tsx
88
+ // BarChart
89
+ <BarChart domain={[0, 100]} formatValue={format} highlightedSeriesId={hovered} selection={{ selectedId, onSelect }} height={200} />
90
+ <BarChart locale="en-US" domain={[0, 100]} valueFormat={{ maximumFractionDigits: 1 }} highlighted={hovered} selected={selectedId} onSelectedChange={onSelect} height="regular" />
91
+
92
+ // LineChart (SmallMultiples panels take valueFormat and tickFormat, the group takes timeFormat)
93
+ <LineChart formatTimestamp={formatTime} formatValue={format} rangeSelection={{ value: range, onChange: setRange, step: 60_000 }} />
94
+ <LineChart locale="en-US" timeFormat={{ timeZone: 'UTC', timeStyle: 'short' }} valueFormat={{ maximumFractionDigits: 1 }} range={range} onRangeChange={setRange} rangeStep={60_000} />
95
+
96
+ // ScatterPlot
97
+ <ScatterPlot xDomain={[0, 1]} xLabel="Cost" formatX={usd} yDomain={[0, 1]} yLabel="Quality" formatY={percent} rangeSelection={{ value: range, onChange: setRange, xStep: 0.01, yStep: 0.01, locale: 'en-US' }} />
98
+ <ScatterPlot locale="en-US" x={{ label: 'Cost (USD)', domain: [0, 1], format: { style: 'currency', currency: 'USD' } }} y={{ label: 'Quality', domain: [0, 1], format: { style: 'percent' } }} range={range} onRangeChange={setRange} rangeStep={{ x: 0.01, y: 0.01 }} />
99
+
100
+ // Histogram
101
+ <Histogram domain={[0, 500]} valueLabel="Latency (ms)" formatValue={ms} maximumCount={400} countLabel="Requests" formatCount={count} />
102
+ <Histogram locale="en-US" value={{ label: 'Latency (ms)', domain: [0, 500], format: { maximumFractionDigits: 0 } }} count={{ label: 'Requests', domain: [0, 400], format: { maximumFractionDigits: 0 } }} />
103
+
104
+ // ECDF
105
+ <ECDF domain={[0, 500]} valueLabel="Latency (ms)" formatValue={ms} probabilityLabel="Share" formatProbability={percent} />
106
+ <ECDF locale="en-US" value={{ label: 'Latency (ms)', domain: [0, 500], format: { maximumFractionDigits: 0 } }} probability={{ label: 'Share of requests', format: { style: 'percent' } }} />
107
+
108
+ // IntervalPlot and RankedBars
109
+ <RankedBars domain={[0, 1]} valueLabel="Share of errors" formatValue={percent} />
110
+ <RankedBars locale="en-US" value={{ label: 'Share of errors', domain: [0, 1], format: { style: 'percent' } }} />
111
+
112
+ // Matrix and TokenHeatmap
113
+ <Matrix valueLabel="Weight" formatValue={weight} selection={{ selectedId, onSelect }} />
114
+ <Matrix locale="en-US" valueLabel="Weight" valueFormat={{ maximumFractionDigits: 2 }} selected={selectedId} onSelectedChange={onSelect} />
115
+
116
+ // Treemap, BreakdownBar and FlowDiagram
117
+ <Treemap formatValue={bytes} selection={{ selectedId, onSelect }} height={180} />
118
+ <Treemap locale="en-US" valueFormat={{ notation: 'compact' }} selected={selectedId} onSelectedChange={onSelect} height="compact" />
119
+
120
+ // BridgeChart
121
+ <BridgeChart formatValue={usd} formatChange={signedUsd} formatTick={compactUsd} />
122
+ <BridgeChart locale="en-US" valueFormat={{ style: 'currency', currency: 'USD' }} changeFormat={{ style: 'currency', currency: 'USD', signDisplay: 'exceptZero' }} />
123
+
124
+ // Waterfall
125
+ <Waterfall label="Request" selectedId={id} onSelect={setId} formatOffset={ms} />
126
+ <Waterfall title="Request" locale="en-US" selected={id} onSelectedChange={setId} offsetFormat={{ style: 'unit', unit: 'millisecond' }} />
127
+
128
+ // RelationGraph (width and height stay numbers)
129
+ <RelationGraph title="Dependencies" selection={{ selectedId, onSelect }} width={640} height={360} />
130
+ <RelationGraph locale="en-US" title="Dependencies" selected={selectedId} onSelectedChange={onSelect} width={640} height={360} />
131
+
132
+ // Sparkline: no change
133
+ <Sparkline title="Latency" summary="Steady" unit="ms" timestampUnit="seconds" series={series} valueDomain={[0, 300]} />
134
+ ```
135
+
136
+ - **`BridgeChart` `changeFormat`** defaults to `valueFormat` with `signDisplay: 'exceptZero'` when `valueFormat` is
137
+ options. When it is a function, the plus and minus prefix logic is unchanged.
138
+ - **A `timeFormat` function receives milliseconds**, whichever `timestampUnit` you declare. `timestampUnit` still tells
139
+ the chart whether your timestamps are seconds or milliseconds.
140
+
141
+ ### Behavior to check
142
+
143
+ - **Default heights changed.** Time-series charts, `BarChart` and `Treemap` default to `compact` (160 px), where they
144
+ were 180, 200 and 180 px. `BridgeChart` defaults to `regular` (260 px), where it was 240 px. Pass `height="regular"`
145
+ to keep a taller plot.
146
+ - **States are shared.** Loading shows `FigureLoading` at the chart's height. The time-series charts, `SmallMultiples`
147
+ and `BarChart` keep their placeholders. Empty and invalid input use `FigureEmpty` and `FigureInvalid`.
148
+ - **A partial figure says so.** A chart given `coverage` states how much it draws beside its title, and the footnote
149
+ names `source` and `transforms`.
150
+ - **Invalid input is refused with a reason.** Axis domains that exclude data, a log axis with zero, and unordered
151
+ records show an invalid figure. Nothing is clamped or reordered.
152
+ - **Tick text and legends changed.** Tick text gains precision until neighbours differ, an axis longer than 120 px shows
153
+ at least three ticks, and an axis that draws its title leaves a `style: 'unit'` out of its ticks. A legend that names
154
+ things sits above the plot, and a color or size scale below it.
155
+ - **`IntervalPlot` and `RankedBars` write no value beside each row.** The readout and the exact-value table carry the
156
+ exact values. Both take `height` for the room per row.
157
+ - **A hollow mark means missing.** A bin, cell or mark with no value is drawn hollow and read as "Unavailable".
158
+ - **Hues come from a scope.** A record with no `tone` takes its hue from the enclosing `ToneScope`, then from its place
159
+ in the figure. Pin `tone` where color carries identity.
160
+
161
+ ### Adopt
162
+
163
+ - **More charts.** 50 charts are registered in all. `/charts/trend` (`CurveChart`, `RunsChart`, `SlopeChart`,
164
+ `BumpChart`, `HorizonChart`), `/charts/comparison` (`DotPlot`, `DumbbellPlot`, `BulletBar`), `/charts/relationship`
165
+ (`ContourPlot`, `ScatterMatrix`, `ParallelCoordinates`, `EmbeddingMap`, `DensityMap`), `/charts/text`, `/charts/image`
166
+ and `/charts/cells`. `BoxPlot`, `ViolinPlot`, `StripPlot` and `Ridgeline` join `/charts/distribution`.
167
+ `ConfusionMatrix`, `CorrelationMatrix`, `AttentionMatrix` and `CalendarHeatmap` join `/charts/matrix`.
168
+ `AttributionGraph` and `TreeDiagram` join `/charts/graph`. `Icicle` joins `/charts/hierarchy` and `EventStrip` joins
169
+ `/charts/timeline`.
170
+ - **Newer props.** `valueLabel` titles the value axis of `LineChart`, `AreaChart`, `SmallMultiples` panels, `BarChart`
171
+ and `BridgeChart`. `Sparkline` takes `layout`, matrices take `cellValues`, and `Waterfall` takes `description`,
172
+ `actions`, `source` and `transforms`.
173
+ - **Linked figures.** `ToneScope` gives each id one hue in every figure. `ChartLink` and `ChartGrid` share one
174
+ inspection between figures, so hovering a row in one figure marks the same id in the others. `CurveChart` and
175
+ `DotPlot` take `highlighted` and follow the link when it is left out. `useScopedTone` and `useChartLinkControl` let
176
+ prose and diagrams join in. `CurveChart` takes `labels` of `'legend'`, `'inline'` or `'none'`.
177
+ - **Statistics as functions.** `/charts/transforms` has bins, densities, fits, quantiles, ranks, smoothing and sampling,
178
+ each with a `describe...` note for the footnote. `bin2d` counts points for `DensityMap`, and its rows count up from
179
+ the lowest `y`.
180
+ - **Figure specs.** `/charts/figure` has `FigureSpec`, `validateFigureSpec`, `Figure`, `describeFigure`, `figureCharts`
181
+ and `chartGuide`, so an agent or a server can describe a figure as JSON, check it, draw it and read it back as text.
182
+ `chartGuide` has one entry per registered chart with what it shows and when to use it.
183
+ - **The plot kernel.** `/charts/plot` exports the scales, ticks, axes, marks and states that every chart uses, so you
184
+ can build a chart the library lacks.
185
+ - **Kits.** `/kits/explainers`, `/kits/training`, `/kits/operations`, `/kits/evaluation` and `/kits/interpretability`
186
+ compose charts into pages.
187
+ - **Large point maps.** `EmbeddingMap` draws up to 100,000 points on canvas and 1,000,000 with WebGL.
188
+
189
+ ## 0.46
190
+
191
+ Every interactive component now runs on a UI SDK primitive. `@base-ui/react`, `@tanstack/react-virtual` and
192
+ `@shadcn/react` are no longer dependencies of the package.
193
+
194
+ ### Change
195
+
196
+ - **`FilePicker` has a new API.** It was a native file input with `onChange`. It now takes
197
+ `onValueChange(files, details)` with `accept`, `multiple`, `maxFiles`, `maxSize` and `minSize`. It lists the chosen
198
+ files and shows why a file was refused.
199
+
200
+ ```tsx
201
+ // Before
202
+ <FilePicker onChange={(event) => setFile(event.currentTarget.files?.[0])} />
203
+ // After
204
+ <FilePicker maxSize={32 * 1024 * 1024} onValueChange={(files) => setFile(files[0])} />
205
+ ```
206
+
207
+ - **`ChartDatumButton` is removed.** Row charts handle their own rows. Pass `selection` to the chart instead.
208
+ - **`Accordion.Root` requires `aria-label` or `aria-labelledby`.**
209
+ - **`CSPProvider` takes `nonce` and `children` only.**
210
+ - **`Waterfall`'s `selectedRef` is `Ref<HTMLDivElement>`** and points at the selected row.
211
+ - **Agent names changed.** `navigation-link` is now `link`, and every Elements link reports `href` and `current` and
212
+ offers `follow`. `collection-record` is removed; open a row with `open` on `collection-results`. A chart offers
213
+ `inspect`, `select` and `dismiss`. Update any `allow` function that names the old components or actions.
214
+
215
+ ### Behavior to check
216
+
217
+ - **One Tab stop per composite.** A table's row actions, the control row above a collection, a timeline's events, a
218
+ waterfall's rows and a row chart with `selection` are each one Tab stop with arrow keys inside. Update tests that
219
+ press Tab once per row.
220
+ - `CollectionToolbar` and `FilterChips` have `role="toolbar"` where they had `role="group"`.
221
+ - A selectable `DataTable` shows a header checkbox for every supplied row, and Shift with a click selects a range.
222
+ - `Waterfall` is a `treegrid`.
223
+ - The day pickers show one typed field per date unit instead of the browser's date field.
224
+ - `ToggleGroup` sizes to its content instead of stretching across a column.
225
+ - On bars and bridge columns the ink edge now means selected only. The band and the readout mark the inspected column.
226
+ - A bridge chart leaves out a value label that would touch another label. The value stays in the readout.
227
+
228
+ ### Adopt
229
+
230
+ - **Change details.** These callbacks gained a second `details` argument with the reason, the source and `cancel()`:
231
+ `Input` and `Textarea` `onValueChange`, a collection's `search.onChange` and `search.onSubmit`, a filter's `onChange`,
232
+ `FilterChips` `onRemove`, a chart's `selection.onSelect`, `Waterfall` `onSelect`, a scatter range's `onChange`, and
233
+ `DataTable` `onSortChange` and `onSelectionChange`. One-argument handlers keep working.
234
+ - **`SegmentedControl`** for one choice from a short row. Replace a `ToggleGroup` that forced a single value.
235
+ - **`rangeSelection`** on `LineChart` and `AreaChart` for a time range the reader draws, moves and resizes.
236
+ - **`history`** on `PromptInput` for Arrow Up recall. Command or Control with Enter always submits.
237
+ - New agent components: `message`, `viewer` and `chart-range`.
238
+
239
+ ## 0.29
240
+
241
+ `ReportSection` is removed. Move its metric summary into the explanatory chart's `report.summary` or
242
+ `report.seriesValues`. Use `Stack` when the content already belongs to a region.