Skip to content

Commit

Permalink
Absolutely position checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Feb 23, 2022
1 parent af51657 commit aa6f347
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 30 deletions.
8 changes: 7 additions & 1 deletion src/listbox/ListBoxOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,15 @@ export function ListBoxOption<T>(props: OptionProps<T>) {
css={css`
display: flex;
justify-content: space-between;
align-items: center;
align-items: flex-start;
color: ${theme.textColors.white90};
padding: ${theme.spacing.padding8}px ${theme.spacing.padding16}px;
position: relative;
& > .ac-icon-wrap {
position: absolute;
top: ${theme.spacing.padding8}px;
right: ${theme.spacing.padding8}px;
}
`}
>
{contents}
Expand Down
67 changes: 38 additions & 29 deletions stories/Picker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const Gallery: Story<void> = () => {
<Provider>
<div
css={css`
.ac-dropdown + .ac-dropdown {
& > * + * {
margin-top: 16px;
}
`}
Expand All @@ -116,35 +116,44 @@ const Gallery: Story<void> = () => {
<Item key="sometimes">Sometimes</Item>
<Item key="always">Always</Item>
</Picker>
<Picker
selectedKey={frequency}
onSelectionChange={selected => setFrequency(selected as string)}
<div
css={css`
.ac-dropdown--picker,
.ac-dropdown--picker .ac-dropdown-button {
width: 250px;
}
`}
>
<Item key="rarely" textValue="Rarely">
<div css={itemWithDescriptionCSS}>
<Text>Rarely</Text>
<Text color="white70" textSize="small">
Only run on occasion
</Text>
</div>
</Item>
<Item key="sometimes" textValue="Sometimes">
<div css={itemWithDescriptionCSS}>
<Text>Sometimes</Text>
<Text color="white70" textSize="small">
Run once a day
</Text>
</div>
</Item>
<Item key="always" textValue="Always">
<div css={itemWithDescriptionCSS}>
<Text>Always</Text>
<Text color="white70" textSize="small">
Run continuously
</Text>
</div>
</Item>
</Picker>
<Picker
selectedKey={frequency}
onSelectionChange={selected => setFrequency(selected as string)}
>
<Item key="rarely" textValue="Rarely">
<div css={itemWithDescriptionCSS}>
<Text>Rarely</Text>
<Text color="white70" textSize="small">
Only run on occasion
</Text>
</div>
</Item>
<Item key="sometimes" textValue="Sometimes">
<div css={itemWithDescriptionCSS}>
<Text>Sometimes</Text>
<Text color="white70" textSize="small">
Run once a day so that things are synchronized on the daily
</Text>
</div>
</Item>
<Item key="always" textValue="Always">
<div css={itemWithDescriptionCSS}>
<Text>Always</Text>
<Text color="white70" textSize="small">
Run continuously so that everything stays up to date
</Text>
</div>
</Item>
</Picker>
</div>
</div>
</Provider>
);
Expand Down

0 comments on commit aa6f347

Please sign in to comment.