@xenide-io/the-old-ui-theme 0.9.12 → 0.9.14
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 +49 -4
- package/dist/suite.d.ts +49 -4
- package/dist/suite.js +892 -778
- package/dist/suite.mjs +617 -498
- package/package.json +1 -1
- package/src/app/globals.css +0 -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 +12 -8
- package/src/suite/components/suite-notification-bell.tsx +23 -170
- package/src/suite/index.ts +7 -5
- package/src/suite/lib/suite-notifications.tsx +282 -0
package/dist/suite.js
CHANGED
|
@@ -106,7 +106,7 @@ function SuiteAiMarkdownMessage({
|
|
|
106
106
|
markdown,
|
|
107
107
|
animate = false
|
|
108
108
|
}) {
|
|
109
|
-
return /* @__PURE__ */ (0,
|
|
109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "suite-ai-markdown", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
110
110
|
import_react_markdown.default,
|
|
111
111
|
{
|
|
112
112
|
remarkPlugins: [import_remark_gfm.default],
|
|
@@ -116,14 +116,14 @@ function SuiteAiMarkdownMessage({
|
|
|
116
116
|
}
|
|
117
117
|
) });
|
|
118
118
|
}
|
|
119
|
-
var import_react_markdown, import_remark_gfm,
|
|
119
|
+
var import_react_markdown, import_remark_gfm, import_jsx_runtime24, WORD_STEP_MS, MAX_DELAY_MS, SKIP_TAGS;
|
|
120
120
|
var init_ai_message_markdown = __esm({
|
|
121
121
|
"src/suite/components/ai-message-markdown.tsx"() {
|
|
122
122
|
"use strict";
|
|
123
123
|
"use client";
|
|
124
124
|
import_react_markdown = __toESM(require("react-markdown"));
|
|
125
125
|
import_remark_gfm = __toESM(require("remark-gfm"));
|
|
126
|
-
|
|
126
|
+
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
127
127
|
WORD_STEP_MS = 18;
|
|
128
128
|
MAX_DELAY_MS = 600;
|
|
129
129
|
SKIP_TAGS = /* @__PURE__ */ new Set(["code", "pre", "style", "script"]);
|
|
@@ -154,6 +154,7 @@ __export(suite_exports, {
|
|
|
154
154
|
SUITE_GLYPHS: () => SUITE_GLYPHS,
|
|
155
155
|
SUITE_ICON_NAMES: () => SUITE_ICON_NAMES,
|
|
156
156
|
SUITE_MUTATED_EVENT: () => SUITE_MUTATED_EVENT,
|
|
157
|
+
SUITE_NOTIFICATIONS_POLL_MS: () => SUITE_NOTIFICATIONS_POLL_MS,
|
|
157
158
|
SUITE_OPEN_ASK_AI_EVENT: () => SUITE_OPEN_ASK_AI_EVENT,
|
|
158
159
|
SUITE_SIDEBAR_WIDTH_COOKIE: () => SUITE_SIDEBAR_WIDTH_COOKIE,
|
|
159
160
|
SUITE_SIDEBAR_WIDTH_KEY: () => SUITE_SIDEBAR_WIDTH_KEY,
|
|
@@ -176,6 +177,7 @@ __export(suite_exports, {
|
|
|
176
177
|
SuiteMobileHeader: () => SuiteMobileHeader,
|
|
177
178
|
SuiteMotionProvider: () => SuiteMotionProvider,
|
|
178
179
|
SuiteNotificationBell: () => SuiteNotificationBell,
|
|
180
|
+
SuiteNotificationsProvider: () => SuiteNotificationsProvider,
|
|
179
181
|
SuitePage: () => SuitePage,
|
|
180
182
|
SuitePageHeader: () => SuitePageHeader,
|
|
181
183
|
SuitePaletteLibrary: () => SuitePaletteLibrary,
|
|
@@ -231,6 +233,7 @@ __export(suite_exports, {
|
|
|
231
233
|
suiteThemeBootScript: () => suiteThemeBootScript,
|
|
232
234
|
useIdleMount: () => useIdleMount,
|
|
233
235
|
useSidebarWidth: () => useSidebarWidth,
|
|
236
|
+
useSuiteNotifications: () => useSuiteNotifications,
|
|
234
237
|
useSuiteTheme: () => useSuiteTheme
|
|
235
238
|
});
|
|
236
239
|
module.exports = __toCommonJS(suite_exports);
|
|
@@ -1240,9 +1243,11 @@ function AppSwitcher({
|
|
|
1240
1243
|
}
|
|
1241
1244
|
|
|
1242
1245
|
// src/suite/components/suite-notification-bell.tsx
|
|
1246
|
+
var import_iconoir_react3 = require("iconoir-react");
|
|
1247
|
+
|
|
1248
|
+
// src/suite/lib/suite-notifications.tsx
|
|
1243
1249
|
var import_react2 = require("react");
|
|
1244
1250
|
var import_navigation = require("next/navigation");
|
|
1245
|
-
var import_iconoir_react3 = require("iconoir-react");
|
|
1246
1251
|
|
|
1247
1252
|
// src/suite/lib/apps.ts
|
|
1248
1253
|
var SUITE_APPS2 = [
|
|
@@ -1345,39 +1350,37 @@ function classifySuiteHref(href, bases, currentOrigin = "") {
|
|
|
1345
1350
|
return null;
|
|
1346
1351
|
}
|
|
1347
1352
|
|
|
1348
|
-
// src/suite/
|
|
1353
|
+
// src/suite/lib/suite-notifications.tsx
|
|
1349
1354
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1350
|
-
var
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
return `${Math.round(hrs / 24)}d ago`;
|
|
1355
|
+
var SUITE_NOTIFICATIONS_POLL_MS = 6e4;
|
|
1356
|
+
var SuiteNotificationsContext = (0, import_react2.createContext)(null);
|
|
1357
|
+
function useSuiteNotifications() {
|
|
1358
|
+
const value = (0, import_react2.useContext)(SuiteNotificationsContext);
|
|
1359
|
+
if (!value) {
|
|
1360
|
+
throw new Error(
|
|
1361
|
+
"useSuiteNotifications must be used within a SuiteNotificationsProvider"
|
|
1362
|
+
);
|
|
1363
|
+
}
|
|
1364
|
+
return value;
|
|
1361
1365
|
}
|
|
1362
|
-
function
|
|
1366
|
+
function SuiteNotificationsProvider({
|
|
1363
1367
|
fetchNotifications,
|
|
1364
1368
|
markRead,
|
|
1365
|
-
markAllRead,
|
|
1366
|
-
|
|
1369
|
+
markAllRead: markAllReadRequest,
|
|
1370
|
+
pollMs = SUITE_NOTIFICATIONS_POLL_MS,
|
|
1367
1371
|
cacheKey = "suite-notifications-cache",
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
triggerDataTest
|
|
1372
|
+
enabled = true,
|
|
1373
|
+
children
|
|
1371
1374
|
}) {
|
|
1372
1375
|
const router = (0, import_navigation.useRouter)();
|
|
1376
|
+
const [notifications, setNotifications] = (0, import_react2.useState)([]);
|
|
1377
|
+
const [unreadCount, setUnreadCount] = (0, import_react2.useState)(0);
|
|
1373
1378
|
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
1374
|
-
const [items, setItems] = (0, import_react2.useState)([]);
|
|
1375
|
-
const [unread, setUnread] = (0, import_react2.useState)(0);
|
|
1376
1379
|
const load = (0, import_react2.useCallback)(async () => {
|
|
1377
1380
|
try {
|
|
1378
1381
|
const data = await fetchNotifications();
|
|
1379
|
-
|
|
1380
|
-
|
|
1382
|
+
setNotifications(data.notifications);
|
|
1383
|
+
setUnreadCount(data.unread_count);
|
|
1381
1384
|
if (cacheKey) {
|
|
1382
1385
|
try {
|
|
1383
1386
|
sessionStorage.setItem(
|
|
@@ -1394,57 +1397,80 @@ function SuiteNotificationBell({
|
|
|
1394
1397
|
}
|
|
1395
1398
|
}, [fetchNotifications, cacheKey]);
|
|
1396
1399
|
(0, import_react2.useEffect)(() => {
|
|
1400
|
+
if (!enabled) return;
|
|
1397
1401
|
if (cacheKey) {
|
|
1398
1402
|
queueMicrotask(() => {
|
|
1399
1403
|
var _a2;
|
|
1400
1404
|
try {
|
|
1401
1405
|
const raw = sessionStorage.getItem(cacheKey);
|
|
1402
|
-
if (raw)
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
}
|
|
1406
|
+
if (!raw) return;
|
|
1407
|
+
const cached = JSON.parse(raw);
|
|
1408
|
+
if (Array.isArray(cached.notifications)) {
|
|
1409
|
+
setNotifications(cached.notifications);
|
|
1410
|
+
setUnreadCount((_a2 = cached.unread_count) != null ? _a2 : 0);
|
|
1408
1411
|
}
|
|
1409
1412
|
} catch (e) {
|
|
1410
1413
|
}
|
|
1411
1414
|
});
|
|
1412
1415
|
}
|
|
1413
|
-
|
|
1414
|
-
const
|
|
1416
|
+
let timer;
|
|
1417
|
+
const stop = () => {
|
|
1418
|
+
if (timer !== void 0) {
|
|
1419
|
+
window.clearInterval(timer);
|
|
1420
|
+
timer = void 0;
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
const start = () => {
|
|
1424
|
+
if (timer !== void 0) return;
|
|
1425
|
+
void load();
|
|
1426
|
+
timer = window.setInterval(() => void load(), pollMs);
|
|
1427
|
+
};
|
|
1428
|
+
const onVisibilityChange = () => {
|
|
1429
|
+
if (document.visibilityState === "visible") start();
|
|
1430
|
+
else stop();
|
|
1431
|
+
};
|
|
1432
|
+
if (document.visibilityState === "visible") start();
|
|
1433
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
1415
1434
|
return () => {
|
|
1416
|
-
|
|
1417
|
-
|
|
1435
|
+
stop();
|
|
1436
|
+
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
1418
1437
|
};
|
|
1419
|
-
}, [load, cacheKey]);
|
|
1420
|
-
const
|
|
1438
|
+
}, [enabled, load, pollMs, cacheKey]);
|
|
1439
|
+
const setOpenAndRefresh = (0, import_react2.useCallback)(
|
|
1421
1440
|
(next) => {
|
|
1422
1441
|
setOpen(next);
|
|
1423
1442
|
if (next) void load();
|
|
1424
1443
|
},
|
|
1425
1444
|
[load]
|
|
1426
1445
|
);
|
|
1427
|
-
const
|
|
1428
|
-
|
|
1446
|
+
const select = (0, import_react2.useCallback)(
|
|
1447
|
+
(notification) => {
|
|
1429
1448
|
setOpen(false);
|
|
1430
|
-
if (!
|
|
1431
|
-
|
|
1449
|
+
if (!notification.read_at) {
|
|
1450
|
+
setNotifications(
|
|
1432
1451
|
(prev) => prev.map(
|
|
1433
|
-
(
|
|
1452
|
+
(item) => item.id === notification.id ? __spreadProps(__spreadValues({}, item), { read_at: (/* @__PURE__ */ new Date()).toISOString() }) : item
|
|
1434
1453
|
)
|
|
1435
1454
|
);
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1455
|
+
setUnreadCount((count) => Math.max(0, count - 1));
|
|
1456
|
+
void (async () => {
|
|
1457
|
+
try {
|
|
1458
|
+
await markRead(notification.id);
|
|
1459
|
+
} catch (e) {
|
|
1460
|
+
}
|
|
1461
|
+
})();
|
|
1441
1462
|
}
|
|
1442
|
-
const target = resolveSuiteNotificationHref(
|
|
1463
|
+
const target = resolveSuiteNotificationHref(
|
|
1464
|
+
notification.href,
|
|
1465
|
+
notification.source_app
|
|
1466
|
+
);
|
|
1443
1467
|
if (!target) return;
|
|
1444
1468
|
if (/^https?:\/\//i.test(target)) {
|
|
1445
1469
|
try {
|
|
1446
1470
|
const url = new URL(target);
|
|
1447
|
-
const sourceApp = suiteAppSlugForNotificationSource(
|
|
1471
|
+
const sourceApp = suiteAppSlugForNotificationSource(
|
|
1472
|
+
notification.source_app
|
|
1473
|
+
);
|
|
1448
1474
|
const path = `${url.pathname}${url.search}${url.hash}`;
|
|
1449
1475
|
if (url.origin === window.location.origin) {
|
|
1450
1476
|
router.push(path);
|
|
@@ -1471,22 +1497,74 @@ function SuiteNotificationBell({
|
|
|
1471
1497
|
},
|
|
1472
1498
|
[router, markRead]
|
|
1473
1499
|
);
|
|
1474
|
-
const
|
|
1475
|
-
|
|
1476
|
-
(prev) => prev.map((
|
|
1500
|
+
const markAllRead = (0, import_react2.useCallback)(() => {
|
|
1501
|
+
setNotifications(
|
|
1502
|
+
(prev) => prev.map((item) => {
|
|
1477
1503
|
var _a2;
|
|
1478
|
-
return __spreadProps(__spreadValues({},
|
|
1479
|
-
read_at: (_a2 =
|
|
1504
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
1505
|
+
read_at: (_a2 = item.read_at) != null ? _a2 : (/* @__PURE__ */ new Date()).toISOString()
|
|
1480
1506
|
});
|
|
1481
1507
|
})
|
|
1482
1508
|
);
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1509
|
+
setUnreadCount(0);
|
|
1510
|
+
void (async () => {
|
|
1511
|
+
try {
|
|
1512
|
+
await markAllReadRequest();
|
|
1513
|
+
} catch (e) {
|
|
1514
|
+
}
|
|
1515
|
+
})();
|
|
1516
|
+
}, [markAllReadRequest]);
|
|
1517
|
+
const value = (0, import_react2.useMemo)(
|
|
1518
|
+
() => ({
|
|
1519
|
+
notifications,
|
|
1520
|
+
unreadCount,
|
|
1521
|
+
open,
|
|
1522
|
+
setOpen: setOpenAndRefresh,
|
|
1523
|
+
refresh: () => void load(),
|
|
1524
|
+
select,
|
|
1525
|
+
markAllRead
|
|
1526
|
+
}),
|
|
1527
|
+
[
|
|
1528
|
+
notifications,
|
|
1529
|
+
unreadCount,
|
|
1530
|
+
open,
|
|
1531
|
+
setOpenAndRefresh,
|
|
1532
|
+
load,
|
|
1533
|
+
select,
|
|
1534
|
+
markAllRead
|
|
1535
|
+
]
|
|
1536
|
+
);
|
|
1537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SuiteNotificationsContext.Provider, { value, children });
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
// src/suite/components/suite-notification-bell.tsx
|
|
1541
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1542
|
+
function timeAgo(iso) {
|
|
1543
|
+
const then = new Date(iso).getTime();
|
|
1544
|
+
if (Number.isNaN(then)) return "";
|
|
1545
|
+
const secs = Math.max(0, Math.round((Date.now() - then) / 1e3));
|
|
1546
|
+
if (secs < 60) return "just now";
|
|
1547
|
+
const mins = Math.round(secs / 60);
|
|
1548
|
+
if (mins < 60) return `${mins}m ago`;
|
|
1549
|
+
const hrs = Math.round(mins / 60);
|
|
1550
|
+
if (hrs < 24) return `${hrs}h ago`;
|
|
1551
|
+
return `${Math.round(hrs / 24)}d ago`;
|
|
1552
|
+
}
|
|
1553
|
+
function SuiteNotificationBell({
|
|
1554
|
+
dropdownMenu: DropdownMenu2,
|
|
1555
|
+
dataTest = "suite-notifications",
|
|
1556
|
+
triggerId,
|
|
1557
|
+
triggerDataTest
|
|
1558
|
+
}) {
|
|
1559
|
+
const {
|
|
1560
|
+
notifications,
|
|
1561
|
+
unreadCount: unread,
|
|
1562
|
+
open,
|
|
1563
|
+
setOpen,
|
|
1564
|
+
select,
|
|
1565
|
+
markAllRead
|
|
1566
|
+
} = useSuiteNotifications();
|
|
1567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1490
1568
|
DropdownMenu2,
|
|
1491
1569
|
{
|
|
1492
1570
|
"aria-label": unread > 0 ? `Notifications, ${unread} unread` : "Notifications",
|
|
@@ -1495,46 +1573,46 @@ function SuiteNotificationBell({
|
|
|
1495
1573
|
align: "end",
|
|
1496
1574
|
panelClassName: "w-80 overflow-hidden p-0",
|
|
1497
1575
|
open,
|
|
1498
|
-
onOpenChange,
|
|
1499
|
-
trigger: /* @__PURE__ */ (0,
|
|
1500
|
-
/* @__PURE__ */ (0,
|
|
1501
|
-
unread > 0 ? /* @__PURE__ */ (0,
|
|
1576
|
+
onOpenChange: setOpen,
|
|
1577
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("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__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "relative inline-flex h-5 w-5", children: [
|
|
1578
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_iconoir_react3.Bell, { className: "h-5 w-5", strokeWidth: 1.75, "aria-hidden": true }),
|
|
1579
|
+
unread > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("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
|
|
1502
1580
|
] }) }),
|
|
1503
1581
|
children: [
|
|
1504
|
-
/* @__PURE__ */ (0,
|
|
1505
|
-
/* @__PURE__ */ (0,
|
|
1506
|
-
unread > 0 ? /* @__PURE__ */ (0,
|
|
1582
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between border-b border-ph-border px-3 py-2", children: [
|
|
1583
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-sm font-semibold text-ph-ink", children: "Notifications" }),
|
|
1584
|
+
unread > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1507
1585
|
"button",
|
|
1508
1586
|
{
|
|
1509
1587
|
type: "button",
|
|
1510
1588
|
id: `${dataTest}-mark-all`,
|
|
1511
1589
|
"data-test": `${dataTest}-mark-all`,
|
|
1512
|
-
onClick:
|
|
1590
|
+
onClick: markAllRead,
|
|
1513
1591
|
className: "text-xs font-medium text-ph-brand hover:underline",
|
|
1514
1592
|
children: "Mark all read"
|
|
1515
1593
|
}
|
|
1516
1594
|
) : null
|
|
1517
1595
|
] }),
|
|
1518
|
-
/* @__PURE__ */ (0,
|
|
1596
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "max-h-80 overflow-y-auto py-1", children: notifications.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "px-3 py-6 text-center text-sm text-ph-mutedtext", children: "You're all caught up." }) : notifications.map((n) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1519
1597
|
"button",
|
|
1520
1598
|
{
|
|
1521
1599
|
id: `${dataTest}-item-${n.id}`,
|
|
1522
1600
|
"data-test": `${dataTest}-item-${n.id}`,
|
|
1523
|
-
onClick: () =>
|
|
1601
|
+
onClick: () => select(n),
|
|
1524
1602
|
className: "flex w-full flex-col gap-0.5 px-3 py-2 text-left transition hover:bg-ph-muted",
|
|
1525
1603
|
children: [
|
|
1526
|
-
/* @__PURE__ */ (0,
|
|
1527
|
-
!n.read_at ? /* @__PURE__ */ (0,
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
1605
|
+
!n.read_at ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1528
1606
|
"span",
|
|
1529
1607
|
{
|
|
1530
1608
|
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-ph-brand",
|
|
1531
1609
|
"aria-hidden": true
|
|
1532
1610
|
}
|
|
1533
1611
|
) : null,
|
|
1534
|
-
/* @__PURE__ */ (0,
|
|
1612
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "truncate text-sm font-medium text-ph-ink", children: n.title })
|
|
1535
1613
|
] }),
|
|
1536
|
-
n.body ? /* @__PURE__ */ (0,
|
|
1537
|
-
/* @__PURE__ */ (0,
|
|
1614
|
+
n.body ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "line-clamp-2 text-xs text-ph-mutedtext", children: n.body }) : null,
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "text-[11px] uppercase tracking-wide text-ph-subtle", children: [
|
|
1538
1616
|
n.source_app,
|
|
1539
1617
|
" \xB7 ",
|
|
1540
1618
|
timeAgo(n.created_at)
|
|
@@ -1550,7 +1628,7 @@ function SuiteNotificationBell({
|
|
|
1550
1628
|
|
|
1551
1629
|
// src/suite/components/command-palette-host.tsx
|
|
1552
1630
|
var import_react3 = require("react");
|
|
1553
|
-
var
|
|
1631
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1554
1632
|
function isEditableTarget() {
|
|
1555
1633
|
if (typeof document === "undefined") return false;
|
|
1556
1634
|
const el = document.activeElement;
|
|
@@ -1582,7 +1660,7 @@ function CommandPaletteHost({
|
|
|
1582
1660
|
return () => window.removeEventListener("keydown", onKey);
|
|
1583
1661
|
}, [open]);
|
|
1584
1662
|
if (!isAuthenticated) return null;
|
|
1585
|
-
return /* @__PURE__ */ (0,
|
|
1663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1586
1664
|
CommandPalette,
|
|
1587
1665
|
{
|
|
1588
1666
|
items,
|
|
@@ -1616,18 +1694,18 @@ function useIdleMount(timeoutMs = 1200) {
|
|
|
1616
1694
|
}
|
|
1617
1695
|
|
|
1618
1696
|
// src/suite/components/deferred-chrome.tsx
|
|
1619
|
-
var
|
|
1697
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1620
1698
|
function DeferredChrome({ children }) {
|
|
1621
1699
|
const ready = useIdleMount();
|
|
1622
1700
|
if (!ready) return null;
|
|
1623
|
-
return /* @__PURE__ */ (0,
|
|
1701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
|
|
1624
1702
|
}
|
|
1625
1703
|
|
|
1626
1704
|
// src/suite/components/suite-mobile-drawer.tsx
|
|
1627
1705
|
var Dialog = __toESM(require("@radix-ui/react-dialog"));
|
|
1628
1706
|
var import_react5 = require("react");
|
|
1629
1707
|
var import_iconoir_react4 = require("iconoir-react");
|
|
1630
|
-
var
|
|
1708
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1631
1709
|
function SuiteMobileDrawer({
|
|
1632
1710
|
open,
|
|
1633
1711
|
onClose,
|
|
@@ -1666,8 +1744,8 @@ function SuiteMobileDrawer({
|
|
|
1666
1744
|
return () => window.clearTimeout(timeout);
|
|
1667
1745
|
}, [open, durationMs]);
|
|
1668
1746
|
if (!rendered) return null;
|
|
1669
|
-
return /* @__PURE__ */ (0,
|
|
1670
|
-
/* @__PURE__ */ (0,
|
|
1747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Dialog.Root, { open, onOpenChange: (nextOpen) => !nextOpen && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Dialog.Portal, { forceMount: true, children: [
|
|
1748
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1671
1749
|
Dialog.Overlay,
|
|
1672
1750
|
{
|
|
1673
1751
|
forceMount: true,
|
|
@@ -1681,7 +1759,7 @@ function SuiteMobileDrawer({
|
|
|
1681
1759
|
style: { transitionDuration: `${durationMs}ms` }
|
|
1682
1760
|
}
|
|
1683
1761
|
),
|
|
1684
|
-
/* @__PURE__ */ (0,
|
|
1762
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Dialog.Content, { forceMount: true, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1685
1763
|
"aside",
|
|
1686
1764
|
{
|
|
1687
1765
|
role: "dialog",
|
|
@@ -1695,8 +1773,8 @@ function SuiteMobileDrawer({
|
|
|
1695
1773
|
),
|
|
1696
1774
|
style: { transitionDuration: `${durationMs}ms` },
|
|
1697
1775
|
children: [
|
|
1698
|
-
/* @__PURE__ */ (0,
|
|
1699
|
-
showCloseButton ? /* @__PURE__ */ (0,
|
|
1776
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Dialog.Title, { className: "sr-only", children: dialogLabel }),
|
|
1777
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1700
1778
|
"div",
|
|
1701
1779
|
{
|
|
1702
1780
|
className: cn(
|
|
@@ -1704,8 +1782,8 @@ function SuiteMobileDrawer({
|
|
|
1704
1782
|
title ? "justify-between" : "justify-end"
|
|
1705
1783
|
),
|
|
1706
1784
|
children: [
|
|
1707
|
-
title ? /* @__PURE__ */ (0,
|
|
1708
|
-
/* @__PURE__ */ (0,
|
|
1785
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "truncate text-sm font-semibold text-ph-ink", children: title }) : null,
|
|
1786
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1709
1787
|
"button",
|
|
1710
1788
|
{
|
|
1711
1789
|
type: "button",
|
|
@@ -1713,13 +1791,13 @@ function SuiteMobileDrawer({
|
|
|
1713
1791
|
"data-test": closeButtonDataTest,
|
|
1714
1792
|
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",
|
|
1715
1793
|
"aria-label": closeLabel,
|
|
1716
|
-
children: /* @__PURE__ */ (0,
|
|
1794
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_iconoir_react4.Xmark, { className: "h-4 w-4", "aria-hidden": true })
|
|
1717
1795
|
}
|
|
1718
1796
|
) })
|
|
1719
1797
|
]
|
|
1720
1798
|
}
|
|
1721
1799
|
) : null,
|
|
1722
|
-
/* @__PURE__ */ (0,
|
|
1800
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1723
1801
|
"div",
|
|
1724
1802
|
{
|
|
1725
1803
|
"data-test": "suite-mobile-drawer-body",
|
|
@@ -1735,7 +1813,7 @@ function SuiteMobileDrawer({
|
|
|
1735
1813
|
|
|
1736
1814
|
// src/suite/components/suite-mobile-header.tsx
|
|
1737
1815
|
var import_iconoir_react5 = require("iconoir-react");
|
|
1738
|
-
var
|
|
1816
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1739
1817
|
function SuiteMobileHeader({
|
|
1740
1818
|
onMenuClick,
|
|
1741
1819
|
menuIcon: MenuIcon = import_iconoir_react5.Menu,
|
|
@@ -1747,7 +1825,7 @@ function SuiteMobileHeader({
|
|
|
1747
1825
|
dataTest,
|
|
1748
1826
|
className
|
|
1749
1827
|
}) {
|
|
1750
|
-
return /* @__PURE__ */ (0,
|
|
1828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1751
1829
|
"header",
|
|
1752
1830
|
{
|
|
1753
1831
|
"data-test": dataTest,
|
|
@@ -1756,7 +1834,7 @@ function SuiteMobileHeader({
|
|
|
1756
1834
|
className
|
|
1757
1835
|
),
|
|
1758
1836
|
children: [
|
|
1759
|
-
onMenuClick ? /* @__PURE__ */ (0,
|
|
1837
|
+
onMenuClick ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1760
1838
|
"button",
|
|
1761
1839
|
{
|
|
1762
1840
|
type: "button",
|
|
@@ -1765,10 +1843,10 @@ function SuiteMobileHeader({
|
|
|
1765
1843
|
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",
|
|
1766
1844
|
onClick: onMenuClick,
|
|
1767
1845
|
"aria-label": menuLabel,
|
|
1768
|
-
children: /* @__PURE__ */ (0,
|
|
1846
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MenuIcon, { className: "h-5 w-5", "aria-hidden": true })
|
|
1769
1847
|
}
|
|
1770
1848
|
) : null,
|
|
1771
|
-
/* @__PURE__ */ (0,
|
|
1849
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1772
1850
|
"div",
|
|
1773
1851
|
{
|
|
1774
1852
|
className: cn(
|
|
@@ -1778,7 +1856,7 @@ function SuiteMobileHeader({
|
|
|
1778
1856
|
children: title
|
|
1779
1857
|
}
|
|
1780
1858
|
),
|
|
1781
|
-
actions ? /* @__PURE__ */ (0,
|
|
1859
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex shrink-0 items-center gap-1", children: actions }) : null
|
|
1782
1860
|
]
|
|
1783
1861
|
}
|
|
1784
1862
|
);
|
|
@@ -1786,20 +1864,20 @@ function SuiteMobileHeader({
|
|
|
1786
1864
|
|
|
1787
1865
|
// src/suite/components/suite-layout.tsx
|
|
1788
1866
|
var import_react6 = require("react");
|
|
1789
|
-
var
|
|
1867
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1790
1868
|
function SuiteBreadcrumbs({ items, className }) {
|
|
1791
|
-
return /* @__PURE__ */ (0,
|
|
1869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("nav", { "aria-label": "Breadcrumb", className, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ol", { className: "flex min-w-0 items-center gap-1.5", children: items.map((item, index) => {
|
|
1792
1870
|
const isLast = index === items.length - 1;
|
|
1793
|
-
return /* @__PURE__ */ (0,
|
|
1794
|
-
index > 0 ? /* @__PURE__ */ (0,
|
|
1795
|
-
item.href && !isLast ? /* @__PURE__ */ (0,
|
|
1871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("li", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
1872
|
+
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "select-none text-ph-border", "aria-hidden": "true", children: "/" }) : null,
|
|
1873
|
+
item.href && !isLast ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1796
1874
|
"a",
|
|
1797
1875
|
{
|
|
1798
1876
|
href: item.href,
|
|
1799
1877
|
className: "truncate transition hover:text-ph-ink",
|
|
1800
1878
|
children: item.label
|
|
1801
1879
|
}
|
|
1802
|
-
) : /* @__PURE__ */ (0,
|
|
1880
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1803
1881
|
"span",
|
|
1804
1882
|
{
|
|
1805
1883
|
className: cn(
|
|
@@ -1824,7 +1902,7 @@ function SuitePage({
|
|
|
1824
1902
|
role,
|
|
1825
1903
|
"aria-live": ariaLive
|
|
1826
1904
|
}) {
|
|
1827
|
-
return /* @__PURE__ */ (0,
|
|
1905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1828
1906
|
Component,
|
|
1829
1907
|
{
|
|
1830
1908
|
id,
|
|
@@ -1892,7 +1970,7 @@ function SuitePageHeader({
|
|
|
1892
1970
|
sentinel.remove();
|
|
1893
1971
|
};
|
|
1894
1972
|
}, [sticky]);
|
|
1895
|
-
const resolvedIcon = todayIcon ? /* @__PURE__ */ (0,
|
|
1973
|
+
const resolvedIcon = todayIcon ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1896
1974
|
TodayTimeIcon,
|
|
1897
1975
|
{
|
|
1898
1976
|
className: cn(
|
|
@@ -1901,7 +1979,7 @@ function SuitePageHeader({
|
|
|
1901
1979
|
)
|
|
1902
1980
|
}
|
|
1903
1981
|
) : icon;
|
|
1904
|
-
return /* @__PURE__ */ (0,
|
|
1982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1905
1983
|
"header",
|
|
1906
1984
|
{
|
|
1907
1985
|
ref: headerRef,
|
|
@@ -1914,11 +1992,11 @@ function SuitePageHeader({
|
|
|
1914
1992
|
className
|
|
1915
1993
|
),
|
|
1916
1994
|
children: [
|
|
1917
|
-
/* @__PURE__ */ (0,
|
|
1918
|
-
eyebrow ? /* @__PURE__ */ (0,
|
|
1919
|
-
breadcrumb ? /* @__PURE__ */ (0,
|
|
1920
|
-
/* @__PURE__ */ (0,
|
|
1921
|
-
resolvedIcon ? /* @__PURE__ */ (0,
|
|
1995
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1996
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mb-0.5 flex min-w-0 items-center gap-1.5 text-xs text-ph-subtle", children: eyebrow }) : null,
|
|
1997
|
+
breadcrumb ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mb-0.5 flex min-w-0 items-center gap-1.5 text-xs text-ph-subtle", children: breadcrumb }) : null,
|
|
1998
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
1999
|
+
resolvedIcon ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1922
2000
|
"div",
|
|
1923
2001
|
{
|
|
1924
2002
|
className: "hidden shrink-0 sm:flex sm:items-center [&_svg]:h-6 [&_svg]:w-6",
|
|
@@ -1926,8 +2004,8 @@ function SuitePageHeader({
|
|
|
1926
2004
|
children: resolvedIcon
|
|
1927
2005
|
}
|
|
1928
2006
|
) : null,
|
|
1929
|
-
/* @__PURE__ */ (0,
|
|
1930
|
-
/* @__PURE__ */ (0,
|
|
2007
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
2008
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1931
2009
|
"h1",
|
|
1932
2010
|
{
|
|
1933
2011
|
className: cn(
|
|
@@ -1937,10 +2015,10 @@ function SuitePageHeader({
|
|
|
1937
2015
|
children: title
|
|
1938
2016
|
}
|
|
1939
2017
|
),
|
|
1940
|
-
badge ? /* @__PURE__ */ (0,
|
|
2018
|
+
badge ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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
|
|
1941
2019
|
] })
|
|
1942
2020
|
] }),
|
|
1943
|
-
description ? /* @__PURE__ */ (0,
|
|
2021
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1944
2022
|
"div",
|
|
1945
2023
|
{
|
|
1946
2024
|
className: cn(
|
|
@@ -1951,7 +2029,7 @@ function SuitePageHeader({
|
|
|
1951
2029
|
}
|
|
1952
2030
|
) : null
|
|
1953
2031
|
] }),
|
|
1954
|
-
actions ? /* @__PURE__ */ (0,
|
|
2032
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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
|
|
1955
2033
|
]
|
|
1956
2034
|
}
|
|
1957
2035
|
);
|
|
@@ -1962,7 +2040,7 @@ function SuiteToolbar({
|
|
|
1962
2040
|
label = "Page tools",
|
|
1963
2041
|
dataTest
|
|
1964
2042
|
}) {
|
|
1965
|
-
return /* @__PURE__ */ (0,
|
|
2043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1966
2044
|
"div",
|
|
1967
2045
|
{
|
|
1968
2046
|
role: "toolbar",
|
|
@@ -1979,7 +2057,7 @@ function SuiteTabList({
|
|
|
1979
2057
|
label,
|
|
1980
2058
|
dataTest
|
|
1981
2059
|
}) {
|
|
1982
|
-
return /* @__PURE__ */ (0,
|
|
2060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1983
2061
|
"nav",
|
|
1984
2062
|
{
|
|
1985
2063
|
"aria-label": label,
|
|
@@ -1998,7 +2076,7 @@ function SuiteSectionHeader({
|
|
|
1998
2076
|
action,
|
|
1999
2077
|
className
|
|
2000
2078
|
}) {
|
|
2001
|
-
return /* @__PURE__ */ (0,
|
|
2079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2002
2080
|
"div",
|
|
2003
2081
|
{
|
|
2004
2082
|
className: cn(
|
|
@@ -2006,18 +2084,18 @@ function SuiteSectionHeader({
|
|
|
2006
2084
|
className
|
|
2007
2085
|
),
|
|
2008
2086
|
children: [
|
|
2009
|
-
/* @__PURE__ */ (0,
|
|
2010
|
-
/* @__PURE__ */ (0,
|
|
2011
|
-
description ? /* @__PURE__ */ (0,
|
|
2087
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "min-w-0", children: [
|
|
2088
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { className: "font-display text-balance text-lg font-semibold tracking-tight text-ph-ink sm:text-xl", children: title }),
|
|
2089
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mt-1 max-w-2xl text-pretty text-sm leading-5 text-ph-subtle", children: description }) : null
|
|
2012
2090
|
] }),
|
|
2013
|
-
action ? /* @__PURE__ */ (0,
|
|
2091
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex min-h-[44px] shrink-0 items-center", children: action }) : null
|
|
2014
2092
|
]
|
|
2015
2093
|
}
|
|
2016
2094
|
);
|
|
2017
2095
|
}
|
|
2018
2096
|
|
|
2019
2097
|
// src/suite/components/suite-settings-layout.tsx
|
|
2020
|
-
var
|
|
2098
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2021
2099
|
function SuiteSettingsLayout({
|
|
2022
2100
|
children,
|
|
2023
2101
|
sidebar,
|
|
@@ -2031,13 +2109,13 @@ function SuiteSettingsLayout({
|
|
|
2031
2109
|
className,
|
|
2032
2110
|
contentClassName
|
|
2033
2111
|
}) {
|
|
2034
|
-
return /* @__PURE__ */ (0,
|
|
2112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2035
2113
|
SuitePage,
|
|
2036
2114
|
{
|
|
2037
2115
|
dataTest,
|
|
2038
2116
|
className: cn("flex h-full flex-col overflow-hidden", className),
|
|
2039
2117
|
children: [
|
|
2040
|
-
header != null ? header : /* @__PURE__ */ (0,
|
|
2118
|
+
header != null ? header : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2041
2119
|
SuitePageHeader,
|
|
2042
2120
|
{
|
|
2043
2121
|
sticky: true,
|
|
@@ -2046,10 +2124,10 @@ function SuiteSettingsLayout({
|
|
|
2046
2124
|
description
|
|
2047
2125
|
}
|
|
2048
2126
|
),
|
|
2049
|
-
loading != null ? loading : /* @__PURE__ */ (0,
|
|
2050
|
-
mobileNav ? /* @__PURE__ */ (0,
|
|
2051
|
-
/* @__PURE__ */ (0,
|
|
2052
|
-
/* @__PURE__ */ (0,
|
|
2127
|
+
loading != null ? loading : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "suite-page-body mt-6 flex min-h-0 flex-1 flex-col", children: [
|
|
2128
|
+
mobileNav ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "sticky top-0 z-20 mb-2 shrink-0 bg-ph-canvas/95 backdrop-blur lg:hidden", children: mobileNav }) : null,
|
|
2129
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col gap-6 lg:flex-row lg:gap-8", children: [
|
|
2130
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2053
2131
|
"aside",
|
|
2054
2132
|
{
|
|
2055
2133
|
"aria-label": "Settings",
|
|
@@ -2057,7 +2135,7 @@ function SuiteSettingsLayout({
|
|
|
2057
2135
|
children: sidebar
|
|
2058
2136
|
}
|
|
2059
2137
|
),
|
|
2060
|
-
/* @__PURE__ */ (0,
|
|
2138
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2061
2139
|
"div",
|
|
2062
2140
|
{
|
|
2063
2141
|
className: cn(
|
|
@@ -2091,7 +2169,7 @@ function cn2(...parts) {
|
|
|
2091
2169
|
}
|
|
2092
2170
|
|
|
2093
2171
|
// src/components/icons/IconBase.tsx
|
|
2094
|
-
var
|
|
2172
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2095
2173
|
var IconBase = (0, import_react7.forwardRef)(function IconBase2(_a2, ref) {
|
|
2096
2174
|
var _b = _a2, {
|
|
2097
2175
|
className,
|
|
@@ -2121,7 +2199,7 @@ var IconBase = (0, import_react7.forwardRef)(function IconBase2(_a2, ref) {
|
|
|
2121
2199
|
"aria-labelledby"
|
|
2122
2200
|
]);
|
|
2123
2201
|
const hasAccessibleName = Boolean(ariaLabel || ariaLabelledBy);
|
|
2124
|
-
return /* @__PURE__ */ (0,
|
|
2202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2125
2203
|
"svg",
|
|
2126
2204
|
__spreadProps(__spreadValues({
|
|
2127
2205
|
ref,
|
|
@@ -2144,10 +2222,10 @@ IconBase.displayName = "IconBase";
|
|
|
2144
2222
|
|
|
2145
2223
|
// src/components/icons/createIconBase.tsx
|
|
2146
2224
|
var import_react8 = require("react");
|
|
2147
|
-
var
|
|
2225
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2148
2226
|
function createIconBase({ name = "IconGlyph", viewBox = "0 0 24 24", paths }) {
|
|
2149
2227
|
const IconGlyph = (0, import_react8.forwardRef)(function IconGlyph2(props, ref) {
|
|
2150
|
-
return /* @__PURE__ */ (0,
|
|
2228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconBase, __spreadProps(__spreadValues({ ref, viewBox }, props), { children: paths }));
|
|
2151
2229
|
});
|
|
2152
2230
|
IconGlyph.displayName = name;
|
|
2153
2231
|
return IconGlyph;
|
|
@@ -2156,14 +2234,14 @@ function createIconBasePath(d, viewBox = "0 0 24 24", name) {
|
|
|
2156
2234
|
return createIconBase({
|
|
2157
2235
|
name,
|
|
2158
2236
|
viewBox,
|
|
2159
|
-
paths: /* @__PURE__ */ (0,
|
|
2237
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d, fill: "currentColor" })
|
|
2160
2238
|
});
|
|
2161
2239
|
}
|
|
2162
2240
|
|
|
2163
2241
|
// src/components/icons/icons.tsx
|
|
2164
2242
|
var import_react9 = require("react");
|
|
2165
|
-
var
|
|
2166
|
-
var fill = (d) => /* @__PURE__ */ (0,
|
|
2243
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2244
|
+
var fill = (d) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d, fill: "currentColor" });
|
|
2167
2245
|
var IconAreaChart = createIconBase({
|
|
2168
2246
|
paths: fill("M3 20V7l4 3 5-7 5 4h4v13Zm5-3 4-5.5 7 5.45V9h-2.7l-3.9-3.125-4.95 6.95L5 11v3.6Z")
|
|
2169
2247
|
});
|
|
@@ -2204,7 +2282,7 @@ var IconFlare = createIconBase({
|
|
|
2204
2282
|
)
|
|
2205
2283
|
});
|
|
2206
2284
|
var IconSelectEvents = createIconBase({
|
|
2207
|
-
paths: /* @__PURE__ */ (0,
|
|
2285
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2208
2286
|
fill("M17.5 9L16.56 6.94L14.5 6L16.56 5.06L17.5 3L18.44 5.06L20.5 6L18.44 6.94L17.5 9Z"),
|
|
2209
2287
|
fill("M6 12.5L6.94 14.56L9 15.5L6.94 16.44L6 18.5L5.06 16.44L3 15.5L5.06 14.56L6 12.5Z"),
|
|
2210
2288
|
fill("M6 9L5.06 6.94L3 6L5.06 5.06L6 3L6.94 5.06L9 6L6.94 6.94L6 9Z"),
|
|
@@ -2262,9 +2340,9 @@ var IconRobot = createIconBase({
|
|
|
2262
2340
|
)
|
|
2263
2341
|
});
|
|
2264
2342
|
var IconExclamation = createIconBase({
|
|
2265
|
-
paths: /* @__PURE__ */ (0,
|
|
2266
|
-
/* @__PURE__ */ (0,
|
|
2267
|
-
/* @__PURE__ */ (0,
|
|
2343
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("g", { fill: "currentColor", children: [
|
|
2344
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "m12 21c1.1046 0 2-.8954 2-2s-.8954-2-2-2-2 .8954-2 2 .8954 2 2 2z" }),
|
|
2345
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "m10 3h4v12h-4z" })
|
|
2268
2346
|
] })
|
|
2269
2347
|
});
|
|
2270
2348
|
var IconErrorOutline = createIconBase({
|
|
@@ -2298,7 +2376,7 @@ var IconChevronLeft = createIconBasePath("M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10
|
|
|
2298
2376
|
var IconChevronRight = createIconBasePath("M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z");
|
|
2299
2377
|
var IconChevronDown = createIconBasePath("M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z");
|
|
2300
2378
|
var IconSubArrowRight = createIconBase({
|
|
2301
|
-
paths: /* @__PURE__ */ (0,
|
|
2379
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { transform: "translate(4 5.5)", children: fill("M2 0H0V10H12.01V13L16 9L12.01 5V8H2V0Z") })
|
|
2302
2380
|
});
|
|
2303
2381
|
var IconSearch = createIconBasePath(
|
|
2304
2382
|
"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"
|
|
@@ -2377,7 +2455,7 @@ var IconRocket = createIconBasePath(
|
|
|
2377
2455
|
);
|
|
2378
2456
|
var IconTerminal = createIconBase({
|
|
2379
2457
|
name: "IconTerminal",
|
|
2380
|
-
paths: /* @__PURE__ */ (0,
|
|
2458
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2381
2459
|
"path",
|
|
2382
2460
|
{
|
|
2383
2461
|
d: "M3 4v16h18V4H3zm2 2h14v12H5V6zm2 2.2L10.8 12 7 15.8 8.4 17.2l5.2-5.2-5.2-5.2L7 8.2zM13 17h5v-2h-5v2z",
|
|
@@ -2389,7 +2467,7 @@ var IconTerminal = createIconBase({
|
|
|
2389
2467
|
});
|
|
2390
2468
|
var IconOldWindow = createIconBase({
|
|
2391
2469
|
name: "IconOldWindow",
|
|
2392
|
-
paths: /* @__PURE__ */ (0,
|
|
2470
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2393
2471
|
"path",
|
|
2394
2472
|
{
|
|
2395
2473
|
d: "M3 3v18h18V3H3zm2 7v9h14v-9H5zm1-4h2v1H6V6zm3 0h2v1H9V6z",
|
|
@@ -2401,7 +2479,7 @@ var IconOldWindow = createIconBase({
|
|
|
2401
2479
|
});
|
|
2402
2480
|
var IconCommandCursor = createIconBase({
|
|
2403
2481
|
name: "IconCommandCursor",
|
|
2404
|
-
paths: /* @__PURE__ */ (0,
|
|
2482
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2405
2483
|
"path",
|
|
2406
2484
|
{
|
|
2407
2485
|
d: "M4 3v18h16V3H4zm2 2h12v14H6V5zm1.5 3.5L11 12l-3.5 3.5L9 17l5-5-5-5-1.5 1.5zM13 17h4v-2h-4v2z",
|
|
@@ -2413,7 +2491,7 @@ var IconCommandCursor = createIconBase({
|
|
|
2413
2491
|
});
|
|
2414
2492
|
var IconDataReel = createIconBase({
|
|
2415
2493
|
name: "IconDataReel",
|
|
2416
|
-
paths: /* @__PURE__ */ (0,
|
|
2494
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2417
2495
|
"path",
|
|
2418
2496
|
{
|
|
2419
2497
|
d: "M3 5v14h18V5H3zm2 2h14v10H5V7zm3 1a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm8 0a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM10 11h4v1.5h-4V11z",
|
|
@@ -2425,7 +2503,7 @@ var IconDataReel = createIconBase({
|
|
|
2425
2503
|
});
|
|
2426
2504
|
var IconCodePreview = createIconBase({
|
|
2427
2505
|
name: "IconCodePreview",
|
|
2428
|
-
paths: /* @__PURE__ */ (0,
|
|
2506
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2429
2507
|
"path",
|
|
2430
2508
|
{
|
|
2431
2509
|
d: "M3 3v15h18V3H3zm2 2h14v11H5V5zm3.5 2L5 10.5 8.5 14l1.4-1.4-2.1-2.1 2.1-2.1L8.5 7zm7 0-1.4 1.4 2.1 2.1-2.1 2.1 1.4 1.4 3.5-3.5L15.5 7zM9 20h6v2H9v-2z",
|
|
@@ -2437,7 +2515,7 @@ var IconCodePreview = createIconBase({
|
|
|
2437
2515
|
});
|
|
2438
2516
|
var IconInsightBoard = createIconBase({
|
|
2439
2517
|
name: "IconInsightBoard",
|
|
2440
|
-
paths: /* @__PURE__ */ (0,
|
|
2518
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2441
2519
|
"path",
|
|
2442
2520
|
{
|
|
2443
2521
|
d: "M3 3v18h18V3H3zm2 2h14v3H5V5zm0 5h6v9H5v-9zm8 0h6v4h-6v-4zm0 6h6v3h-6v-3zM6 6h2v1H6V6zm3 0h2v1H9V6z",
|
|
@@ -2449,14 +2527,14 @@ var IconInsightBoard = createIconBase({
|
|
|
2449
2527
|
});
|
|
2450
2528
|
var IconEventStream = createIconBase({
|
|
2451
2529
|
name: "IconEventStream",
|
|
2452
|
-
paths: /* @__PURE__ */ (0,
|
|
2453
|
-
/* @__PURE__ */ (0,
|
|
2530
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2531
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M5 4h2v16H5V4z", fill: "currentColor", opacity: "0.45" }),
|
|
2454
2532
|
fill("M6 3a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm0 8a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm5-6h10v2H11V5zm0 8h7v2h-7v-2zm0 5h10v2H11v-2z")
|
|
2455
2533
|
] })
|
|
2456
2534
|
});
|
|
2457
2535
|
var IconFeatureGate = createIconBase({
|
|
2458
2536
|
name: "IconFeatureGate",
|
|
2459
|
-
paths: /* @__PURE__ */ (0,
|
|
2537
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2460
2538
|
"path",
|
|
2461
2539
|
{
|
|
2462
2540
|
d: "M4 3h2v18H4V3zm3 2h12l-3 4 3 4H7V5zm4 1-2.2 4H12l-1 4 4.2-5H12l1-3h-2z",
|
|
@@ -2468,7 +2546,7 @@ var IconFeatureGate = createIconBase({
|
|
|
2468
2546
|
});
|
|
2469
2547
|
var IconReplayFrame = createIconBase({
|
|
2470
2548
|
name: "IconReplayFrame",
|
|
2471
|
-
paths: /* @__PURE__ */ (0,
|
|
2549
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2472
2550
|
"path",
|
|
2473
2551
|
{
|
|
2474
2552
|
d: "M3 3v18h18V3H3zm2 2h14v11H5V5zm5 2v7l6-3.5L10 7zm-5 11h9v1H5v-1zm11 0h3v1h-3v-1z",
|
|
@@ -2492,7 +2570,7 @@ var IconExperimentSplit = createIconBase({
|
|
|
2492
2570
|
});
|
|
2493
2571
|
var IconSurveyCard = createIconBase({
|
|
2494
2572
|
name: "IconSurveyCard",
|
|
2495
|
-
paths: /* @__PURE__ */ (0,
|
|
2573
|
+
paths: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2496
2574
|
"path",
|
|
2497
2575
|
{
|
|
2498
2576
|
d: "M3 3v18h18V3H3zm2 2h14v14H5V5zm2 2h7v2H7V7zm0 4h4v2H7v-2zm7-.4-2.5 2.5-1-1-1.4 1.4 2.4 2.4 3.9-3.9-1.4-1.4zM7 16h10v1H7v-1z",
|
|
@@ -2510,7 +2588,7 @@ var IconFlask = createIconBasePath(
|
|
|
2510
2588
|
);
|
|
2511
2589
|
var IconSpinner = (0, import_react9.forwardRef)(function IconSpinner2(_a2, ref) {
|
|
2512
2590
|
var _b = _a2, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2513
|
-
return /* @__PURE__ */ (0,
|
|
2591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconSync, __spreadValues({ ref, className: cn2("ph-icon-spin", className) }, props));
|
|
2514
2592
|
});
|
|
2515
2593
|
IconSpinner.displayName = "IconSpinner";
|
|
2516
2594
|
var CANONICAL_ICONS = {
|
|
@@ -2611,23 +2689,23 @@ for (const [name, Icon] of Object.entries(CANONICAL_ICONS)) {
|
|
|
2611
2689
|
var IconByName = (0, import_react9.forwardRef)(function IconByName2(_a2, ref) {
|
|
2612
2690
|
var _b = _a2, { name } = _b, props = __objRest(_b, ["name"]);
|
|
2613
2691
|
const Icon = PH_ICONS[name];
|
|
2614
|
-
return /* @__PURE__ */ (0,
|
|
2692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, __spreadValues({ ref }, props));
|
|
2615
2693
|
});
|
|
2616
2694
|
IconByName.displayName = "IconByName";
|
|
2617
2695
|
|
|
2618
2696
|
// src/components/ui/ButtonChrome.tsx
|
|
2619
|
-
var
|
|
2697
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2620
2698
|
function ButtonChrome({ label, icon, sideIcon, split }) {
|
|
2621
|
-
return /* @__PURE__ */ (0,
|
|
2622
|
-
icon != null ? /* @__PURE__ */ (0,
|
|
2623
|
-
label != null ? /* @__PURE__ */ (0,
|
|
2624
|
-
split ? /* @__PURE__ */ (0,
|
|
2625
|
-
sideIcon != null ? /* @__PURE__ */ (0,
|
|
2699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "ph-btn-chrome", children: [
|
|
2700
|
+
icon != null ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ph-btn-icon", children: icon }) : null,
|
|
2701
|
+
label != null ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ph-btn-label", children: label }) : null,
|
|
2702
|
+
split ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ph-btn-split-divider", "aria-hidden": true }) : null,
|
|
2703
|
+
sideIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "ph-btn-side-icon", children: sideIcon }) : null
|
|
2626
2704
|
] });
|
|
2627
2705
|
}
|
|
2628
2706
|
|
|
2629
2707
|
// src/components/ui/DropdownMenu.tsx
|
|
2630
|
-
var
|
|
2708
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2631
2709
|
function DropdownContent({
|
|
2632
2710
|
children,
|
|
2633
2711
|
align = "start",
|
|
@@ -2638,7 +2716,7 @@ function DropdownContent({
|
|
|
2638
2716
|
avoidCollisions = true,
|
|
2639
2717
|
panelClassName
|
|
2640
2718
|
}) {
|
|
2641
|
-
return /* @__PURE__ */ (0,
|
|
2719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2642
2720
|
DropdownPrimitive.Content,
|
|
2643
2721
|
{
|
|
2644
2722
|
className: cn2("ph-dropdown-panel", panelClassName),
|
|
@@ -2651,7 +2729,7 @@ function DropdownContent({
|
|
|
2651
2729
|
sticky: "partial",
|
|
2652
2730
|
children: [
|
|
2653
2731
|
children,
|
|
2654
|
-
/* @__PURE__ */ (0,
|
|
2732
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2655
2733
|
DropdownPrimitive.Arrow,
|
|
2656
2734
|
{
|
|
2657
2735
|
className: "ph-dropdown-arrow",
|
|
@@ -2703,7 +2781,7 @@ function DropdownMenu(_a2) {
|
|
|
2703
2781
|
"modal",
|
|
2704
2782
|
"disabled"
|
|
2705
2783
|
]);
|
|
2706
|
-
return /* @__PURE__ */ (0,
|
|
2784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", __spreadProps(__spreadValues({ className: cn2("ph-dropdown", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2707
2785
|
DropdownPrimitive.Root,
|
|
2708
2786
|
{
|
|
2709
2787
|
open,
|
|
@@ -2711,7 +2789,7 @@ function DropdownMenu(_a2) {
|
|
|
2711
2789
|
onOpenChange,
|
|
2712
2790
|
modal,
|
|
2713
2791
|
children: [
|
|
2714
|
-
/* @__PURE__ */ (0,
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2715
2793
|
"button",
|
|
2716
2794
|
{
|
|
2717
2795
|
type: "button",
|
|
@@ -2722,7 +2800,7 @@ function DropdownMenu(_a2) {
|
|
|
2722
2800
|
children: trigger
|
|
2723
2801
|
}
|
|
2724
2802
|
) }),
|
|
2725
|
-
/* @__PURE__ */ (0,
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2726
2804
|
DropdownContent,
|
|
2727
2805
|
{
|
|
2728
2806
|
align,
|
|
@@ -2749,7 +2827,7 @@ function DropdownItem(_a2) {
|
|
|
2749
2827
|
"children",
|
|
2750
2828
|
"disabled"
|
|
2751
2829
|
]);
|
|
2752
|
-
return /* @__PURE__ */ (0,
|
|
2830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownPrimitive.Item, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2753
2831
|
"button",
|
|
2754
2832
|
__spreadProps(__spreadValues({
|
|
2755
2833
|
type: "button",
|
|
@@ -2762,7 +2840,7 @@ function DropdownItem(_a2) {
|
|
|
2762
2840
|
}
|
|
2763
2841
|
|
|
2764
2842
|
// src/suite/components/suite-user-menu.tsx
|
|
2765
|
-
var
|
|
2843
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2766
2844
|
function computeInitials(name, email) {
|
|
2767
2845
|
const source = (name || email || "?").trim();
|
|
2768
2846
|
return source.split(/[\s@]+/).filter(Boolean).slice(0, 2).map((part) => part[0]).join("").toUpperCase();
|
|
@@ -2800,7 +2878,7 @@ function SuiteUserMenu({
|
|
|
2800
2878
|
const router = (0, import_navigation2.useRouter)();
|
|
2801
2879
|
const initials = fallbackInitials != null ? fallbackInitials : computeInitials(name, email);
|
|
2802
2880
|
const fallbackColor = avatarColorClass(email || name || "?");
|
|
2803
|
-
const avatar = /* @__PURE__ */ (0,
|
|
2881
|
+
const avatar = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "inline-flex h-10 w-10 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "inline-flex h-8 w-8 items-center justify-center overflow-hidden rounded-full border border-ph-border", children: image ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2804
2882
|
import_image2.default,
|
|
2805
2883
|
{
|
|
2806
2884
|
src: image,
|
|
@@ -2810,7 +2888,7 @@ function SuiteUserMenu({
|
|
|
2810
2888
|
className: "h-full w-full object-cover",
|
|
2811
2889
|
unoptimized: true
|
|
2812
2890
|
}
|
|
2813
|
-
) : /* @__PURE__ */ (0,
|
|
2891
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2814
2892
|
"span",
|
|
2815
2893
|
{
|
|
2816
2894
|
className: cn(
|
|
@@ -2820,14 +2898,14 @@ function SuiteUserMenu({
|
|
|
2820
2898
|
children: initials
|
|
2821
2899
|
}
|
|
2822
2900
|
) }) });
|
|
2823
|
-
const trigger = showDetails ? /* @__PURE__ */ (0,
|
|
2901
|
+
const trigger = showDetails ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2824
2902
|
avatar,
|
|
2825
|
-
/* @__PURE__ */ (0,
|
|
2826
|
-
/* @__PURE__ */ (0,
|
|
2827
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
2903
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "flex min-w-0 flex-col text-left", children: [
|
|
2904
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "truncate text-sm font-medium text-ph-ink", children: name || email || "Account" }),
|
|
2905
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "truncate text-xs text-ph-mutedtext", children: subtitle }) : null
|
|
2828
2906
|
] })
|
|
2829
2907
|
] }) : avatar;
|
|
2830
|
-
const accountMenu = /* @__PURE__ */ (0,
|
|
2908
|
+
const accountMenu = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2831
2909
|
DropdownMenu,
|
|
2832
2910
|
{
|
|
2833
2911
|
trigger,
|
|
@@ -2846,24 +2924,24 @@ function SuiteUserMenu({
|
|
|
2846
2924
|
),
|
|
2847
2925
|
"data-test": dataTest,
|
|
2848
2926
|
children: [
|
|
2849
|
-
/* @__PURE__ */ (0,
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
2851
|
-
email ? /* @__PURE__ */ (0,
|
|
2927
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "px-2 py-1.5", children: [
|
|
2928
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-sm font-medium text-ph-ink", children: name || email || "Account" }),
|
|
2929
|
+
email ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-xs text-ph-mutedtext", children: email }) : null
|
|
2852
2930
|
] }),
|
|
2853
|
-
/* @__PURE__ */ (0,
|
|
2854
|
-
/* @__PURE__ */ (0,
|
|
2931
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "my-1 border-t border-ph-border" }),
|
|
2932
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2855
2933
|
DropdownItem,
|
|
2856
2934
|
{
|
|
2857
2935
|
"data-test": `${dataTest}-settings`,
|
|
2858
2936
|
onClick: () => router.push(settingsHref),
|
|
2859
2937
|
children: [
|
|
2860
|
-
/* @__PURE__ */ (0,
|
|
2938
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_iconoir_react6.Settings, { className: "h-4 w-4 text-ph-mutedtext", "aria-hidden": true }),
|
|
2861
2939
|
"Profile settings"
|
|
2862
2940
|
]
|
|
2863
2941
|
}
|
|
2864
2942
|
),
|
|
2865
|
-
/* @__PURE__ */ (0,
|
|
2866
|
-
/* @__PURE__ */ (0,
|
|
2943
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(DropdownItem, { "data-test": `${dataTest}-sign-out`, onClick: onSignOut, children: [
|
|
2944
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_iconoir_react6.LogOut, { className: "h-4 w-4 text-ph-mutedtext", "aria-hidden": true }),
|
|
2867
2945
|
"Sign out"
|
|
2868
2946
|
] })
|
|
2869
2947
|
]
|
|
@@ -2872,7 +2950,7 @@ function SuiteUserMenu({
|
|
|
2872
2950
|
if (!showSignOutAction) {
|
|
2873
2951
|
return accountMenu;
|
|
2874
2952
|
}
|
|
2875
|
-
return /* @__PURE__ */ (0,
|
|
2953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2876
2954
|
"div",
|
|
2877
2955
|
{
|
|
2878
2956
|
className: cn(
|
|
@@ -2880,8 +2958,8 @@ function SuiteUserMenu({
|
|
|
2880
2958
|
className
|
|
2881
2959
|
),
|
|
2882
2960
|
children: [
|
|
2883
|
-
/* @__PURE__ */ (0,
|
|
2884
|
-
/* @__PURE__ */ (0,
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "shrink-0", children: accountMenu }),
|
|
2962
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2885
2963
|
"button",
|
|
2886
2964
|
{
|
|
2887
2965
|
type: "button",
|
|
@@ -2890,7 +2968,7 @@ function SuiteUserMenu({
|
|
|
2890
2968
|
"aria-label": "Sign out",
|
|
2891
2969
|
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",
|
|
2892
2970
|
onClick: onSignOut,
|
|
2893
|
-
children: /* @__PURE__ */ (0,
|
|
2971
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_iconoir_react6.LogOut, { className: "h-4 w-4", "aria-hidden": true })
|
|
2894
2972
|
}
|
|
2895
2973
|
)
|
|
2896
2974
|
]
|
|
@@ -2900,7 +2978,7 @@ function SuiteUserMenu({
|
|
|
2900
2978
|
|
|
2901
2979
|
// src/suite/components/suite-bottom-nav.tsx
|
|
2902
2980
|
var import_link = __toESM(require("next/link"));
|
|
2903
|
-
var
|
|
2981
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2904
2982
|
function SuiteBottomNav({
|
|
2905
2983
|
items,
|
|
2906
2984
|
ariaLabel = "Primary navigation",
|
|
@@ -2913,8 +2991,8 @@ function SuiteBottomNav({
|
|
|
2913
2991
|
);
|
|
2914
2992
|
}
|
|
2915
2993
|
const activeIndex = items.findIndex((item) => item.active);
|
|
2916
|
-
return /* @__PURE__ */ (0,
|
|
2917
|
-
/* @__PURE__ */ (0,
|
|
2994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2995
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2918
2996
|
"div",
|
|
2919
2997
|
{
|
|
2920
2998
|
"aria-hidden": true,
|
|
@@ -2922,7 +3000,7 @@ function SuiteBottomNav({
|
|
|
2922
3000
|
style: { height: "calc(60px + env(safe-area-inset-bottom))" }
|
|
2923
3001
|
}
|
|
2924
3002
|
),
|
|
2925
|
-
/* @__PURE__ */ (0,
|
|
3003
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2926
3004
|
"nav",
|
|
2927
3005
|
{
|
|
2928
3006
|
"aria-label": ariaLabel,
|
|
@@ -2937,12 +3015,12 @@ function SuiteBottomNav({
|
|
|
2937
3015
|
"--suite-nav-active": activeIndex >= 0 ? activeIndex : 0
|
|
2938
3016
|
},
|
|
2939
3017
|
children: [
|
|
2940
|
-
activeIndex >= 0 ? /* @__PURE__ */ (0,
|
|
3018
|
+
activeIndex >= 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { "aria-hidden": true, className: "suite-bottom-nav__indicator" }) : null,
|
|
2941
3019
|
items.map((item) => {
|
|
2942
3020
|
var _a2;
|
|
2943
3021
|
const Icon = item.icon;
|
|
2944
3022
|
const active = Boolean(item.active);
|
|
2945
|
-
return /* @__PURE__ */ (0,
|
|
3023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2946
3024
|
import_link.default,
|
|
2947
3025
|
{
|
|
2948
3026
|
href: item.href,
|
|
@@ -2954,14 +3032,14 @@ function SuiteBottomNav({
|
|
|
2954
3032
|
active && "font-semibold text-ph-brand"
|
|
2955
3033
|
),
|
|
2956
3034
|
children: [
|
|
2957
|
-
/* @__PURE__ */ (0,
|
|
3035
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2958
3036
|
"span",
|
|
2959
3037
|
{
|
|
2960
3038
|
className: cn(
|
|
2961
3039
|
"suite-bottom-nav__icon relative z-10 inline-flex items-center justify-center",
|
|
2962
3040
|
active && "suite-bottom-nav__icon--active"
|
|
2963
3041
|
),
|
|
2964
|
-
children: /* @__PURE__ */ (0,
|
|
3042
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2965
3043
|
Icon,
|
|
2966
3044
|
{
|
|
2967
3045
|
className: "h-6 w-6",
|
|
@@ -2971,7 +3049,7 @@ function SuiteBottomNav({
|
|
|
2971
3049
|
)
|
|
2972
3050
|
}
|
|
2973
3051
|
),
|
|
2974
|
-
/* @__PURE__ */ (0,
|
|
3052
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "relative z-10 max-w-full truncate", children: item.label })
|
|
2975
3053
|
]
|
|
2976
3054
|
},
|
|
2977
3055
|
item.href
|
|
@@ -2985,7 +3063,7 @@ function SuiteBottomNav({
|
|
|
2985
3063
|
|
|
2986
3064
|
// src/suite/components/today-calibrating.tsx
|
|
2987
3065
|
var import_iconoir_react7 = require("iconoir-react");
|
|
2988
|
-
var
|
|
3066
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2989
3067
|
function TodayCalibrating({
|
|
2990
3068
|
onRetry,
|
|
2991
3069
|
retrying = false,
|
|
@@ -2995,7 +3073,7 @@ function TodayCalibrating({
|
|
|
2995
3073
|
retrySpinnerClassName = "text-ph-brand"
|
|
2996
3074
|
}) {
|
|
2997
3075
|
void _variant;
|
|
2998
|
-
return /* @__PURE__ */ (0,
|
|
3076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2999
3077
|
"div",
|
|
3000
3078
|
{
|
|
3001
3079
|
className: cn(
|
|
@@ -3004,18 +3082,18 @@ function TodayCalibrating({
|
|
|
3004
3082
|
),
|
|
3005
3083
|
"data-test": "today-calibrating",
|
|
3006
3084
|
children: [
|
|
3007
|
-
/* @__PURE__ */ (0,
|
|
3085
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3008
3086
|
"div",
|
|
3009
3087
|
{
|
|
3010
3088
|
className: "pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_35%,rgba(251,191,36,0.1),transparent_55%)]",
|
|
3011
3089
|
"aria-hidden": true
|
|
3012
3090
|
}
|
|
3013
3091
|
),
|
|
3014
|
-
/* @__PURE__ */ (0,
|
|
3015
|
-
/* @__PURE__ */ (0,
|
|
3016
|
-
/* @__PURE__ */ (0,
|
|
3017
|
-
/* @__PURE__ */ (0,
|
|
3018
|
-
onRetry ? /* @__PURE__ */ (0,
|
|
3092
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("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__ */ (0, import_jsx_runtime21.jsx)(import_iconoir_react7.SunLight, { className: "h-8 w-8", strokeWidth: 2, "aria-hidden": true }) }),
|
|
3093
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className: "relative text-base font-semibold tracking-tight text-ph-ink sm:text-lg md:text-xl", children: "Calibrating your day" }),
|
|
3094
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("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" }),
|
|
3095
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "relative mt-5 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Spinner, { size: "sm", className: "opacity-70", label: "Loading today" }) }),
|
|
3096
|
+
onRetry ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3019
3097
|
"button",
|
|
3020
3098
|
{
|
|
3021
3099
|
type: "button",
|
|
@@ -3023,7 +3101,7 @@ function TodayCalibrating({
|
|
|
3023
3101
|
disabled: retrying,
|
|
3024
3102
|
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",
|
|
3025
3103
|
children: [
|
|
3026
|
-
retrying ? /* @__PURE__ */ (0,
|
|
3104
|
+
retrying ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Spinner, { size: "sm", className: retrySpinnerClassName }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_iconoir_react7.Refresh, { className: "h-4 w-4", "aria-hidden": true }),
|
|
3027
3105
|
"Try again"
|
|
3028
3106
|
]
|
|
3029
3107
|
}
|
|
@@ -3087,7 +3165,7 @@ var SUITE_THEME_COOKIE = "xenide-suite-theme";
|
|
|
3087
3165
|
var SUITE_THEME_CHANNEL = "xenide-suite-theme";
|
|
3088
3166
|
|
|
3089
3167
|
// src/suite/components/theme-provider.tsx
|
|
3090
|
-
var
|
|
3168
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3091
3169
|
var SuiteThemeContext = (0, import_react10.createContext)(null);
|
|
3092
3170
|
var suiteThemeChannel = null;
|
|
3093
3171
|
function broadcastTheme(theme) {
|
|
@@ -3256,7 +3334,7 @@ function SuiteThemeProvider({
|
|
|
3256
3334
|
() => ({ theme: state.theme, resolvedTheme: state.resolvedTheme, setTheme, toggleTheme }),
|
|
3257
3335
|
[state.theme, state.resolvedTheme, setTheme, toggleTheme]
|
|
3258
3336
|
);
|
|
3259
|
-
return /* @__PURE__ */ (0,
|
|
3337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SuiteThemeContext.Provider, { value, children });
|
|
3260
3338
|
}
|
|
3261
3339
|
function useSuiteTheme() {
|
|
3262
3340
|
const ctx = (0, import_react10.useContext)(SuiteThemeContext);
|
|
@@ -3283,7 +3361,7 @@ var import_iconoir_react8 = require("iconoir-react");
|
|
|
3283
3361
|
// src/components/ui/Tooltip.tsx
|
|
3284
3362
|
var import_react11 = require("react");
|
|
3285
3363
|
var import_react_dom = require("react-dom");
|
|
3286
|
-
var
|
|
3364
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3287
3365
|
var TooltipDelayContext = (0, import_react11.createContext)(0);
|
|
3288
3366
|
function tooltipPosition(trigger, content, side, align, offset, collisionPadding) {
|
|
3289
3367
|
const horizontal = align === "start" ? trigger.left : align === "end" ? trigger.right : trigger.left + trigger.width / 2;
|
|
@@ -3376,8 +3454,8 @@ function Tooltip({
|
|
|
3376
3454
|
(0, import_react11.useEffect)(() => () => clearTimer(), []);
|
|
3377
3455
|
const describedBy = [children.props["aria-describedby"], tooltipId].filter(Boolean).join(" ");
|
|
3378
3456
|
const trigger = (0, import_react11.cloneElement)(children, { "aria-describedby": describedBy });
|
|
3379
|
-
return /* @__PURE__ */ (0,
|
|
3380
|
-
/* @__PURE__ */ (0,
|
|
3457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
3458
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3381
3459
|
"span",
|
|
3382
3460
|
{
|
|
3383
3461
|
ref: triggerRef,
|
|
@@ -3393,12 +3471,12 @@ function Tooltip({
|
|
|
3393
3471
|
}
|
|
3394
3472
|
),
|
|
3395
3473
|
isOpen && typeof document !== "undefined" ? (0, import_react_dom.createPortal)(
|
|
3396
|
-
/* @__PURE__ */ (0,
|
|
3474
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3397
3475
|
"span",
|
|
3398
3476
|
{
|
|
3399
3477
|
style: __spreadProps(__spreadValues({ position: "fixed" }, position), { visibility: position ? void 0 : "hidden" }),
|
|
3400
3478
|
className: "pointer-events-none z-[200]",
|
|
3401
|
-
children: /* @__PURE__ */ (0,
|
|
3479
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3402
3480
|
"span",
|
|
3403
3481
|
{
|
|
3404
3482
|
ref: contentRef,
|
|
@@ -3423,7 +3501,7 @@ function Tooltip({
|
|
|
3423
3501
|
}
|
|
3424
3502
|
|
|
3425
3503
|
// src/suite/components/ai-panel.tsx
|
|
3426
|
-
var
|
|
3504
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3427
3505
|
var SuiteAiMarkdownMessage2 = (0, import_react12.lazy)(() => Promise.resolve().then(() => (init_ai_message_markdown(), ai_message_markdown_exports)));
|
|
3428
3506
|
var SUITE_OPEN_ASK_AI_EVENT = "shellstack:open-ask-ai";
|
|
3429
3507
|
var SUITE_ASK_AI_OPEN_KEY = "shellstack:shelly-open";
|
|
@@ -3792,16 +3870,16 @@ function SuiteAiPanel({
|
|
|
3792
3870
|
-1
|
|
3793
3871
|
);
|
|
3794
3872
|
const Icon = BrandIcon != null ? BrandIcon : import_iconoir_react8.Sparks;
|
|
3795
|
-
return /* @__PURE__ */ (0,
|
|
3873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3796
3874
|
"aside",
|
|
3797
3875
|
{
|
|
3798
3876
|
className: "flex h-full min-h-0 flex-col bg-ph-canvas",
|
|
3799
3877
|
"data-test": "suite-ask-ai-panel",
|
|
3800
3878
|
"aria-label": title,
|
|
3801
3879
|
children: [
|
|
3802
|
-
/* @__PURE__ */ (0,
|
|
3803
|
-
/* @__PURE__ */ (0,
|
|
3804
|
-
messages.length > 0 ? /* @__PURE__ */ (0,
|
|
3880
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("header", { className: "flex items-center gap-2 px-2 pb-2", children: [
|
|
3881
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "sr-only", children: title }),
|
|
3882
|
+
messages.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3805
3883
|
"button",
|
|
3806
3884
|
{
|
|
3807
3885
|
type: "button",
|
|
@@ -3810,14 +3888,14 @@ function SuiteAiPanel({
|
|
|
3810
3888
|
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",
|
|
3811
3889
|
"data-test": "ask-ai-clear",
|
|
3812
3890
|
children: [
|
|
3813
|
-
/* @__PURE__ */ (0,
|
|
3891
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_iconoir_react8.Erase, { className: "h-3.5 w-3.5" }),
|
|
3814
3892
|
"Clear"
|
|
3815
3893
|
]
|
|
3816
3894
|
}
|
|
3817
3895
|
) : null
|
|
3818
3896
|
] }),
|
|
3819
|
-
/* @__PURE__ */ (0,
|
|
3820
|
-
/* @__PURE__ */ (0,
|
|
3897
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative min-h-0 flex-1", children: [
|
|
3898
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3821
3899
|
"div",
|
|
3822
3900
|
{
|
|
3823
3901
|
ref: scrollerRef,
|
|
@@ -3828,15 +3906,15 @@ function SuiteAiPanel({
|
|
|
3828
3906
|
"aria-label": "Conversation",
|
|
3829
3907
|
className: "suite-scroll-lock h-full space-y-5 overflow-y-auto px-2 py-3",
|
|
3830
3908
|
children: [
|
|
3831
|
-
hydrating && messages.length === 0 ? /* @__PURE__ */ (0,
|
|
3832
|
-
/* @__PURE__ */ (0,
|
|
3909
|
+
hydrating && messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-2 text-sm text-ph-subtle", children: [
|
|
3910
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Spinner, { className: "h-4 w-4 animate-spin" }),
|
|
3833
3911
|
"Loading your chat\u2026"
|
|
3834
3912
|
] }) : null,
|
|
3835
|
-
!hydrating && messages.length === 0 && !error ? /* @__PURE__ */ (0,
|
|
3836
|
-
/* @__PURE__ */ (0,
|
|
3837
|
-
/* @__PURE__ */ (0,
|
|
3838
|
-
/* @__PURE__ */ (0,
|
|
3839
|
-
presets.length > 0 ? /* @__PURE__ */ (0,
|
|
3913
|
+
!hydrating && messages.length === 0 && !error ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "mx-auto mt-4 flex max-w-sm flex-col items-center px-1 text-center", children: [
|
|
3914
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "flex h-10 w-10 items-center justify-center rounded-2xl bg-ph-brand/10 text-ph-brand", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { className: "h-5 w-5" }) }),
|
|
3915
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-3 font-display text-base font-semibold text-ph-ink", children: "How can I help?" }),
|
|
3916
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-1 text-sm leading-relaxed text-ph-subtle", children: emptyState }),
|
|
3917
|
+
presets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "mt-4 flex w-full flex-col gap-2", children: presets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3840
3918
|
"button",
|
|
3841
3919
|
{
|
|
3842
3920
|
type: "button",
|
|
@@ -3844,9 +3922,9 @@ function SuiteAiPanel({
|
|
|
3844
3922
|
disabled: waiting || hydrating,
|
|
3845
3923
|
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",
|
|
3846
3924
|
children: [
|
|
3847
|
-
/* @__PURE__ */ (0,
|
|
3848
|
-
/* @__PURE__ */ (0,
|
|
3849
|
-
/* @__PURE__ */ (0,
|
|
3925
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_iconoir_react8.Sparks, { className: "h-4 w-4 shrink-0 text-ph-brand" }),
|
|
3926
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "min-w-0 flex-1 truncate", children: preset.label }),
|
|
3927
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_iconoir_react8.ArrowUp, { className: "h-3.5 w-3.5 shrink-0 rotate-45 text-ph-mutedtext transition-transform group-hover:translate-x-0.5" })
|
|
3850
3928
|
]
|
|
3851
3929
|
},
|
|
3852
3930
|
preset.label
|
|
@@ -3857,13 +3935,13 @@ function SuiteAiPanel({
|
|
|
3857
3935
|
const isUser = message.role === "user";
|
|
3858
3936
|
if (isUser) {
|
|
3859
3937
|
if (editingIndex === index) {
|
|
3860
|
-
return /* @__PURE__ */ (0,
|
|
3938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3861
3939
|
"div",
|
|
3862
3940
|
{
|
|
3863
3941
|
className: "suite-msg-in suite-msg-in--user flex justify-end",
|
|
3864
3942
|
"data-test": "ask-ai-user",
|
|
3865
|
-
children: /* @__PURE__ */ (0,
|
|
3866
|
-
/* @__PURE__ */ (0,
|
|
3943
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "w-full max-w-[85%] space-y-2", children: [
|
|
3944
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3867
3945
|
"textarea",
|
|
3868
3946
|
{
|
|
3869
3947
|
autoFocus: true,
|
|
@@ -3884,8 +3962,8 @@ function SuiteAiPanel({
|
|
|
3884
3962
|
className: "w-full resize-none rounded-2xl rounded-br-md border border-ph-border bg-ph-surface px-3 py-2 text-sm leading-relaxed text-ph-ink outline-none focus-visible:border-ph-brand/45 focus-visible:ring-2 focus-visible:ring-ph-focus/35"
|
|
3885
3963
|
}
|
|
3886
3964
|
),
|
|
3887
|
-
/* @__PURE__ */ (0,
|
|
3888
|
-
/* @__PURE__ */ (0,
|
|
3965
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
3966
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3889
3967
|
"button",
|
|
3890
3968
|
{
|
|
3891
3969
|
type: "button",
|
|
@@ -3897,7 +3975,7 @@ function SuiteAiPanel({
|
|
|
3897
3975
|
children: "Cancel"
|
|
3898
3976
|
}
|
|
3899
3977
|
),
|
|
3900
|
-
/* @__PURE__ */ (0,
|
|
3978
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3901
3979
|
"button",
|
|
3902
3980
|
{
|
|
3903
3981
|
type: "button",
|
|
@@ -3914,14 +3992,14 @@ function SuiteAiPanel({
|
|
|
3914
3992
|
`user-${index}`
|
|
3915
3993
|
);
|
|
3916
3994
|
}
|
|
3917
|
-
return /* @__PURE__ */ (0,
|
|
3995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3918
3996
|
"div",
|
|
3919
3997
|
{
|
|
3920
3998
|
className: "suite-msg-in suite-msg-in--user flex justify-end",
|
|
3921
3999
|
"data-test": "ask-ai-user",
|
|
3922
|
-
children: /* @__PURE__ */ (0,
|
|
3923
|
-
!waiting ? /* @__PURE__ */ (0,
|
|
3924
|
-
/* @__PURE__ */ (0,
|
|
4000
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "group flex items-end gap-1.5", children: [
|
|
4001
|
+
!waiting ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("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: [
|
|
4002
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3925
4003
|
"button",
|
|
3926
4004
|
{
|
|
3927
4005
|
type: "button",
|
|
@@ -3929,10 +4007,10 @@ function SuiteAiPanel({
|
|
|
3929
4007
|
"aria-label": copiedIndex === index ? "Copied" : "Copy message",
|
|
3930
4008
|
"data-test": "ask-ai-copy",
|
|
3931
4009
|
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",
|
|
3932
|
-
children: copiedIndex === index ? /* @__PURE__ */ (0,
|
|
4010
|
+
children: copiedIndex === index ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_iconoir_react8.Check, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_iconoir_react8.Copy, { className: "h-3.5 w-3.5" })
|
|
3933
4011
|
}
|
|
3934
4012
|
),
|
|
3935
|
-
/* @__PURE__ */ (0,
|
|
4013
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3936
4014
|
"button",
|
|
3937
4015
|
{
|
|
3938
4016
|
type: "button",
|
|
@@ -3943,41 +4021,41 @@ function SuiteAiPanel({
|
|
|
3943
4021
|
"aria-label": "Edit message",
|
|
3944
4022
|
"data-test": "ask-ai-edit",
|
|
3945
4023
|
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",
|
|
3946
|
-
children: /* @__PURE__ */ (0,
|
|
4024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_iconoir_react8.EditPencil, { className: "h-3.5 w-3.5" })
|
|
3947
4025
|
}
|
|
3948
4026
|
)
|
|
3949
4027
|
] }) : null,
|
|
3950
|
-
/* @__PURE__ */ (0,
|
|
4028
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("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 })
|
|
3951
4029
|
] })
|
|
3952
4030
|
},
|
|
3953
4031
|
`user-${index}`
|
|
3954
4032
|
);
|
|
3955
4033
|
}
|
|
3956
|
-
return /* @__PURE__ */ (0,
|
|
4034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3957
4035
|
"div",
|
|
3958
4036
|
{
|
|
3959
4037
|
className: "flex items-end gap-2",
|
|
3960
4038
|
"data-test": "ask-ai-assistant",
|
|
3961
4039
|
children: [
|
|
3962
|
-
/* @__PURE__ */ (0,
|
|
4040
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3963
4041
|
"span",
|
|
3964
4042
|
{
|
|
3965
4043
|
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",
|
|
3966
4044
|
"aria-hidden": true,
|
|
3967
|
-
children: /* @__PURE__ */ (0,
|
|
4045
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { className: "h-3.5 w-3.5" })
|
|
3968
4046
|
}
|
|
3969
4047
|
),
|
|
3970
|
-
/* @__PURE__ */ (0,
|
|
3971
|
-
/* @__PURE__ */ (0,
|
|
4048
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "suite-msg-bubble min-w-0 max-w-[85%] space-y-2", children: [
|
|
4049
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2 text-sm leading-relaxed text-ph-ink", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3972
4050
|
import_react12.Suspense,
|
|
3973
4051
|
{
|
|
3974
4052
|
fallback: (
|
|
3975
4053
|
// The chunk is pre-warmed above, so this only shows on a
|
|
3976
4054
|
// cold cache. Keep it invisible — a skeleton here reads
|
|
3977
4055
|
// as if it were part of the answer.
|
|
3978
|
-
/* @__PURE__ */ (0,
|
|
4056
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sr-only", role: "status", children: "Rendering response\u2026" })
|
|
3979
4057
|
),
|
|
3980
|
-
children: /* @__PURE__ */ (0,
|
|
4058
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3981
4059
|
SuiteAiMarkdownMessage2,
|
|
3982
4060
|
{
|
|
3983
4061
|
markdown: message.content,
|
|
@@ -3986,16 +4064,16 @@ function SuiteAiPanel({
|
|
|
3986
4064
|
)
|
|
3987
4065
|
}
|
|
3988
4066
|
) }),
|
|
3989
|
-
((_a2 = message.actions) != null ? _a2 : []).map((action) => /* @__PURE__ */ (0,
|
|
4067
|
+
((_a2 = message.actions) != null ? _a2 : []).map((action) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3990
4068
|
"div",
|
|
3991
4069
|
{
|
|
3992
4070
|
"data-test": "ask-ai-action",
|
|
3993
4071
|
"data-status": action.status,
|
|
3994
4072
|
className: "rounded-xl border border-ph-border bg-ph-surface px-3 py-2 text-sm text-ph-ink",
|
|
3995
4073
|
children: [
|
|
3996
|
-
/* @__PURE__ */ (0,
|
|
3997
|
-
action.status === "proposed" ? /* @__PURE__ */ (0,
|
|
3998
|
-
/* @__PURE__ */ (0,
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "font-medium", children: action.summary }),
|
|
4075
|
+
action.status === "proposed" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "mt-2 flex flex-wrap gap-2", children: [
|
|
4076
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3999
4077
|
"button",
|
|
4000
4078
|
{
|
|
4001
4079
|
type: "button",
|
|
@@ -4006,7 +4084,7 @@ function SuiteAiPanel({
|
|
|
4006
4084
|
children: resolvingId === action.id ? "Working\u2026" : "Confirm"
|
|
4007
4085
|
}
|
|
4008
4086
|
),
|
|
4009
|
-
/* @__PURE__ */ (0,
|
|
4087
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4010
4088
|
"button",
|
|
4011
4089
|
{
|
|
4012
4090
|
type: "button",
|
|
@@ -4018,11 +4096,11 @@ function SuiteAiPanel({
|
|
|
4018
4096
|
}
|
|
4019
4097
|
)
|
|
4020
4098
|
] }) : null,
|
|
4021
|
-
action.status === "applied" ? /* @__PURE__ */ (0,
|
|
4099
|
+
action.status === "applied" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "mt-1 text-xs text-ph-subtle", children: [
|
|
4022
4100
|
"Done",
|
|
4023
|
-
action.href ? /* @__PURE__ */ (0,
|
|
4101
|
+
action.href ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
4024
4102
|
" \xB7 ",
|
|
4025
|
-
/* @__PURE__ */ (0,
|
|
4103
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4026
4104
|
"a",
|
|
4027
4105
|
{
|
|
4028
4106
|
href: action.href,
|
|
@@ -4032,8 +4110,8 @@ function SuiteAiPanel({
|
|
|
4032
4110
|
)
|
|
4033
4111
|
] }) : null
|
|
4034
4112
|
] }) : null,
|
|
4035
|
-
action.status === "cancelled" ? /* @__PURE__ */ (0,
|
|
4036
|
-
action.status === "failed" ? /* @__PURE__ */ (0,
|
|
4113
|
+
action.status === "cancelled" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-1 text-xs text-ph-subtle", children: "Cancelled" }) : null,
|
|
4114
|
+
action.status === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-1 text-xs text-ph-danger", children: action.error || "Could not apply that." }) : null
|
|
4037
4115
|
]
|
|
4038
4116
|
},
|
|
4039
4117
|
action.id
|
|
@@ -4044,26 +4122,26 @@ function SuiteAiPanel({
|
|
|
4044
4122
|
`assistant-${index}`
|
|
4045
4123
|
);
|
|
4046
4124
|
}),
|
|
4047
|
-
waiting ? /* @__PURE__ */ (0,
|
|
4048
|
-
/* @__PURE__ */ (0,
|
|
4049
|
-
/* @__PURE__ */ (0,
|
|
4050
|
-
/* @__PURE__ */ (0,
|
|
4051
|
-
/* @__PURE__ */ (0,
|
|
4052
|
-
/* @__PURE__ */ (0,
|
|
4125
|
+
waiting ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-end gap-2", "aria-hidden": true, children: [
|
|
4126
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("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__ */ (0, import_jsx_runtime25.jsx)(Icon, { className: "h-3.5 w-3.5" }) }),
|
|
4127
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-1.5 rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2.5", children: [
|
|
4128
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "suite-think-dot h-1.5 w-1.5 rounded-full bg-ph-mutedtext" }),
|
|
4129
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "suite-think-dot suite-think-dot--2 h-1.5 w-1.5 rounded-full bg-ph-mutedtext" }),
|
|
4130
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "suite-think-dot suite-think-dot--3 h-1.5 w-1.5 rounded-full bg-ph-mutedtext" })
|
|
4053
4131
|
] })
|
|
4054
4132
|
] }) : null,
|
|
4055
|
-
waiting ? /* @__PURE__ */ (0,
|
|
4056
|
-
error ? /* @__PURE__ */ (0,
|
|
4133
|
+
waiting ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sr-only", "aria-live": "polite", children: "Assistant is responding\u2026" }) : null,
|
|
4134
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
4057
4135
|
"div",
|
|
4058
4136
|
{
|
|
4059
4137
|
role: "alert",
|
|
4060
4138
|
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",
|
|
4061
4139
|
children: [
|
|
4062
|
-
/* @__PURE__ */ (0,
|
|
4063
|
-
/* @__PURE__ */ (0,
|
|
4064
|
-
/* @__PURE__ */ (0,
|
|
4065
|
-
/* @__PURE__ */ (0,
|
|
4066
|
-
/* @__PURE__ */ (0,
|
|
4140
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_iconoir_react8.WarningTriangle, { className: "mt-0.5 h-4 w-4 shrink-0 text-ph-danger" }),
|
|
4141
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
4142
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "font-medium text-ph-danger", children: "Something went wrong" }),
|
|
4143
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-0.5 text-ph-subtle", children: error }),
|
|
4144
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4067
4145
|
"button",
|
|
4068
4146
|
{
|
|
4069
4147
|
type: "button",
|
|
@@ -4080,20 +4158,20 @@ function SuiteAiPanel({
|
|
|
4080
4158
|
]
|
|
4081
4159
|
}
|
|
4082
4160
|
),
|
|
4083
|
-
!atBottom ? /* @__PURE__ */ (0,
|
|
4161
|
+
!atBottom ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute bottom-3 left-1/2 -translate-x-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Tooltip, { content: "Scroll to latest", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4084
4162
|
"button",
|
|
4085
4163
|
{
|
|
4086
4164
|
type: "button",
|
|
4087
4165
|
onClick: () => scrollToBottom("smooth"),
|
|
4088
4166
|
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",
|
|
4089
4167
|
"aria-label": "Scroll to latest",
|
|
4090
|
-
children: /* @__PURE__ */ (0,
|
|
4168
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_iconoir_react8.ArrowDown, { className: "h-4 w-4" })
|
|
4091
4169
|
}
|
|
4092
4170
|
) }) }) : null
|
|
4093
4171
|
] }),
|
|
4094
|
-
/* @__PURE__ */ (0,
|
|
4095
|
-
/* @__PURE__ */ (0,
|
|
4096
|
-
/* @__PURE__ */ (0,
|
|
4172
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "px-2 pt-2 pb-[max(2rem,calc(env(safe-area-inset-bottom)+1rem))]", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("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: [
|
|
4173
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { htmlFor: inputId, className: "sr-only", children: "Ask a question" }),
|
|
4174
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4097
4175
|
"textarea",
|
|
4098
4176
|
{
|
|
4099
4177
|
id: inputId,
|
|
@@ -4112,7 +4190,7 @@ function SuiteAiPanel({
|
|
|
4112
4190
|
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"
|
|
4113
4191
|
}
|
|
4114
4192
|
),
|
|
4115
|
-
waiting ? /* @__PURE__ */ (0,
|
|
4193
|
+
waiting ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Tooltip, { content: "Stop generating", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4116
4194
|
"button",
|
|
4117
4195
|
{
|
|
4118
4196
|
type: "button",
|
|
@@ -4120,9 +4198,9 @@ function SuiteAiPanel({
|
|
|
4120
4198
|
"data-test": "ask-ai-stop",
|
|
4121
4199
|
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",
|
|
4122
4200
|
"aria-label": "Stop generating",
|
|
4123
|
-
children: /* @__PURE__ */ (0,
|
|
4201
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_iconoir_react8.Square, { className: "h-3.5 w-3.5 fill-current" })
|
|
4124
4202
|
}
|
|
4125
|
-
) }) : /* @__PURE__ */ (0,
|
|
4203
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Tooltip, { content: "Send message", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4126
4204
|
"button",
|
|
4127
4205
|
{
|
|
4128
4206
|
type: "button",
|
|
@@ -4131,7 +4209,7 @@ function SuiteAiPanel({
|
|
|
4131
4209
|
"data-test": "ask-ai-send",
|
|
4132
4210
|
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",
|
|
4133
4211
|
"aria-label": "Send message",
|
|
4134
|
-
children: /* @__PURE__ */ (0,
|
|
4212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_iconoir_react8.ArrowUp, { className: "h-4 w-4" })
|
|
4135
4213
|
}
|
|
4136
4214
|
) })
|
|
4137
4215
|
] }) })
|
|
@@ -4143,7 +4221,7 @@ function SuiteAiPanel({
|
|
|
4143
4221
|
// src/suite/components/workspace-switcher.tsx
|
|
4144
4222
|
var import_react13 = require("react");
|
|
4145
4223
|
var import_iconoir_react9 = require("iconoir-react");
|
|
4146
|
-
var
|
|
4224
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4147
4225
|
function SuiteWorkspaceSwitcher({
|
|
4148
4226
|
workspaces = [],
|
|
4149
4227
|
groups,
|
|
@@ -4161,7 +4239,7 @@ function SuiteWorkspaceSwitcher({
|
|
|
4161
4239
|
var _a2;
|
|
4162
4240
|
const [open, setOpen] = (0, import_react13.useState)(false);
|
|
4163
4241
|
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 }] : [];
|
|
4164
|
-
return /* @__PURE__ */ (0,
|
|
4242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4165
4243
|
DropdownMenu2,
|
|
4166
4244
|
{
|
|
4167
4245
|
"aria-label": "Switch workspace",
|
|
@@ -4172,7 +4250,7 @@ function SuiteWorkspaceSwitcher({
|
|
|
4172
4250
|
align: "start",
|
|
4173
4251
|
open,
|
|
4174
4252
|
onOpenChange: setOpen,
|
|
4175
|
-
trigger: /* @__PURE__ */ (0,
|
|
4253
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4176
4254
|
"span",
|
|
4177
4255
|
{
|
|
4178
4256
|
className: cn(
|
|
@@ -4182,10 +4260,10 @@ function SuiteWorkspaceSwitcher({
|
|
|
4182
4260
|
),
|
|
4183
4261
|
"data-test": "workspace-switcher-trigger",
|
|
4184
4262
|
children: [
|
|
4185
|
-
/* @__PURE__ */ (0,
|
|
4186
|
-
!collapsed ? /* @__PURE__ */ (0,
|
|
4187
|
-
/* @__PURE__ */ (0,
|
|
4188
|
-
/* @__PURE__ */ (0,
|
|
4263
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_iconoir_react9.Building, { className: "h-4 w-4 shrink-0 text-ph-ink", "aria-hidden": true }),
|
|
4264
|
+
!collapsed ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
4265
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-ph-ink", children: name }),
|
|
4266
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4189
4267
|
import_iconoir_react9.NavArrowDown,
|
|
4190
4268
|
{
|
|
4191
4269
|
className: cn(
|
|
@@ -4199,16 +4277,16 @@ function SuiteWorkspaceSwitcher({
|
|
|
4199
4277
|
]
|
|
4200
4278
|
}
|
|
4201
4279
|
),
|
|
4202
|
-
children: /* @__PURE__ */ (0,
|
|
4280
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4203
4281
|
"div",
|
|
4204
4282
|
{
|
|
4205
4283
|
id: "workspace-switcher-menu",
|
|
4206
4284
|
className: "p-1",
|
|
4207
4285
|
"data-test": "workspace-switcher-menu",
|
|
4208
4286
|
children: [
|
|
4209
|
-
sections.length === 0 ? /* @__PURE__ */ (0,
|
|
4210
|
-
/* @__PURE__ */ (0,
|
|
4211
|
-
section.workspaces.map((workspace) => /* @__PURE__ */ (0,
|
|
4287
|
+
sections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "px-3 py-2 text-sm text-ph-mutedtext", children: emptyLabel }) : sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
|
|
4288
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "px-3 py-2 text-[10px] font-semibold uppercase tracking-[0.14em] text-ph-mutedtext", children: section.label }),
|
|
4289
|
+
section.workspaces.map((workspace) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4212
4290
|
DropdownItem2,
|
|
4213
4291
|
{
|
|
4214
4292
|
id: `workspace-option-${workspace.id}`,
|
|
@@ -4221,12 +4299,12 @@ function SuiteWorkspaceSwitcher({
|
|
|
4221
4299
|
onSelect(workspace);
|
|
4222
4300
|
},
|
|
4223
4301
|
className: appSwitcherMenuItemClass(),
|
|
4224
|
-
children: /* @__PURE__ */ (0,
|
|
4225
|
-
/* @__PURE__ */ (0,
|
|
4226
|
-
/* @__PURE__ */ (0,
|
|
4227
|
-
workspace.description ? /* @__PURE__ */ (0,
|
|
4302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "flex min-w-0 w-full items-center gap-3", children: [
|
|
4303
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
4304
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "block truncate text-sm font-medium text-ph-ink", children: workspace.name }),
|
|
4305
|
+
workspace.description ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "block truncate text-xs text-ph-mutedtext", children: workspace.description }) : null
|
|
4228
4306
|
] }),
|
|
4229
|
-
workspace.id === currentId ? /* @__PURE__ */ (0,
|
|
4307
|
+
workspace.id === currentId ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4230
4308
|
import_iconoir_react9.Check,
|
|
4231
4309
|
{
|
|
4232
4310
|
className: "h-4 w-4 shrink-0 text-ph-brand",
|
|
@@ -4238,7 +4316,7 @@ function SuiteWorkspaceSwitcher({
|
|
|
4238
4316
|
workspace.id
|
|
4239
4317
|
))
|
|
4240
4318
|
] }, section.id)),
|
|
4241
|
-
footer ? /* @__PURE__ */ (0,
|
|
4319
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mt-1 border-t border-ph-border pt-1", children: footer }) : null
|
|
4242
4320
|
]
|
|
4243
4321
|
}
|
|
4244
4322
|
)
|
|
@@ -4247,7 +4325,7 @@ function SuiteWorkspaceSwitcher({
|
|
|
4247
4325
|
}
|
|
4248
4326
|
|
|
4249
4327
|
// src/suite/icons/suite-icon.tsx
|
|
4250
|
-
var
|
|
4328
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4251
4329
|
var TODAY_SUN_STYLE = `
|
|
4252
4330
|
@media (prefers-reduced-motion: no-preference) {
|
|
4253
4331
|
.suite-icon-today-sun-rays {
|
|
@@ -4273,7 +4351,7 @@ function SuiteIcon({
|
|
|
4273
4351
|
const glyph = SUITE_GLYPHS[name];
|
|
4274
4352
|
const accentHex = accent ? APP_ACCENTS[accent].accent : void 0;
|
|
4275
4353
|
const mergedStyle = accentHex ? __spreadProps(__spreadValues({}, style), { "--suite-icon-accent": accentHex }) : style;
|
|
4276
|
-
return /* @__PURE__ */ (0,
|
|
4354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4277
4355
|
"svg",
|
|
4278
4356
|
{
|
|
4279
4357
|
width: size,
|
|
@@ -4290,8 +4368,8 @@ function SuiteIcon({
|
|
|
4290
4368
|
"aria-label": label,
|
|
4291
4369
|
"aria-hidden": label ? void 0 : true,
|
|
4292
4370
|
children: [
|
|
4293
|
-
glyph.animatedAccent && animated ? /* @__PURE__ */ (0,
|
|
4294
|
-
/* @__PURE__ */ (0,
|
|
4371
|
+
glyph.animatedAccent && animated ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("style", { children: TODAY_SUN_STYLE }) : null,
|
|
4372
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4295
4373
|
GlyphParts,
|
|
4296
4374
|
{
|
|
4297
4375
|
elements: glyph.elements,
|
|
@@ -4472,9 +4550,9 @@ function useSidebarWidth(storageKey = SUITE_SIDEBAR_WIDTH_KEY, defaultWidth = SI
|
|
|
4472
4550
|
|
|
4473
4551
|
// src/suite/lib/motion.tsx
|
|
4474
4552
|
var import_react15 = require("motion/react");
|
|
4475
|
-
var
|
|
4553
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4476
4554
|
function SuiteMotionProvider({ children }) {
|
|
4477
|
-
return /* @__PURE__ */ (0,
|
|
4555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react15.LazyMotion, { features: import_react15.domAnimation, strict: true, children });
|
|
4478
4556
|
}
|
|
4479
4557
|
var SUITE_SPRINGS = {
|
|
4480
4558
|
/** Snappy panel/sheet entrances — small overshoot. */
|
|
@@ -4486,24 +4564,24 @@ var SUITE_SPRINGS = {
|
|
|
4486
4564
|
};
|
|
4487
4565
|
|
|
4488
4566
|
// src/suite/components/suite-skeleton.tsx
|
|
4489
|
-
var
|
|
4567
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4490
4568
|
function SuiteSkeleton({
|
|
4491
4569
|
className,
|
|
4492
4570
|
lines = 1,
|
|
4493
4571
|
circle,
|
|
4494
4572
|
width
|
|
4495
4573
|
}) {
|
|
4496
|
-
return /* @__PURE__ */ (0,
|
|
4574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4497
4575
|
"div",
|
|
4498
4576
|
{
|
|
4499
4577
|
className: cn("space-y-2", circle ? "flex flex-col items-center" : ""),
|
|
4500
4578
|
"aria-hidden": true,
|
|
4501
|
-
children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ (0,
|
|
4579
|
+
children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4502
4580
|
"div",
|
|
4503
4581
|
{
|
|
4504
4582
|
className: "animate-[skeleton-stagger_0.6s_ease-out_both]",
|
|
4505
4583
|
style: { animationDelay: `${index * 80}ms` },
|
|
4506
|
-
children: /* @__PURE__ */ (0,
|
|
4584
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4507
4585
|
"div",
|
|
4508
4586
|
{
|
|
4509
4587
|
className: cn(
|
|
@@ -4527,7 +4605,7 @@ function SuiteSkeletonCard({
|
|
|
4527
4605
|
rows = 3,
|
|
4528
4606
|
header = true
|
|
4529
4607
|
}) {
|
|
4530
|
-
return /* @__PURE__ */ (0,
|
|
4608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4531
4609
|
"div",
|
|
4532
4610
|
{
|
|
4533
4611
|
className: cn(
|
|
@@ -4536,26 +4614,26 @@ function SuiteSkeletonCard({
|
|
|
4536
4614
|
),
|
|
4537
4615
|
"aria-hidden": true,
|
|
4538
4616
|
children: [
|
|
4539
|
-
header ? /* @__PURE__ */ (0,
|
|
4617
|
+
header ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4540
4618
|
"div",
|
|
4541
4619
|
{
|
|
4542
4620
|
className: "mb-5 flex items-center gap-3 animate-[skeleton-stagger_0.5s_ease-out_both]",
|
|
4543
4621
|
style: { animationDelay: "100ms" },
|
|
4544
4622
|
children: [
|
|
4545
|
-
/* @__PURE__ */ (0,
|
|
4546
|
-
/* @__PURE__ */ (0,
|
|
4547
|
-
/* @__PURE__ */ (0,
|
|
4548
|
-
/* @__PURE__ */ (0,
|
|
4623
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "ph-skeleton h-10 w-10 rounded-xl" }),
|
|
4624
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
4625
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "ph-skeleton h-4 w-1/3" }),
|
|
4626
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "ph-skeleton h-3 w-1/2" })
|
|
4549
4627
|
] })
|
|
4550
4628
|
]
|
|
4551
4629
|
}
|
|
4552
4630
|
) : null,
|
|
4553
|
-
/* @__PURE__ */ (0,
|
|
4631
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "space-y-3", children: Array.from({ length: rows }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4554
4632
|
"div",
|
|
4555
4633
|
{
|
|
4556
4634
|
className: "animate-[skeleton-stagger_0.5s_ease-out_both]",
|
|
4557
4635
|
style: { animationDelay: `${200 + index * 80}ms` },
|
|
4558
|
-
children: /* @__PURE__ */ (0,
|
|
4636
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4559
4637
|
"div",
|
|
4560
4638
|
{
|
|
4561
4639
|
className: "ph-skeleton h-3",
|
|
@@ -4573,16 +4651,16 @@ function SuiteSkeletonList({
|
|
|
4573
4651
|
className,
|
|
4574
4652
|
items = 4
|
|
4575
4653
|
}) {
|
|
4576
|
-
return /* @__PURE__ */ (0,
|
|
4654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: cn("space-y-3", className), "aria-hidden": true, children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4577
4655
|
"div",
|
|
4578
4656
|
{
|
|
4579
4657
|
className: "animate-[skeleton-stagger_0.6s_ease-out_both]",
|
|
4580
4658
|
style: { animationDelay: `${index * 100}ms` },
|
|
4581
|
-
children: /* @__PURE__ */ (0,
|
|
4582
|
-
/* @__PURE__ */ (0,
|
|
4583
|
-
/* @__PURE__ */ (0,
|
|
4584
|
-
/* @__PURE__ */ (0,
|
|
4585
|
-
/* @__PURE__ */ (0,
|
|
4659
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-3 rounded-xl border border-ph-border bg-ph-surface p-4", children: [
|
|
4660
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "ph-skeleton h-10 w-10 rounded-lg" }),
|
|
4661
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "min-w-0 flex-1 space-y-2", children: [
|
|
4662
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "ph-skeleton h-3.5 w-3/4" }),
|
|
4663
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "ph-skeleton h-3 w-1/2" })
|
|
4586
4664
|
] })
|
|
4587
4665
|
] })
|
|
4588
4666
|
},
|
|
@@ -4597,7 +4675,7 @@ function SuiteEmptyState({
|
|
|
4597
4675
|
className,
|
|
4598
4676
|
size = "md"
|
|
4599
4677
|
}) {
|
|
4600
|
-
return /* @__PURE__ */ (0,
|
|
4678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4601
4679
|
"div",
|
|
4602
4680
|
{
|
|
4603
4681
|
className: cn(
|
|
@@ -4606,13 +4684,13 @@ function SuiteEmptyState({
|
|
|
4606
4684
|
className
|
|
4607
4685
|
),
|
|
4608
4686
|
children: [
|
|
4609
|
-
/* @__PURE__ */ (0,
|
|
4610
|
-
/* @__PURE__ */ (0,
|
|
4611
|
-
/* @__PURE__ */ (0,
|
|
4687
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "pointer-events-none absolute inset-0 overflow-hidden opacity-60", "aria-hidden": true, children: [
|
|
4688
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "absolute -left-10 -top-10 h-40 w-40 rounded-full bg-ph-brand/10 blur-3xl" }),
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "absolute -bottom-10 -right-10 h-40 w-40 rounded-full bg-ph-accent/10 blur-3xl" })
|
|
4612
4690
|
] }),
|
|
4613
|
-
/* @__PURE__ */ (0,
|
|
4614
|
-
icon ? /* @__PURE__ */ (0,
|
|
4615
|
-
/* @__PURE__ */ (0,
|
|
4691
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "relative", children: [
|
|
4692
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("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,
|
|
4693
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4616
4694
|
"h2",
|
|
4617
4695
|
{
|
|
4618
4696
|
className: cn(
|
|
@@ -4622,8 +4700,8 @@ function SuiteEmptyState({
|
|
|
4622
4700
|
children: title
|
|
4623
4701
|
}
|
|
4624
4702
|
),
|
|
4625
|
-
description ? /* @__PURE__ */ (0,
|
|
4626
|
-
action ? /* @__PURE__ */ (0,
|
|
4703
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "mx-auto mt-2 max-w-sm text-sm leading-relaxed text-ph-subtle", children: description }) : null,
|
|
4704
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mt-5 flex flex-wrap items-center justify-center gap-2", children: action }) : null
|
|
4627
4705
|
] })
|
|
4628
4706
|
]
|
|
4629
4707
|
}
|
|
@@ -4632,7 +4710,7 @@ function SuiteEmptyState({
|
|
|
4632
4710
|
|
|
4633
4711
|
// src/suite/components/suite-settings-mobile-nav.tsx
|
|
4634
4712
|
var import_react16 = require("react");
|
|
4635
|
-
var
|
|
4713
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4636
4714
|
function SuiteSettingsMobileNav({
|
|
4637
4715
|
items,
|
|
4638
4716
|
activeHref,
|
|
@@ -4641,16 +4719,16 @@ function SuiteSettingsMobileNav({
|
|
|
4641
4719
|
ariaLabel = "Settings sections",
|
|
4642
4720
|
className
|
|
4643
4721
|
}) {
|
|
4644
|
-
return /* @__PURE__ */ (0,
|
|
4722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4645
4723
|
"nav",
|
|
4646
4724
|
{
|
|
4647
4725
|
"data-test": dataTest,
|
|
4648
4726
|
"aria-label": ariaLabel,
|
|
4649
4727
|
className: cn("suite-settings-mobile-nav lg:hidden", className),
|
|
4650
|
-
children: /* @__PURE__ */ (0,
|
|
4728
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("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) => {
|
|
4651
4729
|
const Icon = item.icon;
|
|
4652
4730
|
const active = activeHref === item.href || activeHref.startsWith(`${item.href}/`);
|
|
4653
|
-
const iconNode = (0, import_react16.isValidElement)(item.icon) ? item.icon : /* @__PURE__ */ (0,
|
|
4731
|
+
const iconNode = (0, import_react16.isValidElement)(item.icon) ? item.icon : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4654
4732
|
Icon,
|
|
4655
4733
|
{
|
|
4656
4734
|
className: cn(
|
|
@@ -4660,7 +4738,7 @@ function SuiteSettingsMobileNav({
|
|
|
4660
4738
|
"aria-hidden": true
|
|
4661
4739
|
}
|
|
4662
4740
|
);
|
|
4663
|
-
return /* @__PURE__ */ (0,
|
|
4741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
4664
4742
|
"button",
|
|
4665
4743
|
{
|
|
4666
4744
|
type: "button",
|
|
@@ -4675,8 +4753,8 @@ function SuiteSettingsMobileNav({
|
|
|
4675
4753
|
),
|
|
4676
4754
|
children: [
|
|
4677
4755
|
iconNode,
|
|
4678
|
-
/* @__PURE__ */ (0,
|
|
4679
|
-
active ? /* @__PURE__ */ (0,
|
|
4756
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "whitespace-nowrap", children: item.label }),
|
|
4757
|
+
active ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "absolute inset-x-0 -bottom-3 h-0.5 rounded-full bg-ph-ink lg:hidden" }) : null
|
|
4680
4758
|
]
|
|
4681
4759
|
},
|
|
4682
4760
|
item.href
|
|
@@ -4690,7 +4768,7 @@ function SuiteSettingsMobileNav({
|
|
|
4690
4768
|
var import_link2 = __toESM(require("next/link"));
|
|
4691
4769
|
var import_react17 = require("react");
|
|
4692
4770
|
var import_iconoir_react10 = require("iconoir-react");
|
|
4693
|
-
var
|
|
4771
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4694
4772
|
function renderNode(node, collapsed) {
|
|
4695
4773
|
if (typeof node === "function") return node(collapsed);
|
|
4696
4774
|
return node;
|
|
@@ -4745,7 +4823,7 @@ function SuiteSidebar({
|
|
|
4745
4823
|
if (collapsed) onRequestExpand == null ? void 0 : onRequestExpand();
|
|
4746
4824
|
setAskAi(true);
|
|
4747
4825
|
}
|
|
4748
|
-
const askAiButton = /* @__PURE__ */ (0,
|
|
4826
|
+
const askAiButton = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4749
4827
|
"button",
|
|
4750
4828
|
{
|
|
4751
4829
|
type: "button",
|
|
@@ -4757,11 +4835,11 @@ function SuiteSidebar({
|
|
|
4757
4835
|
"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",
|
|
4758
4836
|
askAiOpen ? "bg-ph-brand/10 text-ph-brand" : "text-ph-mutedtext hover:bg-ph-muted hover:text-ph-ink"
|
|
4759
4837
|
),
|
|
4760
|
-
children: /* @__PURE__ */ (0,
|
|
4838
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_iconoir_react10.Sparks, { className: "h-4 w-4", "aria-hidden": true })
|
|
4761
4839
|
}
|
|
4762
4840
|
);
|
|
4763
4841
|
if (chatOpen) {
|
|
4764
|
-
return /* @__PURE__ */ (0,
|
|
4842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4765
4843
|
"div",
|
|
4766
4844
|
{
|
|
4767
4845
|
"data-suite-chat-open": "",
|
|
@@ -4771,7 +4849,7 @@ function SuiteSidebar({
|
|
|
4771
4849
|
className
|
|
4772
4850
|
),
|
|
4773
4851
|
children: [
|
|
4774
|
-
/* @__PURE__ */ (0,
|
|
4852
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4775
4853
|
"div",
|
|
4776
4854
|
{
|
|
4777
4855
|
className: cn(
|
|
@@ -4779,7 +4857,7 @@ function SuiteSidebar({
|
|
|
4779
4857
|
surface ? "bg-ph-surface" : "bg-ph-canvas"
|
|
4780
4858
|
),
|
|
4781
4859
|
children: [
|
|
4782
|
-
/* @__PURE__ */ (0,
|
|
4860
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4783
4861
|
"button",
|
|
4784
4862
|
{
|
|
4785
4863
|
type: "button",
|
|
@@ -4787,19 +4865,19 @@ function SuiteSidebar({
|
|
|
4787
4865
|
"aria-label": "Back to navigation",
|
|
4788
4866
|
onClick: () => setAskAi(false),
|
|
4789
4867
|
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",
|
|
4790
|
-
children: /* @__PURE__ */ (0,
|
|
4868
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_iconoir_react10.NavArrowLeft, { className: "h-4 w-4", "aria-hidden": true })
|
|
4791
4869
|
}
|
|
4792
4870
|
),
|
|
4793
|
-
/* @__PURE__ */ (0,
|
|
4871
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-ph-ink", children: "Shelly AI" })
|
|
4794
4872
|
]
|
|
4795
4873
|
}
|
|
4796
4874
|
),
|
|
4797
|
-
/* @__PURE__ */ (0,
|
|
4875
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "min-h-0 flex-1", children: askAi })
|
|
4798
4876
|
]
|
|
4799
4877
|
}
|
|
4800
4878
|
);
|
|
4801
4879
|
}
|
|
4802
|
-
return /* @__PURE__ */ (0,
|
|
4880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4803
4881
|
"div",
|
|
4804
4882
|
{
|
|
4805
4883
|
className: cn(
|
|
@@ -4808,7 +4886,7 @@ function SuiteSidebar({
|
|
|
4808
4886
|
className
|
|
4809
4887
|
),
|
|
4810
4888
|
children: [
|
|
4811
|
-
appSwitcher || notificationBell ? /* @__PURE__ */ (0,
|
|
4889
|
+
appSwitcher || notificationBell ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4812
4890
|
"div",
|
|
4813
4891
|
{
|
|
4814
4892
|
className: cn(
|
|
@@ -4817,12 +4895,12 @@ function SuiteSidebar({
|
|
|
4817
4895
|
collapsed ? "flex-col items-center gap-1 px-1 py-2" : "h-14 items-center justify-between gap-2 px-3"
|
|
4818
4896
|
),
|
|
4819
4897
|
children: [
|
|
4820
|
-
/* @__PURE__ */ (0,
|
|
4821
|
-
collapsed ? null : /* @__PURE__ */ (0,
|
|
4898
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("min-w-0", collapsed ? "shrink-0" : "flex-1"), children: renderNode(appSwitcher, collapsed) }),
|
|
4899
|
+
collapsed ? null : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "shrink-0", children: renderNode(notificationBell, collapsed) })
|
|
4822
4900
|
]
|
|
4823
4901
|
}
|
|
4824
4902
|
) : null,
|
|
4825
|
-
/* @__PURE__ */ (0,
|
|
4903
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4826
4904
|
"div",
|
|
4827
4905
|
{
|
|
4828
4906
|
className: cn(
|
|
@@ -4832,7 +4910,7 @@ function SuiteSidebar({
|
|
|
4832
4910
|
collapsed ? "px-1.5 py-2" : "p-3"
|
|
4833
4911
|
),
|
|
4834
4912
|
children: [
|
|
4835
|
-
contextSwitcher ? /* @__PURE__ */ (0,
|
|
4913
|
+
contextSwitcher ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4836
4914
|
"div",
|
|
4837
4915
|
{
|
|
4838
4916
|
className: cn(
|
|
@@ -4842,9 +4920,9 @@ function SuiteSidebar({
|
|
|
4842
4920
|
children: renderNode(contextSwitcher, collapsed)
|
|
4843
4921
|
}
|
|
4844
4922
|
) : null,
|
|
4845
|
-
chatOpen ? /* @__PURE__ */ (0,
|
|
4846
|
-
/* @__PURE__ */ (0,
|
|
4847
|
-
/* @__PURE__ */ (0,
|
|
4923
|
+
chatOpen ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
4924
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "mb-2 flex shrink-0 items-center gap-1", children: [
|
|
4925
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4848
4926
|
"button",
|
|
4849
4927
|
{
|
|
4850
4928
|
type: "button",
|
|
@@ -4852,20 +4930,20 @@ function SuiteSidebar({
|
|
|
4852
4930
|
onClick: () => setAskAi(false),
|
|
4853
4931
|
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",
|
|
4854
4932
|
children: [
|
|
4855
|
-
/* @__PURE__ */ (0,
|
|
4933
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_iconoir_react10.NavArrowLeft, { className: "h-4 w-4", "aria-hidden": true }),
|
|
4856
4934
|
"Nav"
|
|
4857
4935
|
]
|
|
4858
4936
|
}
|
|
4859
4937
|
),
|
|
4860
|
-
/* @__PURE__ */ (0,
|
|
4938
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "truncate text-sm font-semibold text-ph-ink", children: "Shelly AI" })
|
|
4861
4939
|
] }),
|
|
4862
|
-
/* @__PURE__ */ (0,
|
|
4863
|
-
] }) : /* @__PURE__ */ (0,
|
|
4864
|
-
/* @__PURE__ */ (0,
|
|
4940
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "min-h-0 flex-1", children: askAi })
|
|
4941
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
4942
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("nav", { "aria-label": "Pages", className: "shrink-0 space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "space-y-1", children: navItems.map((item) => {
|
|
4865
4943
|
var _a2;
|
|
4866
4944
|
const Icon = item.icon;
|
|
4867
4945
|
const active = Boolean(item.active);
|
|
4868
|
-
const link = /* @__PURE__ */ (0,
|
|
4946
|
+
const link = /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4869
4947
|
import_link2.default,
|
|
4870
4948
|
{
|
|
4871
4949
|
href: item.href,
|
|
@@ -4879,7 +4957,7 @@ function SuiteSidebar({
|
|
|
4879
4957
|
collapsed ? "mx-auto size-11 shrink-0 justify-center gap-0 px-0 py-0" : "w-full px-2.5 py-2"
|
|
4880
4958
|
),
|
|
4881
4959
|
children: [
|
|
4882
|
-
/* @__PURE__ */ (0,
|
|
4960
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4883
4961
|
"span",
|
|
4884
4962
|
{
|
|
4885
4963
|
className: cn(
|
|
@@ -4887,7 +4965,7 @@ function SuiteSidebar({
|
|
|
4887
4965
|
item.iconClassName
|
|
4888
4966
|
),
|
|
4889
4967
|
"aria-hidden": true,
|
|
4890
|
-
children: /* @__PURE__ */ (0,
|
|
4968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4891
4969
|
Icon,
|
|
4892
4970
|
{
|
|
4893
4971
|
className: "h-full w-full",
|
|
@@ -4896,7 +4974,7 @@ function SuiteSidebar({
|
|
|
4896
4974
|
)
|
|
4897
4975
|
}
|
|
4898
4976
|
),
|
|
4899
|
-
/* @__PURE__ */ (0,
|
|
4977
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4900
4978
|
"span",
|
|
4901
4979
|
{
|
|
4902
4980
|
className: cn(
|
|
@@ -4907,14 +4985,14 @@ function SuiteSidebar({
|
|
|
4907
4985
|
children: item.label
|
|
4908
4986
|
}
|
|
4909
4987
|
),
|
|
4910
|
-
!collapsed && item.badge ? /* @__PURE__ */ (0,
|
|
4988
|
+
!collapsed && item.badge ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "relative ml-auto shrink-0", children: item.badge }) : null
|
|
4911
4989
|
]
|
|
4912
4990
|
},
|
|
4913
4991
|
item.label
|
|
4914
4992
|
);
|
|
4915
|
-
return collapsed ? /* @__PURE__ */ (0,
|
|
4993
|
+
return collapsed ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Tooltip, { content: item.label, side: "right", children: link }, item.label) : link;
|
|
4916
4994
|
}) }) }),
|
|
4917
|
-
secondaryNav ? /* @__PURE__ */ (0,
|
|
4995
|
+
secondaryNav ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4918
4996
|
"div",
|
|
4919
4997
|
{
|
|
4920
4998
|
className: "min-h-0 flex-1",
|
|
@@ -4926,7 +5004,7 @@ function SuiteSidebar({
|
|
|
4926
5004
|
]
|
|
4927
5005
|
}
|
|
4928
5006
|
),
|
|
4929
|
-
/* @__PURE__ */ (0,
|
|
5007
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4930
5008
|
"div",
|
|
4931
5009
|
{
|
|
4932
5010
|
className: cn(
|
|
@@ -4934,7 +5012,7 @@ function SuiteSidebar({
|
|
|
4934
5012
|
surface ? "bg-ph-surface" : "bg-ph-canvas",
|
|
4935
5013
|
collapsed ? "p-1.5" : "p-3"
|
|
4936
5014
|
),
|
|
4937
|
-
children: /* @__PURE__ */ (0,
|
|
5015
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4938
5016
|
"div",
|
|
4939
5017
|
{
|
|
4940
5018
|
className: cn(
|
|
@@ -4943,8 +5021,8 @@ function SuiteSidebar({
|
|
|
4943
5021
|
),
|
|
4944
5022
|
children: [
|
|
4945
5023
|
renderNode(userMenu, collapsed),
|
|
4946
|
-
showAskAi ? /* @__PURE__ */ (0,
|
|
4947
|
-
showAskAi && footerExtras ? /* @__PURE__ */ (0,
|
|
5024
|
+
showAskAi ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("shrink-0", collapsed ? "mt-2" : "ml-auto"), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Tooltip, { content: "Shelly AI", side: collapsed ? "right" : "top", children: askAiButton }) }) : footerExtras ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("shrink-0", collapsed ? "mt-2" : "ml-auto"), children: renderNode(footerExtras, collapsed) }) : null,
|
|
5025
|
+
showAskAi && footerExtras ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("shrink-0", collapsed && "mt-2"), children: renderNode(footerExtras, collapsed) }) : null
|
|
4948
5026
|
]
|
|
4949
5027
|
}
|
|
4950
5028
|
)
|
|
@@ -4956,7 +5034,7 @@ function SuiteSidebar({
|
|
|
4956
5034
|
}
|
|
4957
5035
|
|
|
4958
5036
|
// src/suite/components/suite-app-layout.tsx
|
|
4959
|
-
var
|
|
5037
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4960
5038
|
function SuiteAppLayout({
|
|
4961
5039
|
sidebar,
|
|
4962
5040
|
children,
|
|
@@ -4970,7 +5048,7 @@ function SuiteAppLayout({
|
|
|
4970
5048
|
onResetWidth,
|
|
4971
5049
|
className
|
|
4972
5050
|
}) {
|
|
4973
|
-
return /* @__PURE__ */ (0,
|
|
5051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
4974
5052
|
"div",
|
|
4975
5053
|
{
|
|
4976
5054
|
"data-test": "app-shell",
|
|
@@ -4979,7 +5057,7 @@ function SuiteAppLayout({
|
|
|
4979
5057
|
className
|
|
4980
5058
|
),
|
|
4981
5059
|
children: [
|
|
4982
|
-
/* @__PURE__ */ (0,
|
|
5060
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
4983
5061
|
"aside",
|
|
4984
5062
|
{
|
|
4985
5063
|
"aria-label": "Sidebar",
|
|
@@ -4987,8 +5065,8 @@ function SuiteAppLayout({
|
|
|
4987
5065
|
style: { width: `${sidebarWidth}px` },
|
|
4988
5066
|
"data-collapsed": collapsed ? "true" : "false",
|
|
4989
5067
|
children: [
|
|
4990
|
-
/* @__PURE__ */ (0,
|
|
4991
|
-
onStartResize ? /* @__PURE__ */ (0,
|
|
5068
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "relative z-0 h-full min-h-0 isolate", children: sidebar }),
|
|
5069
|
+
onStartResize ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4992
5070
|
"div",
|
|
4993
5071
|
{
|
|
4994
5072
|
role: "separator",
|
|
@@ -5020,9 +5098,9 @@ function SuiteAppLayout({
|
|
|
5020
5098
|
]
|
|
5021
5099
|
}
|
|
5022
5100
|
),
|
|
5023
|
-
/* @__PURE__ */ (0,
|
|
5024
|
-
mobileHeader ? /* @__PURE__ */ (0,
|
|
5025
|
-
/* @__PURE__ */ (0,
|
|
5101
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
5102
|
+
mobileHeader ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "shrink-0 lg:hidden", children: mobileHeader }) : null,
|
|
5103
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5026
5104
|
"main",
|
|
5027
5105
|
{
|
|
5028
5106
|
id: "main-content",
|
|
@@ -5036,7 +5114,7 @@ function SuiteAppLayout({
|
|
|
5036
5114
|
children
|
|
5037
5115
|
}
|
|
5038
5116
|
),
|
|
5039
|
-
bottomNav ? /* @__PURE__ */ (0,
|
|
5117
|
+
bottomNav ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "shrink-0 lg:hidden", children: bottomNav }) : null
|
|
5040
5118
|
] })
|
|
5041
5119
|
]
|
|
5042
5120
|
}
|
|
@@ -5049,7 +5127,7 @@ var import_iconoir_react12 = require("iconoir-react");
|
|
|
5049
5127
|
|
|
5050
5128
|
// src/components/ui/Button.tsx
|
|
5051
5129
|
var import_react18 = require("react");
|
|
5052
|
-
var
|
|
5130
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
5053
5131
|
var variantClass = {
|
|
5054
5132
|
primary: "ph-btn-primary",
|
|
5055
5133
|
secondary: "ph-btn-secondary",
|
|
@@ -5108,14 +5186,14 @@ var Button = (0, import_react18.forwardRef)(function Button2(_a2, ref) {
|
|
|
5108
5186
|
]);
|
|
5109
5187
|
const usesLemonChrome = !["tertiary", "ghost", "link"].includes(variant);
|
|
5110
5188
|
const label = loadingLabel != null ? loadingLabel : children;
|
|
5111
|
-
const leadingIcon = loading ? /* @__PURE__ */ (0,
|
|
5112
|
-
const content = usesLemonChrome ? /* @__PURE__ */ (0,
|
|
5113
|
-
leadingIcon != null ? /* @__PURE__ */ (0,
|
|
5114
|
-
label != null ? /* @__PURE__ */ (0,
|
|
5115
|
-
split ? /* @__PURE__ */ (0,
|
|
5116
|
-
sideIcon != null ? /* @__PURE__ */ (0,
|
|
5189
|
+
const leadingIcon = loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ph-btn-spinner", "aria-hidden": true }) : icon;
|
|
5190
|
+
const content = usesLemonChrome ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ButtonChrome, { label, icon: leadingIcon, sideIcon, split }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
5191
|
+
leadingIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ph-btn-icon", children: leadingIcon }) : null,
|
|
5192
|
+
label != null ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ph-btn-label", children: label }) : null,
|
|
5193
|
+
split ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ph-btn-split-divider", "aria-hidden": true }) : null,
|
|
5194
|
+
sideIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ph-btn-side-icon", children: sideIcon }) : null
|
|
5117
5195
|
] });
|
|
5118
|
-
return /* @__PURE__ */ (0,
|
|
5196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5119
5197
|
"button",
|
|
5120
5198
|
__spreadProps(__spreadValues({
|
|
5121
5199
|
ref,
|
|
@@ -5141,7 +5219,7 @@ Button.displayName = "Button";
|
|
|
5141
5219
|
|
|
5142
5220
|
// src/components/ui/Alert.tsx
|
|
5143
5221
|
var import_react19 = require("react");
|
|
5144
|
-
var
|
|
5222
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5145
5223
|
var statusConfig = {
|
|
5146
5224
|
info: { icon: IconInfo },
|
|
5147
5225
|
success: { icon: IconCheckCircle },
|
|
@@ -5180,7 +5258,7 @@ var Alert = (0, import_react19.forwardRef)(function Alert2(_a2, ref) {
|
|
|
5180
5258
|
]);
|
|
5181
5259
|
const config = statusConfig[status];
|
|
5182
5260
|
const Icon = config.icon;
|
|
5183
|
-
return /* @__PURE__ */ (0,
|
|
5261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
5184
5262
|
"div",
|
|
5185
5263
|
__spreadProps(__spreadValues({
|
|
5186
5264
|
ref,
|
|
@@ -5189,20 +5267,20 @@ var Alert = (0, import_react19.forwardRef)(function Alert2(_a2, ref) {
|
|
|
5189
5267
|
className: cn2("ph-alert", statusClassMap[status], className)
|
|
5190
5268
|
}, props), {
|
|
5191
5269
|
children: [
|
|
5192
|
-
icon != null ? icon : /* @__PURE__ */ (0,
|
|
5193
|
-
/* @__PURE__ */ (0,
|
|
5194
|
-
title && /* @__PURE__ */ (0,
|
|
5195
|
-
description && /* @__PURE__ */ (0,
|
|
5270
|
+
icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, { className: "ph-alert-icon mt-0.5 h-5 w-5 shrink-0", "aria-hidden": true }),
|
|
5271
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
5272
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "font-semibold", children: title }),
|
|
5273
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "mt-1 text-sm text-ph-subtle", children: description }),
|
|
5196
5274
|
children
|
|
5197
5275
|
] }),
|
|
5198
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
5276
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5199
5277
|
"button",
|
|
5200
5278
|
{
|
|
5201
5279
|
type: "button",
|
|
5202
5280
|
onClick: onDismiss,
|
|
5203
5281
|
className: "ph-alert-dismiss",
|
|
5204
5282
|
"aria-label": dismissLabel,
|
|
5205
|
-
children: /* @__PURE__ */ (0,
|
|
5283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(IconClose, { className: "h-4 w-4", "aria-hidden": true })
|
|
5206
5284
|
}
|
|
5207
5285
|
)
|
|
5208
5286
|
]
|
|
@@ -5213,7 +5291,7 @@ Alert.displayName = "Alert";
|
|
|
5213
5291
|
|
|
5214
5292
|
// src/components/ui/Badge.tsx
|
|
5215
5293
|
var import_react20 = require("react");
|
|
5216
|
-
var
|
|
5294
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5217
5295
|
var variantMap = {
|
|
5218
5296
|
brand: "ph-badge-brand",
|
|
5219
5297
|
neutral: "ph-badge-neutral",
|
|
@@ -5239,7 +5317,7 @@ var Badge = (0, import_react20.forwardRef)(function Badge2(_a2, ref) {
|
|
|
5239
5317
|
"children",
|
|
5240
5318
|
"className"
|
|
5241
5319
|
]);
|
|
5242
|
-
return /* @__PURE__ */ (0,
|
|
5320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5243
5321
|
"span",
|
|
5244
5322
|
__spreadProps(__spreadValues({
|
|
5245
5323
|
ref,
|
|
@@ -5258,7 +5336,7 @@ Badge.displayName = "Badge";
|
|
|
5258
5336
|
|
|
5259
5337
|
// src/components/ui/Card.tsx
|
|
5260
5338
|
var import_react21 = require("react");
|
|
5261
|
-
var
|
|
5339
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5262
5340
|
var variantMap2 = {
|
|
5263
5341
|
default: "",
|
|
5264
5342
|
outlined: "border-2 border-ph-border",
|
|
@@ -5309,18 +5387,18 @@ var Card = (0, import_react21.forwardRef)(function Card2(_a2, ref) {
|
|
|
5309
5387
|
(interactive || isLink || isButton) && "ph-card-interactive",
|
|
5310
5388
|
className
|
|
5311
5389
|
);
|
|
5312
|
-
const cardContent = /* @__PURE__ */ (0,
|
|
5313
|
-
media && /* @__PURE__ */ (0,
|
|
5314
|
-
/* @__PURE__ */ (0,
|
|
5315
|
-
title && /* @__PURE__ */ (0,
|
|
5316
|
-
description && /* @__PURE__ */ (0,
|
|
5390
|
+
const cardContent = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
5391
|
+
media && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ph-card-media", children: media }),
|
|
5392
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: cn2("ph-card-body", bodyClassName), children: [
|
|
5393
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Title3, { className: "ph-card-title", children: title }),
|
|
5394
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-ph-subtle", children: description }),
|
|
5317
5395
|
children,
|
|
5318
|
-
actions && /* @__PURE__ */ (0,
|
|
5396
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ph-card-actions", children: actions })
|
|
5319
5397
|
] }),
|
|
5320
|
-
footer && /* @__PURE__ */ (0,
|
|
5398
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "border-t border-ph-border px-6 py-4 text-xs text-ph-subtle", children: footer })
|
|
5321
5399
|
] });
|
|
5322
5400
|
if (isLink) {
|
|
5323
|
-
return /* @__PURE__ */ (0,
|
|
5401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5324
5402
|
"a",
|
|
5325
5403
|
__spreadProps(__spreadValues({
|
|
5326
5404
|
ref,
|
|
@@ -5335,7 +5413,7 @@ var Card = (0, import_react21.forwardRef)(function Card2(_a2, ref) {
|
|
|
5335
5413
|
);
|
|
5336
5414
|
}
|
|
5337
5415
|
if (isButton) {
|
|
5338
|
-
return /* @__PURE__ */ (0,
|
|
5416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5339
5417
|
"button",
|
|
5340
5418
|
__spreadProps(__spreadValues({
|
|
5341
5419
|
ref,
|
|
@@ -5347,7 +5425,7 @@ var Card = (0, import_react21.forwardRef)(function Card2(_a2, ref) {
|
|
|
5347
5425
|
})
|
|
5348
5426
|
);
|
|
5349
5427
|
}
|
|
5350
|
-
return /* @__PURE__ */ (0,
|
|
5428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", __spreadProps(__spreadValues({ ref, className: cardClassName }, props), { children: cardContent }));
|
|
5351
5429
|
});
|
|
5352
5430
|
Card.displayName = "Card";
|
|
5353
5431
|
|
|
@@ -5357,7 +5435,7 @@ var import_iconoir_react11 = require("iconoir-react");
|
|
|
5357
5435
|
|
|
5358
5436
|
// src/components/ui/FormField.tsx
|
|
5359
5437
|
var import_react22 = require("react");
|
|
5360
|
-
var
|
|
5438
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
5361
5439
|
function FormField(_a2) {
|
|
5362
5440
|
var _b = _a2, {
|
|
5363
5441
|
controlId,
|
|
@@ -5390,26 +5468,26 @@ function FormField(_a2) {
|
|
|
5390
5468
|
"aria-errormessage": errorId,
|
|
5391
5469
|
"aria-invalid": error ? true : void 0
|
|
5392
5470
|
};
|
|
5393
|
-
return /* @__PURE__ */ (0,
|
|
5394
|
-
label ? /* @__PURE__ */ (0,
|
|
5471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", __spreadProps(__spreadValues({ className: cn2("ph-field", className) }, props), { children: [
|
|
5472
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
5395
5473
|
"label",
|
|
5396
5474
|
{
|
|
5397
5475
|
htmlFor: id,
|
|
5398
5476
|
className: cn2("ph-label", hideLabel && "sr-only", disabled && "opacity-50"),
|
|
5399
5477
|
children: [
|
|
5400
5478
|
label,
|
|
5401
|
-
required ? /* @__PURE__ */ (0,
|
|
5479
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { "aria-hidden": "true", children: " *" }) : null
|
|
5402
5480
|
]
|
|
5403
5481
|
}
|
|
5404
5482
|
) : null,
|
|
5405
5483
|
typeof children === "function" ? children(controlProps) : children,
|
|
5406
|
-
descriptionId ? /* @__PURE__ */ (0,
|
|
5407
|
-
errorId ? /* @__PURE__ */ (0,
|
|
5484
|
+
descriptionId ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { id: descriptionId, className: "mt-1 text-xs text-ph-subtle", children: helperText }) : null,
|
|
5485
|
+
errorId ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { id: errorId, className: "mt-1 text-xs font-medium text-ph-danger", children: error }) : null
|
|
5408
5486
|
] }));
|
|
5409
5487
|
}
|
|
5410
5488
|
|
|
5411
5489
|
// src/components/ui/Input.tsx
|
|
5412
|
-
var
|
|
5490
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5413
5491
|
var sizeMap2 = {
|
|
5414
5492
|
sm: "ph-input-sm",
|
|
5415
5493
|
md: "",
|
|
@@ -5454,7 +5532,7 @@ var Input = (0, import_react23.forwardRef)(function Input2(_a2, ref) {
|
|
|
5454
5532
|
const hasError = Boolean(error);
|
|
5455
5533
|
const isPassword = type === "password";
|
|
5456
5534
|
const [revealed, setRevealed] = (0, import_react23.useState)(false);
|
|
5457
|
-
return /* @__PURE__ */ (0,
|
|
5535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5458
5536
|
FormField,
|
|
5459
5537
|
{
|
|
5460
5538
|
controlId: id,
|
|
@@ -5465,8 +5543,8 @@ var Input = (0, import_react23.forwardRef)(function Input2(_a2, ref) {
|
|
|
5465
5543
|
required,
|
|
5466
5544
|
disabled,
|
|
5467
5545
|
className: wrapperClassName,
|
|
5468
|
-
children: (fieldProps) => /* @__PURE__ */ (0,
|
|
5469
|
-
/* @__PURE__ */ (0,
|
|
5546
|
+
children: (fieldProps) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative", children: [
|
|
5547
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5470
5548
|
"input",
|
|
5471
5549
|
__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
5472
5550
|
ref,
|
|
@@ -5485,7 +5563,7 @@ var Input = (0, import_react23.forwardRef)(function Input2(_a2, ref) {
|
|
|
5485
5563
|
)
|
|
5486
5564
|
}), props)
|
|
5487
5565
|
),
|
|
5488
|
-
isPassword ? /* @__PURE__ */ (0,
|
|
5566
|
+
isPassword ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5489
5567
|
"button",
|
|
5490
5568
|
{
|
|
5491
5569
|
type: "button",
|
|
@@ -5494,7 +5572,7 @@ var Input = (0, import_react23.forwardRef)(function Input2(_a2, ref) {
|
|
|
5494
5572
|
"aria-pressed": revealed,
|
|
5495
5573
|
disabled,
|
|
5496
5574
|
className: "absolute inset-y-0 right-0 flex w-10 items-center justify-center rounded-r-[var(--ph-radius-control)] text-ph-mutedtext transition-colors hover:text-ph-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-focus disabled:opacity-40",
|
|
5497
|
-
children: revealed ? /* @__PURE__ */ (0,
|
|
5575
|
+
children: revealed ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_iconoir_react11.EyeClosed, { className: "h-4 w-4", "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_iconoir_react11.Eye, { className: "h-4 w-4", "aria-hidden": true })
|
|
5498
5576
|
}
|
|
5499
5577
|
) : null
|
|
5500
5578
|
] })
|
|
@@ -5533,7 +5611,7 @@ var Select = (0, import_react23.forwardRef)(function Select2(_a2, ref) {
|
|
|
5533
5611
|
const autoId = (0, import_react23.useId)();
|
|
5534
5612
|
const id = idProp != null ? idProp : autoId;
|
|
5535
5613
|
const hasError = Boolean(error);
|
|
5536
|
-
return /* @__PURE__ */ (0,
|
|
5614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormField, { controlId: id, label, hideLabel, helperText, error, required, disabled, className: wrapperClassName, children: (fieldProps) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5537
5615
|
"select",
|
|
5538
5616
|
__spreadProps(__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
5539
5617
|
ref,
|
|
@@ -5582,7 +5660,7 @@ var Textarea = (0, import_react23.forwardRef)(function Textarea2(_a2, ref) {
|
|
|
5582
5660
|
const autoId = (0, import_react23.useId)();
|
|
5583
5661
|
const id = idProp != null ? idProp : autoId;
|
|
5584
5662
|
const hasError = Boolean(error);
|
|
5585
|
-
return /* @__PURE__ */ (0,
|
|
5663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormField, { controlId: id, label, hideLabel, helperText, error, required, disabled, className: wrapperClassName, children: (fieldProps) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5586
5664
|
"textarea",
|
|
5587
5665
|
__spreadValues(__spreadProps(__spreadValues({}, fieldProps), {
|
|
5588
5666
|
ref,
|
|
@@ -5625,9 +5703,9 @@ var Checkbox = (0, import_react23.forwardRef)(function Checkbox2(_a2, ref) {
|
|
|
5625
5703
|
const hasError = Boolean(error);
|
|
5626
5704
|
const descriptionId = helperText && !hasError ? `${id}-description` : void 0;
|
|
5627
5705
|
const errorId = error ? `${id}-error` : void 0;
|
|
5628
|
-
return /* @__PURE__ */ (0,
|
|
5629
|
-
/* @__PURE__ */ (0,
|
|
5630
|
-
/* @__PURE__ */ (0,
|
|
5706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn2("ph-control-row", wrapperClassName), children: [
|
|
5707
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "ph-checkbox-wrap", children: [
|
|
5708
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5631
5709
|
"input",
|
|
5632
5710
|
__spreadValues({
|
|
5633
5711
|
ref,
|
|
@@ -5645,12 +5723,12 @@ var Checkbox = (0, import_react23.forwardRef)(function Checkbox2(_a2, ref) {
|
|
|
5645
5723
|
)
|
|
5646
5724
|
}, props)
|
|
5647
5725
|
),
|
|
5648
|
-
/* @__PURE__ */ (0,
|
|
5726
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(IconCheck, { className: "ph-checkbox-icon", "aria-hidden": true })
|
|
5649
5727
|
] }),
|
|
5650
|
-
/* @__PURE__ */ (0,
|
|
5651
|
-
/* @__PURE__ */ (0,
|
|
5652
|
-
descriptionId ? /* @__PURE__ */ (0,
|
|
5653
|
-
errorId ? /* @__PURE__ */ (0,
|
|
5728
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ph-control-copy", children: [
|
|
5729
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("label", { htmlFor: id, className: cn2("cursor-pointer", disabled && "opacity-60"), children: label }),
|
|
5730
|
+
descriptionId ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { id: descriptionId, className: "text-xs text-ph-subtle", children: helperText }) : null,
|
|
5731
|
+
errorId ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { id: errorId, className: "text-xs font-medium text-ph-danger", children: error }) : null
|
|
5654
5732
|
] })
|
|
5655
5733
|
] });
|
|
5656
5734
|
});
|
|
@@ -5671,8 +5749,8 @@ var Radio = (0, import_react23.forwardRef)(function Radio2(_a2, ref) {
|
|
|
5671
5749
|
]);
|
|
5672
5750
|
const autoId = (0, import_react23.useId)();
|
|
5673
5751
|
const id = idProp != null ? idProp : autoId;
|
|
5674
|
-
return /* @__PURE__ */ (0,
|
|
5675
|
-
/* @__PURE__ */ (0,
|
|
5752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn2("ph-control-row", wrapperClassName, disabled && "opacity-60"), children: [
|
|
5753
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5676
5754
|
"input",
|
|
5677
5755
|
__spreadValues({
|
|
5678
5756
|
ref,
|
|
@@ -5682,7 +5760,7 @@ var Radio = (0, import_react23.forwardRef)(function Radio2(_a2, ref) {
|
|
|
5682
5760
|
className: cn2("ph-radio", disabled && "cursor-not-allowed", className)
|
|
5683
5761
|
}, props)
|
|
5684
5762
|
),
|
|
5685
|
-
/* @__PURE__ */ (0,
|
|
5763
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("label", { htmlFor: id, className: cn2("cursor-pointer", disabled && "opacity-60"), children: label })
|
|
5686
5764
|
] });
|
|
5687
5765
|
});
|
|
5688
5766
|
Radio.displayName = "Radio";
|
|
@@ -5702,9 +5780,9 @@ var Toggle = (0, import_react23.forwardRef)(function Toggle2(_a2, ref) {
|
|
|
5702
5780
|
]);
|
|
5703
5781
|
const autoId = (0, import_react23.useId)();
|
|
5704
5782
|
const id = idProp != null ? idProp : autoId;
|
|
5705
|
-
return /* @__PURE__ */ (0,
|
|
5706
|
-
/* @__PURE__ */ (0,
|
|
5707
|
-
/* @__PURE__ */ (0,
|
|
5783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("label", { className: cn2("ph-control-row-between", wrapperClassName, disabled && "opacity-60"), children: [
|
|
5784
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: disabled ? "opacity-60" : void 0, children: label }),
|
|
5785
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5708
5786
|
"input",
|
|
5709
5787
|
__spreadValues({
|
|
5710
5788
|
ref,
|
|
@@ -5738,13 +5816,13 @@ var Range = (0, import_react23.forwardRef)(function Range2(_a2, ref) {
|
|
|
5738
5816
|
]);
|
|
5739
5817
|
const autoId = (0, import_react23.useId)();
|
|
5740
5818
|
const id = idProp != null ? idProp : autoId;
|
|
5741
|
-
return /* @__PURE__ */ (0,
|
|
5742
|
-
label && /* @__PURE__ */ (0,
|
|
5743
|
-
/* @__PURE__ */ (0,
|
|
5744
|
-
(minLabel || valueLabel || maxLabel) && /* @__PURE__ */ (0,
|
|
5745
|
-
/* @__PURE__ */ (0,
|
|
5746
|
-
/* @__PURE__ */ (0,
|
|
5747
|
-
/* @__PURE__ */ (0,
|
|
5819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn2("ph-field", wrapperClassName), children: [
|
|
5820
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
5821
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", __spreadValues({ ref, id, type: "range", className: cn2("ph-range", className) }, props)),
|
|
5822
|
+
(minLabel || valueLabel || maxLabel) && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex justify-between text-xs text-ph-mutedtext", children: [
|
|
5823
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: minLabel }),
|
|
5824
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: valueLabel }),
|
|
5825
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: maxLabel })
|
|
5748
5826
|
] })
|
|
5749
5827
|
] });
|
|
5750
5828
|
});
|
|
@@ -5765,10 +5843,10 @@ var FileUpload = (0, import_react23.forwardRef)(function FileUpload2(_a2, ref) {
|
|
|
5765
5843
|
]);
|
|
5766
5844
|
const autoId = (0, import_react23.useId)();
|
|
5767
5845
|
const id = idProp != null ? idProp : autoId;
|
|
5768
|
-
return /* @__PURE__ */ (0,
|
|
5769
|
-
label && /* @__PURE__ */ (0,
|
|
5770
|
-
/* @__PURE__ */ (0,
|
|
5771
|
-
/* @__PURE__ */ (0,
|
|
5846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn2("ph-field", wrapperClassName), children: [
|
|
5847
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("label", { htmlFor: id, className: "ph-label", children: label }),
|
|
5848
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("label", { htmlFor: id, className: "ph-file-upload", children: [
|
|
5849
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", __spreadValues({ ref, id, type: "file", className: cn2("sr-only", className) }, props)),
|
|
5772
5850
|
prompt
|
|
5773
5851
|
] })
|
|
5774
5852
|
] });
|
|
@@ -5778,7 +5856,7 @@ FileUpload.displayName = "FileUpload";
|
|
|
5778
5856
|
// src/components/ui/Modal.tsx
|
|
5779
5857
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
5780
5858
|
var import_react24 = require("react");
|
|
5781
|
-
var
|
|
5859
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5782
5860
|
var sizeMap3 = {
|
|
5783
5861
|
sm: "max-w-sm",
|
|
5784
5862
|
md: "max-w-lg",
|
|
@@ -5809,15 +5887,15 @@ function Modal({
|
|
|
5809
5887
|
}) {
|
|
5810
5888
|
const canDismiss = Boolean(onClose);
|
|
5811
5889
|
const restoreFocusRef = (0, import_react24.useRef)(null);
|
|
5812
|
-
return /* @__PURE__ */ (0,
|
|
5890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5813
5891
|
Dialog2.Root,
|
|
5814
5892
|
{
|
|
5815
5893
|
open,
|
|
5816
5894
|
onOpenChange: (nextOpen) => {
|
|
5817
5895
|
if (!nextOpen) onClose == null ? void 0 : onClose();
|
|
5818
5896
|
},
|
|
5819
|
-
children: /* @__PURE__ */ (0,
|
|
5820
|
-
/* @__PURE__ */ (0,
|
|
5897
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Dialog2.Portal, { children: [
|
|
5898
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5821
5899
|
Dialog2.Overlay,
|
|
5822
5900
|
{
|
|
5823
5901
|
"data-test": dataTest,
|
|
@@ -5825,7 +5903,7 @@ function Modal({
|
|
|
5825
5903
|
style: zIndex ? { zIndex } : void 0
|
|
5826
5904
|
}
|
|
5827
5905
|
),
|
|
5828
|
-
/* @__PURE__ */ (0,
|
|
5906
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5829
5907
|
Dialog2.Content,
|
|
5830
5908
|
__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({
|
|
5831
5909
|
id,
|
|
@@ -5848,28 +5926,28 @@ function Modal({
|
|
|
5848
5926
|
onPointerDownOutside: (event) => {
|
|
5849
5927
|
if (!canDismiss || !closeOnOutsideClick) event.preventDefault();
|
|
5850
5928
|
},
|
|
5851
|
-
children: customLayout ? /* @__PURE__ */ (0,
|
|
5852
|
-
/* @__PURE__ */ (0,
|
|
5929
|
+
children: customLayout ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
5930
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Dialog2.Title, { className: "sr-only", children: ariaLabel != null ? ariaLabel : "Dialog" }),
|
|
5853
5931
|
children
|
|
5854
|
-
] }) : /* @__PURE__ */ (0,
|
|
5855
|
-
title ? null : /* @__PURE__ */ (0,
|
|
5856
|
-
title || description || showCloseButton && canDismiss ? /* @__PURE__ */ (0,
|
|
5857
|
-
/* @__PURE__ */ (0,
|
|
5858
|
-
title ? /* @__PURE__ */ (0,
|
|
5859
|
-
description ? /* @__PURE__ */ (0,
|
|
5932
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
5933
|
+
title ? null : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Dialog2.Title, { className: "sr-only", children: ariaLabel != null ? ariaLabel : "Dialog" }),
|
|
5934
|
+
title || description || showCloseButton && canDismiss ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("header", { className: "ph-modal-header", children: [
|
|
5935
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "min-w-0", children: [
|
|
5936
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Dialog2.Title, { className: "text-lg font-bold text-ph-ink", children: title }) : null,
|
|
5937
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Dialog2.Description, { className: "mt-1 text-sm text-ph-subtle", children: description }) : null
|
|
5860
5938
|
] }),
|
|
5861
|
-
showCloseButton && canDismiss ? /* @__PURE__ */ (0,
|
|
5939
|
+
showCloseButton && canDismiss ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Dialog2.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5862
5940
|
"button",
|
|
5863
5941
|
{
|
|
5864
5942
|
type: "button",
|
|
5865
5943
|
className: "ph-modal-close",
|
|
5866
5944
|
"aria-label": "Close dialog",
|
|
5867
|
-
children: /* @__PURE__ */ (0,
|
|
5945
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(IconClose, { className: "h-5 w-5", "aria-hidden": true })
|
|
5868
5946
|
}
|
|
5869
5947
|
) }) : null
|
|
5870
5948
|
] }) : null,
|
|
5871
|
-
/* @__PURE__ */ (0,
|
|
5872
|
-
footer ? /* @__PURE__ */ (0,
|
|
5949
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn2("ph-modal-body", bodyClassName), children }),
|
|
5950
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "ph-modal-footer", children: footer }) : null
|
|
5873
5951
|
] })
|
|
5874
5952
|
})
|
|
5875
5953
|
)
|
|
@@ -5879,24 +5957,24 @@ function Modal({
|
|
|
5879
5957
|
}
|
|
5880
5958
|
|
|
5881
5959
|
// src/suite/components/suite-integration-picker.tsx
|
|
5882
|
-
var
|
|
5960
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
5883
5961
|
var DESCRIPTION_LIMIT = 90;
|
|
5884
5962
|
function IntegrationSkeletonCard() {
|
|
5885
|
-
return /* @__PURE__ */ (0,
|
|
5963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
5886
5964
|
"div",
|
|
5887
5965
|
{
|
|
5888
5966
|
className: "flex min-h-36 min-w-0 animate-pulse flex-col justify-between rounded-xl border border-ph-border bg-ph-surface p-4",
|
|
5889
5967
|
"aria-hidden": "true",
|
|
5890
5968
|
children: [
|
|
5891
|
-
/* @__PURE__ */ (0,
|
|
5892
|
-
/* @__PURE__ */ (0,
|
|
5893
|
-
/* @__PURE__ */ (0,
|
|
5894
|
-
/* @__PURE__ */ (0,
|
|
5895
|
-
/* @__PURE__ */ (0,
|
|
5896
|
-
/* @__PURE__ */ (0,
|
|
5969
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
5970
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "h-8 w-8 shrink-0 rounded-md bg-ph-muted" }),
|
|
5971
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "min-w-0 flex-1 space-y-2 pt-1", children: [
|
|
5972
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "h-4 w-3/5 rounded bg-ph-muted" }),
|
|
5973
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "h-3 w-full rounded bg-ph-muted" }),
|
|
5974
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "h-3 w-4/5 rounded bg-ph-muted" })
|
|
5897
5975
|
] })
|
|
5898
5976
|
] }),
|
|
5899
|
-
/* @__PURE__ */ (0,
|
|
5977
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "mt-3 h-9 w-20 rounded bg-ph-muted" })
|
|
5900
5978
|
]
|
|
5901
5979
|
}
|
|
5902
5980
|
);
|
|
@@ -5921,33 +5999,18 @@ function authSchemesFor(item) {
|
|
|
5921
5999
|
)
|
|
5922
6000
|
);
|
|
5923
6001
|
}
|
|
5924
|
-
var
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
chat: ["tides", "kraken"],
|
|
5929
|
-
documents: ["kraken"],
|
|
5930
|
-
notes: ["kraken"],
|
|
5931
|
-
knowledge: ["kraken"],
|
|
5932
|
-
file_storage: ["kraken"],
|
|
5933
|
-
crm: ["shellstack", "tides"],
|
|
5934
|
-
finance: ["shellstack", "tides"],
|
|
5935
|
-
payment: ["shellstack", "tides"],
|
|
5936
|
-
monitoring: ["tides", "kraken"],
|
|
5937
|
-
design: ["tides", "kraken"],
|
|
5938
|
-
support: ["tides", "shellstack"],
|
|
5939
|
-
ticketing: ["tides", "kraken"]
|
|
6002
|
+
var BRIDGE_MARK = {
|
|
6003
|
+
turtletime: { src: "/turtletime-icon.svg", name: "TurtleTime" },
|
|
6004
|
+
tides: { src: "/tides-icon.svg", name: "Tides" },
|
|
6005
|
+
kraken: { src: "/kraken-icon.svg", name: "Kraken" }
|
|
5940
6006
|
};
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
const apps = /* @__PURE__ */ new Set();
|
|
5945
|
-
for (const category of categories != null ? categories : []) {
|
|
5946
|
-
for (const app of (_a2 = CATEGORY_APP_AFFINITY[category.trim().toLowerCase()]) != null ? _a2 : []) {
|
|
5947
|
-
apps.add(app);
|
|
5948
|
-
}
|
|
6007
|
+
function suiteAppsForIntegration(itemOrCategories) {
|
|
6008
|
+
if (!itemOrCategories || Array.isArray(itemOrCategories) || !("bridgeTargets" in itemOrCategories)) {
|
|
6009
|
+
return [];
|
|
5949
6010
|
}
|
|
5950
|
-
|
|
6011
|
+
const explicit = itemOrCategories.bridgeTargets;
|
|
6012
|
+
if (!Array.isArray(explicit)) return [];
|
|
6013
|
+
return explicit.filter((app) => app in BRIDGE_MARK);
|
|
5951
6014
|
}
|
|
5952
6015
|
function SuiteIntegrationPicker({
|
|
5953
6016
|
open,
|
|
@@ -5963,6 +6026,8 @@ function SuiteIntegrationPicker({
|
|
|
5963
6026
|
category: controlledCategory,
|
|
5964
6027
|
categories: controlledCategories,
|
|
5965
6028
|
onCategoryChange,
|
|
6029
|
+
bridgeOnly: controlledBridgeOnly,
|
|
6030
|
+
onBridgeOnlyChange,
|
|
5966
6031
|
onClose,
|
|
5967
6032
|
onConnect,
|
|
5968
6033
|
onFetchAuthFields,
|
|
@@ -5976,6 +6041,7 @@ function SuiteIntegrationPicker({
|
|
|
5976
6041
|
const [categoryQuery, setCategoryQuery] = (0, import_react25.useState)("");
|
|
5977
6042
|
const [categoryMenuOpen, setCategoryMenuOpen] = (0, import_react25.useState)(false);
|
|
5978
6043
|
const [expanded, setExpanded] = (0, import_react25.useState)(null);
|
|
6044
|
+
const [bridgeOnlyInternal, setBridgeOnlyInternal] = (0, import_react25.useState)(false);
|
|
5979
6045
|
const categoryMenuRef = (0, import_react25.useRef)(null);
|
|
5980
6046
|
const categoryTriggerRef = (0, import_react25.useRef)(null);
|
|
5981
6047
|
const categorySearchRef = (0, import_react25.useRef)(null);
|
|
@@ -5986,6 +6052,7 @@ function SuiteIntegrationPicker({
|
|
|
5986
6052
|
const scrollViewportRef = (0, import_react25.useRef)(null);
|
|
5987
6053
|
const loadMoreSentinelRef = (0, import_react25.useRef)(null);
|
|
5988
6054
|
const loadMoreInFlightRef = (0, import_react25.useRef)(false);
|
|
6055
|
+
const sentinelVisibleRef = (0, import_react25.useRef)(false);
|
|
5989
6056
|
const authRequestRef = (0, import_react25.useRef)(0);
|
|
5990
6057
|
const [methodItem, setMethodItem] = (0, import_react25.useState)(null);
|
|
5991
6058
|
const [authItem, setAuthItem] = (0, import_react25.useState)(null);
|
|
@@ -6009,11 +6076,20 @@ function SuiteIntegrationPicker({
|
|
|
6009
6076
|
const categories = controlledCategories != null ? controlledCategories : itemCategories;
|
|
6010
6077
|
const activeSearch = controlledSearch != null ? controlledSearch : query;
|
|
6011
6078
|
const activeCategory = controlledCategory != null ? controlledCategory : category;
|
|
6079
|
+
const bridgeOnly = controlledBridgeOnly != null ? controlledBridgeOnly : bridgeOnlyInternal;
|
|
6080
|
+
const setBridgeOnly = (value) => {
|
|
6081
|
+
setBridgeOnlyInternal(value);
|
|
6082
|
+
onBridgeOnlyChange == null ? void 0 : onBridgeOnlyChange(value);
|
|
6083
|
+
};
|
|
6012
6084
|
const categoryLabel = (value) => value.replace(/[-_]/g, " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
|
|
6013
|
-
const
|
|
6085
|
+
const catalogItems = onSearchChange || onCategoryChange ? items : items.filter((item) => {
|
|
6014
6086
|
var _a2;
|
|
6015
6087
|
return item.label.toLowerCase().includes(activeSearch.trim().toLowerCase()) && (activeCategory === "all" || ((_a2 = item.categories) != null ? _a2 : []).includes(activeCategory));
|
|
6016
6088
|
});
|
|
6089
|
+
const filtered = bridgeOnly && controlledBridgeOnly === void 0 ? catalogItems.filter((item) => {
|
|
6090
|
+
var _a2;
|
|
6091
|
+
return ((_a2 = item.bridgeTargets) != null ? _a2 : []).length > 0;
|
|
6092
|
+
}) : catalogItems;
|
|
6017
6093
|
const visibleCategories = categories.filter(
|
|
6018
6094
|
(value) => categoryLabel(value).toLowerCase().includes(categoryQuery.trim().toLowerCase())
|
|
6019
6095
|
);
|
|
@@ -6211,23 +6287,31 @@ function SuiteIntegrationPicker({
|
|
|
6211
6287
|
(0, import_react25.useEffect)(() => {
|
|
6212
6288
|
const root = scrollViewportRef.current;
|
|
6213
6289
|
const sentinel = loadMoreSentinelRef.current;
|
|
6214
|
-
if (!open || !root || !sentinel
|
|
6290
|
+
if (!open || !root || !sentinel) {
|
|
6291
|
+
sentinelVisibleRef.current = false;
|
|
6215
6292
|
return;
|
|
6216
6293
|
}
|
|
6217
6294
|
const observer = new IntersectionObserver(
|
|
6218
6295
|
([entry]) => {
|
|
6219
|
-
if (!entry.isIntersecting
|
|
6296
|
+
if (!entry.isIntersecting) {
|
|
6297
|
+
sentinelVisibleRef.current = false;
|
|
6298
|
+
return;
|
|
6299
|
+
}
|
|
6300
|
+
if (sentinelVisibleRef.current) return;
|
|
6301
|
+
sentinelVisibleRef.current = true;
|
|
6302
|
+
if (loadMoreInFlightRef.current || !hasMore || !onEndReached || loading || catalogLoading || loadingMore) {
|
|
6303
|
+
return;
|
|
6304
|
+
}
|
|
6220
6305
|
loadMoreInFlightRef.current = true;
|
|
6221
|
-
observer.unobserve(entry.target);
|
|
6222
6306
|
onEndReached();
|
|
6223
6307
|
},
|
|
6224
|
-
{ root, rootMargin: "0px 0px
|
|
6308
|
+
{ root, rootMargin: "0px 0px 120px", threshold: 0 }
|
|
6225
6309
|
);
|
|
6226
6310
|
observer.observe(sentinel);
|
|
6227
6311
|
return () => observer.disconnect();
|
|
6228
6312
|
}, [catalogLoading, hasMore, loading, loadingMore, onEndReached, open]);
|
|
6229
|
-
return /* @__PURE__ */ (0,
|
|
6230
|
-
/* @__PURE__ */ (0,
|
|
6313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
6314
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6231
6315
|
Modal,
|
|
6232
6316
|
{
|
|
6233
6317
|
open,
|
|
@@ -6237,18 +6321,46 @@ function SuiteIntegrationPicker({
|
|
|
6237
6321
|
size: "xl",
|
|
6238
6322
|
dataTest,
|
|
6239
6323
|
bodyClassName: "!overflow-hidden",
|
|
6240
|
-
children: /* @__PURE__ */ (0,
|
|
6241
|
-
connectionError ? /* @__PURE__ */ (0,
|
|
6242
|
-
/* @__PURE__ */ (0,
|
|
6243
|
-
|
|
6244
|
-
|
|
6324
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "space-y-4", children: [
|
|
6325
|
+
connectionError ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-sm text-ph-danger", role: "alert", children: connectionError }) : null,
|
|
6326
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6327
|
+
"label",
|
|
6328
|
+
{
|
|
6329
|
+
className: "inline-flex w-fit cursor-pointer items-center gap-2 text-sm text-ph-ink",
|
|
6330
|
+
"data-test": `${dataTest}-bridge-only`,
|
|
6331
|
+
children: [
|
|
6332
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6333
|
+
"input",
|
|
6334
|
+
{
|
|
6335
|
+
type: "checkbox",
|
|
6336
|
+
role: "switch",
|
|
6337
|
+
className: "ph-toggle",
|
|
6338
|
+
checked: bridgeOnly,
|
|
6339
|
+
onChange: (event) => setBridgeOnly(event.target.checked),
|
|
6340
|
+
"aria-label": "Shelly Bridge only"
|
|
6341
|
+
}
|
|
6342
|
+
),
|
|
6343
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6344
|
+
import_iconoir_react12.Bridge3d,
|
|
6345
|
+
{
|
|
6346
|
+
className: "h-4 w-4 shrink-0 text-ph-subtle",
|
|
6347
|
+
"aria-hidden": true
|
|
6348
|
+
}
|
|
6349
|
+
),
|
|
6350
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: "Shelly Bridge only" })
|
|
6351
|
+
]
|
|
6352
|
+
}
|
|
6353
|
+
),
|
|
6354
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
6355
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "relative", children: [
|
|
6356
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6245
6357
|
import_iconoir_react12.Search,
|
|
6246
6358
|
{
|
|
6247
6359
|
className: "pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-ph-subtle",
|
|
6248
6360
|
"aria-hidden": true
|
|
6249
6361
|
}
|
|
6250
6362
|
),
|
|
6251
|
-
/* @__PURE__ */ (0,
|
|
6363
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6252
6364
|
Input,
|
|
6253
6365
|
{
|
|
6254
6366
|
value: activeSearch,
|
|
@@ -6262,8 +6374,8 @@ function SuiteIntegrationPicker({
|
|
|
6262
6374
|
}
|
|
6263
6375
|
)
|
|
6264
6376
|
] }),
|
|
6265
|
-
/* @__PURE__ */ (0,
|
|
6266
|
-
/* @__PURE__ */ (0,
|
|
6377
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { ref: categoryMenuRef, className: "relative", children: [
|
|
6378
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6267
6379
|
"button",
|
|
6268
6380
|
{
|
|
6269
6381
|
ref: categoryTriggerRef,
|
|
@@ -6280,17 +6392,17 @@ function SuiteIntegrationPicker({
|
|
|
6280
6392
|
},
|
|
6281
6393
|
onKeyDown: handleCategoryTriggerKeyDown,
|
|
6282
6394
|
children: [
|
|
6283
|
-
/* @__PURE__ */ (0,
|
|
6284
|
-
/* @__PURE__ */ (0,
|
|
6395
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
6396
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6285
6397
|
import_iconoir_react12.Filter,
|
|
6286
6398
|
{
|
|
6287
6399
|
className: "h-4 w-4 shrink-0 text-ph-subtle",
|
|
6288
6400
|
"aria-hidden": true
|
|
6289
6401
|
}
|
|
6290
6402
|
),
|
|
6291
|
-
/* @__PURE__ */ (0,
|
|
6403
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: activeCategory === "all" ? "All apps" : categoryLabel(activeCategory) })
|
|
6292
6404
|
] }),
|
|
6293
|
-
/* @__PURE__ */ (0,
|
|
6405
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6294
6406
|
import_iconoir_react12.NavArrowDown,
|
|
6295
6407
|
{
|
|
6296
6408
|
className: `h-4 w-4 transition-transform ${categoryMenuOpen ? "rotate-180" : ""}`,
|
|
@@ -6300,12 +6412,12 @@ function SuiteIntegrationPicker({
|
|
|
6300
6412
|
]
|
|
6301
6413
|
}
|
|
6302
6414
|
),
|
|
6303
|
-
categoryMenuOpen ? /* @__PURE__ */ (0,
|
|
6415
|
+
categoryMenuOpen ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6304
6416
|
"div",
|
|
6305
6417
|
{
|
|
6306
6418
|
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",
|
|
6307
6419
|
children: [
|
|
6308
|
-
/* @__PURE__ */ (0,
|
|
6420
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6309
6421
|
Input,
|
|
6310
6422
|
{
|
|
6311
6423
|
ref: categorySearchRef,
|
|
@@ -6325,7 +6437,7 @@ function SuiteIntegrationPicker({
|
|
|
6325
6437
|
}
|
|
6326
6438
|
}
|
|
6327
6439
|
),
|
|
6328
|
-
/* @__PURE__ */ (0,
|
|
6440
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6329
6441
|
"div",
|
|
6330
6442
|
{
|
|
6331
6443
|
id: `${dataTest}-category-options`,
|
|
@@ -6333,7 +6445,7 @@ function SuiteIntegrationPicker({
|
|
|
6333
6445
|
"aria-label": "Integration categories",
|
|
6334
6446
|
className: "mt-2 max-h-52 overflow-y-auto",
|
|
6335
6447
|
"data-test": "integration-category-options",
|
|
6336
|
-
children: categoryValues.map((value) => /* @__PURE__ */ (0,
|
|
6448
|
+
children: categoryValues.map((value) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6337
6449
|
"button",
|
|
6338
6450
|
{
|
|
6339
6451
|
type: "button",
|
|
@@ -6365,82 +6477,81 @@ function SuiteIntegrationPicker({
|
|
|
6365
6477
|
) : null
|
|
6366
6478
|
] })
|
|
6367
6479
|
] }),
|
|
6368
|
-
/* @__PURE__ */ (0,
|
|
6480
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6369
6481
|
"div",
|
|
6370
6482
|
{
|
|
6371
6483
|
ref: scrollViewportRef,
|
|
6372
6484
|
className: "min-h-0 max-h-[min(60vh,32rem)] w-full overflow-y-auto pr-1",
|
|
6373
6485
|
children: [
|
|
6374
|
-
loading || catalogLoading ? /* @__PURE__ */ (0,
|
|
6486
|
+
loading || catalogLoading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6375
6487
|
"div",
|
|
6376
6488
|
{
|
|
6377
6489
|
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
6378
6490
|
"aria-label": "Loading apps",
|
|
6379
|
-
children: Array.from({ length: SKELETON_COUNT }, (_, index) => /* @__PURE__ */ (0,
|
|
6491
|
+
children: Array.from({ length: SKELETON_COUNT }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IntegrationSkeletonCard, {}, index))
|
|
6380
6492
|
}
|
|
6381
|
-
) : /* @__PURE__ */ (0,
|
|
6493
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: [
|
|
6382
6494
|
filtered.map((item) => {
|
|
6383
6495
|
var _a2, _b;
|
|
6384
6496
|
const isExpanded = expanded === item.id;
|
|
6385
6497
|
const longDescription = item.description.length > DESCRIPTION_LIMIT;
|
|
6498
|
+
const bridgeApps = suiteAppsForIntegration(item);
|
|
6499
|
+
const schemes = authSchemesFor(item);
|
|
6386
6500
|
const text = isExpanded || !longDescription ? item.description : `${item.description.slice(0, DESCRIPTION_LIMIT).trimEnd()}...`;
|
|
6387
|
-
return /* @__PURE__ */ (0,
|
|
6501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6388
6502
|
"div",
|
|
6389
6503
|
{
|
|
6390
6504
|
className: "flex min-h-36 min-w-0 flex-col justify-between rounded-xl border border-ph-border bg-ph-surface p-4",
|
|
6391
6505
|
children: [
|
|
6392
|
-
/* @__PURE__ */ (0,
|
|
6506
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6393
6507
|
"button",
|
|
6394
6508
|
{
|
|
6395
6509
|
type: "button",
|
|
6396
6510
|
className: "min-w-0 text-left",
|
|
6397
6511
|
onClick: () => longDescription && setExpanded(isExpanded ? null : item.id),
|
|
6398
6512
|
"aria-expanded": isExpanded,
|
|
6399
|
-
children: /* @__PURE__ */ (0,
|
|
6400
|
-
/* @__PURE__ */ (0,
|
|
6401
|
-
/* @__PURE__ */ (0,
|
|
6402
|
-
/* @__PURE__ */ (0,
|
|
6403
|
-
/* @__PURE__ */ (0,
|
|
6404
|
-
longDescription ? /* @__PURE__ */ (0,
|
|
6513
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex items-start gap-3", children: [
|
|
6514
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("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__ */ (0, import_jsx_runtime40.jsx)(import_iconoir_react12.EvPlug, { className: "h-4 w-4", "aria-hidden": true }) }),
|
|
6515
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "min-w-0", children: [
|
|
6516
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "block truncate font-medium text-ph-ink", children: item.label }),
|
|
6517
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "mt-1 block text-xs text-ph-subtle", children: text }),
|
|
6518
|
+
longDescription ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "mt-1 block text-xs font-medium text-ph-brand", children: [
|
|
6405
6519
|
isExpanded ? "See less" : "See more",
|
|
6406
6520
|
" ",
|
|
6407
|
-
isExpanded ? /* @__PURE__ */ (0,
|
|
6521
|
+
isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_iconoir_react12.NavArrowUp, { className: "inline h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_iconoir_react12.NavArrowDown, { className: "inline h-3 w-3" })
|
|
6408
6522
|
] }) : null
|
|
6409
6523
|
] })
|
|
6410
6524
|
] })
|
|
6411
6525
|
}
|
|
6412
6526
|
),
|
|
6413
|
-
|
|
6527
|
+
bridgeApps.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6414
6528
|
"div",
|
|
6415
6529
|
{
|
|
6416
6530
|
className: "mt-3 flex flex-wrap items-center gap-1.5",
|
|
6417
|
-
"aria-label": "
|
|
6418
|
-
children:
|
|
6419
|
-
|
|
6420
|
-
|
|
6531
|
+
"aria-label": "Bridges into ShellStack apps",
|
|
6532
|
+
children: bridgeApps.map((app) => {
|
|
6533
|
+
const mark = BRIDGE_MARK[app];
|
|
6534
|
+
if (!mark) return null;
|
|
6535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6536
|
+
"img",
|
|
6421
6537
|
{
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
size: 16,
|
|
6428
|
-
label: `Works with ${SUITE_APP_MAP[app].name}`,
|
|
6429
|
-
className: "rounded-[4px]"
|
|
6430
|
-
}
|
|
6431
|
-
)
|
|
6538
|
+
src: mark.src,
|
|
6539
|
+
alt: "",
|
|
6540
|
+
title: `Bridge in ${mark.name}`,
|
|
6541
|
+
className: "h-5 w-5",
|
|
6542
|
+
"data-test": `${dataTest}-${item.id}-app-${app}`
|
|
6432
6543
|
},
|
|
6433
6544
|
app
|
|
6434
|
-
)
|
|
6435
|
-
)
|
|
6545
|
+
);
|
|
6546
|
+
})
|
|
6436
6547
|
}
|
|
6437
6548
|
) : null,
|
|
6438
|
-
|
|
6549
|
+
schemes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6439
6550
|
"div",
|
|
6440
6551
|
{
|
|
6441
6552
|
className: "mt-3 flex flex-wrap gap-1.5",
|
|
6442
6553
|
"aria-label": "Connection methods",
|
|
6443
|
-
children:
|
|
6554
|
+
children: schemes.map((scheme) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6444
6555
|
"span",
|
|
6445
6556
|
{
|
|
6446
6557
|
className: "rounded-full border border-ph-border bg-ph-muted px-2 py-1 text-[0.6875rem] font-medium text-ph-subtle",
|
|
@@ -6451,7 +6562,7 @@ function SuiteIntegrationPicker({
|
|
|
6451
6562
|
))
|
|
6452
6563
|
}
|
|
6453
6564
|
) : null,
|
|
6454
|
-
/* @__PURE__ */ (0,
|
|
6565
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6455
6566
|
Button,
|
|
6456
6567
|
{
|
|
6457
6568
|
type: "button",
|
|
@@ -6459,8 +6570,8 @@ function SuiteIntegrationPicker({
|
|
|
6459
6570
|
className: "mt-3 self-start",
|
|
6460
6571
|
disabled: Boolean(item.unavailableReason) || item.connecting,
|
|
6461
6572
|
onClick: () => connectItem(item),
|
|
6462
|
-
children: /* @__PURE__ */ (0,
|
|
6463
|
-
/* @__PURE__ */ (0,
|
|
6573
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
6574
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_iconoir_react12.EvPlug, { className: "h-3.5 w-3.5", "aria-hidden": true }),
|
|
6464
6575
|
item.connecting ? "Connecting..." : (_b = item.unavailableReason) != null ? _b : "Connect"
|
|
6465
6576
|
] })
|
|
6466
6577
|
}
|
|
@@ -6470,31 +6581,31 @@ function SuiteIntegrationPicker({
|
|
|
6470
6581
|
item.id
|
|
6471
6582
|
);
|
|
6472
6583
|
}),
|
|
6473
|
-
loadingMore ? Array.from({ length: 3 }, (_, index) => /* @__PURE__ */ (0,
|
|
6584
|
+
loadingMore ? Array.from({ length: 3 }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IntegrationSkeletonCard, {}, `loading-${index}`)) : null
|
|
6474
6585
|
] }),
|
|
6475
|
-
/* @__PURE__ */ (0,
|
|
6586
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { ref: loadMoreSentinelRef, className: "h-1", "aria-hidden": "true" })
|
|
6476
6587
|
]
|
|
6477
6588
|
}
|
|
6478
6589
|
),
|
|
6479
|
-
connectedItems.length > 0 && onDisconnect ? /* @__PURE__ */ (0,
|
|
6480
|
-
/* @__PURE__ */ (0,
|
|
6481
|
-
connectedItems.map((item) => /* @__PURE__ */ (0,
|
|
6590
|
+
connectedItems.length > 0 && onDisconnect ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "space-y-2 border-t border-ph-border pt-4", children: [
|
|
6591
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h3", { className: "font-medium text-ph-ink", children: "Connected apps" }),
|
|
6592
|
+
connectedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6482
6593
|
"div",
|
|
6483
6594
|
{
|
|
6484
6595
|
className: "flex items-center justify-between gap-3 rounded-lg border border-ph-border bg-ph-muted p-3",
|
|
6485
6596
|
children: [
|
|
6486
|
-
/* @__PURE__ */ (0,
|
|
6597
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex min-w-0 items-center gap-2 text-sm text-ph-ink", children: [
|
|
6487
6598
|
item.icon,
|
|
6488
|
-
/* @__PURE__ */ (0,
|
|
6599
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "truncate", children: item.label })
|
|
6489
6600
|
] }),
|
|
6490
|
-
/* @__PURE__ */ (0,
|
|
6601
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6491
6602
|
Button,
|
|
6492
6603
|
{
|
|
6493
6604
|
type: "button",
|
|
6494
6605
|
variant: "danger",
|
|
6495
6606
|
onClick: () => requestDisconnect(item),
|
|
6496
|
-
children: /* @__PURE__ */ (0,
|
|
6497
|
-
/* @__PURE__ */ (0,
|
|
6607
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
6608
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_iconoir_react12.Xmark, { className: "h-4 w-4", "aria-hidden": true }),
|
|
6498
6609
|
"Disconnect"
|
|
6499
6610
|
] })
|
|
6500
6611
|
}
|
|
@@ -6507,7 +6618,7 @@ function SuiteIntegrationPicker({
|
|
|
6507
6618
|
] })
|
|
6508
6619
|
}
|
|
6509
6620
|
),
|
|
6510
|
-
/* @__PURE__ */ (0,
|
|
6621
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6511
6622
|
Modal,
|
|
6512
6623
|
{
|
|
6513
6624
|
open: itemToDisconnect !== null,
|
|
@@ -6519,8 +6630,8 @@ function SuiteIntegrationPicker({
|
|
|
6519
6630
|
size: "sm",
|
|
6520
6631
|
zIndex: 220,
|
|
6521
6632
|
dataTest: `${dataTest}-disconnect-confirmation`,
|
|
6522
|
-
footer: /* @__PURE__ */ (0,
|
|
6523
|
-
/* @__PURE__ */ (0,
|
|
6633
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
6634
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6524
6635
|
Button,
|
|
6525
6636
|
{
|
|
6526
6637
|
type: "button",
|
|
@@ -6530,7 +6641,7 @@ function SuiteIntegrationPicker({
|
|
|
6530
6641
|
children: "Cancel"
|
|
6531
6642
|
}
|
|
6532
6643
|
),
|
|
6533
|
-
/* @__PURE__ */ (0,
|
|
6644
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6534
6645
|
Button,
|
|
6535
6646
|
{
|
|
6536
6647
|
type: "button",
|
|
@@ -6543,8 +6654,8 @@ function SuiteIntegrationPicker({
|
|
|
6543
6654
|
)
|
|
6544
6655
|
] }),
|
|
6545
6656
|
children: [
|
|
6546
|
-
disconnectError ? /* @__PURE__ */ (0,
|
|
6547
|
-
/* @__PURE__ */ (0,
|
|
6657
|
+
disconnectError ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-sm text-ph-danger", role: "alert", children: disconnectError }) : null,
|
|
6658
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: "text-sm text-ph-ink", children: [
|
|
6548
6659
|
"Disconnect ",
|
|
6549
6660
|
itemToDisconnect == null ? void 0 : itemToDisconnect.label,
|
|
6550
6661
|
"? You can reconnect it later."
|
|
@@ -6552,7 +6663,7 @@ function SuiteIntegrationPicker({
|
|
|
6552
6663
|
]
|
|
6553
6664
|
}
|
|
6554
6665
|
),
|
|
6555
|
-
/* @__PURE__ */ (0,
|
|
6666
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6556
6667
|
Modal,
|
|
6557
6668
|
{
|
|
6558
6669
|
open: Boolean(methodItem),
|
|
@@ -6562,7 +6673,7 @@ function SuiteIntegrationPicker({
|
|
|
6562
6673
|
size: "sm",
|
|
6563
6674
|
zIndex: 200,
|
|
6564
6675
|
dataTest: `${dataTest}-auth-method`,
|
|
6565
|
-
children: methodItem ? /* @__PURE__ */ (0,
|
|
6676
|
+
children: methodItem ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "space-y-2", children: authSchemesFor(methodItem).map((scheme) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6566
6677
|
"button",
|
|
6567
6678
|
{
|
|
6568
6679
|
type: "button",
|
|
@@ -6570,15 +6681,15 @@ function SuiteIntegrationPicker({
|
|
|
6570
6681
|
onClick: () => void prepareConnection(methodItem, scheme),
|
|
6571
6682
|
"data-test": `${dataTest}-choose-${scheme.toLowerCase()}`,
|
|
6572
6683
|
children: [
|
|
6573
|
-
/* @__PURE__ */ (0,
|
|
6574
|
-
/* @__PURE__ */ (0,
|
|
6684
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "font-medium", children: authSchemeLabel(scheme) }),
|
|
6685
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-xs text-ph-subtle", children: "Select" })
|
|
6575
6686
|
]
|
|
6576
6687
|
},
|
|
6577
6688
|
scheme
|
|
6578
6689
|
)) }) : null
|
|
6579
6690
|
}
|
|
6580
6691
|
),
|
|
6581
|
-
/* @__PURE__ */ (0,
|
|
6692
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6582
6693
|
Modal,
|
|
6583
6694
|
{
|
|
6584
6695
|
open: Boolean(authItem),
|
|
@@ -6588,14 +6699,14 @@ function SuiteIntegrationPicker({
|
|
|
6588
6699
|
size: "md",
|
|
6589
6700
|
zIndex: 210,
|
|
6590
6701
|
dataTest: `${dataTest}-auth-form`,
|
|
6591
|
-
children: authLoading ? /* @__PURE__ */ (0,
|
|
6702
|
+
children: authLoading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-sm text-ph-subtle", children: "Loading authentication fields..." }) : authItem ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6592
6703
|
"form",
|
|
6593
6704
|
{
|
|
6594
6705
|
className: "space-y-4",
|
|
6595
6706
|
onSubmit: (event) => void submitAuthForm(event),
|
|
6596
6707
|
children: [
|
|
6597
|
-
authError ? /* @__PURE__ */ (0,
|
|
6598
|
-
authItem.fields.length === 0 && authError ? /* @__PURE__ */ (0,
|
|
6708
|
+
authError ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-sm text-ph-danger", role: "alert", children: authError }) : null,
|
|
6709
|
+
authItem.fields.length === 0 && authError ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6599
6710
|
Button,
|
|
6600
6711
|
{
|
|
6601
6712
|
type: "button",
|
|
@@ -6606,7 +6717,7 @@ function SuiteIntegrationPicker({
|
|
|
6606
6717
|
) : null,
|
|
6607
6718
|
authItem.fields.map((field) => {
|
|
6608
6719
|
var _a2, _b;
|
|
6609
|
-
return /* @__PURE__ */ (0,
|
|
6720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6610
6721
|
Input,
|
|
6611
6722
|
{
|
|
6612
6723
|
label: field.label,
|
|
@@ -6622,8 +6733,8 @@ function SuiteIntegrationPicker({
|
|
|
6622
6733
|
field.name
|
|
6623
6734
|
);
|
|
6624
6735
|
}),
|
|
6625
|
-
/* @__PURE__ */ (0,
|
|
6626
|
-
/* @__PURE__ */ (0,
|
|
6736
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex justify-end gap-2 border-t border-ph-border pt-4", children: [
|
|
6737
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6627
6738
|
Button,
|
|
6628
6739
|
{
|
|
6629
6740
|
type: "button",
|
|
@@ -6633,7 +6744,7 @@ function SuiteIntegrationPicker({
|
|
|
6633
6744
|
children: "Cancel"
|
|
6634
6745
|
}
|
|
6635
6746
|
),
|
|
6636
|
-
/* @__PURE__ */ (0,
|
|
6747
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Button, { type: "submit", variant: "primary", disabled: authSubmitting, children: authSubmitting ? "Connecting..." : "Connect" })
|
|
6637
6748
|
] })
|
|
6638
6749
|
]
|
|
6639
6750
|
}
|
|
@@ -6646,7 +6757,7 @@ function SuiteIntegrationPicker({
|
|
|
6646
6757
|
// src/suite/components/suite-integration-rules.tsx
|
|
6647
6758
|
var import_react26 = require("react");
|
|
6648
6759
|
var import_iconoir_react13 = require("iconoir-react");
|
|
6649
|
-
var
|
|
6760
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6650
6761
|
var ACTION_LABELS = {
|
|
6651
6762
|
create_tides_task: "Create a Tides task",
|
|
6652
6763
|
draft_time_entry: "Draft a time entry",
|
|
@@ -6752,20 +6863,20 @@ function SuiteIntegrationRules({
|
|
|
6752
6863
|
setBusyId(null);
|
|
6753
6864
|
}
|
|
6754
6865
|
}
|
|
6755
|
-
return /* @__PURE__ */ (0,
|
|
6756
|
-
/* @__PURE__ */ (0,
|
|
6866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: "space-y-4", "data-test": dataTest, children: [
|
|
6867
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
6757
6868
|
Card,
|
|
6758
6869
|
{
|
|
6759
6870
|
variant: "outlined",
|
|
6760
6871
|
bodyClassName: "p-5",
|
|
6761
6872
|
"data-test": `${dataTest}-card`,
|
|
6762
6873
|
children: [
|
|
6763
|
-
/* @__PURE__ */ (0,
|
|
6764
|
-
/* @__PURE__ */ (0,
|
|
6765
|
-
/* @__PURE__ */ (0,
|
|
6766
|
-
/* @__PURE__ */ (0,
|
|
6874
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between", children: [
|
|
6875
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
6876
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h3", { className: "font-medium text-ph-ink", children: "Automation rules" }),
|
|
6877
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "mt-1 text-sm text-ph-subtle", children: "Turn incoming integration events into tasks, time entries, or notifications for this workspace." })
|
|
6767
6878
|
] }),
|
|
6768
|
-
canManage && onCreate ? /* @__PURE__ */ (0,
|
|
6879
|
+
canManage && onCreate ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6769
6880
|
Button,
|
|
6770
6881
|
{
|
|
6771
6882
|
type: "button",
|
|
@@ -6773,14 +6884,14 @@ function SuiteIntegrationRules({
|
|
|
6773
6884
|
size: "sm",
|
|
6774
6885
|
onClick: () => setFormOpen((open) => !open),
|
|
6775
6886
|
"data-test": `${dataTest}-new`,
|
|
6776
|
-
children: /* @__PURE__ */ (0,
|
|
6777
|
-
/* @__PURE__ */ (0,
|
|
6887
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
6888
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_iconoir_react13.Plus, { className: "h-4 w-4", "aria-hidden": true }),
|
|
6778
6889
|
"New rule"
|
|
6779
6890
|
] })
|
|
6780
6891
|
}
|
|
6781
6892
|
) : null
|
|
6782
6893
|
] }),
|
|
6783
|
-
error ? /* @__PURE__ */ (0,
|
|
6894
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6784
6895
|
Alert,
|
|
6785
6896
|
{
|
|
6786
6897
|
status: "danger",
|
|
@@ -6788,36 +6899,36 @@ function SuiteIntegrationRules({
|
|
|
6788
6899
|
description: error
|
|
6789
6900
|
}
|
|
6790
6901
|
) : null,
|
|
6791
|
-
loading ? /* @__PURE__ */ (0,
|
|
6902
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "mt-4 text-sm text-ph-subtle", children: "Loading rules..." }) : rules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6792
6903
|
"div",
|
|
6793
6904
|
{
|
|
6794
6905
|
className: "mt-4 rounded-lg border border-dashed border-ph-border px-4 py-6 text-center",
|
|
6795
6906
|
"data-test": `${dataTest}-empty`,
|
|
6796
|
-
children: /* @__PURE__ */ (0,
|
|
6907
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "text-sm text-ph-subtle", children: [
|
|
6797
6908
|
"No automation rules yet.",
|
|
6798
6909
|
canManage ? " Create one to get started." : ""
|
|
6799
6910
|
] })
|
|
6800
6911
|
}
|
|
6801
|
-
) : /* @__PURE__ */ (0,
|
|
6912
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("ul", { className: "mt-4 space-y-2", "data-test": `${dataTest}-list`, children: rules.map((rule) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
6802
6913
|
"li",
|
|
6803
6914
|
{
|
|
6804
6915
|
className: "flex items-center justify-between gap-3 rounded-lg border border-ph-border bg-ph-muted px-3 py-3",
|
|
6805
6916
|
"data-test": `${dataTest}-rule-${rule.id}`,
|
|
6806
6917
|
children: [
|
|
6807
|
-
/* @__PURE__ */ (0,
|
|
6808
|
-
/* @__PURE__ */ (0,
|
|
6809
|
-
/* @__PURE__ */ (0,
|
|
6918
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "min-w-0", children: [
|
|
6919
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "truncate text-sm font-medium text-ph-ink", children: rule.name }),
|
|
6920
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "mt-0.5 truncate text-xs text-ph-subtle", children: [
|
|
6810
6921
|
rule.trigger_event_type,
|
|
6811
6922
|
" \u2192 ",
|
|
6812
6923
|
actionLabel(rule.action_type)
|
|
6813
6924
|
] }),
|
|
6814
|
-
/* @__PURE__ */ (0,
|
|
6925
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "mt-0.5 truncate text-xs text-ph-subtle", children: [
|
|
6815
6926
|
"Last fired: ",
|
|
6816
6927
|
formatDateTime(rule.last_fired_at)
|
|
6817
6928
|
] })
|
|
6818
6929
|
] }),
|
|
6819
|
-
canManage ? /* @__PURE__ */ (0,
|
|
6820
|
-
/* @__PURE__ */ (0,
|
|
6930
|
+
canManage ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
6931
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6821
6932
|
Toggle,
|
|
6822
6933
|
{
|
|
6823
6934
|
checked: rule.enabled,
|
|
@@ -6826,7 +6937,7 @@ function SuiteIntegrationRules({
|
|
|
6826
6937
|
"aria-label": `Enable ${rule.name}`
|
|
6827
6938
|
}
|
|
6828
6939
|
),
|
|
6829
|
-
/* @__PURE__ */ (0,
|
|
6940
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6830
6941
|
Button,
|
|
6831
6942
|
{
|
|
6832
6943
|
type: "button",
|
|
@@ -6835,10 +6946,10 @@ function SuiteIntegrationRules({
|
|
|
6835
6946
|
disabled: busyId === rule.id,
|
|
6836
6947
|
onClick: () => requestDelete(rule),
|
|
6837
6948
|
"aria-label": `Delete ${rule.name}`,
|
|
6838
|
-
children: /* @__PURE__ */ (0,
|
|
6949
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_iconoir_react13.Xmark, { className: "h-4 w-4", "aria-hidden": true })
|
|
6839
6950
|
}
|
|
6840
6951
|
)
|
|
6841
|
-
] }) : /* @__PURE__ */ (0,
|
|
6952
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6842
6953
|
Badge,
|
|
6843
6954
|
{
|
|
6844
6955
|
variant: rule.enabled ? "success" : "neutral",
|
|
@@ -6850,15 +6961,15 @@ function SuiteIntegrationRules({
|
|
|
6850
6961
|
},
|
|
6851
6962
|
rule.id
|
|
6852
6963
|
)) }),
|
|
6853
|
-
canManage && formOpen && onCreate ? /* @__PURE__ */ (0,
|
|
6964
|
+
canManage && formOpen && onCreate ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
6854
6965
|
"form",
|
|
6855
6966
|
{
|
|
6856
6967
|
className: "mt-4 space-y-3 rounded-lg border border-ph-border bg-ph-surface p-4",
|
|
6857
6968
|
onSubmit: (event) => void submitForm(event),
|
|
6858
6969
|
"data-test": `${dataTest}-form`,
|
|
6859
6970
|
children: [
|
|
6860
|
-
formError ? /* @__PURE__ */ (0,
|
|
6861
|
-
/* @__PURE__ */ (0,
|
|
6971
|
+
formError ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-sm text-ph-danger", role: "alert", children: formError }) : null,
|
|
6972
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6862
6973
|
Input,
|
|
6863
6974
|
{
|
|
6864
6975
|
label: "Rule name",
|
|
@@ -6869,7 +6980,7 @@ function SuiteIntegrationRules({
|
|
|
6869
6980
|
"data-test": `${dataTest}-name`
|
|
6870
6981
|
}
|
|
6871
6982
|
),
|
|
6872
|
-
/* @__PURE__ */ (0,
|
|
6983
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6873
6984
|
Input,
|
|
6874
6985
|
{
|
|
6875
6986
|
label: "Trigger event type",
|
|
@@ -6881,7 +6992,7 @@ function SuiteIntegrationRules({
|
|
|
6881
6992
|
"data-test": `${dataTest}-trigger`
|
|
6882
6993
|
}
|
|
6883
6994
|
),
|
|
6884
|
-
/* @__PURE__ */ (0,
|
|
6995
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6885
6996
|
Select,
|
|
6886
6997
|
{
|
|
6887
6998
|
label: "Action",
|
|
@@ -6890,10 +7001,10 @@ function SuiteIntegrationRules({
|
|
|
6890
7001
|
event.target.value
|
|
6891
7002
|
),
|
|
6892
7003
|
"data-test": `${dataTest}-action`,
|
|
6893
|
-
children: Object.entries(ACTION_LABELS).map(([value, label]) => /* @__PURE__ */ (0,
|
|
7004
|
+
children: Object.entries(ACTION_LABELS).map(([value, label]) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value, children: label }, value))
|
|
6894
7005
|
}
|
|
6895
7006
|
),
|
|
6896
|
-
needsProject ? /* @__PURE__ */ (0,
|
|
7007
|
+
needsProject ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
6897
7008
|
Select,
|
|
6898
7009
|
{
|
|
6899
7010
|
label: "Project",
|
|
@@ -6901,12 +7012,12 @@ function SuiteIntegrationRules({
|
|
|
6901
7012
|
onChange: (event) => setProjectId(event.target.value),
|
|
6902
7013
|
"data-test": `${dataTest}-project`,
|
|
6903
7014
|
children: [
|
|
6904
|
-
/* @__PURE__ */ (0,
|
|
6905
|
-
projects.map((project) => /* @__PURE__ */ (0,
|
|
7015
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value: "", children: "Choose a project..." }),
|
|
7016
|
+
projects.map((project) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value: project.id, children: project.name }, project.id))
|
|
6906
7017
|
]
|
|
6907
7018
|
}
|
|
6908
7019
|
) : null,
|
|
6909
|
-
actionType === "draft_time_entry" ? /* @__PURE__ */ (0,
|
|
7020
|
+
actionType === "draft_time_entry" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6910
7021
|
Input,
|
|
6911
7022
|
{
|
|
6912
7023
|
label: "Minutes (optional)",
|
|
@@ -6917,7 +7028,7 @@ function SuiteIntegrationRules({
|
|
|
6917
7028
|
"data-test": `${dataTest}-minutes`
|
|
6918
7029
|
}
|
|
6919
7030
|
) : null,
|
|
6920
|
-
actionType === "create_tides_task" ? /* @__PURE__ */ (0,
|
|
7031
|
+
actionType === "create_tides_task" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
6921
7032
|
Select,
|
|
6922
7033
|
{
|
|
6923
7034
|
label: "Priority",
|
|
@@ -6925,15 +7036,15 @@ function SuiteIntegrationRules({
|
|
|
6925
7036
|
onChange: (event) => setPriority(event.target.value),
|
|
6926
7037
|
"data-test": `${dataTest}-priority`,
|
|
6927
7038
|
children: [
|
|
6928
|
-
/* @__PURE__ */ (0,
|
|
6929
|
-
/* @__PURE__ */ (0,
|
|
6930
|
-
/* @__PURE__ */ (0,
|
|
6931
|
-
/* @__PURE__ */ (0,
|
|
7039
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value: "low", children: "Low" }),
|
|
7040
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value: "medium", children: "Medium" }),
|
|
7041
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value: "high", children: "High" }),
|
|
7042
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value: "urgent", children: "Urgent" })
|
|
6932
7043
|
]
|
|
6933
7044
|
}
|
|
6934
7045
|
) : null,
|
|
6935
|
-
/* @__PURE__ */ (0,
|
|
6936
|
-
/* @__PURE__ */ (0,
|
|
7046
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex justify-end gap-2 border-t border-ph-border pt-3", children: [
|
|
7047
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6937
7048
|
Button,
|
|
6938
7049
|
{
|
|
6939
7050
|
type: "button",
|
|
@@ -6943,7 +7054,7 @@ function SuiteIntegrationRules({
|
|
|
6943
7054
|
children: "Cancel"
|
|
6944
7055
|
}
|
|
6945
7056
|
),
|
|
6946
|
-
/* @__PURE__ */ (0,
|
|
7057
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Button, { type: "submit", variant: "primary", disabled: submitting, children: submitting ? "Creating..." : "Create rule" })
|
|
6947
7058
|
] })
|
|
6948
7059
|
]
|
|
6949
7060
|
}
|
|
@@ -6951,7 +7062,7 @@ function SuiteIntegrationRules({
|
|
|
6951
7062
|
]
|
|
6952
7063
|
}
|
|
6953
7064
|
),
|
|
6954
|
-
/* @__PURE__ */ (0,
|
|
7065
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
6955
7066
|
Modal,
|
|
6956
7067
|
{
|
|
6957
7068
|
open: ruleToDelete !== null,
|
|
@@ -6961,8 +7072,8 @@ function SuiteIntegrationRules({
|
|
|
6961
7072
|
title: "Delete automation rule",
|
|
6962
7073
|
description: "This action cannot be undone.",
|
|
6963
7074
|
dataTest: `${dataTest}-delete-confirmation`,
|
|
6964
|
-
footer: /* @__PURE__ */ (0,
|
|
6965
|
-
/* @__PURE__ */ (0,
|
|
7075
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
7076
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6966
7077
|
Button,
|
|
6967
7078
|
{
|
|
6968
7079
|
type: "button",
|
|
@@ -6972,7 +7083,7 @@ function SuiteIntegrationRules({
|
|
|
6972
7083
|
children: "Cancel"
|
|
6973
7084
|
}
|
|
6974
7085
|
),
|
|
6975
|
-
/* @__PURE__ */ (0,
|
|
7086
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6976
7087
|
Button,
|
|
6977
7088
|
{
|
|
6978
7089
|
type: "button",
|
|
@@ -6985,8 +7096,8 @@ function SuiteIntegrationRules({
|
|
|
6985
7096
|
)
|
|
6986
7097
|
] }),
|
|
6987
7098
|
children: [
|
|
6988
|
-
deleteError ? /* @__PURE__ */ (0,
|
|
6989
|
-
/* @__PURE__ */ (0,
|
|
7099
|
+
deleteError ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-sm text-ph-danger", role: "alert", children: deleteError }) : null,
|
|
7100
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "text-sm text-ph-ink", children: [
|
|
6990
7101
|
"Delete ",
|
|
6991
7102
|
ruleToDelete == null ? void 0 : ruleToDelete.name,
|
|
6992
7103
|
"? This cannot be undone."
|
|
@@ -6994,36 +7105,36 @@ function SuiteIntegrationRules({
|
|
|
6994
7105
|
]
|
|
6995
7106
|
}
|
|
6996
7107
|
),
|
|
6997
|
-
/* @__PURE__ */ (0,
|
|
7108
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
6998
7109
|
Card,
|
|
6999
7110
|
{
|
|
7000
7111
|
variant: "outlined",
|
|
7001
7112
|
bodyClassName: "p-5",
|
|
7002
7113
|
"data-test": `${dataTest}-events-card`,
|
|
7003
7114
|
children: [
|
|
7004
|
-
/* @__PURE__ */ (0,
|
|
7005
|
-
/* @__PURE__ */ (0,
|
|
7006
|
-
events.length === 0 ? /* @__PURE__ */ (0,
|
|
7115
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h3", { className: "font-medium text-ph-ink", children: "Recent events" }),
|
|
7116
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "mt-1 text-sm text-ph-subtle", children: "The latest events received from your connected apps." }),
|
|
7117
|
+
events.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7007
7118
|
"p",
|
|
7008
7119
|
{
|
|
7009
7120
|
className: "mt-4 rounded-lg border border-dashed border-ph-border px-4 py-6 text-center text-sm text-ph-subtle",
|
|
7010
7121
|
"data-test": `${dataTest}-events-empty`,
|
|
7011
7122
|
children: "No integration events yet."
|
|
7012
7123
|
}
|
|
7013
|
-
) : /* @__PURE__ */ (0,
|
|
7124
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("ul", { className: "mt-4 space-y-2", "data-test": `${dataTest}-events-list`, children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
7014
7125
|
"li",
|
|
7015
7126
|
{
|
|
7016
7127
|
className: "flex items-center justify-between gap-3 rounded-lg border border-ph-border bg-ph-muted px-3 py-2",
|
|
7017
7128
|
children: [
|
|
7018
|
-
/* @__PURE__ */ (0,
|
|
7019
|
-
/* @__PURE__ */ (0,
|
|
7129
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "min-w-0", children: [
|
|
7130
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "truncate text-sm text-ph-ink", children: [
|
|
7020
7131
|
event.provider,
|
|
7021
7132
|
" \xB7 ",
|
|
7022
7133
|
event.event_type
|
|
7023
7134
|
] }),
|
|
7024
|
-
/* @__PURE__ */ (0,
|
|
7135
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "mt-0.5 text-xs text-ph-subtle", children: formatDateTime(event.created_at) })
|
|
7025
7136
|
] }),
|
|
7026
|
-
/* @__PURE__ */ (0,
|
|
7137
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7027
7138
|
Badge,
|
|
7028
7139
|
{
|
|
7029
7140
|
variant: event.processed_at ? "success" : "warning",
|
|
@@ -7098,7 +7209,7 @@ function paletteIconSrc(imageUrl, color) {
|
|
|
7098
7209
|
}
|
|
7099
7210
|
|
|
7100
7211
|
// src/suite/components/suite-entity-icon.tsx
|
|
7101
|
-
var
|
|
7212
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7102
7213
|
function SuiteEntityIcon({
|
|
7103
7214
|
imageUrl,
|
|
7104
7215
|
label,
|
|
@@ -7113,7 +7224,7 @@ function SuiteEntityIcon({
|
|
|
7113
7224
|
const neutralBackground = "var(--ph-muted, rgba(127,127,127,0.08))";
|
|
7114
7225
|
if (imageUrl) {
|
|
7115
7226
|
const src = tinted && tint ? paletteIconSrc(imageUrl, tint) : imageUrl;
|
|
7116
|
-
return /* @__PURE__ */ (0,
|
|
7227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7117
7228
|
"span",
|
|
7118
7229
|
{
|
|
7119
7230
|
className: cn2(
|
|
@@ -7124,12 +7235,12 @@ function SuiteEntityIcon({
|
|
|
7124
7235
|
style: __spreadValues({
|
|
7125
7236
|
backgroundColor: tint ? `${tint}18` : neutralBackground
|
|
7126
7237
|
}, style),
|
|
7127
|
-
children: /* @__PURE__ */ (0,
|
|
7238
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("img", { src: src != null ? src : void 0, alt: "", className: "h-full w-full object-cover" })
|
|
7128
7239
|
}
|
|
7129
7240
|
);
|
|
7130
7241
|
}
|
|
7131
7242
|
const initial = label == null ? void 0 : label.trim().charAt(0).toUpperCase();
|
|
7132
|
-
return /* @__PURE__ */ (0,
|
|
7243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7133
7244
|
"span",
|
|
7134
7245
|
{
|
|
7135
7246
|
className: cn2(
|
|
@@ -7142,7 +7253,7 @@ function SuiteEntityIcon({
|
|
|
7142
7253
|
backgroundColor: tint ? `${tint}18` : neutralBackground
|
|
7143
7254
|
}, style),
|
|
7144
7255
|
"aria-hidden": "true",
|
|
7145
|
-
children: initial ? /* @__PURE__ */ (0,
|
|
7256
|
+
children: initial ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-[0.7em]", children: initial }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "block h-1.5 w-1.5 rounded-full bg-current opacity-40" })
|
|
7146
7257
|
}
|
|
7147
7258
|
);
|
|
7148
7259
|
}
|
|
@@ -7150,7 +7261,7 @@ function SuiteEntityIcon({
|
|
|
7150
7261
|
// src/suite/components/suite-palette-library.tsx
|
|
7151
7262
|
var import_react27 = require("react");
|
|
7152
7263
|
var import_iconoir_react14 = require("iconoir-react");
|
|
7153
|
-
var
|
|
7264
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
7154
7265
|
var PAGE_SIZE = 60;
|
|
7155
7266
|
var DISCOVER_LIMIT = 120;
|
|
7156
7267
|
var ICON_TYPES = [
|
|
@@ -7168,15 +7279,15 @@ function FilterSelect({
|
|
|
7168
7279
|
onChange,
|
|
7169
7280
|
children
|
|
7170
7281
|
}) {
|
|
7171
|
-
return /* @__PURE__ */ (0,
|
|
7172
|
-
/* @__PURE__ */ (0,
|
|
7282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "relative", children: [
|
|
7283
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7173
7284
|
Icon,
|
|
7174
7285
|
{
|
|
7175
7286
|
className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
7176
7287
|
"aria-hidden": true
|
|
7177
7288
|
}
|
|
7178
7289
|
),
|
|
7179
|
-
/* @__PURE__ */ (0,
|
|
7290
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7180
7291
|
"select",
|
|
7181
7292
|
{
|
|
7182
7293
|
"aria-label": label,
|
|
@@ -7186,7 +7297,7 @@ function FilterSelect({
|
|
|
7186
7297
|
children
|
|
7187
7298
|
}
|
|
7188
7299
|
),
|
|
7189
|
-
/* @__PURE__ */ (0,
|
|
7300
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7190
7301
|
import_iconoir_react14.NavArrowDown,
|
|
7191
7302
|
{
|
|
7192
7303
|
className: "pointer-events-none absolute right-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ph-mutedtext",
|
|
@@ -7348,18 +7459,18 @@ function SuitePaletteLibrary({
|
|
|
7348
7459
|
document.addEventListener("pointerdown", onPointerDown);
|
|
7349
7460
|
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
7350
7461
|
}, [libraryOpen]);
|
|
7351
|
-
return /* @__PURE__ */ (0,
|
|
7352
|
-
/* @__PURE__ */ (0,
|
|
7353
|
-
/* @__PURE__ */ (0,
|
|
7354
|
-
/* @__PURE__ */ (0,
|
|
7355
|
-
/* @__PURE__ */ (0,
|
|
7462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "space-y-3", "data-test": "palette-icon-library", children: [
|
|
7463
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { ref: libraryRef, className: "space-y-2", children: [
|
|
7464
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
7465
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "relative flex-1", children: [
|
|
7466
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7356
7467
|
import_iconoir_react14.Search,
|
|
7357
7468
|
{
|
|
7358
7469
|
className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
7359
7470
|
"aria-hidden": true
|
|
7360
7471
|
}
|
|
7361
7472
|
),
|
|
7362
|
-
/* @__PURE__ */ (0,
|
|
7473
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7363
7474
|
"input",
|
|
7364
7475
|
{
|
|
7365
7476
|
type: "search",
|
|
@@ -7371,7 +7482,7 @@ function SuitePaletteLibrary({
|
|
|
7371
7482
|
}
|
|
7372
7483
|
)
|
|
7373
7484
|
] }),
|
|
7374
|
-
/* @__PURE__ */ (0,
|
|
7485
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
7375
7486
|
"button",
|
|
7376
7487
|
{
|
|
7377
7488
|
type: "button",
|
|
@@ -7380,9 +7491,9 @@ function SuitePaletteLibrary({
|
|
|
7380
7491
|
onClick: () => setLibraryOpen((open) => !open),
|
|
7381
7492
|
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",
|
|
7382
7493
|
children: [
|
|
7383
|
-
/* @__PURE__ */ (0,
|
|
7384
|
-
/* @__PURE__ */ (0,
|
|
7385
|
-
/* @__PURE__ */ (0,
|
|
7494
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_iconoir_react14.FilterList, { className: "h-4 w-4 shrink-0 text-ph-mutedtext", "aria-hidden": true }),
|
|
7495
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "max-w-[10rem] truncate", children: (_b = activeLibrary == null ? void 0 : activeLibrary.name) != null ? _b : "All libraries" }),
|
|
7496
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7386
7497
|
import_iconoir_react14.NavArrowDown,
|
|
7387
7498
|
{
|
|
7388
7499
|
className: cn2(
|
|
@@ -7395,27 +7506,27 @@ function SuitePaletteLibrary({
|
|
|
7395
7506
|
]
|
|
7396
7507
|
}
|
|
7397
7508
|
),
|
|
7398
|
-
/* @__PURE__ */ (0,
|
|
7509
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7399
7510
|
FilterSelect,
|
|
7400
7511
|
{
|
|
7401
7512
|
icon: import_iconoir_react14.Filter,
|
|
7402
7513
|
label: "Filter by icon type",
|
|
7403
7514
|
value: typeFilter,
|
|
7404
7515
|
onChange: setTypeFilter,
|
|
7405
|
-
children: ICON_TYPES.map((type) => /* @__PURE__ */ (0,
|
|
7516
|
+
children: ICON_TYPES.map((type) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("option", { value: type.value, children: type.label }, type.value))
|
|
7406
7517
|
}
|
|
7407
7518
|
)
|
|
7408
7519
|
] }),
|
|
7409
|
-
libraryOpen ? /* @__PURE__ */ (0,
|
|
7410
|
-
/* @__PURE__ */ (0,
|
|
7411
|
-
/* @__PURE__ */ (0,
|
|
7520
|
+
libraryOpen ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "rounded-lg border border-ph-border bg-ph-surface p-2", children: [
|
|
7521
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "relative mb-2", children: [
|
|
7522
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7412
7523
|
import_iconoir_react14.Search,
|
|
7413
7524
|
{
|
|
7414
7525
|
className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
7415
7526
|
"aria-hidden": true
|
|
7416
7527
|
}
|
|
7417
7528
|
),
|
|
7418
|
-
/* @__PURE__ */ (0,
|
|
7529
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7419
7530
|
"input",
|
|
7420
7531
|
{
|
|
7421
7532
|
type: "search",
|
|
@@ -7428,14 +7539,14 @@ function SuitePaletteLibrary({
|
|
|
7428
7539
|
}
|
|
7429
7540
|
)
|
|
7430
7541
|
] }),
|
|
7431
|
-
/* @__PURE__ */ (0,
|
|
7542
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
7432
7543
|
"ul",
|
|
7433
7544
|
{
|
|
7434
7545
|
role: "listbox",
|
|
7435
7546
|
"aria-label": "Libraries",
|
|
7436
7547
|
className: "max-h-56 overflow-y-auto",
|
|
7437
7548
|
children: [
|
|
7438
|
-
/* @__PURE__ */ (0,
|
|
7549
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7439
7550
|
"button",
|
|
7440
7551
|
{
|
|
7441
7552
|
type: "button",
|
|
@@ -7452,7 +7563,7 @@ function SuitePaletteLibrary({
|
|
|
7452
7563
|
children: "All libraries"
|
|
7453
7564
|
}
|
|
7454
7565
|
) }),
|
|
7455
|
-
filteredLibraries.map((collection) => /* @__PURE__ */ (0,
|
|
7566
|
+
filteredLibraries.map((collection) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
7456
7567
|
"button",
|
|
7457
7568
|
{
|
|
7458
7569
|
type: "button",
|
|
@@ -7467,19 +7578,19 @@ function SuitePaletteLibrary({
|
|
|
7467
7578
|
collectionFilter === collection.slug ? "bg-ph-muted text-ph-ink" : "text-ph-ink hover:bg-ph-muted"
|
|
7468
7579
|
),
|
|
7469
7580
|
children: [
|
|
7470
|
-
/* @__PURE__ */ (0,
|
|
7471
|
-
/* @__PURE__ */ (0,
|
|
7581
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "truncate", children: collection.name }),
|
|
7582
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "shrink-0 text-xs text-ph-mutedtext", children: collection.count })
|
|
7472
7583
|
]
|
|
7473
7584
|
}
|
|
7474
7585
|
) }, collection.slug)),
|
|
7475
|
-
filteredLibraries.length === 0 ? /* @__PURE__ */ (0,
|
|
7586
|
+
filteredLibraries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("li", { className: "px-2 py-4 text-center text-sm text-ph-mutedtext", children: "No libraries match." }) : null
|
|
7476
7587
|
]
|
|
7477
7588
|
}
|
|
7478
7589
|
)
|
|
7479
7590
|
] }) : null
|
|
7480
7591
|
] }),
|
|
7481
|
-
error ? /* @__PURE__ */ (0,
|
|
7482
|
-
/* @__PURE__ */ (0,
|
|
7592
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-sm text-ph-danger", children: error }) : loading ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "py-8 text-center text-sm text-ph-mutedtext", children: "Loading icons\u2026" }) : icons.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "py-8 text-center text-sm text-ph-mutedtext", children: "No icons matched. Try another word or filter." }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
7593
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "max-h-[320px] overflow-y-auto rounded-lg border border-ph-border p-2", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "grid grid-cols-6 gap-1.5 sm:grid-cols-8", children: icons.map((icon) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7483
7594
|
"button",
|
|
7484
7595
|
{
|
|
7485
7596
|
type: "button",
|
|
@@ -7487,7 +7598,7 @@ function SuitePaletteLibrary({
|
|
|
7487
7598
|
title: icon.name,
|
|
7488
7599
|
"aria-label": `Use ${icon.name}`,
|
|
7489
7600
|
className: "flex h-10 items-center justify-center rounded-md border border-transparent p-1.5 hover:border-ph-brand hover:bg-ph-muted",
|
|
7490
|
-
children: /* @__PURE__ */ (0,
|
|
7601
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7491
7602
|
"img",
|
|
7492
7603
|
{
|
|
7493
7604
|
src: icon.url,
|
|
@@ -7500,14 +7611,14 @@ function SuitePaletteLibrary({
|
|
|
7500
7611
|
},
|
|
7501
7612
|
icon.id
|
|
7502
7613
|
)) }) }),
|
|
7503
|
-
/* @__PURE__ */ (0,
|
|
7504
|
-
/* @__PURE__ */ (0,
|
|
7614
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center justify-between text-xs text-ph-mutedtext", children: [
|
|
7615
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { children: [
|
|
7505
7616
|
icons.length,
|
|
7506
7617
|
" of ",
|
|
7507
7618
|
total,
|
|
7508
7619
|
searching ? " matching" : activeLibrary ? ` in ${activeLibrary.name}` : " across all libraries"
|
|
7509
7620
|
] }),
|
|
7510
|
-
!searching && activeLibrary && icons.length < total ? /* @__PURE__ */ (0,
|
|
7621
|
+
!searching && activeLibrary && icons.length < total ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7511
7622
|
"button",
|
|
7512
7623
|
{
|
|
7513
7624
|
type: "button",
|
|
@@ -7526,7 +7637,7 @@ function SuitePaletteLibrary({
|
|
|
7526
7637
|
}
|
|
7527
7638
|
|
|
7528
7639
|
// src/suite/components/suite-clients-projects-directory.tsx
|
|
7529
|
-
var
|
|
7640
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
7530
7641
|
var DEFAULT_ICON = "";
|
|
7531
7642
|
var DEFAULT_COLOR = "";
|
|
7532
7643
|
function DirectoryIconPicker({
|
|
@@ -7537,11 +7648,11 @@ function DirectoryIconPicker({
|
|
|
7537
7648
|
onClear,
|
|
7538
7649
|
onBrowse
|
|
7539
7650
|
}) {
|
|
7540
|
-
return /* @__PURE__ */ (0,
|
|
7541
|
-
/* @__PURE__ */ (0,
|
|
7542
|
-
/* @__PURE__ */ (0,
|
|
7543
|
-
/* @__PURE__ */ (0,
|
|
7544
|
-
/* @__PURE__ */ (0,
|
|
7651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "space-y-2", children: [
|
|
7652
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "mb-1.5 block text-sm font-medium text-ph-ink", children: "Icon" }),
|
|
7653
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "rounded-lg border border-ph-border bg-ph-muted p-3", children: [
|
|
7654
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
7655
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7545
7656
|
SuiteEntityIcon,
|
|
7546
7657
|
{
|
|
7547
7658
|
imageUrl: preview,
|
|
@@ -7551,11 +7662,11 @@ function DirectoryIconPicker({
|
|
|
7551
7662
|
className: "h-9 w-9 text-base"
|
|
7552
7663
|
}
|
|
7553
7664
|
),
|
|
7554
|
-
/* @__PURE__ */ (0,
|
|
7555
|
-
/* @__PURE__ */ (0,
|
|
7556
|
-
/* @__PURE__ */ (0,
|
|
7665
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
7666
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-sm font-medium text-ph-ink", children: preview ? "Custom image" : "No icon yet" }),
|
|
7667
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-xs text-ph-mutedtext", children: preview ? "Shown on cards and lists." : "Browse the library or upload your own." })
|
|
7557
7668
|
] }),
|
|
7558
|
-
onBrowse ? /* @__PURE__ */ (0,
|
|
7669
|
+
onBrowse ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7559
7670
|
"button",
|
|
7560
7671
|
{
|
|
7561
7672
|
type: "button",
|
|
@@ -7565,7 +7676,7 @@ function DirectoryIconPicker({
|
|
|
7565
7676
|
}
|
|
7566
7677
|
) : null
|
|
7567
7678
|
] }),
|
|
7568
|
-
/* @__PURE__ */ (0,
|
|
7679
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "mt-3", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7569
7680
|
FileUpload,
|
|
7570
7681
|
{
|
|
7571
7682
|
accept: "image/png,image/jpeg,image/gif,image/webp,image/svg+xml,.svg",
|
|
@@ -7575,14 +7686,14 @@ function DirectoryIconPicker({
|
|
|
7575
7686
|
}
|
|
7576
7687
|
}
|
|
7577
7688
|
) }),
|
|
7578
|
-
preview ? /* @__PURE__ */ (0,
|
|
7689
|
+
preview ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7579
7690
|
"button",
|
|
7580
7691
|
{
|
|
7581
7692
|
type: "button",
|
|
7582
7693
|
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",
|
|
7583
7694
|
onClick: onClear,
|
|
7584
7695
|
children: [
|
|
7585
|
-
/* @__PURE__ */ (0,
|
|
7696
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_iconoir_react15.Trash, { className: "h-3.5 w-3.5", "aria-hidden": true }),
|
|
7586
7697
|
" Remove image"
|
|
7587
7698
|
]
|
|
7588
7699
|
}
|
|
@@ -7593,7 +7704,7 @@ function DirectoryIconPicker({
|
|
|
7593
7704
|
function DirectoryIcon({
|
|
7594
7705
|
item
|
|
7595
7706
|
}) {
|
|
7596
|
-
return /* @__PURE__ */ (0,
|
|
7707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7597
7708
|
SuiteEntityIcon,
|
|
7598
7709
|
{
|
|
7599
7710
|
imageUrl: item.icon_image,
|
|
@@ -7823,10 +7934,10 @@ function SuiteClientsProjectsDirectory({
|
|
|
7823
7934
|
);
|
|
7824
7935
|
}
|
|
7825
7936
|
}
|
|
7826
|
-
return /* @__PURE__ */ (0,
|
|
7827
|
-
error || mutationError ? /* @__PURE__ */ (0,
|
|
7828
|
-
loading ? /* @__PURE__ */ (0,
|
|
7829
|
-
/* @__PURE__ */ (0,
|
|
7937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { "data-test": dataTest, className: "space-y-3", children: [
|
|
7938
|
+
error || mutationError ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Alert, { status: "danger", live: "assertive", children: error || mutationError }) : null,
|
|
7939
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-sm text-ph-mutedtext", children: "Loading directory..." }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("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: [
|
|
7940
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7830
7941
|
"section",
|
|
7831
7942
|
{
|
|
7832
7943
|
className: cn2(
|
|
@@ -7834,16 +7945,16 @@ function SuiteClientsProjectsDirectory({
|
|
|
7834
7945
|
mobileDetail ? "hidden lg:block" : "block"
|
|
7835
7946
|
),
|
|
7836
7947
|
children: [
|
|
7837
|
-
/* @__PURE__ */ (0,
|
|
7838
|
-
/* @__PURE__ */ (0,
|
|
7839
|
-
/* @__PURE__ */ (0,
|
|
7948
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex h-14 items-center gap-2 border-b border-ph-border px-3", children: [
|
|
7949
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
|
|
7950
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7840
7951
|
import_iconoir_react15.Search,
|
|
7841
7952
|
{
|
|
7842
7953
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
7843
7954
|
"aria-hidden": true
|
|
7844
7955
|
}
|
|
7845
7956
|
),
|
|
7846
|
-
/* @__PURE__ */ (0,
|
|
7957
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7847
7958
|
Input,
|
|
7848
7959
|
{
|
|
7849
7960
|
hideLabel: true,
|
|
@@ -7855,18 +7966,18 @@ function SuiteClientsProjectsDirectory({
|
|
|
7855
7966
|
}
|
|
7856
7967
|
)
|
|
7857
7968
|
] }),
|
|
7858
|
-
canEdit && onCreateClient ? /* @__PURE__ */ (0,
|
|
7969
|
+
canEdit && onCreateClient ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7859
7970
|
Button,
|
|
7860
7971
|
{
|
|
7861
7972
|
size: "sm",
|
|
7862
7973
|
variant: "primary",
|
|
7863
|
-
icon: /* @__PURE__ */ (0,
|
|
7974
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_iconoir_react15.Plus, { className: "h-4 w-4" }),
|
|
7864
7975
|
onClick: () => openNew("client"),
|
|
7865
7976
|
children: "New client"
|
|
7866
7977
|
}
|
|
7867
7978
|
) : null
|
|
7868
7979
|
] }),
|
|
7869
|
-
/* @__PURE__ */ (0,
|
|
7980
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7870
7981
|
"ul",
|
|
7871
7982
|
{
|
|
7872
7983
|
role: "listbox",
|
|
@@ -7877,7 +7988,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
7877
7988
|
const count = projects.filter(
|
|
7878
7989
|
(project) => project.clientId === client.id
|
|
7879
7990
|
).length;
|
|
7880
|
-
return /* @__PURE__ */ (0,
|
|
7991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("li", { role: "none", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7881
7992
|
"button",
|
|
7882
7993
|
{
|
|
7883
7994
|
type: "button",
|
|
@@ -7894,10 +8005,10 @@ function SuiteClientsProjectsDirectory({
|
|
|
7894
8005
|
selected ? "bg-ph-muted" : "hover:bg-ph-canvas"
|
|
7895
8006
|
),
|
|
7896
8007
|
children: [
|
|
7897
|
-
/* @__PURE__ */ (0,
|
|
7898
|
-
/* @__PURE__ */ (0,
|
|
7899
|
-
/* @__PURE__ */ (0,
|
|
7900
|
-
/* @__PURE__ */ (0,
|
|
8008
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DirectoryIcon, { item: client }),
|
|
8009
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
8010
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "block truncate text-sm font-medium text-ph-ink", children: client.name }),
|
|
8011
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "text-xs text-ph-mutedtext", children: [
|
|
7901
8012
|
count,
|
|
7902
8013
|
" project",
|
|
7903
8014
|
count === 1 ? "" : "s"
|
|
@@ -7906,13 +8017,13 @@ function SuiteClientsProjectsDirectory({
|
|
|
7906
8017
|
]
|
|
7907
8018
|
}
|
|
7908
8019
|
) }, client.id);
|
|
7909
|
-
}) : /* @__PURE__ */ (0,
|
|
8020
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("li", { className: "px-3 py-8 text-center text-sm text-ph-mutedtext", children: clients.length ? "No matches." : "Add a client to get started." })
|
|
7910
8021
|
}
|
|
7911
8022
|
)
|
|
7912
8023
|
]
|
|
7913
8024
|
}
|
|
7914
8025
|
),
|
|
7915
|
-
/* @__PURE__ */ (0,
|
|
8026
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7916
8027
|
"section",
|
|
7917
8028
|
{
|
|
7918
8029
|
className: cn2(
|
|
@@ -7920,8 +8031,8 @@ function SuiteClientsProjectsDirectory({
|
|
|
7920
8031
|
mobileDetail ? "flex" : "hidden lg:flex"
|
|
7921
8032
|
),
|
|
7922
8033
|
children: [
|
|
7923
|
-
/* @__PURE__ */ (0,
|
|
7924
|
-
/* @__PURE__ */ (0,
|
|
8034
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "flex min-h-14 items-center gap-2 border-b border-ph-border px-3 py-2", children: selectedClient ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
8035
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7925
8036
|
"button",
|
|
7926
8037
|
{
|
|
7927
8038
|
type: "button",
|
|
@@ -7932,36 +8043,36 @@ function SuiteClientsProjectsDirectory({
|
|
|
7932
8043
|
setMobileDetail(false);
|
|
7933
8044
|
},
|
|
7934
8045
|
"aria-label": "Back to clients",
|
|
7935
|
-
children: /* @__PURE__ */ (0,
|
|
8046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_iconoir_react15.ArrowLeft, { className: "h-4 w-4" })
|
|
7936
8047
|
}
|
|
7937
8048
|
),
|
|
7938
|
-
/* @__PURE__ */ (0,
|
|
7939
|
-
/* @__PURE__ */ (0,
|
|
7940
|
-
/* @__PURE__ */ (0,
|
|
7941
|
-
/* @__PURE__ */ (0,
|
|
8049
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DirectoryIcon, { item: selectedClient }),
|
|
8050
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
8051
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h3", { className: "truncate text-sm font-semibold text-ph-ink", children: selectedClient.name }),
|
|
8052
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "text-xs text-ph-mutedtext", children: [
|
|
7942
8053
|
selectedProjects.length,
|
|
7943
8054
|
" project",
|
|
7944
8055
|
selectedProjects.length === 1 ? "" : "s"
|
|
7945
8056
|
] })
|
|
7946
8057
|
] }),
|
|
7947
|
-
canEdit && (onUpdateClient || onDeleteClient) ? /* @__PURE__ */ (0,
|
|
8058
|
+
canEdit && (onUpdateClient || onDeleteClient) ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7948
8059
|
DropdownMenu,
|
|
7949
8060
|
{
|
|
7950
8061
|
"aria-label": `Actions for ${selectedClient.name}`,
|
|
7951
8062
|
align: "end",
|
|
7952
|
-
trigger: /* @__PURE__ */ (0,
|
|
7953
|
-
/* @__PURE__ */ (0,
|
|
7954
|
-
/* @__PURE__ */ (0,
|
|
8063
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("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: [
|
|
8064
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_iconoir_react15.MoreHoriz, { className: "h-4 w-4", "aria-hidden": true }),
|
|
8065
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "sr-only", children: "Client actions" })
|
|
7955
8066
|
] }),
|
|
7956
|
-
children: /* @__PURE__ */ (0,
|
|
7957
|
-
onUpdateClient ? /* @__PURE__ */ (0,
|
|
8067
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "p-1", children: [
|
|
8068
|
+
onUpdateClient ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7958
8069
|
DropdownItem,
|
|
7959
8070
|
{
|
|
7960
8071
|
onClick: () => openEdit(selectedClient, "client"),
|
|
7961
8072
|
children: "Edit client"
|
|
7962
8073
|
}
|
|
7963
8074
|
) : null,
|
|
7964
|
-
onDeleteClient ? /* @__PURE__ */ (0,
|
|
8075
|
+
onDeleteClient ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7965
8076
|
DropdownItem,
|
|
7966
8077
|
{
|
|
7967
8078
|
className: "text-red-600",
|
|
@@ -7972,32 +8083,32 @@ function SuiteClientsProjectsDirectory({
|
|
|
7972
8083
|
] })
|
|
7973
8084
|
}
|
|
7974
8085
|
) }) : null
|
|
7975
|
-
] }) : /* @__PURE__ */ (0,
|
|
7976
|
-
canEdit && onCreateProject ? /* @__PURE__ */ (0,
|
|
8086
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-sm text-ph-mutedtext", children: "Select a client" }) }),
|
|
8087
|
+
canEdit && onCreateProject ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "border-b border-ph-border p-3", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7977
8088
|
Button,
|
|
7978
8089
|
{
|
|
7979
8090
|
variant: "primary",
|
|
7980
|
-
icon: /* @__PURE__ */ (0,
|
|
8091
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_iconoir_react15.Plus, { className: "h-4 w-4" }),
|
|
7981
8092
|
onClick: () => openNew("project"),
|
|
7982
8093
|
children: "Add project"
|
|
7983
8094
|
}
|
|
7984
8095
|
) }) : null,
|
|
7985
|
-
/* @__PURE__ */ (0,
|
|
8096
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("ul", { className: "flex-1 p-2", children: selectedClient && selectedProjects.length ? selectedProjects.map((project) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7986
8097
|
"div",
|
|
7987
8098
|
{
|
|
7988
8099
|
className: "flex items-center gap-3 rounded-lg px-2 py-1 hover:bg-ph-canvas",
|
|
7989
8100
|
onClick: () => openEdit(project, "project"),
|
|
7990
8101
|
children: [
|
|
7991
|
-
/* @__PURE__ */ (0,
|
|
8102
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
7992
8103
|
"button",
|
|
7993
8104
|
{
|
|
7994
8105
|
type: "button",
|
|
7995
8106
|
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",
|
|
7996
8107
|
onClick: () => openEdit(project, "project"),
|
|
7997
8108
|
children: [
|
|
7998
|
-
/* @__PURE__ */ (0,
|
|
7999
|
-
/* @__PURE__ */ (0,
|
|
8000
|
-
/* @__PURE__ */ (0,
|
|
8109
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(DirectoryIcon, { item: project }),
|
|
8110
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
8111
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8001
8112
|
"span",
|
|
8002
8113
|
{
|
|
8003
8114
|
className: cn2(
|
|
@@ -8007,36 +8118,36 @@ function SuiteClientsProjectsDirectory({
|
|
|
8007
8118
|
children: project.name
|
|
8008
8119
|
}
|
|
8009
8120
|
),
|
|
8010
|
-
/* @__PURE__ */ (0,
|
|
8121
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-xs text-ph-mutedtext", children: project.isArchived ? "Archived" : "Active" })
|
|
8011
8122
|
] })
|
|
8012
8123
|
]
|
|
8013
8124
|
}
|
|
8014
8125
|
),
|
|
8015
|
-
canEdit && (onUpdateProject || onDeleteProject) ? /* @__PURE__ */ (0,
|
|
8126
|
+
canEdit && (onUpdateProject || onDeleteProject) ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8016
8127
|
DropdownMenu,
|
|
8017
8128
|
{
|
|
8018
8129
|
"aria-label": `Actions for ${project.name}`,
|
|
8019
8130
|
align: "end",
|
|
8020
|
-
trigger: /* @__PURE__ */ (0,
|
|
8021
|
-
/* @__PURE__ */ (0,
|
|
8131
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("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: [
|
|
8132
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8022
8133
|
import_iconoir_react15.MoreHoriz,
|
|
8023
8134
|
{
|
|
8024
8135
|
className: "h-4 w-4",
|
|
8025
8136
|
"aria-hidden": true
|
|
8026
8137
|
}
|
|
8027
8138
|
),
|
|
8028
|
-
/* @__PURE__ */ (0,
|
|
8139
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "sr-only", children: "Project actions" })
|
|
8029
8140
|
] }),
|
|
8030
|
-
children: /* @__PURE__ */ (0,
|
|
8031
|
-
onUpdateProject ? /* @__PURE__ */ (0,
|
|
8032
|
-
/* @__PURE__ */ (0,
|
|
8141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "p-1", children: [
|
|
8142
|
+
onUpdateProject ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
8143
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8033
8144
|
DropdownItem,
|
|
8034
8145
|
{
|
|
8035
8146
|
onClick: () => openEdit(project, "project"),
|
|
8036
8147
|
children: "Edit project"
|
|
8037
8148
|
}
|
|
8038
8149
|
),
|
|
8039
|
-
/* @__PURE__ */ (0,
|
|
8150
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8040
8151
|
DropdownItem,
|
|
8041
8152
|
{
|
|
8042
8153
|
onClick: () => void toggleArchive(project),
|
|
@@ -8044,7 +8155,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
8044
8155
|
}
|
|
8045
8156
|
)
|
|
8046
8157
|
] }) : null,
|
|
8047
|
-
onDeleteProject ? /* @__PURE__ */ (0,
|
|
8158
|
+
onDeleteProject ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8048
8159
|
DropdownItem,
|
|
8049
8160
|
{
|
|
8050
8161
|
className: "text-red-600",
|
|
@@ -8057,20 +8168,20 @@ function SuiteClientsProjectsDirectory({
|
|
|
8057
8168
|
) }) : null
|
|
8058
8169
|
]
|
|
8059
8170
|
}
|
|
8060
|
-
) }, project.id)) : /* @__PURE__ */ (0,
|
|
8171
|
+
) }, project.id)) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("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." }) })
|
|
8061
8172
|
]
|
|
8062
8173
|
}
|
|
8063
8174
|
)
|
|
8064
8175
|
] }),
|
|
8065
|
-
/* @__PURE__ */ (0,
|
|
8176
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8066
8177
|
Modal,
|
|
8067
8178
|
{
|
|
8068
8179
|
open: editing !== null,
|
|
8069
8180
|
onClose: closeEditor,
|
|
8070
8181
|
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",
|
|
8071
|
-
footer: /* @__PURE__ */ (0,
|
|
8072
|
-
/* @__PURE__ */ (0,
|
|
8073
|
-
/* @__PURE__ */ (0,
|
|
8182
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
8183
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Button, { variant: "tertiary", onClick: closeEditor, disabled: saving, children: "Cancel" }),
|
|
8184
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8074
8185
|
Button,
|
|
8075
8186
|
{
|
|
8076
8187
|
variant: "primary",
|
|
@@ -8080,8 +8191,8 @@ function SuiteClientsProjectsDirectory({
|
|
|
8080
8191
|
}
|
|
8081
8192
|
)
|
|
8082
8193
|
] }),
|
|
8083
|
-
children: /* @__PURE__ */ (0,
|
|
8084
|
-
/* @__PURE__ */ (0,
|
|
8194
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "space-y-3", children: [
|
|
8195
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8085
8196
|
Input,
|
|
8086
8197
|
{
|
|
8087
8198
|
label: "Name",
|
|
@@ -8090,7 +8201,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
8090
8201
|
onChange: (event) => setDraft(__spreadProps(__spreadValues({}, draft), { name: event.target.value }))
|
|
8091
8202
|
}
|
|
8092
8203
|
),
|
|
8093
|
-
/* @__PURE__ */ (0,
|
|
8204
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8094
8205
|
DirectoryIconPicker,
|
|
8095
8206
|
{
|
|
8096
8207
|
preview,
|
|
@@ -8101,10 +8212,10 @@ function SuiteClientsProjectsDirectory({
|
|
|
8101
8212
|
onBrowse: () => setLibraryOpen(true)
|
|
8102
8213
|
}
|
|
8103
8214
|
),
|
|
8104
|
-
/* @__PURE__ */ (0,
|
|
8105
|
-
/* @__PURE__ */ (0,
|
|
8106
|
-
/* @__PURE__ */ (0,
|
|
8107
|
-
/* @__PURE__ */ (0,
|
|
8215
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { children: [
|
|
8216
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "mb-1.5 block text-sm font-medium text-ph-ink", children: "Colour" }),
|
|
8217
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
8218
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8108
8219
|
"button",
|
|
8109
8220
|
{
|
|
8110
8221
|
type: "button",
|
|
@@ -8116,7 +8227,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
8116
8227
|
"flex h-8 w-8 items-center justify-center rounded-full border border-ph-border bg-ph-surface text-ph-mutedtext ring-offset-2",
|
|
8117
8228
|
!draft.color && "ring-2 ring-ph-brand"
|
|
8118
8229
|
),
|
|
8119
|
-
children: /* @__PURE__ */ (0,
|
|
8230
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_iconoir_react15.Prohibition, { className: "h-4 w-4", "aria-hidden": true })
|
|
8120
8231
|
}
|
|
8121
8232
|
),
|
|
8122
8233
|
[
|
|
@@ -8127,7 +8238,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
8127
8238
|
"#ef4444",
|
|
8128
8239
|
"#a855f7",
|
|
8129
8240
|
"#64748b"
|
|
8130
|
-
].map((color) => /* @__PURE__ */ (0,
|
|
8241
|
+
].map((color) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8131
8242
|
"button",
|
|
8132
8243
|
{
|
|
8133
8244
|
type: "button",
|
|
@@ -8142,7 +8253,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
8142
8253
|
},
|
|
8143
8254
|
color
|
|
8144
8255
|
)),
|
|
8145
|
-
/* @__PURE__ */ (0,
|
|
8256
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8146
8257
|
"label",
|
|
8147
8258
|
{
|
|
8148
8259
|
className: cn2(
|
|
@@ -8162,7 +8273,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
8162
8273
|
},
|
|
8163
8274
|
title: "Custom colour",
|
|
8164
8275
|
children: [
|
|
8165
|
-
/* @__PURE__ */ (0,
|
|
8276
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "flex h-4 w-4 items-center justify-center rounded-full bg-ph-surface", children: [
|
|
8166
8277
|
"#6366f1",
|
|
8167
8278
|
"#0ea5e9",
|
|
8168
8279
|
"#10b981",
|
|
@@ -8170,14 +8281,14 @@ function SuiteClientsProjectsDirectory({
|
|
|
8170
8281
|
"#ef4444",
|
|
8171
8282
|
"#a855f7",
|
|
8172
8283
|
"#64748b"
|
|
8173
|
-
].includes(draft.color) ? /* @__PURE__ */ (0,
|
|
8284
|
+
].includes(draft.color) ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_iconoir_react15.Plus, { className: "h-3 w-3 text-ph-ink", "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8174
8285
|
"span",
|
|
8175
8286
|
{
|
|
8176
8287
|
className: "h-2.5 w-2.5 rounded-full",
|
|
8177
8288
|
style: { backgroundColor: draft.color }
|
|
8178
8289
|
}
|
|
8179
8290
|
) }),
|
|
8180
|
-
/* @__PURE__ */ (0,
|
|
8291
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8181
8292
|
"input",
|
|
8182
8293
|
{
|
|
8183
8294
|
type: "color",
|
|
@@ -8192,20 +8303,20 @@ function SuiteClientsProjectsDirectory({
|
|
|
8192
8303
|
)
|
|
8193
8304
|
] })
|
|
8194
8305
|
] }),
|
|
8195
|
-
(editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */ (0,
|
|
8306
|
+
(editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
8196
8307
|
Select,
|
|
8197
8308
|
{
|
|
8198
8309
|
label: "Client",
|
|
8199
8310
|
value: draftClientId != null ? draftClientId : "",
|
|
8200
8311
|
onChange: (event) => setDraftClientId(event.target.value || null),
|
|
8201
8312
|
children: [
|
|
8202
|
-
/* @__PURE__ */ (0,
|
|
8203
|
-
clients.map((client) => /* @__PURE__ */ (0,
|
|
8313
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("option", { value: "", children: "No client" }),
|
|
8314
|
+
clients.map((client) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("option", { value: client.id, children: client.name }, client.id))
|
|
8204
8315
|
]
|
|
8205
8316
|
}
|
|
8206
8317
|
) : null,
|
|
8207
|
-
(editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */ (0,
|
|
8208
|
-
/* @__PURE__ */ (0,
|
|
8318
|
+
(editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "flex items-center gap-2 text-sm text-ph-ink", children: [
|
|
8319
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8209
8320
|
"input",
|
|
8210
8321
|
{
|
|
8211
8322
|
type: "checkbox",
|
|
@@ -8218,26 +8329,26 @@ function SuiteClientsProjectsDirectory({
|
|
|
8218
8329
|
] })
|
|
8219
8330
|
}
|
|
8220
8331
|
),
|
|
8221
|
-
libraryOpen ? /* @__PURE__ */ (0,
|
|
8332
|
+
libraryOpen ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8222
8333
|
Modal,
|
|
8223
8334
|
{
|
|
8224
8335
|
open: true,
|
|
8225
8336
|
onClose: () => setLibraryOpen(false),
|
|
8226
8337
|
title: "Icon library",
|
|
8227
|
-
children: renderIconLibrary ? renderIconLibrary({ onPick: pickFromLibrary }) : /* @__PURE__ */ (0,
|
|
8338
|
+
children: renderIconLibrary ? renderIconLibrary({ onPick: pickFromLibrary }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SuitePaletteLibrary, { onPick: pickFromLibrary })
|
|
8228
8339
|
}
|
|
8229
8340
|
) : null,
|
|
8230
|
-
/* @__PURE__ */ (0,
|
|
8341
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8231
8342
|
Modal,
|
|
8232
8343
|
{
|
|
8233
8344
|
open: confirming !== null,
|
|
8234
8345
|
onClose: () => setConfirming(null),
|
|
8235
8346
|
title: "Confirm deletion",
|
|
8236
|
-
footer: /* @__PURE__ */ (0,
|
|
8237
|
-
/* @__PURE__ */ (0,
|
|
8238
|
-
/* @__PURE__ */ (0,
|
|
8347
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
8348
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Button, { variant: "tertiary", onClick: () => setConfirming(null), children: "Cancel" }),
|
|
8349
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Button, { variant: "primary", onClick: () => void confirmRemove(), children: "Delete" })
|
|
8239
8350
|
] }),
|
|
8240
|
-
children: /* @__PURE__ */ (0,
|
|
8351
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "text-sm text-ph-ink", children: [
|
|
8241
8352
|
"Delete ",
|
|
8242
8353
|
confirming == null ? void 0 : confirming.item.name,
|
|
8243
8354
|
"? This cannot be undone."
|
|
@@ -8269,6 +8380,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
8269
8380
|
SUITE_GLYPHS,
|
|
8270
8381
|
SUITE_ICON_NAMES,
|
|
8271
8382
|
SUITE_MUTATED_EVENT,
|
|
8383
|
+
SUITE_NOTIFICATIONS_POLL_MS,
|
|
8272
8384
|
SUITE_OPEN_ASK_AI_EVENT,
|
|
8273
8385
|
SUITE_SIDEBAR_WIDTH_COOKIE,
|
|
8274
8386
|
SUITE_SIDEBAR_WIDTH_KEY,
|
|
@@ -8291,6 +8403,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
8291
8403
|
SuiteMobileHeader,
|
|
8292
8404
|
SuiteMotionProvider,
|
|
8293
8405
|
SuiteNotificationBell,
|
|
8406
|
+
SuiteNotificationsProvider,
|
|
8294
8407
|
SuitePage,
|
|
8295
8408
|
SuitePageHeader,
|
|
8296
8409
|
SuitePaletteLibrary,
|
|
@@ -8346,5 +8459,6 @@ function SuiteClientsProjectsDirectory({
|
|
|
8346
8459
|
suiteThemeBootScript,
|
|
8347
8460
|
useIdleMount,
|
|
8348
8461
|
useSidebarWidth,
|
|
8462
|
+
useSuiteNotifications,
|
|
8349
8463
|
useSuiteTheme
|
|
8350
8464
|
});
|