@norges-domstoler/dds-components 0.0.0-dev-20260817084326 → 0.0.0-dev-20260817100430

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
@@ -319,14 +319,15 @@ const defaultOffset = 8;
319
319
  */
320
320
  const useFloatPosition = (arrowRef, options = {}) => {
321
321
  const { animationFrame = true, offset: offset$1 = defaultOffset, placement = "bottom" } = options;
322
+ const middleware = [
323
+ offset(offset$1),
324
+ flip(),
325
+ shift(),
326
+ ...arrowRef ? [arrow({ element: arrowRef })] : []
327
+ ];
322
328
  const { x, y, strategy, middlewareData, placement: actualPlacement, refs, isPositioned } = useFloating({
323
329
  placement,
324
- middleware: [
325
- offset(offset$1),
326
- flip(),
327
- shift(),
328
- ...arrowRef ? [arrow({ element: arrowRef })] : []
329
- ],
330
+ middleware,
330
331
  whileElementsMounted: (reference, floating, update) => autoUpdate(reference, floating, update, { animationFrame })
331
332
  });
332
333
  return {
@@ -1842,13 +1843,14 @@ const DropdownItem = ({ icon, className, children: propChildren, purpose = "defa
1842
1843
  className: cn(loading && utilStyles_module_default.invisible),
1843
1844
  children: propChildren
1844
1845
  }) : propChildren;
1846
+ const cns = rest.as === "span" ? itemCns : interactiveItemCns;
1845
1847
  return /* @__PURE__ */ jsxs(Box, {
1846
1848
  display: "flex",
1847
1849
  alignItems: "center",
1848
1850
  padding: "x0.75",
1849
1851
  gap: "x0.25",
1850
1852
  width: "100%",
1851
- className: cn(className, ...rest.as === "span" ? itemCns : interactiveItemCns, loading && DropdownItem_module_default["item--loading"]),
1853
+ className: cn(className, ...cns, loading && DropdownItem_module_default["item--loading"]),
1852
1854
  "aria-disabled": loading ? true : void 0,
1853
1855
  ...rest,
1854
1856
  children: [
@@ -4841,11 +4843,13 @@ const Breadcrumbs = ({ children, smallScreenBreakpoint, id, className, style, ht
4841
4843
  }, `breadcrumb-${index}`);
4842
4844
  });
4843
4845
  const bChildrenTruncated = childrenArray.length > 2 ? childrenArray.slice(1, childrenArray.length - 1).map((item, index) => {
4844
- if (isValidElement(item)) if (isAnchorTypographyProps(item.props)) return /* @__PURE__ */ jsx(OverflowMenuLink, {
4845
- href: item.props.href,
4846
- children: item.props.children
4847
- }, index);
4848
- else return /* @__PURE__ */ jsx(OverflowMenuSpan, { children: item.props.children }, index);
4846
+ if (isValidElement(item)) {
4847
+ if (isAnchorTypographyProps(item.props)) return /* @__PURE__ */ jsx(OverflowMenuLink, {
4848
+ href: item.props.href,
4849
+ children: item.props.children
4850
+ }, index);
4851
+ else return /* @__PURE__ */ jsx(OverflowMenuSpan, { children: item.props.children }, index);
4852
+ }
4849
4853
  }) : [];
4850
4854
  const bChildrenSmallScreen = /* @__PURE__ */ jsxs(Fragment$1, { children: [
4851
4855
  /* @__PURE__ */ jsx(HStack, {
@@ -7062,8 +7066,9 @@ function CharCounter(props) {
7062
7066
  const { t } = useTranslation();
7063
7067
  const { current, max, id } = props;
7064
7068
  const generatedId = useId();
7069
+ const uniqueId = id ?? `${generatedId}-characterCounter`;
7065
7070
  return /* @__PURE__ */ jsxs(Typography, {
7066
- id: id ?? `${generatedId}-characterCounter`,
7071
+ id: uniqueId,
7067
7072
  className: CharCounter_module_default.container,
7068
7073
  as: "div",
7069
7074
  typographyType: "body-short-xsmall",
@@ -7524,13 +7529,11 @@ const File$1 = (props) => {
7524
7529
  });
7525
7530
  break;
7526
7531
  case "invalid":
7527
- case "error":
7528
- statusIndicator = /* @__PURE__ */ jsx(Icon, {
7529
- icon: ErrorIcon,
7530
- iconSize: "component",
7531
- className: FileUploader_module_default[`file__icon--invalid`]
7532
- });
7533
- break;
7532
+ case "error": statusIndicator = /* @__PURE__ */ jsx(Icon, {
7533
+ icon: ErrorIcon,
7534
+ iconSize: "component",
7535
+ className: FileUploader_module_default[`file__icon--invalid`]
7536
+ });
7534
7537
  }
7535
7538
  return /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsxs(Paper, {
7536
7539
  marginBlock: "x0.5 0",
@@ -11958,12 +11961,14 @@ const SearchAutocompleteWrapper = (props) => {
11958
11961
  handleSetInputValue(query);
11959
11962
  let finalSuggestions = [];
11960
11963
  if (query.length >= queryLength) {
11961
- if (data) if (isWeightedValueData(data)) {
11962
- const { sortFunction, array } = data;
11963
- finalSuggestions = array.filter((suggestion) => filter ? filter(suggestion.text, query) : searchFilter(suggestion.text, query)).sort(sortFunction ? (a, b) => sortFunction(a, b) : void 0).map((item) => item.text);
11964
- } else {
11965
- const { sortFunction, array } = data;
11966
- finalSuggestions = array.filter((suggestion) => filter ? filter(suggestion, query) : searchFilter(suggestion, query)).sort(sortFunction ? (a, b) => sortFunction(a, b) : void 0);
11964
+ if (data) {
11965
+ if (isWeightedValueData(data)) {
11966
+ const { sortFunction, array } = data;
11967
+ finalSuggestions = array.filter((suggestion) => filter ? filter(suggestion.text, query) : searchFilter(suggestion.text, query)).sort(sortFunction ? (a, b) => sortFunction(a, b) : void 0).map((item) => item.text);
11968
+ } else {
11969
+ const { sortFunction, array } = data;
11970
+ finalSuggestions = array.filter((suggestion) => filter ? filter(suggestion, query) : searchFilter(suggestion, query)).sort(sortFunction ? (a, b) => sortFunction(a, b) : void 0);
11971
+ }
11967
11972
  }
11968
11973
  setSuggestions(finalSuggestions);
11969
11974
  } else setSuggestions([]);
@@ -12203,7 +12208,8 @@ const Row = ({ type: _type, className, mode = "normal", children, ref, ...rest }
12203
12208
  })] })
12204
12209
  })] });
12205
12210
  const descriptionListItems = collapseCells.map((child, index) => {
12206
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DescriptionListTerm, { children: labelsStore.get(child.props.collapseKey ?? "") }), /* @__PURE__ */ jsx(CollapsibleCellContext, {
12211
+ const label = labelsStore.get(child.props.collapseKey ?? "");
12212
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DescriptionListTerm, { children: label }), /* @__PURE__ */ jsx(CollapsibleCellContext, {
12207
12213
  value: true,
12208
12214
  children: child
12209
12215
  })] }, `DL-${index}`);