[render preview] [Feature] Add Bubble component

Merged
DJ
5mo ago
+627-0

Description

Ports the shadcn Bubble component to RubyUI — a chat bubble surface for conversational content.

Reference:

What's included

  • Bubble — root, variant: (default, secondary, muted, tinted, outline, ghost, destructive) and align: (start/end)
  • BubbleContent — content wrapper; polymorphic via as: (:div default, :a, :button) for link/button bubbles — the idiomatic Phlex equivalent of shadcn's asChild
  • BubbleReactions — edge-anchored reactions pill, side: (top/bottom) + align: (start/end)
  • BubbleGroup — stacks bubbles with tight spacing

Notes

  • shadcn ships these styles as a custom cn-bubble-* CSS layer. This port translates every rule to real Tailwind v4 utilities + RubyUI theme tokens, so no custom CSS is shipped.
  • No JS (no Stimulus controller).
  • Composes with the existing Tooltip and Popover components — examples included in the docs page.
  • No dependencies.yml entry (Bubble has no gem/JS/component deps, like Avatar/Card).

Testing

  • cd gem && bundle exec rake → tests + StandardRB green.
  • Docs page rendered locally at /docs/bubble: all 7 variants, alignment, reactions (top/bottom × start/end), group, link/button hover states, and Tooltip/Popover integration verified visually.

Screenshots

Add before/after screenshots of /docs/bubble.


Summary by cubic

Add a chat Bubble component to RubyUI for conversational UIs with 7 variants, alignment, grouping, reactions, docs, tests, and mcp registry entries. Built with Tailwind v4 utilities and RubyUI tokens—no custom CSS or JS.

  • New Features

    • RubyUI::Bubble with variants: default, secondary, muted, tinted, outline, ghost, destructive; align: :start|:end.
    • RubyUI::BubbleContent polymorphic via as: :div|:a|:button for link/button bubbles.
    • RubyUI::BubbleReactions pill anchored to the bubble edge; side: :top|:bottom, align: :start|:end.
    • RubyUI::BubbleGroup to stack bubbles with tight spacing.
    • Docs at /docs/bubble with examples and Tooltip/Popover integration; routes, menu, sitemap, and LLMs maps updated.
    • Rebuilt mcp registry to include Bubble metadata and examples.
  • Bug Fixes

    • Simplified BubbleContent interactive selectors to &:is(button,a) to match variant hover rules and reduce class noise without changing behavior.