Sha256: 2922f0732f40640fbde10891518afc14d5bbf1aecf2da49b6c6e89bce64c1f5c

Contents?: true

Size: 1.28 KB

Versions: 112

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

module Primer
  module Beta
    # @label ClipboardCopy
    class ClipboardCopyPreview < ViewComponent::Preview
      # @label Playground
      #
      # @param aria_label [String]
      # @param value [String]
      def playground(value: "Text to copy", aria_label: "Copy text to the system clipboard")
        render(Primer::Beta::ClipboardCopy.new(value: value, "aria-label": aria_label))
      end

      # @label Default Options
      #
      # @param aria_label [String]
      # @param value [String]
      # @snapshot
      def default(value: "Text to copy", aria_label: "Copy text to the system clipboard")
        render(Primer::Beta::ClipboardCopy.new(value: value, "aria-label": aria_label))
      end

      # @label With text instead of icons
      #
      # @param aria_label [String]
      # @param value [String]
      # @snapshot
      def text(value: "Text to copy", aria_label: "Click to copy!")
        render(Primer::Beta::ClipboardCopy.new(value: value, "aria-label": aria_label)) { "Click to copy!" }
      end

      # @label Copying from an element
      #
      # @param aria_label [String]
      def element(aria_label: "Copy text to the system clipboard")
        render_with_template(locals: { aria_label: aria_label })
      end
    end
  end
end

Version data entries

112 entries across 112 versions & 2 rubygems

Version Path
primer_view_components-0.35.2 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.49.1 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.49.0 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.35.1 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.35.0 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.48.2 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.48.1 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.48.0 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.47.1 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.47.0 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.34.0 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.46.1 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.46.0 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.45.0 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.44.3 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.44.2 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.44.1 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.33.0 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.44.0 previews/primer/beta/clipboard_copy_preview.rb
openproject-primer_view_components-0.43.1 previews/primer/beta/clipboard_copy_preview.rb