Skip to content

Commit 85c5371

Browse files
committed
feat(UI): update story and remove unnecessaryprops
1 parent 4c08d8e commit 85c5371

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

datahub-web-react/src/alchemy-components/components/Select/BasicSelect.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export const BasicSelect = <OptionType extends SelectOption>({
6666
onSearch,
6767
filteringPredicate,
6868
selectLabelProps,
69-
className,
7069
...props
7170
}: SelectProps<OptionType>) => {
7271
const [searchQuery, setSearchQuery] = useState('');
@@ -164,7 +163,7 @@ export const BasicSelect = <OptionType extends SelectOption>({
164163
};
165164

166165
return (
167-
<Container size={size || 'md'} width={props.width} className={className}>
166+
<Container size={size || 'md'} width={props.width}>
168167
{label && <SelectLabel onClick={handleSelectClick}>{label}</SelectLabel>}
169168
<Dropdown
170169
open={isOpen}

datahub-web-react/src/alchemy-components/components/Select/Select.stories.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@ const meta: Meta = {
5959
defaultValue: { summary: selectDefaults.showSearch?.toString() },
6060
},
6161
},
62+
onSearch: {
63+
description: 'Called when text in the search bar changed',
64+
},
65+
filteringPredicate: {
66+
description:
67+
'A function to replace default filtering predicate. The default predicate supports only string labels.',
68+
table: {
69+
type: {
70+
summary: 'FilteringPredicate',
71+
detail: '(option: Option, query: string) => boolean',
72+
},
73+
},
74+
},
6275
isDisabled: {
6376
description: 'Whether the Select component is disabled.',
6477
control: {

datahub-web-react/src/alchemy-components/components/Select/SimpleSelect.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export const SimpleSelect = <OptionType extends SelectOption>({
6666
optionSwitchable,
6767
selectLabelProps,
6868
filteringPredicate,
69-
className,
7069
...props
7170
}: SelectProps<OptionType>) => {
7271
const [searchQuery, setSearchQuery] = useState('');
@@ -141,7 +140,6 @@ export const SimpleSelect = <OptionType extends SelectOption>({
141140
width={props.width || 255}
142141
$selectLabelVariant={selectLabelProps?.variant}
143142
isSelected={selectedValues.length > 0}
144-
className={className}
145143
>
146144
{label && <SelectLabel onClick={handleSelectClick}>{label}</SelectLabel>}
147145
<Dropdown

datahub-web-react/src/alchemy-components/components/Select/types.ts

-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ export interface SelectProps<Option extends SelectOption = SelectOption> {
3232
icon?: IconNames;
3333
showSearch?: boolean;
3434
onSearch?: (query: string) => void;
35-
// searchFilter?: (query: string, options: Option[]) => Option[];
3635
filteringPredicate?: FilteringPredicate<Option>;
37-
// onSearchQueryChanged?: (query: string) => void;
3836
isDisabled?: boolean;
3937
isReadOnly?: boolean;
4038
isRequired?: boolean;
@@ -49,7 +47,6 @@ export interface SelectProps<Option extends SelectOption = SelectOption> {
4947
optionListTestId?: string;
5048
optionSwitchable?: boolean;
5149
selectLabelProps?: SelectLabelProps;
52-
className?: string;
5350
}
5451

5552
export interface SelectStyleProps {

0 commit comments

Comments
 (0)