@assistant-ui/react-mcp 0.0.0 → 0.0.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/LICENSE +21 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/auth/buildHeaders.d.ts +7 -3
- package/dist/auth/buildHeaders.d.ts.map +1 -1
- package/dist/auth/buildHeaders.js +14 -12
- package/dist/auth/buildHeaders.js.map +1 -1
- package/dist/auth/createOAuthProvider.d.ts +17 -15
- package/dist/auth/createOAuthProvider.d.ts.map +1 -1
- package/dist/auth/createOAuthProvider.js +111 -137
- package/dist/auth/createOAuthProvider.js.map +1 -1
- package/dist/auth/types.d.ts +10 -7
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js +0 -2
- package/dist/connector.d.ts +6 -2
- package/dist/connector.d.ts.map +1 -1
- package/dist/connector.js +7 -3
- package/dist/connector.js.map +1 -1
- package/dist/context/McpConnectorByIndexProvider.d.ts +7 -3
- package/dist/context/McpConnectorByIndexProvider.d.ts.map +1 -1
- package/dist/context/McpConnectorByIndexProvider.js +18 -11
- package/dist/context/McpConnectorByIndexProvider.js.map +1 -1
- package/dist/context/McpCustomServerByIndexProvider.d.ts +7 -3
- package/dist/context/McpCustomServerByIndexProvider.d.ts.map +1 -1
- package/dist/context/McpCustomServerByIndexProvider.js +18 -11
- package/dist/context/McpCustomServerByIndexProvider.js.map +1 -1
- package/dist/context/McpServerByIdProvider.d.ts +7 -3
- package/dist/context/McpServerByIdProvider.d.ts.map +1 -1
- package/dist/context/McpServerByIdProvider.js +15 -11
- package/dist/context/McpServerByIdProvider.js.map +1 -1
- package/dist/hooks/useMcpOAuthCallback.d.ts +16 -13
- package/dist/hooks/useMcpOAuthCallback.d.ts.map +1 -1
- package/dist/hooks/useMcpOAuthCallback.js +59 -55
- package/dist/hooks/useMcpOAuthCallback.js.map +1 -1
- package/dist/index.d.ts +17 -18
- package/dist/index.js +14 -26
- package/dist/mcp-scope.d.ts +91 -94
- package/dist/mcp-scope.d.ts.map +1 -1
- package/dist/mcp-scope.js +0 -1
- package/dist/primitives/addForm/McpAddFormAuthFields.d.ts +17 -13
- package/dist/primitives/addForm/McpAddFormAuthFields.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthFields.js +23 -14
- package/dist/primitives/addForm/McpAddFormAuthFields.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthSelect.d.ts +9 -5
- package/dist/primitives/addForm/McpAddFormAuthSelect.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormAuthSelect.js +36 -16
- package/dist/primitives/addForm/McpAddFormAuthSelect.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormCancel.d.ts +10 -6
- package/dist/primitives/addForm/McpAddFormCancel.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormCancel.js +19 -11
- package/dist/primitives/addForm/McpAddFormCancel.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormError.d.ts +10 -6
- package/dist/primitives/addForm/McpAddFormError.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormError.js +15 -8
- package/dist/primitives/addForm/McpAddFormError.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormNameField.d.ts +9 -5
- package/dist/primitives/addForm/McpAddFormNameField.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormNameField.js +17 -6
- package/dist/primitives/addForm/McpAddFormNameField.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormRoot.d.ts +15 -11
- package/dist/primitives/addForm/McpAddFormRoot.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormRoot.js +134 -94
- package/dist/primitives/addForm/McpAddFormRoot.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormSubmit.d.ts +10 -6
- package/dist/primitives/addForm/McpAddFormSubmit.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormSubmit.js +16 -6
- package/dist/primitives/addForm/McpAddFormSubmit.js.map +1 -1
- package/dist/primitives/addForm/McpAddFormUrlField.d.ts +9 -5
- package/dist/primitives/addForm/McpAddFormUrlField.d.ts.map +1 -1
- package/dist/primitives/addForm/McpAddFormUrlField.js +18 -6
- package/dist/primitives/addForm/McpAddFormUrlField.js.map +1 -1
- package/dist/primitives/addForm/context.d.ts +22 -18
- package/dist/primitives/addForm/context.d.ts.map +1 -1
- package/dist/primitives/addForm/context.js +9 -7
- package/dist/primitives/addForm/context.js.map +1 -1
- package/dist/primitives/addForm.d.ts +15 -8
- package/dist/primitives/addForm.d.ts.map +1 -1
- package/dist/primitives/addForm.js +23 -8
- package/dist/primitives/addForm.js.map +1 -1
- package/dist/primitives/manager/McpManagerAddCustomTrigger.d.ts +10 -6
- package/dist/primitives/manager/McpManagerAddCustomTrigger.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerAddCustomTrigger.js +13 -6
- package/dist/primitives/manager/McpManagerAddCustomTrigger.js.map +1 -1
- package/dist/primitives/manager/McpManagerConnectors.d.ts +18 -14
- package/dist/primitives/manager/McpManagerConnectors.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerConnectors.js +37 -35
- package/dist/primitives/manager/McpManagerConnectors.js.map +1 -1
- package/dist/primitives/manager/McpManagerCustomServers.d.ts +18 -14
- package/dist/primitives/manager/McpManagerCustomServers.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerCustomServers.js +38 -32
- package/dist/primitives/manager/McpManagerCustomServers.js.map +1 -1
- package/dist/primitives/manager/McpManagerRoot.d.ts +10 -6
- package/dist/primitives/manager/McpManagerRoot.d.ts.map +1 -1
- package/dist/primitives/manager/McpManagerRoot.js +14 -6
- package/dist/primitives/manager/McpManagerRoot.js.map +1 -1
- package/dist/primitives/manager.d.ts +11 -4
- package/dist/primitives/manager.d.ts.map +1 -1
- package/dist/primitives/manager.js +15 -4
- package/dist/primitives/manager.js.map +1 -1
- package/dist/primitives/server/McpServerConnectButton.d.ts +10 -6
- package/dist/primitives/server/McpServerConnectButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerConnectButton.js +28 -17
- package/dist/primitives/server/McpServerConnectButton.js.map +1 -1
- package/dist/primitives/server/McpServerDisconnectButton.d.ts +10 -6
- package/dist/primitives/server/McpServerDisconnectButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerDisconnectButton.js +27 -17
- package/dist/primitives/server/McpServerDisconnectButton.js.map +1 -1
- package/dist/primitives/server/McpServerError.d.ts +10 -6
- package/dist/primitives/server/McpServerError.d.ts.map +1 -1
- package/dist/primitives/server/McpServerError.js +15 -8
- package/dist/primitives/server/McpServerError.js.map +1 -1
- package/dist/primitives/server/McpServerIcon.d.ts +16 -14
- package/dist/primitives/server/McpServerIcon.d.ts.map +1 -1
- package/dist/primitives/server/McpServerIcon.js +18 -10
- package/dist/primitives/server/McpServerIcon.js.map +1 -1
- package/dist/primitives/server/McpServerName.d.ts +10 -6
- package/dist/primitives/server/McpServerName.d.ts.map +1 -1
- package/dist/primitives/server/McpServerName.js +14 -6
- package/dist/primitives/server/McpServerName.js.map +1 -1
- package/dist/primitives/server/McpServerOAuthLink.d.ts +13 -11
- package/dist/primitives/server/McpServerOAuthLink.d.ts.map +1 -1
- package/dist/primitives/server/McpServerOAuthLink.js +18 -9
- package/dist/primitives/server/McpServerOAuthLink.js.map +1 -1
- package/dist/primitives/server/McpServerRemoveButton.d.ts +10 -6
- package/dist/primitives/server/McpServerRemoveButton.d.ts.map +1 -1
- package/dist/primitives/server/McpServerRemoveButton.js +21 -14
- package/dist/primitives/server/McpServerRemoveButton.js.map +1 -1
- package/dist/primitives/server/McpServerRoot.d.ts +10 -6
- package/dist/primitives/server/McpServerRoot.d.ts.map +1 -1
- package/dist/primitives/server/McpServerRoot.js +20 -9
- package/dist/primitives/server/McpServerRoot.js.map +1 -1
- package/dist/primitives/server/McpServerStatus.d.ts +10 -6
- package/dist/primitives/server/McpServerStatus.d.ts.map +1 -1
- package/dist/primitives/server/McpServerStatus.js +15 -6
- package/dist/primitives/server/McpServerStatus.js.map +1 -1
- package/dist/primitives/server/McpServerToolName.d.ts +10 -6
- package/dist/primitives/server/McpServerToolName.d.ts.map +1 -1
- package/dist/primitives/server/McpServerToolName.js +15 -6
- package/dist/primitives/server/McpServerToolName.js.map +1 -1
- package/dist/primitives/server/McpServerTools.d.ts +12 -8
- package/dist/primitives/server/McpServerTools.d.ts.map +1 -1
- package/dist/primitives/server/McpServerTools.js +17 -13
- package/dist/primitives/server/McpServerTools.js.map +1 -1
- package/dist/primitives/server.d.ts +18 -11
- package/dist/primitives/server.d.ts.map +1 -1
- package/dist/primitives/server.js +30 -11
- package/dist/primitives/server.js.map +1 -1
- package/dist/resources/McpManagerResource.d.ts +13 -11
- package/dist/resources/McpManagerResource.d.ts.map +1 -1
- package/dist/resources/McpManagerResource.js +149 -183
- package/dist/resources/McpManagerResource.js.map +1 -1
- package/dist/resources/McpServerResource.d.ts +19 -15
- package/dist/resources/McpServerResource.d.ts.map +1 -1
- package/dist/resources/McpServerResource.js +186 -235
- package/dist/resources/McpServerResource.js.map +1 -1
- package/dist/resources/storage/McpCustomStorage.d.ts +6 -2
- package/dist/resources/storage/McpCustomStorage.d.ts.map +1 -1
- package/dist/resources/storage/McpCustomStorage.js +5 -1
- package/dist/resources/storage/McpCustomStorage.js.map +1 -1
- package/dist/resources/storage/McpLocalStorage.d.ts +9 -7
- package/dist/resources/storage/McpLocalStorage.d.ts.map +1 -1
- package/dist/resources/storage/McpLocalStorage.js +51 -62
- package/dist/resources/storage/McpLocalStorage.js.map +1 -1
- package/dist/resources/storage/McpMemoryStorage.d.ts +6 -2
- package/dist/resources/storage/McpMemoryStorage.d.ts.map +1 -1
- package/dist/resources/storage/McpMemoryStorage.js +20 -16
- package/dist/resources/storage/McpMemoryStorage.js.map +1 -1
- package/dist/resources/storage/types.d.ts +14 -10
- package/dist/resources/storage/types.d.ts.map +1 -1
- package/dist/resources/storage/types.js +0 -2
- package/dist/utils/serverId.d.ts +4 -1
- package/dist/utils/serverId.d.ts.map +1 -1
- package/dist/utils/serverId.js +8 -14
- package/dist/utils/serverId.js.map +1 -1
- package/package.json +12 -12
- package/dist/auth/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp-scope.js.map +0 -1
- package/dist/resources/storage/types.js.map +0 -1
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { AddFormAuthType } from "./context.js";
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/addForm/McpAddFormAuthFields.d.ts
|
|
5
|
+
declare namespace McpAddFormPrimitiveAuthFields {
|
|
6
|
+
type Props = {
|
|
7
|
+
/**
|
|
8
|
+
* Optional render override. Receives the current auth type so apps can render
|
|
9
|
+
* fully custom inputs. Defaults to a minimal built-in for bearer / oauth.
|
|
10
|
+
*/
|
|
11
|
+
children?: FC<{
|
|
12
|
+
authType: AddFormAuthType;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
13
15
|
}
|
|
14
|
-
|
|
16
|
+
declare const McpAddFormPrimitiveAuthFields: FC<McpAddFormPrimitiveAuthFields.Props>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { McpAddFormPrimitiveAuthFields };
|
|
15
19
|
//# sourceMappingURL=McpAddFormAuthFields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormAuthFields.d.ts","
|
|
1
|
+
{"version":3,"file":"McpAddFormAuthFields.d.ts","names":[],"sources":["../../../src/primitives/addForm/McpAddFormAuthFields.tsx"],"mappings":";;;;kBAGiB,6BAAA;EAAA,KACH,KAAA;IADG;;;;IAMb,QAAA,GAAW,EAAE;MAAG,QAAA,EAAU,eAAA;IAAA;EAAA;AAAA;AAAA,cAIjB,6BAAA,EAA+B,EAAE,CAC5C,6BAAA,CAA8B,KAAA"}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { useAddForm } from "./context.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/primitives/addForm/McpAddFormAuthFields.tsx
|
|
4
|
+
const McpAddFormPrimitiveAuthFields = ({ children }) => {
|
|
5
|
+
const { state, setField } = useAddForm();
|
|
6
|
+
if (children) return /* @__PURE__ */ jsx(children, { authType: state.authType });
|
|
7
|
+
if (state.authType === "bearer") return /* @__PURE__ */ jsx("input", {
|
|
8
|
+
type: "password",
|
|
9
|
+
placeholder: "Bearer token",
|
|
10
|
+
value: state.bearerToken,
|
|
11
|
+
onChange: (e) => setField("bearerToken", e.target.value),
|
|
12
|
+
"data-mcp-auth-field": "bearer-token"
|
|
13
|
+
});
|
|
14
|
+
if (state.authType === "oauth") return /* @__PURE__ */ jsx("input", {
|
|
15
|
+
type: "text",
|
|
16
|
+
placeholder: "Scopes (space-separated, optional)",
|
|
17
|
+
value: state.scopes,
|
|
18
|
+
onChange: (e) => setField("scopes", e.target.value),
|
|
19
|
+
"data-mcp-auth-field": "oauth-scopes"
|
|
20
|
+
});
|
|
21
|
+
return null;
|
|
16
22
|
};
|
|
17
23
|
McpAddFormPrimitiveAuthFields.displayName = "McpAddFormPrimitive.AuthFields";
|
|
24
|
+
//#endregion
|
|
25
|
+
export { McpAddFormPrimitiveAuthFields };
|
|
26
|
+
|
|
18
27
|
//# sourceMappingURL=McpAddFormAuthFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormAuthFields.js","
|
|
1
|
+
{"version":3,"file":"McpAddFormAuthFields.js","names":["Render"],"sources":["../../../src/primitives/addForm/McpAddFormAuthFields.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { type AddFormAuthType, useAddForm } from \"./context\";\n\nexport namespace McpAddFormPrimitiveAuthFields {\n export type Props = {\n /**\n * Optional render override. Receives the current auth type so apps can render\n * fully custom inputs. Defaults to a minimal built-in for bearer / oauth.\n */\n children?: FC<{ authType: AddFormAuthType }>;\n };\n}\n\nexport const McpAddFormPrimitiveAuthFields: FC<\n McpAddFormPrimitiveAuthFields.Props\n> = ({ children }) => {\n const { state, setField } = useAddForm();\n\n if (children) {\n const Render = children;\n return <Render authType={state.authType} />;\n }\n\n if (state.authType === \"bearer\") {\n return (\n <input\n type=\"password\"\n placeholder=\"Bearer token\"\n value={state.bearerToken}\n onChange={(e) => setField(\"bearerToken\", e.target.value)}\n data-mcp-auth-field=\"bearer-token\"\n />\n );\n }\n\n if (state.authType === \"oauth\") {\n return (\n <input\n type=\"text\"\n placeholder=\"Scopes (space-separated, optional)\"\n value={state.scopes}\n onChange={(e) => setField(\"scopes\", e.target.value)}\n data-mcp-auth-field=\"oauth-scopes\"\n />\n );\n }\n\n return null;\n};\n\nMcpAddFormPrimitiveAuthFields.displayName = \"McpAddFormPrimitive.AuthFields\";\n"],"mappings":";;;AAaA,MAAa,iCAER,EAAE,eAAe;CACpB,MAAM,EAAE,OAAO,aAAa,WAAW;CAEvC,IAAI,UAEF,OAAO,oBAACA,UAAD,EAAQ,UAAU,MAAM,SAAW,CAAA;CAG5C,IAAI,MAAM,aAAa,UACrB,OACE,oBAAC,SAAD;EACE,MAAK;EACL,aAAY;EACZ,OAAO,MAAM;EACb,WAAW,MAAM,SAAS,eAAe,EAAE,OAAO,KAAK;EACvD,uBAAoB;CACrB,CAAA;CAIL,IAAI,MAAM,aAAa,SACrB,OACE,oBAAC,SAAD;EACE,MAAK;EACL,aAAY;EACZ,OAAO,MAAM;EACb,WAAW,MAAM,SAAS,UAAU,EAAE,OAAO,KAAK;EAClD,uBAAoB;CACrB,CAAA;CAIL,OAAO;AACT;AAEA,8BAA8B,cAAc"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/addForm/McpAddFormAuthSelect.d.ts
|
|
5
|
+
declare namespace McpAddFormPrimitiveAuthSelect {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.select>;
|
|
7
|
+
type Props = Omit<ComponentPropsWithoutRef<typeof Primitive.select>, "value" | "onChange">;
|
|
6
8
|
}
|
|
7
|
-
|
|
9
|
+
declare const McpAddFormPrimitiveAuthSelect: import("react").ForwardRefExoticComponent<McpAddFormPrimitiveAuthSelect.Props & import("react").RefAttributes<HTMLSelectElement>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { McpAddFormPrimitiveAuthSelect };
|
|
8
12
|
//# sourceMappingURL=McpAddFormAuthSelect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormAuthSelect.d.ts","
|
|
1
|
+
{"version":3,"file":"McpAddFormAuthSelect.d.ts","names":[],"sources":["../../../src/primitives/addForm/McpAddFormAuthSelect.tsx"],"mappings":";;;;kBAoBiB,6BAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,MAAA;EAAA,KACxC,KAAA,GAAQ,IAAA,CAClB,wBAAA,QAAgC,SAAA,CAAU,MAAA;AAAA;AAAA,cAKjC,6BAAA,kBAA6B,yBAAA,CAAA,6BAAA,CAAA,KAAA,mBAAA,aAAA,CAAA,iBAAA"}
|
|
@@ -1,24 +1,44 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, } from "react";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
1
|
import { useAddForm } from "./context.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/addForm/McpAddFormAuthSelect.tsx
|
|
5
6
|
const AUTH_TYPES = new Set([
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
"none",
|
|
8
|
+
"bearer",
|
|
9
|
+
"oauth"
|
|
9
10
|
]);
|
|
10
11
|
function asAuthType(value) {
|
|
11
|
-
|
|
12
|
-
? value
|
|
13
|
-
: null;
|
|
12
|
+
return AUTH_TYPES.has(value) ? value : null;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const McpAddFormPrimitiveAuthSelect = forwardRef((props, ref) => {
|
|
15
|
+
const { state, setField } = useAddForm();
|
|
16
|
+
return /* @__PURE__ */ jsx(Primitive.select, {
|
|
17
|
+
...props,
|
|
18
|
+
ref,
|
|
19
|
+
value: state.authType,
|
|
20
|
+
onChange: (e) => {
|
|
21
|
+
const next = asAuthType(e.target.value);
|
|
22
|
+
if (next) setField("authType", next);
|
|
23
|
+
},
|
|
24
|
+
children: props.children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx("option", {
|
|
26
|
+
value: "oauth",
|
|
27
|
+
children: "OAuth"
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ jsx("option", {
|
|
30
|
+
value: "bearer",
|
|
31
|
+
children: "Bearer token"
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ jsx("option", {
|
|
34
|
+
value: "none",
|
|
35
|
+
children: "None"
|
|
36
|
+
})
|
|
37
|
+
] })
|
|
38
|
+
});
|
|
22
39
|
});
|
|
23
40
|
McpAddFormPrimitiveAuthSelect.displayName = "McpAddFormPrimitive.AuthSelect";
|
|
41
|
+
//#endregion
|
|
42
|
+
export { McpAddFormPrimitiveAuthSelect };
|
|
43
|
+
|
|
24
44
|
//# sourceMappingURL=McpAddFormAuthSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormAuthSelect.js","
|
|
1
|
+
{"version":3,"file":"McpAddFormAuthSelect.js","names":[],"sources":["../../../src/primitives/addForm/McpAddFormAuthSelect.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAddForm, type AddFormAuthType } from \"./context\";\n\nconst AUTH_TYPES: ReadonlySet<AddFormAuthType> = new Set([\n \"none\",\n \"bearer\",\n \"oauth\",\n]);\n\nfunction asAuthType(value: string): AddFormAuthType | null {\n return (AUTH_TYPES as ReadonlySet<string>).has(value)\n ? (value as AddFormAuthType)\n : null;\n}\n\nexport namespace McpAddFormPrimitiveAuthSelect {\n export type Element = ComponentRef<typeof Primitive.select>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.select>,\n \"value\" | \"onChange\"\n >;\n}\n\nexport const McpAddFormPrimitiveAuthSelect = forwardRef<\n McpAddFormPrimitiveAuthSelect.Element,\n McpAddFormPrimitiveAuthSelect.Props\n>((props, ref) => {\n const { state, setField } = useAddForm();\n return (\n <Primitive.select\n {...props}\n ref={ref}\n value={state.authType}\n onChange={(e) => {\n const next = asAuthType(e.target.value);\n if (next) setField(\"authType\", next);\n }}\n >\n {props.children ?? (\n <>\n <option value=\"oauth\">OAuth</option>\n <option value=\"bearer\">Bearer token</option>\n <option value=\"none\">None</option>\n </>\n )}\n </Primitive.select>\n );\n});\n\nMcpAddFormPrimitiveAuthSelect.displayName = \"McpAddFormPrimitive.AuthSelect\";\n"],"mappings":";;;;;AAQA,MAAM,aAA2C,IAAI,IAAI;CACvD;CACA;CACA;AACF,CAAC;AAED,SAAS,WAAW,OAAuC;CACzD,OAAQ,WAAmC,IAAI,KAAK,IAC/C,QACD;AACN;AAUA,MAAa,gCAAgC,YAG1C,OAAO,QAAQ;CAChB,MAAM,EAAE,OAAO,aAAa,WAAW;CACvC,OACE,oBAAC,UAAU,QAAX;EACE,GAAI;EACC;EACL,OAAO,MAAM;EACb,WAAW,MAAM;GACf,MAAM,OAAO,WAAW,EAAE,OAAO,KAAK;GACtC,IAAI,MAAM,SAAS,YAAY,IAAI;EACrC;YAEC,MAAM,YACL,qBAAA,UAAA,EAAA,UAAA;GACE,oBAAC,UAAD;IAAQ,OAAM;cAAQ;GAAa,CAAA;GACnC,oBAAC,UAAD;IAAQ,OAAM;cAAS;GAAoB,CAAA;GAC3C,oBAAC,UAAD;IAAQ,OAAM;cAAO;GAAY,CAAA;EACjC,EAAA,CAAA;CAEY,CAAA;AAEtB,CAAC;AAED,8BAA8B,cAAc"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/addForm/McpAddFormCancel.d.ts
|
|
5
|
+
declare namespace McpAddFormPrimitiveCancel {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.button>;
|
|
7
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
declare const McpAddFormPrimitiveCancel: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
10
|
+
asChild?: boolean;
|
|
9
11
|
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { McpAddFormPrimitiveCancel };
|
|
10
14
|
//# sourceMappingURL=McpAddFormCancel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormCancel.d.ts","
|
|
1
|
+
{"version":3,"file":"McpAddFormCancel.d.ts","names":[],"sources":["../../../src/primitives/addForm/McpAddFormCancel.tsx"],"mappings":";;;;kBAQiB,yBAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,MAAA;EAAA,KACxC,KAAA,GAAQ,wBAAA,QAAgC,SAAA,CAAU,MAAA;AAAA;AAAA,cAGnD,yBAAA,kBAAyB,yBAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,iBAAA,oBAAA,oBAAA,CAAA,iBAAA"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, } from "react";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
1
|
import { useAddForm } from "./context.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/addForm/McpAddFormCancel.tsx
|
|
6
|
+
const McpAddFormPrimitiveCancel = forwardRef((props, ref) => {
|
|
7
|
+
const { cancel } = useAddForm();
|
|
8
|
+
return /* @__PURE__ */ jsx(Primitive.button, {
|
|
9
|
+
...props,
|
|
10
|
+
type: "button",
|
|
11
|
+
ref,
|
|
12
|
+
onClick: (e) => {
|
|
13
|
+
props.onClick?.(e);
|
|
14
|
+
if (e.defaultPrevented) return;
|
|
15
|
+
cancel();
|
|
16
|
+
}
|
|
17
|
+
});
|
|
13
18
|
});
|
|
14
19
|
McpAddFormPrimitiveCancel.displayName = "McpAddFormPrimitive.Cancel";
|
|
20
|
+
//#endregion
|
|
21
|
+
export { McpAddFormPrimitiveCancel };
|
|
22
|
+
|
|
15
23
|
//# sourceMappingURL=McpAddFormCancel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormCancel.js","
|
|
1
|
+
{"version":3,"file":"McpAddFormCancel.js","names":[],"sources":["../../../src/primitives/addForm/McpAddFormCancel.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAddForm } from \"./context\";\n\nexport namespace McpAddFormPrimitiveCancel {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\nexport const McpAddFormPrimitiveCancel = forwardRef<\n McpAddFormPrimitiveCancel.Element,\n McpAddFormPrimitiveCancel.Props\n>((props, ref) => {\n const { cancel } = useAddForm();\n return (\n <Primitive.button\n {...props}\n type=\"button\"\n ref={ref}\n onClick={(e) => {\n props.onClick?.(e);\n if (e.defaultPrevented) return;\n cancel();\n }}\n />\n );\n});\n\nMcpAddFormPrimitiveCancel.displayName = \"McpAddFormPrimitive.Cancel\";\n"],"mappings":";;;;;AAaA,MAAa,4BAA4B,YAGtC,OAAO,QAAQ;CAChB,MAAM,EAAE,WAAW,WAAW;CAC9B,OACE,oBAAC,UAAU,QAAX;EACE,GAAI;EACJ,MAAK;EACA;EACL,UAAU,MAAM;GACd,MAAM,UAAU,CAAC;GACjB,IAAI,EAAE,kBAAkB;GACxB,OAAO;EACT;CACD,CAAA;AAEL,CAAC;AAED,0BAA0B,cAAc"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/addForm/McpAddFormError.d.ts
|
|
5
|
+
declare namespace McpAddFormPrimitiveError {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.div>;
|
|
7
|
+
type Props = ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
declare const McpAddFormPrimitiveError: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
10
|
+
asChild?: boolean;
|
|
9
11
|
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { McpAddFormPrimitiveError };
|
|
10
14
|
//# sourceMappingURL=McpAddFormError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormError.d.ts","
|
|
1
|
+
{"version":3,"file":"McpAddFormError.d.ts","names":[],"sources":["../../../src/primitives/addForm/McpAddFormError.tsx"],"mappings":";;;;kBAQiB,wBAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,GAAA;EAAA,KACxC,KAAA,GAAQ,wBAAA,QAAgC,SAAA,CAAU,GAAA;AAAA;AAAA,cAGnD,wBAAA,kBAAwB,yBAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,cAAA,oBAAA,cAAA,CAAA,cAAA"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, } from "react";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
1
|
import { useAddForm } from "./context.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/addForm/McpAddFormError.tsx
|
|
6
|
+
const McpAddFormPrimitiveError = forwardRef((props, ref) => {
|
|
7
|
+
const { state } = useAddForm();
|
|
8
|
+
if (!state.error) return null;
|
|
9
|
+
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
10
|
+
...props,
|
|
11
|
+
ref,
|
|
12
|
+
children: props.children ?? state.error
|
|
13
|
+
});
|
|
10
14
|
});
|
|
11
15
|
McpAddFormPrimitiveError.displayName = "McpAddFormPrimitive.Error";
|
|
16
|
+
//#endregion
|
|
17
|
+
export { McpAddFormPrimitiveError };
|
|
18
|
+
|
|
12
19
|
//# sourceMappingURL=McpAddFormError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormError.js","
|
|
1
|
+
{"version":3,"file":"McpAddFormError.js","names":[],"sources":["../../../src/primitives/addForm/McpAddFormError.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAddForm } from \"./context\";\n\nexport namespace McpAddFormPrimitiveError {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\nexport const McpAddFormPrimitiveError = forwardRef<\n McpAddFormPrimitiveError.Element,\n McpAddFormPrimitiveError.Props\n>((props, ref) => {\n const { state } = useAddForm();\n if (!state.error) return null;\n return (\n <Primitive.div {...props} ref={ref}>\n {props.children ?? state.error}\n </Primitive.div>\n );\n});\n\nMcpAddFormPrimitiveError.displayName = \"McpAddFormPrimitive.Error\";\n"],"mappings":";;;;;AAaA,MAAa,2BAA2B,YAGrC,OAAO,QAAQ;CAChB,MAAM,EAAE,UAAU,WAAW;CAC7B,IAAI,CAAC,MAAM,OAAO,OAAO;CACzB,OACE,oBAAC,UAAU,KAAX;EAAe,GAAI;EAAY;YAC5B,MAAM,YAAY,MAAM;CACZ,CAAA;AAEnB,CAAC;AAED,yBAAyB,cAAc"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/addForm/McpAddFormNameField.d.ts
|
|
5
|
+
declare namespace McpAddFormPrimitiveNameField {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.input>;
|
|
7
|
+
type Props = Omit<ComponentPropsWithoutRef<typeof Primitive.input>, "value" | "onChange" | "type">;
|
|
6
8
|
}
|
|
7
|
-
|
|
9
|
+
declare const McpAddFormPrimitiveNameField: import("react").ForwardRefExoticComponent<McpAddFormPrimitiveNameField.Props & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { McpAddFormPrimitiveNameField };
|
|
8
12
|
//# sourceMappingURL=McpAddFormNameField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormNameField.d.ts","
|
|
1
|
+
{"version":3,"file":"McpAddFormNameField.d.ts","names":[],"sources":["../../../src/primitives/addForm/McpAddFormNameField.tsx"],"mappings":";;;;kBAQiB,4BAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,KAAA;EAAA,KACxC,KAAA,GAAQ,IAAA,CAClB,wBAAA,QAAgC,SAAA,CAAU,KAAA;AAAA;AAAA,cAKjC,4BAAA,kBAA4B,yBAAA,CAAA,4BAAA,CAAA,KAAA,mBAAA,aAAA,CAAA,gBAAA"}
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, } from "react";
|
|
3
|
-
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
1
|
import { useAddForm } from "./context.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/addForm/McpAddFormNameField.tsx
|
|
6
|
+
const McpAddFormPrimitiveNameField = forwardRef((props, ref) => {
|
|
7
|
+
const { state, setField } = useAddForm();
|
|
8
|
+
return /* @__PURE__ */ jsx(Primitive.input, {
|
|
9
|
+
type: "text",
|
|
10
|
+
placeholder: "Name",
|
|
11
|
+
...props,
|
|
12
|
+
ref,
|
|
13
|
+
value: state.name,
|
|
14
|
+
onChange: (e) => setField("name", e.target.value)
|
|
15
|
+
});
|
|
8
16
|
});
|
|
9
17
|
McpAddFormPrimitiveNameField.displayName = "McpAddFormPrimitive.NameField";
|
|
18
|
+
//#endregion
|
|
19
|
+
export { McpAddFormPrimitiveNameField };
|
|
20
|
+
|
|
10
21
|
//# sourceMappingURL=McpAddFormNameField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormNameField.js","
|
|
1
|
+
{"version":3,"file":"McpAddFormNameField.js","names":[],"sources":["../../../src/primitives/addForm/McpAddFormNameField.tsx"],"sourcesContent":["import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n} from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useAddForm } from \"./context\";\n\nexport namespace McpAddFormPrimitiveNameField {\n export type Element = ComponentRef<typeof Primitive.input>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.input>,\n \"value\" | \"onChange\" | \"type\"\n >;\n}\n\nexport const McpAddFormPrimitiveNameField = forwardRef<\n McpAddFormPrimitiveNameField.Element,\n McpAddFormPrimitiveNameField.Props\n>((props, ref) => {\n const { state, setField } = useAddForm();\n return (\n <Primitive.input\n type=\"text\"\n placeholder=\"Name\"\n {...props}\n ref={ref}\n value={state.name}\n onChange={(e) => setField(\"name\", e.target.value)}\n />\n );\n});\n\nMcpAddFormPrimitiveNameField.displayName = \"McpAddFormPrimitive.NameField\";\n"],"mappings":";;;;;AAgBA,MAAa,+BAA+B,YAGzC,OAAO,QAAQ;CAChB,MAAM,EAAE,OAAO,aAAa,WAAW;CACvC,OACE,oBAAC,UAAU,OAAX;EACE,MAAK;EACL,aAAY;EACZ,GAAI;EACC;EACL,OAAO,MAAM;EACb,WAAW,MAAM,SAAS,QAAQ,EAAE,OAAO,KAAK;CACjD,CAAA;AAEL,CAAC;AAED,6BAA6B,cAAc"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentRef } from "react";
|
|
2
2
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare const McpAddFormPrimitiveRoot: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLFormElement> & import("react").FormHTMLAttributes<HTMLFormElement> & {
|
|
11
|
-
asChild?: boolean;
|
|
12
|
-
}, "ref">, "onSubmit"> & {
|
|
3
|
+
|
|
4
|
+
//#region src/primitives/addForm/McpAddFormRoot.d.ts
|
|
5
|
+
declare namespace McpAddFormPrimitiveRoot {
|
|
6
|
+
type Element = ComponentRef<typeof Primitive.form>;
|
|
7
|
+
type Props = Omit<ComponentPropsWithoutRef<typeof Primitive.form>, "onSubmit"> & {
|
|
13
8
|
onSubmitted?: (id: string) => void;
|
|
14
9
|
onCancel?: () => void;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
declare const McpAddFormPrimitiveRoot: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLFormElement> & import("react").FormHTMLAttributes<HTMLFormElement> & {
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
}, "ref">, "onSubmit"> & {
|
|
15
|
+
onSubmitted?: (id: string) => void;
|
|
16
|
+
onCancel?: () => void;
|
|
15
17
|
} & import("react").RefAttributes<HTMLFormElement>>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { McpAddFormPrimitiveRoot };
|
|
16
20
|
//# sourceMappingURL=McpAddFormRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpAddFormRoot.d.ts","
|
|
1
|
+
{"version":3,"file":"McpAddFormRoot.d.ts","names":[],"sources":["../../../src/primitives/addForm/McpAddFormRoot.tsx"],"mappings":";;;;kBAuCiB,uBAAA;EAAA,KACH,OAAA,GAAU,YAAA,QAAoB,SAAA,CAAU,IAAA;EAAA,KACxC,KAAA,GAAQ,IAAA,CAClB,wBAAA,QAAgC,SAAA,CAAU,IAAA;IAG1C,WAAA,IAAe,EAAA;IACf,QAAA;EAAA;AAAA;AAAA,cAIS,uBAAA,kBAAuB,yBAAA,CAAA,IAAA,CAAA,IAAA,iBAAA,eAAA,CAAA,eAAA,oBAAA,kBAAA,CAAA,eAAA;;;iBALjB,EAAA"}
|