Skip to content

Commit

Permalink
fix(components): adjust ListBox styles (#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
Niznikr committed May 15, 2024
1 parent e09bb72 commit 13a75c9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/metal-cougars-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@launchpad-ui/components": patch
---

Adjust `ListBox` styles
6 changes: 5 additions & 1 deletion packages/components/src/ListBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ const _ListBoxItem = <T extends object>(
{composeRenderProps(props.children, (children, { isSelected }) => (
<>
{children}
{isSelected && <Icon name="check" size="medium" className={styles.check} />}
{isSelected ? (
<Icon name="check" size="medium" className={styles.check} />
) : (
<div className={styles.icon} slot="check" />
)}
</>
))}
</AriaListBoxItem>
Expand Down
9 changes: 7 additions & 2 deletions packages/components/src/styles/ListBox.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

.item {
composes: item from './Menu.module.css';
justify-content: space-between;

&:has([slot='label']) {
&[data-selection-mode] {
grid-template-areas:
'label check'
'desc check';
grid-template-columns: max-content 1fr;
grid-template-columns: 1fr min-content;
}
}

Expand All @@ -26,5 +27,9 @@

.check {
grid-area: check;
margin-left: auto;
}

.icon {
height: var(--lp-size-20);
width: var(--lp-size-20);
}
2 changes: 1 addition & 1 deletion packages/components/src/styles/Select.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
color: var(--lp-color-text-field-placeholder);
}

& [slot='description'] {
& :is([slot='description'], [slot='check']) {
display: none;
}
}

0 comments on commit 13a75c9

Please sign in to comment.