basalt-ui 3.0.0 → 3.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.
- package/AGENTS.md +1 -0
- package/CHANGELOG.md +72 -39
- package/MIGRATING.md +44 -2
- package/README.md +39 -12
- package/agent/rules/basalt-tokens.md +1 -1
- package/agent/rules/basalt-ui.md +3 -3
- package/agent/skills/basalt-app/references/live.md +4 -4
- package/agent/skills/basalt-app/references/migrate.md +2 -2
- package/agent/skills/basalt-app/references/setup.md +17 -8
- package/agent/skills/basalt-app/references/testing.md +8 -6
- package/agent/skills/basalt-design/SKILL.md +2 -1
- package/agent/skills/basalt-design/references/controls.md +1 -0
- package/agent/skills/basalt-design/references/parts.md +5 -1
- package/agent/templates/AGENTS-block.md.tpl +6 -23
- package/agent/templates/AGENTS-block.site.md.tpl +5 -18
- package/agent/templates/AGENTS-block.tokens.md.tpl +3 -7
- package/agent/templates/DESIGN.md.tpl +1 -1
- package/agent/templates/_app-error.i18n.tpl +8 -32
- package/agent/templates/_app-error.tpl +8 -32
- package/agent/templates/_app-pending.i18n.tpl +5 -3
- package/agent/templates/_app-pending.tpl +5 -4
- package/agent/templates/main.i18n.tpl +8 -3
- package/agent/templates/main.tpl +8 -3
- package/agent/templates/router.start.tpl +8 -3
- package/agent/templates/seed-messages.json +0 -30
- package/configs/oxlint-app.json +9 -1
- package/configs/oxlint-bridge.json +3 -1
- package/configs/oxlint-parts.json +9 -1
- package/configs/oxlint-site.json +3 -1
- package/dist/astro/shiki.d.ts +3 -2
- package/dist/astro/shiki.d.ts.map +1 -1
- package/dist/cards/bar-list.d.ts.map +1 -1
- package/dist/cards/bar-list.js +2 -1
- package/dist/cards/chain-view.d.ts +37 -8
- package/dist/cards/chain-view.d.ts.map +1 -1
- package/dist/cards/chain-view.js +105 -38
- package/dist/cards/contract.d.ts +8 -1
- package/dist/cards/contract.d.ts.map +1 -1
- package/dist/cards/data-panel.d.ts.map +1 -1
- package/dist/cards/data-panel.js +1 -0
- package/dist/cards/event-list.d.ts.map +1 -1
- package/dist/cards/event-list.js +3 -2
- package/dist/cards/index.d.ts +1 -1
- package/dist/cards/index.d.ts.map +1 -1
- package/dist/cards/row-list.d.ts.map +1 -1
- package/dist/cards/row-list.js +2 -1
- package/dist/cards/stat-card-parts.d.ts +3 -3
- package/dist/cards/stat-card-parts.d.ts.map +1 -1
- package/dist/cards/stat-card-parts.js +8 -2
- package/dist/cards/stat-card.d.ts.map +1 -1
- package/dist/cards/stat-card.js +34 -9
- package/dist/charts/core/compile.d.ts +2 -0
- package/dist/charts/core/compile.d.ts.map +1 -1
- package/dist/charts/core/compile.js +16 -8
- package/dist/charts/core/cursor.d.ts +2 -1
- package/dist/charts/core/cursor.d.ts.map +1 -1
- package/dist/charts/core/cursor.js +8 -1
- package/dist/charts/core/tooltip-said.d.ts +16 -0
- package/dist/charts/core/tooltip-said.d.ts.map +1 -0
- package/dist/charts/core/tooltip-said.js +39 -0
- package/dist/charts/focus.d.ts.map +1 -1
- package/dist/charts/focus.js +1 -1
- package/dist/charts/parts/chart-card.d.ts.map +1 -1
- package/dist/charts/parts/chart-card.js +1 -0
- package/dist/cli/agent-note.d.ts +3 -3
- package/dist/cli/agent-note.d.ts.map +1 -1
- package/dist/cli/agent-note.js +5 -5
- package/dist/cli/budget/index.d.ts +7 -0
- package/dist/cli/budget/index.d.ts.map +1 -1
- package/dist/cli/budget/index.js +11 -5
- package/dist/cli/config.d.ts +1 -1
- package/dist/cli/doctor/app.d.ts.map +1 -1
- package/dist/cli/doctor/app.js +53 -24
- package/dist/cli/doctor/eject.d.ts.map +1 -1
- package/dist/cli/doctor/eject.js +16 -9
- package/dist/cli/doctor/guards.d.ts.map +1 -1
- package/dist/cli/doctor/guards.js +11 -8
- package/dist/cli/doctor/hook.js +1 -1
- package/dist/cli/doctor/install.d.ts.map +1 -1
- package/dist/cli/doctor/install.js +46 -22
- package/dist/cli/doctor/translations.d.ts.map +1 -1
- package/dist/cli/doctor/translations.js +11 -4
- package/dist/cli/doctor/types.d.ts +2 -2
- package/dist/cli/doctor/types.d.ts.map +1 -1
- package/dist/cli/doctor/types.js +1 -1
- package/dist/cli/doctor/wiring.d.ts.map +1 -1
- package/dist/cli/doctor/wiring.js +26 -15
- package/dist/cli/eject/dropped-slots.d.ts +6 -0
- package/dist/cli/eject/dropped-slots.d.ts.map +1 -0
- package/dist/cli/eject/dropped-slots.js +9 -0
- package/dist/cli/eject/index.d.ts.map +1 -1
- package/dist/cli/eject/index.js +9 -8
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +7 -2
- package/dist/cli/index.d.ts +6 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +38 -7
- package/dist/cli/init/index.d.ts +10 -0
- package/dist/cli/init/index.d.ts.map +1 -1
- package/dist/cli/init/index.js +61 -10
- package/dist/cli/init/locales.d.ts +7 -0
- package/dist/cli/init/locales.d.ts.map +1 -1
- package/dist/cli/init/locales.js +21 -6
- package/dist/cli/init/router-seeds.d.ts.map +1 -1
- package/dist/cli/init/router-seeds.js +16 -3
- package/dist/cli/init/steps.d.ts +36 -3
- package/dist/cli/init/steps.d.ts.map +1 -1
- package/dist/cli/init/steps.js +201 -34
- package/dist/cli/lint/baseline.d.ts +27 -0
- package/dist/cli/lint/baseline.d.ts.map +1 -0
- package/dist/cli/lint/baseline.js +96 -0
- package/dist/cli/lint/engine.d.ts +2 -0
- package/dist/cli/lint/engine.d.ts.map +1 -1
- package/dist/cli/lint/engine.js +18 -8
- package/dist/cli/lint/hook.d.ts.map +1 -1
- package/dist/cli/lint/hook.js +8 -3
- package/dist/cli/lint/index.d.ts +3 -0
- package/dist/cli/lint/index.d.ts.map +1 -1
- package/dist/cli/lint/index.js +67 -8
- package/dist/cli/manifest.d.ts +46 -3
- package/dist/cli/manifest.d.ts.map +1 -1
- package/dist/cli/manifest.js +71 -1
- package/dist/cli/migrate/census.d.ts +6 -0
- package/dist/cli/migrate/census.d.ts.map +1 -1
- package/dist/cli/migrate/census.js +22 -1
- package/dist/cli/migrate/index.d.ts +5 -0
- package/dist/cli/migrate/index.d.ts.map +1 -1
- package/dist/cli/migrate/index.js +36 -3
- package/dist/cli/migrate/lost-classes.d.ts +20 -0
- package/dist/cli/migrate/lost-classes.d.ts.map +1 -0
- package/dist/cli/migrate/lost-classes.js +145 -0
- package/dist/cli/migrate/rows.d.ts +10 -0
- package/dist/cli/migrate/rows.d.ts.map +1 -1
- package/dist/cli/migrate/rows.js +15 -0
- package/dist/cli/package-manager.d.ts.map +1 -1
- package/dist/cli/package-manager.js +2 -1
- package/dist/cli/peers.d.ts +2 -0
- package/dist/cli/peers.d.ts.map +1 -1
- package/dist/cli/peers.js +7 -0
- package/dist/cli/presets.d.ts.map +1 -1
- package/dist/cli/presets.js +27 -11
- package/dist/cli/resolver.d.ts +13 -4
- package/dist/cli/resolver.d.ts.map +1 -1
- package/dist/cli/resolver.js +39 -5
- package/dist/cli/router-wiring.d.ts +1 -0
- package/dist/cli/router-wiring.d.ts.map +1 -1
- package/dist/cli/router-wiring.js +1 -1
- package/dist/cli/sync/engine.d.ts +8 -1
- package/dist/cli/sync/engine.d.ts.map +1 -1
- package/dist/cli/sync/engine.js +25 -14
- package/dist/cli/sync/index.d.ts.map +1 -1
- package/dist/cli/sync/index.js +7 -4
- package/dist/cli/sync/render.d.ts.map +1 -1
- package/dist/cli/sync/render.js +21 -28
- package/dist/cli/tokens-css.d.ts +2 -0
- package/dist/cli/tokens-css.d.ts.map +1 -1
- package/dist/cli/tokens-css.js +28 -6
- package/dist/controls/contract.d.ts +2 -1
- package/dist/controls/contract.d.ts.map +1 -1
- package/dist/controls/control-home.d.ts +4 -1
- package/dist/controls/control-home.d.ts.map +1 -1
- package/dist/controls/control-home.js +5 -3
- package/dist/controls/local-control.d.ts +28 -1
- package/dist/controls/local-control.d.ts.map +1 -1
- package/dist/controls/local-control.js +14 -2
- package/dist/core/cn.d.ts.map +1 -1
- package/dist/core/cn.js +6 -5
- package/dist/core/frame-figure.d.ts +2 -0
- package/dist/core/frame-figure.d.ts.map +1 -1
- package/dist/core/frame-figure.js +5 -2
- package/dist/core/frame-head.d.ts +3 -1
- package/dist/core/frame-head.d.ts.map +1 -1
- package/dist/core/frame-head.js +28 -7
- package/dist/core/frame-regions.d.ts +1 -1
- package/dist/core/frame-regions.d.ts.map +1 -1
- package/dist/core/frame-regions.js +18 -8
- package/dist/core/info-hint.d.ts +5 -0
- package/dist/core/info-hint.d.ts.map +1 -1
- package/dist/core/info-hint.js +22 -1
- package/dist/core/mark-tone.d.ts +6 -2
- package/dist/core/mark-tone.d.ts.map +1 -1
- package/dist/core/mark-tone.js +1 -1
- package/dist/core/mark-types.d.ts +4 -2
- package/dist/core/mark-types.d.ts.map +1 -1
- package/dist/core/messages/chain.d.ts +2 -1
- package/dist/core/messages/chain.d.ts.map +1 -1
- package/dist/core/messages/chain.js +1 -0
- package/dist/core/messages/index.d.ts +2 -1
- package/dist/core/messages/index.d.ts.map +1 -1
- package/dist/core/messages/index.js +2 -0
- package/dist/core/messages/runs.d.ts +20 -0
- package/dist/core/messages/runs.d.ts.map +1 -0
- package/dist/core/messages/runs.js +18 -0
- package/dist/core/phase.d.ts +25 -2
- package/dist/core/phase.d.ts.map +1 -1
- package/dist/core/ports.d.ts +4 -1
- package/dist/core/ports.d.ts.map +1 -1
- package/dist/core/provider.d.ts +3 -1
- package/dist/core/provider.d.ts.map +1 -1
- package/dist/core/provider.js +5 -3
- package/dist/core/scheme.d.ts +2 -1
- package/dist/core/scheme.d.ts.map +1 -1
- package/dist/core/scheme.js +1 -0
- package/dist/core/spark/mini-bars.d.ts +6 -4
- package/dist/core/spark/mini-bars.d.ts.map +1 -1
- package/dist/core/spark/mini-bars.js +36 -11
- package/dist/core/spark/sparkline.d.ts +2 -2
- package/dist/core/spark/sparkline.d.ts.map +1 -1
- package/dist/core/spark/sparkline.js +21 -2
- package/dist/css/bridge.css +63 -0
- package/dist/css/generate.d.ts +2 -2
- package/dist/css/generate.d.ts.map +1 -1
- package/dist/css/generate.js +25 -0
- package/dist/data/live/live-query.d.ts +2 -2
- package/dist/data/live/live-query.d.ts.map +1 -1
- package/dist/data/live/live-query.js +2 -1
- package/dist/lint/preset.d.ts +12 -3
- package/dist/lint/preset.d.ts.map +1 -1
- package/dist/lint/preset.js +30 -10
- package/dist/lint/rules/class/table.d.ts.map +1 -1
- package/dist/lint/rules/class/table.js +3 -1
- package/dist/lint/rules/structure/control-home.js +1 -1
- package/dist/lint/rules/structure/import-boundary.d.ts.map +1 -1
- package/dist/lint/rules/structure/import-boundary.js +2 -0
- package/dist/lint/rules/structure/label-literal.d.ts.map +1 -1
- package/dist/lint/rules/structure/label-literal.js +1 -1
- package/dist/lint/shadcn.d.ts +562 -0
- package/dist/lint/shadcn.d.ts.map +1 -0
- package/dist/lint/shadcn.js +52 -0
- package/dist/lint/stylelint/render.d.ts +3 -1
- package/dist/lint/stylelint/render.d.ts.map +1 -1
- package/dist/lint/stylelint/render.js +23 -2
- package/dist/lint/stylelint/rules.d.ts +3 -2
- package/dist/lint/stylelint/rules.d.ts.map +1 -1
- package/dist/lint/stylelint/rules.js +11 -6
- package/dist/lint/weakened.d.ts +8 -0
- package/dist/lint/weakened.d.ts.map +1 -1
- package/dist/lint/weakened.js +44 -1
- package/dist/messages/de.d.ts.map +1 -1
- package/dist/messages/de.js +15 -0
- package/dist/messages/es.d.ts.map +1 -1
- package/dist/messages/es.js +15 -0
- package/dist/messages/fr.d.ts.map +1 -1
- package/dist/messages/fr.js +15 -0
- package/dist/messages/zh-hans.d.ts.map +1 -1
- package/dist/messages/zh-hans.js +15 -0
- package/dist/page/bar-title.d.ts +25 -0
- package/dist/page/bar-title.d.ts.map +1 -0
- package/dist/page/bar-title.js +10 -0
- package/dist/page/contract.d.ts +11 -1
- package/dist/page/contract.d.ts.map +1 -1
- package/dist/page/empty-state.d.ts +5 -2
- package/dist/page/empty-state.d.ts.map +1 -1
- package/dist/page/empty-state.js +14 -3
- package/dist/page/facts.d.ts +19 -2
- package/dist/page/facts.d.ts.map +1 -1
- package/dist/page/facts.js +26 -5
- package/dist/page/index.d.ts +8 -0
- package/dist/page/index.d.ts.map +1 -1
- package/dist/page/index.js +9 -0
- package/dist/page/page-bar.d.ts.map +1 -1
- package/dist/page/page-bar.js +2 -7
- package/dist/page/page-summary.d.ts +2 -1
- package/dist/page/page-summary.d.ts.map +1 -1
- package/dist/page/page-summary.js +1 -1
- package/dist/page/run-button.d.ts +26 -0
- package/dist/page/run-button.d.ts.map +1 -0
- package/dist/page/run-button.js +31 -0
- package/dist/page/run-list.d.ts +28 -0
- package/dist/page/run-list.d.ts.map +1 -0
- package/dist/page/run-list.js +88 -0
- package/dist/page/run-queue.d.ts +78 -0
- package/dist/page/run-queue.d.ts.map +1 -0
- package/dist/page/run-queue.js +93 -0
- package/dist/page/section.d.ts +6 -1
- package/dist/page/section.d.ts.map +1 -1
- package/dist/page/section.js +34 -16
- package/dist/shell/commands/command-palette.d.ts.map +1 -1
- package/dist/shell/commands/command-palette.js +5 -1
- package/dist/shell/parts/header.js +1 -1
- package/dist/surfaces.d.ts +15 -1
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +19 -2
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3 -0
- package/dist/testing/pseudo-locale.d.ts +41 -0
- package/dist/testing/pseudo-locale.d.ts.map +1 -0
- package/dist/testing/pseudo-locale.js +74 -0
- package/dist/testing/quality.d.ts +6 -0
- package/dist/testing/quality.d.ts.map +1 -1
- package/dist/testing/quality.js +139 -1
- package/dist/tokens/bridge-sheet.d.ts +21 -0
- package/dist/tokens/bridge-sheet.d.ts.map +1 -0
- package/dist/tokens/bridge-sheet.js +68 -0
- package/dist/tokens/emit.d.ts +6 -1
- package/dist/tokens/emit.d.ts.map +1 -1
- package/dist/tokens/emit.js +26 -1
- package/dist/ui/accordion.js +1 -1
- package/dist/ui/card.d.ts +32 -4
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +26 -3
- package/dist/ui/collapsible.d.ts +4 -2
- package/dist/ui/collapsible.d.ts.map +1 -1
- package/dist/ui/collapsible.js +1 -1
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/meter.d.ts +34 -3
- package/dist/ui/meter.d.ts.map +1 -1
- package/dist/ui/meter.guard.d.ts +2 -0
- package/dist/ui/meter.guard.d.ts.map +1 -1
- package/dist/ui/meter.guard.js +20 -0
- package/dist/ui/meter.js +23 -7
- package/dist/ui/primitive.contract.d.ts.map +1 -1
- package/dist/ui/primitive.contract.js +7 -0
- package/dist/ui/remote-pad.d.ts +62 -0
- package/dist/ui/remote-pad.d.ts.map +1 -0
- package/dist/ui/remote-pad.guard.d.ts +21 -0
- package/dist/ui/remote-pad.guard.d.ts.map +1 -0
- package/dist/ui/remote-pad.guard.js +6 -0
- package/dist/ui/remote-pad.js +148 -0
- package/dist/ui/segmented.d.ts.map +1 -1
- package/dist/ui/segmented.js +4 -0
- package/dist/ui/skeleton.d.ts +9 -4
- package/dist/ui/skeleton.d.ts.map +1 -1
- package/dist/ui/skeleton.guard.d.ts +6 -2
- package/dist/ui/skeleton.guard.d.ts.map +1 -1
- package/dist/ui/skeleton.guard.js +4 -0
- package/dist/ui/skeleton.js +2 -1
- package/dist/ui/slots.d.ts +2 -1
- package/dist/ui/slots.d.ts.map +1 -1
- package/dist/ui/slots.js +2 -1
- package/dist/vite/allotment.d.ts +1 -1
- package/dist/vite/allotment.d.ts.map +1 -1
- package/dist/vite/allotment.js +15 -1
- package/dist/vite/doc.d.ts +1 -1
- package/dist/vite/doc.d.ts.map +1 -1
- package/dist/vite/doc.js +12 -2
- package/dist/vite/head.d.ts +4 -3
- package/dist/vite/head.d.ts.map +1 -1
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +4 -1
- package/dist/vite/shell-worker.d.ts +6 -0
- package/dist/vite/shell-worker.d.ts.map +1 -0
- package/dist/vite/shell-worker.js +92 -0
- package/docs/astro.md +19 -4
- package/docs/bar-list.md +3 -2
- package/docs/bar-title.md +33 -0
- package/docs/basalt-provider.md +2 -1
- package/docs/card.md +24 -4
- package/docs/chain-view.md +12 -7
- package/docs/chart-card.md +3 -2
- package/docs/collapsible.md +4 -2
- package/docs/control-home.md +4 -2
- package/docs/create-run-queue.md +40 -0
- package/docs/data-panel.md +3 -2
- package/docs/de.md +1 -1
- package/docs/empty-state.md +3 -1
- package/docs/es.md +1 -1
- package/docs/event-list.md +3 -2
- package/docs/fact.md +6 -1
- package/docs/facts.md +5 -1
- package/docs/fr.md +1 -1
- package/docs/live-query.md +1 -1
- package/docs/meter.md +17 -13
- package/docs/mini-bars.md +7 -5
- package/docs/pseudo-basalt-messages.md +30 -0
- package/docs/pseudo-messages.md +27 -0
- package/docs/quality.md +2 -1
- package/docs/recipes/localise-app.md +2 -2
- package/docs/remote-pad.md +40 -0
- package/docs/row-list.md +3 -2
- package/docs/run-button.md +45 -0
- package/docs/run-list.md +71 -0
- package/docs/section.md +7 -1
- package/docs/set-scheme.md +2 -2
- package/docs/skeleton.md +4 -3
- package/docs/slots.md +1 -1
- package/docs/sparkline.md +5 -2
- package/docs/stat-card.md +6 -4
- package/docs/testing.md +64 -0
- package/docs/use-local-control.md +8 -1
- package/docs/use-runs.md +32 -0
- package/docs/vite.md +12 -2
- package/docs/zh-hans.md +1 -1
- package/llms.txt +88 -21
- package/migrations/areas/shadcn.json +338 -0
- package/package.json +9 -2
- package/src/astro/shiki.ts +3 -1
- package/src/cards/bar-list.tsx +2 -1
- package/src/cards/chain-view.tsx +167 -55
- package/src/cards/contract.ts +8 -1
- package/src/cards/data-panel.tsx +1 -0
- package/src/cards/event-list.tsx +2 -1
- package/src/cards/index.ts +1 -0
- package/src/cards/row-list.tsx +2 -1
- package/src/cards/stat-card-parts.tsx +9 -7
- package/src/cards/stat-card.tsx +39 -12
- package/src/charts/core/compile.ts +31 -19
- package/src/charts/core/cursor.ts +11 -3
- package/src/charts/core/tooltip-said.ts +55 -0
- package/src/charts/focus.tsx +4 -1
- package/src/charts/parts/chart-card.tsx +1 -0
- package/src/cli/agent-note.ts +12 -5
- package/src/cli/budget/index.ts +22 -5
- package/src/cli/config.ts +1 -1
- package/src/cli/doctor/app.ts +75 -23
- package/src/cli/doctor/eject.ts +30 -10
- package/src/cli/doctor/guards.ts +11 -8
- package/src/cli/doctor/hook.ts +1 -1
- package/src/cli/doctor/install.ts +61 -24
- package/src/cli/doctor/translations.ts +13 -4
- package/src/cli/doctor/types.ts +2 -3
- package/src/cli/doctor/wiring.ts +30 -16
- package/src/cli/eject/dropped-slots.ts +11 -0
- package/src/cli/eject/index.ts +13 -9
- package/src/cli/help.ts +34 -10
- package/src/cli/index.ts +56 -14
- package/src/cli/init/index.ts +64 -5
- package/src/cli/init/locales.ts +41 -8
- package/src/cli/init/router-seeds.ts +17 -3
- package/src/cli/init/steps.ts +308 -41
- package/src/cli/lint/baseline.ts +141 -0
- package/src/cli/lint/engine.ts +33 -10
- package/src/cli/lint/hook.ts +11 -3
- package/src/cli/lint/index.ts +77 -12
- package/src/cli/manifest.ts +132 -4
- package/src/cli/migrate/census.ts +35 -1
- package/src/cli/migrate/index.ts +46 -3
- package/src/cli/migrate/lost-classes.ts +203 -0
- package/src/cli/migrate/rows.ts +21 -0
- package/src/cli/package-manager.ts +4 -1
- package/src/cli/peers.ts +11 -0
- package/src/cli/presets.ts +32 -11
- package/src/cli/resolver.ts +58 -10
- package/src/cli/router-wiring.ts +3 -1
- package/src/cli/sync/engine.ts +30 -14
- package/src/cli/sync/index.ts +7 -4
- package/src/cli/sync/render.ts +29 -37
- package/src/cli/tokens-css.ts +42 -5
- package/src/controls/contract.ts +2 -0
- package/src/controls/control-home.tsx +15 -4
- package/src/controls/local-control.ts +49 -3
- package/src/core/cn.ts +9 -5
- package/src/core/frame-figure.tsx +7 -1
- package/src/core/frame-head.tsx +32 -6
- package/src/core/frame-regions.tsx +18 -8
- package/src/core/info-hint.tsx +26 -0
- package/src/core/mark-tone.ts +10 -3
- package/src/core/mark-types.ts +4 -2
- package/src/core/messages/chain.ts +2 -1
- package/src/core/messages/index.ts +4 -0
- package/src/core/messages/runs.ts +40 -0
- package/src/core/phase.ts +22 -2
- package/src/core/ports.ts +13 -1
- package/src/core/provider.tsx +7 -3
- package/src/core/scheme.ts +6 -2
- package/src/core/spark/mini-bars.tsx +59 -15
- package/src/core/spark/sparkline.tsx +26 -4
- package/src/css/bridge.css +63 -0
- package/src/css/generate.ts +40 -3
- package/src/data/live/live-query.ts +4 -3
- package/src/lint/preset.ts +52 -13
- package/src/lint/rules/class/table.ts +3 -1
- package/src/lint/rules/structure/control-home.ts +1 -1
- package/src/lint/rules/structure/import-boundary.ts +2 -0
- package/src/lint/rules/structure/label-literal.ts +3 -1
- package/src/lint/shadcn.ts +91 -0
- package/src/lint/stylelint/render.ts +31 -1
- package/src/lint/stylelint/rules.ts +19 -7
- package/src/lint/weakened.ts +59 -1
- package/src/messages/de.ts +20 -0
- package/src/messages/es.ts +20 -0
- package/src/messages/fr.ts +20 -0
- package/src/messages/zh-hans.ts +20 -0
- package/src/page/bar-title.tsx +35 -0
- package/src/page/contract.ts +11 -1
- package/src/page/empty-state.tsx +18 -8
- package/src/page/facts.tsx +43 -5
- package/src/page/index.ts +8 -0
- package/src/page/page-bar.tsx +2 -9
- package/src/page/page-summary.tsx +4 -3
- package/src/page/run-button.tsx +52 -0
- package/src/page/run-list.tsx +151 -0
- package/src/page/run-queue.ts +185 -0
- package/src/page/section.tsx +30 -5
- package/src/shell/commands/command-palette.tsx +10 -1
- package/src/shell/parts/header.tsx +1 -1
- package/src/surfaces.ts +18 -1
- package/src/testing/index.ts +1 -0
- package/src/testing/pseudo-locale.ts +149 -0
- package/src/testing/quality.ts +188 -0
- package/src/tokens/bridge-sheet.ts +80 -0
- package/src/tokens/emit.ts +45 -6
- package/src/ui/accordion.tsx +1 -1
- package/src/ui/card.tsx +56 -6
- package/src/ui/collapsible.tsx +5 -3
- package/src/ui/combobox.tsx +1 -1
- package/src/ui/meter.guard.ts +23 -0
- package/src/ui/meter.tsx +76 -27
- package/src/ui/no-restyle.generated.json +8 -0
- package/src/ui/primitive.contract.ts +7 -0
- package/src/ui/remote-pad.guard.ts +24 -0
- package/src/ui/remote-pad.tsx +249 -0
- package/src/ui/segmented.tsx +6 -0
- package/src/ui/skeleton.guard.ts +7 -2
- package/src/ui/skeleton.tsx +10 -4
- package/src/ui/slots.ts +2 -1
- package/src/vite/allotment.ts +15 -1
- package/src/vite/doc.ts +12 -2
- package/src/vite/head.ts +4 -3
- package/src/vite/index.ts +4 -1
- package/src/vite/shell-worker.ts +115 -0
package/src/cards/chain-view.tsx
CHANGED
|
@@ -5,7 +5,8 @@ import { cn } from '../core/cn'
|
|
|
5
5
|
import { useMessages } from '../core/messages/use-messages'
|
|
6
6
|
import { common } from '../core/messages/common'
|
|
7
7
|
import { chain } from '../core/messages/chain'
|
|
8
|
-
import type { ListFocus, Verdict } from '../core/ports'
|
|
8
|
+
import type { IconComponent, LinkHref, ListFocus, Verdict } from '../core/ports'
|
|
9
|
+
import { AppLink } from '../core/link'
|
|
9
10
|
import { parentsOf } from '../common/nest'
|
|
10
11
|
import { Button } from '../ui/button'
|
|
11
12
|
import { ScrollArea } from '../ui/scroll-area'
|
|
@@ -28,6 +29,16 @@ export type ChainFace = {
|
|
|
28
29
|
sub?: string | undefined
|
|
29
30
|
/** A dot and a word for the node's state. */
|
|
30
31
|
status?: Verdict | undefined
|
|
32
|
+
icon?: IconComponent | undefined
|
|
33
|
+
/** Short chips, in reading order; a chip may link independently of the record. */
|
|
34
|
+
meta?: readonly { label: string; href?: LinkHref | undefined }[] | undefined
|
|
35
|
+
reason?: { label: string; icon?: IconComponent | undefined } | undefined
|
|
36
|
+
/** A formatted age, such as “3 days ago”. */
|
|
37
|
+
age?: string | undefined
|
|
38
|
+
planned?: boolean | undefined
|
|
39
|
+
selected?: boolean | undefined
|
|
40
|
+
/** The record destination. Takes precedence over onActivate for this node. */
|
|
41
|
+
href?: LinkHref | undefined
|
|
31
42
|
/**
|
|
32
43
|
* Finished: what waits on it no longer waits on it. An edge out of a done node is drawn dashed
|
|
33
44
|
* (done), out of any other node solid in the warn hue (blocks), and a node with a blocking edge in
|
|
@@ -48,35 +59,39 @@ export type ChainViewProps<T> = {
|
|
|
48
59
|
*/
|
|
49
60
|
waitsOn: (node: T) => readonly string[]
|
|
50
61
|
face: (node: T) => ChainFace
|
|
51
|
-
/** A click or Enter on a node
|
|
62
|
+
/** A click or Enter on a node without an href (for example, a folded group). */
|
|
52
63
|
onActivate?: ((node: T) => void) | undefined
|
|
64
|
+
/** Uniform graph card dimensions in px. Defaults to 200 × 64; allow more room for record faces. */
|
|
65
|
+
nodeSize?: { width: number; height: number } | undefined
|
|
66
|
+
/** Fit the listed nodes after they appear. Change the key to repeat the request. Unknown ids are ignored. */
|
|
67
|
+
fitRequest?: { key: string; ids: readonly string[] } | undefined
|
|
53
68
|
/**
|
|
54
69
|
* A focus shared with a table or a chart over the same records (`useChartFocus(rows, …)`): a node
|
|
55
70
|
* maps to its item by `getId`, so the order of `focus.items` is free. Pointing at a node focuses
|
|
56
71
|
* its item and marks its row; a row focused elsewhere marks its node and the edges that touch it.
|
|
57
|
-
* The
|
|
72
|
+
* The graph adds one stop whose arrow keys step the shared focus. Chip links stay tabbable.
|
|
58
73
|
*/
|
|
59
74
|
focus?: ListFocus<T> | undefined
|
|
60
75
|
}
|
|
61
76
|
|
|
62
77
|
const NODE =
|
|
63
|
-
'relative flex h-full min-w-0 flex-col justify-center gap-1 overflow-hidden rounded-card bg-card px-3 text-
|
|
78
|
+
'relative isolate flex h-full min-w-0 flex-col justify-center gap-1 overflow-hidden rounded-card bg-card px-3 py-2 text-start text-foreground shadow-card'
|
|
64
79
|
const TARGET =
|
|
65
|
-
'
|
|
80
|
+
'absolute inset-0 z-1 rounded-card border-0 bg-transparent p-0 focus-ring focus-visible:-outline-offset-2'
|
|
66
81
|
/** A node waiting on an open blocker is outlined in the warn tone, its whole border, never one edge. */
|
|
67
|
-
const BLOCKED = 'border-warn'
|
|
82
|
+
const BLOCKED = 'border border-warn'
|
|
83
|
+
const CHIP = 'truncate rounded-ctrl bg-secondary px-1.5 text-muted-foreground'
|
|
68
84
|
|
|
69
|
-
function Face({
|
|
70
|
-
face
|
|
71
|
-
|
|
72
|
-
}: {
|
|
73
|
-
face: ChainFace
|
|
74
|
-
waitsOnLine: string | undefined
|
|
75
|
-
}): ReactElement {
|
|
85
|
+
function Face({ face }: { face: ChainFace }): ReactElement {
|
|
86
|
+
const Icon = face.icon
|
|
87
|
+
const ReasonIcon = face.reason?.icon
|
|
76
88
|
return (
|
|
77
89
|
<>
|
|
78
|
-
<span
|
|
79
|
-
{
|
|
90
|
+
<span className="flex min-w-0 items-center gap-2">
|
|
91
|
+
{Icon !== undefined && <Icon className="size-icon shrink-0" aria-hidden="true" />}
|
|
92
|
+
<span data-slot="chain-title" className="truncate text-sm font-medium" title={face.title}>
|
|
93
|
+
{face.title}
|
|
94
|
+
</span>
|
|
80
95
|
</span>
|
|
81
96
|
<span className="flex min-w-0 items-center justify-between gap-2">
|
|
82
97
|
<span className="min-w-0 truncate text-xs text-muted-foreground">{face.sub ?? ''}</span>
|
|
@@ -86,12 +101,42 @@ function Face({
|
|
|
86
101
|
</Status>
|
|
87
102
|
)}
|
|
88
103
|
</span>
|
|
89
|
-
{
|
|
104
|
+
{face.meta !== undefined && face.meta.length > 0 && (
|
|
105
|
+
<span className="flex min-w-0 flex-wrap items-center gap-1 text-xs">
|
|
106
|
+
{face.meta.map(({ label, href }, index) => {
|
|
107
|
+
return href === undefined ? (
|
|
108
|
+
<span key={index} className={CHIP} title={label}>
|
|
109
|
+
{label}
|
|
110
|
+
</span>
|
|
111
|
+
) : (
|
|
112
|
+
<AppLink
|
|
113
|
+
key={index}
|
|
114
|
+
href={href}
|
|
115
|
+
className={cn(CHIP, 'relative z-2 focus-ring hover:underline')}
|
|
116
|
+
title={label}
|
|
117
|
+
>
|
|
118
|
+
{label}
|
|
119
|
+
</AppLink>
|
|
120
|
+
)
|
|
121
|
+
})}
|
|
122
|
+
</span>
|
|
123
|
+
)}
|
|
124
|
+
{(face.reason !== undefined || face.age !== undefined) && (
|
|
125
|
+
<span className="flex min-w-0 items-center gap-2 text-xs text-muted-foreground">
|
|
126
|
+
{ReasonIcon !== undefined && (
|
|
127
|
+
<ReasonIcon className="size-icon shrink-0" aria-hidden="true" />
|
|
128
|
+
)}
|
|
129
|
+
<span className="min-w-0 flex-1 truncate" title={face.reason?.label}>
|
|
130
|
+
{face.reason?.label}
|
|
131
|
+
</span>
|
|
132
|
+
{face.age !== undefined && <span className="shrink-0">{face.age}</span>}
|
|
133
|
+
</span>
|
|
134
|
+
)}
|
|
90
135
|
</>
|
|
91
136
|
)
|
|
92
137
|
}
|
|
93
138
|
|
|
94
|
-
function Legend(): ReactElement {
|
|
139
|
+
function Legend({ planned }: { planned: boolean }): ReactElement {
|
|
95
140
|
const t = useMessages(chain, common)
|
|
96
141
|
return (
|
|
97
142
|
<ul
|
|
@@ -105,6 +150,12 @@ function Legend(): ReactElement {
|
|
|
105
150
|
</svg>
|
|
106
151
|
{t('chain.blocks')}
|
|
107
152
|
</li>
|
|
153
|
+
{planned && (
|
|
154
|
+
<li className="flex items-center gap-2">
|
|
155
|
+
<span className="h-3 w-6 rounded-ctrl border border-dashed border-line" />
|
|
156
|
+
{t('chain.planned')}
|
|
157
|
+
</li>
|
|
158
|
+
)}
|
|
108
159
|
<li className="flex items-center gap-2">
|
|
109
160
|
<svg viewBox="0 0 24 8" className="h-2 w-6">
|
|
110
161
|
<line
|
|
@@ -165,16 +216,19 @@ function StepIcon({ d }: { d: string }): ReactElement {
|
|
|
165
216
|
* A dependency chain: nodes that wait on other nodes, drawn left to right with each blocker left
|
|
166
217
|
* of what waits on it. Every edge leaves its blocker at the middle of the right side and ends in an
|
|
167
218
|
* arrowhead at the middle of the waiting node's left side; one from an open node is solid in the
|
|
168
|
-
* warn hue and
|
|
169
|
-
*
|
|
170
|
-
*
|
|
219
|
+
* warn hue and one from a done node is dashed. The legend labels the two styles; individual edges
|
|
220
|
+
* have no text label.
|
|
221
|
+
* A node waiting on an open blocker is outlined in the warn tone. The graph opens fitted to its
|
|
222
|
+
* width (never below half size) in a frame no taller than the page's visible scroll area: a drag on empty canvas, the
|
|
171
223
|
* wheel and one finger pan it, Ctrl or Cmd with the wheel, a pinch, the zoom buttons and the
|
|
172
224
|
* `+`, `-` and `0` keys zoom it. Pointing at a node (or focusing its row) lights its whole trace,
|
|
173
225
|
* every node it waits on and every node waiting on it; Focus (or `F`) holds that trace and zooms
|
|
174
226
|
* to it, Show all (or Escape) returns. Below 480 px of container it is a nested list instead, each
|
|
175
227
|
* node under the first node it waits on with the rest named. It shares a `focus` with a
|
|
176
228
|
* `DataTable` over the same records, so a node and its row are one item. The layout is the kit's
|
|
177
|
-
* own (no dependency), and nodes
|
|
229
|
+
* own (no dependency), and nodes cannot be dragged. Use a larger `nodeSize` for record faces with
|
|
230
|
+
* metadata and a reason. Folded groups are ordinary nodes whose activation changes `nodes`; pass a
|
|
231
|
+
* `fitRequest` with the revealed ids to bring those records into view.
|
|
178
232
|
*
|
|
179
233
|
* @useWhen records wait on other records (Issues, tasks, deploy steps) and the answer is what blocks what, beside the table of the same records
|
|
180
234
|
* @neverWhen the records form a strict tree with nothing to compare across branches (use `DataTable` with `nested`), or the relation is a flow of quantities (a chart)
|
|
@@ -197,6 +251,8 @@ export function ChainView<T>({
|
|
|
197
251
|
waitsOn,
|
|
198
252
|
face,
|
|
199
253
|
onActivate,
|
|
254
|
+
nodeSize,
|
|
255
|
+
fitRequest,
|
|
200
256
|
focus: focusSource,
|
|
201
257
|
}: ChainViewProps<T>): ReactElement {
|
|
202
258
|
// The trace follows the shared focus, so the chain reads it: it renders when the focused node moves.
|
|
@@ -208,8 +264,9 @@ export function ChainView<T>({
|
|
|
208
264
|
id: getId(node),
|
|
209
265
|
waitsOn: waitsOn(node).filter((id) => ids.has(id)),
|
|
210
266
|
}))
|
|
211
|
-
const
|
|
212
|
-
const
|
|
267
|
+
const size = { ...CHAIN_SIZE, ...nodeSize }
|
|
268
|
+
const geometry = chainLayout(inputs, size)
|
|
269
|
+
const { frame, width: frameWidth, zoomTo, ...view } = useViewport(geometry, CHAIN_VIEW)
|
|
213
270
|
const faces = new Map(nodes.map((node) => [getId(node), face(node)]))
|
|
214
271
|
const titleOf = (id: string): string => faces.get(id)?.title ?? id
|
|
215
272
|
const blockersOf = new Map(inputs.map((input) => [input.id, input.waitsOn]))
|
|
@@ -253,22 +310,35 @@ export function ChainView<T>({
|
|
|
253
310
|
return {
|
|
254
311
|
x,
|
|
255
312
|
y,
|
|
256
|
-
width: Math.max(...placed.map((at) => at.x)) +
|
|
257
|
-
height: Math.max(...placed.map((at) => at.y)) +
|
|
313
|
+
width: Math.max(...placed.map((at) => at.x)) + size.width - x,
|
|
314
|
+
height: Math.max(...placed.map((at) => at.y)) + size.height - y,
|
|
258
315
|
}
|
|
259
316
|
}
|
|
260
317
|
const hold = (id: string): void => {
|
|
261
318
|
setHeld(id)
|
|
262
319
|
const area = box(traceOf(id, blockersOf, waitersOf))
|
|
263
|
-
if (area !== undefined)
|
|
320
|
+
if (area !== undefined) zoomTo(area)
|
|
264
321
|
}
|
|
265
322
|
const release = (): void => {
|
|
266
323
|
setHeld(undefined)
|
|
267
324
|
view.fit()
|
|
268
325
|
}
|
|
269
326
|
|
|
270
|
-
// A node stepped to with the keys scrolls into the frame.
|
|
271
327
|
const graphRef = useRef<HTMLDivElement>(null)
|
|
328
|
+
const fittedRequest = useRef<string | undefined>(undefined)
|
|
329
|
+
const requestedBox = fitRequest === undefined ? undefined : box(new Set(fitRequest.ids))
|
|
330
|
+
useEffect(() => {
|
|
331
|
+
if (fitRequest === undefined) {
|
|
332
|
+
fittedRequest.current = undefined
|
|
333
|
+
return
|
|
334
|
+
}
|
|
335
|
+
if (frameWidth === 0 || requestedBox === undefined || fittedRequest.current === fitRequest.key)
|
|
336
|
+
return
|
|
337
|
+
fittedRequest.current = fitRequest.key
|
|
338
|
+
setHeld(undefined)
|
|
339
|
+
zoomTo(requestedBox)
|
|
340
|
+
}, [fitRequest, requestedBox, frameWidth, zoomTo])
|
|
341
|
+
// A node stepped to with the keys scrolls into the frame.
|
|
272
342
|
useEffect(() => {
|
|
273
343
|
const graph = graphRef.current
|
|
274
344
|
if (focusedId === undefined || graph === null || !graph.contains(document.activeElement)) {
|
|
@@ -321,12 +391,23 @@ export function ChainView<T>({
|
|
|
321
391
|
'aria-label': label,
|
|
322
392
|
tabIndex: 0,
|
|
323
393
|
onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => {
|
|
324
|
-
if (event.defaultPrevented) return
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
394
|
+
if (event.defaultPrevented || event.target !== event.currentTarget) return
|
|
395
|
+
if (
|
|
396
|
+
event.key === 'Enter' &&
|
|
397
|
+
focusedId !== undefined &&
|
|
398
|
+
!event.altKey &&
|
|
399
|
+
!event.ctrlKey &&
|
|
400
|
+
!event.metaKey &&
|
|
401
|
+
!event.shiftKey
|
|
402
|
+
) {
|
|
403
|
+
const target = graphRef.current?.querySelector<HTMLElement>(
|
|
404
|
+
`[data-slot="chain-node"][data-id="${CSS.escape(focusedId)}"] [data-slot="chain-target"]`,
|
|
405
|
+
)
|
|
406
|
+
if (target) {
|
|
407
|
+
event.preventDefault()
|
|
408
|
+
target.click()
|
|
409
|
+
return
|
|
410
|
+
}
|
|
330
411
|
}
|
|
331
412
|
shared.onKeyDown(event as unknown as KeyboardEvent<HTMLUListElement>)
|
|
332
413
|
},
|
|
@@ -341,25 +422,54 @@ export function ChainView<T>({
|
|
|
341
422
|
}
|
|
342
423
|
|
|
343
424
|
/** `roving`: a node of the graph, whose tab stop is the list when a focus is shared. */
|
|
344
|
-
const body = (node: T, id: string, roving: boolean): ReactElement => {
|
|
425
|
+
const body = (node: T, id: string, roving: boolean, index: number): ReactElement => {
|
|
345
426
|
const own = faces.get(id) ?? { title: id }
|
|
346
427
|
const blocked = isBlocked(id)
|
|
347
|
-
const
|
|
348
|
-
const
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
428
|
+
const interactive = own.href !== undefined || onActivate !== undefined
|
|
429
|
+
const description = [
|
|
430
|
+
...(interactive ? [own.sub, own.status?.label, own.reason?.label, own.age] : []),
|
|
431
|
+
own.planned ? t('chain.planned') : undefined,
|
|
432
|
+
waitsOnLine(id),
|
|
433
|
+
]
|
|
434
|
+
.filter(Boolean)
|
|
435
|
+
.join('. ')
|
|
436
|
+
const descriptionId = description
|
|
437
|
+
? `${marker}-${roving ? 'graph' : 'list'}-${index}`
|
|
438
|
+
: undefined
|
|
439
|
+
const target = {
|
|
440
|
+
'data-slot': 'chain-target',
|
|
441
|
+
'aria-label': own.title,
|
|
442
|
+
'aria-describedby': descriptionId,
|
|
443
|
+
title: own.title,
|
|
444
|
+
className: TARGET,
|
|
445
|
+
tabIndex: roving && focus !== undefined ? -1 : undefined,
|
|
446
|
+
}
|
|
447
|
+
return (
|
|
448
|
+
<div
|
|
449
|
+
className={cn(
|
|
450
|
+
NODE,
|
|
451
|
+
blocked && BLOCKED,
|
|
452
|
+
own.planned && 'border border-dashed',
|
|
453
|
+
own.planned && !blocked && 'border-line',
|
|
454
|
+
own.selected && 'ring-1 ring-inset ring-brand',
|
|
455
|
+
interactive && 'hover:bg-accent group-data-focused/node:bg-accent',
|
|
456
|
+
)}
|
|
357
457
|
data-blocked={blocked ? '' : undefined}
|
|
358
|
-
|
|
359
|
-
|
|
458
|
+
data-planned={own.planned ? '' : undefined}
|
|
459
|
+
data-selected={own.selected ? '' : undefined}
|
|
360
460
|
>
|
|
361
|
-
{
|
|
362
|
-
|
|
461
|
+
{own.href !== undefined ? (
|
|
462
|
+
<AppLink {...target} href={own.href} aria-current={own.selected ? 'true' : undefined} />
|
|
463
|
+
) : onActivate !== undefined ? (
|
|
464
|
+
<button {...target} type="button" onClick={() => onActivate(node)} />
|
|
465
|
+
) : null}
|
|
466
|
+
<Face face={own} />
|
|
467
|
+
{descriptionId !== undefined && (
|
|
468
|
+
<span id={descriptionId} className="sr-only">
|
|
469
|
+
{description}
|
|
470
|
+
</span>
|
|
471
|
+
)}
|
|
472
|
+
</div>
|
|
363
473
|
)
|
|
364
474
|
}
|
|
365
475
|
|
|
@@ -474,7 +584,7 @@ export function ChainView<T>({
|
|
|
474
584
|
)
|
|
475
585
|
})}
|
|
476
586
|
</svg>
|
|
477
|
-
{nodes.map((node) => {
|
|
587
|
+
{nodes.map((node, index) => {
|
|
478
588
|
const id = getId(node)
|
|
479
589
|
const at = geometry.nodes.get(id)
|
|
480
590
|
if (at === undefined) return null
|
|
@@ -493,8 +603,8 @@ export function ChainView<T>({
|
|
|
493
603
|
{
|
|
494
604
|
left: at.x,
|
|
495
605
|
top: at.y,
|
|
496
|
-
width:
|
|
497
|
-
height:
|
|
606
|
+
width: size.width,
|
|
607
|
+
height: size.height,
|
|
498
608
|
} as CSSProperties
|
|
499
609
|
}
|
|
500
610
|
onPointerEnter={(event) => {
|
|
@@ -502,7 +612,7 @@ export function ChainView<T>({
|
|
|
502
612
|
setPointed(id)
|
|
503
613
|
}}
|
|
504
614
|
>
|
|
505
|
-
{body(node, id, true)}
|
|
615
|
+
{body(node, id, true, index)}
|
|
506
616
|
</li>
|
|
507
617
|
)
|
|
508
618
|
})}
|
|
@@ -515,7 +625,7 @@ export function ChainView<T>({
|
|
|
515
625
|
aria-label={label}
|
|
516
626
|
className="m-0 flex list-none flex-col gap-2 p-0 @regular:hidden"
|
|
517
627
|
>
|
|
518
|
-
{nested.map(({ id, level }) => {
|
|
628
|
+
{nested.map(({ id, level }, index) => {
|
|
519
629
|
const node = byId.get(id)
|
|
520
630
|
if (node === undefined) return null
|
|
521
631
|
const more = (blockersOf.get(id) ?? []).slice(1)
|
|
@@ -527,7 +637,9 @@ export function ChainView<T>({
|
|
|
527
637
|
className="flex min-w-0 flex-col gap-1"
|
|
528
638
|
style={{ paddingInlineStart: `calc(var(--spacing) * ${level * 4})` }}
|
|
529
639
|
>
|
|
530
|
-
<div
|
|
640
|
+
<div style={{ minHeight: size.height }} className="grid">
|
|
641
|
+
{body(node, id, false, index)}
|
|
642
|
+
</div>
|
|
531
643
|
{more.length > 0 && (
|
|
532
644
|
<span className="truncate pl-3 text-xs text-muted-foreground">
|
|
533
645
|
{t('chain.alsoWaitsOn', more.map(titleOf).join(', '))}
|
|
@@ -538,7 +650,7 @@ export function ChainView<T>({
|
|
|
538
650
|
})}
|
|
539
651
|
</ul>
|
|
540
652
|
<div className="hidden flex-wrap items-center justify-between gap-3 @regular:flex">
|
|
541
|
-
<Legend />
|
|
653
|
+
<Legend planned={[...faces.values()].some((face) => face.planned === true)} />
|
|
542
654
|
<div
|
|
543
655
|
data-slot="chain-controls"
|
|
544
656
|
role="toolbar"
|
package/src/cards/contract.ts
CHANGED
|
@@ -52,14 +52,20 @@ export type CardTarget =
|
|
|
52
52
|
export type StatCardProps = CardTarget &
|
|
53
53
|
FrameHead &
|
|
54
54
|
FrameState & {
|
|
55
|
-
/** `null` renders a muted dash: absent, never zero. */
|
|
55
|
+
/** `null` renders a muted dash: absent, never zero. A quantity of a total (`39.7 of 64 GB`) is `value: 39.7` with `unit: 'of 64 GB'`: it keeps the display size, a string with words steps down in a narrow card. */
|
|
56
56
|
value: number | string | null
|
|
57
57
|
unit?: string | undefined
|
|
58
58
|
/** A change against a period; `value` prints as given, so pass `'+12%'`, never the fraction 0.12. */
|
|
59
59
|
delta?: Delta | undefined
|
|
60
60
|
/** The verdict home: dot plus word. A card never takes a hue. */
|
|
61
61
|
status?: Verdict | undefined
|
|
62
|
+
/**
|
|
63
|
+
* The line under the figure: what it counts or means, or a short part list (`Core 12 · Edge 4`). One line
|
|
64
|
+
* by default, cut with an ellipsis; a sentence the page writes sets `subLines`. Hidden below `@narrow`.
|
|
65
|
+
*/
|
|
62
66
|
sub?: string | undefined
|
|
67
|
+
/** Lines the sub may wrap to, 1 to 3 (default 1). The inset grows by 20 px a line, the same at every phase; a longer text is cut at the last line. */
|
|
68
|
+
subLines?: 1 | 2 | 3 | undefined
|
|
63
69
|
/** The sub line is a time or an id: drawn in the mono face with tabular numerals. */
|
|
64
70
|
subMono?: boolean | undefined
|
|
65
71
|
/** Called only in `ready` and `stale`, in a fixed clipping box of `height` (72 px by default: a 72 px plot, or plot 56 + label row 16 with `axisLabels`). */
|
|
@@ -80,6 +86,7 @@ export type StatCardProps = CardTarget &
|
|
|
80
86
|
controls?: HeadControls | undefined
|
|
81
87
|
/** One to three header buttons, toggles or a check menu; a fourth does not compile. */
|
|
82
88
|
actions?: HeadActions | undefined
|
|
89
|
+
/** Actions only, data never a node. Words that explain the card (`What is counted`) are `info`, the glyph beside the title. */
|
|
83
90
|
menu?: CardMenu | undefined
|
|
84
91
|
/** Whether a right click, a long press or Shift+F10 on the card opens its menu at the pointer. Default true; the browser's menu stays with false. */
|
|
85
92
|
contextMenu?: boolean | undefined
|
package/src/cards/data-panel.tsx
CHANGED
package/src/cards/event-list.tsx
CHANGED
|
@@ -216,7 +216,7 @@ function EventSkeleton({ rows }: { rows: number }): ReactElement {
|
|
|
216
216
|
export function EventList(props: EventListProps): ReactElement {
|
|
217
217
|
const { items, pageSize = DEFAULT_PAGE, now, phase, empty } = props
|
|
218
218
|
const rows = listRows(props.bodyRows)
|
|
219
|
-
const { title, subtitle, icon, info } = props
|
|
219
|
+
const { title, subtitle, icon, info, headingLevel } = props
|
|
220
220
|
const f = useFormat()
|
|
221
221
|
const { timeZone } = useIntl()
|
|
222
222
|
const t = useMessages(lists, common)
|
|
@@ -264,6 +264,7 @@ export function EventList(props: EventListProps): ReactElement {
|
|
|
264
264
|
{...(subtitle !== undefined && { subtitle })}
|
|
265
265
|
{...(icon !== undefined && { icon })}
|
|
266
266
|
{...(info !== undefined && { info })}
|
|
267
|
+
{...(headingLevel !== undefined && { headingLevel })}
|
|
267
268
|
/>
|
|
268
269
|
<Inset className="flex grow flex-col" style={bodyHeight(rows, 14)}>
|
|
269
270
|
<CardPhase
|
package/src/cards/index.ts
CHANGED
|
@@ -57,6 +57,7 @@ export type {
|
|
|
57
57
|
HeadChecks,
|
|
58
58
|
HeadControls,
|
|
59
59
|
HeadToggle,
|
|
60
|
+
InfoEntry,
|
|
60
61
|
StripStat,
|
|
61
62
|
} from '../core/phase'
|
|
62
63
|
// The frame kit for a hand-built frame: the regions every shipped frame draws (the head, its actions and menu are `CardBand` in `basalt-ui/ui/card`; the legend rides on `CardFooter`).
|
package/src/cards/row-list.tsx
CHANGED
|
@@ -217,7 +217,7 @@ function Row({ item, mono, lines }: RowProps): ReactElement {
|
|
|
217
217
|
* />
|
|
218
218
|
*/
|
|
219
219
|
export function RowList<I = unknown>(props: RowListProps<I>): ReactElement {
|
|
220
|
-
const { items, phase, empty, focus, title, subtitle, icon, info } = props
|
|
220
|
+
const { items, phase, empty, focus, title, subtitle, icon, info, headingLevel } = props
|
|
221
221
|
const link = useRowsLink(focus, items, keyOf)
|
|
222
222
|
const [at, setAt] = useState<number | null>(null)
|
|
223
223
|
const enter = (row: number): void => {
|
|
@@ -243,6 +243,7 @@ export function RowList<I = unknown>(props: RowListProps<I>): ReactElement {
|
|
|
243
243
|
subtitle={subtitle}
|
|
244
244
|
icon={icon}
|
|
245
245
|
info={info}
|
|
246
|
+
headingLevel={headingLevel}
|
|
246
247
|
tools={
|
|
247
248
|
scrolls ? (
|
|
248
249
|
<span
|
|
@@ -5,7 +5,7 @@ import { useMessages } from '../core/messages/use-messages'
|
|
|
5
5
|
import { common } from '../core/messages/common'
|
|
6
6
|
import type { Verdict } from '../core/ports'
|
|
7
7
|
|
|
8
|
-
export { formatValue } from '../core/frame-figure'
|
|
8
|
+
export { formatValue, isLongFigure } from '../core/frame-figure'
|
|
9
9
|
|
|
10
10
|
/** The stale line a stat card or cell prints: still updating, or a refetch that failed. */
|
|
11
11
|
export function useStaleText(refreshFailed: boolean): string {
|
|
@@ -39,21 +39,23 @@ export function StatusMark({ status }: { status: Verdict }): ReactElement {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* The loading anatomy, in the rows the ready card draws: a figure and its pill,
|
|
42
|
+
* The loading anatomy, in the rows the ready card draws: a figure and its pill, `sub` sub lines, and a
|
|
43
43
|
* plot over its label row. Every row has the ready row's height, so the card never moves.
|
|
44
44
|
*/
|
|
45
|
-
export function StatSkeleton({ sub, chart }: { sub:
|
|
45
|
+
export function StatSkeleton({ sub, chart }: { sub: number; chart: boolean }): ReactElement {
|
|
46
46
|
return (
|
|
47
47
|
<div data-slot="stat-skeleton" aria-hidden="true" className="flex h-full flex-col">
|
|
48
48
|
<div className="flex h-9 shrink-0 items-center gap-2">
|
|
49
49
|
<div className={cn(BAR, 'h-7 w-24')} />
|
|
50
50
|
<div className={cn(BAR, 'h-6 w-14 rounded-full')} />
|
|
51
51
|
</div>
|
|
52
|
-
{sub
|
|
53
|
-
<div className="flex h-5 shrink-0 items-center @max-narrow:hidden">
|
|
54
|
-
<div
|
|
52
|
+
{Array.from({ length: sub }, (_, line) => (
|
|
53
|
+
<div key={line} className="flex h-5 shrink-0 items-center @max-narrow:hidden">
|
|
54
|
+
<div
|
|
55
|
+
className={cn(BAR, 'h-3 max-w-full', line === sub - 1 && sub > 1 ? 'w-24' : 'w-40')}
|
|
56
|
+
/>
|
|
55
57
|
</div>
|
|
56
|
-
)}
|
|
58
|
+
))}
|
|
57
59
|
{chart && (
|
|
58
60
|
<div className="mt-2 flex h-(--chart-h) shrink-0 flex-col gap-1">
|
|
59
61
|
<div className={cn(BAR, 'flex-1')} />
|
package/src/cards/stat-card.tsx
CHANGED
|
@@ -14,14 +14,21 @@ import { Card, CardPhase, Inset } from '../ui/card'
|
|
|
14
14
|
import type { StatCardProps } from './contract'
|
|
15
15
|
import { FrameHeadBand } from '../core/frame-head'
|
|
16
16
|
import { FrameFooterRow, FrameLegend } from '../core/frame-regions'
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
StatSkeleton,
|
|
19
|
+
StatusMark,
|
|
20
|
+
formatValue,
|
|
21
|
+
isLongFigure,
|
|
22
|
+
useStaleText,
|
|
23
|
+
} from './stat-card-parts'
|
|
18
24
|
|
|
19
25
|
/** The chart box with no label row: the plot, 72 px. The slot draws inside it and cannot grow it. */
|
|
20
26
|
const CHART_HEIGHT = 72
|
|
21
27
|
/** The label row the card draws itself under the plot (`axisLabels`), px. */
|
|
22
28
|
const LABEL_ROW = 16
|
|
23
|
-
/**
|
|
24
|
-
const
|
|
29
|
+
/** One sub line, px: the row the card reserves for each line the sub may take. */
|
|
30
|
+
const SUB_LINE = 20
|
|
31
|
+
const SUB_CLAMP = { 1: 'truncate', 2: 'line-clamp-2', 3: 'line-clamp-3' } as const
|
|
25
32
|
/** A text figure that holds a word (a name, a state) steps down too; a number written as text (`98.2%`, `1.2k`) keeps the display size. */
|
|
26
33
|
const WORD = /\p{L}{2}/u
|
|
27
34
|
|
|
@@ -47,15 +54,15 @@ function AxisLabels({
|
|
|
47
54
|
|
|
48
55
|
/**
|
|
49
56
|
* The inset is exactly as tall as its anatomy, so a loading, empty or error card is as tall as a
|
|
50
|
-
* ready one and nothing leaves an empty band under the figure: figure row 36, sub
|
|
51
|
-
* below `@narrow`, and
|
|
57
|
+
* ready one and nothing leaves an empty band under the figure: figure row 36, sub rows of 20 (`subLines`,
|
|
58
|
+
* one by default; hidden below `@narrow`, and their height with them), an 8 px gap and the chart box (`height`, 72 by default), plus the
|
|
52
59
|
* inset's 24 px of padding. With no chart the phase arms are one row, so they fit a box one figure row tall.
|
|
53
60
|
*/
|
|
54
61
|
const BODY_HEIGHT = {
|
|
55
62
|
plain: 'h-15',
|
|
56
|
-
sub: 'h-
|
|
63
|
+
sub: 'h-[calc(60px+var(--sub-h))] @max-narrow:h-15',
|
|
57
64
|
chart: 'h-[calc(var(--chart-h)+68px)]',
|
|
58
|
-
both: 'h-[calc(var(--chart-h)+
|
|
65
|
+
both: 'h-[calc(var(--chart-h)+68px+var(--sub-h))] @max-narrow:h-[calc(var(--chart-h)+68px)]',
|
|
59
66
|
} as const
|
|
60
67
|
|
|
61
68
|
const bodyHeight = (hasSub: boolean, hasChart: boolean): string =>
|
|
@@ -102,6 +109,7 @@ export function StatCard(props: StatCardProps): ReactElement {
|
|
|
102
109
|
delta,
|
|
103
110
|
status,
|
|
104
111
|
sub,
|
|
112
|
+
subLines = 1,
|
|
105
113
|
subMono,
|
|
106
114
|
chart,
|
|
107
115
|
axisLabels,
|
|
@@ -114,7 +122,19 @@ export function StatCard(props: StatCardProps): ReactElement {
|
|
|
114
122
|
const plotHeight =
|
|
115
123
|
props.height ?? (axisLabels === undefined ? CHART_HEIGHT : CHART_HEIGHT - LABEL_ROW)
|
|
116
124
|
const chartHeight = plotHeight + (axisLabels === undefined ? 0 : LABEL_ROW)
|
|
117
|
-
const {
|
|
125
|
+
const {
|
|
126
|
+
phase,
|
|
127
|
+
empty,
|
|
128
|
+
subtitle,
|
|
129
|
+
icon,
|
|
130
|
+
info,
|
|
131
|
+
headingLevel,
|
|
132
|
+
badge,
|
|
133
|
+
controls,
|
|
134
|
+
actions,
|
|
135
|
+
menu,
|
|
136
|
+
contextMenu,
|
|
137
|
+
} = props
|
|
118
138
|
const numbers = useFormat()
|
|
119
139
|
const figure = formatValue(value, numbers)
|
|
120
140
|
const standardOf = useStandardActions()
|
|
@@ -159,6 +179,7 @@ export function StatCard(props: StatCardProps): ReactElement {
|
|
|
159
179
|
subtitle={subtitle}
|
|
160
180
|
icon={icon}
|
|
161
181
|
info={info}
|
|
182
|
+
headingLevel={headingLevel}
|
|
162
183
|
badge={badge}
|
|
163
184
|
actions={actions}
|
|
164
185
|
controls={controls}
|
|
@@ -169,14 +190,19 @@ export function StatCard(props: StatCardProps): ReactElement {
|
|
|
169
190
|
<Inset
|
|
170
191
|
className={cn('flex flex-col', bodyHeight(sub !== undefined, chart !== undefined))}
|
|
171
192
|
style={
|
|
172
|
-
|
|
193
|
+
{
|
|
194
|
+
...(chart !== undefined && { '--chart-h': `${chartHeight}px` }),
|
|
195
|
+
...(sub !== undefined && { '--sub-h': `${subLines * SUB_LINE}px` }),
|
|
196
|
+
} as CSSProperties
|
|
173
197
|
}
|
|
174
198
|
>
|
|
175
199
|
<HostTitleContext.Provider value={title}>
|
|
176
200
|
<CardPhase
|
|
177
201
|
phase={phase}
|
|
178
202
|
empty={empty}
|
|
179
|
-
skeleton={
|
|
203
|
+
skeleton={
|
|
204
|
+
<StatSkeleton sub={sub !== undefined ? subLines : 0} chart={chart !== undefined} />
|
|
205
|
+
}
|
|
180
206
|
arms={chart === undefined ? 'line' : 'stack'}
|
|
181
207
|
staleLine="body"
|
|
182
208
|
className="flex flex-1 flex-col"
|
|
@@ -193,7 +219,7 @@ export function StatCard(props: StatCardProps): ReactElement {
|
|
|
193
219
|
// The answer is never cut: the figure keeps its width and the delta beside it gives way.
|
|
194
220
|
'shrink-0 text-display font-semibold whitespace-nowrap tabular-nums',
|
|
195
221
|
((typeof value === 'string' && WORD.test(value)) ||
|
|
196
|
-
(figure
|
|
222
|
+
isLongFigure(figure, unit)) &&
|
|
197
223
|
'@max-regular:text-lg',
|
|
198
224
|
figure === null && 'text-muted-foreground',
|
|
199
225
|
)}
|
|
@@ -229,7 +255,8 @@ export function StatCard(props: StatCardProps): ReactElement {
|
|
|
229
255
|
data-slot="stat-sub"
|
|
230
256
|
data-monospace={subMono === true ? '' : undefined}
|
|
231
257
|
className={cn(
|
|
232
|
-
'm-0 h-
|
|
258
|
+
'm-0 h-(--sub-h) shrink-0 text-sm leading-5 text-muted-foreground @max-narrow:hidden',
|
|
259
|
+
SUB_CLAMP[subLines],
|
|
233
260
|
subMono === true && 'font-mono tabular-nums',
|
|
234
261
|
)}
|
|
235
262
|
>
|