@ai-matrx/sharing 0.1.4 → 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(() => {
@@ -409,12 +409,12 @@ var import_react17 = require("react");
409
409
  var import_design_system2 = require("@ai-matrx/design-system");
410
410
 
411
411
  // src/react/sheet/ShareModal.tsx
412
- var import_design_system33 = require("@ai-matrx/design-system");
413
- 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");
414
414
 
415
415
  // src/react/sheet/ui/share-tabs-trigger.tsx
416
416
  var React = __toESM(require("react"), 1);
417
- var import_controls = require("@ai-matrx/design-system/controls");
417
+ var import_controls2 = require("@ai-matrx/design-system/controls");
418
418
  var import_jsx_runtime2 = require("react/jsx-runtime");
419
419
  function focusOnClick(onClick) {
420
420
  return (event) => {
@@ -426,12 +426,12 @@ function focusOnClick(onClick) {
426
426
  };
427
427
  }
428
428
  var ShareTabsTrigger = React.forwardRef(
429
- ({ 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) })
430
430
  );
431
431
  ShareTabsTrigger.displayName = "ShareTabsTrigger";
432
432
 
433
433
  // src/react/sheet/ShareModal.tsx
434
- var import_design_system34 = require("@ai-matrx/design-system");
434
+ var import_controls20 = require("@ai-matrx/design-system/controls");
435
435
  var import_lucide_react14 = require("lucide-react");
436
436
 
437
437
  // src/react/permissionHooks.ts
@@ -904,16 +904,16 @@ function useGrantableLevels(resourceType, resourceId, enabled, refreshKey) {
904
904
 
905
905
  // src/react/sheet/ShareModal.tsx
906
906
  var import_core35 = require("@ai-matrx/sharing/core");
907
- var import_design_system35 = require("@ai-matrx/design-system");
907
+ var import_design_system26 = require("@ai-matrx/design-system");
908
908
  var import_lucide_react15 = require("lucide-react");
909
909
 
910
910
  // src/react/sheet/PermissionsList.tsx
911
911
  var import_react4 = require("react");
912
+ var import_controls3 = require("@ai-matrx/design-system/controls");
912
913
  var import_design_system5 = require("@ai-matrx/design-system");
913
- var import_design_system6 = require("@ai-matrx/design-system");
914
914
  var import_cn = require("@ai-matrx/design-system/cn");
915
- var import_design_system7 = require("@ai-matrx/design-system");
916
- 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");
917
917
  var import_lucide_react2 = require("lucide-react");
918
918
 
919
919
  // src/react/sheet/PermissionBadge.tsx
@@ -1234,7 +1234,7 @@ function PermissionsList({
1234
1234
  // `group` is what reveals the door controls below on hover — without
1235
1235
  // it EntityDoorControls renders at opacity-0 and the door is
1236
1236
  // invisible, which is the failure this campaign has hit four times.
1237
- /* @__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: [
1238
1238
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
1239
1239
  permission.grantedToUser && !permission.isPublic ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1240
1240
  UserAvatarDisplay,
@@ -1297,33 +1297,31 @@ function PermissionsList({
1297
1297
  ) }),
1298
1298
  isOwner ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1299
1299
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1300
- import_design_system7.Select,
1300
+ import_design_system6.Select,
1301
1301
  {
1302
1302
  value: permission.permissionLevel,
1303
1303
  onValueChange: (value) => handleUpdateLevel(permission, value),
1304
1304
  disabled: isUpdating || isRevoking,
1305
1305
  children: [
1306
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_controls2.SelectTrigger, { className: "w-[140px]", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_design_system7.SelectValue, {}) }),
1307
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_design_system7.SelectContent, { children: [
1308
- /* @__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 }),
1309
- /* @__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 }),
1310
- /* @__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 }),
1311
- /* @__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 })
1312
1312
  ] })
1313
1313
  ]
1314
1314
  }
1315
1315
  ),
1316
1316
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1317
- import_design_system5.Button,
1317
+ import_controls3.Button,
1318
1318
  {
1319
- variant: "ghost",
1320
- size: "icon",
1321
- 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",
1322
1321
  "aria-label": `Revoke access for ${getPermissionLabel(permission)}`,
1323
1322
  title: `Revoke access for ${getPermissionLabel(permission)}`,
1324
1323
  onClick: () => setConfirmRevoke({ open: true, permission }),
1325
- disabled: isUpdating || isRevoking,
1326
- 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
1327
1325
  }
1328
1326
  )
1329
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)(
@@ -1640,16 +1638,16 @@ function ReasonRow({
1640
1638
 
1641
1639
  // src/react/sheet/ShareWithUserTab.tsx
1642
1640
  var import_react7 = require("react");
1643
- var import_design_system14 = require("@ai-matrx/design-system");
1644
- var import_design_system15 = require("@ai-matrx/design-system");
1645
- var import_design_system16 = require("@ai-matrx/design-system");
1646
- 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");
1647
1645
 
1648
1646
  // src/react/sheet/ui/scroll-area.tsx
1649
- var import_design_system8 = require("@ai-matrx/design-system");
1647
+ var import_design_system7 = require("@ai-matrx/design-system");
1650
1648
 
1651
1649
  // src/react/sheet/ui/avatar.tsx
1652
- var import_design_system9 = require("@ai-matrx/design-system");
1650
+ var import_design_system8 = require("@ai-matrx/design-system");
1653
1651
 
1654
1652
  // src/react/sheet/ShareWithUserTab.tsx
1655
1653
  var import_lucide_react5 = require("lucide-react");
@@ -1663,11 +1661,11 @@ var import_core12 = require("@ai-matrx/sharing/core");
1663
1661
  var import_core13 = require("@ai-matrx/sharing/core");
1664
1662
  var import_react6 = require("react");
1665
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");
1666
1666
  var import_design_system10 = require("@ai-matrx/design-system");
1667
1667
  var import_design_system11 = require("@ai-matrx/design-system");
1668
- var import_design_system12 = require("@ai-matrx/design-system");
1669
- var import_design_system13 = require("@ai-matrx/design-system");
1670
- var import_controls3 = require("@ai-matrx/design-system/controls");
1668
+ var import_controls6 = require("@ai-matrx/design-system/controls");
1671
1669
  var import_core14 = require("@ai-matrx/sharing/core");
1672
1670
  var import_core15 = require("@ai-matrx/sharing/core");
1673
1671
  var import_jsx_runtime6 = require("react/jsx-runtime");
@@ -1783,21 +1781,19 @@ function AddEveryoneInOrg({
1783
1781
  };
1784
1782
  if (orgs.length === 0) return null;
1785
1783
  if (!open) {
1786
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1787
- import_design_system10.Button,
1784
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1785
+ import_controls5.Button,
1788
1786
  {
1787
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Users, {}),
1789
1788
  type: "button",
1790
1789
  variant: "outline",
1791
- className: "w-full h-9",
1790
+ className: "w-full",
1792
1791
  onClick: () => {
1793
1792
  if (!orgId && defaultOrgId && orgs.some((o) => o.id === defaultOrgId))
1794
1793
  setOrgId(defaultOrgId);
1795
1794
  setOpen(true);
1796
1795
  },
1797
- children: [
1798
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Users, { className: "w-4 h-4 mr-2" }),
1799
- "Add everyone in an organization or team"
1800
- ]
1796
+ children: "Add everyone in an organization or team"
1801
1797
  }
1802
1798
  );
1803
1799
  }
@@ -1815,10 +1811,10 @@ function AddEveryoneInOrg({
1815
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." })
1816
1812
  ] }),
1817
1813
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "space-y-1.5", children: [
1818
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system12.Label, { htmlFor: "add-everyone-org", className: "text-xs", children: "Organization" }),
1819
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system13.Select, { value: orgId, onValueChange: setOrgId, disabled: running, children: [
1820
- /* @__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" }) }),
1821
- /* @__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: [
1822
1818
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Building2, { className: "w-3 h-3" }),
1823
1819
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: org.name }),
1824
1820
  detail.get(org.id) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "type-meta text-muted-foreground", children: detail.get(org.id) })
@@ -1826,15 +1822,15 @@ function AddEveryoneInOrg({
1826
1822
  ] })
1827
1823
  ] }),
1828
1824
  orgId && teams.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "space-y-1.5", children: [
1829
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system12.Label, { htmlFor: "add-everyone-group", className: "text-xs", children: "Who" }),
1830
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system13.Select, { value: group, onValueChange: setGroup, disabled: running, children: [
1831
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_controls3.SelectTrigger, { id: "add-everyone-group", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system13.SelectValue, {}) }),
1832
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_design_system13.SelectContent, { children: [
1833
- /* @__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: [
1834
1830
  "Everyone in ",
1835
1831
  orgLabel
1836
1832
  ] }),
1837
- 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: [
1838
1834
  t.name,
1839
1835
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "type-meta text-muted-foreground", children: [
1840
1836
  " \xB7 ",
@@ -1845,16 +1841,16 @@ function AddEveryoneInOrg({
1845
1841
  ] })
1846
1842
  ] }) : null,
1847
1843
  orgId ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "space-y-1.5", children: [
1848
- /* @__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" }),
1849
1845
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1850
- import_design_system13.Select,
1846
+ import_design_system11.Select,
1851
1847
  {
1852
1848
  value: level,
1853
1849
  onValueChange: (v) => setOwnLevel(v),
1854
1850
  disabled: running,
1855
1851
  children: [
1856
- /* @__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, {}) }),
1857
- /* @__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)) })
1858
1854
  ]
1859
1855
  }
1860
1856
  )
@@ -1895,7 +1891,7 @@ function AddEveryoneInOrg({
1895
1891
  "data-member": m.email,
1896
1892
  children: [
1897
1893
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1898
- import_design_system11.Checkbox,
1894
+ import_design_system9.Checkbox,
1899
1895
  {
1900
1896
  size: "sm",
1901
1897
  id: `add-everyone-${m.userId}`,
@@ -1933,12 +1929,13 @@ function AddEveryoneInOrg({
1933
1929
  }) }) : null,
1934
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,
1935
1931
  members && members.length > 0 && (chosen.length > 0 || running) ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1936
- import_design_system10.Button,
1932
+ import_controls5.Button,
1937
1933
  {
1934
+ variant: "primary",
1938
1935
  type: "button",
1939
1936
  onClick: run,
1940
1937
  disabled: running || chosen.length === 0,
1941
- className: "w-full h-9",
1938
+ className: "w-full",
1942
1939
  children: running ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1943
1940
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.Loader2, { className: "w-4 h-4 mr-2 animate-spin" }),
1944
1941
  "Sharing\u2026"
@@ -2227,7 +2224,7 @@ function ShareWithUserTab({
2227
2224
  ),
2228
2225
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-2.5", children: [
2229
2226
  !selectedContact && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-1.5", children: [
2230
- /* @__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: [
2231
2228
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Users, { className: "w-3 h-3" }),
2232
2229
  "Your Contacts"
2233
2230
  ] }),
@@ -2271,7 +2268,7 @@ function ShareWithUserTab({
2271
2268
  inputClassName: "h-8 text-xs"
2272
2269
  }
2273
2270
  ) }),
2274
- /* @__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) => {
2275
2272
  const SourceIcon = SOURCE_ICONS[contact.source];
2276
2273
  return (
2277
2274
  // ui-exception: moved verbatim from the web share sheet; restyling onto design-system Button is its own UI change
@@ -2282,14 +2279,14 @@ function ShareWithUserTab({
2282
2279
  disabled: isLoading,
2283
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",
2284
2281
  children: [
2285
- /* @__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: [
2286
2283
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2287
- import_design_system9.AvatarImage,
2284
+ import_design_system8.AvatarImage,
2288
2285
  {
2289
2286
  src: contact.avatar_url || void 0
2290
2287
  }
2291
2288
  ),
2292
- /* @__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) })
2293
2290
  ] }),
2294
2291
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex-1 min-w-0", children: [
2295
2292
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-xs font-medium truncate", children: contact.display_name || contact.email || "Unknown" }),
@@ -2308,9 +2305,9 @@ function ShareWithUserTab({
2308
2305
  ] })
2309
2306
  ] }),
2310
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: [
2311
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_design_system9.Avatar, { className: "w-6 h-6 flex-shrink-0", children: [
2312
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system9.AvatarImage, { src: selectedContact.avatar_url || void 0 }),
2313
- /* @__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)(
2314
2311
  selectedContact.display_name ?? selectedContact.email
2315
2312
  ) })
2316
2313
  ] }),
@@ -2329,7 +2326,7 @@ function ShareWithUserTab({
2329
2326
  )
2330
2327
  ] }),
2331
2328
  !selectedContact && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-1.5", children: [
2332
- /* @__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" }),
2333
2330
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2334
2331
  UserSearchField,
2335
2332
  {
@@ -2356,20 +2353,20 @@ function ShareWithUserTab({
2356
2353
  )
2357
2354
  ] }),
2358
2355
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-1.5", children: [
2359
- /* @__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" }),
2360
2357
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2361
- import_design_system16.Select,
2358
+ import_design_system13.Select,
2362
2359
  {
2363
2360
  value: permissionLevel,
2364
2361
  onValueChange: (value) => setPermissionLevel(value),
2365
2362
  disabled: isLoading,
2366
2363
  children: [
2367
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_controls4.SelectTrigger, { id: "user-permission", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system16.SelectValue, {}) }),
2368
- /* @__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: [
2369
- /* @__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 }),
2370
- /* @__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 }),
2371
- /* @__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 }),
2372
- /* @__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 })
2373
2370
  ] }) })
2374
2371
  ]
2375
2372
  }
@@ -2380,11 +2377,12 @@ function ShareWithUserTab({
2380
2377
  grantable?.outside ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-xs text-muted-foreground", "data-share-outside-reason": "", children: grantable.outside }) : null
2381
2378
  ] }),
2382
2379
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2383
- import_design_system14.Button,
2380
+ import_controls7.Button,
2384
2381
  {
2382
+ variant: "primary",
2385
2383
  onClick: handleShare,
2386
2384
  disabled: isLoading || !email.trim() || chosenWhy !== null,
2387
- className: "w-full h-9",
2385
+ className: "w-full",
2388
2386
  children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2389
2387
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Loader2, { className: "w-4 h-4 mr-2 animate-spin" }),
2390
2388
  status.message || "Processing..."
@@ -2412,11 +2410,11 @@ function ShareWithUserTab({
2412
2410
  // src/react/sheet/OutsideSharePanel.tsx
2413
2411
  var import_react8 = require("react");
2414
2412
  var import_lucide_react6 = require("lucide-react");
2415
- var import_design_system17 = require("@ai-matrx/design-system");
2416
- var import_controls5 = require("@ai-matrx/design-system/controls");
2417
- var import_design_system18 = require("@ai-matrx/design-system");
2418
- var import_design_system19 = require("@ai-matrx/design-system");
2419
- 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");
2420
2418
  var import_clipboard2 = require("@ai-matrx/kit/clipboard");
2421
2419
  var import_core19 = require("@ai-matrx/sharing/core");
2422
2420
  var import_jsx_runtime8 = require("react/jsx-runtime");
@@ -2498,7 +2496,7 @@ function OutsideSharePanel({
2498
2496
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "mt-1 break-words text-xs text-muted-foreground", children: loadError })
2499
2497
  ] })
2500
2498
  ] }),
2501
- /* @__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" })
2502
2500
  ] });
2503
2501
  }
2504
2502
  if (!state2) {
@@ -2525,9 +2523,9 @@ function OutsideSharePanel({
2525
2523
  ] }) : null,
2526
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: [
2527
2525
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "min-w-0 flex-1", children: [
2528
- /* @__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" }),
2529
2527
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2530
- import_controls5.Input,
2528
+ import_controls10.Input,
2531
2529
  {
2532
2530
  id: "outside-email",
2533
2531
  type: "email",
@@ -2538,16 +2536,17 @@ function OutsideSharePanel({
2538
2536
  )
2539
2537
  ] }),
2540
2538
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "sm:w-44", children: [
2541
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system18.Label, { htmlFor: "outside-level", className: "text-xs", children: "They can" }),
2542
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_design_system19.Select, { value: level, onValueChange: setLevel, children: [
2543
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_controls6.SelectTrigger, { id: "outside-level", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_design_system19.SelectValue, {}) }),
2544
- /* @__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)) })
2545
2543
  ] })
2546
2544
  ] }),
2547
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2548
- import_design_system17.Button,
2545
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2546
+ import_controls9.Button,
2549
2547
  {
2550
- 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",
2551
2550
  disabled: !email.trim() || busy === "invite",
2552
2551
  onClick: () => void run("invite", async () => {
2553
2552
  const answer = await (0, import_core19.shareWithOutsidePerson)(organizationId, tableId, email.trim(), level);
@@ -2555,10 +2554,7 @@ function OutsideSharePanel({
2555
2554
  if (answer.granted) onGranted?.();
2556
2555
  return answer;
2557
2556
  }),
2558
- children: [
2559
- 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" }),
2560
- "Share"
2561
- ]
2557
+ children: "Share"
2562
2558
  }
2563
2559
  )
2564
2560
  ] }) : null,
@@ -2577,42 +2573,40 @@ function OutsideSharePanel({
2577
2573
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "mt-0.5 text-xs text-muted-foreground", children: row.say })
2578
2574
  ] }),
2579
2575
  state2.may_invite ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-shrink-0 gap-1", children: [
2580
- row.accept_path ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2581
- import_design_system17.Button,
2576
+ row.accept_path ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2577
+ import_controls9.Button,
2582
2578
  {
2583
- size: "sm",
2584
- 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",
2585
2581
  title: "Copy invitation link",
2586
2582
  onClick: () => void copyLink(
2587
2583
  row.invitation_id,
2588
2584
  row.accept_path,
2589
2585
  row.email
2590
2586
  ),
2591
- children: [
2592
- 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" }),
2593
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-xs", children: copied === row.invitation_id ? "Copied" : "Copy link" })
2594
- ]
2587
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-xs", children: copied === row.invitation_id ? "Copied" : "Copy link" })
2595
2588
  }
2596
2589
  ) : null,
2597
2590
  !row.joined ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2598
- import_design_system17.Button,
2591
+ import_controls9.Button,
2599
2592
  {
2600
- size: "sm",
2601
- 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",
2602
2596
  title: "Send a fresh link",
2603
2597
  disabled: busy === `resend:${row.invitation_id}`,
2604
2598
  onClick: () => void run(
2605
2599
  `resend:${row.invitation_id}`,
2606
2600
  () => (0, import_core19.resendOutside)(organizationId, row.invitation_id)
2607
- ),
2608
- 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
+ )
2609
2602
  }
2610
2603
  ) : null,
2611
2604
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2612
- import_design_system17.Button,
2605
+ import_controls9.Button,
2613
2606
  {
2614
- size: "sm",
2615
- 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",
2616
2610
  title: row.joined ? "Take their access away" : "Withdraw the invitation",
2617
2611
  disabled: busy === `revoke:${row.invitation_id}`,
2618
2612
  onClick: () => void (async () => {
@@ -2627,8 +2621,7 @@ function OutsideSharePanel({
2627
2621
  `revoke:${row.invitation_id}`,
2628
2622
  () => (0, import_core19.revokeOutside)(organizationId, row.invitation_id)
2629
2623
  );
2630
- })(),
2631
- 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
+ })()
2632
2625
  }
2633
2626
  )
2634
2627
  ] }) : null
@@ -2642,8 +2635,8 @@ var import_core36 = require("@ai-matrx/sharing/core");
2642
2635
  // src/react/sheet/WhoCouldSeeOn.tsx
2643
2636
  var import_react9 = require("react");
2644
2637
  var import_lucide_react7 = require("lucide-react");
2645
- var import_design_system20 = require("@ai-matrx/design-system");
2646
- 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");
2647
2640
  var import_core20 = require("@ai-matrx/sharing/core");
2648
2641
  var import_jsx_runtime9 = require("react/jsx-runtime");
2649
2642
  function custom() {
@@ -2674,7 +2667,7 @@ function WhoCouldSeeOn({ recordId }) {
2674
2667
  ] }),
2675
2668
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-1", children: [
2676
2669
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2677
- import_controls7.DateTimeField,
2670
+ import_controls13.DateTimeField,
2678
2671
  {
2679
2672
  "aria-label": "Moment to ask about",
2680
2673
  value: at,
@@ -2682,10 +2675,7 @@ function WhoCouldSeeOn({ recordId }) {
2682
2675
  className: "min-w-0 flex-1"
2683
2676
  }
2684
2677
  ),
2685
- /* @__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: [
2686
- busy ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.Loader2, { className: "mr-1 h-3.5 w-3.5 animate-spin" }) : null,
2687
- "Ask"
2688
- ] })
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" })
2689
2679
  ] }),
2690
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: [
2691
2681
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "min-w-0 truncate", children: [
@@ -2774,18 +2764,18 @@ var import_react14 = require("react");
2774
2764
  var import_lucide_react11 = require("lucide-react");
2775
2765
 
2776
2766
  // src/react/sheet/ui/switch.tsx
2777
- var import_design_system21 = require("@ai-matrx/design-system");
2767
+ var import_design_system16 = require("@ai-matrx/design-system");
2778
2768
  var React6 = __toESM(require("react"), 1);
2779
- var import_controls8 = require("@ai-matrx/design-system/controls");
2769
+ var import_controls14 = require("@ai-matrx/design-system/controls");
2780
2770
  var import_jsx_runtime11 = require("react/jsx-runtime");
2781
- 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 }));
2782
2772
  SwitchLegacy.displayName = "SwitchLegacy";
2783
2773
 
2784
2774
  // src/react/sheet/RowControls.tsx
2785
- var import_design_system28 = require("@ai-matrx/design-system");
2775
+ var import_controls16 = require("@ai-matrx/design-system/controls");
2786
2776
 
2787
2777
  // src/react/sheet/ui/toggle-group.tsx
2788
- var import_design_system22 = require("@ai-matrx/design-system");
2778
+ var import_design_system17 = require("@ai-matrx/design-system");
2789
2779
 
2790
2780
  // src/react/sheet/RowControls.tsx
2791
2781
  var import_cn4 = require("@ai-matrx/design-system/cn");
@@ -2798,32 +2788,31 @@ var import_core30 = require("@ai-matrx/sharing/core");
2798
2788
  var import_react12 = require("react");
2799
2789
 
2800
2790
  // src/react/sheet/ui/alert.tsx
2801
- var import_design_system23 = require("@ai-matrx/design-system");
2791
+ var import_design_system18 = require("@ai-matrx/design-system");
2802
2792
 
2803
2793
  // src/react/sheet/PublicAccessTab.tsx
2804
2794
  var import_lucide_react10 = require("lucide-react");
2805
2795
 
2806
2796
  // src/react/sheet/ShareLinkPanel.tsx
2807
2797
  var import_react11 = require("react");
2808
- var import_design_system26 = require("@ai-matrx/design-system");
2809
- var import_controls9 = require("@ai-matrx/design-system/controls");
2798
+ var import_controls15 = require("@ai-matrx/design-system/controls");
2810
2799
  var import_outbound_react = require("@ai-matrx/kit/outbound-react");
2811
2800
  var import_format2 = require("@ai-matrx/kit/format");
2812
2801
  var import_lucide_react9 = require("lucide-react");
2813
2802
  var import_core21 = require("@ai-matrx/sharing/core");
2814
2803
 
2815
2804
  // src/react/sheet/ui/confirm-dialog.tsx
2816
- var import_design_system24 = require("@ai-matrx/design-system");
2805
+ var import_design_system19 = require("@ai-matrx/design-system");
2817
2806
  var import_jsx_runtime12 = require("react/jsx-runtime");
2818
2807
  function PortalConfirmDialog(props) {
2819
2808
  const container = usePortalContainer();
2820
- 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 });
2821
2810
  }
2822
2811
 
2823
2812
  // src/react/sheet/useShare.tsx
2824
2813
  var import_clipboard3 = require("@ai-matrx/kit/clipboard");
2825
2814
  var import_react10 = require("react");
2826
- var import_design_system25 = require("@ai-matrx/design-system");
2815
+ var import_design_system20 = require("@ai-matrx/design-system");
2827
2816
  var import_jsx_runtime13 = require("react/jsx-runtime");
2828
2817
  function useShare() {
2829
2818
  const { copyText: copyTextKit } = (0, import_clipboard3.useClipboard)({
@@ -2883,7 +2872,7 @@ function useShare() {
2883
2872
  copy,
2884
2873
  copied,
2885
2874
  fallbackDialog: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2886
- import_design_system25.ClipboardFallbackDialog,
2875
+ import_design_system20.ClipboardFallbackDialog,
2887
2876
  {
2888
2877
  open: fallbackUrl !== null,
2889
2878
  onOpenChange: (open) => !open && setFallbackUrl(null),
@@ -3299,17 +3288,15 @@ function ShareLinkPanel({
3299
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" })
3300
3289
  ] })
3301
3290
  ] }),
3302
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
3303
- import_design_system26.Button,
3291
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3292
+ import_controls15.Button,
3304
3293
  {
3305
- 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",
3306
3296
  onClick: handleCreate,
3307
3297
  disabled: creating,
3308
3298
  className: "flex-shrink-0",
3309
- children: [
3310
- 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" }),
3311
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ml-1 hidden sm:inline", children: hasLink ? "New link" : "Create link" })
3312
- ]
3299
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ml-1 hidden sm:inline", children: hasLink ? "New link" : "Create link" })
3313
3300
  }
3314
3301
  )
3315
3302
  ] }),
@@ -3317,7 +3304,7 @@ function ShareLinkPanel({
3317
3304
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "flex flex-col gap-1 text-xs", children: [
3318
3305
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-muted-foreground", children: "Permission" }),
3319
3306
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3320
- import_controls9.Select,
3307
+ import_controls15.Select,
3321
3308
  {
3322
3309
  value: permissionLevel,
3323
3310
  onValueChange: setPermissionLevel,
@@ -3331,12 +3318,12 @@ function ShareLinkPanel({
3331
3318
  ] }),
3332
3319
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "flex flex-col gap-1 text-xs", children: [
3333
3320
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-muted-foreground", children: "Expires" }),
3334
- /* @__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 ?? "") })
3335
3322
  ] }),
3336
3323
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "flex flex-col gap-1 text-xs", children: [
3337
3324
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-muted-foreground", children: "Max uses" }),
3338
3325
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3339
- import_controls9.Input,
3326
+ import_controls15.Input,
3340
3327
  {
3341
3328
  type: "number",
3342
3329
  min: 1,
@@ -3383,16 +3370,15 @@ function ShareLinkPanel({
3383
3370
  }
3384
3371
  ),
3385
3372
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3386
- import_design_system26.Button,
3373
+ import_controls15.Button,
3387
3374
  {
3388
- variant: "ghost",
3389
- size: "icon",
3390
- 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",
3391
3378
  onClick: () => copyExtraUrl(`${link.id}:${extra.key}`, extra.url),
3392
3379
  disabled: !!unavailableReason,
3393
3380
  title: unavailableReason ?? "Copy",
3394
- "aria-label": `Copy ${extra.label}`,
3395
- 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}`
3396
3382
  }
3397
3383
  )
3398
3384
  ]
@@ -3401,7 +3387,7 @@ function ShareLinkPanel({
3401
3387
  )),
3402
3388
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-1.5 rounded-md border bg-background p-1.5", children: [
3403
3389
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3404
- import_controls9.Input,
3390
+ import_controls15.Input,
3405
3391
  {
3406
3392
  mono: true,
3407
3393
  readOnly: true,
@@ -3432,41 +3418,39 @@ function ShareLinkPanel({
3432
3418
  }
3433
3419
  ) : null,
3434
3420
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3435
- import_design_system26.Button,
3421
+ import_controls15.Button,
3436
3422
  {
3437
- variant: "ghost",
3438
- size: "icon",
3439
- 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",
3440
3426
  onClick: () => copyLink(link),
3441
3427
  disabled: !!unavailableReason,
3442
3428
  title: unavailableReason ?? "Copy link",
3443
- "aria-label": "Copy share link",
3444
- 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"
3445
3430
  }
3446
3431
  ),
3447
3432
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3448
- import_design_system26.Button,
3433
+ import_controls15.Button,
3449
3434
  {
3450
- variant: "ghost",
3451
- size: "icon",
3452
- 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",
3453
3438
  onClick: () => prepareTextShare(link.id),
3454
3439
  disabled: !!unavailableReason || refreshing,
3455
3440
  title: unavailableReason ?? "Review before sharing by text",
3456
- "aria-label": "Share by text",
3457
- 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"
3458
3442
  }
3459
3443
  ),
3460
3444
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3461
- import_design_system26.Button,
3445
+ import_controls15.Button,
3462
3446
  {
3463
- variant: "ghost",
3464
- size: "icon",
3465
- 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",
3466
3451
  onClick: () => setRevokeTarget(link),
3467
3452
  title: "Turn off link",
3468
- "aria-label": "Turn off share link",
3469
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Trash2, { className: "w-4 h-4" })
3453
+ "aria-label": "Turn off share link"
3470
3454
  }
3471
3455
  )
3472
3456
  ] })
@@ -3479,18 +3463,15 @@ function ShareLinkPanel({
3479
3463
  className: "flex items-center justify-between gap-2 text-xs text-destructive",
3480
3464
  children: [
3481
3465
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: shareError }),
3482
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
3483
- import_design_system26.Button,
3466
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3467
+ import_controls15.Button,
3484
3468
  {
3469
+ icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.RefreshCw, {}),
3485
3470
  type: "button",
3486
3471
  variant: "outline",
3487
- size: "sm",
3488
3472
  disabled: isLoading,
3489
3473
  onClick: () => refresh(),
3490
- children: [
3491
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.RefreshCw, { className: "mr-1 h-3.5 w-3.5" }),
3492
- "Refresh"
3493
- ]
3474
+ children: "Refresh"
3494
3475
  }
3495
3476
  ),
3496
3477
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ShareErrorAlchemyMenu, { className: "ml-auto" })
@@ -3524,18 +3505,16 @@ function ShareLinkPanel({
3524
3505
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-xs font-medium", children: "Message preview" }),
3525
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)) })
3526
3507
  ] }),
3527
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
3528
- import_design_system26.Button,
3508
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3509
+ import_controls15.Button,
3529
3510
  {
3511
+ icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Copy, {}),
3530
3512
  type: "button",
3531
3513
  variant: "outline",
3532
- className: "min-h-11 w-full sm:min-h-0",
3514
+ className: "w-full",
3533
3515
  disabled: handoffBusy,
3534
3516
  onClick: handleCopyReviewedMessage,
3535
- children: [
3536
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Copy, { className: "mr-2 h-4 w-4" }),
3537
- "Copy message"
3538
- ]
3517
+ children: "Copy message"
3539
3518
  }
3540
3519
  ),
3541
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." })
@@ -3564,7 +3543,7 @@ function ShareLinkPanel({
3564
3543
  }
3565
3544
 
3566
3545
  // src/react/sheet/PublicAccessTab.tsx
3567
- var import_design_system27 = require("@ai-matrx/design-system");
3546
+ var import_design_system21 = require("@ai-matrx/design-system");
3568
3547
  var import_core23 = require("@ai-matrx/sharing/core");
3569
3548
  var import_core24 = require("@ai-matrx/sharing/core");
3570
3549
  var import_core25 = require("@ai-matrx/sharing/core");
@@ -3599,11 +3578,11 @@ function PublicAccessTab({
3599
3578
  };
3600
3579
  }, [resourceType]);
3601
3580
  const location = (0, import_core25.sharingLocation)(copy?.surface ?? "Anyone link");
3602
- 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" });
3603
3582
  if (capabilitiesError) {
3604
- 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: [
3605
3584
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react10.AlertTriangle, { className: "h-4 w-4" }),
3606
- /* @__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: [
3607
3586
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "flex-1", children: capabilitiesError }),
3608
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)(
3609
3588
  CopyButtons,
@@ -3707,7 +3686,7 @@ function SearchEngineIndexedSwitch({
3707
3686
  children: [
3708
3687
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: id, className: "cursor-pointer text-xs text-muted-foreground", children: "Indexed by search engines" }),
3709
3688
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3710
- import_controls8.Switch,
3689
+ import_controls14.Switch,
3711
3690
  {
3712
3691
  id,
3713
3692
  checked: state2.effective,
@@ -3828,7 +3807,7 @@ function RowControls({
3828
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: [
3829
3808
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs font-medium", children: "Shown to" }),
3830
3809
  canChange ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3831
- import_design_system22.ToggleGroup,
3810
+ import_design_system17.ToggleGroup,
3832
3811
  {
3833
3812
  type: "single",
3834
3813
  size: "sm",
@@ -3838,7 +3817,7 @@ function RowControls({
3838
3817
  "aria-label": "Shown to",
3839
3818
  className: "flex-wrap justify-end",
3840
3819
  children: shownChoices.map((v) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3841
- import_design_system22.ToggleGroupItem,
3820
+ import_design_system17.ToggleGroupItem,
3842
3821
  {
3843
3822
  value: v,
3844
3823
  "aria-label": import_core31.SHOWN_TO_WORDS[v].label,
@@ -3896,7 +3875,7 @@ function RowControls({
3896
3875
  ),
3897
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" }),
3898
3877
  canChange ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3899
- import_controls8.Switch,
3878
+ import_controls14.Switch,
3900
3879
  {
3901
3880
  checked: isPublic,
3902
3881
  onCheckedChange: (on) => void togglePublish(on),
@@ -3910,14 +3889,14 @@ function RowControls({
3910
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: [
3911
3890
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "min-w-0 flex-1 truncate px-1 font-mono text-xs", children: publicUrl }),
3912
3891
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3913
- import_design_system28.Button,
3892
+ import_controls16.Button,
3914
3893
  {
3915
- variant: "ghost",
3916
- size: "icon",
3917
- 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",
3918
3898
  onClick: () => void copyAddress(),
3919
- title: "Copy web address",
3920
- 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"
3921
3900
  }
3922
3901
  )
3923
3902
  ] })
@@ -4078,11 +4057,11 @@ function WhoCanSeeThis({
4078
4057
  // src/react/sheet/SecureLinkPanel.tsx
4079
4058
  var import_react16 = require("react");
4080
4059
  var import_lucide_react13 = require("lucide-react");
4081
- var import_design_system29 = require("@ai-matrx/design-system");
4082
- var import_design_system30 = require("@ai-matrx/design-system");
4083
- var import_controls10 = require("@ai-matrx/design-system/controls");
4084
- var import_design_system31 = require("@ai-matrx/design-system");
4085
- 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");
4086
4065
  var import_vault2 = require("@ai-matrx/vault");
4087
4066
  var import_core33 = require("@ai-matrx/sharing/core");
4088
4067
  var import_format3 = require("@ai-matrx/kit/format");
@@ -4224,9 +4203,9 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4224
4203
  ] }),
4225
4204
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
4226
4205
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-1", children: [
4227
- /* @__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" }),
4228
4207
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4229
- import_controls10.Input,
4208
+ import_controls18.Input,
4230
4209
  {
4231
4210
  id: "secure-email",
4232
4211
  type: "email",
@@ -4238,9 +4217,9 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4238
4217
  )
4239
4218
  ] }),
4240
4219
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-1", children: [
4241
- /* @__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" }),
4242
4221
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4243
- import_controls10.Input,
4222
+ import_controls18.Input,
4244
4223
  {
4245
4224
  id: "secure-phone",
4246
4225
  type: "tel",
@@ -4259,7 +4238,7 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4259
4238
  hasBoth ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-wrap items-center gap-2 text-xs text-muted-foreground", children: [
4260
4239
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "Send the link by" }),
4261
4240
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
4262
- import_design_system22.ToggleGroup,
4241
+ import_design_system17.ToggleGroup,
4263
4242
  {
4264
4243
  type: "single",
4265
4244
  size: "sm",
@@ -4267,11 +4246,11 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4267
4246
  value: linkChannel,
4268
4247
  onValueChange: (v) => v && setLinkChannel(v),
4269
4248
  children: [
4270
- /* @__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: [
4271
4250
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react13.Mail, { className: "mr-1 h-3.5 w-3.5" }),
4272
4251
  " Email"
4273
4252
  ] }),
4274
- /* @__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: [
4275
4254
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react13.MessageSquare, { className: "mr-1 h-3.5 w-3.5" }),
4276
4255
  " Text"
4277
4256
  ] })
@@ -4295,7 +4274,7 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4295
4274
  ] }),
4296
4275
  protectedFields.map((f) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-start gap-2", children: [
4297
4276
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4298
- import_design_system30.Checkbox,
4277
+ import_design_system22.Checkbox,
4299
4278
  {
4300
4279
  size: "sm",
4301
4280
  id: `secure-field-${f.key}`,
@@ -4307,15 +4286,15 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4307
4286
  }
4308
4287
  ),
4309
4288
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
4310
- /* @__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 }),
4311
4290
  !f.available && f.reason ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xs text-muted-foreground", children: f.reason }) : null
4312
4291
  ] })
4313
4292
  ] }, f.key))
4314
4293
  ] }) : null,
4315
4294
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-1", children: [
4316
- /* @__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)" }),
4317
4296
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4318
- import_design_system32.Textarea,
4297
+ import_design_system24.Textarea,
4319
4298
  {
4320
4299
  id: "secure-note",
4321
4300
  rows: 2,
@@ -4325,10 +4304,7 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4325
4304
  }
4326
4305
  )
4327
4306
  ] }),
4328
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_design_system29.Button, { className: "w-full", onClick: send, disabled: !canSend, children: [
4329
- sending ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react13.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : null,
4330
- "Send secure link"
4331
- ] }),
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" }),
4332
4308
  result ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
4333
4309
  "div",
4334
4310
  {
@@ -4351,7 +4327,7 @@ function SecureLinkForm({ resourceType, resourceId, resourceName }) {
4351
4327
  row.field_keys.length > 0 ? ` \xB7 with ${row.field_keys.join(", ")}` : ""
4352
4328
  ] })
4353
4329
  ] }),
4354
- 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
4355
4331
  ] }, row.id)) })
4356
4332
  ] }) : null
4357
4333
  ] });
@@ -4547,18 +4523,15 @@ function ShareModal({
4547
4523
  }
4548
4524
  ) }) })
4549
4525
  ] }),
4550
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
4551
- import_design_system34.Button,
4526
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4527
+ import_controls20.Button,
4552
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, {}),
4553
4530
  variant: "outline",
4554
- size: "sm",
4555
4531
  onClick: handleEmailLink,
4556
4532
  disabled: emailingLink,
4557
4533
  className: "flex-shrink-0",
4558
- children: [
4559
- 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" }),
4560
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ml-1.5 hidden sm:inline", children: emailSent ? "Sent!" : "Email link" })
4561
- ]
4534
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ml-1.5 hidden sm:inline", children: emailSent ? "Sent!" : "Email link" })
4562
4535
  }
4563
4536
  )
4564
4537
  ] }) }),
@@ -4571,18 +4544,18 @@ function ShareModal({
4571
4544
  ] })
4572
4545
  ] }),
4573
4546
  !configError && resolvingOwner && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-1 space-y-3 py-4", "aria-busy": "true", children: [
4574
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system35.Skeleton, { className: "h-9 w-full" }),
4575
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_design_system35.Skeleton, { className: "h-24 w-full" }),
4576
- /* @__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" })
4577
4550
  ] }),
4578
4551
  !configError && !resolvingOwner && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
4579
- import_design_system33.Tabs,
4552
+ import_design_system25.Tabs,
4580
4553
  {
4581
4554
  value: activeTab,
4582
4555
  onValueChange: (value) => setActiveTab(value),
4583
4556
  className: "flex-1 flex flex-col min-h-0",
4584
4557
  children: [
4585
- /* @__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: [
4586
4559
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(ShareTabsTrigger, { value: "users", children: [
4587
4560
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.Users, { className: "w-4 h-4" }),
4588
4561
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "hidden sm:inline", children: "Users" }),
@@ -4603,7 +4576,7 @@ function ShareModal({
4603
4576
  ] })
4604
4577
  ] }),
4605
4578
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dialog-scroll-clear-floating flex-1 mt-3 min-h-0 overflow-y-auto", children: [
4606
- /* @__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: [
4607
4580
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4608
4581
  WhoCanSeeThis,
4609
4582
  {
@@ -4697,7 +4670,7 @@ function ShareModal({
4697
4670
  }
4698
4671
  ) : null
4699
4672
  ] }),
4700
- /* @__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: [
4701
4674
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4702
4675
  AccessSummaryPanel,
4703
4676
  {
@@ -4709,7 +4682,7 @@ function ShareModal({
4709
4682
  ),
4710
4683
  resourceType === "record" && isOwner ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WhoCouldSeeOn, { recordId: resourceId }) : null
4711
4684
  ] }),
4712
- /* @__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)(
4713
4686
  SecureLinkPanel,
4714
4687
  {
4715
4688
  resourceType,
@@ -4717,7 +4690,7 @@ function ShareModal({
4717
4690
  resourceName
4718
4691
  }
4719
4692
  ) : manageBlockedNotice }),
4720
- /* @__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)(
4721
4694
  PublicAccessTab,
4722
4695
  {
4723
4696
  publicPermission,