Sha256: 9043a0fd800dc50998ab94cbb4d9fdbb131394cd00583410f1c2e6e4d858a3c8

Contents?: true

Size: 1.05 KB

Versions: 529

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbCollapsible
    class CollapsibleIcon < Playbook::KitBase
      prop :collapsed, type: Playbook::Props::Boolean,
                       default: true
      prop :color, type: Playbook::Props::Enum,
                   values: %w[default light lighter link success error],
                   default: "default"
      prop :icon
      prop :size, type: Playbook::Props::Enum,
                  values: ["lg", "xs", "sm", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x", nil],
                  default: nil

      def classname
        generate_classname("pb_collapsible_icon_kit", separator: " ")
      end

      def show_icon(icon)
        case icon
        when ::String
          [icon, icon]
        when ::Array
          icon
        end
      end

      def icon_color
        return "" if color.nil?

        color_object = { light: "#687887", lighter: "#C1CDD6", link: "#0056CF", success: "#00CA74", error: "#FF2229", default: "#242B42" }
        color_object[color.to_sym]
      end
    end
  end
end

Version data entries

529 entries across 529 versions & 1 rubygems

Version Path
playbook_ui-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5437 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.PBNTR719listdraggablesimple5432 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.PBNTR768stickyrightcolumn5431 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.12.0.pre.rc.6 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5415 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5413 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.12.0.pre.rc.5 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.play1724darkmodeauditmap5409 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5400 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb
playbook_ui-14.11.1.pre.alpha.PBNTR718simiplifieddraggablereact5392 app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb