Sha256: 8c57a0b1b7f65b0d7d6cb29de677d844a4c38ae572d854bf6e7c39243b1e1956

Contents?: true

Size: 646 Bytes

Versions: 112

Compression:

Stored size: 646 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_class, rounded_class)
      end

    private

      def variant_class
        variant === "success" ? "success_sm" : variant
      end

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

Version data entries

112 entries across 112 versions & 1 rubygems

Version Path
playbook_ui-12.30.1.pre.alpha.play846responsivespacingglobalpropsneedsdefault924 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.30.1.pre.alpha.PLAY906multilevelselectedidsprop917 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.30.1.pre.alpha.PLAY906multilevelselectedidsprop916 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.30.1.pre.alpha.hovertesting914 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.30.1.pre.alpha.PLAY906multilevelselectedidsprop912 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.30.1.pre.alpha.PLAY802responsivetitlekit909 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.30.0.pre.alpha.PLAY906multilevelselectedidsprop902 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.30.1 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.30.0 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.29.0.pre.alpha.play716popoverkitcloseonclickissue893 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.29.0 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.28.0.pre.alpha.PLAY863multilevelv2877 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.28.0.pre.alpha.PLAY863multilevelv2876 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.28.0.pre.alpha.PLAY814removemomentjs871 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.28.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown869 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.28.0.pre.alpha.PLAY837MapCustomButton868 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.28.0.pre.alpha.20230613implementbakesupport865 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.28.0 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.27.0.pre.alpha.expandednotworking853 app/pb_kits/playbook/pb_badge/badge.rb
playbook_ui-12.27.0 app/pb_kits/playbook/pb_badge/badge.rb