Sha256: d443bd701da926b170073071a0877ba8b5032f7adbae29fe748b7e9cc656d5f3

Contents?: true

Size: 737 Bytes

Versions: 25

Compression:

Stored size: 737 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbTooltip
    class Tooltip
      include Playbook::Props
      partial "pb_tooltip/tooltip"

      prop :position
      prop :trigger_element_id
      prop :tooltip_id
      prop :dark, type: Playbook::Props::Boolean,
                  default: false

      def classname
        generate_classname("pb_tooltip_kit", dark_class)
      end

      def data
        Hash(values[:data]).merge(
          pb_tooltip_kit: true,
          pb_tooltip_position: position,
          pb_tooltip_trigger_element_id: trigger_element_id,
          pb_tooltip_tooltip_id: tooltip_id,
        )
      end

    private

      def dark_class
        dark ? "dark" : nil
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
playbook_ui-7.11.0.pre.alpha1 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.10.0 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.9.0 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.8.4 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.8.3 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.8.2 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.8.1 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.8.0 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.7.0.pre.alpha1 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.7.0 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.6.2.pre.alpha1 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.6.2 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.6.1.pre.alpha1 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.6.1 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.6.0 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.5.1 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.5.0 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.4.2 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.4.1 app/pb_kits/playbook/pb_tooltip/tooltip.rb
playbook_ui-7.4.0.pre.alpha5 app/pb_kits/playbook/pb_tooltip/tooltip.rb