Sha256: cc18b847d4049ea7dc3c893f3b8d61d8e1242067699ffde24b8d65f2321f2ca6

Contents?: true

Size: 635 Bytes

Versions: 66

Compression:

Stored size: 635 Bytes

Contents

module Lookbook
  class Toolbar::Component < Lookbook::BaseComponent
    DIVIDE_CLASSES = {
      left: "border-l",
      right: "border-r"
    }

    ALIGN_CLASSES = {
      right: "ml-auto",
      left: "mr-auto",
      middle: "mx-auto"
    }

    renders_many :sections, ->(align: :nil, divide: nil, padded: false, **attrs, &block) do
      Lookbook::TagComponent.new class: [
        "min-w-0",
        {
          "px-4": padded,
          "#{DIVIDE_CLASSES[divide]}": divide.present?,
          "#{ALIGN_CLASSES[align]}": align.present?
        },
        attrs[:class]
      ], **attrs.except(:class), &block
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
lookbook-2.3.4 app/components/lookbook/toolbar/component.rb
lookbook-2.3.3 app/components/lookbook/toolbar/component.rb
lookbook-2.3.2 app/components/lookbook/toolbar/component.rb
lookbook-2.3.0 app/components/lookbook/toolbar/component.rb
lookbook-2.2.2 app/components/lookbook/toolbar/component.rb
lookbook-2.2.1 app/components/lookbook/toolbar/component.rb
lookbook-2.2.0 app/components/lookbook/toolbar/component.rb
lookbook-2.1.1 app/components/lookbook/toolbar/component.rb
lookbook-2.1.0 app/components/lookbook/toolbar/component.rb
lookbook-2.0.5 app/components/lookbook/toolbar/component.rb
lookbook-2.0.4 app/components/lookbook/toolbar/component.rb
lookbook-2.0.3 app/components/lookbook/toolbar/component.rb
lookbook-2.0.2 app/components/lookbook/toolbar/component.rb
lookbook-2.0.1 app/components/lookbook/toolbar/component.rb
lookbook-2.0.0 app/components/lookbook/toolbar/component.rb
lookbook-2.0.0.rc.3 app/components/lookbook/toolbar/component.rb
lookbook-1.5.5 app/components/lookbook/toolbar/component.rb
lookbook-1.5.4 app/components/lookbook/toolbar/component.rb
lookbook-2.0.0.rc.2 app/components/lookbook/toolbar/component.rb
lookbook-2.0.0.rc.1 app/components/lookbook/toolbar/component.rb