Sha256: b4f6223855f0c4ba9026338f7284a01753ad9c3ceba7b145f922173b29e82802

Contents?: true

Size: 1.26 KB

Versions: 6

Compression:

Stored size: 1.26 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: "Copy text to the system clipboard")
        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

6 entries across 6 versions & 1 rubygems

Version Path
primer_view_components-0.0.118 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.0.117 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.0.116 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.0.115 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.0.114 previews/primer/beta/clipboard_copy_preview.rb
primer_view_components-0.0.113 previews/primer/beta/clipboard_copy_preview.rb