diff --git a/static/css/v3/forms.css b/static/css/v3/forms.css index 7a757f301..150b263ef 100644 --- a/static/css/v3/forms.css +++ b/static/css/v3/forms.css @@ -216,14 +216,27 @@ .field__control--disabled, .field__control--disabled:hover, .field__control--disabled:focus-within { - opacity: 0.5; + background-color: var(--color-surface-mid); + border-color: var(--color-stroke-strong); cursor: not-allowed; } +.field__control--disabled .field__input, +.field__control--disabled .field__input::placeholder, +.field__control--disabled:hover .field__input::placeholder { + color: var(--color-text-secondary); +} + .field__control--disabled .field__input { cursor: not-allowed; } +.field__control--disabled .field__icon, +.field__control--disabled:hover .field__icon, +.field__control--disabled:focus-within .field__icon { + color: var(--color-icon-secondary); +} + /* ========== Datetime-local: hide native icon, full-area click ========== */ .field__control--datetime { position: relative; diff --git a/templates/v3/examples/_v3_example_section.html b/templates/v3/examples/_v3_example_section.html index 57fcff627..06fcfb9e1 100644 --- a/templates/v3/examples/_v3_example_section.html +++ b/templates/v3/examples/_v3_example_section.html @@ -505,6 +505,7 @@

{{ section_title }}

{% include "v3/includes/_field_text.html" with name="ex_basic" label="Text field" placeholder="Enter text..." %} {% include "v3/includes/_field_text.html" with name="ex_search" label="With icon" placeholder="Search..." icon_left="search" %} {% include "v3/includes/_field_text.html" with name="ex_error" label="Error state" placeholder="Enter value" error="This field is required." %} + {% include "v3/includes/_field_text.html" with name="ex_disabled" label="Disabled state" placeholder="Enter value" value="Disabled value" disabled="true" %} {% include "v3/includes/_field_checkbox.html" with name="ex_agree" label="I agree to the terms and conditions" %} {% include "v3/includes/_field_dropdown.html" with name="ex_type" label="Dropdown" options=demo_dropdown_options placeholder="Select type..." %} {% include "v3/includes/_field_combo.html" with name="ex_library" label="Combo (searchable)" placeholder="Search libraries..." options=demo_libs %} diff --git a/templates/v3/includes/_field_text.html b/templates/v3/includes/_field_text.html index 0b85147a8..cba7f8ee5 100644 --- a/templates/v3/includes/_field_text.html +++ b/templates/v3/includes/_field_text.html @@ -109,7 +109,11 @@ aria-describedby="field-{{ name }}-help" {% endif %} {% if validate_type == "email" %}x-model="value" @blur="touched = true"{% elif submit_icon %}x-model="q" {% if dispatch_field_change %}@input.debounce.150ms="$dispatch('field-change', { name: '{{ name }}', value: q })"{% endif %}{% elif max_chars %}x-model="value"{% endif %}> - {% if submit_icon %} + {% if disabled %} + + {% elif submit_icon %}