@ai-matrx/design-system 0.86.356 → 0.86.358

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.
Files changed (131) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/auth-gate-dialog.js +2 -2
  3. package/dist/carousel.js +11 -10
  4. package/dist/carousel.js.map +1 -1
  5. package/dist/{chunk-UWTODOMD.js → chunk-2BQAHLU3.js} +4 -4
  6. package/dist/{chunk-T4D7WAV7.js → chunk-42GFQMLA.js} +2 -2
  7. package/dist/chunk-5Z5GTXKL.js +79 -0
  8. package/dist/chunk-5Z5GTXKL.js.map +1 -0
  9. package/dist/{chunk-POJ3RR3K.js → chunk-B5D3VIMC.js} +1 -1
  10. package/dist/{chunk-POJ3RR3K.js.map → chunk-B5D3VIMC.js.map} +1 -1
  11. package/dist/{chunk-4WSXAP24.js → chunk-BB5LA7FQ.js} +3 -1
  12. package/dist/chunk-BB5LA7FQ.js.map +1 -0
  13. package/dist/{chunk-FRJ4PPA2.js → chunk-CZGZV35G.js} +2 -2
  14. package/dist/{chunk-RLM4RSED.js → chunk-GUGBVQ4T.js} +6 -4
  15. package/dist/{chunk-RLM4RSED.js.map → chunk-GUGBVQ4T.js.map} +1 -1
  16. package/dist/{chunk-LJKF267O.js → chunk-HS6GMHKZ.js} +18 -76
  17. package/dist/chunk-HS6GMHKZ.js.map +1 -0
  18. package/dist/{chunk-2PO3N42Q.js → chunk-K3XWUACX.js} +5 -5
  19. package/dist/{chunk-ZMUPFGQO.js → chunk-K5ZQROWN.js} +5 -5
  20. package/dist/{chunk-U46XUQI7.js → chunk-KSCSH7AO.js} +16 -14
  21. package/dist/chunk-KSCSH7AO.js.map +1 -0
  22. package/dist/{chunk-MTE6N7XU.js → chunk-NFJ63LIH.js} +2 -2
  23. package/dist/{chunk-CFUXEGW2.js → chunk-OUQT72UL.js} +4 -4
  24. package/dist/{chunk-WUD23YTG.js → chunk-P56Y43RL.js} +6 -6
  25. package/dist/{chunk-GMNROZQJ.js → chunk-QTPW44IJ.js} +2 -2
  26. package/dist/{chunk-QA7EHFRX.js → chunk-T3FKFPCW.js} +5 -5
  27. package/dist/{chunk-X6ZRHJQP.js → chunk-T57DLONB.js} +20 -11
  28. package/dist/chunk-T57DLONB.js.map +1 -0
  29. package/dist/{chunk-SOCNWQMX.js → chunk-TEMAM5ET.js} +3 -3
  30. package/dist/{chunk-CH2NWSES.js → chunk-TIV6M7Q7.js} +3 -3
  31. package/dist/{chunk-6XNYYROM.js → chunk-WVEDW5VO.js} +2 -2
  32. package/dist/clipboard-fallback-dialog.js +4 -4
  33. package/dist/controls.cjs +34 -13
  34. package/dist/controls.cjs.map +1 -1
  35. package/dist/controls.js +9 -8
  36. package/dist/data-table/data-row-inspector.cjs +99 -11
  37. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  38. package/dist/data-table/data-row-inspector.js +8 -7
  39. package/dist/data-table/data-row-window.cjs +99 -11
  40. package/dist/data-table/data-row-window.cjs.map +1 -1
  41. package/dist/data-table/data-row-window.js +11 -10
  42. package/dist/data-table/drill-chart.cjs +15 -3
  43. package/dist/data-table/drill-chart.cjs.map +1 -1
  44. package/dist/data-table/drill-chart.js +2 -1
  45. package/dist/data-table/drill-chart.js.map +1 -1
  46. package/dist/data-table/host.cjs.map +1 -1
  47. package/dist/data-table/host.d.cts +6 -2
  48. package/dist/data-table/host.d.ts +6 -2
  49. package/dist/data-table/host.js +1 -1
  50. package/dist/data-table/index.cjs +54 -40
  51. package/dist/data-table/index.cjs.map +1 -1
  52. package/dist/data-table/index.d.cts +6 -2
  53. package/dist/data-table/index.d.ts +6 -2
  54. package/dist/data-table/index.js +25 -28
  55. package/dist/data-table/index.js.map +1 -1
  56. package/dist/data-table/pagination.cjs +19 -10
  57. package/dist/data-table/pagination.cjs.map +1 -1
  58. package/dist/data-table/pagination.js +4 -4
  59. package/dist/data-table/uuid-cell.cjs +99 -11
  60. package/dist/data-table/uuid-cell.cjs.map +1 -1
  61. package/dist/data-table/uuid-cell.js +5 -4
  62. package/dist/desktop.cjs +45 -15
  63. package/dist/desktop.cjs.map +1 -1
  64. package/dist/desktop.js +23 -15
  65. package/dist/desktop.js.map +1 -1
  66. package/dist/email-input-dialog.cjs +15 -3
  67. package/dist/email-input-dialog.cjs.map +1 -1
  68. package/dist/email-input-dialog.js +4 -3
  69. package/dist/email-input-dialog.js.map +1 -1
  70. package/dist/error-sentence.cjs +130 -0
  71. package/dist/error-sentence.cjs.map +1 -0
  72. package/dist/error-sentence.d.cts +49 -0
  73. package/dist/error-sentence.d.ts +49 -0
  74. package/dist/error-sentence.js +22 -0
  75. package/dist/error-sentence.js.map +1 -0
  76. package/dist/index.cjs +47 -26
  77. package/dist/index.cjs.map +1 -1
  78. package/dist/index.d.cts +12 -10
  79. package/dist/index.d.ts +12 -10
  80. package/dist/index.js +30 -28
  81. package/dist/index.js.map +1 -1
  82. package/dist/item.cjs +19 -10
  83. package/dist/item.cjs.map +1 -1
  84. package/dist/item.js +7 -7
  85. package/dist/lite-table.cjs +15 -3
  86. package/dist/lite-table.cjs.map +1 -1
  87. package/dist/lite-table.js +5 -4
  88. package/dist/lite-table.js.map +1 -1
  89. package/dist/menu-look.cjs +19 -10
  90. package/dist/menu-look.cjs.map +1 -1
  91. package/dist/menu-look.js +2 -2
  92. package/dist/notice-stack.cjs +2 -0
  93. package/dist/notice-stack.cjs.map +1 -1
  94. package/dist/notice-stack.d.cts +11 -1
  95. package/dist/notice-stack.d.ts +11 -1
  96. package/dist/notice-stack.js +3 -1
  97. package/dist/record-list.cjs +34 -13
  98. package/dist/record-list.cjs.map +1 -1
  99. package/dist/record-list.js +8 -7
  100. package/dist/record-list.js.map +1 -1
  101. package/dist/sandbox-gate-dialog.js +2 -2
  102. package/dist/scope-mismatch-dialog.js +2 -2
  103. package/dist/settings.js +3 -3
  104. package/dist/swipe-deck.cjs +15 -3
  105. package/dist/swipe-deck.cjs.map +1 -1
  106. package/dist/swipe-deck.js +2 -1
  107. package/dist/swipe-deck.js.map +1 -1
  108. package/dist/text-input-dialog.cjs +15 -3
  109. package/dist/text-input-dialog.cjs.map +1 -1
  110. package/dist/text-input-dialog.js +4 -3
  111. package/dist/text-input-dialog.js.map +1 -1
  112. package/dist/value-prompts-dialog.js +2 -2
  113. package/dist/writing-field.js +5 -5
  114. package/package.json +12 -2
  115. package/dist/chunk-4WSXAP24.js.map +0 -1
  116. package/dist/chunk-LJKF267O.js.map +0 -1
  117. package/dist/chunk-U46XUQI7.js.map +0 -1
  118. package/dist/chunk-X6ZRHJQP.js.map +0 -1
  119. /package/dist/{chunk-UWTODOMD.js.map → chunk-2BQAHLU3.js.map} +0 -0
  120. /package/dist/{chunk-T4D7WAV7.js.map → chunk-42GFQMLA.js.map} +0 -0
  121. /package/dist/{chunk-FRJ4PPA2.js.map → chunk-CZGZV35G.js.map} +0 -0
  122. /package/dist/{chunk-2PO3N42Q.js.map → chunk-K3XWUACX.js.map} +0 -0
  123. /package/dist/{chunk-ZMUPFGQO.js.map → chunk-K5ZQROWN.js.map} +0 -0
  124. /package/dist/{chunk-MTE6N7XU.js.map → chunk-NFJ63LIH.js.map} +0 -0
  125. /package/dist/{chunk-CFUXEGW2.js.map → chunk-OUQT72UL.js.map} +0 -0
  126. /package/dist/{chunk-WUD23YTG.js.map → chunk-P56Y43RL.js.map} +0 -0
  127. /package/dist/{chunk-GMNROZQJ.js.map → chunk-QTPW44IJ.js.map} +0 -0
  128. /package/dist/{chunk-QA7EHFRX.js.map → chunk-T3FKFPCW.js.map} +0 -0
  129. /package/dist/{chunk-SOCNWQMX.js.map → chunk-TEMAM5ET.js.map} +0 -0
  130. /package/dist/{chunk-CH2NWSES.js.map → chunk-TIV6M7Q7.js.map} +0 -0
  131. /package/dist/{chunk-6XNYYROM.js.map → chunk-WVEDW5VO.js.map} +0 -0
@@ -3,16 +3,17 @@ import "../chunk-QFP4BUKZ.js";
3
3
  import {
4
4
  RecordId,
5
5
  shortUuid
6
- } from "../chunk-U46XUQI7.js";
7
- import "../chunk-6XNYYROM.js";
6
+ } from "../chunk-KSCSH7AO.js";
7
+ import "../chunk-WVEDW5VO.js";
8
8
  import "../chunk-BD77DHUO.js";
9
9
  import "../chunk-BKCJUFD3.js";
10
10
  import "../chunk-PIQJULQB.js";
11
11
  import "../chunk-MOZRIHJF.js";
12
- import "../chunk-X6ZRHJQP.js";
12
+ import "../chunk-T57DLONB.js";
13
13
  import "../chunk-BNXNIN2S.js";
14
+ import "../chunk-HS6GMHKZ.js";
14
15
  import "../chunk-ORXB4A5E.js";
15
- import "../chunk-POJ3RR3K.js";
16
+ import "../chunk-B5D3VIMC.js";
16
17
  import "../chunk-4JAYMFQO.js";
17
18
  import "../chunk-WFITMVDB.js";
18
19
  import "../chunk-WAT2XW7L.js";
package/dist/desktop.cjs CHANGED
@@ -3896,7 +3896,7 @@ var DropdownMenuSubTrigger = React25.forwardRef(({ className, inset, children, .
3896
3896
  DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
3897
3897
  var DropdownMenuSubContent = React25.forwardRef(({ className, container, surface = "default", sideOffset = 2, alignOffset = -4, collisionPadding, onFocusOutside, children, ...props }, ref) => {
3898
3898
  const portalContainer = usePortalContainer(container);
3899
- const [bottomClearance] = React25.useState(readBottomClearance);
3899
+ const [bottomClearance] = React25.useState(sharedBottomClearance);
3900
3900
  const padding = menuCollisionPadding(collisionPadding ?? 8, 0, bottomClearance);
3901
3901
  const nested = useNestedSubmenuPlacement(ref, padding);
3902
3902
  const keep = useSubmenuSurvivesParentPanelFocus(nested.ref, onFocusOutside);
@@ -3918,18 +3918,27 @@ var DropdownMenuSubContent = React25.forwardRef(({ className, container, surface
3918
3918
  ) });
3919
3919
  });
3920
3920
  DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
3921
- function readTopClearance() {
3922
- return readClearance("var(--matrx-floating-top-clearance, var(--shell-header-h, 0px))");
3923
- }
3924
- function readBottomClearance() {
3925
- return readClearance("var(--matrx-floating-clearance, 0px)");
3926
- }
3927
3921
  function menuCollisionPadding(caller, top, bottom, fallback = 0) {
3928
3922
  const side = (key2) => typeof caller === "number" ? caller : caller?.[key2] ?? fallback;
3929
3923
  return { top: Math.max(side("top"), top), right: side("right"), bottom: Math.max(side("bottom"), bottom), left: side("left") };
3930
3924
  }
3931
- function readClearance(height) {
3925
+ var CLEARANCE_REUSE_MS = 500;
3926
+ var clearanceCache = /* @__PURE__ */ new Map();
3927
+ var clock = () => typeof performance !== "undefined" ? performance.now() : Date.now();
3928
+ function readClearance(height, shared = false) {
3932
3929
  if (typeof document === "undefined") return 0;
3930
+ const now = clock();
3931
+ const held = shared ? clearanceCache.get(height) : void 0;
3932
+ if (held && now - held.at < CLEARANCE_REUSE_MS) return held.px;
3933
+ const px = measureClearance(height);
3934
+ clearanceCache.set(height, { px, at: now });
3935
+ return px;
3936
+ }
3937
+ var TOP_CLEARANCE = "var(--matrx-floating-top-clearance, var(--shell-header-h, 0px))";
3938
+ var BOTTOM_CLEARANCE = "var(--matrx-floating-clearance, 0px)";
3939
+ var sharedTopClearance = () => readClearance(TOP_CLEARANCE, true);
3940
+ var sharedBottomClearance = () => readClearance(BOTTOM_CLEARANCE, true);
3941
+ function measureClearance(height) {
3933
3942
  const probe = document.createElement("div");
3934
3943
  probe.style.cssText = `position:fixed;top:0;left:0;width:0;visibility:hidden;pointer-events:none;height:${height}`;
3935
3944
  document.body.appendChild(probe);
@@ -3939,8 +3948,8 @@ function readClearance(height) {
3939
3948
  }
3940
3949
  var DropdownMenuContent = React25.forwardRef(({ className, sideOffset = 4, container, surface = "default", children, onCloseAutoFocus, collisionPadding, ...props }, ref) => {
3941
3950
  const portalContainer = usePortalContainer(container);
3942
- const [topClearance] = React25.useState(readTopClearance);
3943
- const [bottomClearance] = React25.useState(readBottomClearance);
3951
+ const [topClearance] = React25.useState(sharedTopClearance);
3952
+ const [bottomClearance] = React25.useState(sharedBottomClearance);
3944
3953
  const edges = useMenuScrollEdges(ref);
3945
3954
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3946
3955
  DropdownMenuPrimitive.Content,
@@ -5478,6 +5487,16 @@ function errorSentenceOf(error) {
5478
5487
  }
5479
5488
  var TIMED_OUT_SENTENCE = "That took too long. Nothing was lost; try again.";
5480
5489
  var FALLBACK_ERROR_SENTENCE = "Something went wrong. Try again.";
5490
+ var CARD_ERROR_LINE = {
5491
+ OFFLINE: "No connection",
5492
+ TIMEOUT: "Took too long. Nothing was lost.",
5493
+ UNAUTHORIZED: "Signed out. Sign in again.",
5494
+ FORBIDDEN: "Not allowed for this account",
5495
+ NOT_FOUND: "Not found. Refresh and retry.",
5496
+ RATE_LIMIT: "Too many requests. Wait a moment.",
5497
+ SERVER: "Server problem. Try again soon.",
5498
+ FALLBACK: "Something went wrong"
5499
+ };
5481
5500
  function isTimedOutError(error, message, code) {
5482
5501
  if (code === "57014" || code === "timed_out") return true;
5483
5502
  if (error && typeof error === "object") {
@@ -5487,6 +5506,10 @@ function isTimedOutError(error, message, code) {
5487
5506
  const text = `${message ?? ""} ${errorSentenceOf(error)}`;
5488
5507
  return /canceling statement due to statement timeout/i.test(text);
5489
5508
  }
5509
+ function isOfflineError(error, message) {
5510
+ if (typeof navigator !== "undefined" && navigator.onLine === false) return true;
5511
+ return offlineText(`${message ?? ""} ${errorSentenceOf(error)}`);
5512
+ }
5490
5513
  function offlineText(text) {
5491
5514
  const t = text.trim();
5492
5515
  return t !== "" && (describeError(t).code === "OFFLINE" || /networkerror|network request failed|load failed/i.test(t));
@@ -5498,8 +5521,9 @@ function isRawErrorText(text) {
5498
5521
  return MACHINE_PREFIX.test(text) || RAW_TEXT.test(text);
5499
5522
  }
5500
5523
  function peopleErrorSentence(error, message, options = {}) {
5501
- if (isTimedOutError(error, message, options.code)) return TIMED_OUT_SENTENCE;
5502
- const fallback = options.fallback ?? FALLBACK_ERROR_SENTENCE;
5524
+ const card = options.card === true;
5525
+ if (isTimedOutError(error, message, options.code)) return card ? CARD_ERROR_LINE.TIMEOUT : TIMED_OUT_SENTENCE;
5526
+ const fallback = options.fallback ?? (card ? CARD_ERROR_LINE.FALLBACK : FALLBACK_ERROR_SENTENCE);
5503
5527
  const raw = message?.trim() || errorSentenceOf(error).trim();
5504
5528
  if (!raw) return fallback;
5505
5529
  let text = raw;
@@ -5507,7 +5531,8 @@ function peopleErrorSentence(error, message, options = {}) {
5507
5531
  if (!text) return fallback;
5508
5532
  if (offlineText(text) || RAW_TEXT.test(text) || text !== raw) {
5509
5533
  const said = describeError(text, fallback);
5510
- return said.code && ANY_HOST_CODES.has(said.code) ? said.cause : fallback;
5534
+ if (!said.code || !ANY_HOST_CODES.has(said.code)) return fallback;
5535
+ return card ? CARD_ERROR_LINE[said.code] : said.cause;
5511
5536
  }
5512
5537
  return text;
5513
5538
  }
@@ -5515,6 +5540,9 @@ function peopleErrorSentence(error, message, options = {}) {
5515
5540
  // src/desktop/state.tsx
5516
5541
  var import_clipboard = require("@ai-matrx/kit/clipboard");
5517
5542
  var import_jsx_runtime42 = require("react/jsx-runtime");
5543
+ function isOfflineOrKnown(text) {
5544
+ return isOfflineError(null, text) || isTimedOutError(null, text);
5545
+ }
5518
5546
  var EMPTY_ICON = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.75, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
5519
5547
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { d: "M22 12h-6l-2 3h-4l-2-3H2" }),
5520
5548
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { d: "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" })
@@ -5591,10 +5619,12 @@ var BANNER_ICON = {
5591
5619
  };
5592
5620
  function Banner({ tone, icon, title, message, actions, detail, onDismiss, count, className, ...props }) {
5593
5621
  const [copied, setCopied] = React34.useState(false);
5594
- if (typeof title === "string" && isRawErrorText(title)) title = peopleErrorSentence(null, title);
5595
- if (typeof message === "string" && isRawErrorText(message)) message = peopleErrorSentence(null, message);
5596
5622
  const registry3 = React34.useContext(NoticeStackContext);
5597
5623
  const floating = registry3 !== null;
5624
+ const asCard = registry3 !== null;
5625
+ if (typeof title === "string" && isRawErrorText(title)) title = peopleErrorSentence(null, title, { card: asCard });
5626
+ if (typeof message === "string" && (isRawErrorText(message) || asCard && isOfflineOrKnown(message)))
5627
+ message = peopleErrorSentence(null, message, { card: asCard });
5598
5628
  const id = React34.useId();
5599
5629
  const key2 = bannerNoticeKey(tone, title, message);
5600
5630
  React34.useLayoutEffect(() => {