@norges-domstoler/dds-components 0.0.0-dev-20260817084205 → 0.0.0-dev-20260817090134
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.cjs +34 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +14 -8
- package/dist/index.d.cts +18 -12
- package/dist/index.d.mts +18 -12
- package/dist/index.mjs +33 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
26
26
|
}
|
|
27
27
|
return to;
|
|
28
28
|
};
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
30
30
|
value: mod,
|
|
31
31
|
enumerable: true
|
|
32
32
|
}) : target, mod));
|
|
@@ -352,14 +352,15 @@ const defaultOffset = 8;
|
|
|
352
352
|
*/
|
|
353
353
|
const useFloatPosition = (arrowRef, options = {}) => {
|
|
354
354
|
const { animationFrame = true, offset = defaultOffset, placement = "bottom" } = options;
|
|
355
|
+
const middleware = [
|
|
356
|
+
(0, _floating_ui_react_dom.offset)(offset),
|
|
357
|
+
(0, _floating_ui_react_dom.flip)(),
|
|
358
|
+
(0, _floating_ui_react_dom.shift)(),
|
|
359
|
+
...arrowRef ? [(0, _floating_ui_react_dom.arrow)({ element: arrowRef })] : []
|
|
360
|
+
];
|
|
355
361
|
const { x, y, strategy, middlewareData, placement: actualPlacement, refs, isPositioned } = (0, _floating_ui_react_dom.useFloating)({
|
|
356
362
|
placement,
|
|
357
|
-
middleware
|
|
358
|
-
(0, _floating_ui_react_dom.offset)(offset),
|
|
359
|
-
(0, _floating_ui_react_dom.flip)(),
|
|
360
|
-
(0, _floating_ui_react_dom.shift)(),
|
|
361
|
-
...arrowRef ? [(0, _floating_ui_react_dom.arrow)({ element: arrowRef })] : []
|
|
362
|
-
],
|
|
363
|
+
middleware,
|
|
363
364
|
whileElementsMounted: (reference, floating, update) => (0, _floating_ui_react_dom.autoUpdate)(reference, floating, update, { animationFrame })
|
|
364
365
|
});
|
|
365
366
|
return {
|
|
@@ -1875,13 +1876,14 @@ const DropdownItem = ({ icon, className, children: propChildren, purpose = "defa
|
|
|
1875
1876
|
className: cn(loading && utilStyles_module_default.invisible),
|
|
1876
1877
|
children: propChildren
|
|
1877
1878
|
}) : propChildren;
|
|
1879
|
+
const cns = rest.as === "span" ? itemCns : interactiveItemCns;
|
|
1878
1880
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Box, {
|
|
1879
1881
|
display: "flex",
|
|
1880
1882
|
alignItems: "center",
|
|
1881
1883
|
padding: "x0.75",
|
|
1882
1884
|
gap: "x0.25",
|
|
1883
1885
|
width: "100%",
|
|
1884
|
-
className: cn(className, ...
|
|
1886
|
+
className: cn(className, ...cns, loading && DropdownItem_module_default["item--loading"]),
|
|
1885
1887
|
"aria-disabled": loading ? true : void 0,
|
|
1886
1888
|
...rest,
|
|
1887
1889
|
children: [
|
|
@@ -4874,11 +4876,13 @@ const Breadcrumbs = ({ children, smallScreenBreakpoint, id, className, style, ht
|
|
|
4874
4876
|
}, `breadcrumb-${index}`);
|
|
4875
4877
|
});
|
|
4876
4878
|
const bChildrenTruncated = childrenArray.length > 2 ? childrenArray.slice(1, childrenArray.length - 1).map((item, index) => {
|
|
4877
|
-
if ((0, react.isValidElement)(item))
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4879
|
+
if ((0, react.isValidElement)(item)) {
|
|
4880
|
+
if (isAnchorTypographyProps(item.props)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OverflowMenuLink, {
|
|
4881
|
+
href: item.props.href,
|
|
4882
|
+
children: item.props.children
|
|
4883
|
+
}, index);
|
|
4884
|
+
else return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OverflowMenuSpan, { children: item.props.children }, index);
|
|
4885
|
+
}
|
|
4882
4886
|
}) : [];
|
|
4883
4887
|
const bChildrenSmallScreen = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
4884
4888
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HStack, {
|
|
@@ -7095,8 +7099,9 @@ function CharCounter(props) {
|
|
|
7095
7099
|
const { t } = useTranslation();
|
|
7096
7100
|
const { current, max, id } = props;
|
|
7097
7101
|
const generatedId = (0, react.useId)();
|
|
7102
|
+
const uniqueId = id ?? `${generatedId}-characterCounter`;
|
|
7098
7103
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Typography, {
|
|
7099
|
-
id:
|
|
7104
|
+
id: uniqueId,
|
|
7100
7105
|
className: CharCounter_module_default.container,
|
|
7101
7106
|
as: "div",
|
|
7102
7107
|
typographyType: "body-short-xsmall",
|
|
@@ -7557,13 +7562,11 @@ const File$1 = (props) => {
|
|
|
7557
7562
|
});
|
|
7558
7563
|
break;
|
|
7559
7564
|
case "invalid":
|
|
7560
|
-
case "error":
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
});
|
|
7566
|
-
break;
|
|
7565
|
+
case "error": statusIndicator = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
7566
|
+
icon: ErrorIcon,
|
|
7567
|
+
iconSize: "component",
|
|
7568
|
+
className: FileUploader_module_default[`file__icon--invalid`]
|
|
7569
|
+
});
|
|
7567
7570
|
}
|
|
7568
7571
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Paper, {
|
|
7569
7572
|
marginBlock: "x0.5 0",
|
|
@@ -11991,12 +11994,14 @@ const SearchAutocompleteWrapper = (props) => {
|
|
|
11991
11994
|
handleSetInputValue(query);
|
|
11992
11995
|
let finalSuggestions = [];
|
|
11993
11996
|
if (query.length >= queryLength) {
|
|
11994
|
-
if (data)
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
11997
|
+
if (data) {
|
|
11998
|
+
if (isWeightedValueData(data)) {
|
|
11999
|
+
const { sortFunction, array } = data;
|
|
12000
|
+
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);
|
|
12001
|
+
} else {
|
|
12002
|
+
const { sortFunction, array } = data;
|
|
12003
|
+
finalSuggestions = array.filter((suggestion) => filter ? filter(suggestion, query) : searchFilter(suggestion, query)).sort(sortFunction ? (a, b) => sortFunction(a, b) : void 0);
|
|
12004
|
+
}
|
|
12000
12005
|
}
|
|
12001
12006
|
setSuggestions(finalSuggestions);
|
|
12002
12007
|
} else setSuggestions([]);
|
|
@@ -12236,7 +12241,8 @@ const Row = ({ type: _type, className, mode = "normal", children, ref, ...rest }
|
|
|
12236
12241
|
})] })
|
|
12237
12242
|
})] });
|
|
12238
12243
|
const descriptionListItems = collapseCells.map((child, index) => {
|
|
12239
|
-
|
|
12244
|
+
const label = labelsStore.get(child.props.collapseKey ?? "");
|
|
12245
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DescriptionListTerm, { children: label }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollapsibleCellContext, {
|
|
12240
12246
|
value: true,
|
|
12241
12247
|
children: child
|
|
12242
12248
|
})] }, `DL-${index}`);
|