Add StatusIndicator component (CUI-6)#4
Open
calebpanza wants to merge 2 commits into
Open
Conversation
Add the site-agnostic status-dot primitive in app/ui/status-indicator.tsx: a small round indicator in first-party semantic colors (default | success | warning | destructive | info), with size, ring, and position driven entirely by className so it adapts to avatars, filter chips, lists, etc. Add the supporting --success / --warning / --info theme tokens (light + dark) and their --color-* mappings to app.css so bg-success/bg-warning/bg-info resolve — previously only --destructive existed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assignee: @calebpanza (caleb)
Summary
Adds the StatusIndicator primitive — a small round status dot in first-party semantic colors — per CUI-6.
StatusIndicatoris a site-agnostic primitive (lives inapp/ui/alongsidebutton,tooltip,separator). Color comes from thestatusprop (default | success | warning | destructive | info); size, ring, and position are driven entirely byclassNameso the dot adapts to any context — avatars, filter chips, lists. Pass a one-offbg-*class for a custom hue.Animation (review feedback)
animationprop with two pre-configured motion states:"pulse"— the dot fades in and out in place."radar"— the dot emits an expanding ring (a CSS::beforethat inherits the dot's color and radius), like a sonar ping.transition-colorson the dot, so changingstatuscross-fades the hue instead of snapping.prefers-reduced-motion. The animations are pure CSS (keyframes inapp/app.css) — no JS/runtime cost, and the single-element API is preserved (radar uses a pseudo-element, soclassNamestill drives size/ring/position and one-offbg-*overrides).Changes
app/ui/status-indicator.tsx— the component; adds theanimationprop (StatusAnimation = "pulse" | "radar") andtransition-colors.app/app.css— added--success,--warning,--infotheme tokens (light + dark) and their--color-*mappings (only--destructiveexisted before, so three of five statuses would have rendered invisibly). Also added thestatus-indicator-pulse/status-indicator-radarkeyframes and reduced-motion guard.Usage
Testing
bun run lint— cleanbun run typecheck— cleanSite-agnostic primitive; no showcase/registry gallery entry (those are reserved for published registry components under
registry/bases/, matching how the otherapp/ui/primitives are handled).