Sha256: 17c14047e1e3dea24740162ebb4d28d016486e754161d718e3a4cb2a1903d46e

Contents?: true

Size: 715 Bytes

Versions: 135

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

module Playbook
  module PbNav
    class Item
      include Playbook::Props

      partial "pb_nav/item"

      prop :active, type: Playbook::Props::Boolean, default: false
      prop :link
      prop :text
      prop :icon_left
      prop :icon_right

      def classname
        generate_classname("pb_nav_list_kit_item", active_class)
      end

      def tag
        link ? "a" : "div"
      end

      def options
        {
          class: "pb_nav_list_item_link",
        }.compact
      end

      def link_options
        options.merge(
          href: link
        )
      end

    private

      def active_class
        active ? "active" : nil
      end
    end
  end
end

Version data entries

135 entries across 135 versions & 1 rubygems

Version Path
playbook_ui-7.0.0.pre.alpha9 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-7.0.0.pre.alpha8 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-7.0.0.pre.alpha7 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-6.4.1 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-7.0.0.pre.alpha6 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-7.0.0.pre.alpha5 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-6.4.0 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-6.3.1 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-7.0.0.pre.alpha4 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-7.0.0.pre.alpha3 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-7.0.0.pre.alpha2 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-6.3.0 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-6.2.1 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-6.2.0 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-7.0.0.pre.alpha1 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/pb_nav/item.rb
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/pb_nav/item.rb