Skip to content

Commit fd76bf2

Browse files
pierry01claude
andauthored
feat(combobox): use single chevron-down icon in ComboboxTrigger (#475)
* feat(combobox): use single chevron-down icon in ComboboxTrigger Aligns ComboboxTrigger with the base shadcn Combobox, which uses a single chevron-down affordance. ComboboxInputTrigger already renders chevron-down; this makes the default trigger consistent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(mcp): rebuild registry.json for ComboboxTrigger chevron-down --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 945b2c0 commit fd76bf2

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

gem/lib/ruby_ui/combobox/combobox_trigger.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ def icon
5252
stroke_linejoin: "round"
5353
) do |s|
5454
s.path(
55-
d: "m7 15 5 5 5-5"
56-
)
57-
s.path(
58-
d: "m7 9 5-5 5 5"
55+
d: "m6 9 6 6 6-6"
5956
)
6057
end
6158
end

gem/test/ruby_ui/combobox_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ def test_combobox_badge_trigger_no_chevron
187187

188188
def test_combobox_trigger_chevron_down
189189
output = phlex { RubyUI.ComboboxTrigger(placeholder: "Pick") }
190-
assert_match(/m7 15 5 5 5-5/, output)
191-
assert_match(/m7 9 5-5 5 5/, output)
190+
assert_match(/m6 9 6 6 6-6/, output)
192191
end
193192

194193
def test_combobox_trigger_sets_placeholder_data

mcp/data/registry.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@
987987
},
988988
{
989989
"path": "combobox_trigger.rb",
990-
"content": "# frozen_string_literal: true\n\nmodule RubyUI\n class ComboboxTrigger < Base\n def initialize(placeholder: \"\", **)\n @placeholder = placeholder\n super(**)\n end\n\n def view_template\n button(**attrs) do\n span(class: \"truncate\", data: {ruby_ui__combobox_target: \"triggerContent\"}) do\n @placeholder\n end\n icon\n end\n end\n\n private\n\n def default_attrs\n {\n type: \"button\",\n class: [\n \"flex h-full w-full items-center whitespace-nowrap rounded-md text-sm ring-offset-background transition-colors border border-input bg-background h-9 px-4 py-2 justify-between\",\n \"hover:bg-accent hover:text-accent-foreground\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n \"aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:cursor-not-allowed\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n ],\n data: {\n placeholder: @placeholder,\n ruby_ui__combobox_target: \"trigger\",\n action: \"ruby-ui--combobox#togglePopover\"\n },\n aria: {\n haspopup: \"listbox\",\n expanded: \"false\"\n }\n }\n end\n\n def icon\n svg(\n xmlns: \"http://www.w3.org/2000/svg\",\n viewbox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n class: \"ml-2 h-4 w-4 shrink-0 opacity-50\",\n stroke_width: \"2\",\n stroke_linecap: \"round\",\n stroke_linejoin: \"round\"\n ) do |s|\n s.path(\n d: \"m7 15 5 5 5-5\"\n )\n s.path(\n d: \"m7 9 5-5 5 5\"\n )\n end\n end\n end\nend\n"
990+
"content": "# frozen_string_literal: true\n\nmodule RubyUI\n class ComboboxTrigger < Base\n def initialize(placeholder: \"\", **)\n @placeholder = placeholder\n super(**)\n end\n\n def view_template\n button(**attrs) do\n span(class: \"truncate\", data: {ruby_ui__combobox_target: \"triggerContent\"}) do\n @placeholder\n end\n icon\n end\n end\n\n private\n\n def default_attrs\n {\n type: \"button\",\n class: [\n \"flex h-full w-full items-center whitespace-nowrap rounded-md text-sm ring-offset-background transition-colors border border-input bg-background h-9 px-4 py-2 justify-between\",\n \"hover:bg-accent hover:text-accent-foreground\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n \"aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:cursor-not-allowed\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\"\n ],\n data: {\n placeholder: @placeholder,\n ruby_ui__combobox_target: \"trigger\",\n action: \"ruby-ui--combobox#togglePopover\"\n },\n aria: {\n haspopup: \"listbox\",\n expanded: \"false\"\n }\n }\n end\n\n def icon\n svg(\n xmlns: \"http://www.w3.org/2000/svg\",\n viewbox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n class: \"ml-2 h-4 w-4 shrink-0 opacity-50\",\n stroke_width: \"2\",\n stroke_linecap: \"round\",\n stroke_linejoin: \"round\"\n ) do |s|\n s.path(\n d: \"m6 9 6 6 6-6\"\n )\n end\n end\n end\nend\n"
991991
}
992992
],
993993
"dependencies": {

0 commit comments

Comments
 (0)