@xenide-io/the-old-ui-theme 0.4.0 → 0.4.3
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/{chunk-KORWJCIO.mjs → chunk-54ZR4VL5.mjs} +691 -1686
- package/dist/chunk-G53YLHVE.mjs +1023 -0
- package/dist/index.mjs +78 -76
- package/dist/suite.js +494 -258
- package/dist/suite.mjs +93 -117
- package/dist/ui.mjs +13 -11
- package/package.json +1 -1
- package/src/suite/components/suite-layout.tsx +3 -5
- package/src/suite/components/suite-sidebar.tsx +11 -4
- package/src/suite/components/suite-user-menu.tsx +56 -75
- package/src/suite/lib/apps.ts +1 -1
package/dist/suite.js
CHANGED
|
@@ -22,6 +22,18 @@ var __spreadValues = (a, b) => {
|
|
|
22
22
|
return a;
|
|
23
23
|
};
|
|
24
24
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
25
37
|
var __export = (target, all) => {
|
|
26
38
|
for (var name in all)
|
|
27
39
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -99,7 +111,7 @@ __export(suite_exports, {
|
|
|
99
111
|
appSwitcherTriggerClass: () => appSwitcherTriggerClass,
|
|
100
112
|
cn: () => cn,
|
|
101
113
|
getTodayGreeting: () => getTodayGreeting,
|
|
102
|
-
m: () =>
|
|
114
|
+
m: () => import_react8.m,
|
|
103
115
|
sourceToSuiteApp: () => sourceToSuiteApp,
|
|
104
116
|
suiteAppBaseUrl: () => suiteAppBaseUrl,
|
|
105
117
|
suiteAppLabel: () => suiteAppLabel,
|
|
@@ -860,12 +872,12 @@ function AppSwitcher({
|
|
|
860
872
|
mark,
|
|
861
873
|
title,
|
|
862
874
|
collapsed = false,
|
|
863
|
-
dropdownMenu:
|
|
864
|
-
dropdownItem:
|
|
875
|
+
dropdownMenu: DropdownMenu2,
|
|
876
|
+
dropdownItem: DropdownItem2
|
|
865
877
|
}) {
|
|
866
878
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
867
879
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
868
|
-
|
|
880
|
+
DropdownMenu2,
|
|
869
881
|
{
|
|
870
882
|
"aria-label": "Switch application",
|
|
871
883
|
className: collapsed ? "w-11 shrink-0" : "min-w-0 flex-1",
|
|
@@ -892,7 +904,7 @@ function AppSwitcher({
|
|
|
892
904
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "p-1", "data-test": "app-switcher-menu", children: [
|
|
893
905
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "px-3 py-2 text-[10px] font-semibold uppercase tracking-[0.14em] text-ph-mutedtext", children: "Switch application" }),
|
|
894
906
|
apps.map((app) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
895
|
-
|
|
907
|
+
DropdownItem2,
|
|
896
908
|
{
|
|
897
909
|
"data-test": `switch-app-${app.slug}`,
|
|
898
910
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -953,7 +965,7 @@ function SuiteNotificationBell({
|
|
|
953
965
|
fetchNotifications,
|
|
954
966
|
markRead,
|
|
955
967
|
markAllRead,
|
|
956
|
-
dropdownMenu:
|
|
968
|
+
dropdownMenu: DropdownMenu2,
|
|
957
969
|
cacheKey = "suite-notifications-cache"
|
|
958
970
|
}) {
|
|
959
971
|
const router = (0, import_navigation.useRouter)();
|
|
@@ -1048,7 +1060,7 @@ function SuiteNotificationBell({
|
|
|
1048
1060
|
}
|
|
1049
1061
|
}, [markAllRead]);
|
|
1050
1062
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1051
|
-
|
|
1063
|
+
DropdownMenu2,
|
|
1052
1064
|
{
|
|
1053
1065
|
"aria-label": "Notifications",
|
|
1054
1066
|
align: "end",
|
|
@@ -1333,10 +1345,125 @@ function SuiteMobileHeader({
|
|
|
1333
1345
|
|
|
1334
1346
|
// src/suite/components/suite-user-menu.tsx
|
|
1335
1347
|
var import_image2 = __toESM(require("next/image"));
|
|
1336
|
-
var
|
|
1337
|
-
var import_react6 = require("react");
|
|
1348
|
+
var import_navigation2 = require("next/navigation");
|
|
1338
1349
|
var import_iconoir_react6 = require("iconoir-react");
|
|
1350
|
+
|
|
1351
|
+
// src/components/ui/DropdownMenu.tsx
|
|
1352
|
+
var DropdownPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1353
|
+
|
|
1354
|
+
// src/lib/cn.ts
|
|
1355
|
+
function cn2(...parts) {
|
|
1356
|
+
return parts.filter(Boolean).join(" ");
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
// src/components/ui/DropdownMenu.tsx
|
|
1339
1360
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1361
|
+
function DropdownContent({
|
|
1362
|
+
children,
|
|
1363
|
+
align = "start",
|
|
1364
|
+
side = "bottom",
|
|
1365
|
+
sideOffset = 7,
|
|
1366
|
+
alignOffset = 0,
|
|
1367
|
+
collisionPadding = 8,
|
|
1368
|
+
avoidCollisions = true,
|
|
1369
|
+
panelClassName
|
|
1370
|
+
}) {
|
|
1371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1372
|
+
DropdownPrimitive.Content,
|
|
1373
|
+
{
|
|
1374
|
+
className: cn2("ph-dropdown-panel", panelClassName),
|
|
1375
|
+
align,
|
|
1376
|
+
side,
|
|
1377
|
+
sideOffset,
|
|
1378
|
+
alignOffset,
|
|
1379
|
+
collisionPadding,
|
|
1380
|
+
avoidCollisions,
|
|
1381
|
+
sticky: "partial",
|
|
1382
|
+
children: [
|
|
1383
|
+
children,
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownPrimitive.Arrow, { className: "ph-dropdown-arrow", width: 12, height: 6 })
|
|
1385
|
+
]
|
|
1386
|
+
}
|
|
1387
|
+
) });
|
|
1388
|
+
}
|
|
1389
|
+
function DropdownMenu(_a) {
|
|
1390
|
+
var _b = _a, {
|
|
1391
|
+
trigger,
|
|
1392
|
+
children,
|
|
1393
|
+
align,
|
|
1394
|
+
side,
|
|
1395
|
+
sideOffset,
|
|
1396
|
+
alignOffset,
|
|
1397
|
+
collisionPadding,
|
|
1398
|
+
avoidCollisions,
|
|
1399
|
+
className,
|
|
1400
|
+
panelClassName,
|
|
1401
|
+
"aria-label": ariaLabel,
|
|
1402
|
+
open,
|
|
1403
|
+
defaultOpen,
|
|
1404
|
+
onOpenChange,
|
|
1405
|
+
modal = false,
|
|
1406
|
+
disabled
|
|
1407
|
+
} = _b, props = __objRest(_b, [
|
|
1408
|
+
"trigger",
|
|
1409
|
+
"children",
|
|
1410
|
+
"align",
|
|
1411
|
+
"side",
|
|
1412
|
+
"sideOffset",
|
|
1413
|
+
"alignOffset",
|
|
1414
|
+
"collisionPadding",
|
|
1415
|
+
"avoidCollisions",
|
|
1416
|
+
"className",
|
|
1417
|
+
"panelClassName",
|
|
1418
|
+
"aria-label",
|
|
1419
|
+
"open",
|
|
1420
|
+
"defaultOpen",
|
|
1421
|
+
"onOpenChange",
|
|
1422
|
+
"modal",
|
|
1423
|
+
"disabled"
|
|
1424
|
+
]);
|
|
1425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", __spreadProps(__spreadValues({ className: cn2("ph-dropdown", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1426
|
+
DropdownPrimitive.Root,
|
|
1427
|
+
{
|
|
1428
|
+
open,
|
|
1429
|
+
defaultOpen,
|
|
1430
|
+
onOpenChange,
|
|
1431
|
+
modal,
|
|
1432
|
+
children: [
|
|
1433
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "ph-dropdown-trigger", "aria-label": ariaLabel, children: trigger }) }),
|
|
1434
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1435
|
+
DropdownContent,
|
|
1436
|
+
{
|
|
1437
|
+
align,
|
|
1438
|
+
side,
|
|
1439
|
+
sideOffset,
|
|
1440
|
+
alignOffset,
|
|
1441
|
+
collisionPadding,
|
|
1442
|
+
avoidCollisions,
|
|
1443
|
+
panelClassName,
|
|
1444
|
+
children
|
|
1445
|
+
}
|
|
1446
|
+
)
|
|
1447
|
+
]
|
|
1448
|
+
}
|
|
1449
|
+
) }));
|
|
1450
|
+
}
|
|
1451
|
+
function DropdownItem(_a) {
|
|
1452
|
+
var _b = _a, { className, children, disabled } = _b, props = __objRest(_b, ["className", "children", "disabled"]);
|
|
1453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownPrimitive.Item, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1454
|
+
"button",
|
|
1455
|
+
__spreadProps(__spreadValues({
|
|
1456
|
+
type: "button",
|
|
1457
|
+
disabled,
|
|
1458
|
+
className: cn2("ph-dropdown-item w-full text-left", className)
|
|
1459
|
+
}, props), {
|
|
1460
|
+
children
|
|
1461
|
+
})
|
|
1462
|
+
) });
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
// src/suite/components/suite-user-menu.tsx
|
|
1466
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1340
1467
|
function computeInitials(name, email) {
|
|
1341
1468
|
const source = (name || email || "?").trim();
|
|
1342
1469
|
return source.split(/[\s@]+/).filter(Boolean).slice(0, 2).map((part) => part[0]).join("").toUpperCase();
|
|
@@ -1351,94 +1478,67 @@ function SuiteUserMenu({
|
|
|
1351
1478
|
dataTest = "suite-user-menu",
|
|
1352
1479
|
className
|
|
1353
1480
|
}) {
|
|
1354
|
-
const
|
|
1481
|
+
const router = (0, import_navigation2.useRouter)();
|
|
1355
1482
|
const initials = fallbackInitials != null ? fallbackInitials : computeInitials(name, email);
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1483
|
+
const avatar = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "inline-flex h-11 w-11 items-center justify-center rounded-full transition-colors hover:bg-ph-muted", children: image ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1484
|
+
import_image2.default,
|
|
1485
|
+
{
|
|
1486
|
+
src: image,
|
|
1487
|
+
alt: "",
|
|
1488
|
+
width: 32,
|
|
1489
|
+
height: 32,
|
|
1490
|
+
className: "h-8 w-8 rounded-full object-cover",
|
|
1491
|
+
unoptimized: true
|
|
1492
|
+
}
|
|
1493
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-ph-muted text-sm font-semibold text-ph-brand", children: initials }) });
|
|
1494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1495
|
+
DropdownMenu,
|
|
1496
|
+
{
|
|
1497
|
+
trigger: avatar,
|
|
1498
|
+
"aria-label": "Account menu",
|
|
1499
|
+
align: "end",
|
|
1500
|
+
side: "bottom",
|
|
1501
|
+
sideOffset: 6,
|
|
1502
|
+
collisionPadding: 16,
|
|
1503
|
+
modal: false,
|
|
1504
|
+
className,
|
|
1505
|
+
"data-test": dataTest,
|
|
1506
|
+
children: [
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "px-2 py-1.5", children: [
|
|
1508
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "truncate text-sm font-medium text-ph-ink", children: name || email || "Account" }),
|
|
1509
|
+
email ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "truncate text-xs text-ph-mutedtext", children: email }) : null
|
|
1510
|
+
] }),
|
|
1511
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "my-1 border-t border-ph-border" }),
|
|
1512
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1513
|
+
DropdownItem,
|
|
1369
1514
|
{
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1515
|
+
"data-test": `${dataTest}-settings`,
|
|
1516
|
+
onClick: () => router.push(settingsHref),
|
|
1517
|
+
children: [
|
|
1518
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_iconoir_react6.Settings, { className: "h-4 w-4 text-ph-mutedtext", "aria-hidden": true }),
|
|
1519
|
+
"Profile settings"
|
|
1520
|
+
]
|
|
1376
1521
|
}
|
|
1377
|
-
)
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
{
|
|
1393
|
-
role: "menu",
|
|
1394
|
-
className: "absolute right-0 top-full z-50 mt-1 w-56 rounded-xl border border-ph-border bg-ph-surface p-1 shadow-xl",
|
|
1395
|
-
children: [
|
|
1396
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "px-2 py-1.5", children: [
|
|
1397
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "truncate text-sm font-medium text-ph-ink", children: name || email || "Account" }),
|
|
1398
|
-
email ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "truncate text-xs text-ph-mutedtext", children: email }) : null
|
|
1399
|
-
] }),
|
|
1400
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "my-1 border-t border-ph-border" }),
|
|
1401
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1402
|
-
import_link.default,
|
|
1403
|
-
{
|
|
1404
|
-
role: "menuitem",
|
|
1405
|
-
href: settingsHref,
|
|
1406
|
-
"data-test": `${dataTest}-settings`,
|
|
1407
|
-
className: "flex min-h-11 items-center gap-2 rounded-lg px-2 text-sm text-ph-ink transition-colors hover:bg-ph-muted",
|
|
1408
|
-
onClick: () => setOpen(false),
|
|
1409
|
-
children: [
|
|
1410
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_iconoir_react6.Settings, { className: "h-4 w-4 text-ph-mutedtext", "aria-hidden": true }),
|
|
1411
|
-
"Profile settings"
|
|
1412
|
-
]
|
|
1413
|
-
}
|
|
1414
|
-
),
|
|
1415
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1416
|
-
"button",
|
|
1417
|
-
{
|
|
1418
|
-
role: "menuitem",
|
|
1419
|
-
type: "button",
|
|
1420
|
-
"data-test": `${dataTest}-sign-out`,
|
|
1421
|
-
className: "flex min-h-11 w-full items-center gap-2 rounded-lg px-2 text-left text-sm text-ph-ink transition-colors hover:bg-ph-muted",
|
|
1422
|
-
onClick: () => {
|
|
1423
|
-
setOpen(false);
|
|
1424
|
-
onSignOut();
|
|
1425
|
-
},
|
|
1426
|
-
children: [
|
|
1427
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_iconoir_react6.LogOut, { className: "h-4 w-4 text-ph-mutedtext", "aria-hidden": true }),
|
|
1428
|
-
"Sign out"
|
|
1429
|
-
]
|
|
1430
|
-
}
|
|
1431
|
-
)
|
|
1432
|
-
]
|
|
1433
|
-
}
|
|
1434
|
-
)
|
|
1435
|
-
] }) : null
|
|
1436
|
-
] });
|
|
1522
|
+
),
|
|
1523
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1524
|
+
DropdownItem,
|
|
1525
|
+
{
|
|
1526
|
+
"data-test": `${dataTest}-sign-out`,
|
|
1527
|
+
onClick: onSignOut,
|
|
1528
|
+
children: [
|
|
1529
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_iconoir_react6.LogOut, { className: "h-4 w-4 text-ph-mutedtext", "aria-hidden": true }),
|
|
1530
|
+
"Sign out"
|
|
1531
|
+
]
|
|
1532
|
+
}
|
|
1533
|
+
)
|
|
1534
|
+
]
|
|
1535
|
+
}
|
|
1536
|
+
);
|
|
1437
1537
|
}
|
|
1438
1538
|
|
|
1439
1539
|
// src/suite/components/suite-bottom-nav.tsx
|
|
1440
|
-
var
|
|
1441
|
-
var
|
|
1540
|
+
var import_link = __toESM(require("next/link"));
|
|
1541
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1442
1542
|
function SuiteBottomNav({
|
|
1443
1543
|
items,
|
|
1444
1544
|
ariaLabel = "Primary navigation",
|
|
@@ -1451,8 +1551,8 @@ function SuiteBottomNav({
|
|
|
1451
1551
|
);
|
|
1452
1552
|
}
|
|
1453
1553
|
const activeIndex = items.findIndex((item) => item.active);
|
|
1454
|
-
return /* @__PURE__ */ (0,
|
|
1455
|
-
/* @__PURE__ */ (0,
|
|
1554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1555
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1456
1556
|
"div",
|
|
1457
1557
|
{
|
|
1458
1558
|
"aria-hidden": true,
|
|
@@ -1460,7 +1560,7 @@ function SuiteBottomNav({
|
|
|
1460
1560
|
style: { height: "calc(60px + env(safe-area-inset-bottom))" }
|
|
1461
1561
|
}
|
|
1462
1562
|
),
|
|
1463
|
-
/* @__PURE__ */ (0,
|
|
1563
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1464
1564
|
"nav",
|
|
1465
1565
|
{
|
|
1466
1566
|
"aria-label": ariaLabel,
|
|
@@ -1475,13 +1575,13 @@ function SuiteBottomNav({
|
|
|
1475
1575
|
"--suite-nav-active": activeIndex >= 0 ? activeIndex : 0
|
|
1476
1576
|
},
|
|
1477
1577
|
children: [
|
|
1478
|
-
activeIndex >= 0 ? /* @__PURE__ */ (0,
|
|
1578
|
+
activeIndex >= 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "aria-hidden": true, className: "suite-bottom-nav__indicator" }) : null,
|
|
1479
1579
|
items.map((item) => {
|
|
1480
1580
|
var _a;
|
|
1481
1581
|
const Icon = item.icon;
|
|
1482
1582
|
const active = Boolean(item.active);
|
|
1483
|
-
return /* @__PURE__ */ (0,
|
|
1484
|
-
|
|
1583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1584
|
+
import_link.default,
|
|
1485
1585
|
{
|
|
1486
1586
|
href: item.href,
|
|
1487
1587
|
"data-test": (_a = item.dataTest) != null ? _a : `suite-nav-${item.label.toLowerCase().replace(/\s+/g, "-")}`,
|
|
@@ -1491,14 +1591,14 @@ function SuiteBottomNav({
|
|
|
1491
1591
|
active && "font-semibold text-ph-brand"
|
|
1492
1592
|
),
|
|
1493
1593
|
children: [
|
|
1494
|
-
/* @__PURE__ */ (0,
|
|
1594
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1495
1595
|
"span",
|
|
1496
1596
|
{
|
|
1497
1597
|
className: cn(
|
|
1498
1598
|
"suite-bottom-nav__icon relative z-10 inline-flex items-center justify-center",
|
|
1499
1599
|
active && "suite-bottom-nav__icon--active"
|
|
1500
1600
|
),
|
|
1501
|
-
children: /* @__PURE__ */ (0,
|
|
1601
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1502
1602
|
Icon,
|
|
1503
1603
|
{
|
|
1504
1604
|
className: "h-6 w-6",
|
|
@@ -1508,7 +1608,7 @@ function SuiteBottomNav({
|
|
|
1508
1608
|
)
|
|
1509
1609
|
}
|
|
1510
1610
|
),
|
|
1511
|
-
/* @__PURE__ */ (0,
|
|
1611
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "relative z-10 max-w-full truncate", children: item.label })
|
|
1512
1612
|
]
|
|
1513
1613
|
},
|
|
1514
1614
|
item.href
|
|
@@ -1526,7 +1626,7 @@ var SUITE_APPS2 = [
|
|
|
1526
1626
|
slug: "shellstack",
|
|
1527
1627
|
name: "ShellStack",
|
|
1528
1628
|
description: "Organisation and billing",
|
|
1529
|
-
icon: "/
|
|
1629
|
+
icon: "/icon-shellstack.svg",
|
|
1530
1630
|
landing: "/home",
|
|
1531
1631
|
baseUrlEnv: "NEXT_PUBLIC_SHELLSTACK_URL",
|
|
1532
1632
|
baseUrlFallback: "http://localhost:3002"
|
|
@@ -1568,7 +1668,7 @@ function suiteAppBaseUrl(slug) {
|
|
|
1568
1668
|
|
|
1569
1669
|
// src/suite/components/today-calibrating.tsx
|
|
1570
1670
|
var import_iconoir_react7 = require("iconoir-react");
|
|
1571
|
-
var
|
|
1671
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1572
1672
|
function TodayCalibrating({
|
|
1573
1673
|
onRetry,
|
|
1574
1674
|
retrying = false,
|
|
@@ -1577,7 +1677,7 @@ function TodayCalibrating({
|
|
|
1577
1677
|
variant = "ring",
|
|
1578
1678
|
retrySpinnerClassName = "text-ph-brand"
|
|
1579
1679
|
}) {
|
|
1580
|
-
return /* @__PURE__ */ (0,
|
|
1680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1581
1681
|
"div",
|
|
1582
1682
|
{
|
|
1583
1683
|
className: cn(
|
|
@@ -1586,16 +1686,16 @@ function TodayCalibrating({
|
|
|
1586
1686
|
),
|
|
1587
1687
|
"data-test": "today-calibrating",
|
|
1588
1688
|
children: [
|
|
1589
|
-
/* @__PURE__ */ (0,
|
|
1689
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1590
1690
|
"div",
|
|
1591
1691
|
{
|
|
1592
1692
|
className: "pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_35%,rgba(251,191,36,0.12),transparent_55%)]",
|
|
1593
1693
|
"aria-hidden": true
|
|
1594
1694
|
}
|
|
1595
1695
|
),
|
|
1596
|
-
/* @__PURE__ */ (0,
|
|
1597
|
-
variant === "ring" ? /* @__PURE__ */ (0,
|
|
1598
|
-
/* @__PURE__ */ (0,
|
|
1696
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "relative mb-6 flex h-24 w-24 items-center justify-center", children: [
|
|
1697
|
+
variant === "ring" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1698
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1599
1699
|
Spinner,
|
|
1600
1700
|
{
|
|
1601
1701
|
size: "lg",
|
|
@@ -1603,7 +1703,7 @@ function TodayCalibrating({
|
|
|
1603
1703
|
label: "Loading today"
|
|
1604
1704
|
}
|
|
1605
1705
|
),
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
1706
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1607
1707
|
"span",
|
|
1608
1708
|
{
|
|
1609
1709
|
className: "bg-ph-muted/30 absolute inset-2 animate-ping rounded-full",
|
|
@@ -1611,7 +1711,7 @@ function TodayCalibrating({
|
|
|
1611
1711
|
}
|
|
1612
1712
|
)
|
|
1613
1713
|
] }) : null,
|
|
1614
|
-
/* @__PURE__ */ (0,
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "relative 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_runtime15.jsx)(
|
|
1615
1715
|
import_iconoir_react7.SunLight,
|
|
1616
1716
|
{
|
|
1617
1717
|
className: cn("h-9 w-9", variant === "pulse" && "animate-pulse"),
|
|
@@ -1620,9 +1720,9 @@ function TodayCalibrating({
|
|
|
1620
1720
|
}
|
|
1621
1721
|
) })
|
|
1622
1722
|
] }),
|
|
1623
|
-
/* @__PURE__ */ (0,
|
|
1624
|
-
/* @__PURE__ */ (0,
|
|
1625
|
-
/* @__PURE__ */ (0,
|
|
1723
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { className: "relative text-base font-semibold tracking-tight text-ph-ink sm:text-lg md:text-xl", children: "Calibrating your day" }),
|
|
1724
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.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" }),
|
|
1725
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "relative mt-5 flex gap-1.5", "aria-hidden": true, children: [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1626
1726
|
"span",
|
|
1627
1727
|
{
|
|
1628
1728
|
className: "h-1.5 w-5 animate-pulse rounded-full bg-ph-muted",
|
|
@@ -1630,7 +1730,7 @@ function TodayCalibrating({
|
|
|
1630
1730
|
},
|
|
1631
1731
|
i
|
|
1632
1732
|
)) }),
|
|
1633
|
-
onRetry ? /* @__PURE__ */ (0,
|
|
1733
|
+
onRetry ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1634
1734
|
"button",
|
|
1635
1735
|
{
|
|
1636
1736
|
type: "button",
|
|
@@ -1638,7 +1738,7 @@ function TodayCalibrating({
|
|
|
1638
1738
|
disabled: retrying,
|
|
1639
1739
|
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",
|
|
1640
1740
|
children: [
|
|
1641
|
-
retrying ? /* @__PURE__ */ (0,
|
|
1741
|
+
retrying ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Spinner, { size: "sm", className: retrySpinnerClassName }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_iconoir_react7.Refresh, { className: "h-4 w-4", "aria-hidden": true }),
|
|
1642
1742
|
"Try again"
|
|
1643
1743
|
]
|
|
1644
1744
|
}
|
|
@@ -1649,9 +1749,9 @@ function TodayCalibrating({
|
|
|
1649
1749
|
}
|
|
1650
1750
|
|
|
1651
1751
|
// src/suite/components/theme-provider.tsx
|
|
1652
|
-
var
|
|
1653
|
-
var
|
|
1654
|
-
var SuiteThemeContext = (0,
|
|
1752
|
+
var import_react6 = require("react");
|
|
1753
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1754
|
+
var SuiteThemeContext = (0, import_react6.createContext)(null);
|
|
1655
1755
|
function systemTheme(fallback) {
|
|
1656
1756
|
if (typeof window === "undefined") return fallback;
|
|
1657
1757
|
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
@@ -1688,7 +1788,7 @@ function SuiteThemeProvider({
|
|
|
1688
1788
|
config,
|
|
1689
1789
|
children
|
|
1690
1790
|
}) {
|
|
1691
|
-
const [state, setState] = (0,
|
|
1791
|
+
const [state, setState] = (0, import_react6.useState)(() => {
|
|
1692
1792
|
const theme2 = readStoredTheme(config.storageKey);
|
|
1693
1793
|
if (typeof document === "undefined") {
|
|
1694
1794
|
return { theme: theme2, resolvedTheme: config.fallbackTheme };
|
|
@@ -1698,7 +1798,7 @@ function SuiteThemeProvider({
|
|
|
1698
1798
|
return { theme: theme2, resolvedTheme: resolvedTheme2 };
|
|
1699
1799
|
});
|
|
1700
1800
|
const { theme, resolvedTheme } = state;
|
|
1701
|
-
(0,
|
|
1801
|
+
(0, import_react6.useEffect)(() => {
|
|
1702
1802
|
if (theme !== "system") return;
|
|
1703
1803
|
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1704
1804
|
const update = () => {
|
|
@@ -1708,7 +1808,7 @@ function SuiteThemeProvider({
|
|
|
1708
1808
|
media.addEventListener("change", update);
|
|
1709
1809
|
return () => media.removeEventListener("change", update);
|
|
1710
1810
|
}, [theme, config]);
|
|
1711
|
-
const setTheme = (0,
|
|
1811
|
+
const setTheme = (0, import_react6.useCallback)(
|
|
1712
1812
|
(next) => {
|
|
1713
1813
|
const resolved = applyTheme(next, config);
|
|
1714
1814
|
setState({ theme: next, resolvedTheme: resolved });
|
|
@@ -1716,7 +1816,7 @@ function SuiteThemeProvider({
|
|
|
1716
1816
|
},
|
|
1717
1817
|
[config]
|
|
1718
1818
|
);
|
|
1719
|
-
const toggleTheme = (0,
|
|
1819
|
+
const toggleTheme = (0, import_react6.useCallback)(() => {
|
|
1720
1820
|
setState((prev) => {
|
|
1721
1821
|
const next = resolveTheme(prev.theme, config.fallbackTheme) === "dark" ? "light" : "dark";
|
|
1722
1822
|
const resolved = applyTheme(next, config);
|
|
@@ -1724,22 +1824,22 @@ function SuiteThemeProvider({
|
|
|
1724
1824
|
return { theme: next, resolvedTheme: resolved };
|
|
1725
1825
|
});
|
|
1726
1826
|
}, [config]);
|
|
1727
|
-
const value = (0,
|
|
1827
|
+
const value = (0, import_react6.useMemo)(
|
|
1728
1828
|
() => ({ theme, resolvedTheme, setTheme, toggleTheme }),
|
|
1729
1829
|
[theme, resolvedTheme, setTheme, toggleTheme]
|
|
1730
1830
|
);
|
|
1731
|
-
return /* @__PURE__ */ (0,
|
|
1831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SuiteThemeContext.Provider, { value, children });
|
|
1732
1832
|
}
|
|
1733
1833
|
function useSuiteTheme() {
|
|
1734
|
-
const ctx = (0,
|
|
1834
|
+
const ctx = (0, import_react6.useContext)(SuiteThemeContext);
|
|
1735
1835
|
if (!ctx) throw new Error("useTheme must be used within ThemeProvider");
|
|
1736
1836
|
return ctx;
|
|
1737
1837
|
}
|
|
1738
1838
|
|
|
1739
1839
|
// src/suite/components/ai-panel.tsx
|
|
1740
|
-
var
|
|
1840
|
+
var import_react7 = require("react");
|
|
1741
1841
|
var import_iconoir_react8 = require("iconoir-react");
|
|
1742
|
-
var
|
|
1842
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1743
1843
|
function SuiteAiPanel({
|
|
1744
1844
|
presets,
|
|
1745
1845
|
emptyState,
|
|
@@ -1748,12 +1848,12 @@ function SuiteAiPanel({
|
|
|
1748
1848
|
brandIcon: BrandIcon,
|
|
1749
1849
|
spinner: Spinner
|
|
1750
1850
|
}) {
|
|
1751
|
-
const [open, setOpen] = (0,
|
|
1752
|
-
const [prompt, setPrompt] = (0,
|
|
1753
|
-
const [loading, setLoading] = (0,
|
|
1754
|
-
const [answer, setAnswer] = (0,
|
|
1755
|
-
const [error, setError] = (0,
|
|
1756
|
-
const [copied, setCopied] = (0,
|
|
1851
|
+
const [open, setOpen] = (0, import_react7.useState)(false);
|
|
1852
|
+
const [prompt, setPrompt] = (0, import_react7.useState)("");
|
|
1853
|
+
const [loading, setLoading] = (0, import_react7.useState)(false);
|
|
1854
|
+
const [answer, setAnswer] = (0, import_react7.useState)("");
|
|
1855
|
+
const [error, setError] = (0, import_react7.useState)("");
|
|
1856
|
+
const [copied, setCopied] = (0, import_react7.useState)(false);
|
|
1757
1857
|
async function ask(text) {
|
|
1758
1858
|
const trimmed = text.trim();
|
|
1759
1859
|
if (!trimmed || loading) return;
|
|
@@ -1786,8 +1886,8 @@ function SuiteAiPanel({
|
|
|
1786
1886
|
} catch (e) {
|
|
1787
1887
|
}
|
|
1788
1888
|
}
|
|
1789
|
-
return /* @__PURE__ */ (0,
|
|
1790
|
-
/* @__PURE__ */ (0,
|
|
1889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1890
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1791
1891
|
"button",
|
|
1792
1892
|
{
|
|
1793
1893
|
type: "button",
|
|
@@ -1796,13 +1896,13 @@ function SuiteAiPanel({
|
|
|
1796
1896
|
className: "fixed bottom-5 right-5 z-30 flex items-center gap-2 rounded-full border border-ph-border bg-ph-surface px-4 py-2.5 text-sm font-medium text-ph-ink shadow-ph hover:bg-ph-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ph-brand",
|
|
1797
1897
|
"aria-label": "Open ShellStack AI",
|
|
1798
1898
|
children: [
|
|
1799
|
-
/* @__PURE__ */ (0,
|
|
1899
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BrandIcon, { className: "h-4 w-4 text-ph-brand" }),
|
|
1800
1900
|
"Ask AI"
|
|
1801
1901
|
]
|
|
1802
1902
|
}
|
|
1803
1903
|
),
|
|
1804
|
-
open && /* @__PURE__ */ (0,
|
|
1805
|
-
/* @__PURE__ */ (0,
|
|
1904
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "fixed inset-0 z-40", role: "dialog", "aria-modal": "true", children: [
|
|
1905
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1806
1906
|
"button",
|
|
1807
1907
|
{
|
|
1808
1908
|
type: "button",
|
|
@@ -1811,24 +1911,24 @@ function SuiteAiPanel({
|
|
|
1811
1911
|
"aria-label": "Close AI panel"
|
|
1812
1912
|
}
|
|
1813
1913
|
),
|
|
1814
|
-
/* @__PURE__ */ (0,
|
|
1815
|
-
/* @__PURE__ */ (0,
|
|
1816
|
-
/* @__PURE__ */ (0,
|
|
1817
|
-
/* @__PURE__ */ (0,
|
|
1818
|
-
/* @__PURE__ */ (0,
|
|
1914
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("aside", { className: "absolute inset-y-0 right-0 flex w-full max-w-md flex-col border-l border-ph-border bg-ph-surface shadow-2xl", children: [
|
|
1915
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between border-b border-ph-border px-4 py-3", children: [
|
|
1916
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1917
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BrandIcon, { className: "h-4 w-4 text-ph-brand" }),
|
|
1918
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-semibold text-ph-ink", children: "ShellStack AI" })
|
|
1819
1919
|
] }),
|
|
1820
|
-
/* @__PURE__ */ (0,
|
|
1920
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1821
1921
|
"button",
|
|
1822
1922
|
{
|
|
1823
1923
|
type: "button",
|
|
1824
1924
|
onClick: () => setOpen(false),
|
|
1825
1925
|
className: "rounded p-1 hover:bg-ph-muted",
|
|
1826
1926
|
"aria-label": "Close",
|
|
1827
|
-
children: /* @__PURE__ */ (0,
|
|
1927
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_iconoir_react8.Xmark, { className: "h-4 w-4" })
|
|
1828
1928
|
}
|
|
1829
1929
|
)
|
|
1830
1930
|
] }),
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1931
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex flex-wrap gap-1.5 border-b border-ph-border px-4 py-2", children: presets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1832
1932
|
"button",
|
|
1833
1933
|
{
|
|
1834
1934
|
type: "button",
|
|
@@ -1842,31 +1942,31 @@ function SuiteAiPanel({
|
|
|
1842
1942
|
},
|
|
1843
1943
|
preset.label
|
|
1844
1944
|
)) }),
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1846
|
-
error && /* @__PURE__ */ (0,
|
|
1847
|
-
loading && /* @__PURE__ */ (0,
|
|
1848
|
-
/* @__PURE__ */ (0,
|
|
1945
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
|
|
1946
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "bg-ph-danger/10 rounded-lg px-3 py-2 text-sm text-ph-danger", children: error }),
|
|
1947
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-2 text-sm text-ph-mutedtext", children: [
|
|
1948
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Spinner, { className: "h-4 w-4 animate-spin" }),
|
|
1849
1949
|
"Thinking\u2026"
|
|
1850
1950
|
] }),
|
|
1851
|
-
answer && !loading && /* @__PURE__ */ (0,
|
|
1852
|
-
/* @__PURE__ */ (0,
|
|
1853
|
-
/* @__PURE__ */ (0,
|
|
1951
|
+
answer && !loading && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rounded-lg bg-ph-muted px-3 py-2 text-sm text-ph-ink", children: [
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "whitespace-pre-wrap", children: answer }),
|
|
1953
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1854
1954
|
"button",
|
|
1855
1955
|
{
|
|
1856
1956
|
type: "button",
|
|
1857
1957
|
onClick: () => void copyAnswer(),
|
|
1858
1958
|
className: "mt-2 inline-flex items-center gap-1 text-xs text-ph-mutedtext hover:text-ph-ink",
|
|
1859
1959
|
children: [
|
|
1860
|
-
copied ? /* @__PURE__ */ (0,
|
|
1960
|
+
copied ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_iconoir_react8.Check, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_iconoir_react8.Copy, { className: "h-3 w-3" }),
|
|
1861
1961
|
copied ? "Copied" : "Copy"
|
|
1862
1962
|
]
|
|
1863
1963
|
}
|
|
1864
1964
|
)
|
|
1865
1965
|
] }),
|
|
1866
|
-
!answer && !loading && !error && /* @__PURE__ */ (0,
|
|
1966
|
+
!answer && !loading && !error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "mt-8 text-center text-xs text-ph-mutedtext", children: emptyState })
|
|
1867
1967
|
] }),
|
|
1868
|
-
/* @__PURE__ */ (0,
|
|
1869
|
-
/* @__PURE__ */ (0,
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "border-t border-ph-border p-3", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex gap-2", children: [
|
|
1969
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1870
1970
|
"textarea",
|
|
1871
1971
|
{
|
|
1872
1972
|
value: prompt,
|
|
@@ -1883,7 +1983,7 @@ function SuiteAiPanel({
|
|
|
1883
1983
|
className: "flex-1 resize-none rounded-lg border border-ph-border bg-ph-canvas p-2 text-sm text-ph-ink outline-none focus:ring-1 focus:ring-ph-brand"
|
|
1884
1984
|
}
|
|
1885
1985
|
),
|
|
1886
|
-
/* @__PURE__ */ (0,
|
|
1986
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1887
1987
|
"button",
|
|
1888
1988
|
{
|
|
1889
1989
|
type: "button",
|
|
@@ -1900,10 +2000,10 @@ function SuiteAiPanel({
|
|
|
1900
2000
|
}
|
|
1901
2001
|
|
|
1902
2002
|
// src/suite/lib/motion.tsx
|
|
1903
|
-
var
|
|
1904
|
-
var
|
|
2003
|
+
var import_react8 = require("motion/react");
|
|
2004
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1905
2005
|
function SuiteMotionProvider({ children }) {
|
|
1906
|
-
return /* @__PURE__ */ (0,
|
|
2006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react8.LazyMotion, { features: import_react8.domAnimation, strict: true, children });
|
|
1907
2007
|
}
|
|
1908
2008
|
var SUITE_SPRINGS = {
|
|
1909
2009
|
/** Snappy panel/sheet entrances — small overshoot. */
|
|
@@ -1915,7 +2015,7 @@ var SUITE_SPRINGS = {
|
|
|
1915
2015
|
};
|
|
1916
2016
|
|
|
1917
2017
|
// src/suite/components/suite-layout.tsx
|
|
1918
|
-
var
|
|
2018
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1919
2019
|
var WIDTHS = {
|
|
1920
2020
|
full: "max-w-none",
|
|
1921
2021
|
wide: "max-w-7xl",
|
|
@@ -1923,18 +2023,18 @@ var WIDTHS = {
|
|
|
1923
2023
|
narrow: "max-w-4xl"
|
|
1924
2024
|
};
|
|
1925
2025
|
function SuiteBreadcrumbs({ items, className }) {
|
|
1926
|
-
return /* @__PURE__ */ (0,
|
|
2026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("nav", { "aria-label": "Breadcrumb", className, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ol", { className: "flex min-w-0 items-center gap-1.5", children: items.map((item, index) => {
|
|
1927
2027
|
const isLast = index === items.length - 1;
|
|
1928
|
-
return /* @__PURE__ */ (0,
|
|
1929
|
-
index > 0 ? /* @__PURE__ */ (0,
|
|
1930
|
-
item.href && !isLast ? /* @__PURE__ */ (0,
|
|
2028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("li", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
2029
|
+
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "select-none text-ph-border", "aria-hidden": "true", children: "/" }) : null,
|
|
2030
|
+
item.href && !isLast ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1931
2031
|
"a",
|
|
1932
2032
|
{
|
|
1933
2033
|
href: item.href,
|
|
1934
2034
|
className: "truncate transition hover:text-ph-ink",
|
|
1935
2035
|
children: item.label
|
|
1936
2036
|
}
|
|
1937
|
-
) : /* @__PURE__ */ (0,
|
|
2037
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1938
2038
|
"span",
|
|
1939
2039
|
{
|
|
1940
2040
|
className: cn(
|
|
@@ -1959,7 +2059,7 @@ function SuitePage({
|
|
|
1959
2059
|
role,
|
|
1960
2060
|
"aria-live": ariaLive
|
|
1961
2061
|
}) {
|
|
1962
|
-
return /* @__PURE__ */ (0,
|
|
2062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1963
2063
|
Component,
|
|
1964
2064
|
{
|
|
1965
2065
|
id,
|
|
@@ -1969,9 +2069,8 @@ function SuitePage({
|
|
|
1969
2069
|
className: cn(
|
|
1970
2070
|
"mx-auto flex w-full min-w-0 flex-col",
|
|
1971
2071
|
WIDTHS[width],
|
|
1972
|
-
//
|
|
1973
|
-
|
|
1974
|
-
inset && "px-4 pb-10 pt-5 sm:px-6 sm:pt-6 lg:px-8",
|
|
2072
|
+
// Tight inset keeps page titles aligned without excessive whitespace.
|
|
2073
|
+
inset && "px-4 pb-6 pt-4 sm:px-6 sm:pb-7 sm:pt-5 lg:px-8",
|
|
1975
2074
|
className
|
|
1976
2075
|
),
|
|
1977
2076
|
children
|
|
@@ -1996,7 +2095,7 @@ function SuitePageHeader({
|
|
|
1996
2095
|
/** Breadcrumb line rendered above the title. */
|
|
1997
2096
|
breadcrumb
|
|
1998
2097
|
}) {
|
|
1999
|
-
const resolvedIcon = todayIcon ? /* @__PURE__ */ (0,
|
|
2098
|
+
const resolvedIcon = todayIcon ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2000
2099
|
TodayTimeIcon,
|
|
2001
2100
|
{
|
|
2002
2101
|
className: cn(
|
|
@@ -2005,17 +2104,17 @@ function SuitePageHeader({
|
|
|
2005
2104
|
)
|
|
2006
2105
|
}
|
|
2007
2106
|
) : icon;
|
|
2008
|
-
return /* @__PURE__ */ (0,
|
|
2107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2009
2108
|
"header",
|
|
2010
2109
|
{
|
|
2011
2110
|
"data-test": dataTest,
|
|
2012
2111
|
className: cn(
|
|
2013
|
-
"flex items-start justify-between gap-4 pb-
|
|
2112
|
+
"flex items-start justify-between gap-4 pb-4 sm:pb-5",
|
|
2014
2113
|
className
|
|
2015
2114
|
),
|
|
2016
2115
|
children: [
|
|
2017
|
-
/* @__PURE__ */ (0,
|
|
2018
|
-
resolvedIcon ? /* @__PURE__ */ (0,
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex min-w-0 items-start gap-3", children: [
|
|
2117
|
+
resolvedIcon ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2019
2118
|
"div",
|
|
2020
2119
|
{
|
|
2021
2120
|
className: "hidden shrink-0 pt-1 sm:block",
|
|
@@ -2023,11 +2122,11 @@ function SuitePageHeader({
|
|
|
2023
2122
|
children: resolvedIcon
|
|
2024
2123
|
}
|
|
2025
2124
|
) : null,
|
|
2026
|
-
/* @__PURE__ */ (0,
|
|
2027
|
-
eyebrow ? /* @__PURE__ */ (0,
|
|
2028
|
-
breadcrumb ? /* @__PURE__ */ (0,
|
|
2029
|
-
/* @__PURE__ */ (0,
|
|
2030
|
-
/* @__PURE__ */ (0,
|
|
2125
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2126
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mb-0.5 flex min-w-0 items-center gap-1.5 text-xs text-ph-subtle", children: eyebrow }) : null,
|
|
2127
|
+
breadcrumb ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mb-0.5 flex min-w-0 items-center gap-1.5 text-xs text-ph-subtle", children: breadcrumb }) : null,
|
|
2128
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
2129
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2031
2130
|
"h1",
|
|
2032
2131
|
{
|
|
2033
2132
|
className: cn(
|
|
@@ -2037,12 +2136,12 @@ function SuitePageHeader({
|
|
|
2037
2136
|
children: title
|
|
2038
2137
|
}
|
|
2039
2138
|
),
|
|
2040
|
-
badge ? /* @__PURE__ */ (0,
|
|
2139
|
+
badge ? /* @__PURE__ */ (0, import_jsx_runtime19.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
|
|
2041
2140
|
] }),
|
|
2042
|
-
description ? /* @__PURE__ */ (0,
|
|
2141
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mt-1 max-w-2xl text-pretty text-sm leading-5 text-ph-subtle", children: description }) : null
|
|
2043
2142
|
] })
|
|
2044
2143
|
] }),
|
|
2045
|
-
actions ? /* @__PURE__ */ (0,
|
|
2144
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex shrink-0 items-center gap-2 pt-1", children: actions }) : null
|
|
2046
2145
|
]
|
|
2047
2146
|
}
|
|
2048
2147
|
);
|
|
@@ -2053,7 +2152,7 @@ function SuiteToolbar({
|
|
|
2053
2152
|
label = "Page tools",
|
|
2054
2153
|
dataTest
|
|
2055
2154
|
}) {
|
|
2056
|
-
return /* @__PURE__ */ (0,
|
|
2155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2057
2156
|
"div",
|
|
2058
2157
|
{
|
|
2059
2158
|
role: "toolbar",
|
|
@@ -2070,7 +2169,7 @@ function SuiteTabList({
|
|
|
2070
2169
|
label,
|
|
2071
2170
|
dataTest
|
|
2072
2171
|
}) {
|
|
2073
|
-
return /* @__PURE__ */ (0,
|
|
2172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2074
2173
|
"nav",
|
|
2075
2174
|
{
|
|
2076
2175
|
"aria-label": label,
|
|
@@ -2089,7 +2188,7 @@ function SuiteSectionHeader({
|
|
|
2089
2188
|
action,
|
|
2090
2189
|
className
|
|
2091
2190
|
}) {
|
|
2092
|
-
return /* @__PURE__ */ (0,
|
|
2191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2093
2192
|
"div",
|
|
2094
2193
|
{
|
|
2095
2194
|
className: cn(
|
|
@@ -2097,35 +2196,35 @@ function SuiteSectionHeader({
|
|
|
2097
2196
|
className
|
|
2098
2197
|
),
|
|
2099
2198
|
children: [
|
|
2100
|
-
/* @__PURE__ */ (0,
|
|
2101
|
-
/* @__PURE__ */ (0,
|
|
2102
|
-
description ? /* @__PURE__ */ (0,
|
|
2199
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "min-w-0", children: [
|
|
2200
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { className: "font-display text-balance text-lg font-semibold tracking-tight text-ph-ink sm:text-xl", children: title }),
|
|
2201
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mt-1 max-w-2xl text-pretty text-sm leading-5 text-ph-subtle", children: description }) : null
|
|
2103
2202
|
] }),
|
|
2104
|
-
action ? /* @__PURE__ */ (0,
|
|
2203
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex min-h-[44px] shrink-0 items-center", children: action }) : null
|
|
2105
2204
|
]
|
|
2106
2205
|
}
|
|
2107
2206
|
);
|
|
2108
2207
|
}
|
|
2109
2208
|
|
|
2110
2209
|
// src/suite/components/suite-skeleton.tsx
|
|
2111
|
-
var
|
|
2210
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2112
2211
|
function SuiteSkeleton({
|
|
2113
2212
|
className,
|
|
2114
2213
|
lines = 1,
|
|
2115
2214
|
circle,
|
|
2116
2215
|
width
|
|
2117
2216
|
}) {
|
|
2118
|
-
return /* @__PURE__ */ (0,
|
|
2217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2119
2218
|
"div",
|
|
2120
2219
|
{
|
|
2121
2220
|
className: cn("space-y-2", circle ? "flex flex-col items-center" : ""),
|
|
2122
2221
|
"aria-hidden": true,
|
|
2123
|
-
children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ (0,
|
|
2222
|
+
children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2124
2223
|
"div",
|
|
2125
2224
|
{
|
|
2126
2225
|
className: "animate-[skeleton-stagger_0.6s_ease-out_both]",
|
|
2127
2226
|
style: { animationDelay: `${index * 80}ms` },
|
|
2128
|
-
children: /* @__PURE__ */ (0,
|
|
2227
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2129
2228
|
"div",
|
|
2130
2229
|
{
|
|
2131
2230
|
className: cn(
|
|
@@ -2149,7 +2248,7 @@ function SuiteSkeletonCard({
|
|
|
2149
2248
|
rows = 3,
|
|
2150
2249
|
header = true
|
|
2151
2250
|
}) {
|
|
2152
|
-
return /* @__PURE__ */ (0,
|
|
2251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2153
2252
|
"div",
|
|
2154
2253
|
{
|
|
2155
2254
|
className: cn(
|
|
@@ -2158,26 +2257,26 @@ function SuiteSkeletonCard({
|
|
|
2158
2257
|
),
|
|
2159
2258
|
"aria-hidden": true,
|
|
2160
2259
|
children: [
|
|
2161
|
-
header ? /* @__PURE__ */ (0,
|
|
2260
|
+
header ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2162
2261
|
"div",
|
|
2163
2262
|
{
|
|
2164
2263
|
className: "mb-5 flex items-center gap-3 animate-[skeleton-stagger_0.5s_ease-out_both]",
|
|
2165
2264
|
style: { animationDelay: "100ms" },
|
|
2166
2265
|
children: [
|
|
2167
|
-
/* @__PURE__ */ (0,
|
|
2168
|
-
/* @__PURE__ */ (0,
|
|
2169
|
-
/* @__PURE__ */ (0,
|
|
2170
|
-
/* @__PURE__ */ (0,
|
|
2266
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "ph-skeleton h-10 w-10 rounded-xl" }),
|
|
2267
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
2268
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "ph-skeleton h-4 w-1/3" }),
|
|
2269
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "ph-skeleton h-3 w-1/2" })
|
|
2171
2270
|
] })
|
|
2172
2271
|
]
|
|
2173
2272
|
}
|
|
2174
2273
|
) : null,
|
|
2175
|
-
/* @__PURE__ */ (0,
|
|
2274
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "space-y-3", children: Array.from({ length: rows }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2176
2275
|
"div",
|
|
2177
2276
|
{
|
|
2178
2277
|
className: "animate-[skeleton-stagger_0.5s_ease-out_both]",
|
|
2179
2278
|
style: { animationDelay: `${200 + index * 80}ms` },
|
|
2180
|
-
children: /* @__PURE__ */ (0,
|
|
2279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2181
2280
|
"div",
|
|
2182
2281
|
{
|
|
2183
2282
|
className: "ph-skeleton h-3",
|
|
@@ -2195,16 +2294,16 @@ function SuiteSkeletonList({
|
|
|
2195
2294
|
className,
|
|
2196
2295
|
items = 4
|
|
2197
2296
|
}) {
|
|
2198
|
-
return /* @__PURE__ */ (0,
|
|
2297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("space-y-3", className), "aria-hidden": true, children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2199
2298
|
"div",
|
|
2200
2299
|
{
|
|
2201
2300
|
className: "animate-[skeleton-stagger_0.6s_ease-out_both]",
|
|
2202
2301
|
style: { animationDelay: `${index * 100}ms` },
|
|
2203
|
-
children: /* @__PURE__ */ (0,
|
|
2204
|
-
/* @__PURE__ */ (0,
|
|
2205
|
-
/* @__PURE__ */ (0,
|
|
2206
|
-
/* @__PURE__ */ (0,
|
|
2207
|
-
/* @__PURE__ */ (0,
|
|
2302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-3 rounded-xl border border-ph-border/60 bg-ph-surface p-4", children: [
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "ph-skeleton h-10 w-10 rounded-lg" }),
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "min-w-0 flex-1 space-y-2", children: [
|
|
2305
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "ph-skeleton h-3.5 w-3/4" }),
|
|
2306
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "ph-skeleton h-3 w-1/2" })
|
|
2208
2307
|
] })
|
|
2209
2308
|
] })
|
|
2210
2309
|
},
|
|
@@ -2219,7 +2318,7 @@ function SuiteEmptyState({
|
|
|
2219
2318
|
className,
|
|
2220
2319
|
size = "md"
|
|
2221
2320
|
}) {
|
|
2222
|
-
return /* @__PURE__ */ (0,
|
|
2321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2223
2322
|
"div",
|
|
2224
2323
|
{
|
|
2225
2324
|
className: cn(
|
|
@@ -2228,13 +2327,13 @@ function SuiteEmptyState({
|
|
|
2228
2327
|
className
|
|
2229
2328
|
),
|
|
2230
2329
|
children: [
|
|
2231
|
-
/* @__PURE__ */ (0,
|
|
2232
|
-
/* @__PURE__ */ (0,
|
|
2233
|
-
/* @__PURE__ */ (0,
|
|
2330
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "pointer-events-none absolute inset-0 overflow-hidden opacity-60", "aria-hidden": true, children: [
|
|
2331
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "absolute -left-10 -top-10 h-40 w-40 rounded-full bg-ph-brand/10 blur-3xl" }),
|
|
2332
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "absolute -bottom-10 -right-10 h-40 w-40 rounded-full bg-ph-accent/10 blur-3xl" })
|
|
2234
2333
|
] }),
|
|
2235
|
-
/* @__PURE__ */ (0,
|
|
2236
|
-
icon ? /* @__PURE__ */ (0,
|
|
2237
|
-
/* @__PURE__ */ (0,
|
|
2334
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative", children: [
|
|
2335
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime20.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,
|
|
2336
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2238
2337
|
"h3",
|
|
2239
2338
|
{
|
|
2240
2339
|
className: cn(
|
|
@@ -2244,8 +2343,8 @@ function SuiteEmptyState({
|
|
|
2244
2343
|
children: title
|
|
2245
2344
|
}
|
|
2246
2345
|
),
|
|
2247
|
-
description ? /* @__PURE__ */ (0,
|
|
2248
|
-
action ? /* @__PURE__ */ (0,
|
|
2346
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "mx-auto mt-2 max-w-sm text-sm leading-relaxed text-ph-subtle", children: description }) : null,
|
|
2347
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "mt-5 flex flex-wrap items-center justify-center gap-2", children: action }) : null
|
|
2249
2348
|
] })
|
|
2250
2349
|
]
|
|
2251
2350
|
}
|
|
@@ -2253,24 +2352,24 @@ function SuiteEmptyState({
|
|
|
2253
2352
|
}
|
|
2254
2353
|
|
|
2255
2354
|
// src/suite/components/suite-settings-mobile-nav.tsx
|
|
2256
|
-
var
|
|
2257
|
-
var
|
|
2355
|
+
var import_react9 = require("react");
|
|
2356
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2258
2357
|
function SuiteSettingsMobileNav({
|
|
2259
2358
|
items,
|
|
2260
2359
|
activeHref,
|
|
2261
2360
|
onSelect,
|
|
2262
2361
|
dataTest
|
|
2263
2362
|
}) {
|
|
2264
|
-
return /* @__PURE__ */ (0,
|
|
2363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2265
2364
|
"nav",
|
|
2266
2365
|
{
|
|
2267
2366
|
"data-test": dataTest,
|
|
2268
2367
|
"aria-label": "Settings sections",
|
|
2269
2368
|
className: "-mx-4 px-4 lg:hidden",
|
|
2270
|
-
children: /* @__PURE__ */ (0,
|
|
2369
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.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) => {
|
|
2271
2370
|
const Icon = item.icon;
|
|
2272
2371
|
const active = activeHref === item.href || activeHref.startsWith(`${item.href}/`);
|
|
2273
|
-
const iconNode = (0,
|
|
2372
|
+
const iconNode = (0, import_react9.isValidElement)(item.icon) ? item.icon : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2274
2373
|
Icon,
|
|
2275
2374
|
{
|
|
2276
2375
|
className: cn(
|
|
@@ -2280,7 +2379,7 @@ function SuiteSettingsMobileNav({
|
|
|
2280
2379
|
"aria-hidden": true
|
|
2281
2380
|
}
|
|
2282
2381
|
);
|
|
2283
|
-
return /* @__PURE__ */ (0,
|
|
2382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2284
2383
|
"button",
|
|
2285
2384
|
{
|
|
2286
2385
|
type: "button",
|
|
@@ -2294,8 +2393,8 @@ function SuiteSettingsMobileNav({
|
|
|
2294
2393
|
),
|
|
2295
2394
|
children: [
|
|
2296
2395
|
iconNode,
|
|
2297
|
-
/* @__PURE__ */ (0,
|
|
2298
|
-
active ? /* @__PURE__ */ (0,
|
|
2396
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "whitespace-nowrap", children: item.label }),
|
|
2397
|
+
active ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "absolute inset-x-0 -bottom-3 h-0.5 rounded-full bg-ph-ink lg:hidden" }) : null
|
|
2299
2398
|
]
|
|
2300
2399
|
},
|
|
2301
2400
|
item.href
|
|
@@ -2306,8 +2405,145 @@ function SuiteSettingsMobileNav({
|
|
|
2306
2405
|
}
|
|
2307
2406
|
|
|
2308
2407
|
// src/suite/components/suite-sidebar.tsx
|
|
2309
|
-
var
|
|
2310
|
-
|
|
2408
|
+
var import_link2 = __toESM(require("next/link"));
|
|
2409
|
+
|
|
2410
|
+
// src/components/ui/Tooltip.tsx
|
|
2411
|
+
var import_react10 = require("react");
|
|
2412
|
+
var import_react_dom = require("react-dom");
|
|
2413
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2414
|
+
var TooltipDelayContext = (0, import_react10.createContext)(0);
|
|
2415
|
+
function tooltipPosition(trigger, side, align, offset) {
|
|
2416
|
+
const horizontal = align === "start" ? trigger.left : align === "end" ? trigger.right : trigger.left + trigger.width / 2;
|
|
2417
|
+
const vertical = align === "start" ? trigger.top : align === "end" ? trigger.bottom : trigger.top + trigger.height / 2;
|
|
2418
|
+
if (side === "top")
|
|
2419
|
+
return {
|
|
2420
|
+
left: horizontal,
|
|
2421
|
+
top: trigger.top - offset,
|
|
2422
|
+
transform: "translate(-50%, -100%)"
|
|
2423
|
+
};
|
|
2424
|
+
if (side === "bottom")
|
|
2425
|
+
return {
|
|
2426
|
+
left: horizontal,
|
|
2427
|
+
top: trigger.bottom + offset,
|
|
2428
|
+
transform: "translate(-50%, 0)"
|
|
2429
|
+
};
|
|
2430
|
+
if (side === "left")
|
|
2431
|
+
return {
|
|
2432
|
+
left: trigger.left - offset,
|
|
2433
|
+
top: vertical,
|
|
2434
|
+
transform: "translate(-100%, -50%)"
|
|
2435
|
+
};
|
|
2436
|
+
return {
|
|
2437
|
+
left: trigger.right + offset,
|
|
2438
|
+
top: vertical,
|
|
2439
|
+
transform: "translate(0, -50%)"
|
|
2440
|
+
};
|
|
2441
|
+
}
|
|
2442
|
+
function Tooltip({
|
|
2443
|
+
content,
|
|
2444
|
+
children,
|
|
2445
|
+
side = "top",
|
|
2446
|
+
align = "center",
|
|
2447
|
+
sideOffset = 7,
|
|
2448
|
+
className,
|
|
2449
|
+
open,
|
|
2450
|
+
defaultOpen = false,
|
|
2451
|
+
onOpenChange,
|
|
2452
|
+
delayDuration
|
|
2453
|
+
}) {
|
|
2454
|
+
const providerDelay = (0, import_react10.useContext)(TooltipDelayContext);
|
|
2455
|
+
const generatedId = (0, import_react10.useId)().replace(/:/g, "");
|
|
2456
|
+
const triggerRef = (0, import_react10.useRef)(null);
|
|
2457
|
+
const timerRef = (0, import_react10.useRef)(null);
|
|
2458
|
+
const [internalOpen, setInternalOpen] = (0, import_react10.useState)(defaultOpen);
|
|
2459
|
+
const [position, setPosition] = (0, import_react10.useState)(null);
|
|
2460
|
+
const isOpen = open != null ? open : internalOpen;
|
|
2461
|
+
const triggerId = children.props.id;
|
|
2462
|
+
const tooltipId = triggerId ? `${triggerId}-tooltip` : `ph-tooltip-${generatedId}`;
|
|
2463
|
+
function setOpen(next) {
|
|
2464
|
+
if (open === void 0) setInternalOpen(next);
|
|
2465
|
+
onOpenChange == null ? void 0 : onOpenChange(next);
|
|
2466
|
+
}
|
|
2467
|
+
function clearTimer() {
|
|
2468
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
2469
|
+
timerRef.current = null;
|
|
2470
|
+
}
|
|
2471
|
+
function updatePosition() {
|
|
2472
|
+
if (!triggerRef.current) return;
|
|
2473
|
+
setPosition(
|
|
2474
|
+
tooltipPosition(
|
|
2475
|
+
triggerRef.current.getBoundingClientRect(),
|
|
2476
|
+
side,
|
|
2477
|
+
align,
|
|
2478
|
+
sideOffset
|
|
2479
|
+
)
|
|
2480
|
+
);
|
|
2481
|
+
}
|
|
2482
|
+
function show(immediate) {
|
|
2483
|
+
clearTimer();
|
|
2484
|
+
updatePosition();
|
|
2485
|
+
const delay = immediate ? 0 : delayDuration != null ? delayDuration : providerDelay;
|
|
2486
|
+
if (!delay) setOpen(true);
|
|
2487
|
+
else timerRef.current = setTimeout(() => setOpen(true), delay);
|
|
2488
|
+
}
|
|
2489
|
+
function hide() {
|
|
2490
|
+
clearTimer();
|
|
2491
|
+
setOpen(false);
|
|
2492
|
+
}
|
|
2493
|
+
(0, import_react10.useEffect)(() => {
|
|
2494
|
+
if (!isOpen) return;
|
|
2495
|
+
const reposition = () => updatePosition();
|
|
2496
|
+
window.addEventListener("resize", reposition);
|
|
2497
|
+
window.addEventListener("scroll", reposition, true);
|
|
2498
|
+
return () => {
|
|
2499
|
+
window.removeEventListener("resize", reposition);
|
|
2500
|
+
window.removeEventListener("scroll", reposition, true);
|
|
2501
|
+
};
|
|
2502
|
+
});
|
|
2503
|
+
(0, import_react10.useEffect)(() => () => clearTimer(), []);
|
|
2504
|
+
const describedBy = [children.props["aria-describedby"], tooltipId].filter(Boolean).join(" ");
|
|
2505
|
+
const trigger = (0, import_react10.cloneElement)(children, { "aria-describedby": describedBy });
|
|
2506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
2507
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2508
|
+
"span",
|
|
2509
|
+
{
|
|
2510
|
+
ref: triggerRef,
|
|
2511
|
+
className: "inline-flex",
|
|
2512
|
+
onMouseEnter: () => show(false),
|
|
2513
|
+
onMouseLeave: hide,
|
|
2514
|
+
onFocusCapture: () => show(true),
|
|
2515
|
+
onBlurCapture: hide,
|
|
2516
|
+
onKeyDown: (event) => {
|
|
2517
|
+
if (event.key === "Escape") hide();
|
|
2518
|
+
},
|
|
2519
|
+
children: trigger
|
|
2520
|
+
}
|
|
2521
|
+
),
|
|
2522
|
+
isOpen && position && typeof document !== "undefined" ? (0, import_react_dom.createPortal)(
|
|
2523
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2524
|
+
"span",
|
|
2525
|
+
{
|
|
2526
|
+
style: __spreadValues({ position: "fixed" }, position),
|
|
2527
|
+
className: "pointer-events-none z-[200]",
|
|
2528
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2529
|
+
"span",
|
|
2530
|
+
{
|
|
2531
|
+
id: tooltipId,
|
|
2532
|
+
role: "tooltip",
|
|
2533
|
+
"data-side": side,
|
|
2534
|
+
className: cn2("ph-tooltip-content", className),
|
|
2535
|
+
children: content
|
|
2536
|
+
}
|
|
2537
|
+
)
|
|
2538
|
+
}
|
|
2539
|
+
),
|
|
2540
|
+
document.body
|
|
2541
|
+
) : null
|
|
2542
|
+
] });
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
// src/suite/components/suite-sidebar.tsx
|
|
2546
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2311
2547
|
function renderNode(node, collapsed) {
|
|
2312
2548
|
if (typeof node === "function") return node(collapsed);
|
|
2313
2549
|
return node;
|
|
@@ -2324,7 +2560,7 @@ function SuiteSidebar({
|
|
|
2324
2560
|
className,
|
|
2325
2561
|
surface = false
|
|
2326
2562
|
}) {
|
|
2327
|
-
return /* @__PURE__ */ (0,
|
|
2563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2328
2564
|
"div",
|
|
2329
2565
|
{
|
|
2330
2566
|
className: cn(
|
|
@@ -2333,7 +2569,7 @@ function SuiteSidebar({
|
|
|
2333
2569
|
className
|
|
2334
2570
|
),
|
|
2335
2571
|
children: [
|
|
2336
|
-
/* @__PURE__ */ (0,
|
|
2572
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2337
2573
|
"div",
|
|
2338
2574
|
{
|
|
2339
2575
|
className: cn(
|
|
@@ -2342,36 +2578,35 @@ function SuiteSidebar({
|
|
|
2342
2578
|
collapsed ? "flex-col items-center gap-1 px-1 py-2" : "h-14 items-center justify-between gap-2 px-3"
|
|
2343
2579
|
),
|
|
2344
2580
|
children: [
|
|
2345
|
-
/* @__PURE__ */ (0,
|
|
2346
|
-
collapsed ? null : /* @__PURE__ */ (0,
|
|
2581
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("min-w-0", collapsed ? "shrink-0" : "flex-1"), children: renderNode(appSwitcher, collapsed) }),
|
|
2582
|
+
collapsed ? null : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "shrink-0", children: renderNode(notificationBell, collapsed) })
|
|
2347
2583
|
]
|
|
2348
2584
|
}
|
|
2349
2585
|
),
|
|
2350
|
-
/* @__PURE__ */ (0,
|
|
2586
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2351
2587
|
"div",
|
|
2352
2588
|
{
|
|
2353
2589
|
className: cn(
|
|
2354
|
-
"flex min-h-0 flex-1 flex-col",
|
|
2590
|
+
"flex min-h-0 flex-1 flex-col overflow-y-auto",
|
|
2355
2591
|
surface ? "bg-ph-surface" : "bg-ph-canvas",
|
|
2356
2592
|
collapsed ? "px-1.5 py-2" : "p-2"
|
|
2357
2593
|
),
|
|
2358
2594
|
children: [
|
|
2359
|
-
/* @__PURE__ */ (0,
|
|
2595
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2360
2596
|
"nav",
|
|
2361
2597
|
{
|
|
2362
2598
|
"aria-label": "Pages",
|
|
2363
2599
|
className: "shrink-0 space-y-0.5",
|
|
2364
2600
|
children: [
|
|
2365
|
-
/* @__PURE__ */ (0,
|
|
2366
|
-
/* @__PURE__ */ (0,
|
|
2601
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("mb-3", collapsed && "flex justify-center"), children: renderNode(contextSwitcher, collapsed) }),
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "space-y-0.5", children: navItems.map((item) => {
|
|
2367
2603
|
const Icon = item.icon;
|
|
2368
2604
|
const active = Boolean(item.active);
|
|
2369
|
-
|
|
2370
|
-
|
|
2605
|
+
const link = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2606
|
+
import_link2.default,
|
|
2371
2607
|
{
|
|
2372
2608
|
href: item.href,
|
|
2373
2609
|
"data-test": "nav-link",
|
|
2374
|
-
title: collapsed ? item.label : void 0,
|
|
2375
2610
|
"aria-current": active ? "page" : void 0,
|
|
2376
2611
|
onClick: item.onClick,
|
|
2377
2612
|
className: cn(
|
|
@@ -2380,7 +2615,7 @@ function SuiteSidebar({
|
|
|
2380
2615
|
collapsed ? "mx-auto size-10 shrink-0 justify-center gap-0 px-0 py-0" : "w-full px-2.5 py-2"
|
|
2381
2616
|
),
|
|
2382
2617
|
children: [
|
|
2383
|
-
/* @__PURE__ */ (0,
|
|
2618
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2384
2619
|
"span",
|
|
2385
2620
|
{
|
|
2386
2621
|
className: cn(
|
|
@@ -2388,7 +2623,7 @@ function SuiteSidebar({
|
|
|
2388
2623
|
item.iconClassName
|
|
2389
2624
|
),
|
|
2390
2625
|
"aria-hidden": true,
|
|
2391
|
-
children: /* @__PURE__ */ (0,
|
|
2626
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2392
2627
|
Icon,
|
|
2393
2628
|
{
|
|
2394
2629
|
className: "h-full w-full",
|
|
@@ -2397,7 +2632,7 @@ function SuiteSidebar({
|
|
|
2397
2632
|
)
|
|
2398
2633
|
}
|
|
2399
2634
|
),
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2635
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2401
2636
|
"span",
|
|
2402
2637
|
{
|
|
2403
2638
|
className: cn(
|
|
@@ -2408,19 +2643,20 @@ function SuiteSidebar({
|
|
|
2408
2643
|
children: item.label
|
|
2409
2644
|
}
|
|
2410
2645
|
),
|
|
2411
|
-
!collapsed && item.badge ? /* @__PURE__ */ (0,
|
|
2646
|
+
!collapsed && item.badge ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "relative ml-auto shrink-0", children: item.badge }) : null
|
|
2412
2647
|
]
|
|
2413
2648
|
},
|
|
2414
2649
|
item.label
|
|
2415
2650
|
);
|
|
2651
|
+
return collapsed ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tooltip, { content: item.label, side: "right", children: link }, item.label) : link;
|
|
2416
2652
|
}) })
|
|
2417
2653
|
]
|
|
2418
2654
|
}
|
|
2419
2655
|
),
|
|
2420
|
-
secondaryNav ? /* @__PURE__ */ (0,
|
|
2656
|
+
secondaryNav ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2421
2657
|
"div",
|
|
2422
2658
|
{
|
|
2423
|
-
className: "min-h-0 flex-1
|
|
2659
|
+
className: "min-h-0 flex-1",
|
|
2424
2660
|
"data-test": "suite-sidebar-secondary-nav",
|
|
2425
2661
|
children: secondaryNav
|
|
2426
2662
|
}
|
|
@@ -2428,7 +2664,7 @@ function SuiteSidebar({
|
|
|
2428
2664
|
]
|
|
2429
2665
|
}
|
|
2430
2666
|
),
|
|
2431
|
-
/* @__PURE__ */ (0,
|
|
2667
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2432
2668
|
"div",
|
|
2433
2669
|
{
|
|
2434
2670
|
className: cn(
|
|
@@ -2436,7 +2672,7 @@ function SuiteSidebar({
|
|
|
2436
2672
|
surface ? "bg-ph-surface" : "bg-ph-canvas",
|
|
2437
2673
|
collapsed ? "p-1.5" : "p-3"
|
|
2438
2674
|
),
|
|
2439
|
-
children: /* @__PURE__ */ (0,
|
|
2675
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2440
2676
|
"div",
|
|
2441
2677
|
{
|
|
2442
2678
|
className: cn(
|
|
@@ -2445,7 +2681,7 @@ function SuiteSidebar({
|
|
|
2445
2681
|
),
|
|
2446
2682
|
children: [
|
|
2447
2683
|
renderNode(userMenu, collapsed),
|
|
2448
|
-
!collapsed && footerExtras ? /* @__PURE__ */ (0,
|
|
2684
|
+
!collapsed && footerExtras ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "ml-auto shrink-0", children: renderNode(footerExtras, collapsed) }) : null
|
|
2449
2685
|
]
|
|
2450
2686
|
}
|
|
2451
2687
|
)
|
|
@@ -2457,7 +2693,7 @@ function SuiteSidebar({
|
|
|
2457
2693
|
}
|
|
2458
2694
|
|
|
2459
2695
|
// src/suite/components/suite-app-layout.tsx
|
|
2460
|
-
var
|
|
2696
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2461
2697
|
function SuiteAppLayout({
|
|
2462
2698
|
sidebar,
|
|
2463
2699
|
children,
|
|
@@ -2469,16 +2705,16 @@ function SuiteAppLayout({
|
|
|
2469
2705
|
onResetWidth,
|
|
2470
2706
|
className
|
|
2471
2707
|
}) {
|
|
2472
|
-
return /* @__PURE__ */ (0,
|
|
2473
|
-
/* @__PURE__ */ (0,
|
|
2474
|
-
/* @__PURE__ */ (0,
|
|
2708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { "data-test": "app-shell", className: cn("min-h-screen", className), children: [
|
|
2709
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "hidden lg:flex h-screen overflow-hidden", children: [
|
|
2710
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2475
2711
|
"aside",
|
|
2476
2712
|
{
|
|
2477
2713
|
className: "relative flex shrink-0 flex-col border-r border-ph-border transition-[width] duration-200 ease-out",
|
|
2478
2714
|
style: { width: `${sidebarWidth}px` },
|
|
2479
2715
|
children: [
|
|
2480
2716
|
sidebar,
|
|
2481
|
-
onStartResize ? /* @__PURE__ */ (0,
|
|
2717
|
+
onStartResize ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2482
2718
|
"div",
|
|
2483
2719
|
{
|
|
2484
2720
|
role: "separator",
|
|
@@ -2492,12 +2728,12 @@ function SuiteAppLayout({
|
|
|
2492
2728
|
]
|
|
2493
2729
|
}
|
|
2494
2730
|
),
|
|
2495
|
-
/* @__PURE__ */ (0,
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("main", { className: "min-w-0 flex-1 overflow-y-auto bg-ph-canvas", children })
|
|
2496
2732
|
] }),
|
|
2497
|
-
/* @__PURE__ */ (0,
|
|
2498
|
-
mobileHeader ? /* @__PURE__ */ (0,
|
|
2499
|
-
/* @__PURE__ */ (0,
|
|
2500
|
-
bottomNav ? /* @__PURE__ */ (0,
|
|
2733
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex min-h-screen flex-col lg:hidden", children: [
|
|
2734
|
+
mobileHeader ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "shrink-0", children: mobileHeader }) : null,
|
|
2735
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("main", { className: "min-w-0 flex-1 overflow-y-auto bg-ph-canvas", children }),
|
|
2736
|
+
bottomNav ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "shrink-0", children: bottomNav }) : null
|
|
2501
2737
|
] })
|
|
2502
2738
|
] });
|
|
2503
2739
|
}
|