[Feature] Add Empty component

Merged
DJ
5mo ago
+370-0

Description

Ports the shadcn Empty component to RubyUI — a centered empty-state surface for when there is no data or content (no results, no messages, first-run states).

Reference:

Parts

  • Empty — dashed-border centered container
  • EmptyHeader — stacks media + title + description
  • EmptyMedia — variant: default (bare) or icon (muted rounded media box)
  • EmptyTitle / EmptyDescription — heading + muted supporting copy
  • EmptyContent — slot for actions (buttons, inputs)

Notes

  • shadcn ships these styles as a cn-empty-* CSS layer; this port translates every rule to Tailwind v4 utilities. No custom CSS, no JS.
  • No dependencies.yml entry (Empty has no required component/gem/JS deps).
  • Motivation: the Message Scroller chat-window demo (stacked PR) uses Empty for its no-messages state — this lands it as a first-class component.

Testing

  • cd gem && bundle exec rake → tests + StandardRB green.
  • Rendered at /docs/empty: default icon state, with-action state, and default (avatar) media verified.

Screenshots

Add /docs/empty screenshot.


Summary by cubic

Adds the Empty component suite for empty states in RubyUI. Ported from shadcn and built with Tailwind v4 utilities—no JS and no new dependencies.

  • New Features
    • Components: Empty, EmptyHeader, EmptyMedia (variants: default, icon), EmptyTitle, EmptyDescription, EmptyContent with data-slot attributes.
    • Docs: new /docs/empty page, route/controller, and menu entry with examples (default, with action, default media).
    • Registry/SEO: updated MCP registry, sitemap, and LLM docs.
    • Tests: verify structure and EmptyMedia variants.