@norges-domstoler/dds-components 20.0.0 → 20.1.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
@@ -11443,7 +11443,7 @@ var Tab = ({
11443
11443
  onKeyDown,
11444
11444
  id,
11445
11445
  className,
11446
- htmlProps,
11446
+ htmlProps = {},
11447
11447
  width = "1fr",
11448
11448
  ref,
11449
11449
  ...rest
@@ -11452,6 +11452,8 @@ var Tab = ({
11452
11452
  const itemRef = useRef36(null);
11453
11453
  const combinedRef = useCombinedRef(ref, itemRef);
11454
11454
  const { tabContentDirection, size: size2 } = useTabsContext();
11455
+ const { type = "button", ...restHtmlProps } = htmlProps;
11456
+ const fixedHtmlProps = { type, ...restHtmlProps };
11455
11457
  useEffect32(() => {
11456
11458
  var _a;
11457
11459
  if (focus) {
@@ -11465,11 +11467,11 @@ var Tab = ({
11465
11467
  }, [index, setFocus]);
11466
11468
  const handleOnClick = (e) => {
11467
11469
  handleSelect();
11468
- onClick && onClick(e);
11470
+ onClick == null ? void 0 : onClick(e);
11469
11471
  };
11470
11472
  const handleOnKeyDown = (e) => {
11471
11473
  handleSelect();
11472
- onKeyDown && onKeyDown(e);
11474
+ onKeyDown == null ? void 0 : onKeyDown(e);
11473
11475
  };
11474
11476
  return /* @__PURE__ */ jsxs77(
11475
11477
  "button",
@@ -11485,7 +11487,7 @@ var Tab = ({
11485
11487
  typographyStyles_default[`body-${size2}`],
11486
11488
  focus_default["focusable--inset"]
11487
11489
  ),
11488
- htmlProps,
11490
+ fixedHtmlProps,
11489
11491
  rest
11490
11492
  ),
11491
11493
  ref: combinedRef,
@@ -11540,6 +11542,7 @@ var TabList = ({
11540
11542
  return isValidElement7(child) && cloneElement7(child, {
11541
11543
  id: `${tabsId}-tab-${index}`,
11542
11544
  htmlProps: {
11545
+ ...child.props.htmlProps,
11543
11546
  "aria-controls": `${tabsId}-panel-${index}`
11544
11547
  },
11545
11548
  active: activeTab === index,