Sha256: a105f3386fc3abc3afc5106d2c044b5e285f2abacbdcf650b4266733a474f8c4

Contents?: true

Size: 1.02 KB

Versions: 18

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbBody
    class Body
      include Playbook::Props

      partial "pb_body/body"

      prop :color, type: Playbook::Props::Enum,
                   values: %w[default light lighter dark light_dark lighter_dark],
                   default: "default"
      prop :dark, type: Playbook::Props::Boolean,
                  default: false
      prop :status, type: Playbook::Props::Enum,
                    values: %w[neutral negative positive],
                    default: "neutral"
      prop :tag, type: Playbook::Props::Enum,
                 values: %w[h1 h2 h3 h4 h5 h6 p span div],
                 default: "div"
      prop :text

      def classname
        generate_classname("pb_body_kit", color_class, dark_class, status_class)
      end

    private

      def color_class
        color != "default" ? color : nil
      end

      def dark_class
        dark ? "dark" : nil
      end

      def status_class
        status != "neutral" ? status : nil
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
playbook_ui-4.2.0 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-4.1.2 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-4.1.1 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-4.1.0 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-4.0.1 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-4.0.0 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-3.5.0 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-3.4.0 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-3.3.0 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-3.2.0 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-3.1.0 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-3.0.1 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-3.0.0 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-2.9.9 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-2.9.8 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-2.9.7 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-2.9.6 app/pb_kits/playbook/pb_body/body.rb
playbook_ui-2.9.5 app/pb_kits/playbook/pb_body/body.rb