Sha256: 46a636203e131ca3ecbe169f830ee592522b637088cd6fa54c7fd645bdb6e6be

Contents?: true

Size: 1.29 KB

Versions: 73

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true

module Primer
  module Alpha
    # @label UnderlinePanels
    class UnderlinePanelsPreview < ViewComponent::Preview
      # @label Playground
      #
      # @param number_of_panels [Integer] number
      # @param align [Symbol] select [left, right]
      def playground(number_of_panels: 3, align: :left)
        render(Primer::Alpha::UnderlinePanels.new(label: "Test navigation", align: align)) do |component|
          Array.new(number_of_panels || 3) do |i|
            component.with_tab(selected: i.zero?, id: "tab-#{i + 1}") do |tab|
              tab.with_panel { "Panel #{i + 1}" }
              tab.with_text { "Tab #{i + 1}" }
            end
          end
        end
      end

      # @label Default options
      #
      # @param number_of_panels [Integer] number
      # @param align [Symbol] select [left, right]
      def default(number_of_panels: 3, align: :left)
        render(Primer::Alpha::UnderlinePanels.new(label: "Test navigation", align: align)) do |component|
          Array.new(number_of_panels || 3) do |i|
            component.with_tab(selected: i.zero?, id: "tab-#{i + 1}") do |tab|
              tab.with_panel { "Panel #{i + 1}" }
              tab.with_text { "Tab #{i + 1}" }
            end
          end
        end
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.25.1 previews/primer/alpha/underline_panels_preview.rb
primer_view_components-0.21.1 previews/primer/alpha/underline_panels_preview.rb
openproject-primer_view_components-0.25.0 previews/primer/alpha/underline_panels_preview.rb
openproject-primer_view_components-0.24.0 previews/primer/alpha/underline_panels_preview.rb
primer_view_components-0.21.0 previews/primer/alpha/underline_panels_preview.rb
primer_view_components-0.20.1 previews/primer/alpha/underline_panels_preview.rb
primer_view_components-0.20.0 previews/primer/alpha/underline_panels_preview.rb
openproject-primer_view_components-0.23.0 previews/primer/alpha/underline_panels_preview.rb
primer_view_components-0.19.0 previews/primer/alpha/underline_panels_preview.rb
openproject-primer_view_components-0.22.2 previews/primer/alpha/underline_panels_preview.rb
primer_view_components-0.18.2 previews/primer/alpha/underline_panels_preview.rb
openproject-primer_view_components-0.22.1 previews/primer/alpha/underline_panels_preview.rb
primer_view_components-0.18.1 previews/primer/alpha/underline_panels_preview.rb
openproject-primer_view_components-0.22.0 previews/primer/alpha/underline_panels_preview.rb
primer_view_components-0.18.0 previews/primer/alpha/underline_panels_preview.rb
openproject-primer_view_components-0.21.0 previews/primer/alpha/underline_panels_preview.rb
primer_view_components-0.17.0 previews/primer/alpha/underline_panels_preview.rb
openproject-primer_view_components-0.20.0 previews/primer/alpha/underline_panels_preview.rb
primer_view_components-0.16.1 previews/primer/alpha/underline_panels_preview.rb
primer_view_components-0.16.0 previews/primer/alpha/underline_panels_preview.rb