Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2649 from teamleadercrm/fix-clear-indicator-styles
Browse files Browse the repository at this point in the history
`Select` - Fix clear indicator styles
  • Loading branch information
BeirlaenAaron authored May 11, 2023
2 parents cbc3dca + e174ee8 commit 71327b3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 22 deletions.
18 changes: 14 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

### Added

- `IconMenu`: Added a `title` prop and pass it to the IconButton ([@driesd](https://https://github.com/driesd) in [#2648](https://github.com/teamleadercrm/ui/pull/2648))

### Changed

- `IconMenu`: Spread all other props instead of only spreading the box props ([@driesd](https://https://github.com/driesd) in [#2648](https://github.com/teamleadercrm/ui/pull/2648))

### Deprecated

### Removed
Expand All @@ -16,6 +12,20 @@

### Dependency updates

## [21.2.0] - 2023-05-11

### Added

- `IconMenu`: Added a `title` prop and pass it to the IconButton ([@driesd](https://https://github.com/driesd) in [#2648](https://github.com/teamleadercrm/ui/pull/2648))

### Changed

- `IconMenu`: Spread all other props instead of only spreading the box props ([@driesd](https://https://github.com/driesd) in [#2648](https://github.com/teamleadercrm/ui/pull/2648))

### Fixed

- `Select`: Fixed clear indicator styles ([@BeirlaenAaron](https://https://github.com/BeirlaenAaron) in [#2649](https://github.com/teamleadercrm/ui/pull/2649))

## [21.1.0] - 2023-05-08

### Changed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@teamleader/ui",
"description": "Teamleader UI library",
"version": "21.1.0",
"version": "21.2.0",
"author": "Teamleader <[email protected]>",
"bugs": {
"url": "https://github.com/teamleadercrm/ui/issues"
Expand Down
17 changes: 1 addition & 16 deletions src/components/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const ClearIndicator = <Option extends OptionType, IsMulti extends boolean>(
color={inverse ? 'teal' : 'neutral'}
display="flex"
tint={inverse ? 'lightest' : 'darkest'}
className={cx(theme['clear-indicator'], { [theme['clear-indicator--inverse']]: inverse })}
>
<IconCloseBadgedSmallFilled />
</Icon>
Expand Down Expand Up @@ -160,21 +161,6 @@ function Select<Option extends OptionType, IsMulti extends boolean, IsClearable
};
}, []);

const getClearIndicatorStyles = (base: CSSObjectWithLabel) => {
return {
...base,
color: inverse ? COLOR.TEAL.LIGHTEST : COLOR.TEAL.DARK,
'&:hover': {
color: inverse ? COLOR.NEUTRAL.LIGHTEST : COLOR.TEAL.DARKEST,
},
cursor: 'pointer',
svg: {
height: '14px',
width: '14px',
},
};
};

const getControlStyles = (base: CSSObjectWithLabel, { isDisabled, isFocused }: ControlProps<Option>) => {
const commonStyles: CSSObjectWithLabel = {
...base,
Expand Down Expand Up @@ -457,7 +443,6 @@ function Select<Option extends OptionType, IsMulti extends boolean, IsClearable
};

const getStyles = (): StylesConfig<Option> => ({
clearIndicator: getClearIndicatorStyles,
control: getControlStyles,
group: getGroupStyles,
groupHeading: getGroupHeadingStyles,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ exports[`Component - Select renders a clear button when a value is provided 1`]
>
<span
aria-hidden="true"
class="box align-items-center display-flex neutral darkest"
class="box align-items-center display-flex neutral darkest clear-indicator"
data-teamleader-ui="icon"
>
<svg
Expand Down
14 changes: 14 additions & 0 deletions src/components/select/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
width: 30px;
}

.clear-indicator {
cursor: pointer;

&:hover {
color: var(--color-teal-darkest);
}

&--inverse {
&:hover {
color: var(--color-neutral-lightest);
}
}
}

.is-large .dropdown-indicator {
width: 36px;
}
Expand Down

0 comments on commit 71327b3

Please sign in to comment.