@xenide-io/the-old-ui-theme 0.9.17 → 0.10.0
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/{Chip-BzuNgJIa.d.mts → Chip-DKT-82Lf.d.mts} +5 -3
- package/dist/{Chip-BzuNgJIa.d.ts → Chip-DKT-82Lf.d.ts} +5 -3
- package/dist/{chunk-6SVJAU5K.mjs → chunk-LHE4ROON.mjs} +977 -521
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +138 -99
- package/dist/index.mjs +1 -1
- package/dist/suite.d.mts +23 -1
- package/dist/suite.d.ts +23 -1
- package/dist/suite.js +4250 -4041
- package/dist/suite.mjs +1008 -795
- package/dist/tailwind-preset.js +10 -1
- package/dist/tailwind-preset.mjs +10 -1
- package/dist/ui.d.mts +33 -4
- package/dist/ui.d.ts +33 -4
- package/dist/ui.js +1024 -566
- package/dist/ui.mjs +13 -1
- package/docs/macos-identity-audit.md +279 -0
- package/package.json +1 -1
- package/src/app/globals.css +334 -44
- package/src/components/ui/Accordion.tsx +4 -7
- package/src/components/ui/Avatar.tsx +5 -5
- package/src/components/ui/Calendar.tsx +7 -7
- package/src/components/ui/CodeBlock.tsx +3 -10
- package/src/components/ui/CollapsibleSection.tsx +4 -4
- package/src/components/ui/CommandPalette.tsx +7 -10
- package/src/components/ui/EmptyState.tsx +2 -2
- package/src/components/ui/Input.tsx +1 -1
- package/src/components/ui/Marketing.tsx +128 -0
- package/src/components/ui/MarketingIllustrations.tsx +287 -0
- package/src/components/ui/Panel.tsx +1 -1
- package/src/components/ui/SegmentedControl.tsx +59 -13
- package/src/components/ui/ShowcaseWrapper.tsx +3 -3
- package/src/components/ui/Table.tsx +18 -6
- package/src/components/ui/Typography.tsx +4 -4
- package/src/components/ui/avatar-stat.test.tsx +14 -1
- package/src/components/ui/index.ts +13 -12
- package/src/components/ui/interaction-primitives.test.tsx +12 -6
- package/src/components/ui/marketing.test.tsx +39 -0
- package/src/components/ui/table.test.tsx +20 -0
- package/src/styles/suite-skin.css +405 -40
- package/src/styles/themes.css +45 -45
- package/src/styles/typography.css +25 -1
- package/src/suite/components/ai-panel.tsx +17 -17
- package/src/suite/components/app-switcher.tsx +9 -9
- package/src/suite/components/suite-app-layout.tsx +7 -4
- package/src/suite/components/suite-bottom-nav.tsx +1 -1
- package/src/suite/components/suite-clients-projects-directory.tsx +6 -6
- package/src/suite/components/suite-entity-icon.tsx +3 -3
- package/src/suite/components/suite-integration-picker.tsx +7 -7
- package/src/suite/components/suite-integration-rules.tsx +5 -5
- package/src/suite/components/suite-layout.test.tsx +32 -3
- package/src/suite/components/suite-layout.tsx +4 -4
- package/src/suite/components/suite-mobile-drawer.tsx +2 -2
- package/src/suite/components/suite-mobile-header.tsx +1 -1
- package/src/suite/components/suite-notification-bell.tsx +4 -4
- package/src/suite/components/suite-notification-settings.tsx +171 -0
- package/src/suite/components/suite-palette-library.test.tsx +46 -0
- package/src/suite/components/suite-palette-library.tsx +82 -15
- package/src/suite/components/suite-settings-layout.tsx +2 -2
- package/src/suite/components/suite-settings-mobile-nav.tsx +5 -9
- package/src/suite/components/suite-sidebar.test.tsx +39 -0
- package/src/suite/components/suite-sidebar.tsx +41 -19
- package/src/suite/components/suite-skeleton.tsx +6 -6
- package/src/suite/components/suite-user-menu.tsx +2 -2
- package/src/suite/components/today-calibrating.tsx +3 -3
- package/src/suite/components/today-ui.tsx +12 -12
- package/src/suite/components/workspace-switcher.tsx +3 -3
- package/src/suite/index.ts +6 -0
- package/tailwind-preset.ts +9 -0
package/dist/suite.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Toggle,
|
|
13
13
|
Tooltip,
|
|
14
14
|
cn
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LHE4ROON.mjs";
|
|
16
16
|
import {
|
|
17
17
|
SUITE_THEME_CHANNEL,
|
|
18
18
|
SUITE_THEME_COOKIE,
|
|
@@ -441,7 +441,7 @@ function SourceAppGlyph({
|
|
|
441
441
|
{
|
|
442
442
|
src: SOURCE_APP_LOGOS[app],
|
|
443
443
|
alt: "",
|
|
444
|
-
className: cn2("h-7 w-7 shrink-0 rounded-
|
|
444
|
+
className: cn2("h-7 w-7 shrink-0 rounded-[var(--ph-radius-control)] object-contain", className)
|
|
445
445
|
}
|
|
446
446
|
)
|
|
447
447
|
);
|
|
@@ -564,8 +564,8 @@ function TodayTopBar({
|
|
|
564
564
|
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
565
565
|
/* @__PURE__ */ jsx4("div", { className: "hidden shrink-0 sm:block", "aria-hidden": "true", children: icon }),
|
|
566
566
|
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
567
|
-
/* @__PURE__ */ jsx4("h1", { className: "
|
|
568
|
-
appName ? /* @__PURE__ */ jsx4("span", { className: "rounded-
|
|
567
|
+
/* @__PURE__ */ jsx4("h1", { className: "ph-page-title font-display font-semibold text-ph-ink", children: "Today" }),
|
|
568
|
+
appName ? /* @__PURE__ */ jsx4("span", { className: "rounded-[var(--ph-radius-control)] bg-ph-muted px-2 py-0.5 text-[length:var(--ph-type-overline)] font-semibold uppercase tracking-wide text-ph-subtle", children: appName }) : null,
|
|
569
569
|
/* @__PURE__ */ jsx4("span", { className: "text-sm text-ph-subtle", children: formatLongDate() })
|
|
570
570
|
] })
|
|
571
571
|
] }),
|
|
@@ -575,7 +575,7 @@ function TodayTopBar({
|
|
|
575
575
|
type: "button",
|
|
576
576
|
onClick: onRefresh,
|
|
577
577
|
disabled: refreshing || loading,
|
|
578
|
-
className: "
|
|
578
|
+
className: "ph-btn ph-btn-ghost ph-btn-square press-subtle h-10 w-10 text-ph-subtle",
|
|
579
579
|
"data-test": "today-refresh",
|
|
580
580
|
"aria-label": "Refresh today",
|
|
581
581
|
children: /* @__PURE__ */ jsx4(
|
|
@@ -649,14 +649,14 @@ function TodayPrimaryAction({
|
|
|
649
649
|
dataTest = "today-primary-action"
|
|
650
650
|
}) {
|
|
651
651
|
const classes = cn2(
|
|
652
|
-
"today-primary-action group relative flex w-full max-w-md items-center gap-3 overflow-hidden rounded-
|
|
652
|
+
"today-primary-action group relative flex w-full max-w-md items-center gap-3 overflow-hidden rounded-[var(--ph-radius-surface)] px-3.5 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)] sm:px-4 sm:py-3",
|
|
653
653
|
`today-primary-action--${accent}`,
|
|
654
654
|
active && "today-primary-action--active",
|
|
655
655
|
loading && "pointer-events-none opacity-70",
|
|
656
656
|
className
|
|
657
657
|
);
|
|
658
658
|
const body = /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
659
|
-
/* @__PURE__ */ jsx4("span", { className: "today-primary-action__icon inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-
|
|
659
|
+
/* @__PURE__ */ jsx4("span", { className: "today-primary-action__icon inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[var(--ph-radius-control)] sm:h-10 sm:w-10", children: icon }),
|
|
660
660
|
/* @__PURE__ */ jsxs4("span", { className: "min-w-0 flex-1", children: [
|
|
661
661
|
/* @__PURE__ */ jsx4("span", { className: "block text-sm font-semibold tracking-tight sm:text-base", children: label }),
|
|
662
662
|
description ? /* @__PURE__ */ jsx4("span", { className: "mt-0.5 block text-xs opacity-80 sm:text-sm", children: description }) : null
|
|
@@ -664,7 +664,7 @@ function TodayPrimaryAction({
|
|
|
664
664
|
/* @__PURE__ */ jsx4(
|
|
665
665
|
"span",
|
|
666
666
|
{
|
|
667
|
-
className: "today-primary-action__chevron shrink-0 text-base opacity-60 transition group-hover:translate-x-0.5 group-hover:opacity-100",
|
|
667
|
+
className: "today-primary-action__chevron shrink-0 text-base opacity-60 transition-[transform,opacity] group-hover:translate-x-0.5 group-hover:opacity-100",
|
|
668
668
|
"aria-hidden": true,
|
|
669
669
|
children: "\u2192"
|
|
670
670
|
}
|
|
@@ -706,7 +706,7 @@ function TodayEmptyAction({
|
|
|
706
706
|
return /* @__PURE__ */ jsxs4(
|
|
707
707
|
"div",
|
|
708
708
|
{
|
|
709
|
-
className: "rounded-
|
|
709
|
+
className: "rounded-[var(--ph-radius-surface)] border border-dashed border-ph-border/80 bg-[var(--ph-surface-inset)] px-4 py-4 text-center",
|
|
710
710
|
"data-test": dataTest,
|
|
711
711
|
children: [
|
|
712
712
|
/* @__PURE__ */ jsx4("p", { className: "text-sm font-semibold text-ph-ink", children: title }),
|
|
@@ -761,7 +761,7 @@ function TodayAskAiCard({
|
|
|
761
761
|
href
|
|
762
762
|
}) {
|
|
763
763
|
const classes = cn2(
|
|
764
|
-
"group flex w-full items-start gap-3.5 rounded-
|
|
764
|
+
"suite-press group flex w-full items-start gap-3.5 rounded-[var(--ph-radius-surface)] border border-ph-border/70 bg-ph-surface px-4 py-3.5 text-left transition-[background-color,border-color,box-shadow] hover:border-ph-brand/35 hover:bg-[var(--ph-surface-hover)] hover:shadow-[var(--ph-shadow-raised)] focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)] sm:px-5",
|
|
765
765
|
className
|
|
766
766
|
);
|
|
767
767
|
const body = /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
@@ -815,7 +815,7 @@ function TodaySection({
|
|
|
815
815
|
"span",
|
|
816
816
|
{
|
|
817
817
|
className: cn2(
|
|
818
|
-
"inline-flex h-10 w-10 sm:h-11 sm:w-11 shrink-0 items-center justify-center rounded-
|
|
818
|
+
"inline-flex h-10 w-10 sm:h-11 sm:w-11 shrink-0 items-center justify-center rounded-[var(--ph-radius-surface)] border border-ph-border/70 shadow-[var(--ph-shadow-control)]",
|
|
819
819
|
iconClassName != null ? iconClassName : "bg-ph-muted text-ph-ink"
|
|
820
820
|
),
|
|
821
821
|
children: /* @__PURE__ */ jsx4(Icon, { className: "h-5 w-5", "aria-hidden": true })
|
|
@@ -839,7 +839,7 @@ function TodayPanel({
|
|
|
839
839
|
"div",
|
|
840
840
|
{
|
|
841
841
|
className: cn2(
|
|
842
|
-
"border-ph-border/70
|
|
842
|
+
"rounded-[var(--ph-radius-surface)] border border-ph-border/70 bg-ph-surface p-5 sm:p-5",
|
|
843
843
|
className
|
|
844
844
|
),
|
|
845
845
|
children
|
|
@@ -850,7 +850,7 @@ function TodayEmptyState({
|
|
|
850
850
|
title,
|
|
851
851
|
description
|
|
852
852
|
}) {
|
|
853
|
-
return /* @__PURE__ */ jsxs4("div", { className: "
|
|
853
|
+
return /* @__PURE__ */ jsxs4("div", { className: "rounded-[var(--ph-radius-surface)] border border-dashed border-ph-border/80 bg-[var(--ph-surface-inset)] px-5 py-8 text-center", children: [
|
|
854
854
|
/* @__PURE__ */ jsx4("p", { className: "text-sm font-semibold text-ph-ink", children: title }),
|
|
855
855
|
description ? /* @__PURE__ */ jsx4("p", { className: "mt-1.5 text-sm leading-relaxed text-ph-subtle", children: description }) : null
|
|
856
856
|
] });
|
|
@@ -863,16 +863,16 @@ import { NavArrowDown as ChevronDown, OpenNewWindow } from "iconoir-react";
|
|
|
863
863
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
864
864
|
function appSwitcherTriggerClass(open, collapsed = false) {
|
|
865
865
|
return cn2(
|
|
866
|
-
"group flex min-w-0 items-center gap-2 rounded-
|
|
866
|
+
"group flex min-w-0 items-center gap-2 rounded-[var(--ph-radius-control)] border px-2 py-1.5 text-left transition-[color,background-color,border-color,box-shadow] duration-150",
|
|
867
867
|
collapsed ? "h-11 w-11 justify-center px-0 py-0" : "w-full",
|
|
868
|
-
open ? "border-ph-
|
|
868
|
+
open ? "border-[var(--ph-selected-border)] bg-[var(--ph-selected-bg)] shadow-[var(--ph-shadow-control)]" : "border-transparent hover:border-ph-border hover:bg-[var(--ph-surface-hover)]"
|
|
869
869
|
);
|
|
870
870
|
}
|
|
871
871
|
function appSwitcherMarkClass() {
|
|
872
|
-
return "h-8 w-8 shrink-0 rounded-
|
|
872
|
+
return "h-8 w-8 shrink-0 rounded-[var(--ph-radius-control)]";
|
|
873
873
|
}
|
|
874
874
|
function appSwitcherMenuItemClass() {
|
|
875
|
-
return "
|
|
875
|
+
return "px-2 py-2";
|
|
876
876
|
}
|
|
877
877
|
function AppSwitcherMark({
|
|
878
878
|
children,
|
|
@@ -898,7 +898,7 @@ function AppSwitcherChevron({
|
|
|
898
898
|
"span",
|
|
899
899
|
{
|
|
900
900
|
className: cn2(
|
|
901
|
-
"absolute bottom-0 right-0 flex h-3 w-3 items-center justify-center rounded-full border border-ph-border bg-ph-surface
|
|
901
|
+
"absolute bottom-0 right-0 flex h-3 w-3 items-center justify-center rounded-full border border-ph-border bg-ph-surface transition-colors",
|
|
902
902
|
open && "border-ph-brand/40 bg-ph-brand/10"
|
|
903
903
|
),
|
|
904
904
|
"aria-hidden": true,
|
|
@@ -918,7 +918,7 @@ function AppSwitcherChevron({
|
|
|
918
918
|
"span",
|
|
919
919
|
{
|
|
920
920
|
className: cn2(
|
|
921
|
-
"border-ph-border/80 flex h-5 w-5 shrink-0 items-center justify-center rounded-
|
|
921
|
+
"border-ph-border/80 flex h-5 w-5 shrink-0 items-center justify-center rounded-[var(--ph-radius-control)] border bg-ph-canvas transition-[color,background-color,border-color] duration-150",
|
|
922
922
|
open ? "border-ph-brand/35 bg-ph-brand/10 text-ph-brand" : "text-ph-mutedtext group-hover:border-ph-border group-hover:bg-ph-surface"
|
|
923
923
|
),
|
|
924
924
|
"aria-hidden": true,
|
|
@@ -974,7 +974,7 @@ function AppSwitcher({
|
|
|
974
974
|
}
|
|
975
975
|
),
|
|
976
976
|
children: /* @__PURE__ */ jsxs5("div", { id: "app-switcher-menu", className: "p-1", "data-test": "app-switcher-menu", children: [
|
|
977
|
-
/* @__PURE__ */ jsx5("p", { className: "px-3 py-2 text-[
|
|
977
|
+
/* @__PURE__ */ jsx5("p", { className: "px-3 py-2 text-[length:var(--ph-type-overline)] font-semibold uppercase tracking-[0.08em] text-ph-mutedtext", children: "Switch application" }),
|
|
978
978
|
apps.filter((app) => app.slug !== currentApp).map((app) => /* @__PURE__ */ jsxs5("div", { className: "relative", children: [
|
|
979
979
|
/* @__PURE__ */ jsx5(
|
|
980
980
|
DropdownItem2,
|
|
@@ -1016,7 +1016,7 @@ function AppSwitcher({
|
|
|
1016
1016
|
setOpen(false);
|
|
1017
1017
|
onSelect(app, { newTab: true });
|
|
1018
1018
|
},
|
|
1019
|
-
className: "absolute right-1.5 top-1/2 z-[1] flex h-8 -translate-y-1/2 justify-center
|
|
1019
|
+
className: "absolute right-1.5 top-1/2 z-[1] flex h-8 -translate-y-1/2 justify-center p-0 text-ph-mutedtext",
|
|
1020
1020
|
style: { width: "2rem" },
|
|
1021
1021
|
children: /* @__PURE__ */ jsx5(OpenNewWindow, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
1022
1022
|
}
|
|
@@ -1352,7 +1352,7 @@ function SuiteNotificationBell({
|
|
|
1352
1352
|
panelClassName: "w-80 overflow-hidden p-0",
|
|
1353
1353
|
open,
|
|
1354
1354
|
onOpenChange,
|
|
1355
|
-
trigger: /* @__PURE__ */ jsx7("span", { className: "relative inline-flex h-11 w-11 items-center justify-center overflow-visible rounded-full text-ph-mutedtext transition hover:bg-ph-muted hover:text-ph-ink", children: /* @__PURE__ */ jsxs6("span", { className: "relative inline-flex h-5 w-5", children: [
|
|
1355
|
+
trigger: /* @__PURE__ */ jsx7("span", { className: "relative inline-flex h-11 w-11 items-center justify-center overflow-visible rounded-full text-ph-mutedtext transition-colors hover:bg-ph-muted hover:text-ph-ink", children: /* @__PURE__ */ jsxs6("span", { className: "relative inline-flex h-5 w-5", children: [
|
|
1356
1356
|
/* @__PURE__ */ jsx7(Bell, { className: "h-5 w-5", strokeWidth: 1.75, "aria-hidden": true }),
|
|
1357
1357
|
unread > 0 ? /* @__PURE__ */ jsx7("span", { className: "pointer-events-none absolute -right-2 -top-2 z-[1] flex h-4 min-w-4 items-center justify-center rounded-full bg-ph-brand px-1 text-[9px] font-semibold leading-none text-[var(--ph-on-accent)] ring-2 ring-ph-surface", children: unread > 9 ? "9+" : unread }) : null
|
|
1358
1358
|
] }) }),
|
|
@@ -1366,7 +1366,7 @@ function SuiteNotificationBell({
|
|
|
1366
1366
|
id: `${dataTest}-mark-all`,
|
|
1367
1367
|
"data-test": `${dataTest}-mark-all`,
|
|
1368
1368
|
onClick: markAllRead,
|
|
1369
|
-
className: "
|
|
1369
|
+
className: "ph-btn ph-btn-link ph-btn-xs text-xs",
|
|
1370
1370
|
children: "Mark all read"
|
|
1371
1371
|
}
|
|
1372
1372
|
) : null
|
|
@@ -1380,7 +1380,7 @@ function SuiteNotificationBell({
|
|
|
1380
1380
|
setOpen(false);
|
|
1381
1381
|
select(n);
|
|
1382
1382
|
},
|
|
1383
|
-
className: "flex w-full flex-col gap-0.5 px-3 py-2 text-left
|
|
1383
|
+
className: "ph-dropdown-item flex w-full flex-col items-stretch gap-0.5 px-3 py-2 text-left",
|
|
1384
1384
|
children: [
|
|
1385
1385
|
/* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-2", children: [
|
|
1386
1386
|
!n.read_at ? /* @__PURE__ */ jsx7(
|
|
@@ -1393,7 +1393,7 @@ function SuiteNotificationBell({
|
|
|
1393
1393
|
/* @__PURE__ */ jsx7("span", { className: "truncate text-sm font-medium text-ph-ink", children: n.title })
|
|
1394
1394
|
] }),
|
|
1395
1395
|
n.body ? /* @__PURE__ */ jsx7("span", { className: "line-clamp-2 text-xs text-ph-mutedtext", children: n.body }) : null,
|
|
1396
|
-
/* @__PURE__ */ jsxs6("span", { className: "text-
|
|
1396
|
+
/* @__PURE__ */ jsxs6("span", { className: "text-xs text-ph-subtle", children: [
|
|
1397
1397
|
n.source_app,
|
|
1398
1398
|
" \xB7 ",
|
|
1399
1399
|
timeAgo(n.created_at)
|
|
@@ -1407,9 +1407,136 @@ function SuiteNotificationBell({
|
|
|
1407
1407
|
);
|
|
1408
1408
|
}
|
|
1409
1409
|
|
|
1410
|
+
// src/suite/components/suite-notification-settings.tsx
|
|
1411
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useState as useState4 } from "react";
|
|
1412
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1413
|
+
var STATUS_COPY = {
|
|
1414
|
+
unsupported: "This browser does not support browser notifications.",
|
|
1415
|
+
unconfigured: "Browser notifications are not configured on the server yet.",
|
|
1416
|
+
default: "Get notified on this device when a suite notification arrives.",
|
|
1417
|
+
granted: "Permission granted \u2014 turn on browser notifications for this device.",
|
|
1418
|
+
denied: "Notifications are blocked for this site. Allow them in your browser's site settings, then try again.",
|
|
1419
|
+
subscribed: "This device receives browser notifications."
|
|
1420
|
+
};
|
|
1421
|
+
function SuiteNotificationSettings({
|
|
1422
|
+
controller,
|
|
1423
|
+
title = "Notifications",
|
|
1424
|
+
description = "Get suite notifications \u2014 tasks, documents and AI runs \u2014 as OS notifications on this device, even when the app is closed.",
|
|
1425
|
+
dataTest = "suite-notification-settings",
|
|
1426
|
+
className
|
|
1427
|
+
}) {
|
|
1428
|
+
const [state, setState] = useState4(null);
|
|
1429
|
+
const [busy, setBusy] = useState4(false);
|
|
1430
|
+
const [error, setError] = useState4("");
|
|
1431
|
+
const refresh = useCallback2(async () => {
|
|
1432
|
+
setState(await controller.getState());
|
|
1433
|
+
}, [controller]);
|
|
1434
|
+
useEffect2(() => {
|
|
1435
|
+
let active = true;
|
|
1436
|
+
controller.getState().then((next) => {
|
|
1437
|
+
if (active) setState(next);
|
|
1438
|
+
});
|
|
1439
|
+
return () => {
|
|
1440
|
+
active = false;
|
|
1441
|
+
};
|
|
1442
|
+
}, [controller]);
|
|
1443
|
+
const handleEnable = async () => {
|
|
1444
|
+
setBusy(true);
|
|
1445
|
+
setError("");
|
|
1446
|
+
try {
|
|
1447
|
+
await controller.enable();
|
|
1448
|
+
await refresh();
|
|
1449
|
+
} catch (err) {
|
|
1450
|
+
setError(
|
|
1451
|
+
err instanceof Error ? err.message : "Could not enable notifications."
|
|
1452
|
+
);
|
|
1453
|
+
await refresh();
|
|
1454
|
+
} finally {
|
|
1455
|
+
setBusy(false);
|
|
1456
|
+
}
|
|
1457
|
+
};
|
|
1458
|
+
const handleDisable = async () => {
|
|
1459
|
+
setBusy(true);
|
|
1460
|
+
setError("");
|
|
1461
|
+
try {
|
|
1462
|
+
await controller.disable();
|
|
1463
|
+
await refresh();
|
|
1464
|
+
} catch (err) {
|
|
1465
|
+
setError(
|
|
1466
|
+
err instanceof Error ? err.message : "Could not disable notifications."
|
|
1467
|
+
);
|
|
1468
|
+
} finally {
|
|
1469
|
+
setBusy(false);
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
const subscribed = state === "subscribed";
|
|
1473
|
+
const canEnable = state === "default" || state === "granted";
|
|
1474
|
+
return /* @__PURE__ */ jsxs7("div", { className, children: [
|
|
1475
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
1476
|
+
/* @__PURE__ */ jsx8("h2", { className: "text-xl font-semibold text-ph-ink", children: title }),
|
|
1477
|
+
/* @__PURE__ */ jsx8("p", { className: "mt-1 text-sm text-ph-subtle", children: description })
|
|
1478
|
+
] }),
|
|
1479
|
+
error ? /* @__PURE__ */ jsx8(
|
|
1480
|
+
Alert,
|
|
1481
|
+
{
|
|
1482
|
+
id: `${dataTest}-error`,
|
|
1483
|
+
"data-test": `${dataTest}-error`,
|
|
1484
|
+
className: "mt-4",
|
|
1485
|
+
status: "danger",
|
|
1486
|
+
title: "Notifications unavailable",
|
|
1487
|
+
description: error,
|
|
1488
|
+
live: "assertive"
|
|
1489
|
+
}
|
|
1490
|
+
) : null,
|
|
1491
|
+
/* @__PURE__ */ jsxs7(
|
|
1492
|
+
Card,
|
|
1493
|
+
{
|
|
1494
|
+
id: `${dataTest}-card`,
|
|
1495
|
+
"data-test": `${dataTest}-card`,
|
|
1496
|
+
variant: "outlined",
|
|
1497
|
+
bodyClassName: "p-5",
|
|
1498
|
+
className: "mt-4",
|
|
1499
|
+
children: [
|
|
1500
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
1501
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
|
|
1502
|
+
/* @__PURE__ */ jsx8("p", { className: "text-sm font-medium text-ph-ink", children: "Browser notifications" }),
|
|
1503
|
+
subscribed ? /* @__PURE__ */ jsx8(Badge, { variant: "success", children: "On" }) : null
|
|
1504
|
+
] }),
|
|
1505
|
+
controller.supported() && canEnable ? /* @__PURE__ */ jsx8(
|
|
1506
|
+
Button,
|
|
1507
|
+
{
|
|
1508
|
+
id: `${dataTest}-enable`,
|
|
1509
|
+
"data-test": `${dataTest}-enable`,
|
|
1510
|
+
variant: "primary",
|
|
1511
|
+
size: "sm",
|
|
1512
|
+
disabled: busy,
|
|
1513
|
+
onClick: handleEnable,
|
|
1514
|
+
children: busy ? "Enabling\u2026" : "Enable on this device"
|
|
1515
|
+
}
|
|
1516
|
+
) : null,
|
|
1517
|
+
subscribed ? /* @__PURE__ */ jsx8(
|
|
1518
|
+
Button,
|
|
1519
|
+
{
|
|
1520
|
+
id: `${dataTest}-disable`,
|
|
1521
|
+
"data-test": `${dataTest}-disable`,
|
|
1522
|
+
variant: "secondary",
|
|
1523
|
+
size: "sm",
|
|
1524
|
+
disabled: busy,
|
|
1525
|
+
onClick: handleDisable,
|
|
1526
|
+
children: busy ? "Disabling\u2026" : "Disable"
|
|
1527
|
+
}
|
|
1528
|
+
) : null
|
|
1529
|
+
] }),
|
|
1530
|
+
/* @__PURE__ */ jsx8("p", { className: "mt-3 text-sm text-ph-subtle", children: state === null ? "Checking this device\u2026" : STATUS_COPY[state] })
|
|
1531
|
+
]
|
|
1532
|
+
}
|
|
1533
|
+
)
|
|
1534
|
+
] });
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1410
1537
|
// src/suite/components/command-palette-host.tsx
|
|
1411
|
-
import { useEffect as
|
|
1412
|
-
import { jsx as
|
|
1538
|
+
import { useEffect as useEffect3, useState as useState5 } from "react";
|
|
1539
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1413
1540
|
function isEditableTarget() {
|
|
1414
1541
|
if (typeof document === "undefined") return false;
|
|
1415
1542
|
const el = document.activeElement;
|
|
@@ -1429,8 +1556,8 @@ function CommandPaletteHost({
|
|
|
1429
1556
|
inputDataTest,
|
|
1430
1557
|
commandPalette: CommandPalette
|
|
1431
1558
|
}) {
|
|
1432
|
-
const [open, setOpen] =
|
|
1433
|
-
|
|
1559
|
+
const [open, setOpen] = useState5(false);
|
|
1560
|
+
useEffect3(() => {
|
|
1434
1561
|
const onKey = (e) => {
|
|
1435
1562
|
if (!((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k")) return;
|
|
1436
1563
|
if (!open && isEditableTarget()) return;
|
|
@@ -1441,7 +1568,7 @@ function CommandPaletteHost({
|
|
|
1441
1568
|
return () => window.removeEventListener("keydown", onKey);
|
|
1442
1569
|
}, [open]);
|
|
1443
1570
|
if (!isAuthenticated) return null;
|
|
1444
|
-
return /* @__PURE__ */
|
|
1571
|
+
return /* @__PURE__ */ jsx9(
|
|
1445
1572
|
CommandPalette,
|
|
1446
1573
|
{
|
|
1447
1574
|
items,
|
|
@@ -1457,10 +1584,10 @@ function CommandPaletteHost({
|
|
|
1457
1584
|
}
|
|
1458
1585
|
|
|
1459
1586
|
// src/suite/lib/use-idle-mount.ts
|
|
1460
|
-
import { useEffect as
|
|
1587
|
+
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
1461
1588
|
function useIdleMount(timeoutMs = 1200) {
|
|
1462
|
-
const [ready, setReady] =
|
|
1463
|
-
|
|
1589
|
+
const [ready, setReady] = useState6(false);
|
|
1590
|
+
useEffect4(() => {
|
|
1464
1591
|
let timeoutId = 0;
|
|
1465
1592
|
let idleId = 0;
|
|
1466
1593
|
const activate = () => setReady(true);
|
|
@@ -1475,18 +1602,18 @@ function useIdleMount(timeoutMs = 1200) {
|
|
|
1475
1602
|
}
|
|
1476
1603
|
|
|
1477
1604
|
// src/suite/components/deferred-chrome.tsx
|
|
1478
|
-
import { Fragment as Fragment3, jsx as
|
|
1605
|
+
import { Fragment as Fragment3, jsx as jsx10 } from "react/jsx-runtime";
|
|
1479
1606
|
function DeferredChrome({ children }) {
|
|
1480
1607
|
const ready = useIdleMount();
|
|
1481
1608
|
if (!ready) return null;
|
|
1482
|
-
return /* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ jsx10(Fragment3, { children });
|
|
1483
1610
|
}
|
|
1484
1611
|
|
|
1485
1612
|
// src/suite/components/suite-mobile-drawer.tsx
|
|
1486
1613
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
1487
|
-
import { useEffect as
|
|
1614
|
+
import { useEffect as useEffect5, useState as useState7 } from "react";
|
|
1488
1615
|
import { Xmark as X } from "iconoir-react";
|
|
1489
|
-
import { jsx as
|
|
1616
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1490
1617
|
function SuiteMobileDrawer({
|
|
1491
1618
|
open,
|
|
1492
1619
|
onClose,
|
|
@@ -1506,9 +1633,9 @@ function SuiteMobileDrawer({
|
|
|
1506
1633
|
closeButtonDataTest,
|
|
1507
1634
|
panelClassName
|
|
1508
1635
|
}) {
|
|
1509
|
-
const [rendered, setRendered] =
|
|
1510
|
-
const [shown, setShown] =
|
|
1511
|
-
|
|
1636
|
+
const [rendered, setRendered] = useState7(open);
|
|
1637
|
+
const [shown, setShown] = useState7(open);
|
|
1638
|
+
useEffect5(() => {
|
|
1512
1639
|
if (open) {
|
|
1513
1640
|
queueMicrotask(() => setRendered(true));
|
|
1514
1641
|
let inner = 0;
|
|
@@ -1525,8 +1652,8 @@ function SuiteMobileDrawer({
|
|
|
1525
1652
|
return () => window.clearTimeout(timeout);
|
|
1526
1653
|
}, [open, durationMs]);
|
|
1527
1654
|
if (!rendered) return null;
|
|
1528
|
-
return /* @__PURE__ */
|
|
1529
|
-
/* @__PURE__ */
|
|
1655
|
+
return /* @__PURE__ */ jsx11(Dialog.Root, { open, onOpenChange: (nextOpen) => !nextOpen && onClose(), children: /* @__PURE__ */ jsxs8(Dialog.Portal, { forceMount: true, children: [
|
|
1656
|
+
/* @__PURE__ */ jsx11(
|
|
1530
1657
|
Dialog.Overlay,
|
|
1531
1658
|
{
|
|
1532
1659
|
forceMount: true,
|
|
@@ -1540,22 +1667,22 @@ function SuiteMobileDrawer({
|
|
|
1540
1667
|
style: { transitionDuration: `${durationMs}ms` }
|
|
1541
1668
|
}
|
|
1542
1669
|
),
|
|
1543
|
-
/* @__PURE__ */
|
|
1670
|
+
/* @__PURE__ */ jsx11(Dialog.Content, { forceMount: true, asChild: true, children: /* @__PURE__ */ jsxs8(
|
|
1544
1671
|
"aside",
|
|
1545
1672
|
{
|
|
1546
1673
|
role: "dialog",
|
|
1547
1674
|
"data-test": panelDataTest,
|
|
1548
1675
|
"aria-modal": "true",
|
|
1549
1676
|
className: cn2(
|
|
1550
|
-
"fixed inset-y-0 left-0 z-50 flex h-dvh max-h-dvh w-[86%] max-w-72 flex-col overflow-hidden bg-ph-surface shadow-
|
|
1677
|
+
"fixed inset-y-0 left-0 z-50 flex h-dvh max-h-dvh w-[86%] max-w-72 flex-col overflow-hidden border-r border-ph-border bg-ph-surface shadow-[var(--ph-shadow-floating)] outline-none motion-safe:transition-transform motion-safe:ease-spring-fast lg:hidden",
|
|
1551
1678
|
side === "right" && "left-auto right-0",
|
|
1552
1679
|
shown ? "translate-x-0" : side === "right" ? "translate-x-full" : "-translate-x-full",
|
|
1553
1680
|
panelClassName
|
|
1554
1681
|
),
|
|
1555
1682
|
style: { transitionDuration: `${durationMs}ms` },
|
|
1556
1683
|
children: [
|
|
1557
|
-
/* @__PURE__ */
|
|
1558
|
-
showCloseButton ? /* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ jsx11(Dialog.Title, { className: "sr-only", children: dialogLabel }),
|
|
1685
|
+
showCloseButton ? /* @__PURE__ */ jsxs8(
|
|
1559
1686
|
"div",
|
|
1560
1687
|
{
|
|
1561
1688
|
className: cn2(
|
|
@@ -1563,22 +1690,22 @@ function SuiteMobileDrawer({
|
|
|
1563
1690
|
title ? "justify-between" : "justify-end"
|
|
1564
1691
|
),
|
|
1565
1692
|
children: [
|
|
1566
|
-
title ? /* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1693
|
+
title ? /* @__PURE__ */ jsx11("span", { className: "truncate text-sm font-semibold text-ph-ink", children: title }) : null,
|
|
1694
|
+
/* @__PURE__ */ jsx11(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx11(
|
|
1568
1695
|
"button",
|
|
1569
1696
|
{
|
|
1570
1697
|
type: "button",
|
|
1571
1698
|
id: closeButtonId,
|
|
1572
1699
|
"data-test": closeButtonDataTest,
|
|
1573
|
-
className: "-mr-1.5
|
|
1700
|
+
className: "ph-btn ph-btn-ghost ph-btn-square -mr-1.5 h-11 w-11 text-ph-mutedtext",
|
|
1574
1701
|
"aria-label": closeLabel,
|
|
1575
|
-
children: /* @__PURE__ */
|
|
1702
|
+
children: /* @__PURE__ */ jsx11(X, { className: "h-4 w-4", "aria-hidden": true })
|
|
1576
1703
|
}
|
|
1577
1704
|
) })
|
|
1578
1705
|
]
|
|
1579
1706
|
}
|
|
1580
1707
|
) : null,
|
|
1581
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ jsx11(
|
|
1582
1709
|
"div",
|
|
1583
1710
|
{
|
|
1584
1711
|
"data-test": "suite-mobile-drawer-body",
|
|
@@ -1594,7 +1721,7 @@ function SuiteMobileDrawer({
|
|
|
1594
1721
|
|
|
1595
1722
|
// src/suite/components/suite-mobile-header.tsx
|
|
1596
1723
|
import { Menu } from "iconoir-react";
|
|
1597
|
-
import { jsx as
|
|
1724
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1598
1725
|
function SuiteMobileHeader({
|
|
1599
1726
|
onMenuClick,
|
|
1600
1727
|
menuIcon: MenuIcon = Menu,
|
|
@@ -1606,7 +1733,7 @@ function SuiteMobileHeader({
|
|
|
1606
1733
|
dataTest,
|
|
1607
1734
|
className
|
|
1608
1735
|
}) {
|
|
1609
|
-
return /* @__PURE__ */
|
|
1736
|
+
return /* @__PURE__ */ jsxs9(
|
|
1610
1737
|
"header",
|
|
1611
1738
|
{
|
|
1612
1739
|
"data-test": dataTest,
|
|
@@ -1615,19 +1742,19 @@ function SuiteMobileHeader({
|
|
|
1615
1742
|
className
|
|
1616
1743
|
),
|
|
1617
1744
|
children: [
|
|
1618
|
-
onMenuClick ? /* @__PURE__ */
|
|
1745
|
+
onMenuClick ? /* @__PURE__ */ jsx12(
|
|
1619
1746
|
"button",
|
|
1620
1747
|
{
|
|
1621
1748
|
type: "button",
|
|
1622
1749
|
id: menuId,
|
|
1623
1750
|
"data-test": menuDataTest,
|
|
1624
|
-
className: "suite-press
|
|
1751
|
+
className: "ph-btn ph-btn-ghost ph-btn-square suite-press h-11 w-11 shrink-0 text-ph-ink",
|
|
1625
1752
|
onClick: onMenuClick,
|
|
1626
1753
|
"aria-label": menuLabel,
|
|
1627
|
-
children: /* @__PURE__ */
|
|
1754
|
+
children: /* @__PURE__ */ jsx12(MenuIcon, { className: "h-5 w-5", "aria-hidden": true })
|
|
1628
1755
|
}
|
|
1629
1756
|
) : null,
|
|
1630
|
-
/* @__PURE__ */
|
|
1757
|
+
/* @__PURE__ */ jsx12(
|
|
1631
1758
|
"div",
|
|
1632
1759
|
{
|
|
1633
1760
|
className: cn2(
|
|
@@ -1637,7 +1764,7 @@ function SuiteMobileHeader({
|
|
|
1637
1764
|
children: title
|
|
1638
1765
|
}
|
|
1639
1766
|
),
|
|
1640
|
-
actions ? /* @__PURE__ */
|
|
1767
|
+
actions ? /* @__PURE__ */ jsx12("div", { className: "flex shrink-0 items-center gap-1", children: actions }) : null
|
|
1641
1768
|
]
|
|
1642
1769
|
}
|
|
1643
1770
|
);
|
|
@@ -1645,24 +1772,24 @@ function SuiteMobileHeader({
|
|
|
1645
1772
|
|
|
1646
1773
|
// src/suite/components/suite-layout.tsx
|
|
1647
1774
|
import {
|
|
1648
|
-
useEffect as
|
|
1775
|
+
useEffect as useEffect6,
|
|
1649
1776
|
useRef,
|
|
1650
|
-
useState as
|
|
1777
|
+
useState as useState8
|
|
1651
1778
|
} from "react";
|
|
1652
|
-
import { jsx as
|
|
1779
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1653
1780
|
function SuiteBreadcrumbs({ items, className }) {
|
|
1654
|
-
return /* @__PURE__ */
|
|
1781
|
+
return /* @__PURE__ */ jsx13("nav", { "aria-label": "Breadcrumb", className, children: /* @__PURE__ */ jsx13("ol", { className: "flex min-w-0 items-center gap-1.5", children: items.map((item, index) => {
|
|
1655
1782
|
const isLast = index === items.length - 1;
|
|
1656
|
-
return /* @__PURE__ */
|
|
1657
|
-
index > 0 ? /* @__PURE__ */
|
|
1658
|
-
item.href && !isLast ? /* @__PURE__ */
|
|
1783
|
+
return /* @__PURE__ */ jsxs10("li", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
1784
|
+
index > 0 ? /* @__PURE__ */ jsx13("span", { className: "select-none text-ph-border", "aria-hidden": "true", children: "/" }) : null,
|
|
1785
|
+
item.href && !isLast ? /* @__PURE__ */ jsx13(
|
|
1659
1786
|
"a",
|
|
1660
1787
|
{
|
|
1661
1788
|
href: item.href,
|
|
1662
1789
|
className: "truncate transition hover:text-ph-ink",
|
|
1663
1790
|
children: item.label
|
|
1664
1791
|
}
|
|
1665
|
-
) : /* @__PURE__ */
|
|
1792
|
+
) : /* @__PURE__ */ jsx13(
|
|
1666
1793
|
"span",
|
|
1667
1794
|
{
|
|
1668
1795
|
className: cn2(
|
|
@@ -1687,7 +1814,7 @@ function SuitePage({
|
|
|
1687
1814
|
role,
|
|
1688
1815
|
"aria-live": ariaLive
|
|
1689
1816
|
}) {
|
|
1690
|
-
return /* @__PURE__ */
|
|
1817
|
+
return /* @__PURE__ */ jsx13(
|
|
1691
1818
|
Component,
|
|
1692
1819
|
{
|
|
1693
1820
|
id,
|
|
@@ -1728,8 +1855,8 @@ function SuitePageHeader({
|
|
|
1728
1855
|
sticky = true
|
|
1729
1856
|
}) {
|
|
1730
1857
|
const headerRef = useRef(null);
|
|
1731
|
-
const [stuck, setStuck] =
|
|
1732
|
-
|
|
1858
|
+
const [stuck, setStuck] = useState8(false);
|
|
1859
|
+
useEffect6(() => {
|
|
1733
1860
|
if (!sticky) return;
|
|
1734
1861
|
if (typeof IntersectionObserver === "undefined") return;
|
|
1735
1862
|
const el = headerRef.current;
|
|
@@ -1755,7 +1882,7 @@ function SuitePageHeader({
|
|
|
1755
1882
|
sentinel.remove();
|
|
1756
1883
|
};
|
|
1757
1884
|
}, [sticky]);
|
|
1758
|
-
const resolvedIcon = todayIcon ? /* @__PURE__ */
|
|
1885
|
+
const resolvedIcon = todayIcon ? /* @__PURE__ */ jsx13(
|
|
1759
1886
|
TodayTimeIcon,
|
|
1760
1887
|
{
|
|
1761
1888
|
className: cn2(
|
|
@@ -1764,46 +1891,46 @@ function SuitePageHeader({
|
|
|
1764
1891
|
)
|
|
1765
1892
|
}
|
|
1766
1893
|
) : icon;
|
|
1767
|
-
return /* @__PURE__ */
|
|
1894
|
+
return /* @__PURE__ */ jsxs10(
|
|
1768
1895
|
"header",
|
|
1769
1896
|
{
|
|
1770
1897
|
ref: headerRef,
|
|
1771
1898
|
"data-test": dataTest,
|
|
1772
1899
|
"data-stuck": sticky ? stuck ? "true" : "false" : void 0,
|
|
1773
1900
|
className: cn2(
|
|
1774
|
-
"flex min-w-0 shrink-0 flex-col items-start gap-3 pb-2 sm:flex-row sm:justify-between sm:gap-4 sm:pb-3",
|
|
1901
|
+
"suite-page-header flex min-w-0 shrink-0 flex-col items-start gap-3 pb-2 sm:flex-row sm:justify-between sm:gap-4 sm:pb-3",
|
|
1775
1902
|
// No extra pt here — page inset sets the shared title baseline.
|
|
1776
1903
|
sticky && "suite-page-header-sticky",
|
|
1777
1904
|
className
|
|
1778
1905
|
),
|
|
1779
1906
|
children: [
|
|
1780
|
-
/* @__PURE__ */
|
|
1781
|
-
eyebrow ? /* @__PURE__ */
|
|
1782
|
-
breadcrumb ? /* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
resolvedIcon ? /* @__PURE__ */
|
|
1907
|
+
/* @__PURE__ */ jsxs10("div", { className: "min-w-0 flex-1", children: [
|
|
1908
|
+
eyebrow ? /* @__PURE__ */ jsx13("div", { className: "mb-0.5 flex min-w-0 items-center gap-1.5 text-xs text-ph-subtle", children: eyebrow }) : null,
|
|
1909
|
+
breadcrumb ? /* @__PURE__ */ jsx13("div", { className: "mb-0.5 flex min-w-0 items-center gap-1.5 text-xs text-ph-subtle", children: breadcrumb }) : null,
|
|
1910
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
1911
|
+
resolvedIcon ? /* @__PURE__ */ jsx13(
|
|
1785
1912
|
"div",
|
|
1786
1913
|
{
|
|
1787
|
-
className: "hidden shrink-0 sm:flex sm:items-center [&_svg]:h-6 [&_svg]:w-6",
|
|
1914
|
+
className: "suite-page-header__icon hidden shrink-0 sm:flex sm:items-center [&_svg]:h-6 [&_svg]:w-6",
|
|
1788
1915
|
"aria-hidden": "true",
|
|
1789
1916
|
children: resolvedIcon
|
|
1790
1917
|
}
|
|
1791
1918
|
) : null,
|
|
1792
|
-
/* @__PURE__ */
|
|
1793
|
-
/* @__PURE__ */
|
|
1919
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
1920
|
+
/* @__PURE__ */ jsx13(
|
|
1794
1921
|
"h1",
|
|
1795
1922
|
{
|
|
1796
1923
|
className: cn2(
|
|
1797
|
-
"min-w-0 break-words font-display
|
|
1924
|
+
"ph-page-title min-w-0 break-words font-display font-semibold text-ph-ink text-balance",
|
|
1798
1925
|
titleClassName
|
|
1799
1926
|
),
|
|
1800
1927
|
children: title
|
|
1801
1928
|
}
|
|
1802
1929
|
),
|
|
1803
|
-
badge ? /* @__PURE__ */
|
|
1930
|
+
badge ? /* @__PURE__ */ jsx13("span", { className: "rounded-[var(--ph-radius-control)] bg-ph-muted px-2 py-0.5 text-[length:var(--ph-type-overline)] font-semibold uppercase tracking-wide text-ph-subtle", children: badge }) : null
|
|
1804
1931
|
] })
|
|
1805
1932
|
] }),
|
|
1806
|
-
description ? /* @__PURE__ */
|
|
1933
|
+
description ? /* @__PURE__ */ jsx13(
|
|
1807
1934
|
"div",
|
|
1808
1935
|
{
|
|
1809
1936
|
className: cn2(
|
|
@@ -1814,7 +1941,7 @@ function SuitePageHeader({
|
|
|
1814
1941
|
}
|
|
1815
1942
|
) : null
|
|
1816
1943
|
] }),
|
|
1817
|
-
actions ? /* @__PURE__ */
|
|
1944
|
+
actions ? /* @__PURE__ */ jsx13("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
|
|
1818
1945
|
]
|
|
1819
1946
|
}
|
|
1820
1947
|
);
|
|
@@ -1825,7 +1952,7 @@ function SuiteToolbar({
|
|
|
1825
1952
|
label = "Page tools",
|
|
1826
1953
|
dataTest
|
|
1827
1954
|
}) {
|
|
1828
|
-
return /* @__PURE__ */
|
|
1955
|
+
return /* @__PURE__ */ jsx13(
|
|
1829
1956
|
"div",
|
|
1830
1957
|
{
|
|
1831
1958
|
role: "toolbar",
|
|
@@ -1842,7 +1969,7 @@ function SuiteTabList({
|
|
|
1842
1969
|
label,
|
|
1843
1970
|
dataTest
|
|
1844
1971
|
}) {
|
|
1845
|
-
return /* @__PURE__ */
|
|
1972
|
+
return /* @__PURE__ */ jsx13(
|
|
1846
1973
|
"nav",
|
|
1847
1974
|
{
|
|
1848
1975
|
"aria-label": label,
|
|
@@ -1861,7 +1988,7 @@ function SuiteSectionHeader({
|
|
|
1861
1988
|
action,
|
|
1862
1989
|
className
|
|
1863
1990
|
}) {
|
|
1864
|
-
return /* @__PURE__ */
|
|
1991
|
+
return /* @__PURE__ */ jsxs10(
|
|
1865
1992
|
"div",
|
|
1866
1993
|
{
|
|
1867
1994
|
className: cn2(
|
|
@@ -1869,18 +1996,18 @@ function SuiteSectionHeader({
|
|
|
1869
1996
|
className
|
|
1870
1997
|
),
|
|
1871
1998
|
children: [
|
|
1872
|
-
/* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
1874
|
-
description ? /* @__PURE__ */
|
|
1999
|
+
/* @__PURE__ */ jsxs10("div", { className: "min-w-0", children: [
|
|
2000
|
+
/* @__PURE__ */ jsx13("h2", { className: "font-display text-balance text-lg font-semibold tracking-tight text-ph-ink sm:text-xl", children: title }),
|
|
2001
|
+
description ? /* @__PURE__ */ jsx13("div", { className: "mt-1 max-w-2xl text-pretty text-sm leading-5 text-ph-subtle", children: description }) : null
|
|
1875
2002
|
] }),
|
|
1876
|
-
action ? /* @__PURE__ */
|
|
2003
|
+
action ? /* @__PURE__ */ jsx13("div", { className: "flex min-h-[44px] shrink-0 items-center", children: action }) : null
|
|
1877
2004
|
]
|
|
1878
2005
|
}
|
|
1879
2006
|
);
|
|
1880
2007
|
}
|
|
1881
2008
|
|
|
1882
2009
|
// src/suite/components/suite-settings-layout.tsx
|
|
1883
|
-
import { jsx as
|
|
2010
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1884
2011
|
function SuiteSettingsLayout({
|
|
1885
2012
|
children,
|
|
1886
2013
|
sidebar,
|
|
@@ -1894,13 +2021,13 @@ function SuiteSettingsLayout({
|
|
|
1894
2021
|
className,
|
|
1895
2022
|
contentClassName
|
|
1896
2023
|
}) {
|
|
1897
|
-
return /* @__PURE__ */
|
|
2024
|
+
return /* @__PURE__ */ jsxs11(
|
|
1898
2025
|
SuitePage,
|
|
1899
2026
|
{
|
|
1900
2027
|
dataTest,
|
|
1901
2028
|
className: cn2("flex h-full flex-col overflow-hidden", className),
|
|
1902
2029
|
children: [
|
|
1903
|
-
header != null ? header : /* @__PURE__ */
|
|
2030
|
+
header != null ? header : /* @__PURE__ */ jsx14(
|
|
1904
2031
|
SuitePageHeader,
|
|
1905
2032
|
{
|
|
1906
2033
|
sticky: true,
|
|
@@ -1909,18 +2036,18 @@ function SuiteSettingsLayout({
|
|
|
1909
2036
|
description
|
|
1910
2037
|
}
|
|
1911
2038
|
),
|
|
1912
|
-
loading != null ? loading : /* @__PURE__ */
|
|
1913
|
-
mobileNav ? /* @__PURE__ */
|
|
1914
|
-
/* @__PURE__ */
|
|
1915
|
-
/* @__PURE__ */
|
|
2039
|
+
loading != null ? loading : /* @__PURE__ */ jsxs11("div", { className: "suite-page-body mt-6 flex min-h-0 flex-1 flex-col", children: [
|
|
2040
|
+
mobileNav ? /* @__PURE__ */ jsx14("div", { className: "suite-settings-mobile-bar sticky top-0 z-20 mb-2 shrink-0 lg:hidden", children: mobileNav }) : null,
|
|
2041
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex min-h-0 flex-1 flex-col gap-6 lg:flex-row lg:gap-8", children: [
|
|
2042
|
+
/* @__PURE__ */ jsx14(
|
|
1916
2043
|
"aside",
|
|
1917
2044
|
{
|
|
1918
2045
|
"aria-label": "Settings",
|
|
1919
|
-
className: "hidden w-56 shrink-0
|
|
2046
|
+
className: "suite-settings-sidebar hidden w-56 shrink-0 lg:block lg:self-stretch lg:overflow-y-auto lg:overscroll-contain",
|
|
1920
2047
|
children: sidebar
|
|
1921
2048
|
}
|
|
1922
2049
|
),
|
|
1923
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ jsx14(
|
|
1924
2051
|
"div",
|
|
1925
2052
|
{
|
|
1926
2053
|
className: cn2(
|
|
@@ -1941,7 +2068,7 @@ function SuiteSettingsLayout({
|
|
|
1941
2068
|
import Image2 from "next/image";
|
|
1942
2069
|
import { useRouter as useRouter2 } from "next/navigation";
|
|
1943
2070
|
import { LogOut, Settings } from "iconoir-react";
|
|
1944
|
-
import { jsx as
|
|
2071
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1945
2072
|
function computeInitials(name, email) {
|
|
1946
2073
|
const source = (name || email || "?").trim();
|
|
1947
2074
|
return source.split(/[\s@]+/).filter(Boolean).slice(0, 2).map((part) => part[0]).join("").toUpperCase();
|
|
@@ -1979,7 +2106,7 @@ function SuiteUserMenu({
|
|
|
1979
2106
|
const router = useRouter2();
|
|
1980
2107
|
const initials = fallbackInitials != null ? fallbackInitials : computeInitials(name, email);
|
|
1981
2108
|
const fallbackColor = avatarColorClass(email || name || "?");
|
|
1982
|
-
const avatar = /* @__PURE__ */
|
|
2109
|
+
const avatar = /* @__PURE__ */ jsx15("span", { className: "inline-flex h-10 w-10 items-center justify-center", children: /* @__PURE__ */ jsx15("span", { className: "inline-flex h-8 w-8 items-center justify-center overflow-hidden rounded-full border border-ph-border", children: image ? /* @__PURE__ */ jsx15(
|
|
1983
2110
|
Image2,
|
|
1984
2111
|
{
|
|
1985
2112
|
src: image,
|
|
@@ -1989,7 +2116,7 @@ function SuiteUserMenu({
|
|
|
1989
2116
|
className: "h-full w-full object-cover",
|
|
1990
2117
|
unoptimized: true
|
|
1991
2118
|
}
|
|
1992
|
-
) : /* @__PURE__ */
|
|
2119
|
+
) : /* @__PURE__ */ jsx15(
|
|
1993
2120
|
"span",
|
|
1994
2121
|
{
|
|
1995
2122
|
className: cn2(
|
|
@@ -1999,14 +2126,14 @@ function SuiteUserMenu({
|
|
|
1999
2126
|
children: initials
|
|
2000
2127
|
}
|
|
2001
2128
|
) }) });
|
|
2002
|
-
const trigger = showDetails ? /* @__PURE__ */
|
|
2129
|
+
const trigger = showDetails ? /* @__PURE__ */ jsxs12("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2003
2130
|
avatar,
|
|
2004
|
-
/* @__PURE__ */
|
|
2005
|
-
/* @__PURE__ */
|
|
2006
|
-
subtitle ? /* @__PURE__ */
|
|
2131
|
+
/* @__PURE__ */ jsxs12("span", { className: "flex min-w-0 flex-col text-left", children: [
|
|
2132
|
+
/* @__PURE__ */ jsx15("span", { className: "truncate text-sm font-medium text-ph-ink", children: name || email || "Account" }),
|
|
2133
|
+
subtitle ? /* @__PURE__ */ jsx15("span", { className: "truncate text-xs text-ph-mutedtext", children: subtitle }) : null
|
|
2007
2134
|
] })
|
|
2008
2135
|
] }) : avatar;
|
|
2009
|
-
const accountMenu = /* @__PURE__ */
|
|
2136
|
+
const accountMenu = /* @__PURE__ */ jsxs12(
|
|
2010
2137
|
DropdownMenu,
|
|
2011
2138
|
{
|
|
2012
2139
|
trigger,
|
|
@@ -2020,29 +2147,29 @@ function SuiteUserMenu({
|
|
|
2020
2147
|
modal: false,
|
|
2021
2148
|
className: cn2(
|
|
2022
2149
|
"[&_.ph-dropdown-trigger]:rounded-full",
|
|
2023
|
-
showDetails && "min-w-0 flex-1 [&_.ph-dropdown-trigger]:w-full [&_.ph-dropdown-trigger]:justify-start [&_.ph-dropdown-trigger]:rounded-
|
|
2150
|
+
showDetails && "min-w-0 flex-1 [&_.ph-dropdown-trigger]:w-full [&_.ph-dropdown-trigger]:justify-start [&_.ph-dropdown-trigger]:rounded-[var(--ph-radius-control)]",
|
|
2024
2151
|
showSignOutAction ? void 0 : className
|
|
2025
2152
|
),
|
|
2026
2153
|
"data-test": dataTest,
|
|
2027
2154
|
children: [
|
|
2028
|
-
/* @__PURE__ */
|
|
2029
|
-
/* @__PURE__ */
|
|
2030
|
-
email ? /* @__PURE__ */
|
|
2155
|
+
/* @__PURE__ */ jsxs12("div", { className: "px-2 py-1.5", children: [
|
|
2156
|
+
/* @__PURE__ */ jsx15("p", { className: "truncate text-sm font-medium text-ph-ink", children: name || email || "Account" }),
|
|
2157
|
+
email ? /* @__PURE__ */ jsx15("p", { className: "truncate text-xs text-ph-mutedtext", children: email }) : null
|
|
2031
2158
|
] }),
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2159
|
+
/* @__PURE__ */ jsx15("div", { className: "my-1 border-t border-ph-border" }),
|
|
2160
|
+
/* @__PURE__ */ jsxs12(
|
|
2034
2161
|
DropdownItem,
|
|
2035
2162
|
{
|
|
2036
2163
|
"data-test": `${dataTest}-settings`,
|
|
2037
2164
|
onClick: () => router.push(settingsHref),
|
|
2038
2165
|
children: [
|
|
2039
|
-
/* @__PURE__ */
|
|
2166
|
+
/* @__PURE__ */ jsx15(Settings, { className: "h-4 w-4 text-ph-mutedtext", "aria-hidden": true }),
|
|
2040
2167
|
"Profile settings"
|
|
2041
2168
|
]
|
|
2042
2169
|
}
|
|
2043
2170
|
),
|
|
2044
|
-
/* @__PURE__ */
|
|
2045
|
-
/* @__PURE__ */
|
|
2171
|
+
/* @__PURE__ */ jsxs12(DropdownItem, { "data-test": `${dataTest}-sign-out`, onClick: onSignOut, children: [
|
|
2172
|
+
/* @__PURE__ */ jsx15(LogOut, { className: "h-4 w-4 text-ph-mutedtext", "aria-hidden": true }),
|
|
2046
2173
|
"Sign out"
|
|
2047
2174
|
] })
|
|
2048
2175
|
]
|
|
@@ -2051,7 +2178,7 @@ function SuiteUserMenu({
|
|
|
2051
2178
|
if (!showSignOutAction) {
|
|
2052
2179
|
return accountMenu;
|
|
2053
2180
|
}
|
|
2054
|
-
return /* @__PURE__ */
|
|
2181
|
+
return /* @__PURE__ */ jsxs12(
|
|
2055
2182
|
"div",
|
|
2056
2183
|
{
|
|
2057
2184
|
className: cn2(
|
|
@@ -2059,17 +2186,17 @@ function SuiteUserMenu({
|
|
|
2059
2186
|
className
|
|
2060
2187
|
),
|
|
2061
2188
|
children: [
|
|
2062
|
-
/* @__PURE__ */
|
|
2063
|
-
/* @__PURE__ */
|
|
2189
|
+
/* @__PURE__ */ jsx15("div", { className: "shrink-0", children: accountMenu }),
|
|
2190
|
+
/* @__PURE__ */ jsx15(
|
|
2064
2191
|
"button",
|
|
2065
2192
|
{
|
|
2066
2193
|
type: "button",
|
|
2067
2194
|
"data-test": `${dataTest}-visible-sign-out`,
|
|
2068
2195
|
title: "Sign out",
|
|
2069
2196
|
"aria-label": "Sign out",
|
|
2070
|
-
className: "
|
|
2197
|
+
className: "ph-btn ph-btn-ghost ph-btn-square h-10 w-10 shrink-0 text-ph-mutedtext",
|
|
2071
2198
|
onClick: onSignOut,
|
|
2072
|
-
children: /* @__PURE__ */
|
|
2199
|
+
children: /* @__PURE__ */ jsx15(LogOut, { className: "h-4 w-4", "aria-hidden": true })
|
|
2073
2200
|
}
|
|
2074
2201
|
)
|
|
2075
2202
|
]
|
|
@@ -2079,7 +2206,7 @@ function SuiteUserMenu({
|
|
|
2079
2206
|
|
|
2080
2207
|
// src/suite/components/suite-bottom-nav.tsx
|
|
2081
2208
|
import Link from "next/link";
|
|
2082
|
-
import { Fragment as Fragment4, jsx as
|
|
2209
|
+
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2083
2210
|
function SuiteBottomNav({
|
|
2084
2211
|
items,
|
|
2085
2212
|
ariaLabel = "Primary navigation",
|
|
@@ -2092,8 +2219,8 @@ function SuiteBottomNav({
|
|
|
2092
2219
|
);
|
|
2093
2220
|
}
|
|
2094
2221
|
const activeIndex = items.findIndex((item) => item.active);
|
|
2095
|
-
return /* @__PURE__ */
|
|
2096
|
-
/* @__PURE__ */
|
|
2222
|
+
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
2223
|
+
/* @__PURE__ */ jsx16(
|
|
2097
2224
|
"div",
|
|
2098
2225
|
{
|
|
2099
2226
|
"aria-hidden": true,
|
|
@@ -2101,7 +2228,7 @@ function SuiteBottomNav({
|
|
|
2101
2228
|
style: { height: "calc(60px + env(safe-area-inset-bottom))" }
|
|
2102
2229
|
}
|
|
2103
2230
|
),
|
|
2104
|
-
/* @__PURE__ */
|
|
2231
|
+
/* @__PURE__ */ jsxs13(
|
|
2105
2232
|
"nav",
|
|
2106
2233
|
{
|
|
2107
2234
|
"aria-label": ariaLabel,
|
|
@@ -2116,12 +2243,12 @@ function SuiteBottomNav({
|
|
|
2116
2243
|
"--suite-nav-active": activeIndex >= 0 ? activeIndex : 0
|
|
2117
2244
|
},
|
|
2118
2245
|
children: [
|
|
2119
|
-
activeIndex >= 0 ? /* @__PURE__ */
|
|
2246
|
+
activeIndex >= 0 ? /* @__PURE__ */ jsx16("span", { "aria-hidden": true, className: "suite-bottom-nav__indicator" }) : null,
|
|
2120
2247
|
items.map((item) => {
|
|
2121
2248
|
var _a2;
|
|
2122
2249
|
const Icon = item.icon;
|
|
2123
2250
|
const active = Boolean(item.active);
|
|
2124
|
-
return /* @__PURE__ */
|
|
2251
|
+
return /* @__PURE__ */ jsxs13(
|
|
2125
2252
|
Link,
|
|
2126
2253
|
{
|
|
2127
2254
|
href: item.href,
|
|
@@ -2129,18 +2256,18 @@ function SuiteBottomNav({
|
|
|
2129
2256
|
"data-test": (_a2 = item.dataTest) != null ? _a2 : `suite-nav-${item.label.toLowerCase().replace(/\s+/g, "-")}`,
|
|
2130
2257
|
"aria-current": active ? "page" : void 0,
|
|
2131
2258
|
className: cn2(
|
|
2132
|
-
"suite-bottom-nav__item relative flex min-h-[60px] min-w-0 flex-col items-center justify-center gap-1 px-1 pb-1.5 pt-2 text-[
|
|
2259
|
+
"suite-bottom-nav__item relative flex min-h-[60px] min-w-0 flex-col items-center justify-center gap-1 px-1 pb-1.5 pt-2 text-[length:var(--ph-type-overline)] font-medium leading-none text-ph-mutedtext transition-colors duration-200 focus-visible:outline-none focus-visible:shadow-[inset_0_0_0_3px_color-mix(in_oklab,var(--ph-focus-ring)_30%,transparent)] motion-reduce:transition-none",
|
|
2133
2260
|
active && "font-semibold text-ph-brand"
|
|
2134
2261
|
),
|
|
2135
2262
|
children: [
|
|
2136
|
-
/* @__PURE__ */
|
|
2263
|
+
/* @__PURE__ */ jsx16(
|
|
2137
2264
|
"span",
|
|
2138
2265
|
{
|
|
2139
2266
|
className: cn2(
|
|
2140
2267
|
"suite-bottom-nav__icon relative z-10 inline-flex items-center justify-center",
|
|
2141
2268
|
active && "suite-bottom-nav__icon--active"
|
|
2142
2269
|
),
|
|
2143
|
-
children: /* @__PURE__ */
|
|
2270
|
+
children: /* @__PURE__ */ jsx16(
|
|
2144
2271
|
Icon,
|
|
2145
2272
|
{
|
|
2146
2273
|
className: "h-6 w-6",
|
|
@@ -2150,7 +2277,7 @@ function SuiteBottomNav({
|
|
|
2150
2277
|
)
|
|
2151
2278
|
}
|
|
2152
2279
|
),
|
|
2153
|
-
/* @__PURE__ */
|
|
2280
|
+
/* @__PURE__ */ jsx16("span", { className: "relative z-10 max-w-full truncate", children: item.label })
|
|
2154
2281
|
]
|
|
2155
2282
|
},
|
|
2156
2283
|
item.href
|
|
@@ -2164,7 +2291,7 @@ function SuiteBottomNav({
|
|
|
2164
2291
|
|
|
2165
2292
|
// src/suite/components/today-calibrating.tsx
|
|
2166
2293
|
import { Refresh as RefreshCw2, SunLight as Sun } from "iconoir-react";
|
|
2167
|
-
import { jsx as
|
|
2294
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2168
2295
|
function TodayCalibrating({
|
|
2169
2296
|
onRetry,
|
|
2170
2297
|
retrying = false,
|
|
@@ -2174,35 +2301,35 @@ function TodayCalibrating({
|
|
|
2174
2301
|
retrySpinnerClassName = "text-ph-brand"
|
|
2175
2302
|
}) {
|
|
2176
2303
|
void _variant;
|
|
2177
|
-
return /* @__PURE__ */
|
|
2304
|
+
return /* @__PURE__ */ jsxs14(
|
|
2178
2305
|
"div",
|
|
2179
2306
|
{
|
|
2180
2307
|
className: cn2(
|
|
2181
|
-
"suite-auth-handoff relative flex min-h-[14rem] flex-col items-center justify-center overflow-hidden rounded-
|
|
2308
|
+
"suite-auth-handoff relative flex min-h-[14rem] flex-col items-center justify-center overflow-hidden rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface px-5 py-8 text-center",
|
|
2182
2309
|
className
|
|
2183
2310
|
),
|
|
2184
2311
|
"data-test": "today-calibrating",
|
|
2185
2312
|
children: [
|
|
2186
|
-
/* @__PURE__ */
|
|
2313
|
+
/* @__PURE__ */ jsx17(
|
|
2187
2314
|
"div",
|
|
2188
2315
|
{
|
|
2189
2316
|
className: "pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_35%,rgba(251,191,36,0.1),transparent_55%)]",
|
|
2190
2317
|
"aria-hidden": true
|
|
2191
2318
|
}
|
|
2192
2319
|
),
|
|
2193
|
-
/* @__PURE__ */
|
|
2194
|
-
/* @__PURE__ */
|
|
2195
|
-
/* @__PURE__ */
|
|
2196
|
-
/* @__PURE__ */
|
|
2197
|
-
onRetry ? /* @__PURE__ */
|
|
2320
|
+
/* @__PURE__ */ jsx17("div", { className: "relative mb-5 flex h-14 w-14 items-center justify-center rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface text-ph-ink shadow-[var(--ph-shadow-control)]", children: /* @__PURE__ */ jsx17(Sun, { className: "h-8 w-8", strokeWidth: 2, "aria-hidden": true }) }),
|
|
2321
|
+
/* @__PURE__ */ jsx17("h2", { className: "relative text-base font-semibold tracking-tight text-ph-ink sm:text-lg md:text-xl", children: "Calibrating your day" }),
|
|
2322
|
+
/* @__PURE__ */ jsx17("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" }),
|
|
2323
|
+
/* @__PURE__ */ jsx17("div", { className: "relative mt-5 flex justify-center", children: /* @__PURE__ */ jsx17(Spinner, { size: "sm", className: "opacity-70", label: "Loading today" }) }),
|
|
2324
|
+
onRetry ? /* @__PURE__ */ jsxs14(
|
|
2198
2325
|
"button",
|
|
2199
2326
|
{
|
|
2200
2327
|
type: "button",
|
|
2201
2328
|
onClick: onRetry,
|
|
2202
2329
|
disabled: retrying,
|
|
2203
|
-
className: "
|
|
2330
|
+
className: "ph-btn ph-btn-secondary relative mt-6",
|
|
2204
2331
|
children: [
|
|
2205
|
-
retrying ? /* @__PURE__ */
|
|
2332
|
+
retrying ? /* @__PURE__ */ jsx17(Spinner, { size: "sm", className: retrySpinnerClassName }) : /* @__PURE__ */ jsx17(RefreshCw2, { className: "h-4 w-4", "aria-hidden": true }),
|
|
2206
2333
|
"Try again"
|
|
2207
2334
|
]
|
|
2208
2335
|
}
|
|
@@ -2215,12 +2342,12 @@ function TodayCalibrating({
|
|
|
2215
2342
|
// src/suite/components/theme-provider.tsx
|
|
2216
2343
|
import {
|
|
2217
2344
|
createContext as createContext2,
|
|
2218
|
-
useCallback as
|
|
2345
|
+
useCallback as useCallback3,
|
|
2219
2346
|
useContext as useContext2,
|
|
2220
|
-
useEffect as
|
|
2347
|
+
useEffect as useEffect7,
|
|
2221
2348
|
useMemo as useMemo2,
|
|
2222
2349
|
useRef as useRef2,
|
|
2223
|
-
useState as
|
|
2350
|
+
useState as useState9
|
|
2224
2351
|
} from "react";
|
|
2225
2352
|
|
|
2226
2353
|
// src/suite/lib/cookies.ts
|
|
@@ -2270,7 +2397,7 @@ function clearCookie(name) {
|
|
|
2270
2397
|
}
|
|
2271
2398
|
|
|
2272
2399
|
// src/suite/components/theme-provider.tsx
|
|
2273
|
-
import { jsx as
|
|
2400
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2274
2401
|
var SuiteThemeContext = createContext2(null);
|
|
2275
2402
|
var suiteThemeChannel = null;
|
|
2276
2403
|
function broadcastTheme(theme) {
|
|
@@ -2337,7 +2464,7 @@ function SuiteThemeProvider({
|
|
|
2337
2464
|
config,
|
|
2338
2465
|
children
|
|
2339
2466
|
}) {
|
|
2340
|
-
const [state, setState] =
|
|
2467
|
+
const [state, setState] = useState9(() => {
|
|
2341
2468
|
const theme = readStoredTheme(config.storageKey);
|
|
2342
2469
|
if (typeof document === "undefined") {
|
|
2343
2470
|
return { theme, resolvedTheme: config.fallbackTheme };
|
|
@@ -2348,13 +2475,13 @@ function SuiteThemeProvider({
|
|
|
2348
2475
|
});
|
|
2349
2476
|
const themeRef = useRef2(state.theme);
|
|
2350
2477
|
themeRef.current = state.theme;
|
|
2351
|
-
|
|
2478
|
+
useEffect7(() => {
|
|
2352
2479
|
applyTheme(state.theme, config);
|
|
2353
2480
|
}, [state.theme, config]);
|
|
2354
|
-
|
|
2481
|
+
useEffect7(() => {
|
|
2355
2482
|
if (readSharedTheme() == null) writeSharedTheme(state.theme);
|
|
2356
2483
|
}, []);
|
|
2357
|
-
|
|
2484
|
+
useEffect7(() => {
|
|
2358
2485
|
if (state.theme !== "system") return;
|
|
2359
2486
|
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2360
2487
|
const update = () => {
|
|
@@ -2364,7 +2491,7 @@ function SuiteThemeProvider({
|
|
|
2364
2491
|
media.addEventListener("change", update);
|
|
2365
2492
|
return () => media.removeEventListener("change", update);
|
|
2366
2493
|
}, [state.theme, config]);
|
|
2367
|
-
|
|
2494
|
+
useEffect7(() => {
|
|
2368
2495
|
let channel = null;
|
|
2369
2496
|
try {
|
|
2370
2497
|
channel = new BroadcastChannel(SUITE_THEME_CHANNEL);
|
|
@@ -2418,7 +2545,7 @@ function SuiteThemeProvider({
|
|
|
2418
2545
|
stopPolling();
|
|
2419
2546
|
};
|
|
2420
2547
|
}, [config]);
|
|
2421
|
-
const setTheme =
|
|
2548
|
+
const setTheme = useCallback3(
|
|
2422
2549
|
(next) => {
|
|
2423
2550
|
const resolved = applyTheme(next, config);
|
|
2424
2551
|
setState({ theme: next, resolvedTheme: resolved });
|
|
@@ -2431,7 +2558,7 @@ function SuiteThemeProvider({
|
|
|
2431
2558
|
},
|
|
2432
2559
|
[config]
|
|
2433
2560
|
);
|
|
2434
|
-
const toggleTheme =
|
|
2561
|
+
const toggleTheme = useCallback3(() => {
|
|
2435
2562
|
const next = resolveTheme(themeRef.current, config.fallbackTheme) === "dark" ? "light" : "dark";
|
|
2436
2563
|
setTheme(next);
|
|
2437
2564
|
}, [config, setTheme]);
|
|
@@ -2439,7 +2566,7 @@ function SuiteThemeProvider({
|
|
|
2439
2566
|
() => ({ theme: state.theme, resolvedTheme: state.resolvedTheme, setTheme, toggleTheme }),
|
|
2440
2567
|
[state.theme, state.resolvedTheme, setTheme, toggleTheme]
|
|
2441
2568
|
);
|
|
2442
|
-
return /* @__PURE__ */
|
|
2569
|
+
return /* @__PURE__ */ jsx18(SuiteThemeContext.Provider, { value, children });
|
|
2443
2570
|
}
|
|
2444
2571
|
function useSuiteTheme() {
|
|
2445
2572
|
const ctx = useContext2(SuiteThemeContext);
|
|
@@ -2451,12 +2578,12 @@ function useSuiteTheme() {
|
|
|
2451
2578
|
import {
|
|
2452
2579
|
lazy,
|
|
2453
2580
|
Suspense,
|
|
2454
|
-
useCallback as
|
|
2455
|
-
useEffect as
|
|
2581
|
+
useCallback as useCallback4,
|
|
2582
|
+
useEffect as useEffect8,
|
|
2456
2583
|
useId,
|
|
2457
2584
|
useLayoutEffect,
|
|
2458
2585
|
useRef as useRef3,
|
|
2459
|
-
useState as
|
|
2586
|
+
useState as useState10
|
|
2460
2587
|
} from "react";
|
|
2461
2588
|
import {
|
|
2462
2589
|
ArrowDown,
|
|
@@ -2469,7 +2596,7 @@ import {
|
|
|
2469
2596
|
Square,
|
|
2470
2597
|
WarningTriangle
|
|
2471
2598
|
} from "iconoir-react";
|
|
2472
|
-
import { Fragment as Fragment5, jsx as
|
|
2599
|
+
import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2473
2600
|
var SuiteAiMarkdownMessage = lazy(() => import("./ai-message-markdown-AUEMCO7K.mjs"));
|
|
2474
2601
|
var SUITE_OPEN_ASK_AI_EVENT = "shellstack:open-ask-ai";
|
|
2475
2602
|
var SUITE_ASK_AI_OPEN_KEY = "shellstack:shelly-open";
|
|
@@ -2558,10 +2685,10 @@ function SuiteAiPanel({
|
|
|
2558
2685
|
isWaitingForReply = false
|
|
2559
2686
|
}) {
|
|
2560
2687
|
const inputId = useId();
|
|
2561
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
2562
|
-
const [resolvingId, setResolvingId] =
|
|
2688
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState10(false);
|
|
2689
|
+
const [resolvingId, setResolvingId] = useState10("");
|
|
2563
2690
|
const open = openProp != null ? openProp : uncontrolledOpen;
|
|
2564
|
-
const setOpen =
|
|
2691
|
+
const setOpen = useCallback4(
|
|
2565
2692
|
(next) => {
|
|
2566
2693
|
persistSuiteAskAiOpen(next);
|
|
2567
2694
|
if (openProp === void 0) setUncontrolledOpen(next);
|
|
@@ -2569,21 +2696,21 @@ function SuiteAiPanel({
|
|
|
2569
2696
|
},
|
|
2570
2697
|
[onOpenChange, openProp]
|
|
2571
2698
|
);
|
|
2572
|
-
const [prompt, setPrompt] =
|
|
2573
|
-
const [messages, setMessages] =
|
|
2574
|
-
const [loading, setLoading] =
|
|
2575
|
-
const [hydrating, setHydrating] =
|
|
2576
|
-
const [error, setError] =
|
|
2577
|
-
const [atBottom, setAtBottom] =
|
|
2699
|
+
const [prompt, setPrompt] = useState10("");
|
|
2700
|
+
const [messages, setMessages] = useState10([]);
|
|
2701
|
+
const [loading, setLoading] = useState10(false);
|
|
2702
|
+
const [hydrating, setHydrating] = useState10(false);
|
|
2703
|
+
const [error, setError] = useState10("");
|
|
2704
|
+
const [atBottom, setAtBottom] = useState10(true);
|
|
2578
2705
|
const scrollerRef = useRef3(null);
|
|
2579
2706
|
const textareaRef = useRef3(null);
|
|
2580
2707
|
const abortRef = useRef3(null);
|
|
2581
2708
|
const pendingPromptRef = useRef3(null);
|
|
2582
|
-
const [editingIndex, setEditingIndex] =
|
|
2583
|
-
const [editDraft, setEditDraft] =
|
|
2584
|
-
const [copiedIndex, setCopiedIndex] =
|
|
2709
|
+
const [editingIndex, setEditingIndex] = useState10(null);
|
|
2710
|
+
const [editDraft, setEditDraft] = useState10("");
|
|
2711
|
+
const [copiedIndex, setCopiedIndex] = useState10(null);
|
|
2585
2712
|
const waiting = loading || isWaitingForReply;
|
|
2586
|
-
|
|
2713
|
+
useEffect8(() => {
|
|
2587
2714
|
function onOpen(event) {
|
|
2588
2715
|
var _a2;
|
|
2589
2716
|
const detail = event.detail;
|
|
@@ -2597,19 +2724,19 @@ function SuiteAiPanel({
|
|
|
2597
2724
|
window.addEventListener(SUITE_OPEN_ASK_AI_EVENT, onOpen);
|
|
2598
2725
|
return () => window.removeEventListener(SUITE_OPEN_ASK_AI_EVENT, onOpen);
|
|
2599
2726
|
}, [setOpen]);
|
|
2600
|
-
const scrollToBottom =
|
|
2727
|
+
const scrollToBottom = useCallback4((behavior = "auto") => {
|
|
2601
2728
|
const el = scrollerRef.current;
|
|
2602
2729
|
if (!el) return;
|
|
2603
2730
|
el.scrollTo({ top: el.scrollHeight, behavior });
|
|
2604
2731
|
setAtBottom(true);
|
|
2605
2732
|
}, []);
|
|
2606
|
-
const handleScroll =
|
|
2733
|
+
const handleScroll = useCallback4(() => {
|
|
2607
2734
|
const el = scrollerRef.current;
|
|
2608
2735
|
if (!el) return;
|
|
2609
2736
|
const distance = el.scrollHeight - el.scrollTop - el.clientHeight;
|
|
2610
2737
|
setAtBottom(distance < 64);
|
|
2611
2738
|
}, []);
|
|
2612
|
-
const hydrate =
|
|
2739
|
+
const hydrate = useCallback4(async () => {
|
|
2613
2740
|
var _a2, _b, _c;
|
|
2614
2741
|
setHydrating(true);
|
|
2615
2742
|
setError("");
|
|
@@ -2632,7 +2759,7 @@ function SuiteAiPanel({
|
|
|
2632
2759
|
setHydrating(false);
|
|
2633
2760
|
}
|
|
2634
2761
|
}, [fetchChat]);
|
|
2635
|
-
|
|
2762
|
+
useEffect8(() => {
|
|
2636
2763
|
var _a2;
|
|
2637
2764
|
if (!open) return;
|
|
2638
2765
|
const queued = (_a2 = pendingPromptRef.current) != null ? _a2 : consumePendingAskAiPrompt();
|
|
@@ -2643,14 +2770,14 @@ function SuiteAiPanel({
|
|
|
2643
2770
|
if (pending) setPrompt(pending);
|
|
2644
2771
|
});
|
|
2645
2772
|
}, [open, hydrate]);
|
|
2646
|
-
|
|
2773
|
+
useEffect8(() => {
|
|
2647
2774
|
if (open && atBottom) scrollToBottom();
|
|
2648
2775
|
}, [messages, waiting, open, atBottom, scrollToBottom]);
|
|
2649
|
-
|
|
2776
|
+
useEffect8(() => {
|
|
2650
2777
|
var _a2;
|
|
2651
2778
|
if (open && !hydrating) (_a2 = textareaRef.current) == null ? void 0 : _a2.focus();
|
|
2652
2779
|
}, [open, hydrating]);
|
|
2653
|
-
|
|
2780
|
+
useEffect8(() => {
|
|
2654
2781
|
if (!open) return;
|
|
2655
2782
|
void import("./ai-message-markdown-AUEMCO7K.mjs").catch(() => {
|
|
2656
2783
|
});
|
|
@@ -2838,32 +2965,32 @@ function SuiteAiPanel({
|
|
|
2838
2965
|
-1
|
|
2839
2966
|
);
|
|
2840
2967
|
const Icon = BrandIcon != null ? BrandIcon : Sparks;
|
|
2841
|
-
return /* @__PURE__ */
|
|
2968
|
+
return /* @__PURE__ */ jsxs15(
|
|
2842
2969
|
"aside",
|
|
2843
2970
|
{
|
|
2844
2971
|
className: "flex h-full min-h-0 flex-col bg-ph-canvas",
|
|
2845
2972
|
"data-test": "suite-ask-ai-panel",
|
|
2846
2973
|
"aria-label": title,
|
|
2847
2974
|
children: [
|
|
2848
|
-
/* @__PURE__ */
|
|
2849
|
-
/* @__PURE__ */
|
|
2850
|
-
messages.length > 0 ? /* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ jsxs15("header", { className: "flex items-center gap-2 px-2 pb-2", children: [
|
|
2976
|
+
/* @__PURE__ */ jsx19("h2", { className: "sr-only", children: title }),
|
|
2977
|
+
messages.length > 0 ? /* @__PURE__ */ jsxs15(
|
|
2851
2978
|
"button",
|
|
2852
2979
|
{
|
|
2853
2980
|
type: "button",
|
|
2854
2981
|
onClick: () => void handleClear(),
|
|
2855
2982
|
disabled: waiting,
|
|
2856
|
-
className: "
|
|
2983
|
+
className: "ph-btn ph-btn-ghost ph-btn-sm ml-auto h-9 text-xs text-ph-subtle",
|
|
2857
2984
|
"data-test": "ask-ai-clear",
|
|
2858
2985
|
children: [
|
|
2859
|
-
/* @__PURE__ */
|
|
2986
|
+
/* @__PURE__ */ jsx19(Erase, { className: "h-3.5 w-3.5" }),
|
|
2860
2987
|
"Clear"
|
|
2861
2988
|
]
|
|
2862
2989
|
}
|
|
2863
2990
|
) : null
|
|
2864
2991
|
] }),
|
|
2865
|
-
/* @__PURE__ */
|
|
2866
|
-
/* @__PURE__ */
|
|
2992
|
+
/* @__PURE__ */ jsxs15("div", { className: "relative min-h-0 flex-1", children: [
|
|
2993
|
+
/* @__PURE__ */ jsxs15(
|
|
2867
2994
|
"div",
|
|
2868
2995
|
{
|
|
2869
2996
|
ref: scrollerRef,
|
|
@@ -2874,25 +3001,25 @@ function SuiteAiPanel({
|
|
|
2874
3001
|
"aria-label": "Conversation",
|
|
2875
3002
|
className: "suite-scroll-lock h-full space-y-5 overflow-y-auto px-2 py-3",
|
|
2876
3003
|
children: [
|
|
2877
|
-
hydrating && messages.length === 0 ? /* @__PURE__ */
|
|
2878
|
-
/* @__PURE__ */
|
|
3004
|
+
hydrating && messages.length === 0 ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 text-sm text-ph-subtle", children: [
|
|
3005
|
+
/* @__PURE__ */ jsx19(Spinner, { className: "h-4 w-4 animate-spin" }),
|
|
2879
3006
|
"Loading your chat\u2026"
|
|
2880
3007
|
] }) : null,
|
|
2881
|
-
!hydrating && messages.length === 0 && !error ? /* @__PURE__ */
|
|
2882
|
-
/* @__PURE__ */
|
|
2883
|
-
/* @__PURE__ */
|
|
2884
|
-
/* @__PURE__ */
|
|
2885
|
-
presets.length > 0 ? /* @__PURE__ */
|
|
3008
|
+
!hydrating && messages.length === 0 && !error ? /* @__PURE__ */ jsxs15("div", { className: "mx-auto mt-4 flex max-w-sm flex-col items-center px-1 text-center", children: [
|
|
3009
|
+
/* @__PURE__ */ jsx19("span", { className: "flex h-10 w-10 items-center justify-center rounded-[var(--ph-radius-surface)] bg-ph-brand/10 text-ph-brand", children: /* @__PURE__ */ jsx19(Icon, { className: "h-5 w-5" }) }),
|
|
3010
|
+
/* @__PURE__ */ jsx19("p", { className: "mt-3 font-display text-base font-semibold text-ph-ink", children: "How can I help?" }),
|
|
3011
|
+
/* @__PURE__ */ jsx19("p", { className: "mt-1 text-sm leading-relaxed text-ph-subtle", children: emptyState }),
|
|
3012
|
+
presets.length > 0 ? /* @__PURE__ */ jsx19("div", { className: "mt-4 flex w-full flex-col gap-2", children: presets.map((preset) => /* @__PURE__ */ jsxs15(
|
|
2886
3013
|
"button",
|
|
2887
3014
|
{
|
|
2888
3015
|
type: "button",
|
|
2889
3016
|
onClick: () => void ask(preset.prompt),
|
|
2890
3017
|
disabled: waiting || hydrating,
|
|
2891
|
-
className: "group flex w-full items-center gap-2 rounded-
|
|
3018
|
+
className: "group flex w-full items-center gap-2 rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface px-3 py-2 text-left text-sm text-ph-ink transition-[background-color,border-color,box-shadow] hover:border-[var(--ph-selected-border)] hover:bg-[var(--ph-surface-hover)] focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)] disabled:opacity-40",
|
|
2892
3019
|
children: [
|
|
2893
|
-
/* @__PURE__ */
|
|
2894
|
-
/* @__PURE__ */
|
|
2895
|
-
/* @__PURE__ */
|
|
3020
|
+
/* @__PURE__ */ jsx19(Sparks, { className: "h-4 w-4 shrink-0 text-ph-brand" }),
|
|
3021
|
+
/* @__PURE__ */ jsx19("span", { className: "min-w-0 flex-1 truncate", children: preset.label }),
|
|
3022
|
+
/* @__PURE__ */ jsx19(ArrowUp, { className: "h-3.5 w-3.5 shrink-0 rotate-45 text-ph-mutedtext transition-transform group-hover:translate-x-0.5" })
|
|
2896
3023
|
]
|
|
2897
3024
|
},
|
|
2898
3025
|
preset.label
|
|
@@ -2903,13 +3030,13 @@ function SuiteAiPanel({
|
|
|
2903
3030
|
const isUser = message.role === "user";
|
|
2904
3031
|
if (isUser) {
|
|
2905
3032
|
if (editingIndex === index) {
|
|
2906
|
-
return /* @__PURE__ */
|
|
3033
|
+
return /* @__PURE__ */ jsx19(
|
|
2907
3034
|
"div",
|
|
2908
3035
|
{
|
|
2909
3036
|
className: "suite-msg-in suite-msg-in--user flex justify-end",
|
|
2910
3037
|
"data-test": "ask-ai-user",
|
|
2911
|
-
children: /* @__PURE__ */
|
|
2912
|
-
/* @__PURE__ */
|
|
3038
|
+
children: /* @__PURE__ */ jsxs15("div", { className: "w-full max-w-[85%] space-y-2", children: [
|
|
3039
|
+
/* @__PURE__ */ jsx19(
|
|
2913
3040
|
"textarea",
|
|
2914
3041
|
{
|
|
2915
3042
|
autoFocus: true,
|
|
@@ -2927,11 +3054,11 @@ function SuiteAiPanel({
|
|
|
2927
3054
|
},
|
|
2928
3055
|
rows: 2,
|
|
2929
3056
|
"data-test": "ask-ai-edit-input",
|
|
2930
|
-
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-
|
|
3057
|
+
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-[var(--ph-selected-border)] focus-visible:shadow-[var(--ph-focus-halo)]"
|
|
2931
3058
|
}
|
|
2932
3059
|
),
|
|
2933
|
-
/* @__PURE__ */
|
|
2934
|
-
/* @__PURE__ */
|
|
3060
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex justify-end gap-2", children: [
|
|
3061
|
+
/* @__PURE__ */ jsx19(
|
|
2935
3062
|
"button",
|
|
2936
3063
|
{
|
|
2937
3064
|
type: "button",
|
|
@@ -2939,18 +3066,18 @@ function SuiteAiPanel({
|
|
|
2939
3066
|
setEditingIndex(null);
|
|
2940
3067
|
setEditDraft("");
|
|
2941
3068
|
},
|
|
2942
|
-
className: "
|
|
3069
|
+
className: "ph-btn ph-btn-secondary ph-btn-xs",
|
|
2943
3070
|
children: "Cancel"
|
|
2944
3071
|
}
|
|
2945
3072
|
),
|
|
2946
|
-
/* @__PURE__ */
|
|
3073
|
+
/* @__PURE__ */ jsx19(
|
|
2947
3074
|
"button",
|
|
2948
3075
|
{
|
|
2949
3076
|
type: "button",
|
|
2950
3077
|
"data-test": "ask-ai-edit-save",
|
|
2951
3078
|
disabled: !editDraft.trim() || waiting,
|
|
2952
3079
|
onClick: () => void saveEdit(index),
|
|
2953
|
-
className: "
|
|
3080
|
+
className: "ph-btn ph-btn-primary ph-btn-xs",
|
|
2954
3081
|
children: "Save"
|
|
2955
3082
|
}
|
|
2956
3083
|
)
|
|
@@ -2960,25 +3087,25 @@ function SuiteAiPanel({
|
|
|
2960
3087
|
`user-${index}`
|
|
2961
3088
|
);
|
|
2962
3089
|
}
|
|
2963
|
-
return /* @__PURE__ */
|
|
3090
|
+
return /* @__PURE__ */ jsx19(
|
|
2964
3091
|
"div",
|
|
2965
3092
|
{
|
|
2966
3093
|
className: "suite-msg-in suite-msg-in--user flex justify-end",
|
|
2967
3094
|
"data-test": "ask-ai-user",
|
|
2968
|
-
children: /* @__PURE__ */
|
|
2969
|
-
!waiting ? /* @__PURE__ */
|
|
2970
|
-
/* @__PURE__ */
|
|
3095
|
+
children: /* @__PURE__ */ jsxs15("div", { className: "group flex items-end gap-1.5", children: [
|
|
3096
|
+
!waiting ? /* @__PURE__ */ jsxs15("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: [
|
|
3097
|
+
/* @__PURE__ */ jsx19(
|
|
2971
3098
|
"button",
|
|
2972
3099
|
{
|
|
2973
3100
|
type: "button",
|
|
2974
3101
|
onClick: () => void handleCopy(index, message.content),
|
|
2975
3102
|
"aria-label": copiedIndex === index ? "Copied" : "Copy message",
|
|
2976
3103
|
"data-test": "ask-ai-copy",
|
|
2977
|
-
className: "
|
|
2978
|
-
children: copiedIndex === index ? /* @__PURE__ */
|
|
3104
|
+
className: "ph-btn ph-btn-ghost ph-btn-square ph-btn-xs h-7 w-7 text-ph-mutedtext",
|
|
3105
|
+
children: copiedIndex === index ? /* @__PURE__ */ jsx19(Check, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx19(Copy, { className: "h-3.5 w-3.5" })
|
|
2979
3106
|
}
|
|
2980
3107
|
),
|
|
2981
|
-
/* @__PURE__ */
|
|
3108
|
+
/* @__PURE__ */ jsx19(
|
|
2982
3109
|
"button",
|
|
2983
3110
|
{
|
|
2984
3111
|
type: "button",
|
|
@@ -2988,42 +3115,42 @@ function SuiteAiPanel({
|
|
|
2988
3115
|
},
|
|
2989
3116
|
"aria-label": "Edit message",
|
|
2990
3117
|
"data-test": "ask-ai-edit",
|
|
2991
|
-
className: "
|
|
2992
|
-
children: /* @__PURE__ */
|
|
3118
|
+
className: "ph-btn ph-btn-ghost ph-btn-square ph-btn-xs h-7 w-7 text-ph-mutedtext",
|
|
3119
|
+
children: /* @__PURE__ */ jsx19(EditPencil, { className: "h-3.5 w-3.5" })
|
|
2993
3120
|
}
|
|
2994
3121
|
)
|
|
2995
3122
|
] }) : null,
|
|
2996
|
-
/* @__PURE__ */
|
|
3123
|
+
/* @__PURE__ */ jsx19("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 })
|
|
2997
3124
|
] })
|
|
2998
3125
|
},
|
|
2999
3126
|
`user-${index}`
|
|
3000
3127
|
);
|
|
3001
3128
|
}
|
|
3002
|
-
return /* @__PURE__ */
|
|
3129
|
+
return /* @__PURE__ */ jsxs15(
|
|
3003
3130
|
"div",
|
|
3004
3131
|
{
|
|
3005
3132
|
className: "flex items-end gap-2",
|
|
3006
3133
|
"data-test": "ask-ai-assistant",
|
|
3007
3134
|
children: [
|
|
3008
|
-
/* @__PURE__ */
|
|
3135
|
+
/* @__PURE__ */ jsx19(
|
|
3009
3136
|
"span",
|
|
3010
3137
|
{
|
|
3011
3138
|
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",
|
|
3012
3139
|
"aria-hidden": true,
|
|
3013
|
-
children: /* @__PURE__ */
|
|
3140
|
+
children: /* @__PURE__ */ jsx19(Icon, { className: "h-3.5 w-3.5" })
|
|
3014
3141
|
}
|
|
3015
3142
|
),
|
|
3016
|
-
/* @__PURE__ */
|
|
3017
|
-
/* @__PURE__ */
|
|
3143
|
+
/* @__PURE__ */ jsxs15("div", { className: "suite-msg-bubble min-w-0 max-w-[85%] space-y-2", children: [
|
|
3144
|
+
/* @__PURE__ */ jsx19("div", { className: "rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2 text-sm leading-relaxed text-ph-ink", children: /* @__PURE__ */ jsx19(
|
|
3018
3145
|
Suspense,
|
|
3019
3146
|
{
|
|
3020
3147
|
fallback: (
|
|
3021
3148
|
// The chunk is pre-warmed above, so this only shows on a
|
|
3022
3149
|
// cold cache. Keep it invisible — a skeleton here reads
|
|
3023
3150
|
// as if it were part of the answer.
|
|
3024
|
-
/* @__PURE__ */
|
|
3151
|
+
/* @__PURE__ */ jsx19("span", { className: "sr-only", role: "status", children: "Rendering response\u2026" })
|
|
3025
3152
|
),
|
|
3026
|
-
children: /* @__PURE__ */
|
|
3153
|
+
children: /* @__PURE__ */ jsx19(
|
|
3027
3154
|
SuiteAiMarkdownMessage,
|
|
3028
3155
|
{
|
|
3029
3156
|
markdown: message.content,
|
|
@@ -3032,43 +3159,43 @@ function SuiteAiPanel({
|
|
|
3032
3159
|
)
|
|
3033
3160
|
}
|
|
3034
3161
|
) }),
|
|
3035
|
-
((_a2 = message.actions) != null ? _a2 : []).map((action) => /* @__PURE__ */
|
|
3162
|
+
((_a2 = message.actions) != null ? _a2 : []).map((action) => /* @__PURE__ */ jsxs15(
|
|
3036
3163
|
"div",
|
|
3037
3164
|
{
|
|
3038
3165
|
"data-test": "ask-ai-action",
|
|
3039
3166
|
"data-status": action.status,
|
|
3040
|
-
className: "rounded-
|
|
3167
|
+
className: "rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface px-3 py-2 text-sm text-ph-ink",
|
|
3041
3168
|
children: [
|
|
3042
|
-
/* @__PURE__ */
|
|
3043
|
-
action.status === "proposed" ? /* @__PURE__ */
|
|
3044
|
-
/* @__PURE__ */
|
|
3169
|
+
/* @__PURE__ */ jsx19("p", { className: "font-medium", children: action.summary }),
|
|
3170
|
+
action.status === "proposed" ? /* @__PURE__ */ jsxs15("div", { className: "mt-2 flex flex-wrap gap-2", children: [
|
|
3171
|
+
/* @__PURE__ */ jsx19(
|
|
3045
3172
|
"button",
|
|
3046
3173
|
{
|
|
3047
3174
|
type: "button",
|
|
3048
3175
|
"data-test": "ask-ai-action-confirm",
|
|
3049
3176
|
disabled: Boolean(resolvingId) || !resolveAction,
|
|
3050
3177
|
onClick: () => void handleResolve(action.id, "confirm"),
|
|
3051
|
-
className: "
|
|
3178
|
+
className: "ph-btn ph-btn-primary ph-btn-xs",
|
|
3052
3179
|
children: resolvingId === action.id ? "Working\u2026" : "Confirm"
|
|
3053
3180
|
}
|
|
3054
3181
|
),
|
|
3055
|
-
/* @__PURE__ */
|
|
3182
|
+
/* @__PURE__ */ jsx19(
|
|
3056
3183
|
"button",
|
|
3057
3184
|
{
|
|
3058
3185
|
type: "button",
|
|
3059
3186
|
"data-test": "ask-ai-action-cancel",
|
|
3060
3187
|
disabled: Boolean(resolvingId) || !resolveAction,
|
|
3061
3188
|
onClick: () => void handleResolve(action.id, "cancel"),
|
|
3062
|
-
className: "
|
|
3189
|
+
className: "ph-btn ph-btn-secondary ph-btn-xs",
|
|
3063
3190
|
children: "Cancel"
|
|
3064
3191
|
}
|
|
3065
3192
|
)
|
|
3066
3193
|
] }) : null,
|
|
3067
|
-
action.status === "applied" ? /* @__PURE__ */
|
|
3194
|
+
action.status === "applied" ? /* @__PURE__ */ jsxs15("p", { className: "mt-1 text-xs text-ph-subtle", children: [
|
|
3068
3195
|
"Done",
|
|
3069
|
-
action.href ? /* @__PURE__ */
|
|
3196
|
+
action.href ? /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
3070
3197
|
" \xB7 ",
|
|
3071
|
-
/* @__PURE__ */
|
|
3198
|
+
/* @__PURE__ */ jsx19(
|
|
3072
3199
|
"a",
|
|
3073
3200
|
{
|
|
3074
3201
|
href: action.href,
|
|
@@ -3078,8 +3205,8 @@ function SuiteAiPanel({
|
|
|
3078
3205
|
)
|
|
3079
3206
|
] }) : null
|
|
3080
3207
|
] }) : null,
|
|
3081
|
-
action.status === "cancelled" ? /* @__PURE__ */
|
|
3082
|
-
action.status === "failed" ? /* @__PURE__ */
|
|
3208
|
+
action.status === "cancelled" ? /* @__PURE__ */ jsx19("p", { className: "mt-1 text-xs text-ph-subtle", children: "Cancelled" }) : null,
|
|
3209
|
+
action.status === "failed" ? /* @__PURE__ */ jsx19("p", { className: "mt-1 text-xs text-ph-danger", children: action.error || "Could not apply that." }) : null
|
|
3083
3210
|
]
|
|
3084
3211
|
},
|
|
3085
3212
|
action.id
|
|
@@ -3090,32 +3217,32 @@ function SuiteAiPanel({
|
|
|
3090
3217
|
`assistant-${index}`
|
|
3091
3218
|
);
|
|
3092
3219
|
}),
|
|
3093
|
-
waiting ? /* @__PURE__ */
|
|
3094
|
-
/* @__PURE__ */
|
|
3095
|
-
/* @__PURE__ */
|
|
3096
|
-
/* @__PURE__ */
|
|
3097
|
-
/* @__PURE__ */
|
|
3098
|
-
/* @__PURE__ */
|
|
3220
|
+
waiting ? /* @__PURE__ */ jsxs15("div", { className: "flex items-end gap-2", "aria-hidden": true, children: [
|
|
3221
|
+
/* @__PURE__ */ jsx19("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__ */ jsx19(Icon, { className: "h-3.5 w-3.5" }) }),
|
|
3222
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1.5 rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2.5", children: [
|
|
3223
|
+
/* @__PURE__ */ jsx19("span", { className: "suite-think-dot h-1.5 w-1.5 rounded-full bg-ph-mutedtext" }),
|
|
3224
|
+
/* @__PURE__ */ jsx19("span", { className: "suite-think-dot suite-think-dot--2 h-1.5 w-1.5 rounded-full bg-ph-mutedtext" }),
|
|
3225
|
+
/* @__PURE__ */ jsx19("span", { className: "suite-think-dot suite-think-dot--3 h-1.5 w-1.5 rounded-full bg-ph-mutedtext" })
|
|
3099
3226
|
] })
|
|
3100
3227
|
] }) : null,
|
|
3101
|
-
waiting ? /* @__PURE__ */
|
|
3102
|
-
error ? /* @__PURE__ */
|
|
3228
|
+
waiting ? /* @__PURE__ */ jsx19("span", { className: "sr-only", "aria-live": "polite", children: "Assistant is responding\u2026" }) : null,
|
|
3229
|
+
error ? /* @__PURE__ */ jsxs15(
|
|
3103
3230
|
"div",
|
|
3104
3231
|
{
|
|
3105
3232
|
role: "alert",
|
|
3106
|
-
className: "flex items-start gap-2 rounded-
|
|
3233
|
+
className: "flex items-start gap-2 rounded-[var(--ph-radius-surface)] border border-ph-danger/30 bg-ph-danger/10 px-3 py-2.5 text-sm text-ph-ink",
|
|
3107
3234
|
children: [
|
|
3108
|
-
/* @__PURE__ */
|
|
3109
|
-
/* @__PURE__ */
|
|
3110
|
-
/* @__PURE__ */
|
|
3111
|
-
/* @__PURE__ */
|
|
3112
|
-
/* @__PURE__ */
|
|
3235
|
+
/* @__PURE__ */ jsx19(WarningTriangle, { className: "mt-0.5 h-4 w-4 shrink-0 text-ph-danger" }),
|
|
3236
|
+
/* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
|
|
3237
|
+
/* @__PURE__ */ jsx19("p", { className: "font-medium text-ph-danger", children: "Something went wrong" }),
|
|
3238
|
+
/* @__PURE__ */ jsx19("p", { className: "mt-0.5 text-ph-subtle", children: error }),
|
|
3239
|
+
/* @__PURE__ */ jsx19(
|
|
3113
3240
|
"button",
|
|
3114
3241
|
{
|
|
3115
3242
|
type: "button",
|
|
3116
3243
|
onClick: retry,
|
|
3117
3244
|
disabled: waiting,
|
|
3118
|
-
className: "
|
|
3245
|
+
className: "ph-btn ph-btn-secondary ph-btn-xs mt-2 gap-1.5",
|
|
3119
3246
|
children: "Try again"
|
|
3120
3247
|
}
|
|
3121
3248
|
)
|
|
@@ -3126,20 +3253,20 @@ function SuiteAiPanel({
|
|
|
3126
3253
|
]
|
|
3127
3254
|
}
|
|
3128
3255
|
),
|
|
3129
|
-
!atBottom ? /* @__PURE__ */
|
|
3256
|
+
!atBottom ? /* @__PURE__ */ jsx19("div", { className: "absolute bottom-3 left-1/2 -translate-x-1/2", children: /* @__PURE__ */ jsx19(Tooltip, { content: "Scroll to latest", children: /* @__PURE__ */ jsx19(
|
|
3130
3257
|
"button",
|
|
3131
3258
|
{
|
|
3132
3259
|
type: "button",
|
|
3133
3260
|
onClick: () => scrollToBottom("smooth"),
|
|
3134
|
-
className: "
|
|
3261
|
+
className: "ph-btn ph-btn-ghost ph-btn-circle h-9 w-9 border border-ph-border bg-ph-surface text-ph-subtle shadow-[var(--ph-shadow-floating)]",
|
|
3135
3262
|
"aria-label": "Scroll to latest",
|
|
3136
|
-
children: /* @__PURE__ */
|
|
3263
|
+
children: /* @__PURE__ */ jsx19(ArrowDown, { className: "h-4 w-4" })
|
|
3137
3264
|
}
|
|
3138
3265
|
) }) }) : null
|
|
3139
3266
|
] }),
|
|
3140
|
-
/* @__PURE__ */
|
|
3141
|
-
/* @__PURE__ */
|
|
3142
|
-
/* @__PURE__ */
|
|
3267
|
+
/* @__PURE__ */ jsx19("div", { className: "px-2 pt-2 pb-[max(2rem,calc(env(safe-area-inset-bottom)+1rem))]", children: /* @__PURE__ */ jsxs15("div", { className: "suite-ai-composer flex items-end gap-1.5 border bg-ph-surface px-1.5 py-1", children: [
|
|
3268
|
+
/* @__PURE__ */ jsx19("label", { htmlFor: inputId, className: "sr-only", children: "Ask a question" }),
|
|
3269
|
+
/* @__PURE__ */ jsx19(
|
|
3143
3270
|
"textarea",
|
|
3144
3271
|
{
|
|
3145
3272
|
id: inputId,
|
|
@@ -3158,26 +3285,26 @@ function SuiteAiPanel({
|
|
|
3158
3285
|
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"
|
|
3159
3286
|
}
|
|
3160
3287
|
),
|
|
3161
|
-
waiting ? /* @__PURE__ */
|
|
3288
|
+
waiting ? /* @__PURE__ */ jsx19(Tooltip, { content: "Stop generating", children: /* @__PURE__ */ jsx19(
|
|
3162
3289
|
"button",
|
|
3163
3290
|
{
|
|
3164
3291
|
type: "button",
|
|
3165
3292
|
onClick: stop,
|
|
3166
3293
|
"data-test": "ask-ai-stop",
|
|
3167
|
-
className: "
|
|
3294
|
+
className: "ph-btn ph-btn-ghost ph-btn-circle h-9 w-9 shrink-0 bg-ph-muted text-ph-ink",
|
|
3168
3295
|
"aria-label": "Stop generating",
|
|
3169
|
-
children: /* @__PURE__ */
|
|
3296
|
+
children: /* @__PURE__ */ jsx19(Square, { className: "h-3.5 w-3.5 fill-current" })
|
|
3170
3297
|
}
|
|
3171
|
-
) }) : /* @__PURE__ */
|
|
3298
|
+
) }) : /* @__PURE__ */ jsx19(Tooltip, { content: "Send message", children: /* @__PURE__ */ jsx19(
|
|
3172
3299
|
"button",
|
|
3173
3300
|
{
|
|
3174
3301
|
type: "button",
|
|
3175
3302
|
onClick: () => void ask(prompt),
|
|
3176
3303
|
disabled: !prompt.trim(),
|
|
3177
3304
|
"data-test": "ask-ai-send",
|
|
3178
|
-
className: "
|
|
3305
|
+
className: "ph-btn ph-btn-primary ph-btn-circle h-9 w-9 shrink-0",
|
|
3179
3306
|
"aria-label": "Send message",
|
|
3180
|
-
children: /* @__PURE__ */
|
|
3307
|
+
children: /* @__PURE__ */ jsx19(ArrowUp, { className: "h-4 w-4" })
|
|
3181
3308
|
}
|
|
3182
3309
|
) })
|
|
3183
3310
|
] }) })
|
|
@@ -3187,9 +3314,9 @@ function SuiteAiPanel({
|
|
|
3187
3314
|
}
|
|
3188
3315
|
|
|
3189
3316
|
// src/suite/components/workspace-switcher.tsx
|
|
3190
|
-
import { useState as
|
|
3317
|
+
import { useState as useState11 } from "react";
|
|
3191
3318
|
import { Building, Check as Check2, NavArrowDown } from "iconoir-react";
|
|
3192
|
-
import { Fragment as Fragment6, jsx as
|
|
3319
|
+
import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3193
3320
|
function SuiteWorkspaceSwitcher({
|
|
3194
3321
|
workspaces = [],
|
|
3195
3322
|
groups,
|
|
@@ -3205,9 +3332,9 @@ function SuiteWorkspaceSwitcher({
|
|
|
3205
3332
|
footer
|
|
3206
3333
|
}) {
|
|
3207
3334
|
var _a2;
|
|
3208
|
-
const [open, setOpen] =
|
|
3335
|
+
const [open, setOpen] = useState11(false);
|
|
3209
3336
|
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 }] : [];
|
|
3210
|
-
return /* @__PURE__ */
|
|
3337
|
+
return /* @__PURE__ */ jsx20(
|
|
3211
3338
|
DropdownMenu2,
|
|
3212
3339
|
{
|
|
3213
3340
|
"aria-label": "Switch workspace",
|
|
@@ -3218,20 +3345,20 @@ function SuiteWorkspaceSwitcher({
|
|
|
3218
3345
|
align: "start",
|
|
3219
3346
|
open,
|
|
3220
3347
|
onOpenChange: setOpen,
|
|
3221
|
-
trigger: /* @__PURE__ */
|
|
3348
|
+
trigger: /* @__PURE__ */ jsxs16(
|
|
3222
3349
|
"span",
|
|
3223
3350
|
{
|
|
3224
3351
|
className: cn2(
|
|
3225
|
-
"flex min-w-0 max-w-full items-center gap-2 rounded-
|
|
3352
|
+
"flex min-w-0 max-w-full items-center gap-2 rounded-[var(--ph-radius-control)] border border-ph-border bg-[var(--ph-surface-inset)] text-left transition-colors hover:bg-[var(--ph-surface-hover)]",
|
|
3226
3353
|
collapsed ? "h-10 w-10 justify-center p-0" : "w-full px-3 py-2",
|
|
3227
|
-
open && "border-ph-
|
|
3354
|
+
open && "border-[var(--ph-selected-border)] bg-[var(--ph-selected-bg)]"
|
|
3228
3355
|
),
|
|
3229
3356
|
"data-test": "workspace-switcher-trigger",
|
|
3230
3357
|
children: [
|
|
3231
|
-
/* @__PURE__ */
|
|
3232
|
-
!collapsed ? /* @__PURE__ */
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ jsx20(Building, { className: "h-4 w-4 shrink-0 text-ph-ink", "aria-hidden": true }),
|
|
3359
|
+
!collapsed ? /* @__PURE__ */ jsxs16(Fragment6, { children: [
|
|
3360
|
+
/* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-ph-ink", children: name }),
|
|
3361
|
+
/* @__PURE__ */ jsx20(
|
|
3235
3362
|
NavArrowDown,
|
|
3236
3363
|
{
|
|
3237
3364
|
className: cn2(
|
|
@@ -3245,16 +3372,16 @@ function SuiteWorkspaceSwitcher({
|
|
|
3245
3372
|
]
|
|
3246
3373
|
}
|
|
3247
3374
|
),
|
|
3248
|
-
children: /* @__PURE__ */
|
|
3375
|
+
children: /* @__PURE__ */ jsxs16(
|
|
3249
3376
|
"div",
|
|
3250
3377
|
{
|
|
3251
3378
|
id: "workspace-switcher-menu",
|
|
3252
3379
|
className: "p-1",
|
|
3253
3380
|
"data-test": "workspace-switcher-menu",
|
|
3254
3381
|
children: [
|
|
3255
|
-
sections.length === 0 ? /* @__PURE__ */
|
|
3256
|
-
/* @__PURE__ */
|
|
3257
|
-
section.workspaces.map((workspace) => /* @__PURE__ */
|
|
3382
|
+
sections.length === 0 ? /* @__PURE__ */ jsx20("p", { className: "px-3 py-2 text-sm text-ph-mutedtext", children: emptyLabel }) : sections.map((section) => /* @__PURE__ */ jsxs16("div", { children: [
|
|
3383
|
+
/* @__PURE__ */ jsx20("p", { className: "px-3 py-2 text-[length:var(--ph-type-overline)] font-semibold uppercase tracking-[0.08em] text-ph-mutedtext", children: section.label }),
|
|
3384
|
+
section.workspaces.map((workspace) => /* @__PURE__ */ jsx20(
|
|
3258
3385
|
DropdownItem2,
|
|
3259
3386
|
{
|
|
3260
3387
|
id: `workspace-option-${workspace.id}`,
|
|
@@ -3267,12 +3394,12 @@ function SuiteWorkspaceSwitcher({
|
|
|
3267
3394
|
onSelect(workspace);
|
|
3268
3395
|
},
|
|
3269
3396
|
className: appSwitcherMenuItemClass(),
|
|
3270
|
-
children: /* @__PURE__ */
|
|
3271
|
-
/* @__PURE__ */
|
|
3272
|
-
/* @__PURE__ */
|
|
3273
|
-
workspace.description ? /* @__PURE__ */
|
|
3397
|
+
children: /* @__PURE__ */ jsxs16("span", { className: "flex min-w-0 w-full items-center gap-3", children: [
|
|
3398
|
+
/* @__PURE__ */ jsxs16("span", { className: "min-w-0 flex-1", children: [
|
|
3399
|
+
/* @__PURE__ */ jsx20("span", { className: "block truncate text-sm font-medium text-ph-ink", children: workspace.name }),
|
|
3400
|
+
workspace.description ? /* @__PURE__ */ jsx20("span", { className: "block truncate text-xs text-ph-mutedtext", children: workspace.description }) : null
|
|
3274
3401
|
] }),
|
|
3275
|
-
workspace.id === currentId ? /* @__PURE__ */
|
|
3402
|
+
workspace.id === currentId ? /* @__PURE__ */ jsx20(
|
|
3276
3403
|
Check2,
|
|
3277
3404
|
{
|
|
3278
3405
|
className: "h-4 w-4 shrink-0 text-ph-brand",
|
|
@@ -3284,7 +3411,7 @@ function SuiteWorkspaceSwitcher({
|
|
|
3284
3411
|
workspace.id
|
|
3285
3412
|
))
|
|
3286
3413
|
] }, section.id)),
|
|
3287
|
-
footer ? /* @__PURE__ */
|
|
3414
|
+
footer ? /* @__PURE__ */ jsx20("div", { className: "mt-1 border-t border-ph-border pt-1", children: footer }) : null
|
|
3288
3415
|
]
|
|
3289
3416
|
}
|
|
3290
3417
|
)
|
|
@@ -3293,7 +3420,7 @@ function SuiteWorkspaceSwitcher({
|
|
|
3293
3420
|
}
|
|
3294
3421
|
|
|
3295
3422
|
// src/suite/icons/suite-icon.tsx
|
|
3296
|
-
import { jsx as
|
|
3423
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3297
3424
|
var TODAY_SUN_STYLE = `
|
|
3298
3425
|
@media (prefers-reduced-motion: no-preference) {
|
|
3299
3426
|
.suite-icon-today-sun-rays {
|
|
@@ -3319,7 +3446,7 @@ function SuiteIcon({
|
|
|
3319
3446
|
const glyph = SUITE_GLYPHS[name];
|
|
3320
3447
|
const accentHex = accent ? APP_ACCENTS[accent].accent : void 0;
|
|
3321
3448
|
const mergedStyle = accentHex ? __spreadProps(__spreadValues({}, style), { "--suite-icon-accent": accentHex }) : style;
|
|
3322
|
-
return /* @__PURE__ */
|
|
3449
|
+
return /* @__PURE__ */ jsxs17(
|
|
3323
3450
|
"svg",
|
|
3324
3451
|
{
|
|
3325
3452
|
width: size,
|
|
@@ -3336,8 +3463,8 @@ function SuiteIcon({
|
|
|
3336
3463
|
"aria-label": label,
|
|
3337
3464
|
"aria-hidden": label ? void 0 : true,
|
|
3338
3465
|
children: [
|
|
3339
|
-
glyph.animatedAccent && animated ? /* @__PURE__ */
|
|
3340
|
-
/* @__PURE__ */
|
|
3466
|
+
glyph.animatedAccent && animated ? /* @__PURE__ */ jsx21("style", { children: TODAY_SUN_STYLE }) : null,
|
|
3467
|
+
/* @__PURE__ */ jsx21(
|
|
3341
3468
|
GlyphParts,
|
|
3342
3469
|
{
|
|
3343
3470
|
elements: glyph.elements,
|
|
@@ -3351,9 +3478,9 @@ function SuiteIcon({
|
|
|
3351
3478
|
|
|
3352
3479
|
// src/suite/lib/use-sidebar-width.ts
|
|
3353
3480
|
import {
|
|
3354
|
-
useCallback as
|
|
3481
|
+
useCallback as useCallback5,
|
|
3355
3482
|
useLayoutEffect as useLayoutEffect2,
|
|
3356
|
-
useState as
|
|
3483
|
+
useState as useState12
|
|
3357
3484
|
} from "react";
|
|
3358
3485
|
var SIDEBAR_RAIL_WIDTH = 56;
|
|
3359
3486
|
var SIDEBAR_COLLAPSE_THRESHOLD = 80;
|
|
@@ -3439,8 +3566,8 @@ function resetSuiteSidebarWidth() {
|
|
|
3439
3566
|
}
|
|
3440
3567
|
function useSidebarWidth(storageKey = SUITE_SIDEBAR_WIDTH_KEY, defaultWidth = SIDEBAR_DEFAULT_WIDTH) {
|
|
3441
3568
|
const fallbackWidth = snapWidth(clampWidth(defaultWidth));
|
|
3442
|
-
const [width, setWidth] =
|
|
3443
|
-
const [narrowViewport, setNarrowViewport] =
|
|
3569
|
+
const [width, setWidth] = useState12(fallbackWidth);
|
|
3570
|
+
const [narrowViewport, setNarrowViewport] = useState12(false);
|
|
3444
3571
|
const collapsed = narrowViewport || width <= SIDEBAR_COLLAPSE_THRESHOLD;
|
|
3445
3572
|
useLayoutEffect2(() => {
|
|
3446
3573
|
const sync = () => {
|
|
@@ -3465,13 +3592,13 @@ function useSidebarWidth(storageKey = SUITE_SIDEBAR_WIDTH_KEY, defaultWidth = SI
|
|
|
3465
3592
|
media.addEventListener("change", sync);
|
|
3466
3593
|
return () => media.removeEventListener("change", sync);
|
|
3467
3594
|
}, []);
|
|
3468
|
-
const persist =
|
|
3595
|
+
const persist = useCallback5(
|
|
3469
3596
|
(value) => {
|
|
3470
3597
|
persistSidebarWidth(storageKey, value);
|
|
3471
3598
|
},
|
|
3472
3599
|
[storageKey]
|
|
3473
3600
|
);
|
|
3474
|
-
const setCollapsed =
|
|
3601
|
+
const setCollapsed = useCallback5(
|
|
3475
3602
|
(value) => {
|
|
3476
3603
|
setWidth((current) => {
|
|
3477
3604
|
const next = value ? SIDEBAR_RAIL_WIDTH : current <= SIDEBAR_COLLAPSE_THRESHOLD ? fallbackWidth : snapWidth(current);
|
|
@@ -3481,11 +3608,11 @@ function useSidebarWidth(storageKey = SUITE_SIDEBAR_WIDTH_KEY, defaultWidth = SI
|
|
|
3481
3608
|
},
|
|
3482
3609
|
[fallbackWidth, persist]
|
|
3483
3610
|
);
|
|
3484
|
-
const resetWidth =
|
|
3611
|
+
const resetWidth = useCallback5(() => {
|
|
3485
3612
|
setWidth(fallbackWidth);
|
|
3486
3613
|
persist(fallbackWidth);
|
|
3487
3614
|
}, [fallbackWidth, persist]);
|
|
3488
|
-
const startResize =
|
|
3615
|
+
const startResize = useCallback5(
|
|
3489
3616
|
(event) => {
|
|
3490
3617
|
event.preventDefault();
|
|
3491
3618
|
const startX = event.clientX;
|
|
@@ -3507,7 +3634,7 @@ function useSidebarWidth(storageKey = SUITE_SIDEBAR_WIDTH_KEY, defaultWidth = SI
|
|
|
3507
3634
|
},
|
|
3508
3635
|
[persist, width]
|
|
3509
3636
|
);
|
|
3510
|
-
const resizeBy =
|
|
3637
|
+
const resizeBy = useCallback5(
|
|
3511
3638
|
(delta) => {
|
|
3512
3639
|
setWidth((current) => {
|
|
3513
3640
|
const next = clampWidth(current + delta);
|
|
@@ -3522,9 +3649,9 @@ function useSidebarWidth(storageKey = SUITE_SIDEBAR_WIDTH_KEY, defaultWidth = SI
|
|
|
3522
3649
|
|
|
3523
3650
|
// src/suite/lib/motion.tsx
|
|
3524
3651
|
import { LazyMotion, domAnimation, m } from "motion/react";
|
|
3525
|
-
import { jsx as
|
|
3652
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3526
3653
|
function SuiteMotionProvider({ children }) {
|
|
3527
|
-
return /* @__PURE__ */
|
|
3654
|
+
return /* @__PURE__ */ jsx22(LazyMotion, { features: domAnimation, strict: true, children });
|
|
3528
3655
|
}
|
|
3529
3656
|
var SUITE_SPRINGS = {
|
|
3530
3657
|
/** Snappy panel/sheet entrances — small overshoot. */
|
|
@@ -3536,24 +3663,24 @@ var SUITE_SPRINGS = {
|
|
|
3536
3663
|
};
|
|
3537
3664
|
|
|
3538
3665
|
// src/suite/components/suite-skeleton.tsx
|
|
3539
|
-
import { jsx as
|
|
3666
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3540
3667
|
function SuiteSkeleton({
|
|
3541
3668
|
className,
|
|
3542
3669
|
lines = 1,
|
|
3543
3670
|
circle,
|
|
3544
3671
|
width
|
|
3545
3672
|
}) {
|
|
3546
|
-
return /* @__PURE__ */
|
|
3673
|
+
return /* @__PURE__ */ jsx23(
|
|
3547
3674
|
"div",
|
|
3548
3675
|
{
|
|
3549
3676
|
className: cn2("space-y-2", circle ? "flex flex-col items-center" : ""),
|
|
3550
3677
|
"aria-hidden": true,
|
|
3551
|
-
children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */
|
|
3678
|
+
children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx23(
|
|
3552
3679
|
"div",
|
|
3553
3680
|
{
|
|
3554
3681
|
className: "animate-[skeleton-stagger_0.6s_ease-out_both]",
|
|
3555
3682
|
style: { animationDelay: `${index * 80}ms` },
|
|
3556
|
-
children: /* @__PURE__ */
|
|
3683
|
+
children: /* @__PURE__ */ jsx23(
|
|
3557
3684
|
"div",
|
|
3558
3685
|
{
|
|
3559
3686
|
className: cn2(
|
|
@@ -3577,35 +3704,35 @@ function SuiteSkeletonCard({
|
|
|
3577
3704
|
rows = 3,
|
|
3578
3705
|
header = true
|
|
3579
3706
|
}) {
|
|
3580
|
-
return /* @__PURE__ */
|
|
3707
|
+
return /* @__PURE__ */ jsxs18(
|
|
3581
3708
|
"div",
|
|
3582
3709
|
{
|
|
3583
3710
|
className: cn2(
|
|
3584
|
-
"ph-skeleton-card animate-[skeleton-stagger_0.5s_ease-out_both] rounded-
|
|
3711
|
+
"ph-skeleton-card animate-[skeleton-stagger_0.5s_ease-out_both] rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface p-6",
|
|
3585
3712
|
className
|
|
3586
3713
|
),
|
|
3587
3714
|
"aria-hidden": true,
|
|
3588
3715
|
children: [
|
|
3589
|
-
header ? /* @__PURE__ */
|
|
3716
|
+
header ? /* @__PURE__ */ jsxs18(
|
|
3590
3717
|
"div",
|
|
3591
3718
|
{
|
|
3592
3719
|
className: "mb-5 flex items-center gap-3 animate-[skeleton-stagger_0.5s_ease-out_both]",
|
|
3593
3720
|
style: { animationDelay: "100ms" },
|
|
3594
3721
|
children: [
|
|
3595
|
-
/* @__PURE__ */
|
|
3596
|
-
/* @__PURE__ */
|
|
3597
|
-
/* @__PURE__ */
|
|
3598
|
-
/* @__PURE__ */
|
|
3722
|
+
/* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-10 w-10 rounded-[var(--ph-radius-control)]" }),
|
|
3723
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex-1 space-y-2", children: [
|
|
3724
|
+
/* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-4 w-1/3" }),
|
|
3725
|
+
/* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-3 w-1/2" })
|
|
3599
3726
|
] })
|
|
3600
3727
|
]
|
|
3601
3728
|
}
|
|
3602
3729
|
) : null,
|
|
3603
|
-
/* @__PURE__ */
|
|
3730
|
+
/* @__PURE__ */ jsx23("div", { className: "space-y-3", children: Array.from({ length: rows }).map((_, index) => /* @__PURE__ */ jsx23(
|
|
3604
3731
|
"div",
|
|
3605
3732
|
{
|
|
3606
3733
|
className: "animate-[skeleton-stagger_0.5s_ease-out_both]",
|
|
3607
3734
|
style: { animationDelay: `${200 + index * 80}ms` },
|
|
3608
|
-
children: /* @__PURE__ */
|
|
3735
|
+
children: /* @__PURE__ */ jsx23(
|
|
3609
3736
|
"div",
|
|
3610
3737
|
{
|
|
3611
3738
|
className: "ph-skeleton h-3",
|
|
@@ -3623,16 +3750,16 @@ function SuiteSkeletonList({
|
|
|
3623
3750
|
className,
|
|
3624
3751
|
items = 4
|
|
3625
3752
|
}) {
|
|
3626
|
-
return /* @__PURE__ */
|
|
3753
|
+
return /* @__PURE__ */ jsx23("div", { className: cn2("space-y-3", className), "aria-hidden": true, children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsx23(
|
|
3627
3754
|
"div",
|
|
3628
3755
|
{
|
|
3629
3756
|
className: "animate-[skeleton-stagger_0.6s_ease-out_both]",
|
|
3630
3757
|
style: { animationDelay: `${index * 100}ms` },
|
|
3631
|
-
children: /* @__PURE__ */
|
|
3632
|
-
/* @__PURE__ */
|
|
3633
|
-
/* @__PURE__ */
|
|
3634
|
-
/* @__PURE__ */
|
|
3635
|
-
/* @__PURE__ */
|
|
3758
|
+
children: /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-3 rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface p-4", children: [
|
|
3759
|
+
/* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-10 w-10 rounded-[var(--ph-radius-control)]" }),
|
|
3760
|
+
/* @__PURE__ */ jsxs18("div", { className: "min-w-0 flex-1 space-y-2", children: [
|
|
3761
|
+
/* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-3.5 w-3/4" }),
|
|
3762
|
+
/* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-3 w-1/2" })
|
|
3636
3763
|
] })
|
|
3637
3764
|
] })
|
|
3638
3765
|
},
|
|
@@ -3647,22 +3774,22 @@ function SuiteEmptyState({
|
|
|
3647
3774
|
className,
|
|
3648
3775
|
size = "md"
|
|
3649
3776
|
}) {
|
|
3650
|
-
return /* @__PURE__ */
|
|
3777
|
+
return /* @__PURE__ */ jsxs18(
|
|
3651
3778
|
"div",
|
|
3652
3779
|
{
|
|
3653
3780
|
className: cn2(
|
|
3654
|
-
"relative overflow-hidden rounded-
|
|
3781
|
+
"relative overflow-hidden rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface text-center",
|
|
3655
3782
|
size === "sm" ? "px-5 py-8" : "px-6 py-12 sm:px-10 sm:py-16",
|
|
3656
3783
|
className
|
|
3657
3784
|
),
|
|
3658
3785
|
children: [
|
|
3659
|
-
/* @__PURE__ */
|
|
3660
|
-
/* @__PURE__ */
|
|
3661
|
-
/* @__PURE__ */
|
|
3786
|
+
/* @__PURE__ */ jsxs18("div", { className: "pointer-events-none absolute inset-0 overflow-hidden opacity-60", "aria-hidden": true, children: [
|
|
3787
|
+
/* @__PURE__ */ jsx23("div", { className: "absolute -left-10 -top-10 h-40 w-40 rounded-full bg-ph-brand/10 blur-3xl" }),
|
|
3788
|
+
/* @__PURE__ */ jsx23("div", { className: "absolute -bottom-10 -right-10 h-40 w-40 rounded-full bg-ph-accent/10 blur-3xl" })
|
|
3662
3789
|
] }),
|
|
3663
|
-
/* @__PURE__ */
|
|
3664
|
-
icon ? /* @__PURE__ */
|
|
3665
|
-
/* @__PURE__ */
|
|
3790
|
+
/* @__PURE__ */ jsxs18("div", { className: "relative", children: [
|
|
3791
|
+
icon ? /* @__PURE__ */ jsx23("div", { className: "mx-auto mb-4 inline-flex items-center justify-center rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-muted p-3 shadow-[var(--ph-shadow-control)]", children: icon }) : null,
|
|
3792
|
+
/* @__PURE__ */ jsx23(
|
|
3666
3793
|
"h2",
|
|
3667
3794
|
{
|
|
3668
3795
|
className: cn2(
|
|
@@ -3672,8 +3799,8 @@ function SuiteEmptyState({
|
|
|
3672
3799
|
children: title
|
|
3673
3800
|
}
|
|
3674
3801
|
),
|
|
3675
|
-
description ? /* @__PURE__ */
|
|
3676
|
-
action ? /* @__PURE__ */
|
|
3802
|
+
description ? /* @__PURE__ */ jsx23("p", { className: "mx-auto mt-2 max-w-sm text-sm leading-relaxed text-ph-subtle", children: description }) : null,
|
|
3803
|
+
action ? /* @__PURE__ */ jsx23("div", { className: "mt-5 flex flex-wrap items-center justify-center gap-2", children: action }) : null
|
|
3677
3804
|
] })
|
|
3678
3805
|
]
|
|
3679
3806
|
}
|
|
@@ -3682,7 +3809,7 @@ function SuiteEmptyState({
|
|
|
3682
3809
|
|
|
3683
3810
|
// src/suite/components/suite-settings-mobile-nav.tsx
|
|
3684
3811
|
import { isValidElement } from "react";
|
|
3685
|
-
import { jsx as
|
|
3812
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3686
3813
|
function SuiteSettingsMobileNav({
|
|
3687
3814
|
items,
|
|
3688
3815
|
activeHref,
|
|
@@ -3691,26 +3818,26 @@ function SuiteSettingsMobileNav({
|
|
|
3691
3818
|
ariaLabel = "Settings sections",
|
|
3692
3819
|
className
|
|
3693
3820
|
}) {
|
|
3694
|
-
return /* @__PURE__ */
|
|
3821
|
+
return /* @__PURE__ */ jsx24(
|
|
3695
3822
|
"nav",
|
|
3696
3823
|
{
|
|
3697
3824
|
"data-test": dataTest,
|
|
3698
3825
|
"aria-label": ariaLabel,
|
|
3699
3826
|
className: cn2("suite-settings-mobile-nav lg:hidden", className),
|
|
3700
|
-
children: /* @__PURE__ */
|
|
3827
|
+
children: /* @__PURE__ */ jsx24("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) => {
|
|
3701
3828
|
const Icon = item.icon;
|
|
3702
3829
|
const active = activeHref === item.href || activeHref.startsWith(`${item.href}/`);
|
|
3703
|
-
const iconNode = isValidElement(item.icon) ? item.icon : /* @__PURE__ */
|
|
3830
|
+
const iconNode = isValidElement(item.icon) ? item.icon : /* @__PURE__ */ jsx24(
|
|
3704
3831
|
Icon,
|
|
3705
3832
|
{
|
|
3706
3833
|
className: cn2(
|
|
3707
|
-
"h-4 w-4 shrink-0 transition",
|
|
3708
|
-
active ? "text-ph-
|
|
3834
|
+
"h-4 w-4 shrink-0 transition-colors",
|
|
3835
|
+
active ? "text-[var(--ph-selected-text)]" : "text-ph-mutedtext"
|
|
3709
3836
|
),
|
|
3710
3837
|
"aria-hidden": true
|
|
3711
3838
|
}
|
|
3712
3839
|
);
|
|
3713
|
-
return /* @__PURE__ */
|
|
3840
|
+
return /* @__PURE__ */ jsxs19(
|
|
3714
3841
|
"button",
|
|
3715
3842
|
{
|
|
3716
3843
|
type: "button",
|
|
@@ -3719,14 +3846,12 @@ function SuiteSettingsMobileNav({
|
|
|
3719
3846
|
onClick: () => onSelect(item.href),
|
|
3720
3847
|
"aria-current": active ? "page" : void 0,
|
|
3721
3848
|
className: cn2(
|
|
3722
|
-
"group relative flex shrink-0 snap-start items-center gap-2 rounded-
|
|
3723
|
-
"
|
|
3724
|
-
active ? "bg-ph-ink text-ph-surface shadow-sm" : "bg-ph-surface text-ph-subtle ring-1 ring-ph-border hover:bg-ph-muted hover:text-ph-ink"
|
|
3849
|
+
"group relative flex min-h-[44px] shrink-0 snap-start items-center gap-2 rounded-[var(--ph-radius-control)] border px-3.5 py-2.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)]",
|
|
3850
|
+
active ? "border-[var(--ph-selected-border)] bg-[var(--ph-selected-bg)] text-[var(--ph-selected-text)]" : "border-ph-border bg-ph-surface text-ph-subtle hover:bg-[var(--ph-surface-hover)] hover:text-ph-ink"
|
|
3725
3851
|
),
|
|
3726
3852
|
children: [
|
|
3727
3853
|
iconNode,
|
|
3728
|
-
/* @__PURE__ */
|
|
3729
|
-
active ? /* @__PURE__ */ jsx23("span", { className: "absolute inset-x-0 -bottom-3 h-0.5 rounded-full bg-ph-ink lg:hidden" }) : null
|
|
3854
|
+
/* @__PURE__ */ jsx24("span", { className: "whitespace-nowrap", children: item.label })
|
|
3730
3855
|
]
|
|
3731
3856
|
},
|
|
3732
3857
|
item.href
|
|
@@ -3738,9 +3863,9 @@ function SuiteSettingsMobileNav({
|
|
|
3738
3863
|
|
|
3739
3864
|
// src/suite/components/suite-sidebar.tsx
|
|
3740
3865
|
import Link2 from "next/link";
|
|
3741
|
-
import { useCallback as
|
|
3866
|
+
import { useCallback as useCallback6, useEffect as useEffect9, useRef as useRef4 } from "react";
|
|
3742
3867
|
import { NavArrowLeft, Sparks as Sparks2 } from "iconoir-react";
|
|
3743
|
-
import { Fragment as Fragment7, jsx as
|
|
3868
|
+
import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3744
3869
|
function renderNode(node, collapsed) {
|
|
3745
3870
|
if (typeof node === "function") return node(collapsed);
|
|
3746
3871
|
return node;
|
|
@@ -3763,14 +3888,17 @@ function SuiteSidebar({
|
|
|
3763
3888
|
}) {
|
|
3764
3889
|
const showAskAi = Boolean(onAskAiOpenChange && askAi);
|
|
3765
3890
|
const chatOpen = showAskAi && askAiOpen && !collapsed;
|
|
3766
|
-
const
|
|
3891
|
+
const askAiButtonRef = useRef4(null);
|
|
3892
|
+
const askAiBackRef = useRef4(null);
|
|
3893
|
+
const restoreAskAiFocusRef = useRef4(false);
|
|
3894
|
+
const setAskAi = useCallback6(
|
|
3767
3895
|
(next) => {
|
|
3768
3896
|
persistSuiteAskAiOpen(next);
|
|
3769
3897
|
onAskAiOpenChange == null ? void 0 : onAskAiOpenChange(next);
|
|
3770
3898
|
},
|
|
3771
3899
|
[onAskAiOpenChange]
|
|
3772
3900
|
);
|
|
3773
|
-
|
|
3901
|
+
useEffect9(() => {
|
|
3774
3902
|
if (!onAskAiOpenChange) return;
|
|
3775
3903
|
function onOpen() {
|
|
3776
3904
|
onRequestExpand == null ? void 0 : onRequestExpand();
|
|
@@ -3779,49 +3907,69 @@ function SuiteSidebar({
|
|
|
3779
3907
|
window.addEventListener(SUITE_OPEN_ASK_AI_EVENT, onOpen);
|
|
3780
3908
|
return () => window.removeEventListener(SUITE_OPEN_ASK_AI_EVENT, onOpen);
|
|
3781
3909
|
}, [onAskAiOpenChange, onRequestExpand, setAskAi]);
|
|
3782
|
-
|
|
3910
|
+
useEffect9(() => {
|
|
3783
3911
|
if (!chatOpen) return;
|
|
3784
3912
|
function onKey(event) {
|
|
3785
|
-
if (event.key === "Escape")
|
|
3913
|
+
if (event.key === "Escape") {
|
|
3914
|
+
restoreAskAiFocusRef.current = true;
|
|
3915
|
+
setAskAi(false);
|
|
3916
|
+
}
|
|
3786
3917
|
}
|
|
3787
3918
|
window.addEventListener("keydown", onKey);
|
|
3788
3919
|
return () => window.removeEventListener("keydown", onKey);
|
|
3789
3920
|
}, [chatOpen, setAskAi]);
|
|
3921
|
+
useEffect9(() => {
|
|
3922
|
+
const frame = requestAnimationFrame(() => {
|
|
3923
|
+
var _a2, _b;
|
|
3924
|
+
if (chatOpen) {
|
|
3925
|
+
(_a2 = askAiBackRef.current) == null ? void 0 : _a2.focus();
|
|
3926
|
+
} else if (restoreAskAiFocusRef.current) {
|
|
3927
|
+
restoreAskAiFocusRef.current = false;
|
|
3928
|
+
(_b = askAiButtonRef.current) == null ? void 0 : _b.focus();
|
|
3929
|
+
}
|
|
3930
|
+
});
|
|
3931
|
+
return () => cancelAnimationFrame(frame);
|
|
3932
|
+
}, [chatOpen]);
|
|
3933
|
+
function closeAskAi() {
|
|
3934
|
+
restoreAskAiFocusRef.current = true;
|
|
3935
|
+
setAskAi(false);
|
|
3936
|
+
}
|
|
3790
3937
|
function toggleAskAi() {
|
|
3791
3938
|
if (askAiOpen) {
|
|
3792
|
-
|
|
3939
|
+
closeAskAi();
|
|
3793
3940
|
return;
|
|
3794
3941
|
}
|
|
3795
3942
|
if (collapsed) onRequestExpand == null ? void 0 : onRequestExpand();
|
|
3796
3943
|
setAskAi(true);
|
|
3797
3944
|
}
|
|
3798
|
-
const askAiButton = /* @__PURE__ */
|
|
3945
|
+
const askAiButton = /* @__PURE__ */ jsx25(
|
|
3799
3946
|
"button",
|
|
3800
3947
|
{
|
|
3948
|
+
ref: askAiButtonRef,
|
|
3801
3949
|
type: "button",
|
|
3802
3950
|
"data-test": "suite-ask-ai-toggle",
|
|
3803
3951
|
"aria-pressed": askAiOpen,
|
|
3804
3952
|
"aria-label": askAiOpen ? "Back to navigation" : "Shelly AI",
|
|
3805
3953
|
onClick: toggleAskAi,
|
|
3806
3954
|
className: cn2(
|
|
3807
|
-
"
|
|
3955
|
+
"ph-btn ph-btn-ghost ph-btn-square h-10 w-10 shrink-0",
|
|
3808
3956
|
askAiOpen ? "bg-ph-brand/10 text-ph-brand" : "text-ph-mutedtext hover:bg-ph-muted hover:text-ph-ink"
|
|
3809
3957
|
),
|
|
3810
|
-
children: /* @__PURE__ */
|
|
3958
|
+
children: /* @__PURE__ */ jsx25(Sparks2, { className: "h-4 w-4", "aria-hidden": true })
|
|
3811
3959
|
}
|
|
3812
3960
|
);
|
|
3813
3961
|
if (chatOpen) {
|
|
3814
|
-
return /* @__PURE__ */
|
|
3962
|
+
return /* @__PURE__ */ jsxs20(
|
|
3815
3963
|
"div",
|
|
3816
3964
|
{
|
|
3817
3965
|
"data-suite-chat-open": "",
|
|
3966
|
+
"data-surface": surface ? "true" : "false",
|
|
3818
3967
|
className: cn2(
|
|
3819
|
-
"flex h-full w-full min-w-0 flex-col text-ph-ink",
|
|
3820
|
-
surface ? "bg-ph-surface" : "bg-ph-canvas",
|
|
3968
|
+
"suite-sidebar flex h-full w-full min-w-0 flex-col text-ph-ink",
|
|
3821
3969
|
className
|
|
3822
3970
|
),
|
|
3823
3971
|
children: [
|
|
3824
|
-
/* @__PURE__ */
|
|
3972
|
+
/* @__PURE__ */ jsxs20(
|
|
3825
3973
|
"div",
|
|
3826
3974
|
{
|
|
3827
3975
|
className: cn2(
|
|
@@ -3829,60 +3977,59 @@ function SuiteSidebar({
|
|
|
3829
3977
|
surface ? "bg-ph-surface" : "bg-ph-canvas"
|
|
3830
3978
|
),
|
|
3831
3979
|
children: [
|
|
3832
|
-
/* @__PURE__ */
|
|
3980
|
+
/* @__PURE__ */ jsx25(
|
|
3833
3981
|
"button",
|
|
3834
3982
|
{
|
|
3983
|
+
ref: askAiBackRef,
|
|
3835
3984
|
type: "button",
|
|
3836
3985
|
"data-test": "suite-ask-ai-back",
|
|
3837
3986
|
"aria-label": "Back to navigation",
|
|
3838
|
-
onClick:
|
|
3839
|
-
className: "
|
|
3840
|
-
children: /* @__PURE__ */
|
|
3987
|
+
onClick: closeAskAi,
|
|
3988
|
+
className: "ph-btn ph-btn-ghost ph-btn-square h-10 w-10 shrink-0 text-ph-subtle",
|
|
3989
|
+
children: /* @__PURE__ */ jsx25(NavArrowLeft, { className: "h-4 w-4", "aria-hidden": true })
|
|
3841
3990
|
}
|
|
3842
3991
|
),
|
|
3843
|
-
/* @__PURE__ */
|
|
3992
|
+
/* @__PURE__ */ jsx25("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-ph-ink", children: "Shelly AI" })
|
|
3844
3993
|
]
|
|
3845
3994
|
}
|
|
3846
3995
|
),
|
|
3847
|
-
/* @__PURE__ */
|
|
3996
|
+
/* @__PURE__ */ jsx25("div", { className: "min-h-0 flex-1", children: askAi })
|
|
3848
3997
|
]
|
|
3849
3998
|
}
|
|
3850
3999
|
);
|
|
3851
4000
|
}
|
|
3852
|
-
return /* @__PURE__ */
|
|
4001
|
+
return /* @__PURE__ */ jsxs20(
|
|
3853
4002
|
"div",
|
|
3854
4003
|
{
|
|
4004
|
+
"data-surface": surface ? "true" : "false",
|
|
3855
4005
|
className: cn2(
|
|
3856
|
-
"flex h-full w-full min-w-0 flex-col text-ph-ink",
|
|
3857
|
-
surface ? "bg-ph-surface" : "bg-ph-canvas",
|
|
4006
|
+
"suite-sidebar flex h-full w-full min-w-0 flex-col text-ph-ink",
|
|
3858
4007
|
className
|
|
3859
4008
|
),
|
|
3860
4009
|
children: [
|
|
3861
|
-
appSwitcher || notificationBell ? /* @__PURE__ */
|
|
4010
|
+
appSwitcher || notificationBell ? /* @__PURE__ */ jsxs20(
|
|
3862
4011
|
"div",
|
|
3863
4012
|
{
|
|
3864
4013
|
className: cn2(
|
|
3865
4014
|
"flex shrink-0 border-b border-ph-border",
|
|
3866
|
-
surface ? "bg-ph-surface" : "bg-ph-canvas",
|
|
3867
4015
|
collapsed ? "flex-col items-center gap-1 px-1 py-2" : "h-14 items-center justify-between gap-2 px-3"
|
|
3868
4016
|
),
|
|
3869
4017
|
children: [
|
|
3870
|
-
/* @__PURE__ */
|
|
3871
|
-
collapsed ? null : /* @__PURE__ */
|
|
4018
|
+
/* @__PURE__ */ jsx25("div", { className: cn2("min-w-0", collapsed ? "shrink-0" : "flex-1"), children: renderNode(appSwitcher, collapsed) }),
|
|
4019
|
+
collapsed ? null : /* @__PURE__ */ jsx25("div", { className: "shrink-0", children: renderNode(notificationBell, collapsed) })
|
|
3872
4020
|
]
|
|
3873
4021
|
}
|
|
3874
4022
|
) : null,
|
|
3875
|
-
/* @__PURE__ */
|
|
4023
|
+
/* @__PURE__ */ jsxs20(
|
|
3876
4024
|
"div",
|
|
3877
4025
|
{
|
|
3878
4026
|
className: cn2(
|
|
3879
4027
|
"flex min-h-0 flex-1 flex-col",
|
|
3880
|
-
surface ? "bg-ph-surface" : "bg-ph-canvas",
|
|
3881
4028
|
chatOpen ? "min-h-0" : "overflow-y-auto",
|
|
3882
4029
|
collapsed ? "px-1.5 py-2" : "p-3"
|
|
3883
4030
|
),
|
|
3884
4031
|
children: [
|
|
3885
|
-
contextSwitcher ? /* @__PURE__ */
|
|
4032
|
+
contextSwitcher ? /* @__PURE__ */ jsx25(
|
|
3886
4033
|
"div",
|
|
3887
4034
|
{
|
|
3888
4035
|
className: cn2(
|
|
@@ -3892,30 +4039,30 @@ function SuiteSidebar({
|
|
|
3892
4039
|
children: renderNode(contextSwitcher, collapsed)
|
|
3893
4040
|
}
|
|
3894
4041
|
) : null,
|
|
3895
|
-
chatOpen ? /* @__PURE__ */
|
|
3896
|
-
/* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
4042
|
+
chatOpen ? /* @__PURE__ */ jsxs20("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
4043
|
+
/* @__PURE__ */ jsxs20("div", { className: "mb-2 flex shrink-0 items-center gap-1", children: [
|
|
4044
|
+
/* @__PURE__ */ jsxs20(
|
|
3898
4045
|
"button",
|
|
3899
4046
|
{
|
|
3900
4047
|
type: "button",
|
|
3901
4048
|
"data-test": "suite-ask-ai-back",
|
|
3902
|
-
onClick:
|
|
3903
|
-
className: "
|
|
4049
|
+
onClick: closeAskAi,
|
|
4050
|
+
className: "ph-btn ph-btn-ghost ph-btn-sm h-9 text-ph-subtle",
|
|
3904
4051
|
children: [
|
|
3905
|
-
/* @__PURE__ */
|
|
4052
|
+
/* @__PURE__ */ jsx25(NavArrowLeft, { className: "h-4 w-4", "aria-hidden": true }),
|
|
3906
4053
|
"Nav"
|
|
3907
4054
|
]
|
|
3908
4055
|
}
|
|
3909
4056
|
),
|
|
3910
|
-
/* @__PURE__ */
|
|
4057
|
+
/* @__PURE__ */ jsx25("span", { className: "truncate text-sm font-semibold text-ph-ink", children: "Shelly AI" })
|
|
3911
4058
|
] }),
|
|
3912
|
-
/* @__PURE__ */
|
|
3913
|
-
] }) : /* @__PURE__ */
|
|
3914
|
-
/* @__PURE__ */
|
|
4059
|
+
/* @__PURE__ */ jsx25("div", { className: "min-h-0 flex-1", children: askAi })
|
|
4060
|
+
] }) : /* @__PURE__ */ jsxs20(Fragment7, { children: [
|
|
4061
|
+
/* @__PURE__ */ jsx25("nav", { "aria-label": "Pages", className: "shrink-0 space-y-1", children: /* @__PURE__ */ jsx25("div", { className: "space-y-1", children: navItems.map((item) => {
|
|
3915
4062
|
var _a2;
|
|
3916
4063
|
const Icon = item.icon;
|
|
3917
4064
|
const active = Boolean(item.active);
|
|
3918
|
-
const link = /* @__PURE__ */
|
|
4065
|
+
const link = /* @__PURE__ */ jsxs20(
|
|
3919
4066
|
Link2,
|
|
3920
4067
|
{
|
|
3921
4068
|
href: item.href,
|
|
@@ -3924,12 +4071,12 @@ function SuiteSidebar({
|
|
|
3924
4071
|
"aria-current": active ? "page" : void 0,
|
|
3925
4072
|
onClick: item.onClick,
|
|
3926
4073
|
className: cn2(
|
|
3927
|
-
"group relative flex min-h-11 touch-manipulation items-center gap-2.5 rounded-[var(--ph-radius-
|
|
3928
|
-
active ? "bg-ph-
|
|
4074
|
+
"group relative flex min-h-11 touch-manipulation items-center gap-2.5 rounded-[var(--ph-radius-control)] text-sm font-medium transition-colors focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)]",
|
|
4075
|
+
active ? "bg-[var(--ph-selected-bg)] text-[var(--ph-selected-text)] shadow-[inset_0_0_0_1px_var(--ph-selected-border)]" : "text-ph-subtle hover:bg-[var(--ph-surface-hover)] hover:text-ph-ink",
|
|
3929
4076
|
collapsed ? "mx-auto size-11 shrink-0 justify-center gap-0 px-0 py-0" : "w-full px-2.5 py-2"
|
|
3930
4077
|
),
|
|
3931
4078
|
children: [
|
|
3932
|
-
/* @__PURE__ */
|
|
4079
|
+
/* @__PURE__ */ jsx25(
|
|
3933
4080
|
"span",
|
|
3934
4081
|
{
|
|
3935
4082
|
className: cn2(
|
|
@@ -3937,7 +4084,7 @@ function SuiteSidebar({
|
|
|
3937
4084
|
item.iconClassName
|
|
3938
4085
|
),
|
|
3939
4086
|
"aria-hidden": true,
|
|
3940
|
-
children: /* @__PURE__ */
|
|
4087
|
+
children: /* @__PURE__ */ jsx25(
|
|
3941
4088
|
Icon,
|
|
3942
4089
|
{
|
|
3943
4090
|
className: "h-full w-full",
|
|
@@ -3946,25 +4093,25 @@ function SuiteSidebar({
|
|
|
3946
4093
|
)
|
|
3947
4094
|
}
|
|
3948
4095
|
),
|
|
3949
|
-
/* @__PURE__ */
|
|
4096
|
+
/* @__PURE__ */ jsx25(
|
|
3950
4097
|
"span",
|
|
3951
4098
|
{
|
|
3952
4099
|
className: cn2(
|
|
3953
4100
|
"relative truncate",
|
|
3954
|
-
active ? "text-ph-
|
|
4101
|
+
active ? "text-[var(--ph-selected-text)]" : "text-ph-subtle group-hover:text-ph-ink",
|
|
3955
4102
|
collapsed && "sr-only"
|
|
3956
4103
|
),
|
|
3957
4104
|
children: item.label
|
|
3958
4105
|
}
|
|
3959
4106
|
),
|
|
3960
|
-
!collapsed && item.badge ? /* @__PURE__ */
|
|
4107
|
+
!collapsed && item.badge ? /* @__PURE__ */ jsx25("span", { className: "relative ml-auto shrink-0", children: item.badge }) : null
|
|
3961
4108
|
]
|
|
3962
4109
|
},
|
|
3963
4110
|
item.label
|
|
3964
4111
|
);
|
|
3965
|
-
return collapsed ? /* @__PURE__ */
|
|
4112
|
+
return collapsed ? /* @__PURE__ */ jsx25(Tooltip, { content: item.label, side: "right", children: link }, item.label) : link;
|
|
3966
4113
|
}) }) }),
|
|
3967
|
-
secondaryNav ? /* @__PURE__ */
|
|
4114
|
+
secondaryNav ? /* @__PURE__ */ jsx25(
|
|
3968
4115
|
"div",
|
|
3969
4116
|
{
|
|
3970
4117
|
className: "min-h-0 flex-1",
|
|
@@ -3976,15 +4123,14 @@ function SuiteSidebar({
|
|
|
3976
4123
|
]
|
|
3977
4124
|
}
|
|
3978
4125
|
),
|
|
3979
|
-
/* @__PURE__ */
|
|
4126
|
+
/* @__PURE__ */ jsx25(
|
|
3980
4127
|
"div",
|
|
3981
4128
|
{
|
|
3982
4129
|
className: cn2(
|
|
3983
4130
|
"shrink-0 border-t border-ph-border",
|
|
3984
|
-
surface ? "bg-ph-surface" : "bg-ph-canvas",
|
|
3985
4131
|
collapsed ? "p-1.5" : "p-3"
|
|
3986
4132
|
),
|
|
3987
|
-
children: /* @__PURE__ */
|
|
4133
|
+
children: /* @__PURE__ */ jsxs20(
|
|
3988
4134
|
"div",
|
|
3989
4135
|
{
|
|
3990
4136
|
className: cn2(
|
|
@@ -3993,8 +4139,8 @@ function SuiteSidebar({
|
|
|
3993
4139
|
),
|
|
3994
4140
|
children: [
|
|
3995
4141
|
renderNode(userMenu, collapsed),
|
|
3996
|
-
showAskAi ? /* @__PURE__ */
|
|
3997
|
-
showAskAi && footerExtras ? /* @__PURE__ */
|
|
4142
|
+
showAskAi ? /* @__PURE__ */ jsx25("div", { className: cn2("shrink-0", collapsed ? "mt-2" : "ml-auto"), children: /* @__PURE__ */ jsx25(Tooltip, { content: "Shelly AI", side: collapsed ? "right" : "top", children: askAiButton }) }) : footerExtras ? /* @__PURE__ */ jsx25("div", { className: cn2("shrink-0", collapsed ? "mt-2" : "ml-auto"), children: renderNode(footerExtras, collapsed) }) : null,
|
|
4143
|
+
showAskAi && footerExtras ? /* @__PURE__ */ jsx25("div", { className: cn2("shrink-0", collapsed && "mt-2"), children: renderNode(footerExtras, collapsed) }) : null
|
|
3998
4144
|
]
|
|
3999
4145
|
}
|
|
4000
4146
|
)
|
|
@@ -4006,7 +4152,7 @@ function SuiteSidebar({
|
|
|
4006
4152
|
}
|
|
4007
4153
|
|
|
4008
4154
|
// src/suite/components/suite-app-layout.tsx
|
|
4009
|
-
import { jsx as
|
|
4155
|
+
import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4010
4156
|
function SuiteAppLayout({
|
|
4011
4157
|
sidebar,
|
|
4012
4158
|
children,
|
|
@@ -4020,7 +4166,7 @@ function SuiteAppLayout({
|
|
|
4020
4166
|
onResetWidth,
|
|
4021
4167
|
className
|
|
4022
4168
|
}) {
|
|
4023
|
-
return /* @__PURE__ */
|
|
4169
|
+
return /* @__PURE__ */ jsxs21(
|
|
4024
4170
|
"div",
|
|
4025
4171
|
{
|
|
4026
4172
|
"data-test": "app-shell",
|
|
@@ -4029,16 +4175,16 @@ function SuiteAppLayout({
|
|
|
4029
4175
|
className
|
|
4030
4176
|
),
|
|
4031
4177
|
children: [
|
|
4032
|
-
/* @__PURE__ */
|
|
4178
|
+
/* @__PURE__ */ jsxs21(
|
|
4033
4179
|
"aside",
|
|
4034
4180
|
{
|
|
4035
4181
|
"aria-label": "Sidebar",
|
|
4036
|
-
className: "relative hidden shrink-0 flex-col overflow-visible border-r
|
|
4182
|
+
className: "suite-app-layout__sidebar relative hidden shrink-0 flex-col overflow-visible border-r ease-out lg:flex",
|
|
4037
4183
|
style: { width: `${sidebarWidth}px` },
|
|
4038
4184
|
"data-collapsed": collapsed ? "true" : "false",
|
|
4039
4185
|
children: [
|
|
4040
|
-
/* @__PURE__ */
|
|
4041
|
-
onStartResize ? /* @__PURE__ */
|
|
4186
|
+
/* @__PURE__ */ jsx26("div", { className: "relative z-0 h-full min-h-0 isolate", children: sidebar }),
|
|
4187
|
+
onStartResize ? /* @__PURE__ */ jsx26(
|
|
4042
4188
|
"div",
|
|
4043
4189
|
{
|
|
4044
4190
|
role: "separator",
|
|
@@ -4055,7 +4201,10 @@ function SuiteAppLayout({
|
|
|
4055
4201
|
onKeyDown: (event) => {
|
|
4056
4202
|
if (event.key === "Home") {
|
|
4057
4203
|
event.preventDefault();
|
|
4058
|
-
|
|
4204
|
+
onResizeBy == null ? void 0 : onResizeBy(SIDEBAR_RAIL_WIDTH - sidebarWidth);
|
|
4205
|
+
} else if (event.key === "End") {
|
|
4206
|
+
event.preventDefault();
|
|
4207
|
+
onResizeBy == null ? void 0 : onResizeBy(SIDEBAR_MAX_WIDTH - sidebarWidth);
|
|
4059
4208
|
} else if (event.key === "ArrowLeft") {
|
|
4060
4209
|
event.preventDefault();
|
|
4061
4210
|
onResizeBy == null ? void 0 : onResizeBy(-16);
|
|
@@ -4064,29 +4213,29 @@ function SuiteAppLayout({
|
|
|
4064
4213
|
onResizeBy == null ? void 0 : onResizeBy(16);
|
|
4065
4214
|
}
|
|
4066
4215
|
},
|
|
4067
|
-
className: "absolute inset-y-0 right-0 z-20 w-2 cursor-col-resize touch-none
|
|
4216
|
+
className: "suite-sidebar-resize-handle absolute inset-y-0 right-0 z-20 w-2 cursor-col-resize touch-none before:absolute before:-left-2 before:-right-2 before:inset-y-0 before:content-['']"
|
|
4068
4217
|
}
|
|
4069
4218
|
) : null
|
|
4070
4219
|
]
|
|
4071
4220
|
}
|
|
4072
4221
|
),
|
|
4073
|
-
/* @__PURE__ */
|
|
4074
|
-
mobileHeader ? /* @__PURE__ */
|
|
4075
|
-
/* @__PURE__ */
|
|
4222
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
4223
|
+
mobileHeader ? /* @__PURE__ */ jsx26("div", { className: "shrink-0 lg:hidden", children: mobileHeader }) : null,
|
|
4224
|
+
/* @__PURE__ */ jsx26(
|
|
4076
4225
|
"main",
|
|
4077
4226
|
{
|
|
4078
4227
|
id: "main-content",
|
|
4079
4228
|
tabIndex: 0,
|
|
4080
4229
|
"data-lock-scroll": lockMainScroll ? "true" : void 0,
|
|
4081
4230
|
className: cn2(
|
|
4082
|
-
"flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden overscroll-contain bg-ph-canvas focus:outline-none
|
|
4231
|
+
"flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden overscroll-contain bg-ph-canvas focus:outline-none",
|
|
4083
4232
|
"suite-app-layout__main",
|
|
4084
4233
|
lockMainScroll ? "overflow-hidden" : "overflow-y-auto"
|
|
4085
4234
|
),
|
|
4086
4235
|
children
|
|
4087
4236
|
}
|
|
4088
4237
|
),
|
|
4089
|
-
bottomNav ? /* @__PURE__ */
|
|
4238
|
+
bottomNav ? /* @__PURE__ */ jsx26("div", { className: "shrink-0 lg:hidden", children: bottomNav }) : null
|
|
4090
4239
|
] })
|
|
4091
4240
|
]
|
|
4092
4241
|
}
|
|
@@ -4095,10 +4244,10 @@ function SuiteAppLayout({
|
|
|
4095
4244
|
|
|
4096
4245
|
// src/suite/components/suite-integration-picker.tsx
|
|
4097
4246
|
import {
|
|
4098
|
-
useEffect as
|
|
4247
|
+
useEffect as useEffect10,
|
|
4099
4248
|
useMemo as useMemo3,
|
|
4100
|
-
useRef as
|
|
4101
|
-
useState as
|
|
4249
|
+
useRef as useRef5,
|
|
4250
|
+
useState as useState13
|
|
4102
4251
|
} from "react";
|
|
4103
4252
|
import {
|
|
4104
4253
|
Bridge3d,
|
|
@@ -4109,24 +4258,24 @@ import {
|
|
|
4109
4258
|
Search,
|
|
4110
4259
|
Xmark
|
|
4111
4260
|
} from "iconoir-react";
|
|
4112
|
-
import { Fragment as Fragment8, jsx as
|
|
4261
|
+
import { Fragment as Fragment8, jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4113
4262
|
var DESCRIPTION_LIMIT = 90;
|
|
4114
4263
|
function IntegrationSkeletonCard() {
|
|
4115
|
-
return /* @__PURE__ */
|
|
4264
|
+
return /* @__PURE__ */ jsxs22(
|
|
4116
4265
|
"div",
|
|
4117
4266
|
{
|
|
4118
|
-
className: "flex min-h-36 min-w-0 animate-pulse flex-col justify-between rounded-
|
|
4267
|
+
className: "flex min-h-36 min-w-0 animate-pulse flex-col justify-between rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface p-4",
|
|
4119
4268
|
"aria-hidden": "true",
|
|
4120
4269
|
children: [
|
|
4121
|
-
/* @__PURE__ */
|
|
4122
|
-
/* @__PURE__ */
|
|
4123
|
-
/* @__PURE__ */
|
|
4124
|
-
/* @__PURE__ */
|
|
4125
|
-
/* @__PURE__ */
|
|
4126
|
-
/* @__PURE__ */
|
|
4270
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-start gap-3", children: [
|
|
4271
|
+
/* @__PURE__ */ jsx27("div", { className: "h-8 w-8 shrink-0 rounded-md bg-ph-muted" }),
|
|
4272
|
+
/* @__PURE__ */ jsxs22("div", { className: "min-w-0 flex-1 space-y-2 pt-1", children: [
|
|
4273
|
+
/* @__PURE__ */ jsx27("div", { className: "h-4 w-3/5 rounded bg-ph-muted" }),
|
|
4274
|
+
/* @__PURE__ */ jsx27("div", { className: "h-3 w-full rounded bg-ph-muted" }),
|
|
4275
|
+
/* @__PURE__ */ jsx27("div", { className: "h-3 w-4/5 rounded bg-ph-muted" })
|
|
4127
4276
|
] })
|
|
4128
4277
|
] }),
|
|
4129
|
-
/* @__PURE__ */
|
|
4278
|
+
/* @__PURE__ */ jsx27("div", { className: "mt-3 h-9 w-20 rounded bg-ph-muted" })
|
|
4130
4279
|
]
|
|
4131
4280
|
}
|
|
4132
4281
|
);
|
|
@@ -4188,34 +4337,34 @@ function SuiteIntegrationPicker({
|
|
|
4188
4337
|
description = "Connect an app to this workspace securely.",
|
|
4189
4338
|
dataTest = "suite-integration-picker"
|
|
4190
4339
|
}) {
|
|
4191
|
-
const [query, setQuery] =
|
|
4192
|
-
const [category, setCategory] =
|
|
4193
|
-
const [categoryQuery, setCategoryQuery] =
|
|
4194
|
-
const [categoryMenuOpen, setCategoryMenuOpen] =
|
|
4195
|
-
const [expanded, setExpanded] =
|
|
4196
|
-
const [bridgeOnlyInternal, setBridgeOnlyInternal] =
|
|
4197
|
-
const categoryMenuRef =
|
|
4198
|
-
const categoryTriggerRef =
|
|
4199
|
-
const categorySearchRef =
|
|
4200
|
-
const categoryOptionRefs =
|
|
4201
|
-
const pendingCategoryFocus =
|
|
4340
|
+
const [query, setQuery] = useState13("");
|
|
4341
|
+
const [category, setCategory] = useState13("all");
|
|
4342
|
+
const [categoryQuery, setCategoryQuery] = useState13("");
|
|
4343
|
+
const [categoryMenuOpen, setCategoryMenuOpen] = useState13(false);
|
|
4344
|
+
const [expanded, setExpanded] = useState13(null);
|
|
4345
|
+
const [bridgeOnlyInternal, setBridgeOnlyInternal] = useState13(false);
|
|
4346
|
+
const categoryMenuRef = useRef5(null);
|
|
4347
|
+
const categoryTriggerRef = useRef5(null);
|
|
4348
|
+
const categorySearchRef = useRef5(null);
|
|
4349
|
+
const categoryOptionRefs = useRef5({});
|
|
4350
|
+
const pendingCategoryFocus = useRef5(
|
|
4202
4351
|
null
|
|
4203
4352
|
);
|
|
4204
|
-
const scrollViewportRef =
|
|
4205
|
-
const loadMoreSentinelRef =
|
|
4206
|
-
const loadMoreInFlightRef =
|
|
4207
|
-
const sentinelVisibleRef =
|
|
4208
|
-
const authRequestRef =
|
|
4209
|
-
const [methodItem, setMethodItem] =
|
|
4210
|
-
const [authItem, setAuthItem] =
|
|
4211
|
-
const [authValues, setAuthValues] =
|
|
4212
|
-
const [authLoading, setAuthLoading] =
|
|
4213
|
-
const [authSubmitting, setAuthSubmitting] =
|
|
4214
|
-
const [authError, setAuthError] =
|
|
4215
|
-
const [connectionError, setConnectionError] =
|
|
4216
|
-
const [itemToDisconnect, setItemToDisconnect] =
|
|
4217
|
-
const [disconnecting, setDisconnecting] =
|
|
4218
|
-
const [disconnectError, setDisconnectError] =
|
|
4353
|
+
const scrollViewportRef = useRef5(null);
|
|
4354
|
+
const loadMoreSentinelRef = useRef5(null);
|
|
4355
|
+
const loadMoreInFlightRef = useRef5(false);
|
|
4356
|
+
const sentinelVisibleRef = useRef5(false);
|
|
4357
|
+
const authRequestRef = useRef5(0);
|
|
4358
|
+
const [methodItem, setMethodItem] = useState13(null);
|
|
4359
|
+
const [authItem, setAuthItem] = useState13(null);
|
|
4360
|
+
const [authValues, setAuthValues] = useState13({});
|
|
4361
|
+
const [authLoading, setAuthLoading] = useState13(false);
|
|
4362
|
+
const [authSubmitting, setAuthSubmitting] = useState13(false);
|
|
4363
|
+
const [authError, setAuthError] = useState13(null);
|
|
4364
|
+
const [connectionError, setConnectionError] = useState13(null);
|
|
4365
|
+
const [itemToDisconnect, setItemToDisconnect] = useState13(null);
|
|
4366
|
+
const [disconnecting, setDisconnecting] = useState13(false);
|
|
4367
|
+
const [disconnectError, setDisconnectError] = useState13(null);
|
|
4219
4368
|
const itemCategories = useMemo3(
|
|
4220
4369
|
() => Array.from(
|
|
4221
4370
|
new Set(items.flatMap((item) => {
|
|
@@ -4406,7 +4555,7 @@ function SuiteIntegrationPicker({
|
|
|
4406
4555
|
setAuthSubmitting(false);
|
|
4407
4556
|
}
|
|
4408
4557
|
}
|
|
4409
|
-
|
|
4558
|
+
useEffect10(() => {
|
|
4410
4559
|
if (!categoryMenuOpen) return;
|
|
4411
4560
|
const handlePointerDown = (event) => {
|
|
4412
4561
|
var _a2;
|
|
@@ -4424,7 +4573,7 @@ function SuiteIntegrationPicker({
|
|
|
4424
4573
|
document.removeEventListener("keydown", handleKeyDown);
|
|
4425
4574
|
};
|
|
4426
4575
|
}, [categoryMenuOpen]);
|
|
4427
|
-
|
|
4576
|
+
useEffect10(() => {
|
|
4428
4577
|
var _a2, _b, _c;
|
|
4429
4578
|
const target = pendingCategoryFocus.current;
|
|
4430
4579
|
if (!target) return;
|
|
@@ -4433,10 +4582,10 @@ function SuiteIntegrationPicker({
|
|
|
4433
4582
|
else if (target === "search") (_b = categorySearchRef.current) == null ? void 0 : _b.focus();
|
|
4434
4583
|
else (_c = categoryOptionRefs.current[target]) == null ? void 0 : _c.focus();
|
|
4435
4584
|
}, [activeCategory, categoryMenuOpen, categoryQuery, visibleCategories]);
|
|
4436
|
-
|
|
4585
|
+
useEffect10(() => {
|
|
4437
4586
|
if (!loadingMore) loadMoreInFlightRef.current = false;
|
|
4438
4587
|
}, [loadingMore]);
|
|
4439
|
-
|
|
4588
|
+
useEffect10(() => {
|
|
4440
4589
|
const root = scrollViewportRef.current;
|
|
4441
4590
|
const sentinel = loadMoreSentinelRef.current;
|
|
4442
4591
|
if (!open || !root || !sentinel) {
|
|
@@ -4462,8 +4611,8 @@ function SuiteIntegrationPicker({
|
|
|
4462
4611
|
observer.observe(sentinel);
|
|
4463
4612
|
return () => observer.disconnect();
|
|
4464
4613
|
}, [catalogLoading, hasMore, loading, loadingMore, onEndReached, open]);
|
|
4465
|
-
return /* @__PURE__ */
|
|
4466
|
-
/* @__PURE__ */
|
|
4614
|
+
return /* @__PURE__ */ jsxs22(Fragment8, { children: [
|
|
4615
|
+
/* @__PURE__ */ jsx27(
|
|
4467
4616
|
Modal,
|
|
4468
4617
|
{
|
|
4469
4618
|
open,
|
|
@@ -4473,15 +4622,15 @@ function SuiteIntegrationPicker({
|
|
|
4473
4622
|
size: "xl",
|
|
4474
4623
|
dataTest,
|
|
4475
4624
|
bodyClassName: "!overflow-hidden",
|
|
4476
|
-
children: /* @__PURE__ */
|
|
4477
|
-
connectionError ? /* @__PURE__ */
|
|
4478
|
-
/* @__PURE__ */
|
|
4625
|
+
children: /* @__PURE__ */ jsxs22("div", { className: "space-y-4", children: [
|
|
4626
|
+
connectionError ? /* @__PURE__ */ jsx27("p", { className: "text-sm text-ph-danger", role: "alert", children: connectionError }) : null,
|
|
4627
|
+
/* @__PURE__ */ jsxs22(
|
|
4479
4628
|
"label",
|
|
4480
4629
|
{
|
|
4481
4630
|
className: "inline-flex w-fit cursor-pointer items-center gap-2 text-sm text-ph-ink",
|
|
4482
4631
|
"data-test": `${dataTest}-bridge-only`,
|
|
4483
4632
|
children: [
|
|
4484
|
-
/* @__PURE__ */
|
|
4633
|
+
/* @__PURE__ */ jsx27(
|
|
4485
4634
|
"input",
|
|
4486
4635
|
{
|
|
4487
4636
|
type: "checkbox",
|
|
@@ -4492,27 +4641,27 @@ function SuiteIntegrationPicker({
|
|
|
4492
4641
|
"aria-label": "Shelly Bridge only"
|
|
4493
4642
|
}
|
|
4494
4643
|
),
|
|
4495
|
-
/* @__PURE__ */
|
|
4644
|
+
/* @__PURE__ */ jsx27(
|
|
4496
4645
|
Bridge3d,
|
|
4497
4646
|
{
|
|
4498
4647
|
className: "h-4 w-4 shrink-0 text-ph-subtle",
|
|
4499
4648
|
"aria-hidden": true
|
|
4500
4649
|
}
|
|
4501
4650
|
),
|
|
4502
|
-
/* @__PURE__ */
|
|
4651
|
+
/* @__PURE__ */ jsx27("span", { children: "Shelly Bridge only" })
|
|
4503
4652
|
]
|
|
4504
4653
|
}
|
|
4505
4654
|
),
|
|
4506
|
-
/* @__PURE__ */
|
|
4507
|
-
/* @__PURE__ */
|
|
4508
|
-
/* @__PURE__ */
|
|
4655
|
+
/* @__PURE__ */ jsxs22("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
4656
|
+
/* @__PURE__ */ jsxs22("div", { className: "relative", children: [
|
|
4657
|
+
/* @__PURE__ */ jsx27(
|
|
4509
4658
|
Search,
|
|
4510
4659
|
{
|
|
4511
4660
|
className: "pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-ph-subtle",
|
|
4512
4661
|
"aria-hidden": true
|
|
4513
4662
|
}
|
|
4514
4663
|
),
|
|
4515
|
-
/* @__PURE__ */
|
|
4664
|
+
/* @__PURE__ */ jsx27(
|
|
4516
4665
|
Input,
|
|
4517
4666
|
{
|
|
4518
4667
|
value: activeSearch,
|
|
@@ -4526,8 +4675,8 @@ function SuiteIntegrationPicker({
|
|
|
4526
4675
|
}
|
|
4527
4676
|
)
|
|
4528
4677
|
] }),
|
|
4529
|
-
/* @__PURE__ */
|
|
4530
|
-
/* @__PURE__ */
|
|
4678
|
+
/* @__PURE__ */ jsxs22("div", { ref: categoryMenuRef, className: "relative", children: [
|
|
4679
|
+
/* @__PURE__ */ jsxs22(
|
|
4531
4680
|
"button",
|
|
4532
4681
|
{
|
|
4533
4682
|
ref: categoryTriggerRef,
|
|
@@ -4544,17 +4693,17 @@ function SuiteIntegrationPicker({
|
|
|
4544
4693
|
},
|
|
4545
4694
|
onKeyDown: handleCategoryTriggerKeyDown,
|
|
4546
4695
|
children: [
|
|
4547
|
-
/* @__PURE__ */
|
|
4548
|
-
/* @__PURE__ */
|
|
4696
|
+
/* @__PURE__ */ jsxs22("span", { className: "flex items-center gap-2", children: [
|
|
4697
|
+
/* @__PURE__ */ jsx27(
|
|
4549
4698
|
Filter,
|
|
4550
4699
|
{
|
|
4551
4700
|
className: "h-4 w-4 shrink-0 text-ph-subtle",
|
|
4552
4701
|
"aria-hidden": true
|
|
4553
4702
|
}
|
|
4554
4703
|
),
|
|
4555
|
-
/* @__PURE__ */
|
|
4704
|
+
/* @__PURE__ */ jsx27("span", { children: activeCategory === "all" ? "All apps" : categoryLabel(activeCategory) })
|
|
4556
4705
|
] }),
|
|
4557
|
-
/* @__PURE__ */
|
|
4706
|
+
/* @__PURE__ */ jsx27(
|
|
4558
4707
|
NavArrowDown2,
|
|
4559
4708
|
{
|
|
4560
4709
|
className: `h-4 w-4 transition-transform ${categoryMenuOpen ? "rotate-180" : ""}`,
|
|
@@ -4564,12 +4713,12 @@ function SuiteIntegrationPicker({
|
|
|
4564
4713
|
]
|
|
4565
4714
|
}
|
|
4566
4715
|
),
|
|
4567
|
-
categoryMenuOpen ? /* @__PURE__ */
|
|
4716
|
+
categoryMenuOpen ? /* @__PURE__ */ jsxs22(
|
|
4568
4717
|
"div",
|
|
4569
4718
|
{
|
|
4570
|
-
className: "absolute z-20 mt-2 max-h-[min(22rem,calc(100dvh-12rem))] w-full max-w-full overflow-hidden rounded-
|
|
4719
|
+
className: "absolute z-20 mt-2 max-h-[min(22rem,calc(100dvh-12rem))] w-full max-w-full overflow-hidden rounded-[var(--ph-radius-overlay)] border border-[var(--ph-border-control)] bg-[var(--ph-surface-overlay)] p-2 shadow-[var(--ph-shadow-floating)]",
|
|
4571
4720
|
children: [
|
|
4572
|
-
/* @__PURE__ */
|
|
4721
|
+
/* @__PURE__ */ jsx27(
|
|
4573
4722
|
Input,
|
|
4574
4723
|
{
|
|
4575
4724
|
ref: categorySearchRef,
|
|
@@ -4589,7 +4738,7 @@ function SuiteIntegrationPicker({
|
|
|
4589
4738
|
}
|
|
4590
4739
|
}
|
|
4591
4740
|
),
|
|
4592
|
-
/* @__PURE__ */
|
|
4741
|
+
/* @__PURE__ */ jsx27(
|
|
4593
4742
|
"div",
|
|
4594
4743
|
{
|
|
4595
4744
|
id: `${dataTest}-category-options`,
|
|
@@ -4597,7 +4746,7 @@ function SuiteIntegrationPicker({
|
|
|
4597
4746
|
"aria-label": "Integration categories",
|
|
4598
4747
|
className: "mt-2 max-h-52 overflow-y-auto",
|
|
4599
4748
|
"data-test": "integration-category-options",
|
|
4600
|
-
children: categoryValues.map((value) => /* @__PURE__ */
|
|
4749
|
+
children: categoryValues.map((value) => /* @__PURE__ */ jsx27(
|
|
4601
4750
|
"button",
|
|
4602
4751
|
{
|
|
4603
4752
|
type: "button",
|
|
@@ -4607,7 +4756,7 @@ function SuiteIntegrationPicker({
|
|
|
4607
4756
|
ref: (element) => {
|
|
4608
4757
|
categoryOptionRefs.current[value] = element;
|
|
4609
4758
|
},
|
|
4610
|
-
className: `flex w-full min-w-0 items-center rounded-
|
|
4759
|
+
className: `flex w-full min-w-0 items-center rounded-[var(--ph-radius-control)] px-3 py-2 text-left text-sm break-words focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)] ${activeCategory === value ? "bg-[var(--ph-selected-bg)] text-[var(--ph-selected-text)] shadow-[inset_0_0_0_1px_var(--ph-selected-border)]" : "text-ph-ink hover:bg-[var(--ph-surface-hover)]"}`,
|
|
4611
4760
|
onClick: () => selectCategory(value),
|
|
4612
4761
|
onKeyDown: (event) => {
|
|
4613
4762
|
if (event.key === "Escape") {
|
|
@@ -4629,20 +4778,20 @@ function SuiteIntegrationPicker({
|
|
|
4629
4778
|
) : null
|
|
4630
4779
|
] })
|
|
4631
4780
|
] }),
|
|
4632
|
-
/* @__PURE__ */
|
|
4781
|
+
/* @__PURE__ */ jsxs22(
|
|
4633
4782
|
"div",
|
|
4634
4783
|
{
|
|
4635
4784
|
ref: scrollViewportRef,
|
|
4636
4785
|
className: "min-h-0 max-h-[min(60vh,32rem)] w-full overflow-y-auto pr-1",
|
|
4637
4786
|
children: [
|
|
4638
|
-
loading || catalogLoading ? /* @__PURE__ */
|
|
4787
|
+
loading || catalogLoading ? /* @__PURE__ */ jsx27(
|
|
4639
4788
|
"div",
|
|
4640
4789
|
{
|
|
4641
4790
|
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
4642
4791
|
"aria-label": "Loading apps",
|
|
4643
|
-
children: Array.from({ length: SKELETON_COUNT }, (_, index) => /* @__PURE__ */
|
|
4792
|
+
children: Array.from({ length: SKELETON_COUNT }, (_, index) => /* @__PURE__ */ jsx27(IntegrationSkeletonCard, {}, index))
|
|
4644
4793
|
}
|
|
4645
|
-
) : /* @__PURE__ */
|
|
4794
|
+
) : /* @__PURE__ */ jsxs22("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: [
|
|
4646
4795
|
filtered.map((item) => {
|
|
4647
4796
|
var _a2, _b;
|
|
4648
4797
|
const isExpanded = expanded === item.id;
|
|
@@ -4650,33 +4799,33 @@ function SuiteIntegrationPicker({
|
|
|
4650
4799
|
const bridgeApps = suiteAppsForIntegration(item);
|
|
4651
4800
|
const schemes = authSchemesFor(item);
|
|
4652
4801
|
const text = isExpanded || !longDescription ? item.description : `${item.description.slice(0, DESCRIPTION_LIMIT).trimEnd()}...`;
|
|
4653
|
-
return /* @__PURE__ */
|
|
4802
|
+
return /* @__PURE__ */ jsxs22(
|
|
4654
4803
|
"div",
|
|
4655
4804
|
{
|
|
4656
|
-
className: "flex min-h-36 min-w-0 flex-col justify-between rounded-
|
|
4805
|
+
className: "flex min-h-36 min-w-0 flex-col justify-between rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface p-4",
|
|
4657
4806
|
children: [
|
|
4658
|
-
/* @__PURE__ */
|
|
4807
|
+
/* @__PURE__ */ jsx27(
|
|
4659
4808
|
"button",
|
|
4660
4809
|
{
|
|
4661
4810
|
type: "button",
|
|
4662
4811
|
className: "min-w-0 text-left",
|
|
4663
4812
|
onClick: () => longDescription && setExpanded(isExpanded ? null : item.id),
|
|
4664
|
-
"aria-expanded": isExpanded,
|
|
4665
|
-
children: /* @__PURE__ */
|
|
4666
|
-
/* @__PURE__ */
|
|
4667
|
-
/* @__PURE__ */
|
|
4668
|
-
/* @__PURE__ */
|
|
4669
|
-
/* @__PURE__ */
|
|
4670
|
-
longDescription ? /* @__PURE__ */
|
|
4813
|
+
"aria-expanded": longDescription ? isExpanded : void 0,
|
|
4814
|
+
children: /* @__PURE__ */ jsxs22("span", { className: "flex items-start gap-3", children: [
|
|
4815
|
+
/* @__PURE__ */ jsx27("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__ */ jsx27(Plug, { className: "h-4 w-4", "aria-hidden": true }) }),
|
|
4816
|
+
/* @__PURE__ */ jsxs22("span", { className: "min-w-0", children: [
|
|
4817
|
+
/* @__PURE__ */ jsx27("span", { className: "block truncate font-medium text-ph-ink", children: item.label }),
|
|
4818
|
+
/* @__PURE__ */ jsx27("span", { className: "mt-1 block text-xs text-ph-subtle", children: text }),
|
|
4819
|
+
longDescription ? /* @__PURE__ */ jsxs22("span", { className: "mt-1 block text-xs font-medium text-ph-brand", children: [
|
|
4671
4820
|
isExpanded ? "See less" : "See more",
|
|
4672
4821
|
" ",
|
|
4673
|
-
isExpanded ? /* @__PURE__ */
|
|
4822
|
+
isExpanded ? /* @__PURE__ */ jsx27(NavArrowUp, { className: "inline h-3 w-3" }) : /* @__PURE__ */ jsx27(NavArrowDown2, { className: "inline h-3 w-3" })
|
|
4674
4823
|
] }) : null
|
|
4675
4824
|
] })
|
|
4676
4825
|
] })
|
|
4677
4826
|
}
|
|
4678
4827
|
),
|
|
4679
|
-
bridgeApps.length > 0 ? /* @__PURE__ */
|
|
4828
|
+
bridgeApps.length > 0 ? /* @__PURE__ */ jsx27(
|
|
4680
4829
|
"div",
|
|
4681
4830
|
{
|
|
4682
4831
|
className: "mt-3 flex flex-wrap items-center gap-1.5",
|
|
@@ -4684,7 +4833,7 @@ function SuiteIntegrationPicker({
|
|
|
4684
4833
|
children: bridgeApps.map((app) => {
|
|
4685
4834
|
const mark = BRIDGE_MARK[app];
|
|
4686
4835
|
if (!mark) return null;
|
|
4687
|
-
return /* @__PURE__ */
|
|
4836
|
+
return /* @__PURE__ */ jsx27(
|
|
4688
4837
|
"img",
|
|
4689
4838
|
{
|
|
4690
4839
|
src: mark.src,
|
|
@@ -4698,12 +4847,12 @@ function SuiteIntegrationPicker({
|
|
|
4698
4847
|
})
|
|
4699
4848
|
}
|
|
4700
4849
|
) : null,
|
|
4701
|
-
schemes.length > 0 ? /* @__PURE__ */
|
|
4850
|
+
schemes.length > 0 ? /* @__PURE__ */ jsx27(
|
|
4702
4851
|
"div",
|
|
4703
4852
|
{
|
|
4704
4853
|
className: "mt-3 flex flex-wrap gap-1.5",
|
|
4705
4854
|
"aria-label": "Connection methods",
|
|
4706
|
-
children: schemes.map((scheme) => /* @__PURE__ */
|
|
4855
|
+
children: schemes.map((scheme) => /* @__PURE__ */ jsx27(
|
|
4707
4856
|
"span",
|
|
4708
4857
|
{
|
|
4709
4858
|
className: "rounded-full border border-ph-border bg-ph-muted px-2 py-1 text-[0.6875rem] font-medium text-ph-subtle",
|
|
@@ -4714,7 +4863,7 @@ function SuiteIntegrationPicker({
|
|
|
4714
4863
|
))
|
|
4715
4864
|
}
|
|
4716
4865
|
) : null,
|
|
4717
|
-
/* @__PURE__ */
|
|
4866
|
+
/* @__PURE__ */ jsx27(
|
|
4718
4867
|
Button,
|
|
4719
4868
|
{
|
|
4720
4869
|
type: "button",
|
|
@@ -4722,8 +4871,8 @@ function SuiteIntegrationPicker({
|
|
|
4722
4871
|
className: "mt-3 self-start",
|
|
4723
4872
|
disabled: Boolean(item.unavailableReason) || item.connecting,
|
|
4724
4873
|
onClick: () => connectItem(item),
|
|
4725
|
-
children: /* @__PURE__ */
|
|
4726
|
-
/* @__PURE__ */
|
|
4874
|
+
children: /* @__PURE__ */ jsxs22("span", { className: "flex items-center gap-1.5", children: [
|
|
4875
|
+
/* @__PURE__ */ jsx27(Plug, { className: "h-3.5 w-3.5", "aria-hidden": true }),
|
|
4727
4876
|
item.connecting ? "Connecting..." : (_b = item.unavailableReason) != null ? _b : "Connect"
|
|
4728
4877
|
] })
|
|
4729
4878
|
}
|
|
@@ -4733,31 +4882,31 @@ function SuiteIntegrationPicker({
|
|
|
4733
4882
|
item.id
|
|
4734
4883
|
);
|
|
4735
4884
|
}),
|
|
4736
|
-
loadingMore ? Array.from({ length: 3 }, (_, index) => /* @__PURE__ */
|
|
4885
|
+
loadingMore ? Array.from({ length: 3 }, (_, index) => /* @__PURE__ */ jsx27(IntegrationSkeletonCard, {}, `loading-${index}`)) : null
|
|
4737
4886
|
] }),
|
|
4738
|
-
/* @__PURE__ */
|
|
4887
|
+
/* @__PURE__ */ jsx27("div", { ref: loadMoreSentinelRef, className: "h-1", "aria-hidden": "true" })
|
|
4739
4888
|
]
|
|
4740
4889
|
}
|
|
4741
4890
|
),
|
|
4742
|
-
connectedItems.length > 0 && onDisconnect ? /* @__PURE__ */
|
|
4743
|
-
/* @__PURE__ */
|
|
4744
|
-
connectedItems.map((item) => /* @__PURE__ */
|
|
4891
|
+
connectedItems.length > 0 && onDisconnect ? /* @__PURE__ */ jsxs22("div", { className: "space-y-2 border-t border-ph-border pt-4", children: [
|
|
4892
|
+
/* @__PURE__ */ jsx27("h3", { className: "font-medium text-ph-ink", children: "Connected apps" }),
|
|
4893
|
+
connectedItems.map((item) => /* @__PURE__ */ jsxs22(
|
|
4745
4894
|
"div",
|
|
4746
4895
|
{
|
|
4747
|
-
className: "flex items-center justify-between gap-3 rounded-
|
|
4896
|
+
className: "flex items-center justify-between gap-3 rounded-[var(--ph-radius-surface)] border border-ph-border bg-[var(--ph-surface-inset)] p-3",
|
|
4748
4897
|
children: [
|
|
4749
|
-
/* @__PURE__ */
|
|
4898
|
+
/* @__PURE__ */ jsxs22("span", { className: "flex min-w-0 items-center gap-2 text-sm text-ph-ink", children: [
|
|
4750
4899
|
item.icon,
|
|
4751
|
-
/* @__PURE__ */
|
|
4900
|
+
/* @__PURE__ */ jsx27("span", { className: "truncate", children: item.label })
|
|
4752
4901
|
] }),
|
|
4753
|
-
/* @__PURE__ */
|
|
4902
|
+
/* @__PURE__ */ jsx27(
|
|
4754
4903
|
Button,
|
|
4755
4904
|
{
|
|
4756
4905
|
type: "button",
|
|
4757
4906
|
variant: "danger",
|
|
4758
4907
|
onClick: () => requestDisconnect(item),
|
|
4759
|
-
children: /* @__PURE__ */
|
|
4760
|
-
/* @__PURE__ */
|
|
4908
|
+
children: /* @__PURE__ */ jsxs22("span", { className: "flex items-center gap-1.5", children: [
|
|
4909
|
+
/* @__PURE__ */ jsx27(Xmark, { className: "h-4 w-4", "aria-hidden": true }),
|
|
4761
4910
|
"Disconnect"
|
|
4762
4911
|
] })
|
|
4763
4912
|
}
|
|
@@ -4770,7 +4919,7 @@ function SuiteIntegrationPicker({
|
|
|
4770
4919
|
] })
|
|
4771
4920
|
}
|
|
4772
4921
|
),
|
|
4773
|
-
/* @__PURE__ */
|
|
4922
|
+
/* @__PURE__ */ jsxs22(
|
|
4774
4923
|
Modal,
|
|
4775
4924
|
{
|
|
4776
4925
|
open: itemToDisconnect !== null,
|
|
@@ -4782,8 +4931,8 @@ function SuiteIntegrationPicker({
|
|
|
4782
4931
|
size: "sm",
|
|
4783
4932
|
zIndex: 220,
|
|
4784
4933
|
dataTest: `${dataTest}-disconnect-confirmation`,
|
|
4785
|
-
footer: /* @__PURE__ */
|
|
4786
|
-
/* @__PURE__ */
|
|
4934
|
+
footer: /* @__PURE__ */ jsxs22("div", { className: "flex justify-end gap-2", children: [
|
|
4935
|
+
/* @__PURE__ */ jsx27(
|
|
4787
4936
|
Button,
|
|
4788
4937
|
{
|
|
4789
4938
|
type: "button",
|
|
@@ -4793,7 +4942,7 @@ function SuiteIntegrationPicker({
|
|
|
4793
4942
|
children: "Cancel"
|
|
4794
4943
|
}
|
|
4795
4944
|
),
|
|
4796
|
-
/* @__PURE__ */
|
|
4945
|
+
/* @__PURE__ */ jsx27(
|
|
4797
4946
|
Button,
|
|
4798
4947
|
{
|
|
4799
4948
|
type: "button",
|
|
@@ -4806,8 +4955,8 @@ function SuiteIntegrationPicker({
|
|
|
4806
4955
|
)
|
|
4807
4956
|
] }),
|
|
4808
4957
|
children: [
|
|
4809
|
-
disconnectError ? /* @__PURE__ */
|
|
4810
|
-
/* @__PURE__ */
|
|
4958
|
+
disconnectError ? /* @__PURE__ */ jsx27("p", { className: "text-sm text-ph-danger", role: "alert", children: disconnectError }) : null,
|
|
4959
|
+
/* @__PURE__ */ jsxs22("p", { className: "text-sm text-ph-ink", children: [
|
|
4811
4960
|
"Disconnect ",
|
|
4812
4961
|
itemToDisconnect == null ? void 0 : itemToDisconnect.label,
|
|
4813
4962
|
"? You can reconnect it later."
|
|
@@ -4815,7 +4964,7 @@ function SuiteIntegrationPicker({
|
|
|
4815
4964
|
]
|
|
4816
4965
|
}
|
|
4817
4966
|
),
|
|
4818
|
-
/* @__PURE__ */
|
|
4967
|
+
/* @__PURE__ */ jsx27(
|
|
4819
4968
|
Modal,
|
|
4820
4969
|
{
|
|
4821
4970
|
open: Boolean(methodItem),
|
|
@@ -4825,23 +4974,23 @@ function SuiteIntegrationPicker({
|
|
|
4825
4974
|
size: "sm",
|
|
4826
4975
|
zIndex: 200,
|
|
4827
4976
|
dataTest: `${dataTest}-auth-method`,
|
|
4828
|
-
children: methodItem ? /* @__PURE__ */
|
|
4977
|
+
children: methodItem ? /* @__PURE__ */ jsx27("div", { className: "space-y-2", children: authSchemesFor(methodItem).map((scheme) => /* @__PURE__ */ jsxs22(
|
|
4829
4978
|
"button",
|
|
4830
4979
|
{
|
|
4831
4980
|
type: "button",
|
|
4832
|
-
className: "flex w-full items-center justify-between rounded-
|
|
4981
|
+
className: "flex w-full items-center justify-between rounded-[var(--ph-radius-control)] border border-ph-border bg-ph-surface px-3 py-3 text-left text-sm text-ph-ink transition-[background-color,border-color,box-shadow] hover:border-[var(--ph-selected-border)] hover:bg-[var(--ph-surface-hover)] focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)]",
|
|
4833
4982
|
onClick: () => void prepareConnection(methodItem, scheme),
|
|
4834
4983
|
"data-test": `${dataTest}-choose-${scheme.toLowerCase()}`,
|
|
4835
4984
|
children: [
|
|
4836
|
-
/* @__PURE__ */
|
|
4837
|
-
/* @__PURE__ */
|
|
4985
|
+
/* @__PURE__ */ jsx27("span", { className: "font-medium", children: authSchemeLabel(scheme) }),
|
|
4986
|
+
/* @__PURE__ */ jsx27("span", { className: "text-xs text-ph-subtle", children: "Select" })
|
|
4838
4987
|
]
|
|
4839
4988
|
},
|
|
4840
4989
|
scheme
|
|
4841
4990
|
)) }) : null
|
|
4842
4991
|
}
|
|
4843
4992
|
),
|
|
4844
|
-
/* @__PURE__ */
|
|
4993
|
+
/* @__PURE__ */ jsx27(
|
|
4845
4994
|
Modal,
|
|
4846
4995
|
{
|
|
4847
4996
|
open: Boolean(authItem),
|
|
@@ -4851,14 +5000,14 @@ function SuiteIntegrationPicker({
|
|
|
4851
5000
|
size: "md",
|
|
4852
5001
|
zIndex: 210,
|
|
4853
5002
|
dataTest: `${dataTest}-auth-form`,
|
|
4854
|
-
children: authLoading ? /* @__PURE__ */
|
|
5003
|
+
children: authLoading ? /* @__PURE__ */ jsx27("p", { className: "text-sm text-ph-subtle", children: "Loading authentication fields..." }) : authItem ? /* @__PURE__ */ jsxs22(
|
|
4855
5004
|
"form",
|
|
4856
5005
|
{
|
|
4857
5006
|
className: "space-y-4",
|
|
4858
5007
|
onSubmit: (event) => void submitAuthForm(event),
|
|
4859
5008
|
children: [
|
|
4860
|
-
authError ? /* @__PURE__ */
|
|
4861
|
-
authItem.fields.length === 0 && authError ? /* @__PURE__ */
|
|
5009
|
+
authError ? /* @__PURE__ */ jsx27("p", { className: "text-sm text-ph-danger", role: "alert", children: authError }) : null,
|
|
5010
|
+
authItem.fields.length === 0 && authError ? /* @__PURE__ */ jsx27(
|
|
4862
5011
|
Button,
|
|
4863
5012
|
{
|
|
4864
5013
|
type: "button",
|
|
@@ -4869,7 +5018,7 @@ function SuiteIntegrationPicker({
|
|
|
4869
5018
|
) : null,
|
|
4870
5019
|
authItem.fields.map((field) => {
|
|
4871
5020
|
var _a2, _b;
|
|
4872
|
-
return /* @__PURE__ */
|
|
5021
|
+
return /* @__PURE__ */ jsx27(
|
|
4873
5022
|
Input,
|
|
4874
5023
|
{
|
|
4875
5024
|
label: field.label,
|
|
@@ -4885,8 +5034,8 @@ function SuiteIntegrationPicker({
|
|
|
4885
5034
|
field.name
|
|
4886
5035
|
);
|
|
4887
5036
|
}),
|
|
4888
|
-
/* @__PURE__ */
|
|
4889
|
-
/* @__PURE__ */
|
|
5037
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex justify-end gap-2 border-t border-ph-border pt-4", children: [
|
|
5038
|
+
/* @__PURE__ */ jsx27(
|
|
4890
5039
|
Button,
|
|
4891
5040
|
{
|
|
4892
5041
|
type: "button",
|
|
@@ -4896,7 +5045,7 @@ function SuiteIntegrationPicker({
|
|
|
4896
5045
|
children: "Cancel"
|
|
4897
5046
|
}
|
|
4898
5047
|
),
|
|
4899
|
-
/* @__PURE__ */
|
|
5048
|
+
/* @__PURE__ */ jsx27(Button, { type: "submit", variant: "primary", disabled: authSubmitting, children: authSubmitting ? "Connecting..." : "Connect" })
|
|
4900
5049
|
] })
|
|
4901
5050
|
]
|
|
4902
5051
|
}
|
|
@@ -4907,9 +5056,9 @@ function SuiteIntegrationPicker({
|
|
|
4907
5056
|
}
|
|
4908
5057
|
|
|
4909
5058
|
// src/suite/components/suite-integration-rules.tsx
|
|
4910
|
-
import { useState as
|
|
5059
|
+
import { useState as useState14 } from "react";
|
|
4911
5060
|
import { Plus, Xmark as Xmark2 } from "iconoir-react";
|
|
4912
|
-
import { jsx as
|
|
5061
|
+
import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4913
5062
|
var ACTION_LABELS = {
|
|
4914
5063
|
create_tides_task: "Create a Tides task",
|
|
4915
5064
|
draft_time_entry: "Draft a time entry",
|
|
@@ -4939,18 +5088,18 @@ function SuiteIntegrationRules({
|
|
|
4939
5088
|
onRefresh,
|
|
4940
5089
|
dataTest = "integration-rules"
|
|
4941
5090
|
}) {
|
|
4942
|
-
const [formOpen, setFormOpen] =
|
|
4943
|
-
const [name, setName] =
|
|
4944
|
-
const [trigger, setTrigger] =
|
|
4945
|
-
const [actionType, setActionType] =
|
|
4946
|
-
const [projectId, setProjectId] =
|
|
4947
|
-
const [minutes, setMinutes] =
|
|
4948
|
-
const [priority, setPriority] =
|
|
4949
|
-
const [submitting, setSubmitting] =
|
|
4950
|
-
const [formError, setFormError] =
|
|
4951
|
-
const [busyId, setBusyId] =
|
|
4952
|
-
const [ruleToDelete, setRuleToDelete] =
|
|
4953
|
-
const [deleteError, setDeleteError] =
|
|
5091
|
+
const [formOpen, setFormOpen] = useState14(false);
|
|
5092
|
+
const [name, setName] = useState14("");
|
|
5093
|
+
const [trigger, setTrigger] = useState14("");
|
|
5094
|
+
const [actionType, setActionType] = useState14("create_tides_task");
|
|
5095
|
+
const [projectId, setProjectId] = useState14("");
|
|
5096
|
+
const [minutes, setMinutes] = useState14("");
|
|
5097
|
+
const [priority, setPriority] = useState14("low");
|
|
5098
|
+
const [submitting, setSubmitting] = useState14(false);
|
|
5099
|
+
const [formError, setFormError] = useState14(null);
|
|
5100
|
+
const [busyId, setBusyId] = useState14(null);
|
|
5101
|
+
const [ruleToDelete, setRuleToDelete] = useState14(null);
|
|
5102
|
+
const [deleteError, setDeleteError] = useState14(null);
|
|
4954
5103
|
const needsProject = actionType === "create_tides_task" || actionType === "draft_time_entry";
|
|
4955
5104
|
async function submitForm(event) {
|
|
4956
5105
|
event.preventDefault();
|
|
@@ -5015,20 +5164,20 @@ function SuiteIntegrationRules({
|
|
|
5015
5164
|
setBusyId(null);
|
|
5016
5165
|
}
|
|
5017
5166
|
}
|
|
5018
|
-
return /* @__PURE__ */
|
|
5019
|
-
/* @__PURE__ */
|
|
5167
|
+
return /* @__PURE__ */ jsxs23("section", { className: "space-y-4", "data-test": dataTest, children: [
|
|
5168
|
+
/* @__PURE__ */ jsxs23(
|
|
5020
5169
|
Card,
|
|
5021
5170
|
{
|
|
5022
5171
|
variant: "outlined",
|
|
5023
5172
|
bodyClassName: "p-5",
|
|
5024
5173
|
"data-test": `${dataTest}-card`,
|
|
5025
5174
|
children: [
|
|
5026
|
-
/* @__PURE__ */
|
|
5027
|
-
/* @__PURE__ */
|
|
5028
|
-
/* @__PURE__ */
|
|
5029
|
-
/* @__PURE__ */
|
|
5175
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between", children: [
|
|
5176
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
5177
|
+
/* @__PURE__ */ jsx28("h3", { className: "font-medium text-ph-ink", children: "Automation rules" }),
|
|
5178
|
+
/* @__PURE__ */ jsx28("p", { className: "mt-1 text-sm text-ph-subtle", children: "Turn incoming integration events into tasks, time entries, or notifications for this workspace." })
|
|
5030
5179
|
] }),
|
|
5031
|
-
canManage && onCreate ? /* @__PURE__ */
|
|
5180
|
+
canManage && onCreate ? /* @__PURE__ */ jsx28(
|
|
5032
5181
|
Button,
|
|
5033
5182
|
{
|
|
5034
5183
|
type: "button",
|
|
@@ -5036,14 +5185,14 @@ function SuiteIntegrationRules({
|
|
|
5036
5185
|
size: "sm",
|
|
5037
5186
|
onClick: () => setFormOpen((open) => !open),
|
|
5038
5187
|
"data-test": `${dataTest}-new`,
|
|
5039
|
-
children: /* @__PURE__ */
|
|
5040
|
-
/* @__PURE__ */
|
|
5188
|
+
children: /* @__PURE__ */ jsxs23("span", { className: "flex items-center gap-1.5", children: [
|
|
5189
|
+
/* @__PURE__ */ jsx28(Plus, { className: "h-4 w-4", "aria-hidden": true }),
|
|
5041
5190
|
"New rule"
|
|
5042
5191
|
] })
|
|
5043
5192
|
}
|
|
5044
5193
|
) : null
|
|
5045
5194
|
] }),
|
|
5046
|
-
error ? /* @__PURE__ */
|
|
5195
|
+
error ? /* @__PURE__ */ jsx28(
|
|
5047
5196
|
Alert,
|
|
5048
5197
|
{
|
|
5049
5198
|
status: "danger",
|
|
@@ -5051,36 +5200,36 @@ function SuiteIntegrationRules({
|
|
|
5051
5200
|
description: error
|
|
5052
5201
|
}
|
|
5053
5202
|
) : null,
|
|
5054
|
-
loading ? /* @__PURE__ */
|
|
5203
|
+
loading ? /* @__PURE__ */ jsx28("p", { className: "mt-4 text-sm text-ph-subtle", children: "Loading rules..." }) : rules.length === 0 ? /* @__PURE__ */ jsx28(
|
|
5055
5204
|
"div",
|
|
5056
5205
|
{
|
|
5057
|
-
className: "mt-4 rounded-
|
|
5206
|
+
className: "mt-4 rounded-[var(--ph-radius-surface)] border border-dashed border-ph-border bg-[var(--ph-surface-inset)] px-4 py-6 text-center",
|
|
5058
5207
|
"data-test": `${dataTest}-empty`,
|
|
5059
|
-
children: /* @__PURE__ */
|
|
5208
|
+
children: /* @__PURE__ */ jsxs23("p", { className: "text-sm text-ph-subtle", children: [
|
|
5060
5209
|
"No automation rules yet.",
|
|
5061
5210
|
canManage ? " Create one to get started." : ""
|
|
5062
5211
|
] })
|
|
5063
5212
|
}
|
|
5064
|
-
) : /* @__PURE__ */
|
|
5213
|
+
) : /* @__PURE__ */ jsx28("ul", { className: "mt-4 space-y-2", "data-test": `${dataTest}-list`, children: rules.map((rule) => /* @__PURE__ */ jsxs23(
|
|
5065
5214
|
"li",
|
|
5066
5215
|
{
|
|
5067
|
-
className: "flex items-center justify-between gap-3 rounded-
|
|
5216
|
+
className: "flex items-center justify-between gap-3 rounded-[var(--ph-radius-surface)] border border-ph-border bg-[var(--ph-surface-inset)] px-3 py-3",
|
|
5068
5217
|
"data-test": `${dataTest}-rule-${rule.id}`,
|
|
5069
5218
|
children: [
|
|
5070
|
-
/* @__PURE__ */
|
|
5071
|
-
/* @__PURE__ */
|
|
5072
|
-
/* @__PURE__ */
|
|
5219
|
+
/* @__PURE__ */ jsxs23("div", { className: "min-w-0", children: [
|
|
5220
|
+
/* @__PURE__ */ jsx28("p", { className: "truncate text-sm font-medium text-ph-ink", children: rule.name }),
|
|
5221
|
+
/* @__PURE__ */ jsxs23("p", { className: "mt-0.5 truncate text-xs text-ph-subtle", children: [
|
|
5073
5222
|
rule.trigger_event_type,
|
|
5074
5223
|
" \u2192 ",
|
|
5075
5224
|
actionLabel(rule.action_type)
|
|
5076
5225
|
] }),
|
|
5077
|
-
/* @__PURE__ */
|
|
5226
|
+
/* @__PURE__ */ jsxs23("p", { className: "mt-0.5 truncate text-xs text-ph-subtle", children: [
|
|
5078
5227
|
"Last fired: ",
|
|
5079
5228
|
formatDateTime(rule.last_fired_at)
|
|
5080
5229
|
] })
|
|
5081
5230
|
] }),
|
|
5082
|
-
canManage ? /* @__PURE__ */
|
|
5083
|
-
/* @__PURE__ */
|
|
5231
|
+
canManage ? /* @__PURE__ */ jsxs23("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
5232
|
+
/* @__PURE__ */ jsx28(
|
|
5084
5233
|
Toggle,
|
|
5085
5234
|
{
|
|
5086
5235
|
checked: rule.enabled,
|
|
@@ -5089,7 +5238,7 @@ function SuiteIntegrationRules({
|
|
|
5089
5238
|
"aria-label": `Enable ${rule.name}`
|
|
5090
5239
|
}
|
|
5091
5240
|
),
|
|
5092
|
-
/* @__PURE__ */
|
|
5241
|
+
/* @__PURE__ */ jsx28(
|
|
5093
5242
|
Button,
|
|
5094
5243
|
{
|
|
5095
5244
|
type: "button",
|
|
@@ -5098,10 +5247,10 @@ function SuiteIntegrationRules({
|
|
|
5098
5247
|
disabled: busyId === rule.id,
|
|
5099
5248
|
onClick: () => requestDelete(rule),
|
|
5100
5249
|
"aria-label": `Delete ${rule.name}`,
|
|
5101
|
-
children: /* @__PURE__ */
|
|
5250
|
+
children: /* @__PURE__ */ jsx28(Xmark2, { className: "h-4 w-4", "aria-hidden": true })
|
|
5102
5251
|
}
|
|
5103
5252
|
)
|
|
5104
|
-
] }) : /* @__PURE__ */
|
|
5253
|
+
] }) : /* @__PURE__ */ jsx28(
|
|
5105
5254
|
Badge,
|
|
5106
5255
|
{
|
|
5107
5256
|
variant: rule.enabled ? "success" : "neutral",
|
|
@@ -5113,15 +5262,15 @@ function SuiteIntegrationRules({
|
|
|
5113
5262
|
},
|
|
5114
5263
|
rule.id
|
|
5115
5264
|
)) }),
|
|
5116
|
-
canManage && formOpen && onCreate ? /* @__PURE__ */
|
|
5265
|
+
canManage && formOpen && onCreate ? /* @__PURE__ */ jsxs23(
|
|
5117
5266
|
"form",
|
|
5118
5267
|
{
|
|
5119
|
-
className: "mt-4 space-y-3 rounded-
|
|
5268
|
+
className: "mt-4 space-y-3 rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface p-4",
|
|
5120
5269
|
onSubmit: (event) => void submitForm(event),
|
|
5121
5270
|
"data-test": `${dataTest}-form`,
|
|
5122
5271
|
children: [
|
|
5123
|
-
formError ? /* @__PURE__ */
|
|
5124
|
-
/* @__PURE__ */
|
|
5272
|
+
formError ? /* @__PURE__ */ jsx28("p", { className: "text-sm text-ph-danger", role: "alert", children: formError }) : null,
|
|
5273
|
+
/* @__PURE__ */ jsx28(
|
|
5125
5274
|
Input,
|
|
5126
5275
|
{
|
|
5127
5276
|
label: "Rule name",
|
|
@@ -5132,7 +5281,7 @@ function SuiteIntegrationRules({
|
|
|
5132
5281
|
"data-test": `${dataTest}-name`
|
|
5133
5282
|
}
|
|
5134
5283
|
),
|
|
5135
|
-
/* @__PURE__ */
|
|
5284
|
+
/* @__PURE__ */ jsx28(
|
|
5136
5285
|
Input,
|
|
5137
5286
|
{
|
|
5138
5287
|
label: "Trigger event type",
|
|
@@ -5144,7 +5293,7 @@ function SuiteIntegrationRules({
|
|
|
5144
5293
|
"data-test": `${dataTest}-trigger`
|
|
5145
5294
|
}
|
|
5146
5295
|
),
|
|
5147
|
-
/* @__PURE__ */
|
|
5296
|
+
/* @__PURE__ */ jsx28(
|
|
5148
5297
|
Select,
|
|
5149
5298
|
{
|
|
5150
5299
|
label: "Action",
|
|
@@ -5153,10 +5302,10 @@ function SuiteIntegrationRules({
|
|
|
5153
5302
|
event.target.value
|
|
5154
5303
|
),
|
|
5155
5304
|
"data-test": `${dataTest}-action`,
|
|
5156
|
-
children: Object.entries(ACTION_LABELS).map(([value, label]) => /* @__PURE__ */
|
|
5305
|
+
children: Object.entries(ACTION_LABELS).map(([value, label]) => /* @__PURE__ */ jsx28("option", { value, children: label }, value))
|
|
5157
5306
|
}
|
|
5158
5307
|
),
|
|
5159
|
-
needsProject ? /* @__PURE__ */
|
|
5308
|
+
needsProject ? /* @__PURE__ */ jsxs23(
|
|
5160
5309
|
Select,
|
|
5161
5310
|
{
|
|
5162
5311
|
label: "Project",
|
|
@@ -5164,12 +5313,12 @@ function SuiteIntegrationRules({
|
|
|
5164
5313
|
onChange: (event) => setProjectId(event.target.value),
|
|
5165
5314
|
"data-test": `${dataTest}-project`,
|
|
5166
5315
|
children: [
|
|
5167
|
-
/* @__PURE__ */
|
|
5168
|
-
projects.map((project) => /* @__PURE__ */
|
|
5316
|
+
/* @__PURE__ */ jsx28("option", { value: "", children: "Choose a project..." }),
|
|
5317
|
+
projects.map((project) => /* @__PURE__ */ jsx28("option", { value: project.id, children: project.name }, project.id))
|
|
5169
5318
|
]
|
|
5170
5319
|
}
|
|
5171
5320
|
) : null,
|
|
5172
|
-
actionType === "draft_time_entry" ? /* @__PURE__ */
|
|
5321
|
+
actionType === "draft_time_entry" ? /* @__PURE__ */ jsx28(
|
|
5173
5322
|
Input,
|
|
5174
5323
|
{
|
|
5175
5324
|
label: "Minutes (optional)",
|
|
@@ -5180,7 +5329,7 @@ function SuiteIntegrationRules({
|
|
|
5180
5329
|
"data-test": `${dataTest}-minutes`
|
|
5181
5330
|
}
|
|
5182
5331
|
) : null,
|
|
5183
|
-
actionType === "create_tides_task" ? /* @__PURE__ */
|
|
5332
|
+
actionType === "create_tides_task" ? /* @__PURE__ */ jsxs23(
|
|
5184
5333
|
Select,
|
|
5185
5334
|
{
|
|
5186
5335
|
label: "Priority",
|
|
@@ -5188,15 +5337,15 @@ function SuiteIntegrationRules({
|
|
|
5188
5337
|
onChange: (event) => setPriority(event.target.value),
|
|
5189
5338
|
"data-test": `${dataTest}-priority`,
|
|
5190
5339
|
children: [
|
|
5191
|
-
/* @__PURE__ */
|
|
5192
|
-
/* @__PURE__ */
|
|
5193
|
-
/* @__PURE__ */
|
|
5194
|
-
/* @__PURE__ */
|
|
5340
|
+
/* @__PURE__ */ jsx28("option", { value: "low", children: "Low" }),
|
|
5341
|
+
/* @__PURE__ */ jsx28("option", { value: "medium", children: "Medium" }),
|
|
5342
|
+
/* @__PURE__ */ jsx28("option", { value: "high", children: "High" }),
|
|
5343
|
+
/* @__PURE__ */ jsx28("option", { value: "urgent", children: "Urgent" })
|
|
5195
5344
|
]
|
|
5196
5345
|
}
|
|
5197
5346
|
) : null,
|
|
5198
|
-
/* @__PURE__ */
|
|
5199
|
-
/* @__PURE__ */
|
|
5347
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex justify-end gap-2 border-t border-ph-border pt-3", children: [
|
|
5348
|
+
/* @__PURE__ */ jsx28(
|
|
5200
5349
|
Button,
|
|
5201
5350
|
{
|
|
5202
5351
|
type: "button",
|
|
@@ -5206,7 +5355,7 @@ function SuiteIntegrationRules({
|
|
|
5206
5355
|
children: "Cancel"
|
|
5207
5356
|
}
|
|
5208
5357
|
),
|
|
5209
|
-
/* @__PURE__ */
|
|
5358
|
+
/* @__PURE__ */ jsx28(Button, { type: "submit", variant: "primary", disabled: submitting, children: submitting ? "Creating..." : "Create rule" })
|
|
5210
5359
|
] })
|
|
5211
5360
|
]
|
|
5212
5361
|
}
|
|
@@ -5214,7 +5363,7 @@ function SuiteIntegrationRules({
|
|
|
5214
5363
|
]
|
|
5215
5364
|
}
|
|
5216
5365
|
),
|
|
5217
|
-
/* @__PURE__ */
|
|
5366
|
+
/* @__PURE__ */ jsxs23(
|
|
5218
5367
|
Modal,
|
|
5219
5368
|
{
|
|
5220
5369
|
open: ruleToDelete !== null,
|
|
@@ -5224,8 +5373,8 @@ function SuiteIntegrationRules({
|
|
|
5224
5373
|
title: "Delete automation rule",
|
|
5225
5374
|
description: "This action cannot be undone.",
|
|
5226
5375
|
dataTest: `${dataTest}-delete-confirmation`,
|
|
5227
|
-
footer: /* @__PURE__ */
|
|
5228
|
-
/* @__PURE__ */
|
|
5376
|
+
footer: /* @__PURE__ */ jsxs23("div", { className: "flex justify-end gap-2", children: [
|
|
5377
|
+
/* @__PURE__ */ jsx28(
|
|
5229
5378
|
Button,
|
|
5230
5379
|
{
|
|
5231
5380
|
type: "button",
|
|
@@ -5235,7 +5384,7 @@ function SuiteIntegrationRules({
|
|
|
5235
5384
|
children: "Cancel"
|
|
5236
5385
|
}
|
|
5237
5386
|
),
|
|
5238
|
-
/* @__PURE__ */
|
|
5387
|
+
/* @__PURE__ */ jsx28(
|
|
5239
5388
|
Button,
|
|
5240
5389
|
{
|
|
5241
5390
|
type: "button",
|
|
@@ -5248,8 +5397,8 @@ function SuiteIntegrationRules({
|
|
|
5248
5397
|
)
|
|
5249
5398
|
] }),
|
|
5250
5399
|
children: [
|
|
5251
|
-
deleteError ? /* @__PURE__ */
|
|
5252
|
-
/* @__PURE__ */
|
|
5400
|
+
deleteError ? /* @__PURE__ */ jsx28("p", { className: "text-sm text-ph-danger", role: "alert", children: deleteError }) : null,
|
|
5401
|
+
/* @__PURE__ */ jsxs23("p", { className: "text-sm text-ph-ink", children: [
|
|
5253
5402
|
"Delete ",
|
|
5254
5403
|
ruleToDelete == null ? void 0 : ruleToDelete.name,
|
|
5255
5404
|
"? This cannot be undone."
|
|
@@ -5257,36 +5406,36 @@ function SuiteIntegrationRules({
|
|
|
5257
5406
|
]
|
|
5258
5407
|
}
|
|
5259
5408
|
),
|
|
5260
|
-
/* @__PURE__ */
|
|
5409
|
+
/* @__PURE__ */ jsxs23(
|
|
5261
5410
|
Card,
|
|
5262
5411
|
{
|
|
5263
5412
|
variant: "outlined",
|
|
5264
5413
|
bodyClassName: "p-5",
|
|
5265
5414
|
"data-test": `${dataTest}-events-card`,
|
|
5266
5415
|
children: [
|
|
5267
|
-
/* @__PURE__ */
|
|
5268
|
-
/* @__PURE__ */
|
|
5269
|
-
events.length === 0 ? /* @__PURE__ */
|
|
5416
|
+
/* @__PURE__ */ jsx28("h3", { className: "font-medium text-ph-ink", children: "Recent events" }),
|
|
5417
|
+
/* @__PURE__ */ jsx28("p", { className: "mt-1 text-sm text-ph-subtle", children: "The latest events received from your connected apps." }),
|
|
5418
|
+
events.length === 0 ? /* @__PURE__ */ jsx28(
|
|
5270
5419
|
"p",
|
|
5271
5420
|
{
|
|
5272
|
-
className: "mt-4 rounded-
|
|
5421
|
+
className: "mt-4 rounded-[var(--ph-radius-surface)] border border-dashed border-ph-border bg-[var(--ph-surface-inset)] px-4 py-6 text-center text-sm text-ph-subtle",
|
|
5273
5422
|
"data-test": `${dataTest}-events-empty`,
|
|
5274
5423
|
children: "No integration events yet."
|
|
5275
5424
|
}
|
|
5276
|
-
) : /* @__PURE__ */
|
|
5425
|
+
) : /* @__PURE__ */ jsx28("ul", { className: "mt-4 space-y-2", "data-test": `${dataTest}-events-list`, children: events.map((event) => /* @__PURE__ */ jsxs23(
|
|
5277
5426
|
"li",
|
|
5278
5427
|
{
|
|
5279
|
-
className: "flex items-center justify-between gap-3 rounded-
|
|
5428
|
+
className: "flex items-center justify-between gap-3 rounded-[var(--ph-radius-surface)] border border-ph-border bg-[var(--ph-surface-inset)] px-3 py-2",
|
|
5280
5429
|
children: [
|
|
5281
|
-
/* @__PURE__ */
|
|
5282
|
-
/* @__PURE__ */
|
|
5430
|
+
/* @__PURE__ */ jsxs23("div", { className: "min-w-0", children: [
|
|
5431
|
+
/* @__PURE__ */ jsxs23("p", { className: "truncate text-sm text-ph-ink", children: [
|
|
5283
5432
|
event.provider,
|
|
5284
5433
|
" \xB7 ",
|
|
5285
5434
|
event.event_type
|
|
5286
5435
|
] }),
|
|
5287
|
-
/* @__PURE__ */
|
|
5436
|
+
/* @__PURE__ */ jsx28("p", { className: "mt-0.5 text-xs text-ph-subtle", children: formatDateTime(event.created_at) })
|
|
5288
5437
|
] }),
|
|
5289
|
-
/* @__PURE__ */
|
|
5438
|
+
/* @__PURE__ */ jsx28(
|
|
5290
5439
|
Badge,
|
|
5291
5440
|
{
|
|
5292
5441
|
variant: event.processed_at ? "success" : "warning",
|
|
@@ -5306,10 +5455,10 @@ function SuiteIntegrationRules({
|
|
|
5306
5455
|
|
|
5307
5456
|
// src/suite/components/suite-clients-projects-directory.tsx
|
|
5308
5457
|
import {
|
|
5309
|
-
useEffect as
|
|
5458
|
+
useEffect as useEffect12,
|
|
5310
5459
|
useMemo as useMemo5,
|
|
5311
|
-
useRef as
|
|
5312
|
-
useState as
|
|
5460
|
+
useRef as useRef7,
|
|
5461
|
+
useState as useState16
|
|
5313
5462
|
} from "react";
|
|
5314
5463
|
import {
|
|
5315
5464
|
ArrowLeft,
|
|
@@ -5376,7 +5525,7 @@ function paletteIconSrc(imageUrl, color) {
|
|
|
5376
5525
|
}
|
|
5377
5526
|
|
|
5378
5527
|
// src/suite/components/suite-entity-icon.tsx
|
|
5379
|
-
import { jsx as
|
|
5528
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
5380
5529
|
function SuiteEntityIcon({
|
|
5381
5530
|
imageUrl,
|
|
5382
5531
|
label,
|
|
@@ -5391,7 +5540,7 @@ function SuiteEntityIcon({
|
|
|
5391
5540
|
const neutralBackground = "var(--ph-muted, rgba(127,127,127,0.08))";
|
|
5392
5541
|
if (imageUrl) {
|
|
5393
5542
|
const src = tinted && tint ? paletteIconSrc(imageUrl, tint) : imageUrl;
|
|
5394
|
-
return /* @__PURE__ */
|
|
5543
|
+
return /* @__PURE__ */ jsx29(
|
|
5395
5544
|
"span",
|
|
5396
5545
|
{
|
|
5397
5546
|
className: cn(
|
|
@@ -5402,11 +5551,11 @@ function SuiteEntityIcon({
|
|
|
5402
5551
|
style: __spreadValues({
|
|
5403
5552
|
backgroundColor: tint ? `${tint}18` : neutralBackground
|
|
5404
5553
|
}, style),
|
|
5405
|
-
children: /* @__PURE__ */
|
|
5554
|
+
children: /* @__PURE__ */ jsx29("img", { src: src != null ? src : void 0, alt: "", className: "h-full w-full object-contain" })
|
|
5406
5555
|
}
|
|
5407
5556
|
);
|
|
5408
5557
|
}
|
|
5409
|
-
return /* @__PURE__ */
|
|
5558
|
+
return /* @__PURE__ */ jsx29(
|
|
5410
5559
|
"span",
|
|
5411
5560
|
{
|
|
5412
5561
|
className: cn(
|
|
@@ -5420,11 +5569,11 @@ function SuiteEntityIcon({
|
|
|
5420
5569
|
}, style),
|
|
5421
5570
|
"aria-hidden": "true",
|
|
5422
5571
|
title: label != null ? label : void 0,
|
|
5423
|
-
children: /* @__PURE__ */
|
|
5572
|
+
children: /* @__PURE__ */ jsx29(
|
|
5424
5573
|
Folder,
|
|
5425
5574
|
{
|
|
5426
|
-
className: "h-[
|
|
5427
|
-
strokeWidth: 1.
|
|
5575
|
+
className: "h-[88%] w-[88%]",
|
|
5576
|
+
strokeWidth: 1.8,
|
|
5428
5577
|
"aria-hidden": true
|
|
5429
5578
|
}
|
|
5430
5579
|
)
|
|
@@ -5434,14 +5583,15 @@ function SuiteEntityIcon({
|
|
|
5434
5583
|
|
|
5435
5584
|
// src/suite/components/suite-palette-library.tsx
|
|
5436
5585
|
import {
|
|
5437
|
-
useCallback as
|
|
5438
|
-
useEffect as
|
|
5586
|
+
useCallback as useCallback7,
|
|
5587
|
+
useEffect as useEffect11,
|
|
5588
|
+
useId as useId2,
|
|
5439
5589
|
useMemo as useMemo4,
|
|
5440
|
-
useRef as
|
|
5441
|
-
useState as
|
|
5590
|
+
useRef as useRef6,
|
|
5591
|
+
useState as useState15
|
|
5442
5592
|
} from "react";
|
|
5443
5593
|
import { Filter as Filter2, FilterList, NavArrowDown as NavArrowDown3, Search as Search2 } from "iconoir-react";
|
|
5444
|
-
import { Fragment as Fragment9, jsx as
|
|
5594
|
+
import { Fragment as Fragment9, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5445
5595
|
var PAGE_SIZE = 60;
|
|
5446
5596
|
var DISCOVER_LIMIT = 120;
|
|
5447
5597
|
var ICON_TYPES = [
|
|
@@ -5459,25 +5609,25 @@ function FilterSelect({
|
|
|
5459
5609
|
onChange,
|
|
5460
5610
|
children
|
|
5461
5611
|
}) {
|
|
5462
|
-
return /* @__PURE__ */
|
|
5463
|
-
/* @__PURE__ */
|
|
5612
|
+
return /* @__PURE__ */ jsxs24("div", { className: "relative", children: [
|
|
5613
|
+
/* @__PURE__ */ jsx30(
|
|
5464
5614
|
Icon,
|
|
5465
5615
|
{
|
|
5466
5616
|
className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
5467
5617
|
"aria-hidden": true
|
|
5468
5618
|
}
|
|
5469
5619
|
),
|
|
5470
|
-
/* @__PURE__ */
|
|
5620
|
+
/* @__PURE__ */ jsx30(
|
|
5471
5621
|
"select",
|
|
5472
5622
|
{
|
|
5473
5623
|
"aria-label": label,
|
|
5474
5624
|
value,
|
|
5475
5625
|
onChange: (event) => onChange(event.target.value),
|
|
5476
|
-
className: "h-full w-full
|
|
5626
|
+
className: "ph-select h-full w-full py-2 pl-8 pr-7",
|
|
5477
5627
|
children
|
|
5478
5628
|
}
|
|
5479
5629
|
),
|
|
5480
|
-
/* @__PURE__ */
|
|
5630
|
+
/* @__PURE__ */ jsx30(
|
|
5481
5631
|
NavArrowDown3,
|
|
5482
5632
|
{
|
|
5483
5633
|
className: "pointer-events-none absolute right-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ph-mutedtext",
|
|
@@ -5490,20 +5640,22 @@ function SuitePaletteLibrary({
|
|
|
5490
5640
|
onPick
|
|
5491
5641
|
}) {
|
|
5492
5642
|
var _a2, _b;
|
|
5493
|
-
const [collections, setCollections] =
|
|
5494
|
-
const [typeFilter, setTypeFilter] =
|
|
5495
|
-
const [collectionFilter, setCollectionFilter] =
|
|
5496
|
-
const [libraryOpen, setLibraryOpen] =
|
|
5497
|
-
const [libraryQuery, setLibraryQuery] =
|
|
5498
|
-
const libraryRef =
|
|
5499
|
-
const
|
|
5500
|
-
const
|
|
5501
|
-
const [
|
|
5502
|
-
const [
|
|
5503
|
-
const [
|
|
5504
|
-
const [
|
|
5505
|
-
const [
|
|
5506
|
-
const
|
|
5643
|
+
const [collections, setCollections] = useState15([]);
|
|
5644
|
+
const [typeFilter, setTypeFilter] = useState15("all");
|
|
5645
|
+
const [collectionFilter, setCollectionFilter] = useState15("");
|
|
5646
|
+
const [libraryOpen, setLibraryOpen] = useState15(false);
|
|
5647
|
+
const [libraryQuery, setLibraryQuery] = useState15("");
|
|
5648
|
+
const libraryRef = useRef6(null);
|
|
5649
|
+
const libraryTriggerRef = useRef6(null);
|
|
5650
|
+
const libraryListboxId = useId2();
|
|
5651
|
+
const [icons, setIcons] = useState15([]);
|
|
5652
|
+
const [total, setTotal] = useState15(0);
|
|
5653
|
+
const [page, setPage] = useState15(1);
|
|
5654
|
+
const [query, setQuery] = useState15("");
|
|
5655
|
+
const [loading, setLoading] = useState15(true);
|
|
5656
|
+
const [loadingMore, setLoadingMore] = useState15(false);
|
|
5657
|
+
const [error, setError] = useState15(null);
|
|
5658
|
+
const requestId = useRef6(0);
|
|
5507
5659
|
const libraryOptions = useMemo4(() => {
|
|
5508
5660
|
const list = collections.filter(
|
|
5509
5661
|
(item) => typeFilter === "all" || item.style === typeFilter
|
|
@@ -5525,7 +5677,7 @@ function SuitePaletteLibrary({
|
|
|
5525
5677
|
}
|
|
5526
5678
|
return out;
|
|
5527
5679
|
}, [libraryOptions]);
|
|
5528
|
-
const loadCollection =
|
|
5680
|
+
const loadCollection = useCallback7(async (slug, nextPage = 1) => {
|
|
5529
5681
|
const id = ++requestId.current;
|
|
5530
5682
|
if (nextPage === 1) {
|
|
5531
5683
|
setLoading(true);
|
|
@@ -5556,7 +5708,7 @@ function SuitePaletteLibrary({
|
|
|
5556
5708
|
}
|
|
5557
5709
|
}
|
|
5558
5710
|
}, []);
|
|
5559
|
-
|
|
5711
|
+
useEffect11(() => {
|
|
5560
5712
|
let cancelled = false;
|
|
5561
5713
|
fetchPaletteLibrary().then((library) => {
|
|
5562
5714
|
if (cancelled) return;
|
|
@@ -5570,13 +5722,13 @@ function SuitePaletteLibrary({
|
|
|
5570
5722
|
cancelled = true;
|
|
5571
5723
|
};
|
|
5572
5724
|
}, []);
|
|
5573
|
-
|
|
5725
|
+
useEffect11(() => {
|
|
5574
5726
|
if (!collections.length) return;
|
|
5575
5727
|
if (collectionFilter && !libraryOptions.some((c) => c.slug === collectionFilter)) {
|
|
5576
5728
|
setCollectionFilter("");
|
|
5577
5729
|
}
|
|
5578
5730
|
}, [libraryOptions, collectionFilter, collections.length]);
|
|
5579
|
-
|
|
5731
|
+
useEffect11(() => {
|
|
5580
5732
|
if (query.trim()) return;
|
|
5581
5733
|
if (collectionFilter) {
|
|
5582
5734
|
void loadCollection(collectionFilter, 1);
|
|
@@ -5588,7 +5740,7 @@ function SuitePaletteLibrary({
|
|
|
5588
5740
|
setIcons(discoverIcons);
|
|
5589
5741
|
setTotal(discoverIcons.length);
|
|
5590
5742
|
}, [collectionFilter, query, loadCollection, discoverIcons]);
|
|
5591
|
-
|
|
5743
|
+
useEffect11(() => {
|
|
5592
5744
|
const term = query.trim();
|
|
5593
5745
|
if (!term) return;
|
|
5594
5746
|
const id = ++requestId.current;
|
|
@@ -5630,7 +5782,7 @@ function SuitePaletteLibrary({
|
|
|
5630
5782
|
if (!term) return libraryOptions;
|
|
5631
5783
|
return libraryOptions.filter((c) => c.name.toLowerCase().includes(term));
|
|
5632
5784
|
}, [libraryOptions, libraryQuery]);
|
|
5633
|
-
|
|
5785
|
+
useEffect11(() => {
|
|
5634
5786
|
if (!libraryOpen) return;
|
|
5635
5787
|
const onPointerDown = (event) => {
|
|
5636
5788
|
var _a3;
|
|
@@ -5639,18 +5791,55 @@ function SuitePaletteLibrary({
|
|
|
5639
5791
|
document.addEventListener("pointerdown", onPointerDown);
|
|
5640
5792
|
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
5641
5793
|
}, [libraryOpen]);
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5794
|
+
const closeLibrary = (restoreFocus = false) => {
|
|
5795
|
+
setLibraryOpen(false);
|
|
5796
|
+
if (restoreFocus) requestAnimationFrame(() => {
|
|
5797
|
+
var _a3;
|
|
5798
|
+
return (_a3 = libraryTriggerRef.current) == null ? void 0 : _a3.focus();
|
|
5799
|
+
});
|
|
5800
|
+
};
|
|
5801
|
+
const handleLibraryOptionKeyDown = (event) => {
|
|
5802
|
+
var _a3, _b2, _c;
|
|
5803
|
+
const options = Array.from(
|
|
5804
|
+
(_b2 = (_a3 = libraryRef.current) == null ? void 0 : _a3.querySelectorAll('[role="option"]')) != null ? _b2 : []
|
|
5805
|
+
);
|
|
5806
|
+
const index = options.indexOf(event.currentTarget);
|
|
5807
|
+
let nextIndex;
|
|
5808
|
+
switch (event.key) {
|
|
5809
|
+
case "ArrowDown":
|
|
5810
|
+
nextIndex = (index + 1) % options.length;
|
|
5811
|
+
break;
|
|
5812
|
+
case "ArrowUp":
|
|
5813
|
+
nextIndex = (index - 1 + options.length) % options.length;
|
|
5814
|
+
break;
|
|
5815
|
+
case "Home":
|
|
5816
|
+
nextIndex = 0;
|
|
5817
|
+
break;
|
|
5818
|
+
case "End":
|
|
5819
|
+
nextIndex = options.length - 1;
|
|
5820
|
+
break;
|
|
5821
|
+
case "Escape":
|
|
5822
|
+
event.preventDefault();
|
|
5823
|
+
closeLibrary(true);
|
|
5824
|
+
return;
|
|
5825
|
+
default:
|
|
5826
|
+
return;
|
|
5827
|
+
}
|
|
5828
|
+
event.preventDefault();
|
|
5829
|
+
(_c = options[nextIndex]) == null ? void 0 : _c.focus();
|
|
5830
|
+
};
|
|
5831
|
+
return /* @__PURE__ */ jsxs24("div", { className: "space-y-3", "data-test": "palette-icon-library", children: [
|
|
5832
|
+
/* @__PURE__ */ jsxs24("div", { ref: libraryRef, className: "space-y-2", children: [
|
|
5833
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
5834
|
+
/* @__PURE__ */ jsxs24("div", { className: "relative flex-1", children: [
|
|
5835
|
+
/* @__PURE__ */ jsx30(
|
|
5647
5836
|
Search2,
|
|
5648
5837
|
{
|
|
5649
5838
|
className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
5650
5839
|
"aria-hidden": true
|
|
5651
5840
|
}
|
|
5652
5841
|
),
|
|
5653
|
-
/* @__PURE__ */
|
|
5842
|
+
/* @__PURE__ */ jsx30(
|
|
5654
5843
|
"input",
|
|
5655
5844
|
{
|
|
5656
5845
|
type: "search",
|
|
@@ -5658,22 +5847,30 @@ function SuitePaletteLibrary({
|
|
|
5658
5847
|
onChange: (event) => setQuery(event.target.value),
|
|
5659
5848
|
placeholder: "Search icons \u2014 handshake, rocket, briefcase\u2026",
|
|
5660
5849
|
"aria-label": "Search icons",
|
|
5661
|
-
className: "
|
|
5850
|
+
className: "ph-input w-full py-2 pl-8 pr-3"
|
|
5662
5851
|
}
|
|
5663
5852
|
)
|
|
5664
5853
|
] }),
|
|
5665
|
-
/* @__PURE__ */
|
|
5854
|
+
/* @__PURE__ */ jsxs24(
|
|
5666
5855
|
"button",
|
|
5667
5856
|
{
|
|
5857
|
+
ref: libraryTriggerRef,
|
|
5668
5858
|
type: "button",
|
|
5669
5859
|
"aria-haspopup": "listbox",
|
|
5670
5860
|
"aria-expanded": libraryOpen,
|
|
5861
|
+
"aria-controls": libraryOpen ? libraryListboxId : void 0,
|
|
5671
5862
|
onClick: () => setLibraryOpen((open) => !open),
|
|
5672
|
-
|
|
5863
|
+
onKeyDown: (event) => {
|
|
5864
|
+
if (event.key === "Escape" && libraryOpen) {
|
|
5865
|
+
event.preventDefault();
|
|
5866
|
+
closeLibrary();
|
|
5867
|
+
}
|
|
5868
|
+
},
|
|
5869
|
+
className: "ph-input flex items-center gap-2 px-2.5 py-2 text-sm text-ph-ink",
|
|
5673
5870
|
children: [
|
|
5674
|
-
/* @__PURE__ */
|
|
5675
|
-
/* @__PURE__ */
|
|
5676
|
-
/* @__PURE__ */
|
|
5871
|
+
/* @__PURE__ */ jsx30(FilterList, { className: "h-4 w-4 shrink-0 text-ph-mutedtext", "aria-hidden": true }),
|
|
5872
|
+
/* @__PURE__ */ jsx30("span", { className: "max-w-[10rem] truncate", children: (_b = activeLibrary == null ? void 0 : activeLibrary.name) != null ? _b : "All libraries" }),
|
|
5873
|
+
/* @__PURE__ */ jsx30(
|
|
5677
5874
|
NavArrowDown3,
|
|
5678
5875
|
{
|
|
5679
5876
|
className: cn(
|
|
@@ -5686,27 +5883,27 @@ function SuitePaletteLibrary({
|
|
|
5686
5883
|
]
|
|
5687
5884
|
}
|
|
5688
5885
|
),
|
|
5689
|
-
/* @__PURE__ */
|
|
5886
|
+
/* @__PURE__ */ jsx30(
|
|
5690
5887
|
FilterSelect,
|
|
5691
5888
|
{
|
|
5692
5889
|
icon: Filter2,
|
|
5693
5890
|
label: "Filter by icon type",
|
|
5694
5891
|
value: typeFilter,
|
|
5695
5892
|
onChange: setTypeFilter,
|
|
5696
|
-
children: ICON_TYPES.map((type) => /* @__PURE__ */
|
|
5893
|
+
children: ICON_TYPES.map((type) => /* @__PURE__ */ jsx30("option", { value: type.value, children: type.label }, type.value))
|
|
5697
5894
|
}
|
|
5698
5895
|
)
|
|
5699
5896
|
] }),
|
|
5700
|
-
libraryOpen ? /* @__PURE__ */
|
|
5701
|
-
/* @__PURE__ */
|
|
5702
|
-
/* @__PURE__ */
|
|
5897
|
+
libraryOpen ? /* @__PURE__ */ jsxs24("div", { className: "rounded-[var(--ph-radius-overlay)] border border-[var(--ph-border-control)] bg-[var(--ph-surface-overlay)] p-2 shadow-[var(--ph-shadow-floating)]", children: [
|
|
5898
|
+
/* @__PURE__ */ jsxs24("div", { className: "relative mb-2", children: [
|
|
5899
|
+
/* @__PURE__ */ jsx30(
|
|
5703
5900
|
Search2,
|
|
5704
5901
|
{
|
|
5705
5902
|
className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
5706
5903
|
"aria-hidden": true
|
|
5707
5904
|
}
|
|
5708
5905
|
),
|
|
5709
|
-
/* @__PURE__ */
|
|
5906
|
+
/* @__PURE__ */ jsx30(
|
|
5710
5907
|
"input",
|
|
5711
5908
|
{
|
|
5712
5909
|
type: "search",
|
|
@@ -5715,70 +5912,85 @@ function SuitePaletteLibrary({
|
|
|
5715
5912
|
onChange: (event) => setLibraryQuery(event.target.value),
|
|
5716
5913
|
placeholder: "Search libraries\u2026",
|
|
5717
5914
|
"aria-label": "Search libraries",
|
|
5718
|
-
className: "w-full
|
|
5915
|
+
className: "ph-input w-full bg-[var(--ph-surface-inset)] py-1.5 pl-8 pr-3",
|
|
5916
|
+
onKeyDown: (event) => {
|
|
5917
|
+
var _a3, _b2;
|
|
5918
|
+
if (event.key === "ArrowDown") {
|
|
5919
|
+
event.preventDefault();
|
|
5920
|
+
(_b2 = (_a3 = libraryRef.current) == null ? void 0 : _a3.querySelector('[role="option"]')) == null ? void 0 : _b2.focus();
|
|
5921
|
+
} else if (event.key === "Escape") {
|
|
5922
|
+
event.preventDefault();
|
|
5923
|
+
closeLibrary(true);
|
|
5924
|
+
}
|
|
5925
|
+
}
|
|
5719
5926
|
}
|
|
5720
5927
|
)
|
|
5721
5928
|
] }),
|
|
5722
|
-
/* @__PURE__ */
|
|
5929
|
+
/* @__PURE__ */ jsxs24(
|
|
5723
5930
|
"ul",
|
|
5724
5931
|
{
|
|
5725
5932
|
role: "listbox",
|
|
5933
|
+
id: libraryListboxId,
|
|
5726
5934
|
"aria-label": "Libraries",
|
|
5727
5935
|
className: "max-h-56 overflow-y-auto",
|
|
5728
5936
|
children: [
|
|
5729
|
-
/* @__PURE__ */
|
|
5937
|
+
/* @__PURE__ */ jsx30("li", { children: /* @__PURE__ */ jsx30(
|
|
5730
5938
|
"button",
|
|
5731
5939
|
{
|
|
5732
5940
|
type: "button",
|
|
5733
5941
|
role: "option",
|
|
5734
5942
|
"aria-selected": !collectionFilter,
|
|
5943
|
+
tabIndex: -1,
|
|
5944
|
+
onKeyDown: handleLibraryOptionKeyDown,
|
|
5735
5945
|
onClick: () => {
|
|
5736
5946
|
setCollectionFilter("");
|
|
5737
|
-
|
|
5947
|
+
closeLibrary(true);
|
|
5738
5948
|
},
|
|
5739
5949
|
className: cn(
|
|
5740
|
-
"flex w-full items-center rounded-
|
|
5741
|
-
!collectionFilter ? "bg-ph-
|
|
5950
|
+
"flex w-full items-center rounded-[var(--ph-radius-control)] px-2 py-1.5 text-left text-sm focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)]",
|
|
5951
|
+
!collectionFilter ? "bg-[var(--ph-selected-bg)] text-[var(--ph-selected-text)]" : "text-ph-ink hover:bg-[var(--ph-surface-hover)]"
|
|
5742
5952
|
),
|
|
5743
5953
|
children: "All libraries"
|
|
5744
5954
|
}
|
|
5745
5955
|
) }),
|
|
5746
|
-
filteredLibraries.map((collection) => /* @__PURE__ */
|
|
5956
|
+
filteredLibraries.map((collection) => /* @__PURE__ */ jsx30("li", { children: /* @__PURE__ */ jsxs24(
|
|
5747
5957
|
"button",
|
|
5748
5958
|
{
|
|
5749
5959
|
type: "button",
|
|
5750
5960
|
role: "option",
|
|
5751
5961
|
"aria-selected": collectionFilter === collection.slug,
|
|
5962
|
+
tabIndex: -1,
|
|
5963
|
+
onKeyDown: handleLibraryOptionKeyDown,
|
|
5752
5964
|
onClick: () => {
|
|
5753
5965
|
setCollectionFilter(collection.slug);
|
|
5754
|
-
|
|
5966
|
+
closeLibrary(true);
|
|
5755
5967
|
},
|
|
5756
5968
|
className: cn(
|
|
5757
|
-
"flex w-full items-center justify-between gap-2 rounded-
|
|
5758
|
-
collectionFilter === collection.slug ? "bg-ph-
|
|
5969
|
+
"flex w-full items-center justify-between gap-2 rounded-[var(--ph-radius-control)] px-2 py-1.5 text-left text-sm focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)]",
|
|
5970
|
+
collectionFilter === collection.slug ? "bg-[var(--ph-selected-bg)] text-[var(--ph-selected-text)]" : "text-ph-ink hover:bg-[var(--ph-surface-hover)]"
|
|
5759
5971
|
),
|
|
5760
5972
|
children: [
|
|
5761
|
-
/* @__PURE__ */
|
|
5762
|
-
/* @__PURE__ */
|
|
5973
|
+
/* @__PURE__ */ jsx30("span", { className: "truncate", children: collection.name }),
|
|
5974
|
+
/* @__PURE__ */ jsx30("span", { className: "shrink-0 text-xs text-ph-mutedtext", children: collection.count })
|
|
5763
5975
|
]
|
|
5764
5976
|
}
|
|
5765
5977
|
) }, collection.slug)),
|
|
5766
|
-
filteredLibraries.length === 0 ? /* @__PURE__ */
|
|
5978
|
+
filteredLibraries.length === 0 ? /* @__PURE__ */ jsx30("li", { className: "px-2 py-4 text-center text-sm text-ph-mutedtext", children: "No libraries match." }) : null
|
|
5767
5979
|
]
|
|
5768
5980
|
}
|
|
5769
5981
|
)
|
|
5770
5982
|
] }) : null
|
|
5771
5983
|
] }),
|
|
5772
|
-
error ? /* @__PURE__ */
|
|
5773
|
-
/* @__PURE__ */
|
|
5984
|
+
error ? /* @__PURE__ */ jsx30("p", { className: "text-sm text-ph-danger", children: error }) : loading ? /* @__PURE__ */ jsx30("p", { className: "py-8 text-center text-sm text-ph-mutedtext", children: "Loading icons\u2026" }) : icons.length === 0 ? /* @__PURE__ */ jsx30("p", { className: "py-8 text-center text-sm text-ph-mutedtext", children: "No icons matched. Try another word or filter." }) : /* @__PURE__ */ jsxs24(Fragment9, { children: [
|
|
5985
|
+
/* @__PURE__ */ jsx30("div", { className: "max-h-[320px] overflow-y-auto rounded-[var(--ph-radius-surface)] border border-ph-border p-2 focus-within:border-[var(--ph-selected-border)]", children: /* @__PURE__ */ jsx30("div", { className: "grid grid-cols-6 gap-1.5 sm:grid-cols-8", children: icons.map((icon) => /* @__PURE__ */ jsx30(
|
|
5774
5986
|
"button",
|
|
5775
5987
|
{
|
|
5776
5988
|
type: "button",
|
|
5777
5989
|
onClick: () => onPick({ url: icon.url, name: icon.name }),
|
|
5778
5990
|
title: icon.name,
|
|
5779
5991
|
"aria-label": `Use ${icon.name}`,
|
|
5780
|
-
className: "flex h-10 items-center justify-center rounded-
|
|
5781
|
-
children: /* @__PURE__ */
|
|
5992
|
+
className: "flex h-10 items-center justify-center rounded-[var(--ph-radius-control)] border border-transparent p-1.5 hover:border-[var(--ph-selected-border)] hover:bg-[var(--ph-surface-hover)] focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)]",
|
|
5993
|
+
children: /* @__PURE__ */ jsx30(
|
|
5782
5994
|
"img",
|
|
5783
5995
|
{
|
|
5784
5996
|
src: icon.url,
|
|
@@ -5791,14 +6003,14 @@ function SuitePaletteLibrary({
|
|
|
5791
6003
|
},
|
|
5792
6004
|
icon.id
|
|
5793
6005
|
)) }) }),
|
|
5794
|
-
/* @__PURE__ */
|
|
5795
|
-
/* @__PURE__ */
|
|
6006
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between text-xs text-ph-mutedtext", children: [
|
|
6007
|
+
/* @__PURE__ */ jsxs24("span", { children: [
|
|
5796
6008
|
icons.length,
|
|
5797
6009
|
" of ",
|
|
5798
6010
|
total,
|
|
5799
6011
|
searching ? " matching" : activeLibrary ? ` in ${activeLibrary.name}` : " across all libraries"
|
|
5800
6012
|
] }),
|
|
5801
|
-
!searching && activeLibrary && icons.length < total ? /* @__PURE__ */
|
|
6013
|
+
!searching && activeLibrary && icons.length < total ? /* @__PURE__ */ jsx30(
|
|
5802
6014
|
"button",
|
|
5803
6015
|
{
|
|
5804
6016
|
type: "button",
|
|
@@ -5817,7 +6029,7 @@ function SuitePaletteLibrary({
|
|
|
5817
6029
|
}
|
|
5818
6030
|
|
|
5819
6031
|
// src/suite/components/suite-clients-projects-directory.tsx
|
|
5820
|
-
import { Fragment as Fragment10, jsx as
|
|
6032
|
+
import { Fragment as Fragment10, jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5821
6033
|
var DEFAULT_ICON = "";
|
|
5822
6034
|
var DEFAULT_COLOR = "";
|
|
5823
6035
|
function DirectoryIconPicker({
|
|
@@ -5828,11 +6040,11 @@ function DirectoryIconPicker({
|
|
|
5828
6040
|
onClear,
|
|
5829
6041
|
onBrowse
|
|
5830
6042
|
}) {
|
|
5831
|
-
return /* @__PURE__ */
|
|
5832
|
-
/* @__PURE__ */
|
|
5833
|
-
/* @__PURE__ */
|
|
5834
|
-
/* @__PURE__ */
|
|
5835
|
-
/* @__PURE__ */
|
|
6043
|
+
return /* @__PURE__ */ jsxs25("div", { className: "space-y-2", children: [
|
|
6044
|
+
/* @__PURE__ */ jsx31("span", { className: "mb-1.5 block text-sm font-medium text-ph-ink", children: "Icon" }),
|
|
6045
|
+
/* @__PURE__ */ jsxs25("div", { className: "rounded-[var(--ph-radius-surface)] border border-ph-border bg-[var(--ph-surface-inset)] p-3", children: [
|
|
6046
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-3", children: [
|
|
6047
|
+
/* @__PURE__ */ jsx31(
|
|
5836
6048
|
SuiteEntityIcon,
|
|
5837
6049
|
{
|
|
5838
6050
|
imageUrl: preview,
|
|
@@ -5842,11 +6054,11 @@ function DirectoryIconPicker({
|
|
|
5842
6054
|
className: "h-9 w-9 text-base"
|
|
5843
6055
|
}
|
|
5844
6056
|
),
|
|
5845
|
-
/* @__PURE__ */
|
|
5846
|
-
/* @__PURE__ */
|
|
5847
|
-
/* @__PURE__ */
|
|
6057
|
+
/* @__PURE__ */ jsxs25("div", { className: "min-w-0 flex-1", children: [
|
|
6058
|
+
/* @__PURE__ */ jsx31("p", { className: "text-sm font-medium text-ph-ink", children: preview ? "Custom image" : "No icon yet" }),
|
|
6059
|
+
/* @__PURE__ */ jsx31("p", { className: "text-xs text-ph-mutedtext", children: preview ? "Shown on cards and lists." : "Browse the library or upload your own." })
|
|
5848
6060
|
] }),
|
|
5849
|
-
onBrowse ? /* @__PURE__ */
|
|
6061
|
+
onBrowse ? /* @__PURE__ */ jsx31(
|
|
5850
6062
|
"button",
|
|
5851
6063
|
{
|
|
5852
6064
|
type: "button",
|
|
@@ -5856,7 +6068,7 @@ function DirectoryIconPicker({
|
|
|
5856
6068
|
}
|
|
5857
6069
|
) : null
|
|
5858
6070
|
] }),
|
|
5859
|
-
/* @__PURE__ */
|
|
6071
|
+
/* @__PURE__ */ jsx31("div", { className: "mt-3", children: /* @__PURE__ */ jsx31(
|
|
5860
6072
|
FileUpload,
|
|
5861
6073
|
{
|
|
5862
6074
|
accept: "image/png,image/jpeg,image/gif,image/webp,image/svg+xml,.svg",
|
|
@@ -5866,14 +6078,14 @@ function DirectoryIconPicker({
|
|
|
5866
6078
|
}
|
|
5867
6079
|
}
|
|
5868
6080
|
) }),
|
|
5869
|
-
preview ? /* @__PURE__ */
|
|
6081
|
+
preview ? /* @__PURE__ */ jsxs25(
|
|
5870
6082
|
"button",
|
|
5871
6083
|
{
|
|
5872
6084
|
type: "button",
|
|
5873
6085
|
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",
|
|
5874
6086
|
onClick: onClear,
|
|
5875
6087
|
children: [
|
|
5876
|
-
/* @__PURE__ */
|
|
6088
|
+
/* @__PURE__ */ jsx31(Trash, { className: "h-3.5 w-3.5", "aria-hidden": true }),
|
|
5877
6089
|
" Remove image"
|
|
5878
6090
|
]
|
|
5879
6091
|
}
|
|
@@ -5884,7 +6096,7 @@ function DirectoryIconPicker({
|
|
|
5884
6096
|
function DirectoryIcon({
|
|
5885
6097
|
item
|
|
5886
6098
|
}) {
|
|
5887
|
-
return /* @__PURE__ */
|
|
6099
|
+
return /* @__PURE__ */ jsx31(
|
|
5888
6100
|
SuiteEntityIcon,
|
|
5889
6101
|
{
|
|
5890
6102
|
imageUrl: item.icon_image,
|
|
@@ -5892,7 +6104,7 @@ function DirectoryIcon({
|
|
|
5892
6104
|
color: item.color,
|
|
5893
6105
|
tinted: true,
|
|
5894
6106
|
className: "h-8 w-8 text-sm",
|
|
5895
|
-
roundedClass: "rounded-
|
|
6107
|
+
roundedClass: "rounded-[var(--ph-radius-control)]"
|
|
5896
6108
|
}
|
|
5897
6109
|
);
|
|
5898
6110
|
}
|
|
@@ -5912,32 +6124,32 @@ function SuiteClientsProjectsDirectory({
|
|
|
5912
6124
|
dataTest = "suite-clients-projects-directory"
|
|
5913
6125
|
}) {
|
|
5914
6126
|
var _a2;
|
|
5915
|
-
const [query, setQuery] =
|
|
5916
|
-
const [selectedClientId, setSelectedClientId] =
|
|
5917
|
-
const [mobileDetail, setMobileDetail] =
|
|
5918
|
-
const [editing, setEditing] =
|
|
5919
|
-
const [draft, setDraft] =
|
|
6127
|
+
const [query, setQuery] = useState16("");
|
|
6128
|
+
const [selectedClientId, setSelectedClientId] = useState16(null);
|
|
6129
|
+
const [mobileDetail, setMobileDetail] = useState16(false);
|
|
6130
|
+
const [editing, setEditing] = useState16(null);
|
|
6131
|
+
const [draft, setDraft] = useState16({
|
|
5920
6132
|
name: "",
|
|
5921
6133
|
icon: DEFAULT_ICON,
|
|
5922
6134
|
color: DEFAULT_COLOR
|
|
5923
6135
|
});
|
|
5924
|
-
const [draftClientId, setDraftClientId] =
|
|
5925
|
-
const [preview, setPreview] =
|
|
5926
|
-
const [libraryOpen, setLibraryOpen] =
|
|
5927
|
-
const [draftArchived, setDraftArchived] =
|
|
5928
|
-
const [confirming, setConfirming] =
|
|
5929
|
-
const [saving, setSaving] =
|
|
5930
|
-
const [mutationError, setMutationError] =
|
|
5931
|
-
const clientButtonRefs =
|
|
5932
|
-
const backToClientsRef =
|
|
5933
|
-
const mobileFocusTarget =
|
|
5934
|
-
|
|
6136
|
+
const [draftClientId, setDraftClientId] = useState16(null);
|
|
6137
|
+
const [preview, setPreview] = useState16(null);
|
|
6138
|
+
const [libraryOpen, setLibraryOpen] = useState16(false);
|
|
6139
|
+
const [draftArchived, setDraftArchived] = useState16(false);
|
|
6140
|
+
const [confirming, setConfirming] = useState16(null);
|
|
6141
|
+
const [saving, setSaving] = useState16(false);
|
|
6142
|
+
const [mutationError, setMutationError] = useState16(null);
|
|
6143
|
+
const clientButtonRefs = useRef7({});
|
|
6144
|
+
const backToClientsRef = useRef7(null);
|
|
6145
|
+
const mobileFocusTarget = useRef7(null);
|
|
6146
|
+
useEffect12(() => {
|
|
5935
6147
|
var _a3, _b;
|
|
5936
6148
|
if (selectedClientId && clients.some((client) => client.id === selectedClientId))
|
|
5937
6149
|
return;
|
|
5938
6150
|
setSelectedClientId((_b = (_a3 = clients[0]) == null ? void 0 : _a3.id) != null ? _b : null);
|
|
5939
6151
|
}, [clients, selectedClientId]);
|
|
5940
|
-
|
|
6152
|
+
useEffect12(() => {
|
|
5941
6153
|
var _a3, _b;
|
|
5942
6154
|
const target = mobileFocusTarget.current;
|
|
5943
6155
|
if (!target) return;
|
|
@@ -6114,10 +6326,10 @@ function SuiteClientsProjectsDirectory({
|
|
|
6114
6326
|
);
|
|
6115
6327
|
}
|
|
6116
6328
|
}
|
|
6117
|
-
return /* @__PURE__ */
|
|
6118
|
-
error || mutationError ? /* @__PURE__ */
|
|
6119
|
-
loading ? /* @__PURE__ */
|
|
6120
|
-
/* @__PURE__ */
|
|
6329
|
+
return /* @__PURE__ */ jsxs25("div", { "data-test": dataTest, className: "space-y-3", children: [
|
|
6330
|
+
error || mutationError ? /* @__PURE__ */ jsx31(Alert, { status: "danger", live: "assertive", children: error || mutationError }) : null,
|
|
6331
|
+
loading ? /* @__PURE__ */ jsx31("p", { className: "text-sm text-ph-mutedtext", children: "Loading directory..." }) : /* @__PURE__ */ jsxs25("div", { className: "overflow-hidden rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface lg:grid lg:min-h-[22rem] lg:grid-cols-[minmax(14rem,18rem)_1fr]", children: [
|
|
6332
|
+
/* @__PURE__ */ jsxs25(
|
|
6121
6333
|
"section",
|
|
6122
6334
|
{
|
|
6123
6335
|
className: cn(
|
|
@@ -6125,16 +6337,16 @@ function SuiteClientsProjectsDirectory({
|
|
|
6125
6337
|
mobileDetail ? "hidden lg:block" : "block"
|
|
6126
6338
|
),
|
|
6127
6339
|
children: [
|
|
6128
|
-
/* @__PURE__ */
|
|
6129
|
-
/* @__PURE__ */
|
|
6130
|
-
/* @__PURE__ */
|
|
6340
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex h-14 items-center gap-2 border-b border-ph-border px-3", children: [
|
|
6341
|
+
/* @__PURE__ */ jsxs25("div", { className: "relative min-w-0 flex-1", children: [
|
|
6342
|
+
/* @__PURE__ */ jsx31(
|
|
6131
6343
|
Search3,
|
|
6132
6344
|
{
|
|
6133
6345
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
|
|
6134
6346
|
"aria-hidden": true
|
|
6135
6347
|
}
|
|
6136
6348
|
),
|
|
6137
|
-
/* @__PURE__ */
|
|
6349
|
+
/* @__PURE__ */ jsx31(
|
|
6138
6350
|
Input,
|
|
6139
6351
|
{
|
|
6140
6352
|
hideLabel: true,
|
|
@@ -6146,18 +6358,18 @@ function SuiteClientsProjectsDirectory({
|
|
|
6146
6358
|
}
|
|
6147
6359
|
)
|
|
6148
6360
|
] }),
|
|
6149
|
-
canEdit && onCreateClient ? /* @__PURE__ */
|
|
6361
|
+
canEdit && onCreateClient ? /* @__PURE__ */ jsx31(
|
|
6150
6362
|
Button,
|
|
6151
6363
|
{
|
|
6152
6364
|
size: "sm",
|
|
6153
6365
|
variant: "primary",
|
|
6154
|
-
icon: /* @__PURE__ */
|
|
6366
|
+
icon: /* @__PURE__ */ jsx31(Plus2, { className: "h-4 w-4" }),
|
|
6155
6367
|
onClick: () => openNew("client"),
|
|
6156
6368
|
children: "New client"
|
|
6157
6369
|
}
|
|
6158
6370
|
) : null
|
|
6159
6371
|
] }),
|
|
6160
|
-
/* @__PURE__ */
|
|
6372
|
+
/* @__PURE__ */ jsx31(
|
|
6161
6373
|
"ul",
|
|
6162
6374
|
{
|
|
6163
6375
|
role: "listbox",
|
|
@@ -6168,7 +6380,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6168
6380
|
const count = projects.filter(
|
|
6169
6381
|
(project) => project.clientId === client.id
|
|
6170
6382
|
).length;
|
|
6171
|
-
return /* @__PURE__ */
|
|
6383
|
+
return /* @__PURE__ */ jsx31("li", { role: "none", children: /* @__PURE__ */ jsxs25(
|
|
6172
6384
|
"button",
|
|
6173
6385
|
{
|
|
6174
6386
|
type: "button",
|
|
@@ -6181,14 +6393,14 @@ function SuiteClientsProjectsDirectory({
|
|
|
6181
6393
|
clientButtonRefs.current[client.id] = element;
|
|
6182
6394
|
},
|
|
6183
6395
|
className: cn(
|
|
6184
|
-
"flex w-full items-center gap-2.5 rounded-
|
|
6396
|
+
"flex w-full items-center gap-2.5 rounded-[var(--ph-radius-control)] px-2.5 py-2 text-left",
|
|
6185
6397
|
selected ? "bg-ph-muted" : "hover:bg-ph-canvas"
|
|
6186
6398
|
),
|
|
6187
6399
|
children: [
|
|
6188
|
-
/* @__PURE__ */
|
|
6189
|
-
/* @__PURE__ */
|
|
6190
|
-
/* @__PURE__ */
|
|
6191
|
-
/* @__PURE__ */
|
|
6400
|
+
/* @__PURE__ */ jsx31(DirectoryIcon, { item: client }),
|
|
6401
|
+
/* @__PURE__ */ jsxs25("span", { className: "min-w-0 flex-1", children: [
|
|
6402
|
+
/* @__PURE__ */ jsx31("span", { className: "block truncate text-sm font-medium text-ph-ink", children: client.name }),
|
|
6403
|
+
/* @__PURE__ */ jsxs25("span", { className: "text-xs text-ph-mutedtext", children: [
|
|
6192
6404
|
count,
|
|
6193
6405
|
" project",
|
|
6194
6406
|
count === 1 ? "" : "s"
|
|
@@ -6197,13 +6409,13 @@ function SuiteClientsProjectsDirectory({
|
|
|
6197
6409
|
]
|
|
6198
6410
|
}
|
|
6199
6411
|
) }, client.id);
|
|
6200
|
-
}) : /* @__PURE__ */
|
|
6412
|
+
}) : /* @__PURE__ */ jsx31("li", { className: "px-3 py-8 text-center text-sm text-ph-mutedtext", children: clients.length ? "No matches." : "Add a client to get started." })
|
|
6201
6413
|
}
|
|
6202
6414
|
)
|
|
6203
6415
|
]
|
|
6204
6416
|
}
|
|
6205
6417
|
),
|
|
6206
|
-
/* @__PURE__ */
|
|
6418
|
+
/* @__PURE__ */ jsxs25(
|
|
6207
6419
|
"section",
|
|
6208
6420
|
{
|
|
6209
6421
|
className: cn(
|
|
@@ -6211,8 +6423,8 @@ function SuiteClientsProjectsDirectory({
|
|
|
6211
6423
|
mobileDetail ? "flex" : "hidden lg:flex"
|
|
6212
6424
|
),
|
|
6213
6425
|
children: [
|
|
6214
|
-
/* @__PURE__ */
|
|
6215
|
-
/* @__PURE__ */
|
|
6426
|
+
/* @__PURE__ */ jsx31("div", { className: "flex min-h-14 items-center gap-2 border-b border-ph-border px-3 py-2", children: selectedClient ? /* @__PURE__ */ jsxs25(Fragment10, { children: [
|
|
6427
|
+
/* @__PURE__ */ jsx31(
|
|
6216
6428
|
"button",
|
|
6217
6429
|
{
|
|
6218
6430
|
type: "button",
|
|
@@ -6223,36 +6435,36 @@ function SuiteClientsProjectsDirectory({
|
|
|
6223
6435
|
setMobileDetail(false);
|
|
6224
6436
|
},
|
|
6225
6437
|
"aria-label": "Back to clients",
|
|
6226
|
-
children: /* @__PURE__ */
|
|
6438
|
+
children: /* @__PURE__ */ jsx31(ArrowLeft, { className: "h-4 w-4" })
|
|
6227
6439
|
}
|
|
6228
6440
|
),
|
|
6229
|
-
/* @__PURE__ */
|
|
6230
|
-
/* @__PURE__ */
|
|
6231
|
-
/* @__PURE__ */
|
|
6232
|
-
/* @__PURE__ */
|
|
6441
|
+
/* @__PURE__ */ jsx31(DirectoryIcon, { item: selectedClient }),
|
|
6442
|
+
/* @__PURE__ */ jsxs25("div", { className: "min-w-0 flex-1", children: [
|
|
6443
|
+
/* @__PURE__ */ jsx31("h3", { className: "truncate text-sm font-semibold text-ph-ink", children: selectedClient.name }),
|
|
6444
|
+
/* @__PURE__ */ jsxs25("p", { className: "text-xs text-ph-mutedtext", children: [
|
|
6233
6445
|
selectedProjects.length,
|
|
6234
6446
|
" project",
|
|
6235
6447
|
selectedProjects.length === 1 ? "" : "s"
|
|
6236
6448
|
] })
|
|
6237
6449
|
] }),
|
|
6238
|
-
canEdit && (onUpdateClient || onDeleteClient) ? /* @__PURE__ */
|
|
6450
|
+
canEdit && (onUpdateClient || onDeleteClient) ? /* @__PURE__ */ jsx31("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsx31(
|
|
6239
6451
|
DropdownMenu,
|
|
6240
6452
|
{
|
|
6241
6453
|
"aria-label": `Actions for ${selectedClient.name}`,
|
|
6242
6454
|
align: "end",
|
|
6243
|
-
trigger: /* @__PURE__ */
|
|
6244
|
-
/* @__PURE__ */
|
|
6245
|
-
/* @__PURE__ */
|
|
6455
|
+
trigger: /* @__PURE__ */ jsxs25("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: [
|
|
6456
|
+
/* @__PURE__ */ jsx31(MoreHorizontal, { className: "h-4 w-4", "aria-hidden": true }),
|
|
6457
|
+
/* @__PURE__ */ jsx31("span", { className: "sr-only", children: "Client actions" })
|
|
6246
6458
|
] }),
|
|
6247
|
-
children: /* @__PURE__ */
|
|
6248
|
-
onUpdateClient ? /* @__PURE__ */
|
|
6459
|
+
children: /* @__PURE__ */ jsxs25("div", { className: "p-1", children: [
|
|
6460
|
+
onUpdateClient ? /* @__PURE__ */ jsx31(
|
|
6249
6461
|
DropdownItem,
|
|
6250
6462
|
{
|
|
6251
6463
|
onClick: () => openEdit(selectedClient, "client"),
|
|
6252
6464
|
children: "Edit client"
|
|
6253
6465
|
}
|
|
6254
6466
|
) : null,
|
|
6255
|
-
onDeleteClient ? /* @__PURE__ */
|
|
6467
|
+
onDeleteClient ? /* @__PURE__ */ jsx31(
|
|
6256
6468
|
DropdownItem,
|
|
6257
6469
|
{
|
|
6258
6470
|
className: "text-red-600",
|
|
@@ -6263,32 +6475,32 @@ function SuiteClientsProjectsDirectory({
|
|
|
6263
6475
|
] })
|
|
6264
6476
|
}
|
|
6265
6477
|
) }) : null
|
|
6266
|
-
] }) : /* @__PURE__ */
|
|
6267
|
-
canEdit && onCreateProject ? /* @__PURE__ */
|
|
6478
|
+
] }) : /* @__PURE__ */ jsx31("p", { className: "text-sm text-ph-mutedtext", children: "Select a client" }) }),
|
|
6479
|
+
canEdit && onCreateProject ? /* @__PURE__ */ jsx31("div", { className: "border-b border-ph-border p-3", children: /* @__PURE__ */ jsx31(
|
|
6268
6480
|
Button,
|
|
6269
6481
|
{
|
|
6270
6482
|
variant: "primary",
|
|
6271
|
-
icon: /* @__PURE__ */
|
|
6483
|
+
icon: /* @__PURE__ */ jsx31(Plus2, { className: "h-4 w-4" }),
|
|
6272
6484
|
onClick: () => openNew("project"),
|
|
6273
6485
|
children: "Add project"
|
|
6274
6486
|
}
|
|
6275
6487
|
) }) : null,
|
|
6276
|
-
/* @__PURE__ */
|
|
6488
|
+
/* @__PURE__ */ jsx31("ul", { className: "flex-1 p-2", children: selectedClient && selectedProjects.length ? selectedProjects.map((project) => /* @__PURE__ */ jsx31("li", { children: /* @__PURE__ */ jsxs25(
|
|
6277
6489
|
"div",
|
|
6278
6490
|
{
|
|
6279
|
-
className: "flex items-center gap-3 rounded-
|
|
6491
|
+
className: "flex items-center gap-3 rounded-[var(--ph-radius-control)] px-2 py-1 hover:bg-ph-canvas",
|
|
6280
6492
|
onClick: () => openEdit(project, "project"),
|
|
6281
6493
|
children: [
|
|
6282
|
-
/* @__PURE__ */
|
|
6494
|
+
/* @__PURE__ */ jsxs25(
|
|
6283
6495
|
"button",
|
|
6284
6496
|
{
|
|
6285
6497
|
type: "button",
|
|
6286
|
-
className: "flex min-w-0 flex-1 items-center gap-3 rounded-
|
|
6498
|
+
className: "flex min-w-0 flex-1 items-center gap-3 rounded-[var(--ph-radius-control)] py-1 text-left focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)]",
|
|
6287
6499
|
onClick: () => openEdit(project, "project"),
|
|
6288
6500
|
children: [
|
|
6289
|
-
/* @__PURE__ */
|
|
6290
|
-
/* @__PURE__ */
|
|
6291
|
-
/* @__PURE__ */
|
|
6501
|
+
/* @__PURE__ */ jsx31(DirectoryIcon, { item: project }),
|
|
6502
|
+
/* @__PURE__ */ jsxs25("span", { className: "min-w-0 flex-1", children: [
|
|
6503
|
+
/* @__PURE__ */ jsx31(
|
|
6292
6504
|
"span",
|
|
6293
6505
|
{
|
|
6294
6506
|
className: cn(
|
|
@@ -6298,36 +6510,36 @@ function SuiteClientsProjectsDirectory({
|
|
|
6298
6510
|
children: project.name
|
|
6299
6511
|
}
|
|
6300
6512
|
),
|
|
6301
|
-
/* @__PURE__ */
|
|
6513
|
+
/* @__PURE__ */ jsx31("span", { className: "text-xs text-ph-mutedtext", children: project.isArchived ? "Archived" : "Active" })
|
|
6302
6514
|
] })
|
|
6303
6515
|
]
|
|
6304
6516
|
}
|
|
6305
6517
|
),
|
|
6306
|
-
canEdit && (onUpdateProject || onDeleteProject) ? /* @__PURE__ */
|
|
6518
|
+
canEdit && (onUpdateProject || onDeleteProject) ? /* @__PURE__ */ jsx31("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsx31(
|
|
6307
6519
|
DropdownMenu,
|
|
6308
6520
|
{
|
|
6309
6521
|
"aria-label": `Actions for ${project.name}`,
|
|
6310
6522
|
align: "end",
|
|
6311
|
-
trigger: /* @__PURE__ */
|
|
6312
|
-
/* @__PURE__ */
|
|
6523
|
+
trigger: /* @__PURE__ */ jsxs25("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: [
|
|
6524
|
+
/* @__PURE__ */ jsx31(
|
|
6313
6525
|
MoreHorizontal,
|
|
6314
6526
|
{
|
|
6315
6527
|
className: "h-4 w-4",
|
|
6316
6528
|
"aria-hidden": true
|
|
6317
6529
|
}
|
|
6318
6530
|
),
|
|
6319
|
-
/* @__PURE__ */
|
|
6531
|
+
/* @__PURE__ */ jsx31("span", { className: "sr-only", children: "Project actions" })
|
|
6320
6532
|
] }),
|
|
6321
|
-
children: /* @__PURE__ */
|
|
6322
|
-
onUpdateProject ? /* @__PURE__ */
|
|
6323
|
-
/* @__PURE__ */
|
|
6533
|
+
children: /* @__PURE__ */ jsxs25("div", { className: "p-1", children: [
|
|
6534
|
+
onUpdateProject ? /* @__PURE__ */ jsxs25(Fragment10, { children: [
|
|
6535
|
+
/* @__PURE__ */ jsx31(
|
|
6324
6536
|
DropdownItem,
|
|
6325
6537
|
{
|
|
6326
6538
|
onClick: () => openEdit(project, "project"),
|
|
6327
6539
|
children: "Edit project"
|
|
6328
6540
|
}
|
|
6329
6541
|
),
|
|
6330
|
-
/* @__PURE__ */
|
|
6542
|
+
/* @__PURE__ */ jsx31(
|
|
6331
6543
|
DropdownItem,
|
|
6332
6544
|
{
|
|
6333
6545
|
onClick: () => void toggleArchive(project),
|
|
@@ -6335,7 +6547,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6335
6547
|
}
|
|
6336
6548
|
)
|
|
6337
6549
|
] }) : null,
|
|
6338
|
-
onDeleteProject ? /* @__PURE__ */
|
|
6550
|
+
onDeleteProject ? /* @__PURE__ */ jsx31(
|
|
6339
6551
|
DropdownItem,
|
|
6340
6552
|
{
|
|
6341
6553
|
className: "text-red-600",
|
|
@@ -6348,20 +6560,20 @@ function SuiteClientsProjectsDirectory({
|
|
|
6348
6560
|
) }) : null
|
|
6349
6561
|
]
|
|
6350
6562
|
}
|
|
6351
|
-
) }, project.id)) : /* @__PURE__ */
|
|
6563
|
+
) }, project.id)) : /* @__PURE__ */ jsx31("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." }) })
|
|
6352
6564
|
]
|
|
6353
6565
|
}
|
|
6354
6566
|
)
|
|
6355
6567
|
] }),
|
|
6356
|
-
/* @__PURE__ */
|
|
6568
|
+
/* @__PURE__ */ jsx31(
|
|
6357
6569
|
Modal,
|
|
6358
6570
|
{
|
|
6359
6571
|
open: editing !== null,
|
|
6360
6572
|
onClose: closeEditor,
|
|
6361
6573
|
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",
|
|
6362
|
-
footer: /* @__PURE__ */
|
|
6363
|
-
/* @__PURE__ */
|
|
6364
|
-
/* @__PURE__ */
|
|
6574
|
+
footer: /* @__PURE__ */ jsxs25("div", { className: "flex justify-end gap-2", children: [
|
|
6575
|
+
/* @__PURE__ */ jsx31(Button, { variant: "tertiary", onClick: closeEditor, disabled: saving, children: "Cancel" }),
|
|
6576
|
+
/* @__PURE__ */ jsx31(
|
|
6365
6577
|
Button,
|
|
6366
6578
|
{
|
|
6367
6579
|
variant: "primary",
|
|
@@ -6371,8 +6583,8 @@ function SuiteClientsProjectsDirectory({
|
|
|
6371
6583
|
}
|
|
6372
6584
|
)
|
|
6373
6585
|
] }),
|
|
6374
|
-
children: /* @__PURE__ */
|
|
6375
|
-
/* @__PURE__ */
|
|
6586
|
+
children: /* @__PURE__ */ jsxs25("div", { className: "space-y-3", children: [
|
|
6587
|
+
/* @__PURE__ */ jsx31(
|
|
6376
6588
|
Input,
|
|
6377
6589
|
{
|
|
6378
6590
|
label: "Name",
|
|
@@ -6381,7 +6593,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6381
6593
|
onChange: (event) => setDraft(__spreadProps(__spreadValues({}, draft), { name: event.target.value }))
|
|
6382
6594
|
}
|
|
6383
6595
|
),
|
|
6384
|
-
/* @__PURE__ */
|
|
6596
|
+
/* @__PURE__ */ jsx31(
|
|
6385
6597
|
DirectoryIconPicker,
|
|
6386
6598
|
{
|
|
6387
6599
|
preview,
|
|
@@ -6392,10 +6604,10 @@ function SuiteClientsProjectsDirectory({
|
|
|
6392
6604
|
onBrowse: () => setLibraryOpen(true)
|
|
6393
6605
|
}
|
|
6394
6606
|
),
|
|
6395
|
-
/* @__PURE__ */
|
|
6396
|
-
/* @__PURE__ */
|
|
6397
|
-
/* @__PURE__ */
|
|
6398
|
-
/* @__PURE__ */
|
|
6607
|
+
/* @__PURE__ */ jsxs25("div", { children: [
|
|
6608
|
+
/* @__PURE__ */ jsx31("span", { className: "mb-1.5 block text-sm font-medium text-ph-ink", children: "Colour" }),
|
|
6609
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
6610
|
+
/* @__PURE__ */ jsx31(
|
|
6399
6611
|
"button",
|
|
6400
6612
|
{
|
|
6401
6613
|
type: "button",
|
|
@@ -6407,7 +6619,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6407
6619
|
"flex h-8 w-8 items-center justify-center rounded-full border border-ph-border bg-ph-surface text-ph-mutedtext ring-offset-2",
|
|
6408
6620
|
!draft.color && "ring-2 ring-ph-brand"
|
|
6409
6621
|
),
|
|
6410
|
-
children: /* @__PURE__ */
|
|
6622
|
+
children: /* @__PURE__ */ jsx31(Prohibition, { className: "h-4 w-4", "aria-hidden": true })
|
|
6411
6623
|
}
|
|
6412
6624
|
),
|
|
6413
6625
|
[
|
|
@@ -6418,7 +6630,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6418
6630
|
"#ef4444",
|
|
6419
6631
|
"#a855f7",
|
|
6420
6632
|
"#64748b"
|
|
6421
|
-
].map((color) => /* @__PURE__ */
|
|
6633
|
+
].map((color) => /* @__PURE__ */ jsx31(
|
|
6422
6634
|
"button",
|
|
6423
6635
|
{
|
|
6424
6636
|
type: "button",
|
|
@@ -6433,7 +6645,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6433
6645
|
},
|
|
6434
6646
|
color
|
|
6435
6647
|
)),
|
|
6436
|
-
/* @__PURE__ */
|
|
6648
|
+
/* @__PURE__ */ jsxs25(
|
|
6437
6649
|
"label",
|
|
6438
6650
|
{
|
|
6439
6651
|
className: cn(
|
|
@@ -6453,7 +6665,7 @@ function SuiteClientsProjectsDirectory({
|
|
|
6453
6665
|
},
|
|
6454
6666
|
title: "Custom colour",
|
|
6455
6667
|
children: [
|
|
6456
|
-
/* @__PURE__ */
|
|
6668
|
+
/* @__PURE__ */ jsx31("span", { className: "flex h-4 w-4 items-center justify-center rounded-full bg-ph-surface", children: [
|
|
6457
6669
|
"#6366f1",
|
|
6458
6670
|
"#0ea5e9",
|
|
6459
6671
|
"#10b981",
|
|
@@ -6461,14 +6673,14 @@ function SuiteClientsProjectsDirectory({
|
|
|
6461
6673
|
"#ef4444",
|
|
6462
6674
|
"#a855f7",
|
|
6463
6675
|
"#64748b"
|
|
6464
|
-
].includes(draft.color) ? /* @__PURE__ */
|
|
6676
|
+
].includes(draft.color) ? /* @__PURE__ */ jsx31(Plus2, { className: "h-3 w-3 text-ph-ink", "aria-hidden": true }) : /* @__PURE__ */ jsx31(
|
|
6465
6677
|
"span",
|
|
6466
6678
|
{
|
|
6467
6679
|
className: "h-2.5 w-2.5 rounded-full",
|
|
6468
6680
|
style: { backgroundColor: draft.color }
|
|
6469
6681
|
}
|
|
6470
6682
|
) }),
|
|
6471
|
-
/* @__PURE__ */
|
|
6683
|
+
/* @__PURE__ */ jsx31(
|
|
6472
6684
|
"input",
|
|
6473
6685
|
{
|
|
6474
6686
|
type: "color",
|
|
@@ -6483,20 +6695,20 @@ function SuiteClientsProjectsDirectory({
|
|
|
6483
6695
|
)
|
|
6484
6696
|
] })
|
|
6485
6697
|
] }),
|
|
6486
|
-
(editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */
|
|
6698
|
+
(editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */ jsxs25(
|
|
6487
6699
|
Select,
|
|
6488
6700
|
{
|
|
6489
6701
|
label: "Client",
|
|
6490
6702
|
value: draftClientId != null ? draftClientId : "",
|
|
6491
6703
|
onChange: (event) => setDraftClientId(event.target.value || null),
|
|
6492
6704
|
children: [
|
|
6493
|
-
/* @__PURE__ */
|
|
6494
|
-
clients.map((client) => /* @__PURE__ */
|
|
6705
|
+
/* @__PURE__ */ jsx31("option", { value: "", children: "No client" }),
|
|
6706
|
+
clients.map((client) => /* @__PURE__ */ jsx31("option", { value: client.id, children: client.name }, client.id))
|
|
6495
6707
|
]
|
|
6496
6708
|
}
|
|
6497
6709
|
) : null,
|
|
6498
|
-
(editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */
|
|
6499
|
-
/* @__PURE__ */
|
|
6710
|
+
(editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */ jsxs25("label", { className: "flex items-center gap-2 text-sm text-ph-ink", children: [
|
|
6711
|
+
/* @__PURE__ */ jsx31(
|
|
6500
6712
|
"input",
|
|
6501
6713
|
{
|
|
6502
6714
|
type: "checkbox",
|
|
@@ -6509,26 +6721,26 @@ function SuiteClientsProjectsDirectory({
|
|
|
6509
6721
|
] })
|
|
6510
6722
|
}
|
|
6511
6723
|
),
|
|
6512
|
-
libraryOpen ? /* @__PURE__ */
|
|
6724
|
+
libraryOpen ? /* @__PURE__ */ jsx31(
|
|
6513
6725
|
Modal,
|
|
6514
6726
|
{
|
|
6515
6727
|
open: true,
|
|
6516
6728
|
onClose: () => setLibraryOpen(false),
|
|
6517
6729
|
title: "Icon library",
|
|
6518
|
-
children: renderIconLibrary ? renderIconLibrary({ onPick: pickFromLibrary }) : /* @__PURE__ */
|
|
6730
|
+
children: renderIconLibrary ? renderIconLibrary({ onPick: pickFromLibrary }) : /* @__PURE__ */ jsx31(SuitePaletteLibrary, { onPick: pickFromLibrary })
|
|
6519
6731
|
}
|
|
6520
6732
|
) : null,
|
|
6521
|
-
/* @__PURE__ */
|
|
6733
|
+
/* @__PURE__ */ jsx31(
|
|
6522
6734
|
Modal,
|
|
6523
6735
|
{
|
|
6524
6736
|
open: confirming !== null,
|
|
6525
6737
|
onClose: () => setConfirming(null),
|
|
6526
6738
|
title: "Confirm deletion",
|
|
6527
|
-
footer: /* @__PURE__ */
|
|
6528
|
-
/* @__PURE__ */
|
|
6529
|
-
/* @__PURE__ */
|
|
6739
|
+
footer: /* @__PURE__ */ jsxs25("div", { className: "flex justify-end gap-2", children: [
|
|
6740
|
+
/* @__PURE__ */ jsx31(Button, { variant: "tertiary", onClick: () => setConfirming(null), children: "Cancel" }),
|
|
6741
|
+
/* @__PURE__ */ jsx31(Button, { variant: "primary", onClick: () => void confirmRemove(), children: "Delete" })
|
|
6530
6742
|
] }),
|
|
6531
|
-
children: /* @__PURE__ */
|
|
6743
|
+
children: /* @__PURE__ */ jsxs25("p", { className: "text-sm text-ph-ink", children: [
|
|
6532
6744
|
"Delete ",
|
|
6533
6745
|
confirming == null ? void 0 : confirming.item.name,
|
|
6534
6746
|
"? This cannot be undone."
|
|
@@ -6582,6 +6794,7 @@ export {
|
|
|
6582
6794
|
SuiteMobileHeader,
|
|
6583
6795
|
SuiteMotionProvider,
|
|
6584
6796
|
SuiteNotificationBell,
|
|
6797
|
+
SuiteNotificationSettings,
|
|
6585
6798
|
SuiteNotificationsProvider,
|
|
6586
6799
|
SuitePage,
|
|
6587
6800
|
SuitePageHeader,
|