Sha256: a442f11891dbf609244886b1f112bf15b4ddfc210e7b5618c57bd2f48656f671

Contents?: true

Size: 1.97 KB

Versions: 5

Compression:

Stored size: 1.97 KB

Contents

<div id="inspector" class="bg-white w-full overflow-hidden flex flex-col">
   <div class="px-4 border-b border-gray-200 flex items-center flex-none select-none cursor-[ns-resize]">
    <nav class="-mb-px flex space-x-8 cursor-auto">
      <% @inspector[:panes].each do |key, props| %>
        <a
          href="#<%= key %>"
          class="whitespace-nowrap py-2 px-1 border-b-2 cursor-pointer <%= "!text-gray-300" if props[:disabled] %>"
          :class="{
            'border-indigo-400 ': $store.inspector.active === '<%= key %>',
            'border-transparent text-gray-500 hover:text-gray-700': $store.inspector.active !== '<%= key %>'
          }"
          @click.stop.prevent="$store.inspector.active = '<%= key %>'"
        >
          <%== props[:label] %>
        </a>
      <% end %>
    </nav>
  </div>
  <div class="flex-auto overflow-auto bg-gray-50">
    <% @inspector[:panes].each do |key, props| %>
      <div
        class="flex flex-col h-full relative"
        x-show="$store.inspector.active === '<%= key %>'" x-cloak>
        <% if props[:clipboard].present? %>
          <button
            class="p-1.5 border-b border-l border-gray-200 hover:border-gray-300 rounded-bl-md bg-white absolute top-0 right-0 text-gray-400 hover:text-indigo-500 transition"
            x-data="{content: null, done: false}"
            x-tooltip.theme.lookbook="done ? 'cpied!' : 'copy to clipboard'"
            data-tippy-placement="left"
            @click="$clipboard(content); done = true; setTimeout(() => {done = false}, 1000)">
            <svg class="feather h-4 w-4 ">
              <use x-bind:href="done ? '#check' : '#clipboard'" />
            </svg>
            <div class="hidden" x-init="content = $el.innerText"><%= h props[:clipboard].strip %></div>
          </button>
        <% end %>
        <div class="flex flex-col h-full overflow-auto">
          <%= render "partials/inspector/#{props[:template]}", key: key, **props %>
        </div>
      </div>
    <% end %>
  </div>
</div>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lookbook-0.2.4 app/views/lookbook/partials/inspector/_inspector.html.erb
lookbook-0.2.3 app/views/lookbook/partials/inspector/_inspector.html.erb
lookbook-0.2.2 app/views/lookbook/partials/inspector/_inspector.html.erb
lookbook-0.2.1 app/views/lookbook/partials/inspector/_inspector.html.erb
lookbook-0.2.0 app/views/lookbook/partials/inspector/_inspector.html.erb