Skip to content

Add corner indicator dot to ReqoreButton#580

Merged
Foxhoundn merged 3 commits into
developfrom
bugfix/remove-chromatic
Jul 1, 2026
Merged

Add corner indicator dot to ReqoreButton#580
Foxhoundn merged 3 commits into
developfrom
bugfix/remove-chromatic

Conversation

@Foxhoundn

Copy link
Copy Markdown
Member

Summary

Adds an indicator prop to ReqoreButton that renders a small dot in a corner of the button to signal importance or a pending event (unread items, a required action, a live status). It is distinct from the existing badge prop, which renders content tags inside the button.

API

// Shorthand: static, danger-tinted dot in the top-right corner
<ReqoreButton indicator>Messages</ReqoreButton>

// Full config
<ReqoreButton
  indicator={{
    intent: 'success',      // resolved from theme intents; defaults to 'danger'
    color: '#a24bff',       // optional explicit override, wins over intent
    pulse: true,            // animated expanding/fading ring; default false (static)
    position: 'top-right',  // 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
  }}
>
  Alerts
</ReqoreButton>

Details

  • Intent-aware & customizable — the dot resolves its color from the button's theme intents, with an explicit color override.
  • Static or animatedpulse adds a ::after ring that scales 1 → 2.6 while fading to 0 opacity on a 1.6s loop.
  • Size-scaled — diameter/offset derive from the new INDICATOR_SIZE_TO_PX map in constants/sizes.ts, so the dot scales with the button size.
  • Styled via transient ($-prefixed) props; aria-hidden since it's decorative.

Note on clipping

StyledButton has overflow: hidden (needed for the animated label + rounded corners), so the dot is inset slightly from the corner rather than overhanging. The pulse ring's outermost edge is clipped by ~1px at the corner, but that edge is already near-zero opacity so it isn't visible in practice.

Testing

  • New Indicator story: intents, custom color, pulse on/off, all four positions, all sizes.
  • Unit tests: renders when enabled, applies custom intent, absent by default.
  • yarn test (690), yarn test:stories Button (21), lint, and typecheck all pass.

🤖 Generated with Claude Code

Adds an `indicator` prop that renders a small dot in a corner of the
button to signal importance or a pending event. Accepts `true` for a
static danger-tinted dot, or an object to customize `intent`/`color`,
enable an expanding-fade `pulse` animation, and pick the `position`.

- New IReqoreButtonIndicatorProps + StyledButtonIndicator (transient props)
- INDICATOR_SIZE_TO_PX added to constants/sizes.ts (scales with button size)
- Indicator story (intents, pulse, positions, sizes) + unit tests

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@qlip-qore-technologies

qlip-qore-technologies Bot commented Jul 1, 2026

Copy link
Copy Markdown

qlip visual regression

🔍 7 changed, 1 new of 14 snapshots.
⏳ Awaiting review.

Review build 20260701-133523 in the dashboard →

Foxhoundn and others added 2 commits July 1, 2026 13:36
ReqorePopover extended the customTheme contract (via IReqoreComponent)
but never destructured the prop, so it was swallowed and the trigger
component missed the surrounding theme cascade — unlike every other
panel/action item that inherits it. Destructure `customTheme` and
forward it to the trigger `Component` on both render paths, letting a
caller-supplied `componentProps.customTheme` win.

Adds a regression story asserting the themed trigger's resolved surface
differs from an unthemed control (proving the theme reached the trigger)
and that a per-trigger override stays distinct.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Foxhoundn Foxhoundn merged commit 709c9ff into develop Jul 1, 2026
5 checks passed
@Foxhoundn Foxhoundn deleted the bugfix/remove-chromatic branch July 1, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant