@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,10 +1,14 @@
1
+ import type { ChangeDetails } from '@ui-sdk/core';
1
2
  import type { PartProps } from '@ui-sdk/react/primitive';
2
3
  import type { ComponentType } from 'react';
3
4
  import type { CollectionFilter } from './collection-filters.tsx';
5
+ /** Why a search term changed: typing, the close button, Escape, a form reset, or a call such as an agent's step. */
6
+ export type CollectionSearchDetails = ChangeDetails<'input-change' | 'clear-press' | 'escape-key' | 'reset' | 'imperative'>;
7
+ export type CollectionSubmitDetails = ChangeDetails<'enter-key' | 'imperative'>;
4
8
  export type CollectionSearch = {
5
9
  readonly value: string;
6
- readonly onChange: (value: string) => void;
7
- readonly onSubmit?: () => void;
10
+ readonly onChange: (value: string, details: CollectionSearchDetails) => void;
11
+ readonly onSubmit?: (value: string, details: CollectionSubmitDetails) => void;
8
12
  readonly label?: string;
9
13
  readonly placeholder?: string;
10
14
  };
@@ -1,26 +1,60 @@
1
+ import type { ChangeDetails } from '@ui-sdk/core';
1
2
  import type { PartProps } from '@ui-sdk/react/primitive';
2
- import type { ComponentType } from 'react';
3
+ import type { ComponentType, ReactNode } from 'react';
3
4
  import type { CollectionPaginationProps } from './collection-controls.tsx';
4
5
  export type DataTableSort = {
5
6
  readonly columnId: string;
6
7
  readonly direction: 'ascending' | 'descending';
7
8
  };
9
+ /** Why the sort wants to change: a press on a header, or a call such as an agent's step. */
10
+ export type DataTableSortDetails = ChangeDetails<'trigger-press' | 'imperative'>;
11
+ /** Why the selection wants to change: a press on a row's checkbox or on the one for every row, or a call. */
12
+ export type DataTableSelectionDetails = ChangeDetails<'item-press' | 'imperative'>;
8
13
  export type TableResultStatus = 'ready' | 'pending' | 'failed';
9
- type ResultOptions = {
14
+ export type TableResultOptions = {
10
15
  readonly status: TableResultStatus;
11
- readonly sort: DataTableSort | undefined;
16
+ readonly sort: DataTableSort | null;
17
+ readonly onSortChange: ((sort: DataTableSort | null, details: DataTableSortDetails) => void) | undefined;
18
+ /** The columns the application's query can order by. */
19
+ readonly sortable: ReadonlyArray<{
20
+ readonly id: string;
21
+ readonly label: string;
22
+ }>;
23
+ /** The selected row IDs, or null for a table without selection. */
24
+ readonly selected: ReadonlyArray<string> | null;
25
+ readonly onSelectedChange: ((selected: Array<string>, details: DataTableSelectionDetails) => void) | undefined;
12
26
  readonly pagination: CollectionPaginationProps | undefined;
13
- readonly captionElement: {
14
- readonly current: HTMLTableCaptionElement | null;
15
- };
27
+ /** Every supplied row's ID in the supplied order, including rows a window has not rendered. */
28
+ readonly rowIds: ReadonlyArray<string>;
29
+ /** A row's name from its data, for a row a window has not rendered. */
30
+ readonly rowLabel: (row: number) => string | undefined;
31
+ /** Whether each row has an action a reader can use now. */
32
+ readonly isActionable: boolean;
33
+ /** Brings a row a window has not rendered into view. */
34
+ readonly reveal: (row: number) => void;
35
+ /** Uses a row's action as a press does. */
36
+ readonly onOpen: (row: number) => void;
16
37
  readonly isPlaceholder: boolean;
17
38
  };
18
- export declare const TableResultCaption: ComponentType<Omit<PartProps<'caption'>, 'id'> & ResultOptions>;
19
- type RecordOptions = {
20
- readonly recordId: string;
21
- readonly collection: string;
39
+ /** What a table's own controls call on its results. */
40
+ export type TableResultsApi = {
41
+ readonly focusRow: (row: number) => boolean;
42
+ readonly toggleSort: (columnId: string, event: Event) => boolean;
43
+ readonly toggleRow: (id: string, event: Event | undefined) => void;
44
+ readonly toggleAll: (event: Event | undefined) => void;
22
45
  };
23
- type RecordTrigger<Tag extends 'a' | 'button'> = ComponentType<Omit<PartProps<Tag>, 'id'> & RecordOptions>;
24
- export declare const RecordLink: RecordTrigger<'a'>;
25
- export declare const RecordButton: RecordTrigger<'button'>;
46
+ /** Creates a table's results and renders its `table` element, whose props can call the results. */
47
+ export declare function useTableResults(options: TableResultOptions, table: (api: TableResultsApi) => PartProps<'table'>): {
48
+ readonly api: TableResultsApi;
49
+ readonly element: ReactNode;
50
+ };
51
+ type TriggerPart<Tag extends 'a' | 'button'> = ComponentType<Omit<PartProps<Tag>, 'id' | 'value'> & {
52
+ readonly value: string;
53
+ readonly row: number;
54
+ readonly col: number;
55
+ }>;
56
+ /** A row's link action, keyed by its row's ID. The rows' actions share one Tab stop. */
57
+ export declare const TableRowLink: TriggerPart<'a'>;
58
+ /** A row's button action, keyed by its row's ID. */
59
+ export declare const TableRowButton: TriggerPart<'button'>;
26
60
  export {};
@@ -17,6 +17,7 @@ export type TimelineItemProps = {
17
17
  readonly details: ReactNode;
18
18
  readonly defaultOpen?: boolean;
19
19
  });
20
+ /** An ordered list of dated events on the UI SDK timeline: one Tab stop, and arrow keys move between events. */
20
21
  declare function TimelineRoot({ label, children }: TimelineProps): ReactNode;
21
22
  declare function TimelineItem({ icon, title, time, metadata, children, details, defaultOpen, }: TimelineItemProps): ReactNode;
22
23
  export declare const Timeline: {
@@ -1,4 +1,5 @@
1
1
  import type { KeyboardEvent, ReactNode } from 'react';
2
+ import type { FilterRemoveDetails } from './collection-controls.tsx';
2
3
  import type { CollectionFilter } from './collection-filters.tsx';
3
4
  import type { CollectionSearch } from './query-controls.tsx';
4
5
  export type CollectionControlsProps = {
@@ -9,7 +10,7 @@ export type CollectionControlsProps = {
9
10
  readonly chips?: ReadonlyArray<{
10
11
  readonly id: string;
11
12
  readonly label: string;
12
- readonly onRemove: () => void;
13
+ readonly onRemove: (details: FilterRemoveDetails) => void;
13
14
  }>;
14
15
  readonly viewActions?: ReactNode;
15
16
  readonly display?: ReactNode;
@@ -0,0 +1,25 @@
1
+ import type { VirtualItem } from '@ui-sdk/core';
2
+ import type { RefObject } from 'react';
3
+ type TableWindowOptions = {
4
+ readonly isEnabled: boolean;
5
+ readonly viewport: RefObject<HTMLElement | null>;
6
+ readonly count: number;
7
+ readonly keyOf: (index: number) => string;
8
+ /** A row's height before it is measured. A fixed row keeps it. */
9
+ readonly estimate: number;
10
+ /** The height of the caption and header above the first row. */
11
+ readonly margin: number;
12
+ /** Rows to render wherever the viewport is, such as the one with focus. */
13
+ readonly keep: () => ReadonlyArray<number>;
14
+ readonly onEnd: (() => void) | undefined;
15
+ };
16
+ type MeasureRef = (element: HTMLElement | null) => () => void;
17
+ /** Renders only the rows in view, on the UI SDK virtualizer. Each item's `start` is measured from the first row. */
18
+ export declare function useTableWindow(options: TableWindowOptions): {
19
+ items: readonly VirtualItem[];
20
+ size: number;
21
+ scrollToIndex: (index: number) => void;
22
+ /** A stable ref for a content-sized row, so its height is measured now and whenever it changes. */
23
+ measure(index: number): MeasureRef;
24
+ };
25
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { PartProps } from '@ui-sdk/react/primitive';
2
+ import type { ComponentType } from 'react';
3
+ type ViewerKind = 'code' | 'diff' | 'json' | 'log' | 'stack-trace';
4
+ /** A read-only viewer's frame. An agent finds it by its label and kind; its content stays out of the snapshot. */
5
+ export declare const Viewer: ComponentType<Omit<PartProps<'section'>, 'id'> & {
6
+ readonly kind: ViewerKind;
7
+ }>;
8
+ export {};
@@ -2,7 +2,15 @@ import * as SdkAccordion from '@ui-sdk/react/accordion';
2
2
  import * as SdkCollapsible from '@ui-sdk/react/collapsible';
3
3
  import type { ComponentProps, ReactNode } from 'react';
4
4
  import type { OpenStateProperties, ValueStateProperties } from '../../foundations/src/control-state.ts';
5
- type AccordionRootProps<Value extends string> = Omit<ComponentProps<typeof SdkAccordion.Accordion<Value>>, 'value' | 'defaultValue' | 'onValueChange'> & ValueStateProperties<Array<Value>, NonNullable<ComponentProps<typeof SdkAccordion.Accordion<Value>>['onValueChange']>>;
5
+ /** Names the group of sections, so a reader and an agent can tell one accordion from another. */
6
+ type AccordionName = {
7
+ readonly 'aria-label': string;
8
+ readonly 'aria-labelledby'?: undefined;
9
+ } | {
10
+ readonly 'aria-labelledby': string;
11
+ readonly 'aria-label'?: undefined;
12
+ };
13
+ type AccordionRootProps<Value extends string> = Omit<ComponentProps<typeof SdkAccordion.Accordion<Value>>, 'value' | 'defaultValue' | 'onValueChange' | 'aria-label' | 'aria-labelledby'> & AccordionName & ValueStateProperties<Array<Value>, NonNullable<ComponentProps<typeof SdkAccordion.Accordion<Value>>['onValueChange']>>;
6
14
  type AccordionItemProps = ComponentProps<typeof SdkAccordion.AccordionItem<string>>;
7
15
  type AccordionHeaderProps = ComponentProps<typeof SdkAccordion.AccordionHeader>;
8
16
  type AccordionTriggerProps = Omit<ComponentProps<typeof SdkAccordion.AccordionTrigger>, 'children'> & {
@@ -7,6 +7,7 @@ export { agentAvatarShapes } from './agent-avatar-glyphs.tsx';
7
7
  export type { AgentAppearance, AgentAvatarColor, AgentAvatarProps, AgentAvatarSize } from './agent-avatar.tsx';
8
8
  export { AgentAvatar, agentAppearance, agentAvatarColors } from './agent-avatar.tsx';
9
9
  export { CopyValue } from './copy-value.tsx';
10
+ export { RouteLink } from './route-link.tsx';
10
11
  export { Accordion, Collapsible } from './disclosure.tsx';
11
12
  export { Panel, SurfaceLink, Row, Stack, Columns, Divider } from './surfaces.tsx';
12
13
  export { SectionHeading } from './section-heading.tsx';
@@ -0,0 +1,11 @@
1
+ import type { PartProps } from '@ui-sdk/react/primitive';
2
+ import type { ComponentProps, ComponentType, ReactNode } from 'react';
3
+ type LinkOptions = {
4
+ readonly destination: string | undefined;
5
+ readonly current: ComponentProps<'a'>['aria-current'];
6
+ };
7
+ /** The anchor behind every Elements link. An agent reads its destination and whether it is current, and follows it. */
8
+ export declare const Link: ComponentType<Omit<PartProps<'a'>, 'id'> & LinkOptions>;
9
+ /** A native anchor for an application's routes. Without a destination it stays a plain anchor. */
10
+ export declare function RouteLink(props: ComponentProps<'a'>): ReactNode;
11
+ export {};
@@ -1,11 +1,13 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { CalendarDate } from './calendar.tsx';
3
3
  import type { CalendarMonth } from './civil.ts';
4
- export declare function DateInput({ label, value, minimum, maximum, onValueChange, }: {
4
+ /** A typed date on the UI SDK date input: one segment per unit in the locale's order, stepped with the arrow keys. */
5
+ export declare function DateInput({ label, value, minimum, maximum, locale, onValueChange, }: {
5
6
  readonly label: string;
6
7
  readonly value: CalendarDate | undefined;
7
8
  readonly minimum?: CalendarDate | undefined;
8
9
  readonly maximum?: CalendarDate | undefined;
10
+ readonly locale: string;
9
11
  readonly onValueChange: (value: CalendarDate | undefined) => void;
10
12
  }): ReactNode;
11
13
  export declare function MonthInput({ label, value, minimum, maximum, onValueChange, }: {
@@ -0,0 +1,15 @@
1
+ import { FileInput } from '@ui-sdk/react/file-input';
2
+ import type { ComponentProps, ReactNode } from 'react';
3
+ import type { ControlDensity } from '../../foundations/src/control-density.ts';
4
+ import type { PlacementStyle } from '../../foundations/src/style-composition.ts';
5
+ type SdkFileInputProps = ComponentProps<typeof FileInput>;
6
+ export type FilePickerProps = Omit<SdkFileInputProps, 'children' | 'className' | 'style' | 'render'> & {
7
+ readonly density?: ControlDensity;
8
+ readonly xstyle?: PlacementStyle;
9
+ };
10
+ /**
11
+ * Chooses files on the UI SDK file input: a button opens the picker, and the field also takes dropped and pasted files.
12
+ * It lists the chosen files with a remove action and says why a file was refused. It never uploads or reads.
13
+ */
14
+ export declare function FilePicker({ density, xstyle, multiple, onValueChange, onReject, ...props }: FilePickerProps): ReactNode;
15
+ export {};
@@ -1,4 +1,4 @@
1
- import { FieldControl as SdkFieldControl, FieldLabel as SdkFieldLabel, FieldLegend as SdkFieldLegend, FieldSet as SdkFieldSet } from '@ui-sdk/react/field';
1
+ import { FieldLabel as SdkFieldLabel, FieldLegend as SdkFieldLegend, FieldSet as SdkFieldSet } from '@ui-sdk/react/field';
2
2
  import { InputGroup as SdkInputGroup } from '@ui-sdk/react/input';
3
3
  import { NumberInputControl, NumberInputDecrement, NumberInputGroup, NumberInputIncrement, NumberInput as SdkNumberInput } from '@ui-sdk/react/number-input';
4
4
  import { Slider as SdkSlider, SliderControl as SdkSliderControl, SliderIndicator as SdkSliderIndicator, SliderThumb as SdkSliderThumb, SliderTrack as SdkSliderTrack, SliderValue as SdkSliderValue } from '@ui-sdk/react/slider';
@@ -38,10 +38,6 @@ type SliderIndicatorProps = ComponentProps<typeof SdkSliderIndicator>;
38
38
  type SliderThumbProps = ComponentProps<typeof SdkSliderThumb>;
39
39
  type SliderLabelProps = ComponentProps<typeof SdkFieldLabel>;
40
40
  type SliderValueProps = ComponentProps<typeof SdkSliderValue>;
41
- type FilePickerProps = Omit<ComponentProps<typeof SdkFieldControl>, 'type' | 'value' | 'defaultValue' | 'onValueChange'> & {
42
- readonly density?: ControlDensity;
43
- readonly xstyle?: PlacementStyle;
44
- };
45
41
  declare function FieldsetRoot({ className, style, xstyle, ...props }: FieldsetRootProps): ReactNode;
46
42
  declare function FieldsetLegend({ className, style, ...props }: FieldsetLegendProps): ReactNode;
47
43
  declare function InputGroupRoot({ density, className, style, xstyle, ...props }: InputGroupRootProps): ReactNode;
@@ -59,7 +55,6 @@ declare function SliderIndicator({ className, style, ...props }: SliderIndicator
59
55
  declare function SliderThumb({ className, style, ...props }: SliderThumbProps): ReactNode;
60
56
  declare function SliderLabel({ className, style, ...props }: SliderLabelProps): ReactNode;
61
57
  declare function SliderValue({ className, style, ...props }: SliderValueProps): ReactNode;
62
- export declare function FilePicker({ density, className, style, xstyle, ...props }: FilePickerProps): ReactNode;
63
58
  export declare const Fieldset: {
64
59
  Root: typeof FieldsetRoot;
65
60
  Legend: typeof FieldsetLegend;
@@ -1,4 +1,5 @@
1
1
  import { Field as SdkField, FieldDescription as SdkFieldDescription, FieldError as SdkFieldError, FieldLabel as SdkFieldLabel } from '@ui-sdk/react/field';
2
+ import { Input as SdkInput } from '@ui-sdk/react/input';
2
3
  import type { ComponentProps, ReactNode } from 'react';
3
4
  import type { ControlDensity } from '../../foundations/src/control-density.ts';
4
5
  import type { TextValueProperties } from '../../foundations/src/control-state.ts';
@@ -12,7 +13,9 @@ type FieldRootProps = ComponentProps<typeof SdkField> & {
12
13
  type FieldLabelProps = ComponentProps<typeof SdkFieldLabel>;
13
14
  type FieldDescriptionProps = ComponentProps<typeof SdkFieldDescription>;
14
15
  type FieldErrorProps = ComponentProps<typeof SdkFieldError>;
15
- type TextControlProps<Tag extends 'input' | 'textarea'> = Omit<ComponentProps<Tag>, 'value' | 'defaultValue' | 'onChange' | 'readOnly' | 'size' | 'onSelect' | 'onSubmit'> & TextValueProperties<string | number, NonNullable<ComponentProps<Tag>['onChange']>, (value: string) => void> & {
16
+ /** The new text, then the SDK's change details: the reason, the event and who caused it. */
17
+ type TextValueChange = NonNullable<ComponentProps<typeof SdkInput>['onValueChange']>;
18
+ type TextControlProps<Tag extends 'input' | 'textarea'> = Omit<ComponentProps<Tag>, 'value' | 'defaultValue' | 'onChange' | 'readOnly' | 'size' | 'onSelect' | 'onSubmit'> & TextValueProperties<string | number, NonNullable<ComponentProps<Tag>['onChange']>, TextValueChange> & {
16
19
  /** Keep credentials and other private text out of the UI SDK runtime. Password inputs always use this mode. */
17
20
  readonly isSensitive?: boolean;
18
21
  readonly xstyle?: PlacementStyle;
@@ -1,7 +1,9 @@
1
1
  export { Combobox } from './combobox.tsx';
2
2
  export type { AgentAvatarPickerProps } from './agent-avatar-picker.tsx';
3
3
  export { AgentAvatarPicker } from './agent-avatar-picker.tsx';
4
- export { FilePicker, Fieldset, InputGroup, NumberField, Slider } from './form-controls.tsx';
4
+ export { Fieldset, InputGroup, NumberField, Slider } from './form-controls.tsx';
5
+ export type { FilePickerProps } from './file-picker.tsx';
6
+ export { FilePicker } from './file-picker.tsx';
5
7
  export type { FormActionsProps } from './form-actions.tsx';
6
8
  export { FormActions } from './form-actions.tsx';
7
9
  export { FormStatus } from './form-status.tsx';
@@ -10,7 +12,7 @@ export { Field, Input, Textarea } from './forms.tsx';
10
12
  export { Select } from './select.tsx';
11
13
  export type { SelectControlProps, SelectOption } from './select-control.tsx';
12
14
  export { SelectControl } from './select-control.tsx';
13
- export { Checkbox, RadioGroup, Switch, ToggleGroup } from './selection.tsx';
15
+ export { Checkbox, RadioGroup, SegmentedControl, Switch, ToggleGroup } from './selection.tsx';
14
16
  export type { SettingsRowProps } from './settings-row.tsx';
15
17
  export { SettingsRow } from './settings-row.tsx';
16
18
  export type { SettingsSectionProps } from './settings-section.tsx';
@@ -1,5 +1,6 @@
1
1
  import { Checkbox as SdkCheckbox, CheckboxIndicator as SdkCheckboxIndicator } from '@ui-sdk/react/checkbox';
2
2
  import { Radio as SdkRadio, RadioGroup as SdkRadioGroup, RadioIndicator as SdkRadioIndicator } from '@ui-sdk/react/radio';
3
+ import { SegmentedControl as SdkSegmentedControl, SegmentedControlItem as SdkSegmentedControlItem } from '@ui-sdk/react/segmented-control';
3
4
  import { Switch as SdkSwitch, SwitchThumb as SdkSwitchThumb } from '@ui-sdk/react/switch';
4
5
  import { Toggle as SdkToggle, ToggleGroup as SdkToggleGroup } from '@ui-sdk/react/toggle';
5
6
  import type { ComponentProps, ReactNode } from 'react';
@@ -30,6 +31,12 @@ type ToggleGroupRootProps<Value extends string> = Omit<ComponentProps<typeof Sdk
30
31
  type ToggleItemProps<Value extends string> = Omit<ComponentProps<typeof SdkToggle>, 'value' | 'pressed' | 'defaultPressed' | 'onPressedChange'> & {
31
32
  readonly value: Value;
32
33
  };
34
+ type SegmentChange<Value extends string> = NonNullable<ComponentProps<typeof SdkSegmentedControl<Value>>['onValueChange']>;
35
+ type SegmentedControlRootProps<Value extends string> = Omit<ComponentProps<typeof SdkSegmentedControl<Value>>, 'value' | 'defaultValue' | 'onValueChange' | 'children'> & ValueStateProperties<Value, (value: Value, details: Parameters<SegmentChange<Value>>[1]) => void> & {
36
+ readonly children?: ReactNode;
37
+ readonly xstyle?: PlacementStyle;
38
+ };
39
+ type SegmentedControlItemProps = ComponentProps<typeof SdkSegmentedControlItem>;
33
40
  declare function CheckboxRoot({ className, style, xstyle, indeterminate, checked, defaultChecked, onCheckedChange, ...props }: CheckboxRootProps): ReactNode;
34
41
  declare function CheckboxIndicator({ children, className, style, ...props }: CheckboxIndicatorProps): ReactNode;
35
42
  declare function RadioGroupRoot<Value extends string>({ className, style, xstyle, onValueChange, ...props }: RadioGroupRootProps<Value>): ReactNode;
@@ -39,6 +46,9 @@ declare function SwitchRoot({ className, style, xstyle, ...props }: SwitchRootPr
39
46
  declare function SwitchThumb({ className, style, ...props }: SwitchThumbProps): ReactNode;
40
47
  declare function ToggleGroupRoot<Value extends string>({ className, style, xstyle, value, defaultValue, ...props }: ToggleGroupRootProps<Value>): ReactNode;
41
48
  declare function ToggleItem<Value extends string>({ className, style, ...props }: ToggleItemProps<Value>): ReactNode;
49
+ /** One choice from a short row, on the UI SDK segmented control: a radio group drawn as buttons, with one Tab stop. */
50
+ declare function SegmentedControlRoot<Value extends string>({ className, style, xstyle, children, onValueChange, ...props }: SegmentedControlRootProps<Value>): ReactNode;
51
+ declare function SegmentedControlItem({ className, style, ...props }: SegmentedControlItemProps): ReactNode;
42
52
  export declare const Checkbox: {
43
53
  Root: typeof CheckboxRoot;
44
54
  Indicator: typeof CheckboxIndicator;
@@ -56,4 +66,8 @@ export declare const ToggleGroup: {
56
66
  Root: typeof ToggleGroupRoot;
57
67
  Item: typeof ToggleItem;
58
68
  };
69
+ export declare const SegmentedControl: {
70
+ Root: typeof SegmentedControlRoot;
71
+ Item: typeof SegmentedControlItem;
72
+ };
59
73
  export {};
@@ -1,2 +1,2 @@
1
1
  export { CSPProvider } from './provider.tsx';
2
- export type { CSPProviderProps } from '@base-ui/react/csp-provider';
2
+ export type { CSPProviderProps } from './provider.tsx';
@@ -1,3 +1,8 @@
1
- import type { CSPProviderProps } from '@base-ui/react/csp-provider';
2
1
  import type { ReactNode } from 'react';
3
- export declare function CSPProvider({ children, nonce, ...props }: CSPProviderProps): ReactNode;
2
+ export type CSPProviderProps = {
3
+ /** The request nonce in the application's Content Security Policy. */
4
+ readonly nonce?: string | undefined;
5
+ readonly children?: ReactNode;
6
+ };
7
+ /** Gives UI SDK the policy's nonce through the `csp-nonce` meta tag, which it reads before adding its styles. */
8
+ export declare function CSPProvider({ children, nonce }: CSPProviderProps): ReactNode;
@@ -0,0 +1,31 @@
1
+ import type { ChartTone, ValueFormat } from '../../../charts/src/index.ts';
2
+ /** A model as every evaluation component names it. One id per model keeps its hue and linked highlight everywhere. */
3
+ export type EvaluationModel = {
4
+ readonly id: string;
5
+ /** The name a reader sees: "Atlas 13B". */
6
+ readonly label: string;
7
+ /** One short line under the name, such as the checkpoint or the release date. */
8
+ readonly detail?: string | undefined;
9
+ /** Pins the model's hue. Absent takes the next series hue in the order the models are listed. */
10
+ readonly tone?: ChartTone | undefined;
11
+ };
12
+ /** An estimate with the bounds the application computed around it, such as a 95% confidence interval. */
13
+ export type ScoreInterval = {
14
+ readonly value: number;
15
+ readonly low: number;
16
+ readonly high: number;
17
+ };
18
+ /** One measured score: a number, an estimate with its interval, or null where it was not measured. */
19
+ export type ScoreValue = number | ScoreInterval | null;
20
+ /** True for an estimate that carries its interval. */
21
+ export declare function isScoreInterval(value: ScoreValue | ReadonlyArray<number | null>): value is ScoreInterval;
22
+ /** The first id that appears twice, or undefined when every id is unique. */
23
+ export declare function repeatedId(ids: ReadonlyArray<string>): string | undefined;
24
+ /** A value format that always writes its sign, so a gain and a loss never read alike. */
25
+ export declare function signedFormat(format: ValueFormat): ValueFormat;
26
+ /**
27
+ * Points the enclosing chart link at the table row a mouse or the keyboard rests on, so the linked figures mark the
28
+ * same record. Leaving the table clears the link only while it still holds one of this table's rows. Outside a link it
29
+ * does nothing.
30
+ */
31
+ export declare function useLinkedRows(ids: ReadonlyArray<string>): (id: string | undefined) => void;
@@ -0,0 +1,8 @@
1
+ export type { EvaluationModel, ScoreInterval, ScoreValue } from './evaluation-data.ts';
2
+ export type { LeaderboardColumn, LeaderboardColumnKind, LeaderboardValue } from './leaderboard-cells.tsx';
3
+ export type { LeaderboardLabels, LeaderboardProps, LeaderboardRow } from './leaderboard.tsx';
4
+ export { Leaderboard, leaderboardLimits } from './leaderboard.tsx';
5
+ export type { ComparisonRow, ModelComparisonLabels, ModelComparisonProps } from './model-comparison.tsx';
6
+ export { ModelComparison } from './model-comparison.tsx';
7
+ export type { ModelScores, ScoreBreakdownProps } from './score-breakdown.tsx';
8
+ export { ScoreBreakdown } from './score-breakdown.tsx';
@@ -0,0 +1,62 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ValueFormat } from '../../../charts/src/index.ts';
3
+ import type { ScoreInterval } from './evaluation-data.ts';
4
+ /** How a leaderboard column draws its measure. */
5
+ export type LeaderboardColumnKind = 'score' | 'interval' | 'change' | 'trend' | 'heat';
6
+ type ColumnBase = {
7
+ readonly id: string;
8
+ /** The measure with its unit, as the header shows it: "Reasoning accuracy". */
9
+ readonly label: string;
10
+ /** How every value in the column is written. */
11
+ readonly format: ValueFormat;
12
+ /** Whether a larger value is better. It sets which value is marked best and what a rise means in a change column. */
13
+ readonly isHigherBetter: boolean;
14
+ /** The column's width in pixels. Each kind has a default that fits its graphic and text. */
15
+ readonly width?: number | undefined;
16
+ /** True to hide the column on a narrow screen. */
17
+ readonly isSecondary?: boolean | undefined;
18
+ };
19
+ /**
20
+ * One measure of the leaderboard: `score` is a bar from zero, `interval` an estimate with its interval, and `trend` a
21
+ * small line of recent values ranked by the last. The `heat` kind is a shaded number and the `change` kind a signed
22
+ * change with an arrow. Every kind but `change` draws on the column's `domain`, the same for every row.
23
+ */
24
+ export type LeaderboardColumn = (ColumnBase & {
25
+ readonly kind: 'score' | 'interval' | 'trend';
26
+ readonly domain: readonly [number, number];
27
+ }) | (ColumnBase & {
28
+ readonly kind: 'heat';
29
+ readonly domain: readonly [number, number];
30
+ /** `sequential` deepens one hue with the value; `diverging` uses two hues around zero. Defaults to sequential. */
31
+ readonly palette?: 'sequential' | 'diverging' | undefined;
32
+ }) | (ColumnBase & {
33
+ readonly kind: 'change';
34
+ });
35
+ /**
36
+ * A model's value in one column. It is a number for `score`, `heat` and `change`, an estimate with its interval for
37
+ * `interval`, the recent values in order for `trend`, or null where it was not measured.
38
+ */
39
+ export type LeaderboardValue = number | ScoreInterval | ReadonlyArray<number | null> | null;
40
+ export declare const columnWidths: {
41
+ readonly score: 160;
42
+ readonly interval: 300;
43
+ readonly change: 128;
44
+ readonly trend: 160;
45
+ readonly heat: 112;
46
+ };
47
+ /** The sentence that says why a value does not fit its column, or undefined when it does. */
48
+ export declare function valueKindProblem(column: LeaderboardColumn, value: LeaderboardValue): string | undefined;
49
+ /** The number a row is ranked by in a column: the value, the estimate, or the last recorded trend value. */
50
+ export declare function rankedValue(value: LeaderboardValue): number | null;
51
+ export type MeasureCellProps = {
52
+ readonly column: LeaderboardColumn;
53
+ readonly value: LeaderboardValue;
54
+ readonly model: string;
55
+ readonly locale: string;
56
+ readonly isBest: boolean;
57
+ /** The words a screen reader hears after the best value. */
58
+ readonly bestLabel: string;
59
+ };
60
+ /** One measure of one model, drawn by its column's kind. The best value of the column is set in bold and named. */
61
+ export declare function MeasureCell({ isBest, bestLabel, ...cell }: MeasureCellProps): ReactNode;
62
+ export {};
@@ -0,0 +1,59 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { FigureProps } from '../../../charts/src/index.ts';
3
+ import type { DataTableSelectionDetails, DataTableSort, DataTableSortDetails } from '../../../collections/src/index.ts';
4
+ import type { EvaluationModel } from './evaluation-data.ts';
5
+ import type { LeaderboardColumn, LeaderboardValue } from './leaderboard-cells.tsx';
6
+ /** One model's results: its values by column id. A column left out reads as not measured. */
7
+ export type LeaderboardRow = {
8
+ /** The id of a model in `models`. */
9
+ readonly model: string;
10
+ /** The model's place as the application ranked it. Ties may share a rank. */
11
+ readonly rank?: number | undefined;
12
+ readonly values: Readonly<Record<string, LeaderboardValue>>;
13
+ };
14
+ /** The words the leaderboard shows that are not data. */
15
+ export type LeaderboardLabels = {
16
+ readonly model: string;
17
+ readonly rank: string;
18
+ /** Heard by a screen reader after the best value of a column. */
19
+ readonly best: string;
20
+ readonly bestNote: string;
21
+ readonly higherIsBetter: string;
22
+ readonly lowerIsBetter: string;
23
+ /** Starts the name of a row's checkbox: "Select Atlas 13B". */
24
+ readonly select: string;
25
+ };
26
+ export type LeaderboardProps = FigureProps & {
27
+ /**
28
+ * Every model the page shows, in the order their hues are assigned. The table keeps one tone scope over them, so a
29
+ * figure under a `ToneScope` with the same ids shows each model in the same hue.
30
+ */
31
+ readonly models: ReadonlyArray<EvaluationModel>;
32
+ readonly columns: ReadonlyArray<LeaderboardColumn>;
33
+ /** One row per model with results, in the application's order. */
34
+ readonly rows: ReadonlyArray<LeaderboardRow>;
35
+ /**
36
+ * The column the rows are ordered by. Absent keeps the order given, which is the rank order. Missing values sort
37
+ * last.
38
+ */
39
+ readonly sort?: DataTableSort | undefined;
40
+ /** Hears a press on a sortable header. Without it the headers do not sort. */
41
+ readonly onSortChange?: ((sort: DataTableSort | undefined, details: DataTableSortDetails) => void) | undefined;
42
+ /** The ids of the checked models. */
43
+ readonly selected?: ReadonlyArray<string> | undefined;
44
+ /** Hears a press on a row's checkbox. Without it the rows have no checkboxes. */
45
+ readonly onSelectedChange?: ((selected: ReadonlyArray<string>, details: DataTableSelectionDetails) => void) | undefined;
46
+ readonly labels?: Partial<LeaderboardLabels> | undefined;
47
+ };
48
+ /** The most models and measure columns a leaderboard shows. Larger input is refused. */
49
+ export declare const leaderboardLimits: {
50
+ readonly models: 100;
51
+ readonly columns: 10;
52
+ };
53
+ /**
54
+ * A ranked table of models over benchmarks, as an evaluation paper or dashboard shows it, where the application owns
55
+ * the order, the sort and the checked models. Each measure column draws its values with a table cell graphic on one
56
+ * shared scale and writes the exact value beside it. The best value of each column is set in bold and named for screen
57
+ * readers, and inside a `ChartLink`, resting on a row marks it in the linked figures.
58
+ */
59
+ export declare function Leaderboard(props: LeaderboardProps): ReactNode;
@@ -0,0 +1,59 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { FigureProps, FigureSelectionProps, PlotAxis, PlotHeight, ValueFormat } from '../../../charts/src/index.ts';
3
+ import type { EvaluationModel } from './evaluation-data.ts';
4
+ /** One benchmark in a head-to-head comparison. */
5
+ export type ComparisonRow = {
6
+ readonly id: string;
7
+ readonly label: string;
8
+ /** Model A's score, or null where it was not measured. */
9
+ readonly a: number | null;
10
+ /** Model B's score, or null where it was not measured. */
11
+ readonly b: number | null;
12
+ /** B minus A, as the application estimated it, such as a paired mean. Null where it could not be computed. */
13
+ readonly difference: number | null;
14
+ /** The bounds the application computed around the difference, such as a 95% interval. */
15
+ readonly interval?: {
16
+ readonly low: number;
17
+ readonly high: number;
18
+ } | undefined;
19
+ /** The application's test of the difference. Absent reads as "not tested". */
20
+ readonly isSignificant?: boolean | undefined;
21
+ /** A short remark in words: "Fewer than 200 items" or "B was tuned on a related set". */
22
+ readonly note?: string | undefined;
23
+ };
24
+ /** The words the comparison shows that are not data. */
25
+ export type ModelComparisonLabels = {
26
+ /** Starts the table's caption: "Differences, Cirrus 34B minus Atlas 70B". */
27
+ readonly caption: string;
28
+ readonly benchmark: string;
29
+ readonly difference: string;
30
+ readonly interval: string;
31
+ readonly reading: string;
32
+ /** Follows the leading model's name in a significant row: "Atlas 13B ahead". */
33
+ readonly ahead: string;
34
+ readonly unclear: string;
35
+ readonly untested: string;
36
+ readonly noInterval: string;
37
+ };
38
+ export type ModelComparisonProps = FigureProps & FigureSelectionProps & {
39
+ /** The reference model, drawn first. */
40
+ readonly a: EvaluationModel;
41
+ /** The model compared with it. Differences are B minus A. */
42
+ readonly b: EvaluationModel;
43
+ readonly rows: ReadonlyArray<ComparisonRow>;
44
+ /** The measured axis of both scores. */
45
+ readonly value: PlotAxis;
46
+ /** Whether a larger score is better. It sets which model a difference favors and the hue of the change. */
47
+ readonly isHigherBetter: boolean;
48
+ /** How the differences are written. Defaults to the axis format with a sign. */
49
+ readonly differenceFormat?: ValueFormat | undefined;
50
+ readonly height?: PlotHeight | undefined;
51
+ readonly labels?: Partial<ModelComparisonLabels> | undefined;
52
+ };
53
+ /**
54
+ * Two models head to head across benchmarks: a dumbbell of A against B per benchmark, then a table of differences, each
55
+ * with its interval and a test in words. Model A is the reference, every difference is B minus A, and each model keeps
56
+ * its hue from an enclosing tone scope. Resting on a table row marks the benchmark in the plot and the other way round,
57
+ * and the application supplies every score, difference and test.
58
+ */
59
+ export declare function ModelComparison(props: ModelComparisonProps): ReactNode;
@@ -0,0 +1,33 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { FigureProps, FigureSelectionProps, PlotAxis, PlotHeight } from '../../../charts/src/index.ts';
3
+ import type { EvaluationModel, ScoreValue } from './evaluation-data.ts';
4
+ /** One model's scores on the benchmark's categories, by category id. A category left out reads as not measured. */
5
+ export type ModelScores = {
6
+ /** The id of a model in `models`. */
7
+ readonly model: string;
8
+ readonly values: Readonly<Record<string, ScoreValue>>;
9
+ };
10
+ export type ScoreBreakdownProps = FigureProps & FigureSelectionProps & {
11
+ /**
12
+ * Every model the page names, for their labels and pinned hues. Only models with scores are drawn. Under a
13
+ * `ToneScope` each model keeps the hue it has elsewhere on the page.
14
+ */
15
+ readonly models: ReadonlyArray<EvaluationModel>;
16
+ /** The categories or tasks of the benchmark, listed down the side in the order given. */
17
+ readonly categories: ReadonlyArray<{
18
+ readonly id: string;
19
+ readonly label: string;
20
+ }>;
21
+ /** The models drawn, in legend order. */
22
+ readonly scores: ReadonlyArray<ModelScores>;
23
+ /** The measured axis. Position carries the score, so it need not start at zero. */
24
+ readonly value: PlotAxis;
25
+ readonly height?: PlotHeight | undefined;
26
+ };
27
+ /**
28
+ * One benchmark broken down by category, with a dot per model on each row and an optional interval behind it, for
29
+ * showing under a leaderboard where models differ. Inside a `ChartLink`, pointing the link at a model, such as by
30
+ * resting on its leaderboard row, keeps that model at full strength and fades the others. The one model then reads
31
+ * across every category.
32
+ */
33
+ export declare function ScoreBreakdown(props: ScoreBreakdownProps): ReactNode;