@meetreeve/ui 0.12.0 → 0.14.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/README.md +29 -0
- package/dist/index.d.mts +32 -3
- package/dist/index.d.ts +32 -3
- package/dist/index.js +216 -199
- package/dist/index.mjs +215 -199
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __export(src_exports, {
|
|
|
37
37
|
ContextSwitcher: () => ContextSwitcher,
|
|
38
38
|
Flyout: () => Flyout,
|
|
39
39
|
GLYPH_CANVAS_FILL: () => GLYPH_CANVAS_FILL,
|
|
40
|
+
InfoTip: () => InfoTip,
|
|
40
41
|
LOCKUP_GAP: () => LOCKUP_GAP,
|
|
41
42
|
LOCKUP_ROW: () => LOCKUP_ROW,
|
|
42
43
|
MARK_CAP_RATIO: () => MARK_CAP_RATIO,
|
|
@@ -472,6 +473,44 @@ function useResponsivePlaceholder(desktop, mobile) {
|
|
|
472
473
|
return isDesktop ? desktop : mobile ?? desktop;
|
|
473
474
|
}
|
|
474
475
|
|
|
476
|
+
// src/info-tip.tsx
|
|
477
|
+
var import_popover = require("@base-ui/react/popover");
|
|
478
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
479
|
+
function InfoTip({ children, label = "More information", side = "top", align = "center", className }) {
|
|
480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_popover.Popover.Root, { children: [
|
|
481
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
482
|
+
import_popover.Popover.Trigger,
|
|
483
|
+
{
|
|
484
|
+
openOnHover: true,
|
|
485
|
+
delay: 150,
|
|
486
|
+
closeDelay: 100,
|
|
487
|
+
"aria-label": label,
|
|
488
|
+
style: TOUCH_TARGET_STYLE,
|
|
489
|
+
className: cn(
|
|
490
|
+
"group -my-3.5 inline-flex shrink-0 cursor-help items-center justify-center rounded-full align-middle text-muted-foreground outline-none transition-colors hover:text-foreground data-[popup-open]:text-foreground",
|
|
491
|
+
className
|
|
492
|
+
),
|
|
493
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
494
|
+
"span",
|
|
495
|
+
{
|
|
496
|
+
"aria-hidden": "true",
|
|
497
|
+
className: "inline-flex size-4 items-center justify-center rounded-full border border-current text-[0.625rem] font-semibold leading-none group-focus-visible:ring-2 group-focus-visible:ring-ring/50",
|
|
498
|
+
children: "?"
|
|
499
|
+
}
|
|
500
|
+
)
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_popover.Popover.Positioner, { side, align, sideOffset: 8, collisionPadding: 16, className: "z-50", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
504
|
+
import_popover.Popover.Popup,
|
|
505
|
+
{
|
|
506
|
+
"aria-label": label,
|
|
507
|
+
className: "max-w-[min(20rem,calc(100vw-2rem))] origin-[var(--transform-origin)] rounded-md border border-border bg-popover px-3 py-2 text-left text-xs font-normal leading-relaxed text-popover-foreground shadow-md outline-none transition-[opacity,transform] duration-150 ease-out data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 motion-reduce:transition-none",
|
|
508
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_popover.Popover.Description, { children })
|
|
509
|
+
}
|
|
510
|
+
) }) })
|
|
511
|
+
] });
|
|
512
|
+
}
|
|
513
|
+
|
|
475
514
|
// src/app-sidebar.tsx
|
|
476
515
|
var import_react8 = require("react");
|
|
477
516
|
var import_lucide_react2 = require("lucide-react");
|
|
@@ -754,7 +793,7 @@ function useLadderRung(ladder, containerRef, options = {}) {
|
|
|
754
793
|
|
|
755
794
|
// src/ladder/flyout.tsx
|
|
756
795
|
var import_react7 = require("react");
|
|
757
|
-
var
|
|
796
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
758
797
|
var PANEL_GAP = 4;
|
|
759
798
|
function Flyout({
|
|
760
799
|
label,
|
|
@@ -818,7 +857,7 @@ function Flyout({
|
|
|
818
857
|
(0, import_react7.useEffect)(() => {
|
|
819
858
|
if (clickOpen && panelPosition) firstItemRef.current?.focus();
|
|
820
859
|
}, [clickOpen, panelPosition]);
|
|
821
|
-
return /* @__PURE__ */ (0,
|
|
860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
822
861
|
"div",
|
|
823
862
|
{
|
|
824
863
|
"data-testid": "ladder-flyout",
|
|
@@ -826,7 +865,7 @@ function Flyout({
|
|
|
826
865
|
onMouseEnter: () => setHoverOpen(true),
|
|
827
866
|
onMouseLeave: () => setHoverOpen(false),
|
|
828
867
|
children: [
|
|
829
|
-
/* @__PURE__ */ (0,
|
|
868
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
830
869
|
"button",
|
|
831
870
|
{
|
|
832
871
|
ref: triggerRef,
|
|
@@ -849,7 +888,7 @@ function Flyout({
|
|
|
849
888
|
active ? "bg-sidebar-accent text-sidebar-accent-foreground" : "text-sidebar-foreground/70 hover:bg-sidebar-foreground/5 hover:text-sidebar-foreground"
|
|
850
889
|
),
|
|
851
890
|
children: [
|
|
852
|
-
/* @__PURE__ */ (0,
|
|
891
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
853
892
|
Icon,
|
|
854
893
|
{
|
|
855
894
|
className: cn(
|
|
@@ -860,11 +899,11 @@ function Flyout({
|
|
|
860
899
|
"aria-hidden": "true"
|
|
861
900
|
}
|
|
862
901
|
),
|
|
863
|
-
/* @__PURE__ */ (0,
|
|
902
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: cn("truncate", collapsed && "sr-only"), children: label })
|
|
864
903
|
]
|
|
865
904
|
}
|
|
866
905
|
),
|
|
867
|
-
open && panelPosition && /* @__PURE__ */ (0,
|
|
906
|
+
open && panelPosition && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
868
907
|
"div",
|
|
869
908
|
{
|
|
870
909
|
ref: panelRef,
|
|
@@ -886,7 +925,7 @@ function Flyout({
|
|
|
886
925
|
// silently loses the focus-on-open behavior (a console ref
|
|
887
926
|
// warning, not a crash) — same tradeoff any Link-injection
|
|
888
927
|
// pattern accepts; not a regression from today's plain `<a>`.
|
|
889
|
-
/* @__PURE__ */ (0,
|
|
928
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
890
929
|
LinkEl,
|
|
891
930
|
{
|
|
892
931
|
ref: i === 0 ? firstItemRef : void 0,
|
|
@@ -910,7 +949,7 @@ function Flyout({
|
|
|
910
949
|
}
|
|
911
950
|
|
|
912
951
|
// src/app-sidebar.tsx
|
|
913
|
-
var
|
|
952
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
914
953
|
var DEFAULT_COLLAPSE_STORAGE_KEY = "reeve-sidebar-collapsed";
|
|
915
954
|
var COLLAPSED_WIDTH_CLASS = "w-14";
|
|
916
955
|
var EXPANDED_WIDTH_CLASS = "w-64";
|
|
@@ -928,7 +967,7 @@ function NavLink({
|
|
|
928
967
|
}) {
|
|
929
968
|
const Icon = resolveIcon(icon);
|
|
930
969
|
const LinkEl = linkComponent ?? "a";
|
|
931
|
-
return /* @__PURE__ */ (0,
|
|
970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
932
971
|
LinkEl,
|
|
933
972
|
{
|
|
934
973
|
href,
|
|
@@ -948,7 +987,7 @@ function NavLink({
|
|
|
948
987
|
active ? "bg-sidebar-accent text-sidebar-accent-foreground" : "text-sidebar-foreground/70 hover:bg-sidebar-foreground/5 hover:text-sidebar-foreground"
|
|
949
988
|
),
|
|
950
989
|
children: [
|
|
951
|
-
/* @__PURE__ */ (0,
|
|
990
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
952
991
|
Icon,
|
|
953
992
|
{
|
|
954
993
|
className: cn(
|
|
@@ -959,7 +998,7 @@ function NavLink({
|
|
|
959
998
|
"aria-hidden": "true"
|
|
960
999
|
}
|
|
961
1000
|
),
|
|
962
|
-
/* @__PURE__ */ (0,
|
|
1001
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: cn("truncate", collapsed && "sr-only"), children: label })
|
|
963
1002
|
]
|
|
964
1003
|
}
|
|
965
1004
|
);
|
|
@@ -1047,7 +1086,7 @@ function AppSidebar({
|
|
|
1047
1086
|
function renderAppItem(item, testIdPrefix, collapsedRow = false) {
|
|
1048
1087
|
const def = moduleMap.get(item.moduleId);
|
|
1049
1088
|
if (!def) return null;
|
|
1050
|
-
return /* @__PURE__ */ (0,
|
|
1089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1051
1090
|
NavLink,
|
|
1052
1091
|
{
|
|
1053
1092
|
href: def.href,
|
|
@@ -1073,7 +1112,7 @@ function AppSidebar({
|
|
|
1073
1112
|
};
|
|
1074
1113
|
});
|
|
1075
1114
|
const active = children.some((c) => c.active);
|
|
1076
|
-
return /* @__PURE__ */ (0,
|
|
1115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1077
1116
|
Flyout,
|
|
1078
1117
|
{
|
|
1079
1118
|
label: item.label,
|
|
@@ -1091,7 +1130,7 @@ function AppSidebar({
|
|
|
1091
1130
|
function brandBlockFor(collapsedMode) {
|
|
1092
1131
|
if (!brand) return null;
|
|
1093
1132
|
if (collapsedMode) {
|
|
1094
|
-
return /* @__PURE__ */ (0,
|
|
1133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1095
1134
|
"a",
|
|
1096
1135
|
{
|
|
1097
1136
|
href: brand.href,
|
|
@@ -1099,28 +1138,28 @@ function AppSidebar({
|
|
|
1099
1138
|
title: brand.label,
|
|
1100
1139
|
className: "flex items-center justify-center border-b border-sidebar-border px-1 py-4",
|
|
1101
1140
|
children: [
|
|
1102
|
-
/* @__PURE__ */ (0,
|
|
1103
|
-
/* @__PURE__ */ (0,
|
|
1141
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "sr-only", children: brand.label }),
|
|
1142
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BrandGlyph, { brand: { name: brand.label }, size: "xl" })
|
|
1104
1143
|
]
|
|
1105
1144
|
}
|
|
1106
1145
|
);
|
|
1107
1146
|
}
|
|
1108
|
-
return /* @__PURE__ */ (0,
|
|
1147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1109
1148
|
"a",
|
|
1110
1149
|
{
|
|
1111
1150
|
href: brand.href,
|
|
1112
1151
|
"data-testid": "app-sidebar-brand",
|
|
1113
1152
|
className: "flex items-center gap-2.5 border-b border-sidebar-border px-5 py-4 text-sidebar-foreground",
|
|
1114
1153
|
children: [
|
|
1115
|
-
/* @__PURE__ */ (0,
|
|
1116
|
-
/* @__PURE__ */ (0,
|
|
1154
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "grid size-7 place-items-center rounded-md bg-sidebar-primary text-sidebar-primary-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "font-mono text-sm font-bold", children: (brand.label[0] ?? "r").toUpperCase() }) }),
|
|
1155
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "truncate text-sm font-semibold tracking-tight", children: brand.label })
|
|
1117
1156
|
]
|
|
1118
1157
|
}
|
|
1119
1158
|
);
|
|
1120
1159
|
}
|
|
1121
1160
|
function topItemBlock(testId, collapsedMode = false) {
|
|
1122
1161
|
if (!topItem) return null;
|
|
1123
|
-
return /* @__PURE__ */ (0,
|
|
1162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: cn("px-3 pt-4", collapsedMode && "flex justify-center px-0"), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1124
1163
|
NavLink,
|
|
1125
1164
|
{
|
|
1126
1165
|
href: topItem.href,
|
|
@@ -1133,8 +1172,8 @@ function AppSidebar({
|
|
|
1133
1172
|
}
|
|
1134
1173
|
) });
|
|
1135
1174
|
}
|
|
1136
|
-
return /* @__PURE__ */ (0,
|
|
1137
|
-
!isDesktop && /* @__PURE__ */ (0,
|
|
1175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
1176
|
+
!isDesktop && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1138
1177
|
"button",
|
|
1139
1178
|
{
|
|
1140
1179
|
ref: mobileTriggerRef,
|
|
@@ -1146,11 +1185,11 @@ function AppSidebar({
|
|
|
1146
1185
|
onClick: () => setMobileOpen((v) => !v),
|
|
1147
1186
|
style: TOUCH_TARGET_STYLE,
|
|
1148
1187
|
className: "flex items-center justify-center rounded-md border border-border p-2 text-foreground",
|
|
1149
|
-
children: mobileOpen ? /* @__PURE__ */ (0,
|
|
1188
|
+
children: mobileOpen ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.X, { className: "h-5 w-5", "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.Menu, { className: "h-5 w-5", "aria-hidden": "true" })
|
|
1150
1189
|
}
|
|
1151
1190
|
),
|
|
1152
|
-
!isDesktop && mobileOpen && /* @__PURE__ */ (0,
|
|
1153
|
-
/* @__PURE__ */ (0,
|
|
1191
|
+
!isDesktop && mobileOpen && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fixed inset-0 z-50", children: [
|
|
1192
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1154
1193
|
"div",
|
|
1155
1194
|
{
|
|
1156
1195
|
"data-testid": "app-sidebar-mobile-scrim",
|
|
@@ -1159,7 +1198,7 @@ function AppSidebar({
|
|
|
1159
1198
|
onClick: () => setMobileOpen(false)
|
|
1160
1199
|
}
|
|
1161
1200
|
),
|
|
1162
|
-
/* @__PURE__ */ (0,
|
|
1201
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1163
1202
|
"div",
|
|
1164
1203
|
{
|
|
1165
1204
|
ref: mobileDrawerRef,
|
|
@@ -1170,7 +1209,7 @@ function AppSidebar({
|
|
|
1170
1209
|
"data-testid": "app-sidebar-mobile-drawer",
|
|
1171
1210
|
className: "absolute inset-y-0 left-0 flex w-72 flex-col overflow-y-auto border-r border-sidebar-border bg-sidebar",
|
|
1172
1211
|
children: [
|
|
1173
|
-
/* @__PURE__ */ (0,
|
|
1212
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "sticky top-0 z-10 flex justify-end bg-sidebar p-2", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1174
1213
|
"button",
|
|
1175
1214
|
{
|
|
1176
1215
|
ref: mobileCloseRef,
|
|
@@ -1180,19 +1219,19 @@ function AppSidebar({
|
|
|
1180
1219
|
onClick: () => setMobileOpen(false),
|
|
1181
1220
|
style: TOUCH_TARGET_STYLE,
|
|
1182
1221
|
className: "flex items-center justify-center rounded-md p-2 text-sidebar-foreground/70 hover:bg-sidebar-foreground/5 hover:text-sidebar-foreground",
|
|
1183
|
-
children: /* @__PURE__ */ (0,
|
|
1222
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.X, { className: "h-5 w-5", "aria-hidden": "true" })
|
|
1184
1223
|
}
|
|
1185
1224
|
) }),
|
|
1186
1225
|
brandBlockFor(false),
|
|
1187
1226
|
topItemBlock("app-sidebar-mobile-top-item"),
|
|
1188
|
-
/* @__PURE__ */ (0,
|
|
1227
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { className: "flex-1 px-3 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex flex-col gap-0.5", children: rung0.items.map(
|
|
1189
1228
|
(item) => item.type === "app" ? renderAppItem(item, "app-sidebar-mobile-navlink") : null
|
|
1190
1229
|
) }) })
|
|
1191
1230
|
]
|
|
1192
1231
|
}
|
|
1193
1232
|
)
|
|
1194
1233
|
] }),
|
|
1195
|
-
/* @__PURE__ */ (0,
|
|
1234
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1196
1235
|
"aside",
|
|
1197
1236
|
{
|
|
1198
1237
|
"data-testid": "app-sidebar-desktop",
|
|
@@ -1207,18 +1246,18 @@ function AppSidebar({
|
|
|
1207
1246
|
children: [
|
|
1208
1247
|
brandBlockFor(collapsed),
|
|
1209
1248
|
topItemBlock("app-sidebar-top-item", collapsed),
|
|
1210
|
-
/* @__PURE__ */ (0,
|
|
1249
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1211
1250
|
"nav",
|
|
1212
1251
|
{
|
|
1213
1252
|
ref: containerRef,
|
|
1214
1253
|
"data-testid": "app-sidebar-nav",
|
|
1215
1254
|
className: "flex-1 overflow-y-auto px-3 py-4",
|
|
1216
|
-
children: /* @__PURE__ */ (0,
|
|
1255
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex flex-col gap-0.5", children: rung.items.map(
|
|
1217
1256
|
(item) => item.type === "app" ? renderAppItem(item, "app-sidebar-navlink", collapsed) : renderGroupItem(item, collapsed)
|
|
1218
1257
|
) })
|
|
1219
1258
|
}
|
|
1220
1259
|
),
|
|
1221
|
-
collapsible && /* @__PURE__ */ (0,
|
|
1260
|
+
collapsible && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "border-t border-sidebar-border px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1222
1261
|
"button",
|
|
1223
1262
|
{
|
|
1224
1263
|
type: "button",
|
|
@@ -1232,8 +1271,8 @@ function AppSidebar({
|
|
|
1232
1271
|
collapsed && "justify-center px-0"
|
|
1233
1272
|
),
|
|
1234
1273
|
children: [
|
|
1235
|
-
collapsed ? /* @__PURE__ */ (0,
|
|
1236
|
-
/* @__PURE__ */ (0,
|
|
1274
|
+
collapsed ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.PanelLeftOpen, { className: "size-4 shrink-0", strokeWidth: 1.5, "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.PanelLeftClose, { className: "size-4 shrink-0", strokeWidth: 1.5, "aria-hidden": "true" }),
|
|
1275
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: cn("truncate", collapsed && "sr-only"), children: collapsed ? "Expand sidebar" : "Collapse sidebar" })
|
|
1237
1276
|
]
|
|
1238
1277
|
}
|
|
1239
1278
|
) })
|
|
@@ -1272,19 +1311,19 @@ function groupItemsByOrg(rows, get) {
|
|
|
1272
1311
|
|
|
1273
1312
|
// src/lib/dropdown-menu.tsx
|
|
1274
1313
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1275
|
-
var
|
|
1314
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1276
1315
|
function DropdownMenu(props) {
|
|
1277
|
-
return /* @__PURE__ */ (0,
|
|
1316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
1278
1317
|
}
|
|
1279
1318
|
function DropdownMenuTrigger(props) {
|
|
1280
|
-
return /* @__PURE__ */ (0,
|
|
1319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
1281
1320
|
}
|
|
1282
1321
|
function DropdownMenuContent({
|
|
1283
1322
|
className,
|
|
1284
1323
|
sideOffset = 4,
|
|
1285
1324
|
...props
|
|
1286
1325
|
}) {
|
|
1287
|
-
return /* @__PURE__ */ (0,
|
|
1326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1288
1327
|
DropdownMenuPrimitive.Content,
|
|
1289
1328
|
{
|
|
1290
1329
|
"data-slot": "dropdown-menu-content",
|
|
@@ -1301,7 +1340,7 @@ function DropdownMenuItem({
|
|
|
1301
1340
|
className,
|
|
1302
1341
|
...props
|
|
1303
1342
|
}) {
|
|
1304
|
-
return /* @__PURE__ */ (0,
|
|
1343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1305
1344
|
DropdownMenuPrimitive.Item,
|
|
1306
1345
|
{
|
|
1307
1346
|
"data-slot": "dropdown-menu-item",
|
|
@@ -1317,7 +1356,7 @@ function DropdownMenuLabel({
|
|
|
1317
1356
|
className,
|
|
1318
1357
|
...props
|
|
1319
1358
|
}) {
|
|
1320
|
-
return /* @__PURE__ */ (0,
|
|
1359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1321
1360
|
DropdownMenuPrimitive.Label,
|
|
1322
1361
|
{
|
|
1323
1362
|
"data-slot": "dropdown-menu-label",
|
|
@@ -1328,7 +1367,7 @@ function DropdownMenuLabel({
|
|
|
1328
1367
|
}
|
|
1329
1368
|
|
|
1330
1369
|
// src/context-switcher.tsx
|
|
1331
|
-
var
|
|
1370
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1332
1371
|
function groupByOrg(items) {
|
|
1333
1372
|
return groupItemsByOrg(items, {
|
|
1334
1373
|
orgId: (it) => it.orgId,
|
|
@@ -1359,29 +1398,29 @@ function ContextSwitcher({
|
|
|
1359
1398
|
const active = items.find((it) => it.refId === activeRefId) ?? null;
|
|
1360
1399
|
const groups = groupByOrg(items);
|
|
1361
1400
|
const showOrgHeaders = groups.length > 1;
|
|
1362
|
-
return /* @__PURE__ */ (0,
|
|
1363
|
-
/* @__PURE__ */ (0,
|
|
1401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DropdownMenu, { children: [
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownMenuTrigger, { asChild: true, children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1364
1403
|
"button",
|
|
1365
1404
|
{
|
|
1366
1405
|
type: "button",
|
|
1367
1406
|
title: active?.name || placeholder,
|
|
1368
1407
|
"aria-label": active?.name || placeholder,
|
|
1369
1408
|
className: "flex h-10 w-10 items-center justify-center rounded-lg text-sidebar-foreground/70 transition-colors hover:bg-sidebar-foreground/5 hover:text-sidebar-foreground",
|
|
1370
|
-
children: /* @__PURE__ */ (0,
|
|
1409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(BrandGlyph, { brand: toBrand(active ?? { name: "" }), size: "lg" })
|
|
1371
1410
|
}
|
|
1372
|
-
) : /* @__PURE__ */ (0,
|
|
1411
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1373
1412
|
"button",
|
|
1374
1413
|
{
|
|
1375
1414
|
type: "button",
|
|
1376
1415
|
className: "group flex items-center gap-2 rounded-md border border-sidebar-border bg-sidebar-accent/60 px-2.5 py-1.5 text-sm font-medium transition-colors hover:bg-sidebar",
|
|
1377
1416
|
children: [
|
|
1378
|
-
/* @__PURE__ */ (0,
|
|
1379
|
-
/* @__PURE__ */ (0,
|
|
1380
|
-
/* @__PURE__ */ (0,
|
|
1417
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(BrandGlyph, { brand: toBrand(active ?? { name: "" }) }),
|
|
1418
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "max-w-[140px] truncate text-sidebar-accent-foreground", children: active?.name || placeholder }),
|
|
1419
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.ChevronDown, { className: "h-3.5 w-3.5 text-sidebar-foreground/70 transition-transform group-data-[state=open]:rotate-180" })
|
|
1381
1420
|
]
|
|
1382
1421
|
}
|
|
1383
1422
|
) }),
|
|
1384
|
-
/* @__PURE__ */ (0,
|
|
1423
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1385
1424
|
DropdownMenuContent,
|
|
1386
1425
|
{
|
|
1387
1426
|
side,
|
|
@@ -1390,31 +1429,31 @@ function ContextSwitcher({
|
|
|
1390
1429
|
collisionPadding: 8,
|
|
1391
1430
|
className: cn("w-60 overflow-hidden p-0", contentClassName),
|
|
1392
1431
|
children: [
|
|
1393
|
-
groups.map((group) => /* @__PURE__ */ (0,
|
|
1394
|
-
showOrgHeaders && /* @__PURE__ */ (0,
|
|
1395
|
-
/* @__PURE__ */ (0,
|
|
1432
|
+
groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
1433
|
+
showOrgHeaders && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownMenuLabel, { className: "px-3 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: group.orgName ?? "Other" }),
|
|
1434
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: cn(showOrgHeaders && "ml-5 border-l border-border/60"), children: group.items.map((item) => {
|
|
1396
1435
|
const isActive = item.refId === activeRefId;
|
|
1397
|
-
return /* @__PURE__ */ (0,
|
|
1436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1398
1437
|
DropdownMenuItem,
|
|
1399
1438
|
{
|
|
1400
1439
|
"data-active": isActive || void 0,
|
|
1401
1440
|
onSelect: () => onSelect(item),
|
|
1402
1441
|
className: "flex w-full items-center gap-2.5 rounded-none px-3 py-2 text-sm",
|
|
1403
1442
|
children: [
|
|
1404
|
-
/* @__PURE__ */ (0,
|
|
1405
|
-
/* @__PURE__ */ (0,
|
|
1406
|
-
item.kindLabel && /* @__PURE__ */ (0,
|
|
1443
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(BrandGlyph, { brand: toBrand(item), subtle: true }),
|
|
1444
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "flex-1 truncate text-left text-foreground/90", children: item.name }),
|
|
1445
|
+
item.kindLabel && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1407
1446
|
" ",
|
|
1408
|
-
/* @__PURE__ */ (0,
|
|
1447
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: item.kindLabel })
|
|
1409
1448
|
] }),
|
|
1410
|
-
isActive && /* @__PURE__ */ (0,
|
|
1449
|
+
isActive && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.Check, { className: "size-3.5 text-emerald-500" })
|
|
1411
1450
|
]
|
|
1412
1451
|
},
|
|
1413
1452
|
item.refId
|
|
1414
1453
|
);
|
|
1415
1454
|
}) })
|
|
1416
1455
|
] }, group.orgId ?? "unattributed")),
|
|
1417
|
-
footer && /* @__PURE__ */ (0,
|
|
1456
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "sticky bottom-0 border-t border-border bg-popover", children: footer })
|
|
1418
1457
|
]
|
|
1419
1458
|
}
|
|
1420
1459
|
)
|
|
@@ -1423,7 +1462,7 @@ function ContextSwitcher({
|
|
|
1423
1462
|
|
|
1424
1463
|
// src/connector-picker.tsx
|
|
1425
1464
|
var import_react9 = require("react");
|
|
1426
|
-
var
|
|
1465
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1427
1466
|
var DEFAULT_CONNECT_ERROR = "Couldn't start the connection. Please try again.";
|
|
1428
1467
|
var MAX_RECONNECT_REFOCUS_CHECKS = 3;
|
|
1429
1468
|
var RECONNECT_UNCONFIRMED_ERROR = "Couldn't confirm the reconnect \u2014 the connection still reports unhealthy. Try again, or disconnect and reconnect.";
|
|
@@ -1432,7 +1471,6 @@ var DEFAULT_LOAD_ERROR = "Couldn't load connections. Please try again.";
|
|
|
1432
1471
|
var DEFAULT_GRANTS_LOAD_ERROR = "Couldn't load sharing. Please try again.";
|
|
1433
1472
|
var DEFAULT_GRANT_ERROR = "Couldn't share. Please try again.";
|
|
1434
1473
|
var DEFAULT_REVOKE_ERROR = "Couldn't revoke access. Please try again.";
|
|
1435
|
-
var DEFAULT_ORG_DISABLED_REASON = "Org-wide connections aren't available to you.";
|
|
1436
1474
|
var DEFAULT_CREDENTIAL_ERROR = "Couldn't save that credential. Please try again.";
|
|
1437
1475
|
var DEFAULT_CREDENTIAL_TEST_ERROR = "Couldn't test that credential. Please try again.";
|
|
1438
1476
|
var DEFAULT_RECONNECT_MESSAGE = "This connection needs to be reconnected to keep working.";
|
|
@@ -1451,11 +1489,6 @@ function capabilityLabel(capability) {
|
|
|
1451
1489
|
if (capability === "write") return "Write only";
|
|
1452
1490
|
return "Read & write";
|
|
1453
1491
|
}
|
|
1454
|
-
function formatSince(since) {
|
|
1455
|
-
const parsed = new Date(since);
|
|
1456
|
-
if (Number.isNaN(parsed.getTime())) return since;
|
|
1457
|
-
return parsed.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
1458
|
-
}
|
|
1459
1492
|
function errorMessageFrom(err, fallback) {
|
|
1460
1493
|
return err instanceof Error && err.message ? err.message : fallback;
|
|
1461
1494
|
}
|
|
@@ -1677,35 +1710,35 @@ function ConnectorPicker({
|
|
|
1677
1710
|
);
|
|
1678
1711
|
const ownEntries = entries?.filter((entry) => !isSharedWithViewer(entry)) ?? null;
|
|
1679
1712
|
const sharedEntries = entries?.filter(isSharedWithViewer) ?? [];
|
|
1680
|
-
return /* @__PURE__ */ (0,
|
|
1681
|
-
/* @__PURE__ */ (0,
|
|
1682
|
-
entries === null && !loadError && Array.from({ length: SKELETON_COUNT }).map((_, i) => /* @__PURE__ */ (0,
|
|
1713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { "data-testid": "connector-picker", "data-layout": layout, className: "flex flex-col gap-4", children: [
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: containerClassName, children: [
|
|
1715
|
+
entries === null && !loadError && Array.from({ length: SKELETON_COUNT }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1683
1716
|
"div",
|
|
1684
1717
|
{
|
|
1685
1718
|
"data-testid": "connector-picker-skeleton-item",
|
|
1686
1719
|
"aria-hidden": "true",
|
|
1687
1720
|
className: "flex items-center gap-3 rounded-lg border border-border p-3",
|
|
1688
1721
|
children: [
|
|
1689
|
-
/* @__PURE__ */ (0,
|
|
1690
|
-
/* @__PURE__ */ (0,
|
|
1722
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "h-8 w-8 shrink-0 animate-pulse rounded bg-foreground/10" }),
|
|
1723
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "h-3 flex-1 animate-pulse rounded bg-foreground/10" })
|
|
1691
1724
|
]
|
|
1692
1725
|
},
|
|
1693
1726
|
i
|
|
1694
1727
|
)),
|
|
1695
|
-
loadError && /* @__PURE__ */ (0,
|
|
1728
|
+
loadError && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1696
1729
|
"div",
|
|
1697
1730
|
{
|
|
1698
1731
|
role: "alert",
|
|
1699
1732
|
"data-testid": "connector-picker-load-error",
|
|
1700
1733
|
className: "flex items-center justify-between gap-3 rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",
|
|
1701
1734
|
children: [
|
|
1702
|
-
/* @__PURE__ */ (0,
|
|
1703
|
-
/* @__PURE__ */ (0,
|
|
1735
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: loadError }),
|
|
1736
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", onClick: () => void load(), className: "shrink-0 underline", children: "Retry" })
|
|
1704
1737
|
]
|
|
1705
1738
|
}
|
|
1706
1739
|
),
|
|
1707
|
-
entries !== null && entries.length === 0 && !loadError && /* @__PURE__ */ (0,
|
|
1708
|
-
ownEntries?.map((entry) => /* @__PURE__ */ (0,
|
|
1740
|
+
entries !== null && entries.length === 0 && !loadError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { "data-testid": "connector-picker-empty", className: "text-sm text-muted-foreground", children: "No connections available." }),
|
|
1741
|
+
ownEntries?.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1709
1742
|
ConnectorTile,
|
|
1710
1743
|
{
|
|
1711
1744
|
entry,
|
|
@@ -1725,9 +1758,9 @@ function ConnectorPicker({
|
|
|
1725
1758
|
entry.slug
|
|
1726
1759
|
))
|
|
1727
1760
|
] }),
|
|
1728
|
-
sharedEntries.length > 0 && /* @__PURE__ */ (0,
|
|
1729
|
-
/* @__PURE__ */ (0,
|
|
1730
|
-
/* @__PURE__ */ (0,
|
|
1761
|
+
sharedEntries.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("section", { "data-testid": "connector-picker-shared-with-me", className: "flex flex-col gap-2", children: [
|
|
1762
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: "Shared with me" }),
|
|
1763
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: containerClassName, children: sharedEntries.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1731
1764
|
ConnectorTile,
|
|
1732
1765
|
{
|
|
1733
1766
|
entry,
|
|
@@ -1779,11 +1812,11 @@ function ConnectorTile({
|
|
|
1779
1812
|
const guide = entry.guide ?? null;
|
|
1780
1813
|
const canSetUp = !isConnected && (pasteSupported || guide !== null);
|
|
1781
1814
|
const orgPermitted = entry.org_connect?.permitted === true;
|
|
1782
|
-
const
|
|
1815
|
+
const connectKind = orgPermitted ? kind : "personal";
|
|
1783
1816
|
const attribution = ownerLabel(entry);
|
|
1784
1817
|
const canDisconnect = isConnected && !shared;
|
|
1785
1818
|
const canManageSharing = isConnected && entry.connection.owned_by_viewer === true && grantsSupported;
|
|
1786
|
-
return /* @__PURE__ */ (0,
|
|
1819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1787
1820
|
"div",
|
|
1788
1821
|
{
|
|
1789
1822
|
"data-testid": `connector-tile-${entry.slug}`,
|
|
@@ -1791,12 +1824,12 @@ function ConnectorTile({
|
|
|
1791
1824
|
"data-deprecated": entry.deprecated || void 0,
|
|
1792
1825
|
className: cn("flex flex-col p-3", layout === "tiles" && "rounded-lg border border-border"),
|
|
1793
1826
|
children: [
|
|
1794
|
-
/* @__PURE__ */ (0,
|
|
1795
|
-
/* @__PURE__ */ (0,
|
|
1796
|
-
/* @__PURE__ */ (0,
|
|
1797
|
-
/* @__PURE__ */ (0,
|
|
1798
|
-
/* @__PURE__ */ (0,
|
|
1799
|
-
entry.deprecated && /* @__PURE__ */ (0,
|
|
1827
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
1828
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BrandGlyph, { brand: { name: entry.name, logo: entry.logo }, size: "lg" }),
|
|
1829
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1830
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1831
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "truncate text-sm font-medium", children: entry.name }),
|
|
1832
|
+
entry.deprecated && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1800
1833
|
"span",
|
|
1801
1834
|
{
|
|
1802
1835
|
"data-testid": `connector-deprecated-${entry.slug}`,
|
|
@@ -1805,22 +1838,24 @@ function ConnectorTile({
|
|
|
1805
1838
|
}
|
|
1806
1839
|
)
|
|
1807
1840
|
] }),
|
|
1808
|
-
/* @__PURE__ */ (0,
|
|
1809
|
-
/* @__PURE__ */ (0,
|
|
1810
|
-
|
|
1811
|
-
/* @__PURE__ */ (0,
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1841
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
1842
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { "data-testid": `connector-capability-${entry.slug}`, children: capabilityLabel(entry.capability) }),
|
|
1843
|
+
isConnected && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1844
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { "aria-hidden": "true", children: "\xB7" }),
|
|
1845
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1846
|
+
"span",
|
|
1847
|
+
{
|
|
1848
|
+
"data-testid": `connector-connected-${entry.slug}`,
|
|
1849
|
+
className: "inline-flex items-center gap-1",
|
|
1850
|
+
children: [
|
|
1851
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { "aria-hidden": "true", className: "h-1.5 w-1.5 rounded-full bg-emerald-500" }),
|
|
1852
|
+
"Connected"
|
|
1853
|
+
]
|
|
1854
|
+
}
|
|
1855
|
+
)
|
|
1813
1856
|
] })
|
|
1814
1857
|
] }),
|
|
1815
|
-
isConnected && /* @__PURE__ */ (0,
|
|
1816
|
-
"p",
|
|
1817
|
-
{
|
|
1818
|
-
"data-testid": `connector-connected-since-${entry.slug}`,
|
|
1819
|
-
className: "text-xs text-muted-foreground",
|
|
1820
|
-
children: entry.connection.since ? `Connected since ${formatSince(entry.connection.since)}` : "Connected"
|
|
1821
|
-
}
|
|
1822
|
-
),
|
|
1823
|
-
isConnected && !shared && entry.connection.account_label && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1858
|
+
isConnected && !shared && entry.connection.account_label && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1824
1859
|
"p",
|
|
1825
1860
|
{
|
|
1826
1861
|
"data-testid": `connector-account-${entry.slug}`,
|
|
@@ -1831,7 +1866,7 @@ function ConnectorTile({
|
|
|
1831
1866
|
]
|
|
1832
1867
|
}
|
|
1833
1868
|
),
|
|
1834
|
-
isConnected && entry.access_summary && /* @__PURE__ */ (0,
|
|
1869
|
+
isConnected && entry.access_summary && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1835
1870
|
"p",
|
|
1836
1871
|
{
|
|
1837
1872
|
"data-testid": `connector-access-summary-${entry.slug}`,
|
|
@@ -1839,7 +1874,7 @@ function ConnectorTile({
|
|
|
1839
1874
|
children: entry.access_summary
|
|
1840
1875
|
}
|
|
1841
1876
|
),
|
|
1842
|
-
unhealthy && /* @__PURE__ */ (0,
|
|
1877
|
+
unhealthy && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1843
1878
|
"p",
|
|
1844
1879
|
{
|
|
1845
1880
|
role: "alert",
|
|
@@ -1848,7 +1883,7 @@ function ConnectorTile({
|
|
|
1848
1883
|
children: DEFAULT_RECONNECT_MESSAGE
|
|
1849
1884
|
}
|
|
1850
1885
|
),
|
|
1851
|
-
attribution && /* @__PURE__ */ (0,
|
|
1886
|
+
attribution && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1852
1887
|
"p",
|
|
1853
1888
|
{
|
|
1854
1889
|
"data-testid": `connector-owner-${entry.slug}`,
|
|
@@ -1856,7 +1891,7 @@ function ConnectorTile({
|
|
|
1856
1891
|
children: attribution
|
|
1857
1892
|
}
|
|
1858
1893
|
),
|
|
1859
|
-
!isConnected && /* @__PURE__ */ (0,
|
|
1894
|
+
!isConnected && orgPermitted && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1860
1895
|
"div",
|
|
1861
1896
|
{
|
|
1862
1897
|
"data-testid": `connector-kind-toggle-${entry.slug}`,
|
|
@@ -1864,13 +1899,14 @@ function ConnectorTile({
|
|
|
1864
1899
|
"aria-label": "Connect as",
|
|
1865
1900
|
className: "mt-1 flex items-center gap-1",
|
|
1866
1901
|
children: [
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
1902
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1868
1903
|
"button",
|
|
1869
1904
|
{
|
|
1870
1905
|
type: "button",
|
|
1871
1906
|
"data-testid": `connector-kind-personal-${entry.slug}`,
|
|
1872
1907
|
"aria-pressed": kind === "personal",
|
|
1873
1908
|
disabled: isConnecting,
|
|
1909
|
+
title: "Just for you",
|
|
1874
1910
|
onClick: () => setKind("personal"),
|
|
1875
1911
|
className: cn(
|
|
1876
1912
|
"rounded-full border px-2 py-0.5 text-[11px]",
|
|
@@ -1880,37 +1916,30 @@ function ConnectorTile({
|
|
|
1880
1916
|
children: "Personal"
|
|
1881
1917
|
}
|
|
1882
1918
|
),
|
|
1883
|
-
/* @__PURE__ */ (0,
|
|
1919
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1884
1920
|
"button",
|
|
1885
1921
|
{
|
|
1886
1922
|
type: "button",
|
|
1887
1923
|
"data-testid": `connector-kind-org-${entry.slug}`,
|
|
1888
1924
|
"aria-pressed": kind === "org",
|
|
1889
|
-
disabled: isConnecting
|
|
1890
|
-
title:
|
|
1925
|
+
disabled: isConnecting,
|
|
1926
|
+
title: "For your whole org",
|
|
1891
1927
|
onClick: () => setKind("org"),
|
|
1892
1928
|
className: cn(
|
|
1893
1929
|
"rounded-full border px-2 py-0.5 text-[11px]",
|
|
1894
1930
|
kind === "org" ? "border-primary bg-primary/10 font-medium" : "border-border text-muted-foreground",
|
|
1895
1931
|
"disabled:opacity-50"
|
|
1896
1932
|
),
|
|
1897
|
-
children:
|
|
1898
|
-
"Org",
|
|
1899
|
-
!orgPermitted && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "sr-only", children: [
|
|
1900
|
-
" (",
|
|
1901
|
-
orgDisabledReason,
|
|
1902
|
-
")"
|
|
1903
|
-
] })
|
|
1904
|
-
]
|
|
1933
|
+
children: "Org"
|
|
1905
1934
|
}
|
|
1906
1935
|
)
|
|
1907
1936
|
]
|
|
1908
1937
|
}
|
|
1909
1938
|
),
|
|
1910
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
1939
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", "data-testid": `connector-error-${entry.slug}`, className: "text-xs text-destructive", children: errorMessage })
|
|
1911
1940
|
] }),
|
|
1912
|
-
isConnected ? /* @__PURE__ */ (0,
|
|
1913
|
-
unhealthy && !shared && /* @__PURE__ */ (0,
|
|
1941
|
+
isConnected ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex shrink-0 flex-col items-end gap-1", children: [
|
|
1942
|
+
unhealthy && !shared && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1914
1943
|
"button",
|
|
1915
1944
|
{
|
|
1916
1945
|
type: "button",
|
|
@@ -1921,7 +1950,11 @@ function ConnectorTile({
|
|
|
1921
1950
|
children: isConnecting ? "Reconnecting\u2026" : "Reconnect"
|
|
1922
1951
|
}
|
|
1923
1952
|
),
|
|
1924
|
-
canDisconnect &&
|
|
1953
|
+
canDisconnect && // DEV-11580: the revoke reassurance lives in the title only —
|
|
1954
|
+
// as an always-visible paragraph it wrapped to four lines
|
|
1955
|
+
// beside every connected tile. Muted until hover so a
|
|
1956
|
+
// destructive action isn't the loudest thing on the tile.
|
|
1957
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1925
1958
|
"button",
|
|
1926
1959
|
{
|
|
1927
1960
|
type: "button",
|
|
@@ -1929,28 +1962,11 @@ function ConnectorTile({
|
|
|
1929
1962
|
title: DISCONNECT_REVOKES_HINT,
|
|
1930
1963
|
onClick: () => onDisconnect(entry),
|
|
1931
1964
|
disabled: isDisconnecting || isConnecting,
|
|
1932
|
-
className: "shrink-0 rounded-md px-2.5 py-1 text-xs font-medium text-
|
|
1965
|
+
className: "shrink-0 rounded-md px-2.5 py-1 text-xs font-medium text-muted-foreground hover:bg-destructive/10 hover:text-destructive disabled:opacity-50",
|
|
1933
1966
|
children: isDisconnecting ? "Disconnecting\u2026" : "Disconnect"
|
|
1934
1967
|
}
|
|
1935
1968
|
),
|
|
1936
|
-
|
|
1937
|
-
// paragraph's one long sentence forced the WHOLE shrink-0
|
|
1938
|
-
// button column to grow to its natural (unwrapped) width,
|
|
1939
|
-
// squeezing the sibling `min-w-0 flex-1` text column down to
|
|
1940
|
-
// one word per line at any realistic tile width. RTL's jsdom
|
|
1941
|
-
// tests never caught it — jsdom doesn't lay out real flexbox
|
|
1942
|
-
// sizing, so every textContent assertion still passed. A
|
|
1943
|
-
// narrow max-width forces the hint to wrap within the same
|
|
1944
|
-
// footprint as the button above it instead.
|
|
1945
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1946
|
-
"p",
|
|
1947
|
-
{
|
|
1948
|
-
"data-testid": `connector-disconnect-hint-${entry.slug}`,
|
|
1949
|
-
className: "max-w-28 text-right text-[11px] text-muted-foreground",
|
|
1950
|
-
children: DISCONNECT_REVOKES_HINT
|
|
1951
|
-
}
|
|
1952
|
-
),
|
|
1953
|
-
canManageSharing && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1969
|
+
canManageSharing && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1954
1970
|
"button",
|
|
1955
1971
|
{
|
|
1956
1972
|
type: "button",
|
|
@@ -1961,19 +1977,19 @@ function ConnectorTile({
|
|
|
1961
1977
|
children: sharingOpen ? "Hide sharing" : "Manage sharing"
|
|
1962
1978
|
}
|
|
1963
1979
|
)
|
|
1964
|
-
] }) : /* @__PURE__ */ (0,
|
|
1965
|
-
/* @__PURE__ */ (0,
|
|
1980
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex shrink-0 flex-col items-end gap-1", children: [
|
|
1981
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1966
1982
|
"button",
|
|
1967
1983
|
{
|
|
1968
1984
|
type: "button",
|
|
1969
1985
|
"data-testid": `connector-connect-${entry.slug}`,
|
|
1970
|
-
onClick: () => onConnect(entry,
|
|
1986
|
+
onClick: () => onConnect(entry, connectKind),
|
|
1971
1987
|
disabled: isConnecting,
|
|
1972
1988
|
className: "shrink-0 rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground disabled:opacity-50",
|
|
1973
1989
|
children: isConnecting ? "Connecting\u2026" : "Connect"
|
|
1974
1990
|
}
|
|
1975
1991
|
),
|
|
1976
|
-
canSetUp && /* @__PURE__ */ (0,
|
|
1992
|
+
canSetUp && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1977
1993
|
"button",
|
|
1978
1994
|
{
|
|
1979
1995
|
type: "button",
|
|
@@ -1987,20 +2003,20 @@ function ConnectorTile({
|
|
|
1987
2003
|
)
|
|
1988
2004
|
] })
|
|
1989
2005
|
] }),
|
|
1990
|
-
canSetUp && setupOpen && /* @__PURE__ */ (0,
|
|
2006
|
+
canSetUp && setupOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1991
2007
|
"div",
|
|
1992
2008
|
{
|
|
1993
2009
|
id: `connector-setup-panel-${entry.slug}`,
|
|
1994
2010
|
"data-testid": `connector-setup-panel-${entry.slug}`,
|
|
1995
2011
|
className: "mt-2 flex flex-col gap-3 rounded-md border border-border bg-foreground/5 p-2",
|
|
1996
2012
|
children: [
|
|
1997
|
-
guide && /* @__PURE__ */ (0,
|
|
1998
|
-
pasteSupported && /* @__PURE__ */ (0,
|
|
2013
|
+
guide && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SetupGuidePanel, { entry, guide, showVerify: !pasteSupported }),
|
|
2014
|
+
pasteSupported && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1999
2015
|
CredentialForm,
|
|
2000
2016
|
{
|
|
2001
2017
|
entry,
|
|
2002
2018
|
fields: credentialFields,
|
|
2003
|
-
kind,
|
|
2019
|
+
kind: connectKind,
|
|
2004
2020
|
verify: guide?.verify ?? null,
|
|
2005
2021
|
testSupported: credentialTestSupported,
|
|
2006
2022
|
onSubmitCredentials,
|
|
@@ -2010,7 +2026,7 @@ function ConnectorTile({
|
|
|
2010
2026
|
]
|
|
2011
2027
|
}
|
|
2012
2028
|
),
|
|
2013
|
-
canManageSharing && sharingOpen && /* @__PURE__ */ (0,
|
|
2029
|
+
canManageSharing && sharingOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2014
2030
|
ManageSharing,
|
|
2015
2031
|
{
|
|
2016
2032
|
entry,
|
|
@@ -2060,8 +2076,8 @@ function CopyableValue({ value, testId }) {
|
|
|
2060
2076
|
setCopied(false);
|
|
2061
2077
|
}
|
|
2062
2078
|
}, [value]);
|
|
2063
|
-
return /* @__PURE__ */ (0,
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "mt-1 flex items-center gap-1.5", children: [
|
|
2080
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2065
2081
|
"code",
|
|
2066
2082
|
{
|
|
2067
2083
|
"data-testid": `${testId}-value`,
|
|
@@ -2069,7 +2085,7 @@ function CopyableValue({ value, testId }) {
|
|
|
2069
2085
|
children: value
|
|
2070
2086
|
}
|
|
2071
2087
|
),
|
|
2072
|
-
/* @__PURE__ */ (0,
|
|
2088
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2073
2089
|
"button",
|
|
2074
2090
|
{
|
|
2075
2091
|
type: "button",
|
|
@@ -2095,8 +2111,8 @@ function SetupGuidePanel({
|
|
|
2095
2111
|
ungrounded
|
|
2096
2112
|
);
|
|
2097
2113
|
}, [entry.slug, guide, leaked]);
|
|
2098
|
-
return /* @__PURE__ */ (0,
|
|
2099
|
-
leaked && isDevEnvironment() && /* @__PURE__ */ (0,
|
|
2114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { "data-testid": `connector-guide-${entry.slug}`, className: "flex flex-col gap-2", children: [
|
|
2115
|
+
leaked && isDevEnvironment() && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2100
2116
|
"p",
|
|
2101
2117
|
{
|
|
2102
2118
|
role: "alert",
|
|
@@ -2108,25 +2124,25 @@ function SetupGuidePanel({
|
|
|
2108
2124
|
]
|
|
2109
2125
|
}
|
|
2110
2126
|
),
|
|
2111
|
-
prerequisites.length > 0 && /* @__PURE__ */ (0,
|
|
2112
|
-
/* @__PURE__ */ (0,
|
|
2113
|
-
/* @__PURE__ */ (0,
|
|
2127
|
+
prerequisites.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
|
|
2128
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h4", { className: "text-xs font-medium", children: "Before you start" }),
|
|
2129
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2114
2130
|
"ul",
|
|
2115
2131
|
{
|
|
2116
2132
|
"data-testid": `connector-guide-prerequisites-${entry.slug}`,
|
|
2117
2133
|
className: "mt-1 list-disc pl-4 text-xs text-muted-foreground",
|
|
2118
|
-
children: prerequisites.map((item) => /* @__PURE__ */ (0,
|
|
2134
|
+
children: prerequisites.map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { children: item }, item))
|
|
2119
2135
|
}
|
|
2120
2136
|
)
|
|
2121
2137
|
] }),
|
|
2122
|
-
steps.length > 0 && /* @__PURE__ */ (0,
|
|
2138
|
+
steps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2123
2139
|
"ol",
|
|
2124
2140
|
{
|
|
2125
2141
|
"data-testid": `connector-guide-steps-${entry.slug}`,
|
|
2126
2142
|
className: "list-decimal pl-4 text-xs",
|
|
2127
|
-
children: steps.map((step, index) => /* @__PURE__ */ (0,
|
|
2128
|
-
/* @__PURE__ */ (0,
|
|
2129
|
-
step.copyable && /* @__PURE__ */ (0,
|
|
2143
|
+
children: steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("li", { className: "mt-1 first:mt-0", children: [
|
|
2144
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: step.text }),
|
|
2145
|
+
step.copyable && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2130
2146
|
CopyableValue,
|
|
2131
2147
|
{
|
|
2132
2148
|
value: step.copyable,
|
|
@@ -2136,7 +2152,7 @@ function SetupGuidePanel({
|
|
|
2136
2152
|
] }, step.text))
|
|
2137
2153
|
}
|
|
2138
2154
|
),
|
|
2139
|
-
scopeNote && /* @__PURE__ */ (0,
|
|
2155
|
+
scopeNote && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2140
2156
|
"p",
|
|
2141
2157
|
{
|
|
2142
2158
|
"data-testid": `connector-guide-scope-note-${entry.slug}`,
|
|
@@ -2144,7 +2160,7 @@ function SetupGuidePanel({
|
|
|
2144
2160
|
children: scopeNote
|
|
2145
2161
|
}
|
|
2146
2162
|
),
|
|
2147
|
-
showVerify && verify && /* @__PURE__ */ (0,
|
|
2163
|
+
showVerify && verify && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2148
2164
|
"p",
|
|
2149
2165
|
{
|
|
2150
2166
|
"data-testid": `connector-guide-verify-${entry.slug}`,
|
|
@@ -2208,7 +2224,7 @@ function CredentialForm({
|
|
|
2208
2224
|
setBusy(false);
|
|
2209
2225
|
}
|
|
2210
2226
|
}, [kind, onSubmitCredentials, values]);
|
|
2211
|
-
return /* @__PURE__ */ (0,
|
|
2227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2212
2228
|
"form",
|
|
2213
2229
|
{
|
|
2214
2230
|
"data-testid": `connector-credential-form-${entry.slug}`,
|
|
@@ -2222,12 +2238,12 @@ function CredentialForm({
|
|
|
2222
2238
|
fields.map((field) => {
|
|
2223
2239
|
const inputId = `connector-credential-${entry.slug}-${field.key}`;
|
|
2224
2240
|
const fieldError = fieldErrors?.[field.key] ?? null;
|
|
2225
|
-
return /* @__PURE__ */ (0,
|
|
2226
|
-
/* @__PURE__ */ (0,
|
|
2241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { htmlFor: inputId, className: "text-xs font-medium", children: [
|
|
2227
2243
|
field.label,
|
|
2228
|
-
field.required !== false && /* @__PURE__ */ (0,
|
|
2244
|
+
field.required !== false && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { "aria-hidden": "true", className: "ml-0.5 text-destructive", children: "*" })
|
|
2229
2245
|
] }),
|
|
2230
|
-
/* @__PURE__ */ (0,
|
|
2246
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2231
2247
|
"input",
|
|
2232
2248
|
{
|
|
2233
2249
|
id: inputId,
|
|
@@ -2247,7 +2263,7 @@ function CredentialForm({
|
|
|
2247
2263
|
)
|
|
2248
2264
|
}
|
|
2249
2265
|
),
|
|
2250
|
-
fieldError && /* @__PURE__ */ (0,
|
|
2266
|
+
fieldError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2251
2267
|
"p",
|
|
2252
2268
|
{
|
|
2253
2269
|
id: `${inputId}-error`,
|
|
@@ -2258,7 +2274,7 @@ function CredentialForm({
|
|
|
2258
2274
|
)
|
|
2259
2275
|
] }, field.key);
|
|
2260
2276
|
}),
|
|
2261
|
-
verify && /* @__PURE__ */ (0,
|
|
2277
|
+
verify && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2262
2278
|
"p",
|
|
2263
2279
|
{
|
|
2264
2280
|
"data-testid": `connector-guide-verify-${entry.slug}`,
|
|
@@ -2266,8 +2282,8 @@ function CredentialForm({
|
|
|
2266
2282
|
children: verify
|
|
2267
2283
|
}
|
|
2268
2284
|
),
|
|
2269
|
-
result && /* @__PURE__ */ (0,
|
|
2270
|
-
error && /* @__PURE__ */ (0,
|
|
2285
|
+
result && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CredentialTestResult, { entry, result }),
|
|
2286
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2271
2287
|
"p",
|
|
2272
2288
|
{
|
|
2273
2289
|
role: "alert",
|
|
@@ -2276,8 +2292,8 @@ function CredentialForm({
|
|
|
2276
2292
|
children: error
|
|
2277
2293
|
}
|
|
2278
2294
|
),
|
|
2279
|
-
/* @__PURE__ */ (0,
|
|
2280
|
-
testSupported && /* @__PURE__ */ (0,
|
|
2295
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center justify-end gap-1.5", children: [
|
|
2296
|
+
testSupported && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2281
2297
|
"button",
|
|
2282
2298
|
{
|
|
2283
2299
|
type: "button",
|
|
@@ -2288,7 +2304,7 @@ function CredentialForm({
|
|
|
2288
2304
|
children: testing ? "Testing\u2026" : "Test connection"
|
|
2289
2305
|
}
|
|
2290
2306
|
),
|
|
2291
|
-
/* @__PURE__ */ (0,
|
|
2307
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2292
2308
|
"button",
|
|
2293
2309
|
{
|
|
2294
2310
|
type: "submit",
|
|
@@ -2309,15 +2325,15 @@ function CredentialTestResult({
|
|
|
2309
2325
|
result
|
|
2310
2326
|
}) {
|
|
2311
2327
|
if (result.valid === true) {
|
|
2312
|
-
return /* @__PURE__ */ (0,
|
|
2328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2313
2329
|
"div",
|
|
2314
2330
|
{
|
|
2315
2331
|
role: "status",
|
|
2316
2332
|
"data-testid": `connector-credential-test-pass-${entry.slug}`,
|
|
2317
2333
|
className: "rounded-md border border-primary/30 bg-primary/5 px-2 py-1 text-xs",
|
|
2318
2334
|
children: [
|
|
2319
|
-
/* @__PURE__ */ (0,
|
|
2320
|
-
result.permissions_note && /* @__PURE__ */ (0,
|
|
2335
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: result.account_name ? `Verified \u2014 connected as ${result.account_name}.` : "Verified \u2014 these credentials work." }),
|
|
2336
|
+
result.permissions_note && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2321
2337
|
"p",
|
|
2322
2338
|
{
|
|
2323
2339
|
"data-testid": `connector-credential-permissions-${entry.slug}`,
|
|
@@ -2330,7 +2346,7 @@ function CredentialTestResult({
|
|
|
2330
2346
|
);
|
|
2331
2347
|
}
|
|
2332
2348
|
if (result.valid === false) {
|
|
2333
|
-
return /* @__PURE__ */ (0,
|
|
2349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2334
2350
|
"p",
|
|
2335
2351
|
{
|
|
2336
2352
|
role: "alert",
|
|
@@ -2340,7 +2356,7 @@ function CredentialTestResult({
|
|
|
2340
2356
|
}
|
|
2341
2357
|
);
|
|
2342
2358
|
}
|
|
2343
|
-
return /* @__PURE__ */ (0,
|
|
2359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2344
2360
|
"p",
|
|
2345
2361
|
{
|
|
2346
2362
|
role: "status",
|
|
@@ -2403,13 +2419,13 @@ function ManageSharing({
|
|
|
2403
2419
|
},
|
|
2404
2420
|
[load, revokeGrant]
|
|
2405
2421
|
);
|
|
2406
|
-
return /* @__PURE__ */ (0,
|
|
2422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2407
2423
|
"div",
|
|
2408
2424
|
{
|
|
2409
2425
|
"data-testid": `connector-sharing-panel-${entry.slug}`,
|
|
2410
2426
|
className: "mt-2 flex flex-col gap-2 rounded-md border border-border bg-foreground/5 p-2",
|
|
2411
2427
|
children: [
|
|
2412
|
-
grants === null && !error && /* @__PURE__ */ (0,
|
|
2428
|
+
grants === null && !error && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2413
2429
|
"p",
|
|
2414
2430
|
{
|
|
2415
2431
|
"data-testid": `connector-grants-loading-${entry.slug}`,
|
|
@@ -2417,7 +2433,7 @@ function ManageSharing({
|
|
|
2417
2433
|
children: "Loading sharing\u2026"
|
|
2418
2434
|
}
|
|
2419
2435
|
),
|
|
2420
|
-
error && /* @__PURE__ */ (0,
|
|
2436
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2421
2437
|
"p",
|
|
2422
2438
|
{
|
|
2423
2439
|
role: "alert",
|
|
@@ -2426,7 +2442,7 @@ function ManageSharing({
|
|
|
2426
2442
|
children: error
|
|
2427
2443
|
}
|
|
2428
2444
|
),
|
|
2429
|
-
grants !== null && grants.length === 0 && /* @__PURE__ */ (0,
|
|
2445
|
+
grants !== null && grants.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2430
2446
|
"p",
|
|
2431
2447
|
{
|
|
2432
2448
|
"data-testid": `connector-grants-empty-${entry.slug}`,
|
|
@@ -2434,21 +2450,21 @@ function ManageSharing({
|
|
|
2434
2450
|
children: "Not shared with anyone yet."
|
|
2435
2451
|
}
|
|
2436
2452
|
),
|
|
2437
|
-
grants?.map((grant) => /* @__PURE__ */ (0,
|
|
2453
|
+
grants?.map((grant) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2438
2454
|
"div",
|
|
2439
2455
|
{
|
|
2440
2456
|
"data-testid": `connector-grant-${entry.slug}-${grant.id}`,
|
|
2441
2457
|
className: "flex items-center justify-between gap-2 text-xs",
|
|
2442
2458
|
children: [
|
|
2443
|
-
/* @__PURE__ */ (0,
|
|
2459
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "truncate", children: [
|
|
2444
2460
|
grant.grantee_name || grant.grantee_id,
|
|
2445
|
-
/* @__PURE__ */ (0,
|
|
2461
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "text-muted-foreground", children: [
|
|
2446
2462
|
" ",
|
|
2447
2463
|
"\xB7 ",
|
|
2448
2464
|
grant.grantee_type === "role" ? "Role" : "User"
|
|
2449
2465
|
] })
|
|
2450
2466
|
] }),
|
|
2451
|
-
/* @__PURE__ */ (0,
|
|
2467
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2452
2468
|
"button",
|
|
2453
2469
|
{
|
|
2454
2470
|
type: "button",
|
|
@@ -2463,8 +2479,8 @@ function ManageSharing({
|
|
|
2463
2479
|
},
|
|
2464
2480
|
grant.id
|
|
2465
2481
|
)),
|
|
2466
|
-
/* @__PURE__ */ (0,
|
|
2467
|
-
/* @__PURE__ */ (0,
|
|
2482
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
2483
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2468
2484
|
"select",
|
|
2469
2485
|
{
|
|
2470
2486
|
"data-testid": `connector-grant-type-${entry.slug}`,
|
|
@@ -2477,12 +2493,12 @@ function ManageSharing({
|
|
|
2477
2493
|
disabled: busy,
|
|
2478
2494
|
className: "rounded-md border border-border bg-transparent px-1.5 py-1 text-xs disabled:opacity-50",
|
|
2479
2495
|
children: [
|
|
2480
|
-
/* @__PURE__ */ (0,
|
|
2481
|
-
/* @__PURE__ */ (0,
|
|
2496
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "user", children: "User" }),
|
|
2497
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "role", children: "Role" })
|
|
2482
2498
|
]
|
|
2483
2499
|
}
|
|
2484
2500
|
),
|
|
2485
|
-
granteeType === "user" ? /* @__PURE__ */ (0,
|
|
2501
|
+
granteeType === "user" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2486
2502
|
"input",
|
|
2487
2503
|
{
|
|
2488
2504
|
"data-testid": `connector-grant-grantee-${entry.slug}`,
|
|
@@ -2493,7 +2509,7 @@ function ManageSharing({
|
|
|
2493
2509
|
disabled: busy,
|
|
2494
2510
|
className: "min-w-0 flex-1 rounded-md border border-border bg-transparent px-1.5 py-1 text-xs disabled:opacity-50"
|
|
2495
2511
|
}
|
|
2496
|
-
) : /* @__PURE__ */ (0,
|
|
2512
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2497
2513
|
"select",
|
|
2498
2514
|
{
|
|
2499
2515
|
"data-testid": `connector-grant-role-${entry.slug}`,
|
|
@@ -2503,12 +2519,12 @@ function ManageSharing({
|
|
|
2503
2519
|
disabled: busy,
|
|
2504
2520
|
className: "min-w-0 flex-1 rounded-md border border-border bg-transparent px-1.5 py-1 text-xs disabled:opacity-50",
|
|
2505
2521
|
children: [
|
|
2506
|
-
/* @__PURE__ */ (0,
|
|
2507
|
-
roleOptions.map((role) => /* @__PURE__ */ (0,
|
|
2522
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "", children: "Select a role\u2026" }),
|
|
2523
|
+
roleOptions.map((role) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: role.id, children: role.name }, role.id))
|
|
2508
2524
|
]
|
|
2509
2525
|
}
|
|
2510
2526
|
),
|
|
2511
|
-
/* @__PURE__ */ (0,
|
|
2527
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2512
2528
|
"button",
|
|
2513
2529
|
{
|
|
2514
2530
|
type: "button",
|
|
@@ -2532,6 +2548,7 @@ function ManageSharing({
|
|
|
2532
2548
|
ContextSwitcher,
|
|
2533
2549
|
Flyout,
|
|
2534
2550
|
GLYPH_CANVAS_FILL,
|
|
2551
|
+
InfoTip,
|
|
2535
2552
|
LOCKUP_GAP,
|
|
2536
2553
|
LOCKUP_ROW,
|
|
2537
2554
|
MARK_CAP_RATIO,
|