@grampro/kit 2.7.2 → 2.7.3
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/.gbs/skills/gbs-components/SKILL.md +233 -209
- package/.gbs/skills/gbs-components/references/data-grid.md +9 -0
- package/.gbs/skills/gbs-components/references/forms.md +12 -0
- package/.gbs/skills/gbs-components/references/install.md +14 -3
- package/CHANGELOG.md +963 -861
- package/README.md +11 -3
- package/index.cjs +108 -123
- package/package.json +1 -1
- package/source/components/accordion/passport.json +1 -1
- package/source/components/alert/passport.json +1 -1
- package/source/components/avatar/passport.json +1 -1
- package/source/components/badge/passport.json +1 -1
- package/source/components/breadcrumb/passport.json +1 -1
- package/source/components/button/passport.json +1 -1
- package/source/components/card/passport.json +1 -1
- package/source/components/checkbox/passport.json +2 -2
- package/source/components/checkbox/passport.manual.json +1 -1
- package/source/components/checkbox/react/Checkbox.tsx +14 -0
- package/source/components/combobox/passport.json +3 -2
- package/source/components/combobox/passport.manual.json +1 -1
- package/source/components/combobox/react/MultiSelect.tsx +13 -0
- package/source/components/combobox/react/Select.tsx +13 -0
- package/source/components/combobox/react/surface.ts +70 -0
- package/source/components/data-grid/passport.json +6 -6
- package/source/components/data-grid/react/DataGrid.tsx +353 -351
- package/source/components/date-picker/passport.json +3 -2
- package/source/components/date-picker/passport.manual.json +1 -1
- package/source/components/date-picker/react/DatePicker.tsx +16 -2
- package/source/components/date-picker/react/DateRangePicker.tsx +16 -2
- package/source/components/date-picker/react/surface.ts +68 -0
- package/source/components/dialog/passport.json +1 -1
- package/source/components/file-uploader/passport.json +1 -1
- package/source/components/input/passport.json +2 -2
- package/source/components/input/passport.manual.json +1 -1
- package/source/components/input/react/Input.tsx +21 -0
- package/source/components/menu/passport.json +1 -1
- package/source/components/modal/passport.json +1 -1
- package/source/components/number-input/passport.json +2 -2
- package/source/components/number-input/passport.manual.json +1 -1
- package/source/components/number-input/react/NumberInput.tsx +30 -0
- package/source/components/popover/passport.json +1 -1
- package/source/components/progress/passport.json +1 -1
- package/source/components/radio-group/passport.json +2 -2
- package/source/components/radio-group/passport.manual.json +1 -1
- package/source/components/radio-group/react/RadioGroup.tsx +33 -0
- package/source/components/shared/core/agent/field-executors.ts +173 -137
- package/source/components/shared/core/agent/index.ts +21 -0
- package/source/components/shared/core/agent/surface.ts +437 -0
- package/source/components/shared/core/agent/webmcp.ts +332 -328
- package/source/components/shared/core/agent/write.ts +62 -58
- package/source/components/shared/index.ts +7 -0
- package/source/components/shared/react/AgentSurface.tsx +145 -0
- package/source/components/shared/react/agentSurfaceContext.ts +92 -0
- package/source/components/shared/react/useFieldAgent.ts +62 -88
- package/source/components/shared/version.json +4 -4
- package/source/components/shared/version.ts +6 -6
- package/source/components/skeleton/passport.json +1 -1
- package/source/components/spinner/passport.json +1 -1
- package/source/components/switch/passport.json +2 -2
- package/source/components/switch/passport.manual.json +1 -1
- package/source/components/switch/react/Switch.tsx +16 -0
- package/source/components/tabs/passport.json +1 -1
- package/source/components/textarea/passport.json +2 -2
- package/source/components/textarea/passport.manual.json +1 -1
- package/source/components/textarea/react/Textarea.tsx +16 -0
- package/source/components/toaster/passport.json +1 -1
- package/source/components/tooltip/passport.json +1 -1
- package/tools/doctor/baseline.cjs +5 -4
- package/tools/mcp/server.cjs +13 -1
- package/tools/passport/extract.cjs +20 -65
- package/tools/passport/hash.cjs +18 -1
- package/tools/passport/index.cjs +4 -2
- package/tools/passport/typescript.cjs +220 -0
- package/tools/prompt.cjs +205 -0
- package/tools/ui.cjs +67 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { labelText, useAgentSurfaceField } from "../../shared/react/agentSurfaceContext";
|
|
4
|
+
import type { ComboboxOption, OptionValue } from "../core/types";
|
|
5
|
+
import type { ComboboxHandle } from "./props";
|
|
6
|
+
|
|
7
|
+
interface ComboboxSurfaceParams<V extends OptionValue> {
|
|
8
|
+
component: "Select" | "MultiSelect";
|
|
9
|
+
label: unknown;
|
|
10
|
+
ariaLabel: unknown;
|
|
11
|
+
name?: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
options: readonly ComboboxOption<V>[];
|
|
15
|
+
mode?: "client" | "server";
|
|
16
|
+
max?: number;
|
|
17
|
+
handle: ComboboxHandle<V>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Inside an <AgentSurface>, offer a Select or MultiSelect with its options.
|
|
22
|
+
*
|
|
23
|
+
* An agent speaks in strings and an option's value may be a number, so values
|
|
24
|
+
* are offered as text and mapped back to the option they came from before the
|
|
25
|
+
* write. In server mode the options are only the current results, so none are
|
|
26
|
+
* enumerated: the set is the server's, not the component's.
|
|
27
|
+
*/
|
|
28
|
+
export function useComboboxSurface<V extends OptionValue>(params: ComboboxSurfaceParams<V>): void {
|
|
29
|
+
useAgentSurfaceField(() => {
|
|
30
|
+
const { component, options, handle } = params;
|
|
31
|
+
const multiple = component === "MultiSelect";
|
|
32
|
+
const enumerate = params.mode !== "server";
|
|
33
|
+
const back = (value: unknown): V => {
|
|
34
|
+
const text = String(value);
|
|
35
|
+
return (options.find((option) => String(option.value) === text)?.value ?? text) as V;
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
contract: {
|
|
39
|
+
component,
|
|
40
|
+
kind: multiple ? "multiChoice" : "choice",
|
|
41
|
+
label: labelText(params.label, params.ariaLabel, params.name),
|
|
42
|
+
disabled: params.disabled,
|
|
43
|
+
required: params.required,
|
|
44
|
+
...(enumerate
|
|
45
|
+
? {
|
|
46
|
+
options: options.map((option) => ({
|
|
47
|
+
value: String(option.value),
|
|
48
|
+
label: option.label,
|
|
49
|
+
...(option.disabled ? { disabled: true } : {}),
|
|
50
|
+
})),
|
|
51
|
+
}
|
|
52
|
+
: {}),
|
|
53
|
+
...(multiple && params.max !== undefined ? { maxSelected: params.max } : {}),
|
|
54
|
+
operations: ["setValue", "clear", "focus", "open", "close"],
|
|
55
|
+
},
|
|
56
|
+
target: () => ({
|
|
57
|
+
setValue: (next) =>
|
|
58
|
+
handle.setValue(
|
|
59
|
+
(next == null ? null : Array.isArray(next) ? next.map(back) : back(next)) as Parameters<
|
|
60
|
+
ComboboxHandle<V>["setValue"]
|
|
61
|
+
>[0],
|
|
62
|
+
),
|
|
63
|
+
clear: handle.clear,
|
|
64
|
+
focus: handle.focus,
|
|
65
|
+
open: handle.open,
|
|
66
|
+
close: handle.close,
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
16
|
"source": {
|
|
17
|
-
"libraryVersion": "2.7.
|
|
17
|
+
"libraryVersion": "2.7.3",
|
|
18
18
|
"files": [
|
|
19
19
|
"agent/coerce.ts",
|
|
20
20
|
"agent/contract.ts",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"react/keyboard.ts",
|
|
65
65
|
"react/locale.ts"
|
|
66
66
|
],
|
|
67
|
-
"sourceHash": "sha256:
|
|
67
|
+
"sourceHash": "sha256:1047a3723ee462533fa5b82741d89309723cecedc71ea4b1339176a50ced0545"
|
|
68
68
|
},
|
|
69
69
|
"purpose": "Display and operate on tabular data. Virtualized; holds its own sort, filter, search, selection, column and pagination state in an external store exposed through GridApi.",
|
|
70
70
|
"props": [
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"required": false,
|
|
94
94
|
"default": false,
|
|
95
95
|
"origin": "derived",
|
|
96
|
-
"description": "Render a natural-language box above the grid.\
|
|
96
|
+
"description": "Render a natural-language box above the grid.\n\nNeeds a `<GramproAIProvider>` above it supplying an adapter; without one\nthis renders nothing and the grid is unchanged. No model is bundled or\ndownloaded — the application brings its own.",
|
|
97
97
|
"descriptionOrigin": "jsdoc"
|
|
98
98
|
},
|
|
99
99
|
{
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"typeText": "ReactNode",
|
|
153
153
|
"required": false,
|
|
154
154
|
"origin": "derived",
|
|
155
|
-
"description": "Shown in place of rows when there are none. Worth distinguishing \"nothing\
|
|
155
|
+
"description": "Shown in place of rows when there are none. Worth distinguishing \"nothing\nhere yet\" from \"nothing matched your filters\", which the default does not.",
|
|
156
156
|
"descriptionOrigin": "jsdoc"
|
|
157
157
|
},
|
|
158
158
|
{
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
"required": false,
|
|
307
307
|
"default": false,
|
|
308
308
|
"origin": "derived",
|
|
309
|
-
"description": "Show the loading treatment over the grid. The existing rows stay in place\
|
|
309
|
+
"description": "Show the loading treatment over the grid. The existing rows stay in place\nunderneath, so a refresh does not empty the screen.",
|
|
310
310
|
"descriptionOrigin": "jsdoc"
|
|
311
311
|
},
|
|
312
312
|
{
|
|
@@ -483,7 +483,7 @@
|
|
|
483
483
|
"required": false,
|
|
484
484
|
"default": true,
|
|
485
485
|
"origin": "derived",
|
|
486
|
-
"description": "The toolbar above the grid. `true` for all of it, `false` for none, or an\
|
|
486
|
+
"description": "The toolbar above the grid. `true` for all of it, `false` for none, or an\nobject to choose parts — `{ search: true, export: false }` — and to put\nyour own controls at its `start` or `end`.",
|
|
487
487
|
"descriptionOrigin": "jsdoc"
|
|
488
488
|
}
|
|
489
489
|
],
|