@norges-domstoler/dds-components 13.10.2 → 13.10.4

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.mjs CHANGED
@@ -2043,10 +2043,7 @@ AppShell2.NavItem = NavigationItem;
2043
2043
 
2044
2044
  // src/components/SelectionControl/RadioButton/RadioButton.tsx
2045
2045
  import { forwardRef as forwardRef5, useId as useId4 } from "react";
2046
- import {
2047
- getBaseHTMLProps as getBaseHTMLProps8,
2048
- joinClassNames
2049
- } from "@norges-domstoler/dds-core";
2046
+ import { getBaseHTMLProps as getBaseHTMLProps8, cn } from "@norges-domstoler/dds-core";
2050
2047
  import { Typography } from "@norges-domstoler/dds-typography";
2051
2048
  import { HiddenInput } from "@norges-domstoler/dds-form";
2052
2049
 
@@ -2399,7 +2396,7 @@ var RadioButton = forwardRef5(
2399
2396
  disabled: disabled || (radioButtonGroup == null ? void 0 : radioButtonGroup.disabled),
2400
2397
  $readOnly: readOnly || (radioButtonGroup == null ? void 0 : radioButtonGroup.readOnly),
2401
2398
  style,
2402
- className: joinClassNames(className, htmlPropsClassName),
2399
+ className: cn(className, htmlPropsClassName),
2403
2400
  $hasLabel: hasLabel,
2404
2401
  htmlFor: uniqueId,
2405
2402
  $controlType: "radio",
@@ -2609,7 +2606,7 @@ RadioButtonGroup2.displayName = "RadioButtonGroup";
2609
2606
  import { forwardRef as forwardRef8, useId as useId6 } from "react";
2610
2607
  import {
2611
2608
  getBaseHTMLProps as getBaseHTMLProps11,
2612
- joinClassNames as joinClassNames2,
2609
+ cn as cn2,
2613
2610
  spaceSeparatedIdListGenerator
2614
2611
  } from "@norges-domstoler/dds-core";
2615
2612
  import { Typography as Typography4 } from "@norges-domstoler/dds-typography";
@@ -2656,7 +2653,7 @@ var Checkbox = forwardRef8(
2656
2653
  htmlFor: uniqueId,
2657
2654
  $hasLabel: hasLabel,
2658
2655
  $controlType: "checkbox",
2659
- className: joinClassNames2(className, htmlPropsClassName),
2656
+ className: cn2(className, htmlPropsClassName),
2660
2657
  style,
2661
2658
  children: [
2662
2659
  /* @__PURE__ */ jsx19(
@@ -6889,7 +6886,7 @@ import { forwardRef as forwardRef38 } from "react";
6889
6886
  import styled50 from "styled-components";
6890
6887
  import {
6891
6888
  getBaseHTMLProps as getBaseHTMLProps29,
6892
- joinClassNames as joinClassNames3
6889
+ cn as cn3
6893
6890
  } from "@norges-domstoler/dds-core";
6894
6891
  import {
6895
6892
  getFontStyling as getFontStyling15,
@@ -6984,7 +6981,7 @@ var SkipToContent = forwardRef38(
6984
6981
  Wrapper5,
6985
6982
  {
6986
6983
  $top: top,
6987
- className: joinClassNames3(className, htmlPropsClassName),
6984
+ className: cn3(className, htmlPropsClassName),
6988
6985
  style,
6989
6986
  children: /* @__PURE__ */ jsx56(Link3, { ...getBaseHTMLProps29(id, restHtmlProps, rest), ref, children: text })
6990
6987
  }
@@ -7650,7 +7647,7 @@ DrawerGroup.displayName = "DrawerGroup";
7650
7647
 
7651
7648
  // src/components/Popover/Popover.tsx
7652
7649
  import { ddsBaseTokens as ddsBaseTokens30 } from "@norges-domstoler/dds-design-tokens";
7653
- import { forwardRef as forwardRef44, useEffect as useEffect13 } from "react";
7650
+ import { forwardRef as forwardRef44 } from "react";
7654
7651
  import styled57, { css as css27 } from "styled-components";
7655
7652
  import { visibilityTransition as visibilityTransition4 } from "@norges-domstoler/dds-core";
7656
7653
  import {
@@ -7748,22 +7745,21 @@ var Popover = forwardRef44(
7748
7745
  htmlProps = {},
7749
7746
  ...rest
7750
7747
  } = props;
7748
+ const hasTransitionedIn = useMountTransition3(isOpen, 400);
7749
+ const { refs, styles } = useFloatPosition3(null, {
7750
+ placement,
7751
+ offset
7752
+ });
7753
+ refs.setReference(anchorElement || null);
7751
7754
  const popoverRef = useReturnFocusOnBlur(
7752
- isOpen,
7755
+ isOpen && hasTransitionedIn,
7753
7756
  () => {
7754
7757
  onClose && onClose();
7755
7758
  onBlur && onBlur();
7756
7759
  },
7757
7760
  anchorElement && anchorElement
7758
7761
  );
7759
- const { refs, styles } = useFloatPosition3(null, {
7760
- placement,
7761
- offset
7762
- });
7763
7762
  const multiRef = useCombinedRef7(ref, popoverRef, refs.setFloating);
7764
- useEffect13(() => {
7765
- anchorElement ? refs.setReference(anchorElement) : refs.setReference(null);
7766
- }, [anchorElement]);
7767
7763
  const elements = [popoverRef.current];
7768
7764
  if (anchorElement)
7769
7765
  elements.push(anchorElement);
@@ -7771,7 +7767,6 @@ var Popover = forwardRef44(
7771
7767
  if (isOpen)
7772
7768
  onClose && onClose();
7773
7769
  });
7774
- const hasTransitionedIn = useMountTransition3(isOpen, 400);
7775
7770
  return isOpen || hasTransitionedIn ? /* @__PURE__ */ jsxs36(
7776
7771
  Wrapper6,
7777
7772
  {