@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 +14 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -363,7 +363,9 @@ declare function getIconColorProps(colorName: IconColor, hoverColorName?: IconCo
|
|
|
363
363
|
};
|
|
364
364
|
|
|
365
365
|
interface IconProps$1 extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "color">, VariantProps<typeof iconVariants> {
|
|
366
|
-
|
|
366
|
+
/** The icon-font class rendered as the button's content. Only required when `children`
|
|
367
|
+
* isn't passed - if `children` is given, it's rendered instead and `name` goes unused. */
|
|
368
|
+
name?: string;
|
|
367
369
|
color?: IconColor;
|
|
368
370
|
hoverColor?: IconColor;
|
|
369
371
|
bgColor?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -363,7 +363,9 @@ declare function getIconColorProps(colorName: IconColor, hoverColorName?: IconCo
|
|
|
363
363
|
};
|
|
364
364
|
|
|
365
365
|
interface IconProps$1 extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "color">, VariantProps<typeof iconVariants> {
|
|
366
|
-
|
|
366
|
+
/** The icon-font class rendered as the button's content. Only required when `children`
|
|
367
|
+
* isn't passed - if `children` is given, it's rendered instead and `name` goes unused. */
|
|
368
|
+
name?: string;
|
|
367
369
|
color?: IconColor;
|
|
368
370
|
hoverColor?: IconColor;
|
|
369
371
|
bgColor?: string;
|
package/dist/index.js
CHANGED
|
@@ -2213,8 +2213,17 @@ var ScrollToFieldError = () => {
|
|
|
2213
2213
|
const errorKeys = Object.keys(errors);
|
|
2214
2214
|
if (errorKeys.length === 0) return;
|
|
2215
2215
|
const firstErrorKey = errorKeys[0];
|
|
2216
|
-
const
|
|
2217
|
-
if (!
|
|
2216
|
+
const rawEl = document.querySelector(`[name="${firstErrorKey}"]`) || document.getElementById(firstErrorKey);
|
|
2217
|
+
if (!rawEl) return;
|
|
2218
|
+
const isRenderedEl = (node) => node.offsetParent !== null || node === document.body;
|
|
2219
|
+
let el = rawEl;
|
|
2220
|
+
if (!isRenderedEl(rawEl)) {
|
|
2221
|
+
let ancestor = rawEl.parentElement;
|
|
2222
|
+
while (ancestor && !isRenderedEl(ancestor)) {
|
|
2223
|
+
ancestor = ancestor.parentElement;
|
|
2224
|
+
}
|
|
2225
|
+
if (ancestor) el = ancestor;
|
|
2226
|
+
}
|
|
2218
2227
|
const scrollable = el.closest(".edit-panel__body") || el.closest(".dept-modal__panel-backdrop") || el.closest(".dept-modal__backdrop") || el.closest("[class*='overflow-y-auto']");
|
|
2219
2228
|
if (scrollable && scrollable.id !== "scroll") {
|
|
2220
2229
|
const elRect = el.getBoundingClientRect();
|
|
@@ -2829,7 +2838,7 @@ import * as React27 from "react";
|
|
|
2829
2838
|
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2830
2839
|
var CARD_TEXT_LIMIT = 20;
|
|
2831
2840
|
var TruncatedText = ({ text, maxLength, className, viewMode = "grid" /* GRID */ }) => {
|
|
2832
|
-
maxLength = viewMode === "list" /* LIST */ ?
|
|
2841
|
+
maxLength = maxLength ? maxLength : viewMode === "list" /* LIST */ ? void 0 : CARD_TEXT_LIMIT;
|
|
2833
2842
|
if (maxLength === void 0) {
|
|
2834
2843
|
return /* @__PURE__ */ jsx27(TruncatedTextByWidth, { text, className });
|
|
2835
2844
|
}
|
|
@@ -2837,7 +2846,7 @@ var TruncatedText = ({ text, maxLength, className, viewMode = "grid" /* GRID */
|
|
|
2837
2846
|
return /* @__PURE__ */ jsx27("span", { className: cn("cursor-default", className), children: text || "" });
|
|
2838
2847
|
}
|
|
2839
2848
|
return /* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
2840
|
-
/* @__PURE__ */ jsx27(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs17("span", { children: [
|
|
2849
|
+
/* @__PURE__ */ jsx27(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs17("span", { className: cn("block w-full truncate", className), children: [
|
|
2841
2850
|
text.slice(0, maxLength),
|
|
2842
2851
|
"\u2026"
|
|
2843
2852
|
] }) }),
|
|
@@ -2869,7 +2878,7 @@ var TruncatedTextByWidth = ({ text, className }) => {
|
|
|
2869
2878
|
}
|
|
2870
2879
|
const textSpan = /* @__PURE__ */ jsx27("span", { ref, className: cn("block w-full truncate", className), children: text });
|
|
2871
2880
|
return /* @__PURE__ */ jsxs17(Tooltip, { children: [
|
|
2872
|
-
/* @__PURE__ */ jsx27(TooltipTrigger, { className: "min-w-0 w-full", children: textSpan }),
|
|
2881
|
+
/* @__PURE__ */ jsx27(TooltipTrigger, { asChild: true, className: "min-w-0 w-full", children: textSpan }),
|
|
2873
2882
|
isOverflowing && /* @__PURE__ */ jsx27(
|
|
2874
2883
|
TooltipContent,
|
|
2875
2884
|
{
|