Sha256: 9efacb9564d34a8620087efba9f91da39e3770cba7064e54c200a49586ed7505

Contents?: true

Size: 1.09 KB

Versions: 18

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbBackground
    class Background < Playbook::KitBase
      prop :background_color, type: Playbook::Props::Enum,
                              values: %w[gradient dark light white success warning error info neutral primary category_1 category_2 category_3 category_4 category_5 category_6 category_7 category_8 category_9 category_10 category_11 category_12 category_13 category_14 category_15 category_16 category_17 category_18 category_19 category_20 category_21],
                              default: "light"
      prop :image_url

      prop :tag, type: Playbook::Props::Enum,
                 values: %w[h1 h2 h3 h4 h5 h6 p div span],
                 default: "div"

      def classname
        generate_classname("pb_background_kit", image_classname, background_color_classname, separator: " ")
      end

    private

      def image_classname
        image_url.present? ? "lazyload blur_up" : ""
      end

      def background_color_classname
        !image_url.present? ? "pb_background_color_#{background_color}" : ""
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
playbook_ui-10.23.0.pre.cachetest app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.21.0.pre.alpha.lightbox.2 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.21.0.pre.alpha.lightbox app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.21.0.pre.alpha.rg1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.21.0.pre.alpha.na1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.21.0.pre.alpha.jd1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.20.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.19.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.19.0.pre.lightbox app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.18.2 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.19.0.pre.popover.alpha1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.18.1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.18.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.17.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.16.0 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.15.1 app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.15.1.pre.alpha.rubocop.deps app/pb_kits/playbook/pb_background/background.rb
playbook_ui-10.15.0 app/pb_kits/playbook/pb_background/background.rb