@grasp-labs/ds-react-components 1.1.2 → 1.1.4
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/List.d.ts +3 -3
- package/dist/components/list/ListSectionHeader.d.ts +5 -0
- package/dist/components/list/index.d.ts +1 -0
- package/dist/components/select/Select.d.ts +4 -4
- package/dist/{index-BLcXInK2.js → index-DnAYLZ11.js} +3610 -3516
- package/dist/index.css +1 -1
- package/dist/{index.esm-Cbp5uV56.js → index.esm-CxO4uPdH.js} +1 -1
- package/dist/index.js +57 -56
- package/dist/types/BaseOption.d.ts +7 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/normalizeOptionNodes.d.ts +18 -0
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OptionNode } from '../../types';
|
|
2
2
|
export type ListType = "single" | "multi";
|
|
3
3
|
export type ListProps = {
|
|
4
|
-
options:
|
|
4
|
+
options: OptionNode[];
|
|
5
5
|
type: ListType;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
error?: boolean;
|
|
@@ -20,7 +20,7 @@ export type ListProps = {
|
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
22
22
|
* A flexible list component supporting both single and multi-selection modes.
|
|
23
|
-
* Handles
|
|
23
|
+
* Handles flat options and grouped option sections with proper highlight mapping.
|
|
24
24
|
*
|
|
25
25
|
* @param props - The props for the List component.
|
|
26
26
|
* @returns The rendered list with selectable items.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import { BaseOption } from '../../types
|
|
2
|
+
import { BaseOption, OptionNode } from '../../types';
|
|
3
3
|
import { NoneOf } from '../../types/NoneOf';
|
|
4
|
-
export type BaseSelectProps<Option> = {
|
|
4
|
+
export type BaseSelectProps<Option extends BaseOption> = {
|
|
5
5
|
value: Option | null;
|
|
6
6
|
setValue: (value: Option | null) => void;
|
|
7
7
|
prefix?: ReactElement;
|
|
8
8
|
suffix?: ReactElement;
|
|
9
|
-
options: Option[];
|
|
9
|
+
options: OptionNode<Option>[];
|
|
10
10
|
id?: string;
|
|
11
11
|
error?: boolean;
|
|
12
12
|
disabled?: boolean;
|
|
@@ -31,7 +31,7 @@ export type ServerSelectProps = {
|
|
|
31
31
|
export type SelectProps<Option extends BaseOption> = (BaseSelectProps<Option> & ClientSelectProps & NoneOf<ServerSelectProps>) | (BaseSelectProps<Option> & ServerSelectProps & NoneOf<ClientSelectProps>);
|
|
32
32
|
/**
|
|
33
33
|
* A dropdown select component with search functionality and keyboard navigation.
|
|
34
|
-
* Built with Downshift for accessibility and supports
|
|
34
|
+
* Built with Downshift for accessibility and supports grouped options via section nodes.
|
|
35
35
|
*
|
|
36
36
|
* @template Option - The option type extending BaseOption.
|
|
37
37
|
* @param props - The props for the Select component.
|