Sha256: 9c064a3b102e652b297df3673b5b51df784f0c7d090f654310a83f2fdcc248e6

Contents?: true

Size: 558 Bytes

Versions: 6

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

module Primer
  module Forms
    # :nodoc:
    class FormControl < BaseComponent
      delegate :builder, :form, to: :@input

      def initialize(input:)
        @input = input
        @input.add_label_classes("FormControl-label")
        @form_group_arguments = {
          class: class_names(
            "FormControl",
            "width-full",
            "FormControl--fullWidth" => @input.full_width?
          )
        }

        @form_group_arguments[:hidden] = "hidden" if @input.hidden?
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
primer_view_components-0.1.3 lib/primer/forms/form_control.rb
primer_view_components-0.1.2 lib/primer/forms/form_control.rb
primer_view_components-0.1.1 lib/primer/forms/form_control.rb
primer_view_components-0.1.0 lib/primer/forms/form_control.rb
primer_view_components-0.0.123 lib/primer/forms/form_control.rb
primer_view_components-0.0.122 lib/primer/forms/form_control.rb