Sha256: 1782bcf92ff927840a10849b629e337edf8d29e728e34db8f8fbefac05fcf4c8

Contents?: true

Size: 958 Bytes

Versions: 3

Compression:

Stored size: 958 Bytes

Contents

<%= render_component_tag :li, id: @item.id, class: "list-none", "x-show": "!filteredOut", cloak: true do %>
  
  <%= render_tag href.present? ? :a : :div,
    href: href,
    class: "flex items-center py-1 select-none cursor-pointer text-lookbook-nav-text hover:bg-lookbook-nav-item-hover",
    style: "padding-left: #{left_pad}px",
    x_bind: "bindings.#{href.present? ? "link" : "toggle"}" do %>
    <div class="relative flex items-center">
      <%= render_component :icon, name: nil,
        size: 3,
        class: "mr-1 text-lookbook-nav-toggle absolute -left-4",
        x_effect: "iconName = open ? 'chevron-down' : 'chevron-right'" if children? %>
      <%= render_component :icon, name: nav_icon(@item), size: 3.5, class: "mr-1.5 text-lookbook-nav-icon" %>
      <span><%= label %></span>
    </div>
  <% end %>
  
  <% if children? %>
    <ul x-ref="items" x-show="open" x-cloak>
      <%= safe_join(children) %>
    </ul>
  <% end %>  
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lookbook-1.0.0.beta.2 app/components/lookbook/nav/item/component.html.erb
lookbook-1.0.0.beta.1 app/components/lookbook/nav/item/component.html.erb
lookbook-1.0.0.beta.0 app/components/lookbook/nav/item/component.html.erb