Sha256: bfad30f406f56e68db13150baada691938748de764411cb70adc6a2c33b2a20a

Contents?: true

Size: 785 Bytes

Versions: 4

Compression:

Stored size: 785 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-3.1.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-3.0.1 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-3.0.0 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
playbook_ui-2.9.9 app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb