Sha256: ff007c554dbee9d6c013f81002a353472019fbc3d48ee97addca91ad4f36e09c

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require_relative '../../components/govuk/field/input/character_count'

module CCS
  module FrontendHelpers
    module GovUKFrontend
      # = GOV.UK Character count
      #
      # This helper is used for generating the character count component from the
      # {https://design-system.service.gov.uk/components/character-count GDS - Components - Character count}

      module CharacterCount
        # Generates the HTML for the GOV.UK Character count component
        #
        # @param (see CCS::Components::GovUK::Input::CharacterCount#initialize)
        #
        # @option (see CCS::Components::GovUK::Input::CharacterCount#initialize)
        #
        # @return (see CCS::Components::GovUK::Input::CharacterCount#render)

        def govuk_character_count(attribute, character_count_options, **options)
          Components::GovUK::Field::Input::CharacterCount.new(context: self, attribute: attribute, character_count_options: character_count_options, **options).render
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ccs-frontend_helpers-0.1.2 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-0.1.1 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-0.1.1.rc.1 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-0.1.0.rc.7 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-0.1.0.rc.6 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-0.1.0.rc.5 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-0.1.0.rc.4 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-0.1.0.rc.3 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb