@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.
- package/README.md +83 -2
- package/custom-elements.json +5022 -0
- package/dist/charts/bar-chart.d.ts +32 -0
- package/dist/charts/bar-chart.d.ts.map +1 -0
- package/dist/charts/bar-chart.js +70 -0
- package/dist/charts/bar-chart.js.map +1 -0
- package/dist/charts/base.d.ts +48 -0
- package/dist/charts/base.d.ts.map +1 -0
- package/dist/charts/base.js +203 -0
- package/dist/charts/base.js.map +1 -0
- package/dist/charts/column-chart.d.ts +42 -0
- package/dist/charts/column-chart.d.ts.map +1 -0
- package/dist/charts/column-chart.js +146 -0
- package/dist/charts/column-chart.js.map +1 -0
- package/dist/charts/heatmap.d.ts +42 -0
- package/dist/charts/heatmap.d.ts.map +1 -0
- package/dist/charts/heatmap.js +124 -0
- package/dist/charts/heatmap.js.map +1 -0
- package/dist/charts/index.d.ts +9 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +11 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/charts/line-chart.d.ts +36 -0
- package/dist/charts/line-chart.d.ts.map +1 -0
- package/dist/charts/line-chart.js +118 -0
- package/dist/charts/line-chart.js.map +1 -0
- package/dist/charts/scale.d.ts +32 -0
- package/dist/charts/scale.d.ts.map +1 -0
- package/dist/charts/scale.js +50 -0
- package/dist/charts/scale.js.map +1 -0
- package/dist/charts/state-grid.d.ts +64 -0
- package/dist/charts/state-grid.d.ts.map +1 -0
- package/dist/charts/state-grid.js +223 -0
- package/dist/charts/state-grid.js.map +1 -0
- package/dist/charts/types.d.ts +34 -0
- package/dist/charts/types.d.ts.map +1 -0
- package/dist/charts/types.js +11 -0
- package/dist/charts/types.js.map +1 -0
- package/dist/checks/check-table.d.ts +32 -0
- package/dist/checks/check-table.d.ts.map +1 -0
- package/dist/checks/check-table.js +94 -0
- package/dist/checks/check-table.js.map +1 -0
- package/dist/checks/index.d.ts +4 -0
- package/dist/checks/index.d.ts.map +1 -0
- package/dist/checks/index.js +6 -0
- package/dist/checks/index.js.map +1 -0
- package/dist/checks/styles.d.ts +5 -0
- package/dist/checks/styles.d.ts.map +1 -0
- package/dist/checks/styles.js +30 -0
- package/dist/checks/styles.js.map +1 -0
- package/dist/checks/types.d.ts +35 -0
- package/dist/checks/types.d.ts.map +1 -0
- package/dist/checks/types.js +12 -0
- package/dist/checks/types.js.map +1 -0
- package/dist/code/code.d.ts +83 -0
- package/dist/code/code.d.ts.map +1 -0
- package/dist/code/code.js +206 -0
- package/dist/code/code.js.map +1 -0
- package/dist/code/highlight.d.ts +25 -0
- package/dist/code/highlight.d.ts.map +1 -0
- package/dist/code/highlight.js +312 -0
- package/dist/code/highlight.js.map +1 -0
- package/dist/code/index.d.ts +3 -0
- package/dist/code/index.d.ts.map +1 -0
- package/dist/code/index.js +5 -0
- package/dist/code/index.js.map +1 -0
- package/dist/core/clock.d.ts +20 -0
- package/dist/core/clock.d.ts.map +1 -0
- package/dist/core/clock.js +45 -0
- package/dist/core/clock.js.map +1 -0
- package/dist/core/define.d.ts +3 -0
- package/dist/core/define.d.ts.map +1 -0
- package/dist/core/define.js +8 -0
- package/dist/core/define.js.map +1 -0
- package/dist/core/events.d.ts +78 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +8 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/format.d.ts +8 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +28 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/frame.d.ts +4 -0
- package/dist/core/frame.d.ts.map +1 -0
- package/dist/core/frame.js +5 -0
- package/dist/core/frame.js.map +1 -0
- package/dist/core/strings.d.ts +3 -0
- package/dist/core/strings.d.ts.map +1 -0
- package/dist/core/strings.js +14 -0
- package/dist/core/strings.js.map +1 -0
- package/dist/core/tone.d.ts +8 -0
- package/dist/core/tone.d.ts.map +1 -0
- package/dist/core/tone.js +9 -0
- package/dist/core/tone.js.map +1 -0
- package/dist/count/count.d.ts +22 -0
- package/dist/count/count.d.ts.map +1 -0
- package/dist/count/count.js +60 -0
- package/dist/count/count.js.map +1 -0
- package/dist/count/elapsed.d.ts +18 -0
- package/dist/count/elapsed.d.ts.map +1 -0
- package/dist/count/elapsed.js +33 -0
- package/dist/count/elapsed.js.map +1 -0
- package/dist/count/index.d.ts +3 -0
- package/dist/count/index.d.ts.map +1 -0
- package/dist/count/index.js +5 -0
- package/dist/count/index.js.map +1 -0
- package/dist/define/all.d.ts +15 -0
- package/dist/define/all.d.ts.map +1 -0
- package/dist/define/all.js +16 -0
- package/dist/define/all.js.map +1 -0
- package/dist/define/charts.d.ts +8 -0
- package/dist/define/charts.d.ts.map +1 -0
- package/dist/define/charts.js +15 -0
- package/dist/define/charts.js.map +1 -0
- package/dist/define/check-table.d.ts +4 -0
- package/dist/define/check-table.d.ts.map +1 -0
- package/dist/define/check-table.js +7 -0
- package/dist/define/check-table.js.map +1 -0
- package/dist/define/code.d.ts +4 -0
- package/dist/define/code.d.ts.map +1 -0
- package/dist/define/code.js +7 -0
- package/dist/define/code.js.map +1 -0
- package/dist/define/count.d.ts +5 -0
- package/dist/define/count.d.ts.map +1 -0
- package/dist/define/count.js +9 -0
- package/dist/define/count.js.map +1 -0
- package/dist/define/data-table.d.ts +4 -0
- package/dist/define/data-table.d.ts.map +1 -0
- package/dist/define/data-table.js +7 -0
- package/dist/define/data-table.js.map +1 -0
- package/dist/define/graph.d.ts +6 -0
- package/dist/define/graph.d.ts.map +1 -0
- package/dist/define/graph.js +9 -0
- package/dist/define/graph.js.map +1 -0
- package/dist/define/json-tree.d.ts +4 -0
- package/dist/define/json-tree.d.ts.map +1 -0
- package/dist/define/json-tree.js +7 -0
- package/dist/define/json-tree.js.map +1 -0
- package/dist/define/lanes.d.ts +4 -0
- package/dist/define/lanes.d.ts.map +1 -0
- package/dist/define/lanes.js +7 -0
- package/dist/define/lanes.js.map +1 -0
- package/dist/define/markdown.d.ts +4 -0
- package/dist/define/markdown.d.ts.map +1 -0
- package/dist/define/markdown.js +7 -0
- package/dist/define/markdown.js.map +1 -0
- package/dist/define/matrix.d.ts +4 -0
- package/dist/define/matrix.d.ts.map +1 -0
- package/dist/define/matrix.js +7 -0
- package/dist/define/matrix.js.map +1 -0
- package/dist/define/segmented.d.ts +4 -0
- package/dist/define/segmented.d.ts.map +1 -0
- package/dist/define/segmented.js +7 -0
- package/dist/define/segmented.js.map +1 -0
- package/dist/define/tiles.d.ts +5 -0
- package/dist/define/tiles.d.ts.map +1 -0
- package/dist/define/tiles.js +9 -0
- package/dist/define/tiles.js.map +1 -0
- package/dist/define/transcript.d.ts +4 -0
- package/dist/define/transcript.d.ts.map +1 -0
- package/dist/define/transcript.js +7 -0
- package/dist/define/transcript.js.map +1 -0
- package/dist/define/tree.d.ts +4 -0
- package/dist/define/tree.d.ts.map +1 -0
- package/dist/define/tree.js +7 -0
- package/dist/define/tree.js.map +1 -0
- package/dist/graph/arrange.d.ts +43 -0
- package/dist/graph/arrange.d.ts.map +1 -0
- package/dist/graph/arrange.js +390 -0
- package/dist/graph/arrange.js.map +1 -0
- package/dist/graph/card.d.ts +71 -0
- package/dist/graph/card.d.ts.map +1 -0
- package/dist/graph/card.js +185 -0
- package/dist/graph/card.js.map +1 -0
- package/dist/graph/host.d.ts +82 -0
- package/dist/graph/host.d.ts.map +1 -0
- package/dist/graph/host.js +21 -0
- package/dist/graph/host.js.map +1 -0
- package/dist/graph/icons.d.ts +7 -0
- package/dist/graph/icons.d.ts.map +1 -0
- package/dist/graph/icons.js +18 -0
- package/dist/graph/icons.js.map +1 -0
- package/dist/graph/index.d.ts +15 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +17 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/layered-graph.d.ts +226 -0
- package/dist/graph/layered-graph.d.ts.map +1 -0
- package/dist/graph/layered-graph.js +396 -0
- package/dist/graph/layered-graph.js.map +1 -0
- package/dist/graph/layout.d.ts +80 -0
- package/dist/graph/layout.d.ts.map +1 -0
- package/dist/graph/layout.js +264 -0
- package/dist/graph/layout.js.map +1 -0
- package/dist/graph/marks.d.ts +24 -0
- package/dist/graph/marks.d.ts.map +1 -0
- package/dist/graph/marks.js +38 -0
- package/dist/graph/marks.js.map +1 -0
- package/dist/graph/nav.d.ts +14 -0
- package/dist/graph/nav.d.ts.map +1 -0
- package/dist/graph/nav.js +14 -0
- package/dist/graph/nav.js.map +1 -0
- package/dist/graph/pan-zoom.d.ts +80 -0
- package/dist/graph/pan-zoom.d.ts.map +1 -0
- package/dist/graph/pan-zoom.js +191 -0
- package/dist/graph/pan-zoom.js.map +1 -0
- package/dist/graph/paths.d.ts +9 -0
- package/dist/graph/paths.d.ts.map +1 -0
- package/dist/graph/paths.js +44 -0
- package/dist/graph/paths.js.map +1 -0
- package/dist/graph/place-card.d.ts +36 -0
- package/dist/graph/place-card.d.ts.map +1 -0
- package/dist/graph/place-card.js +68 -0
- package/dist/graph/place-card.js.map +1 -0
- package/dist/graph/strings.d.ts +50 -0
- package/dist/graph/strings.d.ts.map +1 -0
- package/dist/graph/strings.js +37 -0
- package/dist/graph/strings.js.map +1 -0
- package/dist/graph/styles.d.ts +2 -0
- package/dist/graph/styles.d.ts.map +1 -0
- package/dist/graph/styles.js +203 -0
- package/dist/graph/styles.js.map +1 -0
- package/dist/graph/types.d.ts +184 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/types.js +2 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/graph/view.d.ts +17 -0
- package/dist/graph/view.d.ts.map +1 -0
- package/dist/graph/view.js +21 -0
- package/dist/graph/view.js.map +1 -0
- package/dist/graph/views/dag.d.ts +10 -0
- package/dist/graph/views/dag.d.ts.map +1 -0
- package/dist/graph/views/dag.js +292 -0
- package/dist/graph/views/dag.js.map +1 -0
- package/dist/graph/views/foot.d.ts +8 -0
- package/dist/graph/views/foot.d.ts.map +1 -0
- package/dist/graph/views/foot.js +103 -0
- package/dist/graph/views/foot.js.map +1 -0
- package/dist/graph/views/node-table.d.ts +17 -0
- package/dist/graph/views/node-table.d.ts.map +1 -0
- package/dist/graph/views/node-table.js +80 -0
- package/dist/graph/views/node-table.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/json/index.d.ts +2 -0
- package/dist/json/index.d.ts.map +1 -0
- package/dist/json/index.js +3 -0
- package/dist/json/index.js.map +1 -0
- package/dist/json/json-tree.d.ts +21 -0
- package/dist/json/json-tree.d.ts.map +1 -0
- package/dist/json/json-tree.js +51 -0
- package/dist/json/json-tree.js.map +1 -0
- package/dist/lanes/index.d.ts +5 -0
- package/dist/lanes/index.d.ts.map +1 -0
- package/dist/lanes/index.js +7 -0
- package/dist/lanes/index.js.map +1 -0
- package/dist/lanes/lanes.d.ts +56 -0
- package/dist/lanes/lanes.d.ts.map +1 -0
- package/dist/lanes/lanes.js +160 -0
- package/dist/lanes/lanes.js.map +1 -0
- package/dist/lanes/stack.d.ts +26 -0
- package/dist/lanes/stack.d.ts.map +1 -0
- package/dist/lanes/stack.js +43 -0
- package/dist/lanes/stack.js.map +1 -0
- package/dist/lanes/styles.d.ts +2 -0
- package/dist/lanes/styles.d.ts.map +1 -0
- package/dist/lanes/styles.js +30 -0
- package/dist/lanes/styles.js.map +1 -0
- package/dist/lanes/types.d.ts +41 -0
- package/dist/lanes/types.d.ts.map +1 -0
- package/dist/lanes/types.js +6 -0
- package/dist/lanes/types.js.map +1 -0
- package/dist/markdown/cae-markdown.d.ts +37 -0
- package/dist/markdown/cae-markdown.d.ts.map +1 -0
- package/dist/markdown/cae-markdown.js +68 -0
- package/dist/markdown/cae-markdown.js.map +1 -0
- package/dist/markdown/highlight.d.ts +2 -0
- package/dist/markdown/highlight.d.ts.map +1 -0
- package/dist/markdown/highlight.js +3 -0
- package/dist/markdown/highlight.js.map +1 -0
- package/dist/markdown/index.d.ts +4 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +6 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/markdown/markdown.d.ts +4 -0
- package/dist/markdown/markdown.d.ts.map +1 -0
- package/dist/markdown/markdown.js +105 -0
- package/dist/markdown/markdown.js.map +1 -0
- package/dist/matrix/grid-step.d.ts +8 -0
- package/dist/matrix/grid-step.d.ts.map +1 -0
- package/dist/matrix/grid-step.js +69 -0
- package/dist/matrix/grid-step.js.map +1 -0
- package/dist/matrix/index.d.ts +5 -0
- package/dist/matrix/index.d.ts.map +1 -0
- package/dist/matrix/index.js +7 -0
- package/dist/matrix/index.js.map +1 -0
- package/dist/matrix/mark-matrix.d.ts +97 -0
- package/dist/matrix/mark-matrix.d.ts.map +1 -0
- package/dist/matrix/mark-matrix.js +272 -0
- package/dist/matrix/mark-matrix.js.map +1 -0
- package/dist/matrix/styles.d.ts +4 -0
- package/dist/matrix/styles.d.ts.map +1 -0
- package/dist/matrix/styles.js +47 -0
- package/dist/matrix/styles.js.map +1 -0
- package/dist/matrix/types.d.ts +79 -0
- package/dist/matrix/types.d.ts.map +1 -0
- package/dist/matrix/types.js +5 -0
- package/dist/matrix/types.js.map +1 -0
- package/dist/primitives/fact-line.d.ts +14 -0
- package/dist/primitives/fact-line.d.ts.map +1 -0
- package/dist/primitives/fact-line.js +18 -0
- package/dist/primitives/fact-line.js.map +1 -0
- package/dist/primitives/icon.d.ts +14 -0
- package/dist/primitives/icon.d.ts.map +1 -0
- package/dist/primitives/icon.js +19 -0
- package/dist/primitives/icon.js.map +1 -0
- package/dist/primitives/index.d.ts +10 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +13 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/legend.d.ts +28 -0
- package/dist/primitives/legend.d.ts.map +1 -0
- package/dist/primitives/legend.js +28 -0
- package/dist/primitives/legend.js.map +1 -0
- package/dist/primitives/pill.d.ts +23 -0
- package/dist/primitives/pill.d.ts.map +1 -0
- package/dist/primitives/pill.js +40 -0
- package/dist/primitives/pill.js.map +1 -0
- package/dist/primitives/roving-focus.d.ts +47 -0
- package/dist/primitives/roving-focus.d.ts.map +1 -0
- package/dist/primitives/roving-focus.js +111 -0
- package/dist/primitives/roving-focus.js.map +1 -0
- package/dist/primitives/segmented.d.ts +41 -0
- package/dist/primitives/segmented.d.ts.map +1 -0
- package/dist/primitives/segmented.js +88 -0
- package/dist/primitives/segmented.js.map +1 -0
- package/dist/primitives/share-bar.d.ts +37 -0
- package/dist/primitives/share-bar.d.ts.map +1 -0
- package/dist/primitives/share-bar.js +69 -0
- package/dist/primitives/share-bar.js.map +1 -0
- package/dist/primitives/states.d.ts +19 -0
- package/dist/primitives/states.d.ts.map +1 -0
- package/dist/primitives/states.js +11 -0
- package/dist/primitives/states.js.map +1 -0
- package/dist/primitives/window.d.ts +24 -0
- package/dist/primitives/window.d.ts.map +1 -0
- package/dist/primitives/window.js +56 -0
- package/dist/primitives/window.js.map +1 -0
- package/dist/styles/chips.d.ts +2 -0
- package/dist/styles/chips.d.ts.map +1 -0
- package/dist/styles/chips.js +18 -0
- package/dist/styles/chips.js.map +1 -0
- package/dist/styles/facts.d.ts +2 -0
- package/dist/styles/facts.d.ts.map +1 -0
- package/dist/styles/facts.js +7 -0
- package/dist/styles/facts.js.map +1 -0
- package/dist/styles/index.d.ts +16 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/index.js +15 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/styles/layout.d.ts +2 -0
- package/dist/styles/layout.d.ts.map +1 -0
- package/dist/styles/layout.js +33 -0
- package/dist/styles/layout.js.map +1 -0
- package/dist/styles/marks.d.ts +2 -0
- package/dist/styles/marks.d.ts.map +1 -0
- package/dist/styles/marks.js +30 -0
- package/dist/styles/marks.js.map +1 -0
- package/dist/styles/meter.d.ts +3 -0
- package/dist/styles/meter.d.ts.map +1 -0
- package/dist/styles/meter.js +9 -0
- package/dist/styles/meter.js.map +1 -0
- package/dist/styles/motion.d.ts +2 -0
- package/dist/styles/motion.d.ts.map +1 -0
- package/dist/styles/motion.js +27 -0
- package/dist/styles/motion.js.map +1 -0
- package/dist/styles/prose.d.ts +3 -0
- package/dist/styles/prose.d.ts.map +1 -0
- package/dist/styles/prose.js +64 -0
- package/dist/styles/prose.js.map +1 -0
- package/dist/styles/reset.d.ts +2 -0
- package/dist/styles/reset.d.ts.map +1 -0
- package/dist/styles/reset.js +13 -0
- package/dist/styles/reset.js.map +1 -0
- package/dist/styles/status.d.ts +2 -0
- package/dist/styles/status.d.ts.map +1 -0
- package/dist/styles/status.js +52 -0
- package/dist/styles/status.js.map +1 -0
- package/dist/styles/text.d.ts +2 -0
- package/dist/styles/text.d.ts.map +1 -0
- package/dist/styles/text.js +21 -0
- package/dist/styles/text.js.map +1 -0
- package/dist/styles/tokens.d.ts +8 -0
- package/dist/styles/tokens.d.ts.map +1 -0
- package/dist/styles/tokens.js +32 -0
- package/dist/styles/tokens.js.map +1 -0
- package/dist/table/data-table.d.ts +106 -0
- package/dist/table/data-table.d.ts.map +1 -0
- package/dist/table/data-table.js +408 -0
- package/dist/table/data-table.js.map +1 -0
- package/dist/table/index.d.ts +4 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/index.js +6 -0
- package/dist/table/index.js.map +1 -0
- package/dist/table/styles.d.ts +2 -0
- package/dist/table/styles.d.ts.map +1 -0
- package/dist/table/styles.js +32 -0
- package/dist/table/styles.js.map +1 -0
- package/dist/table/types.d.ts +48 -0
- package/dist/table/types.d.ts.map +1 -0
- package/dist/table/types.js +30 -0
- package/dist/table/types.js.map +1 -0
- package/dist/themes/boot.d.ts +7 -0
- package/dist/themes/boot.d.ts.map +1 -0
- package/dist/themes/boot.js +14 -0
- package/dist/themes/boot.js.map +1 -0
- package/dist/themes/choice.d.ts +16 -0
- package/dist/themes/choice.d.ts.map +1 -0
- package/dist/themes/choice.js +45 -0
- package/dist/themes/choice.js.map +1 -0
- package/dist/themes/data.d.ts +43 -0
- package/dist/themes/data.d.ts.map +1 -0
- package/dist/themes/data.js +408 -0
- package/dist/themes/data.js.map +1 -0
- package/dist/themes/index.d.ts +7 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +11 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/sheet.d.ts +16 -0
- package/dist/themes/sheet.d.ts.map +1 -0
- package/dist/themes/sheet.js +28 -0
- package/dist/themes/sheet.js.map +1 -0
- package/dist/themes/token-meanings.d.ts +3 -0
- package/dist/themes/token-meanings.d.ts.map +1 -0
- package/dist/themes/token-meanings.js +67 -0
- package/dist/themes/token-meanings.js.map +1 -0
- package/dist/themes/tokens-list.d.ts +14 -0
- package/dist/themes/tokens-list.d.ts.map +1 -0
- package/dist/themes/tokens-list.js +69 -0
- package/dist/themes/tokens-list.js.map +1 -0
- package/dist/tiles/index.d.ts +4 -0
- package/dist/tiles/index.d.ts.map +1 -0
- package/dist/tiles/index.js +6 -0
- package/dist/tiles/index.js.map +1 -0
- package/dist/tiles/stat-tiles.d.ts +40 -0
- package/dist/tiles/stat-tiles.d.ts.map +1 -0
- package/dist/tiles/stat-tiles.js +99 -0
- package/dist/tiles/stat-tiles.js.map +1 -0
- package/dist/tiles/styles.d.ts +2 -0
- package/dist/tiles/styles.d.ts.map +1 -0
- package/dist/tiles/styles.js +23 -0
- package/dist/tiles/styles.js.map +1 -0
- package/dist/tiles/types.d.ts +22 -0
- package/dist/tiles/types.d.ts.map +1 -0
- package/dist/tiles/types.js +2 -0
- package/dist/tiles/types.js.map +1 -0
- package/dist/transcript/follow-scroll.d.ts +21 -0
- package/dist/transcript/follow-scroll.d.ts.map +1 -0
- package/dist/transcript/follow-scroll.js +76 -0
- package/dist/transcript/follow-scroll.js.map +1 -0
- package/dist/transcript/index.d.ts +5 -0
- package/dist/transcript/index.d.ts.map +1 -0
- package/dist/transcript/index.js +7 -0
- package/dist/transcript/index.js.map +1 -0
- package/dist/transcript/styles.d.ts +2 -0
- package/dist/transcript/styles.d.ts.map +1 -0
- package/dist/transcript/styles.js +114 -0
- package/dist/transcript/styles.js.map +1 -0
- package/dist/transcript/tags.d.ts +6 -0
- package/dist/transcript/tags.d.ts.map +1 -0
- package/dist/transcript/tags.js +13 -0
- package/dist/transcript/tags.js.map +1 -0
- package/dist/transcript/tool-card.d.ts +16 -0
- package/dist/transcript/tool-card.d.ts.map +1 -0
- package/dist/transcript/tool-card.js +87 -0
- package/dist/transcript/tool-card.js.map +1 -0
- package/dist/transcript/transcript.d.ts +103 -0
- package/dist/transcript/transcript.d.ts.map +1 -0
- package/dist/transcript/transcript.js +397 -0
- package/dist/transcript/transcript.js.map +1 -0
- package/dist/transcript/types.d.ts +161 -0
- package/dist/transcript/types.d.ts.map +1 -0
- package/dist/transcript/types.js +25 -0
- package/dist/transcript/types.js.map +1 -0
- package/dist/tree/index.d.ts +2 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/tree/index.js +4 -0
- package/dist/tree/index.js.map +1 -0
- package/dist/tree/tree.d.ts +83 -0
- package/dist/tree/tree.d.ts.map +1 -0
- package/dist/tree/tree.js +251 -0
- package/dist/tree/tree.js.map +1 -0
- package/docs/charts.md +58 -0
- package/docs/check-table.md +40 -0
- package/docs/code.md +55 -0
- package/docs/data-table.md +57 -0
- package/docs/examples/charts.ts +61 -0
- package/docs/examples/check-table.ts +19 -0
- package/docs/examples/ci-pipeline.ts +271 -0
- package/docs/examples/code.ts +28 -0
- package/docs/examples/data-table.ts +39 -0
- package/docs/examples/graph.ts +57 -0
- package/docs/examples/lanes.ts +40 -0
- package/docs/examples/matrix.ts +56 -0
- package/docs/examples/page.css +34 -0
- package/docs/examples/segmented.ts +18 -0
- package/docs/examples/status.ts +30 -0
- package/docs/examples/theme.css +54 -0
- package/docs/examples/tiles.ts +27 -0
- package/docs/examples/transcript.ts +59 -0
- package/docs/examples/tree.ts +44 -0
- package/docs/graph.md +112 -0
- package/docs/lanes.md +48 -0
- package/docs/matrix.md +34 -0
- package/docs/page.md +87 -0
- package/docs/primitives.md +57 -0
- package/docs/strings.md +16 -0
- package/docs/theming.md +147 -0
- package/docs/tiles.md +40 -0
- package/docs/transcript.md +73 -0
- package/docs/tree.md +44 -0
- package/docs/tsconfig.json +20 -0
- package/package.json +177 -4
- package/src/charts/bar-chart.ts +74 -0
- package/src/charts/base.ts +188 -0
- package/src/charts/column-chart.ts +153 -0
- package/src/charts/heatmap.ts +129 -0
- package/src/charts/index.ts +10 -0
- package/src/charts/line-chart.ts +128 -0
- package/src/charts/scale.ts +61 -0
- package/src/charts/state-grid.ts +245 -0
- package/src/charts/types.ts +48 -0
- package/src/checks/check-table.ts +85 -0
- package/src/checks/index.ts +5 -0
- package/src/checks/styles.ts +31 -0
- package/src/checks/types.ts +48 -0
- package/src/code/code.ts +199 -0
- package/src/code/highlight.ts +378 -0
- package/src/code/index.ts +4 -0
- package/src/core/clock.ts +46 -0
- package/src/core/define.ts +7 -0
- package/src/core/events.ts +89 -0
- package/src/core/format.ts +25 -0
- package/src/core/frame.ts +5 -0
- package/src/core/strings.ts +11 -0
- package/src/core/tone.ts +14 -0
- package/src/count/count.ts +54 -0
- package/src/count/elapsed.ts +33 -0
- package/src/count/index.ts +4 -0
- package/src/define/all.ts +15 -0
- package/src/define/charts.ts +17 -0
- package/src/define/check-table.ts +9 -0
- package/src/define/code.ts +9 -0
- package/src/define/count.ts +11 -0
- package/src/define/data-table.ts +9 -0
- package/src/define/graph.ts +11 -0
- package/src/define/json-tree.ts +9 -0
- package/src/define/lanes.ts +9 -0
- package/src/define/markdown.ts +9 -0
- package/src/define/matrix.ts +9 -0
- package/src/define/segmented.ts +9 -0
- package/src/define/tiles.ts +11 -0
- package/src/define/transcript.ts +9 -0
- package/src/define/tree.ts +9 -0
- package/src/graph/arrange.ts +399 -0
- package/src/graph/card.ts +209 -0
- package/src/graph/host.ts +100 -0
- package/src/graph/icons.ts +23 -0
- package/src/graph/index.ts +16 -0
- package/src/graph/layered-graph.ts +417 -0
- package/src/graph/layout.ts +331 -0
- package/src/graph/marks.ts +42 -0
- package/src/graph/nav.ts +19 -0
- package/src/graph/pan-zoom.ts +219 -0
- package/src/graph/paths.ts +41 -0
- package/src/graph/place-card.ts +93 -0
- package/src/graph/strings.ts +86 -0
- package/src/graph/styles.ts +204 -0
- package/src/graph/types.ts +202 -0
- package/src/graph/view.ts +28 -0
- package/src/graph/views/dag.ts +294 -0
- package/src/graph/views/foot.ts +109 -0
- package/src/graph/views/node-table.ts +90 -0
- package/src/index.ts +27 -0
- package/src/json/index.ts +2 -0
- package/src/json/json-tree.ts +49 -0
- package/src/lanes/index.ts +6 -0
- package/src/lanes/lanes.ts +143 -0
- package/src/lanes/stack.ts +51 -0
- package/src/lanes/styles.ts +30 -0
- package/src/lanes/types.ts +51 -0
- package/src/markdown/cae-markdown.ts +64 -0
- package/src/markdown/highlight.ts +2 -0
- package/src/markdown/index.ts +5 -0
- package/src/markdown/markdown.ts +110 -0
- package/src/matrix/grid-step.ts +58 -0
- package/src/matrix/index.ts +6 -0
- package/src/matrix/mark-matrix.ts +285 -0
- package/src/matrix/styles.ts +48 -0
- package/src/matrix/types.ts +83 -0
- package/src/primitives/fact-line.ts +26 -0
- package/src/primitives/icon.ts +26 -0
- package/src/primitives/index.ts +12 -0
- package/src/primitives/legend.ts +56 -0
- package/src/primitives/pill.ts +58 -0
- package/src/primitives/roving-focus.ts +138 -0
- package/src/primitives/segmented.ts +92 -0
- package/src/primitives/share-bar.ts +94 -0
- package/src/primitives/states.ts +28 -0
- package/src/primitives/window.ts +65 -0
- package/src/styles/chips.ts +18 -0
- package/src/styles/facts.ts +7 -0
- package/src/styles/index.ts +19 -0
- package/src/styles/layout.ts +33 -0
- package/src/styles/marks.ts +30 -0
- package/src/styles/meter.ts +9 -0
- package/src/styles/motion.ts +27 -0
- package/src/styles/prose.ts +64 -0
- package/src/styles/reset.ts +13 -0
- package/src/styles/status.ts +52 -0
- package/src/styles/text.ts +21 -0
- package/src/styles/tokens.ts +35 -0
- package/src/table/data-table.ts +367 -0
- package/src/table/index.ts +5 -0
- package/src/table/styles.ts +32 -0
- package/src/table/types.ts +73 -0
- package/src/themes/boot.ts +14 -0
- package/src/themes/choice.ts +47 -0
- package/src/themes/data.ts +433 -0
- package/src/themes/index.ts +10 -0
- package/src/themes/sheet.ts +29 -0
- package/src/themes/token-meanings.ts +67 -0
- package/src/themes/tokens-list.ts +82 -0
- package/src/tiles/index.ts +5 -0
- package/src/tiles/stat-tiles.ts +92 -0
- package/src/tiles/styles.ts +23 -0
- package/src/tiles/types.ts +20 -0
- package/src/transcript/follow-scroll.ts +72 -0
- package/src/transcript/index.ts +6 -0
- package/src/transcript/styles.ts +114 -0
- package/src/transcript/tags.ts +18 -0
- package/src/transcript/tool-card.ts +103 -0
- package/src/transcript/transcript.ts +358 -0
- package/src/transcript/types.ts +167 -0
- package/src/tree/index.ts +3 -0
- 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
|
+

|
|
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
|
+

|
|
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
|
+

|
|
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
|
+

|
|
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
|
+

|
|
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"}
|
package/docs/strings.md
ADDED
|
@@ -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.
|
package/docs/theming.md
ADDED
|
@@ -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
|
+

|
|
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
|
+

|
|
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`.
|