Sha256: 75198a9c4cfca3396da398ada8de6fb205e031b7129cf913271e224f2f7b52ee

Contents?: true

Size: 1.78 KB

Versions: 398

Compression:

Stored size: 1.78 KB

Contents

# frozen_string_literal: true

# rubocop:disable Style/HashLikeCase

module Playbook
  module PbFixedConfirmationToast
    class FixedConfirmationToast < Playbook::KitBase
      prop :status, type: Playbook::Props::Enum,
                    values: %w[success error neutral tip],
                    default: "neutral"
      prop :text, type: Playbook::Props::String
      prop :multi_line, type: Playbook::Props::Boolean,
                        default: false
      prop :closeable, type: Playbook::Props::Boolean,
                       default: false
      prop :horizontal, type: Playbook::Props::Enum,
                        values: [nil, "right", "left", "center"],
                        default: nil
      prop :vertical, type: Playbook::Props::Enum,
                      values: [nil, "top", "bottom"],
                      default: nil
      prop :auto_close, type: Playbook::Props::Number

      def show_text?
        text.present?
      end

      def close_class
        closeable.present? ? " remove_toast" : ""
      end

      def auto_close_class
        auto_close.present? ? " auto_close_#{auto_close}" : ""
      end

      def position_class
        horizontal && vertical ? " positioned_toast #{vertical} #{horizontal}" : ""
      end

      def multi_line_class
        multi_line.present? ? "multi_line" : nil
      end

      def icon_value
        case status
        when "success"
          "check"
        when "error"
          "exclamation-triangle"
        when "neutral"
          "info-circle"
        when "tip"
          "info-circle"
        end
      end

      def classname
        generate_classname("pb_fixed_confirmation_toast_kit", status, multi_line_class) + close_class + position_class + auto_close_class
      end
    end
  end
end

# rubocop:enable Style/HashLikeCase

Version data entries

398 entries across 398 versions & 1 rubygems

Version Path
playbook_ui-13.18.0.pre.alpha.useexactnodejsversionghactions2183 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.18.0.pre.alpha.useexactnodejsversionghactions2181 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.18.0.pre.alpha.useexactnodejsversionghactions2180 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.18.0.pre.alpha.useexactnodejsversionghactions2179 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.18.0.pre.alpha.PBNTR191AdvancedTableFinalFixes2178 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.18.0.pre.alpha.PLAY12062177 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.18.0.pre.alpha.PBNTR191AdvancedTableFinalFixes2176 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.18.0.pre.alpha.dependabotnpmandyarnpowerhomeplaybookicons001alpha52175 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.18.0.pre.alpha.dependabotnpmandyarnpowerhomeplaybookicons001alpha52174 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.18.0.pre.alpha.PBNTR191AdvancedTableFinalFixes2173 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.18.0.pre.alpha.PBNTR191AdvancedTableFinalFixes2159 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.17.0.pre.alpha.nodealphaupgrade2157 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.18.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.16.0.pre.alpha.play1141iconkitusinglibrary2130 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.16.0.pre.alpha.PLAY12002127 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.16.0.pre.alpha.powercentrainplaybookpt22125 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.16.0.pre.alpha.play1141iconkitusinglibrary2107 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.16.0.pre.alpha.PBNTR181stripedtable2103 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.16.0.pre.alpha.play1141iconkitusinglibrary2100 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-13.16.0.pre.alpha.PBNTR184betaflaginmenuyml2085 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb