Sha256: ef4002492a479fe56d8e1d7afa27ec964eca778eaf19e66c200a1e0f3496eb84

Contents?: true

Size: 1.11 KB

Versions: 45

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

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

      def show_text?
        text.present?
      end

      def close_class
        closeable.present? ? " remove_toast" : ""
      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
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
playbook_ui-10.11.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.10.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.9.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.8.1.pre.alpha.flexdeps app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.9.0.pre.alpha1 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.8.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.7.1 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.7.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.6.2.pre.alpha.dep app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.6.1.pre.alpha1 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.6.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.5.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.4.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.3.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.2.1.alpha.sisensefix app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.2.1 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.2.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.1.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.0.3.pre.alpha.walkthrough2 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-10.0.3.pre.alpha.walkthrough app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb