Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions lib/ruby_ui/docs/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,81 @@ def Heading(level:, &)
def component_files(component_name)
[]
end

# Text helper for wrapping paragraphs
def Text(&)
p(&)
end

# InlineLink helper for documentation links
def InlineLink(href:, target: nil, class: nil, &)
a(href: href, target: target, class: binding.local_variable_get(:class), &)
end

# Alert component helpers
def Alert(&)
div(&)
end

def AlertTitle(&)
h4(&)
end

def AlertDescription(&)
p(&)
end

# Route helper stubs - return "#" as placeholder
def docs_sheet_path
"#"
end

def docs_separator_path
"#"
end

def docs_accordion_path
"#"
end

def docs_alert_path
"#"
end

def docs_alert_dialog_path
"#"
end

def docs_aspect_ratio_path
"#"
end

def docs_avatar_path
"#"
end

def docs_badge_path
"#"
end

def docs_installation_path
"#"
end

# InlineCode helper for typography examples
def InlineCode(&)
code(&)
end
end
end

# Module-level components stub
module Components
def self.Heading(level:, &block)
# Stub for module-level Heading calls
end

def self.TypographyList(items:, numbered: false)
# Stub for TypographyList component
end
end
22 changes: 22 additions & 0 deletions lib/ruby_ui/docs/sidebar_examples.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

# Stub constants for sidebar documentation examples
# These are replaced with actual implementations in the web app

module Views
module Docs
class Sidebar < Views::Base
class Example
CODE = <<~RUBY
# Sidebar example code placeholder
RUBY
end

class InsetExample
CODE = <<~RUBY
# Sidebar inset example code placeholder
RUBY
end
end
end
end
5 changes: 4 additions & 1 deletion lib/ruby_ui/docs/visual_code_example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

module Docs
class VisualCodeExample < Phlex::HTML
def initialize(title:, context:)
def initialize(title:, context:, description: nil, src: nil)
@title = title
@context = context
@description = description
@src = src
end

def view_template(&block)
code = block.call
div do
h3 { @title }
p { @description } if @description
pre { code }
@context.instance_eval(code)
end
Expand Down
Loading