Sha256: 849ab3e89bef2e54ade5f88680ab986d649c9f91e7ad713c81084ea7b6b0b9fa

Contents?: true

Size: 492 Bytes

Versions: 61

Compression:

Stored size: 492 Bytes

Contents

# frozen_string_literal: true

class Avo::ModalComponent < ViewComponent::Base
  renders_one :heading
  renders_one :controls

  attr_reader :width
  attr_reader :body_class

  def initialize(width: :md, body_class: nil)
    @width = width
    @body_class = body_class
  end

  def width_classes
    case width.to_sym
    when :md
      "w-11/12 lg:w-1/2 sm:max-w-168"
    when :xl
      "w-11/12 lg:w-3/4"
    end
  end

  def height_classes
    "max-h-full min-h-1/4 max-h-11/12"
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
avo-2.43.0 app/components/avo/modal_component.rb