@adoptai/genui-components 0.1.58 → 0.1.59
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/dist/composites/document-field-extraction/resolver.cjs +1920 -0
- package/dist/composites/document-field-extraction/resolver.cjs.map +1 -0
- package/dist/composites/document-field-extraction/resolver.js +1913 -0
- package/dist/composites/document-field-extraction/resolver.js.map +1 -0
- package/dist/composites/tabby-auth/resolver.cjs +597 -0
- package/dist/composites/tabby-auth/resolver.cjs.map +1 -0
- package/dist/composites/tabby-auth/resolver.d.ts +3 -0
- package/dist/composites/tabby-auth/resolver.d.ts.map +1 -0
- package/dist/composites/tabby-auth/resolver.js +595 -0
- package/dist/composites/tabby-auth/resolver.js.map +1 -0
- package/dist/composites/workflow-stepper/resolver.cjs +86 -18
- package/dist/composites/workflow-stepper/resolver.cjs.map +1 -1
- package/dist/composites/workflow-stepper/resolver.d.ts.map +1 -1
- package/dist/composites/workflow-stepper/resolver.js +86 -18
- package/dist/composites/workflow-stepper/resolver.js.map +1 -1
- package/dist/index.cjs +492 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +492 -27
- package/dist/index.js.map +1 -1
- package/dist/renderer.cjs +492 -27
- package/dist/renderer.cjs.map +1 -1
- package/dist/renderer.js +492 -27
- package/dist/renderer.js.map +1 -1
- package/dist/resolver.cjs +492 -27
- package/dist/resolver.cjs.map +1 -1
- package/dist/resolver.d.ts.map +1 -1
- package/dist/resolver.js +492 -27
- package/dist/resolver.js.map +1 -1
- package/dist/schemas/index.cjs +84 -3
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.ts +118 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +84 -3
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/tabby-auth.d.ts +58 -0
- package/dist/schemas/tabby-auth.d.ts.map +1 -0
- package/dist/schemas/workflow-stepper.d.ts +60 -0
- package/dist/schemas/workflow-stepper.d.ts.map +1 -1
- package/dist/tool-definitions.json +102 -3
- package/package.json +1 -1
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var htmlToImage = require('html-to-image');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
// src/shared/theme.ts
|
|
9
|
+
var BORDER = "#dedede";
|
|
10
|
+
var MUTED = "#777777";
|
|
11
|
+
var PAPER = "#f6f6f6";
|
|
12
|
+
var ACCENT = "#ff5000";
|
|
13
|
+
var ACCENT_SOFT = "#cc4000";
|
|
14
|
+
var SECONDARY = "#0364ff";
|
|
15
|
+
var CHART_PALETTE = [
|
|
16
|
+
"#ff5000",
|
|
17
|
+
"#0364ff",
|
|
18
|
+
"#16a34a",
|
|
19
|
+
"#dc2626",
|
|
20
|
+
"#7c3aed",
|
|
21
|
+
"#0891b2",
|
|
22
|
+
"#f59e0b",
|
|
23
|
+
"#6366f1",
|
|
24
|
+
"#ec4899",
|
|
25
|
+
"#84cc16",
|
|
26
|
+
"#e11d48",
|
|
27
|
+
"#0ea5e9"
|
|
28
|
+
];
|
|
29
|
+
function ColumnSettingsPanel({ columns, hidden, onToggle, onShowAll, onHideAll }) {
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px", minWidth: "180px" }, children: [
|
|
31
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", paddingBottom: "4px", borderBottom: `1px solid ${BORDER}` }, children: [
|
|
32
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
33
|
+
"button",
|
|
34
|
+
{
|
|
35
|
+
onClick: onShowAll,
|
|
36
|
+
style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: ACCENT, fontWeight: 500, padding: 0 },
|
|
37
|
+
children: "Show all"
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
+
"button",
|
|
42
|
+
{
|
|
43
|
+
onClick: onHideAll,
|
|
44
|
+
style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: MUTED, fontWeight: 500, padding: 0 },
|
|
45
|
+
children: "Hide all"
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
] }),
|
|
49
|
+
columns.map((col) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
50
|
+
"label",
|
|
51
|
+
{
|
|
52
|
+
style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer", fontSize: "12px", color: "var(--foreground)" },
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
+
"input",
|
|
56
|
+
{
|
|
57
|
+
type: "checkbox",
|
|
58
|
+
checked: !hidden.has(col.key),
|
|
59
|
+
onChange: () => onToggle(col.key),
|
|
60
|
+
style: { accentColor: ACCENT, width: "14px", height: "14px", margin: 0, cursor: "pointer" }
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
col.label
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
col.key
|
|
67
|
+
))
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
var DOT_COLOR = "#aaaaaa";
|
|
71
|
+
var DOT_HOVER = "#555555";
|
|
72
|
+
function ComponentActions({ children, onDownloadCSV, columnConfig, filename = "component" }) {
|
|
73
|
+
const [open, setOpen] = react.useState(false);
|
|
74
|
+
const [view, setView] = react.useState("main");
|
|
75
|
+
const contentRef = react.useRef(null);
|
|
76
|
+
const menuRef = react.useRef(null);
|
|
77
|
+
const btnRef = react.useRef(null);
|
|
78
|
+
const close = react.useCallback(() => {
|
|
79
|
+
setOpen(false);
|
|
80
|
+
setView("main");
|
|
81
|
+
}, []);
|
|
82
|
+
react.useEffect(() => {
|
|
83
|
+
if (!open) return;
|
|
84
|
+
const handler = (e) => {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
if ((_a = menuRef.current) == null ? void 0 : _a.contains(e.target)) return;
|
|
87
|
+
if ((_b = btnRef.current) == null ? void 0 : _b.contains(e.target)) return;
|
|
88
|
+
close();
|
|
89
|
+
};
|
|
90
|
+
document.addEventListener("mousedown", handler);
|
|
91
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
92
|
+
}, [open, close]);
|
|
93
|
+
const handleDownloadPNG = react.useCallback(async () => {
|
|
94
|
+
if (!contentRef.current) return;
|
|
95
|
+
try {
|
|
96
|
+
const url = await htmlToImage.toPng(contentRef.current, { backgroundColor: "white", pixelRatio: 2 });
|
|
97
|
+
const a = document.createElement("a");
|
|
98
|
+
a.href = url;
|
|
99
|
+
a.download = `${filename}.png`;
|
|
100
|
+
a.click();
|
|
101
|
+
} catch (e) {
|
|
102
|
+
}
|
|
103
|
+
close();
|
|
104
|
+
}, [filename, close]);
|
|
105
|
+
const handleCSV = react.useCallback(() => {
|
|
106
|
+
onDownloadCSV == null ? void 0 : onDownloadCSV();
|
|
107
|
+
close();
|
|
108
|
+
}, [onDownloadCSV, close]);
|
|
109
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
110
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: contentRef, style: { width: "100%" }, children }),
|
|
111
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: "4px", position: "relative", zIndex: 10, flexShrink: 0 }, children: [
|
|
112
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
113
|
+
"button",
|
|
114
|
+
{
|
|
115
|
+
ref: btnRef,
|
|
116
|
+
onClick: () => {
|
|
117
|
+
setOpen((o) => !o);
|
|
118
|
+
setView("main");
|
|
119
|
+
},
|
|
120
|
+
"aria-label": "Component actions",
|
|
121
|
+
style: {
|
|
122
|
+
background: "none",
|
|
123
|
+
border: "none",
|
|
124
|
+
cursor: "pointer",
|
|
125
|
+
padding: "4px 8px",
|
|
126
|
+
display: "flex",
|
|
127
|
+
gap: "3px",
|
|
128
|
+
alignItems: "center",
|
|
129
|
+
borderRadius: "6px",
|
|
130
|
+
transition: "background 0.15s"
|
|
131
|
+
},
|
|
132
|
+
onMouseEnter: (e) => {
|
|
133
|
+
e.currentTarget.style.background = "#f2f2f2";
|
|
134
|
+
e.currentTarget.querySelectorAll("circle").forEach((c) => c.style.fill = DOT_HOVER);
|
|
135
|
+
},
|
|
136
|
+
onMouseLeave: (e) => {
|
|
137
|
+
e.currentTarget.style.background = "none";
|
|
138
|
+
e.currentTarget.querySelectorAll("circle").forEach((c) => c.style.fill = DOT_COLOR);
|
|
139
|
+
},
|
|
140
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "6", viewBox: "0 0 20 6", children: [
|
|
141
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "3", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } }),
|
|
142
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "10", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } }),
|
|
143
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "17", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } })
|
|
144
|
+
] })
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
ref: menuRef,
|
|
151
|
+
style: {
|
|
152
|
+
position: "absolute",
|
|
153
|
+
bottom: "100%",
|
|
154
|
+
right: 0,
|
|
155
|
+
marginBottom: "4px",
|
|
156
|
+
background: "white",
|
|
157
|
+
border: `1px solid ${BORDER}`,
|
|
158
|
+
borderRadius: "0.75rem",
|
|
159
|
+
boxShadow: "0 4px 12px rgba(0,0,0,0.06)",
|
|
160
|
+
zIndex: 50,
|
|
161
|
+
padding: view === "columns" ? "10px" : "4px",
|
|
162
|
+
minWidth: view === "columns" ? "200px" : "160px"
|
|
163
|
+
},
|
|
164
|
+
children: view === "main" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
165
|
+
columnConfig && /* @__PURE__ */ jsxRuntime.jsx(MenuButton, { label: "Customize columns", onClick: () => setView("columns") }),
|
|
166
|
+
onDownloadCSV && /* @__PURE__ */ jsxRuntime.jsx(MenuButton, { label: "Download CSV", onClick: handleCSV }),
|
|
167
|
+
/* @__PURE__ */ jsxRuntime.jsx(MenuButton, { label: "Download PNG", onClick: handleDownloadPNG })
|
|
168
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
169
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
170
|
+
"button",
|
|
171
|
+
{
|
|
172
|
+
onClick: () => setView("main"),
|
|
173
|
+
style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: MUTED, marginBottom: "6px", padding: 0 },
|
|
174
|
+
children: "\u2190 Back"
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
178
|
+
ColumnSettingsPanel,
|
|
179
|
+
{
|
|
180
|
+
columns: columnConfig.columns,
|
|
181
|
+
hidden: columnConfig.hidden,
|
|
182
|
+
onToggle: columnConfig.onToggle,
|
|
183
|
+
onShowAll: columnConfig.onShowAll,
|
|
184
|
+
onHideAll: columnConfig.onHideAll
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
] })
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
] })
|
|
191
|
+
] });
|
|
192
|
+
}
|
|
193
|
+
function MenuButton({ label, onClick }) {
|
|
194
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
195
|
+
"button",
|
|
196
|
+
{
|
|
197
|
+
onClick,
|
|
198
|
+
style: {
|
|
199
|
+
background: "none",
|
|
200
|
+
border: "none",
|
|
201
|
+
cursor: "pointer",
|
|
202
|
+
padding: "8px 12px",
|
|
203
|
+
fontSize: "12.5px",
|
|
204
|
+
color: "var(--foreground)",
|
|
205
|
+
textAlign: "left",
|
|
206
|
+
borderRadius: "8px",
|
|
207
|
+
transition: "background 0.15s",
|
|
208
|
+
whiteSpace: "nowrap"
|
|
209
|
+
},
|
|
210
|
+
onMouseEnter: (e) => e.currentTarget.style.background = "#f2f2f2",
|
|
211
|
+
onMouseLeave: (e) => e.currentTarget.style.background = "none",
|
|
212
|
+
children: label
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
var DEFAULT_TOKENS = {
|
|
217
|
+
BORDER,
|
|
218
|
+
MUTED,
|
|
219
|
+
PAPER,
|
|
220
|
+
ACCENT,
|
|
221
|
+
ACCENT_SOFT,
|
|
222
|
+
SECONDARY,
|
|
223
|
+
CHART_PALETTE: [...CHART_PALETTE]
|
|
224
|
+
};
|
|
225
|
+
var GenUIThemeContext = react.createContext(DEFAULT_TOKENS);
|
|
226
|
+
function useTheme() {
|
|
227
|
+
return react.useContext(GenUIThemeContext);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// src/shared/brandIcons.ts
|
|
231
|
+
var SLUGS = {
|
|
232
|
+
gmail: "gmail",
|
|
233
|
+
googlemail: "gmail",
|
|
234
|
+
outlook: "microsoftoutlook",
|
|
235
|
+
microsoftoutlook: "microsoftoutlook",
|
|
236
|
+
office365: "microsoftoffice",
|
|
237
|
+
slack: "slack",
|
|
238
|
+
googledrive: "googledrive",
|
|
239
|
+
drive: "googledrive",
|
|
240
|
+
googlesheets: "googlesheets",
|
|
241
|
+
googledocs: "googledocs",
|
|
242
|
+
googlecalendar: "googlecalendar",
|
|
243
|
+
gcal: "googlecalendar",
|
|
244
|
+
notion: "notion",
|
|
245
|
+
salesforce: "salesforce",
|
|
246
|
+
hubspot: "hubspot",
|
|
247
|
+
github: "github",
|
|
248
|
+
gitlab: "gitlab",
|
|
249
|
+
jira: "jira",
|
|
250
|
+
confluence: "confluence",
|
|
251
|
+
atlassian: "atlassian",
|
|
252
|
+
asana: "asana",
|
|
253
|
+
trello: "trello",
|
|
254
|
+
linear: "linear",
|
|
255
|
+
zoom: "zoom",
|
|
256
|
+
dropbox: "dropbox",
|
|
257
|
+
box: "box",
|
|
258
|
+
zendesk: "zendesk",
|
|
259
|
+
intercom: "intercom",
|
|
260
|
+
stripe: "stripe",
|
|
261
|
+
shopify: "shopify",
|
|
262
|
+
perplexity: "perplexity",
|
|
263
|
+
openai: "openai",
|
|
264
|
+
anthropic: "anthropic",
|
|
265
|
+
fireflies: "fireflies",
|
|
266
|
+
zohodesk: "zoho",
|
|
267
|
+
zoho: "zoho",
|
|
268
|
+
pipedrive: "pipedrive",
|
|
269
|
+
workday: "workday",
|
|
270
|
+
sap: "sap",
|
|
271
|
+
odoo: "odoo",
|
|
272
|
+
superset: "apachesuperset",
|
|
273
|
+
highradius: "",
|
|
274
|
+
zoominfo: ""
|
|
275
|
+
};
|
|
276
|
+
function normalize(name) {
|
|
277
|
+
return (name || "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
278
|
+
}
|
|
279
|
+
function brandIconUrl(name) {
|
|
280
|
+
const slug = SLUGS[normalize(name)];
|
|
281
|
+
if (!slug) return void 0;
|
|
282
|
+
return `https://cdn.simpleicons.org/${slug}`;
|
|
283
|
+
}
|
|
284
|
+
var CONNECTED_GREEN = "#15803d";
|
|
285
|
+
var CONNECTED_GREEN_BG = "#dcfce7";
|
|
286
|
+
var PENDING_AMBER = "#92400e";
|
|
287
|
+
var PENDING_AMBER_BG = "#fff7ed";
|
|
288
|
+
var CARD_TITLE = "Authentication required";
|
|
289
|
+
var TRUST_FOOTER = "Credentials not stored by Adopt";
|
|
290
|
+
var DEFAULT_STEPS = (app, ctaLabel, connected) => connected ? [
|
|
291
|
+
`Click ${ctaLabel} below to open ${app} in a new tab.`,
|
|
292
|
+
"Confirm you are signed in \u2014 re-authenticate if prompted.",
|
|
293
|
+
"Return here \u2014 the request continues automatically."
|
|
294
|
+
] : [
|
|
295
|
+
`Click ${ctaLabel} below to open the sign-in page.`,
|
|
296
|
+
`Sign in with your ${app} credentials \u2014 SSO is supported.`,
|
|
297
|
+
"Return here \u2014 the request resumes automatically."
|
|
298
|
+
];
|
|
299
|
+
function humanizeApp(raw) {
|
|
300
|
+
const v = raw.trim();
|
|
301
|
+
if (!v) return v;
|
|
302
|
+
const looksLikeSlug = /^[a-z0-9]+([_-][a-z0-9]+)*$/.test(v);
|
|
303
|
+
if (!looksLikeSlug) return v;
|
|
304
|
+
return v.split(/[_-]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
|
|
305
|
+
}
|
|
306
|
+
function ShieldIcon({ color }) {
|
|
307
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
308
|
+
"svg",
|
|
309
|
+
{
|
|
310
|
+
width: "13",
|
|
311
|
+
height: "13",
|
|
312
|
+
viewBox: "0 0 24 24",
|
|
313
|
+
fill: "none",
|
|
314
|
+
stroke: color,
|
|
315
|
+
strokeWidth: "2",
|
|
316
|
+
strokeLinecap: "round",
|
|
317
|
+
strokeLinejoin: "round",
|
|
318
|
+
"aria-hidden": "true",
|
|
319
|
+
style: { flexShrink: 0 },
|
|
320
|
+
children: [
|
|
321
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }),
|
|
322
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 12 2 2 4-4" })
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
function ExternalIcon() {
|
|
328
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
329
|
+
"svg",
|
|
330
|
+
{
|
|
331
|
+
width: "13",
|
|
332
|
+
height: "13",
|
|
333
|
+
viewBox: "0 0 24 24",
|
|
334
|
+
fill: "none",
|
|
335
|
+
stroke: "currentColor",
|
|
336
|
+
strokeWidth: "2",
|
|
337
|
+
strokeLinecap: "round",
|
|
338
|
+
strokeLinejoin: "round",
|
|
339
|
+
"aria-hidden": "true",
|
|
340
|
+
style: { flexShrink: 0 },
|
|
341
|
+
children: [
|
|
342
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 3h6v6" }),
|
|
343
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 14 21 3" }),
|
|
344
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
|
|
345
|
+
]
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
function TabbyAuthResolver(p) {
|
|
350
|
+
var _a, _b, _c;
|
|
351
|
+
const { BORDER: BORDER2, MUTED: MUTED2, ACCENT: ACCENT2, ACCENT_SOFT: ACCENT_SOFT2 } = useTheme();
|
|
352
|
+
const [cardHovered, setCardHovered] = react.useState(false);
|
|
353
|
+
const [btnHovered, setBtnHovered] = react.useState(false);
|
|
354
|
+
const [imgFailed, setImgFailed] = react.useState(false);
|
|
355
|
+
const app = humanizeApp(p.app || "the app");
|
|
356
|
+
const connected = p.state === "connected";
|
|
357
|
+
const accent = connected ? CONNECTED_GREEN : ACCENT2;
|
|
358
|
+
const ctaLabel = (_a = p.ctaLabel) != null ? _a : connected ? `Open ${app}` : `Connect ${app}`;
|
|
359
|
+
const subtitle = p.workspace ? `${app} \xB7 ${p.workspace} workspace` : app;
|
|
360
|
+
const steps = ((_b = p.steps) == null ? void 0 : _b.length) ? p.steps : DEFAULT_STEPS(app, ctaLabel, connected);
|
|
361
|
+
const description = (_c = p.description) != null ? _c : connected ? `Your ${app} session is active. Open ${app} to continue, or re-authenticate if prompted.` : `Your ${app} account is not yet connected to this workspace. Complete sign-in once to enable automatic access.`;
|
|
362
|
+
const iconSrc = p.iconUrl || brandIconUrl(app);
|
|
363
|
+
const showImg = Boolean(iconSrc) && !imgFailed;
|
|
364
|
+
const initial = app.charAt(0).toUpperCase();
|
|
365
|
+
const badge = connected ? { label: "Connected", bg: CONNECTED_GREEN_BG, color: CONNECTED_GREEN } : { label: "Pending sign-in", bg: PENDING_AMBER_BG, color: PENDING_AMBER };
|
|
366
|
+
const sectionPad = "13px 16px";
|
|
367
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ComponentActions, { filename: `${app} authentication`, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: "10px" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
368
|
+
"div",
|
|
369
|
+
{
|
|
370
|
+
onMouseEnter: () => setCardHovered(true),
|
|
371
|
+
onMouseLeave: () => setCardHovered(false),
|
|
372
|
+
style: {
|
|
373
|
+
display: "flex",
|
|
374
|
+
flexDirection: "row",
|
|
375
|
+
alignItems: "stretch",
|
|
376
|
+
borderRadius: "0.75rem",
|
|
377
|
+
border: `1px solid ${cardHovered ? "#d2d2d2" : BORDER2}`,
|
|
378
|
+
background: "white",
|
|
379
|
+
overflow: "hidden",
|
|
380
|
+
boxShadow: cardHovered ? "0 1px 3px rgba(0,0,0,0.05), 0 6px 18px rgba(0,0,0,0.06)" : "0 1px 2px rgba(0,0,0,0.03)",
|
|
381
|
+
transition: "box-shadow 0.18s ease, border-color 0.18s ease"
|
|
382
|
+
},
|
|
383
|
+
children: [
|
|
384
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "3px", flexShrink: 0, background: accent } }),
|
|
385
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
|
|
386
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
387
|
+
"div",
|
|
388
|
+
{
|
|
389
|
+
style: {
|
|
390
|
+
display: "flex",
|
|
391
|
+
alignItems: "flex-start",
|
|
392
|
+
gap: "12px",
|
|
393
|
+
padding: sectionPad
|
|
394
|
+
},
|
|
395
|
+
children: [
|
|
396
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
397
|
+
"div",
|
|
398
|
+
{
|
|
399
|
+
style: {
|
|
400
|
+
position: "relative",
|
|
401
|
+
width: "34px",
|
|
402
|
+
height: "34px",
|
|
403
|
+
borderRadius: "9px",
|
|
404
|
+
flexShrink: 0,
|
|
405
|
+
display: "flex",
|
|
406
|
+
alignItems: "center",
|
|
407
|
+
justifyContent: "center",
|
|
408
|
+
background: showImg ? "white" : "#fff3ee",
|
|
409
|
+
boxShadow: "inset 0 0 0 1px rgba(0,0,0,0.06)",
|
|
410
|
+
overflow: "hidden"
|
|
411
|
+
},
|
|
412
|
+
children: showImg ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
413
|
+
"img",
|
|
414
|
+
{
|
|
415
|
+
src: iconSrc,
|
|
416
|
+
alt: app,
|
|
417
|
+
onError: () => setImgFailed(true),
|
|
418
|
+
style: { width: "22px", height: "22px", objectFit: "contain" }
|
|
419
|
+
}
|
|
420
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
421
|
+
"span",
|
|
422
|
+
{
|
|
423
|
+
style: {
|
|
424
|
+
fontFamily: "var(--font-serif)",
|
|
425
|
+
fontSize: "17px",
|
|
426
|
+
fontWeight: 400,
|
|
427
|
+
color: ACCENT2,
|
|
428
|
+
lineHeight: 1
|
|
429
|
+
},
|
|
430
|
+
children: initial
|
|
431
|
+
}
|
|
432
|
+
)
|
|
433
|
+
}
|
|
434
|
+
),
|
|
435
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: "2px" }, children: [
|
|
436
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
437
|
+
"span",
|
|
438
|
+
{
|
|
439
|
+
style: {
|
|
440
|
+
fontFamily: "var(--font-serif)",
|
|
441
|
+
fontSize: "15px",
|
|
442
|
+
fontWeight: 400,
|
|
443
|
+
color: "var(--foreground)",
|
|
444
|
+
letterSpacing: "-0.01em",
|
|
445
|
+
lineHeight: 1.2
|
|
446
|
+
},
|
|
447
|
+
children: CARD_TITLE
|
|
448
|
+
}
|
|
449
|
+
),
|
|
450
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
451
|
+
"span",
|
|
452
|
+
{
|
|
453
|
+
style: {
|
|
454
|
+
fontSize: "12px",
|
|
455
|
+
color: MUTED2,
|
|
456
|
+
whiteSpace: "nowrap",
|
|
457
|
+
overflow: "hidden",
|
|
458
|
+
textOverflow: "ellipsis"
|
|
459
|
+
},
|
|
460
|
+
children: subtitle
|
|
461
|
+
}
|
|
462
|
+
)
|
|
463
|
+
] }),
|
|
464
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
465
|
+
"span",
|
|
466
|
+
{
|
|
467
|
+
style: {
|
|
468
|
+
display: "inline-flex",
|
|
469
|
+
alignItems: "center",
|
|
470
|
+
gap: "5px",
|
|
471
|
+
flexShrink: 0,
|
|
472
|
+
fontSize: "10.5px",
|
|
473
|
+
fontWeight: 600,
|
|
474
|
+
padding: "3px 9px",
|
|
475
|
+
borderRadius: "9999px",
|
|
476
|
+
background: badge.bg,
|
|
477
|
+
color: badge.color,
|
|
478
|
+
whiteSpace: "nowrap"
|
|
479
|
+
},
|
|
480
|
+
children: [
|
|
481
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
482
|
+
"span",
|
|
483
|
+
{
|
|
484
|
+
style: {
|
|
485
|
+
width: "6px",
|
|
486
|
+
height: "6px",
|
|
487
|
+
borderRadius: "9999px",
|
|
488
|
+
background: badge.color
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
),
|
|
492
|
+
badge.label
|
|
493
|
+
]
|
|
494
|
+
}
|
|
495
|
+
)
|
|
496
|
+
]
|
|
497
|
+
}
|
|
498
|
+
),
|
|
499
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
500
|
+
"div",
|
|
501
|
+
{
|
|
502
|
+
style: {
|
|
503
|
+
borderTop: `1px solid ${BORDER2}`,
|
|
504
|
+
padding: sectionPad,
|
|
505
|
+
display: "flex",
|
|
506
|
+
flexDirection: "column",
|
|
507
|
+
gap: "12px"
|
|
508
|
+
},
|
|
509
|
+
children: [
|
|
510
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: 0, fontSize: "12.5px", lineHeight: 1.5, color: "var(--foreground)" }, children: description }),
|
|
511
|
+
/* @__PURE__ */ jsxRuntime.jsx("ol", { style: { margin: 0, padding: 0, listStyle: "none", display: "flex", flexDirection: "column", gap: "8px" }, children: steps.map((step, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { style: { display: "flex", alignItems: "flex-start", gap: "10px" }, children: [
|
|
512
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
513
|
+
"span",
|
|
514
|
+
{
|
|
515
|
+
style: {
|
|
516
|
+
flexShrink: 0,
|
|
517
|
+
width: "18px",
|
|
518
|
+
height: "18px",
|
|
519
|
+
borderRadius: "9999px",
|
|
520
|
+
background: accent,
|
|
521
|
+
color: "white",
|
|
522
|
+
fontSize: "10.5px",
|
|
523
|
+
fontWeight: 600,
|
|
524
|
+
display: "flex",
|
|
525
|
+
alignItems: "center",
|
|
526
|
+
justifyContent: "center",
|
|
527
|
+
marginTop: "1px"
|
|
528
|
+
},
|
|
529
|
+
children: i + 1
|
|
530
|
+
}
|
|
531
|
+
),
|
|
532
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12.5px", lineHeight: 1.45, color: "var(--foreground)" }, children: step })
|
|
533
|
+
] }, i)) })
|
|
534
|
+
]
|
|
535
|
+
}
|
|
536
|
+
),
|
|
537
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
538
|
+
"div",
|
|
539
|
+
{
|
|
540
|
+
style: {
|
|
541
|
+
borderTop: `1px solid ${BORDER2}`,
|
|
542
|
+
padding: sectionPad,
|
|
543
|
+
background: "#fbfbfb",
|
|
544
|
+
display: "flex",
|
|
545
|
+
alignItems: "center",
|
|
546
|
+
justifyContent: "space-between",
|
|
547
|
+
gap: "12px",
|
|
548
|
+
flexWrap: "wrap"
|
|
549
|
+
},
|
|
550
|
+
children: [
|
|
551
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: "6px", color: MUTED2, fontSize: "11.5px" }, children: [
|
|
552
|
+
/* @__PURE__ */ jsxRuntime.jsx(ShieldIcon, { color: CONNECTED_GREEN }),
|
|
553
|
+
TRUST_FOOTER
|
|
554
|
+
] }),
|
|
555
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
556
|
+
"a",
|
|
557
|
+
{
|
|
558
|
+
href: p.url,
|
|
559
|
+
target: "_blank",
|
|
560
|
+
rel: "noopener noreferrer",
|
|
561
|
+
onMouseEnter: () => setBtnHovered(true),
|
|
562
|
+
onMouseLeave: () => setBtnHovered(false),
|
|
563
|
+
style: {
|
|
564
|
+
display: "inline-flex",
|
|
565
|
+
alignItems: "center",
|
|
566
|
+
gap: "7px",
|
|
567
|
+
flexShrink: 0,
|
|
568
|
+
borderRadius: "8px",
|
|
569
|
+
padding: "8px 15px",
|
|
570
|
+
fontSize: "12.5px",
|
|
571
|
+
fontWeight: 600,
|
|
572
|
+
textDecoration: "none",
|
|
573
|
+
whiteSpace: "nowrap",
|
|
574
|
+
cursor: "pointer",
|
|
575
|
+
color: "white",
|
|
576
|
+
border: "1px solid transparent",
|
|
577
|
+
background: btnHovered ? connected ? "#126a33" : ACCENT_SOFT2 : accent,
|
|
578
|
+
transition: "background 0.15s ease"
|
|
579
|
+
},
|
|
580
|
+
children: [
|
|
581
|
+
/* @__PURE__ */ jsxRuntime.jsx(ExternalIcon, {}),
|
|
582
|
+
ctaLabel
|
|
583
|
+
]
|
|
584
|
+
}
|
|
585
|
+
)
|
|
586
|
+
]
|
|
587
|
+
}
|
|
588
|
+
)
|
|
589
|
+
] })
|
|
590
|
+
]
|
|
591
|
+
}
|
|
592
|
+
) }) });
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
exports.TabbyAuthResolver = TabbyAuthResolver;
|
|
596
|
+
//# sourceMappingURL=resolver.cjs.map
|
|
597
|
+
//# sourceMappingURL=resolver.cjs.map
|