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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<div class="p-8">
<h3 class="text-lg font-semibold mb-4">Size Variants</h3>
<div class="flex gap-8 items-start">
<div>
<p class="text-sm text-grayscale-500 mb-2">sm</p>
<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-secondary-500 bg-transparent border-2 border-secondary-600 hover:border-secondary-700 hover:bg-secondary-50 text-secondary-600 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">
Size: sm
</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-40 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="#">
<span class="flex-1">Action One</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="#">
<span class="flex-1">Action Two</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="#">
<span class="flex-1">Action Three</span>
</a>
</div>
</div>
</div>
<div>
<p class="text-sm text-grayscale-500 mb-2">md</p>
<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-secondary-500 bg-transparent border-2 border-secondary-600 hover:border-secondary-700 hover:bg-secondary-50 text-secondary-600 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">
Size: md
</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="#">
<span class="flex-1">Action One</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="#">
<span class="flex-1">Action Two</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="#">
<span class="flex-1">Action Three</span>
</a>
</div>
</div>
</div>
<div>
<p class="text-sm text-grayscale-500 mb-2">lg</p>
<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-secondary-500 bg-transparent border-2 border-secondary-600 hover:border-secondary-700 hover:bg-secondary-50 text-secondary-600 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">
Size: lg
</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-72 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="#">
<span class="flex-1">Action One</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="#">
<span class="flex-1">Action Two</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="#">
<span class="flex-1">Action Three</span>
</a>
</div>
</div>
</div>
</div>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<div class="p-8">
<h3 class="text-lg font-semibold mb-4">Size Variants</h3>
<div class="flex gap-8 items-start">
<% [:sm, :md, :lg].each do |size| %>
<div>
<p class="text-sm text-grayscale-500 mb-2"><%= size %></p>
<%= render BetterUi::Dropdown::DropdownComponent.new(size: size) do |d| %>
<% d.with_trigger do %>
<%= render(BetterUi::ButtonComponent.new(variant: :secondary, style: :outline)) do %>Size: <%= size %><% end %>
<% end %>
<% d.with_item(href: "#") { "Action One" } %>
<% d.with_item(href: "#") { "Action Two" } %>
<% d.with_item(href: "#") { "Action Three" } %>
<% end %>
</div>
<% end %>
</div>
</div>