<%= form_with model: [collection, column], data: { controller: "form", action: "turbo:submit-end->dialog#close turbo:submit-end->form#reset" } do |form| %>
  <%= form.text_field :name, class: "input", placeholder: "Name this column", value: column.name,
        required: true, autocomplete: "off", pattern: ".*\\S.*", title: "Column name cannot be blank", data: { action: "focus->form#select" } %>

  <div class="color-picker__colors">
    <% ([Card::DEFAULT_COLOR] + Card::COLORS).each do |color| %>
      <label class="btn txt-small borderless" style="--btn-background: <%= color %>" title="<%= color %>">
        <%= form.radio_button :color, color, checked: (column.color == color || (column.new_record? && color == Card::DEFAULT_COLOR)) %>
        <%= icon_tag "check", class: "checked" %>
        <span class="for-screen-reader"><%= color %></span>
      </label>
    <% end %>
  </div>

  <%= form.submit label, class: "btn btn--link" %>
<% end %>
