@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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Norges domstoler
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -9,7 +9,7 @@ Sjekk ut [Elsa - domstolenes designsystem](https://design.domstol.no/) og [ Elsa
9
9
  ## 📦 Installasjon
10
10
 
11
11
  ```sh
12
- npm install @norges-domstoler/dds-components
12
+ pnpm add @norges-domstoler/dds-components
13
13
  ```
14
14
 
15
15
  ## 🔨 Bruk
package/dist/index.js CHANGED
@@ -2446,7 +2446,7 @@ var RadioButton = (0, import_react12.forwardRef)(
2446
2446
  disabled: disabled || (radioButtonGroup == null ? void 0 : radioButtonGroup.disabled),
2447
2447
  $readOnly: readOnly || (radioButtonGroup == null ? void 0 : radioButtonGroup.readOnly),
2448
2448
  style,
2449
- className: (0, import_dds_core16.joinClassNames)(className, htmlPropsClassName),
2449
+ className: (0, import_dds_core16.cn)(className, htmlPropsClassName),
2450
2450
  $hasLabel: hasLabel,
2451
2451
  htmlFor: uniqueId,
2452
2452
  $controlType: "radio",
@@ -2689,7 +2689,7 @@ var Checkbox = (0, import_react16.forwardRef)(
2689
2689
  htmlFor: uniqueId,
2690
2690
  $hasLabel: hasLabel,
2691
2691
  $controlType: "checkbox",
2692
- className: (0, import_dds_core19.joinClassNames)(className, htmlPropsClassName),
2692
+ className: (0, import_dds_core19.cn)(className, htmlPropsClassName),
2693
2693
  style,
2694
2694
  children: [
2695
2695
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
@@ -6821,7 +6821,7 @@ var SkipToContent = (0, import_react55.forwardRef)(
6821
6821
  Wrapper5,
6822
6822
  {
6823
6823
  $top: top,
6824
- className: (0, import_dds_core53.joinClassNames)(className, htmlPropsClassName),
6824
+ className: (0, import_dds_core53.cn)(className, htmlPropsClassName),
6825
6825
  style,
6826
6826
  children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Link3, { ...(0, import_dds_core53.getBaseHTMLProps)(id, restHtmlProps, rest), ref, children: text })
6827
6827
  }
@@ -7533,22 +7533,21 @@ var Popover = (0, import_react62.forwardRef)(
7533
7533
  htmlProps = {},
7534
7534
  ...rest
7535
7535
  } = props;
7536
+ const hasTransitionedIn = (0, import_dds_core64.useMountTransition)(isOpen, 400);
7537
+ const { refs, styles } = (0, import_dds_core64.useFloatPosition)(null, {
7538
+ placement,
7539
+ offset
7540
+ });
7541
+ refs.setReference(anchorElement || null);
7536
7542
  const popoverRef = (0, import_dds_core64.useReturnFocusOnBlur)(
7537
- isOpen,
7543
+ isOpen && hasTransitionedIn,
7538
7544
  () => {
7539
7545
  onClose && onClose();
7540
7546
  onBlur && onBlur();
7541
7547
  },
7542
7548
  anchorElement && anchorElement
7543
7549
  );
7544
- const { refs, styles } = (0, import_dds_core64.useFloatPosition)(null, {
7545
- placement,
7546
- offset
7547
- });
7548
7550
  const multiRef = (0, import_dds_core64.useCombinedRef)(ref, popoverRef, refs.setFloating);
7549
- (0, import_react62.useEffect)(() => {
7550
- anchorElement ? refs.setReference(anchorElement) : refs.setReference(null);
7551
- }, [anchorElement]);
7552
7551
  const elements = [popoverRef.current];
7553
7552
  if (anchorElement)
7554
7553
  elements.push(anchorElement);
@@ -7556,7 +7555,6 @@ var Popover = (0, import_react62.forwardRef)(
7556
7555
  if (isOpen)
7557
7556
  onClose && onClose();
7558
7557
  });
7559
- const hasTransitionedIn = (0, import_dds_core64.useMountTransition)(isOpen, 400);
7560
7558
  return isOpen || hasTransitionedIn ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
7561
7559
  Wrapper6,
7562
7560
  {