Skip to content

Commit c720b72

Browse files
feat: fix filter chip select css (#370)
* feat: fix filter chip select css * fix: remove redundant fn call
1 parent 07e6821 commit c720b72

File tree

2 files changed

+16
-27
lines changed

2 files changed

+16
-27
lines changed

packages/raystack/v1/components/filter-chip/filter-chip.module.css

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,20 @@
2424
/* padding-right: var(--rs-space-1); */
2525
}
2626

27-
.operation {
28-
font-family: var(--rs-font-body);
29-
font-weight: var(--rs-font-weight-regular);
30-
font-size: var(--rs-font-size-small);
31-
line-height: var(--rs-line-height-small);
32-
letter-spacing: var(--rs-letter-spacing-small);
33-
background: transparent;
34-
height: calc(100% - 2px);
35-
display: flex;
36-
align-items: center;
37-
margin-left: var(--rs-space-2);
38-
}
39-
40-
.operation:hover {
41-
background: var(--rs-color-background-base-primary-hover);
42-
}
43-
4427
.operationText {
4528
color: var(--rs-color-foreground-base-secondary);
4629
font-family: var(--rs-font-body);
4730
font-weight: var(--rs-font-weight-regular);
4831
font-size: var(--rs-font-size-small);
4932
line-height: var(--rs-line-height-small);
5033
letter-spacing: var(--rs-letter-spacing-small);
51-
padding: var(--rs-space-1) var(--rs-space-3);
52-
height: calc(100% - 2px);
5334
display: flex;
5435
align-items: center;
5536
}
5637

5738
.operationText:hover {
5839
color: var(--rs-color-foreground-base-primary);
5940
background: var(--rs-color-background-base-primary-hover);
60-
height: calc(100% - 2px);
6141
}
6242

6343
/* Target any input fields within the chip */
@@ -140,16 +120,23 @@
140120
font-size: var(--rs-font-size-small);
141121
line-height: var(--rs-line-height-small);
142122
letter-spacing: var(--rs-letter-spacing-small);
143-
padding: var(--rs-space-1) var(--rs-space-2);
144-
height: calc(100% - 2px);
145123
display: flex;
146124
align-items: center;
125+
background: transparent;
126+
height: 100%;
127+
min-height: auto;
128+
padding: var(--rs-space-2) var(--rs-space-3);
129+
border-radius: 0;
130+
}
131+
.selectColumn {
132+
border-top-right-radius: var(--rs-radius-2);
133+
border-bottom-right-radius: var(--rs-radius-2);
147134
}
148135

149-
.selectValue:hover {
136+
.selectValue:hover,
137+
.selectValue:focus-visible {
150138
color: var(--rs-color-foreground-base-primary);
151139
background: var(--rs-color-background-base-primary-hover);
152-
height: calc(100% - 2px);
153140
}
154141

155142
.leadingIcon {

packages/raystack/v1/components/filter-chip/filter-chip.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
FilterType,
1616
FilterTypes,
1717
} from "~/v1/types/filters";
18-
import { cva, VariantProps } from "class-variance-authority";
18+
import { cva, cx, VariantProps } from "class-variance-authority";
1919

2020
const chip = cva(styles.chip, {
2121
variants: {
@@ -72,7 +72,7 @@ const Operation = ({
7272
aria-labelledby={`${label}-label`}>
7373
<Select.Trigger
7474
variant="text"
75-
className={styles.operation}
75+
className={styles.selectValue}
7676
aria-label={`${label} filter operation`}>
7777
<Select.Value
7878
placeholder="Select operation"
@@ -131,7 +131,9 @@ export const FilterChip = ({
131131
case FilterType.select:
132132
return (
133133
<Select value={filterValue.toString()} onValueChange={setFilterValue}>
134-
<Select.Trigger variant="text" className={styles.selectValue}>
134+
<Select.Trigger
135+
variant="text"
136+
className={cx(styles.selectValue, styles.selectColumn)}>
135137
<Select.Value placeholder="Select value" />
136138
</Select.Trigger>
137139
<Select.Content data-variant="filter">

0 commit comments

Comments
 (0)