@vectramindnpm/unified-design-system 0.2.0 → 0.2.2

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/index.cjs CHANGED
@@ -2331,8 +2331,17 @@ var ScrollToFieldError = () => {
2331
2331
  const errorKeys = Object.keys(errors);
2332
2332
  if (errorKeys.length === 0) return;
2333
2333
  const firstErrorKey = errorKeys[0];
2334
- const el = document.querySelector(`[name="${firstErrorKey}"]`) || document.getElementById(firstErrorKey);
2335
- if (!el) return;
2334
+ const rawEl = document.querySelector(`[name="${firstErrorKey}"]`) || document.getElementById(firstErrorKey);
2335
+ if (!rawEl) return;
2336
+ const isRenderedEl = (node) => node.offsetParent !== null || node === document.body;
2337
+ let el = rawEl;
2338
+ if (!isRenderedEl(rawEl)) {
2339
+ let ancestor = rawEl.parentElement;
2340
+ while (ancestor && !isRenderedEl(ancestor)) {
2341
+ ancestor = ancestor.parentElement;
2342
+ }
2343
+ if (ancestor) el = ancestor;
2344
+ }
2336
2345
  const scrollable = el.closest(".edit-panel__body") || el.closest(".dept-modal__panel-backdrop") || el.closest(".dept-modal__backdrop") || el.closest("[class*='overflow-y-auto']");
2337
2346
  if (scrollable && scrollable.id !== "scroll") {
2338
2347
  const elRect = el.getBoundingClientRect();
@@ -2947,7 +2956,7 @@ var React27 = __toESM(require("react"), 1);
2947
2956
  var import_jsx_runtime27 = require("react/jsx-runtime");
2948
2957
  var CARD_TEXT_LIMIT = 20;
2949
2958
  var TruncatedText = ({ text, maxLength, className, viewMode = "grid" /* GRID */ }) => {
2950
- maxLength = viewMode === "list" /* LIST */ ? maxLength : CARD_TEXT_LIMIT;
2959
+ maxLength = maxLength ? maxLength : viewMode === "list" /* LIST */ ? void 0 : CARD_TEXT_LIMIT;
2951
2960
  if (maxLength === void 0) {
2952
2961
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TruncatedTextByWidth, { text, className });
2953
2962
  }
@@ -2955,7 +2964,7 @@ var TruncatedText = ({ text, maxLength, className, viewMode = "grid" /* GRID */
2955
2964
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: cn("cursor-default", className), children: text || "" });
2956
2965
  }
2957
2966
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Tooltip, { children: [
2958
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { children: [
2967
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: cn("block w-full truncate", className), children: [
2959
2968
  text.slice(0, maxLength),
2960
2969
  "\u2026"
2961
2970
  ] }) }),
@@ -2987,7 +2996,7 @@ var TruncatedTextByWidth = ({ text, className }) => {
2987
2996
  }
2988
2997
  const textSpan = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { ref, className: cn("block w-full truncate", className), children: text });
2989
2998
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Tooltip, { children: [
2990
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TooltipTrigger, { className: "min-w-0 w-full", children: textSpan }),
2999
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TooltipTrigger, { asChild: true, className: "min-w-0 w-full", children: textSpan }),
2991
3000
  isOverflowing && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2992
3001
  TooltipContent,
2993
3002
  {