Sha256: 03638420a6f7d1397858888ab20c23ed3895be10bda83022ee8f460be5c3d3b1

Contents?: true

Size: 1.81 KB

Versions: 17

Compression:

Stored size: 1.81 KB

Contents

# frozen_string_literal: true

module Primer
  module Beta
    # @label Details
    class DetailsPreview < ViewComponent::Preview
      # @label Playground
      #
      # @param overlay [Symbol] select [none, default, dark]
      # @param reset [Boolean] toggle
      def playground(reset: false, overlay: :default)
        render Primer::Beta::Details.new(reset: reset, overlay: overlay) do |component|
          component.with_summary do
            "Summary"
          end
          component.with_body do
            "Body"
          end
        end
      end

      # @label Default options
      #
      # @param overlay [Symbol] select [none, default, dark]
      # @param reset [Boolean] toggle
      def default(reset: false, overlay: :default)
        render Primer::Beta::Details.new(reset: reset, overlay: overlay) do |component|
          component.with_summary do
            "Summary"
          end
          component.with_body do
            "Body"
          end
        end
      end

      # @label Custom button
      #
      # @param overlay [Symbol] select [none, default, dark]
      # @param reset [Boolean] toggle
      def custom_button(reset: false, overlay: :default)
        render Primer::Beta::Details.new(reset: reset, overlay: overlay) do |component|
          component.with_summary(size: :small, scheme: :primary) { "Click me" }
          component.with_body { "Body" }
        end
      end

      # @label Without button
      #
      # @param overlay [Symbol] select [none, default, dark]
      # @param reset [Boolean] toggle
      def without_button(reset: false, overlay: :default)
        render Primer::Beta::Details.new(reset: reset, overlay: overlay) do |component|
          component.with_summary(button: false) { "Click me" }
          component.with_body { "Body" }
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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