2.6 KiB
2.6 KiB
Gauge Component
- Status:
completed - Owner:
Codex - Date:
2026-03-25
Goal
Add a true radial Gauge component to packages/ui so the system supports meter-style KPI
visuals in addition to linear Progress and segmented progress bars.
Scope
- In scope:
- add a new
Gaugecomponent with radial SVG rendering - support dial and semi-circle shapes
- cover the component with tests and Storybook docs
- export the component from
@ai-ui/ui
- add a new
- Out of scope:
- registry metadata refresh while the worktree already contains unrelated registry edits
- retrofitting local draft dashboard stories to use the new component
- animated needle / pointer gauges
Constraints
Gaugeshould userole="meter"rather than overloadingProgress.- Keep
variantsemantic and reserve geometry differences for a dedicated shape dimension. - Follow the current Cadence UI tonal and motion language.
- Preserve the existing dirty worktree and avoid rewriting unrelated draft files.
Affected Surfaces
packages/ui/src/components/gauge.tsxpackages/ui/src/components/gauge.variants.tspackages/ui/src/components/gauge.test.tsxpackages/ui/src/skins.csspackages/ui/src/index.tsapps/docs/src/components/gauge.stories.tsx
Plan
- Define the Gauge API, rendering geometry, and stable slots.
- Implement the component with skin tokens and SVG arc math.
- Add tests and Storybook docs for geometry, states, and accessibility guidance.
- Run targeted validation for the package surface and changed files.
Validation
pnpm --filter @ai-ui/ui typecheckpnpm --filter @ai-ui/ui buildpnpm --filter @ai-ui/ui exec vitest run packages/ui/src/components/gauge.test.tsx --config ../../vitest.config.tspnpm exec eslint apps/docs/src/components/gauge.stories.tsx packages/ui/src/components/gauge.tsx packages/ui/src/components/gauge.variants.ts packages/ui/src/components/gauge.test.tsx packages/ui/src/index.ts
Status Log
2026-03-25 18:30Read the closest dashboard-oriented component and story patterns, and scoped Gauge as a separate meter primitive rather than an extension of Progress.2026-03-25 18:42Implemented theGaugecomponent with radial SVG geometry, dial and semi-circle shapes, meter semantics, and stable slots.2026-03-25 18:47Added package exports, skin tokens, unit coverage, and a dedicated Storybook docs page for Gauge.2026-03-25 18:51Verifiedpnpm --filter @ai-ui/ui typecheck,pnpm --filter @ai-ui/ui build,pnpm --filter @ai-ui/ui exec vitest run packages/ui/src/components/gauge.test.tsx --config ../../vitest.config.ts, targetedeslint, andpnpm harness:validate:docs.