Sha256: 63f3e98c7ced882396cdf1594a15e3ead9fc9a4a02352815c5e09c3db125a082

Contents?: true

Size: 887 Bytes

Versions: 99

Compression:

Stored size: 887 Bytes

Contents

# frozen_string_literal: true

module Primer
  module Beta
    # @label ClipboardCopyButton
    class ClipboardCopyButtonPreview < ViewComponent::Preview
      # @label Playground
      #
      # @param text [String]
      def playground(text: "Text to copy")
        render(Primer::Beta::ClipboardCopyButton.new(id: "clipboard-button", aria: { label: "Copy" }, value: text))
      end

      # @label Playground
      # @snapshot
      def default
        render(Primer::Beta::ClipboardCopyButton.new(id: "clipboard-button", aria: { label: "Copy" }, value: "Text to copy"))
      end

      # @label With tooltip
      # @snapshot
      def with_tooltip
        render(Primer::Beta::ClipboardCopyButton.new(id: "clipboard-button", aria: { label: "Copy" }, value: "Text to copy")) do |button|
          button.with_tooltip(text: "Copy some text")
        end
      end
    end
  end
end

Version data entries

99 entries across 99 versions & 2 rubygems

Version Path
primer_view_components-0.36.5 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.52.2 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.36.4 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.52.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.52.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.36.3 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.51.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.36.2 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.50.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.50.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.36.1 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.36.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.49.2 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.35.2 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.49.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.49.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.35.1 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.35.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.48.2 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.48.1 previews/primer/beta/clipboard_copy_button_preview.rb