Sha256: 77ff7aad00816b13187c7a615492f376eb749fa8fa1cf2cd412369d89237df9d

Contents?: true

Size: 1.24 KB

Versions: 18

Compression:

Stored size: 1.24 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]
      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]
      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

18 entries across 18 versions & 1 rubygems

Version Path
primer_view_components-0.3.1 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.3.0 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.2.0 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.1.9 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.1.8 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.1.7 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.1.6 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.1.5 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.1.4 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.1.3 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.1.2 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.1.1 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.1.0 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.0.123 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.0.122 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.0.121 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.0.120 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.0.119 previews/primer/beta/clipboard_copy_preview.rb