{% import "_includes/forms" as forms %}

{%- set class = [
    'nicetext',
    field.code ? 'code',
    field.uiMode == 'enlarged' ? 'readable',
]|filter %}

{% set config = {
    id: id ?? field.getInputId(),
    describedBy: field.describedBy,
    name: name,
    value: value,
    class: class,
    maxlength: field.charLimit,
    showCharsLeft: true,
    placeholder: field.placeholder ? field.placeholder|t('site'),
    required: field.required,
    rows: field.initialRows,
    orientation: orientation ?? null,
} %}

{% if field.multiline %}
    {{ forms.textarea(config) }}
{% else %}
    {{ forms.text(config) }}
{% endif %}
