Skip to content

Commit

Permalink
Merge pull request #396 from bcgov/395-tag---implement-new-selectfocu…
Browse files Browse the repository at this point in the history
…s-state

Update tag focus and select states to new design
  • Loading branch information
mkernohanbc authored Jul 17, 2024
2 parents a3ff5a6 + 18cf561 commit 406341a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
27 changes: 12 additions & 15 deletions packages/react-components/src/components/Tag/Tag.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
cursor: pointer;
border-radius: var(--layout-margin-hair);
border: 1px solid;
box-sizing: content-box;
font: var(--typography-regular-label);
padding: 2px 8px;
width: fit-content;
}
.bcds-react-aria-Tag--contents {
display: flex;
align-items: center;
gap: 8px;
font: var(--typography-regular-label);
padding: 2px 8px;
width: fit-content;
}
.bcds-react-aria-Tag--contents .react-aria-Button {
.bcds-react-aria-Tag .react-aria-Button {
background: none;
border: none;
color: var(--typography-color-primary);
Expand All @@ -29,9 +26,7 @@
border-color: var(--theme-blue-90);
color: var(--typography-color-primary-invert);
}
.bcds-react-aria-Tag.bc-blue
.bcds-react-aria-Tag--contents
> .react-aria-Button {
.bcds-react-aria-Tag.bc-blue .react-aria-Button {
color: var(--typography-color-primary-invert);
}
.bcds-react-aria-Tag.bc-gold {
Expand All @@ -47,7 +42,7 @@
border-color: var(--theme-blue-90);
color: var(--typography-color-primary-invert);
}
.bcds-react-aria-Tag.dark .bcds-react-aria-Tag--contents > .react-aria-Button {
.bcds-react-aria-Tag.dark .react-aria-Button {
color: var(--typography-color-primary-invert);
}
.bcds-react-aria-Tag.gray,
Expand All @@ -70,14 +65,16 @@

/* Selected */
.bcds-react-aria-Tag[data-selected] {
border: 2px solid var(--surface-color-border-active);
padding: 1px 7px;
border-radius: var(--layout-border-radius-small);
border: var(--layout-border-width-medium) solid
var(--surface-color-border-active);
}

/* Focused */
.bcds-react-aria-Tag[data-focused] {
outline: 2px solid var(--surface-color-border-active);
outline-offset: 0;
outline: var(--layout-border-width-medium) solid
var(--surface-color-border-active);
outline-offset: var(--layout-margin-hair);
}

/* Disabled */
Expand Down
4 changes: 2 additions & 2 deletions packages/react-components/src/components/Tag/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function Tag({ color = "blue", icon, id, textValue }: TagProps) {
textValue={textValue}
>
{({ allowsRemoving, isDisabled }: TagRenderProps) => (
<div className="bcds-react-aria-Tag--contents">
<>
{icon}
{textValue}
{!isDisabled && allowsRemoving && (
Expand All @@ -57,7 +57,7 @@ export default function Tag({ color = "blue", icon, id, textValue }: TagProps) {
</svg>
</ReactAriaButton>
)}
</div>
</>
)}
</ReactAriaTag>
);
Expand Down

0 comments on commit 406341a

Please sign in to comment.