@norges-domstoler/dds-components 0.0.0-dev-20250603102801 → 0.0.0-dev-20250604071409

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.d.mts CHANGED
@@ -4014,16 +4014,9 @@ declare const Tooltip: {
4014
4014
  displayName: string;
4015
4015
  };
4016
4016
 
4017
- type VisuallyHiddenDivProps = BaseComponentPropsWithChildren<HTMLDivElement, {
4018
- as: 'div';
4019
- }>;
4020
- type VisuallyHiddenSpanProps = BaseComponentPropsWithChildren<HTMLSpanElement, {
4021
- /**Spesifiserer hvilken HTML tag skal returneres. */
4022
- as: 'span';
4023
- }>;
4024
- type VisuallyHiddenProps = VisuallyHiddenSpanProps | VisuallyHiddenDivProps;
4017
+ type VisuallyHiddenProps<T extends ElementType = 'span'> = PolymorphicBaseComponentProps<T>;
4025
4018
  declare const VisuallyHidden: {
4026
- (props: VisuallyHiddenProps): react_jsx_runtime.JSX.Element;
4019
+ <T extends ElementType = "span">({ id, as: asProp, className, htmlProps, ...rest }: VisuallyHiddenProps<T>): react_jsx_runtime.JSX.Element;
4027
4020
  displayName: string;
4028
4021
  };
4029
4022
 
package/dist/index.d.ts CHANGED
@@ -4014,16 +4014,9 @@ declare const Tooltip: {
4014
4014
  displayName: string;
4015
4015
  };
4016
4016
 
4017
- type VisuallyHiddenDivProps = BaseComponentPropsWithChildren<HTMLDivElement, {
4018
- as: 'div';
4019
- }>;
4020
- type VisuallyHiddenSpanProps = BaseComponentPropsWithChildren<HTMLSpanElement, {
4021
- /**Spesifiserer hvilken HTML tag skal returneres. */
4022
- as: 'span';
4023
- }>;
4024
- type VisuallyHiddenProps = VisuallyHiddenSpanProps | VisuallyHiddenDivProps;
4017
+ type VisuallyHiddenProps<T extends ElementType = 'span'> = PolymorphicBaseComponentProps<T>;
4025
4018
  declare const VisuallyHidden: {
4026
- (props: VisuallyHiddenProps): react_jsx_runtime.JSX.Element;
4019
+ <T extends ElementType = "span">({ id, as: asProp, className, htmlProps, ...rest }: VisuallyHiddenProps<T>): react_jsx_runtime.JSX.Element;
4027
4020
  displayName: string;
4028
4021
  };
4029
4022
 
package/dist/index.js CHANGED
@@ -5912,13 +5912,26 @@ CalendarCell.displayName = "CalendarCell";
5912
5912
 
5913
5913
  // src/components/VisuallyHidden/VisuallyHidden.tsx
5914
5914
  var import_jsx_runtime222 = require("react/jsx-runtime");
5915
- var VisuallyHidden = (props) => {
5916
- const { id, className, htmlProps, as, ...rest } = props;
5917
- const cl = cn(className, utilStyles_default["visually-hidden"]);
5918
- if (as === "div") {
5919
- return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { ...getBaseHTMLProps(id, cl, htmlProps, rest) });
5920
- }
5921
- return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { ...getBaseHTMLProps(id, cl, htmlProps, rest) });
5915
+ var VisuallyHidden = ({
5916
+ id,
5917
+ as: asProp,
5918
+ className,
5919
+ htmlProps,
5920
+ ...rest
5921
+ }) => {
5922
+ const as = asProp != null ? asProp : "span";
5923
+ return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
5924
+ ElementAs,
5925
+ {
5926
+ as,
5927
+ ...getBaseHTMLProps(
5928
+ id,
5929
+ cn(className, utilStyles_default["visually-hidden"]),
5930
+ htmlProps,
5931
+ rest
5932
+ )
5933
+ }
5934
+ );
5922
5935
  };
5923
5936
  VisuallyHidden.displayName = "VisuallyHidden";
5924
5937
 
@@ -6165,7 +6178,7 @@ function CalendarGrid({ state, ...props }) {
6165
6178
  className: cn(DateInput_default["calendar__grid-element"], ...typographyCn),
6166
6179
  children: [
6167
6180
  "# ",
6168
- /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(VisuallyHidden, { as: "span", children: "Ukenummer" })
6181
+ /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(VisuallyHidden, { children: "Ukenummer" })
6169
6182
  ]
6170
6183
  }
6171
6184
  ),
@@ -8221,7 +8234,7 @@ var FileUploader = (props) => {
8221
8234
  }
8222
8235
  ),
8223
8236
  dropAreaLabel,
8224
- /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(VisuallyHidden, { as: "span", children: "velg fil med p\xE5f\xF8lgende knapp" }),
8237
+ /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(VisuallyHidden, { children: "velg fil med p\xE5f\xF8lgende knapp" }),
8225
8238
  button
8226
8239
  ]
8227
8240
  }
@@ -8487,7 +8500,7 @@ var InlineEdit_default = {
8487
8500
 
8488
8501
  // src/components/InlineEdit/InlineEdit.utils.tsx
8489
8502
  var import_jsx_runtime267 = require("react/jsx-runtime");
8490
- var inlineEditVisuallyHidden = (id, emptiable) => /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(VisuallyHidden, { id, as: "span", children: [
8503
+ var inlineEditVisuallyHidden = (id, emptiable) => /* @__PURE__ */ (0, import_jsx_runtime267.jsxs)(VisuallyHidden, { id, children: [
8491
8504
  "Escape, Enter eller Tab for \xE5 lagre.",
8492
8505
  " ",
8493
8506
  !emptiable && "Inputfeltet er ikke t\xF8mmbar."
@@ -11076,9 +11089,9 @@ var ProgressTrackerItem = (props) => {
11076
11089
  typographyStyles_default["body-medium"]
11077
11090
  ),
11078
11091
  children: [
11079
- /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(VisuallyHidden, { as: "span", children: getVisuallyHiddenTextBefore(index) }),
11092
+ /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(VisuallyHidden, { children: getVisuallyHiddenTextBefore(index) }),
11080
11093
  children,
11081
- /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(VisuallyHidden, { as: "span", children: getVisuallyHiddenTextAfter(completed) })
11094
+ /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(VisuallyHidden, { children: getVisuallyHiddenTextAfter(completed) })
11082
11095
  ]
11083
11096
  }
11084
11097
  )
@@ -11580,7 +11593,7 @@ var Search = ({
11580
11593
  componentSize
11581
11594
  }
11582
11595
  ),
11583
- /* @__PURE__ */ (0, import_jsx_runtime292.jsx)(VisuallyHidden, { id: suggestionsDescriptionId, as: "span", children: "Bla i s\xF8keforslag med piltaster n\xE5r listen er utvidet." })
11596
+ /* @__PURE__ */ (0, import_jsx_runtime292.jsx)(VisuallyHidden, { id: suggestionsDescriptionId, children: "Bla i s\xF8keforslag med piltaster n\xE5r listen er utvidet." })
11584
11597
  ] }),
11585
11598
  hasValue && /* @__PURE__ */ (0, import_jsx_runtime292.jsx)(
11586
11599
  Button,
@@ -12135,7 +12148,7 @@ var CollapsibleRow = ({
12135
12148
  definingColumnCells,
12136
12149
  /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(Table2.Cell, { type: "head", layout: "center", children: [
12137
12150
  "Utvid",
12138
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(VisuallyHidden, { as: "span", children: "raden" })
12151
+ /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(VisuallyHidden, { children: "raden" })
12139
12152
  ] })
12140
12153
  ] }) });
12141
12154
  };
@@ -12989,7 +13002,7 @@ var Toggle = ({
12989
13002
  ),
12990
13003
  children,
12991
13004
  " ",
12992
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(VisuallyHidden, { as: "span", children: "Innlastning p\xE5g\xE5r" })
13005
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(VisuallyHidden, { children: "Innlastning p\xE5g\xE5r" })
12993
13006
  ] })
12994
13007
  ]
12995
13008
  }