Sha256: e6149b9a9fb926a74b5f52f6e6a9022ad957b77af45fbcdf3f33d24c1ec9ead9

Contents?: true

Size: 730 Bytes

Versions: 87

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbBadge
    class Badge
      include Playbook::Props

      partial "pb_badge/badge"

      prop :dark, type: Playbook::Props::Boolean, default: false
      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, dark_class)
      end

    private

      def dark_class
        dark ? "dark" : nil
      end

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

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
playbook_ui-6.0.1.pre.alpha5 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-6.0.1.pre.alpha4 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-6.0.1.pre.alpha3 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-6.0.1.pre.alpha2 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-6.0.1 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.2.0.pre.alpha12 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-6.0.0 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.2.0.pre.alpha11 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.5.1.pre.alpha4 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.5.1.pre.alpha3 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.5.1.pre.alpha2 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.5.1.pre.alpha1 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.2.0.pre.alpha10 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.5.1 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.5.0 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.5.0.pre.alpha1 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-5.2.0.pre.alpha9 app/pb_kits/playbook/pb_badge/badge.rb