@norges-domstoler/dds-components 22.7.2 → 22.8.0

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
@@ -1837,21 +1837,7 @@ var focusVisibleInset = {
1837
1837
  var scrollbarWidth = "thin";
1838
1838
  var scrollbarStyling = {
1839
1839
  scrollbarColor: "var(--dds-color-surface-scrollbar) transparent",
1840
- scrollbarWidth,
1841
- /* Safari styling. TODO: fjernes når scrollbar styling blir standardisert */
1842
- /* width */
1843
- "&::-webkit-scrollbar": {
1844
- width: "var(--dds-spacing-x0-5)",
1845
- height: "var(--dds-spacing-x0-5)"
1846
- },
1847
- /* Track */
1848
- "&::-webkit-scrollbar-track": {
1849
- background: "transparent"
1850
- },
1851
- /* Handle */
1852
- "&::-webkit-scrollbar-thumb": {
1853
- background: "var(--dds-color-surface-scrollbar)"
1854
- }
1840
+ scrollbarWidth
1855
1841
  };
1856
1842
  var hideInput = {
1857
1843
  clip: "rect(0 0 0 0)",
@@ -3709,6 +3695,17 @@ var Typography_default = {
3709
3695
  container: "Typography_container"
3710
3696
  };
3711
3697
 
3698
+ // src/components/Typography/Typography/Typography.types.ts
3699
+ var TG_HEADING_TYPES = [
3700
+ "headingXxsmall",
3701
+ "headingXsmall",
3702
+ "headingSmall",
3703
+ "headingMedium",
3704
+ "headingLarge",
3705
+ "headingXlarge",
3706
+ "headingXxlarge"
3707
+ ];
3708
+
3712
3709
  // src/components/Typography/Typography/Typography.utils.ts
3713
3710
  var getElementType = (element) => {
3714
3711
  switch (element) {
@@ -3743,7 +3740,7 @@ var getElementType = (element) => {
3743
3740
  }
3744
3741
  };
3745
3742
  var isHeading = (type) => {
3746
- return true;
3743
+ return TG_HEADING_TYPES.includes(type);
3747
3744
  };
3748
3745
  var isLegend = (as) => {
3749
3746
  return as === "legend";
@@ -4533,6 +4530,7 @@ import { jsx as jsx211 } from "react/jsx-runtime";
4533
4530
  var OverflowMenuButton = ({
4534
4531
  onClick,
4535
4532
  onClickAsync,
4533
+ closeMenuOnClickAsync = true,
4536
4534
  purpose = "default",
4537
4535
  loading,
4538
4536
  ref,
@@ -4549,17 +4547,21 @@ var OverflowMenuButton = ({
4549
4547
  }, []);
4550
4548
  const handleClick = async (e) => {
4551
4549
  if (isLoading) return;
4550
+ const close = () => onClose == null ? void 0 : onClose();
4552
4551
  if (onClickAsync) {
4553
4552
  setInternalLoading(true);
4553
+ const shouldAutoClose = closeMenuOnClickAsync === true;
4554
4554
  try {
4555
4555
  await onClickAsync(e);
4556
+ if (typeof closeMenuOnClickAsync === "function") {
4557
+ closeMenuOnClickAsync(close);
4558
+ } else if (shouldAutoClose) close();
4556
4559
  } finally {
4557
4560
  setInternalLoading(false);
4558
- onClose == null ? void 0 : onClose();
4559
4561
  }
4560
4562
  } else {
4561
4563
  onClick == null ? void 0 : onClick(e);
4562
- onClose == null ? void 0 : onClose();
4564
+ close();
4563
4565
  }
4564
4566
  };
4565
4567
  return /* @__PURE__ */ jsx211("li", { children: /* @__PURE__ */ jsx211(
@@ -15333,6 +15335,7 @@ export {
15333
15335
  SunIcon,
15334
15336
  SupportIcon,
15335
15337
  SyncIcon,
15338
+ TG_HEADING_TYPES,
15336
15339
  Tab,
15337
15340
  TabList,
15338
15341
  TabPanel,