Skip to content

Conversation

@djalmaaraujo
Copy link
Contributor

@djalmaaraujo djalmaaraujo commented Dec 10, 2025

Related issue

Related to #335

Description

Migrate documentation for the third batch of components from the web repository to the ruby_ui gem.

Components migrated in this batch:

  • DropdownMenu - Displays a menu triggered by a button for actions/functions
  • Form - Building forms with built-in client-side validations
  • HoverCard - Preview content available behind a link for sighted users
  • Input - Form input field component with various states (email, file, disabled)
  • Link - Styled links with button or underline appearance and variants
  • MaskedInput - Form input with applied mask (phone, hex color, CPF/CNPJ)
  • Pagination - Page navigation with next/previous links

These documentation files are copied from the web repository and will be installed to Rails apps via the ruby_ui:install:docs generator.

Testing instructions

  1. In a Rails app, configure Gemfile to use local ruby_ui source:
    gem "ruby_ui", path: "../ruby_ui"
  2. Remove any existing docs files for the web repository
  3. Run bin/rails g ruby_ui:install:docs
  4. Verify that 7 new files are created in app/views/docs/:
    • dropdown_menu.rb
    • form.rb
    • hover_card.rb
    • input.rb
    • link.rb
    • masked_input.rb
    • pagination.rb
  5. Run bundle exec rake in the ruby_ui repository to verify tests pass

Introduce a new generator (`ruby_ui:install:docs`) that copies component
documentation files from the gem to Rails applications. Documentation
files follow the naming convention `{component}_docs.rb` and are copied
to `app/views/docs/` with the `_docs` suffix removed.

Usage:
  bin/rails g ruby_ui:install:docs
  bin/rails g ruby_ui:install:docs --force

Include stub classes for docs dependencies (Views::Base, Docs::Header,
Docs::VisualCodeExample, etc.) so docs files can be loaded without errors.
Rails apps can override these with full implementations.

Includes button component documentation as the first example.
Add docs files for:
- accordion
- alert
- alert_dialog
- aspect_ratio
- avatar
- badge
- breadcrumb
- calendar
- card
Add documentation files for: carousel, chart, checkbox, clipboard,
codeblock, collapsible, combobox, command, context_menu, dialog
Migrate documentation files for dropdown_menu, form, hover_card,
input, link, masked_input, and pagination components.
@djalmaaraujo djalmaaraujo requested a review from cirdes as a code owner December 10, 2025 20:53
@djalmaaraujo djalmaaraujo changed the base branch from docs-generator to docs/batch-2 December 10, 2025 20:54
Base automatically changed from docs/batch-2 to main December 11, 2025 17:34
@cirdes cirdes merged commit 7bd455f into main Dec 11, 2025
2 checks passed
@cirdes cirdes deleted the docs/batch-3 branch December 11, 2025 17:35
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.

3 participants