@gridui/select 1.3.0 → 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 +42 -1
- package/dist/autocomplete-suggestions/autocomplete-suggestions.d.ts +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +326 -292
- package/dist/index.js.map +4 -4
- 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/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/package.json +7 -6
|
@@ -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/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
|
+
|
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,12 +27,13 @@
|
|
|
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",
|