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
openproject-primer_view_components-0.48.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.47.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.47.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.34.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.46.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.46.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.45.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.44.3 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.44.2 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.44.1 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.33.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.44.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.43.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.43.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.32.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.42.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.31.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.41.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.41.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.40.0 previews/primer/beta/clipboard_copy_button_preview.rb