Sha256: 265c78499297b68767ccc0279d583907da34050da1a0cb5590ed47cac5ce6bf7

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

<alv-input-email>
  <%= f.label @attribute, class: "block text-sm font-medium leading-6 text-gray-900" %>
  <div class="relative mt-2 rounded-md shadow-sm">
    <% input_color_class = errors? ? "text-red-900 ring-red-300 placeholder:text-red-300 focus:ring-red-500" : "text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-primary-600" %>
    <%= f.input_field @attribute, class: "block w-full rounded-md border-0 py-1.5 shadow-sm ring-1 ring-inset focus:ring-2 focus:ring-inset sm:text-sm sm:leading-6 #{input_color_class}" %>

    <% if f.object.errors[@attribute].present? %>
      <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3">
        <%= render(IconComponent.new(:exclamation, class: "h-5 w-5 text-red-500")) %>
      </div>
    <% end %>
  </div>
  <% if @args[:hint] %>
    <p class="mt-2 text-sm text-gray-500" id="email-description"><%= @args[:hint] %></p>
  <% end %>
  <%= f.error @attribute, id: "#{@attribute}_error", class: "mt-2 text-sm text-red-600" %>
</alv-input-email>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alveole-1.0.0.pre.alpha.1 app/components/alveole/input/email_component.html.erb