@contractspec/example.integration-hub 3.7.6 → 3.7.7
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 +70 -183
- package/dist/connection/index.d.ts +1 -1
- package/dist/events.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +596 -594
- package/dist/integration/index.d.ts +1 -1
- package/dist/node/events.js +1 -1
- package/dist/node/index.js +596 -594
- package/dist/node/ui/IntegrationDashboard.js +27 -27
- package/dist/node/ui/hooks/index.js +1 -1
- package/dist/node/ui/hooks/useIntegrationData.js +1 -1
- package/dist/node/ui/index.js +545 -544
- package/dist/sync/index.d.ts +3 -3
- package/dist/ui/IntegrationDashboard.js +27 -27
- package/dist/ui/hooks/index.d.ts +1 -1
- package/dist/ui/hooks/index.js +1 -1
- package/dist/ui/hooks/useIntegrationData.js +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +545 -544
- package/dist/ui/renderers/index.d.ts +1 -1
- package/package.json +8 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/ui/hooks/useIntegrationData.ts
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
3
2
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
"use client";
|
|
5
5
|
function useIntegrationData(projectId = "local-project") {
|
|
6
6
|
const { handlers } = useTemplateRuntime();
|
|
@@ -83,7 +83,6 @@ function IntegrationHubChat({
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
// src/ui/IntegrationDashboard.tsx
|
|
86
|
-
import { useState as useState2 } from "react";
|
|
87
86
|
import {
|
|
88
87
|
Button,
|
|
89
88
|
ErrorState,
|
|
@@ -91,6 +90,7 @@ import {
|
|
|
91
90
|
StatCard,
|
|
92
91
|
StatCardGroup
|
|
93
92
|
} from "@contractspec/lib.design-system";
|
|
93
|
+
import { useState as useState2 } from "react";
|
|
94
94
|
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
95
95
|
"use client";
|
|
96
96
|
var STATUS_COLORS = {
|
|
@@ -147,7 +147,7 @@ function IntegrationDashboard() {
|
|
|
147
147
|
className: "flex items-center justify-between",
|
|
148
148
|
children: [
|
|
149
149
|
/* @__PURE__ */ jsxDEV2("h2", {
|
|
150
|
-
className: "text-2xl
|
|
150
|
+
className: "font-bold text-2xl",
|
|
151
151
|
children: "Integration Hub"
|
|
152
152
|
}, undefined, false, undefined, this),
|
|
153
153
|
/* @__PURE__ */ jsxDEV2(Button, {
|
|
@@ -182,14 +182,14 @@ function IntegrationDashboard() {
|
|
|
182
182
|
]
|
|
183
183
|
}, undefined, true, undefined, this),
|
|
184
184
|
/* @__PURE__ */ jsxDEV2("nav", {
|
|
185
|
-
className: "
|
|
185
|
+
className: "flex gap-1 rounded-lg bg-muted p-1",
|
|
186
186
|
role: "tablist",
|
|
187
187
|
children: tabs.map((tab) => /* @__PURE__ */ jsxDEV2(Button, {
|
|
188
188
|
type: "button",
|
|
189
189
|
role: "tab",
|
|
190
190
|
"aria-selected": activeTab === tab.id,
|
|
191
191
|
onClick: () => setActiveTab(tab.id),
|
|
192
|
-
className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm
|
|
192
|
+
className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 font-medium text-sm transition-colors ${activeTab === tab.id ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
193
193
|
children: [
|
|
194
194
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
195
195
|
children: tab.icon
|
|
@@ -206,7 +206,7 @@ function IntegrationDashboard() {
|
|
|
206
206
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
207
207
|
children: [
|
|
208
208
|
integrations.map((integration) => /* @__PURE__ */ jsxDEV2("div", {
|
|
209
|
-
className: "
|
|
209
|
+
className: "cursor-pointer rounded-lg border border-border bg-card p-4 transition-colors hover:bg-muted/50",
|
|
210
210
|
children: [
|
|
211
211
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
212
212
|
className: "mb-3 flex items-center gap-3",
|
|
@@ -233,7 +233,7 @@ function IntegrationDashboard() {
|
|
|
233
233
|
className: "flex items-center justify-between",
|
|
234
234
|
children: [
|
|
235
235
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
236
|
-
className: `inline-flex rounded-full px-2 py-0.5 text-xs
|
|
236
|
+
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[integration.status] ?? ""}`,
|
|
237
237
|
children: integration.status
|
|
238
238
|
}, undefined, false, undefined, this),
|
|
239
239
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
@@ -245,37 +245,37 @@ function IntegrationDashboard() {
|
|
|
245
245
|
]
|
|
246
246
|
}, integration.id, true, undefined, this)),
|
|
247
247
|
integrations.length === 0 && /* @__PURE__ */ jsxDEV2("div", {
|
|
248
|
-
className: "
|
|
248
|
+
className: "col-span-full flex h-64 items-center justify-center text-muted-foreground",
|
|
249
249
|
children: "No integrations configured"
|
|
250
250
|
}, undefined, false, undefined, this)
|
|
251
251
|
]
|
|
252
252
|
}, undefined, true, undefined, this),
|
|
253
253
|
activeTab === "connections" && /* @__PURE__ */ jsxDEV2("div", {
|
|
254
|
-
className: "
|
|
254
|
+
className: "rounded-lg border border-border",
|
|
255
255
|
children: /* @__PURE__ */ jsxDEV2("table", {
|
|
256
256
|
className: "w-full",
|
|
257
257
|
children: [
|
|
258
258
|
/* @__PURE__ */ jsxDEV2("thead", {
|
|
259
|
-
className: "border-border bg-muted/30
|
|
259
|
+
className: "border-border border-b bg-muted/30",
|
|
260
260
|
children: /* @__PURE__ */ jsxDEV2("tr", {
|
|
261
261
|
children: [
|
|
262
262
|
/* @__PURE__ */ jsxDEV2("th", {
|
|
263
|
-
className: "px-4 py-3 text-left text-sm
|
|
263
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
264
264
|
children: "Connection"
|
|
265
265
|
}, undefined, false, undefined, this),
|
|
266
266
|
/* @__PURE__ */ jsxDEV2("th", {
|
|
267
|
-
className: "px-4 py-3 text-left text-sm
|
|
267
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
268
268
|
children: "Status"
|
|
269
269
|
}, undefined, false, undefined, this),
|
|
270
270
|
/* @__PURE__ */ jsxDEV2("th", {
|
|
271
|
-
className: "px-4 py-3 text-left text-sm
|
|
271
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
272
272
|
children: "Last Sync"
|
|
273
273
|
}, undefined, false, undefined, this)
|
|
274
274
|
]
|
|
275
275
|
}, undefined, true, undefined, this)
|
|
276
276
|
}, undefined, false, undefined, this),
|
|
277
277
|
/* @__PURE__ */ jsxDEV2("tbody", {
|
|
278
|
-
className: "divide-
|
|
278
|
+
className: "divide-y divide-border",
|
|
279
279
|
children: [
|
|
280
280
|
connections.map((conn) => /* @__PURE__ */ jsxDEV2("tr", {
|
|
281
281
|
className: "hover:bg-muted/50",
|
|
@@ -290,12 +290,12 @@ function IntegrationDashboard() {
|
|
|
290
290
|
/* @__PURE__ */ jsxDEV2("td", {
|
|
291
291
|
className: "px-4 py-3",
|
|
292
292
|
children: /* @__PURE__ */ jsxDEV2("span", {
|
|
293
|
-
className: `inline-flex rounded-full px-2 py-0.5 text-xs
|
|
293
|
+
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[conn.status] ?? ""}`,
|
|
294
294
|
children: conn.status
|
|
295
295
|
}, undefined, false, undefined, this)
|
|
296
296
|
}, undefined, false, undefined, this),
|
|
297
297
|
/* @__PURE__ */ jsxDEV2("td", {
|
|
298
|
-
className: "
|
|
298
|
+
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
299
299
|
children: conn.lastSyncAt?.toLocaleString() ?? "Never"
|
|
300
300
|
}, undefined, false, undefined, this)
|
|
301
301
|
]
|
|
@@ -303,7 +303,7 @@ function IntegrationDashboard() {
|
|
|
303
303
|
connections.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
|
|
304
304
|
children: /* @__PURE__ */ jsxDEV2("td", {
|
|
305
305
|
colSpan: 3,
|
|
306
|
-
className: "
|
|
306
|
+
className: "px-4 py-8 text-center text-muted-foreground",
|
|
307
307
|
children: "No connections found"
|
|
308
308
|
}, undefined, false, undefined, this)
|
|
309
309
|
}, undefined, false, undefined, this)
|
|
@@ -323,35 +323,35 @@ function IntegrationDashboard() {
|
|
|
323
323
|
className: "min-h-[400px]"
|
|
324
324
|
}, undefined, false, undefined, this),
|
|
325
325
|
activeTab === "syncs" && /* @__PURE__ */ jsxDEV2("div", {
|
|
326
|
-
className: "
|
|
326
|
+
className: "rounded-lg border border-border",
|
|
327
327
|
children: /* @__PURE__ */ jsxDEV2("table", {
|
|
328
328
|
className: "w-full",
|
|
329
329
|
children: [
|
|
330
330
|
/* @__PURE__ */ jsxDEV2("thead", {
|
|
331
|
-
className: "border-border bg-muted/30
|
|
331
|
+
className: "border-border border-b bg-muted/30",
|
|
332
332
|
children: /* @__PURE__ */ jsxDEV2("tr", {
|
|
333
333
|
children: [
|
|
334
334
|
/* @__PURE__ */ jsxDEV2("th", {
|
|
335
|
-
className: "px-4 py-3 text-left text-sm
|
|
335
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
336
336
|
children: "Sync Config"
|
|
337
337
|
}, undefined, false, undefined, this),
|
|
338
338
|
/* @__PURE__ */ jsxDEV2("th", {
|
|
339
|
-
className: "px-4 py-3 text-left text-sm
|
|
339
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
340
340
|
children: "Frequency"
|
|
341
341
|
}, undefined, false, undefined, this),
|
|
342
342
|
/* @__PURE__ */ jsxDEV2("th", {
|
|
343
|
-
className: "px-4 py-3 text-left text-sm
|
|
343
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
344
344
|
children: "Status"
|
|
345
345
|
}, undefined, false, undefined, this),
|
|
346
346
|
/* @__PURE__ */ jsxDEV2("th", {
|
|
347
|
-
className: "px-4 py-3 text-left text-sm
|
|
347
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
348
348
|
children: "Records"
|
|
349
349
|
}, undefined, false, undefined, this)
|
|
350
350
|
]
|
|
351
351
|
}, undefined, true, undefined, this)
|
|
352
352
|
}, undefined, false, undefined, this),
|
|
353
353
|
/* @__PURE__ */ jsxDEV2("tbody", {
|
|
354
|
-
className: "divide-
|
|
354
|
+
className: "divide-y divide-border",
|
|
355
355
|
children: [
|
|
356
356
|
syncConfigs.map((sync) => /* @__PURE__ */ jsxDEV2("tr", {
|
|
357
357
|
className: "hover:bg-muted/50",
|
|
@@ -380,12 +380,12 @@ function IntegrationDashboard() {
|
|
|
380
380
|
/* @__PURE__ */ jsxDEV2("td", {
|
|
381
381
|
className: "px-4 py-3",
|
|
382
382
|
children: /* @__PURE__ */ jsxDEV2("span", {
|
|
383
|
-
className: `inline-flex rounded-full px-2 py-0.5 text-xs
|
|
383
|
+
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[sync.status] ?? ""}`,
|
|
384
384
|
children: sync.status
|
|
385
385
|
}, undefined, false, undefined, this)
|
|
386
386
|
}, undefined, false, undefined, this),
|
|
387
387
|
/* @__PURE__ */ jsxDEV2("td", {
|
|
388
|
-
className: "
|
|
388
|
+
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
389
389
|
children: sync.recordsSynced.toLocaleString()
|
|
390
390
|
}, undefined, false, undefined, this)
|
|
391
391
|
]
|
|
@@ -393,7 +393,7 @@ function IntegrationDashboard() {
|
|
|
393
393
|
syncConfigs.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
|
|
394
394
|
children: /* @__PURE__ */ jsxDEV2("td", {
|
|
395
395
|
colSpan: 4,
|
|
396
|
-
className: "
|
|
396
|
+
className: "px-4 py-8 text-center text-muted-foreground",
|
|
397
397
|
children: "No sync configurations found"
|
|
398
398
|
}, undefined, false, undefined, this)
|
|
399
399
|
}, undefined, false, undefined, this)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/ui/hooks/useIntegrationData.ts
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
3
2
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
"use client";
|
|
5
5
|
function useIntegrationData(projectId = "local-project") {
|
|
6
6
|
const { handlers } = useTemplateRuntime();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/ui/hooks/useIntegrationData.ts
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
3
2
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
"use client";
|
|
5
5
|
function useIntegrationData(projectId = "local-project") {
|
|
6
6
|
const { handlers } = useTemplateRuntime();
|