Sha256: 79e67e9fd5b8e25b364b43dc216116563a5843217d2a2cc219c751086ab3ea64

Contents?: true

Size: 1.67 KB

Versions: 11

Compression:

Stored size: 1.67 KB

Contents

<%= render_component_tag class: "px-4 py-3" do %>
  <div class="flex items-start max-w-[800px]" :class="isNarrowLayout && '!block'">
    <label
      for="param-<%= @name %>"
      class="block font-bold cursor-pointer flex-none py-2 w-[140px] truncate pr-2">
      <%= label %>
    </label>
    
    <div class="flex-grow">
      <% if field_type == "text" %>
      
        <input
          class="form-input"
          value="<%= value %>"
          type="<%= input_type %>"
          x-bind="bindings.input || {}">

      <% elsif field_type == "textarea" %>

        <textarea
          class="form-input"
          rows="4"
          x-bind="bindings.input || {}"><%= value %></textarea>

      <% elsif field_type == "select" %>

        <select
          class="form-input"
          x-bind="bindings.input || {}"
          x-model="value">
          <%= options_for_select(@options || [], value) %>
        </select>

      <% elsif field_type == "toggle" %>

        <button type="button"
          class="<%= value == true ? "bg-lookbook-input-toggle-active" : "bg-lookbook-input-toggle" %> 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"
          role="switch"
          @click.stop="value = !value">
          <span
            aria-hidden="true"
            class="<%= value == true ? "translate-x-5" : "translate-x-0" %>  pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow ring-0 transition ease-in-out duration-200"
          ></span>
        </button>

      <% end %>
    </div>
  </div>
<% end %>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lookbook-1.0.0.rc.2 app/components/lookbook/params_editor/field/component.html.erb
lookbook-1.0.0.rc.1 app/components/lookbook/params_editor/field/component.html.erb
lookbook-1.0.0.beta.8 app/components/lookbook/params_editor/field/component.html.erb
lookbook-1.0.0.beta.7 app/components/lookbook/params_editor/field/component.html.erb
lookbook-1.0.0.beta.6 app/components/lookbook/params_editor/field/component.html.erb
lookbook-1.0.0.beta.5 app/components/lookbook/params_editor/field/component.html.erb
lookbook-1.0.0.beta.4 app/components/lookbook/params_editor/field/component.html.erb
lookbook-1.0.0.beta.3 app/components/lookbook/params_editor/field/component.html.erb
lookbook-1.0.0.beta.2 app/components/lookbook/params_editor/field/component.html.erb
lookbook-1.0.0.beta.1 app/components/lookbook/params_editor/field/component.html.erb
lookbook-1.0.0.beta.0 app/components/lookbook/params_editor/field/component.html.erb