@contraagent/elements 0.0.0-stage → 0.2.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 (648) hide show
  1. package/README.md +83 -2
  2. package/custom-elements.json +5022 -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/code/code.d.ts +83 -0
  56. package/dist/code/code.d.ts.map +1 -0
  57. package/dist/code/code.js +206 -0
  58. package/dist/code/code.js.map +1 -0
  59. package/dist/code/highlight.d.ts +25 -0
  60. package/dist/code/highlight.d.ts.map +1 -0
  61. package/dist/code/highlight.js +312 -0
  62. package/dist/code/highlight.js.map +1 -0
  63. package/dist/code/index.d.ts +3 -0
  64. package/dist/code/index.d.ts.map +1 -0
  65. package/dist/code/index.js +5 -0
  66. package/dist/code/index.js.map +1 -0
  67. package/dist/core/clock.d.ts +20 -0
  68. package/dist/core/clock.d.ts.map +1 -0
  69. package/dist/core/clock.js +45 -0
  70. package/dist/core/clock.js.map +1 -0
  71. package/dist/core/define.d.ts +3 -0
  72. package/dist/core/define.d.ts.map +1 -0
  73. package/dist/core/define.js +8 -0
  74. package/dist/core/define.js.map +1 -0
  75. package/dist/core/events.d.ts +78 -0
  76. package/dist/core/events.d.ts.map +1 -0
  77. package/dist/core/events.js +8 -0
  78. package/dist/core/events.js.map +1 -0
  79. package/dist/core/format.d.ts +8 -0
  80. package/dist/core/format.d.ts.map +1 -0
  81. package/dist/core/format.js +28 -0
  82. package/dist/core/format.js.map +1 -0
  83. package/dist/core/frame.d.ts +4 -0
  84. package/dist/core/frame.d.ts.map +1 -0
  85. package/dist/core/frame.js +5 -0
  86. package/dist/core/frame.js.map +1 -0
  87. package/dist/core/strings.d.ts +3 -0
  88. package/dist/core/strings.d.ts.map +1 -0
  89. package/dist/core/strings.js +14 -0
  90. package/dist/core/strings.js.map +1 -0
  91. package/dist/core/tone.d.ts +8 -0
  92. package/dist/core/tone.d.ts.map +1 -0
  93. package/dist/core/tone.js +9 -0
  94. package/dist/core/tone.js.map +1 -0
  95. package/dist/count/count.d.ts +22 -0
  96. package/dist/count/count.d.ts.map +1 -0
  97. package/dist/count/count.js +60 -0
  98. package/dist/count/count.js.map +1 -0
  99. package/dist/count/elapsed.d.ts +18 -0
  100. package/dist/count/elapsed.d.ts.map +1 -0
  101. package/dist/count/elapsed.js +33 -0
  102. package/dist/count/elapsed.js.map +1 -0
  103. package/dist/count/index.d.ts +3 -0
  104. package/dist/count/index.d.ts.map +1 -0
  105. package/dist/count/index.js +5 -0
  106. package/dist/count/index.js.map +1 -0
  107. package/dist/define/all.d.ts +15 -0
  108. package/dist/define/all.d.ts.map +1 -0
  109. package/dist/define/all.js +16 -0
  110. package/dist/define/all.js.map +1 -0
  111. package/dist/define/charts.d.ts +8 -0
  112. package/dist/define/charts.d.ts.map +1 -0
  113. package/dist/define/charts.js +15 -0
  114. package/dist/define/charts.js.map +1 -0
  115. package/dist/define/check-table.d.ts +4 -0
  116. package/dist/define/check-table.d.ts.map +1 -0
  117. package/dist/define/check-table.js +7 -0
  118. package/dist/define/check-table.js.map +1 -0
  119. package/dist/define/code.d.ts +4 -0
  120. package/dist/define/code.d.ts.map +1 -0
  121. package/dist/define/code.js +7 -0
  122. package/dist/define/code.js.map +1 -0
  123. package/dist/define/count.d.ts +5 -0
  124. package/dist/define/count.d.ts.map +1 -0
  125. package/dist/define/count.js +9 -0
  126. package/dist/define/count.js.map +1 -0
  127. package/dist/define/data-table.d.ts +4 -0
  128. package/dist/define/data-table.d.ts.map +1 -0
  129. package/dist/define/data-table.js +7 -0
  130. package/dist/define/data-table.js.map +1 -0
  131. package/dist/define/graph.d.ts +6 -0
  132. package/dist/define/graph.d.ts.map +1 -0
  133. package/dist/define/graph.js +9 -0
  134. package/dist/define/graph.js.map +1 -0
  135. package/dist/define/json-tree.d.ts +4 -0
  136. package/dist/define/json-tree.d.ts.map +1 -0
  137. package/dist/define/json-tree.js +7 -0
  138. package/dist/define/json-tree.js.map +1 -0
  139. package/dist/define/lanes.d.ts +4 -0
  140. package/dist/define/lanes.d.ts.map +1 -0
  141. package/dist/define/lanes.js +7 -0
  142. package/dist/define/lanes.js.map +1 -0
  143. package/dist/define/markdown.d.ts +4 -0
  144. package/dist/define/markdown.d.ts.map +1 -0
  145. package/dist/define/markdown.js +7 -0
  146. package/dist/define/markdown.js.map +1 -0
  147. package/dist/define/matrix.d.ts +4 -0
  148. package/dist/define/matrix.d.ts.map +1 -0
  149. package/dist/define/matrix.js +7 -0
  150. package/dist/define/matrix.js.map +1 -0
  151. package/dist/define/segmented.d.ts +4 -0
  152. package/dist/define/segmented.d.ts.map +1 -0
  153. package/dist/define/segmented.js +7 -0
  154. package/dist/define/segmented.js.map +1 -0
  155. package/dist/define/tiles.d.ts +5 -0
  156. package/dist/define/tiles.d.ts.map +1 -0
  157. package/dist/define/tiles.js +9 -0
  158. package/dist/define/tiles.js.map +1 -0
  159. package/dist/define/transcript.d.ts +4 -0
  160. package/dist/define/transcript.d.ts.map +1 -0
  161. package/dist/define/transcript.js +7 -0
  162. package/dist/define/transcript.js.map +1 -0
  163. package/dist/define/tree.d.ts +4 -0
  164. package/dist/define/tree.d.ts.map +1 -0
  165. package/dist/define/tree.js +7 -0
  166. package/dist/define/tree.js.map +1 -0
  167. package/dist/graph/arrange.d.ts +43 -0
  168. package/dist/graph/arrange.d.ts.map +1 -0
  169. package/dist/graph/arrange.js +390 -0
  170. package/dist/graph/arrange.js.map +1 -0
  171. package/dist/graph/card.d.ts +71 -0
  172. package/dist/graph/card.d.ts.map +1 -0
  173. package/dist/graph/card.js +185 -0
  174. package/dist/graph/card.js.map +1 -0
  175. package/dist/graph/host.d.ts +82 -0
  176. package/dist/graph/host.d.ts.map +1 -0
  177. package/dist/graph/host.js +21 -0
  178. package/dist/graph/host.js.map +1 -0
  179. package/dist/graph/icons.d.ts +7 -0
  180. package/dist/graph/icons.d.ts.map +1 -0
  181. package/dist/graph/icons.js +18 -0
  182. package/dist/graph/icons.js.map +1 -0
  183. package/dist/graph/index.d.ts +15 -0
  184. package/dist/graph/index.d.ts.map +1 -0
  185. package/dist/graph/index.js +17 -0
  186. package/dist/graph/index.js.map +1 -0
  187. package/dist/graph/layered-graph.d.ts +226 -0
  188. package/dist/graph/layered-graph.d.ts.map +1 -0
  189. package/dist/graph/layered-graph.js +396 -0
  190. package/dist/graph/layered-graph.js.map +1 -0
  191. package/dist/graph/layout.d.ts +80 -0
  192. package/dist/graph/layout.d.ts.map +1 -0
  193. package/dist/graph/layout.js +264 -0
  194. package/dist/graph/layout.js.map +1 -0
  195. package/dist/graph/marks.d.ts +24 -0
  196. package/dist/graph/marks.d.ts.map +1 -0
  197. package/dist/graph/marks.js +38 -0
  198. package/dist/graph/marks.js.map +1 -0
  199. package/dist/graph/nav.d.ts +14 -0
  200. package/dist/graph/nav.d.ts.map +1 -0
  201. package/dist/graph/nav.js +14 -0
  202. package/dist/graph/nav.js.map +1 -0
  203. package/dist/graph/pan-zoom.d.ts +80 -0
  204. package/dist/graph/pan-zoom.d.ts.map +1 -0
  205. package/dist/graph/pan-zoom.js +191 -0
  206. package/dist/graph/pan-zoom.js.map +1 -0
  207. package/dist/graph/paths.d.ts +9 -0
  208. package/dist/graph/paths.d.ts.map +1 -0
  209. package/dist/graph/paths.js +44 -0
  210. package/dist/graph/paths.js.map +1 -0
  211. package/dist/graph/place-card.d.ts +36 -0
  212. package/dist/graph/place-card.d.ts.map +1 -0
  213. package/dist/graph/place-card.js +68 -0
  214. package/dist/graph/place-card.js.map +1 -0
  215. package/dist/graph/strings.d.ts +50 -0
  216. package/dist/graph/strings.d.ts.map +1 -0
  217. package/dist/graph/strings.js +37 -0
  218. package/dist/graph/strings.js.map +1 -0
  219. package/dist/graph/styles.d.ts +2 -0
  220. package/dist/graph/styles.d.ts.map +1 -0
  221. package/dist/graph/styles.js +203 -0
  222. package/dist/graph/styles.js.map +1 -0
  223. package/dist/graph/types.d.ts +184 -0
  224. package/dist/graph/types.d.ts.map +1 -0
  225. package/dist/graph/types.js +2 -0
  226. package/dist/graph/types.js.map +1 -0
  227. package/dist/graph/view.d.ts +17 -0
  228. package/dist/graph/view.d.ts.map +1 -0
  229. package/dist/graph/view.js +21 -0
  230. package/dist/graph/view.js.map +1 -0
  231. package/dist/graph/views/dag.d.ts +10 -0
  232. package/dist/graph/views/dag.d.ts.map +1 -0
  233. package/dist/graph/views/dag.js +292 -0
  234. package/dist/graph/views/dag.js.map +1 -0
  235. package/dist/graph/views/foot.d.ts +8 -0
  236. package/dist/graph/views/foot.d.ts.map +1 -0
  237. package/dist/graph/views/foot.js +103 -0
  238. package/dist/graph/views/foot.js.map +1 -0
  239. package/dist/graph/views/node-table.d.ts +17 -0
  240. package/dist/graph/views/node-table.d.ts.map +1 -0
  241. package/dist/graph/views/node-table.js +80 -0
  242. package/dist/graph/views/node-table.js.map +1 -0
  243. package/dist/index.d.ts +24 -0
  244. package/dist/index.d.ts.map +1 -0
  245. package/dist/index.js +28 -0
  246. package/dist/index.js.map +1 -0
  247. package/dist/json/index.d.ts +2 -0
  248. package/dist/json/index.d.ts.map +1 -0
  249. package/dist/json/index.js +3 -0
  250. package/dist/json/index.js.map +1 -0
  251. package/dist/json/json-tree.d.ts +21 -0
  252. package/dist/json/json-tree.d.ts.map +1 -0
  253. package/dist/json/json-tree.js +51 -0
  254. package/dist/json/json-tree.js.map +1 -0
  255. package/dist/lanes/index.d.ts +5 -0
  256. package/dist/lanes/index.d.ts.map +1 -0
  257. package/dist/lanes/index.js +7 -0
  258. package/dist/lanes/index.js.map +1 -0
  259. package/dist/lanes/lanes.d.ts +56 -0
  260. package/dist/lanes/lanes.d.ts.map +1 -0
  261. package/dist/lanes/lanes.js +160 -0
  262. package/dist/lanes/lanes.js.map +1 -0
  263. package/dist/lanes/stack.d.ts +26 -0
  264. package/dist/lanes/stack.d.ts.map +1 -0
  265. package/dist/lanes/stack.js +43 -0
  266. package/dist/lanes/stack.js.map +1 -0
  267. package/dist/lanes/styles.d.ts +2 -0
  268. package/dist/lanes/styles.d.ts.map +1 -0
  269. package/dist/lanes/styles.js +30 -0
  270. package/dist/lanes/styles.js.map +1 -0
  271. package/dist/lanes/types.d.ts +41 -0
  272. package/dist/lanes/types.d.ts.map +1 -0
  273. package/dist/lanes/types.js +6 -0
  274. package/dist/lanes/types.js.map +1 -0
  275. package/dist/markdown/cae-markdown.d.ts +37 -0
  276. package/dist/markdown/cae-markdown.d.ts.map +1 -0
  277. package/dist/markdown/cae-markdown.js +68 -0
  278. package/dist/markdown/cae-markdown.js.map +1 -0
  279. package/dist/markdown/highlight.d.ts +2 -0
  280. package/dist/markdown/highlight.d.ts.map +1 -0
  281. package/dist/markdown/highlight.js +3 -0
  282. package/dist/markdown/highlight.js.map +1 -0
  283. package/dist/markdown/index.d.ts +4 -0
  284. package/dist/markdown/index.d.ts.map +1 -0
  285. package/dist/markdown/index.js +6 -0
  286. package/dist/markdown/index.js.map +1 -0
  287. package/dist/markdown/markdown.d.ts +4 -0
  288. package/dist/markdown/markdown.d.ts.map +1 -0
  289. package/dist/markdown/markdown.js +105 -0
  290. package/dist/markdown/markdown.js.map +1 -0
  291. package/dist/matrix/grid-step.d.ts +8 -0
  292. package/dist/matrix/grid-step.d.ts.map +1 -0
  293. package/dist/matrix/grid-step.js +69 -0
  294. package/dist/matrix/grid-step.js.map +1 -0
  295. package/dist/matrix/index.d.ts +5 -0
  296. package/dist/matrix/index.d.ts.map +1 -0
  297. package/dist/matrix/index.js +7 -0
  298. package/dist/matrix/index.js.map +1 -0
  299. package/dist/matrix/mark-matrix.d.ts +97 -0
  300. package/dist/matrix/mark-matrix.d.ts.map +1 -0
  301. package/dist/matrix/mark-matrix.js +272 -0
  302. package/dist/matrix/mark-matrix.js.map +1 -0
  303. package/dist/matrix/styles.d.ts +4 -0
  304. package/dist/matrix/styles.d.ts.map +1 -0
  305. package/dist/matrix/styles.js +47 -0
  306. package/dist/matrix/styles.js.map +1 -0
  307. package/dist/matrix/types.d.ts +79 -0
  308. package/dist/matrix/types.d.ts.map +1 -0
  309. package/dist/matrix/types.js +5 -0
  310. package/dist/matrix/types.js.map +1 -0
  311. package/dist/primitives/fact-line.d.ts +14 -0
  312. package/dist/primitives/fact-line.d.ts.map +1 -0
  313. package/dist/primitives/fact-line.js +18 -0
  314. package/dist/primitives/fact-line.js.map +1 -0
  315. package/dist/primitives/icon.d.ts +14 -0
  316. package/dist/primitives/icon.d.ts.map +1 -0
  317. package/dist/primitives/icon.js +19 -0
  318. package/dist/primitives/icon.js.map +1 -0
  319. package/dist/primitives/index.d.ts +10 -0
  320. package/dist/primitives/index.d.ts.map +1 -0
  321. package/dist/primitives/index.js +13 -0
  322. package/dist/primitives/index.js.map +1 -0
  323. package/dist/primitives/legend.d.ts +28 -0
  324. package/dist/primitives/legend.d.ts.map +1 -0
  325. package/dist/primitives/legend.js +28 -0
  326. package/dist/primitives/legend.js.map +1 -0
  327. package/dist/primitives/pill.d.ts +23 -0
  328. package/dist/primitives/pill.d.ts.map +1 -0
  329. package/dist/primitives/pill.js +40 -0
  330. package/dist/primitives/pill.js.map +1 -0
  331. package/dist/primitives/roving-focus.d.ts +47 -0
  332. package/dist/primitives/roving-focus.d.ts.map +1 -0
  333. package/dist/primitives/roving-focus.js +111 -0
  334. package/dist/primitives/roving-focus.js.map +1 -0
  335. package/dist/primitives/segmented.d.ts +41 -0
  336. package/dist/primitives/segmented.d.ts.map +1 -0
  337. package/dist/primitives/segmented.js +88 -0
  338. package/dist/primitives/segmented.js.map +1 -0
  339. package/dist/primitives/share-bar.d.ts +37 -0
  340. package/dist/primitives/share-bar.d.ts.map +1 -0
  341. package/dist/primitives/share-bar.js +69 -0
  342. package/dist/primitives/share-bar.js.map +1 -0
  343. package/dist/primitives/states.d.ts +19 -0
  344. package/dist/primitives/states.d.ts.map +1 -0
  345. package/dist/primitives/states.js +11 -0
  346. package/dist/primitives/states.js.map +1 -0
  347. package/dist/primitives/window.d.ts +24 -0
  348. package/dist/primitives/window.d.ts.map +1 -0
  349. package/dist/primitives/window.js +56 -0
  350. package/dist/primitives/window.js.map +1 -0
  351. package/dist/styles/chips.d.ts +2 -0
  352. package/dist/styles/chips.d.ts.map +1 -0
  353. package/dist/styles/chips.js +18 -0
  354. package/dist/styles/chips.js.map +1 -0
  355. package/dist/styles/facts.d.ts +2 -0
  356. package/dist/styles/facts.d.ts.map +1 -0
  357. package/dist/styles/facts.js +7 -0
  358. package/dist/styles/facts.js.map +1 -0
  359. package/dist/styles/index.d.ts +16 -0
  360. package/dist/styles/index.d.ts.map +1 -0
  361. package/dist/styles/index.js +15 -0
  362. package/dist/styles/index.js.map +1 -0
  363. package/dist/styles/layout.d.ts +2 -0
  364. package/dist/styles/layout.d.ts.map +1 -0
  365. package/dist/styles/layout.js +33 -0
  366. package/dist/styles/layout.js.map +1 -0
  367. package/dist/styles/marks.d.ts +2 -0
  368. package/dist/styles/marks.d.ts.map +1 -0
  369. package/dist/styles/marks.js +30 -0
  370. package/dist/styles/marks.js.map +1 -0
  371. package/dist/styles/meter.d.ts +3 -0
  372. package/dist/styles/meter.d.ts.map +1 -0
  373. package/dist/styles/meter.js +9 -0
  374. package/dist/styles/meter.js.map +1 -0
  375. package/dist/styles/motion.d.ts +2 -0
  376. package/dist/styles/motion.d.ts.map +1 -0
  377. package/dist/styles/motion.js +27 -0
  378. package/dist/styles/motion.js.map +1 -0
  379. package/dist/styles/prose.d.ts +3 -0
  380. package/dist/styles/prose.d.ts.map +1 -0
  381. package/dist/styles/prose.js +64 -0
  382. package/dist/styles/prose.js.map +1 -0
  383. package/dist/styles/reset.d.ts +2 -0
  384. package/dist/styles/reset.d.ts.map +1 -0
  385. package/dist/styles/reset.js +13 -0
  386. package/dist/styles/reset.js.map +1 -0
  387. package/dist/styles/status.d.ts +2 -0
  388. package/dist/styles/status.d.ts.map +1 -0
  389. package/dist/styles/status.js +52 -0
  390. package/dist/styles/status.js.map +1 -0
  391. package/dist/styles/text.d.ts +2 -0
  392. package/dist/styles/text.d.ts.map +1 -0
  393. package/dist/styles/text.js +21 -0
  394. package/dist/styles/text.js.map +1 -0
  395. package/dist/styles/tokens.d.ts +8 -0
  396. package/dist/styles/tokens.d.ts.map +1 -0
  397. package/dist/styles/tokens.js +32 -0
  398. package/dist/styles/tokens.js.map +1 -0
  399. package/dist/table/data-table.d.ts +106 -0
  400. package/dist/table/data-table.d.ts.map +1 -0
  401. package/dist/table/data-table.js +408 -0
  402. package/dist/table/data-table.js.map +1 -0
  403. package/dist/table/index.d.ts +4 -0
  404. package/dist/table/index.d.ts.map +1 -0
  405. package/dist/table/index.js +6 -0
  406. package/dist/table/index.js.map +1 -0
  407. package/dist/table/styles.d.ts +2 -0
  408. package/dist/table/styles.d.ts.map +1 -0
  409. package/dist/table/styles.js +32 -0
  410. package/dist/table/styles.js.map +1 -0
  411. package/dist/table/types.d.ts +48 -0
  412. package/dist/table/types.d.ts.map +1 -0
  413. package/dist/table/types.js +30 -0
  414. package/dist/table/types.js.map +1 -0
  415. package/dist/themes/boot.d.ts +7 -0
  416. package/dist/themes/boot.d.ts.map +1 -0
  417. package/dist/themes/boot.js +14 -0
  418. package/dist/themes/boot.js.map +1 -0
  419. package/dist/themes/choice.d.ts +16 -0
  420. package/dist/themes/choice.d.ts.map +1 -0
  421. package/dist/themes/choice.js +45 -0
  422. package/dist/themes/choice.js.map +1 -0
  423. package/dist/themes/data.d.ts +43 -0
  424. package/dist/themes/data.d.ts.map +1 -0
  425. package/dist/themes/data.js +408 -0
  426. package/dist/themes/data.js.map +1 -0
  427. package/dist/themes/index.d.ts +7 -0
  428. package/dist/themes/index.d.ts.map +1 -0
  429. package/dist/themes/index.js +11 -0
  430. package/dist/themes/index.js.map +1 -0
  431. package/dist/themes/sheet.d.ts +16 -0
  432. package/dist/themes/sheet.d.ts.map +1 -0
  433. package/dist/themes/sheet.js +28 -0
  434. package/dist/themes/sheet.js.map +1 -0
  435. package/dist/themes/token-meanings.d.ts +3 -0
  436. package/dist/themes/token-meanings.d.ts.map +1 -0
  437. package/dist/themes/token-meanings.js +67 -0
  438. package/dist/themes/token-meanings.js.map +1 -0
  439. package/dist/themes/tokens-list.d.ts +14 -0
  440. package/dist/themes/tokens-list.d.ts.map +1 -0
  441. package/dist/themes/tokens-list.js +69 -0
  442. package/dist/themes/tokens-list.js.map +1 -0
  443. package/dist/tiles/index.d.ts +4 -0
  444. package/dist/tiles/index.d.ts.map +1 -0
  445. package/dist/tiles/index.js +6 -0
  446. package/dist/tiles/index.js.map +1 -0
  447. package/dist/tiles/stat-tiles.d.ts +40 -0
  448. package/dist/tiles/stat-tiles.d.ts.map +1 -0
  449. package/dist/tiles/stat-tiles.js +99 -0
  450. package/dist/tiles/stat-tiles.js.map +1 -0
  451. package/dist/tiles/styles.d.ts +2 -0
  452. package/dist/tiles/styles.d.ts.map +1 -0
  453. package/dist/tiles/styles.js +23 -0
  454. package/dist/tiles/styles.js.map +1 -0
  455. package/dist/tiles/types.d.ts +22 -0
  456. package/dist/tiles/types.d.ts.map +1 -0
  457. package/dist/tiles/types.js +2 -0
  458. package/dist/tiles/types.js.map +1 -0
  459. package/dist/transcript/follow-scroll.d.ts +21 -0
  460. package/dist/transcript/follow-scroll.d.ts.map +1 -0
  461. package/dist/transcript/follow-scroll.js +76 -0
  462. package/dist/transcript/follow-scroll.js.map +1 -0
  463. package/dist/transcript/index.d.ts +5 -0
  464. package/dist/transcript/index.d.ts.map +1 -0
  465. package/dist/transcript/index.js +7 -0
  466. package/dist/transcript/index.js.map +1 -0
  467. package/dist/transcript/styles.d.ts +2 -0
  468. package/dist/transcript/styles.d.ts.map +1 -0
  469. package/dist/transcript/styles.js +114 -0
  470. package/dist/transcript/styles.js.map +1 -0
  471. package/dist/transcript/tags.d.ts +6 -0
  472. package/dist/transcript/tags.d.ts.map +1 -0
  473. package/dist/transcript/tags.js +13 -0
  474. package/dist/transcript/tags.js.map +1 -0
  475. package/dist/transcript/tool-card.d.ts +16 -0
  476. package/dist/transcript/tool-card.d.ts.map +1 -0
  477. package/dist/transcript/tool-card.js +87 -0
  478. package/dist/transcript/tool-card.js.map +1 -0
  479. package/dist/transcript/transcript.d.ts +103 -0
  480. package/dist/transcript/transcript.d.ts.map +1 -0
  481. package/dist/transcript/transcript.js +397 -0
  482. package/dist/transcript/transcript.js.map +1 -0
  483. package/dist/transcript/types.d.ts +161 -0
  484. package/dist/transcript/types.d.ts.map +1 -0
  485. package/dist/transcript/types.js +25 -0
  486. package/dist/transcript/types.js.map +1 -0
  487. package/dist/tree/index.d.ts +2 -0
  488. package/dist/tree/index.d.ts.map +1 -0
  489. package/dist/tree/index.js +4 -0
  490. package/dist/tree/index.js.map +1 -0
  491. package/dist/tree/tree.d.ts +83 -0
  492. package/dist/tree/tree.d.ts.map +1 -0
  493. package/dist/tree/tree.js +251 -0
  494. package/dist/tree/tree.js.map +1 -0
  495. package/docs/charts.md +58 -0
  496. package/docs/check-table.md +40 -0
  497. package/docs/code.md +55 -0
  498. package/docs/data-table.md +57 -0
  499. package/docs/examples/charts.ts +61 -0
  500. package/docs/examples/check-table.ts +19 -0
  501. package/docs/examples/ci-pipeline.ts +271 -0
  502. package/docs/examples/code.ts +28 -0
  503. package/docs/examples/data-table.ts +39 -0
  504. package/docs/examples/graph.ts +57 -0
  505. package/docs/examples/lanes.ts +40 -0
  506. package/docs/examples/matrix.ts +56 -0
  507. package/docs/examples/page.css +34 -0
  508. package/docs/examples/segmented.ts +18 -0
  509. package/docs/examples/status.ts +30 -0
  510. package/docs/examples/theme.css +54 -0
  511. package/docs/examples/tiles.ts +27 -0
  512. package/docs/examples/transcript.ts +59 -0
  513. package/docs/examples/tree.ts +44 -0
  514. package/docs/graph.md +112 -0
  515. package/docs/lanes.md +48 -0
  516. package/docs/matrix.md +34 -0
  517. package/docs/page.md +87 -0
  518. package/docs/primitives.md +57 -0
  519. package/docs/strings.md +16 -0
  520. package/docs/theming.md +147 -0
  521. package/docs/tiles.md +40 -0
  522. package/docs/transcript.md +73 -0
  523. package/docs/tree.md +44 -0
  524. package/docs/tsconfig.json +20 -0
  525. package/package.json +177 -4
  526. package/src/charts/bar-chart.ts +74 -0
  527. package/src/charts/base.ts +188 -0
  528. package/src/charts/column-chart.ts +153 -0
  529. package/src/charts/heatmap.ts +129 -0
  530. package/src/charts/index.ts +10 -0
  531. package/src/charts/line-chart.ts +128 -0
  532. package/src/charts/scale.ts +61 -0
  533. package/src/charts/state-grid.ts +245 -0
  534. package/src/charts/types.ts +48 -0
  535. package/src/checks/check-table.ts +85 -0
  536. package/src/checks/index.ts +5 -0
  537. package/src/checks/styles.ts +31 -0
  538. package/src/checks/types.ts +48 -0
  539. package/src/code/code.ts +199 -0
  540. package/src/code/highlight.ts +378 -0
  541. package/src/code/index.ts +4 -0
  542. package/src/core/clock.ts +46 -0
  543. package/src/core/define.ts +7 -0
  544. package/src/core/events.ts +89 -0
  545. package/src/core/format.ts +25 -0
  546. package/src/core/frame.ts +5 -0
  547. package/src/core/strings.ts +11 -0
  548. package/src/core/tone.ts +14 -0
  549. package/src/count/count.ts +54 -0
  550. package/src/count/elapsed.ts +33 -0
  551. package/src/count/index.ts +4 -0
  552. package/src/define/all.ts +15 -0
  553. package/src/define/charts.ts +17 -0
  554. package/src/define/check-table.ts +9 -0
  555. package/src/define/code.ts +9 -0
  556. package/src/define/count.ts +11 -0
  557. package/src/define/data-table.ts +9 -0
  558. package/src/define/graph.ts +11 -0
  559. package/src/define/json-tree.ts +9 -0
  560. package/src/define/lanes.ts +9 -0
  561. package/src/define/markdown.ts +9 -0
  562. package/src/define/matrix.ts +9 -0
  563. package/src/define/segmented.ts +9 -0
  564. package/src/define/tiles.ts +11 -0
  565. package/src/define/transcript.ts +9 -0
  566. package/src/define/tree.ts +9 -0
  567. package/src/graph/arrange.ts +399 -0
  568. package/src/graph/card.ts +209 -0
  569. package/src/graph/host.ts +100 -0
  570. package/src/graph/icons.ts +23 -0
  571. package/src/graph/index.ts +16 -0
  572. package/src/graph/layered-graph.ts +417 -0
  573. package/src/graph/layout.ts +331 -0
  574. package/src/graph/marks.ts +42 -0
  575. package/src/graph/nav.ts +19 -0
  576. package/src/graph/pan-zoom.ts +219 -0
  577. package/src/graph/paths.ts +41 -0
  578. package/src/graph/place-card.ts +93 -0
  579. package/src/graph/strings.ts +86 -0
  580. package/src/graph/styles.ts +204 -0
  581. package/src/graph/types.ts +202 -0
  582. package/src/graph/view.ts +28 -0
  583. package/src/graph/views/dag.ts +294 -0
  584. package/src/graph/views/foot.ts +109 -0
  585. package/src/graph/views/node-table.ts +90 -0
  586. package/src/index.ts +27 -0
  587. package/src/json/index.ts +2 -0
  588. package/src/json/json-tree.ts +49 -0
  589. package/src/lanes/index.ts +6 -0
  590. package/src/lanes/lanes.ts +143 -0
  591. package/src/lanes/stack.ts +51 -0
  592. package/src/lanes/styles.ts +30 -0
  593. package/src/lanes/types.ts +51 -0
  594. package/src/markdown/cae-markdown.ts +64 -0
  595. package/src/markdown/highlight.ts +2 -0
  596. package/src/markdown/index.ts +5 -0
  597. package/src/markdown/markdown.ts +110 -0
  598. package/src/matrix/grid-step.ts +58 -0
  599. package/src/matrix/index.ts +6 -0
  600. package/src/matrix/mark-matrix.ts +285 -0
  601. package/src/matrix/styles.ts +48 -0
  602. package/src/matrix/types.ts +83 -0
  603. package/src/primitives/fact-line.ts +26 -0
  604. package/src/primitives/icon.ts +26 -0
  605. package/src/primitives/index.ts +12 -0
  606. package/src/primitives/legend.ts +56 -0
  607. package/src/primitives/pill.ts +58 -0
  608. package/src/primitives/roving-focus.ts +138 -0
  609. package/src/primitives/segmented.ts +92 -0
  610. package/src/primitives/share-bar.ts +94 -0
  611. package/src/primitives/states.ts +28 -0
  612. package/src/primitives/window.ts +65 -0
  613. package/src/styles/chips.ts +18 -0
  614. package/src/styles/facts.ts +7 -0
  615. package/src/styles/index.ts +19 -0
  616. package/src/styles/layout.ts +33 -0
  617. package/src/styles/marks.ts +30 -0
  618. package/src/styles/meter.ts +9 -0
  619. package/src/styles/motion.ts +27 -0
  620. package/src/styles/prose.ts +64 -0
  621. package/src/styles/reset.ts +13 -0
  622. package/src/styles/status.ts +52 -0
  623. package/src/styles/text.ts +21 -0
  624. package/src/styles/tokens.ts +35 -0
  625. package/src/table/data-table.ts +367 -0
  626. package/src/table/index.ts +5 -0
  627. package/src/table/styles.ts +32 -0
  628. package/src/table/types.ts +73 -0
  629. package/src/themes/boot.ts +14 -0
  630. package/src/themes/choice.ts +47 -0
  631. package/src/themes/data.ts +433 -0
  632. package/src/themes/index.ts +10 -0
  633. package/src/themes/sheet.ts +29 -0
  634. package/src/themes/token-meanings.ts +67 -0
  635. package/src/themes/tokens-list.ts +82 -0
  636. package/src/tiles/index.ts +5 -0
  637. package/src/tiles/stat-tiles.ts +92 -0
  638. package/src/tiles/styles.ts +23 -0
  639. package/src/tiles/types.ts +20 -0
  640. package/src/transcript/follow-scroll.ts +72 -0
  641. package/src/transcript/index.ts +6 -0
  642. package/src/transcript/styles.ts +114 -0
  643. package/src/transcript/tags.ts +18 -0
  644. package/src/transcript/tool-card.ts +103 -0
  645. package/src/transcript/transcript.ts +358 -0
  646. package/src/transcript/types.ts +167 -0
  647. package/src/tree/index.ts +3 -0
  648. package/src/tree/tree.ts +263 -0
@@ -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
+ }
@@ -0,0 +1,44 @@
1
+ // A tree of a CI pipeline's files, paired with a code element: selecting a file shows
2
+ // its text. The host holds the selection and answers `cae-select`.
3
+ import '@contraagent/elements/code/define';
4
+ import '@contraagent/elements/tree/define';
5
+ import type { TreeItem } from '@contraagent/elements/tree';
6
+
7
+ const files: Record<string, string> = {
8
+ 'ci/build.py': 'def build(target: str) -> bool:\n return run(["make", target]).returncode == 0\n',
9
+ 'ci/jobs.yaml': 'jobs:\n unit: { needs: [build] }\n lint: { needs: [] }\n',
10
+ 'ci/tests/test_build.py': 'def test_build():\n assert build("all")\n',
11
+ 'README.md': 'The CI pipeline of the project.\n',
12
+ };
13
+
14
+ const items: TreeItem[] = [
15
+ {
16
+ id: 'ci',
17
+ name: 'ci',
18
+ children: [
19
+ { id: 'ci/build.py', name: 'build.py' },
20
+ { id: 'ci/jobs.yaml', name: 'jobs.yaml', badge: 'changed', tone: 'attention' },
21
+ { id: 'ci/tests', name: 'tests', open: false, children: [{ id: 'ci/tests/test_build.py', name: 'test_build.py', badge: 'failed', tone: 'failed' }] },
22
+ ],
23
+ },
24
+ { id: 'README.md', name: 'README.md' },
25
+ ];
26
+
27
+ export function mount(host: HTMLElement): void {
28
+ const tree = document.createElement('cae-tree');
29
+ tree.items = items;
30
+ tree.label = 'Files';
31
+ const code = document.createElement('cae-code');
32
+ const show = (id: string) => {
33
+ tree.selected = id;
34
+ code.code = files[id] ?? '';
35
+ code.path = id;
36
+ code.language = id;
37
+ };
38
+ tree.addEventListener('cae-select', (e) => e.detail.id && show(e.detail.id));
39
+ show('ci/build.py');
40
+ const pair = document.createElement('div');
41
+ pair.style.cssText = 'display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; align-items: start';
42
+ pair.append(tree, code);
43
+ host.replaceChildren(pair);
44
+ }
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.
@@ -0,0 +1,147 @@
1
+ # Theming
2
+
3
+ Each element keeps its styles in its own shadow root, so your page's CSS cannot
4
+ break it and its CSS cannot leak into your page. What reaches it are the
5
+ `--ca-*` custom properties:
6
+
7
+ 1. **A built-in theme**, picked by `data-ca-theme="<name>"` on any ancestor
8
+ (or on the element), sets every colour property on that element. The
9
+ elements inside it read them, and so does your page's own CSS.
10
+ 2. **A `--ca-*` property of your own** wins over the theme when it is set on
11
+ the element that carries `data-ca-theme` or on an element inside it. A theme
12
+ of your own is a set of them.
13
+
14
+ With neither, an element shows contraagent Dark.
15
+
16
+ ![The CI pipeline's page in the contraagent Dark theme](images/theming-dark.webp)
17
+
18
+ ## The built-in themes
19
+
20
+ | `data-ca-theme` | Name | Source |
21
+ |---|---|---|
22
+ | `contraagent-dark` | contraagent Dark (the default) | this package |
23
+ | `contraagent-light` | contraagent Light | this package: the hues of contraagent Dark, set for a light page |
24
+ | `github-dark` | GitHub Dark | [GitHub Primer primitives](https://github.com/primer/primitives), dark (MIT, GitHub Inc.) |
25
+ | `github-light` | GitHub Light | Primer primitives, light (MIT, GitHub Inc.) |
26
+ | `one-dark` | One Dark | [Atom One Dark](https://github.com/atom/atom/tree/master/packages/one-dark-syntax) (MIT, GitHub Inc.) |
27
+ | `nord` | Nord | [Nord](https://www.nordtheme.com) (MIT, Arctic Ice Studio and Sven Greb) |
28
+ | `high-contrast` | High contrast | Primer primitives, dark high contrast (MIT, GitHub Inc.) |
29
+
30
+ An editor theme takes its surfaces, borders and text from the editor's own
31
+ colours, its accent from the palette's accent, the statuses from its red,
32
+ yellow, green and cyan, and the code colours from its syntax colours. Where a
33
+ palette colour reads under 4.5:1 on the theme's surfaces and tints, its lightness
34
+ is raised (or lowered, on a light theme) as little as needed and its hue kept;
35
+ `src/themes/data.ts` lists every value. High contrast keeps text at 7:1 or
36
+ more on every surface, has stronger borders and a wider focus ring, and its
37
+ status colours stay apart under protanopia, deuteranopia and tritanopia.
38
+
39
+ ## Choosing a theme
40
+
41
+ Set `data-ca-theme` on any ancestor. The rules that apply it are a stylesheet
42
+ that a document (or a shadow root) adopts once: add it to the page's document,
43
+ and to a shadow root of your own that holds the elements and sets
44
+ `data-ca-theme` inside it. No import adopts it; `<ca-monitor>` of
45
+ `@contraagent/ui` adopts it for its document when it connects.
46
+
47
+ ```ts
48
+ import { adoptThemes } from '@contraagent/elements/themes';
49
+
50
+ adoptThemes(document);
51
+ adoptThemes(myShadowRoot);
52
+ ```
53
+
54
+ The themes are also plain data: `THEMES`, `resolveTheme` and `themeRules` in
55
+ `@contraagent/elements/themes`. `themeRules` writes the rules for a selector of
56
+ your own, and `themeBootScript` is a script for a page's `<head>` that sets the
57
+ reader's theme before the first paint, as the monitor's page does.
58
+ `preferredTheme` and `rememberTheme` keep the reader's choice in this browser;
59
+ `system` follows the system's colour scheme (contraagent Dark or contraagent
60
+ Light).
61
+
62
+ ## Use the theme in your own page
63
+
64
+ The theme's properties have the same names in your page as in the elements, so
65
+ your page and the elements show one theme. Here `<html data-ca-theme="nord">`
66
+ picks it, and the page's CSS reads it:
67
+
68
+ ::code{file="examples/page.css"}
69
+
70
+ A theme sets each property that has a value per theme: the colours,
71
+ `--ca-tint`, `--ca-focus-width` and `--ca-color-scheme`. Its selector has no specificity,
72
+ so any rule of your page that sets a `--ca-*` property wins over it:
73
+
74
+ ::code{file="../src/themes/data.ts" from="/** A theme's selector on a page" to="/**"}
75
+
76
+ The tints (`--ca-accent-bg`, `--ca-status-*-bg`, `--ca-agent-bg`), the type
77
+ scale and the corners have one default for every theme; that default exists only
78
+ inside the elements, unless your page sets the property.
79
+
80
+ ## What a colour means
81
+
82
+ A colour means one thing, on every screen and in every theme:
83
+
84
+ - **Neutral by default.** Text, totals, cost, tokens, time and every count that
85
+ is not a count of a problem are in the text colours. A number is emphasised by
86
+ its size and weight, not by a colour of its own.
87
+ - **A status colour marks a status, and only where it applies.** A count of a
88
+ problem (failed attempts, tasks not started) takes its status colour above 0;
89
+ at 0 it is neutral, with its words ("All attempts done"). A total is never
90
+ coloured by its worst part.
91
+ - **A status also has a shape and a word**, so it reads without colour: ✓ done,
92
+ ✕ failed, ◌ not started, a round mark for done and a square one for failed.
93
+ - **One rule set draws every status.** An element that shows a status carries
94
+ `data-tone`, its tone (`failed`, `attention`, `done`, `running`, `muted`; none
95
+ for `neutral`), which picks its `--ca-status-*` colour and tint, and
96
+ `data-mark` for its mark. The primitives set both
97
+ ([Primitives](primitives.md)).
98
+ - **One accent** for links and the selected tab or item; the focus ring has
99
+ its own colour and width.
100
+ - **Identity colours are small cues** (an agent task's icon and edge, the token
101
+ bars, the timeline's bars): none of them is a status hue.
102
+
103
+ | Properties | Meaning |
104
+ |---|---|
105
+ | `--ca-backdrop`, `--ca-bg`, `--ca-card`, `--ca-panel`, `--ca-panel2`, `--ca-raise`, `--ca-well`, `--ca-track`, `--ca-line`, `--ca-line2`, `--ca-shadow` | the page, surfaces, borders and shadows |
106
+ | `--ca-text`, `--ca-text-secondary`, `--ca-text-muted` | text, from the main text to labels and units |
107
+ | `--ca-accent`, `--ca-accent-bg` | what can be clicked or is selected |
108
+ | `--ca-focus`, `--ca-focus-width` | the focus ring |
109
+ | `--ca-selection` | selected text |
110
+ | `--ca-status-failed` | failed: a task, an attempt, a check |
111
+ | `--ca-status-attention` | not failed, needs a look: not started, a usage limit near |
112
+ | `--ca-status-done` | done or passed: in marks and small chips only |
113
+ | `--ca-status-running` | running, live |
114
+ | `--ca-status-muted` | skipped, waiting, not run |
115
+ | `--ca-status-*-bg`, `--ca-tint` | the tint behind a status pill or chip: by default the status colour at `--ca-tint` |
116
+ | `--ca-agent`, `--ca-agent-bg` | identity: an agent task |
117
+ | `--ca-meter` | a bar that measures, not judges: time, usage, progress |
118
+ | `--ca-tok-input`, `--ca-tok-cache-read`, `--ca-tok-cache-write`, `--ca-tok-output` | the kinds of tokens in a bar |
119
+ | `--ca-series-1` to `--ca-series-6` | the series of a chart, in a fixed order; never a status, and each series also named in words |
120
+ | `--ca-code-*` | syntax colours in code, prompts and JSON |
121
+ | `--ca-color-scheme` | `light` or `dark`: native controls and scrollbars |
122
+ | `--ca-sans`, `--ca-mono` | the fonts |
123
+ | `--ca-font-size-xs` to `--ca-font-size-2xl` | the type scale |
124
+ | `--ca-radius-sm`, `--ca-radius-md`, `--ca-radius-lg`, `--ca-radius-pill` | the corners |
125
+
126
+ Every property, its meaning and its value in each built-in theme are in the
127
+ site's theme reference, generated from `src/themes/tokens-list.ts` (`TOKENS`),
128
+ `src/themes/token-meanings.ts` (`TOKEN_MEANINGS`)
129
+ and `src/themes/data.ts` (`THEMES`).
130
+
131
+ ## Type and corners
132
+
133
+ The type and radius scale is the same in every theme: no theme sets it, and
134
+ each step has a default. A `--ca-*` property on an ancestor changes a step for
135
+ every element under it.
136
+
137
+ ::code{file="../src/themes/tokens-list.ts" from="{ name: 'font-size-xs'" to="];"}
138
+
139
+ ## A theme of your own
140
+
141
+ Set the `--ca-*` properties on an element, here with a class: on the element
142
+ that carries `data-ca-theme`, or on one inside it (on `<body>` under
143
+ `<html data-ca-theme>`). Build it
144
+ the way the built-in themes are built: each text colour keeps a contrast of at
145
+ least 4.5:1 (WCAG AA) on every surface and on every status tint.
146
+
147
+ ::code{file="examples/theme.css"}
package/docs/tiles.md ADDED
@@ -0,0 +1,40 @@
1
+ # Stat tiles
2
+
3
+ `<cae-stat-tiles>` shows figures as a grid of tiles: each a label, a value and
4
+ lines of facts under it, and a link. Register it with
5
+ `@contraagent/elements/tiles/define`, which also registers the `<cae-count>` a
6
+ tile's number counts up in; the types are in `@contraagent/elements/tiles`.
7
+
8
+ ![Four stat tiles: jobs, failed jobs with a link, build time, and queued](images/tiles.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/tiles.ts"}
14
+
15
+ ## Tiles
16
+
17
+ A tile is a `StatTile`. Its value is a number or a text: a number counts up to a
18
+ new value, and the tile bumps when it changes (unless `bump` is off or the
19
+ reader asks for reduced motion). Each line under the value is a row of facts
20
+ (`factLine`, [Primitives](primitives.md)); a fact with a tone is in its status
21
+ colour, and an empty line keeps its place.
22
+
23
+ ::code{file="../src/tiles/types.ts" from="/** A figure as a tile"}
24
+
25
+ A tile is neutral by default. A tile with a tone takes it on its value, on the
26
+ mark before its label (✓ done, ✕ failed, ◌ attention) and on a thin edge, and
27
+ has `data-tone`. Give a tone only to a figure that is a status, such as a count
28
+ of failures above 0; a total or a measure stays neutral.
29
+
30
+ ## Events
31
+
32
+ A tile's link sends `cae-action` with the tile's `id` and the action's `id`;
33
+ the host decides what it opens.
34
+
35
+ ## Look
36
+
37
+ `columns` sets the tiles per row in a wide element (5); a narrower one has 4
38
+ below 1100px of its width, 2 below 660px and 1 below 240px. `--cae-stat-tiles-gap` sets the space between
39
+ the tiles. The parts are `tiles`, `tile` (with `data-id` and `data-tone`),
40
+ `label`, `value`, `sub` and `action`.