Sha256: f9c52d2700f4cdc0aa799d4fe3b1445d04138f0656dfdabbfbc9bfd616be4199

Contents?: true

Size: 816 Bytes

Versions: 7

Compression:

Stored size: 816 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbTitle
    class Title
      include Playbook::Props

      partial "pb_title/title"

      prop :dark, type: Playbook::Props::Boolean,
                  default: false
      prop :size, type: Playbook::Props::Enum,
                  values: [1, 2, 3, 4],
                  default: 3
      prop :tag, type: Playbook::Props::Enum,
                 values: %w[h1 h2 h3 h4 h5 h6 p div span],
                 default: "h3"
      prop :text
      prop :variant, type: Playbook::Props::Enum,
                    values: [nil, "primary"],
                    default: nil

      def classname
        generate_classname("pb_title_kit", size, dark_class, variant)
      end

    private

      def dark_class
        dark ? "dark" : nil
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
playbook_ui-5.5.1.pre.alpha4 app/pb_kits/playbook/pb_title/title.rb
playbook_ui-5.5.1.pre.alpha3 app/pb_kits/playbook/pb_title/title.rb
playbook_ui-5.5.1.pre.alpha2 app/pb_kits/playbook/pb_title/title.rb
playbook_ui-5.5.1.pre.alpha1 app/pb_kits/playbook/pb_title/title.rb
playbook_ui-5.5.1 app/pb_kits/playbook/pb_title/title.rb
playbook_ui-5.5.0 app/pb_kits/playbook/pb_title/title.rb
playbook_ui-5.5.0.pre.alpha1 app/pb_kits/playbook/pb_title/title.rb