@norges-domstoler/dds-components 13.8.8 → 13.9.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
@@ -905,6 +905,7 @@ var Button = forwardRef2(
905
905
  (props, ref) => {
906
906
  const {
907
907
  label: label3,
908
+ children,
908
909
  purpose = "primary",
909
910
  size = "medium",
910
911
  iconPosition = "left",
@@ -924,12 +925,11 @@ var Button = forwardRef2(
924
925
  ...rest
925
926
  } = props;
926
927
  const as = href ? "a" : "button";
927
- const hasLabel = !!label3;
928
+ const hasLabel = !!children || !!label3;
928
929
  const hasIcon = !!icon12;
929
930
  const wrapperProps = {
930
931
  ...getBaseHTMLProps3(id, className, htmlProps, rest),
931
932
  href,
932
- label: label3,
933
933
  as,
934
934
  rel: href ? "noreferrer noopener" : void 0,
935
935
  target: href && target ? target : void 0,
@@ -963,7 +963,7 @@ var Button = forwardRef2(
963
963
  return /* @__PURE__ */ jsxs3(ButtonWrapper, { ...wrapperProps, "aria-disabled": loading, children: [
964
964
  !isIconButton && /* @__PURE__ */ jsxs3(Fragment, { children: [
965
965
  iconPosition === "left" && iconElement,
966
- /* @__PURE__ */ jsx6(Label, { isHidden: loading, "aria-hidden": loading, children: label3 }),
966
+ /* @__PURE__ */ jsx6(Label, { isHidden: loading, "aria-hidden": loading, children: children != null ? children : label3 }),
967
967
  iconPosition === "right" && iconElement
968
968
  ] }),
969
969
  isIconButton && iconElement,
@@ -4476,9 +4476,9 @@ var Search = forwardRef13(
4476
4476
  Button,
4477
4477
  {
4478
4478
  size: componentSize,
4479
- label: buttonLabel || "S\xF8k",
4480
4479
  onClick,
4481
- ...otherButtonProps
4480
+ ...otherButtonProps,
4481
+ children: buttonLabel || "S\xF8k"
4482
4482
  }
4483
4483
  )
4484
4484
  ]
@@ -5625,14 +5625,14 @@ var Pagination = forwardRef29(
5625
5625
  return /* @__PURE__ */ jsx45(ListItem2, { children: item !== "truncator" ? /* @__PURE__ */ jsx45(
5626
5626
  Button,
5627
5627
  {
5628
- label: item.toString(),
5629
5628
  purpose: isActive ? "primary" : "secondary",
5630
5629
  appearance: isActive ? "filled" : "ghost",
5631
5630
  size: "small",
5632
5631
  onClick: (event) => {
5633
5632
  onPageChange(event, item);
5634
5633
  },
5635
- "aria-label": isActive ? `N\xE5v\xE6rende side (side ${item})` : `G\xE5 til side ${item}`
5634
+ "aria-label": isActive ? `N\xE5v\xE6rende side (side ${item})` : `G\xE5 til side ${item}`,
5635
+ children: item
5636
5636
  }
5637
5637
  ) : /* @__PURE__ */ jsx45(
5638
5638
  Icon14,
@@ -5700,11 +5700,11 @@ var Pagination = forwardRef29(
5700
5700
  /* @__PURE__ */ jsx45(ListItem2, { children: /* @__PURE__ */ jsx45(
5701
5701
  Button,
5702
5702
  {
5703
- label: activePage.toString(),
5704
5703
  size: "small",
5705
5704
  onClick: (event) => {
5706
5705
  onPageChange(event, activePage);
5707
- }
5706
+ },
5707
+ children: activePage
5708
5708
  }
5709
5709
  ) }),
5710
5710
  /* @__PURE__ */ jsx45(ListItem2, { isHidden: isOnLastPage, "aria-hidden": isOnLastPage, children: nextPageButton }),
@@ -10504,7 +10504,6 @@ var FileUploader = (props) => {
10504
10504
  type: "button",
10505
10505
  appearance: "filled",
10506
10506
  purpose: "secondary",
10507
- label: "Velg fil",
10508
10507
  icon: UploadIcon,
10509
10508
  htmlProps: {
10510
10509
  "aria-invalid": hasRootErrors ? true : void 0,
@@ -10512,7 +10511,8 @@ var FileUploader = (props) => {
10512
10511
  hasTip ? tipId : void 0,
10513
10512
  ...rootErrorsList.map((e) => e.id)
10514
10513
  ])
10515
- }
10514
+ },
10515
+ children: "Velg fil"
10516
10516
  }
10517
10517
  )
10518
10518
  ]
@@ -10714,11 +10714,11 @@ var CommentComponent = ({
10714
10714
  /* @__PURE__ */ jsx94(
10715
10715
  Button,
10716
10716
  {
10717
- label: "Send inn",
10718
10717
  purpose: "secondary",
10719
10718
  size: "small",
10720
10719
  onClick: handleSubmit,
10721
- loading
10720
+ loading,
10721
+ children: "Send inn"
10722
10722
  }
10723
10723
  )
10724
10724
  ] });