@ai-matrx/sharing 0.1.3 → 0.1.5

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/react.cjs CHANGED
@@ -72,6 +72,7 @@ module.exports = __toCommonJS(react_exports);
72
72
  // src/react/sheet/host.tsx
73
73
  var import_react = require("react");
74
74
  var import_design_system = require("@ai-matrx/design-system");
75
+ var import_controls = require("@ai-matrx/design-system/controls");
75
76
  var import_clipboard = require("@ai-matrx/kit/clipboard");
76
77
  var import_confirm_opener = require("@ai-matrx/kit/confirm-opener");
77
78
  var import_core = require("@ai-matrx/sharing/core");
@@ -88,11 +89,10 @@ function DefaultCopyButtons(props) {
88
89
  return Array.isArray(v) ? v.join("\n") : String(v ?? "");
89
90
  };
90
91
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
91
- import_design_system.Button,
92
+ import_controls.Button,
92
93
  {
93
94
  type: "button",
94
- variant: "ghost",
95
- size: "sm",
95
+ variant: "quiet",
96
96
  className: props.className,
97
97
  onClick: () => {
98
98
  void (0, import_clipboard.copyText)(text()).then(() => {
@@ -104,8 +104,26 @@ function DefaultCopyButtons(props) {
104
104
  }
105
105
  );
106
106
  }
107
+ var announced = /* @__PURE__ */ new Set();
108
+ function announceStandIn(port) {
109
+ if (announced.has(port)) return;
110
+ announced.add(port);
111
+ console.warn(
112
+ `[share] The share sheet is using its built-in stand-in for "${port}": the host did not pass it, so that part of the sheet is absent. Pass it with configureShareSheetUi({ ${port} }).`
113
+ );
114
+ }
115
+ function StandIn({ port }) {
116
+ (0, import_react.useEffect)(() => announceStandIn(port), [port]);
117
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { hidden: true, "data-share-sheet-host": "unconfigured", "data-share-sheet-port": port });
118
+ }
107
119
  function DefaultErrorMenu(_props) {
108
- return null;
120
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StandIn, { port: "ErrorAlchemyMenu" });
121
+ }
122
+ function DefaultPageCaptureButton(_props) {
123
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StandIn, { port: "PageCaptureButton" });
124
+ }
125
+ function DefaultEntityDoorControls(_props) {
126
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StandIn, { port: "EntityDoorControls" });
109
127
  }
110
128
  function DefaultInfoHint(props) {
111
129
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { title: String(props.text ?? ""), "aria-label": String(props.label ?? "More info"), className: "cursor-help text-muted-foreground", children: "\u24D8" });
@@ -215,14 +233,23 @@ var DEFAULTS = {
215
233
  useUserConnections: useDefaultConnections,
216
234
  confirm: (o) => (0, import_confirm_opener.confirm)(o),
217
235
  CopyButtons: DefaultCopyButtons,
218
- csvExportItem: () => null,
219
- jsonExportItem: () => null,
220
- usePageCapture: () => void 0,
236
+ csvExportItem: () => {
237
+ announceStandIn("csvExportItem");
238
+ return null;
239
+ },
240
+ jsonExportItem: () => {
241
+ announceStandIn("jsonExportItem");
242
+ return null;
243
+ },
244
+ usePageCapture: () => {
245
+ announceStandIn("usePageCapture");
246
+ return void 0;
247
+ },
221
248
  dialogCapture: (input) => input,
222
- PageCaptureButton: () => null,
249
+ PageCaptureButton: DefaultPageCaptureButton,
223
250
  ErrorAlchemyMenu: DefaultErrorMenu,
224
251
  InfoHint: DefaultInfoHint,
225
- EntityDoorControls: () => null,
252
+ EntityDoorControls: DefaultEntityDoorControls,
226
253
  EntityRef: DefaultEntityRef,
227
254
  UserAvatarDisplay: DefaultUserAvatar,
228
255
  ConnectionsReadNotice: DefaultConnectionsNotice,
@@ -241,7 +268,7 @@ function shareSheetUi() {
241
268
  function useToast() {
242
269
  return { toast: (o) => ui.toast(o) };
243
270
  }
244
- function copyNotify(message, kind) {
271
+ function shareCopyNotify(message, kind) {
245
272
  ui.toast({ title: message, ...kind === "error" ? { variant: "destructive" } : {} });
246
273
  }
247
274
  var confirm = (options) => ui.confirm(options);
@@ -255,10 +282,10 @@ var csvExportItem = (...args) => ui.csvExportItem(...args);
255
282
  var jsonExportItem = (...args) => ui.jsonExportItem(...args);
256
283
  var CopyButtons = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.CopyButtons, { ...p });
257
284
  var PageCaptureButton = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.PageCaptureButton, { ...p });
258
- var ErrorAlchemyMenu = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.ErrorAlchemyMenu, { ...p });
285
+ var ShareErrorAlchemyMenu = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.ErrorAlchemyMenu, { ...p });
259
286
  var InfoHint = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.InfoHint, { ...p });
260
- var EntityDoorControls = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.EntityDoorControls, { ...p });
261
- var EntityRef = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.EntityRef, { ...p });
287
+ var ShareEntityDoorControls = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.EntityDoorControls, { ...p });
288
+ var ShareEntityRef = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.EntityRef, { ...p });
262
289
  var UserAvatarDisplay = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.UserAvatarDisplay, { ...p });
263
290
  var ConnectionsReadNotice = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.ConnectionsReadNotice, { ...p });
264
291
  var UserSearchField = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ui.UserSearchField, { ...p });
@@ -266,6 +293,7 @@ var defaultIdentity = null;
266
293
  var usePortalContainer = () => ui.usePortalContainer();
267
294
  var vaultIdentity = () => {
268
295
  if (ui.vaultIdentity) return ui.vaultIdentity;
296
+ announceStandIn("vaultIdentity");
269
297
  if (!defaultIdentity) {
270
298
  defaultIdentity = (0, import_vault.createSupabaseIdentity)((0, import_core2.shareClient)().auth, {
271
299
  redirectTo: () => window.location.href,
@@ -381,12 +409,12 @@ var import_react17 = require("react");
381
409
  var import_design_system2 = require("@ai-matrx/design-system");
382
410
 
383
411
  // src/react/sheet/ShareModal.tsx
384
- var import_design_system33 = require("@ai-matrx/design-system");
385
- var import_controls11 = require("@ai-matrx/design-system/controls");
412
+ var import_design_system25 = require("@ai-matrx/design-system");
413
+ var import_controls19 = require("@ai-matrx/design-system/controls");
386
414
 
387
415
  // src/react/sheet/ui/share-tabs-trigger.tsx
388
416
  var React = __toESM(require("react"), 1);
389
- var import_controls = require("@ai-matrx/design-system/controls");
417
+ var import_controls2 = require("@ai-matrx/design-system/controls");
390
418
  var import_jsx_runtime2 = require("react/jsx-runtime");
391
419
  function focusOnClick(onClick) {
392
420
  return (event) => {
@@ -398,12 +426,12 @@ function focusOnClick(onClick) {
398
426
  };
399
427
  }
400
428
  var ShareTabsTrigger = React.forwardRef(
401
- ({ onClick, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_controls.TabsTrigger, { ...props, ref, onClick: focusOnClick(onClick) })
429
+ ({ onClick, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_controls2.TabsTrigger, { ...props, ref, onClick: focusOnClick(onClick) })
402
430
  );
403
431
  ShareTabsTrigger.displayName = "ShareTabsTrigger";
404
432
 
405
433
  // src/react/sheet/ShareModal.tsx
406
- var import_design_system34 = require("@ai-matrx/design-system");
434
+ var import_controls20 = require("@ai-matrx/design-system/controls");
407
435
  var import_lucide_react14 = require("lucide-react");
408
436
 
409
437
  // src/react/permissionHooks.ts
@@ -876,16 +904,16 @@ function useGrantableLevels(resourceType, resourceId, enabled, refreshKey) {
876
904
 
877
905
  // src/react/sheet/ShareModal.tsx
878
906
  var import_core35 = require("@ai-matrx/sharing/core");
879
- var import_design_system35 = require("@ai-matrx/design-system");
907
+ var import_design_system26 = require("@ai-matrx/design-system");
880
908
  var import_lucide_react15 = require("lucide-react");
881
909
 
882
910
  // src/react/sheet/PermissionsList.tsx
883
911
  var import_react4 = require("react");
912
+ var import_controls3 = require("@ai-matrx/design-system/controls");
884
913
  var import_design_system5 = require("@ai-matrx/design-system");
885
- var import_design_system6 = require("@ai-matrx/design-system");
886
914
  var import_cn = require("@ai-matrx/design-system/cn");
887
- var import_design_system7 = require("@ai-matrx/design-system");
888
- var import_controls2 = require("@ai-matrx/design-system/controls");
915
+ var import_design_system6 = require("@ai-matrx/design-system");
916
+ var import_controls4 = require("@ai-matrx/design-system/controls");
889
917
  var import_lucide_react2 = require("lucide-react");
890
918
 
891
919
  // src/react/sheet/PermissionBadge.tsx
@@ -1206,7 +1234,7 @@ function PermissionsList({
1206
1234
  // `group` is what reveals the door controls below on hover — without
1207
1235
  // it EntityDoorControls renders at opacity-0 and the door is
1208
1236
  // invisible, which is the failure this campaign has hit four times.
1209
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system6.Card, { size: "sm", className: "group px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2", children: [
1237
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system5.Card, { size: "sm", className: "group px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2", children: [
1210
1238
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
1211
1239
  permission.grantedToUser && !permission.isPublic ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1212
1240
  UserAvatarDisplay,
@@ -1220,7 +1248,7 @@ function PermissionsList({
1220
1248
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "text-sm font-semibold truncate leading-none", children: getPermissionLabel(permission) }),
1221
1249
  permission.grantedToUser?.isGuest && !permission.isPublic ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GuestBadge, {}) : null,
1222
1250
  permission.grantedToOrganization && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1223
- EntityDoorControls,
1251
+ ShareEntityDoorControls,
1224
1252
  {
1225
1253
  token: "organization",
1226
1254
  id: permission.grantedToOrganization.id,
@@ -1269,33 +1297,31 @@ function PermissionsList({
1269
1297
  ) }),
1270
1298
  isOwner ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1271
1299
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1272
- import_design_system7.Select,
1300
+ import_design_system6.Select,
1273
1301
  {
1274
1302
  value: permission.permissionLevel,
1275
1303
  onValueChange: (value) => handleUpdateLevel(permission, value),
1276
1304
  disabled: isUpdating || isRevoking,
1277
1305
  children: [
1278
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_controls2.SelectTrigger, { className: "w-[140px]", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system7.SelectValue, {}) }),
1279
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_design_system7.SelectContent, { children: [
1280
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system7.SelectItem, { value: "viewer", title: import_core9.PERMISSION_LEVEL_HINTS.viewer, children: import_core9.PERMISSION_LEVEL_SHORT_LABELS.viewer }),
1281
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system7.SelectItem, { value: "commenter", title: import_core9.PERMISSION_LEVEL_HINTS.commenter, children: import_core9.PERMISSION_LEVEL_SHORT_LABELS.commenter }),
1282
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system7.SelectItem, { value: "editor", title: import_core9.PERMISSION_LEVEL_HINTS.editor, children: import_core9.PERMISSION_LEVEL_SHORT_LABELS.editor }),
1283
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system7.SelectItem, { value: "admin", title: import_core9.PERMISSION_LEVEL_HINTS.admin, children: import_core9.PERMISSION_LEVEL_SHORT_LABELS.admin })
1306
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_controls4.SelectTrigger, { className: "w-[140px]", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system6.SelectValue, {}) }),
1307
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_design_system6.SelectContent, { children: [
1308
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system6.SelectItem, { value: "viewer", title: import_core9.PERMISSION_LEVEL_HINTS.viewer, children: import_core9.PERMISSION_LEVEL_SHORT_LABELS.viewer }),
1309
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system6.SelectItem, { value: "commenter", title: import_core9.PERMISSION_LEVEL_HINTS.commenter, children: import_core9.PERMISSION_LEVEL_SHORT_LABELS.commenter }),
1310
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system6.SelectItem, { value: "editor", title: import_core9.PERMISSION_LEVEL_HINTS.editor, children: import_core9.PERMISSION_LEVEL_SHORT_LABELS.editor }),
1311
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system6.SelectItem, { value: "admin", title: import_core9.PERMISSION_LEVEL_HINTS.admin, children: import_core9.PERMISSION_LEVEL_SHORT_LABELS.admin })
1284
1312
  ] })
1285
1313
  ]
1286
1314
  }
1287
1315
  ),
1288
1316
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1289
- import_design_system5.Button,
1317
+ import_controls3.Button,
1290
1318
  {
1291
- variant: "ghost",
1292
- size: "icon",
1293
- className: "h-7 w-7",
1319
+ icon: isRevoking ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.Loader2, { className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.X, {}),
1320
+ variant: "quiet",
1294
1321
  "aria-label": `Revoke access for ${getPermissionLabel(permission)}`,
1295
1322
  title: `Revoke access for ${getPermissionLabel(permission)}`,
1296
1323
  onClick: () => setConfirmRevoke({ open: true, permission }),
1297
- disabled: isUpdating || isRevoking,
1298
- children: isRevoking ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.Loader2, { className: "w-3 h-3 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.X, { className: "w-3 h-3" })
1324
+ disabled: isUpdating || isRevoking
1299
1325
  }
1300
1326
  )
1301
1327
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: permission.isPublic ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PublicBadge, { variant: "compact" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
@@ -1497,7 +1523,7 @@ function AccessSummaryPanel({
1497
1523
  children: "Retry"
1498
1524
  }
1499
1525
  ),
1500
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ErrorAlchemyMenu, { error })
1526
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ShareErrorAlchemyMenu, { error })
1501
1527
  ]
1502
1528
  }
1503
1529
  );
@@ -1612,16 +1638,16 @@ function ReasonRow({
1612
1638
 
1613
1639
  // src/react/sheet/ShareWithUserTab.tsx
1614
1640
  var import_react7 = require("react");
1615
- var import_design_system14 = require("@ai-matrx/design-system");
1616
- var import_design_system15 = require("@ai-matrx/design-system");
1617
- var import_design_system16 = require("@ai-matrx/design-system");
1618
- var import_controls4 = require("@ai-matrx/design-system/controls");
1641
+ var import_controls7 = require("@ai-matrx/design-system/controls");
1642
+ var import_design_system12 = require("@ai-matrx/design-system");
1643
+ var import_design_system13 = require("@ai-matrx/design-system");
1644
+ var import_controls8 = require("@ai-matrx/design-system/controls");
1619
1645
 
1620
1646
  // src/react/sheet/ui/scroll-area.tsx
1621
- var import_design_system8 = require("@ai-matrx/design-system");
1647
+ var import_design_system7 = require("@ai-matrx/design-system");
1622
1648
 
1623
1649
  // src/react/sheet/ui/avatar.tsx
1624
- var import_design_system9 = require("@ai-matrx/design-system");
1650
+ var import_design_system8 = require("@ai-matrx/design-system");
1625
1651
 
1626
1652
  // src/react/sheet/ShareWithUserTab.tsx
1627
1653
  var import_lucide_react5 = require("lucide-react");
@@ -1635,11 +1661,11 @@ var import_core12 = require("@ai-matrx/sharing/core");
1635
1661
  var import_core13 = require("@ai-matrx/sharing/core");
1636
1662
  var import_react6 = require("react");
1637
1663
  var import_lucide_react4 = require("lucide-react");
1664
+ var import_controls5 = require("@ai-matrx/design-system/controls");
1665
+ var import_design_system9 = require("@ai-matrx/design-system");
1638
1666
  var import_design_system10 = require("@ai-matrx/design-system");
1639
1667
  var import_design_system11 = require("@ai-matrx/design-system");
1640
- var import_design_system12 = require("@ai-matrx/design-system");
1641
- var import_design_system13 = require("@ai-matrx/design-system");
1642
- var import_controls3 = require("@ai-matrx/design-system/controls");
1668
+ var import_controls6 = require("@ai-matrx/design-system/controls");
1643
1669
  var import_core14 = require("@ai-matrx/sharing/core");
1644
1670
  var import_core15 = require("@ai-matrx/sharing/core");
1645
1671
  var import_jsx_runtime6 = require("react/jsx-runtime");
@@ -1755,21 +1781,19 @@ function AddEveryoneInOrg({
1755
1781
  };
1756
1782
  if (orgs.length === 0) return null;
1757
1783
  if (!open) {
1758
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1759
- import_design_system10.Button,
1784
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1785
+ import_controls5.Button,
1760
1786
  {
1787
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Users, {}),
1761
1788
  type: "button",
1762
1789
  variant: "outline",
1763
- className: "w-full h-9",
1790
+ className: "w-full",
1764
1791
  onClick: () => {
1765
1792
  if (!orgId && defaultOrgId && orgs.some((o) => o.id === defaultOrgId))
1766
1793
  setOrgId(defaultOrgId);
1767
1794
  setOpen(true);
1768
1795
  },
1769
- children: [
1770
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Users, { className: "w-4 h-4 mr-2" }),
1771
- "Add everyone in an organization or team"
1772
- ]
1796
+ children: "Add everyone in an organization or team"
1773
1797
  }
1774
1798
  );
1775
1799
  }
@@ -1787,10 +1811,10 @@ function AddEveryoneInOrg({
1787
1811
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "type-secondary text-muted-foreground", children: "Each person below is given access by name. People who join later are not added." })
1788
1812
  ] }),
1789
1813
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "space-y-1.5", children: [
1790
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system12.Label, { htmlFor: "add-everyone-org", className: "text-xs", children: "Organization" }),
1791
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system13.Select, { value: orgId, onValueChange: setOrgId, disabled: running, children: [
1792
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_controls3.SelectTrigger, { id: "add-everyone-org", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system13.SelectValue, { placeholder: "Choose one of your organizations" }) }),
1793
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system13.SelectContent, { children: orgs.map((org) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system13.SelectItem, { value: org.id, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2", children: [
1814
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system10.Label, { htmlFor: "add-everyone-org", className: "text-xs", children: "Organization" }),
1815
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system11.Select, { value: orgId, onValueChange: setOrgId, disabled: running, children: [
1816
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_controls6.SelectTrigger, { id: "add-everyone-org", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system11.SelectValue, { placeholder: "Choose one of your organizations" }) }),
1817
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system11.SelectContent, { children: orgs.map((org) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system11.SelectItem, { value: org.id, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2", children: [
1794
1818
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Building2, { className: "w-3 h-3" }),
1795
1819
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: org.name }),
1796
1820
  detail.get(org.id) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "type-meta text-muted-foreground", children: detail.get(org.id) })
@@ -1798,15 +1822,15 @@ function AddEveryoneInOrg({
1798
1822
  ] })
1799
1823
  ] }),
1800
1824
  orgId && teams.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "space-y-1.5", children: [
1801
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system12.Label, { htmlFor: "add-everyone-group", className: "text-xs", children: "Who" }),
1802
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system13.Select, { value: group, onValueChange: setGroup, disabled: running, children: [
1803
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_controls3.SelectTrigger, { id: "add-everyone-group", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system13.SelectValue, {}) }),
1804
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system13.SelectContent, { children: [
1805
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system13.SelectItem, { value: EVERYONE, children: [
1825
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system10.Label, { htmlFor: "add-everyone-group", className: "text-xs", children: "Who" }),
1826
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system11.Select, { value: group, onValueChange: setGroup, disabled: running, children: [
1827
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_controls6.SelectTrigger, { id: "add-everyone-group", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system11.SelectValue, {}) }),
1828
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system11.SelectContent, { children: [
1829
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system11.SelectItem, { value: EVERYONE, children: [
1806
1830
  "Everyone in ",
1807
1831
  orgLabel
1808
1832
  ] }),
1809
- teams.map((t) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system13.SelectItem, { value: t.id, children: [
1833
+ teams.map((t) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system11.SelectItem, { value: t.id, children: [
1810
1834
  t.name,
1811
1835
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "type-meta text-muted-foreground", children: [
1812
1836
  " \xB7 ",
@@ -1817,16 +1841,16 @@ function AddEveryoneInOrg({
1817
1841
  ] })
1818
1842
  ] }) : null,
1819
1843
  orgId ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "space-y-1.5", children: [
1820
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system12.Label, { htmlFor: "add-everyone-level", className: "text-xs", children: "They get" }),
1844
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system10.Label, { htmlFor: "add-everyone-level", className: "text-xs", children: "They get" }),
1821
1845
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1822
- import_design_system13.Select,
1846
+ import_design_system11.Select,
1823
1847
  {
1824
1848
  value: level,
1825
1849
  onValueChange: (v) => setOwnLevel(v),
1826
1850
  disabled: running,
1827
1851
  children: [
1828
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_controls3.SelectTrigger, { id: "add-everyone-level", "data-add-everyone-level": level, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system13.SelectValue, {}) }),
1829
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system13.SelectContent, { children: import_core15.PERMISSION_LEVELS.map((l) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system13.SelectItem, { value: l, disabled: (whyNotLevel?.(l) ?? null) !== null, title: whyNotLevel?.(l) ?? void 0, children: import_core15.PERMISSION_LEVEL_SHORT_LABELS[l] }, l)) })
1852
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_controls6.SelectTrigger, { id: "add-everyone-level", "data-add-everyone-level": level, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system11.SelectValue, {}) }),
1853
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system11.SelectContent, { children: import_core15.PERMISSION_LEVELS.map((l) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system11.SelectItem, { value: l, disabled: (whyNotLevel?.(l) ?? null) !== null, title: whyNotLevel?.(l) ?? void 0, children: import_core15.PERMISSION_LEVEL_SHORT_LABELS[l] }, l)) })
1830
1854
  ]
1831
1855
  }
1832
1856
  )
@@ -1836,14 +1860,14 @@ function AddEveryoneInOrg({
1836
1860
  orgLabel,
1837
1861
  " could not be listed: ",
1838
1862
  teamsError,
1839
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ErrorAlchemyMenu, { error: teamsError })
1863
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ShareErrorAlchemyMenu, { error: teamsError })
1840
1864
  ] }) : null,
1841
1865
  orgId && loadError ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "type-secondary text-destructive", children: [
1842
1866
  "The people in ",
1843
1867
  orgName,
1844
1868
  " could not be listed: ",
1845
1869
  loadError,
1846
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ErrorAlchemyMenu, { error: loadError })
1870
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ShareErrorAlchemyMenu, { error: loadError })
1847
1871
  ] }) : null,
1848
1872
  orgId && !loadError && members === null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2 type-secondary text-muted-foreground", children: [
1849
1873
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Loader2, { className: "w-3 h-3 animate-spin" }),
@@ -1867,7 +1891,7 @@ function AddEveryoneInOrg({
1867
1891
  "data-member": m.email,
1868
1892
  children: [
1869
1893
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1870
- import_design_system11.Checkbox,
1894
+ import_design_system9.Checkbox,
1871
1895
  {
1872
1896
  size: "sm",
1873
1897
  id: `add-everyone-${m.userId}`,
@@ -1905,12 +1929,13 @@ function AddEveryoneInOrg({
1905
1929
  }) }) : null,
1906
1930
  members && members.length > 0 && chosen.length === 0 && !running ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "type-secondary text-muted-foreground", children: Object.values(outcomes).some((o) => o.ok) || members.every((m) => already.has(m.userId)) ? `Everyone listed in ${orgName} has access now.` : "Tick the people to add." }) : null,
1907
1931
  members && members.length > 0 && (chosen.length > 0 || running) ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1908
- import_design_system10.Button,
1932
+ import_controls5.Button,
1909
1933
  {
1934
+ variant: "primary",
1910
1935
  type: "button",
1911
1936
  onClick: run,
1912
1937
  disabled: running || chosen.length === 0,
1913
- className: "w-full h-9",
1938
+ className: "w-full",
1914
1939
  children: running ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1915
1940
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Loader2, { className: "w-4 h-4 mr-2 animate-spin" }),
1916
1941
  "Sharing\u2026"
@@ -2199,7 +2224,7 @@ function ShareWithUserTab({
2199
2224
  ),
2200
2225
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-2.5", children: [
2201
2226
  !selectedContact && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-1.5", children: [
2202
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_design_system15.Label, { className: "text-xs flex items-center gap-1.5", children: [
2227
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_design_system12.Label, { className: "text-xs flex items-center gap-1.5", children: [
2203
2228
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Users, { className: "w-3 h-3" }),
2204
2229
  "Your Contacts"
2205
2230
  ] }),
@@ -2243,7 +2268,7 @@ function ShareWithUserTab({
2243
2268
  inputClassName: "h-8 text-xs"
2244
2269
  }
2245
2270
  ) }),
2246
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system8.ScrollArea, { className: "max-h-36 rounded-md border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "p-1", children: filteredConnections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-xs text-muted-foreground py-2 text-center", children: "No matching contacts" }) : filteredConnections.map((contact) => {
2271
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system7.ScrollArea, { className: "max-h-36 rounded-md border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "p-1", children: filteredConnections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-xs text-muted-foreground py-2 text-center", children: "No matching contacts" }) : filteredConnections.map((contact) => {
2247
2272
  const SourceIcon = SOURCE_ICONS[contact.source];
2248
2273
  return (
2249
2274
  // ui-exception: moved verbatim from the web share sheet; restyling onto design-system Button is its own UI change
@@ -2254,14 +2279,14 @@ function ShareWithUserTab({
2254
2279
  disabled: isLoading,
2255
2280
  className: "w-full flex items-center gap-2 p-1.5 rounded-md hover:bg-accent/50 transition-colors text-left disabled:opacity-50",
2256
2281
  children: [
2257
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_design_system9.Avatar, { className: "w-6 h-6 flex-shrink-0", children: [
2282
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_design_system8.Avatar, { className: "w-6 h-6 flex-shrink-0", children: [
2258
2283
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2259
- import_design_system9.AvatarImage,
2284
+ import_design_system8.AvatarImage,
2260
2285
  {
2261
2286
  src: contact.avatar_url || void 0
2262
2287
  }
2263
2288
  ),
2264
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system9.AvatarFallback, { className: "text-[10px] bg-primary/10 text-primary-ink", children: (0, import_format.getInitials)(contact.display_name ?? contact.email) })
2289
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system8.AvatarFallback, { className: "text-[10px] bg-primary/10 text-primary-ink", children: (0, import_format.getInitials)(contact.display_name ?? contact.email) })
2265
2290
  ] }),
2266
2291
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex-1 min-w-0", children: [
2267
2292
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-xs font-medium truncate", children: contact.display_name || contact.email || "Unknown" }),
@@ -2280,9 +2305,9 @@ function ShareWithUserTab({
2280
2305
  ] })
2281
2306
  ] }),
2282
2307
  selectedContact && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-2 p-2 rounded-md bg-primary/5 border border-primary/20", children: [
2283
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_design_system9.Avatar, { className: "w-6 h-6 flex-shrink-0", children: [
2284
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system9.AvatarImage, { src: selectedContact.avatar_url || void 0 }),
2285
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system9.AvatarFallback, { className: "text-[10px] bg-primary/10 text-primary-ink", children: (0, import_format.getInitials)(
2308
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_design_system8.Avatar, { className: "w-6 h-6 flex-shrink-0", children: [
2309
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system8.AvatarImage, { src: selectedContact.avatar_url || void 0 }),
2310
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system8.AvatarFallback, { className: "text-[10px] bg-primary/10 text-primary-ink", children: (0, import_format.getInitials)(
2286
2311
  selectedContact.display_name ?? selectedContact.email
2287
2312
  ) })
2288
2313
  ] }),
@@ -2301,7 +2326,7 @@ function ShareWithUserTab({
2301
2326
  )
2302
2327
  ] }),
2303
2328
  !selectedContact && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-1.5", children: [
2304
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system15.Label, { htmlFor: "user-email", className: "text-xs", children: "Or enter email manually" }),
2329
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system12.Label, { htmlFor: "user-email", className: "text-xs", children: "Or enter email manually" }),
2305
2330
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2306
2331
  UserSearchField,
2307
2332
  {
@@ -2328,20 +2353,20 @@ function ShareWithUserTab({
2328
2353
  )
2329
2354
  ] }),
2330
2355
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-1.5", children: [
2331
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system15.Label, { htmlFor: "user-permission", className: "text-xs", children: "Permission Level" }),
2356
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system12.Label, { htmlFor: "user-permission", className: "text-xs", children: "Permission Level" }),
2332
2357
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2333
- import_design_system16.Select,
2358
+ import_design_system13.Select,
2334
2359
  {
2335
2360
  value: permissionLevel,
2336
2361
  onValueChange: (value) => setPermissionLevel(value),
2337
2362
  disabled: isLoading,
2338
2363
  children: [
2339
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_controls4.SelectTrigger, { id: "user-permission", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system16.SelectValue, {}) }),
2340
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system16.SelectContent, { children: levelWording === "notion" ? [...import_core16.PERMISSION_LEVELS].reverse().map((level) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system16.SelectItem, { value: level, disabled: whyNotLevel(level) !== null, title: whyNotLevel(level) ?? import_core16.PERMISSION_LEVEL_HINTS[level], children: import_core16.PERMISSION_LEVEL_LABELS[level] }, level)) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2341
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system16.SelectItem, { value: "viewer", disabled: whyNotLevel("viewer") !== null, title: whyNotLevel("viewer") ?? import_core16.PERMISSION_LEVEL_HINTS.viewer, children: import_core16.PERMISSION_LEVEL_SHORT_LABELS.viewer }),
2342
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system16.SelectItem, { value: "commenter", disabled: whyNotLevel("commenter") !== null, title: whyNotLevel("commenter") ?? import_core16.PERMISSION_LEVEL_HINTS.commenter, children: import_core16.PERMISSION_LEVEL_SHORT_LABELS.commenter }),
2343
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system16.SelectItem, { value: "editor", disabled: whyNotLevel("editor") !== null, title: whyNotLevel("editor") ?? import_core16.PERMISSION_LEVEL_HINTS.editor, children: import_core16.PERMISSION_LEVEL_SHORT_LABELS.editor }),
2344
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system16.SelectItem, { value: "admin", disabled: whyNotLevel("admin") !== null, title: whyNotLevel("admin") ?? import_core16.PERMISSION_LEVEL_HINTS.admin, children: import_core16.PERMISSION_LEVEL_SHORT_LABELS.admin })
2364
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_controls8.SelectTrigger, { id: "user-permission", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system13.SelectValue, {}) }),
2365
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system13.SelectContent, { children: levelWording === "notion" ? [...import_core16.PERMISSION_LEVELS].reverse().map((level) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system13.SelectItem, { value: level, disabled: whyNotLevel(level) !== null, title: whyNotLevel(level) ?? import_core16.PERMISSION_LEVEL_HINTS[level], children: import_core16.PERMISSION_LEVEL_LABELS[level] }, level)) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2366
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system13.SelectItem, { value: "viewer", disabled: whyNotLevel("viewer") !== null, title: whyNotLevel("viewer") ?? import_core16.PERMISSION_LEVEL_HINTS.viewer, children: import_core16.PERMISSION_LEVEL_SHORT_LABELS.viewer }),
2367
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system13.SelectItem, { value: "commenter", disabled: whyNotLevel("commenter") !== null, title: whyNotLevel("commenter") ?? import_core16.PERMISSION_LEVEL_HINTS.commenter, children: import_core16.PERMISSION_LEVEL_SHORT_LABELS.commenter }),
2368
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system13.SelectItem, { value: "editor", disabled: whyNotLevel("editor") !== null, title: whyNotLevel("editor") ?? import_core16.PERMISSION_LEVEL_HINTS.editor, children: import_core16.PERMISSION_LEVEL_SHORT_LABELS.editor }),
2369
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system13.SelectItem, { value: "admin", disabled: whyNotLevel("admin") !== null, title: whyNotLevel("admin") ?? import_core16.PERMISSION_LEVEL_HINTS.admin, children: import_core16.PERMISSION_LEVEL_SHORT_LABELS.admin })
2345
2370
  ] }) })
2346
2371
  ]
2347
2372
  }
@@ -2352,11 +2377,12 @@ function ShareWithUserTab({
2352
2377
  grantable?.outside ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-xs text-muted-foreground", "data-share-outside-reason": "", children: grantable.outside }) : null
2353
2378
  ] }),
2354
2379
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2355
- import_design_system14.Button,
2380
+ import_controls7.Button,
2356
2381
  {
2382
+ variant: "primary",
2357
2383
  onClick: handleShare,
2358
2384
  disabled: isLoading || !email.trim() || chosenWhy !== null,
2359
- className: "w-full h-9",
2385
+ className: "w-full",
2360
2386
  children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2361
2387
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Loader2, { className: "w-4 h-4 mr-2 animate-spin" }),
2362
2388
  status.message || "Processing..."
@@ -2384,11 +2410,11 @@ function ShareWithUserTab({
2384
2410
  // src/react/sheet/OutsideSharePanel.tsx
2385
2411
  var import_react8 = require("react");
2386
2412
  var import_lucide_react6 = require("lucide-react");
2387
- var import_design_system17 = require("@ai-matrx/design-system");
2388
- var import_controls5 = require("@ai-matrx/design-system/controls");
2389
- var import_design_system18 = require("@ai-matrx/design-system");
2390
- var import_design_system19 = require("@ai-matrx/design-system");
2391
- var import_controls6 = require("@ai-matrx/design-system/controls");
2413
+ var import_controls9 = require("@ai-matrx/design-system/controls");
2414
+ var import_controls10 = require("@ai-matrx/design-system/controls");
2415
+ var import_design_system14 = require("@ai-matrx/design-system");
2416
+ var import_design_system15 = require("@ai-matrx/design-system");
2417
+ var import_controls11 = require("@ai-matrx/design-system/controls");
2392
2418
  var import_clipboard2 = require("@ai-matrx/kit/clipboard");
2393
2419
  var import_core19 = require("@ai-matrx/sharing/core");
2394
2420
  var import_jsx_runtime8 = require("react/jsx-runtime");
@@ -2464,13 +2490,13 @@ function OutsideSharePanel({
2464
2490
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { className: "text-sm font-medium text-destructive", children: [
2465
2491
  "We could not check who outside this organization can see ",
2466
2492
  tableName,
2467
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ErrorAlchemyMenu, {})
2493
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ShareErrorAlchemyMenu, {})
2468
2494
  ] }),
2469
2495
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "mt-0.5 text-xs text-destructive/80", children: "Nobody was added or removed. This does not mean sharing outside is switched off \u2014 we simply could not look." }),
2470
2496
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "mt-1 break-words text-xs text-muted-foreground", children: loadError })
2471
2497
  ] })
2472
2498
  ] }),
2473
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system17.Button, { size: "sm", variant: "outline", className: "mt-2", onClick: () => void refresh(), children: "Try again" })
2499
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_controls9.Button, { variant: "outline", className: "mt-2", onClick: () => void refresh(), children: "Try again" })
2474
2500
  ] });
2475
2501
  }
2476
2502
  if (!state2) {
@@ -2497,9 +2523,9 @@ function OutsideSharePanel({
2497
2523
  ] }) : null,
2498
2524
  state2.lane_open && state2.may_invite ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-end", children: [
2499
2525
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "min-w-0 flex-1", children: [
2500
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system18.Label, { htmlFor: "outside-email", className: "text-xs", children: "Their email address" }),
2526
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system14.Label, { htmlFor: "outside-email", className: "text-xs", children: "Their email address" }),
2501
2527
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2502
- import_controls5.Input,
2528
+ import_controls10.Input,
2503
2529
  {
2504
2530
  id: "outside-email",
2505
2531
  type: "email",
@@ -2510,16 +2536,17 @@ function OutsideSharePanel({
2510
2536
  )
2511
2537
  ] }),
2512
2538
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "sm:w-44", children: [
2513
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system18.Label, { htmlFor: "outside-level", className: "text-xs", children: "They can" }),
2514
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_design_system19.Select, { value: level, onValueChange: setLevel, children: [
2515
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_controls6.SelectTrigger, { id: "outside-level", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system19.SelectValue, {}) }),
2516
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system19.SelectContent, { children: state2.levels.map((l) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system19.SelectItem, { value: l.level, children: l.means }, l.level)) })
2539
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system14.Label, { htmlFor: "outside-level", className: "text-xs", children: "They can" }),
2540
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_design_system15.Select, { value: level, onValueChange: setLevel, children: [
2541
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_controls11.SelectTrigger, { id: "outside-level", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system15.SelectValue, {}) }),
2542
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system15.SelectContent, { children: state2.levels.map((l) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system15.SelectItem, { value: l.level, children: l.means }, l.level)) })
2517
2543
  ] })
2518
2544
  ] }),
2519
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2520
- import_design_system17.Button,
2545
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2546
+ import_controls9.Button,
2521
2547
  {
2522
- size: "sm",
2548
+ icon: busy === "invite" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Loader2, { className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Send, {}),
2549
+ variant: "primary",
2523
2550
  disabled: !email.trim() || busy === "invite",
2524
2551
  onClick: () => void run("invite", async () => {
2525
2552
  const answer = await (0, import_core19.shareWithOutsidePerson)(organizationId, tableId, email.trim(), level);
@@ -2527,10 +2554,7 @@ function OutsideSharePanel({
2527
2554
  if (answer.granted) onGranted?.();
2528
2555
  return answer;
2529
2556
  }),
2530
- children: [
2531
- busy === "invite" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Loader2, { className: "mr-1.5 h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Send, { className: "mr-1.5 h-4 w-4" }),
2532
- "Share"
2533
- ]
2557
+ children: "Share"
2534
2558
  }
2535
2559
  )
2536
2560
  ] }) : null,
@@ -2549,42 +2573,40 @@ function OutsideSharePanel({
2549
2573
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "mt-0.5 text-xs text-muted-foreground", children: row.say })
2550
2574
  ] }),
2551
2575
  state2.may_invite ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-shrink-0 gap-1", children: [
2552
- row.accept_path ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2553
- import_design_system17.Button,
2576
+ row.accept_path ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2577
+ import_controls9.Button,
2554
2578
  {
2555
- size: "sm",
2556
- variant: "ghost",
2579
+ icon: copied === row.invitation_id ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Check, {}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Link2, {}),
2580
+ variant: "quiet",
2557
2581
  title: "Copy invitation link",
2558
2582
  onClick: () => void copyLink(
2559
2583
  row.invitation_id,
2560
2584
  row.accept_path,
2561
2585
  row.email
2562
2586
  ),
2563
- children: [
2564
- copied === row.invitation_id ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Check, { className: "mr-1.5 h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Link2, { className: "mr-1.5 h-4 w-4" }),
2565
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-xs", children: copied === row.invitation_id ? "Copied" : "Copy link" })
2566
- ]
2587
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-xs", children: copied === row.invitation_id ? "Copied" : "Copy link" })
2567
2588
  }
2568
2589
  ) : null,
2569
2590
  !row.joined ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2570
- import_design_system17.Button,
2591
+ import_controls9.Button,
2571
2592
  {
2572
- size: "sm",
2573
- variant: "ghost",
2593
+ icon: busy === `resend:${row.invitation_id}` ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Loader2, { className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.RotateCw, {}),
2594
+ "aria-label": "Send a fresh link",
2595
+ variant: "quiet",
2574
2596
  title: "Send a fresh link",
2575
2597
  disabled: busy === `resend:${row.invitation_id}`,
2576
2598
  onClick: () => void run(
2577
2599
  `resend:${row.invitation_id}`,
2578
2600
  () => (0, import_core19.resendOutside)(organizationId, row.invitation_id)
2579
- ),
2580
- children: busy === `resend:${row.invitation_id}` ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.RotateCw, { className: "h-4 w-4" })
2601
+ )
2581
2602
  }
2582
2603
  ) : null,
2583
2604
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2584
- import_design_system17.Button,
2605
+ import_controls9.Button,
2585
2606
  {
2586
- size: "sm",
2587
- variant: "ghost",
2607
+ icon: busy === `revoke:${row.invitation_id}` ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Loader2, { className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Trash2, {}),
2608
+ "aria-label": row.joined ? "Take their access away" : "Withdraw the invitation",
2609
+ variant: "quiet",
2588
2610
  title: row.joined ? "Take their access away" : "Withdraw the invitation",
2589
2611
  disabled: busy === `revoke:${row.invitation_id}`,
2590
2612
  onClick: () => void (async () => {
@@ -2599,8 +2621,7 @@ function OutsideSharePanel({
2599
2621
  `revoke:${row.invitation_id}`,
2600
2622
  () => (0, import_core19.revokeOutside)(organizationId, row.invitation_id)
2601
2623
  );
2602
- })(),
2603
- children: busy === `revoke:${row.invitation_id}` ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Trash2, { className: "h-4 w-4" })
2624
+ })()
2604
2625
  }
2605
2626
  )
2606
2627
  ] }) : null
@@ -2614,8 +2635,8 @@ var import_core36 = require("@ai-matrx/sharing/core");
2614
2635
  // src/react/sheet/WhoCouldSeeOn.tsx
2615
2636
  var import_react9 = require("react");
2616
2637
  var import_lucide_react7 = require("lucide-react");
2617
- var import_design_system20 = require("@ai-matrx/design-system");
2618
- var import_controls7 = require("@ai-matrx/design-system/controls");
2638
+ var import_controls12 = require("@ai-matrx/design-system/controls");
2639
+ var import_controls13 = require("@ai-matrx/design-system/controls");
2619
2640
  var import_core20 = require("@ai-matrx/sharing/core");
2620
2641
  var import_jsx_runtime9 = require("react/jsx-runtime");
2621
2642
  function custom() {
@@ -2646,7 +2667,7 @@ function WhoCouldSeeOn({ recordId }) {
2646
2667
  ] }),
2647
2668
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-1", children: [
2648
2669
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2649
- import_controls7.DateTimeField,
2670
+ import_controls13.DateTimeField,
2650
2671
  {
2651
2672
  "aria-label": "Moment to ask about",
2652
2673
  value: at,
@@ -2654,10 +2675,7 @@ function WhoCouldSeeOn({ recordId }) {
2654
2675
  className: "min-w-0 flex-1"
2655
2676
  }
2656
2677
  ),
2657
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_design_system20.Button, { size: "sm", variant: "outline", className: "h-7 px-2 text-xs", disabled: busy || at === "", onClick: () => void ask(), "data-who-could-see-ask": "", children: [
2658
- busy ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.Loader2, { className: "mr-1 h-3.5 w-3.5 animate-spin" }) : null,
2659
- "Ask"
2660
- ] })
2678
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_controls12.Button, { icon: busy ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.Loader2, { className: "animate-spin" }) : null, variant: "outline", disabled: busy || at === "", onClick: () => void ask(), "data-who-could-see-ask": "", children: "Ask" })
2661
2679
  ] }),
2662
2680
  people ? people.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-muted-foreground", children: "Nobody could see it then." }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { className: "flex flex-col gap-0.5", "data-who-could-see-list": "", children: people.map((p) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("li", { className: "flex items-center justify-between gap-2 text-xs", "data-who-could-see-person": p.id ?? "", children: [
2663
2681
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "min-w-0 truncate", children: [
@@ -2746,18 +2764,18 @@ var import_react14 = require("react");
2746
2764
  var import_lucide_react11 = require("lucide-react");
2747
2765
 
2748
2766
  // src/react/sheet/ui/switch.tsx
2749
- var import_design_system21 = require("@ai-matrx/design-system");
2767
+ var import_design_system16 = require("@ai-matrx/design-system");
2750
2768
  var React6 = __toESM(require("react"), 1);
2751
- var import_controls8 = require("@ai-matrx/design-system/controls");
2769
+ var import_controls14 = require("@ai-matrx/design-system/controls");
2752
2770
  var import_jsx_runtime11 = require("react/jsx-runtime");
2753
- var SwitchLegacy = React6.forwardRef(({ size = "sm", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system21.Switch, { ref, size, ...props }));
2771
+ var SwitchLegacy = React6.forwardRef(({ size = "sm", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_design_system16.Switch, { ref, size, ...props }));
2754
2772
  SwitchLegacy.displayName = "SwitchLegacy";
2755
2773
 
2756
2774
  // src/react/sheet/RowControls.tsx
2757
- var import_design_system28 = require("@ai-matrx/design-system");
2775
+ var import_controls16 = require("@ai-matrx/design-system/controls");
2758
2776
 
2759
2777
  // src/react/sheet/ui/toggle-group.tsx
2760
- var import_design_system22 = require("@ai-matrx/design-system");
2778
+ var import_design_system17 = require("@ai-matrx/design-system");
2761
2779
 
2762
2780
  // src/react/sheet/RowControls.tsx
2763
2781
  var import_cn4 = require("@ai-matrx/design-system/cn");
@@ -2770,36 +2788,35 @@ var import_core30 = require("@ai-matrx/sharing/core");
2770
2788
  var import_react12 = require("react");
2771
2789
 
2772
2790
  // src/react/sheet/ui/alert.tsx
2773
- var import_design_system23 = require("@ai-matrx/design-system");
2791
+ var import_design_system18 = require("@ai-matrx/design-system");
2774
2792
 
2775
2793
  // src/react/sheet/PublicAccessTab.tsx
2776
2794
  var import_lucide_react10 = require("lucide-react");
2777
2795
 
2778
2796
  // src/react/sheet/ShareLinkPanel.tsx
2779
2797
  var import_react11 = require("react");
2780
- var import_design_system26 = require("@ai-matrx/design-system");
2781
- var import_controls9 = require("@ai-matrx/design-system/controls");
2798
+ var import_controls15 = require("@ai-matrx/design-system/controls");
2782
2799
  var import_outbound_react = require("@ai-matrx/kit/outbound-react");
2783
2800
  var import_format2 = require("@ai-matrx/kit/format");
2784
2801
  var import_lucide_react9 = require("lucide-react");
2785
2802
  var import_core21 = require("@ai-matrx/sharing/core");
2786
2803
 
2787
2804
  // src/react/sheet/ui/confirm-dialog.tsx
2788
- var import_design_system24 = require("@ai-matrx/design-system");
2805
+ var import_design_system19 = require("@ai-matrx/design-system");
2789
2806
  var import_jsx_runtime12 = require("react/jsx-runtime");
2790
2807
  function PortalConfirmDialog(props) {
2791
2808
  const container = usePortalContainer();
2792
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system24.ConfirmDialog, { ...container ? { portalContainer: container } : {}, ...props });
2809
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_design_system19.ConfirmDialog, { ...container ? { portalContainer: container } : {}, ...props });
2793
2810
  }
2794
2811
 
2795
2812
  // src/react/sheet/useShare.tsx
2796
2813
  var import_clipboard3 = require("@ai-matrx/kit/clipboard");
2797
2814
  var import_react10 = require("react");
2798
- var import_design_system25 = require("@ai-matrx/design-system");
2815
+ var import_design_system20 = require("@ai-matrx/design-system");
2799
2816
  var import_jsx_runtime13 = require("react/jsx-runtime");
2800
2817
  function useShare() {
2801
2818
  const { copyText: copyTextKit } = (0, import_clipboard3.useClipboard)({
2802
- notify: copyNotify
2819
+ notify: shareCopyNotify
2803
2820
  });
2804
2821
  const [copied, setCopied] = (0, import_react10.useState)(false);
2805
2822
  const [fallbackUrl, setFallbackUrl] = (0, import_react10.useState)(null);
@@ -2855,7 +2872,7 @@ function useShare() {
2855
2872
  copy,
2856
2873
  copied,
2857
2874
  fallbackDialog: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2858
- import_design_system25.ClipboardFallbackDialog,
2875
+ import_design_system20.ClipboardFallbackDialog,
2859
2876
  {
2860
2877
  open: fallbackUrl !== null,
2861
2878
  onOpenChange: (open) => !open && setFallbackUrl(null),
@@ -3271,17 +3288,15 @@ function ShareLinkPanel({
3271
3288
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-xs text-muted-foreground", children: hasLink ? `Link is on \xB7 ${activeLinks.length} active` : "Create a link that opens with no sign-in required" })
3272
3289
  ] })
3273
3290
  ] }),
3274
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
3275
- import_design_system26.Button,
3291
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3292
+ import_controls15.Button,
3276
3293
  {
3277
- size: "sm",
3294
+ icon: creating ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Loader2, { className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Plus, {}),
3295
+ variant: "primary",
3278
3296
  onClick: handleCreate,
3279
3297
  disabled: creating,
3280
3298
  className: "flex-shrink-0",
3281
- children: [
3282
- creating ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Loader2, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Plus, { className: "w-4 h-4" }),
3283
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ml-1 hidden sm:inline", children: hasLink ? "New link" : "Create link" })
3284
- ]
3299
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ml-1 hidden sm:inline", children: hasLink ? "New link" : "Create link" })
3285
3300
  }
3286
3301
  )
3287
3302
  ] }),
@@ -3289,7 +3304,7 @@ function ShareLinkPanel({
3289
3304
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "flex flex-col gap-1 text-xs", children: [
3290
3305
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-muted-foreground", children: "Permission" }),
3291
3306
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3292
- import_controls9.Select,
3307
+ import_controls15.Select,
3293
3308
  {
3294
3309
  value: permissionLevel,
3295
3310
  onValueChange: setPermissionLevel,
@@ -3303,12 +3318,12 @@ function ShareLinkPanel({
3303
3318
  ] }),
3304
3319
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "flex flex-col gap-1 text-xs", children: [
3305
3320
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-muted-foreground", children: "Expires" }),
3306
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_controls9.DateTimeField, { value: expiresAt, onValueChange: (v) => setExpiresAt(v ?? "") })
3321
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_controls15.DateTimeField, { value: expiresAt, onValueChange: (v) => setExpiresAt(v ?? "") })
3307
3322
  ] }),
3308
3323
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "flex flex-col gap-1 text-xs", children: [
3309
3324
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-muted-foreground", children: "Max uses" }),
3310
3325
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3311
- import_controls9.Input,
3326
+ import_controls15.Input,
3312
3327
  {
3313
3328
  type: "number",
3314
3329
  min: 1,
@@ -3355,16 +3370,15 @@ function ShareLinkPanel({
3355
3370
  }
3356
3371
  ),
3357
3372
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3358
- import_design_system26.Button,
3373
+ import_controls15.Button,
3359
3374
  {
3360
- variant: "ghost",
3361
- size: "icon",
3362
- className: "h-11 w-11 flex-shrink-0 sm:h-8 sm:w-8",
3375
+ icon: copiedId === `${link.id}:${extra.key}` ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Check, { className: "text-green-500" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Copy, {}),
3376
+ variant: "quiet",
3377
+ className: "flex-shrink-0",
3363
3378
  onClick: () => copyExtraUrl(`${link.id}:${extra.key}`, extra.url),
3364
3379
  disabled: !!unavailableReason,
3365
3380
  title: unavailableReason ?? "Copy",
3366
- "aria-label": `Copy ${extra.label}`,
3367
- children: copiedId === `${link.id}:${extra.key}` ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Check, { className: "w-4 h-4 text-green-500" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Copy, { className: "w-4 h-4" })
3381
+ "aria-label": `Copy ${extra.label}`
3368
3382
  }
3369
3383
  )
3370
3384
  ]
@@ -3373,7 +3387,7 @@ function ShareLinkPanel({
3373
3387
  )),
3374
3388
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-1.5 rounded-md border bg-background p-1.5", children: [
3375
3389
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3376
- import_controls9.Input,
3390
+ import_controls15.Input,
3377
3391
  {
3378
3392
  mono: true,
3379
3393
  readOnly: true,
@@ -3404,41 +3418,39 @@ function ShareLinkPanel({
3404
3418
  }
3405
3419
  ) : null,
3406
3420
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3407
- import_design_system26.Button,
3421
+ import_controls15.Button,
3408
3422
  {
3409
- variant: "ghost",
3410
- size: "icon",
3411
- className: "h-11 w-11 flex-shrink-0 sm:h-8 sm:w-8",
3423
+ icon: copiedId === link.id ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Check, { className: "text-green-500" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Copy, {}),
3424
+ variant: "quiet",
3425
+ className: "flex-shrink-0",
3412
3426
  onClick: () => copyLink(link),
3413
3427
  disabled: !!unavailableReason,
3414
3428
  title: unavailableReason ?? "Copy link",
3415
- "aria-label": "Copy share link",
3416
- children: copiedId === link.id ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Check, { className: "w-4 h-4 text-green-500" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Copy, { className: "w-4 h-4" })
3429
+ "aria-label": "Copy share link"
3417
3430
  }
3418
3431
  ),
3419
3432
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3420
- import_design_system26.Button,
3433
+ import_controls15.Button,
3421
3434
  {
3422
- variant: "ghost",
3423
- size: "icon",
3424
- className: "h-11 w-11 flex-shrink-0 sm:h-8 sm:w-8",
3435
+ icon: refreshing ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Loader2, { className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.MessageSquareText, {}),
3436
+ variant: "quiet",
3437
+ className: "flex-shrink-0",
3425
3438
  onClick: () => prepareTextShare(link.id),
3426
3439
  disabled: !!unavailableReason || refreshing,
3427
3440
  title: unavailableReason ?? "Review before sharing by text",
3428
- "aria-label": "Share by text",
3429
- children: refreshing ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Loader2, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.MessageSquareText, { className: "w-4 h-4" })
3441
+ "aria-label": "Share by text"
3430
3442
  }
3431
3443
  ),
3432
3444
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3433
- import_design_system26.Button,
3445
+ import_controls15.Button,
3434
3446
  {
3435
- variant: "ghost",
3436
- size: "icon",
3437
- className: "h-11 w-11 flex-shrink-0 text-destructive sm:h-8 sm:w-8",
3447
+ icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Trash2, {}),
3448
+ removes: true,
3449
+ variant: "quiet",
3450
+ className: "flex-shrink-0",
3438
3451
  onClick: () => setRevokeTarget(link),
3439
3452
  title: "Turn off link",
3440
- "aria-label": "Turn off share link",
3441
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Trash2, { className: "w-4 h-4" })
3453
+ "aria-label": "Turn off share link"
3442
3454
  }
3443
3455
  )
3444
3456
  ] })
@@ -3451,21 +3463,18 @@ function ShareLinkPanel({
3451
3463
  className: "flex items-center justify-between gap-2 text-xs text-destructive",
3452
3464
  children: [
3453
3465
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: shareError }),
3454
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
3455
- import_design_system26.Button,
3466
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3467
+ import_controls15.Button,
3456
3468
  {
3469
+ icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.RefreshCw, {}),
3457
3470
  type: "button",
3458
3471
  variant: "outline",
3459
- size: "sm",
3460
3472
  disabled: isLoading,
3461
3473
  onClick: () => refresh(),
3462
- children: [
3463
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.RefreshCw, { className: "mr-1 h-3.5 w-3.5" }),
3464
- "Refresh"
3465
- ]
3474
+ children: "Refresh"
3466
3475
  }
3467
3476
  ),
3468
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ErrorAlchemyMenu, { className: "ml-auto" })
3477
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ShareErrorAlchemyMenu, { className: "ml-auto" })
3469
3478
  ]
3470
3479
  }
3471
3480
  ) : null,
@@ -3496,18 +3505,16 @@ function ShareLinkPanel({
3496
3505
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-xs font-medium", children: "Message preview" }),
3497
3506
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "rounded-md border bg-muted/30 p-3 break-words", children: (0, import_core22.createSafeShareMessage)(urlFor(shareTarget)) })
3498
3507
  ] }),
3499
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
3500
- import_design_system26.Button,
3508
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3509
+ import_controls15.Button,
3501
3510
  {
3511
+ icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Copy, {}),
3502
3512
  type: "button",
3503
3513
  variant: "outline",
3504
- className: "min-h-11 w-full sm:min-h-0",
3514
+ className: "w-full",
3505
3515
  disabled: handoffBusy,
3506
3516
  onClick: handleCopyReviewedMessage,
3507
- children: [
3508
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Copy, { className: "mr-2 h-4 w-4" }),
3509
- "Copy message"
3510
- ]
3517
+ children: "Copy message"
3511
3518
  }
3512
3519
  ),
3513
3520
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-xs text-muted-foreground", children: "You can turn this link off from the share panel at any time." })
@@ -3536,7 +3543,7 @@ function ShareLinkPanel({
3536
3543
  }
3537
3544
 
3538
3545
  // src/react/sheet/PublicAccessTab.tsx
3539
- var import_design_system27 = require("@ai-matrx/design-system");
3546
+ var import_design_system21 = require("@ai-matrx/design-system");
3540
3547
  var import_core23 = require("@ai-matrx/sharing/core");
3541
3548
  var import_core24 = require("@ai-matrx/sharing/core");
3542
3549
  var import_core25 = require("@ai-matrx/sharing/core");
@@ -3571,11 +3578,11 @@ function PublicAccessTab({
3571
3578
  };
3572
3579
  }, [resourceType]);
3573
3580
  const location = (0, import_core25.sharingLocation)(copy?.surface ?? "Anyone link");
3574
- if (loading) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system27.Skeleton, { className: "h-20 w-full" });
3581
+ if (loading) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system21.Skeleton, { className: "h-20 w-full" });
3575
3582
  if (capabilitiesError) {
3576
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system23.Alert, { variant: "destructive", className: "group", children: [
3583
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system18.Alert, { variant: "destructive", className: "group", children: [
3577
3584
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react10.AlertTriangle, { className: "h-4 w-4" }),
3578
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system23.AlertDescription, { className: "flex items-start gap-2", children: [
3585
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_design_system18.AlertDescription, { className: "flex items-start gap-2", children: [
3579
3586
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "flex-1", children: capabilitiesError }),
3580
3587
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shrink-0 opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3581
3588
  CopyButtons,
@@ -3679,7 +3686,7 @@ function SearchEngineIndexedSwitch({
3679
3686
  children: [
3680
3687
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: id, className: "cursor-pointer text-xs text-muted-foreground", children: "Indexed by search engines" }),
3681
3688
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3682
- import_controls8.Switch,
3689
+ import_controls14.Switch,
3683
3690
  {
3684
3691
  id,
3685
3692
  checked: state2.effective,
@@ -3709,7 +3716,7 @@ function RowControls({
3709
3716
  onStopPublishing
3710
3717
  }) {
3711
3718
  const { copyText: copyText3 } = (0, import_clipboard4.useClipboard)({
3712
- notify: copyNotify
3719
+ notify: shareCopyNotify
3713
3720
  });
3714
3721
  const { toast } = useToast();
3715
3722
  const [caps, setCaps] = (0, import_react14.useState)(null);
@@ -3735,7 +3742,7 @@ function RowControls({
3735
3742
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "rounded-lg border border-destructive/20 bg-destructive/10 p-3 text-xs text-destructive-ink", children: [
3736
3743
  "Couldn't read this item's sharing options: ",
3737
3744
  capsError,
3738
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ErrorAlchemyMenu, { error: capsError })
3745
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ShareErrorAlchemyMenu, { error: capsError })
3739
3746
  ] });
3740
3747
  }
3741
3748
  if (childRecord) return null;
@@ -3800,7 +3807,7 @@ function RowControls({
3800
3807
  showShownTo && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-2", "data-shown-to": shownTo ?? "default", children: [
3801
3808
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs font-medium", children: "Shown to" }),
3802
3809
  canChange ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3803
- import_design_system22.ToggleGroup,
3810
+ import_design_system17.ToggleGroup,
3804
3811
  {
3805
3812
  type: "single",
3806
3813
  size: "sm",
@@ -3810,7 +3817,7 @@ function RowControls({
3810
3817
  "aria-label": "Shown to",
3811
3818
  className: "flex-wrap justify-end",
3812
3819
  children: shownChoices.map((v) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3813
- import_design_system22.ToggleGroupItem,
3820
+ import_design_system17.ToggleGroupItem,
3814
3821
  {
3815
3822
  value: v,
3816
3823
  "aria-label": import_core31.SHOWN_TO_WORDS[v].label,
@@ -3868,7 +3875,7 @@ function RowControls({
3868
3875
  ),
3869
3876
  busy === "publish" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react11.Loader2, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }),
3870
3877
  canChange ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3871
- import_controls8.Switch,
3878
+ import_controls14.Switch,
3872
3879
  {
3873
3880
  checked: isPublic,
3874
3881
  onCheckedChange: (on) => void togglePublish(on),
@@ -3882,14 +3889,14 @@ function RowControls({
3882
3889
  isPublic && publicUrl && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center gap-1.5 rounded-md border bg-background p-1.5", children: [
3883
3890
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "min-w-0 flex-1 truncate px-1 font-mono text-xs", children: publicUrl }),
3884
3891
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3885
- import_design_system28.Button,
3892
+ import_controls16.Button,
3886
3893
  {
3887
- variant: "ghost",
3888
- size: "icon",
3889
- className: "h-7 w-7 flex-shrink-0",
3894
+ icon: copied ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react11.Check, {}) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react11.Copy, {}),
3895
+ "aria-label": "Copy web address",
3896
+ variant: "quiet",
3897
+ className: "flex-shrink-0",
3890
3898
  onClick: () => void copyAddress(),
3891
- title: "Copy web address",
3892
- children: copied ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react11.Check, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react11.Copy, { className: "h-3.5 w-3.5" })
3899
+ title: "Copy web address"
3893
3900
  }
3894
3901
  )
3895
3902
  ] })
@@ -4050,11 +4057,11 @@ function WhoCanSeeThis({
4050
4057
  // src/react/sheet/SecureLinkPanel.tsx
4051
4058
  var import_react16 = require("react");
4052
4059
  var import_lucide_react13 = require("lucide-react");
4053
- var import_design_system29 = require("@ai-matrx/design-system");
4054
- var import_design_system30 = require("@ai-matrx/design-system");
4055
- var import_controls10 = require("@ai-matrx/design-system/controls");
4056
- var import_design_system31 = require("@ai-matrx/design-system");
4057
- var import_design_system32 = require("@ai-matrx/design-system");
4060
+ var import_controls17 = require("@ai-matrx/design-system/controls");
4061
+ var import_design_system22 = require("@ai-matrx/design-system");
4062
+ var import_controls18 = require("@ai-matrx/design-system/controls");
4063
+ var import_design_system23 = require("@ai-matrx/design-system");
4064
+ var import_design_system24 = require("@ai-matrx/design-system");
4058
4065
  var import_vault2 = require("@ai-matrx/vault");
4059
4066
  var import_core33 = require("@ai-matrx/sharing/core");
4060
4067
  var import_format3 = require("@ai-matrx/kit/format");
@@ -4196,9 +4203,9 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4196
4203
  ] }),
4197
4204
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
4198
4205
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-1", children: [
4199
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system31.Label, { htmlFor: "secure-email", className: "text-xs", children: "Their email" }),
4206
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system23.Label, { htmlFor: "secure-email", className: "text-xs", children: "Their email" }),
4200
4207
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4201
- import_controls10.Input,
4208
+ import_controls18.Input,
4202
4209
  {
4203
4210
  id: "secure-email",
4204
4211
  type: "email",
@@ -4210,9 +4217,9 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4210
4217
  )
4211
4218
  ] }),
4212
4219
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-1", children: [
4213
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system31.Label, { htmlFor: "secure-phone", className: "text-xs", children: "Their mobile, for the code" }),
4220
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system23.Label, { htmlFor: "secure-phone", className: "text-xs", children: "Their mobile, for the code" }),
4214
4221
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4215
- import_controls10.Input,
4222
+ import_controls18.Input,
4216
4223
  {
4217
4224
  id: "secure-phone",
4218
4225
  type: "tel",
@@ -4231,7 +4238,7 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4231
4238
  hasBoth ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-wrap items-center gap-2 text-xs text-muted-foreground", children: [
4232
4239
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "Send the link by" }),
4233
4240
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
4234
- import_design_system22.ToggleGroup,
4241
+ import_design_system17.ToggleGroup,
4235
4242
  {
4236
4243
  type: "single",
4237
4244
  size: "sm",
@@ -4239,11 +4246,11 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4239
4246
  value: linkChannel,
4240
4247
  onValueChange: (v) => v && setLinkChannel(v),
4241
4248
  children: [
4242
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_design_system22.ToggleGroupItem, { value: "email", "aria-label": "Link by email", children: [
4249
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_design_system17.ToggleGroupItem, { value: "email", "aria-label": "Link by email", children: [
4243
4250
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react13.Mail, { className: "mr-1 h-3.5 w-3.5" }),
4244
4251
  " Email"
4245
4252
  ] }),
4246
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_design_system22.ToggleGroupItem, { value: "sms", "aria-label": "Link by text", children: [
4253
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_design_system17.ToggleGroupItem, { value: "sms", "aria-label": "Link by text", children: [
4247
4254
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react13.MessageSquare, { className: "mr-1 h-3.5 w-3.5" }),
4248
4255
  " Text"
4249
4256
  ] })
@@ -4258,7 +4265,7 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4258
4265
  ] }) : email.trim() !== "" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xs text-amber-700 dark:text-amber-400", children: "Without a mobile number, the link and the code both go by email \u2014 anyone who can read that inbox could open it." }) : null,
4259
4266
  optionsError ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: "text-xs text-destructive", children: [
4260
4267
  optionsError,
4261
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ErrorAlchemyMenu, { error: optionsError, operation: "Load the secure-link options" })
4268
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ShareErrorAlchemyMenu, { error: optionsError, operation: "Load the secure-link options" })
4262
4269
  ] }) : null,
4263
4270
  protectedFields.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("fieldset", { className: "space-y-2", children: [
4264
4271
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("legend", { className: "text-xs font-medium", children: [
@@ -4267,7 +4274,7 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4267
4274
  ] }),
4268
4275
  protectedFields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-start gap-2", children: [
4269
4276
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4270
- import_design_system30.Checkbox,
4277
+ import_design_system22.Checkbox,
4271
4278
  {
4272
4279
  size: "sm",
4273
4280
  id: `secure-field-${f.key}`,
@@ -4279,15 +4286,15 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4279
4286
  }
4280
4287
  ),
4281
4288
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
4282
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system31.Label, { htmlFor: `secure-field-${f.key}`, className: "text-sm", children: f.label }),
4289
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system23.Label, { htmlFor: `secure-field-${f.key}`, className: "text-sm", children: f.label }),
4283
4290
  !f.available && f.reason ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xs text-muted-foreground", children: f.reason }) : null
4284
4291
  ] })
4285
4292
  ] }, f.key))
4286
4293
  ] }) : null,
4287
4294
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-1", children: [
4288
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system31.Label, { htmlFor: "secure-note", className: "text-xs", children: "Message (optional, shown once with it)" }),
4295
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system23.Label, { htmlFor: "secure-note", className: "text-xs", children: "Message (optional, shown once with it)" }),
4289
4296
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4290
- import_design_system32.Textarea,
4297
+ import_design_system24.Textarea,
4291
4298
  {
4292
4299
  id: "secure-note",
4293
4300
  rows: 2,
@@ -4297,10 +4304,7 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4297
4304
  }
4298
4305
  )
4299
4306
  ] }),
4300
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_design_system29.Button, { className: "w-full", onClick: send, disabled: !canSend, children: [
4301
- sending ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react13.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : null,
4302
- "Send secure link"
4303
- ] }),
4307
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_controls17.Button, { icon: sending ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react13.Loader2, { className: "animate-spin" }) : null, variant: "primary", className: "w-full", onClick: send, disabled: !canSend, children: "Send secure link" }),
4304
4308
  result ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
4305
4309
  "div",
4306
4310
  {
@@ -4323,7 +4327,7 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4323
4327
  row.field_keys.length > 0 ? ` \xB7 with ${row.field_keys.join(", ")}` : ""
4324
4328
  ] })
4325
4329
  ] }),
4326
- row.status === "pending" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_design_system29.Button, { size: "sm", variant: "outline", onClick: () => void turnOff(row), children: "Turn off" }) : null
4330
+ row.status === "pending" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_controls17.Button, { variant: "outline", onClick: () => void turnOff(row), children: "Turn off" }) : null
4327
4331
  ] }, row.id)) })
4328
4332
  ] }) : null
4329
4333
  ] });
@@ -4482,7 +4486,7 @@ function ShareModal({
4482
4486
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "text-xs text-destructive/80 mt-0.5", children: [
4483
4487
  ownerError,
4484
4488
  " ",
4485
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ErrorAlchemyMenu, { error: ownerError })
4489
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ShareErrorAlchemyMenu, { error: ownerError })
4486
4490
  ] })
4487
4491
  ] })
4488
4492
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "p-3 rounded-lg border bg-muted/30 flex items-start gap-2", children: [
@@ -4509,7 +4513,7 @@ function ShareModal({
4509
4513
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PageCaptureButton, { size: "xs" })
4510
4514
  ] }),
4511
4515
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system2.DialogDescription, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4512
- EntityRef,
4516
+ ShareEntityRef,
4513
4517
  {
4514
4518
  token: resourceType,
4515
4519
  id: resourceId,
@@ -4519,18 +4523,15 @@ function ShareModal({
4519
4523
  }
4520
4524
  ) }) })
4521
4525
  ] }),
4522
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
4523
- import_design_system34.Button,
4526
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4527
+ import_controls20.Button,
4524
4528
  {
4529
+ icon: emailingLink ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.Loader2, { className: "animate-spin" }) : emailSent ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.CheckCircle, { className: "text-green-500" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.Mail, {}),
4525
4530
  variant: "outline",
4526
- size: "sm",
4527
4531
  onClick: handleEmailLink,
4528
4532
  disabled: emailingLink,
4529
4533
  className: "flex-shrink-0",
4530
- children: [
4531
- emailingLink ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.Loader2, { className: "h-4 w-4 animate-spin" }) : emailSent ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.CheckCircle, { className: "h-4 w-4 text-green-500" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.Mail, { className: "h-4 w-4" }),
4532
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ml-1.5 hidden sm:inline", children: emailSent ? "Sent!" : "Email link" })
4533
- ]
4534
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ml-1.5 hidden sm:inline", children: emailSent ? "Sent!" : "Email link" })
4534
4535
  }
4535
4536
  )
4536
4537
  ] }) }),
@@ -4539,22 +4540,22 @@ function ShareModal({
4539
4540
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm font-medium", children: "Sharing is unavailable" }),
4540
4541
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "text-xs text-muted-foreground max-w-sm", children: [
4541
4542
  configError,
4542
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ErrorAlchemyMenu, { error: configError })
4543
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ShareErrorAlchemyMenu, { error: configError })
4543
4544
  ] })
4544
4545
  ] }),
4545
4546
  !configError && resolvingOwner && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-1 space-y-3 py-4", "aria-busy": "true", children: [
4546
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system35.Skeleton, { className: "h-9 w-full" }),
4547
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system35.Skeleton, { className: "h-24 w-full" }),
4548
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system35.Skeleton, { className: "h-32 w-full" })
4547
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system26.Skeleton, { className: "h-9 w-full" }),
4548
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system26.Skeleton, { className: "h-24 w-full" }),
4549
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system26.Skeleton, { className: "h-32 w-full" })
4549
4550
  ] }),
4550
4551
  !configError && !resolvingOwner && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
4551
- import_design_system33.Tabs,
4552
+ import_design_system25.Tabs,
4552
4553
  {
4553
4554
  value: activeTab,
4554
4555
  onValueChange: (value) => setActiveTab(value),
4555
4556
  className: "flex-1 flex flex-col min-h-0",
4556
4557
  children: [
4557
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_controls11.TabsList, { fill: true, className: "flex-shrink-0", children: [
4558
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_controls19.TabsList, { fill: true, className: "flex-shrink-0", children: [
4558
4559
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(ShareTabsTrigger, { value: "users", children: [
4559
4560
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.Users, { className: "w-4 h-4" }),
4560
4561
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "hidden sm:inline", children: "Users" }),
@@ -4575,7 +4576,7 @@ function ShareModal({
4575
4576
  ] })
4576
4577
  ] }),
4577
4578
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dialog-scroll-clear-floating flex-1 mt-3 min-h-0 overflow-y-auto", children: [
4578
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_design_system33.TabsContent, { value: "users", className: "mt-0 space-y-3", children: [
4579
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_design_system25.TabsContent, { value: "users", className: "mt-0 space-y-3", children: [
4579
4580
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4580
4581
  WhoCanSeeThis,
4581
4582
  {
@@ -4669,7 +4670,7 @@ function ShareModal({
4669
4670
  }
4670
4671
  ) : null
4671
4672
  ] }),
4672
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_design_system33.TabsContent, { value: "access", className: "mt-0", children: [
4673
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_design_system25.TabsContent, { value: "access", className: "mt-0", children: [
4673
4674
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4674
4675
  AccessSummaryPanel,
4675
4676
  {
@@ -4681,7 +4682,7 @@ function ShareModal({
4681
4682
  ),
4682
4683
  resourceType === "record" && isOwner ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WhoCouldSeeOn, { recordId: resourceId }) : null
4683
4684
  ] }),
4684
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system33.TabsContent, { value: "secure", className: "mt-0", children: isOwner ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4685
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system25.TabsContent, { value: "secure", className: "mt-0", children: isOwner ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4685
4686
  SecureLinkPanel,
4686
4687
  {
4687
4688
  resourceType,
@@ -4689,7 +4690,7 @@ function ShareModal({
4689
4690
  resourceName
4690
4691
  }
4691
4692
  ) : manageBlockedNotice }),
4692
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system33.TabsContent, { value: "public", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4693
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system25.TabsContent, { value: "public", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4693
4694
  PublicAccessTab,
4694
4695
  {
4695
4696
  publicPermission,
@@ -4705,7 +4706,7 @@ function ShareModal({
4705
4706
  ),
4706
4707
  error && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mt-3 p-2.5 bg-destructive/10 border border-destructive/20 rounded-md flex-shrink-0", children: [
4707
4708
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-destructive", children: error }),
4708
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ErrorAlchemyMenu, { error })
4709
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ShareErrorAlchemyMenu, { error })
4709
4710
  ] })
4710
4711
  ] }) });
4711
4712
  }