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/lint/weakened.ts
CHANGED
|
@@ -266,6 +266,61 @@ function readConfig(dir: string): Config | string {
|
|
|
266
266
|
return parseJsonc(readFileSync(path, 'utf8')) ?? `${OXLINTRC} does not parse as JSON or JSONC`
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
+
const SHADCN_WRAPPER = 'basalt-ui/lint/shadcn'
|
|
270
|
+
|
|
271
|
+
/** The package a module specifier names: `@scope/name/sub` is `@scope/name`, `name/sub` is `name`. */
|
|
272
|
+
const packageOf = (spec: string): string =>
|
|
273
|
+
spec
|
|
274
|
+
.split('/')
|
|
275
|
+
.slice(0, spec.startsWith('@') ? 2 : 1)
|
|
276
|
+
.join('/')
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Why the config oxlint loads at `dir` does not run the preset's rules, or an empty list. Each is a
|
|
280
|
+
* way `lint` would report "findings: 0" with the guard off: no config, a config that neither extends
|
|
281
|
+
* the preset nor carries its plugins, a missing preset, or a jsPlugin that does not resolve from the
|
|
282
|
+
* install root (oxlint loads them relative to the config, and an isolated install links a package
|
|
283
|
+
* into the app that depends on it, not into the root).
|
|
284
|
+
*/
|
|
285
|
+
export function presetLoadProblems(dir: string): string[] {
|
|
286
|
+
const config = readConfig(dir)
|
|
287
|
+
if (typeof config === 'string') return [`${config}: \`basalt-ui sync\` writes it`]
|
|
288
|
+
const problems: string[] = []
|
|
289
|
+
const extended = asStrings(config['extends']).some((p) => basename(p) === PRESET_FILE)
|
|
290
|
+
const plugins = asStrings(config['jsPlugins'])
|
|
291
|
+
if (!extended && !plugins.includes('basalt-ui/lint')) {
|
|
292
|
+
problems.push(
|
|
293
|
+
`${OXLINTRC} does not extend ${PRESET_FILE}, so oxlint runs none of the preset's rules: add it to "extends" (\`basalt-ui sync\` writes the file)`,
|
|
294
|
+
)
|
|
295
|
+
}
|
|
296
|
+
if (extended) {
|
|
297
|
+
const path = resolve(dir, PRESET_FILE)
|
|
298
|
+
const preset = existsSync(path) ? parseJsonc(readFileSync(path, 'utf8')) : null
|
|
299
|
+
if (preset === null)
|
|
300
|
+
problems.push(`${PRESET_FILE} is missing or not JSON: run \`basalt-ui sync\``)
|
|
301
|
+
else plugins.push(...asStrings(preset['jsPlugins']))
|
|
302
|
+
}
|
|
303
|
+
const checked = new Set<string>()
|
|
304
|
+
for (const spec of new Set(plugins)) {
|
|
305
|
+
if (/^\.{0,2}\//.test(spec)) {
|
|
306
|
+
if (!existsSync(resolve(dir, spec)))
|
|
307
|
+
problems.push(`jsPlugin ${spec} does not exist from ${dir}`)
|
|
308
|
+
continue
|
|
309
|
+
}
|
|
310
|
+
// The shadcn wrapper imports the bought plugin itself, so that package must be installed too.
|
|
311
|
+
for (const pkg of [packageOf(spec), ...(spec === SHADCN_WRAPPER ? ['@shadcn/lint'] : [])]) {
|
|
312
|
+
if (checked.has(pkg)) continue
|
|
313
|
+
checked.add(pkg)
|
|
314
|
+
if (findUp(dir, pkg) === null) {
|
|
315
|
+
problems.push(
|
|
316
|
+
`jsPlugin ${spec} does not resolve from ${dir}: oxlint loads it relative to the config, so ${pkg} must be installed at the install root (a dependency of its package.json), not only in the app`,
|
|
317
|
+
)
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return problems
|
|
322
|
+
}
|
|
323
|
+
|
|
269
324
|
function extendsPreset(config: Config | string): WeakenedResult {
|
|
270
325
|
const result = verdict(2, 'extends')
|
|
271
326
|
if (typeof config === 'string') return result('failed', config)
|
|
@@ -535,7 +590,10 @@ function budgetRatchet(
|
|
|
535
590
|
`no base ref resolves (tried ${named}) and the repo has no remote, so no ceiling can have been raised; the ratchet runs once it has one`,
|
|
536
591
|
)
|
|
537
592
|
}
|
|
538
|
-
return result(
|
|
593
|
+
return result(
|
|
594
|
+
'skipped',
|
|
595
|
+
`no base ref resolves (tried ${named}); fetch the base branch first: git fetch --no-tags --depth=1 origin +refs/heads/<base>:refs/remotes/origin/<base>; a default branch other than main or master also needs git remote set-head origin <base>`,
|
|
596
|
+
)
|
|
539
597
|
}
|
|
540
598
|
if (git('rev-parse', '--verify', '--quiet', `${baseRef}^{commit}`).exitCode !== 0) {
|
|
541
599
|
return result('skipped', `base ref ${baseRef} does not resolve; fetch it first`)
|
package/src/messages/de.ts
CHANGED
|
@@ -20,6 +20,13 @@ function stepDuration(f: Format, ms: number): string {
|
|
|
20
20
|
return rest === 0 ? `${hours} Std.` : `${hours} Std. ${f.number(rest)} Min.`
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/** Under a minute a run's time keeps a decimal, so a quick command does not read as zero. */
|
|
24
|
+
function runTime(f: Format, ms: number): string {
|
|
25
|
+
return ms < 60_000
|
|
26
|
+
? f.number(ms / 1000, { style: 'unit', unit: 'second', maximumFractionDigits: 1 })
|
|
27
|
+
: f.duration(ms, 'compact')
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
const COLOR_NAMES: ReadonlyMap<string, string> = new Map([
|
|
24
31
|
['neutral', 'Grau'],
|
|
25
32
|
['brand', 'Markenfarbe'],
|
|
@@ -139,6 +146,7 @@ export const de: BasaltMessages = {
|
|
|
139
146
|
|
|
140
147
|
// chain
|
|
141
148
|
'chain.blocks': 'Blockierend',
|
|
149
|
+
'chain.planned': 'Geplant',
|
|
142
150
|
'chain.waitsOn': (_f, names) => `Wartet auf ${names}`,
|
|
143
151
|
'chain.alsoWaitsOn': (_f, names) => `Wartet außerdem auf ${names}`,
|
|
144
152
|
'chain.fit': 'An Breite anpassen',
|
|
@@ -524,6 +532,18 @@ export const de: BasaltMessages = {
|
|
|
524
532
|
`Fehler: Gib eine Zahl von ${f.number(min)} bis ${f.number(max)} ein.`,
|
|
525
533
|
'page.minRead': (f, minutes) => `${f.number(minutes)} Min. Lesezeit`,
|
|
526
534
|
|
|
535
|
+
// runs
|
|
536
|
+
'runs.list': 'Läufe',
|
|
537
|
+
'runs.waiting': 'Wartet',
|
|
538
|
+
'runs.running': 'Läuft',
|
|
539
|
+
'runs.waitingHint': 'Wartet auf den Befehl davor.',
|
|
540
|
+
'runs.stepOk': 'ok',
|
|
541
|
+
'runs.stepFailed': 'fehlgeschlagen',
|
|
542
|
+
'runs.elapsed': (f, ms) => `Läuft seit ${f.duration(ms, 'compact')}.`,
|
|
543
|
+
'runs.finished': (f, ms) => `Fertig nach ${runTime(f, ms)}.`,
|
|
544
|
+
'runs.failed': (_f, label) => `${label}: fehlgeschlagen`,
|
|
545
|
+
'runs.steps': (f, count) => `Schritte (${f.number(count)})`,
|
|
546
|
+
|
|
527
547
|
// schedule
|
|
528
548
|
'schedule.railContent': 'Neben dem Zeitplan',
|
|
529
549
|
'schedule.period': 'Zeitraum',
|
package/src/messages/es.ts
CHANGED
|
@@ -34,6 +34,13 @@ const STREAM_STATE: ReadonlyMap<string, string> = new Map([
|
|
|
34
34
|
['done', 'Finalizada'],
|
|
35
35
|
])
|
|
36
36
|
|
|
37
|
+
/** Under a minute a run's time keeps a decimal, so a quick command does not read as zero. */
|
|
38
|
+
function runTime(f: Format, ms: number): string {
|
|
39
|
+
return ms < 60_000
|
|
40
|
+
? f.number(ms / 1000, { style: 'unit', unit: 'second', maximumFractionDigits: 1 })
|
|
41
|
+
: f.duration(ms, 'compact')
|
|
42
|
+
}
|
|
43
|
+
|
|
37
44
|
const COLOR_NAMES: ReadonlyMap<string, string> = new Map([
|
|
38
45
|
['neutral', 'Gris'],
|
|
39
46
|
['brand', 'Marca'],
|
|
@@ -138,6 +145,7 @@ export const es: BasaltMessages = {
|
|
|
138
145
|
|
|
139
146
|
// chain
|
|
140
147
|
'chain.blocks': 'Bloquea',
|
|
148
|
+
'chain.planned': 'Planificado',
|
|
141
149
|
'chain.waitsOn': (_f, names) => `Espera a ${names}`,
|
|
142
150
|
'chain.alsoWaitsOn': (_f, names) => `También espera a ${names}`,
|
|
143
151
|
'chain.fit': 'Ajustar al ancho',
|
|
@@ -523,6 +531,18 @@ export const es: BasaltMessages = {
|
|
|
523
531
|
`Error: introduce un número de ${f.number(min)} a ${f.number(max)}.`,
|
|
524
532
|
'page.minRead': (f, minutes) => `${f.number(minutes)} min de lectura`,
|
|
525
533
|
|
|
534
|
+
// runs
|
|
535
|
+
'runs.list': 'Ejecuciones',
|
|
536
|
+
'runs.waiting': 'En espera',
|
|
537
|
+
'runs.running': 'En curso',
|
|
538
|
+
'runs.waitingHint': 'Esperando el comando anterior.',
|
|
539
|
+
'runs.stepOk': 'correcto',
|
|
540
|
+
'runs.stepFailed': 'fallido',
|
|
541
|
+
'runs.elapsed': (f, ms) => `En curso desde hace ${f.duration(ms, 'compact')}.`,
|
|
542
|
+
'runs.finished': (f, ms) => `Terminado en ${runTime(f, ms)}.`,
|
|
543
|
+
'runs.failed': (_f, label) => `${label}: falló`,
|
|
544
|
+
'runs.steps': (f, count) => `Pasos (${f.number(count)})`,
|
|
545
|
+
|
|
526
546
|
// schedule
|
|
527
547
|
'schedule.railContent': 'Junto a la agenda',
|
|
528
548
|
'schedule.period': 'Periodo',
|
package/src/messages/fr.ts
CHANGED
|
@@ -38,6 +38,13 @@ const STREAM_STATE: ReadonlyMap<string, string> = new Map([
|
|
|
38
38
|
['done', 'Terminé'],
|
|
39
39
|
])
|
|
40
40
|
|
|
41
|
+
/** Under a minute a run's time keeps a decimal, so a quick command does not read as zero. */
|
|
42
|
+
function runTime(f: Format, ms: number): string {
|
|
43
|
+
return ms < 60_000
|
|
44
|
+
? f.number(ms / 1000, { style: 'unit', unit: 'second', maximumFractionDigits: 1 })
|
|
45
|
+
: f.duration(ms, 'compact')
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
const COLOR_NAMES: ReadonlyMap<string, string> = new Map([
|
|
42
49
|
['neutral', 'Gris'],
|
|
43
50
|
['brand', 'Couleur de marque'],
|
|
@@ -143,6 +150,7 @@ export const fr: BasaltMessages = {
|
|
|
143
150
|
|
|
144
151
|
// chain
|
|
145
152
|
'chain.blocks': 'Bloque',
|
|
153
|
+
'chain.planned': 'Prévu',
|
|
146
154
|
'chain.waitsOn': (_f, names) => `En attente de\u00a0: ${names}`,
|
|
147
155
|
'chain.alsoWaitsOn': (_f, names) => `Également en attente de\u00a0: ${names}`,
|
|
148
156
|
'chain.fit': 'Ajuster à la largeur',
|
|
@@ -538,6 +546,18 @@ export const fr: BasaltMessages = {
|
|
|
538
546
|
`Erreur\u00a0: saisissez un nombre compris entre ${f.number(min)} et ${f.number(max)}.`,
|
|
539
547
|
'page.minRead': (f, minutes) => `${f.number(minutes)}\u00a0min de lecture`,
|
|
540
548
|
|
|
549
|
+
// runs
|
|
550
|
+
'runs.list': 'Exécutions',
|
|
551
|
+
'runs.waiting': 'En attente',
|
|
552
|
+
'runs.running': 'En cours',
|
|
553
|
+
'runs.waitingHint': 'En attente de la commande précédente.',
|
|
554
|
+
'runs.stepOk': 'réussi',
|
|
555
|
+
'runs.stepFailed': 'échoué',
|
|
556
|
+
'runs.elapsed': (f, ms) => `En cours depuis ${f.duration(ms, 'compact')}.`,
|
|
557
|
+
'runs.finished': (f, ms) => `Terminé en ${runTime(f, ms)}.`,
|
|
558
|
+
'runs.failed': (_f, label) => `${label}\u00a0: échec`,
|
|
559
|
+
'runs.steps': (f, count) => `Étapes (${f.number(count)})`,
|
|
560
|
+
|
|
541
561
|
// schedule
|
|
542
562
|
'schedule.railContent': 'À côté du planning',
|
|
543
563
|
'schedule.period': 'Période',
|
package/src/messages/zh-hans.ts
CHANGED
|
@@ -19,6 +19,13 @@ function stepDuration(f: Format, ms: number): string {
|
|
|
19
19
|
return rest === 0 ? `${hours} 小时` : `${hours} 小时 ${f.number(rest)} 分钟`
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/** Under a minute a run's time keeps a decimal, so a quick command does not read as zero. */
|
|
23
|
+
function runTime(f: Format, ms: number): string {
|
|
24
|
+
return ms < 60_000
|
|
25
|
+
? f.number(ms / 1000, { style: 'unit', unit: 'second', maximumFractionDigits: 1 })
|
|
26
|
+
: f.duration(ms, 'compact')
|
|
27
|
+
}
|
|
28
|
+
|
|
22
29
|
const COLOR_NAMES: ReadonlyMap<string, string> = new Map([
|
|
23
30
|
['neutral', '灰色'],
|
|
24
31
|
['brand', '品牌色'],
|
|
@@ -136,6 +143,7 @@ export const zhHans: BasaltMessages = {
|
|
|
136
143
|
|
|
137
144
|
// chain
|
|
138
145
|
'chain.blocks': '阻塞',
|
|
146
|
+
'chain.planned': '计划中',
|
|
139
147
|
'chain.waitsOn': (_f, names) => `等待:${names}`,
|
|
140
148
|
'chain.alsoWaitsOn': (_f, names) => `还在等待:${names}`,
|
|
141
149
|
'chain.fit': '适应宽度',
|
|
@@ -510,6 +518,18 @@ export const zhHans: BasaltMessages = {
|
|
|
510
518
|
`错误:请输入 ${f.number(min)} 到 ${f.number(max)} 之间的数字。`,
|
|
511
519
|
'page.minRead': (f, minutes) => `阅读约 ${f.number(minutes)} 分钟`,
|
|
512
520
|
|
|
521
|
+
// runs
|
|
522
|
+
'runs.list': '运行记录',
|
|
523
|
+
'runs.waiting': '等待中',
|
|
524
|
+
'runs.running': '运行中',
|
|
525
|
+
'runs.waitingHint': '正在等待前一个命令。',
|
|
526
|
+
'runs.stepOk': '成功',
|
|
527
|
+
'runs.stepFailed': '失败',
|
|
528
|
+
'runs.elapsed': (f, ms) => `已运行 ${f.duration(ms, 'compact')}。`,
|
|
529
|
+
'runs.finished': (f, ms) => `用时 ${runTime(f, ms)}。`,
|
|
530
|
+
'runs.failed': (_f, label) => `${label}:失败`,
|
|
531
|
+
'runs.steps': (f, count) => `步骤(${f.number(count)})`,
|
|
532
|
+
|
|
513
533
|
// schedule
|
|
514
534
|
'schedule.railContent': '日程旁的内容',
|
|
515
535
|
'schedule.period': '时间段',
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactElement } from 'react'
|
|
2
|
+
import { cn } from '../core/cn'
|
|
3
|
+
|
|
4
|
+
/** The bar's title class: `PageBar` draws it outside a shell and `BarTitle` draws it anywhere. Internal: not in the barrel. */
|
|
5
|
+
export const BAR_TITLE =
|
|
6
|
+
'm-0 min-w-0 font-head text-lg font-semibold tracking-tight text-balance text-foreground [overflow-wrap:anywhere]'
|
|
7
|
+
|
|
8
|
+
export type BarTitleProps = {
|
|
9
|
+
/** The screen's name. It wraps onto further lines at a narrow width and never ends in an ellipsis. */
|
|
10
|
+
title: string
|
|
11
|
+
/** Layout only (`shrink`, `flex-1`). */
|
|
12
|
+
className?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The title of a screen that has its own top bar and no `Page`: the page's `h1`, in the bar's
|
|
17
|
+
* title style. It wraps and never truncates, so a long or translated name stays readable at 360 px.
|
|
18
|
+
*
|
|
19
|
+
* @useWhen a game, kiosk or other single-screen app draws its own top bar and needs to name the screen with a heading
|
|
20
|
+
* @neverWhen the screen is a `Page` (use `PageBar` `title`, which draws this heading) or the title belongs to a card (use the card title)
|
|
21
|
+
* @instead PageBar, Section
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <header className="flex items-center gap-3">
|
|
25
|
+
* <BarTitle title="Sprint 42 planning" className="shrink" />
|
|
26
|
+
* <RoomMenu />
|
|
27
|
+
* </header>
|
|
28
|
+
*/
|
|
29
|
+
export function BarTitle({ title, className }: BarTitleProps): ReactElement {
|
|
30
|
+
return (
|
|
31
|
+
<h1 data-slot="bar-title" className={cn(BAR_TITLE, className)}>
|
|
32
|
+
{title}
|
|
33
|
+
</h1>
|
|
34
|
+
)
|
|
35
|
+
}
|
package/src/page/contract.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { ComponentType, ReactNode } from 'react'
|
|
8
8
|
import type { KeyChar } from './search-hint'
|
|
9
|
-
import type { CardMenu } from '../core/phase'
|
|
9
|
+
import type { CardMenu, InfoEntry } from '../core/phase'
|
|
10
10
|
import type {
|
|
11
11
|
ConnectionView,
|
|
12
12
|
ControlHandle,
|
|
@@ -201,6 +201,16 @@ export type SectionProps<K extends string = string> = {
|
|
|
201
201
|
controls?: ControlsSlot
|
|
202
202
|
/** The section's view switch, beside the title. */
|
|
203
203
|
tabs?: PageTabs<K>
|
|
204
|
+
/**
|
|
205
|
+
* The heading element, 3 for a part of a section. The look is the same at both.
|
|
206
|
+
*
|
|
207
|
+
* @default 2
|
|
208
|
+
*/
|
|
209
|
+
headingLevel?: 2 | 3
|
|
210
|
+
/** The title's definition, behind the card head's info glyph; an array is one paragraph per entry, which may end with a link. */
|
|
211
|
+
info?: string | readonly InfoEntry[]
|
|
212
|
+
/** A hairline under the heading row. */
|
|
213
|
+
divided?: boolean
|
|
204
214
|
/** The heading is the trigger; open state is uncontrolled or a handle (F2 amendment n5). */
|
|
205
215
|
collapsible?: { defaultOpen?: boolean; state?: ControlHandle<boolean> }
|
|
206
216
|
children?: ReactNode
|
package/src/page/empty-state.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import { buttonVariants } from '../ui/button'
|
|
|
11
11
|
type EmptyStateBase = {
|
|
12
12
|
/** One line: the cause, and the next step when there is one. Required: never a bare "No data". */
|
|
13
13
|
cause: string
|
|
14
|
-
/** What is empty, in a few words (`No runs yet`), on the line above `cause`.
|
|
14
|
+
/** What is empty, in a few words (`No runs yet`), on the line above `cause`. */
|
|
15
15
|
title?: string
|
|
16
16
|
icon?: IconComponent
|
|
17
17
|
/**
|
|
@@ -20,6 +20,8 @@ type EmptyStateBase = {
|
|
|
20
20
|
* @default 'page'
|
|
21
21
|
*/
|
|
22
22
|
tier?: 'page' | 'section'
|
|
23
|
+
/** Drops the `section` tier's box, for a region the page does not frame. The `page` tier has none. */
|
|
24
|
+
bare?: boolean
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
/** One action, or the filtered variant: the two never meet, because filtered renders Clear filters. */
|
|
@@ -32,7 +34,8 @@ const ACTION = buttonVariants({ variant: 'secondary', size: 'sm' })
|
|
|
32
34
|
* The state of a region that has nothing to show: one line of cause and at most one action. With
|
|
33
35
|
* active filters it is the filtered variant, whose action is Clear filters; the line says what the
|
|
34
36
|
* filters hid. It never says "No data": the line names the cause, so a failed load cannot pass for
|
|
35
|
-
* an empty list (a failed query is `QueryState`'s error arm, not this).
|
|
37
|
+
* an empty list (a failed query is `QueryState`'s error arm, not this). `cause` is a string: a link
|
|
38
|
+
* to the next step is `action` with an `href`.
|
|
36
39
|
*
|
|
37
40
|
* @useWhen a settled query or a filter left a page or region with nothing to list
|
|
38
41
|
* @neverWhen the data failed to load or is still loading (use `QueryState`, or a frame `phase`)
|
|
@@ -49,7 +52,7 @@ const ACTION = buttonVariants({ variant: 'secondary', size: 'sm' })
|
|
|
49
52
|
* <EmptyState title="No runs yet" cause="Start one from the CLI." action={{ label: 'Open docs', href: 'https://basalt-ui.com/docs' }} />
|
|
50
53
|
*/
|
|
51
54
|
export function EmptyState(props: EmptyStateProps): ReactElement {
|
|
52
|
-
const { cause, title, icon: Icon, tier = 'page', action, filtered } = props
|
|
55
|
+
const { cause, title, icon: Icon, tier = 'page', bare, action, filtered } = props
|
|
53
56
|
const t = useMessages(home, common)
|
|
54
57
|
return (
|
|
55
58
|
<div
|
|
@@ -57,9 +60,10 @@ export function EmptyState(props: EmptyStateProps): ReactElement {
|
|
|
57
60
|
data-tier={tier}
|
|
58
61
|
className={cn(
|
|
59
62
|
'flex min-w-0 flex-col items-center gap-2 text-center',
|
|
60
|
-
tier === 'page'
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
tier === 'page' ? 'px-6 py-16' : 'px-5 py-8',
|
|
64
|
+
tier === 'section' &&
|
|
65
|
+
bare !== true &&
|
|
66
|
+
'rounded-inset shadow-[inset_0_0_0_1px_var(--basalt-hairline)] forced-colors:border forced-colors:border-current',
|
|
63
67
|
)}
|
|
64
68
|
>
|
|
65
69
|
{Icon !== undefined && (
|
|
@@ -70,8 +74,14 @@ export function EmptyState(props: EmptyStateProps): ReactElement {
|
|
|
70
74
|
<Icon aria-hidden="true" size={24} />
|
|
71
75
|
</span>
|
|
72
76
|
)}
|
|
73
|
-
{title !== undefined &&
|
|
74
|
-
<p
|
|
77
|
+
{title !== undefined && (
|
|
78
|
+
<p
|
|
79
|
+
data-slot="empty-state-title"
|
|
80
|
+
className={cn(
|
|
81
|
+
'm-0 font-semibold text-foreground',
|
|
82
|
+
tier === 'page' ? 'text-lg' : 'text-sm',
|
|
83
|
+
)}
|
|
84
|
+
>
|
|
75
85
|
{title}
|
|
76
86
|
</p>
|
|
77
87
|
)}
|
package/src/page/facts.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react'
|
|
2
|
+
import { cn } from '../core/cn'
|
|
2
3
|
|
|
3
4
|
/** One entry of `Facts`: the label and its value. */
|
|
4
5
|
export type FactRow = {
|
|
@@ -12,15 +13,41 @@ export const FACTS_GRID =
|
|
|
12
13
|
export const FACTS_TERM = 'text-muted-foreground'
|
|
13
14
|
export const FACTS_VALUE = 'm-0 min-w-0 [overflow-wrap:anywhere] text-foreground'
|
|
14
15
|
|
|
16
|
+
const STACKED = {
|
|
17
|
+
2: '@narrow:grid-cols-2',
|
|
18
|
+
3: '@narrow:grid-cols-2 @regular:grid-cols-3',
|
|
19
|
+
4: '@narrow:grid-cols-2 @regular:grid-cols-3 @wide:grid-cols-4',
|
|
20
|
+
} as const
|
|
21
|
+
|
|
15
22
|
export type FactsProps = {
|
|
16
23
|
/** One row per entry, in order; labels are unique within one list. */
|
|
17
24
|
rows: readonly FactRow[]
|
|
18
|
-
}
|
|
25
|
+
} & (
|
|
26
|
+
| {
|
|
27
|
+
/**
|
|
28
|
+
* `beside` puts each label beside its value, `stacked` above it.
|
|
29
|
+
*
|
|
30
|
+
* @default 'beside'
|
|
31
|
+
*/
|
|
32
|
+
layout?: 'beside'
|
|
33
|
+
columns?: never
|
|
34
|
+
}
|
|
35
|
+
| {
|
|
36
|
+
layout: 'stacked'
|
|
37
|
+
/**
|
|
38
|
+
* The most columns a stacked list takes; a narrower list takes fewer.
|
|
39
|
+
*
|
|
40
|
+
* @default 3
|
|
41
|
+
*/
|
|
42
|
+
columns?: 2 | 3 | 4
|
|
43
|
+
}
|
|
44
|
+
)
|
|
19
45
|
|
|
20
46
|
/**
|
|
21
47
|
* A labelled list of facts about one record: a `dl` of `{ label, value }` rows. The columns follow
|
|
22
48
|
* the list's own width, never the viewport: two label-and-value columns from the `regular`
|
|
23
49
|
* container tier, one below it, so the same list reads right in a 360 px aside and in a page column.
|
|
50
|
+
* `layout="stacked"` puts each label above its value, in up to `columns` columns of the same list width.
|
|
24
51
|
*
|
|
25
52
|
* @useWhen the properties of one record are listed as label and value, such as the body of an inspector in a `PageAside`
|
|
26
53
|
* @neverWhen the values are numbers to compare at a glance (use `StatGroup`) or the rows are records of their own (use `DataTable`)
|
|
@@ -34,13 +61,24 @@ export type FactsProps = {
|
|
|
34
61
|
* ]}
|
|
35
62
|
* />
|
|
36
63
|
*/
|
|
37
|
-
export function Facts({ rows }: FactsProps): ReactElement {
|
|
64
|
+
export function Facts({ rows, layout, columns = 3 }: FactsProps): ReactElement {
|
|
65
|
+
const stacked = layout === 'stacked'
|
|
38
66
|
return (
|
|
39
67
|
<div data-slot="facts" className="@container min-w-0">
|
|
40
|
-
<dl
|
|
68
|
+
<dl
|
|
69
|
+
className={
|
|
70
|
+
stacked
|
|
71
|
+
? cn('m-0 grid min-w-0 grid-cols-1 gap-x-6 gap-y-3 text-sm', STACKED[columns])
|
|
72
|
+
: FACTS_GRID
|
|
73
|
+
}
|
|
74
|
+
>
|
|
41
75
|
{rows.map((row) => (
|
|
42
|
-
<div
|
|
43
|
-
|
|
76
|
+
<div
|
|
77
|
+
key={row.label}
|
|
78
|
+
data-slot="facts-row"
|
|
79
|
+
className={stacked ? 'flex min-w-0 flex-col gap-0.5' : 'contents'}
|
|
80
|
+
>
|
|
81
|
+
<dt className={cn(FACTS_TERM, stacked && 'text-xs')}>{row.label}</dt>
|
|
44
82
|
<dd className={FACTS_VALUE}>{row.value}</dd>
|
|
45
83
|
</div>
|
|
46
84
|
))}
|
package/src/page/index.ts
CHANGED
|
@@ -19,6 +19,8 @@ export { ArticleLayout } from './article-layout'
|
|
|
19
19
|
export { ToastHost } from './toast-host'
|
|
20
20
|
export { Page } from './page'
|
|
21
21
|
export { PageBar } from './page-bar'
|
|
22
|
+
export { BarTitle } from './bar-title'
|
|
23
|
+
export type { BarTitleProps } from './bar-title'
|
|
22
24
|
export { PageAside } from './page-aside'
|
|
23
25
|
export { Facts } from './facts'
|
|
24
26
|
export { PropertyList, controlProperty } from './property-list'
|
|
@@ -33,6 +35,12 @@ export { ConnectionIndicator } from './connection-indicator'
|
|
|
33
35
|
export type { ConnectionIndicatorProps } from './connection-indicator'
|
|
34
36
|
export { RefreshButton } from './refresh-button'
|
|
35
37
|
export type { RefreshButtonProps } from './refresh-button'
|
|
38
|
+
export { createRunQueue, useRuns } from './run-queue'
|
|
39
|
+
export type { Run, RunQueue, RunResult, RunTask } from './run-queue'
|
|
40
|
+
export { RunButton } from './run-button'
|
|
41
|
+
export type { RunButtonProps } from './run-button'
|
|
42
|
+
export { RunList } from './run-list'
|
|
43
|
+
export type { RunListProps } from './run-list'
|
|
36
44
|
export { Dock } from './dock'
|
|
37
45
|
export type { DockProps } from './dock'
|
|
38
46
|
export { FavoriteToggle, useFavorite } from './favorites'
|
package/src/page/page-bar.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import { Kbd } from '../ui/kbd'
|
|
|
14
14
|
import { EntityTitle } from '../ui/entity'
|
|
15
15
|
import { Input } from '../ui/input'
|
|
16
16
|
import { Menu, MenuContent, MenuItem, MenuTrigger } from '../ui/menu'
|
|
17
|
+
import { BAR_TITLE } from './bar-title'
|
|
17
18
|
import { ConnectionIndicator } from './connection-indicator'
|
|
18
19
|
import { FavoriteToggle } from './favorites'
|
|
19
20
|
import { CLOSE, Glyph, PanelSteps } from './panel-steps'
|
|
@@ -615,15 +616,7 @@ export function PageBar<K extends string = string, L extends string = string>({
|
|
|
615
616
|
{...(identity.tags !== undefined && { tags: identity.tags })}
|
|
616
617
|
/>
|
|
617
618
|
) : (
|
|
618
|
-
<h1
|
|
619
|
-
className={
|
|
620
|
-
inShell
|
|
621
|
-
? 'sr-only'
|
|
622
|
-
: 'm-0 min-w-0 font-head text-lg font-semibold tracking-tight text-balance text-foreground'
|
|
623
|
-
}
|
|
624
|
-
>
|
|
625
|
-
{title}
|
|
626
|
-
</h1>
|
|
619
|
+
<h1 className={inShell ? 'sr-only' : BAR_TITLE}>{title}</h1>
|
|
627
620
|
)
|
|
628
621
|
|
|
629
622
|
if (!bandHasContent) return <>{heading}</>
|
|
@@ -16,7 +16,8 @@ import type { ERROR_KEYS } from './error-cause'
|
|
|
16
16
|
* A fact is a node, or a label and a value as a footer fact is: `{ label: 'Last reindex', value,
|
|
17
17
|
* mono: true }` sets a time or an id in the mono face, which a node cannot ask for.
|
|
18
18
|
*/
|
|
19
|
-
type
|
|
19
|
+
type SummaryFact = Pick<LabelledFact, 'label' | 'value' | 'mono'>
|
|
20
|
+
type Fact = ReactNode | SummaryFact | null | false | undefined
|
|
20
21
|
|
|
21
22
|
type PageSummaryContent = {
|
|
22
23
|
/** The headline sentence. It must state a live number: never describe the page. */
|
|
@@ -55,7 +56,7 @@ function causeOf(
|
|
|
55
56
|
const isShown = (fact: Fact): boolean =>
|
|
56
57
|
fact !== null && fact !== false && fact !== undefined && fact !== ''
|
|
57
58
|
|
|
58
|
-
const isLabelled = (fact: Fact): fact is
|
|
59
|
+
const isLabelled = (fact: Fact): fact is SummaryFact =>
|
|
59
60
|
typeof fact === 'object' &&
|
|
60
61
|
fact !== null &&
|
|
61
62
|
!isValidElement(fact) &&
|
|
@@ -72,7 +73,7 @@ function FactText({ fact }: { fact: Fact }): ReactNode {
|
|
|
72
73
|
data-monospace={fact.mono === true ? '' : undefined}
|
|
73
74
|
className={cn(fact.mono === true && 'font-mono tabular-nums')}
|
|
74
75
|
>
|
|
75
|
-
{fact.value}
|
|
76
|
+
{fact.value ?? '–'}
|
|
76
77
|
</span>
|
|
77
78
|
</>
|
|
78
79
|
)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ReactElement } from 'react'
|
|
2
|
+
import { Button } from '../ui/button'
|
|
3
|
+
import type { ButtonProps } from '../ui/button'
|
|
4
|
+
import { useRuns } from './run-queue'
|
|
5
|
+
import type { RunQueue, RunTask } from './run-queue'
|
|
6
|
+
|
|
7
|
+
export type RunButtonProps<D = unknown> = ButtonProps & {
|
|
8
|
+
queue: RunQueue<D>
|
|
9
|
+
task: RunTask<D>
|
|
10
|
+
/** Stays pressable while its runs are open: a remote key pressed three times in a row. */
|
|
11
|
+
repeatable?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A button that starts a task on a queue and is busy until that task's latest run has ended. Its
|
|
16
|
+
* `data-action` is the latest run's phase, `idle` before the first. Where the outcome shows is
|
|
17
|
+
* `RunList`'s job.
|
|
18
|
+
*
|
|
19
|
+
* @useWhen a press sends a command that takes seconds
|
|
20
|
+
* @neverWhen the press is local and instant (use `Button`), or it submits a form (use the form's submit)
|
|
21
|
+
* @instead Button
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <RunButton queue={commands} task={tvOn} variant="primary">TV on</RunButton>
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <RunButton queue={commands} task={volumeUp} repeatable>Volume up</RunButton>
|
|
28
|
+
*/
|
|
29
|
+
export function RunButton<D = unknown>({
|
|
30
|
+
queue,
|
|
31
|
+
task,
|
|
32
|
+
repeatable = false,
|
|
33
|
+
onClick,
|
|
34
|
+
loading,
|
|
35
|
+
...props
|
|
36
|
+
}: RunButtonProps<D>): ReactElement {
|
|
37
|
+
const latest = useRuns(queue).find((run) => run.task === task.id)
|
|
38
|
+
const busy = latest?.phase === 'running' || latest?.phase === 'waiting'
|
|
39
|
+
const press: NonNullable<ButtonProps['onClick']> = (event) => {
|
|
40
|
+
onClick?.(event)
|
|
41
|
+
if (!event.defaultPrevented) queue.start(task)
|
|
42
|
+
}
|
|
43
|
+
return (
|
|
44
|
+
<Button
|
|
45
|
+
type="button"
|
|
46
|
+
{...(props as ButtonProps)}
|
|
47
|
+
loading={loading === true || (busy && !repeatable)}
|
|
48
|
+
data-action={latest?.phase ?? 'idle'}
|
|
49
|
+
onClick={press}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|