Sha256: 432c8e3abb72ccc0fb92d2a29de423f4ebed27835f06f931d7fe4ae06b8ecf10

Contents?: true

Size: 795 Bytes

Versions: 6

Compression:

Stored size: 795 Bytes

Contents

<%
button_classes = [
  "relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full
    cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2
    focus:ring-offset-2 focus:ring-input-border-focus",
  value == "true" ? "bg-lookbook-input-toggle-active" : "bg-lookbook-input-toggle"
]
span_classes = [
  "pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow ring-0 transition ease-in-out duration-200",
  value == "true" ? "translate-x-5" : "translate-x-0"
]
%>

<%= button_tag **input_options,
  class: class_names(button_classes),
  role: "switch",
  type: "button",
  "@click.stop": "value = value == 'true' ? 'false' : 'true'" do %>
  <%= tag.span "aria-hidden": true, class: class_names(span_classes) %>
<% end %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lookbook-1.4.1 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-1.4.0 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-1.3.4 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-1.3.3 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-1.3.1 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-1.3.0 app/views/lookbook/inspector/inputs/_toggle.html.erb