Sha256: 20246a7328e3d8e4eb857341900733019f3145c637664c3e28361acdbb0a8ba9

Contents?: true

Size: 786 Bytes

Versions: 4

Compression:

Stored size: 786 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbFixedConfirmationToast
    class FixedConfirmationToast
      include Playbook::Props

      partial "pb_fixed_confirmation_toast/fixed_confirmation_toast"

      prop :status, type: Playbook::Props::Enum,
                    values: %w[success error neutral],
                    default: "neutral"
      prop :text, type: Playbook::Props::String


      def show_text?
        text.present?
      end

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

      def classname
        generate_classname("pb_fixed_confirmation_toast_kit", status)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
playbook_ui-2.9.8 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-2.9.7 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-2.9.6 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-2.9.5 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb