@xenide-io/the-old-ui-theme 0.9.13 → 0.9.15
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/suite.d.mts +47 -4
- package/dist/suite.d.ts +47 -4
- package/dist/suite.js +1099 -996
- package/dist/suite.mjs +696 -588
- package/package.json +1 -1
- package/src/suite/components/suite-integration-picker.test.tsx +36 -2
- package/src/suite/components/suite-integration-picker.tsx +104 -72
- package/src/suite/components/suite-notification-bell.test.tsx +87 -9
- package/src/suite/components/suite-notification-bell.tsx +29 -167
- package/src/suite/index.ts +7 -5
- package/src/suite/lib/suite-notifications.tsx +260 -0
package/dist/suite.mjs
CHANGED
|
@@ -1028,10 +1028,20 @@ function AppSwitcher({
|
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
1030
|
// src/suite/components/suite-notification-bell.tsx
|
|
1031
|
-
import {
|
|
1032
|
-
import { useRouter } from "next/navigation";
|
|
1031
|
+
import { useState as useState3 } from "react";
|
|
1033
1032
|
import { Bell } from "iconoir-react";
|
|
1034
1033
|
|
|
1034
|
+
// src/suite/lib/suite-notifications.tsx
|
|
1035
|
+
import {
|
|
1036
|
+
createContext,
|
|
1037
|
+
useCallback,
|
|
1038
|
+
useContext,
|
|
1039
|
+
useEffect,
|
|
1040
|
+
useMemo,
|
|
1041
|
+
useState as useState2
|
|
1042
|
+
} from "react";
|
|
1043
|
+
import { useRouter } from "next/navigation";
|
|
1044
|
+
|
|
1035
1045
|
// src/suite/lib/apps.ts
|
|
1036
1046
|
var SUITE_APPS2 = [
|
|
1037
1047
|
{
|
|
@@ -1133,39 +1143,36 @@ function classifySuiteHref(href, bases, currentOrigin = "") {
|
|
|
1133
1143
|
return null;
|
|
1134
1144
|
}
|
|
1135
1145
|
|
|
1136
|
-
// src/suite/
|
|
1137
|
-
import { jsx as jsx6
|
|
1138
|
-
var
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
return `${Math.round(hrs / 24)}d ago`;
|
|
1146
|
+
// src/suite/lib/suite-notifications.tsx
|
|
1147
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1148
|
+
var SUITE_NOTIFICATIONS_POLL_MS = 6e4;
|
|
1149
|
+
var SuiteNotificationsContext = createContext(null);
|
|
1150
|
+
function useSuiteNotifications() {
|
|
1151
|
+
const value = useContext(SuiteNotificationsContext);
|
|
1152
|
+
if (!value) {
|
|
1153
|
+
throw new Error(
|
|
1154
|
+
"useSuiteNotifications must be used within a SuiteNotificationsProvider"
|
|
1155
|
+
);
|
|
1156
|
+
}
|
|
1157
|
+
return value;
|
|
1149
1158
|
}
|
|
1150
|
-
function
|
|
1159
|
+
function SuiteNotificationsProvider({
|
|
1151
1160
|
fetchNotifications,
|
|
1152
1161
|
markRead,
|
|
1153
|
-
markAllRead,
|
|
1154
|
-
|
|
1162
|
+
markAllRead: markAllReadRequest,
|
|
1163
|
+
pollMs = SUITE_NOTIFICATIONS_POLL_MS,
|
|
1155
1164
|
cacheKey = "suite-notifications-cache",
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
triggerDataTest
|
|
1165
|
+
enabled = true,
|
|
1166
|
+
children
|
|
1159
1167
|
}) {
|
|
1160
1168
|
const router = useRouter();
|
|
1161
|
-
const [
|
|
1162
|
-
const [
|
|
1163
|
-
const [unread, setUnread] = useState2(0);
|
|
1169
|
+
const [notifications, setNotifications] = useState2([]);
|
|
1170
|
+
const [unreadCount, setUnreadCount] = useState2(0);
|
|
1164
1171
|
const load = useCallback(async () => {
|
|
1165
1172
|
try {
|
|
1166
1173
|
const data = await fetchNotifications();
|
|
1167
|
-
|
|
1168
|
-
|
|
1174
|
+
setNotifications(data.notifications);
|
|
1175
|
+
setUnreadCount(data.unread_count);
|
|
1169
1176
|
if (cacheKey) {
|
|
1170
1177
|
try {
|
|
1171
1178
|
sessionStorage.setItem(
|
|
@@ -1182,57 +1189,72 @@ function SuiteNotificationBell({
|
|
|
1182
1189
|
}
|
|
1183
1190
|
}, [fetchNotifications, cacheKey]);
|
|
1184
1191
|
useEffect(() => {
|
|
1192
|
+
if (!enabled) return;
|
|
1185
1193
|
if (cacheKey) {
|
|
1186
1194
|
queueMicrotask(() => {
|
|
1187
1195
|
var _a2;
|
|
1188
1196
|
try {
|
|
1189
1197
|
const raw = sessionStorage.getItem(cacheKey);
|
|
1190
|
-
if (raw)
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
}
|
|
1198
|
+
if (!raw) return;
|
|
1199
|
+
const cached = JSON.parse(raw);
|
|
1200
|
+
if (Array.isArray(cached.notifications)) {
|
|
1201
|
+
setNotifications(cached.notifications);
|
|
1202
|
+
setUnreadCount((_a2 = cached.unread_count) != null ? _a2 : 0);
|
|
1196
1203
|
}
|
|
1197
1204
|
} catch (e) {
|
|
1198
1205
|
}
|
|
1199
1206
|
});
|
|
1200
1207
|
}
|
|
1201
|
-
|
|
1202
|
-
const
|
|
1208
|
+
let timer;
|
|
1209
|
+
const stop = () => {
|
|
1210
|
+
if (timer !== void 0) {
|
|
1211
|
+
window.clearInterval(timer);
|
|
1212
|
+
timer = void 0;
|
|
1213
|
+
}
|
|
1214
|
+
};
|
|
1215
|
+
const start = () => {
|
|
1216
|
+
if (timer !== void 0) return;
|
|
1217
|
+
void load();
|
|
1218
|
+
timer = window.setInterval(() => void load(), pollMs);
|
|
1219
|
+
};
|
|
1220
|
+
const onVisibilityChange = () => {
|
|
1221
|
+
if (document.visibilityState === "visible") start();
|
|
1222
|
+
else stop();
|
|
1223
|
+
};
|
|
1224
|
+
if (document.visibilityState === "visible") start();
|
|
1225
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
1203
1226
|
return () => {
|
|
1204
|
-
|
|
1205
|
-
|
|
1227
|
+
stop();
|
|
1228
|
+
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
1206
1229
|
};
|
|
1207
|
-
}, [load, cacheKey]);
|
|
1208
|
-
const
|
|
1209
|
-
(
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
},
|
|
1213
|
-
[load]
|
|
1214
|
-
);
|
|
1215
|
-
const openItem = useCallback(
|
|
1216
|
-
async (n) => {
|
|
1217
|
-
setOpen(false);
|
|
1218
|
-
if (!n.read_at) {
|
|
1219
|
-
setItems(
|
|
1230
|
+
}, [enabled, load, pollMs, cacheKey]);
|
|
1231
|
+
const select = useCallback(
|
|
1232
|
+
(notification) => {
|
|
1233
|
+
if (!notification.read_at) {
|
|
1234
|
+
setNotifications(
|
|
1220
1235
|
(prev) => prev.map(
|
|
1221
|
-
(
|
|
1236
|
+
(item) => item.id === notification.id ? __spreadProps(__spreadValues({}, item), { read_at: (/* @__PURE__ */ new Date()).toISOString() }) : item
|
|
1222
1237
|
)
|
|
1223
1238
|
);
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1239
|
+
setUnreadCount((count) => Math.max(0, count - 1));
|
|
1240
|
+
void (async () => {
|
|
1241
|
+
try {
|
|
1242
|
+
await markRead(notification.id);
|
|
1243
|
+
} catch (e) {
|
|
1244
|
+
}
|
|
1245
|
+
})();
|
|
1229
1246
|
}
|
|
1230
|
-
const target = resolveSuiteNotificationHref(
|
|
1247
|
+
const target = resolveSuiteNotificationHref(
|
|
1248
|
+
notification.href,
|
|
1249
|
+
notification.source_app
|
|
1250
|
+
);
|
|
1231
1251
|
if (!target) return;
|
|
1232
1252
|
if (/^https?:\/\//i.test(target)) {
|
|
1233
1253
|
try {
|
|
1234
1254
|
const url = new URL(target);
|
|
1235
|
-
const sourceApp = suiteAppSlugForNotificationSource(
|
|
1255
|
+
const sourceApp = suiteAppSlugForNotificationSource(
|
|
1256
|
+
notification.source_app
|
|
1257
|
+
);
|
|
1236
1258
|
const path = `${url.pathname}${url.search}${url.hash}`;
|
|
1237
1259
|
if (url.origin === window.location.origin) {
|
|
1238
1260
|
router.push(path);
|
|
@@ -1259,21 +1281,67 @@ function SuiteNotificationBell({
|
|
|
1259
1281
|
},
|
|
1260
1282
|
[router, markRead]
|
|
1261
1283
|
);
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
(prev) => prev.map((
|
|
1284
|
+
const markAllRead = useCallback(() => {
|
|
1285
|
+
setNotifications(
|
|
1286
|
+
(prev) => prev.map((item) => {
|
|
1265
1287
|
var _a2;
|
|
1266
|
-
return __spreadProps(__spreadValues({},
|
|
1267
|
-
read_at: (_a2 =
|
|
1288
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
1289
|
+
read_at: (_a2 = item.read_at) != null ? _a2 : (/* @__PURE__ */ new Date()).toISOString()
|
|
1268
1290
|
});
|
|
1269
1291
|
})
|
|
1270
1292
|
);
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1293
|
+
setUnreadCount(0);
|
|
1294
|
+
void (async () => {
|
|
1295
|
+
try {
|
|
1296
|
+
await markAllReadRequest();
|
|
1297
|
+
} catch (e) {
|
|
1298
|
+
}
|
|
1299
|
+
})();
|
|
1300
|
+
}, [markAllReadRequest]);
|
|
1301
|
+
const value = useMemo(
|
|
1302
|
+
() => ({
|
|
1303
|
+
notifications,
|
|
1304
|
+
unreadCount,
|
|
1305
|
+
refresh: () => void load(),
|
|
1306
|
+
select,
|
|
1307
|
+
markAllRead
|
|
1308
|
+
}),
|
|
1309
|
+
[notifications, unreadCount, load, select, markAllRead]
|
|
1310
|
+
);
|
|
1311
|
+
return /* @__PURE__ */ jsx6(SuiteNotificationsContext.Provider, { value, children });
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
// src/suite/components/suite-notification-bell.tsx
|
|
1315
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1316
|
+
function timeAgo(iso) {
|
|
1317
|
+
const then = new Date(iso).getTime();
|
|
1318
|
+
if (Number.isNaN(then)) return "";
|
|
1319
|
+
const secs = Math.max(0, Math.round((Date.now() - then) / 1e3));
|
|
1320
|
+
if (secs < 60) return "just now";
|
|
1321
|
+
const mins = Math.round(secs / 60);
|
|
1322
|
+
if (mins < 60) return `${mins}m ago`;
|
|
1323
|
+
const hrs = Math.round(mins / 60);
|
|
1324
|
+
if (hrs < 24) return `${hrs}h ago`;
|
|
1325
|
+
return `${Math.round(hrs / 24)}d ago`;
|
|
1326
|
+
}
|
|
1327
|
+
function SuiteNotificationBell({
|
|
1328
|
+
dropdownMenu: DropdownMenu2,
|
|
1329
|
+
dataTest = "suite-notifications",
|
|
1330
|
+
triggerId,
|
|
1331
|
+
triggerDataTest
|
|
1332
|
+
}) {
|
|
1333
|
+
const {
|
|
1334
|
+
notifications,
|
|
1335
|
+
unreadCount: unread,
|
|
1336
|
+
refresh,
|
|
1337
|
+
select,
|
|
1338
|
+
markAllRead
|
|
1339
|
+
} = useSuiteNotifications();
|
|
1340
|
+
const [open, setOpen] = useState3(false);
|
|
1341
|
+
const onOpenChange = (next) => {
|
|
1342
|
+
setOpen(next);
|
|
1343
|
+
if (next) refresh();
|
|
1344
|
+
};
|
|
1277
1345
|
return /* @__PURE__ */ jsxs6(
|
|
1278
1346
|
DropdownMenu2,
|
|
1279
1347
|
{
|
|
@@ -1284,44 +1352,47 @@ function SuiteNotificationBell({
|
|
|
1284
1352
|
panelClassName: "w-80 overflow-hidden p-0",
|
|
1285
1353
|
open,
|
|
1286
1354
|
onOpenChange,
|
|
1287
|
-
trigger: /* @__PURE__ */
|
|
1288
|
-
/* @__PURE__ */
|
|
1289
|
-
unread > 0 ? /* @__PURE__ */
|
|
1355
|
+
trigger: /* @__PURE__ */ jsx7("span", { className: "relative inline-flex h-11 w-11 items-center justify-center overflow-visible rounded-full text-ph-mutedtext transition hover:bg-ph-muted hover:text-ph-ink", children: /* @__PURE__ */ jsxs6("span", { className: "relative inline-flex h-5 w-5", children: [
|
|
1356
|
+
/* @__PURE__ */ jsx7(Bell, { className: "h-5 w-5", strokeWidth: 1.75, "aria-hidden": true }),
|
|
1357
|
+
unread > 0 ? /* @__PURE__ */ jsx7("span", { className: "pointer-events-none absolute -right-2 -top-2 z-[1] flex h-4 min-w-4 items-center justify-center rounded-full bg-ph-brand px-1 text-[9px] font-semibold leading-none text-[var(--ph-on-accent)] ring-2 ring-ph-surface", children: unread > 9 ? "9+" : unread }) : null
|
|
1290
1358
|
] }) }),
|
|
1291
1359
|
children: [
|
|
1292
1360
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between border-b border-ph-border px-3 py-2", children: [
|
|
1293
|
-
/* @__PURE__ */
|
|
1294
|
-
unread > 0 ? /* @__PURE__ */
|
|
1361
|
+
/* @__PURE__ */ jsx7("span", { className: "text-sm font-semibold text-ph-ink", children: "Notifications" }),
|
|
1362
|
+
unread > 0 ? /* @__PURE__ */ jsx7(
|
|
1295
1363
|
"button",
|
|
1296
1364
|
{
|
|
1297
1365
|
type: "button",
|
|
1298
1366
|
id: `${dataTest}-mark-all`,
|
|
1299
1367
|
"data-test": `${dataTest}-mark-all`,
|
|
1300
|
-
onClick:
|
|
1368
|
+
onClick: markAllRead,
|
|
1301
1369
|
className: "text-xs font-medium text-ph-brand hover:underline",
|
|
1302
1370
|
children: "Mark all read"
|
|
1303
1371
|
}
|
|
1304
1372
|
) : null
|
|
1305
1373
|
] }),
|
|
1306
|
-
/* @__PURE__ */
|
|
1374
|
+
/* @__PURE__ */ jsx7("div", { className: "max-h-80 overflow-y-auto py-1", children: notifications.length === 0 ? /* @__PURE__ */ jsx7("p", { className: "px-3 py-6 text-center text-sm text-ph-mutedtext", children: "You're all caught up." }) : notifications.map((n) => /* @__PURE__ */ jsxs6(
|
|
1307
1375
|
"button",
|
|
1308
1376
|
{
|
|
1309
1377
|
id: `${dataTest}-item-${n.id}`,
|
|
1310
1378
|
"data-test": `${dataTest}-item-${n.id}`,
|
|
1311
|
-
onClick: () =>
|
|
1379
|
+
onClick: () => {
|
|
1380
|
+
setOpen(false);
|
|
1381
|
+
select(n);
|
|
1382
|
+
},
|
|
1312
1383
|
className: "flex w-full flex-col gap-0.5 px-3 py-2 text-left transition hover:bg-ph-muted",
|
|
1313
1384
|
children: [
|
|
1314
1385
|
/* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-2", children: [
|
|
1315
|
-
!n.read_at ? /* @__PURE__ */
|
|
1386
|
+
!n.read_at ? /* @__PURE__ */ jsx7(
|
|
1316
1387
|
"span",
|
|
1317
1388
|
{
|
|
1318
1389
|
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-ph-brand",
|
|
1319
1390
|
"aria-hidden": true
|
|
1320
1391
|
}
|
|
1321
1392
|
) : null,
|
|
1322
|
-
/* @__PURE__ */
|
|
1393
|
+
/* @__PURE__ */ jsx7("span", { className: "truncate text-sm font-medium text-ph-ink", children: n.title })
|
|
1323
1394
|
] }),
|
|
1324
|
-
n.body ? /* @__PURE__ */
|
|
1395
|
+
n.body ? /* @__PURE__ */ jsx7("span", { className: "line-clamp-2 text-xs text-ph-mutedtext", children: n.body }) : null,
|
|
1325
1396
|
/* @__PURE__ */ jsxs6("span", { className: "text-[11px] uppercase tracking-wide text-ph-subtle", children: [
|
|
1326
1397
|
n.source_app,
|
|
1327
1398
|
" \xB7 ",
|
|
@@ -1337,8 +1408,8 @@ function SuiteNotificationBell({
|
|
|
1337
1408
|
}
|
|
1338
1409
|
|
|
1339
1410
|
// src/suite/components/command-palette-host.tsx
|
|
1340
|
-
import { useEffect as useEffect2, useState as
|
|
1341
|
-
import { jsx as
|
|
1411
|
+
import { useEffect as useEffect2, useState as useState4 } from "react";
|
|
1412
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1342
1413
|
function isEditableTarget() {
|
|
1343
1414
|
if (typeof document === "undefined") return false;
|
|
1344
1415
|
const el = document.activeElement;
|
|
@@ -1358,7 +1429,7 @@ function CommandPaletteHost({
|
|
|
1358
1429
|
inputDataTest,
|
|
1359
1430
|
commandPalette: CommandPalette
|
|
1360
1431
|
}) {
|
|
1361
|
-
const [open, setOpen] =
|
|
1432
|
+
const [open, setOpen] = useState4(false);
|
|
1362
1433
|
useEffect2(() => {
|
|
1363
1434
|
const onKey = (e) => {
|
|
1364
1435
|
if (!((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k")) return;
|
|
@@ -1370,7 +1441,7 @@ function CommandPaletteHost({
|
|
|
1370
1441
|
return () => window.removeEventListener("keydown", onKey);
|
|
1371
1442
|
}, [open]);
|
|
1372
1443
|
if (!isAuthenticated) return null;
|
|
1373
|
-
return /* @__PURE__ */
|
|
1444
|
+
return /* @__PURE__ */ jsx8(
|
|
1374
1445
|
CommandPalette,
|
|
1375
1446
|
{
|
|
1376
1447
|
items,
|
|
@@ -1386,9 +1457,9 @@ function CommandPaletteHost({
|
|
|
1386
1457
|
}
|
|
1387
1458
|
|
|
1388
1459
|
// src/suite/lib/use-idle-mount.ts
|
|
1389
|
-
import { useEffect as useEffect3, useState as
|
|
1460
|
+
import { useEffect as useEffect3, useState as useState5 } from "react";
|
|
1390
1461
|
function useIdleMount(timeoutMs = 1200) {
|
|
1391
|
-
const [ready, setReady] =
|
|
1462
|
+
const [ready, setReady] = useState5(false);
|
|
1392
1463
|
useEffect3(() => {
|
|
1393
1464
|
let timeoutId = 0;
|
|
1394
1465
|
let idleId = 0;
|
|
@@ -1404,18 +1475,18 @@ function useIdleMount(timeoutMs = 1200) {
|
|
|
1404
1475
|
}
|
|
1405
1476
|
|
|
1406
1477
|
// src/suite/components/deferred-chrome.tsx
|
|
1407
|
-
import { Fragment as Fragment3, jsx as
|
|
1478
|
+
import { Fragment as Fragment3, jsx as jsx9 } from "react/jsx-runtime";
|
|
1408
1479
|
function DeferredChrome({ children }) {
|
|
1409
1480
|
const ready = useIdleMount();
|
|
1410
1481
|
if (!ready) return null;
|
|
1411
|
-
return /* @__PURE__ */
|
|
1482
|
+
return /* @__PURE__ */ jsx9(Fragment3, { children });
|
|
1412
1483
|
}
|
|
1413
1484
|
|
|
1414
1485
|
// src/suite/components/suite-mobile-drawer.tsx
|
|
1415
1486
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
1416
|
-
import { useEffect as useEffect4, useState as
|
|
1487
|
+
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
1417
1488
|
import { Xmark as X } from "iconoir-react";
|
|
1418
|
-
import { jsx as
|
|
1489
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1419
1490
|
function SuiteMobileDrawer({
|
|
1420
1491
|
open,
|
|
1421
1492
|
onClose,
|
|
@@ -1435,8 +1506,8 @@ function SuiteMobileDrawer({
|
|
|
1435
1506
|
closeButtonDataTest,
|
|
1436
1507
|
panelClassName
|
|
1437
1508
|
}) {
|
|
1438
|
-
const [rendered, setRendered] =
|
|
1439
|
-
const [shown, setShown] =
|
|
1509
|
+
const [rendered, setRendered] = useState6(open);
|
|
1510
|
+
const [shown, setShown] = useState6(open);
|
|
1440
1511
|
useEffect4(() => {
|
|
1441
1512
|
if (open) {
|
|
1442
1513
|
queueMicrotask(() => setRendered(true));
|
|
@@ -1454,8 +1525,8 @@ function SuiteMobileDrawer({
|
|
|
1454
1525
|
return () => window.clearTimeout(timeout);
|
|
1455
1526
|
}, [open, durationMs]);
|
|
1456
1527
|
if (!rendered) return null;
|
|
1457
|
-
return /* @__PURE__ */
|
|
1458
|
-
/* @__PURE__ */
|
|
1528
|
+
return /* @__PURE__ */ jsx10(Dialog.Root, { open, onOpenChange: (nextOpen) => !nextOpen && onClose(), children: /* @__PURE__ */ jsxs7(Dialog.Portal, { forceMount: true, children: [
|
|
1529
|
+
/* @__PURE__ */ jsx10(
|
|
1459
1530
|
Dialog.Overlay,
|
|
1460
1531
|
{
|
|
1461
1532
|
forceMount: true,
|
|
@@ -1469,7 +1540,7 @@ function SuiteMobileDrawer({
|
|
|
1469
1540
|
style: { transitionDuration: `${durationMs}ms` }
|
|
1470
1541
|
}
|
|
1471
1542
|
),
|
|
1472
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ jsx10(Dialog.Content, { forceMount: true, asChild: true, children: /* @__PURE__ */ jsxs7(
|
|
1473
1544
|
"aside",
|
|
1474
1545
|
{
|
|
1475
1546
|
role: "dialog",
|
|
@@ -1483,7 +1554,7 @@ function SuiteMobileDrawer({
|
|
|
1483
1554
|
),
|
|
1484
1555
|
style: { transitionDuration: `${durationMs}ms` },
|
|
1485
1556
|
children: [
|
|
1486
|
-
/* @__PURE__ */
|
|
1557
|
+
/* @__PURE__ */ jsx10(Dialog.Title, { className: "sr-only", children: dialogLabel }),
|
|
1487
1558
|
showCloseButton ? /* @__PURE__ */ jsxs7(
|
|
1488
1559
|
"div",
|
|
1489
1560
|
{
|
|
@@ -1492,8 +1563,8 @@ function SuiteMobileDrawer({
|
|
|
1492
1563
|
title ? "justify-between" : "justify-end"
|
|
1493
1564
|
),
|
|
1494
1565
|
children: [
|
|
1495
|
-
title ? /* @__PURE__ */
|
|
1496
|
-
/* @__PURE__ */
|
|
1566
|
+
title ? /* @__PURE__ */ jsx10("span", { className: "truncate text-sm font-semibold text-ph-ink", children: title }) : null,
|
|
1567
|
+
/* @__PURE__ */ jsx10(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx10(
|
|
1497
1568
|
"button",
|
|
1498
1569
|
{
|
|
1499
1570
|
type: "button",
|
|
@@ -1501,13 +1572,13 @@ function SuiteMobileDrawer({
|
|
|
1501
1572
|
"data-test": closeButtonDataTest,
|
|
1502
1573
|
className: "-mr-1.5 inline-flex h-11 w-11 items-center justify-center rounded-lg text-ph-mutedtext transition-colors hover:bg-ph-muted hover:text-ph-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-brand",
|
|
1503
1574
|
"aria-label": closeLabel,
|
|
1504
|
-
children: /* @__PURE__ */
|
|
1575
|
+
children: /* @__PURE__ */ jsx10(X, { className: "h-4 w-4", "aria-hidden": true })
|
|
1505
1576
|
}
|
|
1506
1577
|
) })
|
|
1507
1578
|
]
|
|
1508
1579
|
}
|
|
1509
1580
|
) : null,
|
|
1510
|
-
/* @__PURE__ */
|
|
1581
|
+
/* @__PURE__ */ jsx10(
|
|
1511
1582
|
"div",
|
|
1512
1583
|
{
|
|
1513
1584
|
"data-test": "suite-mobile-drawer-body",
|
|
@@ -1523,7 +1594,7 @@ function SuiteMobileDrawer({
|
|
|
1523
1594
|
|
|
1524
1595
|
// src/suite/components/suite-mobile-header.tsx
|
|
1525
1596
|
import { Menu } from "iconoir-react";
|
|
1526
|
-
import { jsx as
|
|
1597
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1527
1598
|
function SuiteMobileHeader({
|
|
1528
1599
|
onMenuClick,
|
|
1529
1600
|
menuIcon: MenuIcon = Menu,
|
|
@@ -1544,7 +1615,7 @@ function SuiteMobileHeader({
|
|
|
1544
1615
|
className
|
|
1545
1616
|
),
|
|
1546
1617
|
children: [
|
|
1547
|
-
onMenuClick ? /* @__PURE__ */
|
|
1618
|
+
onMenuClick ? /* @__PURE__ */ jsx11(
|
|
1548
1619
|
"button",
|
|
1549
1620
|
{
|
|
1550
1621
|
type: "button",
|
|
@@ -1553,10 +1624,10 @@ function SuiteMobileHeader({
|
|
|
1553
1624
|
className: "suite-press inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-xl text-ph-ink transition-colors hover:bg-ph-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-brand",
|
|
1554
1625
|
onClick: onMenuClick,
|
|
1555
1626
|
"aria-label": menuLabel,
|
|
1556
|
-
children: /* @__PURE__ */
|
|
1627
|
+
children: /* @__PURE__ */ jsx11(MenuIcon, { className: "h-5 w-5", "aria-hidden": true })
|
|
1557
1628
|
}
|
|
1558
1629
|
) : null,
|
|
1559
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ jsx11(
|
|
1560
1631
|
"div",
|
|
1561
1632
|
{
|
|
1562
1633
|
className: cn2(
|
|
@@ -1566,7 +1637,7 @@ function SuiteMobileHeader({
|
|
|
1566
1637
|
children: title
|
|
1567
1638
|
}
|
|
1568
1639
|
),
|
|
1569
|
-
actions ? /* @__PURE__ */
|
|
1640
|
+
actions ? /* @__PURE__ */ jsx11("div", { className: "flex shrink-0 items-center gap-1", children: actions }) : null
|
|
1570
1641
|
]
|
|
1571
1642
|
}
|
|
1572
1643
|
);
|
|
@@ -1576,22 +1647,22 @@ function SuiteMobileHeader({
|
|
|
1576
1647
|
import {
|
|
1577
1648
|
useEffect as useEffect5,
|
|
1578
1649
|
useRef,
|
|
1579
|
-
useState as
|
|
1650
|
+
useState as useState7
|
|
1580
1651
|
} from "react";
|
|
1581
|
-
import { jsx as
|
|
1652
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1582
1653
|
function SuiteBreadcrumbs({ items, className }) {
|
|
1583
|
-
return /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ jsx12("nav", { "aria-label": "Breadcrumb", className, children: /* @__PURE__ */ jsx12("ol", { className: "flex min-w-0 items-center gap-1.5", children: items.map((item, index) => {
|
|
1584
1655
|
const isLast = index === items.length - 1;
|
|
1585
1656
|
return /* @__PURE__ */ jsxs9("li", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
1586
|
-
index > 0 ? /* @__PURE__ */
|
|
1587
|
-
item.href && !isLast ? /* @__PURE__ */
|
|
1657
|
+
index > 0 ? /* @__PURE__ */ jsx12("span", { className: "select-none text-ph-border", "aria-hidden": "true", children: "/" }) : null,
|
|
1658
|
+
item.href && !isLast ? /* @__PURE__ */ jsx12(
|
|
1588
1659
|
"a",
|
|
1589
1660
|
{
|
|
1590
1661
|
href: item.href,
|
|
1591
1662
|
className: "truncate transition hover:text-ph-ink",
|
|
1592
1663
|
children: item.label
|
|
1593
1664
|
}
|
|
1594
|
-
) : /* @__PURE__ */
|
|
1665
|
+
) : /* @__PURE__ */ jsx12(
|
|
1595
1666
|
"span",
|
|
1596
1667
|
{
|
|
1597
1668
|
className: cn2(
|
|
@@ -1616,7 +1687,7 @@ function SuitePage({
|
|
|
1616
1687
|
role,
|
|
1617
1688
|
"aria-live": ariaLive
|
|
1618
1689
|
}) {
|
|
1619
|
-
return /* @__PURE__ */
|
|
1690
|
+
return /* @__PURE__ */ jsx12(
|
|
1620
1691
|
Component,
|
|
1621
1692
|
{
|
|
1622
1693
|
id,
|
|
@@ -1657,7 +1728,7 @@ function SuitePageHeader({
|
|
|
1657
1728
|
sticky = true
|
|
1658
1729
|
}) {
|
|
1659
1730
|
const headerRef = useRef(null);
|
|
1660
|
-
const [stuck, setStuck] =
|
|
1731
|
+
const [stuck, setStuck] = useState7(false);
|
|
1661
1732
|
useEffect5(() => {
|
|
1662
1733
|
if (!sticky) return;
|
|
1663
1734
|
if (typeof IntersectionObserver === "undefined") return;
|
|
@@ -1684,7 +1755,7 @@ function SuitePageHeader({
|
|
|
1684
1755
|
sentinel.remove();
|
|
1685
1756
|
};
|
|
1686
1757
|
}, [sticky]);
|
|
1687
|
-
const resolvedIcon = todayIcon ? /* @__PURE__ */
|
|
1758
|
+
const resolvedIcon = todayIcon ? /* @__PURE__ */ jsx12(
|
|
1688
1759
|
TodayTimeIcon,
|
|
1689
1760
|
{
|
|
1690
1761
|
className: cn2(
|
|
@@ -1707,10 +1778,10 @@ function SuitePageHeader({
|
|
|
1707
1778
|
),
|
|
1708
1779
|
children: [
|
|
1709
1780
|
/* @__PURE__ */ jsxs9("div", { className: "min-w-0 flex-1", children: [
|
|
1710
|
-
eyebrow ? /* @__PURE__ */
|
|
1711
|
-
breadcrumb ? /* @__PURE__ */
|
|
1781
|
+
eyebrow ? /* @__PURE__ */ jsx12("div", { className: "mb-0.5 flex min-w-0 items-center gap-1.5 text-xs text-ph-subtle", children: eyebrow }) : null,
|
|
1782
|
+
breadcrumb ? /* @__PURE__ */ jsx12("div", { className: "mb-0.5 flex min-w-0 items-center gap-1.5 text-xs text-ph-subtle", children: breadcrumb }) : null,
|
|
1712
1783
|
/* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
1713
|
-
resolvedIcon ? /* @__PURE__ */
|
|
1784
|
+
resolvedIcon ? /* @__PURE__ */ jsx12(
|
|
1714
1785
|
"div",
|
|
1715
1786
|
{
|
|
1716
1787
|
className: "hidden shrink-0 sm:flex sm:items-center [&_svg]:h-6 [&_svg]:w-6",
|
|
@@ -1719,7 +1790,7 @@ function SuitePageHeader({
|
|
|
1719
1790
|
}
|
|
1720
1791
|
) : null,
|
|
1721
1792
|
/* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
1722
|
-
/* @__PURE__ */
|
|
1793
|
+
/* @__PURE__ */ jsx12(
|
|
1723
1794
|
"h1",
|
|
1724
1795
|
{
|
|
1725
1796
|
className: cn2(
|
|
@@ -1729,10 +1800,10 @@ function SuitePageHeader({
|
|
|
1729
1800
|
children: title
|
|
1730
1801
|
}
|
|
1731
1802
|
),
|
|
1732
|
-
badge ? /* @__PURE__ */
|
|
1803
|
+
badge ? /* @__PURE__ */ jsx12("span", { className: "rounded-md bg-ph-muted px-2 py-0.5 text-[11px] font-semibold uppercase tracking-wide text-ph-subtle", children: badge }) : null
|
|
1733
1804
|
] })
|
|
1734
1805
|
] }),
|
|
1735
|
-
description ? /* @__PURE__ */
|
|
1806
|
+
description ? /* @__PURE__ */ jsx12(
|
|
1736
1807
|
"div",
|
|
1737
1808
|
{
|
|
1738
1809
|
className: cn2(
|
|
@@ -1743,7 +1814,7 @@ function SuitePageHeader({
|
|
|
1743
1814
|
}
|
|
1744
1815
|
) : null
|
|
1745
1816
|
] }),
|
|
1746
|
-
actions ? /* @__PURE__ */
|
|
1817
|
+
actions ? /* @__PURE__ */ jsx12("div", { className: "flex max-w-full items-center gap-2 self-stretch overflow-x-auto pb-1 sm:shrink-0 sm:self-center sm:overflow-visible sm:pb-0", children: actions }) : null
|
|
1747
1818
|
]
|
|
1748
1819
|
}
|
|
1749
1820
|
);
|
|
@@ -1754,7 +1825,7 @@ function SuiteToolbar({
|
|
|
1754
1825
|
label = "Page tools",
|
|
1755
1826
|
dataTest
|
|
1756
1827
|
}) {
|
|
1757
|
-
return /* @__PURE__ */
|
|
1828
|
+
return /* @__PURE__ */ jsx12(
|
|
1758
1829
|
"div",
|
|
1759
1830
|
{
|
|
1760
1831
|
role: "toolbar",
|
|
@@ -1771,7 +1842,7 @@ function SuiteTabList({
|
|
|
1771
1842
|
label,
|
|
1772
1843
|
dataTest
|
|
1773
1844
|
}) {
|
|
1774
|
-
return /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ jsx12(
|
|
1775
1846
|
"nav",
|
|
1776
1847
|
{
|
|
1777
1848
|
"aria-label": label,
|
|
@@ -1799,17 +1870,17 @@ function SuiteSectionHeader({
|
|
|
1799
1870
|
),
|
|
1800
1871
|
children: [
|
|
1801
1872
|
/* @__PURE__ */ jsxs9("div", { className: "min-w-0", children: [
|
|
1802
|
-
/* @__PURE__ */
|
|
1803
|
-
description ? /* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ jsx12("h2", { className: "font-display text-balance text-lg font-semibold tracking-tight text-ph-ink sm:text-xl", children: title }),
|
|
1874
|
+
description ? /* @__PURE__ */ jsx12("div", { className: "mt-1 max-w-2xl text-pretty text-sm leading-5 text-ph-subtle", children: description }) : null
|
|
1804
1875
|
] }),
|
|
1805
|
-
action ? /* @__PURE__ */
|
|
1876
|
+
action ? /* @__PURE__ */ jsx12("div", { className: "flex min-h-[44px] shrink-0 items-center", children: action }) : null
|
|
1806
1877
|
]
|
|
1807
1878
|
}
|
|
1808
1879
|
);
|
|
1809
1880
|
}
|
|
1810
1881
|
|
|
1811
1882
|
// src/suite/components/suite-settings-layout.tsx
|
|
1812
|
-
import { jsx as
|
|
1883
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1813
1884
|
function SuiteSettingsLayout({
|
|
1814
1885
|
children,
|
|
1815
1886
|
sidebar,
|
|
@@ -1829,7 +1900,7 @@ function SuiteSettingsLayout({
|
|
|
1829
1900
|
dataTest,
|
|
1830
1901
|
className: cn2("flex h-full flex-col overflow-hidden", className),
|
|
1831
1902
|
children: [
|
|
1832
|
-
header != null ? header : /* @__PURE__ */
|
|
1903
|
+
header != null ? header : /* @__PURE__ */ jsx13(
|
|
1833
1904
|
SuitePageHeader,
|
|
1834
1905
|
{
|
|
1835
1906
|
sticky: true,
|
|
@@ -1839,9 +1910,9 @@ function SuiteSettingsLayout({
|
|
|
1839
1910
|
}
|
|
1840
1911
|
),
|
|
1841
1912
|
loading != null ? loading : /* @__PURE__ */ jsxs10("div", { className: "suite-page-body mt-6 flex min-h-0 flex-1 flex-col", children: [
|
|
1842
|
-
mobileNav ? /* @__PURE__ */
|
|
1913
|
+
mobileNav ? /* @__PURE__ */ jsx13("div", { className: "sticky top-0 z-20 mb-2 shrink-0 bg-ph-canvas/95 backdrop-blur lg:hidden", children: mobileNav }) : null,
|
|
1843
1914
|
/* @__PURE__ */ jsxs10("div", { className: "flex min-h-0 flex-1 flex-col gap-6 lg:flex-row lg:gap-8", children: [
|
|
1844
|
-
/* @__PURE__ */
|
|
1915
|
+
/* @__PURE__ */ jsx13(
|
|
1845
1916
|
"aside",
|
|
1846
1917
|
{
|
|
1847
1918
|
"aria-label": "Settings",
|
|
@@ -1849,7 +1920,7 @@ function SuiteSettingsLayout({
|
|
|
1849
1920
|
children: sidebar
|
|
1850
1921
|
}
|
|
1851
1922
|
),
|
|
1852
|
-
/* @__PURE__ */
|
|
1923
|
+
/* @__PURE__ */ jsx13(
|
|
1853
1924
|
"div",
|
|
1854
1925
|
{
|
|
1855
1926
|
className: cn2(
|
|
@@ -1870,7 +1941,7 @@ function SuiteSettingsLayout({
|
|
|
1870
1941
|
import Image2 from "next/image";
|
|
1871
1942
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
1872
1943
|
import { LogOut, Settings } from "iconoir-react";
|
|
1873
|
-
import { jsx as
|
|
1944
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1874
1945
|
function computeInitials(name, email) {
|
|
1875
1946
|
const source = (name || email || "?").trim();
|
|
1876
1947
|
return source.split(/[\s@]+/).filter(Boolean).slice(0, 2).map((part) => part[0]).join("").toUpperCase();
|
|
@@ -1908,7 +1979,7 @@ function SuiteUserMenu({
|
|
|
1908
1979
|
const router = useRouter2();
|
|
1909
1980
|
const initials = fallbackInitials != null ? fallbackInitials : computeInitials(name, email);
|
|
1910
1981
|
const fallbackColor = avatarColorClass(email || name || "?");
|
|
1911
|
-
const avatar = /* @__PURE__ */
|
|
1982
|
+
const avatar = /* @__PURE__ */ jsx14("span", { className: "inline-flex h-10 w-10 items-center justify-center", children: /* @__PURE__ */ jsx14("span", { className: "inline-flex h-8 w-8 items-center justify-center overflow-hidden rounded-full border border-ph-border", children: image ? /* @__PURE__ */ jsx14(
|
|
1912
1983
|
Image2,
|
|
1913
1984
|
{
|
|
1914
1985
|
src: image,
|
|
@@ -1918,7 +1989,7 @@ function SuiteUserMenu({
|
|
|
1918
1989
|
className: "h-full w-full object-cover",
|
|
1919
1990
|
unoptimized: true
|
|
1920
1991
|
}
|
|
1921
|
-
) : /* @__PURE__ */
|
|
1992
|
+
) : /* @__PURE__ */ jsx14(
|
|
1922
1993
|
"span",
|
|
1923
1994
|
{
|
|
1924
1995
|
className: cn2(
|
|
@@ -1931,8 +2002,8 @@ function SuiteUserMenu({
|
|
|
1931
2002
|
const trigger = showDetails ? /* @__PURE__ */ jsxs11("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
1932
2003
|
avatar,
|
|
1933
2004
|
/* @__PURE__ */ jsxs11("span", { className: "flex min-w-0 flex-col text-left", children: [
|
|
1934
|
-
/* @__PURE__ */
|
|
1935
|
-
subtitle ? /* @__PURE__ */
|
|
2005
|
+
/* @__PURE__ */ jsx14("span", { className: "truncate text-sm font-medium text-ph-ink", children: name || email || "Account" }),
|
|
2006
|
+
subtitle ? /* @__PURE__ */ jsx14("span", { className: "truncate text-xs text-ph-mutedtext", children: subtitle }) : null
|
|
1936
2007
|
] })
|
|
1937
2008
|
] }) : avatar;
|
|
1938
2009
|
const accountMenu = /* @__PURE__ */ jsxs11(
|
|
@@ -1955,23 +2026,23 @@ function SuiteUserMenu({
|
|
|
1955
2026
|
"data-test": dataTest,
|
|
1956
2027
|
children: [
|
|
1957
2028
|
/* @__PURE__ */ jsxs11("div", { className: "px-2 py-1.5", children: [
|
|
1958
|
-
/* @__PURE__ */
|
|
1959
|
-
email ? /* @__PURE__ */
|
|
2029
|
+
/* @__PURE__ */ jsx14("p", { className: "truncate text-sm font-medium text-ph-ink", children: name || email || "Account" }),
|
|
2030
|
+
email ? /* @__PURE__ */ jsx14("p", { className: "truncate text-xs text-ph-mutedtext", children: email }) : null
|
|
1960
2031
|
] }),
|
|
1961
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ jsx14("div", { className: "my-1 border-t border-ph-border" }),
|
|
1962
2033
|
/* @__PURE__ */ jsxs11(
|
|
1963
2034
|
DropdownItem,
|
|
1964
2035
|
{
|
|
1965
2036
|
"data-test": `${dataTest}-settings`,
|
|
1966
2037
|
onClick: () => router.push(settingsHref),
|
|
1967
2038
|
children: [
|
|
1968
|
-
/* @__PURE__ */
|
|
2039
|
+
/* @__PURE__ */ jsx14(Settings, { className: "h-4 w-4 text-ph-mutedtext", "aria-hidden": true }),
|
|
1969
2040
|
"Profile settings"
|
|
1970
2041
|
]
|
|
1971
2042
|
}
|
|
1972
2043
|
),
|
|
1973
2044
|
/* @__PURE__ */ jsxs11(DropdownItem, { "data-test": `${dataTest}-sign-out`, onClick: onSignOut, children: [
|
|
1974
|
-
/* @__PURE__ */
|
|
2045
|
+
/* @__PURE__ */ jsx14(LogOut, { className: "h-4 w-4 text-ph-mutedtext", "aria-hidden": true }),
|
|
1975
2046
|
"Sign out"
|
|
1976
2047
|
] })
|
|
1977
2048
|
]
|
|
@@ -1988,8 +2059,8 @@ function SuiteUserMenu({
|
|
|
1988
2059
|
className
|
|
1989
2060
|
),
|
|
1990
2061
|
children: [
|
|
1991
|
-
/* @__PURE__ */
|
|
1992
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ jsx14("div", { className: "shrink-0", children: accountMenu }),
|
|
2063
|
+
/* @__PURE__ */ jsx14(
|
|
1993
2064
|
"button",
|
|
1994
2065
|
{
|
|
1995
2066
|
type: "button",
|
|
@@ -1998,7 +2069,7 @@ function SuiteUserMenu({
|
|
|
1998
2069
|
"aria-label": "Sign out",
|
|
1999
2070
|
className: "inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-ph-mutedtext transition-colors hover:bg-ph-muted hover:text-ph-ink focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ph-focus-ring",
|
|
2000
2071
|
onClick: onSignOut,
|
|
2001
|
-
children: /* @__PURE__ */
|
|
2072
|
+
children: /* @__PURE__ */ jsx14(LogOut, { className: "h-4 w-4", "aria-hidden": true })
|
|
2002
2073
|
}
|
|
2003
2074
|
)
|
|
2004
2075
|
]
|
|
@@ -2008,7 +2079,7 @@ function SuiteUserMenu({
|
|
|
2008
2079
|
|
|
2009
2080
|
// src/suite/components/suite-bottom-nav.tsx
|
|
2010
2081
|
import Link from "next/link";
|
|
2011
|
-
import { Fragment as Fragment4, jsx as
|
|
2082
|
+
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2012
2083
|
function SuiteBottomNav({
|
|
2013
2084
|
items,
|
|
2014
2085
|
ariaLabel = "Primary navigation",
|
|
@@ -2022,7 +2093,7 @@ function SuiteBottomNav({
|
|
|
2022
2093
|
}
|
|
2023
2094
|
const activeIndex = items.findIndex((item) => item.active);
|
|
2024
2095
|
return /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
2025
|
-
/* @__PURE__ */
|
|
2096
|
+
/* @__PURE__ */ jsx15(
|
|
2026
2097
|
"div",
|
|
2027
2098
|
{
|
|
2028
2099
|
"aria-hidden": true,
|
|
@@ -2045,7 +2116,7 @@ function SuiteBottomNav({
|
|
|
2045
2116
|
"--suite-nav-active": activeIndex >= 0 ? activeIndex : 0
|
|
2046
2117
|
},
|
|
2047
2118
|
children: [
|
|
2048
|
-
activeIndex >= 0 ? /* @__PURE__ */
|
|
2119
|
+
activeIndex >= 0 ? /* @__PURE__ */ jsx15("span", { "aria-hidden": true, className: "suite-bottom-nav__indicator" }) : null,
|
|
2049
2120
|
items.map((item) => {
|
|
2050
2121
|
var _a2;
|
|
2051
2122
|
const Icon = item.icon;
|
|
@@ -2062,14 +2133,14 @@ function SuiteBottomNav({
|
|
|
2062
2133
|
active && "font-semibold text-ph-brand"
|
|
2063
2134
|
),
|
|
2064
2135
|
children: [
|
|
2065
|
-
/* @__PURE__ */
|
|
2136
|
+
/* @__PURE__ */ jsx15(
|
|
2066
2137
|
"span",
|
|
2067
2138
|
{
|
|
2068
2139
|
className: cn2(
|
|
2069
2140
|
"suite-bottom-nav__icon relative z-10 inline-flex items-center justify-center",
|
|
2070
2141
|
active && "suite-bottom-nav__icon--active"
|
|
2071
2142
|
),
|
|
2072
|
-
children: /* @__PURE__ */
|
|
2143
|
+
children: /* @__PURE__ */ jsx15(
|
|
2073
2144
|
Icon,
|
|
2074
2145
|
{
|
|
2075
2146
|
className: "h-6 w-6",
|
|
@@ -2079,7 +2150,7 @@ function SuiteBottomNav({
|
|
|
2079
2150
|
)
|
|
2080
2151
|
}
|
|
2081
2152
|
),
|
|
2082
|
-
/* @__PURE__ */
|
|
2153
|
+
/* @__PURE__ */ jsx15("span", { className: "relative z-10 max-w-full truncate", children: item.label })
|
|
2083
2154
|
]
|
|
2084
2155
|
},
|
|
2085
2156
|
item.href
|
|
@@ -2093,7 +2164,7 @@ function SuiteBottomNav({
|
|
|
2093
2164
|
|
|
2094
2165
|
// src/suite/components/today-calibrating.tsx
|
|
2095
2166
|
import { Refresh as RefreshCw2, SunLight as Sun } from "iconoir-react";
|
|
2096
|
-
import { jsx as
|
|
2167
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2097
2168
|
function TodayCalibrating({
|
|
2098
2169
|
onRetry,
|
|
2099
2170
|
retrying = false,
|
|
@@ -2112,17 +2183,17 @@ function TodayCalibrating({
|
|
|
2112
2183
|
),
|
|
2113
2184
|
"data-test": "today-calibrating",
|
|
2114
2185
|
children: [
|
|
2115
|
-
/* @__PURE__ */
|
|
2186
|
+
/* @__PURE__ */ jsx16(
|
|
2116
2187
|
"div",
|
|
2117
2188
|
{
|
|
2118
2189
|
className: "pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_35%,rgba(251,191,36,0.1),transparent_55%)]",
|
|
2119
2190
|
"aria-hidden": true
|
|
2120
2191
|
}
|
|
2121
2192
|
),
|
|
2122
|
-
/* @__PURE__ */
|
|
2123
|
-
/* @__PURE__ */
|
|
2124
|
-
/* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
2193
|
+
/* @__PURE__ */ jsx16("div", { className: "relative mb-5 flex h-14 w-14 items-center justify-center rounded-2xl border border-ph-border bg-ph-surface text-ph-ink shadow-sm", children: /* @__PURE__ */ jsx16(Sun, { className: "h-8 w-8", strokeWidth: 2, "aria-hidden": true }) }),
|
|
2194
|
+
/* @__PURE__ */ jsx16("h2", { className: "relative text-base font-semibold tracking-tight text-ph-ink sm:text-lg md:text-xl", children: "Calibrating your day" }),
|
|
2195
|
+
/* @__PURE__ */ jsx16("p", { className: "relative mt-1.5 max-w-sm text-sm sm:text-[15px] leading-relaxed text-ph-subtle", children: "Pulling together tasks, time and updates from your workspace\u2026" }),
|
|
2196
|
+
/* @__PURE__ */ jsx16("div", { className: "relative mt-5 flex justify-center", children: /* @__PURE__ */ jsx16(Spinner, { size: "sm", className: "opacity-70", label: "Loading today" }) }),
|
|
2126
2197
|
onRetry ? /* @__PURE__ */ jsxs13(
|
|
2127
2198
|
"button",
|
|
2128
2199
|
{
|
|
@@ -2131,7 +2202,7 @@ function TodayCalibrating({
|
|
|
2131
2202
|
disabled: retrying,
|
|
2132
2203
|
className: "relative mt-6 inline-flex items-center gap-2 rounded-xl border border-ph-border bg-ph-canvas px-4 py-2 text-sm font-medium text-ph-ink transition hover:bg-ph-muted disabled:opacity-60",
|
|
2133
2204
|
children: [
|
|
2134
|
-
retrying ? /* @__PURE__ */
|
|
2205
|
+
retrying ? /* @__PURE__ */ jsx16(Spinner, { size: "sm", className: retrySpinnerClassName }) : /* @__PURE__ */ jsx16(RefreshCw2, { className: "h-4 w-4", "aria-hidden": true }),
|
|
2135
2206
|
"Try again"
|
|
2136
2207
|
]
|
|
2137
2208
|
}
|
|
@@ -2143,13 +2214,13 @@ function TodayCalibrating({
|
|
|
2143
2214
|
|
|
2144
2215
|
// src/suite/components/theme-provider.tsx
|
|
2145
2216
|
import {
|
|
2146
|
-
createContext,
|
|
2217
|
+
createContext as createContext2,
|
|
2147
2218
|
useCallback as useCallback2,
|
|
2148
|
-
useContext,
|
|
2219
|
+
useContext as useContext2,
|
|
2149
2220
|
useEffect as useEffect6,
|
|
2150
|
-
useMemo,
|
|
2221
|
+
useMemo as useMemo2,
|
|
2151
2222
|
useRef as useRef2,
|
|
2152
|
-
useState as
|
|
2223
|
+
useState as useState8
|
|
2153
2224
|
} from "react";
|
|
2154
2225
|
|
|
2155
2226
|
// src/suite/lib/cookies.ts
|
|
@@ -2199,8 +2270,8 @@ function clearCookie(name) {
|
|
|
2199
2270
|
}
|
|
2200
2271
|
|
|
2201
2272
|
// src/suite/components/theme-provider.tsx
|
|
2202
|
-
import { jsx as
|
|
2203
|
-
var SuiteThemeContext =
|
|
2273
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2274
|
+
var SuiteThemeContext = createContext2(null);
|
|
2204
2275
|
var suiteThemeChannel = null;
|
|
2205
2276
|
function broadcastTheme(theme) {
|
|
2206
2277
|
if (typeof BroadcastChannel === "undefined") return;
|
|
@@ -2266,7 +2337,7 @@ function SuiteThemeProvider({
|
|
|
2266
2337
|
config,
|
|
2267
2338
|
children
|
|
2268
2339
|
}) {
|
|
2269
|
-
const [state, setState] =
|
|
2340
|
+
const [state, setState] = useState8(() => {
|
|
2270
2341
|
const theme = readStoredTheme(config.storageKey);
|
|
2271
2342
|
if (typeof document === "undefined") {
|
|
2272
2343
|
return { theme, resolvedTheme: config.fallbackTheme };
|
|
@@ -2364,14 +2435,14 @@ function SuiteThemeProvider({
|
|
|
2364
2435
|
const next = resolveTheme(themeRef.current, config.fallbackTheme) === "dark" ? "light" : "dark";
|
|
2365
2436
|
setTheme(next);
|
|
2366
2437
|
}, [config, setTheme]);
|
|
2367
|
-
const value =
|
|
2438
|
+
const value = useMemo2(
|
|
2368
2439
|
() => ({ theme: state.theme, resolvedTheme: state.resolvedTheme, setTheme, toggleTheme }),
|
|
2369
2440
|
[state.theme, state.resolvedTheme, setTheme, toggleTheme]
|
|
2370
2441
|
);
|
|
2371
|
-
return /* @__PURE__ */
|
|
2442
|
+
return /* @__PURE__ */ jsx17(SuiteThemeContext.Provider, { value, children });
|
|
2372
2443
|
}
|
|
2373
2444
|
function useSuiteTheme() {
|
|
2374
|
-
const ctx =
|
|
2445
|
+
const ctx = useContext2(SuiteThemeContext);
|
|
2375
2446
|
if (!ctx) throw new Error("useTheme must be used within ThemeProvider");
|
|
2376
2447
|
return ctx;
|
|
2377
2448
|
}
|
|
@@ -2385,7 +2456,7 @@ import {
|
|
|
2385
2456
|
useId,
|
|
2386
2457
|
useLayoutEffect,
|
|
2387
2458
|
useRef as useRef3,
|
|
2388
|
-
useState as
|
|
2459
|
+
useState as useState9
|
|
2389
2460
|
} from "react";
|
|
2390
2461
|
import {
|
|
2391
2462
|
ArrowDown,
|
|
@@ -2398,7 +2469,7 @@ import {
|
|
|
2398
2469
|
Square,
|
|
2399
2470
|
WarningTriangle
|
|
2400
2471
|
} from "iconoir-react";
|
|
2401
|
-
import { Fragment as Fragment5, jsx as
|
|
2472
|
+
import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2402
2473
|
var SuiteAiMarkdownMessage = lazy(() => import("./ai-message-markdown-AUEMCO7K.mjs"));
|
|
2403
2474
|
var SUITE_OPEN_ASK_AI_EVENT = "shellstack:open-ask-ai";
|
|
2404
2475
|
var SUITE_ASK_AI_OPEN_KEY = "shellstack:shelly-open";
|
|
@@ -2487,8 +2558,8 @@ function SuiteAiPanel({
|
|
|
2487
2558
|
isWaitingForReply = false
|
|
2488
2559
|
}) {
|
|
2489
2560
|
const inputId = useId();
|
|
2490
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
2491
|
-
const [resolvingId, setResolvingId] =
|
|
2561
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState9(false);
|
|
2562
|
+
const [resolvingId, setResolvingId] = useState9("");
|
|
2492
2563
|
const open = openProp != null ? openProp : uncontrolledOpen;
|
|
2493
2564
|
const setOpen = useCallback3(
|
|
2494
2565
|
(next) => {
|
|
@@ -2498,19 +2569,19 @@ function SuiteAiPanel({
|
|
|
2498
2569
|
},
|
|
2499
2570
|
[onOpenChange, openProp]
|
|
2500
2571
|
);
|
|
2501
|
-
const [prompt, setPrompt] =
|
|
2502
|
-
const [messages, setMessages] =
|
|
2503
|
-
const [loading, setLoading] =
|
|
2504
|
-
const [hydrating, setHydrating] =
|
|
2505
|
-
const [error, setError] =
|
|
2506
|
-
const [atBottom, setAtBottom] =
|
|
2572
|
+
const [prompt, setPrompt] = useState9("");
|
|
2573
|
+
const [messages, setMessages] = useState9([]);
|
|
2574
|
+
const [loading, setLoading] = useState9(false);
|
|
2575
|
+
const [hydrating, setHydrating] = useState9(false);
|
|
2576
|
+
const [error, setError] = useState9("");
|
|
2577
|
+
const [atBottom, setAtBottom] = useState9(true);
|
|
2507
2578
|
const scrollerRef = useRef3(null);
|
|
2508
2579
|
const textareaRef = useRef3(null);
|
|
2509
2580
|
const abortRef = useRef3(null);
|
|
2510
2581
|
const pendingPromptRef = useRef3(null);
|
|
2511
|
-
const [editingIndex, setEditingIndex] =
|
|
2512
|
-
const [editDraft, setEditDraft] =
|
|
2513
|
-
const [copiedIndex, setCopiedIndex] =
|
|
2582
|
+
const [editingIndex, setEditingIndex] = useState9(null);
|
|
2583
|
+
const [editDraft, setEditDraft] = useState9("");
|
|
2584
|
+
const [copiedIndex, setCopiedIndex] = useState9(null);
|
|
2514
2585
|
const waiting = loading || isWaitingForReply;
|
|
2515
2586
|
useEffect7(() => {
|
|
2516
2587
|
function onOpen(event) {
|
|
@@ -2775,7 +2846,7 @@ function SuiteAiPanel({
|
|
|
2775
2846
|
"aria-label": title,
|
|
2776
2847
|
children: [
|
|
2777
2848
|
/* @__PURE__ */ jsxs14("header", { className: "flex items-center gap-2 px-2 pb-2", children: [
|
|
2778
|
-
/* @__PURE__ */
|
|
2849
|
+
/* @__PURE__ */ jsx18("h2", { className: "sr-only", children: title }),
|
|
2779
2850
|
messages.length > 0 ? /* @__PURE__ */ jsxs14(
|
|
2780
2851
|
"button",
|
|
2781
2852
|
{
|
|
@@ -2785,7 +2856,7 @@ function SuiteAiPanel({
|
|
|
2785
2856
|
className: "ml-auto inline-flex h-9 items-center gap-1.5 rounded-lg px-2 text-xs font-medium text-ph-subtle transition-colors hover:bg-ph-muted hover:text-ph-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-focus disabled:opacity-40",
|
|
2786
2857
|
"data-test": "ask-ai-clear",
|
|
2787
2858
|
children: [
|
|
2788
|
-
/* @__PURE__ */
|
|
2859
|
+
/* @__PURE__ */ jsx18(Erase, { className: "h-3.5 w-3.5" }),
|
|
2789
2860
|
"Clear"
|
|
2790
2861
|
]
|
|
2791
2862
|
}
|
|
@@ -2804,14 +2875,14 @@ function SuiteAiPanel({
|
|
|
2804
2875
|
className: "suite-scroll-lock h-full space-y-5 overflow-y-auto px-2 py-3",
|
|
2805
2876
|
children: [
|
|
2806
2877
|
hydrating && messages.length === 0 ? /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 text-sm text-ph-subtle", children: [
|
|
2807
|
-
/* @__PURE__ */
|
|
2878
|
+
/* @__PURE__ */ jsx18(Spinner, { className: "h-4 w-4 animate-spin" }),
|
|
2808
2879
|
"Loading your chat\u2026"
|
|
2809
2880
|
] }) : null,
|
|
2810
2881
|
!hydrating && messages.length === 0 && !error ? /* @__PURE__ */ jsxs14("div", { className: "mx-auto mt-4 flex max-w-sm flex-col items-center px-1 text-center", children: [
|
|
2811
|
-
/* @__PURE__ */
|
|
2812
|
-
/* @__PURE__ */
|
|
2813
|
-
/* @__PURE__ */
|
|
2814
|
-
presets.length > 0 ? /* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ jsx18("span", { className: "flex h-10 w-10 items-center justify-center rounded-2xl bg-ph-brand/10 text-ph-brand", children: /* @__PURE__ */ jsx18(Icon, { className: "h-5 w-5" }) }),
|
|
2883
|
+
/* @__PURE__ */ jsx18("p", { className: "mt-3 font-display text-base font-semibold text-ph-ink", children: "How can I help?" }),
|
|
2884
|
+
/* @__PURE__ */ jsx18("p", { className: "mt-1 text-sm leading-relaxed text-ph-subtle", children: emptyState }),
|
|
2885
|
+
presets.length > 0 ? /* @__PURE__ */ jsx18("div", { className: "mt-4 flex w-full flex-col gap-2", children: presets.map((preset) => /* @__PURE__ */ jsxs14(
|
|
2815
2886
|
"button",
|
|
2816
2887
|
{
|
|
2817
2888
|
type: "button",
|
|
@@ -2819,9 +2890,9 @@ function SuiteAiPanel({
|
|
|
2819
2890
|
disabled: waiting || hydrating,
|
|
2820
2891
|
className: "group flex w-full items-center gap-2 rounded-xl border border-ph-border bg-ph-surface px-3 py-2 text-left text-sm text-ph-ink transition-colors hover:border-ph-brand/40 hover:bg-ph-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-focus disabled:opacity-40",
|
|
2821
2892
|
children: [
|
|
2822
|
-
/* @__PURE__ */
|
|
2823
|
-
/* @__PURE__ */
|
|
2824
|
-
/* @__PURE__ */
|
|
2893
|
+
/* @__PURE__ */ jsx18(Sparks, { className: "h-4 w-4 shrink-0 text-ph-brand" }),
|
|
2894
|
+
/* @__PURE__ */ jsx18("span", { className: "min-w-0 flex-1 truncate", children: preset.label }),
|
|
2895
|
+
/* @__PURE__ */ jsx18(ArrowUp, { className: "h-3.5 w-3.5 shrink-0 rotate-45 text-ph-mutedtext transition-transform group-hover:translate-x-0.5" })
|
|
2825
2896
|
]
|
|
2826
2897
|
},
|
|
2827
2898
|
preset.label
|
|
@@ -2832,13 +2903,13 @@ function SuiteAiPanel({
|
|
|
2832
2903
|
const isUser = message.role === "user";
|
|
2833
2904
|
if (isUser) {
|
|
2834
2905
|
if (editingIndex === index) {
|
|
2835
|
-
return /* @__PURE__ */
|
|
2906
|
+
return /* @__PURE__ */ jsx18(
|
|
2836
2907
|
"div",
|
|
2837
2908
|
{
|
|
2838
2909
|
className: "suite-msg-in suite-msg-in--user flex justify-end",
|
|
2839
2910
|
"data-test": "ask-ai-user",
|
|
2840
2911
|
children: /* @__PURE__ */ jsxs14("div", { className: "w-full max-w-[85%] space-y-2", children: [
|
|
2841
|
-
/* @__PURE__ */
|
|
2912
|
+
/* @__PURE__ */ jsx18(
|
|
2842
2913
|
"textarea",
|
|
2843
2914
|
{
|
|
2844
2915
|
autoFocus: true,
|
|
@@ -2860,7 +2931,7 @@ function SuiteAiPanel({
|
|
|
2860
2931
|
}
|
|
2861
2932
|
),
|
|
2862
2933
|
/* @__PURE__ */ jsxs14("div", { className: "flex justify-end gap-2", children: [
|
|
2863
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ jsx18(
|
|
2864
2935
|
"button",
|
|
2865
2936
|
{
|
|
2866
2937
|
type: "button",
|
|
@@ -2872,7 +2943,7 @@ function SuiteAiPanel({
|
|
|
2872
2943
|
children: "Cancel"
|
|
2873
2944
|
}
|
|
2874
2945
|
),
|
|
2875
|
-
/* @__PURE__ */
|
|
2946
|
+
/* @__PURE__ */ jsx18(
|
|
2876
2947
|
"button",
|
|
2877
2948
|
{
|
|
2878
2949
|
type: "button",
|
|
@@ -2889,14 +2960,14 @@ function SuiteAiPanel({
|
|
|
2889
2960
|
`user-${index}`
|
|
2890
2961
|
);
|
|
2891
2962
|
}
|
|
2892
|
-
return /* @__PURE__ */
|
|
2963
|
+
return /* @__PURE__ */ jsx18(
|
|
2893
2964
|
"div",
|
|
2894
2965
|
{
|
|
2895
2966
|
className: "suite-msg-in suite-msg-in--user flex justify-end",
|
|
2896
2967
|
"data-test": "ask-ai-user",
|
|
2897
2968
|
children: /* @__PURE__ */ jsxs14("div", { className: "group flex items-end gap-1.5", children: [
|
|
2898
2969
|
!waiting ? /* @__PURE__ */ jsxs14("div", { className: "mb-0.5 flex items-center gap-0.5 opacity-100 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-focus-within:opacity-100 [@media(hover:hover)]:group-hover:opacity-100", children: [
|
|
2899
|
-
/* @__PURE__ */
|
|
2970
|
+
/* @__PURE__ */ jsx18(
|
|
2900
2971
|
"button",
|
|
2901
2972
|
{
|
|
2902
2973
|
type: "button",
|
|
@@ -2904,10 +2975,10 @@ function SuiteAiPanel({
|
|
|
2904
2975
|
"aria-label": copiedIndex === index ? "Copied" : "Copy message",
|
|
2905
2976
|
"data-test": "ask-ai-copy",
|
|
2906
2977
|
className: "flex h-7 w-7 items-center justify-center rounded-lg text-ph-mutedtext transition-colors hover:bg-ph-muted hover:text-ph-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-focus",
|
|
2907
|
-
children: copiedIndex === index ? /* @__PURE__ */
|
|
2978
|
+
children: copiedIndex === index ? /* @__PURE__ */ jsx18(Check, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx18(Copy, { className: "h-3.5 w-3.5" })
|
|
2908
2979
|
}
|
|
2909
2980
|
),
|
|
2910
|
-
/* @__PURE__ */
|
|
2981
|
+
/* @__PURE__ */ jsx18(
|
|
2911
2982
|
"button",
|
|
2912
2983
|
{
|
|
2913
2984
|
type: "button",
|
|
@@ -2918,11 +2989,11 @@ function SuiteAiPanel({
|
|
|
2918
2989
|
"aria-label": "Edit message",
|
|
2919
2990
|
"data-test": "ask-ai-edit",
|
|
2920
2991
|
className: "flex h-7 w-7 items-center justify-center rounded-lg text-ph-mutedtext transition-colors hover:bg-ph-muted hover:text-ph-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-focus",
|
|
2921
|
-
children: /* @__PURE__ */
|
|
2992
|
+
children: /* @__PURE__ */ jsx18(EditPencil, { className: "h-3.5 w-3.5" })
|
|
2922
2993
|
}
|
|
2923
2994
|
)
|
|
2924
2995
|
] }) : null,
|
|
2925
|
-
/* @__PURE__ */
|
|
2996
|
+
/* @__PURE__ */ jsx18("div", { className: "w-fit max-w-[85%] whitespace-pre-wrap break-words rounded-2xl rounded-br-md bg-ph-brand px-3 py-2 text-sm leading-relaxed text-[var(--ph-on-accent)] [overflow-wrap:anywhere]", children: message.content })
|
|
2926
2997
|
] })
|
|
2927
2998
|
},
|
|
2928
2999
|
`user-${index}`
|
|
@@ -2934,25 +3005,25 @@ function SuiteAiPanel({
|
|
|
2934
3005
|
className: "flex items-end gap-2",
|
|
2935
3006
|
"data-test": "ask-ai-assistant",
|
|
2936
3007
|
children: [
|
|
2937
|
-
/* @__PURE__ */
|
|
3008
|
+
/* @__PURE__ */ jsx18(
|
|
2938
3009
|
"span",
|
|
2939
3010
|
{
|
|
2940
3011
|
className: "suite-msg-avatar mb-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-ph-brand/10 text-ph-brand",
|
|
2941
3012
|
"aria-hidden": true,
|
|
2942
|
-
children: /* @__PURE__ */
|
|
3013
|
+
children: /* @__PURE__ */ jsx18(Icon, { className: "h-3.5 w-3.5" })
|
|
2943
3014
|
}
|
|
2944
3015
|
),
|
|
2945
3016
|
/* @__PURE__ */ jsxs14("div", { className: "suite-msg-bubble min-w-0 max-w-[85%] space-y-2", children: [
|
|
2946
|
-
/* @__PURE__ */
|
|
3017
|
+
/* @__PURE__ */ jsx18("div", { className: "rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2 text-sm leading-relaxed text-ph-ink", children: /* @__PURE__ */ jsx18(
|
|
2947
3018
|
Suspense,
|
|
2948
3019
|
{
|
|
2949
3020
|
fallback: (
|
|
2950
3021
|
// The chunk is pre-warmed above, so this only shows on a
|
|
2951
3022
|
// cold cache. Keep it invisible — a skeleton here reads
|
|
2952
3023
|
// as if it were part of the answer.
|
|
2953
|
-
/* @__PURE__ */
|
|
3024
|
+
/* @__PURE__ */ jsx18("span", { className: "sr-only", role: "status", children: "Rendering response\u2026" })
|
|
2954
3025
|
),
|
|
2955
|
-
children: /* @__PURE__ */
|
|
3026
|
+
children: /* @__PURE__ */ jsx18(
|
|
2956
3027
|
SuiteAiMarkdownMessage,
|
|
2957
3028
|
{
|
|
2958
3029
|
markdown: message.content,
|
|
@@ -2968,9 +3039,9 @@ function SuiteAiPanel({
|
|
|
2968
3039
|
"data-status": action.status,
|
|
2969
3040
|
className: "rounded-xl border border-ph-border bg-ph-surface px-3 py-2 text-sm text-ph-ink",
|
|
2970
3041
|
children: [
|
|
2971
|
-
/* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ jsx18("p", { className: "font-medium", children: action.summary }),
|
|
2972
3043
|
action.status === "proposed" ? /* @__PURE__ */ jsxs14("div", { className: "mt-2 flex flex-wrap gap-2", children: [
|
|
2973
|
-
/* @__PURE__ */
|
|
3044
|
+
/* @__PURE__ */ jsx18(
|
|
2974
3045
|
"button",
|
|
2975
3046
|
{
|
|
2976
3047
|
type: "button",
|
|
@@ -2981,7 +3052,7 @@ function SuiteAiPanel({
|
|
|
2981
3052
|
children: resolvingId === action.id ? "Working\u2026" : "Confirm"
|
|
2982
3053
|
}
|
|
2983
3054
|
),
|
|
2984
|
-
/* @__PURE__ */
|
|
3055
|
+
/* @__PURE__ */ jsx18(
|
|
2985
3056
|
"button",
|
|
2986
3057
|
{
|
|
2987
3058
|
type: "button",
|
|
@@ -2997,7 +3068,7 @@ function SuiteAiPanel({
|
|
|
2997
3068
|
"Done",
|
|
2998
3069
|
action.href ? /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2999
3070
|
" \xB7 ",
|
|
3000
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ jsx18(
|
|
3001
3072
|
"a",
|
|
3002
3073
|
{
|
|
3003
3074
|
href: action.href,
|
|
@@ -3007,8 +3078,8 @@ function SuiteAiPanel({
|
|
|
3007
3078
|
)
|
|
3008
3079
|
] }) : null
|
|
3009
3080
|
] }) : null,
|
|
3010
|
-
action.status === "cancelled" ? /* @__PURE__ */
|
|
3011
|
-
action.status === "failed" ? /* @__PURE__ */
|
|
3081
|
+
action.status === "cancelled" ? /* @__PURE__ */ jsx18("p", { className: "mt-1 text-xs text-ph-subtle", children: "Cancelled" }) : null,
|
|
3082
|
+
action.status === "failed" ? /* @__PURE__ */ jsx18("p", { className: "mt-1 text-xs text-ph-danger", children: action.error || "Could not apply that." }) : null
|
|
3012
3083
|
]
|
|
3013
3084
|
},
|
|
3014
3085
|
action.id
|
|
@@ -3020,25 +3091,25 @@ function SuiteAiPanel({
|
|
|
3020
3091
|
);
|
|
3021
3092
|
}),
|
|
3022
3093
|
waiting ? /* @__PURE__ */ jsxs14("div", { className: "flex items-end gap-2", "aria-hidden": true, children: [
|
|
3023
|
-
/* @__PURE__ */
|
|
3094
|
+
/* @__PURE__ */ jsx18("span", { className: "mb-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-ph-brand/10 text-ph-brand", children: /* @__PURE__ */ jsx18(Icon, { className: "h-3.5 w-3.5" }) }),
|
|
3024
3095
|
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1.5 rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2.5", children: [
|
|
3025
|
-
/* @__PURE__ */
|
|
3026
|
-
/* @__PURE__ */
|
|
3027
|
-
/* @__PURE__ */
|
|
3096
|
+
/* @__PURE__ */ jsx18("span", { className: "suite-think-dot h-1.5 w-1.5 rounded-full bg-ph-mutedtext" }),
|
|
3097
|
+
/* @__PURE__ */ jsx18("span", { className: "suite-think-dot suite-think-dot--2 h-1.5 w-1.5 rounded-full bg-ph-mutedtext" }),
|
|
3098
|
+
/* @__PURE__ */ jsx18("span", { className: "suite-think-dot suite-think-dot--3 h-1.5 w-1.5 rounded-full bg-ph-mutedtext" })
|
|
3028
3099
|
] })
|
|
3029
3100
|
] }) : null,
|
|
3030
|
-
waiting ? /* @__PURE__ */
|
|
3101
|
+
waiting ? /* @__PURE__ */ jsx18("span", { className: "sr-only", "aria-live": "polite", children: "Assistant is responding\u2026" }) : null,
|
|
3031
3102
|
error ? /* @__PURE__ */ jsxs14(
|
|
3032
3103
|
"div",
|
|
3033
3104
|
{
|
|
3034
3105
|
role: "alert",
|
|
3035
3106
|
className: "flex items-start gap-2 rounded-xl border border-ph-danger/30 bg-ph-danger/10 px-3 py-2.5 text-sm text-ph-ink",
|
|
3036
3107
|
children: [
|
|
3037
|
-
/* @__PURE__ */
|
|
3108
|
+
/* @__PURE__ */ jsx18(WarningTriangle, { className: "mt-0.5 h-4 w-4 shrink-0 text-ph-danger" }),
|
|
3038
3109
|
/* @__PURE__ */ jsxs14("div", { className: "min-w-0 flex-1", children: [
|
|
3039
|
-
/* @__PURE__ */
|
|
3040
|
-
/* @__PURE__ */
|
|
3041
|
-
/* @__PURE__ */
|
|
3110
|
+
/* @__PURE__ */ jsx18("p", { className: "font-medium text-ph-danger", children: "Something went wrong" }),
|
|
3111
|
+
/* @__PURE__ */ jsx18("p", { className: "mt-0.5 text-ph-subtle", children: error }),
|
|
3112
|
+
/* @__PURE__ */ jsx18(
|
|
3042
3113
|
"button",
|
|
3043
3114
|
{
|
|
3044
3115
|
type: "button",
|
|
@@ -3055,20 +3126,20 @@ function SuiteAiPanel({
|
|
|
3055
3126
|
]
|
|
3056
3127
|
}
|
|
3057
3128
|
),
|
|
3058
|
-
!atBottom ? /* @__PURE__ */
|
|
3129
|
+
!atBottom ? /* @__PURE__ */ jsx18("div", { className: "absolute bottom-3 left-1/2 -translate-x-1/2", children: /* @__PURE__ */ jsx18(Tooltip, { content: "Scroll to latest", children: /* @__PURE__ */ jsx18(
|
|
3059
3130
|
"button",
|
|
3060
3131
|
{
|
|
3061
3132
|
type: "button",
|
|
3062
3133
|
onClick: () => scrollToBottom("smooth"),
|
|
3063
3134
|
className: "flex h-9 w-9 items-center justify-center rounded-full border border-ph-border bg-ph-surface text-ph-subtle shadow-ph-md transition-colors hover:text-ph-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-focus",
|
|
3064
3135
|
"aria-label": "Scroll to latest",
|
|
3065
|
-
children: /* @__PURE__ */
|
|
3136
|
+
children: /* @__PURE__ */ jsx18(ArrowDown, { className: "h-4 w-4" })
|
|
3066
3137
|
}
|
|
3067
3138
|
) }) }) : null
|
|
3068
3139
|
] }),
|
|
3069
|
-
/* @__PURE__ */
|
|
3070
|
-
/* @__PURE__ */
|
|
3071
|
-
/* @__PURE__ */
|
|
3140
|
+
/* @__PURE__ */ jsx18("div", { className: "px-2 pt-2 pb-[max(2rem,calc(env(safe-area-inset-bottom)+1rem))]", children: /* @__PURE__ */ jsxs14("div", { className: "flex items-end gap-1.5 rounded-2xl border border-ph-border bg-ph-surface px-1.5 py-1 transition-colors focus-within:border-ph-brand/45 focus-within:ring-2 focus-within:ring-ph-focus/35", children: [
|
|
3141
|
+
/* @__PURE__ */ jsx18("label", { htmlFor: inputId, className: "sr-only", children: "Ask a question" }),
|
|
3142
|
+
/* @__PURE__ */ jsx18(
|
|
3072
3143
|
"textarea",
|
|
3073
3144
|
{
|
|
3074
3145
|
id: inputId,
|
|
@@ -3087,7 +3158,7 @@ function SuiteAiPanel({
|
|
|
3087
3158
|
className: "max-h-36 min-h-10 flex-1 resize-none bg-transparent px-1.5 py-2 text-sm leading-relaxed text-ph-ink outline-none placeholder:text-ph-mutedtext"
|
|
3088
3159
|
}
|
|
3089
3160
|
),
|
|
3090
|
-
waiting ? /* @__PURE__ */
|
|
3161
|
+
waiting ? /* @__PURE__ */ jsx18(Tooltip, { content: "Stop generating", children: /* @__PURE__ */ jsx18(
|
|
3091
3162
|
"button",
|
|
3092
3163
|
{
|
|
3093
3164
|
type: "button",
|
|
@@ -3095,9 +3166,9 @@ function SuiteAiPanel({
|
|
|
3095
3166
|
"data-test": "ask-ai-stop",
|
|
3096
3167
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-ph-muted text-ph-ink transition-colors hover:bg-ph-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-focus",
|
|
3097
3168
|
"aria-label": "Stop generating",
|
|
3098
|
-
children: /* @__PURE__ */
|
|
3169
|
+
children: /* @__PURE__ */ jsx18(Square, { className: "h-3.5 w-3.5 fill-current" })
|
|
3099
3170
|
}
|
|
3100
|
-
) }) : /* @__PURE__ */
|
|
3171
|
+
) }) : /* @__PURE__ */ jsx18(Tooltip, { content: "Send message", children: /* @__PURE__ */ jsx18(
|
|
3101
3172
|
"button",
|
|
3102
3173
|
{
|
|
3103
3174
|
type: "button",
|
|
@@ -3106,7 +3177,7 @@ function SuiteAiPanel({
|
|
|
3106
3177
|
"data-test": "ask-ai-send",
|
|
3107
3178
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-ph-brand text-[color:var(--ph-on-accent)] transition-opacity hover:bg-ph-brand-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-focus disabled:opacity-40",
|
|
3108
3179
|
"aria-label": "Send message",
|
|
3109
|
-
children: /* @__PURE__ */
|
|
3180
|
+
children: /* @__PURE__ */ jsx18(ArrowUp, { className: "h-4 w-4" })
|
|
3110
3181
|
}
|
|
3111
3182
|
) })
|
|
3112
3183
|
] }) })
|
|
@@ -3116,9 +3187,9 @@ function SuiteAiPanel({
|
|
|
3116
3187
|
}
|
|
3117
3188
|
|
|
3118
3189
|
// src/suite/components/workspace-switcher.tsx
|
|
3119
|
-
import { useState as
|
|
3190
|
+
import { useState as useState10 } from "react";
|
|
3120
3191
|
import { Building, Check as Check2, NavArrowDown } from "iconoir-react";
|
|
3121
|
-
import { Fragment as Fragment6, jsx as
|
|
3192
|
+
import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3122
3193
|
function SuiteWorkspaceSwitcher({
|
|
3123
3194
|
workspaces = [],
|
|
3124
3195
|
groups,
|
|
@@ -3134,9 +3205,9 @@ function SuiteWorkspaceSwitcher({
|
|
|
3134
3205
|
footer
|
|
3135
3206
|
}) {
|
|
3136
3207
|
var _a2;
|
|
3137
|
-
const [open, setOpen] =
|
|
3208
|
+
const [open, setOpen] = useState10(false);
|
|
3138
3209
|
const sections = (_a2 = groups == null ? void 0 : groups.filter((group) => group.workspaces.length > 0)) != null ? _a2 : workspaces.length > 0 ? [{ id: "workspaces", label: "Switch workspace", workspaces }] : [];
|
|
3139
|
-
return /* @__PURE__ */
|
|
3210
|
+
return /* @__PURE__ */ jsx19(
|
|
3140
3211
|
DropdownMenu2,
|
|
3141
3212
|
{
|
|
3142
3213
|
"aria-label": "Switch workspace",
|
|
@@ -3157,10 +3228,10 @@ function SuiteWorkspaceSwitcher({
|
|
|
3157
3228
|
),
|
|
3158
3229
|
"data-test": "workspace-switcher-trigger",
|
|
3159
3230
|
children: [
|
|
3160
|
-
/* @__PURE__ */
|
|
3231
|
+
/* @__PURE__ */ jsx19(Building, { className: "h-4 w-4 shrink-0 text-ph-ink", "aria-hidden": true }),
|
|
3161
3232
|
!collapsed ? /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
3162
|
-
/* @__PURE__ */
|
|
3163
|
-
/* @__PURE__ */
|
|
3233
|
+
/* @__PURE__ */ jsx19("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-ph-ink", children: name }),
|
|
3234
|
+
/* @__PURE__ */ jsx19(
|
|
3164
3235
|
NavArrowDown,
|
|
3165
3236
|
{
|
|
3166
3237
|
className: cn2(
|
|
@@ -3181,9 +3252,9 @@ function SuiteWorkspaceSwitcher({
|
|
|
3181
3252
|
className: "p-1",
|
|
3182
3253
|
"data-test": "workspace-switcher-menu",
|
|
3183
3254
|
children: [
|
|
3184
|
-
sections.length === 0 ? /* @__PURE__ */
|
|
3185
|
-
/* @__PURE__ */
|
|
3186
|
-
section.workspaces.map((workspace) => /* @__PURE__ */
|
|
3255
|
+
sections.length === 0 ? /* @__PURE__ */ jsx19("p", { className: "px-3 py-2 text-sm text-ph-mutedtext", children: emptyLabel }) : sections.map((section) => /* @__PURE__ */ jsxs15("div", { children: [
|
|
3256
|
+
/* @__PURE__ */ jsx19("p", { className: "px-3 py-2 text-[10px] font-semibold uppercase tracking-[0.14em] text-ph-mutedtext", children: section.label }),
|
|
3257
|
+
section.workspaces.map((workspace) => /* @__PURE__ */ jsx19(
|
|
3187
3258
|
DropdownItem2,
|
|
3188
3259
|
{
|
|
3189
3260
|
id: `workspace-option-${workspace.id}`,
|
|
@@ -3198,10 +3269,10 @@ function SuiteWorkspaceSwitcher({
|
|
|
3198
3269
|
className: appSwitcherMenuItemClass(),
|
|
3199
3270
|
children: /* @__PURE__ */ jsxs15("span", { className: "flex min-w-0 w-full items-center gap-3", children: [
|
|
3200
3271
|
/* @__PURE__ */ jsxs15("span", { className: "min-w-0 flex-1", children: [
|
|
3201
|
-
/* @__PURE__ */
|
|
3202
|
-
workspace.description ? /* @__PURE__ */
|
|
3272
|
+
/* @__PURE__ */ jsx19("span", { className: "block truncate text-sm font-medium text-ph-ink", children: workspace.name }),
|
|
3273
|
+
workspace.description ? /* @__PURE__ */ jsx19("span", { className: "block truncate text-xs text-ph-mutedtext", children: workspace.description }) : null
|
|
3203
3274
|
] }),
|
|
3204
|
-
workspace.id === currentId ? /* @__PURE__ */
|
|
3275
|
+
workspace.id === currentId ? /* @__PURE__ */ jsx19(
|
|
3205
3276
|
Check2,
|
|
3206
3277
|
{
|
|
3207
3278
|
className: "h-4 w-4 shrink-0 text-ph-brand",
|
|
@@ -3213,7 +3284,7 @@ function SuiteWorkspaceSwitcher({
|
|
|
3213
3284
|
workspace.id
|
|
3214
3285
|
))
|
|
3215
3286
|
] }, section.id)),
|
|
3216
|
-
footer ? /* @__PURE__ */
|
|
3287
|
+
footer ? /* @__PURE__ */ jsx19("div", { className: "mt-1 border-t border-ph-border pt-1", children: footer }) : null
|
|
3217
3288
|
]
|
|
3218
3289
|
}
|
|
3219
3290
|
)
|
|
@@ -3222,7 +3293,7 @@ function SuiteWorkspaceSwitcher({
|
|
|
3222
3293
|
}
|
|
3223
3294
|
|
|
3224
3295
|
// src/suite/icons/suite-icon.tsx
|
|
3225
|
-
import { jsx as
|
|
3296
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3226
3297
|
var TODAY_SUN_STYLE = `
|
|
3227
3298
|
@media (prefers-reduced-motion: no-preference) {
|
|
3228
3299
|
.suite-icon-today-sun-rays {
|
|
@@ -3265,8 +3336,8 @@ function SuiteIcon({
|
|
|
3265
3336
|
"aria-label": label,
|
|
3266
3337
|
"aria-hidden": label ? void 0 : true,
|
|
3267
3338
|
children: [
|
|
3268
|
-
glyph.animatedAccent && animated ? /* @__PURE__ */
|
|
3269
|
-
/* @__PURE__ */
|
|
3339
|
+
glyph.animatedAccent && animated ? /* @__PURE__ */ jsx20("style", { children: TODAY_SUN_STYLE }) : null,
|
|
3340
|
+
/* @__PURE__ */ jsx20(
|
|
3270
3341
|
GlyphParts,
|
|
3271
3342
|
{
|
|
3272
3343
|
elements: glyph.elements,
|
|
@@ -3282,7 +3353,7 @@ function SuiteIcon({
|
|
|
3282
3353
|
import {
|
|
3283
3354
|
useCallback as useCallback4,
|
|
3284
3355
|
useLayoutEffect as useLayoutEffect2,
|
|
3285
|
-
useState as
|
|
3356
|
+
useState as useState11
|
|
3286
3357
|
} from "react";
|
|
3287
3358
|
var SIDEBAR_RAIL_WIDTH = 56;
|
|
3288
3359
|
var SIDEBAR_COLLAPSE_THRESHOLD = 80;
|
|
@@ -3368,8 +3439,8 @@ function resetSuiteSidebarWidth() {
|
|
|
3368
3439
|
}
|
|
3369
3440
|
function useSidebarWidth(storageKey = SUITE_SIDEBAR_WIDTH_KEY, defaultWidth = SIDEBAR_DEFAULT_WIDTH) {
|
|
3370
3441
|
const fallbackWidth = snapWidth(clampWidth(defaultWidth));
|
|
3371
|
-
const [width, setWidth] =
|
|
3372
|
-
const [narrowViewport, setNarrowViewport] =
|
|
3442
|
+
const [width, setWidth] = useState11(fallbackWidth);
|
|
3443
|
+
const [narrowViewport, setNarrowViewport] = useState11(false);
|
|
3373
3444
|
const collapsed = narrowViewport || width <= SIDEBAR_COLLAPSE_THRESHOLD;
|
|
3374
3445
|
useLayoutEffect2(() => {
|
|
3375
3446
|
const sync = () => {
|
|
@@ -3451,9 +3522,9 @@ function useSidebarWidth(storageKey = SUITE_SIDEBAR_WIDTH_KEY, defaultWidth = SI
|
|
|
3451
3522
|
|
|
3452
3523
|
// src/suite/lib/motion.tsx
|
|
3453
3524
|
import { LazyMotion, domAnimation, m } from "motion/react";
|
|
3454
|
-
import { jsx as
|
|
3525
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
3455
3526
|
function SuiteMotionProvider({ children }) {
|
|
3456
|
-
return /* @__PURE__ */
|
|
3527
|
+
return /* @__PURE__ */ jsx21(LazyMotion, { features: domAnimation, strict: true, children });
|
|
3457
3528
|
}
|
|
3458
3529
|
var SUITE_SPRINGS = {
|
|
3459
3530
|
/** Snappy panel/sheet entrances — small overshoot. */
|
|
@@ -3465,24 +3536,24 @@ var SUITE_SPRINGS = {
|
|
|
3465
3536
|
};
|
|
3466
3537
|
|
|
3467
3538
|
// src/suite/components/suite-skeleton.tsx
|
|
3468
|
-
import { jsx as
|
|
3539
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3469
3540
|
function SuiteSkeleton({
|
|
3470
3541
|
className,
|
|
3471
3542
|
lines = 1,
|
|
3472
3543
|
circle,
|
|
3473
3544
|
width
|
|
3474
3545
|
}) {
|
|
3475
|
-
return /* @__PURE__ */
|
|
3546
|
+
return /* @__PURE__ */ jsx22(
|
|
3476
3547
|
"div",
|
|
3477
3548
|
{
|
|
3478
3549
|
className: cn2("space-y-2", circle ? "flex flex-col items-center" : ""),
|
|
3479
3550
|
"aria-hidden": true,
|
|
3480
|
-
children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */
|
|
3551
|
+
children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx22(
|
|
3481
3552
|
"div",
|
|
3482
3553
|
{
|
|
3483
3554
|
className: "animate-[skeleton-stagger_0.6s_ease-out_both]",
|
|
3484
3555
|
style: { animationDelay: `${index * 80}ms` },
|
|
3485
|
-
children: /* @__PURE__ */
|
|
3556
|
+
children: /* @__PURE__ */ jsx22(
|
|
3486
3557
|
"div",
|
|
3487
3558
|
{
|
|
3488
3559
|
className: cn2(
|
|
@@ -3521,20 +3592,20 @@ function SuiteSkeletonCard({
|
|
|
3521
3592
|
className: "mb-5 flex items-center gap-3 animate-[skeleton-stagger_0.5s_ease-out_both]",
|
|
3522
3593
|
style: { animationDelay: "100ms" },
|
|
3523
3594
|
children: [
|
|
3524
|
-
/* @__PURE__ */
|
|
3595
|
+
/* @__PURE__ */ jsx22("div", { className: "ph-skeleton h-10 w-10 rounded-xl" }),
|
|
3525
3596
|
/* @__PURE__ */ jsxs17("div", { className: "flex-1 space-y-2", children: [
|
|
3526
|
-
/* @__PURE__ */
|
|
3527
|
-
/* @__PURE__ */
|
|
3597
|
+
/* @__PURE__ */ jsx22("div", { className: "ph-skeleton h-4 w-1/3" }),
|
|
3598
|
+
/* @__PURE__ */ jsx22("div", { className: "ph-skeleton h-3 w-1/2" })
|
|
3528
3599
|
] })
|
|
3529
3600
|
]
|
|
3530
3601
|
}
|
|
3531
3602
|
) : null,
|
|
3532
|
-
/* @__PURE__ */
|
|
3603
|
+
/* @__PURE__ */ jsx22("div", { className: "space-y-3", children: Array.from({ length: rows }).map((_, index) => /* @__PURE__ */ jsx22(
|
|
3533
3604
|
"div",
|
|
3534
3605
|
{
|
|
3535
3606
|
className: "animate-[skeleton-stagger_0.5s_ease-out_both]",
|
|
3536
3607
|
style: { animationDelay: `${200 + index * 80}ms` },
|
|
3537
|
-
children: /* @__PURE__ */
|
|
3608
|
+
children: /* @__PURE__ */ jsx22(
|
|
3538
3609
|
"div",
|
|
3539
3610
|
{
|
|
3540
3611
|
className: "ph-skeleton h-3",
|
|
@@ -3552,16 +3623,16 @@ function SuiteSkeletonList({
|
|
|
3552
3623
|
className,
|
|
3553
3624
|
items = 4
|
|
3554
3625
|
}) {
|
|
3555
|
-
return /* @__PURE__ */
|
|
3626
|
+
return /* @__PURE__ */ jsx22("div", { className: cn2("space-y-3", className), "aria-hidden": true, children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsx22(
|
|
3556
3627
|
"div",
|
|
3557
3628
|
{
|
|
3558
3629
|
className: "animate-[skeleton-stagger_0.6s_ease-out_both]",
|
|
3559
3630
|
style: { animationDelay: `${index * 100}ms` },
|
|
3560
3631
|
children: /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-3 rounded-xl border border-ph-border bg-ph-surface p-4", children: [
|
|
3561
|
-
/* @__PURE__ */
|
|
3632
|
+
/* @__PURE__ */ jsx22("div", { className: "ph-skeleton h-10 w-10 rounded-lg" }),
|
|
3562
3633
|
/* @__PURE__ */ jsxs17("div", { className: "min-w-0 flex-1 space-y-2", children: [
|
|
3563
|
-
/* @__PURE__ */
|
|
3564
|
-
/* @__PURE__ */
|
|
3634
|
+
/* @__PURE__ */ jsx22("div", { className: "ph-skeleton h-3.5 w-3/4" }),
|
|
3635
|
+
/* @__PURE__ */ jsx22("div", { className: "ph-skeleton h-3 w-1/2" })
|
|
3565
3636
|
] })
|
|
3566
3637
|
] })
|
|
3567
3638
|
},
|
|
@@ -3586,12 +3657,12 @@ function SuiteEmptyState({
|
|
|
3586
3657
|
),
|
|
3587
3658
|
children: [
|
|
3588
3659
|
/* @__PURE__ */ jsxs17("div", { className: "pointer-events-none absolute inset-0 overflow-hidden opacity-60", "aria-hidden": true, children: [
|
|
3589
|
-
/* @__PURE__ */
|
|
3590
|
-
/* @__PURE__ */
|
|
3660
|
+
/* @__PURE__ */ jsx22("div", { className: "absolute -left-10 -top-10 h-40 w-40 rounded-full bg-ph-brand/10 blur-3xl" }),
|
|
3661
|
+
/* @__PURE__ */ jsx22("div", { className: "absolute -bottom-10 -right-10 h-40 w-40 rounded-full bg-ph-accent/10 blur-3xl" })
|
|
3591
3662
|
] }),
|
|
3592
3663
|
/* @__PURE__ */ jsxs17("div", { className: "relative", children: [
|
|
3593
|
-
icon ? /* @__PURE__ */
|
|
3594
|
-
/* @__PURE__ */
|
|
3664
|
+
icon ? /* @__PURE__ */ jsx22("div", { className: "mx-auto mb-4 inline-flex items-center justify-center rounded-2xl bg-ph-muted p-3 shadow-sm ring-1 ring-black/[0.06]", children: icon }) : null,
|
|
3665
|
+
/* @__PURE__ */ jsx22(
|
|
3595
3666
|
"h2",
|
|
3596
3667
|
{
|
|
3597
3668
|
className: cn2(
|
|
@@ -3601,8 +3672,8 @@ function SuiteEmptyState({
|
|
|
3601
3672
|
children: title
|
|
3602
3673
|
}
|
|
3603
3674
|
),
|
|
3604
|
-
description ? /* @__PURE__ */
|
|
3605
|
-
action ? /* @__PURE__ */
|
|
3675
|
+
description ? /* @__PURE__ */ jsx22("p", { className: "mx-auto mt-2 max-w-sm text-sm leading-relaxed text-ph-subtle", children: description }) : null,
|
|
3676
|
+
action ? /* @__PURE__ */ jsx22("div", { className: "mt-5 flex flex-wrap items-center justify-center gap-2", children: action }) : null
|
|
3606
3677
|
] })
|
|
3607
3678
|
]
|
|
3608
3679
|
}
|
|
@@ -3611,7 +3682,7 @@ function SuiteEmptyState({
|
|
|
3611
3682
|
|
|
3612
3683
|
// src/suite/components/suite-settings-mobile-nav.tsx
|
|
3613
3684
|
import { isValidElement } from "react";
|
|
3614
|
-
import { jsx as
|
|
3685
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3615
3686
|
function SuiteSettingsMobileNav({
|
|
3616
3687
|
items,
|
|
3617
3688
|
activeHref,
|
|
@@ -3620,16 +3691,16 @@ function SuiteSettingsMobileNav({
|
|
|
3620
3691
|
ariaLabel = "Settings sections",
|
|
3621
3692
|
className
|
|
3622
3693
|
}) {
|
|
3623
|
-
return /* @__PURE__ */
|
|
3694
|
+
return /* @__PURE__ */ jsx23(
|
|
3624
3695
|
"nav",
|
|
3625
3696
|
{
|
|
3626
3697
|
"data-test": dataTest,
|
|
3627
3698
|
"aria-label": ariaLabel,
|
|
3628
3699
|
className: cn2("suite-settings-mobile-nav lg:hidden", className),
|
|
3629
|
-
children: /* @__PURE__ */
|
|
3700
|
+
children: /* @__PURE__ */ jsx23("div", { className: "flex snap-x gap-2 overflow-x-auto pb-3 pt-1 scrollbar-hide [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: items.map((item) => {
|
|
3630
3701
|
const Icon = item.icon;
|
|
3631
3702
|
const active = activeHref === item.href || activeHref.startsWith(`${item.href}/`);
|
|
3632
|
-
const iconNode = isValidElement(item.icon) ? item.icon : /* @__PURE__ */
|
|
3703
|
+
const iconNode = isValidElement(item.icon) ? item.icon : /* @__PURE__ */ jsx23(
|
|
3633
3704
|
Icon,
|
|
3634
3705
|
{
|
|
3635
3706
|
className: cn2(
|
|
@@ -3654,8 +3725,8 @@ function SuiteSettingsMobileNav({
|
|
|
3654
3725
|
),
|
|
3655
3726
|
children: [
|
|
3656
3727
|
iconNode,
|
|
3657
|
-
/* @__PURE__ */
|
|
3658
|
-
active ? /* @__PURE__ */
|
|
3728
|
+
/* @__PURE__ */ jsx23("span", { className: "whitespace-nowrap", children: item.label }),
|
|
3729
|
+
active ? /* @__PURE__ */ jsx23("span", { className: "absolute inset-x-0 -bottom-3 h-0.5 rounded-full bg-ph-ink lg:hidden" }) : null
|
|
3659
3730
|
]
|
|
3660
3731
|
},
|
|
3661
3732
|
item.href
|
|
@@ -3669,7 +3740,7 @@ function SuiteSettingsMobileNav({
|
|
|
3669
3740
|
import Link2 from "next/link";
|
|
3670
3741
|
import { useCallback as useCallback5, useEffect as useEffect8 } from "react";
|
|
3671
3742
|
import { NavArrowLeft, Sparks as Sparks2 } from "iconoir-react";
|
|
3672
|
-
import { Fragment as Fragment7, jsx as
|
|
3743
|
+
import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3673
3744
|
function renderNode(node, collapsed) {
|
|
3674
3745
|
if (typeof node === "function") return node(collapsed);
|
|
3675
3746
|
return node;
|
|
@@ -3724,7 +3795,7 @@ function SuiteSidebar({
|
|
|
3724
3795
|
if (collapsed) onRequestExpand == null ? void 0 : onRequestExpand();
|
|
3725
3796
|
setAskAi(true);
|
|
3726
3797
|
}
|
|
3727
|
-
const askAiButton = /* @__PURE__ */
|
|
3798
|
+
const askAiButton = /* @__PURE__ */ jsx24(
|
|
3728
3799
|
"button",
|
|
3729
3800
|
{
|
|
3730
3801
|
type: "button",
|
|
@@ -3736,7 +3807,7 @@ function SuiteSidebar({
|
|
|
3736
3807
|
"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ph-focus-ring",
|
|
3737
3808
|
askAiOpen ? "bg-ph-brand/10 text-ph-brand" : "text-ph-mutedtext hover:bg-ph-muted hover:text-ph-ink"
|
|
3738
3809
|
),
|
|
3739
|
-
children: /* @__PURE__ */
|
|
3810
|
+
children: /* @__PURE__ */ jsx24(Sparks2, { className: "h-4 w-4", "aria-hidden": true })
|
|
3740
3811
|
}
|
|
3741
3812
|
);
|
|
3742
3813
|
if (chatOpen) {
|
|
@@ -3758,7 +3829,7 @@ function SuiteSidebar({
|
|
|
3758
3829
|
surface ? "bg-ph-surface" : "bg-ph-canvas"
|
|
3759
3830
|
),
|
|
3760
3831
|
children: [
|
|
3761
|
-
/* @__PURE__ */
|
|
3832
|
+
/* @__PURE__ */ jsx24(
|
|
3762
3833
|
"button",
|
|
3763
3834
|
{
|
|
3764
3835
|
type: "button",
|
|
@@ -3766,14 +3837,14 @@ function SuiteSidebar({
|
|
|
3766
3837
|
"aria-label": "Back to navigation",
|
|
3767
3838
|
onClick: () => setAskAi(false),
|
|
3768
3839
|
className: "inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-ph-subtle transition-colors hover:bg-ph-muted hover:text-ph-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-brand",
|
|
3769
|
-
children: /* @__PURE__ */
|
|
3840
|
+
children: /* @__PURE__ */ jsx24(NavArrowLeft, { className: "h-4 w-4", "aria-hidden": true })
|
|
3770
3841
|
}
|
|
3771
3842
|
),
|
|
3772
|
-
/* @__PURE__ */
|
|
3843
|
+
/* @__PURE__ */ jsx24("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-ph-ink", children: "Shelly AI" })
|
|
3773
3844
|
]
|
|
3774
3845
|
}
|
|
3775
3846
|
),
|
|
3776
|
-
/* @__PURE__ */
|
|
3847
|
+
/* @__PURE__ */ jsx24("div", { className: "min-h-0 flex-1", children: askAi })
|
|
3777
3848
|
]
|
|
3778
3849
|
}
|
|
3779
3850
|
);
|
|
@@ -3796,8 +3867,8 @@ function SuiteSidebar({
|
|
|
3796
3867
|
collapsed ? "flex-col items-center gap-1 px-1 py-2" : "h-14 items-center justify-between gap-2 px-3"
|
|
3797
3868
|
),
|
|
3798
3869
|
children: [
|
|
3799
|
-
/* @__PURE__ */
|
|
3800
|
-
collapsed ? null : /* @__PURE__ */
|
|
3870
|
+
/* @__PURE__ */ jsx24("div", { className: cn2("min-w-0", collapsed ? "shrink-0" : "flex-1"), children: renderNode(appSwitcher, collapsed) }),
|
|
3871
|
+
collapsed ? null : /* @__PURE__ */ jsx24("div", { className: "shrink-0", children: renderNode(notificationBell, collapsed) })
|
|
3801
3872
|
]
|
|
3802
3873
|
}
|
|
3803
3874
|
) : null,
|
|
@@ -3811,7 +3882,7 @@ function SuiteSidebar({
|
|
|
3811
3882
|
collapsed ? "px-1.5 py-2" : "p-3"
|
|
3812
3883
|
),
|
|
3813
3884
|
children: [
|
|
3814
|
-
contextSwitcher ? /* @__PURE__ */
|
|
3885
|
+
contextSwitcher ? /* @__PURE__ */ jsx24(
|
|
3815
3886
|
"div",
|
|
3816
3887
|
{
|
|
3817
3888
|
className: cn2(
|
|
@@ -3831,16 +3902,16 @@ function SuiteSidebar({
|
|
|
3831
3902
|
onClick: () => setAskAi(false),
|
|
3832
3903
|
className: "inline-flex h-9 items-center gap-1 rounded-lg px-2 text-sm font-medium text-ph-subtle transition-colors hover:bg-ph-muted hover:text-ph-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-brand",
|
|
3833
3904
|
children: [
|
|
3834
|
-
/* @__PURE__ */
|
|
3905
|
+
/* @__PURE__ */ jsx24(NavArrowLeft, { className: "h-4 w-4", "aria-hidden": true }),
|
|
3835
3906
|
"Nav"
|
|
3836
3907
|
]
|
|
3837
3908
|
}
|
|
3838
3909
|
),
|
|
3839
|
-
/* @__PURE__ */
|
|
3910
|
+
/* @__PURE__ */ jsx24("span", { className: "truncate text-sm font-semibold text-ph-ink", children: "Shelly AI" })
|
|
3840
3911
|
] }),
|
|
3841
|
-
/* @__PURE__ */
|
|
3912
|
+
/* @__PURE__ */ jsx24("div", { className: "min-h-0 flex-1", children: askAi })
|
|
3842
3913
|
] }) : /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
3843
|
-
/* @__PURE__ */
|
|
3914
|
+
/* @__PURE__ */ jsx24("nav", { "aria-label": "Pages", className: "shrink-0 space-y-1", children: /* @__PURE__ */ jsx24("div", { className: "space-y-1", children: navItems.map((item) => {
|
|
3844
3915
|
var _a2;
|
|
3845
3916
|
const Icon = item.icon;
|
|
3846
3917
|
const active = Boolean(item.active);
|
|
@@ -3858,7 +3929,7 @@ function SuiteSidebar({
|
|
|
3858
3929
|
collapsed ? "mx-auto size-11 shrink-0 justify-center gap-0 px-0 py-0" : "w-full px-2.5 py-2"
|
|
3859
3930
|
),
|
|
3860
3931
|
children: [
|
|
3861
|
-
/* @__PURE__ */
|
|
3932
|
+
/* @__PURE__ */ jsx24(
|
|
3862
3933
|
"span",
|
|
3863
3934
|
{
|
|
3864
3935
|
className: cn2(
|
|
@@ -3866,7 +3937,7 @@ function SuiteSidebar({
|
|
|
3866
3937
|
item.iconClassName
|
|
3867
3938
|
),
|
|
3868
3939
|
"aria-hidden": true,
|
|
3869
|
-
children: /* @__PURE__ */
|
|
3940
|
+
children: /* @__PURE__ */ jsx24(
|
|
3870
3941
|
Icon,
|
|
3871
3942
|
{
|
|
3872
3943
|
className: "h-full w-full",
|
|
@@ -3875,7 +3946,7 @@ function SuiteSidebar({
|
|
|
3875
3946
|
)
|
|
3876
3947
|
}
|
|
3877
3948
|
),
|
|
3878
|
-
/* @__PURE__ */
|
|
3949
|
+
/* @__PURE__ */ jsx24(
|
|
3879
3950
|
"span",
|
|
3880
3951
|
{
|
|
3881
3952
|
className: cn2(
|
|
@@ -3886,14 +3957,14 @@ function SuiteSidebar({
|
|
|
3886
3957
|
children: item.label
|
|
3887
3958
|
}
|
|
3888
3959
|
),
|
|
3889
|
-
!collapsed && item.badge ? /* @__PURE__ */
|
|
3960
|
+
!collapsed && item.badge ? /* @__PURE__ */ jsx24("span", { className: "relative ml-auto shrink-0", children: item.badge }) : null
|
|
3890
3961
|
]
|
|
3891
3962
|
},
|
|
3892
3963
|
item.label
|
|
3893
3964
|
);
|
|
3894
|
-
return collapsed ? /* @__PURE__ */
|
|
3965
|
+
return collapsed ? /* @__PURE__ */ jsx24(Tooltip, { content: item.label, side: "right", children: link }, item.label) : link;
|
|
3895
3966
|
}) }) }),
|
|
3896
|
-
secondaryNav ? /* @__PURE__ */
|
|
3967
|
+
secondaryNav ? /* @__PURE__ */ jsx24(
|
|
3897
3968
|
"div",
|
|
3898
3969
|
{
|
|
3899
3970
|
className: "min-h-0 flex-1",
|
|
@@ -3905,7 +3976,7 @@ function SuiteSidebar({
|
|
|
3905
3976
|
]
|
|
3906
3977
|
}
|
|
3907
3978
|
),
|
|
3908
|
-
/* @__PURE__ */
|
|
3979
|
+
/* @__PURE__ */ jsx24(
|
|
3909
3980
|
"div",
|
|
3910
3981
|
{
|
|
3911
3982
|
className: cn2(
|
|
@@ -3922,8 +3993,8 @@ function SuiteSidebar({
|
|
|
3922
3993
|
),
|
|
3923
3994
|
children: [
|
|
3924
3995
|
renderNode(userMenu, collapsed),
|
|
3925
|
-
showAskAi ? /* @__PURE__ */
|
|
3926
|
-
showAskAi && footerExtras ? /* @__PURE__ */
|
|
3996
|
+
showAskAi ? /* @__PURE__ */ jsx24("div", { className: cn2("shrink-0", collapsed ? "mt-2" : "ml-auto"), children: /* @__PURE__ */ jsx24(Tooltip, { content: "Shelly AI", side: collapsed ? "right" : "top", children: askAiButton }) }) : footerExtras ? /* @__PURE__ */ jsx24("div", { className: cn2("shrink-0", collapsed ? "mt-2" : "ml-auto"), children: renderNode(footerExtras, collapsed) }) : null,
|
|
3997
|
+
showAskAi && footerExtras ? /* @__PURE__ */ jsx24("div", { className: cn2("shrink-0", collapsed && "mt-2"), children: renderNode(footerExtras, collapsed) }) : null
|
|
3927
3998
|
]
|
|
3928
3999
|
}
|
|
3929
4000
|
)
|
|
@@ -3935,7 +4006,7 @@ function SuiteSidebar({
|
|
|
3935
4006
|
}
|
|
3936
4007
|
|
|
3937
4008
|
// src/suite/components/suite-app-layout.tsx
|
|
3938
|
-
import { jsx as
|
|
4009
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3939
4010
|
function SuiteAppLayout({
|
|
3940
4011
|
sidebar,
|
|
3941
4012
|
children,
|
|
@@ -3966,8 +4037,8 @@ function SuiteAppLayout({
|
|
|
3966
4037
|
style: { width: `${sidebarWidth}px` },
|
|
3967
4038
|
"data-collapsed": collapsed ? "true" : "false",
|
|
3968
4039
|
children: [
|
|
3969
|
-
/* @__PURE__ */
|
|
3970
|
-
onStartResize ? /* @__PURE__ */
|
|
4040
|
+
/* @__PURE__ */ jsx25("div", { className: "relative z-0 h-full min-h-0 isolate", children: sidebar }),
|
|
4041
|
+
onStartResize ? /* @__PURE__ */ jsx25(
|
|
3971
4042
|
"div",
|
|
3972
4043
|
{
|
|
3973
4044
|
role: "separator",
|
|
@@ -4000,8 +4071,8 @@ function SuiteAppLayout({
|
|
|
4000
4071
|
}
|
|
4001
4072
|
),
|
|
4002
4073
|
/* @__PURE__ */ jsxs20("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
4003
|
-
mobileHeader ? /* @__PURE__ */
|
|
4004
|
-
/* @__PURE__ */
|
|
4074
|
+
mobileHeader ? /* @__PURE__ */ jsx25("div", { className: "shrink-0 lg:hidden", children: mobileHeader }) : null,
|
|
4075
|
+
/* @__PURE__ */ jsx25(
|
|
4005
4076
|
"main",
|
|
4006
4077
|
{
|
|
4007
4078
|
id: "main-content",
|
|
@@ -4015,7 +4086,7 @@ function SuiteAppLayout({
|
|
|
4015
4086
|
children
|
|
4016
4087
|
}
|
|
4017
4088
|
),
|
|
4018
|
-
bottomNav ? /* @__PURE__ */
|
|
4089
|
+
bottomNav ? /* @__PURE__ */ jsx25("div", { className: "shrink-0 lg:hidden", children: bottomNav }) : null
|
|
4019
4090
|
] })
|
|
4020
4091
|
]
|
|
4021
4092
|
}
|
|
@@ -4025,11 +4096,12 @@ function SuiteAppLayout({
|
|
|
4025
4096
|
// src/suite/components/suite-integration-picker.tsx
|
|
4026
4097
|
import {
|
|
4027
4098
|
useEffect as useEffect9,
|
|
4028
|
-
useMemo as
|
|
4099
|
+
useMemo as useMemo3,
|
|
4029
4100
|
useRef as useRef4,
|
|
4030
|
-
useState as
|
|
4101
|
+
useState as useState12
|
|
4031
4102
|
} from "react";
|
|
4032
4103
|
import {
|
|
4104
|
+
Bridge3d,
|
|
4033
4105
|
EvPlug as Plug,
|
|
4034
4106
|
Filter,
|
|
4035
4107
|
NavArrowDown as NavArrowDown2,
|
|
@@ -4037,7 +4109,7 @@ import {
|
|
|
4037
4109
|
Search,
|
|
4038
4110
|
Xmark
|
|
4039
4111
|
} from "iconoir-react";
|
|
4040
|
-
import { Fragment as Fragment8, jsx as
|
|
4112
|
+
import { Fragment as Fragment8, jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4041
4113
|
var DESCRIPTION_LIMIT = 90;
|
|
4042
4114
|
function IntegrationSkeletonCard() {
|
|
4043
4115
|
return /* @__PURE__ */ jsxs21(
|
|
@@ -4047,14 +4119,14 @@ function IntegrationSkeletonCard() {
|
|
|
4047
4119
|
"aria-hidden": "true",
|
|
4048
4120
|
children: [
|
|
4049
4121
|
/* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-3", children: [
|
|
4050
|
-
/* @__PURE__ */
|
|
4122
|
+
/* @__PURE__ */ jsx26("div", { className: "h-8 w-8 shrink-0 rounded-md bg-ph-muted" }),
|
|
4051
4123
|
/* @__PURE__ */ jsxs21("div", { className: "min-w-0 flex-1 space-y-2 pt-1", children: [
|
|
4052
|
-
/* @__PURE__ */
|
|
4053
|
-
/* @__PURE__ */
|
|
4054
|
-
/* @__PURE__ */
|
|
4124
|
+
/* @__PURE__ */ jsx26("div", { className: "h-4 w-3/5 rounded bg-ph-muted" }),
|
|
4125
|
+
/* @__PURE__ */ jsx26("div", { className: "h-3 w-full rounded bg-ph-muted" }),
|
|
4126
|
+
/* @__PURE__ */ jsx26("div", { className: "h-3 w-4/5 rounded bg-ph-muted" })
|
|
4055
4127
|
] })
|
|
4056
4128
|
] }),
|
|
4057
|
-
/* @__PURE__ */
|
|
4129
|
+
/* @__PURE__ */ jsx26("div", { className: "mt-3 h-9 w-20 rounded bg-ph-muted" })
|
|
4058
4130
|
]
|
|
4059
4131
|
}
|
|
4060
4132
|
);
|
|
@@ -4079,33 +4151,18 @@ function authSchemesFor(item) {
|
|
|
4079
4151
|
)
|
|
4080
4152
|
);
|
|
4081
4153
|
}
|
|
4082
|
-
var
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
chat: ["tides", "kraken"],
|
|
4087
|
-
documents: ["kraken"],
|
|
4088
|
-
notes: ["kraken"],
|
|
4089
|
-
knowledge: ["kraken"],
|
|
4090
|
-
file_storage: ["kraken"],
|
|
4091
|
-
crm: ["shellstack", "tides"],
|
|
4092
|
-
finance: ["shellstack", "tides"],
|
|
4093
|
-
payment: ["shellstack", "tides"],
|
|
4094
|
-
monitoring: ["tides", "kraken"],
|
|
4095
|
-
design: ["tides", "kraken"],
|
|
4096
|
-
support: ["tides", "shellstack"],
|
|
4097
|
-
ticketing: ["tides", "kraken"]
|
|
4154
|
+
var BRIDGE_MARK = {
|
|
4155
|
+
turtletime: { src: "/turtletime-icon.svg", name: "TurtleTime" },
|
|
4156
|
+
tides: { src: "/tides-icon.svg", name: "Tides" },
|
|
4157
|
+
kraken: { src: "/kraken-icon.svg", name: "Kraken" }
|
|
4098
4158
|
};
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
const apps = /* @__PURE__ */ new Set();
|
|
4103
|
-
for (const category of categories != null ? categories : []) {
|
|
4104
|
-
for (const app of (_a2 = CATEGORY_APP_AFFINITY[category.trim().toLowerCase()]) != null ? _a2 : []) {
|
|
4105
|
-
apps.add(app);
|
|
4106
|
-
}
|
|
4159
|
+
function suiteAppsForIntegration(itemOrCategories) {
|
|
4160
|
+
if (!itemOrCategories || Array.isArray(itemOrCategories) || !("bridgeTargets" in itemOrCategories)) {
|
|
4161
|
+
return [];
|
|
4107
4162
|
}
|
|
4108
|
-
|
|
4163
|
+
const explicit = itemOrCategories.bridgeTargets;
|
|
4164
|
+
if (!Array.isArray(explicit)) return [];
|
|
4165
|
+
return explicit.filter((app) => app in BRIDGE_MARK);
|
|
4109
4166
|
}
|
|
4110
4167
|
function SuiteIntegrationPicker({
|
|
4111
4168
|
open,
|
|
@@ -4121,6 +4178,8 @@ function SuiteIntegrationPicker({
|
|
|
4121
4178
|
category: controlledCategory,
|
|
4122
4179
|
categories: controlledCategories,
|
|
4123
4180
|
onCategoryChange,
|
|
4181
|
+
bridgeOnly: controlledBridgeOnly,
|
|
4182
|
+
onBridgeOnlyChange,
|
|
4124
4183
|
onClose,
|
|
4125
4184
|
onConnect,
|
|
4126
4185
|
onFetchAuthFields,
|
|
@@ -4129,11 +4188,12 @@ function SuiteIntegrationPicker({
|
|
|
4129
4188
|
description = "Connect an app to this workspace securely.",
|
|
4130
4189
|
dataTest = "suite-integration-picker"
|
|
4131
4190
|
}) {
|
|
4132
|
-
const [query, setQuery] =
|
|
4133
|
-
const [category, setCategory] =
|
|
4134
|
-
const [categoryQuery, setCategoryQuery] =
|
|
4135
|
-
const [categoryMenuOpen, setCategoryMenuOpen] =
|
|
4136
|
-
const [expanded, setExpanded] =
|
|
4191
|
+
const [query, setQuery] = useState12("");
|
|
4192
|
+
const [category, setCategory] = useState12("all");
|
|
4193
|
+
const [categoryQuery, setCategoryQuery] = useState12("");
|
|
4194
|
+
const [categoryMenuOpen, setCategoryMenuOpen] = useState12(false);
|
|
4195
|
+
const [expanded, setExpanded] = useState12(null);
|
|
4196
|
+
const [bridgeOnlyInternal, setBridgeOnlyInternal] = useState12(false);
|
|
4137
4197
|
const categoryMenuRef = useRef4(null);
|
|
4138
4198
|
const categoryTriggerRef = useRef4(null);
|
|
4139
4199
|
const categorySearchRef = useRef4(null);
|
|
@@ -4144,18 +4204,19 @@ function SuiteIntegrationPicker({
|
|
|
4144
4204
|
const scrollViewportRef = useRef4(null);
|
|
4145
4205
|
const loadMoreSentinelRef = useRef4(null);
|
|
4146
4206
|
const loadMoreInFlightRef = useRef4(false);
|
|
4207
|
+
const sentinelVisibleRef = useRef4(false);
|
|
4147
4208
|
const authRequestRef = useRef4(0);
|
|
4148
|
-
const [methodItem, setMethodItem] =
|
|
4149
|
-
const [authItem, setAuthItem] =
|
|
4150
|
-
const [authValues, setAuthValues] =
|
|
4151
|
-
const [authLoading, setAuthLoading] =
|
|
4152
|
-
const [authSubmitting, setAuthSubmitting] =
|
|
4153
|
-
const [authError, setAuthError] =
|
|
4154
|
-
const [connectionError, setConnectionError] =
|
|
4155
|
-
const [itemToDisconnect, setItemToDisconnect] =
|
|
4156
|
-
const [disconnecting, setDisconnecting] =
|
|
4157
|
-
const [disconnectError, setDisconnectError] =
|
|
4158
|
-
const itemCategories =
|
|
4209
|
+
const [methodItem, setMethodItem] = useState12(null);
|
|
4210
|
+
const [authItem, setAuthItem] = useState12(null);
|
|
4211
|
+
const [authValues, setAuthValues] = useState12({});
|
|
4212
|
+
const [authLoading, setAuthLoading] = useState12(false);
|
|
4213
|
+
const [authSubmitting, setAuthSubmitting] = useState12(false);
|
|
4214
|
+
const [authError, setAuthError] = useState12(null);
|
|
4215
|
+
const [connectionError, setConnectionError] = useState12(null);
|
|
4216
|
+
const [itemToDisconnect, setItemToDisconnect] = useState12(null);
|
|
4217
|
+
const [disconnecting, setDisconnecting] = useState12(false);
|
|
4218
|
+
const [disconnectError, setDisconnectError] = useState12(null);
|
|
4219
|
+
const itemCategories = useMemo3(
|
|
4159
4220
|
() => Array.from(
|
|
4160
4221
|
new Set(items.flatMap((item) => {
|
|
4161
4222
|
var _a2;
|
|
@@ -4167,11 +4228,20 @@ function SuiteIntegrationPicker({
|
|
|
4167
4228
|
const categories = controlledCategories != null ? controlledCategories : itemCategories;
|
|
4168
4229
|
const activeSearch = controlledSearch != null ? controlledSearch : query;
|
|
4169
4230
|
const activeCategory = controlledCategory != null ? controlledCategory : category;
|
|
4231
|
+
const bridgeOnly = controlledBridgeOnly != null ? controlledBridgeOnly : bridgeOnlyInternal;
|
|
4232
|
+
const setBridgeOnly = (value) => {
|
|
4233
|
+
setBridgeOnlyInternal(value);
|
|
4234
|
+
onBridgeOnlyChange == null ? void 0 : onBridgeOnlyChange(value);
|
|
4235
|
+
};
|
|
4170
4236
|
const categoryLabel = (value) => value.replace(/[-_]/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
|
|
4171
|
-
const
|
|
4237
|
+
const catalogItems = onSearchChange || onCategoryChange ? items : items.filter((item) => {
|
|
4172
4238
|
var _a2;
|
|
4173
4239
|
return item.label.toLowerCase().includes(activeSearch.trim().toLowerCase()) && (activeCategory === "all" || ((_a2 = item.categories) != null ? _a2 : []).includes(activeCategory));
|
|
4174
4240
|
});
|
|
4241
|
+
const filtered = bridgeOnly && controlledBridgeOnly === void 0 ? catalogItems.filter((item) => {
|
|
4242
|
+
var _a2;
|
|
4243
|
+
return ((_a2 = item.bridgeTargets) != null ? _a2 : []).length > 0;
|
|
4244
|
+
}) : catalogItems;
|
|
4175
4245
|
const visibleCategories = categories.filter(
|
|
4176
4246
|
(value) => categoryLabel(value).toLowerCase().includes(categoryQuery.trim().toLowerCase())
|
|
4177
4247
|
);
|
|
@@ -4369,23 +4439,31 @@ function SuiteIntegrationPicker({
|
|
|
4369
4439
|
useEffect9(() => {
|
|
4370
4440
|
const root = scrollViewportRef.current;
|
|
4371
4441
|
const sentinel = loadMoreSentinelRef.current;
|
|
4372
|
-
if (!open || !root || !sentinel
|
|
4442
|
+
if (!open || !root || !sentinel) {
|
|
4443
|
+
sentinelVisibleRef.current = false;
|
|
4373
4444
|
return;
|
|
4374
4445
|
}
|
|
4375
4446
|
const observer = new IntersectionObserver(
|
|
4376
4447
|
([entry]) => {
|
|
4377
|
-
if (!entry.isIntersecting
|
|
4448
|
+
if (!entry.isIntersecting) {
|
|
4449
|
+
sentinelVisibleRef.current = false;
|
|
4450
|
+
return;
|
|
4451
|
+
}
|
|
4452
|
+
if (sentinelVisibleRef.current) return;
|
|
4453
|
+
sentinelVisibleRef.current = true;
|
|
4454
|
+
if (loadMoreInFlightRef.current || !hasMore || !onEndReached || loading || catalogLoading || loadingMore) {
|
|
4455
|
+
return;
|
|
4456
|
+
}
|
|
4378
4457
|
loadMoreInFlightRef.current = true;
|
|
4379
|
-
observer.unobserve(entry.target);
|
|
4380
4458
|
onEndReached();
|
|
4381
4459
|
},
|
|
4382
|
-
{ root, rootMargin: "0px 0px
|
|
4460
|
+
{ root, rootMargin: "0px 0px 120px", threshold: 0 }
|
|
4383
4461
|
);
|
|
4384
4462
|
observer.observe(sentinel);
|
|
4385
4463
|
return () => observer.disconnect();
|
|
4386
4464
|
}, [catalogLoading, hasMore, loading, loadingMore, onEndReached, open]);
|
|
4387
4465
|
return /* @__PURE__ */ jsxs21(Fragment8, { children: [
|
|
4388
|
-
/* @__PURE__ */
|
|
4466
|
+
/* @__PURE__ */ jsx26(
|
|
4389
4467
|
Modal,
|
|
4390
4468
|
{
|
|
4391
4469
|
open,
|
|
@@ -4396,17 +4474,45 @@ function SuiteIntegrationPicker({
|
|
|
4396
4474
|
dataTest,
|
|
4397
4475
|
bodyClassName: "!overflow-hidden",
|
|
4398
4476
|
children: /* @__PURE__ */ jsxs21("div", { className: "space-y-4", children: [
|
|
4399
|
-
connectionError ? /* @__PURE__ */
|
|
4477
|
+
connectionError ? /* @__PURE__ */ jsx26("p", { className: "text-sm text-ph-danger", role: "alert", children: connectionError }) : null,
|
|
4478
|
+
/* @__PURE__ */ jsxs21(
|
|
4479
|
+
"label",
|
|
4480
|
+
{
|
|
4481
|
+
className: "inline-flex w-fit cursor-pointer items-center gap-2 text-sm text-ph-ink",
|
|
4482
|
+
"data-test": `${dataTest}-bridge-only`,
|
|
4483
|
+
children: [
|
|
4484
|
+
/* @__PURE__ */ jsx26(
|
|
4485
|
+
"input",
|
|
4486
|
+
{
|
|
4487
|
+
type: "checkbox",
|
|
4488
|
+
role: "switch",
|
|
4489
|
+
className: "ph-toggle",
|
|
4490
|
+
checked: bridgeOnly,
|
|
4491
|
+
onChange: (event) => setBridgeOnly(event.target.checked),
|
|
4492
|
+
"aria-label": "Shelly Bridge only"
|
|
4493
|
+
}
|
|
4494
|
+
),
|
|
4495
|
+
/* @__PURE__ */ jsx26(
|
|
4496
|
+
Bridge3d,
|
|
4497
|
+
{
|
|
4498
|
+
className: "h-4 w-4 shrink-0 text-ph-subtle",
|
|
4499
|
+
"aria-hidden": true
|
|
4500
|
+
}
|
|
4501
|
+
),
|
|
4502
|
+
/* @__PURE__ */ jsx26("span", { children: "Shelly Bridge only" })
|
|
4503
|
+
]
|
|
4504
|
+
}
|
|
4505
|
+
),
|
|
4400
4506
|
/* @__PURE__ */ jsxs21("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
4401
4507
|
/* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
4402
|
-
/* @__PURE__ */
|
|
4508
|
+
/* @__PURE__ */ jsx26(
|
|
4403
4509
|
Search,
|
|
4404
4510
|
{
|
|
4405
4511
|
className: "pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-ph-subtle",
|
|
4406
4512
|
"aria-hidden": true
|
|
4407
4513
|
}
|
|
4408
4514
|
),
|
|
4409
|
-
/* @__PURE__ */
|
|
4515
|
+
/* @__PURE__ */ jsx26(
|
|
4410
4516
|
Input,
|
|
4411
4517
|
{
|
|
4412
4518
|
value: activeSearch,
|
|
@@ -4439,16 +4545,16 @@ function SuiteIntegrationPicker({
|
|
|
4439
4545
|
onKeyDown: handleCategoryTriggerKeyDown,
|
|
4440
4546
|
children: [
|
|
4441
4547
|
/* @__PURE__ */ jsxs21("span", { className: "flex items-center gap-2", children: [
|
|
4442
|
-
/* @__PURE__ */
|
|
4548
|
+
/* @__PURE__ */ jsx26(
|
|
4443
4549
|
Filter,
|
|
4444
4550
|
{
|
|
4445
4551
|
className: "h-4 w-4 shrink-0 text-ph-subtle",
|
|
4446
4552
|
"aria-hidden": true
|
|
4447
4553
|
}
|
|
4448
4554
|
),
|
|
4449
|
-
/* @__PURE__ */
|
|
4555
|
+
/* @__PURE__ */ jsx26("span", { children: activeCategory === "all" ? "All apps" : categoryLabel(activeCategory) })
|
|
4450
4556
|
] }),
|
|
4451
|
-
/* @__PURE__ */
|
|
4557
|
+
/* @__PURE__ */ jsx26(
|
|
4452
4558
|
NavArrowDown2,
|
|
4453
4559
|
{
|
|
4454
4560
|
className: `h-4 w-4 transition-transform ${categoryMenuOpen ? "rotate-180" : ""}`,
|
|
@@ -4463,7 +4569,7 @@ function SuiteIntegrationPicker({
|
|
|
4463
4569
|
{
|
|
4464
4570
|
className: "absolute z-20 mt-2 max-h-[min(22rem,calc(100dvh-12rem))] w-full max-w-full overflow-hidden rounded-lg border border-ph-border bg-ph-surface p-2 shadow-lg",
|
|
4465
4571
|
children: [
|
|
4466
|
-
/* @__PURE__ */
|
|
4572
|
+
/* @__PURE__ */ jsx26(
|
|
4467
4573
|
Input,
|
|
4468
4574
|
{
|
|
4469
4575
|
ref: categorySearchRef,
|
|
@@ -4483,7 +4589,7 @@ function SuiteIntegrationPicker({
|
|
|
4483
4589
|
}
|
|
4484
4590
|
}
|
|
4485
4591
|
),
|
|
4486
|
-
/* @__PURE__ */
|
|
4592
|
+
/* @__PURE__ */ jsx26(
|
|
4487
4593
|
"div",
|
|
4488
4594
|
{
|
|
4489
4595
|
id: `${dataTest}-category-options`,
|
|
@@ -4491,7 +4597,7 @@ function SuiteIntegrationPicker({
|
|
|
4491
4597
|
"aria-label": "Integration categories",
|
|
4492
4598
|
className: "mt-2 max-h-52 overflow-y-auto",
|
|
4493
4599
|
"data-test": "integration-category-options",
|
|
4494
|
-
children: categoryValues.map((value) => /* @__PURE__ */
|
|
4600
|
+
children: categoryValues.map((value) => /* @__PURE__ */ jsx26(
|
|
4495
4601
|
"button",
|
|
4496
4602
|
{
|
|
4497
4603
|
type: "button",
|
|
@@ -4529,25 +4635,27 @@ function SuiteIntegrationPicker({
|
|
|
4529
4635
|
ref: scrollViewportRef,
|
|
4530
4636
|
className: "min-h-0 max-h-[min(60vh,32rem)] w-full overflow-y-auto pr-1",
|
|
4531
4637
|
children: [
|
|
4532
|
-
loading || catalogLoading ? /* @__PURE__ */
|
|
4638
|
+
loading || catalogLoading ? /* @__PURE__ */ jsx26(
|
|
4533
4639
|
"div",
|
|
4534
4640
|
{
|
|
4535
4641
|
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
4536
4642
|
"aria-label": "Loading apps",
|
|
4537
|
-
children: Array.from({ length: SKELETON_COUNT }, (_, index) => /* @__PURE__ */
|
|
4643
|
+
children: Array.from({ length: SKELETON_COUNT }, (_, index) => /* @__PURE__ */ jsx26(IntegrationSkeletonCard, {}, index))
|
|
4538
4644
|
}
|
|
4539
4645
|
) : /* @__PURE__ */ jsxs21("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: [
|
|
4540
4646
|
filtered.map((item) => {
|
|
4541
4647
|
var _a2, _b;
|
|
4542
4648
|
const isExpanded = expanded === item.id;
|
|
4543
4649
|
const longDescription = item.description.length > DESCRIPTION_LIMIT;
|
|
4650
|
+
const bridgeApps = suiteAppsForIntegration(item);
|
|
4651
|
+
const schemes = authSchemesFor(item);
|
|
4544
4652
|
const text = isExpanded || !longDescription ? item.description : `${item.description.slice(0, DESCRIPTION_LIMIT).trimEnd()}...`;
|
|
4545
4653
|
return /* @__PURE__ */ jsxs21(
|
|
4546
4654
|
"div",
|
|
4547
4655
|
{
|
|
4548
4656
|
className: "flex min-h-36 min-w-0 flex-col justify-between rounded-xl border border-ph-border bg-ph-surface p-4",
|
|
4549
4657
|
children: [
|
|
4550
|
-
/* @__PURE__ */
|
|
4658
|
+
/* @__PURE__ */ jsx26(
|
|
4551
4659
|
"button",
|
|
4552
4660
|
{
|
|
4553
4661
|
type: "button",
|
|
@@ -4555,50 +4663,47 @@ function SuiteIntegrationPicker({
|
|
|
4555
4663
|
onClick: () => longDescription && setExpanded(isExpanded ? null : item.id),
|
|
4556
4664
|
"aria-expanded": isExpanded,
|
|
4557
4665
|
children: /* @__PURE__ */ jsxs21("span", { className: "flex items-start gap-3", children: [
|
|
4558
|
-
/* @__PURE__ */
|
|
4666
|
+
/* @__PURE__ */ jsx26("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-ph-muted text-ph-ink", children: (_a2 = item.icon) != null ? _a2 : /* @__PURE__ */ jsx26(Plug, { className: "h-4 w-4", "aria-hidden": true }) }),
|
|
4559
4667
|
/* @__PURE__ */ jsxs21("span", { className: "min-w-0", children: [
|
|
4560
|
-
/* @__PURE__ */
|
|
4561
|
-
/* @__PURE__ */
|
|
4668
|
+
/* @__PURE__ */ jsx26("span", { className: "block truncate font-medium text-ph-ink", children: item.label }),
|
|
4669
|
+
/* @__PURE__ */ jsx26("span", { className: "mt-1 block text-xs text-ph-subtle", children: text }),
|
|
4562
4670
|
longDescription ? /* @__PURE__ */ jsxs21("span", { className: "mt-1 block text-xs font-medium text-ph-brand", children: [
|
|
4563
4671
|
isExpanded ? "See less" : "See more",
|
|
4564
4672
|
" ",
|
|
4565
|
-
isExpanded ? /* @__PURE__ */
|
|
4673
|
+
isExpanded ? /* @__PURE__ */ jsx26(NavArrowUp, { className: "inline h-3 w-3" }) : /* @__PURE__ */ jsx26(NavArrowDown2, { className: "inline h-3 w-3" })
|
|
4566
4674
|
] }) : null
|
|
4567
4675
|
] })
|
|
4568
4676
|
] })
|
|
4569
4677
|
}
|
|
4570
4678
|
),
|
|
4571
|
-
|
|
4679
|
+
bridgeApps.length > 0 ? /* @__PURE__ */ jsx26(
|
|
4572
4680
|
"div",
|
|
4573
4681
|
{
|
|
4574
4682
|
className: "mt-3 flex flex-wrap items-center gap-1.5",
|
|
4575
|
-
"aria-label": "
|
|
4576
|
-
children:
|
|
4577
|
-
|
|
4578
|
-
|
|
4683
|
+
"aria-label": "Bridges into ShellStack apps",
|
|
4684
|
+
children: bridgeApps.map((app) => {
|
|
4685
|
+
const mark = BRIDGE_MARK[app];
|
|
4686
|
+
if (!mark) return null;
|
|
4687
|
+
return /* @__PURE__ */ jsx26(
|
|
4688
|
+
"img",
|
|
4579
4689
|
{
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
size: 16,
|
|
4586
|
-
label: `Works with ${SUITE_APP_MAP[app].name}`,
|
|
4587
|
-
className: "rounded-[4px]"
|
|
4588
|
-
}
|
|
4589
|
-
)
|
|
4690
|
+
src: mark.src,
|
|
4691
|
+
alt: "",
|
|
4692
|
+
title: `Bridge in ${mark.name}`,
|
|
4693
|
+
className: "h-5 w-5",
|
|
4694
|
+
"data-test": `${dataTest}-${item.id}-app-${app}`
|
|
4590
4695
|
},
|
|
4591
4696
|
app
|
|
4592
|
-
)
|
|
4593
|
-
)
|
|
4697
|
+
);
|
|
4698
|
+
})
|
|
4594
4699
|
}
|
|
4595
4700
|
) : null,
|
|
4596
|
-
|
|
4701
|
+
schemes.length > 0 ? /* @__PURE__ */ jsx26(
|
|
4597
4702
|
"div",
|
|
4598
4703
|
{
|
|
4599
4704
|
className: "mt-3 flex flex-wrap gap-1.5",
|
|
4600
4705
|
"aria-label": "Connection methods",
|
|
4601
|
-
children:
|
|
4706
|
+
children: schemes.map((scheme) => /* @__PURE__ */ jsx26(
|
|
4602
4707
|
"span",
|
|
4603
4708
|
{
|
|
4604
4709
|
className: "rounded-full border border-ph-border bg-ph-muted px-2 py-1 text-[0.6875rem] font-medium text-ph-subtle",
|
|
@@ -4609,7 +4714,7 @@ function SuiteIntegrationPicker({
|
|
|
4609
4714
|
))
|
|
4610
4715
|
}
|
|
4611
4716
|
) : null,
|
|
4612
|
-
/* @__PURE__ */
|
|
4717
|
+
/* @__PURE__ */ jsx26(
|
|
4613
4718
|
Button,
|
|
4614
4719
|
{
|
|
4615
4720
|
type: "button",
|
|
@@ -4618,7 +4723,7 @@ function SuiteIntegrationPicker({
|
|
|
4618
4723
|
disabled: Boolean(item.unavailableReason) || item.connecting,
|
|
4619
4724
|
onClick: () => connectItem(item),
|
|
4620
4725
|
children: /* @__PURE__ */ jsxs21("span", { className: "flex items-center gap-1.5", children: [
|
|
4621
|
-
/* @__PURE__ */
|
|
4726
|
+
/* @__PURE__ */ jsx26(Plug, { className: "h-3.5 w-3.5", "aria-hidden": true }),
|
|
4622
4727
|
item.connecting ? "Connecting..." : (_b = item.unavailableReason) != null ? _b : "Connect"
|
|
4623
4728
|
] })
|
|
4624
4729
|
}
|
|
@@ -4628,14 +4733,14 @@ function SuiteIntegrationPicker({
|
|
|
4628
4733
|
item.id
|
|
4629
4734
|
);
|
|
4630
4735
|
}),
|
|
4631
|
-
loadingMore ? Array.from({ length: 3 }, (_, index) => /* @__PURE__ */
|
|
4736
|
+
loadingMore ? Array.from({ length: 3 }, (_, index) => /* @__PURE__ */ jsx26(IntegrationSkeletonCard, {}, `loading-${index}`)) : null
|
|
4632
4737
|
] }),
|
|
4633
|
-
/* @__PURE__ */
|
|
4738
|
+
/* @__PURE__ */ jsx26("div", { ref: loadMoreSentinelRef, className: "h-1", "aria-hidden": "true" })
|
|
4634
4739
|
]
|
|
4635
4740
|
}
|
|
4636
4741
|
),
|
|
4637
4742
|
connectedItems.length > 0 && onDisconnect ? /* @__PURE__ */ jsxs21("div", { className: "space-y-2 border-t border-ph-border pt-4", children: [
|
|
4638
|
-
/* @__PURE__ */
|
|
4743
|
+
/* @__PURE__ */ jsx26("h3", { className: "font-medium text-ph-ink", children: "Connected apps" }),
|
|
4639
4744
|
connectedItems.map((item) => /* @__PURE__ */ jsxs21(
|
|
4640
4745
|
"div",
|
|
4641
4746
|
{
|
|
@@ -4643,16 +4748,16 @@ function SuiteIntegrationPicker({
|
|
|
4643
4748
|
children: [
|
|
4644
4749
|
/* @__PURE__ */ jsxs21("span", { className: "flex min-w-0 items-center gap-2 text-sm text-ph-ink", children: [
|
|
4645
4750
|
item.icon,
|
|
4646
|
-
/* @__PURE__ */
|
|
4751
|
+
/* @__PURE__ */ jsx26("span", { className: "truncate", children: item.label })
|
|
4647
4752
|
] }),
|
|
4648
|
-
/* @__PURE__ */
|
|
4753
|
+
/* @__PURE__ */ jsx26(
|
|
4649
4754
|
Button,
|
|
4650
4755
|
{
|
|
4651
4756
|
type: "button",
|
|
4652
4757
|
variant: "danger",
|
|
4653
4758
|
onClick: () => requestDisconnect(item),
|
|
4654
4759
|
children: /* @__PURE__ */ jsxs21("span", { className: "flex items-center gap-1.5", children: [
|
|
4655
|
-
/* @__PURE__ */
|
|
4760
|
+
/* @__PURE__ */ jsx26(Xmark, { className: "h-4 w-4", "aria-hidden": true }),
|
|
4656
4761
|
"Disconnect"
|
|
4657
4762
|
] })
|
|
4658
4763
|
}
|
|
@@ -4678,7 +4783,7 @@ function SuiteIntegrationPicker({
|
|
|
4678
4783
|
zIndex: 220,
|
|
4679
4784
|
dataTest: `${dataTest}-disconnect-confirmation`,
|
|
4680
4785
|
footer: /* @__PURE__ */ jsxs21("div", { className: "flex justify-end gap-2", children: [
|
|
4681
|
-
/* @__PURE__ */
|
|
4786
|
+
/* @__PURE__ */ jsx26(
|
|
4682
4787
|
Button,
|
|
4683
4788
|
{
|
|
4684
4789
|
type: "button",
|
|
@@ -4688,7 +4793,7 @@ function SuiteIntegrationPicker({
|
|
|
4688
4793
|
children: "Cancel"
|
|
4689
4794
|
}
|
|
4690
4795
|
),
|
|
4691
|
-
/* @__PURE__ */
|
|
4796
|
+
/* @__PURE__ */ jsx26(
|
|
4692
4797
|
Button,
|
|
4693
4798
|
{
|
|
4694
4799
|
type: "button",
|
|
@@ -4701,7 +4806,7 @@ function SuiteIntegrationPicker({
|
|
|
4701
4806
|
)
|
|
4702
4807
|
] }),
|
|
4703
4808
|
children: [
|
|
4704
|
-
disconnectError ? /* @__PURE__ */
|
|
4809
|
+
disconnectError ? /* @__PURE__ */ jsx26("p", { className: "text-sm text-ph-danger", role: "alert", children: disconnectError }) : null,
|
|
4705
4810
|
/* @__PURE__ */ jsxs21("p", { className: "text-sm text-ph-ink", children: [
|
|
4706
4811
|
"Disconnect ",
|
|
4707
4812
|
itemToDisconnect == null ? void 0 : itemToDisconnect.label,
|
|
@@ -4710,7 +4815,7 @@ function SuiteIntegrationPicker({
|
|
|
4710
4815
|
]
|
|
4711
4816
|
}
|
|
4712
4817
|
),
|
|
4713
|
-
/* @__PURE__ */
|
|
4818
|
+
/* @__PURE__ */ jsx26(
|
|
4714
4819
|
Modal,
|
|
4715
4820
|
{
|
|
4716
4821
|
open: Boolean(methodItem),
|
|
@@ -4720,7 +4825,7 @@ function SuiteIntegrationPicker({
|
|
|
4720
4825
|
size: "sm",
|
|
4721
4826
|
zIndex: 200,
|
|
4722
4827
|
dataTest: `${dataTest}-auth-method`,
|
|
4723
|
-
children: methodItem ? /* @__PURE__ */
|
|
4828
|
+
children: methodItem ? /* @__PURE__ */ jsx26("div", { className: "space-y-2", children: authSchemesFor(methodItem).map((scheme) => /* @__PURE__ */ jsxs21(
|
|
4724
4829
|
"button",
|
|
4725
4830
|
{
|
|
4726
4831
|
type: "button",
|
|
@@ -4728,15 +4833,15 @@ function SuiteIntegrationPicker({
|
|
|
4728
4833
|
onClick: () => void prepareConnection(methodItem, scheme),
|
|
4729
4834
|
"data-test": `${dataTest}-choose-${scheme.toLowerCase()}`,
|
|
4730
4835
|
children: [
|
|
4731
|
-
/* @__PURE__ */
|
|
4732
|
-
/* @__PURE__ */
|
|
4836
|
+
/* @__PURE__ */ jsx26("span", { className: "font-medium", children: authSchemeLabel(scheme) }),
|
|
4837
|
+
/* @__PURE__ */ jsx26("span", { className: "text-xs text-ph-subtle", children: "Select" })
|
|
4733
4838
|
]
|
|
4734
4839
|
},
|
|
4735
4840
|
scheme
|
|
4736
4841
|
)) }) : null
|
|
4737
4842
|
}
|
|
4738
4843
|
),
|
|
4739
|
-
/* @__PURE__ */
|
|
4844
|
+
/* @__PURE__ */ jsx26(
|
|
4740
4845
|
Modal,
|
|
4741
4846
|
{
|
|
4742
4847
|
open: Boolean(authItem),
|
|
@@ -4746,14 +4851,14 @@ function SuiteIntegrationPicker({
|
|
|
4746
4851
|
size: "md",
|
|
4747
4852
|
zIndex: 210,
|
|
4748
4853
|
dataTest: `${dataTest}-auth-form`,
|
|
4749
|
-
children: authLoading ? /* @__PURE__ */
|
|
4854
|
+
children: authLoading ? /* @__PURE__ */ jsx26("p", { className: "text-sm text-ph-subtle", children: "Loading authentication fields..." }) : authItem ? /* @__PURE__ */ jsxs21(
|
|
4750
4855
|
"form",
|
|
4751
4856
|
{
|
|
4752
4857
|
className: "space-y-4",
|
|
4753
4858
|
onSubmit: (event) => void submitAuthForm(event),
|
|
4754
4859
|
children: [
|
|
4755
|
-
authError ? /* @__PURE__ */
|
|
4756
|
-
authItem.fields.length === 0 && authError ? /* @__PURE__ */
|
|
4860
|
+
authError ? /* @__PURE__ */ jsx26("p", { className: "text-sm text-ph-danger", role: "alert", children: authError }) : null,
|
|
4861
|
+
authItem.fields.length === 0 && authError ? /* @__PURE__ */ jsx26(
|
|
4757
4862
|
Button,
|
|
4758
4863
|
{
|
|
4759
4864
|
type: "button",
|
|
@@ -4764,7 +4869,7 @@ function SuiteIntegrationPicker({
|
|
|
4764
4869
|
) : null,
|
|
4765
4870
|
authItem.fields.map((field) => {
|
|
4766
4871
|
var _a2, _b;
|
|
4767
|
-
return /* @__PURE__ */
|
|
4872
|
+
return /* @__PURE__ */ jsx26(
|
|
4768
4873
|
Input,
|
|
4769
4874
|
{
|
|
4770
4875
|
label: field.label,
|
|
@@ -4781,7 +4886,7 @@ function SuiteIntegrationPicker({
|
|
|
4781
4886
|
);
|
|
4782
4887
|
}),
|
|
4783
4888
|
/* @__PURE__ */ jsxs21("div", { className: "flex justify-end gap-2 border-t border-ph-border pt-4", children: [
|
|
4784
|
-
/* @__PURE__ */
|
|
4889
|
+
/* @__PURE__ */ jsx26(
|
|
4785
4890
|
Button,
|
|
4786
4891
|
{
|
|
4787
4892
|
type: "button",
|
|
@@ -4791,7 +4896,7 @@ function SuiteIntegrationPicker({
|
|
|
4791
4896
|
children: "Cancel"
|
|
4792
4897
|
}
|
|
4793
4898
|
),
|
|
4794
|
-
/* @__PURE__ */
|
|
4899
|
+
/* @__PURE__ */ jsx26(Button, { type: "submit", variant: "primary", disabled: authSubmitting, children: authSubmitting ? "Connecting..." : "Connect" })
|
|
4795
4900
|
] })
|
|
4796
4901
|
]
|
|
4797
4902
|
}
|
|
@@ -4802,9 +4907,9 @@ function SuiteIntegrationPicker({
|
|
|
4802
4907
|
}
|
|
4803
4908
|
|
|
4804
4909
|
// src/suite/components/suite-integration-rules.tsx
|
|
4805
|
-
import { useState as
|
|
4910
|
+
import { useState as useState13 } from "react";
|
|
4806
4911
|
import { Plus, Xmark as Xmark2 } from "iconoir-react";
|
|
4807
|
-
import { jsx as
|
|
4912
|
+
import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4808
4913
|
var ACTION_LABELS = {
|
|
4809
4914
|
create_tides_task: "Create a Tides task",
|
|
4810
4915
|
draft_time_entry: "Draft a time entry",
|
|
@@ -4834,18 +4939,18 @@ function SuiteIntegrationRules({
|
|
|
4834
4939
|
onRefresh,
|
|
4835
4940
|
dataTest = "integration-rules"
|
|
4836
4941
|
}) {
|
|
4837
|
-
const [formOpen, setFormOpen] =
|
|
4838
|
-
const [name, setName] =
|
|
4839
|
-
const [trigger, setTrigger] =
|
|
4840
|
-
const [actionType, setActionType] =
|
|
4841
|
-
const [projectId, setProjectId] =
|
|
4842
|
-
const [minutes, setMinutes] =
|
|
4843
|
-
const [priority, setPriority] =
|
|
4844
|
-
const [submitting, setSubmitting] =
|
|
4845
|
-
const [formError, setFormError] =
|
|
4846
|
-
const [busyId, setBusyId] =
|
|
4847
|
-
const [ruleToDelete, setRuleToDelete] =
|
|
4848
|
-
const [deleteError, setDeleteError] =
|
|
4942
|
+
const [formOpen, setFormOpen] = useState13(false);
|
|
4943
|
+
const [name, setName] = useState13("");
|
|
4944
|
+
const [trigger, setTrigger] = useState13("");
|
|
4945
|
+
const [actionType, setActionType] = useState13("create_tides_task");
|
|
4946
|
+
const [projectId, setProjectId] = useState13("");
|
|
4947
|
+
const [minutes, setMinutes] = useState13("");
|
|
4948
|
+
const [priority, setPriority] = useState13("low");
|
|
4949
|
+
const [submitting, setSubmitting] = useState13(false);
|
|
4950
|
+
const [formError, setFormError] = useState13(null);
|
|
4951
|
+
const [busyId, setBusyId] = useState13(null);
|
|
4952
|
+
const [ruleToDelete, setRuleToDelete] = useState13(null);
|
|
4953
|
+
const [deleteError, setDeleteError] = useState13(null);
|
|
4849
4954
|
const needsProject = actionType === "create_tides_task" || actionType === "draft_time_entry";
|
|
4850
4955
|
async function submitForm(event) {
|
|
4851
4956
|
event.preventDefault();
|
|
@@ -4920,10 +5025,10 @@ function SuiteIntegrationRules({
|
|
|
4920
5025
|
children: [
|
|
4921
5026
|
/* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between", children: [
|
|
4922
5027
|
/* @__PURE__ */ jsxs22("div", { children: [
|
|
4923
|
-
/* @__PURE__ */
|
|
4924
|
-
/* @__PURE__ */
|
|
5028
|
+
/* @__PURE__ */ jsx27("h3", { className: "font-medium text-ph-ink", children: "Automation rules" }),
|
|
5029
|
+
/* @__PURE__ */ jsx27("p", { className: "mt-1 text-sm text-ph-subtle", children: "Turn incoming integration events into tasks, time entries, or notifications for this workspace." })
|
|
4925
5030
|
] }),
|
|
4926
|
-
canManage && onCreate ? /* @__PURE__ */
|
|
5031
|
+
canManage && onCreate ? /* @__PURE__ */ jsx27(
|
|
4927
5032
|
Button,
|
|
4928
5033
|
{
|
|
4929
5034
|
type: "button",
|
|
@@ -4932,13 +5037,13 @@ function SuiteIntegrationRules({
|
|
|
4932
5037
|
onClick: () => setFormOpen((open) => !open),
|
|
4933
5038
|
"data-test": `${dataTest}-new`,
|
|
4934
5039
|
children: /* @__PURE__ */ jsxs22("span", { className: "flex items-center gap-1.5", children: [
|
|
4935
|
-
/* @__PURE__ */
|
|
5040
|
+
/* @__PURE__ */ jsx27(Plus, { className: "h-4 w-4", "aria-hidden": true }),
|
|
4936
5041
|
"New rule"
|
|
4937
5042
|
] })
|
|
4938
5043
|
}
|
|
4939
5044
|
) : null
|
|
4940
5045
|
] }),
|
|
4941
|
-
error ? /* @__PURE__ */
|
|
5046
|
+
error ? /* @__PURE__ */ jsx27(
|
|
4942
5047
|
Alert,
|
|
4943
5048
|
{
|
|
4944
5049
|
status: "danger",
|
|
@@ -4946,7 +5051,7 @@ function SuiteIntegrationRules({
|
|
|
4946
5051
|
description: error
|
|
4947
5052
|
}
|
|
4948
5053
|
) : null,
|
|
4949
|
-
loading ? /* @__PURE__ */
|
|
5054
|
+
loading ? /* @__PURE__ */ jsx27("p", { className: "mt-4 text-sm text-ph-subtle", children: "Loading rules..." }) : rules.length === 0 ? /* @__PURE__ */ jsx27(
|
|
4950
5055
|
"div",
|
|
4951
5056
|
{
|
|
4952
5057
|
className: "mt-4 rounded-lg border border-dashed border-ph-border px-4 py-6 text-center",
|
|
@@ -4956,14 +5061,14 @@ function SuiteIntegrationRules({
|
|
|
4956
5061
|
canManage ? " Create one to get started." : ""
|
|
4957
5062
|
] })
|
|
4958
5063
|
}
|
|
4959
|
-
) : /* @__PURE__ */
|
|
5064
|
+
) : /* @__PURE__ */ jsx27("ul", { className: "mt-4 space-y-2", "data-test": `${dataTest}-list`, children: rules.map((rule) => /* @__PURE__ */ jsxs22(
|
|
4960
5065
|
"li",
|
|
4961
5066
|
{
|
|
4962
5067
|
className: "flex items-center justify-between gap-3 rounded-lg border border-ph-border bg-ph-muted px-3 py-3",
|
|
4963
5068
|
"data-test": `${dataTest}-rule-${rule.id}`,
|
|
4964
5069
|
children: [
|
|
4965
5070
|
/* @__PURE__ */ jsxs22("div", { className: "min-w-0", children: [
|
|
4966
|
-
/* @__PURE__ */
|
|
5071
|
+
/* @__PURE__ */ jsx27("p", { className: "truncate text-sm font-medium text-ph-ink", children: rule.name }),
|
|
4967
5072
|
/* @__PURE__ */ jsxs22("p", { className: "mt-0.5 truncate text-xs text-ph-subtle", children: [
|
|
4968
5073
|
rule.trigger_event_type,
|
|
4969
5074
|
" \u2192 ",
|
|
@@ -4975,7 +5080,7 @@ function SuiteIntegrationRules({
|
|
|
4975
5080
|
] })
|
|
4976
5081
|
] }),
|
|
4977
5082
|
canManage ? /* @__PURE__ */ jsxs22("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
4978
|
-
/* @__PURE__ */
|
|
5083
|
+
/* @__PURE__ */ jsx27(
|
|
4979
5084
|
Toggle,
|
|
4980
5085
|
{
|
|
4981
5086
|
checked: rule.enabled,
|
|
@@ -4984,7 +5089,7 @@ function SuiteIntegrationRules({
|
|
|
4984
5089
|
"aria-label": `Enable ${rule.name}`
|
|
4985
5090
|
}
|
|
4986
5091
|
),
|
|
4987
|
-
/* @__PURE__ */
|
|
5092
|
+
/* @__PURE__ */ jsx27(
|
|
4988
5093
|
Button,
|
|
4989
5094
|
{
|
|
4990
5095
|
type: "button",
|
|
@@ -4993,10 +5098,10 @@ function SuiteIntegrationRules({
|
|
|
4993
5098
|
disabled: busyId === rule.id,
|
|
4994
5099
|
onClick: () => requestDelete(rule),
|
|
4995
5100
|
"aria-label": `Delete ${rule.name}`,
|
|
4996
|
-
children: /* @__PURE__ */
|
|
5101
|
+
children: /* @__PURE__ */ jsx27(Xmark2, { className: "h-4 w-4", "aria-hidden": true })
|
|
4997
5102
|
}
|
|
4998
5103
|
)
|
|
4999
|
-
] }) : /* @__PURE__ */
|
|
5104
|
+
] }) : /* @__PURE__ */ jsx27(
|
|
5000
5105
|
Badge,
|
|
5001
5106
|
{
|
|
5002
5107
|
variant: rule.enabled ? "success" : "neutral",
|
|
@@ -5015,8 +5120,8 @@ function SuiteIntegrationRules({
|
|
|
5015
5120
|
onSubmit: (event) => void submitForm(event),
|
|
5016
5121
|
"data-test": `${dataTest}-form`,
|
|
5017
5122
|
children: [
|
|
5018
|
-
formError ? /* @__PURE__ */
|
|
5019
|
-
/* @__PURE__ */
|
|
5123
|
+
formError ? /* @__PURE__ */ jsx27("p", { className: "text-sm text-ph-danger", role: "alert", children: formError }) : null,
|
|
5124
|
+
/* @__PURE__ */ jsx27(
|
|
5020
5125
|
Input,
|
|
5021
5126
|
{
|
|
5022
5127
|
label: "Rule name",
|
|
@@ -5027,7 +5132,7 @@ function SuiteIntegrationRules({
|
|
|
5027
5132
|
"data-test": `${dataTest}-name`
|
|
5028
5133
|
}
|
|
5029
5134
|
),
|
|
5030
|
-
/* @__PURE__ */
|
|
5135
|
+
/* @__PURE__ */ jsx27(
|
|
5031
5136
|
Input,
|
|
5032
5137
|
{
|
|
5033
5138
|
label: "Trigger event type",
|
|
@@ -5039,7 +5144,7 @@ function SuiteIntegrationRules({
|
|
|
5039
5144
|
"data-test": `${dataTest}-trigger`
|
|
5040
5145
|
}
|
|
5041
5146
|
),
|
|
5042
|
-
/* @__PURE__ */
|
|
5147
|
+
/* @__PURE__ */ jsx27(
|
|
5043
5148
|
Select,
|
|
5044
5149
|
{
|
|
5045
5150
|
label: "Action",
|
|
@@ -5048,7 +5153,7 @@ function SuiteIntegrationRules({
|
|
|
5048
5153
|
event.target.value
|
|
5049
5154
|
),
|
|
5050
5155
|
"data-test": `${dataTest}-action`,
|
|
5051
|
-
children: Object.entries(ACTION_LABELS).map(([value, label]) => /* @__PURE__ */
|
|
5156
|
+
children: Object.entries(ACTION_LABELS).map(([value, label]) => /* @__PURE__ */ jsx27("option", { value, children: label }, value))
|
|
5052
5157
|
}
|
|
5053
5158
|
),
|
|
5054
5159
|
needsProject ? /* @__PURE__ */ jsxs22(
|
|
@@ -5059,12 +5164,12 @@ function SuiteIntegrationRules({
|
|
|
5059
5164
|
onChange: (event) => setProjectId(event.target.value),
|
|
5060
5165
|
"data-test": `${dataTest}-project`,
|
|
5061
5166
|
children: [
|
|
5062
|
-
/* @__PURE__ */
|
|
5063
|
-
projects.map((project) => /* @__PURE__ */
|
|
5167
|
+
/* @__PURE__ */ jsx27("option", { value: "", children: "Choose a project..." }),
|
|
5168
|
+
projects.map((project) => /* @__PURE__ */ jsx27("option", { value: project.id, children: project.name }, project.id))
|
|
5064
5169
|
]
|
|
5065
5170
|
}
|
|
5066
5171
|
) : null,
|
|
5067
|
-
actionType === "draft_time_entry" ? /* @__PURE__ */
|
|
5172
|
+
actionType === "draft_time_entry" ? /* @__PURE__ */ jsx27(
|
|
5068
5173
|
Input,
|
|
5069
5174
|
{
|
|
5070
5175
|
label: "Minutes (optional)",
|
|
@@ -5083,15 +5188,15 @@ function SuiteIntegrationRules({
|
|
|
5083
5188
|
onChange: (event) => setPriority(event.target.value),
|
|
5084
5189
|
"data-test": `${dataTest}-priority`,
|
|
5085
5190
|
children: [
|
|
5086
|
-
/* @__PURE__ */
|
|
5087
|
-
/* @__PURE__ */
|
|
5088
|
-
/* @__PURE__ */
|
|
5089
|
-
/* @__PURE__ */
|
|
5191
|
+
/* @__PURE__ */ jsx27("option", { value: "low", children: "Low" }),
|
|
5192
|
+
/* @__PURE__ */ jsx27("option", { value: "medium", children: "Medium" }),
|
|
5193
|
+
/* @__PURE__ */ jsx27("option", { value: "high", children: "High" }),
|
|
5194
|
+
/* @__PURE__ */ jsx27("option", { value: "urgent", children: "Urgent" })
|
|
5090
5195
|
]
|
|
5091
5196
|
}
|
|
5092
5197
|
) : null,
|
|
5093
5198
|
/* @__PURE__ */ jsxs22("div", { className: "flex justify-end gap-2 border-t border-ph-border pt-3", children: [
|
|
5094
|
-
/* @__PURE__ */
|
|
5199
|
+
/* @__PURE__ */ jsx27(
|
|
5095
5200
|
Button,
|
|
5096
5201
|
{
|
|
5097
5202
|
type: "button",
|
|
@@ -5101,7 +5206,7 @@ function SuiteIntegrationRules({
|
|
|
5101
5206
|
children: "Cancel"
|
|
5102
5207
|
}
|
|
5103
5208
|
),
|
|
5104
|
-
/* @__PURE__ */
|
|
5209
|
+
/* @__PURE__ */ jsx27(Button, { type: "submit", variant: "primary", disabled: submitting, children: submitting ? "Creating..." : "Create rule" })
|
|
5105
5210
|
] })
|
|
5106
5211
|
]
|
|
5107
5212
|
}
|
|
@@ -5120,7 +5225,7 @@ function SuiteIntegrationRules({
|
|
|
5120
5225
|
description: "This action cannot be undone.",
|
|
5121
5226
|
dataTest: `${dataTest}-delete-confirmation`,
|
|
5122
5227
|
footer: /* @__PURE__ */ jsxs22("div", { className: "flex justify-end gap-2", children: [
|
|
5123
|
-
/* @__PURE__ */
|
|
5228
|
+
/* @__PURE__ */ jsx27(
|
|
5124
5229
|
Button,
|
|
5125
5230
|
{
|
|
5126
5231
|
type: "button",
|
|
@@ -5130,7 +5235,7 @@ function SuiteIntegrationRules({
|
|
|
5130
5235
|
children: "Cancel"
|
|
5131
5236
|
}
|
|
5132
5237
|
),
|
|
5133
|
-
/* @__PURE__ */
|
|
5238
|
+
/* @__PURE__ */ jsx27(
|
|
5134
5239
|
Button,
|
|
5135
5240
|
{
|
|
5136
5241
|
type: "button",
|
|
@@ -5143,7 +5248,7 @@ function SuiteIntegrationRules({
|
|
|
5143
5248
|
)
|
|
5144
5249
|
] }),
|
|
5145
5250
|
children: [
|
|
5146
|
-
deleteError ? /* @__PURE__ */
|
|
5251
|
+
deleteError ? /* @__PURE__ */ jsx27("p", { className: "text-sm text-ph-danger", role: "alert", children: deleteError }) : null,
|
|
5147
5252
|
/* @__PURE__ */ jsxs22("p", { className: "text-sm text-ph-ink", children: [
|
|
5148
5253
|
"Delete ",
|
|
5149
5254
|
ruleToDelete == null ? void 0 : ruleToDelete.name,
|
|
@@ -5159,16 +5264,16 @@ function SuiteIntegrationRules({
|
|
|
5159
5264
|
bodyClassName: "p-5",
|
|
5160
5265
|
"data-test": `${dataTest}-events-card`,
|
|
5161
5266
|
children: [
|
|
5162
|
-
/* @__PURE__ */
|
|
5163
|
-
/* @__PURE__ */
|
|
5164
|
-
events.length === 0 ? /* @__PURE__ */
|
|
5267
|
+
/* @__PURE__ */ jsx27("h3", { className: "font-medium text-ph-ink", children: "Recent events" }),
|
|
5268
|
+
/* @__PURE__ */ jsx27("p", { className: "mt-1 text-sm text-ph-subtle", children: "The latest events received from your connected apps." }),
|
|
5269
|
+
events.length === 0 ? /* @__PURE__ */ jsx27(
|
|
5165
5270
|
"p",
|
|
5166
5271
|
{
|
|
5167
5272
|
className: "mt-4 rounded-lg border border-dashed border-ph-border px-4 py-6 text-center text-sm text-ph-subtle",
|
|
5168
5273
|
"data-test": `${dataTest}-events-empty`,
|
|
5169
5274
|
children: "No integration events yet."
|
|
5170
5275
|
}
|
|
5171
|
-
) : /* @__PURE__ */
|
|
5276
|
+
) : /* @__PURE__ */ jsx27("ul", { className: "mt-4 space-y-2", "data-test": `${dataTest}-events-list`, children: events.map((event) => /* @__PURE__ */ jsxs22(
|
|
5172
5277
|
"li",
|
|
5173
5278
|
{
|
|
5174
5279
|
className: "flex items-center justify-between gap-3 rounded-lg border border-ph-border bg-ph-muted px-3 py-2",
|
|
@@ -5179,9 +5284,9 @@ function SuiteIntegrationRules({
|
|
|
5179
5284
|
" \xB7 ",
|
|
5180
5285
|
event.event_type
|
|
5181
5286
|
] }),
|
|
5182
|
-
/* @__PURE__ */
|
|
5287
|
+
/* @__PURE__ */ jsx27("p", { className: "mt-0.5 text-xs text-ph-subtle", children: formatDateTime(event.created_at) })
|
|
5183
5288
|
] }),
|
|
5184
|
-
/* @__PURE__ */
|
|
5289
|
+
/* @__PURE__ */ jsx27(
|
|
5185
5290
|
Badge,
|
|
5186
5291
|
{
|
|
5187
5292
|
variant: event.processed_at ? "success" : "warning",
|
|
@@ -5202,9 +5307,9 @@ function SuiteIntegrationRules({
|
|
|
5202
5307
|
// src/suite/components/suite-clients-projects-directory.tsx
|
|
5203
5308
|
import {
|
|
5204
5309
|
useEffect as useEffect11,
|
|
5205
|
-
useMemo as
|
|
5310
|
+
useMemo as useMemo5,
|
|
5206
5311
|
useRef as useRef6,
|
|
5207
|
-
useState as
|
|
5312
|
+
useState as useState15
|
|
5208
5313
|
} from "react";
|
|
5209
5314
|
import {
|
|
5210
5315
|
ArrowLeft,
|
|
@@ -5268,7 +5373,7 @@ function paletteIconSrc(imageUrl, color) {
|
|
|
5268
5373
|
}
|
|
5269
5374
|
|
|
5270
5375
|
// src/suite/components/suite-entity-icon.tsx
|
|
5271
|
-
import { jsx as
|
|
5376
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
5272
5377
|
function SuiteEntityIcon({
|
|
5273
5378
|
imageUrl,
|
|
5274
5379
|
label,
|
|
@@ -5283,7 +5388,7 @@ function SuiteEntityIcon({
|
|
|
5283
5388
|
const neutralBackground = "var(--ph-muted, rgba(127,127,127,0.08))";
|
|
5284
5389
|
if (imageUrl) {
|
|
5285
5390
|
const src = tinted && tint ? paletteIconSrc(imageUrl, tint) : imageUrl;
|
|
5286
|
-
return /* @__PURE__ */
|
|
5391
|
+
return /* @__PURE__ */ jsx28(
|
|
5287
5392
|
"span",
|
|
5288
5393
|
{
|
|
5289
5394
|
className: cn(
|
|
@@ -5294,12 +5399,12 @@ function SuiteEntityIcon({
|
|
|
5294
5399
|
style: __spreadValues({
|
|
5295
5400
|
backgroundColor: tint ? `${tint}18` : neutralBackground
|
|
5296
5401
|
}, style),
|
|
5297
|
-
children: /* @__PURE__ */
|
|
5402
|
+
children: /* @__PURE__ */ jsx28("img", { src: src != null ? src : void 0, alt: "", className: "h-full w-full object-cover" })
|
|
5298
5403
|
}
|
|
5299
5404
|
);
|
|
5300
5405
|
}
|
|
5301
5406
|
const initial = label == null ? void 0 : label.trim().charAt(0).toUpperCase();
|
|
5302
|
-
return /* @__PURE__ */
|
|
5407
|
+
return /* @__PURE__ */ jsx28(
|
|
5303
5408
|
"span",
|
|
5304
5409
|
{
|
|
5305
5410
|
className: cn(
|
|
@@ -5312,7 +5417,7 @@ function SuiteEntityIcon({
|
|
|
5312
5417
|
backgroundColor: tint ? `${tint}18` : neutralBackground
|
|
5313
5418
|
}, style),
|
|
5314
5419
|
"aria-hidden": "true",
|
|
5315
|
-
children: initial ? /* @__PURE__ */
|
|
5420
|
+
children: initial ? /* @__PURE__ */ jsx28("span", { className: "text-[0.7em]", children: initial }) : /* @__PURE__ */ jsx28("span", { className: "block h-1.5 w-1.5 rounded-full bg-current opacity-40" })
|
|
5316
5421
|
}
|
|
5317
5422
|
);
|
|
5318
5423
|
}
|
|
@@ -5321,12 +5426,12 @@ function SuiteEntityIcon({
|
|
|
5321
5426
|
import {
|
|
5322
5427
|
useCallback as useCallback6,
|
|
5323
5428
|
useEffect as useEffect10,
|
|
5324
|
-
useMemo as
|
|
5429
|
+
useMemo as useMemo4,
|
|
5325
5430
|
useRef as useRef5,
|
|
5326
|
-
useState as
|
|
5431
|
+
useState as useState14
|
|
5327
5432
|
} from "react";
|
|
5328
5433
|
import { Filter as Filter2, FilterList, NavArrowDown as NavArrowDown3, Search as Search2 } from "iconoir-react";
|
|
5329
|
-
import { Fragment as Fragment9, jsx as
|
|
5434
|
+
import { Fragment as Fragment9, jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5330
5435
|
var PAGE_SIZE = 60;
|
|
5331
5436
|
var DISCOVER_LIMIT = 120;
|
|
5332
5437
|
var ICON_TYPES = [
|
|
@@ -5345,14 +5450,14 @@ function FilterSelect({
|
|
|
5345
5450
|
children
|
|
5346
5451
|
}) {
|
|
5347
5452
|
return /* @__PURE__ */ jsxs23("div", { className: "relative", children: [
|
|
5348
|
-
/* @__PURE__ */
|
|
5453
|
+
/* @__PURE__ */ jsx29(
|
|
5349
5454
|
Icon,
|
|
5350
5455
|
{
|
|
5351
5456
|
className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
5352
5457
|
"aria-hidden": true
|
|
5353
5458
|
}
|
|
5354
5459
|
),
|
|
5355
|
-
/* @__PURE__ */
|
|
5460
|
+
/* @__PURE__ */ jsx29(
|
|
5356
5461
|
"select",
|
|
5357
5462
|
{
|
|
5358
5463
|
"aria-label": label,
|
|
@@ -5362,7 +5467,7 @@ function FilterSelect({
|
|
|
5362
5467
|
children
|
|
5363
5468
|
}
|
|
5364
5469
|
),
|
|
5365
|
-
/* @__PURE__ */
|
|
5470
|
+
/* @__PURE__ */ jsx29(
|
|
5366
5471
|
NavArrowDown3,
|
|
5367
5472
|
{
|
|
5368
5473
|
className: "pointer-events-none absolute right-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ph-mutedtext",
|
|
@@ -5375,21 +5480,21 @@ function SuitePaletteLibrary({
|
|
|
5375
5480
|
onPick
|
|
5376
5481
|
}) {
|
|
5377
5482
|
var _a2, _b;
|
|
5378
|
-
const [collections, setCollections] =
|
|
5379
|
-
const [typeFilter, setTypeFilter] =
|
|
5380
|
-
const [collectionFilter, setCollectionFilter] =
|
|
5381
|
-
const [libraryOpen, setLibraryOpen] =
|
|
5382
|
-
const [libraryQuery, setLibraryQuery] =
|
|
5483
|
+
const [collections, setCollections] = useState14([]);
|
|
5484
|
+
const [typeFilter, setTypeFilter] = useState14("all");
|
|
5485
|
+
const [collectionFilter, setCollectionFilter] = useState14("");
|
|
5486
|
+
const [libraryOpen, setLibraryOpen] = useState14(false);
|
|
5487
|
+
const [libraryQuery, setLibraryQuery] = useState14("");
|
|
5383
5488
|
const libraryRef = useRef5(null);
|
|
5384
|
-
const [icons, setIcons] =
|
|
5385
|
-
const [total, setTotal] =
|
|
5386
|
-
const [page, setPage] =
|
|
5387
|
-
const [query, setQuery] =
|
|
5388
|
-
const [loading, setLoading] =
|
|
5389
|
-
const [loadingMore, setLoadingMore] =
|
|
5390
|
-
const [error, setError] =
|
|
5489
|
+
const [icons, setIcons] = useState14([]);
|
|
5490
|
+
const [total, setTotal] = useState14(0);
|
|
5491
|
+
const [page, setPage] = useState14(1);
|
|
5492
|
+
const [query, setQuery] = useState14("");
|
|
5493
|
+
const [loading, setLoading] = useState14(true);
|
|
5494
|
+
const [loadingMore, setLoadingMore] = useState14(false);
|
|
5495
|
+
const [error, setError] = useState14(null);
|
|
5391
5496
|
const requestId = useRef5(0);
|
|
5392
|
-
const libraryOptions =
|
|
5497
|
+
const libraryOptions = useMemo4(() => {
|
|
5393
5498
|
const list = collections.filter(
|
|
5394
5499
|
(item) => typeFilter === "all" || item.style === typeFilter
|
|
5395
5500
|
);
|
|
@@ -5397,7 +5502,7 @@ function SuitePaletteLibrary({
|
|
|
5397
5502
|
(a, b) => Number(b.featured) - Number(a.featured) || a.name.localeCompare(b.name)
|
|
5398
5503
|
);
|
|
5399
5504
|
}, [collections, typeFilter]);
|
|
5400
|
-
const discoverIcons =
|
|
5505
|
+
const discoverIcons = useMemo4(() => {
|
|
5401
5506
|
const seen = /* @__PURE__ */ new Set();
|
|
5402
5507
|
const out = [];
|
|
5403
5508
|
for (const collection of libraryOptions) {
|
|
@@ -5510,7 +5615,7 @@ function SuitePaletteLibrary({
|
|
|
5510
5615
|
}, [query, collectionFilter, typeFilter]);
|
|
5511
5616
|
const searching = Boolean(query.trim());
|
|
5512
5617
|
const activeLibrary = (_a2 = collections.find((c) => c.slug === collectionFilter)) != null ? _a2 : null;
|
|
5513
|
-
const filteredLibraries =
|
|
5618
|
+
const filteredLibraries = useMemo4(() => {
|
|
5514
5619
|
const term = libraryQuery.trim().toLowerCase();
|
|
5515
5620
|
if (!term) return libraryOptions;
|
|
5516
5621
|
return libraryOptions.filter((c) => c.name.toLowerCase().includes(term));
|
|
@@ -5528,14 +5633,14 @@ function SuitePaletteLibrary({
|
|
|
5528
5633
|
/* @__PURE__ */ jsxs23("div", { ref: libraryRef, className: "space-y-2", children: [
|
|
5529
5634
|
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
5530
5635
|
/* @__PURE__ */ jsxs23("div", { className: "relative flex-1", children: [
|
|
5531
|
-
/* @__PURE__ */
|
|
5636
|
+
/* @__PURE__ */ jsx29(
|
|
5532
5637
|
Search2,
|
|
5533
5638
|
{
|
|
5534
5639
|
className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
5535
5640
|
"aria-hidden": true
|
|
5536
5641
|
}
|
|
5537
5642
|
),
|
|
5538
|
-
/* @__PURE__ */
|
|
5643
|
+
/* @__PURE__ */ jsx29(
|
|
5539
5644
|
"input",
|
|
5540
5645
|
{
|
|
5541
5646
|
type: "search",
|
|
@@ -5556,9 +5661,9 @@ function SuitePaletteLibrary({
|
|
|
5556
5661
|
onClick: () => setLibraryOpen((open) => !open),
|
|
5557
5662
|
className: "flex items-center gap-2 rounded-lg border border-ph-border bg-ph-surface px-2.5 py-2 text-sm text-ph-ink hover:border-ph-brand focus:outline-none focus-visible:ring-2 focus-visible:ring-ph-brand",
|
|
5558
5663
|
children: [
|
|
5559
|
-
/* @__PURE__ */
|
|
5560
|
-
/* @__PURE__ */
|
|
5561
|
-
/* @__PURE__ */
|
|
5664
|
+
/* @__PURE__ */ jsx29(FilterList, { className: "h-4 w-4 shrink-0 text-ph-mutedtext", "aria-hidden": true }),
|
|
5665
|
+
/* @__PURE__ */ jsx29("span", { className: "max-w-[10rem] truncate", children: (_b = activeLibrary == null ? void 0 : activeLibrary.name) != null ? _b : "All libraries" }),
|
|
5666
|
+
/* @__PURE__ */ jsx29(
|
|
5562
5667
|
NavArrowDown3,
|
|
5563
5668
|
{
|
|
5564
5669
|
className: cn(
|
|
@@ -5571,27 +5676,27 @@ function SuitePaletteLibrary({
|
|
|
5571
5676
|
]
|
|
5572
5677
|
}
|
|
5573
5678
|
),
|
|
5574
|
-
/* @__PURE__ */
|
|
5679
|
+
/* @__PURE__ */ jsx29(
|
|
5575
5680
|
FilterSelect,
|
|
5576
5681
|
{
|
|
5577
5682
|
icon: Filter2,
|
|
5578
5683
|
label: "Filter by icon type",
|
|
5579
5684
|
value: typeFilter,
|
|
5580
5685
|
onChange: setTypeFilter,
|
|
5581
|
-
children: ICON_TYPES.map((type) => /* @__PURE__ */
|
|
5686
|
+
children: ICON_TYPES.map((type) => /* @__PURE__ */ jsx29("option", { value: type.value, children: type.label }, type.value))
|
|
5582
5687
|
}
|
|
5583
5688
|
)
|
|
5584
5689
|
] }),
|
|
5585
5690
|
libraryOpen ? /* @__PURE__ */ jsxs23("div", { className: "rounded-lg border border-ph-border bg-ph-surface p-2", children: [
|
|
5586
5691
|
/* @__PURE__ */ jsxs23("div", { className: "relative mb-2", children: [
|
|
5587
|
-
/* @__PURE__ */
|
|
5692
|
+
/* @__PURE__ */ jsx29(
|
|
5588
5693
|
Search2,
|
|
5589
5694
|
{
|
|
5590
5695
|
className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
5591
5696
|
"aria-hidden": true
|
|
5592
5697
|
}
|
|
5593
5698
|
),
|
|
5594
|
-
/* @__PURE__ */
|
|
5699
|
+
/* @__PURE__ */ jsx29(
|
|
5595
5700
|
"input",
|
|
5596
5701
|
{
|
|
5597
5702
|
type: "search",
|
|
@@ -5611,7 +5716,7 @@ function SuitePaletteLibrary({
|
|
|
5611
5716
|
"aria-label": "Libraries",
|
|
5612
5717
|
className: "max-h-56 overflow-y-auto",
|
|
5613
5718
|
children: [
|
|
5614
|
-
/* @__PURE__ */
|
|
5719
|
+
/* @__PURE__ */ jsx29("li", { children: /* @__PURE__ */ jsx29(
|
|
5615
5720
|
"button",
|
|
5616
5721
|
{
|
|
5617
5722
|
type: "button",
|
|
@@ -5628,7 +5733,7 @@ function SuitePaletteLibrary({
|
|
|
5628
5733
|
children: "All libraries"
|
|
5629
5734
|
}
|
|
5630
5735
|
) }),
|
|
5631
|
-
filteredLibraries.map((collection) => /* @__PURE__ */
|
|
5736
|
+
filteredLibraries.map((collection) => /* @__PURE__ */ jsx29("li", { children: /* @__PURE__ */ jsxs23(
|
|
5632
5737
|
"button",
|
|
5633
5738
|
{
|
|
5634
5739
|
type: "button",
|
|
@@ -5643,19 +5748,19 @@ function SuitePaletteLibrary({
|
|
|
5643
5748
|
collectionFilter === collection.slug ? "bg-ph-muted text-ph-ink" : "text-ph-ink hover:bg-ph-muted"
|
|
5644
5749
|
),
|
|
5645
5750
|
children: [
|
|
5646
|
-
/* @__PURE__ */
|
|
5647
|
-
/* @__PURE__ */
|
|
5751
|
+
/* @__PURE__ */ jsx29("span", { className: "truncate", children: collection.name }),
|
|
5752
|
+
/* @__PURE__ */ jsx29("span", { className: "shrink-0 text-xs text-ph-mutedtext", children: collection.count })
|
|
5648
5753
|
]
|
|
5649
5754
|
}
|
|
5650
5755
|
) }, collection.slug)),
|
|
5651
|
-
filteredLibraries.length === 0 ? /* @__PURE__ */
|
|
5756
|
+
filteredLibraries.length === 0 ? /* @__PURE__ */ jsx29("li", { className: "px-2 py-4 text-center text-sm text-ph-mutedtext", children: "No libraries match." }) : null
|
|
5652
5757
|
]
|
|
5653
5758
|
}
|
|
5654
5759
|
)
|
|
5655
5760
|
] }) : null
|
|
5656
5761
|
] }),
|
|
5657
|
-
error ? /* @__PURE__ */
|
|
5658
|
-
/* @__PURE__ */
|
|
5762
|
+
error ? /* @__PURE__ */ jsx29("p", { className: "text-sm text-ph-danger", children: error }) : loading ? /* @__PURE__ */ jsx29("p", { className: "py-8 text-center text-sm text-ph-mutedtext", children: "Loading icons\u2026" }) : icons.length === 0 ? /* @__PURE__ */ jsx29("p", { className: "py-8 text-center text-sm text-ph-mutedtext", children: "No icons matched. Try another word or filter." }) : /* @__PURE__ */ jsxs23(Fragment9, { children: [
|
|
5763
|
+
/* @__PURE__ */ jsx29("div", { className: "max-h-[320px] overflow-y-auto rounded-lg border border-ph-border p-2", children: /* @__PURE__ */ jsx29("div", { className: "grid grid-cols-6 gap-1.5 sm:grid-cols-8", children: icons.map((icon) => /* @__PURE__ */ jsx29(
|
|
5659
5764
|
"button",
|
|
5660
5765
|
{
|
|
5661
5766
|
type: "button",
|
|
@@ -5663,7 +5768,7 @@ function SuitePaletteLibrary({
|
|
|
5663
5768
|
title: icon.name,
|
|
5664
5769
|
"aria-label": `Use ${icon.name}`,
|
|
5665
5770
|
className: "flex h-10 items-center justify-center rounded-md border border-transparent p-1.5 hover:border-ph-brand hover:bg-ph-muted",
|
|
5666
|
-
children: /* @__PURE__ */
|
|
5771
|
+
children: /* @__PURE__ */ jsx29(
|
|
5667
5772
|
"img",
|
|
5668
5773
|
{
|
|
5669
5774
|
src: icon.url,
|
|
@@ -5683,7 +5788,7 @@ function SuitePaletteLibrary({
|
|
|
5683
5788
|
total,
|
|
5684
5789
|
searching ? " matching" : activeLibrary ? ` in ${activeLibrary.name}` : " across all libraries"
|
|
5685
5790
|
] }),
|
|
5686
|
-
!searching && activeLibrary && icons.length < total ? /* @__PURE__ */
|
|
5791
|
+
!searching && activeLibrary && icons.length < total ? /* @__PURE__ */ jsx29(
|
|
5687
5792
|
"button",
|
|
5688
5793
|
{
|
|
5689
5794
|
type: "button",
|
|
@@ -5702,7 +5807,7 @@ function SuitePaletteLibrary({
|
|
|
5702
5807
|
}
|
|
5703
5808
|
|
|
5704
5809
|
// src/suite/components/suite-clients-projects-directory.tsx
|
|
5705
|
-
import { Fragment as Fragment10, jsx as
|
|
5810
|
+
import { Fragment as Fragment10, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5706
5811
|
var DEFAULT_ICON = "";
|
|
5707
5812
|
var DEFAULT_COLOR = "";
|
|
5708
5813
|
function DirectoryIconPicker({
|
|
@@ -5714,10 +5819,10 @@ function DirectoryIconPicker({
|
|
|
5714
5819
|
onBrowse
|
|
5715
5820
|
}) {
|
|
5716
5821
|
return /* @__PURE__ */ jsxs24("div", { className: "space-y-2", children: [
|
|
5717
|
-
/* @__PURE__ */
|
|
5822
|
+
/* @__PURE__ */ jsx30("span", { className: "mb-1.5 block text-sm font-medium text-ph-ink", children: "Icon" }),
|
|
5718
5823
|
/* @__PURE__ */ jsxs24("div", { className: "rounded-lg border border-ph-border bg-ph-muted p-3", children: [
|
|
5719
5824
|
/* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-3", children: [
|
|
5720
|
-
/* @__PURE__ */
|
|
5825
|
+
/* @__PURE__ */ jsx30(
|
|
5721
5826
|
SuiteEntityIcon,
|
|
5722
5827
|
{
|
|
5723
5828
|
imageUrl: preview,
|
|
@@ -5728,10 +5833,10 @@ function DirectoryIconPicker({
|
|
|
5728
5833
|
}
|
|
5729
5834
|
),
|
|
5730
5835
|
/* @__PURE__ */ jsxs24("div", { className: "min-w-0 flex-1", children: [
|
|
5731
|
-
/* @__PURE__ */
|
|
5732
|
-
/* @__PURE__ */
|
|
5836
|
+
/* @__PURE__ */ jsx30("p", { className: "text-sm font-medium text-ph-ink", children: preview ? "Custom image" : "No icon yet" }),
|
|
5837
|
+
/* @__PURE__ */ jsx30("p", { className: "text-xs text-ph-mutedtext", children: preview ? "Shown on cards and lists." : "Browse the library or upload your own." })
|
|
5733
5838
|
] }),
|
|
5734
|
-
onBrowse ? /* @__PURE__ */
|
|
5839
|
+
onBrowse ? /* @__PURE__ */ jsx30(
|
|
5735
5840
|
"button",
|
|
5736
5841
|
{
|
|
5737
5842
|
type: "button",
|
|
@@ -5741,7 +5846,7 @@ function DirectoryIconPicker({
|
|
|
5741
5846
|
}
|
|
5742
5847
|
) : null
|
|
5743
5848
|
] }),
|
|
5744
|
-
/* @__PURE__ */
|
|
5849
|
+
/* @__PURE__ */ jsx30("div", { className: "mt-3", children: /* @__PURE__ */ jsx30(
|
|
5745
5850
|
FileUpload,
|
|
5746
5851
|
{
|
|
5747
5852
|
accept: "image/png,image/jpeg,image/gif,image/webp,image/svg+xml,.svg",
|
|
@@ -5758,7 +5863,7 @@ function DirectoryIconPicker({
|
|
|
5758
5863
|
className: "mt-2 inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-ph-mutedtext hover:bg-ph-surface hover:text-ph-ink",
|
|
5759
5864
|
onClick: onClear,
|
|
5760
5865
|
children: [
|
|
5761
|
-
/* @__PURE__ */
|
|
5866
|
+
/* @__PURE__ */ jsx30(Trash, { className: "h-3.5 w-3.5", "aria-hidden": true }),
|
|
5762
5867
|
" Remove image"
|
|
5763
5868
|
]
|
|
5764
5869
|
}
|
|
@@ -5769,7 +5874,7 @@ function DirectoryIconPicker({
|
|
|
5769
5874
|
function DirectoryIcon({
|
|
5770
5875
|
item
|
|
5771
5876
|
}) {
|
|
5772
|
-
return /* @__PURE__ */
|
|
5877
|
+
return /* @__PURE__ */ jsx30(
|
|
5773
5878
|
SuiteEntityIcon,
|
|
5774
5879
|
{
|
|
5775
5880
|
imageUrl: item.icon_image,
|
|
@@ -5797,22 +5902,22 @@ function SuiteClientsProjectsDirectory({
|
|
|
5797
5902
|
dataTest = "suite-clients-projects-directory"
|
|
5798
5903
|
}) {
|
|
5799
5904
|
var _a2;
|
|
5800
|
-
const [query, setQuery] =
|
|
5801
|
-
const [selectedClientId, setSelectedClientId] =
|
|
5802
|
-
const [mobileDetail, setMobileDetail] =
|
|
5803
|
-
const [editing, setEditing] =
|
|
5804
|
-
const [draft, setDraft] =
|
|
5905
|
+
const [query, setQuery] = useState15("");
|
|
5906
|
+
const [selectedClientId, setSelectedClientId] = useState15(null);
|
|
5907
|
+
const [mobileDetail, setMobileDetail] = useState15(false);
|
|
5908
|
+
const [editing, setEditing] = useState15(null);
|
|
5909
|
+
const [draft, setDraft] = useState15({
|
|
5805
5910
|
name: "",
|
|
5806
5911
|
icon: DEFAULT_ICON,
|
|
5807
5912
|
color: DEFAULT_COLOR
|
|
5808
5913
|
});
|
|
5809
|
-
const [draftClientId, setDraftClientId] =
|
|
5810
|
-
const [preview, setPreview] =
|
|
5811
|
-
const [libraryOpen, setLibraryOpen] =
|
|
5812
|
-
const [draftArchived, setDraftArchived] =
|
|
5813
|
-
const [confirming, setConfirming] =
|
|
5814
|
-
const [saving, setSaving] =
|
|
5815
|
-
const [mutationError, setMutationError] =
|
|
5914
|
+
const [draftClientId, setDraftClientId] = useState15(null);
|
|
5915
|
+
const [preview, setPreview] = useState15(null);
|
|
5916
|
+
const [libraryOpen, setLibraryOpen] = useState15(false);
|
|
5917
|
+
const [draftArchived, setDraftArchived] = useState15(false);
|
|
5918
|
+
const [confirming, setConfirming] = useState15(null);
|
|
5919
|
+
const [saving, setSaving] = useState15(false);
|
|
5920
|
+
const [mutationError, setMutationError] = useState15(null);
|
|
5816
5921
|
const clientButtonRefs = useRef6({});
|
|
5817
5922
|
const backToClientsRef = useRef6(null);
|
|
5818
5923
|
const mobileFocusTarget = useRef6(null);
|
|
@@ -5831,7 +5936,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
5831
5936
|
else if (selectedClientId)
|
|
5832
5937
|
(_b = clientButtonRefs.current[selectedClientId]) == null ? void 0 : _b.focus();
|
|
5833
5938
|
}, [mobileDetail, selectedClientId]);
|
|
5834
|
-
const filteredClients =
|
|
5939
|
+
const filteredClients = useMemo5(() => {
|
|
5835
5940
|
const value = query.trim().toLowerCase();
|
|
5836
5941
|
return [...clients].sort((a, b) => a.name.localeCompare(b.name)).filter((client) => !value || client.name.toLowerCase().includes(value));
|
|
5837
5942
|
}, [clients, query]);
|
|
@@ -6000,8 +6105,8 @@ function SuiteClientsProjectsDirectory({
|
|
|
6000
6105
|
}
|
|
6001
6106
|
}
|
|
6002
6107
|
return /* @__PURE__ */ jsxs24("div", { "data-test": dataTest, className: "space-y-3", children: [
|
|
6003
|
-
error || mutationError ? /* @__PURE__ */
|
|
6004
|
-
loading ? /* @__PURE__ */
|
|
6108
|
+
error || mutationError ? /* @__PURE__ */ jsx30(Alert, { status: "danger", live: "assertive", children: error || mutationError }) : null,
|
|
6109
|
+
loading ? /* @__PURE__ */ jsx30("p", { className: "text-sm text-ph-mutedtext", children: "Loading directory..." }) : /* @__PURE__ */ jsxs24("div", { className: "overflow-hidden rounded-xl border border-ph-border bg-ph-surface lg:grid lg:min-h-[22rem] lg:grid-cols-[minmax(14rem,18rem)_1fr]", children: [
|
|
6005
6110
|
/* @__PURE__ */ jsxs24(
|
|
6006
6111
|
"section",
|
|
6007
6112
|
{
|
|
@@ -6012,14 +6117,14 @@ function SuiteClientsProjectsDirectory({
|
|
|
6012
6117
|
children: [
|
|
6013
6118
|
/* @__PURE__ */ jsxs24("div", { className: "flex h-14 items-center gap-2 border-b border-ph-border px-3", children: [
|
|
6014
6119
|
/* @__PURE__ */ jsxs24("div", { className: "relative min-w-0 flex-1", children: [
|
|
6015
|
-
/* @__PURE__ */
|
|
6120
|
+
/* @__PURE__ */ jsx30(
|
|
6016
6121
|
Search3,
|
|
6017
6122
|
{
|
|
6018
6123
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
6019
6124
|
"aria-hidden": true
|
|
6020
6125
|
}
|
|
6021
6126
|
),
|
|
6022
|
-
/* @__PURE__ */
|
|
6127
|
+
/* @__PURE__ */ jsx30(
|
|
6023
6128
|
Input,
|
|
6024
6129
|
{
|
|
6025
6130
|
hideLabel: true,
|
|
@@ -6031,18 +6136,18 @@ function SuiteClientsProjectsDirectory({
|
|
|
6031
6136
|
}
|
|
6032
6137
|
)
|
|
6033
6138
|
] }),
|
|
6034
|
-
canEdit && onCreateClient ? /* @__PURE__ */
|
|
6139
|
+
canEdit && onCreateClient ? /* @__PURE__ */ jsx30(
|
|
6035
6140
|
Button,
|
|
6036
6141
|
{
|
|
6037
6142
|
size: "sm",
|
|
6038
6143
|
variant: "primary",
|
|
6039
|
-
icon: /* @__PURE__ */
|
|
6144
|
+
icon: /* @__PURE__ */ jsx30(Plus2, { className: "h-4 w-4" }),
|
|
6040
6145
|
onClick: () => openNew("client"),
|
|
6041
6146
|
children: "New client"
|
|
6042
6147
|
}
|
|
6043
6148
|
) : null
|
|
6044
6149
|
] }),
|
|
6045
|
-
/* @__PURE__ */
|
|
6150
|
+
/* @__PURE__ */ jsx30(
|
|
6046
6151
|
"ul",
|
|
6047
6152
|
{
|
|
6048
6153
|
role: "listbox",
|
|
@@ -6053,7 +6158,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6053
6158
|
const count = projects.filter(
|
|
6054
6159
|
(project) => project.clientId === client.id
|
|
6055
6160
|
).length;
|
|
6056
|
-
return /* @__PURE__ */
|
|
6161
|
+
return /* @__PURE__ */ jsx30("li", { role: "none", children: /* @__PURE__ */ jsxs24(
|
|
6057
6162
|
"button",
|
|
6058
6163
|
{
|
|
6059
6164
|
type: "button",
|
|
@@ -6070,9 +6175,9 @@ function SuiteClientsProjectsDirectory({
|
|
|
6070
6175
|
selected ? "bg-ph-muted" : "hover:bg-ph-canvas"
|
|
6071
6176
|
),
|
|
6072
6177
|
children: [
|
|
6073
|
-
/* @__PURE__ */
|
|
6178
|
+
/* @__PURE__ */ jsx30(DirectoryIcon, { item: client }),
|
|
6074
6179
|
/* @__PURE__ */ jsxs24("span", { className: "min-w-0 flex-1", children: [
|
|
6075
|
-
/* @__PURE__ */
|
|
6180
|
+
/* @__PURE__ */ jsx30("span", { className: "block truncate text-sm font-medium text-ph-ink", children: client.name }),
|
|
6076
6181
|
/* @__PURE__ */ jsxs24("span", { className: "text-xs text-ph-mutedtext", children: [
|
|
6077
6182
|
count,
|
|
6078
6183
|
" project",
|
|
@@ -6082,7 +6187,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6082
6187
|
]
|
|
6083
6188
|
}
|
|
6084
6189
|
) }, client.id);
|
|
6085
|
-
}) : /* @__PURE__ */
|
|
6190
|
+
}) : /* @__PURE__ */ jsx30("li", { className: "px-3 py-8 text-center text-sm text-ph-mutedtext", children: clients.length ? "No matches." : "Add a client to get started." })
|
|
6086
6191
|
}
|
|
6087
6192
|
)
|
|
6088
6193
|
]
|
|
@@ -6096,8 +6201,8 @@ function SuiteClientsProjectsDirectory({
|
|
|
6096
6201
|
mobileDetail ? "flex" : "hidden lg:flex"
|
|
6097
6202
|
),
|
|
6098
6203
|
children: [
|
|
6099
|
-
/* @__PURE__ */
|
|
6100
|
-
/* @__PURE__ */
|
|
6204
|
+
/* @__PURE__ */ jsx30("div", { className: "flex min-h-14 items-center gap-2 border-b border-ph-border px-3 py-2", children: selectedClient ? /* @__PURE__ */ jsxs24(Fragment10, { children: [
|
|
6205
|
+
/* @__PURE__ */ jsx30(
|
|
6101
6206
|
"button",
|
|
6102
6207
|
{
|
|
6103
6208
|
type: "button",
|
|
@@ -6108,36 +6213,36 @@ function SuiteClientsProjectsDirectory({
|
|
|
6108
6213
|
setMobileDetail(false);
|
|
6109
6214
|
},
|
|
6110
6215
|
"aria-label": "Back to clients",
|
|
6111
|
-
children: /* @__PURE__ */
|
|
6216
|
+
children: /* @__PURE__ */ jsx30(ArrowLeft, { className: "h-4 w-4" })
|
|
6112
6217
|
}
|
|
6113
6218
|
),
|
|
6114
|
-
/* @__PURE__ */
|
|
6219
|
+
/* @__PURE__ */ jsx30(DirectoryIcon, { item: selectedClient }),
|
|
6115
6220
|
/* @__PURE__ */ jsxs24("div", { className: "min-w-0 flex-1", children: [
|
|
6116
|
-
/* @__PURE__ */
|
|
6221
|
+
/* @__PURE__ */ jsx30("h3", { className: "truncate text-sm font-semibold text-ph-ink", children: selectedClient.name }),
|
|
6117
6222
|
/* @__PURE__ */ jsxs24("p", { className: "text-xs text-ph-mutedtext", children: [
|
|
6118
6223
|
selectedProjects.length,
|
|
6119
6224
|
" project",
|
|
6120
6225
|
selectedProjects.length === 1 ? "" : "s"
|
|
6121
6226
|
] })
|
|
6122
6227
|
] }),
|
|
6123
|
-
canEdit && (onUpdateClient || onDeleteClient) ? /* @__PURE__ */
|
|
6228
|
+
canEdit && (onUpdateClient || onDeleteClient) ? /* @__PURE__ */ jsx30("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsx30(
|
|
6124
6229
|
DropdownMenu,
|
|
6125
6230
|
{
|
|
6126
6231
|
"aria-label": `Actions for ${selectedClient.name}`,
|
|
6127
6232
|
align: "end",
|
|
6128
6233
|
trigger: /* @__PURE__ */ jsxs24("span", { className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-ph-mutedtext hover:bg-ph-muted hover:text-ph-ink", children: [
|
|
6129
|
-
/* @__PURE__ */
|
|
6130
|
-
/* @__PURE__ */
|
|
6234
|
+
/* @__PURE__ */ jsx30(MoreHorizontal, { className: "h-4 w-4", "aria-hidden": true }),
|
|
6235
|
+
/* @__PURE__ */ jsx30("span", { className: "sr-only", children: "Client actions" })
|
|
6131
6236
|
] }),
|
|
6132
6237
|
children: /* @__PURE__ */ jsxs24("div", { className: "p-1", children: [
|
|
6133
|
-
onUpdateClient ? /* @__PURE__ */
|
|
6238
|
+
onUpdateClient ? /* @__PURE__ */ jsx30(
|
|
6134
6239
|
DropdownItem,
|
|
6135
6240
|
{
|
|
6136
6241
|
onClick: () => openEdit(selectedClient, "client"),
|
|
6137
6242
|
children: "Edit client"
|
|
6138
6243
|
}
|
|
6139
6244
|
) : null,
|
|
6140
|
-
onDeleteClient ? /* @__PURE__ */
|
|
6245
|
+
onDeleteClient ? /* @__PURE__ */ jsx30(
|
|
6141
6246
|
DropdownItem,
|
|
6142
6247
|
{
|
|
6143
6248
|
className: "text-red-600",
|
|
@@ -6148,17 +6253,17 @@ function SuiteClientsProjectsDirectory({
|
|
|
6148
6253
|
] })
|
|
6149
6254
|
}
|
|
6150
6255
|
) }) : null
|
|
6151
|
-
] }) : /* @__PURE__ */
|
|
6152
|
-
canEdit && onCreateProject ? /* @__PURE__ */
|
|
6256
|
+
] }) : /* @__PURE__ */ jsx30("p", { className: "text-sm text-ph-mutedtext", children: "Select a client" }) }),
|
|
6257
|
+
canEdit && onCreateProject ? /* @__PURE__ */ jsx30("div", { className: "border-b border-ph-border p-3", children: /* @__PURE__ */ jsx30(
|
|
6153
6258
|
Button,
|
|
6154
6259
|
{
|
|
6155
6260
|
variant: "primary",
|
|
6156
|
-
icon: /* @__PURE__ */
|
|
6261
|
+
icon: /* @__PURE__ */ jsx30(Plus2, { className: "h-4 w-4" }),
|
|
6157
6262
|
onClick: () => openNew("project"),
|
|
6158
6263
|
children: "Add project"
|
|
6159
6264
|
}
|
|
6160
6265
|
) }) : null,
|
|
6161
|
-
/* @__PURE__ */
|
|
6266
|
+
/* @__PURE__ */ jsx30("ul", { className: "flex-1 p-2", children: selectedClient && selectedProjects.length ? selectedProjects.map((project) => /* @__PURE__ */ jsx30("li", { children: /* @__PURE__ */ jsxs24(
|
|
6162
6267
|
"div",
|
|
6163
6268
|
{
|
|
6164
6269
|
className: "flex items-center gap-3 rounded-lg px-2 py-1 hover:bg-ph-canvas",
|
|
@@ -6171,9 +6276,9 @@ function SuiteClientsProjectsDirectory({
|
|
|
6171
6276
|
className: "flex min-w-0 flex-1 items-center gap-3 rounded-lg py-1 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-brand",
|
|
6172
6277
|
onClick: () => openEdit(project, "project"),
|
|
6173
6278
|
children: [
|
|
6174
|
-
/* @__PURE__ */
|
|
6279
|
+
/* @__PURE__ */ jsx30(DirectoryIcon, { item: project }),
|
|
6175
6280
|
/* @__PURE__ */ jsxs24("span", { className: "min-w-0 flex-1", children: [
|
|
6176
|
-
/* @__PURE__ */
|
|
6281
|
+
/* @__PURE__ */ jsx30(
|
|
6177
6282
|
"span",
|
|
6178
6283
|
{
|
|
6179
6284
|
className: cn(
|
|
@@ -6183,36 +6288,36 @@ function SuiteClientsProjectsDirectory({
|
|
|
6183
6288
|
children: project.name
|
|
6184
6289
|
}
|
|
6185
6290
|
),
|
|
6186
|
-
/* @__PURE__ */
|
|
6291
|
+
/* @__PURE__ */ jsx30("span", { className: "text-xs text-ph-mutedtext", children: project.isArchived ? "Archived" : "Active" })
|
|
6187
6292
|
] })
|
|
6188
6293
|
]
|
|
6189
6294
|
}
|
|
6190
6295
|
),
|
|
6191
|
-
canEdit && (onUpdateProject || onDeleteProject) ? /* @__PURE__ */
|
|
6296
|
+
canEdit && (onUpdateProject || onDeleteProject) ? /* @__PURE__ */ jsx30("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsx30(
|
|
6192
6297
|
DropdownMenu,
|
|
6193
6298
|
{
|
|
6194
6299
|
"aria-label": `Actions for ${project.name}`,
|
|
6195
6300
|
align: "end",
|
|
6196
6301
|
trigger: /* @__PURE__ */ jsxs24("span", { className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-ph-mutedtext hover:bg-ph-muted hover:text-ph-ink", children: [
|
|
6197
|
-
/* @__PURE__ */
|
|
6302
|
+
/* @__PURE__ */ jsx30(
|
|
6198
6303
|
MoreHorizontal,
|
|
6199
6304
|
{
|
|
6200
6305
|
className: "h-4 w-4",
|
|
6201
6306
|
"aria-hidden": true
|
|
6202
6307
|
}
|
|
6203
6308
|
),
|
|
6204
|
-
/* @__PURE__ */
|
|
6309
|
+
/* @__PURE__ */ jsx30("span", { className: "sr-only", children: "Project actions" })
|
|
6205
6310
|
] }),
|
|
6206
6311
|
children: /* @__PURE__ */ jsxs24("div", { className: "p-1", children: [
|
|
6207
6312
|
onUpdateProject ? /* @__PURE__ */ jsxs24(Fragment10, { children: [
|
|
6208
|
-
/* @__PURE__ */
|
|
6313
|
+
/* @__PURE__ */ jsx30(
|
|
6209
6314
|
DropdownItem,
|
|
6210
6315
|
{
|
|
6211
6316
|
onClick: () => openEdit(project, "project"),
|
|
6212
6317
|
children: "Edit project"
|
|
6213
6318
|
}
|
|
6214
6319
|
),
|
|
6215
|
-
/* @__PURE__ */
|
|
6320
|
+
/* @__PURE__ */ jsx30(
|
|
6216
6321
|
DropdownItem,
|
|
6217
6322
|
{
|
|
6218
6323
|
onClick: () => void toggleArchive(project),
|
|
@@ -6220,7 +6325,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6220
6325
|
}
|
|
6221
6326
|
)
|
|
6222
6327
|
] }) : null,
|
|
6223
|
-
onDeleteProject ? /* @__PURE__ */
|
|
6328
|
+
onDeleteProject ? /* @__PURE__ */ jsx30(
|
|
6224
6329
|
DropdownItem,
|
|
6225
6330
|
{
|
|
6226
6331
|
className: "text-red-600",
|
|
@@ -6233,20 +6338,20 @@ function SuiteClientsProjectsDirectory({
|
|
|
6233
6338
|
) }) : null
|
|
6234
6339
|
]
|
|
6235
6340
|
}
|
|
6236
|
-
) }, project.id)) : /* @__PURE__ */
|
|
6341
|
+
) }, project.id)) : /* @__PURE__ */ jsx30("li", { className: "px-3 py-8 text-center text-sm text-ph-mutedtext", children: selectedClient ? "No projects yet." : "Select a client to see its projects." }) })
|
|
6237
6342
|
]
|
|
6238
6343
|
}
|
|
6239
6344
|
)
|
|
6240
6345
|
] }),
|
|
6241
|
-
/* @__PURE__ */
|
|
6346
|
+
/* @__PURE__ */ jsx30(
|
|
6242
6347
|
Modal,
|
|
6243
6348
|
{
|
|
6244
6349
|
open: editing !== null,
|
|
6245
6350
|
onClose: closeEditor,
|
|
6246
6351
|
title: (editing == null ? void 0 : editing.kind.includes("project")) ? editing.kind === "new-project" ? "New project" : "Edit project" : (editing == null ? void 0 : editing.kind) === "new-client" ? "New client" : "Edit client",
|
|
6247
6352
|
footer: /* @__PURE__ */ jsxs24("div", { className: "flex justify-end gap-2", children: [
|
|
6248
|
-
/* @__PURE__ */
|
|
6249
|
-
/* @__PURE__ */
|
|
6353
|
+
/* @__PURE__ */ jsx30(Button, { variant: "tertiary", onClick: closeEditor, disabled: saving, children: "Cancel" }),
|
|
6354
|
+
/* @__PURE__ */ jsx30(
|
|
6250
6355
|
Button,
|
|
6251
6356
|
{
|
|
6252
6357
|
variant: "primary",
|
|
@@ -6257,7 +6362,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6257
6362
|
)
|
|
6258
6363
|
] }),
|
|
6259
6364
|
children: /* @__PURE__ */ jsxs24("div", { className: "space-y-3", children: [
|
|
6260
|
-
/* @__PURE__ */
|
|
6365
|
+
/* @__PURE__ */ jsx30(
|
|
6261
6366
|
Input,
|
|
6262
6367
|
{
|
|
6263
6368
|
label: "Name",
|
|
@@ -6266,7 +6371,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6266
6371
|
onChange: (event) => setDraft(__spreadProps(__spreadValues({}, draft), { name: event.target.value }))
|
|
6267
6372
|
}
|
|
6268
6373
|
),
|
|
6269
|
-
/* @__PURE__ */
|
|
6374
|
+
/* @__PURE__ */ jsx30(
|
|
6270
6375
|
DirectoryIconPicker,
|
|
6271
6376
|
{
|
|
6272
6377
|
preview,
|
|
@@ -6278,9 +6383,9 @@ function SuiteClientsProjectsDirectory({
|
|
|
6278
6383
|
}
|
|
6279
6384
|
),
|
|
6280
6385
|
/* @__PURE__ */ jsxs24("div", { children: [
|
|
6281
|
-
/* @__PURE__ */
|
|
6386
|
+
/* @__PURE__ */ jsx30("span", { className: "mb-1.5 block text-sm font-medium text-ph-ink", children: "Colour" }),
|
|
6282
6387
|
/* @__PURE__ */ jsxs24("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
6283
|
-
/* @__PURE__ */
|
|
6388
|
+
/* @__PURE__ */ jsx30(
|
|
6284
6389
|
"button",
|
|
6285
6390
|
{
|
|
6286
6391
|
type: "button",
|
|
@@ -6292,7 +6397,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6292
6397
|
"flex h-8 w-8 items-center justify-center rounded-full border border-ph-border bg-ph-surface text-ph-mutedtext ring-offset-2",
|
|
6293
6398
|
!draft.color && "ring-2 ring-ph-brand"
|
|
6294
6399
|
),
|
|
6295
|
-
children: /* @__PURE__ */
|
|
6400
|
+
children: /* @__PURE__ */ jsx30(Prohibition, { className: "h-4 w-4", "aria-hidden": true })
|
|
6296
6401
|
}
|
|
6297
6402
|
),
|
|
6298
6403
|
[
|
|
@@ -6303,7 +6408,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6303
6408
|
"#ef4444",
|
|
6304
6409
|
"#a855f7",
|
|
6305
6410
|
"#64748b"
|
|
6306
|
-
].map((color) => /* @__PURE__ */
|
|
6411
|
+
].map((color) => /* @__PURE__ */ jsx30(
|
|
6307
6412
|
"button",
|
|
6308
6413
|
{
|
|
6309
6414
|
type: "button",
|
|
@@ -6338,7 +6443,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6338
6443
|
},
|
|
6339
6444
|
title: "Custom colour",
|
|
6340
6445
|
children: [
|
|
6341
|
-
/* @__PURE__ */
|
|
6446
|
+
/* @__PURE__ */ jsx30("span", { className: "flex h-4 w-4 items-center justify-center rounded-full bg-ph-surface", children: [
|
|
6342
6447
|
"#6366f1",
|
|
6343
6448
|
"#0ea5e9",
|
|
6344
6449
|
"#10b981",
|
|
@@ -6346,14 +6451,14 @@ function SuiteClientsProjectsDirectory({
|
|
|
6346
6451
|
"#ef4444",
|
|
6347
6452
|
"#a855f7",
|
|
6348
6453
|
"#64748b"
|
|
6349
|
-
].includes(draft.color) ? /* @__PURE__ */
|
|
6454
|
+
].includes(draft.color) ? /* @__PURE__ */ jsx30(Plus2, { className: "h-3 w-3 text-ph-ink", "aria-hidden": true }) : /* @__PURE__ */ jsx30(
|
|
6350
6455
|
"span",
|
|
6351
6456
|
{
|
|
6352
6457
|
className: "h-2.5 w-2.5 rounded-full",
|
|
6353
6458
|
style: { backgroundColor: draft.color }
|
|
6354
6459
|
}
|
|
6355
6460
|
) }),
|
|
6356
|
-
/* @__PURE__ */
|
|
6461
|
+
/* @__PURE__ */ jsx30(
|
|
6357
6462
|
"input",
|
|
6358
6463
|
{
|
|
6359
6464
|
type: "color",
|
|
@@ -6375,13 +6480,13 @@ function SuiteClientsProjectsDirectory({
|
|
|
6375
6480
|
value: draftClientId != null ? draftClientId : "",
|
|
6376
6481
|
onChange: (event) => setDraftClientId(event.target.value || null),
|
|
6377
6482
|
children: [
|
|
6378
|
-
/* @__PURE__ */
|
|
6379
|
-
clients.map((client) => /* @__PURE__ */
|
|
6483
|
+
/* @__PURE__ */ jsx30("option", { value: "", children: "No client" }),
|
|
6484
|
+
clients.map((client) => /* @__PURE__ */ jsx30("option", { value: client.id, children: client.name }, client.id))
|
|
6380
6485
|
]
|
|
6381
6486
|
}
|
|
6382
6487
|
) : null,
|
|
6383
6488
|
(editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */ jsxs24("label", { className: "flex items-center gap-2 text-sm text-ph-ink", children: [
|
|
6384
|
-
/* @__PURE__ */
|
|
6489
|
+
/* @__PURE__ */ jsx30(
|
|
6385
6490
|
"input",
|
|
6386
6491
|
{
|
|
6387
6492
|
type: "checkbox",
|
|
@@ -6394,24 +6499,24 @@ function SuiteClientsProjectsDirectory({
|
|
|
6394
6499
|
] })
|
|
6395
6500
|
}
|
|
6396
6501
|
),
|
|
6397
|
-
libraryOpen ? /* @__PURE__ */
|
|
6502
|
+
libraryOpen ? /* @__PURE__ */ jsx30(
|
|
6398
6503
|
Modal,
|
|
6399
6504
|
{
|
|
6400
6505
|
open: true,
|
|
6401
6506
|
onClose: () => setLibraryOpen(false),
|
|
6402
6507
|
title: "Icon library",
|
|
6403
|
-
children: renderIconLibrary ? renderIconLibrary({ onPick: pickFromLibrary }) : /* @__PURE__ */
|
|
6508
|
+
children: renderIconLibrary ? renderIconLibrary({ onPick: pickFromLibrary }) : /* @__PURE__ */ jsx30(SuitePaletteLibrary, { onPick: pickFromLibrary })
|
|
6404
6509
|
}
|
|
6405
6510
|
) : null,
|
|
6406
|
-
/* @__PURE__ */
|
|
6511
|
+
/* @__PURE__ */ jsx30(
|
|
6407
6512
|
Modal,
|
|
6408
6513
|
{
|
|
6409
6514
|
open: confirming !== null,
|
|
6410
6515
|
onClose: () => setConfirming(null),
|
|
6411
6516
|
title: "Confirm deletion",
|
|
6412
6517
|
footer: /* @__PURE__ */ jsxs24("div", { className: "flex justify-end gap-2", children: [
|
|
6413
|
-
/* @__PURE__ */
|
|
6414
|
-
/* @__PURE__ */
|
|
6518
|
+
/* @__PURE__ */ jsx30(Button, { variant: "tertiary", onClick: () => setConfirming(null), children: "Cancel" }),
|
|
6519
|
+
/* @__PURE__ */ jsx30(Button, { variant: "primary", onClick: () => void confirmRemove(), children: "Delete" })
|
|
6415
6520
|
] }),
|
|
6416
6521
|
children: /* @__PURE__ */ jsxs24("p", { className: "text-sm text-ph-ink", children: [
|
|
6417
6522
|
"Delete ",
|
|
@@ -6444,6 +6549,7 @@ export {
|
|
|
6444
6549
|
SUITE_GLYPHS,
|
|
6445
6550
|
SUITE_ICON_NAMES,
|
|
6446
6551
|
SUITE_MUTATED_EVENT,
|
|
6552
|
+
SUITE_NOTIFICATIONS_POLL_MS,
|
|
6447
6553
|
SUITE_OPEN_ASK_AI_EVENT,
|
|
6448
6554
|
SUITE_SIDEBAR_WIDTH_COOKIE,
|
|
6449
6555
|
SUITE_SIDEBAR_WIDTH_KEY,
|
|
@@ -6466,6 +6572,7 @@ export {
|
|
|
6466
6572
|
SuiteMobileHeader,
|
|
6467
6573
|
SuiteMotionProvider,
|
|
6468
6574
|
SuiteNotificationBell,
|
|
6575
|
+
SuiteNotificationsProvider,
|
|
6469
6576
|
SuitePage,
|
|
6470
6577
|
SuitePageHeader,
|
|
6471
6578
|
SuitePaletteLibrary,
|
|
@@ -6521,5 +6628,6 @@ export {
|
|
|
6521
6628
|
suiteThemeBootScript,
|
|
6522
6629
|
useIdleMount,
|
|
6523
6630
|
useSidebarWidth,
|
|
6631
|
+
useSuiteNotifications,
|
|
6524
6632
|
useSuiteTheme
|
|
6525
6633
|
};
|