Sha256: 58b4feff4ed915d217d588e55fe47ef682eec1c495a04c310d2eb9be88bd623e

Contents?: true

Size: 811 Bytes

Versions: 26

Compression:

Stored size: 811 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"
]
%>

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

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
lookbook-2.0.2 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.1 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.rc.3 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-1.5.5 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-1.5.4 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.rc.2 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.rc.1 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.beta.9 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.beta.8 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.beta.7 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.beta.6 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.beta.5 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.beta.4 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.beta.3 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.beta.2 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-1.5.3 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.beta.1 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-1.5.2 app/views/lookbook/inspector/inputs/_toggle.html.erb
lookbook-2.0.0.beta.0 app/views/lookbook/inspector/inputs/_toggle.html.erb