Skip to content

Commit f379a08

Browse files
committed
[Bug Fix] cursor-pointer on Toast action/cancel/close buttons
1 parent 1ae58e1 commit f379a08

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

docs/app/javascript/controllers/ruby_ui/toaster_controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default class extends Controller {
101101
const btn = document.createElement("button")
102102
btn.type = "button"
103103
btn.dataset.slot = "action"
104-
btn.className = "inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-input bg-transparent px-3 text-sm font-medium hover:bg-secondary"
104+
btn.className = "inline-flex h-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-input bg-transparent px-3 text-sm font-medium hover:bg-secondary"
105105
btn.textContent = detail.action.label
106106
btn.addEventListener("click", (ev) => {
107107
try { detail.action.onClick?.(ev) } finally {
@@ -116,7 +116,7 @@ export default class extends Controller {
116116
btn.type = "button"
117117
btn.dataset.slot = "cancel"
118118
btn.dataset.action = "click->ruby-ui--toast#dismiss"
119-
btn.className = "inline-flex h-8 shrink-0 items-center justify-center rounded-md px-3 text-sm font-medium text-muted-foreground hover:bg-muted"
119+
btn.className = "inline-flex h-8 shrink-0 cursor-pointer items-center justify-center rounded-md px-3 text-sm font-medium text-muted-foreground hover:bg-muted"
120120
btn.textContent = detail.cancel.label
121121
node.appendChild(btn)
122122
}

gem/lib/ruby_ui/toast/toast_action.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def default_attrs
2020
{
2121
type: "button",
2222
data: data,
23-
class: "inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-input bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary hover:text-secondary-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
23+
class: "inline-flex h-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-input bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary hover:text-secondary-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
2424
}
2525
end
2626
end

gem/lib/ruby_ui/toast/toast_cancel.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def default_attrs
2020
slot: "cancel",
2121
action: "click->ruby-ui--toast#dismiss"
2222
},
23-
class: "inline-flex h-8 shrink-0 items-center justify-center rounded-md px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring"
23+
class: "inline-flex h-8 shrink-0 cursor-pointer items-center justify-center rounded-md px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring"
2424
}
2525
end
2626
end

gem/lib/ruby_ui/toast/toast_close.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def default_attrs
3333
slot: "close",
3434
action: "click->ruby-ui--toast#dismiss"
3535
},
36-
class: "absolute right-1 top-1 rounded-md p-1 text-foreground/60 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 focus:ring-ring group-hover/toast:opacity-100 group-data-[close-button=always]/toaster:opacity-100"
36+
class: "absolute right-1 top-1 cursor-pointer rounded-md p-1 text-foreground/60 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 focus:ring-ring group-hover/toast:opacity-100 group-data-[close-button=always]/toaster:opacity-100"
3737
}
3838
end
3939
end

gem/lib/ruby_ui/toast/toaster_controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default class extends Controller {
101101
const btn = document.createElement("button")
102102
btn.type = "button"
103103
btn.dataset.slot = "action"
104-
btn.className = "inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-input bg-transparent px-3 text-sm font-medium hover:bg-secondary"
104+
btn.className = "inline-flex h-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-input bg-transparent px-3 text-sm font-medium hover:bg-secondary"
105105
btn.textContent = detail.action.label
106106
btn.addEventListener("click", (ev) => {
107107
try { detail.action.onClick?.(ev) } finally {
@@ -116,7 +116,7 @@ export default class extends Controller {
116116
btn.type = "button"
117117
btn.dataset.slot = "cancel"
118118
btn.dataset.action = "click->ruby-ui--toast#dismiss"
119-
btn.className = "inline-flex h-8 shrink-0 items-center justify-center rounded-md px-3 text-sm font-medium text-muted-foreground hover:bg-muted"
119+
btn.className = "inline-flex h-8 shrink-0 cursor-pointer items-center justify-center rounded-md px-3 text-sm font-medium text-muted-foreground hover:bg-muted"
120120
btn.textContent = detail.cancel.label
121121
node.appendChild(btn)
122122
}

0 commit comments

Comments
 (0)