Sha256: a4f395e3f72703e40adb0bbed2912742aa19d1677f5ce8d9989f72f3476cd019

Contents?: true

Size: 1.78 KB

Versions: 57

Compression:

Stored size: 1.78 KB

Contents

# frozen_string_literal: true

module Primer
  module Alpha
    TextField = Primer::FormComponents.from_input(Primer::Forms::Dsl::TextFieldInput)

    # Text fields are single-line text inputs rendered as `<input type="text">` in HTML.
    #
    # @form_usage
    #   class ExampleForm < ApplicationForm
    #     form do |example_form|
    #       example_form.text_field(attributes)
    #     end
    #   end
    class TextField < Primer::Component
      status :alpha

      # @!method initialize
      #
      # @macro form_size_arguments
      # @macro form_full_width_arguments
      # @macro form_input_arguments
      #
      # @param placeholder [String] Placeholder text.
      # @param inset [Boolean] If `true`, renders the input in a visually inset state.
      # @param monospace [Boolean] If `true`, uses a monospace font for the input field.
      # @param auto_check_src [String] When provided, makes a request to the given URL whenever the contents of the text field changes. If the server responds with a non-2xx status code, the response body is used as the validation message.
      # @param leading_visual [Hash] Renders a leading visual icon before the text field's cursor. The hash will be passed to Primer's <%= link_to_component(Primer::Beta::Octicon) %> component.
      # @param leading_spinner [Boolean] If `true`, a leading spinner will be included in the markup. The spinner can be shown via the `showLeadingSpinner()` JavaScript method, and hidden via `hideLeadingSpinner()`. If this argument is `true`, a leading visual must also be provided.
      # @param show_clear_button [Boolean] Whether or not to include a clear button inside the input that clears the input's contents when clicked.
      # @param clear_button_id [String] The HTML id attribute of the clear button.
    end
  end
end

Version data entries

57 entries across 57 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.48.0 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.47.1 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.47.0 app/components/primer/alpha/text_field.rb
primer_view_components-0.34.0 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.46.1 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.46.0 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.45.0 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.44.3 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.44.2 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.44.1 app/components/primer/alpha/text_field.rb
primer_view_components-0.33.0 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.44.0 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.43.1 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.43.0 app/components/primer/alpha/text_field.rb
primer_view_components-0.32.0 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.42.0 app/components/primer/alpha/text_field.rb
primer_view_components-0.31.0 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.41.1 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.41.0 app/components/primer/alpha/text_field.rb
openproject-primer_view_components-0.40.0 app/components/primer/alpha/text_field.rb