@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,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`.
@@ -0,0 +1,73 @@
1
+ # Transcript
2
+
3
+ `<cae-transcript>` shows a conversation with an agent: chat bubbles for the
4
+ prompts, the answers and the model's reasoning, lines of the agent's own log,
5
+ and a card per tool call that opens on its command and output. A web search
6
+ lists the pages it returned as links; a page read shows its URL. Register it
7
+ with `@contraagent/elements/transcript/define`; the types are in
8
+ `@contraagent/elements/transcript`.
9
+
10
+ ![A transcript of two sessions: an API request sent again, a web search with 2 results, a log line, and the assistant's answer](images/transcript.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/transcript.ts"}
16
+
17
+ ## Sections and items
18
+
19
+ The conversation comes in sections, one per session with the agent. Above two
20
+ sections, a picker shows one at a time; each section names itself (`title`),
21
+ can add short facts after its name (a model) and a mark of how it ended
22
+ (`verdict`: ✓ with the tone `done`, ✕ otherwise). A section's head shows its
23
+ `tags` (who ran it) and its `details`: folded texts, code (a command line) or
24
+ prose (a prompt). A `footer` after the items says how the section ended, with
25
+ a list (errors) or a note.
26
+
27
+ ::code{file="../src/transcript/types.ts" from="export interface TranscriptSection {" to="/** Where the reader was in a transcript. */"}
28
+
29
+ An item is a prompt, a message or reasoning (markdown), an event (a glyph, a
30
+ title and a detail), a notice, or a tool card:
31
+
32
+ ::code{file="../src/transcript/types.ts" from="/** One tool call:" to="/** A labelled value in a section's head (who ran it). */"}
33
+
34
+ ## Following and reading
35
+
36
+ `shown` picks a section (0-based); null follows the latest. While the reader
37
+ is at the bottom, new content scrolls into view. Once they scroll up, it stays
38
+ where they are, and a button counts what arrived below: `count` is how much
39
+ the transcript holds (by default its sections and items), so a host that
40
+ counts events sets it. A section that starts while the reader is scrolled up
41
+ in the latest one keeps the one they read on screen. `live` shows the agent
42
+ working, and a tool call with no result as running; without it, such a call
43
+ was interrupted.
44
+
45
+ A host that loads a transcript in pages sets `loading` until the first page
46
+ has arrived, and `earlier` to the number of lines before it that are not
47
+ loaded: a button then asks for them with `cae-load-earlier`, and the next
48
+ `sections` it gets is the content from further back, which keeps the reader's
49
+ place. For another transcript, give it a new element.
50
+
51
+ `memory` keeps what the reader opened and where they were: `isOpen` and
52
+ `setOpen` for the tool cards, `scroll` and `setScroll` for the position, which
53
+ is restored once the content has arrived. Without it, both last as long as the
54
+ element. `reveal(id)` opens a tool card and scrolls it into view once its
55
+ section is shown; it returns that section's index for the host to show.
56
+
57
+ ## Events
58
+
59
+ - `cae-section-change` with `{index}`: the reader picked a section (null: the
60
+ latest). The host sets `shown`.
61
+ - `cae-section-shown` with `{index}`: the section on screen changed (-1: none),
62
+ also when a new section keeps the one being read.
63
+ - `cae-load-earlier`: the reader asked for the content before `earlier`.
64
+
65
+ ## Look and words
66
+
67
+ Markdown is turned into HTML by `markdown` (`md` of
68
+ `@contraagent/elements/markdown` escapes the text); without it, answers and
69
+ reasoning show as plain text. `renderDetail` draws an open prose detail. The
70
+ parts are `picker`, `section`, `tag`, `bubble`, `notice`, `tool`, `tool-body`
71
+ and `verdict`; `tagChips` and `tagStyles` draw tags elsewhere in the same
72
+ look. The words are `strings` ([Strings](strings.md)): the picker's name and
73
+ tooltip, the bubbles' heads, the tool cards' statuses, the counts.
@@ -0,0 +1,20 @@
1
+ {
2
+ // The examples are documentation: they compile against the package as it is.
3
+ "extends": "../../../tsconfig.base.json",
4
+ "compilerOptions": {
5
+ "noEmit": true,
6
+ "paths": {
7
+ "@contraagent/elements": ["../src/index.ts"],
8
+ "@contraagent/elements/segmented/define": ["../src/define/segmented.ts"],
9
+ "@contraagent/elements/data-table": ["../src/table/index.ts"],
10
+ "@contraagent/elements/data-table/define": ["../src/define/data-table.ts"],
11
+ "@contraagent/elements/tiles": ["../src/tiles/index.ts"],
12
+ "@contraagent/elements/tiles/define": ["../src/define/tiles.ts"],
13
+ "@contraagent/elements/lanes": ["../src/lanes/index.ts"],
14
+ "@contraagent/elements/lanes/define": ["../src/define/lanes.ts"],
15
+ "@contraagent/elements/check-table": ["../src/checks/index.ts"],
16
+ "@contraagent/elements/check-table/define": ["../src/define/check-table.ts"]
17
+ }
18
+ },
19
+ "include": ["examples/**/*.ts"]
20
+ }
package/package.json CHANGED
@@ -1,6 +1,163 @@
1
1
  {
2
2
  "name": "@contraagent/elements",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Generic web components (Lit) and their parts: design tokens, themes, status pills, legends, a segmented control, a data table, a layered graph, a mark matrix, stat tiles, time lanes, charts (columns, lines, a heatmap, horizontal bars), a check table, a transcript, a JSON tree, markdown and counters. No contraagent data, no localization library",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "web-components",
8
+ "lit",
9
+ "custom-elements",
10
+ "charts",
11
+ "data-table",
12
+ "design-tokens"
13
+ ],
14
+ "homepage": "https://t-tani.github.io/contraagent/",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/t-tani/contraagent.git",
18
+ "directory": "web/packages/elements"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/t-tani/contraagent/issues"
22
+ },
23
+ "type": "module",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "default": "./dist/index.js"
28
+ },
29
+ "./primitives": {
30
+ "types": "./dist/primitives/index.d.ts",
31
+ "default": "./dist/primitives/index.js"
32
+ },
33
+ "./styles": {
34
+ "types": "./dist/styles/index.d.ts",
35
+ "default": "./dist/styles/index.js"
36
+ },
37
+ "./themes": {
38
+ "types": "./dist/themes/index.d.ts",
39
+ "default": "./dist/themes/index.js"
40
+ },
41
+ "./json-tree": {
42
+ "types": "./dist/json/index.d.ts",
43
+ "default": "./dist/json/index.js"
44
+ },
45
+ "./markdown": {
46
+ "types": "./dist/markdown/index.d.ts",
47
+ "default": "./dist/markdown/index.js"
48
+ },
49
+ "./count": {
50
+ "types": "./dist/count/index.d.ts",
51
+ "default": "./dist/count/index.js"
52
+ },
53
+ "./data-table": {
54
+ "types": "./dist/table/index.d.ts",
55
+ "default": "./dist/table/index.js"
56
+ },
57
+ "./graph": {
58
+ "types": "./dist/graph/index.d.ts",
59
+ "default": "./dist/graph/index.js"
60
+ },
61
+ "./matrix": {
62
+ "types": "./dist/matrix/index.d.ts",
63
+ "default": "./dist/matrix/index.js"
64
+ },
65
+ "./tiles": {
66
+ "types": "./dist/tiles/index.d.ts",
67
+ "default": "./dist/tiles/index.js"
68
+ },
69
+ "./lanes": {
70
+ "types": "./dist/lanes/index.d.ts",
71
+ "default": "./dist/lanes/index.js"
72
+ },
73
+ "./charts": {
74
+ "types": "./dist/charts/index.d.ts",
75
+ "default": "./dist/charts/index.js"
76
+ },
77
+ "./check-table": {
78
+ "types": "./dist/checks/index.d.ts",
79
+ "default": "./dist/checks/index.js"
80
+ },
81
+ "./transcript": {
82
+ "types": "./dist/transcript/index.d.ts",
83
+ "default": "./dist/transcript/index.js"
84
+ },
85
+ "./define": {
86
+ "types": "./dist/define/all.d.ts",
87
+ "default": "./dist/define/all.js"
88
+ },
89
+ "./json-tree/define": {
90
+ "types": "./dist/define/json-tree.d.ts",
91
+ "default": "./dist/define/json-tree.js"
92
+ },
93
+ "./markdown/define": {
94
+ "types": "./dist/define/markdown.d.ts",
95
+ "default": "./dist/define/markdown.js"
96
+ },
97
+ "./count/define": {
98
+ "types": "./dist/define/count.d.ts",
99
+ "default": "./dist/define/count.js"
100
+ },
101
+ "./segmented/define": {
102
+ "types": "./dist/define/segmented.d.ts",
103
+ "default": "./dist/define/segmented.js"
104
+ },
105
+ "./data-table/define": {
106
+ "types": "./dist/define/data-table.d.ts",
107
+ "default": "./dist/define/data-table.js"
108
+ },
109
+ "./graph/define": {
110
+ "types": "./dist/define/graph.d.ts",
111
+ "default": "./dist/define/graph.js"
112
+ },
113
+ "./matrix/define": {
114
+ "types": "./dist/define/matrix.d.ts",
115
+ "default": "./dist/define/matrix.js"
116
+ },
117
+ "./tiles/define": {
118
+ "types": "./dist/define/tiles.d.ts",
119
+ "default": "./dist/define/tiles.js"
120
+ },
121
+ "./lanes/define": {
122
+ "types": "./dist/define/lanes.d.ts",
123
+ "default": "./dist/define/lanes.js"
124
+ },
125
+ "./charts/define": {
126
+ "types": "./dist/define/charts.d.ts",
127
+ "default": "./dist/define/charts.js"
128
+ },
129
+ "./check-table/define": {
130
+ "types": "./dist/define/check-table.d.ts",
131
+ "default": "./dist/define/check-table.js"
132
+ },
133
+ "./transcript/define": {
134
+ "types": "./dist/define/transcript.d.ts",
135
+ "default": "./dist/define/transcript.js"
136
+ },
137
+ "./custom-elements.json": "./custom-elements.json"
138
+ },
139
+ "customElements": "custom-elements.json",
140
+ "files": [
141
+ "dist",
142
+ "src",
143
+ "!src/**/*.test.ts",
144
+ "!src/**/__snapshots__",
145
+ "docs",
146
+ "!docs/images",
147
+ "custom-elements.json"
148
+ ],
149
+ "sideEffects": [
150
+ "./dist/define/*.js"
151
+ ],
152
+ "peerDependencies": {
153
+ "lit": "^3.3.3"
154
+ },
155
+ "devDependencies": {
156
+ "@custom-elements-manifest/analyzer": "^0.11.0",
157
+ "lit": "^3.3.3"
158
+ },
159
+ "scripts": {
160
+ "build": "tsc -p tsconfig.build.json && cem analyze --litelement --globs 'src/*/{segmented,data-table,layered-graph,mark-matrix,stat-tiles,lanes,column-chart,line-chart,heatmap,bar-chart,check-table,transcript,json-tree,cae-markdown,count,elapsed}.ts'",
161
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p docs"
162
+ }
163
+ }
@@ -0,0 +1,74 @@
1
+ import { css, html, nothing, type TemplateResult } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import { toneAttr } from '../core/tone.js';
4
+ import type { LegendItem } from '../primitives/legend.js';
5
+ import { ChartElement } from './base.js';
6
+ import type { ChartBar } from './types.js';
7
+
8
+ /**
9
+ * Horizontal bars, one per label, in the order given (a funnel's stages, a ranking):
10
+ * each its label, a bar as long as its value against the longest, and the value in
11
+ * words. A bar with a `tone` takes that status colour, the others one colour. Every
12
+ * value is written beside its bar, so no tooltip is needed; the switch shows them as
13
+ * a table.
14
+ *
15
+ * @tagname cae-bar-chart
16
+ * @csspart plot - the bars
17
+ * @csspart table - the table of its values
18
+ * @csspart switch - the button between the two
19
+ * @csspart empty - what it shows with no values
20
+ */
21
+ export class CaeBarChart extends ChartElement {
22
+ static override styles = [
23
+ ...ChartElement.styles,
24
+ css`
25
+ .bars { display: grid; grid-template-columns: minmax(80px, max-content) minmax(0, 1fr) max-content; gap: 6px 12px; align-items: center;
26
+ font-size: var(--font-size-sm); }
27
+ .bars .r { display: contents; }
28
+ .bars .l { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; }
29
+ .bars .track { display: block; height: 12px; }
30
+ .bars .bar { display: block; height: 100%; min-width: 2px; border-radius: 1px 4px 4px 1px; background: var(--series-1); }
31
+ .bars .bar[data-tone] { background: var(--tone); }
32
+ .bars .v { color: var(--text-2); font-variant-numeric: tabular-nums; text-align: right; }
33
+ `,
34
+ ];
35
+
36
+ @property({ attribute: false }) bars: readonly ChartBar[] = [];
37
+
38
+ protected hasValues(): boolean {
39
+ return this.bars.length > 0;
40
+ }
41
+
42
+ protected legendItems(): LegendItem[] {
43
+ return [];
44
+ }
45
+
46
+ protected itemCount(): number {
47
+ return 0;
48
+ }
49
+
50
+ protected plot(): TemplateResult {
51
+ const top = Math.max(0, ...this.bars.map((b) => b.value));
52
+ return html`<div class="bars" role="list" aria-label=${this.label || nothing}>
53
+ ${this.bars.map(
54
+ (b) => html`<div class="r" role="listitem" aria-label="${b.label} | ${this.format(b.value)}">
55
+ <span class="l" aria-hidden="true" title=${b.label}>${b.label}</span>
56
+ <span class="track" aria-hidden="true"><span class="bar" data-tone=${toneAttr(b.tone)}
57
+ style="width: ${top > 0 ? (100 * Math.max(0, b.value)) / top : 0}%"></span></span>
58
+ <span class="v" aria-hidden="true">${this.format(b.value)}</span></div>`,
59
+ )}
60
+ </div>`;
61
+ }
62
+
63
+ protected table(): TemplateResult {
64
+ return html`<table aria-label=${this.label || nothing}>
65
+ <tbody>${this.bars.map((b) => html`<tr><th scope="row">${b.label}</th><td>${this.format(b.value)}</td></tr>`)}</tbody>
66
+ </table>`;
67
+ }
68
+ }
69
+
70
+ declare global {
71
+ interface HTMLElementTagNameMap {
72
+ 'cae-bar-chart': CaeBarChart;
73
+ }
74
+ }