@gridui/select 1.2.2 → 1.5.0
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/README.md +53 -3
- package/dist/autocomplete-suggestions/autocomplete-suggestions.d.ts +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +341 -299
- package/dist/index.js.map +4 -4
- package/dist/select/select-options.d.ts +1 -1
- package/dist/select/select.d.ts +0 -6
- package/dist/shared/popup/selection-popup.d.ts +0 -6
- package/dist/shared/search/calculate-search-options.d.ts +3 -5
- package/dist/shared/search/use-search-options.d.ts +2 -1
- package/dist/shared/types.d.ts +8 -2
- package/dist/styles.css +1 -0
- package/docs/catalog.json +17 -1
- package/docs/reference/README.md +1 -0
- package/docs/reference/autocomplete-suggestions.md +77 -0
- package/docs/reference/combobox.md +8 -0
- package/docs/reference/multi-select.md +8 -0
- package/docs/reference/select.md +8 -0
- package/package.json +10 -10
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* @description Calculate Search Options
|
|
6
6
|
*/
|
|
7
7
|
import type { SelectGroup, SelectionSearchProps, SelectOption } from "../types";
|
|
8
|
+
export { getSearchResultLabel as getSearchStatus } from "@gridui/interaction";
|
|
8
9
|
type SearchOptionsInput = Pick<SelectionSearchProps, "filterOptions" | "loading" | "errorLabel"> & {
|
|
9
10
|
readonly options: readonly (SelectOption | SelectGroup)[];
|
|
10
11
|
readonly selected: readonly string[];
|
|
@@ -15,14 +16,11 @@ type SearchOptionsInput = Pick<SelectionSearchProps, "filterOptions" | "loading"
|
|
|
15
16
|
export declare const calculateSearchOptions: (input: SearchOptionsInput) => {
|
|
16
17
|
all: SelectOption[];
|
|
17
18
|
filtered: readonly (SelectOption | SelectGroup)[];
|
|
18
|
-
visible: SelectOption[];
|
|
19
|
+
visible: readonly SelectOption[];
|
|
19
20
|
active: string | null;
|
|
20
21
|
activeOption: SelectOption | undefined;
|
|
21
22
|
activeOptionId: string | undefined;
|
|
22
23
|
optionId: (value: string) => string;
|
|
23
24
|
getOption: (value: string) => SelectOption | undefined;
|
|
25
|
+
navigate: (direction: import("@gridui/interaction").SearchNavigation) => SelectOption | undefined;
|
|
24
26
|
};
|
|
25
|
-
export declare const getSearchStatus: (count: number, props: Pick<SelectionSearchProps, "loading" | "loadingLabel" | "errorLabel" | "resultCountLabel"> & {
|
|
26
|
-
readonly emptyLabel: string;
|
|
27
|
-
}) => string | undefined;
|
|
28
|
-
export {};
|
|
@@ -12,10 +12,11 @@ export declare const useSearchOptions: (options: readonly (SelectOption | Select
|
|
|
12
12
|
moveActive: (direction: number) => void;
|
|
13
13
|
all: SelectOption[];
|
|
14
14
|
filtered: readonly (SelectOption | SelectGroup)[];
|
|
15
|
-
visible: SelectOption[];
|
|
15
|
+
visible: readonly SelectOption[];
|
|
16
16
|
active: string | null;
|
|
17
17
|
activeOption: SelectOption | undefined;
|
|
18
18
|
activeOptionId: string | undefined;
|
|
19
19
|
optionId: (value: string) => string;
|
|
20
20
|
getOption: (value: string) => SelectOption | undefined;
|
|
21
|
+
navigate: (direction: import("@gridui/interaction").SearchNavigation) => SelectOption | undefined;
|
|
21
22
|
};
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* @namespace Shared
|
|
5
5
|
* @description Types
|
|
6
6
|
*/
|
|
7
|
+
import type { overlayListItemStyles } from "@gridui/overlay";
|
|
8
|
+
import type { VariantProps } from "class-variance-authority";
|
|
7
9
|
import type { ReactNode } from "react";
|
|
8
10
|
export type SelectOption = {
|
|
9
11
|
readonly value: string;
|
|
@@ -39,7 +41,11 @@ export interface SelectionValueProps {
|
|
|
39
41
|
export interface SelectionOptionSource {
|
|
40
42
|
readonly options: readonly (SelectOption | SelectGroup)[];
|
|
41
43
|
}
|
|
42
|
-
export
|
|
44
|
+
export type SelectionAppearanceOptions = {
|
|
45
|
+
/** Selected option presentation; keyboard and pointer highlights remain independent. */
|
|
46
|
+
readonly selectionAppearance?: NonNullable<VariantProps<typeof overlayListItemStyles>["selectionAppearance"]> | undefined;
|
|
47
|
+
};
|
|
48
|
+
export interface SelectionControlOptions extends SelectionOptionSource, SelectionAppearanceOptions {
|
|
43
49
|
readonly clearLabel?: string;
|
|
44
50
|
readonly portalContainer?: HTMLElement | null;
|
|
45
51
|
readonly required?: boolean;
|
|
@@ -64,7 +70,7 @@ export type SelectionSearchProps = {
|
|
|
64
70
|
readonly errorLabel?: string | undefined;
|
|
65
71
|
readonly resultCountLabel?: ((count: number) => string) | undefined;
|
|
66
72
|
};
|
|
67
|
-
export type SelectionListOptions = SelectionOptionSource & {
|
|
73
|
+
export type SelectionListOptions = SelectionOptionSource & SelectionAppearanceOptions & {
|
|
68
74
|
readonly id: string;
|
|
69
75
|
readonly label?: string | undefined;
|
|
70
76
|
};
|
package/dist/styles.css
CHANGED
package/docs/catalog.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/select",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"category": "core",
|
|
6
6
|
"description": "GridUI React select",
|
|
7
7
|
"usage": "Input supplies control styles. Overlay supplies popup surfaces, motion, option rows, group labels, and trailing check slots. Form hides MultiSelect’s native multiple-value bridge. Applications own routes, labels, state persistence, and branding.",
|
|
8
8
|
"documentation": [
|
|
9
9
|
"README.md",
|
|
10
10
|
"docs/reference/README.md",
|
|
11
|
+
"docs/reference/autocomplete-suggestions.md",
|
|
11
12
|
"docs/reference/autocomplete.md",
|
|
12
13
|
"docs/reference/combobox.md",
|
|
13
14
|
"docs/reference/multi-select.md",
|
|
@@ -29,11 +30,26 @@
|
|
|
29
30
|
"kind": "component",
|
|
30
31
|
"importPath": "@gridui/select"
|
|
31
32
|
},
|
|
33
|
+
{
|
|
34
|
+
"name": "AutocompleteInputPropsGetter",
|
|
35
|
+
"kind": "type",
|
|
36
|
+
"importPath": "@gridui/select"
|
|
37
|
+
},
|
|
32
38
|
{
|
|
33
39
|
"name": "AutocompleteProps",
|
|
34
40
|
"kind": "type",
|
|
35
41
|
"importPath": "@gridui/select"
|
|
36
42
|
},
|
|
43
|
+
{
|
|
44
|
+
"name": "AutocompleteSuggestions",
|
|
45
|
+
"kind": "component",
|
|
46
|
+
"importPath": "@gridui/select"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "AutocompleteSuggestionsProps",
|
|
50
|
+
"kind": "type",
|
|
51
|
+
"importPath": "@gridui/select"
|
|
52
|
+
},
|
|
37
53
|
{
|
|
38
54
|
"name": "Combobox",
|
|
39
55
|
"kind": "component",
|
package/docs/reference/README.md
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
|
+
# AutocompleteSuggestions
|
|
3
|
+
|
|
4
|
+
Public AutocompleteSuggestions component from @gridui/select. See the package guide for its composition contract.
|
|
5
|
+
|
|
6
|
+
Import from ``@gridui/select`` and load Theme before this family's stylesheet.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { AutocompleteSuggestions } from "@gridui/select";
|
|
10
|
+
import "@gridui/theme/styles.css";
|
|
11
|
+
import "@gridui/select/styles.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/select/README.md) for shared behavior and stylesheet dependencies.
|
|
15
|
+
|
|
16
|
+
## API
|
|
17
|
+
|
|
18
|
+
The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
|
|
19
|
+
|
|
20
|
+
### loading
|
|
21
|
+
|
|
22
|
+
``boolean | undefined`` · Optional
|
|
23
|
+
|
|
24
|
+
### filterOptions
|
|
25
|
+
|
|
26
|
+
``boolean | undefined`` · Optional
|
|
27
|
+
|
|
28
|
+
### loadingLabel
|
|
29
|
+
|
|
30
|
+
``string | undefined`` · Optional
|
|
31
|
+
|
|
32
|
+
### errorLabel
|
|
33
|
+
|
|
34
|
+
``string | undefined`` · Optional
|
|
35
|
+
|
|
36
|
+
### resultCountLabel
|
|
37
|
+
|
|
38
|
+
``((count: number) => string) | undefined`` · Optional
|
|
39
|
+
|
|
40
|
+
### value
|
|
41
|
+
|
|
42
|
+
``string`` · Required
|
|
43
|
+
|
|
44
|
+
Controlled value. Pair with the corresponding change callback.
|
|
45
|
+
|
|
46
|
+
### options
|
|
47
|
+
|
|
48
|
+
``readonly (SelectOption | SelectGroup)[]`` · Required
|
|
49
|
+
|
|
50
|
+
### searchLabel
|
|
51
|
+
|
|
52
|
+
``string`` · Required
|
|
53
|
+
|
|
54
|
+
### emptyLabel
|
|
55
|
+
|
|
56
|
+
``string`` · Required
|
|
57
|
+
|
|
58
|
+
### portalContainer
|
|
59
|
+
|
|
60
|
+
``HTMLElement | undefined`` · Optional
|
|
61
|
+
|
|
62
|
+
### rootClassName
|
|
63
|
+
|
|
64
|
+
``string | undefined`` · Optional
|
|
65
|
+
|
|
66
|
+
### onOptionSelect
|
|
67
|
+
|
|
68
|
+
``(option: SelectOption): void`` · Required
|
|
69
|
+
|
|
70
|
+
Called when the corresponding interaction occurs; inspect the arguments in Actions.
|
|
71
|
+
|
|
72
|
+
### children
|
|
73
|
+
|
|
74
|
+
``(getInputProps: AutocompleteInputPropsGetter) => ReactNode`` · Required
|
|
75
|
+
|
|
76
|
+
Content rendered inside the component.
|
|
77
|
+
|
|
@@ -109,6 +109,14 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
109
109
|
|
|
110
110
|
``readonly (SelectOption | SelectGroup)[]`` · Required
|
|
111
111
|
|
|
112
|
+
### selectionAppearance
|
|
113
|
+
|
|
114
|
+
``NonNullable<"filled" | "indicator" | null | undefined> | undefined`` · Optional
|
|
115
|
+
|
|
116
|
+
Default: ``"filled"``
|
|
117
|
+
|
|
118
|
+
Selected option presentation; keyboard and pointer highlights remain independent.
|
|
119
|
+
|
|
112
120
|
### query
|
|
113
121
|
|
|
114
122
|
``string | undefined`` · Optional
|
|
@@ -95,6 +95,14 @@ Participates in required form validation.
|
|
|
95
95
|
|
|
96
96
|
``readonly (SelectOption | SelectGroup)[]`` · Required
|
|
97
97
|
|
|
98
|
+
### selectionAppearance
|
|
99
|
+
|
|
100
|
+
``NonNullable<"filled" | "indicator" | null | undefined> | undefined`` · Optional
|
|
101
|
+
|
|
102
|
+
Default: ``"filled"``
|
|
103
|
+
|
|
104
|
+
Selected option presentation; keyboard and pointer highlights remain independent.
|
|
105
|
+
|
|
98
106
|
### query
|
|
99
107
|
|
|
100
108
|
``string | undefined`` · Optional
|
package/docs/reference/select.md
CHANGED
|
@@ -109,6 +109,14 @@ Participates in required form validation.
|
|
|
109
109
|
|
|
110
110
|
``readonly (SelectOption | SelectGroup)[]`` · Required
|
|
111
111
|
|
|
112
|
+
### selectionAppearance
|
|
113
|
+
|
|
114
|
+
``NonNullable<"filled" | "indicator" | null | undefined> | undefined`` · Optional
|
|
115
|
+
|
|
116
|
+
Default: ``"filled"``
|
|
117
|
+
|
|
118
|
+
Selected option presentation; keyboard and pointer highlights remain independent.
|
|
119
|
+
|
|
112
120
|
### placeholder
|
|
113
121
|
|
|
114
122
|
``string | undefined`` · Optional
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/select",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "GridUI React select",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -27,21 +27,22 @@
|
|
|
27
27
|
"react-dom": "^19.2.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@gridui/form": "^4.1.
|
|
31
|
-
"@gridui/input": "^4.0.
|
|
32
|
-
"@gridui/interaction": "^1.
|
|
33
|
-
"@gridui/
|
|
30
|
+
"@gridui/form": "^4.1.2",
|
|
31
|
+
"@gridui/input": "^4.0.2",
|
|
32
|
+
"@gridui/interaction": "^1.3.0",
|
|
33
|
+
"@gridui/motion": "^1.0.1",
|
|
34
|
+
"@gridui/overlay": "^2.3.0",
|
|
34
35
|
"@gridui/style-utils": "^4.0.0",
|
|
35
|
-
"@gridui/theme": "^
|
|
36
|
+
"@gridui/theme": "^3.0.0",
|
|
36
37
|
"@radix-ui/react-popover": "1.3.1",
|
|
37
38
|
"@radix-ui/react-select": "2.4.1",
|
|
38
39
|
"class-variance-authority": "0.7.1",
|
|
39
|
-
"lucide-react": "1.
|
|
40
|
+
"lucide-react": "1.72.0"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
43
44
|
"@jest/globals": "30.5.2",
|
|
44
|
-
"@storybook/react-vite": "10.6.
|
|
45
|
+
"@storybook/react-vite": "10.6.7",
|
|
45
46
|
"@types/jest": "30.0.0",
|
|
46
47
|
"@types/node": "26.6.6",
|
|
47
48
|
"@types/react": "19.3.0",
|
|
@@ -54,7 +55,6 @@
|
|
|
54
55
|
"scripts": {
|
|
55
56
|
"build": "node ../../scripts/compilation/package.ts",
|
|
56
57
|
"compile": "tsc --project tsconfig.json",
|
|
57
|
-
"test": "jest"
|
|
58
|
-
"coverage": "jest --coverage"
|
|
58
|
+
"test": "jest"
|
|
59
59
|
}
|
|
60
60
|
}
|