Sha256: f115326a6d5334f2711ae6606628316788009c1e55fd2269471ef422cc421f67

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 KB

Contents

# frozen_string_literal: true

module Primer
  module Beta
    # @label Counter
    class CounterPreview < ViewComponent::Preview
      # @label Playground
      #
      # @param count number
      # @param limit number
      # @param hide_if_zero toggle
      # @param round toggle
      # @param scheme [Symbol] select [[Default, default], [Primary, primary], [Secondary, secondary]]]
      def playground(count: 1_000, limit: nil, round: false, hide_if_zero: false, scheme: :default)
        render(Primer::Beta::Counter.new(count: count, round: round, limit: limit, hide_if_zero: hide_if_zero, scheme: scheme))
      end

      # @label Default Options
      #
      # @param count number
      # @param limit number
      # @param hide_if_zero toggle
      # @param round toggle
      # @param scheme [Symbol] select [[Default, default], [Primary, primary], [Secondary, secondary]]]
      def default(count: 1_000, limit: nil, round: false, hide_if_zero: false, scheme: :default)
        render(Primer::Beta::Counter.new(count: count, round: round, limit: limit, hide_if_zero: hide_if_zero, scheme: scheme))
      end

      # @label With Text
      def with_text
        render(Primer::Beta::Counter.new(text: "∞"))
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
primer_view_components-0.0.109 previews/primer/beta/counter_preview.rb
primer_view_components-0.0.108 previews/primer/beta/counter_preview.rb
primer_view_components-0.0.107 previews/primer/beta/counter_preview.rb
primer_view_components-0.0.106 previews/primer/beta/counter_preview.rb
primer_view_components-0.0.105 previews/primer/beta/counter_preview.rb