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.33.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.25.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.32.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.32.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.29.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.29.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.23.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.28.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.28.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.27.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.26.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.25.1 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.22.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.21.1 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.25.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.24.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.21.0 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.20.1 previews/primer/beta/clipboard_copy_button_preview.rb
primer_view_components-0.20.0 previews/primer/beta/clipboard_copy_button_preview.rb
openproject-primer_view_components-0.23.0 previews/primer/beta/clipboard_copy_button_preview.rb