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-10.17.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.16.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.15.1 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.15.1.pre.alpha.rubocop.deps app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.15.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.14.1.pre.alpha2 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.14.1.pre.alpha1 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.14.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.13.1 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.13.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.13.0.pre.node.update app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.12.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.11.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.10.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.9.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.8.1.pre.alpha.flexdeps app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.9.0.pre.alpha1 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.8.0 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.7.1 app/pb_kits/playbook/pb_image/image.rb
playbook_ui-10.7.0 app/pb_kits/playbook/pb_image/image.rb