Sha256: 53165d54907f68112dae51613dbb6766d4b60da980d1ad73f40c3a674dbeb8cb

Contents?: true

Size: 1.96 KB

Versions: 27

Compression:

Stored size: 1.96 KB

Contents

# frozen_string_literal: true

module Primer
  module Beta
    # @label ProgressBar
    class ProgressBarPreview < ViewComponent::Preview
      # @label Playground
      #
      # @param size [Symbol] select [default, small, large]
      def playground(size: :default)
        render(Primer::Beta::ProgressBar.new(size: size)) do |component|
          component.with_item(percentage: 10)
          component.with_item(bg: :accent_emphasis, percentage: 20)
          component.with_item(bg: :danger_emphasis, percentage: 30)
        end
      end

      # @label Default
      #
      # @param size [Symbol] select [default, small, large]
      def default(size: :default)
        render(Primer::Beta::ProgressBar.new(size: size)) do |component|
          component.with_item(percentage: 10)
          component.with_item(bg: :accent_emphasis, percentage: 20)
          component.with_item(bg: :danger_emphasis, percentage: 30)
        end
      end

      # @!group Sizes
      #
      # @label Size small
      def size_small
        render(Primer::Beta::ProgressBar.new(size: :small)) do |component|
          component.with_item(percentage: 10)
          component.with_item(bg: :accent_emphasis, percentage: 20)
          component.with_item(bg: :danger_emphasis, percentage: 30)
        end
      end

      # @label Size default
      def size_default
        render(Primer::Beta::ProgressBar.new(size: :default)) do |component|
          component.with_item(percentage: 10)
          component.with_item(bg: :accent_emphasis, percentage: 20)
          component.with_item(bg: :danger_emphasis, percentage: 30)
        end
      end

      # @label Size large
      def size_large
        render(Primer::Beta::ProgressBar.new(size: :large)) do |component|
          component.with_item(percentage: 10)
          component.with_item(bg: :accent_emphasis, percentage: 20)
          component.with_item(bg: :danger_emphasis, percentage: 30)
        end
      end
      # @!endgroup
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
primer_view_components-0.3.1 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.3.0 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.2.0 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.1.9 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.1.8 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.1.7 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.1.6 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.1.5 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.1.4 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.1.3 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.1.2 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.1.1 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.1.0 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.0.123 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.0.122 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.0.121 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.0.120 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.0.119 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.0.118 previews/primer/beta/progress_bar_preview.rb
primer_view_components-0.0.117 previews/primer/beta/progress_bar_preview.rb