Sha256: 05e7913aa33b11a278e5b3b5830cc47fd1c35ec041fc1aa4b351d386f40afd0b

Contents?: true

Size: 550 Bytes

Versions: 294

Compression:

Stored size: 550 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbBadge
    class Badge < Playbook::KitBase
      prop :rounded, type: Playbook::Props::Boolean, default: false
      prop :text
      prop :variant, type: Playbook::Props::Enum,
                     values: %w[success warning error info neutral primary],
                     default: "neutral"

      def classname
        generate_classname("pb_badge_kit", variant, rounded_class)
      end

    private

      def rounded_class
        rounded ? "rounded" : nil
      end
    end
  end
end

Version data entries

294 entries across 294 versions & 1 rubygems

Version Path
playbook_ui-12.9.0 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.8.0.pre.alpha.PLAY625phonenumberdark301 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.8.0.pre.alpha.PLAY625phonenumberdark300 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.8.0.pre.alpha.PLAY649mapkitstyles299 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.8.0.pre.alpha.PLAY645typescriptprogresstep298 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.8.0.pre.alpha.PLAY645typescriptprogresstep297 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.8.0.pre.alpha.rubyandnpmalpharelease296 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.8.0.pre.alpha.rubyandnpmalpharelease295 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.8.0.pre.alpha.rubyandnpmalpharelease294 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.8.0 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.7.1.pre.alpha.rubyandnpmalpharelease293 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.7.1.pre.alpha.rubyandnpmalpharelease292 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.7.1.pre.alpha.rubyandnpmalpharelease291 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.7.1.pre.alpha.alpharubyrelease281 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.7.1.pre.alpha.menu2 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.7.1.pre.alpha.menu1 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.7.1 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.7.0 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.6.0.pre.alpha.sectionseparator1 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.6.0.pre.alpha.menuyml1 app/pb_kits/playbook/pb_badge/badge.rb