Sha256: 3ddccca1902829ce268137206d6a3352a29fb6047fc6f2123bf0ffd6445137fa

Contents?: true

Size: 504 Bytes

Versions: 24

Compression:

Stored size: 504 Bytes

Contents

module Lookbook
  class Prose::Component < Lookbook::BaseComponent
    def initialize(size: :sm, markdown: true, **html_attrs)
      @size = size
      @markdown = markdown
      super(**html_attrs)
    end

    def rendered_content
      @markdown ? MarkdownRenderer.call(content.strip_heredoc) : helpers.raw(content)
    end

    def size_class
      case @size
      when :sm
        "prose-sm"
      when :lg
        "prose-lg"
      else
        "prose-sm lg:prose-base"
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
lookbook-2.0.0.beta.7 app/components/lookbook/prose/component.rb
lookbook-2.0.0.beta.6 app/components/lookbook/prose/component.rb
lookbook-2.0.0.beta.5 app/components/lookbook/prose/component.rb
lookbook-2.0.0.beta.4 app/components/lookbook/prose/component.rb