Sha256: 2143a51622344eeb68bfe24b9f25d53fb05b175450325134dcda2446696e8724

Contents?: true

Size: 807 Bytes

Versions: 7

Compression:

Stored size: 807 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbCard
    class Card
      include Playbook::Props

      partial "pb_card/card"

      prop :selected, type: Playbook::Props::Boolean, default: false
      prop :padding, type: Playbook::Props::Enum,
                     values: %w[none xs sm md lg xl],
                     default: "md"
      prop :shadow, type: Playbook::Props::Enum,
                    values: %w[none shallow default deep deeper deepest],
                    default: "none"

      def classname
        generate_classname("pb_card_kit", selected_class, shadow_class)
      end

    private

      def selected_class
        selected ? "selected" : "deselected"
      end

      def shadow_class
        shadow != "none" ? "shadow_#{shadow}" : nil
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
playbook_ui-2.9.8 app/pb_kits/playbook/pb_card/card.rb
playbook_ui-2.9.7 app/pb_kits/playbook/pb_card/card.rb
playbook_ui-2.9.6 app/pb_kits/playbook/pb_card/card.rb
playbook_ui-2.9.5 app/pb_kits/playbook/pb_card/card.rb
playbook_ui-2.9.4 app/pb_kits/playbook/pb_card/card.rb
playbook_ui-2.9.3 app/pb_kits/playbook/pb_card/card.rb
playbook_ui-2.9.2 app/pb_kits/playbook/pb_card/card.rb