@contraagent/elements 0.0.0-stage → 0.1.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 (609) hide show
  1. package/README.md +72 -2
  2. package/custom-elements.json +4260 -0
  3. package/dist/charts/bar-chart.d.ts +32 -0
  4. package/dist/charts/bar-chart.d.ts.map +1 -0
  5. package/dist/charts/bar-chart.js +70 -0
  6. package/dist/charts/bar-chart.js.map +1 -0
  7. package/dist/charts/base.d.ts +48 -0
  8. package/dist/charts/base.d.ts.map +1 -0
  9. package/dist/charts/base.js +203 -0
  10. package/dist/charts/base.js.map +1 -0
  11. package/dist/charts/column-chart.d.ts +42 -0
  12. package/dist/charts/column-chart.d.ts.map +1 -0
  13. package/dist/charts/column-chart.js +146 -0
  14. package/dist/charts/column-chart.js.map +1 -0
  15. package/dist/charts/heatmap.d.ts +42 -0
  16. package/dist/charts/heatmap.d.ts.map +1 -0
  17. package/dist/charts/heatmap.js +124 -0
  18. package/dist/charts/heatmap.js.map +1 -0
  19. package/dist/charts/index.d.ts +9 -0
  20. package/dist/charts/index.d.ts.map +1 -0
  21. package/dist/charts/index.js +11 -0
  22. package/dist/charts/index.js.map +1 -0
  23. package/dist/charts/line-chart.d.ts +36 -0
  24. package/dist/charts/line-chart.d.ts.map +1 -0
  25. package/dist/charts/line-chart.js +118 -0
  26. package/dist/charts/line-chart.js.map +1 -0
  27. package/dist/charts/scale.d.ts +32 -0
  28. package/dist/charts/scale.d.ts.map +1 -0
  29. package/dist/charts/scale.js +50 -0
  30. package/dist/charts/scale.js.map +1 -0
  31. package/dist/charts/state-grid.d.ts +64 -0
  32. package/dist/charts/state-grid.d.ts.map +1 -0
  33. package/dist/charts/state-grid.js +223 -0
  34. package/dist/charts/state-grid.js.map +1 -0
  35. package/dist/charts/types.d.ts +34 -0
  36. package/dist/charts/types.d.ts.map +1 -0
  37. package/dist/charts/types.js +11 -0
  38. package/dist/charts/types.js.map +1 -0
  39. package/dist/checks/check-table.d.ts +32 -0
  40. package/dist/checks/check-table.d.ts.map +1 -0
  41. package/dist/checks/check-table.js +94 -0
  42. package/dist/checks/check-table.js.map +1 -0
  43. package/dist/checks/index.d.ts +4 -0
  44. package/dist/checks/index.d.ts.map +1 -0
  45. package/dist/checks/index.js +6 -0
  46. package/dist/checks/index.js.map +1 -0
  47. package/dist/checks/styles.d.ts +5 -0
  48. package/dist/checks/styles.d.ts.map +1 -0
  49. package/dist/checks/styles.js +30 -0
  50. package/dist/checks/styles.js.map +1 -0
  51. package/dist/checks/types.d.ts +35 -0
  52. package/dist/checks/types.d.ts.map +1 -0
  53. package/dist/checks/types.js +12 -0
  54. package/dist/checks/types.js.map +1 -0
  55. package/dist/core/clock.d.ts +20 -0
  56. package/dist/core/clock.d.ts.map +1 -0
  57. package/dist/core/clock.js +45 -0
  58. package/dist/core/clock.js.map +1 -0
  59. package/dist/core/define.d.ts +3 -0
  60. package/dist/core/define.d.ts.map +1 -0
  61. package/dist/core/define.js +8 -0
  62. package/dist/core/define.js.map +1 -0
  63. package/dist/core/events.d.ts +78 -0
  64. package/dist/core/events.d.ts.map +1 -0
  65. package/dist/core/events.js +8 -0
  66. package/dist/core/events.js.map +1 -0
  67. package/dist/core/format.d.ts +8 -0
  68. package/dist/core/format.d.ts.map +1 -0
  69. package/dist/core/format.js +28 -0
  70. package/dist/core/format.js.map +1 -0
  71. package/dist/core/frame.d.ts +4 -0
  72. package/dist/core/frame.d.ts.map +1 -0
  73. package/dist/core/frame.js +5 -0
  74. package/dist/core/frame.js.map +1 -0
  75. package/dist/core/strings.d.ts +3 -0
  76. package/dist/core/strings.d.ts.map +1 -0
  77. package/dist/core/strings.js +14 -0
  78. package/dist/core/strings.js.map +1 -0
  79. package/dist/core/tone.d.ts +8 -0
  80. package/dist/core/tone.d.ts.map +1 -0
  81. package/dist/core/tone.js +9 -0
  82. package/dist/core/tone.js.map +1 -0
  83. package/dist/count/count.d.ts +22 -0
  84. package/dist/count/count.d.ts.map +1 -0
  85. package/dist/count/count.js +60 -0
  86. package/dist/count/count.js.map +1 -0
  87. package/dist/count/elapsed.d.ts +18 -0
  88. package/dist/count/elapsed.d.ts.map +1 -0
  89. package/dist/count/elapsed.js +33 -0
  90. package/dist/count/elapsed.js.map +1 -0
  91. package/dist/count/index.d.ts +3 -0
  92. package/dist/count/index.d.ts.map +1 -0
  93. package/dist/count/index.js +5 -0
  94. package/dist/count/index.js.map +1 -0
  95. package/dist/define/all.d.ts +13 -0
  96. package/dist/define/all.d.ts.map +1 -0
  97. package/dist/define/all.js +14 -0
  98. package/dist/define/all.js.map +1 -0
  99. package/dist/define/charts.d.ts +8 -0
  100. package/dist/define/charts.d.ts.map +1 -0
  101. package/dist/define/charts.js +15 -0
  102. package/dist/define/charts.js.map +1 -0
  103. package/dist/define/check-table.d.ts +4 -0
  104. package/dist/define/check-table.d.ts.map +1 -0
  105. package/dist/define/check-table.js +7 -0
  106. package/dist/define/check-table.js.map +1 -0
  107. package/dist/define/count.d.ts +5 -0
  108. package/dist/define/count.d.ts.map +1 -0
  109. package/dist/define/count.js +9 -0
  110. package/dist/define/count.js.map +1 -0
  111. package/dist/define/data-table.d.ts +4 -0
  112. package/dist/define/data-table.d.ts.map +1 -0
  113. package/dist/define/data-table.js +7 -0
  114. package/dist/define/data-table.js.map +1 -0
  115. package/dist/define/graph.d.ts +6 -0
  116. package/dist/define/graph.d.ts.map +1 -0
  117. package/dist/define/graph.js +9 -0
  118. package/dist/define/graph.js.map +1 -0
  119. package/dist/define/json-tree.d.ts +4 -0
  120. package/dist/define/json-tree.d.ts.map +1 -0
  121. package/dist/define/json-tree.js +7 -0
  122. package/dist/define/json-tree.js.map +1 -0
  123. package/dist/define/lanes.d.ts +4 -0
  124. package/dist/define/lanes.d.ts.map +1 -0
  125. package/dist/define/lanes.js +7 -0
  126. package/dist/define/lanes.js.map +1 -0
  127. package/dist/define/markdown.d.ts +4 -0
  128. package/dist/define/markdown.d.ts.map +1 -0
  129. package/dist/define/markdown.js +7 -0
  130. package/dist/define/markdown.js.map +1 -0
  131. package/dist/define/matrix.d.ts +4 -0
  132. package/dist/define/matrix.d.ts.map +1 -0
  133. package/dist/define/matrix.js +7 -0
  134. package/dist/define/matrix.js.map +1 -0
  135. package/dist/define/segmented.d.ts +4 -0
  136. package/dist/define/segmented.d.ts.map +1 -0
  137. package/dist/define/segmented.js +7 -0
  138. package/dist/define/segmented.js.map +1 -0
  139. package/dist/define/tiles.d.ts +5 -0
  140. package/dist/define/tiles.d.ts.map +1 -0
  141. package/dist/define/tiles.js +9 -0
  142. package/dist/define/tiles.js.map +1 -0
  143. package/dist/define/transcript.d.ts +4 -0
  144. package/dist/define/transcript.d.ts.map +1 -0
  145. package/dist/define/transcript.js +7 -0
  146. package/dist/define/transcript.js.map +1 -0
  147. package/dist/graph/arrange.d.ts +43 -0
  148. package/dist/graph/arrange.d.ts.map +1 -0
  149. package/dist/graph/arrange.js +390 -0
  150. package/dist/graph/arrange.js.map +1 -0
  151. package/dist/graph/card.d.ts +71 -0
  152. package/dist/graph/card.d.ts.map +1 -0
  153. package/dist/graph/card.js +185 -0
  154. package/dist/graph/card.js.map +1 -0
  155. package/dist/graph/host.d.ts +82 -0
  156. package/dist/graph/host.d.ts.map +1 -0
  157. package/dist/graph/host.js +21 -0
  158. package/dist/graph/host.js.map +1 -0
  159. package/dist/graph/icons.d.ts +7 -0
  160. package/dist/graph/icons.d.ts.map +1 -0
  161. package/dist/graph/icons.js +18 -0
  162. package/dist/graph/icons.js.map +1 -0
  163. package/dist/graph/index.d.ts +15 -0
  164. package/dist/graph/index.d.ts.map +1 -0
  165. package/dist/graph/index.js +17 -0
  166. package/dist/graph/index.js.map +1 -0
  167. package/dist/graph/layered-graph.d.ts +226 -0
  168. package/dist/graph/layered-graph.d.ts.map +1 -0
  169. package/dist/graph/layered-graph.js +396 -0
  170. package/dist/graph/layered-graph.js.map +1 -0
  171. package/dist/graph/layout.d.ts +80 -0
  172. package/dist/graph/layout.d.ts.map +1 -0
  173. package/dist/graph/layout.js +264 -0
  174. package/dist/graph/layout.js.map +1 -0
  175. package/dist/graph/marks.d.ts +24 -0
  176. package/dist/graph/marks.d.ts.map +1 -0
  177. package/dist/graph/marks.js +38 -0
  178. package/dist/graph/marks.js.map +1 -0
  179. package/dist/graph/nav.d.ts +14 -0
  180. package/dist/graph/nav.d.ts.map +1 -0
  181. package/dist/graph/nav.js +14 -0
  182. package/dist/graph/nav.js.map +1 -0
  183. package/dist/graph/pan-zoom.d.ts +80 -0
  184. package/dist/graph/pan-zoom.d.ts.map +1 -0
  185. package/dist/graph/pan-zoom.js +191 -0
  186. package/dist/graph/pan-zoom.js.map +1 -0
  187. package/dist/graph/paths.d.ts +9 -0
  188. package/dist/graph/paths.d.ts.map +1 -0
  189. package/dist/graph/paths.js +44 -0
  190. package/dist/graph/paths.js.map +1 -0
  191. package/dist/graph/place-card.d.ts +36 -0
  192. package/dist/graph/place-card.d.ts.map +1 -0
  193. package/dist/graph/place-card.js +68 -0
  194. package/dist/graph/place-card.js.map +1 -0
  195. package/dist/graph/strings.d.ts +50 -0
  196. package/dist/graph/strings.d.ts.map +1 -0
  197. package/dist/graph/strings.js +37 -0
  198. package/dist/graph/strings.js.map +1 -0
  199. package/dist/graph/styles.d.ts +2 -0
  200. package/dist/graph/styles.d.ts.map +1 -0
  201. package/dist/graph/styles.js +203 -0
  202. package/dist/graph/styles.js.map +1 -0
  203. package/dist/graph/types.d.ts +184 -0
  204. package/dist/graph/types.d.ts.map +1 -0
  205. package/dist/graph/types.js +2 -0
  206. package/dist/graph/types.js.map +1 -0
  207. package/dist/graph/view.d.ts +17 -0
  208. package/dist/graph/view.d.ts.map +1 -0
  209. package/dist/graph/view.js +21 -0
  210. package/dist/graph/view.js.map +1 -0
  211. package/dist/graph/views/dag.d.ts +10 -0
  212. package/dist/graph/views/dag.d.ts.map +1 -0
  213. package/dist/graph/views/dag.js +292 -0
  214. package/dist/graph/views/dag.js.map +1 -0
  215. package/dist/graph/views/foot.d.ts +8 -0
  216. package/dist/graph/views/foot.d.ts.map +1 -0
  217. package/dist/graph/views/foot.js +103 -0
  218. package/dist/graph/views/foot.js.map +1 -0
  219. package/dist/graph/views/node-table.d.ts +17 -0
  220. package/dist/graph/views/node-table.d.ts.map +1 -0
  221. package/dist/graph/views/node-table.js +80 -0
  222. package/dist/graph/views/node-table.js.map +1 -0
  223. package/dist/index.d.ts +22 -0
  224. package/dist/index.d.ts.map +1 -0
  225. package/dist/index.js +26 -0
  226. package/dist/index.js.map +1 -0
  227. package/dist/json/index.d.ts +2 -0
  228. package/dist/json/index.d.ts.map +1 -0
  229. package/dist/json/index.js +3 -0
  230. package/dist/json/index.js.map +1 -0
  231. package/dist/json/json-tree.d.ts +21 -0
  232. package/dist/json/json-tree.d.ts.map +1 -0
  233. package/dist/json/json-tree.js +51 -0
  234. package/dist/json/json-tree.js.map +1 -0
  235. package/dist/lanes/index.d.ts +5 -0
  236. package/dist/lanes/index.d.ts.map +1 -0
  237. package/dist/lanes/index.js +7 -0
  238. package/dist/lanes/index.js.map +1 -0
  239. package/dist/lanes/lanes.d.ts +56 -0
  240. package/dist/lanes/lanes.d.ts.map +1 -0
  241. package/dist/lanes/lanes.js +160 -0
  242. package/dist/lanes/lanes.js.map +1 -0
  243. package/dist/lanes/stack.d.ts +26 -0
  244. package/dist/lanes/stack.d.ts.map +1 -0
  245. package/dist/lanes/stack.js +43 -0
  246. package/dist/lanes/stack.js.map +1 -0
  247. package/dist/lanes/styles.d.ts +2 -0
  248. package/dist/lanes/styles.d.ts.map +1 -0
  249. package/dist/lanes/styles.js +30 -0
  250. package/dist/lanes/styles.js.map +1 -0
  251. package/dist/lanes/types.d.ts +41 -0
  252. package/dist/lanes/types.d.ts.map +1 -0
  253. package/dist/lanes/types.js +6 -0
  254. package/dist/lanes/types.js.map +1 -0
  255. package/dist/markdown/cae-markdown.d.ts +37 -0
  256. package/dist/markdown/cae-markdown.d.ts.map +1 -0
  257. package/dist/markdown/cae-markdown.js +68 -0
  258. package/dist/markdown/cae-markdown.js.map +1 -0
  259. package/dist/markdown/highlight.d.ts +5 -0
  260. package/dist/markdown/highlight.d.ts.map +1 -0
  261. package/dist/markdown/highlight.js +86 -0
  262. package/dist/markdown/highlight.js.map +1 -0
  263. package/dist/markdown/index.d.ts +4 -0
  264. package/dist/markdown/index.d.ts.map +1 -0
  265. package/dist/markdown/index.js +6 -0
  266. package/dist/markdown/index.js.map +1 -0
  267. package/dist/markdown/markdown.d.ts +4 -0
  268. package/dist/markdown/markdown.d.ts.map +1 -0
  269. package/dist/markdown/markdown.js +105 -0
  270. package/dist/markdown/markdown.js.map +1 -0
  271. package/dist/matrix/grid-step.d.ts +8 -0
  272. package/dist/matrix/grid-step.d.ts.map +1 -0
  273. package/dist/matrix/grid-step.js +69 -0
  274. package/dist/matrix/grid-step.js.map +1 -0
  275. package/dist/matrix/index.d.ts +5 -0
  276. package/dist/matrix/index.d.ts.map +1 -0
  277. package/dist/matrix/index.js +7 -0
  278. package/dist/matrix/index.js.map +1 -0
  279. package/dist/matrix/mark-matrix.d.ts +97 -0
  280. package/dist/matrix/mark-matrix.d.ts.map +1 -0
  281. package/dist/matrix/mark-matrix.js +272 -0
  282. package/dist/matrix/mark-matrix.js.map +1 -0
  283. package/dist/matrix/styles.d.ts +4 -0
  284. package/dist/matrix/styles.d.ts.map +1 -0
  285. package/dist/matrix/styles.js +47 -0
  286. package/dist/matrix/styles.js.map +1 -0
  287. package/dist/matrix/types.d.ts +79 -0
  288. package/dist/matrix/types.d.ts.map +1 -0
  289. package/dist/matrix/types.js +5 -0
  290. package/dist/matrix/types.js.map +1 -0
  291. package/dist/primitives/fact-line.d.ts +14 -0
  292. package/dist/primitives/fact-line.d.ts.map +1 -0
  293. package/dist/primitives/fact-line.js +18 -0
  294. package/dist/primitives/fact-line.js.map +1 -0
  295. package/dist/primitives/icon.d.ts +14 -0
  296. package/dist/primitives/icon.d.ts.map +1 -0
  297. package/dist/primitives/icon.js +19 -0
  298. package/dist/primitives/icon.js.map +1 -0
  299. package/dist/primitives/index.d.ts +10 -0
  300. package/dist/primitives/index.d.ts.map +1 -0
  301. package/dist/primitives/index.js +13 -0
  302. package/dist/primitives/index.js.map +1 -0
  303. package/dist/primitives/legend.d.ts +28 -0
  304. package/dist/primitives/legend.d.ts.map +1 -0
  305. package/dist/primitives/legend.js +28 -0
  306. package/dist/primitives/legend.js.map +1 -0
  307. package/dist/primitives/pill.d.ts +23 -0
  308. package/dist/primitives/pill.d.ts.map +1 -0
  309. package/dist/primitives/pill.js +40 -0
  310. package/dist/primitives/pill.js.map +1 -0
  311. package/dist/primitives/roving-focus.d.ts +47 -0
  312. package/dist/primitives/roving-focus.d.ts.map +1 -0
  313. package/dist/primitives/roving-focus.js +111 -0
  314. package/dist/primitives/roving-focus.js.map +1 -0
  315. package/dist/primitives/segmented.d.ts +41 -0
  316. package/dist/primitives/segmented.d.ts.map +1 -0
  317. package/dist/primitives/segmented.js +88 -0
  318. package/dist/primitives/segmented.js.map +1 -0
  319. package/dist/primitives/share-bar.d.ts +37 -0
  320. package/dist/primitives/share-bar.d.ts.map +1 -0
  321. package/dist/primitives/share-bar.js +69 -0
  322. package/dist/primitives/share-bar.js.map +1 -0
  323. package/dist/primitives/states.d.ts +19 -0
  324. package/dist/primitives/states.d.ts.map +1 -0
  325. package/dist/primitives/states.js +11 -0
  326. package/dist/primitives/states.js.map +1 -0
  327. package/dist/primitives/window.d.ts +24 -0
  328. package/dist/primitives/window.d.ts.map +1 -0
  329. package/dist/primitives/window.js +56 -0
  330. package/dist/primitives/window.js.map +1 -0
  331. package/dist/styles/chips.d.ts +2 -0
  332. package/dist/styles/chips.d.ts.map +1 -0
  333. package/dist/styles/chips.js +18 -0
  334. package/dist/styles/chips.js.map +1 -0
  335. package/dist/styles/facts.d.ts +2 -0
  336. package/dist/styles/facts.d.ts.map +1 -0
  337. package/dist/styles/facts.js +7 -0
  338. package/dist/styles/facts.js.map +1 -0
  339. package/dist/styles/index.d.ts +16 -0
  340. package/dist/styles/index.d.ts.map +1 -0
  341. package/dist/styles/index.js +15 -0
  342. package/dist/styles/index.js.map +1 -0
  343. package/dist/styles/layout.d.ts +2 -0
  344. package/dist/styles/layout.d.ts.map +1 -0
  345. package/dist/styles/layout.js +33 -0
  346. package/dist/styles/layout.js.map +1 -0
  347. package/dist/styles/marks.d.ts +2 -0
  348. package/dist/styles/marks.d.ts.map +1 -0
  349. package/dist/styles/marks.js +30 -0
  350. package/dist/styles/marks.js.map +1 -0
  351. package/dist/styles/meter.d.ts +3 -0
  352. package/dist/styles/meter.d.ts.map +1 -0
  353. package/dist/styles/meter.js +9 -0
  354. package/dist/styles/meter.js.map +1 -0
  355. package/dist/styles/motion.d.ts +2 -0
  356. package/dist/styles/motion.d.ts.map +1 -0
  357. package/dist/styles/motion.js +27 -0
  358. package/dist/styles/motion.js.map +1 -0
  359. package/dist/styles/prose.d.ts +3 -0
  360. package/dist/styles/prose.d.ts.map +1 -0
  361. package/dist/styles/prose.js +59 -0
  362. package/dist/styles/prose.js.map +1 -0
  363. package/dist/styles/reset.d.ts +2 -0
  364. package/dist/styles/reset.d.ts.map +1 -0
  365. package/dist/styles/reset.js +13 -0
  366. package/dist/styles/reset.js.map +1 -0
  367. package/dist/styles/status.d.ts +2 -0
  368. package/dist/styles/status.d.ts.map +1 -0
  369. package/dist/styles/status.js +52 -0
  370. package/dist/styles/status.js.map +1 -0
  371. package/dist/styles/text.d.ts +2 -0
  372. package/dist/styles/text.d.ts.map +1 -0
  373. package/dist/styles/text.js +21 -0
  374. package/dist/styles/text.js.map +1 -0
  375. package/dist/styles/tokens.d.ts +8 -0
  376. package/dist/styles/tokens.d.ts.map +1 -0
  377. package/dist/styles/tokens.js +32 -0
  378. package/dist/styles/tokens.js.map +1 -0
  379. package/dist/table/data-table.d.ts +106 -0
  380. package/dist/table/data-table.d.ts.map +1 -0
  381. package/dist/table/data-table.js +408 -0
  382. package/dist/table/data-table.js.map +1 -0
  383. package/dist/table/index.d.ts +4 -0
  384. package/dist/table/index.d.ts.map +1 -0
  385. package/dist/table/index.js +6 -0
  386. package/dist/table/index.js.map +1 -0
  387. package/dist/table/styles.d.ts +2 -0
  388. package/dist/table/styles.d.ts.map +1 -0
  389. package/dist/table/styles.js +32 -0
  390. package/dist/table/styles.js.map +1 -0
  391. package/dist/table/types.d.ts +48 -0
  392. package/dist/table/types.d.ts.map +1 -0
  393. package/dist/table/types.js +30 -0
  394. package/dist/table/types.js.map +1 -0
  395. package/dist/themes/boot.d.ts +7 -0
  396. package/dist/themes/boot.d.ts.map +1 -0
  397. package/dist/themes/boot.js +14 -0
  398. package/dist/themes/boot.js.map +1 -0
  399. package/dist/themes/choice.d.ts +16 -0
  400. package/dist/themes/choice.d.ts.map +1 -0
  401. package/dist/themes/choice.js +45 -0
  402. package/dist/themes/choice.js.map +1 -0
  403. package/dist/themes/data.d.ts +43 -0
  404. package/dist/themes/data.d.ts.map +1 -0
  405. package/dist/themes/data.js +408 -0
  406. package/dist/themes/data.js.map +1 -0
  407. package/dist/themes/index.d.ts +7 -0
  408. package/dist/themes/index.d.ts.map +1 -0
  409. package/dist/themes/index.js +11 -0
  410. package/dist/themes/index.js.map +1 -0
  411. package/dist/themes/sheet.d.ts +16 -0
  412. package/dist/themes/sheet.d.ts.map +1 -0
  413. package/dist/themes/sheet.js +28 -0
  414. package/dist/themes/sheet.js.map +1 -0
  415. package/dist/themes/token-meanings.d.ts +3 -0
  416. package/dist/themes/token-meanings.d.ts.map +1 -0
  417. package/dist/themes/token-meanings.js +67 -0
  418. package/dist/themes/token-meanings.js.map +1 -0
  419. package/dist/themes/tokens-list.d.ts +14 -0
  420. package/dist/themes/tokens-list.d.ts.map +1 -0
  421. package/dist/themes/tokens-list.js +69 -0
  422. package/dist/themes/tokens-list.js.map +1 -0
  423. package/dist/tiles/index.d.ts +4 -0
  424. package/dist/tiles/index.d.ts.map +1 -0
  425. package/dist/tiles/index.js +6 -0
  426. package/dist/tiles/index.js.map +1 -0
  427. package/dist/tiles/stat-tiles.d.ts +40 -0
  428. package/dist/tiles/stat-tiles.d.ts.map +1 -0
  429. package/dist/tiles/stat-tiles.js +99 -0
  430. package/dist/tiles/stat-tiles.js.map +1 -0
  431. package/dist/tiles/styles.d.ts +2 -0
  432. package/dist/tiles/styles.d.ts.map +1 -0
  433. package/dist/tiles/styles.js +23 -0
  434. package/dist/tiles/styles.js.map +1 -0
  435. package/dist/tiles/types.d.ts +22 -0
  436. package/dist/tiles/types.d.ts.map +1 -0
  437. package/dist/tiles/types.js +2 -0
  438. package/dist/tiles/types.js.map +1 -0
  439. package/dist/transcript/follow-scroll.d.ts +21 -0
  440. package/dist/transcript/follow-scroll.d.ts.map +1 -0
  441. package/dist/transcript/follow-scroll.js +76 -0
  442. package/dist/transcript/follow-scroll.js.map +1 -0
  443. package/dist/transcript/index.d.ts +5 -0
  444. package/dist/transcript/index.d.ts.map +1 -0
  445. package/dist/transcript/index.js +7 -0
  446. package/dist/transcript/index.js.map +1 -0
  447. package/dist/transcript/styles.d.ts +2 -0
  448. package/dist/transcript/styles.d.ts.map +1 -0
  449. package/dist/transcript/styles.js +114 -0
  450. package/dist/transcript/styles.js.map +1 -0
  451. package/dist/transcript/tags.d.ts +6 -0
  452. package/dist/transcript/tags.d.ts.map +1 -0
  453. package/dist/transcript/tags.js +13 -0
  454. package/dist/transcript/tags.js.map +1 -0
  455. package/dist/transcript/tool-card.d.ts +16 -0
  456. package/dist/transcript/tool-card.d.ts.map +1 -0
  457. package/dist/transcript/tool-card.js +87 -0
  458. package/dist/transcript/tool-card.js.map +1 -0
  459. package/dist/transcript/transcript.d.ts +103 -0
  460. package/dist/transcript/transcript.d.ts.map +1 -0
  461. package/dist/transcript/transcript.js +397 -0
  462. package/dist/transcript/transcript.js.map +1 -0
  463. package/dist/transcript/types.d.ts +161 -0
  464. package/dist/transcript/types.d.ts.map +1 -0
  465. package/dist/transcript/types.js +25 -0
  466. package/dist/transcript/types.js.map +1 -0
  467. package/docs/charts.md +58 -0
  468. package/docs/check-table.md +40 -0
  469. package/docs/data-table.md +57 -0
  470. package/docs/examples/charts.ts +61 -0
  471. package/docs/examples/check-table.ts +19 -0
  472. package/docs/examples/ci-pipeline.ts +271 -0
  473. package/docs/examples/data-table.ts +39 -0
  474. package/docs/examples/graph.ts +57 -0
  475. package/docs/examples/lanes.ts +40 -0
  476. package/docs/examples/matrix.ts +56 -0
  477. package/docs/examples/page.css +34 -0
  478. package/docs/examples/segmented.ts +18 -0
  479. package/docs/examples/status.ts +30 -0
  480. package/docs/examples/theme.css +54 -0
  481. package/docs/examples/tiles.ts +27 -0
  482. package/docs/examples/transcript.ts +59 -0
  483. package/docs/graph.md +112 -0
  484. package/docs/lanes.md +48 -0
  485. package/docs/matrix.md +34 -0
  486. package/docs/page.md +87 -0
  487. package/docs/primitives.md +57 -0
  488. package/docs/strings.md +16 -0
  489. package/docs/theming.md +147 -0
  490. package/docs/tiles.md +40 -0
  491. package/docs/transcript.md +73 -0
  492. package/docs/tsconfig.json +20 -0
  493. package/package.json +161 -4
  494. package/src/charts/bar-chart.ts +74 -0
  495. package/src/charts/base.ts +188 -0
  496. package/src/charts/column-chart.ts +153 -0
  497. package/src/charts/heatmap.ts +129 -0
  498. package/src/charts/index.ts +10 -0
  499. package/src/charts/line-chart.ts +128 -0
  500. package/src/charts/scale.ts +61 -0
  501. package/src/charts/state-grid.ts +245 -0
  502. package/src/charts/types.ts +48 -0
  503. package/src/checks/check-table.ts +85 -0
  504. package/src/checks/index.ts +5 -0
  505. package/src/checks/styles.ts +31 -0
  506. package/src/checks/types.ts +48 -0
  507. package/src/core/clock.ts +46 -0
  508. package/src/core/define.ts +7 -0
  509. package/src/core/events.ts +89 -0
  510. package/src/core/format.ts +25 -0
  511. package/src/core/frame.ts +5 -0
  512. package/src/core/strings.ts +11 -0
  513. package/src/core/tone.ts +14 -0
  514. package/src/count/count.ts +54 -0
  515. package/src/count/elapsed.ts +33 -0
  516. package/src/count/index.ts +4 -0
  517. package/src/define/all.ts +13 -0
  518. package/src/define/charts.ts +17 -0
  519. package/src/define/check-table.ts +9 -0
  520. package/src/define/count.ts +11 -0
  521. package/src/define/data-table.ts +9 -0
  522. package/src/define/graph.ts +11 -0
  523. package/src/define/json-tree.ts +9 -0
  524. package/src/define/lanes.ts +9 -0
  525. package/src/define/markdown.ts +9 -0
  526. package/src/define/matrix.ts +9 -0
  527. package/src/define/segmented.ts +9 -0
  528. package/src/define/tiles.ts +11 -0
  529. package/src/define/transcript.ts +9 -0
  530. package/src/graph/arrange.ts +399 -0
  531. package/src/graph/card.ts +209 -0
  532. package/src/graph/host.ts +100 -0
  533. package/src/graph/icons.ts +23 -0
  534. package/src/graph/index.ts +16 -0
  535. package/src/graph/layered-graph.ts +417 -0
  536. package/src/graph/layout.ts +331 -0
  537. package/src/graph/marks.ts +42 -0
  538. package/src/graph/nav.ts +19 -0
  539. package/src/graph/pan-zoom.ts +219 -0
  540. package/src/graph/paths.ts +41 -0
  541. package/src/graph/place-card.ts +93 -0
  542. package/src/graph/strings.ts +86 -0
  543. package/src/graph/styles.ts +204 -0
  544. package/src/graph/types.ts +202 -0
  545. package/src/graph/view.ts +28 -0
  546. package/src/graph/views/dag.ts +294 -0
  547. package/src/graph/views/foot.ts +109 -0
  548. package/src/graph/views/node-table.ts +90 -0
  549. package/src/index.ts +25 -0
  550. package/src/json/index.ts +2 -0
  551. package/src/json/json-tree.ts +49 -0
  552. package/src/lanes/index.ts +6 -0
  553. package/src/lanes/lanes.ts +143 -0
  554. package/src/lanes/stack.ts +51 -0
  555. package/src/lanes/styles.ts +30 -0
  556. package/src/lanes/types.ts +51 -0
  557. package/src/markdown/cae-markdown.ts +64 -0
  558. package/src/markdown/highlight.ts +94 -0
  559. package/src/markdown/index.ts +5 -0
  560. package/src/markdown/markdown.ts +110 -0
  561. package/src/matrix/grid-step.ts +58 -0
  562. package/src/matrix/index.ts +6 -0
  563. package/src/matrix/mark-matrix.ts +285 -0
  564. package/src/matrix/styles.ts +48 -0
  565. package/src/matrix/types.ts +83 -0
  566. package/src/primitives/fact-line.ts +26 -0
  567. package/src/primitives/icon.ts +26 -0
  568. package/src/primitives/index.ts +12 -0
  569. package/src/primitives/legend.ts +56 -0
  570. package/src/primitives/pill.ts +58 -0
  571. package/src/primitives/roving-focus.ts +138 -0
  572. package/src/primitives/segmented.ts +92 -0
  573. package/src/primitives/share-bar.ts +94 -0
  574. package/src/primitives/states.ts +28 -0
  575. package/src/primitives/window.ts +65 -0
  576. package/src/styles/chips.ts +18 -0
  577. package/src/styles/facts.ts +7 -0
  578. package/src/styles/index.ts +19 -0
  579. package/src/styles/layout.ts +33 -0
  580. package/src/styles/marks.ts +30 -0
  581. package/src/styles/meter.ts +9 -0
  582. package/src/styles/motion.ts +27 -0
  583. package/src/styles/prose.ts +59 -0
  584. package/src/styles/reset.ts +13 -0
  585. package/src/styles/status.ts +52 -0
  586. package/src/styles/text.ts +21 -0
  587. package/src/styles/tokens.ts +35 -0
  588. package/src/table/data-table.ts +367 -0
  589. package/src/table/index.ts +5 -0
  590. package/src/table/styles.ts +32 -0
  591. package/src/table/types.ts +73 -0
  592. package/src/themes/boot.ts +14 -0
  593. package/src/themes/choice.ts +47 -0
  594. package/src/themes/data.ts +433 -0
  595. package/src/themes/index.ts +10 -0
  596. package/src/themes/sheet.ts +29 -0
  597. package/src/themes/token-meanings.ts +67 -0
  598. package/src/themes/tokens-list.ts +82 -0
  599. package/src/tiles/index.ts +5 -0
  600. package/src/tiles/stat-tiles.ts +92 -0
  601. package/src/tiles/styles.ts +23 -0
  602. package/src/tiles/types.ts +20 -0
  603. package/src/transcript/follow-scroll.ts +72 -0
  604. package/src/transcript/index.ts +6 -0
  605. package/src/transcript/styles.ts +114 -0
  606. package/src/transcript/tags.ts +18 -0
  607. package/src/transcript/tool-card.ts +103 -0
  608. package/src/transcript/transcript.ts +358 -0
  609. package/src/transcript/types.ts +167 -0
package/docs/charts.md ADDED
@@ -0,0 +1,58 @@
1
+ # Charts
2
+
3
+ Five charts of plain series: `<cae-column-chart>` (vertical bars, stacked or
4
+ side by side), `<cae-line-chart>`, `<cae-heatmap>`, `<cae-state-grid>` (a state
5
+ per row and column) and `<cae-bar-chart>` (horizontal bars). Register them with
6
+ `@contraagent/elements/charts/define`; the types and the arithmetic they share
7
+ are in `@contraagent/elements/charts`.
8
+
9
+ ![Five charts of a CI pipeline: minutes by day as stacked columns, queue time as two lines, builds by weekday and hour as a heatmap, nightly builds as a state grid, and a test funnel as horizontal bars](images/charts.webp)
10
+
11
+ ::code{file="examples/charts.ts"}
12
+
13
+ ## Series and values
14
+
15
+ A chart takes labels (`x`) and series, each a name and a value per label; a
16
+ null value is a value the series has not: no bar, a break in a line, an empty
17
+ cell. A heatmap takes its rows (`y`), its columns (`x`) and `values[row][column]`;
18
+ a state grid the same rows and columns and `cells[row][column]`, each a state's
19
+ `label`, its `tone` and an optional `tip` (null: no cell); a bar chart takes
20
+ `bars`, each a label, a value and an optional `tone`.
21
+
22
+ ::code{file="../src/charts/types.ts" from="/** One series" to="/** The words of a chart"}
23
+
24
+ `format` writes a value in words (`$1.20`, `42%`, `2m 05s`): on the axis, in the
25
+ tooltip and in the table. It is the host's, since the chart does not know the
26
+ unit.
27
+
28
+ ## Colour
29
+
30
+ The series take the series colours (`--ca-series-1` to `--ca-series-6`) in
31
+ their order, so a series keeps its colour whatever its values and its rank. A
32
+ chart never makes up a seventh colour: past six series, a column chart sums the
33
+ sixth and later into one series, `strings.other`, in the neutral `--ca-meter`;
34
+ a line chart draws them in that colour and names each in the legend and the
35
+ tooltip. A heatmap uses one hue, light to dark in five steps between its lowest
36
+ and highest value. A state grid colours a cell by its tone, so a failure and
37
+ what needs attention stand out and a cell that ended well stays quiet; the
38
+ colour is never alone: a cell wide enough holds its tone's mark (✓ done,
39
+ ✕ failed, ◌ attention; a done cell's mark is quieter), the legend names each
40
+ state once, failures and what needs attention first, and the tooltip and the
41
+ table say the state in words. A bar
42
+ with a `tone` takes that status colour; a status colour is never a series.
43
+
44
+ ## Reading it
45
+
46
+ Two or more series have a legend; one series has none, since the chart's title
47
+ names it. Pointing at a label, or moving to it with the arrow keys once the
48
+ chart has the focus (up and down by a row in a heatmap and a state grid, Home and End to the
49
+ ends, Escape to close), shows its values in a tooltip. Every chart has a switch
50
+ to a table of the same values (`strings.showTable`, `strings.showChart`), which
51
+ is also how a screen reader reads it. A bar chart writes each value beside its
52
+ bar.
53
+
54
+ ## Look
55
+
56
+ `height` sets a column or line chart's height in px (200 by default; the rows of
57
+ a heatmap and of a state grid are 22px each). The parts are `plot`, `table`, `switch`, `legend` and
58
+ `empty`.
@@ -0,0 +1,40 @@
1
+ # Check table
2
+
3
+ `<cae-check-table>` shows named values checked one by one: a row per name,
4
+ with what it must be, what it is and the verdict. Register it with
5
+ `@contraagent/elements/check-table/define`; the types, `verdict` and
6
+ `verdictStyles` are in `@contraagent/elements/check-table`.
7
+
8
+ ![A check table of five fields: what each must be, what the file holds, and the verdict (passed, wrong type, absent, extra field)](images/check-table.webp)
9
+
10
+ <!-- not on the site -->
11
+ Live on this topic's page of the documentation site (`pnpm run docs` in `web/`).
12
+
13
+ ::code{file="examples/check-table.ts"}
14
+
15
+ ## Rows
16
+
17
+ A row is a `CheckRow`. The host judges each value; the table shows the
18
+ verdict: `pass` (✓ and its word), `fail` (✕ and its word, in the failed
19
+ tone), `warn` (its word, in the attention tone) or `none` (its word, muted, or
20
+ an empty cell without one). The marks are hidden from screen readers, which
21
+ read the word.
22
+
23
+ ::code{file="../src/checks/types.ts" from="export interface CheckRow" to="export interface CheckTableStrings"}
24
+
25
+ A value is shown in one line: a string quoted and cut, a list's length and its
26
+ first items, an object's first keys. A row with `extra` names a value that is
27
+ not expected: its `expected` is a phrase, not code. Without `showValues`, the
28
+ table shows only the names and what each must be.
29
+
30
+ ## Verdicts elsewhere
31
+
32
+ `verdict(v, label, tip)` draws a verdict as the table does, for a host that
33
+ shows one outside a table; add `verdictStyles` to the host's styles.
34
+
35
+ ## Look
36
+
37
+ The table is as wide as its content, so each verdict sits next to the value it
38
+ judges; a long value wraps. The parts are `table`, `row` and `verdict`. The
39
+ words are `strings` ([Strings](strings.md)): the headers, `optional`, and the
40
+ summaries of a list (`items`) and an object.
@@ -0,0 +1,57 @@
1
+ # Data table
2
+
3
+ `<cae-data-table>` shows rows of data in a real `<table>`: a header cell per
4
+ column, and the first `rowHeader` column as the header of its row, so a screen
5
+ reader names each cell by its column and its row. Register it with
6
+ `@contraagent/elements/data-table/define`; the types and `sortRows` are in
7
+ `@contraagent/elements/data-table`.
8
+
9
+ ![A data table of three jobs with their minutes and their state: done, failed, running](images/data-table.webp)
10
+
11
+ <!-- not on the site -->
12
+ Live on this topic's page of the documentation site (`pnpm run docs` in `web/`).
13
+
14
+ ::code{file="examples/data-table.ts"}
15
+
16
+ ## Columns
17
+
18
+ A column is a `DataColumn`: its header, a CSS grid track as its width, and a
19
+ function that draws its cell for a row (a template, a string or a number).
20
+ Every row is a grid of the columns' tracks, so the rows line up with the header.
21
+
22
+ ::code{file="../src/table/types.ts" from="/** A column:" to="/** The column the rows are ordered by. */"}
23
+
24
+ ## Keyboard and events
25
+
26
+ The rows are one tab stop. The arrow keys move between rows, and Home and End
27
+ move to the first and the last row. Enter or a click on a row sends
28
+ `cae-activate` with the row's id (`rowKey`). With `activatable` off, they choose
29
+ the row as the selection and send `cae-select`; the selected row has the part
30
+ `row-selected`. A click on a button or a link inside a cell is that control's.
31
+
32
+ A column with `compare` (or `sortable`) has a header button that sends
33
+ `cae-sort` with the column and the direction. The table does not reorder the
34
+ rows: the host sets `sort` and the rows, ordered by `sortRows` or its own way.
35
+ `sortRows` orders by the column's `compare`, else its `text`, else its cell when
36
+ the cell is a string or a number: a column of plain values needs only `sortable`.
37
+
38
+ ## Long lists
39
+
40
+ Above `windowAt` rows (200), the table draws only the rows on screen and a
41
+ spacer for the rows above and below them, so the scroll height stays that of
42
+ the whole list. The rows' height is measured; `rowHeight` is the first
43
+ estimate. The table finds the element that scrolls it, across shadow roots, or
44
+ the window.
45
+
46
+ ## Look
47
+
48
+ `--cae-data-table-gap` sets the space between the columns and
49
+ `--cae-data-table-row-padding` a row's padding. The parts are `table`,
50
+ `caption`, `head`, `header-cell`, `row`, `row-selected`, `cell` and `empty`;
51
+ `rowTone` gives a row a tone (`data-tone`) and `rowAttrs` more attributes. What
52
+ the cells draw lives in the table's shadow root: `cellStyles` adds styles there,
53
+ after the table's own (the rows are `tr`, the cells `th` and `td`, each with
54
+ `data-col` set to its column's id).
55
+
56
+ The words are `strings` ([Strings](strings.md)): `empty` with no rows (or the
57
+ `empty` slot), and the sort buttons' tooltips.
@@ -0,0 +1,61 @@
1
+ // Charts: a CI pipeline's minutes by day and stage (stacked columns), its queue
2
+ // time (lines), its builds by weekday and hour (a heatmap), how its nightly builds
3
+ // ended (a state grid) and its test funnel (horizontal bars). The host gives each
4
+ // chart its unit's format.
5
+ import '@contraagent/elements/charts/define';
6
+ import type { ChartSeries } from '@contraagent/elements/charts';
7
+
8
+ const days = ['10-08', '10-09', '10-10', '10-11', '10-12', '10-13', '10-14'];
9
+ const minutes: ChartSeries[] = [
10
+ { name: 'build', values: [42, 38, 51, 12, 9, 47, 44] },
11
+ { name: 'test', values: [65, 70, 58, 20, null, 61, 66] },
12
+ { name: 'deploy', values: [8, 8, 9, 2, 2, 10, 8] },
13
+ ];
14
+
15
+ export function mount(host: HTMLElement): void {
16
+ const columns = document.createElement('cae-column-chart');
17
+ columns.label = 'Minutes by day';
18
+ columns.x = days;
19
+ columns.series = minutes;
20
+ columns.stacked = true;
21
+ columns.format = (v) => `${v} min`;
22
+
23
+ const lines = document.createElement('cae-line-chart');
24
+ lines.label = 'Queue time';
25
+ lines.x = days;
26
+ lines.series = [
27
+ { name: 'median', values: [1.2, 1.4, 0.9, 0.3, 0.2, 1.8, 1.1] },
28
+ { name: 'slowest', values: [6, 9, 4, 1, 1, 12, 7] },
29
+ ];
30
+ lines.format = (v) => `${v} min`;
31
+
32
+ const heat = document.createElement('cae-heatmap');
33
+ heat.label = 'Builds by weekday and hour';
34
+ heat.x = ['9', '10', '11', '12', '13', '14', '15', '16', '17'];
35
+ heat.y = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'];
36
+ // A count per weekday and hour; Wednesday at 13 has no record (null: an empty cell).
37
+ heat.values = heat.y.map((_, r) => heat.x.map((_, c) => (r === 2 && c === 4 ? null : (r * 7 + c * 3) % 9)));
38
+ heat.strings = { scale: (low, high) => `${low} to ${high} builds` };
39
+
40
+ const bars = document.createElement('cae-bar-chart');
41
+ bars.label = 'Tests this week';
42
+ bars.bars = [
43
+ { label: 'written', value: 1240 },
44
+ { label: 'run', value: 1180 },
45
+ { label: 'passed', value: 1162 },
46
+ { label: 'flaky', value: 18, tone: 'attention' },
47
+ ];
48
+
49
+ const nightly = document.createElement('cae-state-grid');
50
+ nightly.label = 'Nightly builds by weekday and hour';
51
+ nightly.x = ['0', '1', '2', '3'];
52
+ nightly.y = ['Mon', 'Tue'];
53
+ const passed = { label: 'passed', tone: 'done' as const };
54
+ // A state per weekday and hour: its word, its tone, and a fact for the tooltip; null: no build.
55
+ nightly.cells = [
56
+ [passed, { label: 'failed', tone: 'failed', tip: 'build 4127' }, passed, null],
57
+ [passed, passed, { label: 'skipped', tone: 'muted' }, passed],
58
+ ];
59
+
60
+ host.replaceChildren(columns, lines, heat, nightly, bars);
61
+ }
@@ -0,0 +1,19 @@
1
+ // A check table: hand-written fields of a settings file, each checked against
2
+ // what it must be. The host judges the values; the table shows the verdicts.
3
+ import '@contraagent/elements/check-table/define';
4
+ import type { CheckRow } from '@contraagent/elements/check-table';
5
+
6
+ const rows: CheckRow[] = [
7
+ { name: 'name', expected: 'string', hasValue: true, value: 'release-build', verdict: 'pass', verdictLabel: 'passed' },
8
+ { name: 'retries', expected: 'integer', hasValue: true, value: '3', verdict: 'fail', verdictLabel: 'wrong type', tip: 'Expected integer' },
9
+ { name: 'targets', expected: 'list[str]', hasValue: true, value: ['linux', 'macos', 'windows', 'wasm'], verdict: 'pass', verdictLabel: 'passed' },
10
+ { name: 'cache', expected: 'object', optional: true, hasValue: false, verdict: 'none', verdictLabel: 'absent (optional)' },
11
+ { name: 'colour', expected: 'not in the schema', extra: true, hasValue: true, value: 'blue', verdict: 'warn', verdictLabel: 'extra field' },
12
+ ];
13
+
14
+ export function mount(host: HTMLElement): void {
15
+ const table = document.createElement('cae-check-table');
16
+ table.rows = rows;
17
+ table.strings = { name: 'Field', actual: 'In the file' };
18
+ host.replaceChildren(table);
19
+ }
@@ -0,0 +1,271 @@
1
+ // A whole page from the generic elements: one run of a made-up CI pipeline.
2
+ // A theme switch, stat tiles, a sortable table of jobs, and a layered graph of
3
+ // the steps (a shard is a series; the end-to-end tests repeat in a retry loop),
4
+ // with a detail panel of the page's own beside them. The page holds the data
5
+ // and the state (the theme, the selection, the order), and answers the events.
6
+ import '@contraagent/elements/segmented/define'; // <cae-segmented>
7
+ import '@contraagent/elements/tiles/define'; // <cae-stat-tiles>
8
+ import '@contraagent/elements/data-table/define'; // <cae-data-table>
9
+ import '@contraagent/elements/graph/define'; // <cae-layered-graph>
10
+ import { adoptThemes } from '@contraagent/elements/themes';
11
+ import { fmtDur, pill, type StateStyles } from '@contraagent/elements';
12
+ import { sortRows, type CaeDataTable, type DataColumn } from '@contraagent/elements/data-table';
13
+ import type { GraphInput, GraphMark, GraphNodeInput } from '@contraagent/elements/graph';
14
+ import type { StatTile } from '@contraagent/elements/tiles';
15
+
16
+ // ---- The data: a step is a node, a job is one run of a step (or of one shard of it).
17
+
18
+ type State = 'done' | 'failed' | 'running' | 'queued';
19
+
20
+ interface Job {
21
+ id: string;
22
+ step: string;
23
+ /** The shard ('1' to '3'), or null for a step that runs once. */
24
+ shard: string | null;
25
+ /** The pass of the retry loop it ran in (1 outside the loop). */
26
+ pass: number;
27
+ state: State;
28
+ seconds: number;
29
+ runner: string;
30
+ }
31
+
32
+ const steps = [
33
+ { id: 'lint', label: 'lint', loop: false },
34
+ { id: 'unit', label: 'unit tests', loop: false },
35
+ { id: 'build', label: 'build', loop: false },
36
+ { id: 'e2e', label: 'e2e tests', loop: true },
37
+ { id: 'triage', label: 'triage failures', loop: true },
38
+ { id: 'deploy', label: 'deploy preview', loop: false },
39
+ ];
40
+ const shards = ['1', '2', '3'];
41
+
42
+ const job = (step: string, shard: string | null, pass: number, state: State, seconds: number, runner: string): Job => ({
43
+ id: `${step}${shard ? `/${shard}` : ''}#${pass}`,
44
+ step,
45
+ shard,
46
+ pass,
47
+ state,
48
+ seconds,
49
+ runner,
50
+ });
51
+
52
+ const jobs: Job[] = [
53
+ job('lint', null, 1, 'done', 41, 'small-1'),
54
+ job('unit', '1', 1, 'done', 188, 'large-1'),
55
+ job('unit', '2', 1, 'done', 203, 'large-2'),
56
+ job('unit', '3', 1, 'done', 176, 'large-3'),
57
+ job('build', null, 1, 'done', 315, 'large-1'),
58
+ job('e2e', '1', 1, 'done', 402, 'large-2'),
59
+ job('e2e', '2', 1, 'failed', 377, 'large-3'),
60
+ job('e2e', '3', 1, 'done', 395, 'large-1'),
61
+ job('triage', null, 1, 'done', 12, 'small-1'),
62
+ job('e2e', '2', 2, 'done', 381, 'large-2'),
63
+ job('triage', null, 2, 'done', 9, 'small-1'),
64
+ job('deploy', null, 1, 'running', 74, 'deploy-1'),
65
+ ];
66
+
67
+ // ---- What each state looks like: a word, a tone, a shape (the legend follows this order).
68
+
69
+ const states: StateStyles = {
70
+ done: { label: 'done', tone: 'done', shape: 'round', rank: 0 },
71
+ queued: { label: 'queued', tone: 'muted', shape: 'ring', rank: 1 },
72
+ running: { label: 'running', tone: 'running', shape: 'round', rank: 2 },
73
+ failed: { label: 'failed', tone: 'failed', shape: 'square', rank: 3 },
74
+ };
75
+ const toneOf = (s: State) => states[s]!.tone;
76
+ const jobName = (j: Job) => `${steps.find((s) => s.id === j.step)!.label}${j.shard ? ` shard ${j.shard}` : ''}`;
77
+
78
+ // ---- The graph: a mark per shard (or one loose mark), the last pass's state, the passes as a badge.
79
+
80
+ /** The id of a mark: a step's shard, or the step's single job. */
81
+ const markId = (j: Job) => `${j.step}/${j.shard ?? '-'}`;
82
+
83
+ function mark(runs: Job[]): GraphMark {
84
+ const last = runs[runs.length - 1]!;
85
+ const passes = runs.length > 1 ? `${runs.length} passes` : '1 pass';
86
+ return { id: markId(last), state: last.state, label: `${jobName(last)} | ${last.state} | ${passes}`, tip: jobName(last), badge: runs.length > 1 ? String(runs.length) : undefined };
87
+ }
88
+
89
+ function node(step: (typeof steps)[number]): GraphNodeInput {
90
+ const own = jobs.filter((j) => j.step === step.id);
91
+ const runsOf = (shard: string | null) => own.filter((j) => j.shard === shard);
92
+ const sharded = own.some((j) => j.shard);
93
+ const marks = sharded ? shards.map((s) => (runsOf(s).length ? mark(runsOf(s)) : null)) : [];
94
+ const loose = sharded ? [] : [mark(runsOf(null))];
95
+ // `counts` and `progress` ("2/3") default to what the marks say.
96
+ // A job that failed in an earlier pass is not in the marks: the line under them names it.
97
+ const failed = own.filter((j) => j.state === 'failed').length;
98
+ return {
99
+ id: step.id,
100
+ label: step.label,
101
+ cluster: step.loop ? 'retry' : null,
102
+ marks,
103
+ loose,
104
+ notes: failed ? [{ text: `${failed} failed ${failed === 1 ? 'job' : 'jobs'}`, tone: 'failed' }] : [],
105
+ };
106
+ }
107
+
108
+ const graph: GraphInput = {
109
+ series: shards,
110
+ nodes: steps.map(node),
111
+ clusters: [{ id: 'retry', parent: null, label: 'retry loop', note: 'up to 3 passes', cycle: true }],
112
+ edges: [
113
+ { from: 'lint', to: 'build', style: 'solid', weight: 1, ranks: true },
114
+ { from: 'unit', to: 'build', style: 'solid', weight: 3, ranks: true },
115
+ { from: 'build', to: 'e2e', style: 'solid', weight: 3, ranks: true },
116
+ { from: 'e2e', to: 'triage', style: 'solid', weight: 3, ranks: true },
117
+ // The next pass: from triage back to the tests. It does not set the layers.
118
+ { from: 'triage', to: 'e2e', style: 'solid', weight: 1, ranks: false },
119
+ { from: 'triage', to: 'deploy', style: 'solid', weight: 1, ranks: true },
120
+ ],
121
+ stubs: [{ id: 'push', label: 'push to main', to: 'lint', style: 'solid', weight: 1 }],
122
+ };
123
+
124
+ // ---- The table: a row per job; every column sorts.
125
+
126
+ const columns: DataColumn<Job>[] = [
127
+ { id: 'job', header: 'Job', rowHeader: true, cell: jobName, sortable: true },
128
+ { id: 'pass', header: 'Pass', align: 'end', width: '72px', cell: (j) => j.pass, compare: (a, b) => a.pass - b.pass },
129
+ { id: 'state', header: 'State', width: '120px', cell: (j) => pill({ text: j.state, tone: toneOf(j.state) }), compare: (a, b) => states[a.state]!.rank - states[b.state]!.rank },
130
+ { id: 'time', header: 'Time', align: 'end', width: '96px', cell: (j) => fmtDur(j.seconds), compare: (a, b) => a.seconds - b.seconds },
131
+ { id: 'runner', header: 'Runner', width: '120px', cell: (j) => j.runner, sortable: true },
132
+ ];
133
+
134
+ // ---- The tiles.
135
+
136
+ const failed = jobs.filter((j) => j.state === 'failed');
137
+ const passes = Math.max(...jobs.map((j) => j.pass));
138
+ const count = (s: State) => jobs.filter((j) => j.state === s).length;
139
+ const tiles: StatTile[] = [
140
+ { id: 'jobs', label: 'Jobs', value: jobs.length, sub: [[`${count('done')} done`, `${count('running')} running`]] },
141
+ { id: 'failed', label: 'Failed jobs', value: failed.length, tone: failed.length ? 'failed' : undefined, sub: [failed.length ? failed.map((j) => `${jobName(j)}, pass ${j.pass}`) : ['All jobs passed']] },
142
+ { id: 'passes', label: 'Passes of the retry loop', value: passes, sub: [['Up to 3']] },
143
+ { id: 'time', label: 'Job time', value: fmtDur(jobs.reduce((t, j) => t + j.seconds, 0)), tip: 'Sum over all jobs' },
144
+ ];
145
+
146
+ // ---- The page's own styles. Its colours are the theme's, so the page changes with the switch.
147
+
148
+ const css = `
149
+ .ci-page {
150
+ background: var(--ca-bg);
151
+ color: var(--ca-text);
152
+ font: 14px/1.45 system-ui, sans-serif;
153
+ padding: 16px;
154
+ display: grid;
155
+ gap: 16px;
156
+ container-type: inline-size;
157
+ }
158
+ .ci-page header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
159
+ .ci-page h2 { font-size: 18px; margin: 0; flex: 1; color: var(--ca-text); }
160
+ .ci-page h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--ca-text-secondary); }
161
+ .ci-page .body { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
162
+ .ci-page .main { display: grid; gap: 16px; min-width: 0; }
163
+ .ci-page aside { background: var(--ca-card); border: 1px solid var(--ca-line); border-radius: 8px; padding: 12px; position: sticky; top: 0; }
164
+ .ci-page dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
165
+ .ci-page dt { color: var(--ca-text-muted); }
166
+ .ci-page dd { margin: 0; }
167
+ @container (max-width: 760px) { .ci-page .body { grid-template-columns: minmax(0, 1fr); } }
168
+ `;
169
+
170
+ // ---- The page: build it, then answer the events.
171
+
172
+ export function mount(host: HTMLElement): void {
173
+ adoptThemes(document);
174
+ host.dataset['caTheme'] = 'contraagent-dark';
175
+
176
+ const page = document.createElement('div');
177
+ page.className = 'ci-page';
178
+ page.innerHTML = `<style>${css}</style>
179
+ <header><h2>web-app | pipeline 482 | main</h2></header>
180
+ <div class="body">
181
+ <div class="main">
182
+ <section><h3>Pipeline</h3></section>
183
+ <section></section>
184
+ </div>
185
+ <aside aria-live="polite"><h3>Selected</h3><div class="detail">No selection</div></aside>
186
+ </div>`;
187
+ const [graphBox, tableBox] = page.querySelectorAll('section');
188
+ const detail = page.querySelector<HTMLElement>('.detail')!;
189
+
190
+ // The theme: `data-ca-theme` on the box that holds the page.
191
+ const theme = document.createElement('cae-segmented');
192
+ theme.label = 'Theme';
193
+ theme.options = [
194
+ { value: 'contraagent-dark', label: 'Dark' },
195
+ { value: 'contraagent-light', label: 'Light' },
196
+ { value: 'high-contrast', label: 'High contrast' },
197
+ ];
198
+ theme.value = 'contraagent-dark';
199
+ theme.addEventListener('cae-change', (e) => {
200
+ theme.value = e.detail.value;
201
+ host.dataset['caTheme'] = e.detail.value;
202
+ });
203
+ page.querySelector('header')!.append(theme);
204
+
205
+ const stats = document.createElement('cae-stat-tiles');
206
+ stats.columns = 4;
207
+ stats.tiles = tiles;
208
+ page.querySelector('header')!.after(stats);
209
+
210
+ const table = document.createElement('cae-data-table') as CaeDataTable<Job>;
211
+ table.caption = 'Jobs of pipeline 482';
212
+ table.columns = columns;
213
+ table.rowKey = (j) => j.id;
214
+ table.rows = jobs;
215
+ table.addEventListener('cae-sort', (e) => {
216
+ table.sort = e.detail;
217
+ table.rows = sortRows(jobs, columns, e.detail);
218
+ });
219
+ tableBox!.append(table);
220
+
221
+ const view = document.createElement('cae-layered-graph');
222
+ view.key = 'pipeline-482'; // a new key is a new graph: the frame shows all of it again
223
+ view.graph = graph;
224
+ view.states = states;
225
+ view.strings = { cycle: 'next pass', badge: 'number of passes' };
226
+ graphBox!.append(view);
227
+
228
+ /** The selection: the graph shows it, the panel describes it. */
229
+ const select = (id: string | null) => {
230
+ view.selected = id;
231
+ detail.replaceChildren(describe(id));
232
+ };
233
+ view.addEventListener('cae-select', (e) => select(e.detail.id));
234
+ // A row of the table selects its job's mark in the graph.
235
+ table.addEventListener('cae-activate', (e) => select(markId(jobs.find((j) => j.id === e.detail.id)!)));
236
+
237
+ host.replaceChildren(page);
238
+ }
239
+
240
+ /** The panel's content for a mark, a node or the loop. */
241
+ function describe(id: string | null): Node {
242
+ const runs = jobs.filter((j) => markId(j) === id);
243
+ const step = steps.find((s) => s.id === id);
244
+ let title = 'No selection';
245
+ let rows: [string, string][] = [];
246
+ if (runs.length) {
247
+ const last = runs[runs.length - 1]!;
248
+ title = jobName(last);
249
+ rows = [['State', last.state], ['Passes', String(runs.length)], ...runs.map((j): [string, string] => [`Pass ${j.pass}`, `${j.state} | ${fmtDur(j.seconds)} | ${j.runner}`])];
250
+ } else if (step) {
251
+ const own = jobs.filter((j) => j.step === step.id);
252
+ title = step.label;
253
+ rows = [['Jobs', String(own.length)], ['Failed', String(own.filter((j) => j.state === 'failed').length)], ['Time', fmtDur(own.reduce((t, j) => t + j.seconds, 0))]];
254
+ } else if (id === 'retry') {
255
+ title = 'retry loop';
256
+ rows = [['Passes', `${passes} of up to 3`], ['Rerun', jobs.filter((j) => j.pass > 1 && j.shard).map(jobName).join(', ')]];
257
+ }
258
+ const box = document.createElement('div');
259
+ const h = document.createElement('strong');
260
+ h.textContent = title;
261
+ const dl = document.createElement('dl');
262
+ for (const [k, v] of rows) {
263
+ const dt = document.createElement('dt');
264
+ const dd = document.createElement('dd');
265
+ dt.textContent = k;
266
+ dd.textContent = v;
267
+ dl.append(dt, dd);
268
+ }
269
+ box.append(h, dl);
270
+ return box;
271
+ }
@@ -0,0 +1,39 @@
1
+ // A data table: hand-written rows, one sortable column, a row's action. The
2
+ // host holds the rows and the order, and answers the events.
3
+ import '@contraagent/elements/data-table/define';
4
+ import { sortRows, type CaeDataTable, type DataColumn } from '@contraagent/elements/data-table';
5
+ import { pill } from '@contraagent/elements';
6
+
7
+ interface Job {
8
+ id: string;
9
+ name: string;
10
+ minutes: number;
11
+ state: 'done' | 'failed' | 'running';
12
+ }
13
+
14
+ const jobs: Job[] = [
15
+ { id: 'j1', name: 'Build', minutes: 4, state: 'done' },
16
+ { id: 'j2', name: 'Unit tests', minutes: 11, state: 'failed' },
17
+ { id: 'j3', name: 'Deploy preview', minutes: 2, state: 'running' },
18
+ ];
19
+
20
+ const columns: DataColumn<Job>[] = [
21
+ { id: 'name', header: 'Job', rowHeader: true, cell: (j) => j.name },
22
+ { id: 'minutes', header: 'Minutes', align: 'end', width: '96px', cell: (j) => j.minutes, compare: (a, b) => a.minutes - b.minutes },
23
+ { id: 'state', header: 'State', width: '120px', cell: (j) => pill({ text: j.state, tone: j.state }) },
24
+ ];
25
+
26
+ export function mount(host: HTMLElement): void {
27
+ const table = document.createElement('cae-data-table') as CaeDataTable<Job>;
28
+ table.caption = 'Jobs';
29
+ table.columns = columns;
30
+ table.rowKey = (j) => j.id;
31
+ table.rows = jobs;
32
+ table.addEventListener('cae-sort', (e) => {
33
+ table.sort = e.detail;
34
+ table.rows = sortRows(jobs, columns, e.detail);
35
+ });
36
+ const shown = document.createElement('p');
37
+ table.addEventListener('cae-activate', (e) => (shown.textContent = `Opened: ${e.detail.id}`));
38
+ host.replaceChildren(table, shown);
39
+ }
@@ -0,0 +1,57 @@
1
+ // A layered graph: a hand-written build pipeline of three steps, the last two in a
2
+ // cluster that repeats (a retry loop), one mark per service in each step. The host
3
+ // keeps the selection and the order, and answers the events.
4
+ import '@contraagent/elements/graph/define';
5
+ import type { GraphInput, GraphMark, GraphNodeInput } from '@contraagent/elements/graph';
6
+ import type { StateStyles } from '@contraagent/elements/primitives';
7
+
8
+ const states: StateStyles = {
9
+ ok: { label: 'ok', tone: 'done', shape: 'round', rank: 0 },
10
+ busy: { label: 'busy', tone: 'running', shape: 'round', rank: 2 },
11
+ broken: { label: 'broken', tone: 'failed', shape: 'square', rank: 3 },
12
+ queued: { label: 'queued', tone: 'neutral', shape: 'ring', rank: 1 },
13
+ };
14
+
15
+ const services = ['api', 'web', 'worker'];
16
+
17
+ /** One mark per service: its id is unique in the graph, so it is what the graph selects. */
18
+ const marks = (step: string, looks: string[]): GraphMark[] =>
19
+ services.map((s, i) => ({ id: `${step}#${s}`, state: looks[i] ?? 'queued', label: `${step} · ${s} | ${looks[i] ?? 'queued'}`, tip: `${step} · ${s}` }));
20
+
21
+ /** A step: its counts and its header's count ("2/3") come from its marks. */
22
+ const node = (id: string, label: string, looks: string[], cluster: string | null): GraphNodeInput => ({ id, label, cluster, marks: marks(id, looks) });
23
+
24
+ const graph: GraphInput = {
25
+ series: services,
26
+ nodes: [
27
+ node('build', 'build', ['ok', 'ok', 'ok'], null),
28
+ node('test', 'test', ['ok', 'broken', 'ok'], 'retry'),
29
+ node('deploy', 'deploy', ['busy', 'queued', 'ok'], 'retry'),
30
+ ],
31
+ clusters: [{ id: 'retry', parent: null, label: 'retry', note: 'up to 3 rounds', cycle: true }],
32
+ edges: [
33
+ { from: 'build', to: 'test', style: 'solid', weight: 3, ranks: true },
34
+ { from: 'test', to: 'deploy', style: 'solid', weight: 3, ranks: true },
35
+ // The next round: back from deploy to test; it does not set the layers.
36
+ { from: 'deploy', to: 'test', style: 'solid', weight: 1, ranks: false },
37
+ ],
38
+ stubs: [{ id: 'commit', label: 'commit', to: 'build', style: 'solid', weight: 1 }],
39
+ };
40
+
41
+ export function mount(host: HTMLElement): void {
42
+ const el = document.createElement('cae-layered-graph');
43
+ el.graph = graph;
44
+ el.states = states;
45
+ el.key = 'pipeline';
46
+ el.strings = { cycle: 'next round' };
47
+ const card = document.createElement('div');
48
+ card.slot = 'inspector';
49
+ el.append(card);
50
+ const shown = document.createElement('p');
51
+ el.addEventListener('cae-select', (e) => {
52
+ el.selected = e.detail.id;
53
+ card.innerHTML = e.detail.id ? `<h4>${e.detail.id}</h4>` : '';
54
+ });
55
+ el.addEventListener('cae-activate', (e) => (shown.textContent = `Opened: ${e.detail.id}`));
56
+ host.replaceChildren(el, shown);
57
+ }
@@ -0,0 +1,40 @@
1
+ // Lanes: hand-written jobs on a time axis, a lane per stage, one job running.
2
+ // The host names the looks of the bars; their labels are the legend.
3
+ import '@contraagent/elements/lanes/define';
4
+ import type { Lane, LaneStyle } from '@contraagent/elements/lanes';
5
+
6
+ const barStyles: Record<string, LaneStyle> = {
7
+ passed: { label: 'passed', color: 'var(--ca-status-done)' },
8
+ failed: { label: 'failed', color: 'var(--ca-status-failed)', pattern: 'hatched' },
9
+ running: { label: 'running', color: 'var(--ca-status-running)', pattern: 'striped' },
10
+ };
11
+
12
+ export function mount(host: HTMLElement): void {
13
+ const now = Date.now();
14
+ const min = 60e3;
15
+ const lanes: Lane[] = [
16
+ {
17
+ id: 'build',
18
+ label: 'Build',
19
+ bars: [
20
+ { id: 'b1', start: now - 9 * min, end: now - 6 * min, style: 'failed', label: 'Build #1\nfailed' },
21
+ { id: 'b2', start: now - 6 * min, end: now - 3 * min, style: 'passed', label: 'Build #2\npassed' },
22
+ ],
23
+ },
24
+ {
25
+ id: 'test',
26
+ label: 'Test',
27
+ bars: [
28
+ { id: 't1', start: now - 3 * min, end: null, style: 'running', label: 'Unit tests\nrunning' },
29
+ { id: 't2', start: now - 2.5 * min, end: now - 1 * min, style: 'passed', label: 'Lint\npassed' },
30
+ ],
31
+ },
32
+ ];
33
+ const el = document.createElement('cae-lanes');
34
+ el.lanes = lanes;
35
+ el.barStyles = barStyles;
36
+ el.live = true;
37
+ el.omitted = 3;
38
+ el.strings = { omitted: (n) => `${n} older jobs not shown` };
39
+ host.replaceChildren(el);
40
+ }