Skip to content

feat(tooltip): Tooltip component with CSS Anchor Positioning (#13) - #118

Merged
auldrant-merge-bot[bot] merged 9 commits into
mainfrom
feature/tooltip
Mar 16, 2026
Merged

auldrant-merge-bot[bot] merged 9 commits into
mainfrom
feature/tooltip

Conversation

@coloneljade

@coloneljade coloneljade commented Mar 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add Tooltip component with CSS Anchor Positioning and JS fallback (Firefox/older browsers use JS fallback via useTooltipPosition)
  • Dogfood Tooltip on all icon-only buttons across the library (close, dismiss, remove, toggle, clear)
  • Fix dialog drag transform to unblock position:fixed descendants from escaping dialog bounds
  • Fix tooltip clipping — use position:fixed in CSS Anchor path so tooltips paint above dialog edges
  • Widen dialog max-width from 32em to 40em for more comfortable content
  • Add WCAG 2.5.8 touch target minimums to PasswordInput toggle and Toast dismiss buttons
  • Extract shared CSS patterns to composable classes in shared.css

Fixes

Fixes #13

Test Plan

  • Hover a trigger → tooltip appears after ~200ms delay
  • Move mouse from trigger onto tooltip → stays open (hover coordination)
  • Tab to trigger → tooltip appears immediately; Tab away → dismisses
  • Escape key dismisses tooltip
  • Tooltip near bottom of viewport flips above (CSS path: position-try-fallbacks; JS path: viewport collision detection)
  • Tooltip paints above dialog bounds — not clipped by dialog edge
  • Dialog/Modal close × button: tooltip shows "Close (Esc)"
  • Chip remove ×: tooltip shows remove label
  • Toast dismiss: tooltip shows dismiss label
  • SearchInput clear ×: tooltip shows "Clear search"
  • PasswordInput eye icon: tooltip toggles "Show password" / "Hide password"
  • FileInput remove/clear buttons: tooltip shows correct label
  • 821 tests pass: bun test

…JS fallback

Hover/focus tooltip with automatic above/below placement. CSS Anchor
Positioning handles layout natively on Chrome 131+ and Safari 26+; a JS
fallback (useTooltipPosition) covers Firefox and older browsers by setting
CSS custom properties that the @supports not block consumes.

Signed-off-by: Colonel Jade <colonel.jade@proton.me>
…om properties

Removes the always-present CSS transform from .dialog (previously
translate(var(--drag-x), var(--drag-y)) with 0 defaults). Any CSS
transform — even translate(0, 0) — creates a containing block that traps
position:fixed descendants, preventing tooltips and dropdowns from
escaping the dialog bounds. useDraggable now sets transform directly as
an inline style only while dragging, and removes it on reset.

Signed-off-by: Colonel Jade <colonel.jade@proton.me>
Wraps close, dismiss, remove, toggle, and clear buttons in Tooltip to
provide visual hints for sighted users. aria-label remains on each button
for screen reader users; Tooltip adds the complementary hover/focus text.

Signed-off-by: Colonel Jade <colonel.jade@proton.me>
Signed-off-by: Colonel Jade <colonel.jade@proton.me>
…tip migration

Replace getByTitle queries with getByRole after title attributes were
replaced by Tooltip wrappers. Narrow file-input text matchers to avoid
matching tooltip content. Replace non-null assertions with getByRole in
form-field tests.

Signed-off-by: Colonel Jade <colonel.jade@proton.me>
Signed-off-by: Colonel Jade <colonel.jade@proton.me>
Add pill radius token, status/solid variant classes, notification body,
overlay input, ghost button, and fieldset reset to shared.css. Update 13
consumer modules to compose from shared classes. Fixes Badge .warning
bypassing the token system. Adds reduced-motion comments documenting
0.001ms vs none rationale.

Signed-off-by: Colonel Jade <colonel.jade@proton.me>
@auldrant-merge-bot

auldrant-merge-bot Bot commented Mar 16, 2026 •

Copy link
Copy Markdown
Contributor

Merge Readiness

  • ✅ PR is ready for review
  • ✅ No merge conflicts
  • 🔍 Version: 0.26.1 → 0.27.0 (minor)

Status: 🚀 Ready to merge — comment /merge to proceed

Updated 2026-03-16 06:20:05 UTC

position:absolute in the @supports anchor block used the <dialog>
(position:fixed) as its containing block, trapping the tooltip inside
the dialog's coordinate space and causing visual clipping. Switching to
position:fixed escapes that containing block entirely — anchor()
coordinates are viewport-relative, which is correct since the dialog
has no CSS transform at rest.

Also widens dialog max-width from 32em to 40em for more comfortable
reading of longer content.

Signed-off-by: Colonel Jade <colonel.jade@proton.me>
@coloneljade

Copy link
Copy Markdown
Owner Author

/merge --major

@auldrant-merge-bot
auldrant-merge-bot Bot merged commit 6430885 into main Mar 16, 2026
5 checks passed
@auldrant-merge-bot

Copy link
Copy Markdown
Contributor

Merge bot: Merged via squash.

Version: 0.26.1 → 1.0.0 (major bump)

@auldrant-merge-bot
auldrant-merge-bot Bot deleted the feature/tooltip branch March 16, 2026 06:21
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.

Component: Tooltip

1 participant