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.24.0.pre.alpha.railsmultilevelimprovements742 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.24.0.pre.alpha.railsmultilevelimprovements741 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.24.0.pre.alpha.railsmultilevelimprovements739 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.24.0.pre.alpha.play824733 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.24.0.pre.alpha.play833boldoptionfortitle2and3721 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.24.0.pre.alpha.alphatestforselfhostfak720 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.24.0.pre.alpha.play833boldoptionfortitle2and3719 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.24.0.pre.alpha.play833boldoptionfortitle2and3717 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.24.0 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.23.0.pre.alpha.movemarkdown712 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.23.0.pre.alpha.movemarkdown708 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.23.0.pre.alpha.play698responsivespacingglobalprop703 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.23.0.pre.alpha.play698responsivespacingglobalprop701 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.23.0 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.22.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown696 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.22.0.pre.alpha.play698responsivespacingglobalprop690 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.22.0.pre.alpha.PBNTR12checkingemptyfilters686 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.22.0 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.21.0.pre.alpha.PLAY807RTEcustomtoolbar680 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
playbook_ui-12.21.0 app/pb_kits/playbook/pb_collapsible/collapsible_main.rb