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.3.4 app/components/lookbook/prose/component.rb
lookbook-2.3.3 app/components/lookbook/prose/component.rb
lookbook-2.3.2 app/components/lookbook/prose/component.rb
lookbook-2.3.0 app/components/lookbook/prose/component.rb
lookbook-2.2.2 app/components/lookbook/prose/component.rb
lookbook-2.2.1 app/components/lookbook/prose/component.rb
lookbook-2.2.0 app/components/lookbook/prose/component.rb
lookbook-2.1.1 app/components/lookbook/prose/component.rb
lookbook-2.1.0 app/components/lookbook/prose/component.rb
lookbook-2.0.5 app/components/lookbook/prose/component.rb
lookbook-2.0.4 app/components/lookbook/prose/component.rb
lookbook-2.0.3 app/components/lookbook/prose/component.rb
lookbook-2.0.2 app/components/lookbook/prose/component.rb
lookbook-2.0.1 app/components/lookbook/prose/component.rb
lookbook-2.0.0 app/components/lookbook/prose/component.rb
lookbook-2.0.0.rc.3 app/components/lookbook/prose/component.rb
lookbook-2.0.0.rc.2 app/components/lookbook/prose/component.rb
lookbook-2.0.0.rc.1 app/components/lookbook/prose/component.rb
lookbook-2.0.0.beta.9 app/components/lookbook/prose/component.rb
lookbook-2.0.0.beta.8 app/components/lookbook/prose/component.rb