@nucleux/connector-card 0.1.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/README.md +26 -0
- package/dist/index.cjs +88 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nucleux
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @nucleux/connector-card
|
|
2
|
+
|
|
3
|
+
ConnectorCard — enable an external tool or data connector — Nucleux agentic UI for React.
|
|
4
|
+
|
|
5
|
+
Part of **[Nucleux](https://github.com/intelligaia-open-labs/nucleux)** — agentic UI components for React. Install a single component, or the full kit via [`@nucleux/react`](https://www.npmjs.com/package/@nucleux/react).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @nucleux/connector-card @nucleux/tokens
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`react` / `react-dom` are peer dependencies.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { ConnectorCard } from "@nucleux/connector-card";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Requires the theme once in your app: `import "@nucleux/tokens/styles.css";`
|
|
22
|
+
and the Tailwind preset from `@nucleux/tokens/preset`.
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
MIT © Nucleux
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var utils = require('@nucleux/utils');
|
|
6
|
+
var lucideReact = require('lucide-react');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
|
+
|
|
29
|
+
// src/index.tsx
|
|
30
|
+
var ConnectorCard = React__namespace.forwardRef(
|
|
31
|
+
({
|
|
32
|
+
name,
|
|
33
|
+
description,
|
|
34
|
+
icon,
|
|
35
|
+
connected = false,
|
|
36
|
+
onConnect,
|
|
37
|
+
onDisconnect,
|
|
38
|
+
connectLabel = "Connect",
|
|
39
|
+
disconnectLabel = "Disconnect",
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
ref,
|
|
46
|
+
className: utils.cn(
|
|
47
|
+
"flex items-center gap-3 rounded-xl border border-border bg-background p-4",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...props,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg]:size-5", children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plug, { "aria-hidden": "true" }) }),
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: name }),
|
|
55
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: description })
|
|
56
|
+
] }),
|
|
57
|
+
connected ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
58
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-xs font-medium text-success [&_svg]:size-3.5", children: [
|
|
59
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { "aria-hidden": "true" }),
|
|
60
|
+
"Connected"
|
|
61
|
+
] }),
|
|
62
|
+
onDisconnect && /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
+
"button",
|
|
64
|
+
{
|
|
65
|
+
type: "button",
|
|
66
|
+
onClick: onDisconnect,
|
|
67
|
+
className: "rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
68
|
+
children: disconnectLabel
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
"button",
|
|
73
|
+
{
|
|
74
|
+
type: "button",
|
|
75
|
+
onClick: onConnect,
|
|
76
|
+
className: "inline-flex shrink-0 items-center rounded-lg border border-border bg-background px-3 py-1.5 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
77
|
+
children: connectLabel
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
);
|
|
84
|
+
ConnectorCard.displayName = "ConnectorCard";
|
|
85
|
+
|
|
86
|
+
exports.ConnectorCard = ConnectorCard;
|
|
87
|
+
//# sourceMappingURL=index.cjs.map
|
|
88
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"names":["React","jsxs","cn","jsx","Plug","Check"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,IAAM,aAAA,GAAsBA,gBAAA,CAAA,UAAA;AAAA,EACjC,CACE;AAAA,IACE,IAAA;AAAA,IACA,WAAA;AAAA,IACA,IAAA;AAAA,IACA,SAAA,GAAY,KAAA;AAAA,IACZ,SAAA;AAAA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,mBAEAA,cAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,QAAA;AAAA,YACL,OAAA,EAAS,SAAA;AAAA,YACT,SAAA,EAAU,qPAAA;AAAA,YAET,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA;AAIR;AACA,aAAA,CAAc,WAAA,GAAc,eAAA","file":"index.cjs","sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@nucleux/utils\";\nimport { Plug, Check } from \"lucide-react\";\n\nexport interface ConnectorCardProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Connector name, e.g. `\"GitHub\"`. */\n name: React.ReactNode;\n /** What the connector gives the agent access to. */\n description?: React.ReactNode;\n /** Connector logo/icon. Defaults to a plug glyph. */\n icon?: React.ReactNode;\n /** Whether the connector is already connected. */\n connected?: boolean;\n /** Called to connect. Renders the connect button when set and not connected. */\n onConnect?: () => void;\n /** Called to disconnect. Renders a manage/disconnect control when connected. */\n onDisconnect?: () => void;\n connectLabel?: React.ReactNode;\n disconnectLabel?: React.ReactNode;\n}\n\n/**\n * A card to enable an external tool or data connector for the agent — icon,\n * name, what it unlocks, and a connect action.\n * Source: Figma \"Context Expansion / Connector suggestion card\".\n */\nexport const ConnectorCard = React.forwardRef<HTMLDivElement, ConnectorCardProps>(\n (\n {\n name,\n description,\n icon,\n connected = false,\n onConnect,\n onDisconnect,\n connectLabel = \"Connect\",\n disconnectLabel = \"Disconnect\",\n className,\n ...props\n },\n ref,\n ) => (\n <div\n ref={ref}\n className={cn(\n \"flex items-center gap-3 rounded-xl border border-border bg-background p-4\",\n className,\n )}\n {...props}\n >\n <span className=\"inline-flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg]:size-5\">\n {icon ?? <Plug aria-hidden=\"true\" />}\n </span>\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"text-sm font-medium text-foreground\">{name}</span>\n {description && <span className=\"text-xs text-muted-foreground\">{description}</span>}\n </div>\n {connected ? (\n <div className=\"flex shrink-0 items-center gap-2\">\n <span className=\"inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-xs font-medium text-success [&_svg]:size-3.5\">\n <Check aria-hidden=\"true\" />\n Connected\n </span>\n {onDisconnect && (\n <button\n type=\"button\"\n onClick={onDisconnect}\n className=\"rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {disconnectLabel}\n </button>\n )}\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={onConnect}\n className=\"inline-flex shrink-0 items-center rounded-lg border border-border bg-background px-3 py-1.5 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {connectLabel}\n </button>\n )}\n </div>\n ),\n);\nConnectorCard.displayName = \"ConnectorCard\";\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ConnectorCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
4
|
+
/** Connector name, e.g. `"GitHub"`. */
|
|
5
|
+
name: React.ReactNode;
|
|
6
|
+
/** What the connector gives the agent access to. */
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
/** Connector logo/icon. Defaults to a plug glyph. */
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
/** Whether the connector is already connected. */
|
|
11
|
+
connected?: boolean;
|
|
12
|
+
/** Called to connect. Renders the connect button when set and not connected. */
|
|
13
|
+
onConnect?: () => void;
|
|
14
|
+
/** Called to disconnect. Renders a manage/disconnect control when connected. */
|
|
15
|
+
onDisconnect?: () => void;
|
|
16
|
+
connectLabel?: React.ReactNode;
|
|
17
|
+
disconnectLabel?: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A card to enable an external tool or data connector for the agent — icon,
|
|
21
|
+
* name, what it unlocks, and a connect action.
|
|
22
|
+
* Source: Figma "Context Expansion / Connector suggestion card".
|
|
23
|
+
*/
|
|
24
|
+
declare const ConnectorCard: React.ForwardRefExoticComponent<ConnectorCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
|
|
26
|
+
export { ConnectorCard, type ConnectorCardProps };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ConnectorCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
4
|
+
/** Connector name, e.g. `"GitHub"`. */
|
|
5
|
+
name: React.ReactNode;
|
|
6
|
+
/** What the connector gives the agent access to. */
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
/** Connector logo/icon. Defaults to a plug glyph. */
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
/** Whether the connector is already connected. */
|
|
11
|
+
connected?: boolean;
|
|
12
|
+
/** Called to connect. Renders the connect button when set and not connected. */
|
|
13
|
+
onConnect?: () => void;
|
|
14
|
+
/** Called to disconnect. Renders a manage/disconnect control when connected. */
|
|
15
|
+
onDisconnect?: () => void;
|
|
16
|
+
connectLabel?: React.ReactNode;
|
|
17
|
+
disconnectLabel?: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A card to enable an external tool or data connector for the agent — icon,
|
|
21
|
+
* name, what it unlocks, and a connect action.
|
|
22
|
+
* Source: Figma "Context Expansion / Connector suggestion card".
|
|
23
|
+
*/
|
|
24
|
+
declare const ConnectorCard: React.ForwardRefExoticComponent<ConnectorCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
|
|
26
|
+
export { ConnectorCard, type ConnectorCardProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { cn } from '@nucleux/utils';
|
|
4
|
+
import { Plug, Check } from 'lucide-react';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
// src/index.tsx
|
|
8
|
+
var ConnectorCard = React.forwardRef(
|
|
9
|
+
({
|
|
10
|
+
name,
|
|
11
|
+
description,
|
|
12
|
+
icon,
|
|
13
|
+
connected = false,
|
|
14
|
+
onConnect,
|
|
15
|
+
onDisconnect,
|
|
16
|
+
connectLabel = "Connect",
|
|
17
|
+
disconnectLabel = "Disconnect",
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
}, ref) => /* @__PURE__ */ jsxs(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
className: cn(
|
|
25
|
+
"flex items-center gap-3 rounded-xl border border-border bg-background p-4",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...props,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: "inline-flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg]:size-5", children: icon ?? /* @__PURE__ */ jsx(Plug, { "aria-hidden": "true" }) }),
|
|
31
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
32
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: name }),
|
|
33
|
+
description && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: description })
|
|
34
|
+
] }),
|
|
35
|
+
connected ? /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-xs font-medium text-success [&_svg]:size-3.5", children: [
|
|
37
|
+
/* @__PURE__ */ jsx(Check, { "aria-hidden": "true" }),
|
|
38
|
+
"Connected"
|
|
39
|
+
] }),
|
|
40
|
+
onDisconnect && /* @__PURE__ */ jsx(
|
|
41
|
+
"button",
|
|
42
|
+
{
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: onDisconnect,
|
|
45
|
+
className: "rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
46
|
+
children: disconnectLabel
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] }) : /* @__PURE__ */ jsx(
|
|
50
|
+
"button",
|
|
51
|
+
{
|
|
52
|
+
type: "button",
|
|
53
|
+
onClick: onConnect,
|
|
54
|
+
className: "inline-flex shrink-0 items-center rounded-lg border border-border bg-background px-3 py-1.5 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
55
|
+
children: connectLabel
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
);
|
|
62
|
+
ConnectorCard.displayName = "ConnectorCard";
|
|
63
|
+
|
|
64
|
+
export { ConnectorCard };
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;AA2BO,IAAM,aAAA,GAAsB,KAAA,CAAA,UAAA;AAAA,EACjC,CACE;AAAA,IACE,IAAA;AAAA,IACA,WAAA;AAAA,IACA,IAAA;AAAA,IACA,SAAA,GAAY,KAAA;AAAA,IACZ,SAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA,GAAe,SAAA;AAAA,IACf,eAAA,GAAkB,YAAA;AAAA,IAClB,SAAA;AAAA,IACA,GAAG;AAAA,KAEL,GAAA,qBAEA,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,SAAA,EAAW,EA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","file":"index.js","sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@nucleux/utils\";\nimport { Plug, Check } from \"lucide-react\";\n\nexport interface ConnectorCardProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Connector name, e.g. `\"GitHub\"`. */\n name: React.ReactNode;\n /** What the connector gives the agent access to. */\n description?: React.ReactNode;\n /** Connector logo/icon. Defaults to a plug glyph. */\n icon?: React.ReactNode;\n /** Whether the connector is already connected. */\n connected?: boolean;\n /** Called to connect. Renders the connect button when set and not connected. */\n onConnect?: () => void;\n /** Called to disconnect. Renders a manage/disconnect control when connected. */\n onDisconnect?: () => void;\n connectLabel?: React.ReactNode;\n disconnectLabel?: React.ReactNode;\n}\n\n/**\n * A card to enable an external tool or data connector for the agent — icon,\n * name, what it unlocks, and a connect action.\n * Source: Figma \"Context Expansion / Connector suggestion card\".\n */\nexport const ConnectorCard = React.forwardRef<HTMLDivElement, ConnectorCardProps>(\n (\n {\n name,\n description,\n icon,\n connected = false,\n onConnect,\n onDisconnect,\n connectLabel = \"Connect\",\n disconnectLabel = \"Disconnect\",\n className,\n ...props\n },\n ref,\n ) => (\n <div\n ref={ref}\n className={cn(\n \"flex items-center gap-3 rounded-xl border border-border bg-background p-4\",\n className,\n )}\n {...props}\n >\n <span className=\"inline-flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg]:size-5\">\n {icon ?? <Plug aria-hidden=\"true\" />}\n </span>\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"text-sm font-medium text-foreground\">{name}</span>\n {description && <span className=\"text-xs text-muted-foreground\">{description}</span>}\n </div>\n {connected ? (\n <div className=\"flex shrink-0 items-center gap-2\">\n <span className=\"inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-xs font-medium text-success [&_svg]:size-3.5\">\n <Check aria-hidden=\"true\" />\n Connected\n </span>\n {onDisconnect && (\n <button\n type=\"button\"\n onClick={onDisconnect}\n className=\"rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {disconnectLabel}\n </button>\n )}\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={onConnect}\n className=\"inline-flex shrink-0 items-center rounded-lg border border-border bg-background px-3 py-1.5 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {connectLabel}\n </button>\n )}\n </div>\n ),\n);\nConnectorCard.displayName = \"ConnectorCard\";\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nucleux/connector-card",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"description": "ConnectorCard — enable an external tool or data connector — Nucleux agentic UI for React.",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"nucleux",
|
|
9
|
+
"react",
|
|
10
|
+
"ui",
|
|
11
|
+
"components",
|
|
12
|
+
"agentic",
|
|
13
|
+
"ai",
|
|
14
|
+
"tailwind",
|
|
15
|
+
"connector-card"
|
|
16
|
+
],
|
|
17
|
+
"main": "./dist/index.cjs",
|
|
18
|
+
"module": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"require": "./dist/index.cjs"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"react": ">=18",
|
|
33
|
+
"react-dom": ">=18"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"lucide-react": "^0.469.0",
|
|
37
|
+
"@nucleux/utils": "0.1.1"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"tsup": "^8.3.5",
|
|
41
|
+
"typescript": "^5.7.2",
|
|
42
|
+
"@types/react": "^18.3.18",
|
|
43
|
+
"react": "^18.3.1"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/intelligaia-open-labs/nucleux.git",
|
|
52
|
+
"directory": "packages/connector-card"
|
|
53
|
+
},
|
|
54
|
+
"homepage": "https://github.com/intelligaia-open-labs/nucleux#readme",
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "tsup"
|
|
57
|
+
}
|
|
58
|
+
}
|