Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/ruby_ui/command/command_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ def input_container(&)

def default_attrs
{
class: "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
class: [
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none",
"placeholder:text-muted-foreground",
"disabled:cursor-not-allowed disabled:opacity-50",
"aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none"
],
placeholder: @placeholder,
data_action: "input->ruby-ui--command#filter keydown.down->ruby-ui--command#handleKeydown keydown.up->ruby-ui--command#handleKeydown keydown.enter->ruby-ui--command#handleKeydown keydown.esc->ruby-ui--command#dismiss",
data_ruby_ui__command_target: "input",
Expand Down
9 changes: 8 additions & 1 deletion lib/ruby_ui/command/command_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ def view_template(&)

def default_attrs
{
class: "relative flex cursor-pointer select-none items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
class: [
"relative flex cursor-pointer select-none items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-none",
"hover:bg-accent hover:text-accent-foreground",
"disabled:pointer-events-none disabled:opacity-50",
"aria-selected:bg-accent aria-selected:text-accent-foreground",
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
"aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:pointer-events-none"
],
href: @href,
role: "option",
data: {
Expand Down