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/cli/sync/engine.ts
CHANGED
|
@@ -17,19 +17,23 @@ import {
|
|
|
17
17
|
import { dirname, relative, resolve } from 'node:path'
|
|
18
18
|
|
|
19
19
|
import { sha256 } from '../index'
|
|
20
|
+
import { AGENTS_FILE, agentsPath } from '../manifest'
|
|
20
21
|
import type { Manifest } from '../manifest'
|
|
21
22
|
import { scanBlock, spliceBlock } from './block'
|
|
22
23
|
import { unitPath } from './sibling'
|
|
23
24
|
import type { Unit } from './render'
|
|
24
25
|
|
|
25
|
-
export
|
|
26
|
+
export { AGENTS_FILE }
|
|
26
27
|
|
|
27
28
|
export type State = 'current' | 'missing' | 'stale' | 'edited'
|
|
28
|
-
|
|
29
|
+
/** `shadows`: an edited file at a shipped path that basalt never placed (no ledger digest), a file of the consumer's own. */
|
|
30
|
+
export type Item = Unit & { state: State; shadows: boolean }
|
|
29
31
|
export type Retired = { path: string; state: 'untouched' | 'edited' | 'gone' }
|
|
30
32
|
export type Plan = {
|
|
31
33
|
items: Item[]
|
|
32
34
|
retired: Retired[]
|
|
35
|
+
/** The file the block lives in, relative to the install root (`manifest.agents`). */
|
|
36
|
+
agents: string
|
|
33
37
|
/** Generated files no longer placed that are still on disk (the shim, a hook file basalt alone filled). */
|
|
34
38
|
drops: string[]
|
|
35
39
|
/** `text` is the whole host after the splice; `''` deletes a host the block alone filled. */
|
|
@@ -59,10 +63,14 @@ export function planSync(
|
|
|
59
63
|
repo: string = root,
|
|
60
64
|
drops: readonly string[] = [],
|
|
61
65
|
): Plan {
|
|
62
|
-
const items = units.map((unit) =>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
const items = units.map((unit): Item => {
|
|
67
|
+
const state = stateOf(unit, readText(root, unit.path, repo), manifest.managed[unit.path])
|
|
68
|
+
return {
|
|
69
|
+
...unit,
|
|
70
|
+
state,
|
|
71
|
+
shadows: state === 'edited' && manifest.managed[unit.path] === undefined,
|
|
72
|
+
}
|
|
73
|
+
})
|
|
66
74
|
const wanted = new Set(units.map((unit) => unit.path))
|
|
67
75
|
const retired = Object.entries(manifest.managed)
|
|
68
76
|
.filter(([path]) => !wanted.has(path))
|
|
@@ -74,23 +82,25 @@ export function planSync(
|
|
|
74
82
|
})
|
|
75
83
|
|
|
76
84
|
const dropped = drops.filter((path) => readText(root, path, repo) !== null)
|
|
77
|
-
const
|
|
78
|
-
const
|
|
85
|
+
const agents = agentsPath(manifest)
|
|
86
|
+
const host = readText(root, agents, repo) ?? ''
|
|
87
|
+
const scan = scanBlock(host, agents)
|
|
79
88
|
if (typeof scan === 'object' && 'error' in scan) {
|
|
80
|
-
return { items, retired, drops: dropped, block: scan }
|
|
89
|
+
return { items, retired, agents, drops: dropped, block: scan }
|
|
81
90
|
}
|
|
82
91
|
if (block === null) {
|
|
83
92
|
const text = scan === 'absent' ? host : cutBlock(host, scan)
|
|
84
93
|
return {
|
|
85
94
|
items,
|
|
86
95
|
retired,
|
|
96
|
+
agents,
|
|
87
97
|
drops: dropped,
|
|
88
98
|
block: { state: text === host ? 'current' : 'stale', text },
|
|
89
99
|
}
|
|
90
100
|
}
|
|
91
101
|
const text = spliceBlock(host, scan, block)
|
|
92
102
|
const state = scan === 'absent' ? 'missing' : text === host ? 'current' : 'stale'
|
|
93
|
-
return { items, retired, drops: dropped, block: { state, text } }
|
|
103
|
+
return { items, retired, agents, drops: dropped, block: { state, text } }
|
|
94
104
|
}
|
|
95
105
|
|
|
96
106
|
/** The host without the block and the blank lines around it; `''` when nothing else is left. */
|
|
@@ -104,19 +114,25 @@ function cutBlock(host: string, scan: { start: number; end: number }): string {
|
|
|
104
114
|
return text === '' ? '' : `${text}\n`
|
|
105
115
|
}
|
|
106
116
|
|
|
117
|
+
/** What `sync` and `doctor` say for a consumer's own file that sits at a shipped path: the name is taken by the shipped layer. */
|
|
118
|
+
export function shadowNote(path: string): string {
|
|
119
|
+
const kind = path.includes('/rules/') ? 'rule' : 'file'
|
|
120
|
+
return `your file shadows a shipped ${kind}: rename it, then sync --force`
|
|
121
|
+
}
|
|
122
|
+
|
|
107
123
|
/** Every path a plan would change; `--check` is red on any, a locally edited file included. */
|
|
108
124
|
export function differences(plan: Plan): string[] {
|
|
109
125
|
const how = { missing: 'missing', stale: 'out of date', edited: 'edited locally', current: '' }
|
|
110
126
|
const lines = plan.items
|
|
111
127
|
.filter((i) => i.state !== 'current')
|
|
112
|
-
.map((i) => `${i.path}: ${how[i.state]}`)
|
|
128
|
+
.map((i) => (i.shadows ? `${i.path}: ${shadowNote(i.path)}` : `${i.path}: ${how[i.state]}`))
|
|
113
129
|
for (const r of plan.retired) {
|
|
114
130
|
if (r.state !== 'gone')
|
|
115
131
|
lines.push(`${r.path}: retired${r.state === 'edited' ? ' (edited locally)' : ''}`)
|
|
116
132
|
}
|
|
117
133
|
for (const path of plan.drops) lines.push(`${path}: no longer placed`)
|
|
118
134
|
if ('state' in plan.block && plan.block.state !== 'current') {
|
|
119
|
-
lines.push(`${
|
|
135
|
+
lines.push(`${plan.agents}: basalt block ${how[plan.block.state]}`)
|
|
120
136
|
}
|
|
121
137
|
return lines
|
|
122
138
|
}
|
|
@@ -181,8 +197,8 @@ export function applySync(
|
|
|
181
197
|
applied.removed++
|
|
182
198
|
}
|
|
183
199
|
if ('state' in plan.block && plan.block.state !== 'current') {
|
|
184
|
-
if (plan.block.text === '') remove(root,
|
|
185
|
-
else put(root,
|
|
200
|
+
if (plan.block.text === '') remove(root, plan.agents, repo)
|
|
201
|
+
else put(root, plan.agents, plan.block.text, repo)
|
|
186
202
|
applied.written++
|
|
187
203
|
}
|
|
188
204
|
return applied
|
package/src/cli/sync/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { BUDGET_FORMAT, BUDGET_PATH, migrateBudget, readBudget } from '../budget
|
|
|
15
15
|
import { staleRecord } from '../lint/record'
|
|
16
16
|
import { MANIFEST_FORMAT, MANIFEST_PATH, readManifest, writeManifest } from '../manifest'
|
|
17
17
|
import type { Manifest } from '../manifest'
|
|
18
|
-
import { applySync, differences, planSync } from './engine'
|
|
18
|
+
import { applySync, differences, planSync, shadowNote } from './engine'
|
|
19
19
|
import { lintSettingsUnits } from '../lint-settings'
|
|
20
20
|
import { presetFilesFor } from '../presets'
|
|
21
21
|
import { coveredByRoots, undeclaredInstall } from '../resolver'
|
|
@@ -147,7 +147,8 @@ export function sync(opts: SyncOptions = {}, invocationCwd: string = process.cwd
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
const bases = repo === root ? [root] : [root, repo]
|
|
150
|
-
const
|
|
150
|
+
const agents = [plan.agents]
|
|
151
|
+
const before = agentFiles(bases, agents)
|
|
151
152
|
const applied = applySync(root, manifest, plan, opts.force === true, repo)
|
|
152
153
|
applyEjected(root, ejects)
|
|
153
154
|
migrateBudget(root)
|
|
@@ -158,10 +159,12 @@ export function sync(opts: SyncOptions = {}, invocationCwd: string = process.cwd
|
|
|
158
159
|
)
|
|
159
160
|
if (applied.left.length > 0) {
|
|
160
161
|
console.log('Locally edited files were left as they are (run with --force to overwrite):')
|
|
161
|
-
|
|
162
|
+
const shadowed = new Set(plan.items.filter((i) => i.shadows).map((i) => i.path))
|
|
163
|
+
for (const path of applied.left)
|
|
164
|
+
console.log(` ${path}${shadowed.has(path) ? `: ${shadowNote(path)}` : ''}`)
|
|
162
165
|
}
|
|
163
166
|
for (const problem of install.problems) console.error(`✖ basalt-ui sync: ${problem}`)
|
|
164
|
-
const note = opts.note === false ? null : sessionNote(before, bases)
|
|
167
|
+
const note = opts.note === false ? null : sessionNote(before, bases, agents)
|
|
165
168
|
if (note !== null) console.log(`\n${note}`)
|
|
166
169
|
return ejects.conflicts.length + ejects.errors.length + install.problems.length === 0 ? 0 : 1
|
|
167
170
|
}
|
package/src/cli/sync/render.ts
CHANGED
|
@@ -19,10 +19,10 @@ import { renderRulePaths } from '../index'
|
|
|
19
19
|
import { HARNESS_NAMES, HOOK_ADAPTERS, HOOK_TARGETS, harnessesOf, placementFor } from '../harness'
|
|
20
20
|
import type { Harness, HookAdapter } from '../harness'
|
|
21
21
|
import { hooksObject, mergeSettings, SHIM, stripHookEntries } from '../lint/settings'
|
|
22
|
-
import { isSiteManifest } from '../manifest'
|
|
22
|
+
import { DEFAULT_REPORT, designPath, isSiteManifest } from '../manifest'
|
|
23
23
|
import type { Manifest, Profile } from '../manifest'
|
|
24
24
|
import { renderTokens } from '../tokens-css'
|
|
25
|
-
import { portableSkill,
|
|
25
|
+
import { portableSkill, subagentFor } from './formats'
|
|
26
26
|
import { REPO, renameRefs, siblingName } from './sibling'
|
|
27
27
|
import type { Sibling } from './sibling'
|
|
28
28
|
|
|
@@ -252,7 +252,7 @@ export function renderBlock(
|
|
|
252
252
|
.replace(/\n{3,}/g, '\n\n')
|
|
253
253
|
.trim()
|
|
254
254
|
// A mixed install places the site skill for its site roots: the app block names it beside the app skills.
|
|
255
|
-
if (!site && profiles.includes('site')) block = withSiteSkill(block
|
|
255
|
+
if (!site && profiles.includes('site')) block = withSiteSkill(block)
|
|
256
256
|
return sibling === null ? block : renameRefs(block, sibling.prefix, skillNames(pkgRoot))
|
|
257
257
|
}
|
|
258
258
|
|
|
@@ -286,13 +286,13 @@ function layerVars(
|
|
|
286
286
|
const harnesses = harnessesOf(manifest)
|
|
287
287
|
const placement = placementFor(manifest)
|
|
288
288
|
const site = isSiteManifest(manifest)
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
289
|
+
const ruleDirs = [
|
|
290
|
+
...new Set(
|
|
291
|
+
units
|
|
292
|
+
.filter((u) => u.source?.startsWith('agent/rules/') === true)
|
|
293
|
+
.map((u) => posixRepo(u.path).split('/').slice(0, -1).join('/')),
|
|
294
|
+
),
|
|
295
|
+
]
|
|
296
296
|
const skillDirs = placement.skills.map((dir) => {
|
|
297
297
|
const readers = (SKILL_READERS[dir] ?? []).filter((h) => harnesses.includes(h))
|
|
298
298
|
// OpenCode reads both: it is named beside the one placed for it alone.
|
|
@@ -302,10 +302,11 @@ function layerVars(
|
|
|
302
302
|
: readers
|
|
303
303
|
return `${code(`${dir}/`)} (${names(shown)})`
|
|
304
304
|
})
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
305
|
+
const placedReviewer = units.some(
|
|
306
|
+
(u) =>
|
|
307
|
+
u.source?.startsWith('agent/reviewer/') === true &&
|
|
308
|
+
(u.source.includes('basalt-site-reviewer') === true) === site,
|
|
309
|
+
)
|
|
309
310
|
const hooked: Harness[] = unhookedInstall
|
|
310
311
|
? []
|
|
311
312
|
: [...placement.hooks, ...placement.adapters]
|
|
@@ -321,11 +322,9 @@ function layerVars(
|
|
|
321
322
|
? ''
|
|
322
323
|
: `\`.basalt/hook.mjs\` lints each edit in ${names(hooked)} as it is written and refuses an edit of a managed file.`,
|
|
323
324
|
hooked.includes('codex') ? 'Codex runs it once you trust it in `/hooks`.' : '',
|
|
324
|
-
hooked.includes('pi')
|
|
325
|
-
? 'Pi runs it when started in this directory, once you trust the project.'
|
|
326
|
-
: '',
|
|
325
|
+
hooked.includes('pi') ? 'Pi runs it once you trust the project.' : '',
|
|
327
326
|
hooked.includes('opencode')
|
|
328
|
-
? `OpenCode 2 has no end-of-turn re-check
|
|
327
|
+
? `OpenCode 1 loads no hook and OpenCode 2 has no end-of-turn re-check: there, ${lintFirst}.`
|
|
329
328
|
: '',
|
|
330
329
|
unhooked.length === 0
|
|
331
330
|
? ''
|
|
@@ -335,31 +334,24 @@ function layerVars(
|
|
|
335
334
|
.filter((s) => s !== '')
|
|
336
335
|
.join(' ')
|
|
337
336
|
const load = harnesses.includes('claude-code')
|
|
338
|
-
? 'Claude Code loads each by its paths; any other agent reads the
|
|
339
|
-
: '
|
|
337
|
+
? 'Claude Code loads each by its paths; any other agent reads the one whose paths match before it edits'
|
|
338
|
+
: 'each names its paths: read the one that matches before you edit'
|
|
340
339
|
return {
|
|
341
|
-
|
|
340
|
+
RULES_AT: ruleDirs.map((dir) => code(`${dir}/`)).join(' and '),
|
|
341
|
+
LOAD: load,
|
|
342
|
+
DESIGN: designPath(manifest),
|
|
343
|
+
REPORT: manifest.report ?? DEFAULT_REPORT,
|
|
342
344
|
SKILLS_AT: skillDirs.join(' and '),
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
? `no subagent in Pi: hand \`node_modules/basalt-ui/agent/reviewer/${site ? 'basalt-site-reviewer' : 'basalt-design-reviewer'}.md\` to a fresh session`
|
|
347
|
-
: reviewer.join(', '),
|
|
345
|
+
REVIEWER: placedReviewer
|
|
346
|
+
? `; the \`basalt-${site ? 'site' : 'design'}-reviewer\` subagent`
|
|
347
|
+
: '',
|
|
348
348
|
HOOK: hook,
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
/** The app block with the site
|
|
353
|
-
function withSiteSkill(block: string
|
|
354
|
-
|
|
355
|
-
const bullet = existsSync(siteBlock)
|
|
356
|
-
? /^- `\/basalt-site`:.*$/m.exec(readFileSync(siteBlock, 'utf8'))?.[0]
|
|
357
|
-
: undefined
|
|
358
|
-
if (bullet === undefined) return block
|
|
359
|
-
const skills = [...block.matchAll(/^- `\/basalt-[a-z-]+`:.*$/gm)].at(-1)
|
|
360
|
-
if (skills === undefined) return `${block}\n\n${bullet}`
|
|
361
|
-
const at = (skills.index ?? 0) + skills[0].length
|
|
362
|
-
return `${block.slice(0, at)}\n${bullet}${block.slice(at)}`
|
|
352
|
+
/** The app block with the site skill named after the app skills. */
|
|
353
|
+
function withSiteSkill(block: string): string {
|
|
354
|
+
return block.replace('`/basalt-app`', (app) => `${app}, \`/basalt-site\``)
|
|
363
355
|
}
|
|
364
356
|
|
|
365
357
|
export const HOOK_TEMPLATE = 'agent/templates/hook.mjs.tpl'
|
package/src/cli/tokens-css.ts
CHANGED
|
@@ -32,7 +32,7 @@ function flagValue(flags: string[], name: string): string | undefined {
|
|
|
32
32
|
* basalt starts reporting its own output again (116 findings in rollhook's token sheet).
|
|
33
33
|
*/
|
|
34
34
|
function generatedHeader(version: string, command: string, flags: string[]): string {
|
|
35
|
-
const shown = flags
|
|
35
|
+
const shown = recordedFlags(flags)
|
|
36
36
|
const invocation = shown.length === 0 ? command : `${command} ${shown.join(' ')}`
|
|
37
37
|
return `${GENERATED_HEADER_LINE}\n/* basalt-ui ${version} — \`basalt-ui ${invocation}\` */\n`
|
|
38
38
|
}
|
|
@@ -123,6 +123,7 @@ const VALUE_FLAGS = [
|
|
|
123
123
|
'--vibrancy',
|
|
124
124
|
'--selector',
|
|
125
125
|
'--accents',
|
|
126
|
+
'--pick',
|
|
126
127
|
'--extra',
|
|
127
128
|
'--format',
|
|
128
129
|
'--out',
|
|
@@ -197,10 +198,23 @@ function readAccents(flags: string[]): { names: AccentName[] } | { error: string
|
|
|
197
198
|
|
|
198
199
|
/** `tokens:css <flags minus --check>`: the invocation line 2 of the header (and `$provenance`) records. */
|
|
199
200
|
function invocationOf(flags: string[]): string {
|
|
200
|
-
const shown = flags
|
|
201
|
+
const shown = recordedFlags(flags)
|
|
201
202
|
return shown.length === 0 ? 'basalt-ui tokens:css' : `basalt-ui tokens:css ${shown.join(' ')}`
|
|
202
203
|
}
|
|
203
204
|
|
|
205
|
+
/**
|
|
206
|
+
* The flags line 2 records. `--out` and `--extra` take paths read from the cwd, so neither is recorded as
|
|
207
|
+
* typed (a check from another directory would drift): `--out` is dropped, `--extra` shows `<file>`.
|
|
208
|
+
*/
|
|
209
|
+
function recordedFlags(flags: string[]): string[] {
|
|
210
|
+
return flags.flatMap((f, i) => {
|
|
211
|
+
const prev = flags[i - 1]
|
|
212
|
+
if (f === '--check' || f === '--out' || prev === '--out') return []
|
|
213
|
+
if (prev === '--extra') return []
|
|
214
|
+
return f === '--extra' ? ['--extra', '<file>'] : [f]
|
|
215
|
+
})
|
|
216
|
+
}
|
|
217
|
+
|
|
204
218
|
/** What one `tokens:css` run emits: files to `--out` (paths as given), or the stylesheet for stdout. */
|
|
205
219
|
export type TokenEmit = { files: { out: string; content: string }[] } | { stdout: string }
|
|
206
220
|
|
|
@@ -214,9 +228,15 @@ function extraOutput(flags: string[], cwd: string, version: string): TokenEmit |
|
|
|
214
228
|
'tokens:css --extra needs --out <path>: the app sheet is a committed file, so there is no stdout form.',
|
|
215
229
|
}
|
|
216
230
|
}
|
|
217
|
-
const clash = [
|
|
218
|
-
|
|
219
|
-
|
|
231
|
+
const clash = [
|
|
232
|
+
'--accent',
|
|
233
|
+
'--neutral',
|
|
234
|
+
'--vibrancy',
|
|
235
|
+
'--selector',
|
|
236
|
+
'--accents',
|
|
237
|
+
'--pick',
|
|
238
|
+
'--format',
|
|
239
|
+
].find((f) => flags.includes(f))
|
|
220
240
|
if (clash !== undefined) {
|
|
221
241
|
return {
|
|
222
242
|
error: `tokens:css --extra emits the app-owned sheet only; ${clash} belongs to the basalt-ui sheet — run it without --extra.`,
|
|
@@ -272,11 +292,26 @@ export function renderTokens(
|
|
|
272
292
|
}
|
|
273
293
|
}
|
|
274
294
|
|
|
295
|
+
const pick = flagValue(flags, '--pick')
|
|
296
|
+
?.split(',')
|
|
297
|
+
.map((n) => n.trim())
|
|
298
|
+
.filter((n) => n !== '')
|
|
299
|
+
if (
|
|
300
|
+
pick !== undefined &&
|
|
301
|
+
(selector !== undefined || accents !== null || format === 'json' || pick.length === 0)
|
|
302
|
+
) {
|
|
303
|
+
return {
|
|
304
|
+
error:
|
|
305
|
+
'tokens:css: --pick <name,…> cuts the full stylesheet down; drop --selector, --accents and --format.',
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
275
309
|
const options = {
|
|
276
310
|
version,
|
|
277
311
|
command: invocationOf(flags),
|
|
278
312
|
...(Object.keys(read.config).length === 0 ? {} : { config: read.config }),
|
|
279
313
|
...(selector === undefined ? {} : { selector }),
|
|
314
|
+
...(pick === undefined ? {} : { pick }),
|
|
280
315
|
}
|
|
281
316
|
let content: string
|
|
282
317
|
try {
|
|
@@ -305,6 +340,8 @@ export function renderTokens(
|
|
|
305
340
|
* - `--accent --neutral --vibrancy` retune the identity; a config that fails a gate exits 1 with
|
|
306
341
|
* the gate, the scheme and the ratio.
|
|
307
342
|
* - `--selector ":root[<attr>]"` emits a tenant sheet: only the roles that differ from the default.
|
|
343
|
+
* - `--pick canvas,ink` cuts the sheet down to those tokens and what they reference, for a standalone
|
|
344
|
+
* document that loads no basalt sheet.
|
|
308
345
|
* - `--extra <file>` emits the app-owned tokens instead (see `./tokens-css-extra`).
|
|
309
346
|
* - `--check` writes nothing and exits 1 on any byte of drift in what `--out` names.
|
|
310
347
|
*/
|
package/src/controls/contract.ts
CHANGED
|
@@ -94,6 +94,7 @@ export type ControlHome =
|
|
|
94
94
|
| 'sheet'
|
|
95
95
|
| 'side-panel'
|
|
96
96
|
| 'overlay'
|
|
97
|
+
| 'command'
|
|
97
98
|
|
|
98
99
|
export type ControlPresentation = 'pill' | 'row' | 'inline'
|
|
99
100
|
|
|
@@ -109,6 +110,7 @@ export type HomePresentation = {
|
|
|
109
110
|
sheet: 'row'
|
|
110
111
|
'side-panel': 'row'
|
|
111
112
|
overlay: 'row'
|
|
113
|
+
command: 'row'
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
export type ControlHomeProps = { home: ControlHome; children?: ReactNode }
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
* |-|-|
|
|
7
7
|
* | `page-bar`, `section-header`, `view-mode` | `pill` |
|
|
8
8
|
* | `card-header`, `tool` | `inline` |
|
|
9
|
-
* | `form-row`, `aside`, `sheet`, `side-panel`, `overlay` | `row` |
|
|
9
|
+
* | `form-row`, `aside`, `sheet`, `side-panel`, `overlay`, `command` | `row` |
|
|
10
|
+
*
|
|
11
|
+
* `command` is the one home whose controls hold no filter: using one sends a request (a volume
|
|
12
|
+
* released, a lamp switched), so it draws a plain box, not the group named "Filters".
|
|
10
13
|
*
|
|
11
14
|
* `view-mode` and `tool` sit in a toolbar row, so they draw a `Toolbar` with one `ToolbarGroup`. A pill that a
|
|
12
15
|
* fold moves into a popover draws the `row` form (`FoldedControls`): a pill inside a pill would nest
|
|
@@ -41,6 +44,7 @@ export const HOME_PRESENTATION = {
|
|
|
41
44
|
sheet: 'row',
|
|
42
45
|
'side-panel': 'row',
|
|
43
46
|
overlay: 'row',
|
|
47
|
+
command: 'row',
|
|
44
48
|
} as const satisfies HomePresentation
|
|
45
49
|
|
|
46
50
|
/** Homes whose controls share a toolbar row with buttons, and so draw through `ToolbarGroup`. */
|
|
@@ -73,7 +77,9 @@ const SLOT: Record<ControlPresentation, string> = {
|
|
|
73
77
|
/**
|
|
74
78
|
* Hosts controls and gives them the presentation of its `home`. A `FilterSet` or a `filterSlot`
|
|
75
79
|
* inside reads it; with no home around, a control is a `pill`. A home with nothing to draw renders
|
|
76
|
-
* nothing, so an empty slot leaves no gap.
|
|
80
|
+
* nothing, so an empty slot leaves no gap. A control that sends a request and holds no stored value
|
|
81
|
+
* (an absolute volume sent on release) goes in `home="command"`: it is named by its own label, and
|
|
82
|
+
* the app owns the shown value (the reported one, or the pick until the request answers).
|
|
77
83
|
*
|
|
78
84
|
* @useWhen you place controls in a surface that is not a slot of a composite (an aside, a sheet, a toolbar)
|
|
79
85
|
* @neverWhen you want a different look for one control: the home decides the look, never a prop
|
|
@@ -89,10 +95,15 @@ export function ControlHome({ home, children }: ControlHomeProps): ReactElement
|
|
|
89
95
|
const presentation = folded ? 'row' : presentationOf(home)
|
|
90
96
|
const toolbar = TOOLBAR_HOMES.has(home) && !folded
|
|
91
97
|
const slotHome = !folded && FOLDING_HOMES.has(home) ? (home as FoldingHome) : undefined
|
|
98
|
+
const frame = cn('m-0 border-0 p-0 empty:hidden', FRAME[presentation])
|
|
92
99
|
return (
|
|
93
100
|
<ControlPresentationContext value={presentation}>
|
|
94
101
|
<SlotHomeContext value={slotHome}>
|
|
95
|
-
{
|
|
102
|
+
{home === 'command' ? (
|
|
103
|
+
<div data-slot="control-command" data-home={home} className={frame}>
|
|
104
|
+
{children}
|
|
105
|
+
</div>
|
|
106
|
+
) : toolbar ? (
|
|
96
107
|
<Toolbar
|
|
97
108
|
aria-label={t('common.filters')}
|
|
98
109
|
data-home={home}
|
|
@@ -107,7 +118,7 @@ export function ControlHome({ home, children }: ControlHomeProps): ReactElement
|
|
|
107
118
|
data-slot={SLOT[presentation]}
|
|
108
119
|
data-home={home}
|
|
109
120
|
aria-label={t('common.filters')}
|
|
110
|
-
className={
|
|
121
|
+
className={frame}
|
|
111
122
|
>
|
|
112
123
|
{children}
|
|
113
124
|
</fieldset>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
|
+
import type { ControlHandle } from '../core/ports'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* A value that lives as long as the component that owns it (a dialog's draft, a popover's choice),
|
|
@@ -11,24 +12,69 @@ export type LocalControl<T> = {
|
|
|
11
12
|
readonly isDefault: boolean
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
/**
|
|
16
|
+
* What a local value needs to stand as a card's control: the identity and the kind a `spec` is drawn
|
|
17
|
+
* from, as `externalField` takes them.
|
|
18
|
+
*/
|
|
19
|
+
export type LocalFieldOptions<T> = {
|
|
20
|
+
/** Stable identity of the control within its slot (`ControlHandle.key`). */
|
|
21
|
+
key: string
|
|
22
|
+
kind: ControlHandle<T>['kind']
|
|
23
|
+
options?: ControlHandle<T>['options']
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A local value as a widget-scoped `ControlHandle`: `spec(handle, label)` makes a spec a card's
|
|
28
|
+
* `controls` slot takes (`ChartCard`, `StatCard`, `DataPanel`). It has no lane and `clear()` writes
|
|
29
|
+
* the starting value back.
|
|
30
|
+
*/
|
|
31
|
+
export type LocalField<T> = ControlHandle<T> & { readonly scope: 'widget' }
|
|
32
|
+
|
|
14
33
|
/**
|
|
15
34
|
* The handle of a value that lives in the calling component: it starts at `initial`, resets when the
|
|
16
35
|
* component unmounts (a closed dialog) and is shared with nothing. Call it where a hook may be
|
|
17
36
|
* called and pass the result to `FormField control=`.
|
|
18
37
|
*
|
|
19
|
-
*
|
|
38
|
+
* Given `{ key, kind }` it is a card's own control instead: a window or a mode that only that card
|
|
39
|
+
* reads, drawn through `filterSlot([spec(handle, 'Window')])` in the card's `controls`.
|
|
40
|
+
*
|
|
41
|
+
* @useWhen a control's value lives as long as one dialog, sheet, popover or card and nothing outside it reads it
|
|
20
42
|
* @neverWhen the value should survive a reload (use `persisted`), appear in a shared link (use a router field) or is another store's (use `externalField`)
|
|
21
43
|
* @instead externalField
|
|
22
44
|
*
|
|
23
45
|
* @example
|
|
24
46
|
* const view = useLocalControl<'list' | 'grid'>('list')
|
|
25
47
|
* <FormField label="Layout" control={view}>{(bind) => <Segmented {...bind} options={LAYOUTS} />}</FormField>
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* const window = useLocalControl('24h', { key: 'window', kind: 'enum', options: WINDOWS })
|
|
51
|
+
* <ChartCard title="Throughput" controls={filterSlot([spec(window, 'Window', { as: 'segmented' })])} chart={…} />
|
|
26
52
|
*/
|
|
27
|
-
export function useLocalControl<T>(initial: T | (() => T)): LocalControl<T>
|
|
53
|
+
export function useLocalControl<T>(initial: T | (() => T)): LocalControl<T>
|
|
54
|
+
export function useLocalControl<T>(
|
|
55
|
+
initial: T | (() => T),
|
|
56
|
+
field: LocalFieldOptions<T>,
|
|
57
|
+
): LocalField<T>
|
|
58
|
+
export function useLocalControl<T>(
|
|
59
|
+
initial: T | (() => T),
|
|
60
|
+
field?: LocalFieldOptions<T>,
|
|
61
|
+
): LocalControl<T> | LocalField<T> {
|
|
28
62
|
const [start] = useState(initial)
|
|
29
63
|
const [value, set] = useState(start)
|
|
64
|
+
const control = {
|
|
65
|
+
useValue: () => [value, set] as const,
|
|
66
|
+
isDefault: Object.is(value, start),
|
|
67
|
+
}
|
|
68
|
+
if (field === undefined) return control
|
|
69
|
+
const source = { source: 'own', inherited: undefined } as const
|
|
30
70
|
return {
|
|
71
|
+
key: field.key,
|
|
72
|
+
kind: field.kind,
|
|
73
|
+
...(field.options === undefined ? {} : { options: field.options }),
|
|
74
|
+
scope: 'widget',
|
|
31
75
|
useValue: () => [value, set],
|
|
32
|
-
|
|
76
|
+
useSource: () => source,
|
|
77
|
+
clear: () => set(start),
|
|
78
|
+
isDefault: control.isDefault,
|
|
33
79
|
}
|
|
34
80
|
}
|
package/src/core/cn.ts
CHANGED
|
@@ -92,7 +92,11 @@ exact('border-collapse', 'border-collapse border-separate')
|
|
|
92
92
|
const LENGTH = /^\[(?:[-+]?[\d.]+[a-z%]*|(?:calc|min|max|clamp)\(.*)\]$/
|
|
93
93
|
const NUMBER = /^(?:\d+(?:\.\d+)?|px|\[.*\])$/
|
|
94
94
|
const STRICT_NUMBER = /^\d+(?:\.\d+)?$/
|
|
95
|
-
|
|
95
|
+
// `sidebar*` and `*-foreground` are the shadcn names `bridge.css` adds.
|
|
96
|
+
const PALETTE =
|
|
97
|
+
/^(?:[a-z]+-\d{2,3}|black|white|transparent|current|inherit|sidebar.*|.+-foreground)$/
|
|
98
|
+
// Tailwind's scale steps: `bridge.css` restores the ones the theme clears.
|
|
99
|
+
const STEP = /^(?:2?xs|sm|md|lg|\d?xl)$/
|
|
96
100
|
const BG_KEYWORD: Record<string, string> = {
|
|
97
101
|
fixed: 'bg-attachment',
|
|
98
102
|
local: 'bg-attachment',
|
|
@@ -246,7 +250,7 @@ rule('transition', (rest) =>
|
|
|
246
250
|
rest === 'discrete' || rest === 'normal' ? 'transition-behavior' : 'transition',
|
|
247
251
|
)
|
|
248
252
|
rule('font', (rest) => {
|
|
249
|
-
if (THEME.fonts.has(rest)) return 'font-family'
|
|
253
|
+
if (THEME.fonts.has(rest) || rest === 'heading') return 'font-family'
|
|
250
254
|
return arbitraryKind(rest) === 'family-name' ? 'font-family' : 'font-weight'
|
|
251
255
|
})
|
|
252
256
|
rule('flex', (rest) => {
|
|
@@ -259,7 +263,7 @@ rule('object', (rest) =>
|
|
|
259
263
|
/^(?:contain|cover|fill|none|scale-down)$/.test(rest) ? 'object-fit' : 'object-position',
|
|
260
264
|
)
|
|
261
265
|
rule('text', (rest) => {
|
|
262
|
-
if (THEME.sizes.has(rest)) return 'font-size'
|
|
266
|
+
if (THEME.sizes.has(rest) || STEP.test(rest)) return 'font-size'
|
|
263
267
|
if (/^(?:left|center|right|justify|start|end)$/.test(rest)) return 'text-align'
|
|
264
268
|
if (/^(?:wrap|nowrap|balance|pretty)$/.test(rest)) return 'text-wrap'
|
|
265
269
|
if (rest === 'ellipsis' || rest === 'clip') return 'text-overflow'
|
|
@@ -285,14 +289,14 @@ rule('border', (rest) => {
|
|
|
285
289
|
})
|
|
286
290
|
for (const s of ['x', 'y', ...SIDES, 's', 'e']) rule(`border-${s}`, side('border', s))
|
|
287
291
|
rule('rounded', (rest) =>
|
|
288
|
-
rest === '' || THEME.radii.has(rest) ||
|
|
292
|
+
rest === '' || THEME.radii.has(rest) || STEP.test(rest) || rest[0] === '['
|
|
289
293
|
? 'rounded'
|
|
290
294
|
: undefined,
|
|
291
295
|
)
|
|
292
296
|
for (const s of ['t', 'r', 'b', 'l', 's', 'e', 'tl', 'tr', 'br', 'bl', 'ss', 'se', 'ee', 'es'])
|
|
293
297
|
rule(`rounded-${s}`, always(`rounded-${s}`))
|
|
294
298
|
rule('shadow', (rest) => {
|
|
295
|
-
if (rest === '' || THEME.shadows.has(rest)) return 'shadow'
|
|
299
|
+
if (rest === '' || THEME.shadows.has(rest) || STEP.test(rest)) return 'shadow'
|
|
296
300
|
if (!rest.startsWith('[')) return 'shadow-color'
|
|
297
301
|
return /^\[(?:color:|#|rgb|hsl|oklch|var\()/.test(rest) ? 'shadow-color' : 'shadow'
|
|
298
302
|
})
|
|
@@ -34,6 +34,12 @@ const DOT: Record<Verdict['tone'], string> = {
|
|
|
34
34
|
const MONO = 'font-mono tabular-nums'
|
|
35
35
|
/** A figure longer than this steps down a size where the card is narrower than `regular`. */
|
|
36
36
|
const LONG_FIGURE = 10
|
|
37
|
+
/** The unit counts for 0.4 of a character (13 px beside the 30 px figure), so `39.7` + `of 64 GB` keeps the display size. */
|
|
38
|
+
const UNIT_WEIGHT = 0.4
|
|
39
|
+
|
|
40
|
+
/** True when the figure and its unit are long enough to step down a size in a card narrower than `regular`. */
|
|
41
|
+
export const isLongFigure = (text: string | null, unit: string | undefined): boolean =>
|
|
42
|
+
(text?.length ?? 0) + (unit?.length ?? 0) * UNIT_WEIGHT > LONG_FIGURE
|
|
37
43
|
/**
|
|
38
44
|
* The readout line: the status and the period, the one place in the figure row a hover may change.
|
|
39
45
|
* Its box takes the rest of the row from `regular` up and a line of its own, one line tall even while
|
|
@@ -121,7 +127,7 @@ export function FigureRow({
|
|
|
121
127
|
className={cn(
|
|
122
128
|
// The answer is never cut: the figure keeps its width and the delta beside it gives way.
|
|
123
129
|
'shrink-0 text-display font-semibold whitespace-nowrap tabular-nums',
|
|
124
|
-
(text
|
|
130
|
+
isLongFigure(text, unit) && '@max-regular:text-lg',
|
|
125
131
|
text === null && 'text-muted-foreground',
|
|
126
132
|
)}
|
|
127
133
|
>
|