Skip to content

Commit fbc2bbf

Browse files
Fix (FilterChip): migrate textfield to inputfield and CSS fixes (#490)
* chore: migrate textfield to inputfield * fix: select radius and datepicker css fix in the filterchip * fix: add check to apply border to select trigger
1 parent 41edf24 commit fbc2bbf

File tree

5 files changed

+33
-189
lines changed

5 files changed

+33
-189
lines changed

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

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,26 @@ button.selectValue:hover {
145145
max-height: 12px;
146146
}
147147

148-
.textFieldWrapper {
148+
.inputFieldWrapper {
149149
padding: 0 var(--rs-space-2);
150150
min-width: 60px;
151151
}
152152

153-
.textField {
153+
.inputField {
154154
border-radius: var(--rs-radius-1);
155+
min-height: 18px;
156+
height: 18px;
155157
}
156158

157-
.textFieldWrapper input {
159+
/* Match height of InputField when FilterChip variant is text */
160+
.chip[data-variant='text'] .inputField {
161+
border: none;
162+
box-shadow: none;
163+
height: 24px;
164+
min-height: 24px;
165+
}
166+
167+
.inputFieldWrapper input {
158168
padding-left: var(--rs-space-2) !important;
159169
padding-right: var(--rs-space-2) !important;
160170
}
@@ -170,6 +180,16 @@ button.selectValue:hover {
170180
justify-content: space-between;
171181
align-items: center;
172182
width: 100%;
183+
height: 18px;
184+
min-height: 18px;
185+
}
186+
187+
/* Remove border and match height of the DatePicker when FilterChip variant is text */
188+
.chip[data-variant='text'] .dateField {
189+
border: none;
190+
box-shadow: none;
191+
height: 24px;
192+
min-height: 24px;
173193
}
174194

175195
.dateField input {

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import {
1111
} from '~/types/filters';
1212
import { DatePicker } from '../calendar';
1313
import { Flex } from '../flex';
14+
import { InputField } from '../input-field';
1415
import { Select } from '../select';
1516
import { Text } from '../text';
16-
import { TextField } from '../textfield';
1717
import { Operation } from './filter-chip-operation';
1818
import styles from './filter-chip.module.css';
1919

@@ -104,7 +104,10 @@ export const FilterChip = ({
104104
}
105105
}}
106106
variant='text'
107-
className={cx(styles.selectValue, styles.selectColumn)}
107+
className={cx(
108+
styles.selectValue,
109+
!showOnRemove && styles.selectColumn
110+
)}
108111
>
109112
<Select.Value placeholder='Select value'>
110113
{isMultiSelectColumn && filterValue.length > 1
@@ -137,9 +140,10 @@ export const FilterChip = ({
137140
);
138141
default:
139142
return (
140-
<div className={styles.textFieldWrapper}>
141-
<TextField
142-
className={styles.textField}
143+
<div className={styles.inputFieldWrapper}>
144+
<InputField
145+
variant={variant === 'text' ? 'borderless' : 'default'}
146+
className={styles.inputField}
143147
value={filterValue}
144148
onChange={e => handleFilterValueChange(e.target.value)}
145149
/>
@@ -155,6 +159,7 @@ export const FilterChip = ({
155159
className={chip({ variant, className })}
156160
role='group'
157161
aria-label={`Filter by ${label}`}
162+
data-variant={variant}
158163
{...props}
159164
>
160165
<Flex align='center' gap={2} className={styles['chip-label']}>

packages/raystack/components/textfield/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/raystack/components/textfield/textfield.module.css

Lines changed: 0 additions & 83 deletions
This file was deleted.

packages/raystack/components/textfield/textfield.tsx

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)