Sha256: 611d8b1dd1b6c3363b242a95b2c1df8a019db3721a63966225024b28181cb16f

Contents?: true

Size: 1.11 KB

Versions: 14

Compression:

Stored size: 1.11 KB

Contents

<%= field_wrapper(**field_wrapper_args) do %>
  <div class="relative" data-controller="<%= @field.revealable ? 'password-visibility' : nil %>">
    <%= @form.password_field @field.id,
      value: @field.value,
      class: classes("w-full"),
      data: @field.get_html(:data, view: view, element: :input).merge(password_visibility_target: "input"),
      disabled: disabled?,
      placeholder: @field.placeholder,
      style: @field.get_html(:style, view: view, element: :input),
      autocomplete: @field.autocomplete,
      autofocus: @autofocus
    %>

    <% if @field.revealable %>
      <button data-action="password-visibility#toggle" type="button" class="text-gray-500 absolute inset-y-0 right-0 pr-3 flex items-center cursor-pointer">
        <!-- Heroicon name: outline/eye -->
        <%= helpers.svg('heroicons/outline/eye', class: "size-6", data: { 'password-visibility-target': 'icon' }) %>

        <!-- Heroicon name: outline/eye-off -->
        <%= helpers.svg('heroicons/outline/eye-off', class: "size-6 hidden", data: { 'password-visibility-target': 'icon' }) %>
      </button>
    <% end %>
  </div>
<% end %>

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
avo-3.17.3 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.17.5.tw4 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.17.4.tw4 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.17.3.tw4 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.17.2.tw4 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.17.2 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.17.1.tw4 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.17.1 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.17.0 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.16.6 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.16.5 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.16.4 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.16.3 app/components/avo/fields/password_field/edit_component.html.erb
avo-3.16.2 app/components/avo/fields/password_field/edit_component.html.erb