Previews

No matching results.

x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<div class="p-8">
<h3 class="text-lg font-semibold mb-4">Disabled Items</h3>
<div class="relative inline-block" data-controller="better-ui--dropdown--dropdown" data-better-ui--dropdown--dropdown-auto-close-value="true" data-better-ui--dropdown--dropdown-close-on-item-click-value="true">
<div aria-haspopup="true"
aria-expanded="false"
data-action="click->better-ui--dropdown--dropdown#toggle"
data-better-ui--dropdown--dropdown-target="trigger">
<button type="button" data-controller="better-ui--button" data-action="click->better-ui--button#handleClick" class="inline-flex items-center justify-center font-medium rounded-lg transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-grayscale-50 px-4 py-2 text-base gap-2 cursor-pointer">
<span data-better-ui--button-target="spinner" class="hidden">
<svg class="animate-spin w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
<span class="sr-only">Loading...</span>
</span>
<span data-better-ui--button-target="content" class=" inline-flex items-center gap-2">
Actions
</span>
</button>
</div>
<div role="menu"
hidden
data-better-ui--dropdown--dropdown-target="menu"
class="absolute z-50 bg-white rounded-md ring-1 ring-grayscale-200 ring-opacity-5 py-1 overflow-hidden focus:outline-none transition-all duration-150 ease-out opacity-0 scale-95 w-56 top-full left-0 mt-1 shadow-lg">
<a role="menuitem" tabindex="-1" class="flex items-center gap-2 w-full text-left px-3 py-2 text-sm transition-colors duration-150 text-grayscale-700 hover:bg-grayscale-100 hover:text-grayscale-900 cursor-pointer" data-better-ui--dropdown--dropdown-target="item" href="#edit">
<span class="flex-1">Edit</span>
</a>
<a role="menuitem" tabindex="-1" class="flex items-center gap-2 w-full text-left px-3 py-2 text-sm transition-colors duration-150 text-grayscale-700 opacity-50 cursor-not-allowed pointer-events-none" data-better-ui--dropdown--dropdown-target="item" href="#duplicate" aria-disabled="true">
<span class="flex-1">Duplicate (disabled)</span>
</a>
<a role="menuitem" tabindex="-1" class="flex items-center gap-2 w-full text-left px-3 py-2 text-sm transition-colors duration-150 text-grayscale-700 hover:bg-grayscale-100 hover:text-grayscale-900 cursor-pointer" data-better-ui--dropdown--dropdown-target="item" href="#archive">
<span class="flex-1">Archive</span>
</a>
<div role="separator" class="border-t border-grayscale-200 my-1"></div>
<a role="menuitem" tabindex="-1" class="flex items-center gap-2 w-full text-left px-3 py-2 text-sm transition-colors duration-150 text-danger-600 opacity-50 cursor-not-allowed pointer-events-none" data-better-ui--dropdown--dropdown-target="item" href="#delete" aria-disabled="true">
<span class="flex-1">Delete (disabled)</span>
</a>
</div>
</div>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<div class="p-8">
<h3 class="text-lg font-semibold mb-4">Disabled Items</h3>
<%= render BetterUi::Dropdown::DropdownComponent.new do |d| %>
<% d.with_trigger do %>
<%= render(BetterUi::ButtonComponent.new(variant: :primary)) do %>Actions<% end %>
<% end %>
<% d.with_item(href: "#edit") { "Edit" } %>
<% d.with_item(href: "#duplicate", disabled: true) { "Duplicate (disabled)" } %>
<% d.with_item(href: "#archive") { "Archive" } %>
<% d.with_divider %>
<% d.with_item(href: "#delete", variant: :danger, disabled: true) { "Delete (disabled)" } %>
<% end %>
</div>