basecoat 2.3.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/basecoat/form_helper.rb +29 -17
- data/lib/basecoat/version.rb +1 -1
- data/lib/generators/basecoat/templates/devise/registrations/edit.html.erb +2 -2
- data/lib/generators/basecoat/templates/devise/shared/_error_messages.html.erb +1 -1
- data/lib/generators/basecoat/templates/devise/shared/_links.html.erb +6 -6
- data/lib/generators/basecoat/templates/devise.html.erb +1 -1
- data/lib/generators/basecoat/templates/layouts/_alert.html.erb +1 -1
- data/lib/generators/basecoat/templates/layouts/_aside.html.erb +2 -2
- data/lib/generators/basecoat/templates/layouts/_form_errors.html.erb +1 -1
- data/lib/generators/basecoat/templates/layouts/_head.html.erb +3 -12
- data/lib/generators/basecoat/templates/layouts/_header.html.erb +1 -1
- data/lib/generators/basecoat/templates/layouts/_theme_toggle.html.erb +1 -1
- data/lib/generators/basecoat/templates/search_controller.js +3 -0
- data/lib/generators/basecoat/templates/sessions.html.erb +1 -1
- data/lib/tasks/basecoat.rake +38 -6
- data/lib/templates/erb/scaffold/_form.html.erb.tt +1 -1
- data/lib/templates/erb/scaffold/edit.html.erb.tt +2 -2
- data/lib/templates/erb/scaffold/index.html.erb.tt +1 -1
- data/lib/templates/erb/scaffold/new.html.erb.tt +1 -1
- data/lib/templates/erb/scaffold/show.html.erb.tt +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a0c11b58abe60ce841b3ac9f3cf43c791ac1e48cf4737a5770a0659866291ae
|
|
4
|
+
data.tar.gz: 931161305163f8f87222a2d67b120f05dfbb8ef43378811985547f54c9a628ed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f051fc0aa838857ed26b36cf56bc47099fb387e6446bacf4430220b91593569d99c888fc2898660b026e492dd8e72bddd1eac9bacf1f4cb1bb7d070221d9ab1e
|
|
7
|
+
data.tar.gz: 9e8003734f72af73e90ade1a43deeffea0991125b0d95aad63ffb8ff2b4361c5192a9cfd50a4ac4d872f9d091a7e713423f752b3fbcd4e15b15fc8948355230d
|
data/lib/basecoat/form_helper.rb
CHANGED
|
@@ -84,11 +84,12 @@ module Basecoat
|
|
|
84
84
|
scrollable = options[:scrollable] || false
|
|
85
85
|
turbo_frame = options[:turbo_frame] || (url ? url.gsub("/", "_") : nil)
|
|
86
86
|
|
|
87
|
-
select_attrs = { id: select_id, class: "
|
|
87
|
+
select_attrs = { id: select_id, class: "combobox" }
|
|
88
88
|
if url
|
|
89
89
|
select_attrs[:data] = {
|
|
90
90
|
controller: "search",
|
|
91
|
-
search_url_value: url
|
|
91
|
+
search_url_value: url,
|
|
92
|
+
filter: "manual" # filtering happens server-side, tell basecoat not to filter
|
|
92
93
|
}
|
|
93
94
|
end
|
|
94
95
|
|
|
@@ -168,7 +169,7 @@ module Basecoat
|
|
|
168
169
|
basecoat_select_tag(name, choices, options)
|
|
169
170
|
|
|
170
171
|
rescue LoadError
|
|
171
|
-
content_tag :div, class: "alert-destructive" do
|
|
172
|
+
content_tag :div, class: "alert", "data-variant": "destructive" do
|
|
172
173
|
lucide_icon("circle-alert") + tag.section("gem 'countries' required")
|
|
173
174
|
end
|
|
174
175
|
end
|
|
@@ -176,23 +177,40 @@ module Basecoat
|
|
|
176
177
|
private
|
|
177
178
|
|
|
178
179
|
def basecoat_select_button(select_id, selected_label)
|
|
179
|
-
content_tag(:button, type: "button", class: "btn
|
|
180
|
-
content_tag(:span, selected_label, class: "truncate") +
|
|
180
|
+
content_tag(:button, type: "button", class: "btn justify-between font-normal w-[180px]", "data-variant": "outline", id: "#{select_id}-trigger", "aria-haspopup": "listbox", "aria-expanded": "false", "aria-controls": "#{select_id}-listbox") do
|
|
181
|
+
content_tag(:span, selected_label, class: "truncate", "data-value": "") +
|
|
181
182
|
lucide_icon("chevrons-up-down", class: "text-muted-foreground opacity-50 shrink-0").html_safe
|
|
182
183
|
end
|
|
183
184
|
end
|
|
184
185
|
|
|
185
186
|
def basecoat_select_popover(select_id, choices, group_label, placeholder, selected_value, url, scrollable, turbo_frame)
|
|
186
187
|
content_tag(:div, id: "#{select_id}-popover", data: { popover: true }, "aria-hidden": "true") do
|
|
187
|
-
|
|
188
|
+
basecoat_select_search_input(select_id, placeholder, url) +
|
|
188
189
|
basecoat_select_listbox(select_id, choices, group_label, selected_value, url, scrollable, turbo_frame)
|
|
189
190
|
end
|
|
190
191
|
end
|
|
191
192
|
|
|
192
|
-
def
|
|
193
|
-
|
|
193
|
+
def basecoat_select_search_input(select_id, placeholder, url)
|
|
194
|
+
input_attrs = {
|
|
195
|
+
type: "text",
|
|
196
|
+
value: "",
|
|
197
|
+
placeholder: placeholder,
|
|
198
|
+
autocomplete: "off",
|
|
199
|
+
autocorrect: "off",
|
|
200
|
+
spellcheck: "false",
|
|
201
|
+
"aria-autocomplete": "list",
|
|
202
|
+
role: "combobox",
|
|
203
|
+
"aria-expanded": "false",
|
|
204
|
+
"aria-controls": "#{select_id}-listbox",
|
|
205
|
+
"aria-labelledby": "#{select_id}-trigger"
|
|
206
|
+
}
|
|
207
|
+
# Local filtering is handled by basecoat itself; remote search goes
|
|
208
|
+
# through the Stimulus search controller and Turbo Streams.
|
|
209
|
+
input_attrs[:data] = { search_target: "input", action: "input->search#search" } if url
|
|
210
|
+
|
|
211
|
+
content_tag(:div, class: "input-group") do
|
|
194
212
|
lucide_icon("search").html_safe +
|
|
195
|
-
tag(:input,
|
|
213
|
+
tag(:input, **input_attrs)
|
|
196
214
|
end
|
|
197
215
|
end
|
|
198
216
|
|
|
@@ -201,18 +219,12 @@ module Basecoat
|
|
|
201
219
|
role: "listbox",
|
|
202
220
|
id: "#{select_id}-listbox",
|
|
203
221
|
"aria-orientation": "vertical",
|
|
204
|
-
"aria-labelledby": "#{select_id}-trigger"
|
|
222
|
+
"aria-labelledby": "#{select_id}-trigger",
|
|
223
|
+
data: { empty: "No results found." }
|
|
205
224
|
}
|
|
206
225
|
|
|
207
226
|
listbox_attrs[:class] = "scrollbar overflow-y-auto max-h-64" if scrollable
|
|
208
227
|
|
|
209
|
-
if url
|
|
210
|
-
listbox_attrs[:data] = {
|
|
211
|
-
controller: "search",
|
|
212
|
-
search_url_value: url
|
|
213
|
-
}
|
|
214
|
-
end
|
|
215
|
-
|
|
216
228
|
content_tag(:div, listbox_attrs) do
|
|
217
229
|
if url
|
|
218
230
|
turbo_frame_tag(turbo_frame)
|
data/lib/basecoat/version.rb
CHANGED
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
<p>Unhappy? You can delete your account below.</p>
|
|
53
53
|
</header>
|
|
54
54
|
<footer>
|
|
55
|
-
<%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete, class: "btn
|
|
55
|
+
<%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?", variant: "outline" }, method: :delete, class: "btn" %>
|
|
56
56
|
</footer>
|
|
57
57
|
</div>
|
|
58
58
|
|
|
59
59
|
<div class="mt-6">
|
|
60
|
-
<%= link_to "Back", :back, class: "btn
|
|
60
|
+
<%= link_to "Back", :back, class: "btn", data: { variant: "ghost" } %>
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<% if resource.errors.any? %>
|
|
2
|
-
<div class="alert
|
|
2
|
+
<div class="alert max-w-2xl mx-auto" data-variant="destructive" data-turbo-cache="false">
|
|
3
3
|
<%= lucide_icon "circle-x", class: "w-5 h-5" %>
|
|
4
4
|
<h2><%= pluralize(resource.errors.count, "error") %> prohibited this <%= resource.class.model_name.human.downcase %> from being saved</h2>
|
|
5
5
|
<section>
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
<div class="flex flex-col gap-2 text-sm">
|
|
2
2
|
<%- if controller_name != 'sessions' %>
|
|
3
|
-
<%= link_to "Log in", new_session_path(resource_name), class: "btn
|
|
3
|
+
<%= link_to "Log in", new_session_path(resource_name), class: "btn", data: { variant: "ghost" } %>
|
|
4
4
|
<% end %>
|
|
5
5
|
|
|
6
6
|
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
|
7
|
-
<%= link_to "Sign up", new_registration_path(resource_name), class: "btn
|
|
7
|
+
<%= link_to "Sign up", new_registration_path(resource_name), class: "btn", data: { variant: "ghost" } %>
|
|
8
8
|
<% end %>
|
|
9
9
|
|
|
10
10
|
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
|
11
|
-
<%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn
|
|
11
|
+
<%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn", data: { variant: "ghost" } %>
|
|
12
12
|
<% end %>
|
|
13
13
|
|
|
14
14
|
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
|
15
|
-
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: "btn
|
|
15
|
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: "btn", data: { variant: "ghost" } %>
|
|
16
16
|
<% end %>
|
|
17
17
|
|
|
18
18
|
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
|
19
|
-
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: "btn
|
|
19
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: "btn", data: { variant: "ghost" } %>
|
|
20
20
|
<% end %>
|
|
21
21
|
|
|
22
22
|
<%- if devise_mapping.omniauthable? %>
|
|
23
23
|
<%- resource_class.omniauth_providers.each do |provider| %>
|
|
24
|
-
<%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false }, class: "btn
|
|
24
|
+
<%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false, variant: "outline" }, class: "btn" %>
|
|
25
25
|
<% end %>
|
|
26
26
|
<% end %>
|
|
27
27
|
</div>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<aside class="sidebar" data-side="left" aria-hidden="false">
|
|
2
2
|
<nav aria-label="Sidebar navigation">
|
|
3
3
|
<header>
|
|
4
|
-
<a href="/" class="btn
|
|
4
|
+
<a href="/" class="btn p-2 h-12 w-full justify-start" data-variant="ghost" aria-current="page">
|
|
5
5
|
<div class="bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg">
|
|
6
6
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" class="h-4 w-4"><rect width="256" height="256" fill="none"></rect><line x1="208" y1="128" x2="128" y2="208" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></line><line x1="192" y1="40" x2="40" y2="192" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></line></svg>
|
|
7
7
|
</div>
|
|
8
8
|
<div class="grid flex-1 text-left text-sm leading-tight">
|
|
9
9
|
<span class="truncate font-medium">Basecoat</span>
|
|
10
|
-
<span class="truncate text-xs">
|
|
10
|
+
<span class="truncate text-xs">v1.0.2</span>
|
|
11
11
|
</div>
|
|
12
12
|
</a>
|
|
13
13
|
</header>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="alert
|
|
1
|
+
<div class="alert max-w-2xl mx-auto" data-variant="destructive">
|
|
2
2
|
<%= lucide_icon "circle-x", class: "w-5 h-5" %>
|
|
3
3
|
<h2><%= pluralize(object.errors.count, "error") %> prohibited this object from being saved</h2>
|
|
4
4
|
<section>
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
|
|
20
20
|
<%= javascript_importmap_tags %>
|
|
21
21
|
<script>
|
|
22
|
+
// Apply the stored theme before first paint to prevent flickering.
|
|
23
|
+
// Toggling is handled by basecoat (window.basecoat.theme), which
|
|
24
|
+
// reads and writes the same 'themeMode' localStorage key.
|
|
22
25
|
(() => {
|
|
23
26
|
try {
|
|
24
27
|
const stored = localStorage.getItem('themeMode');
|
|
@@ -27,18 +30,6 @@
|
|
|
27
30
|
document.documentElement.classList.add('dark');
|
|
28
31
|
}
|
|
29
32
|
} catch (_) {}
|
|
30
|
-
|
|
31
|
-
const apply = dark => {
|
|
32
|
-
document.documentElement.classList.toggle('dark', dark);
|
|
33
|
-
try { localStorage.setItem('themeMode', dark ? 'dark' : 'light'); } catch (_) {}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
document.addEventListener('basecoat:theme', (event) => {
|
|
37
|
-
const mode = event.detail?.mode;
|
|
38
|
-
apply(mode === 'dark' ? true
|
|
39
|
-
: mode === 'light' ? false
|
|
40
|
-
: !document.documentElement.classList.contains('dark'));
|
|
41
|
-
});
|
|
42
33
|
})();
|
|
43
34
|
</script>
|
|
44
35
|
</head>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<header class="bg-background sticky inset-x-0 top-0 isolate flex shrink-0 items-center gap-2 border-b z-10 px-4">
|
|
2
2
|
<div class="flex h-14 flex-1 items-center gap-2">
|
|
3
|
-
<button type="button" onclick="document.
|
|
3
|
+
<button type="button" onclick="document.querySelector('.sidebar')?.toggle()" aria-label="Toggle sidebar" data-tooltip="Toggle sidebar" data-side="bottom" data-align="start" class="btn mr-auto size-7 -ml-1.5" data-variant="ghost" data-size="icon-sm">
|
|
4
4
|
<%= lucide_icon "panel-left" %>
|
|
5
5
|
</button>
|
|
6
6
|
<%= render "layouts/theme_toggle" %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<button type="button" aria-label="Toggle dark mode" data-tooltip="Toggle dark mode" data-side="left" onclick="
|
|
1
|
+
<button type="button" aria-label="Toggle dark mode" data-tooltip="Toggle dark mode" data-side="left" onclick="window.basecoat.theme.toggle()" class="btn size-8" data-variant="ghost" data-size="icon">
|
|
2
2
|
<span class="hidden dark:block"><%= lucide_icon "sun" %></span>
|
|
3
3
|
<span class="block dark:hidden"><%= lucide_icon "moon" %></span>
|
|
4
4
|
</button>
|
|
@@ -17,5 +17,8 @@ export default class extends Controller {
|
|
|
17
17
|
})
|
|
18
18
|
.then(response => response.text())
|
|
19
19
|
.then(html => Turbo.renderStreamMessage(html))
|
|
20
|
+
// Basecoat comboboxes cache their options on init, so they need a
|
|
21
|
+
// refresh after Turbo has rendered the new options into the listbox.
|
|
22
|
+
.then(() => this.element.refresh?.())
|
|
20
23
|
}
|
|
21
24
|
}
|
data/lib/tasks/basecoat.rake
CHANGED
|
@@ -51,7 +51,7 @@ namespace :basecoat do
|
|
|
51
51
|
|
|
52
52
|
unless importmap_content.include?("basecoat-css")
|
|
53
53
|
File.open(importmap_path, "a") do |f|
|
|
54
|
-
f.puts "\npin \"basecoat-css/all\", to: \"https://cdn.jsdelivr.net/npm/basecoat-css@0.
|
|
54
|
+
f.puts "\npin \"basecoat-css/all\", to: \"https://cdn.jsdelivr.net/npm/basecoat-css@1.0.2/dist/js/all.js\""
|
|
55
55
|
end
|
|
56
56
|
puts " Added: basecoat-css to config/importmap.rb"
|
|
57
57
|
end
|
|
@@ -192,6 +192,38 @@ namespace :basecoat do
|
|
|
192
192
|
end
|
|
193
193
|
end
|
|
194
194
|
|
|
195
|
+
# Make sure the theme bootstrap script is present in _head.html.erb.
|
|
196
|
+
# Basecoat only writes the themeMode localStorage key; applying it on
|
|
197
|
+
# page load is the app's job. Without this script the theme reverts to
|
|
198
|
+
# light on every refresh (and dark mode flickers). This matters when
|
|
199
|
+
# the head was extracted from an existing layout instead of copied
|
|
200
|
+
# from the gem's template.
|
|
201
|
+
head_destination = partials_destination.join("_head.html.erb")
|
|
202
|
+
if File.exist?(head_destination)
|
|
203
|
+
head_content = File.read(head_destination)
|
|
204
|
+
unless head_content.include?("themeMode")
|
|
205
|
+
theme_script = <<~HTML.gsub(/^/, " ")
|
|
206
|
+
<script>
|
|
207
|
+
// Apply the stored theme before first paint to prevent flickering.
|
|
208
|
+
// Toggling is handled by basecoat (window.basecoat.theme), which
|
|
209
|
+
// reads and writes the same 'themeMode' localStorage key.
|
|
210
|
+
(() => {
|
|
211
|
+
try {
|
|
212
|
+
const stored = localStorage.getItem('themeMode');
|
|
213
|
+
if (stored ? stored === 'dark'
|
|
214
|
+
: matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
215
|
+
document.documentElement.classList.add('dark');
|
|
216
|
+
}
|
|
217
|
+
} catch (_) {}
|
|
218
|
+
})();
|
|
219
|
+
</script>
|
|
220
|
+
HTML
|
|
221
|
+
updated_content = head_content.sub(/(<\/head>)/, "#{theme_script}\\1")
|
|
222
|
+
File.write(head_destination, updated_content)
|
|
223
|
+
puts " Added: theme bootstrap script to app/views/layouts/_head.html.erb"
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
|
|
195
227
|
# Copy application layout
|
|
196
228
|
layout_source = File.expand_path("../generators/basecoat/templates/application.html.erb", __dir__)
|
|
197
229
|
if prompt_overwrite(layout_destination, overwrite_all)
|
|
@@ -236,7 +268,7 @@ namespace :basecoat do
|
|
|
236
268
|
head_content = File.read(head_path)
|
|
237
269
|
unless head_content.include?("basecoat.cdn.min.css")
|
|
238
270
|
cdn_link = ' <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
|
239
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/basecoat-css@0.
|
|
271
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/basecoat-css@1.0.2/dist/basecoat.cdn.min.css">'
|
|
240
272
|
# Insert before the closing </head> tag
|
|
241
273
|
updated_content = head_content.sub(/(<\/head>)/, "#{cdn_link}\n\\1")
|
|
242
274
|
File.write(head_path, updated_content)
|
|
@@ -306,13 +338,13 @@ namespace :basecoat do
|
|
|
306
338
|
|
|
307
339
|
<% if defined?(user_signed_in?) && user_signed_in? %>
|
|
308
340
|
<div id="dropdown-user" class="dropdown-menu">
|
|
309
|
-
<button type="button" id="dropdown-user-trigger" aria-haspopup="menu" aria-controls="dropdown-user-menu" aria-expanded="false" class="btn
|
|
341
|
+
<button type="button" id="dropdown-user-trigger" aria-haspopup="menu" aria-controls="dropdown-user-menu" aria-expanded="false" class="btn size-8" data-variant="ghost" data-size="icon">
|
|
310
342
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-circle-user-icon lucide-circle-user"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="10" r="3"/><path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662"/></svg>
|
|
311
343
|
</button>
|
|
312
344
|
<div id="dropdown-user-popover" data-popover="" aria-hidden="true" data-align="end">
|
|
313
345
|
<div role="menu" id="dropdown-user-menu" aria-labelledby="dropdown-user-trigger">
|
|
314
346
|
<div class="px-1 py-1.5">
|
|
315
|
-
<%= button_to destroy_user_session_path, method: :delete, class: "btn
|
|
347
|
+
<%= button_to destroy_user_session_path, method: :delete, class: "btn", data: { variant: "link" } do %>
|
|
316
348
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>
|
|
317
349
|
Log out
|
|
318
350
|
<% end %>
|
|
@@ -447,13 +479,13 @@ namespace :basecoat do
|
|
|
447
479
|
|
|
448
480
|
<% if defined?(Current) && defined?(Current.user) && Current.user %>
|
|
449
481
|
<div id="dropdown-user" class="dropdown-menu">
|
|
450
|
-
<button type="button" id="dropdown-user-trigger" aria-haspopup="menu" aria-controls="dropdown-user-menu" aria-expanded="false" class="btn
|
|
482
|
+
<button type="button" id="dropdown-user-trigger" aria-haspopup="menu" aria-controls="dropdown-user-menu" aria-expanded="false" class="btn size-8" data-variant="ghost" data-size="icon">
|
|
451
483
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-circle-user-icon lucide-circle-user"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="10" r="3"/><path d="M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662"/></svg>
|
|
452
484
|
</button>
|
|
453
485
|
<div id="dropdown-user-popover" data-popover="" aria-hidden="true" data-align="end">
|
|
454
486
|
<div role="menu" id="dropdown-user-menu" aria-labelledby="dropdown-user-trigger">
|
|
455
487
|
<div class="px-1 py-1.5">
|
|
456
|
-
<%= button_to session_path, method: :delete, class: "btn
|
|
488
|
+
<%= button_to session_path, method: :delete, class: "btn", data: { variant: "link" } do %>
|
|
457
489
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>
|
|
458
490
|
Log out
|
|
459
491
|
<% end %>
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
<% end -%>
|
|
42
42
|
<div class="flex justify-end space-x-3 pt-6">
|
|
43
|
-
<%%= link_to "Cancel", <%= index_helper(type: :path) %>, class: "btn
|
|
43
|
+
<%%= link_to "Cancel", <%= index_helper(type: :path) %>, class: "btn", data: { variant: "outline" } %>
|
|
44
44
|
<%%= form.submit class: "btn" %>
|
|
45
45
|
</div>
|
|
46
46
|
<%% end %>
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
14
|
<div class="flex flex-wrap gap-3 mt-6">
|
|
15
|
-
<%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, class: "btn
|
|
16
|
-
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn
|
|
15
|
+
<%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, class: "btn", data: { variant: "outline", turbo_action: "advance" } %>
|
|
16
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn", data: { variant: "outline", turbo_action: "advance" } %>
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
19
|
<%% end %>
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
</td>
|
|
37
37
|
<% end -%>
|
|
38
38
|
<td class="bg-background sticky right-0">
|
|
39
|
-
<%%= link_to "Show", <%= model_resource_name(singular_table_name) %>, class: "btn
|
|
39
|
+
<%%= link_to "Show", <%= model_resource_name(singular_table_name) %>, class: "btn", data: { variant: "outline", turbo_action: "advance" } %>
|
|
40
40
|
</td>
|
|
41
41
|
</tr>
|
|
42
42
|
<%% end %>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
14
|
<div class="mt-6">
|
|
15
|
-
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn
|
|
15
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn", data: { variant: "outline", turbo_action: "advance" } %>
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
18
|
<%% end %>
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
|
|
29
29
|
<div class="flex flex-wrap gap-3 mt-6">
|
|
30
30
|
<%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "btn", data: { turbo_action: "advance" } %>
|
|
31
|
-
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn
|
|
31
|
+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "btn", data: { variant: "outline", turbo_action: "advance" } %>
|
|
32
32
|
<%%= button_to "Delete this <%= human_name.downcase %>",
|
|
33
33
|
<%= model_resource_name(prefix: "@") %>,
|
|
34
34
|
method: :delete,
|
|
35
|
-
class: "btn
|
|
36
|
-
data: { turbo_confirm: "Are you sure you want to delete this <%= human_name.downcase %>?", turbo_action: "advance" },
|
|
35
|
+
class: "btn",
|
|
36
|
+
data: { variant: "destructive", turbo_confirm: "Are you sure you want to delete this <%= human_name.downcase %>?", turbo_action: "advance" },
|
|
37
37
|
form_class: "inline-block" %>
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|