Sha256: 31fa2612e1d4ebdd46db799ffdd959cad2a564d62a685cfb1ce20261b688ccfd

Contents?: true

Size: 1.2 KB

Versions: 223

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbCollapsible
    class CollapsibleMain < Playbook::KitBase
      prop :color, type: Playbook::Props::Enum,
                   values: %w[default light lighter link success error],
                   default: "default"
      prop :size, type: Playbook::Props::Enum,
                  values: ["lg", "xs", "sm", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x", nil],
                  default: nil
      def data
        Hash(prop(:data)).merge(collapsible_main: true)
      end

      def classname
        generate_classname("pb_collapsible_main_kit", padding, separator: " ")
      end

      def icon_size
        return "" if size.nil?

        size_object = { lg: "fa-lg", xs: "fa-xs", sm: "fa-sm", "1x": "fa-1x", "2x": "fa-2x", "3x": "fa-3x", "4x": "fa-4x", "5x": "fa-5x", "6x": "fa-6x", "7x": "fa-7x", "8x": "fa-8x", "9x": "fa-9x", "10x": "fa-10x" }
        size_object[size.to_sym]
      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

223 entries across 223 versions & 1 rubygems

Version Path
playbook_ui-12.34.0.pre.alpha.fixdialogcloseevents1004 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.34.0.pre.alpha.fixdialogcloseevents1003 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.34.0.pre.alpha.play716popoverkitcloseonclickissue998 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.34.0 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.33.1 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.33.0.pre.alpha.PLAY905reactionbuttons982 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.33.0.pre.alpha.PLAY905reactionbuttons979 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.33.0.pre.alpha.revert2650closedialogonoutsideclick977 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.33.0 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.32.0 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.31.0.pre.alpha.hoverrails951 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.31.0.pre.alpha.hoverrails948 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.31.0.pre.alpha.multilevelnopillsdesigns944 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.31.0.pre.alpha.multilevelnopillsdesigns941 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.31.0.pre.alpha.PLAY814removemomentjs935 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.31.0.pre.alpha.PLAY814removemomentjs933 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.31.0.pre.alpha.datepickerdisableddatefix931 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.31.0.pre.alpha.customiconsfa928 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.31.0 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.30.1.pre.alpha.play846responsivespacingglobalpropsneedsdefault924 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb