@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
@@ -0,0 +1,56 @@
1
+ // A mark matrix: a hand-written week of nightly checks, a row per service, a column
2
+ // per check under a group per night. The host sorts the rows and keeps the selection.
3
+ import '@contraagent/elements/matrix/define';
4
+ import type { MarkMatrixInput, MatrixRowInput } from '@contraagent/elements/matrix';
5
+ import type { StateStyles } from '@contraagent/elements/primitives';
6
+
7
+ const states: StateStyles = {
8
+ pass: { label: 'pass', tone: 'done', shape: 'round', rank: 0 },
9
+ fail: { label: 'fail', tone: 'failed', shape: 'square', rank: 2 },
10
+ skip: { label: 'skip', tone: 'muted', shape: 'round', rank: 1 },
11
+ };
12
+
13
+ const nights = ['Mon', 'Tue'];
14
+ const checks = ['lint', 'unit'];
15
+ const results: Record<string, string[]> = { api: ['pass', 'pass', 'pass', 'fail'], web: ['pass', 'skip', 'pass', 'pass'], worker: ['fail', 'fail', 'pass', 'pass'] };
16
+
17
+ const rows: MatrixRowInput[] = Object.entries(results).map(([service, rs]) => ({
18
+ id: service,
19
+ label: service,
20
+ value: rs.filter((r) => r === 'fail').length,
21
+ strong: rs.includes('fail'),
22
+ cells: rs.map((state, i) => {
23
+ const at = `${nights[Math.floor(i / 2)]} ${checks[i % 2]}`;
24
+ return { id: `${service}|${i}`, state, label: `${service} | ${at} | ${state}`, tip: `${service}, ${at}` };
25
+ }),
26
+ }));
27
+
28
+ const byFailures = (rs: readonly MatrixRowInput[]) => [...rs].sort((a, b) => Number(b.value) - Number(a.value));
29
+
30
+ const matrix = (sort: string): MarkMatrixInput => ({
31
+ caption: 'Nightly checks',
32
+ label: 'Nightly checks by service',
33
+ facts: ['2 nights', '3 services'],
34
+ head: [
35
+ nights.map((n) => ({ id: n, label: n, span: 2, rows: 1, type: 'group' as const })),
36
+ nights.flatMap((n) => checks.map((c) => ({ id: `${n}|${c}`, label: c, span: 1, rows: 1, type: 'column' as const }))),
37
+ ],
38
+ columns: nights.flatMap((n) => checks.map((c) => ({ id: `${n}|${c}`, groups: [n] }))),
39
+ rows: sort === 'failures' ? byFailures(rows) : rows,
40
+ value: { label: 'Failures' },
41
+ sorts: [
42
+ { id: 'name', label: 'Name' },
43
+ { id: 'failures', label: 'Failures' },
44
+ ],
45
+ sort,
46
+ });
47
+
48
+ export function mount(host: HTMLElement): void {
49
+ const el = document.createElement('cae-mark-matrix');
50
+ el.matrix = matrix('name');
51
+ el.states = states;
52
+ el.strings = { rowsHeader: 'Service' };
53
+ el.addEventListener('cae-sort', (e) => (el.matrix = matrix(e.detail.id)));
54
+ el.addEventListener('cae-select', (e) => (el.selected = e.detail.id));
55
+ host.replaceChildren(el);
56
+ }
@@ -0,0 +1,34 @@
1
+ /* A page of your own in its elements' theme. With <html data-ca-theme="nord">
2
+ and the themes' rules in the document (adoptThemes(document)), the page's own
3
+ CSS reads the same --ca-* properties as the elements. */
4
+ body {
5
+ margin: 0;
6
+ color-scheme: var(--ca-color-scheme);
7
+ background: var(--ca-bg);
8
+ color: var(--ca-text);
9
+ font: 13px/1.5 system-ui, sans-serif;
10
+ }
11
+ .card {
12
+ background: var(--ca-card);
13
+ border: 1px solid var(--ca-line);
14
+ border-radius: 8px;
15
+ padding: 16px;
16
+ }
17
+ .caption {
18
+ color: var(--ca-text-secondary);
19
+ }
20
+ .unit {
21
+ color: var(--ca-text-muted);
22
+ }
23
+ a {
24
+ color: var(--ca-accent);
25
+ }
26
+ :focus-visible {
27
+ outline: var(--ca-focus-width) solid var(--ca-focus);
28
+ }
29
+ /* A property with one default for every theme (a tint, a type size) has its
30
+ value only inside the elements: compute it the way the elements do. */
31
+ .failed-badge {
32
+ color: var(--ca-status-failed);
33
+ background: color-mix(in srgb, var(--ca-status-failed) var(--ca-tint), transparent);
34
+ }
@@ -0,0 +1,18 @@
1
+ // A segmented control: one choice among a few. The host holds the value and
2
+ // answers `cae-change`; the words are the host's.
3
+ import '@contraagent/elements/segmented/define';
4
+
5
+ export function mount(host: HTMLElement): void {
6
+ const control = document.createElement('cae-segmented');
7
+ control.label = 'Period';
8
+ control.options = [
9
+ { value: 'day', label: 'Day' },
10
+ { value: 'week', label: 'Week' },
11
+ { value: 'month', label: 'Month', title: 'The last 30 days' },
12
+ ];
13
+ control.value = 'week';
14
+ const shown = document.createElement('p');
15
+ shown.textContent = `Showing: ${control.value}`;
16
+ control.addEventListener('cae-change', (e) => (shown.textContent = `Showing: ${e.detail.value}`));
17
+ host.replaceChildren(control, shown);
18
+ }
@@ -0,0 +1,30 @@
1
+ // Statuses, a legend and a row of facts, drawn by the primitives into an element
2
+ // of your own: its styles start from `base` (the tokens and the status rules),
3
+ // plus `legendStyles` for the legend.
4
+ import { base, factLine, legend, legendStyles, pill, statusWord } from '@contraagent/elements';
5
+ import { LitElement, html } from 'lit';
6
+
7
+ class BuildSummary extends LitElement {
8
+ static override styles = [base, legendStyles];
9
+
10
+ override render() {
11
+ return html`<p>
12
+ ${pill({ text: 'passed', tone: 'done' })} ${pill({ text: 'failed', tone: 'failed', title: 'exit code 2' })}
13
+ ${pill({ text: 'running', tone: 'running' })} ${statusWord({ text: 'queued', tone: 'attention' })}
14
+ </p>
15
+ <p class="meta words">${factLine(['12 jobs', { text: '1 failed', tone: 'failed' }, '4m 05s'])}</p>
16
+ ${legend(
17
+ [
18
+ { label: 'passed', tone: 'done', shape: 'round' },
19
+ { label: 'failed', tone: 'failed', shape: 'square' },
20
+ { label: 'queued', tone: 'attention', shape: 'ring' },
21
+ ],
22
+ { label: 'Job states' },
23
+ )}`;
24
+ }
25
+ }
26
+
27
+ export function mount(host: HTMLElement): void {
28
+ if (!customElements.get('build-summary')) customElements.define('build-summary', BuildSummary);
29
+ host.replaceChildren(document.createElement('build-summary'));
30
+ }
@@ -0,0 +1,54 @@
1
+ /* A theme of your own: Solarized Light (https://ethanschoonover.com/solarized/,
2
+ MIT, (c) Ethan Schoonover), built the way the built-in themes are.
3
+ Every colour is a --ca-* property, inherited through the elements' shadow
4
+ roots; one set here overrides the built-in theme's value, token by token.
5
+
6
+ Surfaces and text come from the palette's base tones, the accent is its blue,
7
+ the statuses its red, yellow, green and cyan, the code colours its syntax
8
+ colours. Solarized's accents are mid-tones: where one reads under 4.5:1 on
9
+ these surfaces, it is darkened in lightness only, with its hue kept. */
10
+ .solarized-light {
11
+ --ca-color-scheme: light;
12
+ /* surfaces and text: base3, base2 and base02 to base01 */
13
+ --ca-backdrop: #eee8d5;
14
+ --ca-bg: #eee8d5;
15
+ --ca-card: #fdf6e3;
16
+ --ca-panel: #fdf6e3;
17
+ --ca-panel2: #fdf6e3;
18
+ --ca-raise: #eee8d5;
19
+ --ca-well: #f5efdc;
20
+ --ca-track: #e4ddc8;
21
+ --ca-line: #e4ddc8;
22
+ --ca-line2: #93a1a1;
23
+ --ca-shadow: #586e7533;
24
+ --ca-text: #073642;
25
+ --ca-text-secondary: #365059;
26
+ --ca-text-muted: #4b6068;
27
+ /* interaction: blue */
28
+ --ca-accent: #02629b;
29
+ --ca-focus: #268bd2;
30
+ --ca-selection: #268bd233;
31
+ /* status: red, yellow, green, cyan, base01 */
32
+ --ca-status-failed: #bd0112;
33
+ --ca-status-attention: #7a5b01;
34
+ --ca-status-done: #586604;
35
+ --ca-status-running: #046b64;
36
+ --ca-status-muted: #4e646c;
37
+ --ca-tint: 10%;
38
+ /* identity: violet, and the token bars */
39
+ --ca-agent: #5a5eaf;
40
+ --ca-meter: #93a1a1;
41
+ --ca-tok-input: #268bd2;
42
+ --ca-tok-cache-read: #e4ddc8;
43
+ --ca-tok-cache-write: #93a1a1;
44
+ --ca-tok-output: #6c71c4;
45
+ /* code */
46
+ --ca-code-keyword: #657402;
47
+ --ca-code-string: #077a73;
48
+ --ca-code-number: #c82979;
49
+ --ca-code-constant: #c14204;
50
+ --ca-code-comment: #626f6f;
51
+ --ca-code-function: #0071b3;
52
+ --ca-code-type: #896705;
53
+ --ca-code-name: #0071b3;
54
+ }
@@ -0,0 +1,27 @@
1
+ // Stat tiles: hand-written figures, one with a tone and a link. The host holds
2
+ // the figures and answers `cae-action`.
3
+ import '@contraagent/elements/tiles/define';
4
+ import type { StatTile } from '@contraagent/elements/tiles';
5
+
6
+ const tiles: StatTile[] = [
7
+ { id: 'jobs', label: 'Jobs', value: 24, sub: [[{ text: '22 passed' }, { text: '2 failed', tone: 'failed' }]] },
8
+ {
9
+ id: 'failed',
10
+ label: 'Failed jobs',
11
+ value: 2,
12
+ tone: 'failed',
13
+ sub: [['Unit tests', 'Lint']],
14
+ action: { id: 'list', label: 'Failed jobs in the log' },
15
+ },
16
+ { id: 'time', label: 'Build time', value: '14m 05s', sub: [['Longest: Unit tests']], tip: 'Sum over all jobs' },
17
+ { id: 'queued', label: 'Queued', value: 0, sub: [['No jobs waiting']] },
18
+ ];
19
+
20
+ export function mount(host: HTMLElement): void {
21
+ const grid = document.createElement('cae-stat-tiles');
22
+ grid.columns = 4;
23
+ grid.tiles = tiles;
24
+ const shown = document.createElement('p');
25
+ grid.addEventListener('cae-action', (e) => (shown.textContent = `Action: ${e.detail.action} of ${e.detail.id}`));
26
+ host.replaceChildren(grid, shown);
27
+ }
@@ -0,0 +1,59 @@
1
+ // A conversation with a support bot in two sessions: the first ended with a
2
+ // failed lookup, the second answered. The host holds the sections and decides
3
+ // what a reader's pick means: here the picked session is simply shown.
4
+ import '@contraagent/elements/transcript/define';
5
+ import { md } from '@contraagent/elements/markdown';
6
+ import type { TranscriptSection } from '@contraagent/elements/transcript';
7
+
8
+ const sections: TranscriptSection[] = [
9
+ {
10
+ id: 's1',
11
+ title: 'Session 1',
12
+ verdict: { tone: 'failed', text: 'failed', tip: 'The order service did not answer' },
13
+ tags: [
14
+ { label: 'bot', value: 'helpdesk' },
15
+ { label: 'model', value: 'small-2', look: 'mono' },
16
+ ],
17
+ items: [
18
+ { type: 'prompt', id: 'p1', text: 'Where is order 1042?' },
19
+ { type: 'reasoning', id: 'r1', text: 'Look the order up first, then answer with its **status**.' },
20
+ { type: 'tool', id: 't1', name: 'orders.get', icon: 'read', summary: 'order 1042', output: 'timeout after 30s', status: 'error' },
21
+ ],
22
+ footer: { tone: 'failed', title: 'The order service did not answer' },
23
+ },
24
+ {
25
+ id: 's2',
26
+ title: 'Session 2',
27
+ facts: ['small-2'],
28
+ verdict: { tone: 'done', text: 'answered' },
29
+ items: [
30
+ { type: 'event', id: 'e1', icon: '↻', title: 'Request sent again', text: 'after a timeout' },
31
+ {
32
+ type: 'tool',
33
+ id: 't2',
34
+ name: 'web_search',
35
+ icon: 'search',
36
+ summary: 'carrier tracking 1042',
37
+ query: 'carrier tracking 1042',
38
+ links: [
39
+ { title: 'Track a parcel', url: 'https://example.com/track' },
40
+ { title: 'Delivery times', url: 'https://example.org/delivery' },
41
+ ],
42
+ output: 'Track a parcel https://example.com/track\nDelivery times https://example.org/delivery',
43
+ status: 'ok',
44
+ },
45
+ { type: 'notice', id: 'n1', text: 'cache hit: orders/1042' },
46
+ { type: 'message', id: 'm1', text: 'Order **1042** left the warehouse on Monday and arrives on *Thursday*.' },
47
+ ],
48
+ },
49
+ ];
50
+
51
+ export function mount(host: HTMLElement): void {
52
+ const t = document.createElement('cae-transcript');
53
+ t.sections = sections;
54
+ t.markdown = md;
55
+ t.strings = { sections: 'Sessions', sectionsTip: 'One session per conversation with the bot' };
56
+ t.style.height = '420px';
57
+ t.addEventListener('cae-section-change', (e) => (t.shown = e.detail.index));
58
+ host.replaceChildren(t);
59
+ }
package/docs/graph.md ADDED
@@ -0,0 +1,112 @@
1
+ # Layered graph
2
+
3
+ `<cae-layered-graph>` draws nodes in layers, joined by edges, inside clusters: a
4
+ pipeline, a build, any flow of steps. Each node holds a group of marks, one per
5
+ series id, at the same place in every node, so one series can be followed across
6
+ the graph. Register it with `@contraagent/elements/graph/define` (it registers
7
+ `<cae-mark-matrix>` and `<cae-segmented>` too); the types, `arrange` and
8
+ `layoutGraph` are in `@contraagent/elements/graph`.
9
+
10
+ ![A layered graph: commit, then build, then a retry loop of test and deploy, a mark per series in each node, and the legend](images/graph.webp)
11
+
12
+ <!-- not on the site -->
13
+ Live on this topic's page of the documentation site (`pnpm run docs` in `web/`).
14
+
15
+ ::code{file="examples/graph.ts"}
16
+
17
+ ## The model
18
+
19
+ A `GraphInput` names the series, the nodes, the clusters, the edges and the stubs
20
+ (edges from outside the graph). A state is any id: `states` (`StateStyles`) gives
21
+ each its word, its tone and its shape, and its key order is the legend's.
22
+
23
+ A mark is in a series when the same item has a mark in several nodes: a service
24
+ built, tested and deployed is a series, and its marks line up across the steps.
25
+ A mark of one node only (a job of one CI step) is in that node's `loose`.
26
+
27
+ A node's `counts` (the bar of a node with many marks) and `progress` (the count
28
+ in its header, "2/3") default to what its marks say: its marks by state, and its
29
+ marks whose state has the tone `done` of all its marks, in the words of
30
+ `strings.progress`. Give them when a node stands for more items than it has marks.
31
+
32
+ ::code{file="../src/graph/types.ts" from="export interface GraphNodeInput {" to="/** A node as the graph draws it"}
33
+
34
+ A cluster is a box of nodes (and of other clusters). A cluster that `cycle`s draws
35
+ a return from its last layer to its first; an edge with `ranks: false` closes that
36
+ cycle: it never sets the layers and is not drawn. An edge may join items in
37
+ different clusters, at any depth: it leaves and enters each box on its way.
38
+
39
+ An item the host can draw open or closed carries `toggle`: a node with `toggle:
40
+ 'closed'` draws a control in its header (`strings.open`, "Show inside") and a
41
+ cluster with `toggle: 'open'` one in its corner (`strings.close`); either sends
42
+ `cae-toggle` with the item's id and whether it is to be open, and the host draws
43
+ the graph again. A cluster named by a `path` of parts shows them as "a › b › c":
44
+ the first part is its name, and each later part sends `cae-drill` with that part's
45
+ id. `focusToggle(id)` puts the focus on an item's control once it is drawn again.
46
+
47
+ `key` is the graph's identity. A new `key` is a new graph: the frame shows all of
48
+ it again, and the focused mark of each node is forgotten. Keep the `key` while the
49
+ same graph changes (a run in progress), so the reader's zoom and pan stay.
50
+
51
+ ## Order and drawing
52
+
53
+ `arrange` gives each item its layer by the longest path to it, orders each layer to
54
+ reduce crossings, and gives each edge its edge path: a point on every layer it crosses.
55
+ The order depends on the structure only. Give the element the `order` of an earlier
56
+ drawing of the same graph to keep its items in place: an item that appears later is
57
+ added at the end of its layer. `layoutGraph` places everything from the measured
58
+ sizes; the element measures its nodes itself. Below 640 px of width, `direction:
59
+ 'auto'` draws top to bottom. `extentOf(arrangement)` gives a drawing's shape before
60
+ it is measured: the layers it spans along the flow and the items it stacks across
61
+ it at most, a cluster counted as what it holds; a host can choose the direction,
62
+ or how much to draw, from it.
63
+
64
+ ## Size
65
+
66
+ The element is as wide as its container. Without a height, the frame is as tall
67
+ as the whole drawing at that width (never scaled up), up to 70% of the window's
68
+ height or 360 px, whichever is more; top to bottom, as tall as the drawing. With a
69
+ height set on the element (or given by a flex or grid container), the `crumbs`
70
+ slot and the row under the frame keep their height, and the frame takes the rest,
71
+ with the whole drawing fitted and centred in it.
72
+
73
+ ## Selection and events
74
+
75
+ A click selects a mark, a node or a cluster and sends `cae-select`; the element
76
+ does not select by itself: the host sets `selected`. Enter or a double click sends
77
+ `cae-activate`, or `cae-drill` for an item with `drill` (an inner view). "Graph |
78
+ Table" sends `cae-view-change`: the table is a row per node with the nodes it is
79
+ joined to. With `matrix`, the frame shows a [mark matrix](matrix.md) as the table.
80
+
81
+ The card of the selected item is the host's content in the `inspector` slot,
82
+ beside the item in the frame; its first heading and its `[data-status]` element
83
+ name the item to a screen reader. With nothing in the slot when the element
84
+ draws (a new `selected` draws it), there is no card: a page that shows the
85
+ selection elsewhere leaves the slot empty.
86
+
87
+ Hovering, focusing or selecting a mark highlights its series; `related` names more
88
+ marks to light (a mark's id, or a series id, to the ids of the marks it lights).
89
+
90
+ The line under the legend holds the key hints. It keeps its height at all times,
91
+ and shows its words while the graph has the focus. On a screen with touch alone
92
+ (no fine pointer) there is no line; `::part(keys) { display: none; }` removes it
93
+ everywhere.
94
+
95
+ ## Look
96
+
97
+ The words are `strings` ([Strings](strings.md)). `renderIcon` draws the icons a
98
+ node names (`icons`), and `iconStyles` adds styles for them. A mark has the state's
99
+ look as `data-tone` and `data-shape`. The parts, for `::part()`:
100
+
101
+ | Part | What it is |
102
+ |---|---|
103
+ | `frame` | the frame every view is drawn in |
104
+ | `stage` | what pans and zooms |
105
+ | `node`, `node-header`, `node-name` | each node, its first line, its name |
106
+ | `mark` | each mark |
107
+ | `cluster`, `cluster-label` | each cluster, its header |
108
+ | `edge`, `stub` | each edge, each stub |
109
+ | `legend` | the legend |
110
+ | `keys` | the line of key hints |
111
+ | `inspector` | the selected item's card |
112
+ | `table`, `row` | the node table, each of its rows |
package/docs/lanes.md ADDED
@@ -0,0 +1,48 @@
1
+ # Lanes
2
+
3
+ `<cae-lanes>` shows bars on a time axis, a lane per group: each bar as long as
4
+ the thing it stands for took. Register it with
5
+ `@contraagent/elements/lanes/define`; the types and the placement functions are
6
+ in `@contraagent/elements/lanes`.
7
+
8
+ ![Lanes on a time axis: a build that failed then passed, a test still running, and a line at now](images/lanes.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/lanes.ts"}
14
+
15
+ ## Lanes and bars
16
+
17
+ A lane is a `Lane`, a bar a `LaneBar`: a start and an end in epoch
18
+ milliseconds, the key of its look and its tooltip. A bar with no end is
19
+ running: it grows until now, and a line marks now. Set `live` while a bar runs,
20
+ so the element draws again every second.
21
+
22
+ ::code{file="../src/lanes/types.ts" from="/** Something that took time" to="/** A row of bars"}
23
+
24
+ The overlapping bars of a lane are stacked, each on the first row whose last
25
+ bar has ended (`stack`), so no bar hides another. The bars grow in when they
26
+ are first drawn.
27
+
28
+ ## Looks and the legend
29
+
30
+ `barStyles` maps each key to a `LaneStyle`: a label, a colour, and a pattern
31
+ (`solid`, `hatched`, `striped`, which moves on a bar, or `outline`). Give a
32
+ status a pattern besides its colour, so it does not depend on colour alone. The
33
+ labels are the legend, a row per `group`, in key order; `omitted` adds a note
34
+ of the bars the host left out (`strings.omitted`).
35
+
36
+ ## The axis
37
+
38
+ By default the axis fits the bars (`fitRange`): from the first start to the
39
+ last end; with a running bar, to now plus 20 seconds, rounded up to the minute.
40
+ Set `range` to fix it. The axis shows five times, with seconds when it spans
41
+ less than 10 minutes, in `locale` (by default the page's `lang`).
42
+
43
+ ## Look
44
+
45
+ `--cae-lanes-label-width` sets the width of the lanes' labels (112px, 78px when
46
+ the element is narrower than 760 px). The parts are `axis`, `lane`, `lane-label`, `track`, `bar`,
47
+ `now`, `legend` and `empty`; with no bars the element shows `strings.empty`, or
48
+ the `empty` slot.
package/docs/matrix.md ADDED
@@ -0,0 +1,34 @@
1
+ # Mark matrix
2
+
3
+ `<cae-mark-matrix>` shows marks in a table: a row per series (its label, then a
4
+ value), a column per item, the columns under nested groups. Register it with
5
+ `@contraagent/elements/matrix/define`; the types are in
6
+ `@contraagent/elements/matrix`.
7
+
8
+ ![A mark matrix of nightly checks: a row per service with its failures, a column per check under each night](images/matrix.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/matrix.ts"}
14
+
15
+ ## The model
16
+
17
+ A `MarkMatrixInput` holds the header rows (outermost first), the columns, the rows
18
+ and the line above the table. A column names the groups it is under: a border marks
19
+ where a group starts. A mark is drawn in its state's look (`states`, as in the
20
+ [layered graph](graph.md)).
21
+
22
+ ::code{file="../src/matrix/types.ts" from="export interface MatrixRowInput {" to="export interface MarkMatrixStrings {"}
23
+
24
+ ## Keyboard and events
25
+
26
+ The marks are one tab stop. The arrow keys, Home, End, Page Up and Page Down move
27
+ between them (Ctrl with Home and End: the first and the last row). A click or the
28
+ focus sends `cae-select`; Enter or a double click sends `cae-activate`, or
29
+ `cae-drill` for a mark with `drill`. The sort control sends `cae-sort`: the host
30
+ sorts the rows and sets `sort`. Above `windowAt` rows (150), only the rows in view
31
+ are drawn.
32
+
33
+ The words are `strings` ([Strings](strings.md)): the sort control's label and the
34
+ header of the rows' labels.
package/docs/page.md ADDED
@@ -0,0 +1,87 @@
1
+ # Building a page
2
+
3
+ A page made of several elements: one run of a made-up CI pipeline, with a theme
4
+ switch, stat tiles, a sortable table of jobs, and a layered graph of the steps
5
+ beside a detail panel of the page's own. The whole example is
6
+ `docs/examples/ci-pipeline.ts`; it uses only the package's public entry points,
7
+ and `mount(host)` builds the page in any element.
8
+
9
+ ![A CI pipeline's page in the light theme: a theme switch, stat tiles, the layered graph of its steps beside a detail panel, and a table of its jobs](images/page.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
+ ## What the page holds
15
+
16
+ The elements keep no state of their own that the page needs: each one draws
17
+ what its properties give it and sends a `cae-*` event for what the reader did.
18
+ The page holds the data, the theme, the selection and the order of the table,
19
+ and sets them back on the elements.
20
+
21
+ | The reader | The element sends | The page sets |
22
+ |---|---|---|
23
+ | picks a theme | `cae-change` from `<cae-segmented>` | `data-ca-theme` on the page's box, and the control's `value` |
24
+ | sorts a column | `cae-sort` from `<cae-data-table>` | the table's `sort`, and its `rows` in that order (`sortRows`) |
25
+ | opens a row | `cae-activate` from `<cae-data-table>` | the graph's `selected`, and the panel |
26
+ | selects a mark, a node or the loop | `cae-select` from `<cae-layered-graph>` | the graph's `selected`, and the panel |
27
+
28
+ ## Registering and theming
29
+
30
+ Each `define` entry registers its elements; `adoptThemes(document)` adds the
31
+ themes' rules once, and `data-ca-theme` on any ancestor then picks a theme
32
+ ([Theming](theming.md)).
33
+
34
+ ::code{file="examples/ci-pipeline.ts" from="import '@contraagent/elements/segmented/define'" to="// ---- The data"}
35
+
36
+ ## Widths
37
+
38
+ Each element is as wide as its container and lays itself out by its own width,
39
+ not the window's: its host is a CSS container (`container-type: inline-size`),
40
+ so the same element fits a sidebar, a column or a whole page. Its width does
41
+ not come from its content: in a flex row, give it a width or `flex: 1`. A table
42
+ wider than its element scrolls inside its own box. This page's two columns
43
+ become one below 760 px of the page's own width (`@container` in its stylesheet).
44
+
45
+ ## The data
46
+
47
+ A step is a node of the graph and a job is one run of it, or of one of its
48
+ shards. The steps `e2e` and `triage` repeat in a retry loop.
49
+
50
+ ::code{file="examples/ci-pipeline.ts" from="// ---- The data" to="// ---- What each state"}
51
+
52
+ ## States
53
+
54
+ A state is the page's own word: `StateStyles` gives each one a tone, a shape
55
+ and a rank, and the legend follows its key order.
56
+
57
+ ::code{file="examples/ci-pipeline.ts" from="// ---- What each state" to="// ---- The graph"}
58
+
59
+ ## The graph
60
+
61
+ The shards are the graph's `series`, so shard 2 is at the same place in every
62
+ node that has shards; a step that runs once has one mark in `loose`. Each mark
63
+ shows the last pass of its job, and the number of passes as its `badge`. The
64
+ loop is a cluster that `cycle`s, closed by an edge with `ranks: false`. A
65
+ node's `counts` and `progress` follow from its marks. The page puts nothing in
66
+ the graph's `inspector` slot, so the graph draws no card beside the selection:
67
+ the panel beside the graph describes it.
68
+
69
+ ::code{file="examples/ci-pipeline.ts" from="// ---- The graph" to="// ---- The table"}
70
+
71
+ ## The table and the tiles
72
+
73
+ A column with `compare` sorts by it; a column with `sortable` and no `compare`
74
+ sorts by its cell, a string or a number.
75
+
76
+ ::code{file="examples/ci-pipeline.ts" from="// ---- The table" to="// ---- The page's own styles"}
77
+
78
+ ## The page's styles
79
+
80
+ The page's own text and boxes take the theme's colours (`--ca-*`), so they
81
+ change with the switch.
82
+
83
+ ::code{file="examples/ci-pipeline.ts" from="// ---- The page's own styles" to="// ---- The page: build it"}
84
+
85
+ ## The page
86
+
87
+ ::code{file="examples/ci-pipeline.ts" from="// ---- The page: build it"}
@@ -0,0 +1,57 @@
1
+ # Primitives
2
+
3
+ The parts every element is built from, in `@contraagent/elements/primitives`.
4
+ Most are template functions that a Lit element calls in its `render()`; their
5
+ look comes from the element's styles, which start from `base`
6
+ (`@contraagent/elements/styles`: the tokens, the status rules, chips, layout
7
+ and motion).
8
+
9
+ ![Status pills (passed, failed, running, queued), a row of facts, and a legend](images/primitives.webp)
10
+
11
+ ## Tones
12
+
13
+ A tone is the status colour a value takes: `failed`, `attention`, `done`,
14
+ `running`, `muted`, or `neutral` (the text colour). The names are the token
15
+ names (`--ca-status-<tone>`, [Theming](theming.md)). An element shows a tone as
16
+ `data-tone`, and `neutral` as no attribute (`toneAttr`).
17
+
18
+ ::code{file="../src/core/tone.ts" from="/** A status colour" to="export const TONES"}
19
+
20
+ ## Statuses, legends and facts
21
+
22
+ `pill` draws a status as a pill, `statusWord` as a word in a row, and
23
+ `statusChip` in a class the element styles. Each sets `data-tone` and, where a
24
+ mark belongs, `data-mark` (✓ done, ✕ failed, ◌ pending): the mark is drawn by
25
+ CSS and hidden from screen readers, which read the word. A pill also has the
26
+ parts `pill` and `tone-<tone>`.
27
+
28
+ `legend` draws a list of entries, each a swatch (a colour, a tone and a shape,
29
+ a class, or an icon of its own) and its word; add `legendStyles` to the
30
+ element's styles. `factLine` draws a row of facts separated by ` | ` that
31
+ breaks between facts, never inside one; a fact with a tone is in its status
32
+ colour.
33
+
34
+ ::code{file="examples/status.ts"}
35
+
36
+ ## Icons
37
+
38
+ `icon(name, label)` draws a glyph, or a template registered under `name` with
39
+ `registerIcon`. Without a label it is hidden from screen readers; with one, the
40
+ label is its tooltip and what a screen reader reads.
41
+
42
+ ## The segmented control
43
+
44
+ `<cae-segmented>` is one choice among a few: a radio group, one tab stop, the
45
+ arrow keys, Home and End to choose. It sends `cae-change` with the chosen
46
+ value; the host keeps `value`.
47
+
48
+ ::code{file="examples/segmented.ts"}
49
+
50
+ ## Keyboard and long lists
51
+
52
+ `RovingFocusController` gives a group of items one tab stop and moves the
53
+ focus with the arrow keys, in a row, a column or a grid (`rovingStep` is the
54
+ rule). `windowRows` is the arithmetic for drawing only the rows of a long list
55
+ that are on screen.
56
+
57
+ ::code{file="../src/primitives/window.ts" from="/**" to="export function windowRows"}
@@ -0,0 +1,16 @@
1
+ # Strings
2
+
3
+ An element shows words: a button's name, an empty state, a count. It takes
4
+ them from its `strings` property, a partial set of its `XStrings` interface,
5
+ and uses its English default (`DEFAULT_X_STRINGS`) for each word it is not
6
+ given. A word with a number is a function of the number, so the host decides
7
+ plural forms and word order. Nothing here depends on a localization library:
8
+ the host translates.
9
+
10
+ ::code{file="../src/markdown/cae-markdown.ts" from="export interface MarkdownStrings" to="export const DEFAULT_MARKDOWN_STRINGS"}
11
+
12
+ ```ts
13
+ markdown.strings = { showRendered: 'プレビューを表示', showSource: 'ソースを表示' };
14
+ ```
15
+
16
+ `withDefaults(defaults, given)` merges the two, as each element does.