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
11 changes: 10 additions & 1 deletion packages/boxel-ui/addon/src/components/button/index.gts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,12 @@ const ButtonComponent: TemplateOnlyComponent<Signature> = <template>
transparent
);
}
/* Keyboard focus ring sits just outside the button. Set the full
outline shorthand (not just the color) so the ring renders
regardless of the UA's default outline-style. */
.boxel-button:focus-visible {
outline-color: var(--ring, var(--boxel-highlight));
outline: var(--boxel-outline-width) var(--boxel-outline-style)
var(--ring, var(--boxel-highlight));
outline-offset: 2px;
}

Expand Down Expand Up @@ -250,6 +254,11 @@ const ButtonComponent: TemplateOnlyComponent<Signature> = <template>
.kind-primary:not(:disabled):active {
--boxel-button-color: var(--primary, var(--boxel-highlight-hover));
}
/* When the fill darkens, the focus ring darkens to match. */
.kind-primary:not(:disabled):focus-visible:hover,
.kind-primary:not(:disabled):focus-visible:active {
outline-color: var(--ring, var(--boxel-highlight-hover));
}

.kind-secondary {
--boxel-button-color: var(--secondary, var(--boxel-light));
Expand Down
24 changes: 15 additions & 9 deletions packages/boxel-ui/addon/src/components/selection-menu/index.gts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Component from '@glimmer/component';

import type { MenuDivider } from '../../helpers/menu-divider.ts';
import type { MenuItem } from '../../helpers/menu-item.ts';
import { DropdownArrowDown } from '../../icons.gts';
import CaretDown from '../../icons/caret-down.gts';
import BoxelButton from '../button/index.gts';
import BoxelDropdown from '../dropdown/index.gts';
import Menu from '../menu/index.gts';
Expand Down Expand Up @@ -66,7 +66,7 @@ export default class SelectionMenu extends Component<Signature> {
>
<SelectionCheckmark class='selection-menu-icon' />
<span class='selection-menu-count'>{{@selectedCount}}</span>
<DropdownArrowDown
<CaretDown
class='selection-menu-caret'
width='13px'
height='13px'
Expand Down Expand Up @@ -102,17 +102,17 @@ export default class SelectionMenu extends Component<Signature> {
--boxel-button-padding: var(--boxel-sp-5xs) var(--boxel-sp-xs);
--boxel-button-min-width: 0;
}
/* Keyboard focus ring just outside the button. (Set explicitly so it
renders regardless of the global button outline setup.) */
.selection-menu-trigger:focus-visible {
outline: var(--boxel-outline-width) var(--boxel-outline-style)
var(--boxel-highlight);
outline-offset: 2px;
}
/* Focus ring comes from BoxelButton's standard :focus-visible (full
outline, 2px outside). */
/* Deepen the fill while the menu is open, matching Button's hover. */
.selection-menu-trigger[aria-expanded='true'] {
--boxel-button-color: var(--boxel-highlight-hover);
}
/* When open-and-keyboard-focused, darken the ring to match the fill,
mirroring Button's hover/active focus behavior. */
.selection-menu-trigger[aria-expanded='true']:focus-visible {
outline-color: var(--ring, var(--boxel-highlight-hover));
}
.selection-menu-icon {
width: 0.875rem;
height: 0.875rem;
Expand All @@ -121,6 +121,12 @@ export default class SelectionMenu extends Component<Signature> {
.selection-menu-count {
line-height: 1;
white-space: nowrap;
/* Reserve a stable width (and equal-width digits) so the trigger
doesn't shift when the count crosses 1↔2 digits, e.g. during a
Select All that jumps 9→10. */
min-width: 2ch;
text-align: center;
font-variant-numeric: tabular-nums;
}
.selection-menu-caret {
flex-shrink: 0;
Expand Down
13 changes: 10 additions & 3 deletions packages/boxel-ui/addon/src/components/sort-dropdown/index.gts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Component from '@glimmer/component';

import { MenuDivider } from '../../helpers/menu-divider.ts';
import { MenuItem } from '../../helpers/menu-item.ts';
import DropdownIcon from '../../icons/dropdown-arrow-down.gts';
import CaretDown from '../../icons/caret-down.gts';
import BoxelButton from '../button/index.gts';
import BoxelDropdown from '../dropdown/index.gts';
import BoxelMenu from '../menu/index.gts';
Expand Down Expand Up @@ -34,7 +34,7 @@ export default class SortDropdown extends Component<Signature> {
{{bindings}}
>
{{if @selectedOption @selectedOption.displayName 'Please Select'}}
<DropdownIcon width='12px' height='12px' />
<CaretDown class='sort-button-caret' width='12px' height='12px' />
</BoxelButton>
</:trigger>
<:content as |dd|>
Expand Down Expand Up @@ -65,8 +65,15 @@ export default class SortDropdown extends Component<Signature> {
padding-left: var(--boxel-sp-sm);
padding-right: var(--boxel-sp-sm);
}
.sort-button > svg {
.sort-button-caret {
margin-left: auto;
transition: transform var(--boxel-transition);
}
/* Flip the caret while the menu is open, matching boxel-ui's
select/dropdown triggers. BoxelDropdown sets aria-expanded on the
trigger button via the yielded bindings. */
.sort-button[aria-expanded='true'] .sort-button-caret {
transform: rotate(180deg);
}
}
</style>
Expand Down
Loading