-
Notifications
You must be signed in to change notification settings - Fork 4.6k
[fix/feat:ui] Move menu checks to the right #3233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,32 +147,42 @@ function MenuRadioGroup(props: MenuPrimitive.RadioGroup.Props) { | |
| return <MenuPrimitive.RadioGroup data-slot="menu-radio-group" {...props} />; | ||
| } | ||
|
|
||
| function MenuRadioItem({ className, children, ...props }: MenuPrimitive.RadioItem.Props) { | ||
| function MenuRadioItem({ | ||
| className, | ||
| children, | ||
| hideIndicator = false, | ||
| ...props | ||
| }: MenuPrimitive.RadioItem.Props & { | ||
| hideIndicator?: boolean; | ||
| }) { | ||
| return ( | ||
| <MenuPrimitive.RadioItem | ||
| className={cn( | ||
| "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base text-foreground outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", | ||
| "grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default items-center gap-2 rounded-sm py-1 text-base text-foreground outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", | ||
| hideIndicator ? "grid-cols-[1fr] ps-3 pe-3" : "grid-cols-[1rem_1fr] ps-2 pe-4", | ||
| className, | ||
| )} | ||
| data-slot="menu-radio-item" | ||
| {...props} | ||
| > | ||
| <MenuPrimitive.RadioItemIndicator className="col-start-1"> | ||
| <svg | ||
| fill="none" | ||
| height="24" | ||
| stroke="currentColor" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| strokeWidth="2" | ||
| viewBox="0 0 24 24" | ||
| width="24" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| > | ||
| <path d="M5.252 12.7 10.2 18.63 18.748 5.37" /> | ||
| </svg> | ||
| </MenuPrimitive.RadioItemIndicator> | ||
| <span className="col-start-2">{children}</span> | ||
| {hideIndicator ? null : ( | ||
| <MenuPrimitive.RadioItemIndicator className="col-start-1"> | ||
| <svg | ||
| fill="none" | ||
| height="24" | ||
| stroke="currentColor" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| strokeWidth="2" | ||
| viewBox="0 0 24 24" | ||
| width="24" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| > | ||
| <path d="M5.252 12.7 10.2 18.63 18.748 5.37" /> | ||
| </svg> | ||
| </MenuPrimitive.RadioItemIndicator> | ||
| )} | ||
| <span className={hideIndicator ? "col-start-1" : "col-start-2"}>{children}</span> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Label truncation may not applyLow Severity
Additional Locations (1)Reviewed by Cursor Bugbot for commit 4bbdcf7. Configure here. |
||
| </MenuPrimitive.RadioItem> | ||
| ); | ||
| } | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Muted runtime mode checkmark
Low Severity
The new right-side
CheckIconsits insideSelectItem’sItemText, which forces SVGs without atext-*class totext-muted-foreground. The old left indicator sat outsideItemTextand kept normal foreground contrast, so the selected-state check now matches decorative icons instead of a selection affordance.Reviewed by Cursor Bugbot for commit 4bbdcf7. Configure here.