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

{%- set disabled = disabled ?? false %}

{%- 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: not disabled ? field.charLimit,
    showCharsLeft: true,
    placeholder: placeholder,
    required: field.required,
    rows: field.initialRows,
    orientation: orientation ?? null,
    disabled,
} %}

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