Sha256: b5600b3e058f8a967630a3c5c60fa1a367989b8ec45bd3f28bdd313db9914f45

Contents?: true

Size: 1.04 KB

Versions: 337

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbFormPill
    class FormPill < Playbook::KitBase
      prop :avatar_url
      prop :name
      prop :text
      prop :size

      prop :text_transform, type: Playbook::Props::Enum,
                            values: %w[none lowercase],
                            default: "none"
      prop :color, type: Playbook::Props::Enum,
                   values: %w[primary neutral success warning error info data_1 data_2 data_3 data_4 data_5 data_6 data_7 data_8 windows siding roofing doors gutters solar insulation accessories],
                   default: "primary"
      prop :tabindex
      prop :icon

      def classname
        generate_classname("pb_form_pill_kit", color, icon_class, name, text, text_transform)
      end

      def display_text
        object.text
      end

      def size_class
        size == "small" ? " small" : ""
      end

      def icon_class
        icon ? "icon" : nil
      end

      def close_icon_size
        size == "small" ? "xs" : "sm"
      end
    end
  end
end

Version data entries

337 entries across 337 versions & 1 rubygems

Version Path
playbook_ui-14.10.0.pre.rc.23 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.10.0.pre.rc.22 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.10.0.pre.rc.21 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.9.0.pre.alpha.play1703errorstatealignment5060 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.10.0.pre.rc.20 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.10.0.pre.rc.19 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.10.0.pre.rc.18 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.9.0.pre.alpha.PLAY1660reactdropzone5020 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.10.0.pre.rc.17 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.10.0.pre.rc.16 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.9.0.pre.alpha.play17004992 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.9.0.pre.alpha.play1703errorstatealignment4991 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.10.0.pre.rc.15 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.9.0.pre.alpha.PLAY16264952 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.9.0.pre.alpha.PLAY1731inputmasking4927 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.9.0.pre.alpha.play1742globalheightfixes4926 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.9.0.pre.alpha.play1742globalheightfixes4925 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.10.0.pre.rc.14 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.10.0.pre.rc.13 app/pb_kits/playbook/pb_form_pill/form_pill.rb
playbook_ui-14.9.0.pre.alpha.PBNTR746datepickerdefaultbug4903 app/pb_kits/playbook/pb_form_pill/form_pill.rb