Sha256: 7d401acc65547a8ea1afa2084968d89420e207eb9e333dd68666d1c4166b21a0

Contents?: true

Size: 1.04 KB

Versions: 128

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

module Primer
  module Beta
    # @label BaseButton
    class BaseButtonPreview < ViewComponent::Preview
      # @label Playground
      #
      # @param type [Symbol] select [button, submit]
      # @param tag [Symbol] select [button, a, summary]
      # @param block [Boolean] toggle
      # @param disabled [Boolean]
      def playground(tag: :button, block: false, type: :button, disabled: false)
        render(Primer::Beta::BaseButton.new(tag: tag, block: block, type: type, disabled: disabled)) { "Button" }
      end

      # @label Default options
      #
      # @param type [Symbol] select [button, submit]
      # @param tag [Symbol] select [button, a, summary]
      # @param block [Boolean] toggle
      def default(tag: :button, block: false, type: :button)
        render(Primer::Beta::BaseButton.new(tag: tag, block: block, type: type)) { "Button" }
      end

      # @label Disabled
      #
      def disabled
        render(Primer::Beta::BaseButton.new(disabled: true)) { "Button" }
      end
    end
  end
end

Version data entries

128 entries across 128 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.6.3 previews/primer/beta/base_button_preview.rb
primer_view_components-0.6.0 previews/primer/beta/base_button_preview.rb
primer_view_components-0.5.1 previews/primer/beta/base_button_preview.rb
primer_view_components-0.5.0 previews/primer/beta/base_button_preview.rb
primer_view_components-0.4.0 previews/primer/beta/base_button_preview.rb
primer_view_components-0.3.1 previews/primer/beta/base_button_preview.rb
primer_view_components-0.3.0 previews/primer/beta/base_button_preview.rb
primer_view_components-0.2.0 previews/primer/beta/base_button_preview.rb