Sha256: 47e74df64bb548ebed0f5b7c38abba60666b2f4c6d5285a6cb30d2286e84a08f

Contents?: true

Size: 735 Bytes

Versions: 124

Compression:

Stored size: 735 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbImage
    class Image < Playbook::KitBase
      prop :alt
      prop :on_error, type: Playbook::Props::String,
                      default: nil
      prop :rounded, type: Playbook::Props::Boolean,
                     default: false
      prop :size, type: Playbook::Props::Enum,
                  values: %w[xs sm md lg xl none],
                  default: "none"
      prop :url

      def classname
        generate_classname("pb_image_kit#{size_class} lazyload blur_up") + rounded_class
      end

    private

      def rounded_class
        rounded ? " rounded" : ""
      end

      def size_class
        size == "none" ? nil : "_#{size}"
      end
    end
  end
end

Version data entries

124 entries across 124 versions & 1 rubygems

Version Path
playbook_ui-8.1.3 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.4.0.alpha.dependencies.2 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.4.0.alpha.dependencies.1 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.2.0.pre.alpha4 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.2.0.pre.alpha3 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.2.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.1.2 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.1.0.pre.alpha1 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.0.3 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.2.0.pre.alpha2 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.1.1 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.0.2 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.2.0.pre.alpha1 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.1.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.0.1 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.0.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.0.0.pre.alpha5 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.0.0.pre.alpha4 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-8.0.0.pre.alpha1 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-7.16.0.pre.alpha5 app/pb_kits/playbook/pb_image/image.rb