Skip to content

Commit

Permalink
feat: change padding and wrap select in label
Browse files Browse the repository at this point in the history
  • Loading branch information
timoheddes committed Aug 23, 2023
1 parent d573134 commit 5ef085b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
6 changes: 3 additions & 3 deletions packages/libs/react-ui/src/components/Select/Select.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { style } from '@vanilla-extract/css';

export const containerClass = style([
sprinkles({
padding: '$2',
borderRadius: '$sm',
}),
{
Expand Down Expand Up @@ -55,17 +54,18 @@ export const iconClass = style([
sprinkles({
marginRight: '$2',
marginLeft: '$2',
display: 'block',
display: 'flex',
alignItems: 'center',
}),
]);

export const selectClass = style([
sprinkles({
padding: '$2',
border: 'none',
fontSize: '$base',
}),
{
padding: '0',
backgroundColor: 'inherit',
color: 'inherit',
flex: '1',
Expand Down
34 changes: 18 additions & 16 deletions packages/libs/react-ui/src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,24 @@ export const Select: FC<ISelectProps> = forwardRef<
)}
data-testid="kda-select"
>
<div className={selectContainerClass}>
{Icon && (
<span className={iconClass}>
<Icon size="md" />
</span>
)}
<select
aria-label={ariaLabel}
ref={ref}
className={selectClass}
disabled={Boolean(disabled)}
{...rest}
>
{children}
</select>
</div>
<label>
<div className={selectContainerClass}>
{Icon && (
<span className={iconClass}>
<Icon size="md" />
</span>
)}
<select
aria-label={ariaLabel}
ref={ref}
className={selectClass}
disabled={Boolean(disabled)}
{...rest}
>
{children}
</select>
</div>
</label>
</div>
);
});

0 comments on commit 5ef085b

Please sign in to comment.