@grasp-labs/ds-react-components 0.23.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/list/ListItem.d.ts +1 -0
- package/dist/components/select/Select.d.ts +13 -3
- package/dist/{index-jM5wxy7D.js → index-RkdOAOOO.js} +2704 -2694
- package/dist/{index.esm-fQDYRCEr.js → index.esm-D5Kv8WPG.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/types/NoneOf.d.ts +3 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ export type ListItemProps = HTMLProps<HTMLLIElement> & {
|
|
|
10
10
|
itemsClassName?: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const EMPTY_OPTION_ID = "EMPTY";
|
|
13
|
+
export declare const LOADING_OPTION_ID = "LOADING";
|
|
13
14
|
/**
|
|
14
15
|
* A list item component that renders individual options within a List.
|
|
15
16
|
* Supports checkbox display for multi-select mode and various visual states.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { BaseOption } from '../../types/BaseOption';
|
|
3
|
-
|
|
3
|
+
import { NoneOf } from '../../types/NoneOf';
|
|
4
|
+
export type BaseSelectProps<Option> = {
|
|
4
5
|
value: Option | null;
|
|
5
6
|
setValue: (value: Option | null) => void;
|
|
6
7
|
prefixContent?: ReactElement;
|
|
@@ -13,12 +14,21 @@ export type SelectProps<Option extends BaseOption> = {
|
|
|
13
14
|
toggleAriaLabel?: string;
|
|
14
15
|
noOptionsText?: string;
|
|
15
16
|
ref?: React.Ref<HTMLInputElement>;
|
|
16
|
-
disableSearch?: boolean;
|
|
17
17
|
className?: string;
|
|
18
18
|
containerClassName?: string;
|
|
19
19
|
listClassName?: string;
|
|
20
20
|
maxHeight?: number;
|
|
21
21
|
};
|
|
22
|
+
export type ClientSelectProps = {
|
|
23
|
+
disableSearch?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type ServerSelectProps = {
|
|
26
|
+
onSearch: (search: string) => void;
|
|
27
|
+
debounce?: number;
|
|
28
|
+
isLoading?: boolean;
|
|
29
|
+
loadingText: string;
|
|
30
|
+
};
|
|
31
|
+
export type SelectProps<Option extends BaseOption> = (BaseSelectProps<Option> & ClientSelectProps & NoneOf<ServerSelectProps>) | (BaseSelectProps<Option> & ServerSelectProps & NoneOf<ClientSelectProps>);
|
|
22
32
|
/**
|
|
23
33
|
* A dropdown select component with search functionality and keyboard navigation.
|
|
24
34
|
* Built with Downshift for accessibility and supports custom option filtering.
|
|
@@ -27,4 +37,4 @@ export type SelectProps<Option extends BaseOption> = {
|
|
|
27
37
|
* @param props - The props for the Select component.
|
|
28
38
|
* @returns The rendered select dropdown component.
|
|
29
39
|
*/
|
|
30
|
-
export declare const Select: <Option extends BaseOption>({ value, setValue, options, id, prefixContent, suffixContent, error, disabled, placeholder, toggleAriaLabel, noOptionsText, ref, disableSearch, className, containerClassName, listClassName, maxHeight, }: SelectProps<Option>) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare const Select: <Option extends BaseOption>({ value, setValue, options, id, prefixContent, suffixContent, error, disabled, placeholder, toggleAriaLabel, noOptionsText, ref, disableSearch, className, containerClassName, listClassName, maxHeight, onSearch, debounce, isLoading, loadingText, }: SelectProps<Option>) => import("react/jsx-runtime").JSX.Element;
|