@vectramindnpm/unified-design-system 0.2.0 → 0.2.1

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.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
- name: string;
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
- name: string;
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 el = document.querySelector(`[name="${firstErrorKey}"]`) || document.getElementById(firstErrorKey);
2217
- if (!el) return;
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();