app/components/validated_field_component.html.erb
<%= content_tag(:'lg-validated-field', 'error-id': error_id) do %>
<%= content_tag(
:script,
error_messages.to_json,
{
type: 'application/json',
class: 'validated-field__error-strings',
},
false,
) %>
<%= f.input(
name,
tag_options.deep_merge(
wrapper_html: {
class: [*tag_options.dig(:wrapper_html, :class), 'validated-field__input-wrapper'],
},
input_html: {
class: [*tag_options.dig(:input_html, :class), 'validated-field__input'],
aria: {
invalid: has_errors?,
describedby: aria_describedby_idrefs,
},
},
hint_html: { id: hint_id },
error_html: { id: error_id },
),
) %>
<% end %>