Sha256: 9e2a4939961ca2a360dade4ceba10ac6951b6f029b31c4ecfeec451e1a3337af

Contents?: true

Size: 883 Bytes

Versions: 12

Compression:

Stored size: 883 Bytes

Contents

# frozen_string_literal: true

module Primer
  module Beta
    # @label Breadcrumbs
    class BreadcrumbsPreview < ViewComponent::Preview
      # @label Playground
      #
      # @param number_of_links [Integer] number
      def playground(number_of_links: 2)
        render(Primer::Beta::Breadcrumbs.new) do |component|
          Array.new(number_of_links&.to_i || 3) do |i|
            component.with_item(href: "##{i}") { "Breadcrumb Item #{i + 1}" }
          end
        end
      end

      # @label Default options
      #
      # @param number_of_links [Integer] number
      # @snapshot
      def default(number_of_links: 2)
        render(Primer::Beta::Breadcrumbs.new) do |component|
          Array.new(number_of_links&.to_i || 3) do |i|
            component.with_item(href: "##{i}") { "Breadcrumb Item #{i + 1}" }
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.33.1 previews/primer/beta/breadcrumbs_preview.rb
openproject-primer_view_components-0.33.0 previews/primer/beta/breadcrumbs_preview.rb
openproject-primer_view_components-0.32.1 previews/primer/beta/breadcrumbs_preview.rb
openproject-primer_view_components-0.32.0 previews/primer/beta/breadcrumbs_preview.rb
openproject-primer_view_components-0.29.1 previews/primer/beta/breadcrumbs_preview.rb
openproject-primer_view_components-0.29.0 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.23.0 previews/primer/beta/breadcrumbs_preview.rb
openproject-primer_view_components-0.28.1 previews/primer/beta/breadcrumbs_preview.rb
openproject-primer_view_components-0.28.0 previews/primer/beta/breadcrumbs_preview.rb
openproject-primer_view_components-0.27.0 previews/primer/beta/breadcrumbs_preview.rb
openproject-primer_view_components-0.26.0 previews/primer/beta/breadcrumbs_preview.rb
primer_view_components-0.22.0 previews/primer/beta/breadcrumbs_preview.rb