@norges-domstoler/dds-components 15.2.0 → 15.3.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.d.mts +25 -7
- package/dist/index.d.ts +25 -7
- package/dist/index.js +400 -401
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +460 -462
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -1130,14 +1130,14 @@ function Icon(props) {
|
|
|
1130
1130
|
id,
|
|
1131
1131
|
iconSize = "medium",
|
|
1132
1132
|
color = "currentcolor",
|
|
1133
|
-
icon:
|
|
1133
|
+
icon: icon11,
|
|
1134
1134
|
className,
|
|
1135
1135
|
htmlProps = {},
|
|
1136
1136
|
...rest
|
|
1137
1137
|
} = props;
|
|
1138
1138
|
const { title: title3, "aria-hidden": ariaHidden = true } = htmlProps;
|
|
1139
1139
|
const size2 = getSize(iconSize);
|
|
1140
|
-
return
|
|
1140
|
+
return icon11({
|
|
1141
1141
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
1142
1142
|
title: title3,
|
|
1143
1143
|
height: size2,
|
|
@@ -2755,7 +2755,7 @@ import {
|
|
|
2755
2755
|
useState as useState2
|
|
2756
2756
|
} from "react";
|
|
2757
2757
|
var isKeyboardEvent = (e) => e.key !== void 0;
|
|
2758
|
-
function useRoveFocus(size2,
|
|
2758
|
+
function useRoveFocus(size2, active, direction = "column") {
|
|
2759
2759
|
const [currentFocusIndex, setCurrentFocusIndex] = useState2(-1);
|
|
2760
2760
|
const nextKey = direction === "row" ? "ArrowRight" : "ArrowDown";
|
|
2761
2761
|
const previousKey = direction === "row" ? "ArrowLeft" : "ArrowUp";
|
|
@@ -2763,31 +2763,30 @@ function useRoveFocus(size2, reset, direction = "column") {
|
|
|
2763
2763
|
(e) => {
|
|
2764
2764
|
if (!size2 || !isKeyboardEvent(e))
|
|
2765
2765
|
return;
|
|
2766
|
-
if (reset)
|
|
2767
|
-
setCurrentFocusIndex(-1);
|
|
2768
2766
|
if (e.key === nextKey) {
|
|
2769
2767
|
e.preventDefault();
|
|
2770
|
-
setCurrentFocusIndex(
|
|
2771
|
-
currentFocusIndex === size2 - 1 ? 0 : currentFocusIndex + 1
|
|
2772
|
-
);
|
|
2768
|
+
setCurrentFocusIndex((prev) => prev === size2 - 1 ? 0 : prev + 1);
|
|
2773
2769
|
} else if (e.key === previousKey) {
|
|
2774
2770
|
e.preventDefault();
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
}
|
|
2780
|
-
setCurrentFocusIndex(size2 - 1);
|
|
2771
|
+
setCurrentFocusIndex((prev) => {
|
|
2772
|
+
if (prev === -1 || prev === 0)
|
|
2773
|
+
return size2 - 1;
|
|
2774
|
+
return prev - 1;
|
|
2775
|
+
});
|
|
2781
2776
|
}
|
|
2782
2777
|
},
|
|
2783
|
-
[size2,
|
|
2778
|
+
[size2, setCurrentFocusIndex]
|
|
2784
2779
|
);
|
|
2785
2780
|
useEffect7(() => {
|
|
2781
|
+
if (!active) {
|
|
2782
|
+
setCurrentFocusIndex(-1);
|
|
2783
|
+
return;
|
|
2784
|
+
}
|
|
2786
2785
|
document.addEventListener("keydown", handleKeyDown, false);
|
|
2787
2786
|
return () => {
|
|
2788
2787
|
document.removeEventListener("keydown", handleKeyDown, false);
|
|
2789
2788
|
};
|
|
2790
|
-
}, [handleKeyDown]);
|
|
2789
|
+
}, [handleKeyDown, active]);
|
|
2791
2790
|
return [currentFocusIndex, setCurrentFocusIndex];
|
|
2792
2791
|
}
|
|
2793
2792
|
|
|
@@ -3026,7 +3025,7 @@ var ExternalNavItem = styled9(BaseLink)`
|
|
|
3026
3025
|
var NavigationItem = ({
|
|
3027
3026
|
as: _as,
|
|
3028
3027
|
active,
|
|
3029
|
-
icon:
|
|
3028
|
+
icon: icon11,
|
|
3030
3029
|
external,
|
|
3031
3030
|
children,
|
|
3032
3031
|
onClick: propOnClick,
|
|
@@ -3052,7 +3051,7 @@ var NavigationItem = ({
|
|
|
3052
3051
|
onClick,
|
|
3053
3052
|
className: [active ? "active" : "", rest.className].join(" "),
|
|
3054
3053
|
children: [
|
|
3055
|
-
/* @__PURE__ */ jsx163(IconContainer, { children:
|
|
3054
|
+
/* @__PURE__ */ jsx163(IconContainer, { children: icon11 && /* @__PURE__ */ jsx163(Icon, { icon: icon11 }) }),
|
|
3056
3055
|
/* @__PURE__ */ jsx163(TextContainer, { children }),
|
|
3057
3056
|
/* @__PURE__ */ jsx163(ChevronContainer, { children: /* @__PURE__ */ jsx163(Icon, { icon: ChevronRightIcon }) })
|
|
3058
3057
|
]
|
|
@@ -3906,7 +3905,7 @@ var Button = forwardRef9(
|
|
|
3906
3905
|
loading = false,
|
|
3907
3906
|
loadingTooltip = "Lagring p\xE5g\xE5r",
|
|
3908
3907
|
fullWidth = false,
|
|
3909
|
-
icon:
|
|
3908
|
+
icon: icon11,
|
|
3910
3909
|
onClick,
|
|
3911
3910
|
onFocus,
|
|
3912
3911
|
onBlur,
|
|
@@ -3917,7 +3916,7 @@ var Button = forwardRef9(
|
|
|
3917
3916
|
} = props;
|
|
3918
3917
|
const as = href ? "a" : "button";
|
|
3919
3918
|
const hasLabel = !!children || !!label3;
|
|
3920
|
-
const hasIcon = !!
|
|
3919
|
+
const hasIcon = !!icon11;
|
|
3921
3920
|
const wrapperProps = {
|
|
3922
3921
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
3923
3922
|
href,
|
|
@@ -3942,13 +3941,13 @@ var Button = forwardRef9(
|
|
|
3942
3941
|
onBlur
|
|
3943
3942
|
};
|
|
3944
3943
|
const isIconButton = !hasLabel && hasIcon;
|
|
3945
|
-
const iconElement =
|
|
3944
|
+
const iconElement = icon11 && /* @__PURE__ */ jsx172(
|
|
3946
3945
|
StyledIconWrapperSpan,
|
|
3947
3946
|
{
|
|
3948
3947
|
size: size2,
|
|
3949
3948
|
isHidden: hasIcon && loading,
|
|
3950
3949
|
justIcon: isIconButton,
|
|
3951
|
-
children: /* @__PURE__ */ jsx172(Icon, { icon:
|
|
3950
|
+
children: /* @__PURE__ */ jsx172(Icon, { icon: icon11, iconSize: "inherit" })
|
|
3952
3951
|
}
|
|
3953
3952
|
);
|
|
3954
3953
|
return /* @__PURE__ */ jsxs20(ButtonWrapper, { ...wrapperProps, "aria-disabled": loading, children: [
|
|
@@ -4030,7 +4029,6 @@ var overflowMenuTokens = {
|
|
|
4030
4029
|
// src/components/OverflowMenu/OverflowMenuItem.tsx
|
|
4031
4030
|
import {
|
|
4032
4031
|
forwardRef as forwardRef10,
|
|
4033
|
-
useCallback as useCallback4,
|
|
4034
4032
|
useEffect as useEffect9,
|
|
4035
4033
|
useRef as useRef5
|
|
4036
4034
|
} from "react";
|
|
@@ -4081,18 +4079,7 @@ var IconWrapper = styled15.span`
|
|
|
4081
4079
|
var isAnchorProps2 = (props) => props.href !== void 0;
|
|
4082
4080
|
var isButtonProps = (props) => props.href === void 0 && props.onClick !== void 0;
|
|
4083
4081
|
var OverflowMenuItem = forwardRef10((props, ref) => {
|
|
4084
|
-
const {
|
|
4085
|
-
title: title3,
|
|
4086
|
-
icon: icon12,
|
|
4087
|
-
focus,
|
|
4088
|
-
setFocus,
|
|
4089
|
-
index,
|
|
4090
|
-
id,
|
|
4091
|
-
className,
|
|
4092
|
-
htmlProps = {},
|
|
4093
|
-
...rest
|
|
4094
|
-
} = props;
|
|
4095
|
-
const { onKeyDown } = htmlProps;
|
|
4082
|
+
const { title: title3, icon: icon11, focus, id, className, htmlProps = {}, ...rest } = props;
|
|
4096
4083
|
let href;
|
|
4097
4084
|
let onClick;
|
|
4098
4085
|
if (isAnchorProps2(props)) {
|
|
@@ -4108,27 +4095,12 @@ var OverflowMenuItem = forwardRef10((props, ref) => {
|
|
|
4108
4095
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
4109
4096
|
}
|
|
4110
4097
|
}, [focus]);
|
|
4111
|
-
const handleSelect = useCallback4(() => {
|
|
4112
|
-
if (setFocus && index) {
|
|
4113
|
-
setFocus(index);
|
|
4114
|
-
}
|
|
4115
|
-
}, [index, setFocus]);
|
|
4116
|
-
const handleOnClick = (e) => {
|
|
4117
|
-
handleSelect();
|
|
4118
|
-
onClick && onClick(e);
|
|
4119
|
-
};
|
|
4120
|
-
const handleOnKeyDown = (e) => {
|
|
4121
|
-
handleSelect();
|
|
4122
|
-
onKeyDown && onKeyDown(e);
|
|
4123
|
-
};
|
|
4124
4098
|
const linkProps = {
|
|
4125
4099
|
href,
|
|
4126
|
-
onClick: handleOnClick,
|
|
4127
|
-
onKeyDown: handleOnKeyDown,
|
|
4128
4100
|
role: "menuitem",
|
|
4129
4101
|
tabIndex: focus ? 0 : -1
|
|
4130
4102
|
};
|
|
4131
|
-
const iconElement =
|
|
4103
|
+
const iconElement = icon11 && /* @__PURE__ */ jsx173(Icon, { iconSize: "inherit", icon: icon11 });
|
|
4132
4104
|
if (!href && !onClick) {
|
|
4133
4105
|
return /* @__PURE__ */ jsxs21(Span, { ...{ ...getBaseHTMLProps(id, className, htmlProps, rest), ref }, children: [
|
|
4134
4106
|
/* @__PURE__ */ jsx173(IconWrapper, { children: iconElement }),
|
|
@@ -4214,7 +4186,7 @@ Divider.displayName = "Divider";
|
|
|
4214
4186
|
|
|
4215
4187
|
// src/components/ScrollableContainer/Scrollbar.tsx
|
|
4216
4188
|
import {
|
|
4217
|
-
useCallback as
|
|
4189
|
+
useCallback as useCallback4,
|
|
4218
4190
|
useEffect as useEffect10,
|
|
4219
4191
|
useRef as useRef6,
|
|
4220
4192
|
useState as useState5
|
|
@@ -4302,7 +4274,7 @@ var Scrollbar = (props) => {
|
|
|
4302
4274
|
Math.max(clientHeight / scrollHeight * trackSize, minThumbHeightPx)
|
|
4303
4275
|
);
|
|
4304
4276
|
}
|
|
4305
|
-
const handleTrackClick =
|
|
4277
|
+
const handleTrackClick = useCallback4(
|
|
4306
4278
|
(e) => {
|
|
4307
4279
|
if (contentRef == null ? void 0 : contentRef.current) {
|
|
4308
4280
|
const { current: trackCurrent } = trackRef;
|
|
@@ -4326,7 +4298,7 @@ var Scrollbar = (props) => {
|
|
|
4326
4298
|
},
|
|
4327
4299
|
[thumbHeight]
|
|
4328
4300
|
);
|
|
4329
|
-
const handleThumbPositioning =
|
|
4301
|
+
const handleThumbPositioning = useCallback4(() => {
|
|
4330
4302
|
if (!(contentRef == null ? void 0 : contentRef.current) || !trackRef.current || !thumbRef.current) {
|
|
4331
4303
|
return;
|
|
4332
4304
|
}
|
|
@@ -4352,18 +4324,18 @@ var Scrollbar = (props) => {
|
|
|
4352
4324
|
};
|
|
4353
4325
|
}
|
|
4354
4326
|
}, []);
|
|
4355
|
-
const handleThumbMousedown =
|
|
4327
|
+
const handleThumbMousedown = useCallback4((e) => {
|
|
4356
4328
|
setScrollStartPosition(e.clientY);
|
|
4357
4329
|
if (contentRef == null ? void 0 : contentRef.current)
|
|
4358
4330
|
setInitialScrollTop(contentRef.current.scrollTop);
|
|
4359
4331
|
setIsDragging(true);
|
|
4360
4332
|
}, []);
|
|
4361
|
-
const handleThumbMouseup =
|
|
4333
|
+
const handleThumbMouseup = useCallback4(() => {
|
|
4362
4334
|
if (isDragging) {
|
|
4363
4335
|
setIsDragging(false);
|
|
4364
4336
|
}
|
|
4365
4337
|
}, [isDragging]);
|
|
4366
|
-
const handleThumbMousemove =
|
|
4338
|
+
const handleThumbMousemove = useCallback4(
|
|
4367
4339
|
(e) => {
|
|
4368
4340
|
if (contentRef == null ? void 0 : contentRef.current) {
|
|
4369
4341
|
if (isDragging) {
|
|
@@ -4589,13 +4561,12 @@ var OverflowMenu = forwardRef12(
|
|
|
4589
4561
|
hasNavItems && interactiveItems.push(...navItems);
|
|
4590
4562
|
hasContextItems && interactiveItems.push(...items);
|
|
4591
4563
|
const hasInteractiveItems = interactiveItems.length > 0;
|
|
4592
|
-
const [focus
|
|
4564
|
+
const [focus] = useRoveFocus(interactiveItems == null ? void 0 : interactiveItems.length, isOpen);
|
|
4593
4565
|
const interactiveItemsList = hasInteractiveItems ? interactiveItems.map((item, index) => /* @__PURE__ */ jsx177("li", { children: /* @__PURE__ */ jsx177(
|
|
4594
4566
|
OverflowMenuItem,
|
|
4595
4567
|
{
|
|
4596
4568
|
index,
|
|
4597
4569
|
focus: focus === index && isOpen,
|
|
4598
|
-
setFocus,
|
|
4599
4570
|
icon: hasInteractiveUser && index === 0 ? PersonIcon : void 0,
|
|
4600
4571
|
...item,
|
|
4601
4572
|
onClick: (e) => {
|
|
@@ -5019,33 +4990,26 @@ import styled23 from "styled-components";
|
|
|
5019
4990
|
|
|
5020
4991
|
// src/components/BackLink/BackLink.tokens.tsx
|
|
5021
4992
|
import { ddsBaseTokens as ddsBaseTokens22 } from "@norges-domstoler/dds-design-tokens";
|
|
5022
|
-
var {
|
|
5023
|
-
var
|
|
5024
|
-
|
|
5025
|
-
};
|
|
5026
|
-
var nav = {
|
|
5027
|
-
gap: spacing10.SizesDdsSpacingX05
|
|
4993
|
+
var { spacing: spacing10 } = ddsBaseTokens22;
|
|
4994
|
+
var link3 = {
|
|
4995
|
+
gap: spacing10.SizesDdsSpacingX025
|
|
5028
4996
|
};
|
|
5029
4997
|
var backLinkTokens = {
|
|
5030
|
-
|
|
5031
|
-
nav
|
|
4998
|
+
link: link3
|
|
5032
4999
|
};
|
|
5033
5000
|
|
|
5034
5001
|
// src/components/BackLink/BackLink.tsx
|
|
5035
5002
|
import { jsx as jsx182, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5036
|
-
var
|
|
5003
|
+
var StyledLink2 = styled23(Link)`
|
|
5037
5004
|
align-items: center;
|
|
5038
5005
|
display: flex;
|
|
5039
|
-
gap: ${backLinkTokens.
|
|
5040
|
-
`;
|
|
5041
|
-
var StyledIcon = styled23(Icon)`
|
|
5042
|
-
color: ${backLinkTokens.icon.color};
|
|
5006
|
+
gap: ${backLinkTokens.link.gap};
|
|
5043
5007
|
`;
|
|
5044
5008
|
var BackLink = forwardRef13((props, ref) => {
|
|
5045
|
-
return /* @__PURE__ */
|
|
5046
|
-
/* @__PURE__ */ jsx182(
|
|
5047
|
-
|
|
5048
|
-
] });
|
|
5009
|
+
return /* @__PURE__ */ jsx182("nav", { ref, "aria-label": "g\xE5 tilbake", children: /* @__PURE__ */ jsxs28(StyledLink2, { href: props.href, children: [
|
|
5010
|
+
/* @__PURE__ */ jsx182(Icon, { icon: ArrowLeftIcon, iconSize: "small" }),
|
|
5011
|
+
props.label
|
|
5012
|
+
] }) });
|
|
5049
5013
|
});
|
|
5050
5014
|
BackLink.displayName = "BackLink";
|
|
5051
5015
|
|
|
@@ -5069,18 +5033,21 @@ var Breadcrumb = forwardRef14(
|
|
|
5069
5033
|
Breadcrumb.displayName = "Breadcrumb";
|
|
5070
5034
|
|
|
5071
5035
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
5072
|
-
import { Children as Children2, forwardRef as forwardRef15 } from "react";
|
|
5036
|
+
import { Children as Children2, forwardRef as forwardRef15, isValidElement as isValidElement2 } from "react";
|
|
5073
5037
|
import styled24 from "styled-components";
|
|
5074
5038
|
|
|
5075
5039
|
// src/components/Breadcrumbs/Breadcrumb.tokens.tsx
|
|
5076
5040
|
import { ddsBaseTokens as ddsBaseTokens23 } from "@norges-domstoler/dds-design-tokens";
|
|
5077
|
-
var { colors:
|
|
5041
|
+
var { colors: colors12, spacing: spacing11 } = ddsBaseTokens23;
|
|
5078
5042
|
var typographyType2 = "bodySans02";
|
|
5079
|
-
var
|
|
5080
|
-
color:
|
|
5043
|
+
var icon2 = {
|
|
5044
|
+
color: colors12.DdsColorInteractiveBase
|
|
5081
5045
|
};
|
|
5082
5046
|
var listItem = {
|
|
5083
|
-
gap: spacing11.SizesDdsSpacingX05
|
|
5047
|
+
gap: spacing11.SizesDdsSpacingX05,
|
|
5048
|
+
notSmallScreen: {
|
|
5049
|
+
padding: `${spacing11.SizesDdsSpacingX0125} 0`
|
|
5050
|
+
}
|
|
5084
5051
|
};
|
|
5085
5052
|
var list = {
|
|
5086
5053
|
gap: spacing11.SizesDdsSpacingX05
|
|
@@ -5088,12 +5055,12 @@ var list = {
|
|
|
5088
5055
|
var breadcrumbTokens = {
|
|
5089
5056
|
list,
|
|
5090
5057
|
listItem,
|
|
5091
|
-
icon:
|
|
5058
|
+
icon: icon2
|
|
5092
5059
|
};
|
|
5093
5060
|
|
|
5094
5061
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
5095
|
-
import { jsx as jsx184, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5096
|
-
var { icon:
|
|
5062
|
+
import { Fragment as Fragment5, jsx as jsx184, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5063
|
+
var { icon: icon3, list: list2, listItem: listItem2 } = breadcrumbTokens;
|
|
5097
5064
|
var List = styled24.ol`
|
|
5098
5065
|
${removeListStyling}
|
|
5099
5066
|
display: flex;
|
|
@@ -5102,33 +5069,66 @@ var List = styled24.ol`
|
|
|
5102
5069
|
gap: ${list2.gap};
|
|
5103
5070
|
`;
|
|
5104
5071
|
List.displayName = "List";
|
|
5105
|
-
var ListItem = styled24.li
|
|
5072
|
+
var ListItem = styled24.li.withConfig({
|
|
5073
|
+
shouldForwardProp: (prop) => prop !== "smallScreen"
|
|
5074
|
+
})`
|
|
5106
5075
|
align-items: center;
|
|
5107
5076
|
display: flex;
|
|
5108
5077
|
gap: ${listItem2.gap};
|
|
5109
5078
|
${getFontStyling(typographyType2)}
|
|
5079
|
+
padding: ${({ smallScreen }) => smallScreen ? "0" : listItem2.notSmallScreen.padding};
|
|
5110
5080
|
`;
|
|
5111
5081
|
ListItem.displayName = "ListItem";
|
|
5112
|
-
var
|
|
5113
|
-
color: ${
|
|
5082
|
+
var StyledIcon = styled24(Icon)`
|
|
5083
|
+
color: ${icon3.color};
|
|
5114
5084
|
`;
|
|
5115
5085
|
var Breadcrumbs = forwardRef15(
|
|
5116
5086
|
(props, ref) => {
|
|
5117
|
-
const { children, id, className, htmlProps, ...rest } = props;
|
|
5087
|
+
const { children, smallScreen, id, className, htmlProps, ...rest } = props;
|
|
5088
|
+
const chevronIcon = /* @__PURE__ */ jsx184(StyledIcon, { iconSize: "inherit", icon: ChevronRightIcon });
|
|
5118
5089
|
const childrenArray = Children2.toArray(children);
|
|
5119
5090
|
const breadcrumbChildren = childrenArray.map((item, index) => {
|
|
5120
|
-
return /* @__PURE__ */ jsxs29(ListItem, { children: [
|
|
5121
|
-
index !== 0 &&
|
|
5091
|
+
return /* @__PURE__ */ jsxs29(ListItem, { smallScreen, children: [
|
|
5092
|
+
index !== 0 && chevronIcon,
|
|
5122
5093
|
item
|
|
5123
5094
|
] }, `breadcrumb-${index}`);
|
|
5124
5095
|
});
|
|
5096
|
+
const breadcrumbChildrenTruncated = childrenArray.length > 2 ? childrenArray.slice(1, childrenArray.length - 1).map((item) => {
|
|
5097
|
+
if (isValidElement2(item))
|
|
5098
|
+
return {
|
|
5099
|
+
title: item.props.children,
|
|
5100
|
+
href: item.props.href
|
|
5101
|
+
};
|
|
5102
|
+
}).filter((item) => item) : [];
|
|
5103
|
+
const breadcrumbChildrenSmallScreen = /* @__PURE__ */ jsxs29(Fragment5, { children: [
|
|
5104
|
+
/* @__PURE__ */ jsx184(ListItem, { smallScreen, children: childrenArray[0] }),
|
|
5105
|
+
breadcrumbChildrenTruncated.length > 0 && /* @__PURE__ */ jsxs29(ListItem, { smallScreen, children: [
|
|
5106
|
+
chevronIcon,
|
|
5107
|
+
/* @__PURE__ */ jsxs29(OverflowMenuGroup, { children: [
|
|
5108
|
+
/* @__PURE__ */ jsx184(
|
|
5109
|
+
Button,
|
|
5110
|
+
{
|
|
5111
|
+
size: "tiny",
|
|
5112
|
+
icon: MoreHorizontalIcon,
|
|
5113
|
+
appearance: "borderless",
|
|
5114
|
+
"aria-label": `Vis br\xF8dsmulesti br\xF8dsmule 2 ${breadcrumbChildrenTruncated.length > 1 && `til ${breadcrumbChildren.length - 1}`}`
|
|
5115
|
+
}
|
|
5116
|
+
),
|
|
5117
|
+
/* @__PURE__ */ jsx184(OverflowMenu, { items: breadcrumbChildrenTruncated })
|
|
5118
|
+
] })
|
|
5119
|
+
] }),
|
|
5120
|
+
/* @__PURE__ */ jsxs29(ListItem, { smallScreen, children: [
|
|
5121
|
+
chevronIcon,
|
|
5122
|
+
childrenArray[childrenArray.length - 1]
|
|
5123
|
+
] })
|
|
5124
|
+
] });
|
|
5125
5125
|
return /* @__PURE__ */ jsx184(
|
|
5126
5126
|
"nav",
|
|
5127
5127
|
{
|
|
5128
5128
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
5129
5129
|
ref,
|
|
5130
5130
|
"aria-label": "br\xF8dsmulesti",
|
|
5131
|
-
children: /* @__PURE__ */ jsx184(List, { children: breadcrumbChildren })
|
|
5131
|
+
children: /* @__PURE__ */ jsx184(List, { children: smallScreen ? breadcrumbChildrenSmallScreen : breadcrumbChildren })
|
|
5132
5132
|
}
|
|
5133
5133
|
);
|
|
5134
5134
|
}
|
|
@@ -5143,29 +5143,29 @@ import {
|
|
|
5143
5143
|
ddsBaseTokens as ddsBaseTokens24,
|
|
5144
5144
|
ddsReferenceTokens as ddsReferenceTokens4
|
|
5145
5145
|
} from "@norges-domstoler/dds-design-tokens";
|
|
5146
|
-
var { colors:
|
|
5146
|
+
var { colors: colors13, border: border8 } = ddsBaseTokens24;
|
|
5147
5147
|
var { textDefault: textDefault3 } = ddsReferenceTokens4;
|
|
5148
5148
|
var base2 = {
|
|
5149
5149
|
border: `${border8.BordersDdsBorderStyleLightStrokeWeight} solid`
|
|
5150
5150
|
};
|
|
5151
5151
|
var cardColors = {
|
|
5152
5152
|
filledLight: {
|
|
5153
|
-
backgroundColor:
|
|
5154
|
-
borderColor:
|
|
5153
|
+
backgroundColor: colors13.DdsColorPrimaryLightest,
|
|
5154
|
+
borderColor: colors13.DdsColorPrimaryLightest,
|
|
5155
5155
|
color: textDefault3.textColor
|
|
5156
5156
|
},
|
|
5157
5157
|
filledDark: {
|
|
5158
|
-
backgroundColor:
|
|
5159
|
-
borderColor:
|
|
5160
|
-
color:
|
|
5158
|
+
backgroundColor: colors13.DdsColorPrimaryBase,
|
|
5159
|
+
borderColor: colors13.DdsColorPrimaryBase,
|
|
5160
|
+
color: colors13.DdsColorNeutralsWhite
|
|
5161
5161
|
},
|
|
5162
5162
|
strokeDark: {
|
|
5163
|
-
backgroundColor:
|
|
5163
|
+
backgroundColor: colors13.DdsColorNeutralsWhite,
|
|
5164
5164
|
borderColor: border8.BordersDdsBorderStyleLightStroke,
|
|
5165
5165
|
color: textDefault3.textColor
|
|
5166
5166
|
},
|
|
5167
5167
|
strokeLight: {
|
|
5168
|
-
backgroundColor:
|
|
5168
|
+
backgroundColor: colors13.DdsColorNeutralsWhite,
|
|
5169
5169
|
borderColor: border8.BordersDdsBorderStyleLightStroke,
|
|
5170
5170
|
color: textDefault3.textColor
|
|
5171
5171
|
}
|
|
@@ -5254,7 +5254,7 @@ var Card = (props) => {
|
|
|
5254
5254
|
Card.displayName = "Card";
|
|
5255
5255
|
|
|
5256
5256
|
// src/components/Card/CardAccordion/CardAccordion.tsx
|
|
5257
|
-
import { forwardRef as forwardRef16, useCallback as
|
|
5257
|
+
import { forwardRef as forwardRef16, useCallback as useCallback5, useEffect as useEffect13, useId as useId4, useState as useState7 } from "react";
|
|
5258
5258
|
import styled26 from "styled-components";
|
|
5259
5259
|
|
|
5260
5260
|
// src/components/Card/CardAccordion/CardAccordionContext.tsx
|
|
@@ -5297,7 +5297,7 @@ var CardAccordion = forwardRef16(
|
|
|
5297
5297
|
useEffect13(() => {
|
|
5298
5298
|
setExpanded(isExpanded);
|
|
5299
5299
|
}, [isExpanded]);
|
|
5300
|
-
const toggleExpanded =
|
|
5300
|
+
const toggleExpanded = useCallback5(() => {
|
|
5301
5301
|
setExpanded((prevExpanded) => {
|
|
5302
5302
|
const newExpanded = !prevExpanded;
|
|
5303
5303
|
if (onChange) {
|
|
@@ -5573,13 +5573,13 @@ import styled29 from "styled-components";
|
|
|
5573
5573
|
|
|
5574
5574
|
// src/components/Chip/Chip.tokens.tsx
|
|
5575
5575
|
import { ddsBaseTokens as ddsBaseTokens26 } from "@norges-domstoler/dds-design-tokens";
|
|
5576
|
-
var { colors:
|
|
5576
|
+
var { colors: colors14, spacing: spacing13, borderRadius: borderRadius5 } = ddsBaseTokens26;
|
|
5577
5577
|
var typographyType3 = "bodySans01";
|
|
5578
5578
|
var container3 = {
|
|
5579
5579
|
gap: spacing13.SizesDdsSpacingX025,
|
|
5580
5580
|
padding: `${spacing13.SizesDdsSpacingX0125} ${spacing13.SizesDdsSpacingX025}`,
|
|
5581
|
-
backgroundColor:
|
|
5582
|
-
border: `1px solid ${
|
|
5581
|
+
backgroundColor: colors14.DdsColorNeutralsGray1,
|
|
5582
|
+
border: `1px solid ${colors14.DdsColorNeutralsGray3}`,
|
|
5583
5583
|
borderRadius: borderRadius5.RadiiDdsBorderRadius1Radius
|
|
5584
5584
|
};
|
|
5585
5585
|
var group = {
|
|
@@ -6105,7 +6105,7 @@ import styled35, { css as css14 } from "styled-components";
|
|
|
6105
6105
|
|
|
6106
6106
|
// src/components/date-inputs/DatePicker/DatePicker.tokens.ts
|
|
6107
6107
|
import { ddsBaseTokens as ddsBaseTokens28 } from "@norges-domstoler/dds-design-tokens";
|
|
6108
|
-
var { colors:
|
|
6108
|
+
var { colors: colors15 } = ddsBaseTokens28;
|
|
6109
6109
|
var segment = {
|
|
6110
6110
|
medium: {
|
|
6111
6111
|
font: {
|
|
@@ -6113,7 +6113,7 @@ var segment = {
|
|
|
6113
6113
|
},
|
|
6114
6114
|
placeholder: {
|
|
6115
6115
|
...ddsBaseTokens28.fontPackages.supportingStyle_placeholdertext_01.base,
|
|
6116
|
-
textColor:
|
|
6116
|
+
textColor: colors15.DdsColorNeutralsGray6
|
|
6117
6117
|
}
|
|
6118
6118
|
},
|
|
6119
6119
|
small: {
|
|
@@ -6122,7 +6122,7 @@ var segment = {
|
|
|
6122
6122
|
},
|
|
6123
6123
|
placeholder: {
|
|
6124
6124
|
...ddsBaseTokens28.fontPackages.supportingStyle_placeholdertext_02.base,
|
|
6125
|
-
textColor:
|
|
6125
|
+
textColor: colors15.DdsColorNeutralsGray6
|
|
6126
6126
|
}
|
|
6127
6127
|
},
|
|
6128
6128
|
tiny: {
|
|
@@ -6131,7 +6131,7 @@ var segment = {
|
|
|
6131
6131
|
},
|
|
6132
6132
|
placeholder: {
|
|
6133
6133
|
...ddsBaseTokens28.fontPackages.supportingStyle_placeholdertext_03.base,
|
|
6134
|
-
textColor:
|
|
6134
|
+
textColor: colors15.DdsColorNeutralsGray6
|
|
6135
6135
|
}
|
|
6136
6136
|
},
|
|
6137
6137
|
padding: {
|
|
@@ -6139,24 +6139,24 @@ var segment = {
|
|
|
6139
6139
|
y: "0"
|
|
6140
6140
|
},
|
|
6141
6141
|
focus: {
|
|
6142
|
-
textColor:
|
|
6143
|
-
backgroundColor:
|
|
6142
|
+
textColor: colors15.DdsColorNeutralsWhite,
|
|
6143
|
+
backgroundColor: colors15.DdsColorInteractiveBase
|
|
6144
6144
|
}
|
|
6145
6145
|
};
|
|
6146
6146
|
var calendarButton = {
|
|
6147
|
-
color:
|
|
6147
|
+
color: colors15.DdsColorNeutralsGray9,
|
|
6148
6148
|
disabled: {
|
|
6149
|
-
color:
|
|
6149
|
+
color: colors15.DdsColorNeutralsGray6
|
|
6150
6150
|
},
|
|
6151
6151
|
background: "transparent",
|
|
6152
6152
|
borderRadius: ddsBaseTokens28.borderRadius.RadiiDdsBorderRadius1Radius,
|
|
6153
6153
|
hover: {
|
|
6154
|
-
background:
|
|
6155
|
-
color:
|
|
6154
|
+
background: colors15.DdsColorInteractiveLightest,
|
|
6155
|
+
color: colors15.DdsColorInteractiveBase
|
|
6156
6156
|
},
|
|
6157
6157
|
active: {
|
|
6158
|
-
background:
|
|
6159
|
-
color:
|
|
6158
|
+
background: colors15.DdsColorInteractiveLighter,
|
|
6159
|
+
color: colors15.DdsColorInteractiveBase
|
|
6160
6160
|
},
|
|
6161
6161
|
medium: {
|
|
6162
6162
|
size: `calc(${ddsBaseTokens28.iconSizes.DdsIconsizeMedium} + ${ddsBaseTokens28.spacing.SizesDdsSpacingX05})`
|
|
@@ -6649,14 +6649,14 @@ import styled39, { css as css16 } from "styled-components";
|
|
|
6649
6649
|
|
|
6650
6650
|
// src/components/DescriptionList/DescriptionList.tokens.tsx
|
|
6651
6651
|
import { ddsBaseTokens as ddsBaseTokens29 } from "@norges-domstoler/dds-design-tokens";
|
|
6652
|
-
var { spacing: spacing14, colors:
|
|
6652
|
+
var { spacing: spacing14, colors: colors16 } = ddsBaseTokens29;
|
|
6653
6653
|
var term = {
|
|
6654
6654
|
appearance: {
|
|
6655
6655
|
small: {
|
|
6656
|
-
color:
|
|
6656
|
+
color: colors16.DdsColorNeutralsGray7
|
|
6657
6657
|
},
|
|
6658
6658
|
bold: {
|
|
6659
|
-
color:
|
|
6659
|
+
color: colors16.DdsColorNeutralsGray9
|
|
6660
6660
|
}
|
|
6661
6661
|
},
|
|
6662
6662
|
firstOfType: {
|
|
@@ -6666,7 +6666,7 @@ var term = {
|
|
|
6666
6666
|
var desc = {
|
|
6667
6667
|
base: {
|
|
6668
6668
|
gap: spacing14.SizesDdsSpacingX025,
|
|
6669
|
-
color:
|
|
6669
|
+
color: colors16.DdsColorNeutralsGray9
|
|
6670
6670
|
},
|
|
6671
6671
|
lastChild: {
|
|
6672
6672
|
marginBottom: spacing14.SizesDdsSpacingX1
|
|
@@ -6774,14 +6774,14 @@ var DListDesc = styled41.dd`
|
|
|
6774
6774
|
gap: ${descriptionListTokens.desc.base.gap};
|
|
6775
6775
|
`;
|
|
6776
6776
|
var DescriptionListDesc = forwardRef27((props, ref) => {
|
|
6777
|
-
const { children, icon:
|
|
6777
|
+
const { children, icon: icon11, id, className, htmlProps, ...rest } = props;
|
|
6778
6778
|
const dListDescProps = {
|
|
6779
6779
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
6780
6780
|
children,
|
|
6781
6781
|
ref
|
|
6782
6782
|
};
|
|
6783
6783
|
return /* @__PURE__ */ jsxs37(DListDesc, { ...dListDescProps, children: [
|
|
6784
|
-
|
|
6784
|
+
icon11 && /* @__PURE__ */ jsx204(Icon, { icon: icon11 }),
|
|
6785
6785
|
" ",
|
|
6786
6786
|
children
|
|
6787
6787
|
] });
|
|
@@ -6991,12 +6991,12 @@ Drawer.displayName = "Drawer";
|
|
|
6991
6991
|
import {
|
|
6992
6992
|
Children as ReactChildren2,
|
|
6993
6993
|
cloneElement as cloneElement2,
|
|
6994
|
-
isValidElement as
|
|
6994
|
+
isValidElement as isValidElement3,
|
|
6995
6995
|
useId as useId6,
|
|
6996
6996
|
useRef as useRef18,
|
|
6997
6997
|
useState as useState11
|
|
6998
6998
|
} from "react";
|
|
6999
|
-
import { Fragment as
|
|
6999
|
+
import { Fragment as Fragment6, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
7000
7000
|
var DrawerGroup = ({
|
|
7001
7001
|
children,
|
|
7002
7002
|
drawerId,
|
|
@@ -7018,7 +7018,7 @@ var DrawerGroup = ({
|
|
|
7018
7018
|
onClose && onClose();
|
|
7019
7019
|
};
|
|
7020
7020
|
const Children9 = ReactChildren2.map(children, (child, childIndex) => {
|
|
7021
|
-
return
|
|
7021
|
+
return isValidElement3(child) && (childIndex === 0 ? cloneElement2(child, {
|
|
7022
7022
|
"aria-haspopup": "dialog",
|
|
7023
7023
|
"aria-controls": uniqueDrawerId,
|
|
7024
7024
|
"aria-expanded": !closed,
|
|
@@ -7031,7 +7031,7 @@ var DrawerGroup = ({
|
|
|
7031
7031
|
onClose: handleClose
|
|
7032
7032
|
}));
|
|
7033
7033
|
});
|
|
7034
|
-
return /* @__PURE__ */ jsxs39(
|
|
7034
|
+
return /* @__PURE__ */ jsxs39(Fragment6, { children: [
|
|
7035
7035
|
" ",
|
|
7036
7036
|
Children9,
|
|
7037
7037
|
" "
|
|
@@ -7043,7 +7043,7 @@ DrawerGroup.displayName = "DrawerGroup";
|
|
|
7043
7043
|
import { ddsBaseTokens as ddsBaseTokens31 } from "@norges-domstoler/dds-design-tokens";
|
|
7044
7044
|
import styled44 from "styled-components";
|
|
7045
7045
|
import { jsx as jsx207, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
7046
|
-
var { colors:
|
|
7046
|
+
var { colors: colors17, spacing: spacing16 } = ddsBaseTokens31;
|
|
7047
7047
|
var StyledEmptyContent = styled44.div`
|
|
7048
7048
|
display: flex;
|
|
7049
7049
|
justify-content: center;
|
|
@@ -7051,7 +7051,7 @@ var StyledEmptyContent = styled44.div`
|
|
|
7051
7051
|
min-height: ${spacing16.SizesDdsSpacingX10};
|
|
7052
7052
|
height: 100%;
|
|
7053
7053
|
width: 100%;
|
|
7054
|
-
background-color: ${
|
|
7054
|
+
background-color: ${colors17.DdsColorNeutralsGray1};
|
|
7055
7055
|
padding: ${spacing16.SizesDdsSpacingX15};
|
|
7056
7056
|
`;
|
|
7057
7057
|
var StyledEmptyContentText = styled44.div`
|
|
@@ -7117,13 +7117,13 @@ function favStarTokens(size2, variant) {
|
|
|
7117
7117
|
import { useState as useState12 } from "react";
|
|
7118
7118
|
|
|
7119
7119
|
// src/hooks/useCallbackRef.ts
|
|
7120
|
-
import { useCallback as
|
|
7120
|
+
import { useCallback as useCallback6, useEffect as useEffect17, useRef as useRef19 } from "react";
|
|
7121
7121
|
function useCallbackRef(callback, deps = []) {
|
|
7122
7122
|
const callbackRef = useRef19(callback);
|
|
7123
7123
|
useEffect17(() => {
|
|
7124
7124
|
callbackRef.current = callback;
|
|
7125
7125
|
});
|
|
7126
|
-
return
|
|
7126
|
+
return useCallback6((...args) => {
|
|
7127
7127
|
var _a;
|
|
7128
7128
|
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
7129
7129
|
}, deps);
|
|
@@ -7153,7 +7153,7 @@ function useControllableState(props) {
|
|
|
7153
7153
|
// src/components/FavStar/FavStar.tsx
|
|
7154
7154
|
import { jsx as jsx208, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
7155
7155
|
var TRANSITION_SPEED = "0.2s";
|
|
7156
|
-
var
|
|
7156
|
+
var StyledIcon2 = styled45(Icon)`
|
|
7157
7157
|
color: currentColor;
|
|
7158
7158
|
position: absolute;
|
|
7159
7159
|
top: 0;
|
|
@@ -7199,7 +7199,7 @@ var Container5 = styled45.label`
|
|
|
7199
7199
|
}
|
|
7200
7200
|
|
|
7201
7201
|
&:active {
|
|
7202
|
-
${
|
|
7202
|
+
${StyledIcon2} {
|
|
7203
7203
|
transform: scale(0.75);
|
|
7204
7204
|
}
|
|
7205
7205
|
}
|
|
@@ -7255,9 +7255,9 @@ var FavStar = forwardRef30(
|
|
|
7255
7255
|
"aria-label": (_a = props["aria-label"]) != null ? _a : "Favoriser"
|
|
7256
7256
|
}
|
|
7257
7257
|
),
|
|
7258
|
-
/* @__PURE__ */ jsx208(
|
|
7258
|
+
/* @__PURE__ */ jsx208(StyledIcon2, { iconSize: size2, icon: StarIcon }),
|
|
7259
7259
|
/* @__PURE__ */ jsx208(
|
|
7260
|
-
|
|
7260
|
+
StyledIcon2,
|
|
7261
7261
|
{
|
|
7262
7262
|
iconSize: size2,
|
|
7263
7263
|
icon: StarFilledIcon,
|
|
@@ -7520,7 +7520,7 @@ import {
|
|
|
7520
7520
|
Children as ReactChildren3,
|
|
7521
7521
|
cloneElement as cloneElement3,
|
|
7522
7522
|
forwardRef as forwardRef33,
|
|
7523
|
-
isValidElement as
|
|
7523
|
+
isValidElement as isValidElement4,
|
|
7524
7524
|
useEffect as useEffect19,
|
|
7525
7525
|
useId as useId9,
|
|
7526
7526
|
useRef as useRef21,
|
|
@@ -7532,16 +7532,16 @@ import styled49 from "styled-components";
|
|
|
7532
7532
|
|
|
7533
7533
|
// src/components/Tooltip/Tooltip.tokens.tsx
|
|
7534
7534
|
import { ddsBaseTokens as ddsBaseTokens36 } from "@norges-domstoler/dds-design-tokens";
|
|
7535
|
-
var { colors:
|
|
7535
|
+
var { colors: colors18, spacing: spacing19 } = ddsBaseTokens36;
|
|
7536
7536
|
var wrapper = {
|
|
7537
7537
|
padding: `${spacing19.SizesDdsSpacingX075}`
|
|
7538
7538
|
};
|
|
7539
7539
|
var svgArrow = {
|
|
7540
7540
|
border: {
|
|
7541
|
-
fill:
|
|
7541
|
+
fill: colors18.DdsColorPrimaryLighter
|
|
7542
7542
|
},
|
|
7543
7543
|
background: {
|
|
7544
|
-
fill:
|
|
7544
|
+
fill: colors18.DdsColorNeutralsWhite
|
|
7545
7545
|
}
|
|
7546
7546
|
};
|
|
7547
7547
|
var tooltipTokens = {
|
|
@@ -7650,7 +7650,7 @@ var Tooltip = forwardRef33(
|
|
|
7650
7650
|
};
|
|
7651
7651
|
const anchorProps = children.props;
|
|
7652
7652
|
const anchorElement = ReactChildren3.only(
|
|
7653
|
-
|
|
7653
|
+
isValidElement4(children) && cloneElement3(children, {
|
|
7654
7654
|
ref: refs.setReference,
|
|
7655
7655
|
onFocus: combineHandlers(openTooltip, anchorProps.onFocus),
|
|
7656
7656
|
onBlur: combineHandlers(closeTooltip, anchorProps.onBlur),
|
|
@@ -7837,17 +7837,17 @@ import styled51 from "styled-components";
|
|
|
7837
7837
|
|
|
7838
7838
|
// src/components/FileUploader/FileUploader.tokens.tsx
|
|
7839
7839
|
import { ddsBaseTokens as ddsBaseTokens38 } from "@norges-domstoler/dds-design-tokens";
|
|
7840
|
-
var { colors:
|
|
7840
|
+
var { colors: colors19, spacing: spacing20 } = ddsBaseTokens38;
|
|
7841
7841
|
var rootTokens = {
|
|
7842
|
-
borderColor:
|
|
7843
|
-
borderColorError:
|
|
7842
|
+
borderColor: colors19.DdsColorNeutralsGray5,
|
|
7843
|
+
borderColorError: colors19.DdsColorDangerBase,
|
|
7844
7844
|
paddingLeftRightTop: spacing20.SizesDdsSpacingX15,
|
|
7845
7845
|
paddingBottom: spacing20.SizesDdsSpacingX2,
|
|
7846
7846
|
gap: spacing20.SizesDdsSpacingX1,
|
|
7847
|
-
backgroundColor:
|
|
7847
|
+
backgroundColor: colors19.DdsColorNeutralsWhite,
|
|
7848
7848
|
dragActive: {
|
|
7849
|
-
borderColor:
|
|
7850
|
-
backgroundColor:
|
|
7849
|
+
borderColor: colors19.DdsColorInteractiveBase,
|
|
7850
|
+
backgroundColor: colors19.DdsColorInteractiveLightest
|
|
7851
7851
|
}
|
|
7852
7852
|
};
|
|
7853
7853
|
var noZoneContainerTokens = {
|
|
@@ -7857,10 +7857,10 @@ var fileTokens = {
|
|
|
7857
7857
|
marginTop: spacing20.SizesDdsSpacingX05,
|
|
7858
7858
|
paddingLeftRight: spacing20.SizesDdsSpacingX05,
|
|
7859
7859
|
paddingTopBottom: spacing20.SizesDdsSpacingX1,
|
|
7860
|
-
backgroundColor:
|
|
7860
|
+
backgroundColor: colors19.DdsColorNeutralsGray1,
|
|
7861
7861
|
textToIconsGap: spacing20.SizesDdsSpacingX075,
|
|
7862
7862
|
invalid: {
|
|
7863
|
-
borderColor:
|
|
7863
|
+
borderColor: colors19.DdsColorDangerBase
|
|
7864
7864
|
}
|
|
7865
7865
|
};
|
|
7866
7866
|
var errorsTokens = {
|
|
@@ -7951,7 +7951,7 @@ var File = (props) => {
|
|
|
7951
7951
|
import {
|
|
7952
7952
|
fromEvent as getFilesFromEvent
|
|
7953
7953
|
} from "file-selector";
|
|
7954
|
-
import { useCallback as
|
|
7954
|
+
import { useCallback as useCallback7, useEffect as useEffect21, useMemo, useReducer, useRef as useRef22 } from "react";
|
|
7955
7955
|
|
|
7956
7956
|
// src/components/FileUploader/fileUploaderReducer.ts
|
|
7957
7957
|
var fileUploaderReducer = (state, action) => {
|
|
@@ -8075,12 +8075,12 @@ var useFileUploader = (props) => {
|
|
|
8075
8075
|
payload: calcRootErrors(stateFiles, maxFiles, errorMessage)
|
|
8076
8076
|
});
|
|
8077
8077
|
}, [dispatch, stateFiles, maxFiles, errorMessage]);
|
|
8078
|
-
const onRootFocus =
|
|
8078
|
+
const onRootFocus = useCallback7(
|
|
8079
8079
|
() => dispatch({ type: "focus" }),
|
|
8080
8080
|
[dispatch]
|
|
8081
8081
|
);
|
|
8082
|
-
const onRootBlur =
|
|
8083
|
-
const onRootDragEnter =
|
|
8082
|
+
const onRootBlur = useCallback7(() => dispatch({ type: "blur" }), [dispatch]);
|
|
8083
|
+
const onRootDragEnter = useCallback7(
|
|
8084
8084
|
async (evt) => {
|
|
8085
8085
|
preventDefaults(evt);
|
|
8086
8086
|
if (isEventWithFiles(evt)) {
|
|
@@ -8093,7 +8093,7 @@ var useFileUploader = (props) => {
|
|
|
8093
8093
|
},
|
|
8094
8094
|
[dispatch, accept, maxFiles]
|
|
8095
8095
|
);
|
|
8096
|
-
const onRootDragOver =
|
|
8096
|
+
const onRootDragOver = useCallback7((evt) => {
|
|
8097
8097
|
preventDefaults(evt);
|
|
8098
8098
|
const hasFiles = isEventWithFiles(evt);
|
|
8099
8099
|
if (hasFiles && evt.dataTransfer) {
|
|
@@ -8103,7 +8103,7 @@ var useFileUploader = (props) => {
|
|
|
8103
8103
|
}
|
|
8104
8104
|
}
|
|
8105
8105
|
}, []);
|
|
8106
|
-
const onRootDragLeave =
|
|
8106
|
+
const onRootDragLeave = useCallback7(
|
|
8107
8107
|
(evt) => {
|
|
8108
8108
|
preventDefaults(evt);
|
|
8109
8109
|
if (evt.currentTarget.contains(evt.relatedTarget))
|
|
@@ -8112,7 +8112,7 @@ var useFileUploader = (props) => {
|
|
|
8112
8112
|
},
|
|
8113
8113
|
[dispatch]
|
|
8114
8114
|
);
|
|
8115
|
-
const setFiles =
|
|
8115
|
+
const setFiles = useCallback7(
|
|
8116
8116
|
async (evt) => {
|
|
8117
8117
|
evt.preventDefault();
|
|
8118
8118
|
if (isEventWithFiles(evt)) {
|
|
@@ -8146,13 +8146,13 @@ var useFileUploader = (props) => {
|
|
|
8146
8146
|
dispatch
|
|
8147
8147
|
]
|
|
8148
8148
|
);
|
|
8149
|
-
const openFileDialog =
|
|
8149
|
+
const openFileDialog = useCallback7(() => {
|
|
8150
8150
|
if (inputRef.current) {
|
|
8151
8151
|
inputRef.current.value = "";
|
|
8152
8152
|
inputRef.current.click();
|
|
8153
8153
|
}
|
|
8154
8154
|
}, [inputRef]);
|
|
8155
|
-
const removeFile =
|
|
8155
|
+
const removeFile = useCallback7(
|
|
8156
8156
|
(file) => {
|
|
8157
8157
|
const newFiles = [...stateFiles];
|
|
8158
8158
|
newFiles.splice(stateFiles.indexOf(file), 1);
|
|
@@ -8166,7 +8166,7 @@ var useFileUploader = (props) => {
|
|
|
8166
8166
|
},
|
|
8167
8167
|
[stateFiles, isControlled, maxFiles, errorMessage, onChange, dispatch]
|
|
8168
8168
|
);
|
|
8169
|
-
const getRootProps =
|
|
8169
|
+
const getRootProps = useCallback7(
|
|
8170
8170
|
() => ({
|
|
8171
8171
|
onBlur: onRootBlur,
|
|
8172
8172
|
onFocus: onRootFocus,
|
|
@@ -8188,14 +8188,14 @@ var useFileUploader = (props) => {
|
|
|
8188
8188
|
disabled
|
|
8189
8189
|
]
|
|
8190
8190
|
);
|
|
8191
|
-
const getButtonProps =
|
|
8191
|
+
const getButtonProps = useCallback7(
|
|
8192
8192
|
() => ({
|
|
8193
8193
|
onClick: openFileDialog,
|
|
8194
8194
|
ref: buttonRef
|
|
8195
8195
|
}),
|
|
8196
8196
|
[openFileDialog, buttonRef]
|
|
8197
8197
|
);
|
|
8198
|
-
const getInputProps =
|
|
8198
|
+
const getInputProps = useCallback7(
|
|
8199
8199
|
() => ({
|
|
8200
8200
|
type: "file",
|
|
8201
8201
|
style: { display: "none" },
|
|
@@ -8375,22 +8375,22 @@ import styled55, { css as css21 } from "styled-components";
|
|
|
8375
8375
|
|
|
8376
8376
|
// src/components/GlobalMessage/GlobalMessage.tokens.tsx
|
|
8377
8377
|
import { ddsBaseTokens as ddsBaseTokens39 } from "@norges-domstoler/dds-design-tokens";
|
|
8378
|
-
var { colors:
|
|
8378
|
+
var { colors: colors20, spacing: spacing21 } = ddsBaseTokens39;
|
|
8379
8379
|
var typographyType4 = "bodySans02";
|
|
8380
8380
|
var container7 = {
|
|
8381
8381
|
borderBottom: "2px solid",
|
|
8382
8382
|
padding: `0 ${spacing21.SizesDdsSpacingX1}`,
|
|
8383
8383
|
info: {
|
|
8384
|
-
borderColor:
|
|
8385
|
-
backgroundColor:
|
|
8384
|
+
borderColor: colors20.DdsColorInfoLighter,
|
|
8385
|
+
backgroundColor: colors20.DdsColorInfoLightest
|
|
8386
8386
|
},
|
|
8387
8387
|
danger: {
|
|
8388
|
-
borderColor:
|
|
8389
|
-
backgroundColor:
|
|
8388
|
+
borderColor: colors20.DdsColorDangerLighter,
|
|
8389
|
+
backgroundColor: colors20.DdsColorDangerLightest
|
|
8390
8390
|
},
|
|
8391
8391
|
warning: {
|
|
8392
|
-
borderColor:
|
|
8393
|
-
backgroundColor:
|
|
8392
|
+
borderColor: colors20.DdsColorWarningLighter,
|
|
8393
|
+
backgroundColor: colors20.DdsColorWarningLightest
|
|
8394
8394
|
}
|
|
8395
8395
|
};
|
|
8396
8396
|
var contentContainer3 = {
|
|
@@ -8422,20 +8422,20 @@ var globalMessageTokens = {
|
|
|
8422
8422
|
icon: {
|
|
8423
8423
|
marginRight: `${spacing21.SizesDdsSpacingX075}`,
|
|
8424
8424
|
info: {
|
|
8425
|
-
color:
|
|
8425
|
+
color: colors20.DdsColorInfoDarkest
|
|
8426
8426
|
},
|
|
8427
8427
|
danger: {
|
|
8428
|
-
color:
|
|
8428
|
+
color: colors20.DdsColorDangerDarkest
|
|
8429
8429
|
},
|
|
8430
8430
|
warning: {
|
|
8431
|
-
color:
|
|
8431
|
+
color: colors20.DdsColorWarningDarkest
|
|
8432
8432
|
}
|
|
8433
8433
|
}
|
|
8434
8434
|
};
|
|
8435
8435
|
|
|
8436
8436
|
// src/components/GlobalMessage/GlobalMessage.tsx
|
|
8437
8437
|
import { jsx as jsx219, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
8438
|
-
var { container: container8, contentContainer: contentContainer4, icon:
|
|
8438
|
+
var { container: container8, contentContainer: contentContainer4, icon: icon4 } = globalMessageTokens;
|
|
8439
8439
|
var Container7 = styled55.div`
|
|
8440
8440
|
display: flex;
|
|
8441
8441
|
align-items: center;
|
|
@@ -8451,7 +8451,7 @@ var Container7 = styled55.div`
|
|
|
8451
8451
|
`}
|
|
8452
8452
|
`;
|
|
8453
8453
|
var MessageIconWrapper = styled55(Icon)`
|
|
8454
|
-
margin-right: ${
|
|
8454
|
+
margin-right: ${icon4.marginRight};
|
|
8455
8455
|
`;
|
|
8456
8456
|
var ControlsContainer = styled55.div`
|
|
8457
8457
|
display: flex;
|
|
@@ -8490,7 +8490,7 @@ var GlobalMessage = forwardRef34(
|
|
|
8490
8490
|
MessageIconWrapper,
|
|
8491
8491
|
{
|
|
8492
8492
|
icon: purposeVariants[purpose].icon,
|
|
8493
|
-
color:
|
|
8493
|
+
color: icon4[purpose].color
|
|
8494
8494
|
}
|
|
8495
8495
|
),
|
|
8496
8496
|
children != null ? children : /* @__PURE__ */ jsx219(Typography, { as: "span", children: message2 })
|
|
@@ -8719,10 +8719,10 @@ import { forwardRef as forwardRef36, useRef as useRef24 } from "react";
|
|
|
8719
8719
|
import {
|
|
8720
8720
|
Children as Children4,
|
|
8721
8721
|
cloneElement as cloneElement4,
|
|
8722
|
-
isValidElement as
|
|
8722
|
+
isValidElement as isValidElement5,
|
|
8723
8723
|
useState as useState17
|
|
8724
8724
|
} from "react";
|
|
8725
|
-
import { Fragment as
|
|
8725
|
+
import { Fragment as Fragment7, jsx as jsx222 } from "react/jsx-runtime";
|
|
8726
8726
|
var InlineEdit = (props) => {
|
|
8727
8727
|
const {
|
|
8728
8728
|
emptiable,
|
|
@@ -8763,7 +8763,7 @@ var InlineEdit = (props) => {
|
|
|
8763
8763
|
useOnKeyDown(["Escape"], () => onExitHandler());
|
|
8764
8764
|
useOnClickOutside(inputRef.current, () => onExitHandler());
|
|
8765
8765
|
const inputChild = Children4.only(
|
|
8766
|
-
|
|
8766
|
+
isValidElement5(children) && cloneElement4(children, {
|
|
8767
8767
|
onChange: onChangeHandler,
|
|
8768
8768
|
onBlur: onBlurHandler,
|
|
8769
8769
|
onFocus: onFocusHandler,
|
|
@@ -8772,7 +8772,7 @@ var InlineEdit = (props) => {
|
|
|
8772
8772
|
emptiable
|
|
8773
8773
|
})
|
|
8774
8774
|
);
|
|
8775
|
-
return /* @__PURE__ */ jsx222(
|
|
8775
|
+
return /* @__PURE__ */ jsx222(Fragment7, { children: inputChild });
|
|
8776
8776
|
};
|
|
8777
8777
|
InlineEdit.displayName = "InlineEdit";
|
|
8778
8778
|
|
|
@@ -8784,7 +8784,7 @@ import styled58, { css as css23 } from "styled-components";
|
|
|
8784
8784
|
|
|
8785
8785
|
// src/components/InlineEdit/InlineEdit.tokens.ts
|
|
8786
8786
|
import { ddsBaseTokens as ddsBaseTokens41 } from "@norges-domstoler/dds-design-tokens";
|
|
8787
|
-
var { colors:
|
|
8787
|
+
var { colors: colors21, spacing: spacing23, fontPackages: fontPackages5 } = ddsBaseTokens41;
|
|
8788
8788
|
var inlineEdit = {
|
|
8789
8789
|
padding: spacing23.SizesDdsSpacingX025,
|
|
8790
8790
|
font: fontPackages5.body_sans_02.base,
|
|
@@ -8793,10 +8793,10 @@ var inlineEdit = {
|
|
|
8793
8793
|
paddingLeft: spacing23.SizesDdsSpacingX2
|
|
8794
8794
|
},
|
|
8795
8795
|
hover: {
|
|
8796
|
-
backgroundColor:
|
|
8796
|
+
backgroundColor: colors21.DdsColorInteractiveLightest
|
|
8797
8797
|
},
|
|
8798
8798
|
focus: {
|
|
8799
|
-
backgroundColor:
|
|
8799
|
+
backgroundColor: colors21.DdsColorNeutralsWhite
|
|
8800
8800
|
}
|
|
8801
8801
|
};
|
|
8802
8802
|
var iconWrapper = {
|
|
@@ -9027,9 +9027,9 @@ import styled59, { css as css24 } from "styled-components";
|
|
|
9027
9027
|
|
|
9028
9028
|
// src/components/InternalHeader/InternalHeader.tokens.tsx
|
|
9029
9029
|
import { ddsBaseTokens as ddsBaseTokens42 } from "@norges-domstoler/dds-design-tokens";
|
|
9030
|
-
var { border: border10, colors:
|
|
9030
|
+
var { border: border10, colors: colors22, spacing: spacing24 } = ddsBaseTokens42;
|
|
9031
9031
|
var bar = {
|
|
9032
|
-
backgroundColor:
|
|
9032
|
+
backgroundColor: colors22.DdsColorNeutralsWhite,
|
|
9033
9033
|
itemGap: spacing24.SizesDdsSpacingX15,
|
|
9034
9034
|
minHeight: "57px",
|
|
9035
9035
|
borderBottom: `${border10.BordersDdsBorderStyleLightStroke} solid ${border10.BordersDdsBorderStyleLightStrokeWeight}`,
|
|
@@ -9421,7 +9421,7 @@ import styled63, { css as css26 } from "styled-components";
|
|
|
9421
9421
|
|
|
9422
9422
|
// src/components/LocalMessage/LocalMessage.tokens.tsx
|
|
9423
9423
|
import { ddsBaseTokens as ddsBaseTokens45 } from "@norges-domstoler/dds-design-tokens";
|
|
9424
|
-
var { colors:
|
|
9424
|
+
var { colors: colors23, spacing: spacing26, borderRadius: borderRadius6, border: border11, outerShadow: outerShadow3 } = ddsBaseTokens45;
|
|
9425
9425
|
var container9 = {
|
|
9426
9426
|
base: {
|
|
9427
9427
|
boxShadow: outerShadow3.DdsShadow1Onlight,
|
|
@@ -9432,28 +9432,28 @@ var container9 = {
|
|
|
9432
9432
|
},
|
|
9433
9433
|
purpose: {
|
|
9434
9434
|
info: {
|
|
9435
|
-
borderColor:
|
|
9436
|
-
backgroundColor:
|
|
9435
|
+
borderColor: colors23.DdsColorInfoBase,
|
|
9436
|
+
backgroundColor: colors23.DdsColorInfoLightest
|
|
9437
9437
|
},
|
|
9438
9438
|
warning: {
|
|
9439
|
-
borderColor:
|
|
9440
|
-
backgroundColor:
|
|
9439
|
+
borderColor: colors23.DdsColorWarningBase,
|
|
9440
|
+
backgroundColor: colors23.DdsColorWarningLightest
|
|
9441
9441
|
},
|
|
9442
9442
|
danger: {
|
|
9443
|
-
borderColor:
|
|
9444
|
-
backgroundColor:
|
|
9443
|
+
borderColor: colors23.DdsColorDangerBase,
|
|
9444
|
+
backgroundColor: colors23.DdsColorDangerLightest
|
|
9445
9445
|
},
|
|
9446
9446
|
success: {
|
|
9447
|
-
borderColor:
|
|
9448
|
-
backgroundColor:
|
|
9447
|
+
borderColor: colors23.DdsColorSuccessBase,
|
|
9448
|
+
backgroundColor: colors23.DdsColorSuccessLightest
|
|
9449
9449
|
},
|
|
9450
9450
|
tips: {
|
|
9451
|
-
borderColor:
|
|
9452
|
-
backgroundColor:
|
|
9451
|
+
borderColor: colors23.DdsColorPrimaryBase,
|
|
9452
|
+
backgroundColor: colors23.DdsColorPrimaryLightest
|
|
9453
9453
|
},
|
|
9454
9454
|
confidential: {
|
|
9455
|
-
borderColor:
|
|
9456
|
-
backgroundColor:
|
|
9455
|
+
borderColor: colors23.DdsColorDangerBase,
|
|
9456
|
+
backgroundColor: colors23.DdsColorDangerLightest
|
|
9457
9457
|
}
|
|
9458
9458
|
}
|
|
9459
9459
|
};
|
|
@@ -9488,37 +9488,37 @@ var purposeVariants2 = {
|
|
|
9488
9488
|
closeButtonPurpose: "danger"
|
|
9489
9489
|
}
|
|
9490
9490
|
};
|
|
9491
|
-
var
|
|
9491
|
+
var icon5 = {
|
|
9492
9492
|
marginRight: `${spacing26.SizesDdsSpacingX075}`,
|
|
9493
9493
|
info: {
|
|
9494
|
-
color:
|
|
9494
|
+
color: colors23.DdsColorInfoDarkest
|
|
9495
9495
|
},
|
|
9496
9496
|
danger: {
|
|
9497
|
-
color:
|
|
9497
|
+
color: colors23.DdsColorDangerDarkest
|
|
9498
9498
|
},
|
|
9499
9499
|
warning: {
|
|
9500
|
-
color:
|
|
9500
|
+
color: colors23.DdsColorWarningDarkest
|
|
9501
9501
|
},
|
|
9502
9502
|
success: {
|
|
9503
|
-
color:
|
|
9503
|
+
color: colors23.DdsColorSuccessDarkest
|
|
9504
9504
|
},
|
|
9505
9505
|
tips: {
|
|
9506
|
-
color:
|
|
9506
|
+
color: colors23.DdsColorPrimaryDarkest
|
|
9507
9507
|
},
|
|
9508
9508
|
confidential: {
|
|
9509
|
-
color:
|
|
9509
|
+
color: colors23.DdsColorDangerDarkest
|
|
9510
9510
|
}
|
|
9511
9511
|
};
|
|
9512
9512
|
var localMessageTokens = {
|
|
9513
9513
|
container: container9,
|
|
9514
9514
|
content: content3,
|
|
9515
9515
|
purposeVariants: purposeVariants2,
|
|
9516
|
-
icon:
|
|
9516
|
+
icon: icon5
|
|
9517
9517
|
};
|
|
9518
9518
|
|
|
9519
9519
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9520
|
-
import { Fragment as
|
|
9521
|
-
var { container: container10, content: content4, icon:
|
|
9520
|
+
import { Fragment as Fragment8, jsx as jsx231, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
9521
|
+
var { container: container10, content: content4, icon: icon6, purposeVariants: purposeVariants3 } = localMessageTokens;
|
|
9522
9522
|
var Container8 = styled63.div.withConfig({
|
|
9523
9523
|
shouldForwardProp: (prop) => {
|
|
9524
9524
|
const styleOnlyProps = [
|
|
@@ -9606,14 +9606,14 @@ var LocalMessage = forwardRef42(
|
|
|
9606
9606
|
ref
|
|
9607
9607
|
};
|
|
9608
9608
|
if (isClosed) {
|
|
9609
|
-
return /* @__PURE__ */ jsx231(
|
|
9609
|
+
return /* @__PURE__ */ jsx231(Fragment8, {});
|
|
9610
9610
|
}
|
|
9611
9611
|
return /* @__PURE__ */ jsxs53(Container8, { ...containerProps, children: [
|
|
9612
9612
|
/* @__PURE__ */ jsx231(
|
|
9613
9613
|
MessageIconWrapper2,
|
|
9614
9614
|
{
|
|
9615
9615
|
icon: purposeVariants3[purpose].icon,
|
|
9616
|
-
color:
|
|
9616
|
+
color: icon6[purpose].color
|
|
9617
9617
|
}
|
|
9618
9618
|
),
|
|
9619
9619
|
/* @__PURE__ */ jsx231(TextContainer2, { children: children != null ? children : /* @__PURE__ */ jsx231(Typography, { as: "span", children: message2 }) }),
|
|
@@ -9854,12 +9854,12 @@ import styled69, { css as css28 } from "styled-components";
|
|
|
9854
9854
|
|
|
9855
9855
|
// src/components/Pagination/Pagination.tokens.tsx
|
|
9856
9856
|
import { ddsBaseTokens as ddsBaseTokens48 } from "@norges-domstoler/dds-design-tokens";
|
|
9857
|
-
var { spacing: spacing28, colors:
|
|
9857
|
+
var { spacing: spacing28, colors: colors24 } = ddsBaseTokens48;
|
|
9858
9858
|
var list7 = {
|
|
9859
9859
|
gap: spacing28.SizesDdsSpacingX075
|
|
9860
9860
|
};
|
|
9861
9861
|
var truncationIcon = {
|
|
9862
|
-
color:
|
|
9862
|
+
color: colors24.DdsColorNeutralsGray7
|
|
9863
9863
|
};
|
|
9864
9864
|
var outerContainer3 = {
|
|
9865
9865
|
gap: spacing28.SizesDdsSpacingX075
|
|
@@ -9921,7 +9921,7 @@ import {
|
|
|
9921
9921
|
ddsBaseTokens as ddsBaseTokens49,
|
|
9922
9922
|
ddsReferenceTokens as ddsReferenceTokens6
|
|
9923
9923
|
} from "@norges-domstoler/dds-design-tokens";
|
|
9924
|
-
var { colors:
|
|
9924
|
+
var { colors: colors25, spacing: spacing29, borderRadius: borderRadius7, border: border12 } = ddsBaseTokens49;
|
|
9925
9925
|
var { textDefault: textDefault5 } = ddsReferenceTokens6;
|
|
9926
9926
|
var placeholderTypographyTypes = {
|
|
9927
9927
|
medium: "supportingStylePlaceholderText01",
|
|
@@ -9944,12 +9944,12 @@ var typographyTypes3 = {
|
|
|
9944
9944
|
var control = {
|
|
9945
9945
|
borderRadius: borderRadius7.RadiiDdsBorderRadius1Radius,
|
|
9946
9946
|
border: `${border12.BordersDdsBorderStyleLightStrokeWeight} solid`,
|
|
9947
|
-
borderColor:
|
|
9948
|
-
backgroundColor:
|
|
9949
|
-
color:
|
|
9947
|
+
borderColor: colors25.DdsColorNeutralsGray5,
|
|
9948
|
+
backgroundColor: colors25.DdsColorNeutralsWhite,
|
|
9949
|
+
color: colors25.DdsColorNeutralsGray9,
|
|
9950
9950
|
disabled: {
|
|
9951
|
-
backgroundColor:
|
|
9952
|
-
borderColor:
|
|
9951
|
+
backgroundColor: colors25.DdsColorNeutralsGray1,
|
|
9952
|
+
borderColor: colors25.DdsColorNeutralsGray5
|
|
9953
9953
|
},
|
|
9954
9954
|
readOnly: {
|
|
9955
9955
|
borderColor: "transparent",
|
|
@@ -9982,14 +9982,14 @@ var control = {
|
|
|
9982
9982
|
}
|
|
9983
9983
|
};
|
|
9984
9984
|
var placeholder = {
|
|
9985
|
-
color:
|
|
9985
|
+
color: colors25.DdsColorNeutralsGray6
|
|
9986
9986
|
};
|
|
9987
9987
|
var dropdownIndicator = {
|
|
9988
9988
|
base: {
|
|
9989
|
-
color:
|
|
9989
|
+
color: colors25.DdsColorNeutralsGray6
|
|
9990
9990
|
},
|
|
9991
9991
|
hover: {
|
|
9992
|
-
color:
|
|
9992
|
+
color: colors25.DdsColorInteractiveBase
|
|
9993
9993
|
},
|
|
9994
9994
|
readOnly: {
|
|
9995
9995
|
color: "transparent"
|
|
@@ -9997,23 +9997,23 @@ var dropdownIndicator = {
|
|
|
9997
9997
|
};
|
|
9998
9998
|
var clearIndicator = {
|
|
9999
9999
|
base: {
|
|
10000
|
-
color:
|
|
10000
|
+
color: colors25.DdsColorNeutralsGray6
|
|
10001
10001
|
},
|
|
10002
|
-
hover: { color:
|
|
10002
|
+
hover: { color: colors25.DdsColorInteractiveBase }
|
|
10003
10003
|
};
|
|
10004
10004
|
var loadingIndicator = {
|
|
10005
|
-
color:
|
|
10005
|
+
color: colors25.DdsColorNeutralsGray6
|
|
10006
10006
|
};
|
|
10007
10007
|
var menu = {
|
|
10008
10008
|
border: "1px solid",
|
|
10009
|
-
borderColor:
|
|
10010
|
-
backgroundColor:
|
|
10009
|
+
borderColor: colors25.DdsColorInteractiveBase,
|
|
10010
|
+
backgroundColor: colors25.DdsColorNeutralsWhite,
|
|
10011
10011
|
borderRadius: borderRadius7.RadiiDdsBorderRadius1Radius,
|
|
10012
10012
|
marginTop: spacing29.SizesDdsSpacingX025,
|
|
10013
10013
|
marginBottom: spacing29.SizesDdsSpacingX025
|
|
10014
10014
|
};
|
|
10015
10015
|
var groupHeading = {
|
|
10016
|
-
color:
|
|
10016
|
+
color: colors25.DdsColorNeutralsGray7,
|
|
10017
10017
|
padding: `${spacing29.SizesDdsSpacingX05} ${spacing29.SizesDdsSpacingX075} ${spacing29.SizesDdsSpacingX0125} ${spacing29.SizesDdsSpacingX075}`
|
|
10018
10018
|
};
|
|
10019
10019
|
var option = {
|
|
@@ -10021,44 +10021,44 @@ var option = {
|
|
|
10021
10021
|
color: textDefault5.textColor,
|
|
10022
10022
|
gap: spacing29.SizesDdsSpacingX05,
|
|
10023
10023
|
padding: `${spacing29.SizesDdsSpacingX075}`,
|
|
10024
|
-
backgroundColor:
|
|
10024
|
+
backgroundColor: colors25.DdsColorNeutralsWhite
|
|
10025
10025
|
},
|
|
10026
10026
|
hover: {
|
|
10027
10027
|
color: textDefault5.textColor,
|
|
10028
|
-
backgroundColor:
|
|
10028
|
+
backgroundColor: colors25.DdsColorInteractiveLightest
|
|
10029
10029
|
},
|
|
10030
10030
|
focus: {
|
|
10031
10031
|
color: textDefault5.textColor,
|
|
10032
|
-
backgroundColor:
|
|
10032
|
+
backgroundColor: colors25.DdsColorInteractiveLightest
|
|
10033
10033
|
},
|
|
10034
10034
|
selected: {
|
|
10035
10035
|
color: textDefault5.textColor,
|
|
10036
|
-
backgroundColor:
|
|
10036
|
+
backgroundColor: colors25.DdsColorNeutralsWhite
|
|
10037
10037
|
}
|
|
10038
10038
|
};
|
|
10039
10039
|
var noOptionsMessage = {
|
|
10040
10040
|
padding: `${spacing29.SizesDdsSpacingX05} ${spacing29.SizesDdsSpacingX1}`,
|
|
10041
|
-
color:
|
|
10041
|
+
color: colors25.DdsColorNeutralsGray6
|
|
10042
10042
|
};
|
|
10043
10043
|
var multiValue = {
|
|
10044
10044
|
borderRadius: borderRadius7.RadiiDdsBorderRadius1Radius,
|
|
10045
|
-
backgroundColor:
|
|
10045
|
+
backgroundColor: colors25.DdsColorNeutralsGray2
|
|
10046
10046
|
};
|
|
10047
10047
|
var multiValueLabel = {
|
|
10048
10048
|
padding: `0 ${spacing29.SizesDdsSpacingX025}`,
|
|
10049
|
-
color:
|
|
10049
|
+
color: colors25.DdsColorNeutralsGray9
|
|
10050
10050
|
};
|
|
10051
10051
|
var multiValueRemove = {
|
|
10052
10052
|
base: {
|
|
10053
|
-
color:
|
|
10053
|
+
color: colors25.DdsColorNeutralsGray9,
|
|
10054
10054
|
padding: `0 ${spacing29.SizesDdsSpacingX025}`,
|
|
10055
10055
|
borderTopRightRadius: borderRadius7.RadiiDdsBorderRadius1Radius,
|
|
10056
10056
|
borderBottomRightRadius: borderRadius7.RadiiDdsBorderRadius1Radius
|
|
10057
10057
|
},
|
|
10058
10058
|
hover: {
|
|
10059
|
-
color:
|
|
10060
|
-
backgroundColor:
|
|
10061
|
-
boxShadow: `inset 0 0 0 1px ${
|
|
10059
|
+
color: colors25.DdsColorNeutralsWhite,
|
|
10060
|
+
backgroundColor: colors25.DdsColorInteractiveBase,
|
|
10061
|
+
boxShadow: `inset 0 0 0 1px ${colors25.DdsColorNeutralsGray9}`
|
|
10062
10062
|
}
|
|
10063
10063
|
};
|
|
10064
10064
|
var valueContainer = {
|
|
@@ -10066,7 +10066,7 @@ var valueContainer = {
|
|
|
10066
10066
|
gap: spacing29.SizesDdsSpacingX025
|
|
10067
10067
|
}
|
|
10068
10068
|
};
|
|
10069
|
-
var
|
|
10069
|
+
var icon7 = {
|
|
10070
10070
|
marginRight: spacing29.SizesDdsSpacingX05
|
|
10071
10071
|
};
|
|
10072
10072
|
var selectTokens = {
|
|
@@ -10083,7 +10083,7 @@ var selectTokens = {
|
|
|
10083
10083
|
noOptionsMessage,
|
|
10084
10084
|
clearIndicator,
|
|
10085
10085
|
loadingIndicator,
|
|
10086
|
-
icon:
|
|
10086
|
+
icon: icon7
|
|
10087
10087
|
};
|
|
10088
10088
|
|
|
10089
10089
|
// src/components/Select/Select.styles.ts
|
|
@@ -10100,7 +10100,7 @@ var {
|
|
|
10100
10100
|
multiValueRemove: multiValueRemove2,
|
|
10101
10101
|
noOptionsMessage: noOptionsMessage2,
|
|
10102
10102
|
placeholder: placeholder2,
|
|
10103
|
-
icon:
|
|
10103
|
+
icon: icon8,
|
|
10104
10104
|
valueContainer: valueContainer2
|
|
10105
10105
|
} = selectTokens;
|
|
10106
10106
|
var prefix = "dds-select";
|
|
@@ -10181,8 +10181,8 @@ var InnerSingleValue = styled68.div`
|
|
|
10181
10181
|
box-sizing: border-box;
|
|
10182
10182
|
max-width: 100%;
|
|
10183
10183
|
`;
|
|
10184
|
-
var
|
|
10185
|
-
margin-right: ${
|
|
10184
|
+
var StyledIcon3 = styled68(Icon)`
|
|
10185
|
+
margin-right: ${icon8.marginRight};
|
|
10186
10186
|
`;
|
|
10187
10187
|
var getCustomStyles = (size2) => ({
|
|
10188
10188
|
control: () => ({
|
|
@@ -10377,8 +10377,8 @@ var DDSInput = (props, ariaInvalid, ariaDescribedby) => /* @__PURE__ */ jsx235(
|
|
|
10377
10377
|
"aria-describedby": ariaDescribedby
|
|
10378
10378
|
}
|
|
10379
10379
|
);
|
|
10380
|
-
var DDSControl = (props, componentSize,
|
|
10381
|
-
|
|
10380
|
+
var DDSControl = (props, componentSize, icon11) => /* @__PURE__ */ jsxs55(Control, { ...props, children: [
|
|
10381
|
+
icon11 && /* @__PURE__ */ jsx235(StyledIcon3, { icon: icon11, iconSize: getFormInputIconSize(componentSize) }),
|
|
10382
10382
|
props.children
|
|
10383
10383
|
] });
|
|
10384
10384
|
|
|
@@ -10399,7 +10399,7 @@ function SelectInner(props, ref) {
|
|
|
10399
10399
|
options,
|
|
10400
10400
|
isMulti,
|
|
10401
10401
|
value,
|
|
10402
|
-
icon:
|
|
10402
|
+
icon: icon11,
|
|
10403
10403
|
defaultValue,
|
|
10404
10404
|
width = defaultWidth4,
|
|
10405
10405
|
closeMenuOnSelect,
|
|
@@ -10463,7 +10463,7 @@ function SelectInner(props, ref) {
|
|
|
10463
10463
|
ClearIndicator: (props2) => DDSClearIndicator(props2, componentSize),
|
|
10464
10464
|
DropdownIndicator: (props2) => DDSDropdownIndicator(props2, componentSize),
|
|
10465
10465
|
MultiValueRemove: DDSMultiValueRemove,
|
|
10466
|
-
Control: (props2) => DDSControl(props2, componentSize,
|
|
10466
|
+
Control: (props2) => DDSControl(props2, componentSize, icon11)
|
|
10467
10467
|
},
|
|
10468
10468
|
"aria-invalid": hasErrorMessage ? true : void 0,
|
|
10469
10469
|
required,
|
|
@@ -10485,7 +10485,7 @@ var createSelectOptions = (...args) => args.map((v) => ({ label: v, value: v }))
|
|
|
10485
10485
|
// src/components/Pagination/Pagination.tsx
|
|
10486
10486
|
import { jsx as jsx237, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
10487
10487
|
var { outerContainer: outerContainer4, indicatorsContainer: indicatorsContainer2, truncationIcon: truncationIcon2, list: list8 } = paginationTokens;
|
|
10488
|
-
var
|
|
10488
|
+
var Nav = styled69.nav`
|
|
10489
10489
|
display: flex;
|
|
10490
10490
|
align-items: center;
|
|
10491
10491
|
`;
|
|
@@ -10618,12 +10618,12 @@ var Pagination = forwardRef47(
|
|
|
10618
10618
|
};
|
|
10619
10619
|
const isOnFirstPage = activePage === 1;
|
|
10620
10620
|
const isOnLastPage = activePage === pagesLength;
|
|
10621
|
-
const navigation2 = withPagination ? /* @__PURE__ */ jsx237(
|
|
10621
|
+
const navigation2 = withPagination ? /* @__PURE__ */ jsx237(Nav, { ref, "aria-label": "paginering", ...navProps, children: /* @__PURE__ */ jsxs57(List3, { children: [
|
|
10622
10622
|
/* @__PURE__ */ jsx237(ListItem3, { $isHidden: isOnFirstPage, "aria-hidden": isOnFirstPage, children: previousPageButton }),
|
|
10623
10623
|
listItems,
|
|
10624
10624
|
/* @__PURE__ */ jsx237(ListItem3, { $isHidden: isOnLastPage, "aria-hidden": isOnLastPage, children: nextPageButton })
|
|
10625
10625
|
] }) }) : null;
|
|
10626
|
-
const smallScreenNavigation = withPagination ? /* @__PURE__ */ jsx237(
|
|
10626
|
+
const smallScreenNavigation = withPagination ? /* @__PURE__ */ jsx237(Nav, { ref, "aria-label": "paginering", ...navProps, children: /* @__PURE__ */ jsxs57(List3, { children: [
|
|
10627
10627
|
/* @__PURE__ */ jsx237(ListItem3, { $isHidden: isOnFirstPage, "aria-hidden": isOnFirstPage, children: /* @__PURE__ */ jsx237(
|
|
10628
10628
|
Button,
|
|
10629
10629
|
{
|
|
@@ -10849,12 +10849,12 @@ Popover.displayName = "Popover";
|
|
|
10849
10849
|
import {
|
|
10850
10850
|
Children as ReactChildren4,
|
|
10851
10851
|
cloneElement as cloneElement5,
|
|
10852
|
-
isValidElement as
|
|
10852
|
+
isValidElement as isValidElement6,
|
|
10853
10853
|
useId as useId15,
|
|
10854
10854
|
useRef as useRef28,
|
|
10855
10855
|
useState as useState21
|
|
10856
10856
|
} from "react";
|
|
10857
|
-
import { Fragment as
|
|
10857
|
+
import { Fragment as Fragment9, jsx as jsx239 } from "react/jsx-runtime";
|
|
10858
10858
|
var PopoverGroup = ({
|
|
10859
10859
|
isOpen = false,
|
|
10860
10860
|
onCloseButtonClick,
|
|
@@ -10884,7 +10884,7 @@ var PopoverGroup = ({
|
|
|
10884
10884
|
});
|
|
10885
10885
|
const handleClose = () => setOpen(false);
|
|
10886
10886
|
const Children9 = ReactChildren4.map(children, (child, childIndex) => {
|
|
10887
|
-
return
|
|
10887
|
+
return isValidElement6(child) && (childIndex === 0 ? cloneElement5(child, {
|
|
10888
10888
|
"aria-haspopup": "dialog",
|
|
10889
10889
|
"aria-controls": uniquePopoverId,
|
|
10890
10890
|
"aria-expanded": open,
|
|
@@ -10900,17 +10900,17 @@ var PopoverGroup = ({
|
|
|
10900
10900
|
onClose: handleClose
|
|
10901
10901
|
}));
|
|
10902
10902
|
});
|
|
10903
|
-
return /* @__PURE__ */ jsx239(
|
|
10903
|
+
return /* @__PURE__ */ jsx239(Fragment9, { children: Children9 });
|
|
10904
10904
|
};
|
|
10905
10905
|
PopoverGroup.displayName = "PopoverGroup";
|
|
10906
10906
|
|
|
10907
10907
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
10908
10908
|
import {
|
|
10909
10909
|
Children as Children5,
|
|
10910
|
-
Fragment as
|
|
10910
|
+
Fragment as Fragment10,
|
|
10911
10911
|
cloneElement as cloneElement6,
|
|
10912
10912
|
forwardRef as forwardRef49,
|
|
10913
|
-
isValidElement as
|
|
10913
|
+
isValidElement as isValidElement7,
|
|
10914
10914
|
useEffect as useEffect23,
|
|
10915
10915
|
useMemo as useMemo3,
|
|
10916
10916
|
useState as useState22
|
|
@@ -10928,7 +10928,7 @@ var useProgressTrackerContext = () => useContext5(ProgressTrackerContext);
|
|
|
10928
10928
|
|
|
10929
10929
|
// src/components/ProgressTracker/ProgressTracker.tokens.tsx
|
|
10930
10930
|
import { ddsBaseTokens as ddsBaseTokens52 } from "@norges-domstoler/dds-design-tokens";
|
|
10931
|
-
var { colors:
|
|
10931
|
+
var { colors: colors26, spacing: spacing31 } = ddsBaseTokens52;
|
|
10932
10932
|
var typographyTypes4 = {
|
|
10933
10933
|
number: "bodySans01",
|
|
10934
10934
|
label: "bodySans03"
|
|
@@ -10940,7 +10940,7 @@ var itemContentWrapper = {
|
|
|
10940
10940
|
gap: spacing31.SizesDdsSpacingX05
|
|
10941
10941
|
};
|
|
10942
10942
|
var connector = {
|
|
10943
|
-
color:
|
|
10943
|
+
color: colors26.DdsColorNeutralsGray5,
|
|
10944
10944
|
height: "18px",
|
|
10945
10945
|
width: "1px"
|
|
10946
10946
|
};
|
|
@@ -10949,87 +10949,87 @@ var itemNumber = {
|
|
|
10949
10949
|
borderWidth: "2px",
|
|
10950
10950
|
iconSize: "small",
|
|
10951
10951
|
activeIncomplete: {
|
|
10952
|
-
borderColor:
|
|
10953
|
-
color:
|
|
10954
|
-
backgroundColor:
|
|
10952
|
+
borderColor: colors26.DdsColorInteractiveBase,
|
|
10953
|
+
color: colors26.DdsColorNeutralsWhite,
|
|
10954
|
+
backgroundColor: colors26.DdsColorInteractiveBase,
|
|
10955
10955
|
hover: {
|
|
10956
|
-
borderColor:
|
|
10957
|
-
color:
|
|
10958
|
-
backgroundColor:
|
|
10956
|
+
borderColor: colors26.DdsColorInteractiveBase,
|
|
10957
|
+
color: colors26.DdsColorNeutralsWhite,
|
|
10958
|
+
backgroundColor: colors26.DdsColorInteractiveBase
|
|
10959
10959
|
}
|
|
10960
10960
|
},
|
|
10961
10961
|
activeCompleted: {
|
|
10962
|
-
borderColor:
|
|
10963
|
-
color:
|
|
10964
|
-
backgroundColor:
|
|
10962
|
+
borderColor: colors26.DdsColorInteractiveBase,
|
|
10963
|
+
color: colors26.DdsColorNeutralsWhite,
|
|
10964
|
+
backgroundColor: colors26.DdsColorInteractiveBase,
|
|
10965
10965
|
hover: {
|
|
10966
|
-
borderColor:
|
|
10967
|
-
color:
|
|
10968
|
-
backgroundColor:
|
|
10966
|
+
borderColor: colors26.DdsColorInteractiveDark,
|
|
10967
|
+
color: colors26.DdsColorNeutralsWhite,
|
|
10968
|
+
backgroundColor: colors26.DdsColorInteractiveDark
|
|
10969
10969
|
}
|
|
10970
10970
|
},
|
|
10971
10971
|
inactiveCompleted: {
|
|
10972
|
-
borderColor:
|
|
10973
|
-
color:
|
|
10974
|
-
backgroundColor:
|
|
10972
|
+
borderColor: colors26.DdsColorInteractiveBase,
|
|
10973
|
+
color: colors26.DdsColorNeutralsWhite,
|
|
10974
|
+
backgroundColor: colors26.DdsColorInteractiveBase,
|
|
10975
10975
|
hover: {
|
|
10976
|
-
borderColor:
|
|
10977
|
-
color:
|
|
10978
|
-
backgroundColor:
|
|
10976
|
+
borderColor: colors26.DdsColorInteractiveDark,
|
|
10977
|
+
color: colors26.DdsColorNeutralsWhite,
|
|
10978
|
+
backgroundColor: colors26.DdsColorInteractiveDark
|
|
10979
10979
|
}
|
|
10980
10980
|
},
|
|
10981
10981
|
inactiveIncomplete: {
|
|
10982
|
-
borderColor:
|
|
10983
|
-
color:
|
|
10984
|
-
backgroundColor:
|
|
10982
|
+
borderColor: colors26.DdsColorInteractiveBase,
|
|
10983
|
+
color: colors26.DdsColorInteractiveBase,
|
|
10984
|
+
backgroundColor: colors26.DdsColorNeutralsWhite,
|
|
10985
10985
|
hover: {
|
|
10986
|
-
borderColor:
|
|
10987
|
-
color:
|
|
10988
|
-
backgroundColor:
|
|
10986
|
+
borderColor: colors26.DdsColorInteractiveBase,
|
|
10987
|
+
color: colors26.DdsColorInteractiveBase,
|
|
10988
|
+
backgroundColor: colors26.DdsColorInteractiveLightest
|
|
10989
10989
|
}
|
|
10990
10990
|
},
|
|
10991
10991
|
disabled: {
|
|
10992
|
-
borderColor:
|
|
10993
|
-
color:
|
|
10994
|
-
backgroundColor:
|
|
10992
|
+
borderColor: colors26.DdsColorNeutralsGray5,
|
|
10993
|
+
color: colors26.DdsColorNeutralsGray5,
|
|
10994
|
+
backgroundColor: colors26.DdsColorNeutralsWhite
|
|
10995
10995
|
}
|
|
10996
10996
|
};
|
|
10997
10997
|
var itemText = {
|
|
10998
10998
|
textDecoration: "underline",
|
|
10999
10999
|
activeCompleted: {
|
|
11000
|
-
color:
|
|
11000
|
+
color: colors26.DdsColorInteractiveBase,
|
|
11001
11001
|
textDecorationColor: "transparent",
|
|
11002
11002
|
hover: {
|
|
11003
|
-
color:
|
|
11003
|
+
color: colors26.DdsColorInteractiveBase,
|
|
11004
11004
|
textDecorationColor: "transparent"
|
|
11005
11005
|
}
|
|
11006
11006
|
},
|
|
11007
11007
|
activeIncomplete: {
|
|
11008
|
-
color:
|
|
11008
|
+
color: colors26.DdsColorInteractiveBase,
|
|
11009
11009
|
textDecorationColor: "transparent",
|
|
11010
11010
|
hover: {
|
|
11011
|
-
color:
|
|
11011
|
+
color: colors26.DdsColorInteractiveBase,
|
|
11012
11012
|
textDecorationColor: "transparent"
|
|
11013
11013
|
}
|
|
11014
11014
|
},
|
|
11015
11015
|
inactiveIncomplete: {
|
|
11016
|
-
color:
|
|
11017
|
-
textDecorationColor:
|
|
11016
|
+
color: colors26.DdsColorNeutralsGray7,
|
|
11017
|
+
textDecorationColor: colors26.DdsColorNeutralsGray7,
|
|
11018
11018
|
hover: {
|
|
11019
|
-
color:
|
|
11020
|
-
textDecorationColor:
|
|
11019
|
+
color: colors26.DdsColorInteractiveBase,
|
|
11020
|
+
textDecorationColor: colors26.DdsColorInteractiveBase
|
|
11021
11021
|
}
|
|
11022
11022
|
},
|
|
11023
11023
|
inactiveCompleted: {
|
|
11024
|
-
color:
|
|
11025
|
-
textDecorationColor:
|
|
11024
|
+
color: colors26.DdsColorNeutralsGray7,
|
|
11025
|
+
textDecorationColor: colors26.DdsColorNeutralsGray7,
|
|
11026
11026
|
hover: {
|
|
11027
|
-
color:
|
|
11028
|
-
textDecorationColor:
|
|
11027
|
+
color: colors26.DdsColorInteractiveBase,
|
|
11028
|
+
textDecorationColor: colors26.DdsColorInteractiveBase
|
|
11029
11029
|
}
|
|
11030
11030
|
},
|
|
11031
11031
|
disabled: {
|
|
11032
|
-
color:
|
|
11032
|
+
color: colors26.DdsColorNeutralsGray6,
|
|
11033
11033
|
textDecorationColor: "transparent"
|
|
11034
11034
|
}
|
|
11035
11035
|
};
|
|
@@ -11131,7 +11131,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
11131
11131
|
index = 0,
|
|
11132
11132
|
completed = false,
|
|
11133
11133
|
disabled = false,
|
|
11134
|
-
icon:
|
|
11134
|
+
icon: icon11,
|
|
11135
11135
|
children
|
|
11136
11136
|
} = props;
|
|
11137
11137
|
const { activeStep, handleStepChange } = useProgressTrackerContext();
|
|
@@ -11143,11 +11143,11 @@ var ProgressTrackerItem = (props) => {
|
|
|
11143
11143
|
if (completed) {
|
|
11144
11144
|
return /* @__PURE__ */ jsx240(Icon, { icon: CheckIcon, iconSize: itemNumber2.iconSize });
|
|
11145
11145
|
}
|
|
11146
|
-
if (
|
|
11147
|
-
return /* @__PURE__ */ jsx240(Icon, { icon:
|
|
11146
|
+
if (icon11 !== void 0) {
|
|
11147
|
+
return /* @__PURE__ */ jsx240(Icon, { icon: icon11, iconSize: itemNumber2.iconSize });
|
|
11148
11148
|
}
|
|
11149
11149
|
return index + 1;
|
|
11150
|
-
}, [completed,
|
|
11150
|
+
}, [completed, icon11, index]);
|
|
11151
11151
|
return /* @__PURE__ */ jsx240(ItemWrapper, { "aria-current": active ? "step" : void 0, children: /* @__PURE__ */ jsxs59(
|
|
11152
11152
|
ItemContentWrapper,
|
|
11153
11153
|
{
|
|
@@ -11233,7 +11233,7 @@ var ProgressTracker = (() => {
|
|
|
11233
11233
|
return Res;
|
|
11234
11234
|
})();
|
|
11235
11235
|
function removeInvalidChildren(children) {
|
|
11236
|
-
return Children5.toArray(children).filter(
|
|
11236
|
+
return Children5.toArray(children).filter(isValidElement7);
|
|
11237
11237
|
}
|
|
11238
11238
|
function passIndexPropToProgressTrackerItem(children) {
|
|
11239
11239
|
return Children5.map(
|
|
@@ -11248,7 +11248,7 @@ var intersperseItemsWithConnector = (children) => Children5.map(children, (child
|
|
|
11248
11248
|
if (index === 0) {
|
|
11249
11249
|
return child;
|
|
11250
11250
|
}
|
|
11251
|
-
return /* @__PURE__ */ jsxs60(
|
|
11251
|
+
return /* @__PURE__ */ jsxs60(Fragment10, { children: [
|
|
11252
11252
|
/* @__PURE__ */ jsx241(ProgressTrackerConnector, { "aria-hidden": true }),
|
|
11253
11253
|
child
|
|
11254
11254
|
] }, index);
|
|
@@ -11277,7 +11277,7 @@ import {
|
|
|
11277
11277
|
ddsBaseTokens as ddsBaseTokens53,
|
|
11278
11278
|
ddsReferenceTokens as ddsReferenceTokens7
|
|
11279
11279
|
} from "@norges-domstoler/dds-design-tokens";
|
|
11280
|
-
var { spacing: spacing32, iconSizes: iconSizes2, colors:
|
|
11280
|
+
var { spacing: spacing32, iconSizes: iconSizes2, colors: colors27 } = ddsBaseTokens53;
|
|
11281
11281
|
var { textDefault: textDefault6 } = ddsReferenceTokens7;
|
|
11282
11282
|
var typographyTypes5 = {
|
|
11283
11283
|
small: "bodySans01",
|
|
@@ -11339,8 +11339,8 @@ var clearButton = {
|
|
|
11339
11339
|
};
|
|
11340
11340
|
var suggestionsContainer = {
|
|
11341
11341
|
marginTop: spacing32.SizesDdsSpacingX025,
|
|
11342
|
-
border: `1px solid ${
|
|
11343
|
-
boxShadow: `0 0 0 1px ${
|
|
11342
|
+
border: `1px solid ${colors27.DdsColorInteractiveBase}`,
|
|
11343
|
+
boxShadow: `0 0 0 1px ${colors27.DdsColorInteractiveBase}`
|
|
11344
11344
|
};
|
|
11345
11345
|
var suggestionsHeader = {
|
|
11346
11346
|
paddingLeft: spacing32.SizesDdsSpacingX1
|
|
@@ -11426,7 +11426,7 @@ var SearchSuggestions = forwardRef50((props, ref) => {
|
|
|
11426
11426
|
searchId,
|
|
11427
11427
|
"suggestions-header"
|
|
11428
11428
|
);
|
|
11429
|
-
const [focus
|
|
11429
|
+
const [focus] = useRoveFocus(suggestions == null ? void 0 : suggestions.length, showSuggestions);
|
|
11430
11430
|
const suggestionsToRender = maxSuggestions ? suggestions == null ? void 0 : suggestions.slice(maxSuggestions) : suggestions;
|
|
11431
11431
|
const renderedSuggestions = /* @__PURE__ */ jsx242(SuggestionsList, { role: "listbox", "aria-labelledby": suggestionsHeaderId, children: suggestionsToRender.map((suggestion, index) => {
|
|
11432
11432
|
return /* @__PURE__ */ jsx242("li", { role: "option", children: /* @__PURE__ */ jsx242(
|
|
@@ -11434,7 +11434,6 @@ var SearchSuggestions = forwardRef50((props, ref) => {
|
|
|
11434
11434
|
{
|
|
11435
11435
|
index,
|
|
11436
11436
|
focus: focus === index && showSuggestions,
|
|
11437
|
-
setFocus,
|
|
11438
11437
|
"aria-label": `s\xF8k p\xE5 ${suggestion}`,
|
|
11439
11438
|
onClick: onSuggestionClick,
|
|
11440
11439
|
title: suggestion,
|
|
@@ -11470,7 +11469,7 @@ var SearchSuggestions = forwardRef50((props, ref) => {
|
|
|
11470
11469
|
SearchSuggestions.displayName = "SearchSuggestions";
|
|
11471
11470
|
|
|
11472
11471
|
// src/components/Search/Search.tsx
|
|
11473
|
-
import { Fragment as
|
|
11472
|
+
import { Fragment as Fragment11, jsx as jsx243, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
11474
11473
|
var { input: input4, outerContainer: outerContainer6, horisontalContainer: horisontalContainer2, searchIcon: searchIcon2, clearButton: clearButton2 } = searchTokens;
|
|
11475
11474
|
var getIconSize = (size2) => {
|
|
11476
11475
|
switch (size2) {
|
|
@@ -11615,7 +11614,7 @@ var Search = forwardRef51(
|
|
|
11615
11614
|
role: hasSuggestions ? "combobox" : void 0
|
|
11616
11615
|
}
|
|
11617
11616
|
),
|
|
11618
|
-
hasSuggestions && /* @__PURE__ */ jsxs62(
|
|
11617
|
+
hasSuggestions && /* @__PURE__ */ jsxs62(Fragment11, { children: [
|
|
11619
11618
|
/* @__PURE__ */ jsx243(
|
|
11620
11619
|
SearchSuggestions,
|
|
11621
11620
|
{
|
|
@@ -11778,13 +11777,13 @@ var selectionControlTypographyProps = {
|
|
|
11778
11777
|
};
|
|
11779
11778
|
|
|
11780
11779
|
// src/components/SelectionControl/SelectionControl.tokens.tsx
|
|
11781
|
-
var { colors:
|
|
11780
|
+
var { colors: colors28, spacing: spacing33, borderRadius: borderRadius8 } = ddsBaseTokens54;
|
|
11782
11781
|
var checkmark = {
|
|
11783
11782
|
checkbox: {
|
|
11784
|
-
borderColor:
|
|
11783
|
+
borderColor: colors28.DdsColorNeutralsWhite
|
|
11785
11784
|
},
|
|
11786
11785
|
radio: {
|
|
11787
|
-
backgroundColor:
|
|
11786
|
+
backgroundColor: colors28.DdsColorNeutralsWhite,
|
|
11788
11787
|
height: spacing33.SizesDdsSpacingX05,
|
|
11789
11788
|
width: spacing33.SizesDdsSpacingX05,
|
|
11790
11789
|
left: `calc(50% - ${spacing33.SizesDdsSpacingX05NumberPx / 2}px)`,
|
|
@@ -11794,20 +11793,20 @@ var checkmark = {
|
|
|
11794
11793
|
var selectionControl = {
|
|
11795
11794
|
base: {
|
|
11796
11795
|
border: "1px solid",
|
|
11797
|
-
borderColor:
|
|
11798
|
-
backgroundColor:
|
|
11796
|
+
borderColor: colors28.DdsColorNeutralsGray5,
|
|
11797
|
+
backgroundColor: colors28.DdsColorNeutralsWhite,
|
|
11799
11798
|
borderRadius: borderRadius8.RadiiDdsBorderRadius1Radius,
|
|
11800
11799
|
height: selectionControlSize,
|
|
11801
11800
|
width: selectionControlSize
|
|
11802
11801
|
},
|
|
11803
11802
|
hover: {
|
|
11804
11803
|
base: {
|
|
11805
|
-
backgroundColor:
|
|
11804
|
+
backgroundColor: colors28.DdsColorInteractiveLightest,
|
|
11806
11805
|
boxShadow: `inset 0 0 0 1px ${hoverInputfield.borderColor}`,
|
|
11807
11806
|
borderColor: hoverInputfield.borderColor
|
|
11808
11807
|
},
|
|
11809
11808
|
danger: {
|
|
11810
|
-
backgroundColor:
|
|
11809
|
+
backgroundColor: colors28.DdsColorDangerLightest,
|
|
11811
11810
|
boxShadow: `inset 0 0 0 1px ${dangerInputfield.borderColor}`,
|
|
11812
11811
|
borderColor: dangerInputfield.borderColor
|
|
11813
11812
|
}
|
|
@@ -11817,39 +11816,39 @@ var selectionControl = {
|
|
|
11817
11816
|
borderColor: dangerInputfield.borderColor
|
|
11818
11817
|
},
|
|
11819
11818
|
disabled: {
|
|
11820
|
-
borderColor:
|
|
11819
|
+
borderColor: colors28.DdsColorNeutralsGray5
|
|
11821
11820
|
},
|
|
11822
11821
|
readOnly: { backgroundColor: "transparent" },
|
|
11823
11822
|
checked: {
|
|
11824
11823
|
base: {
|
|
11825
|
-
borderColor:
|
|
11826
|
-
backgroundColor:
|
|
11824
|
+
borderColor: colors28.DdsColorInteractiveBase,
|
|
11825
|
+
backgroundColor: colors28.DdsColorInteractiveBase
|
|
11827
11826
|
},
|
|
11828
11827
|
hover: {
|
|
11829
|
-
backgroundColor:
|
|
11830
|
-
boxShadow: `inset 0 0 0 1px ${
|
|
11831
|
-
borderColor:
|
|
11828
|
+
backgroundColor: colors28.DdsColorInteractiveDark,
|
|
11829
|
+
boxShadow: `inset 0 0 0 1px ${colors28.DdsColorInteractiveDark}`,
|
|
11830
|
+
borderColor: colors28.DdsColorInteractiveDark
|
|
11832
11831
|
},
|
|
11833
11832
|
disabled: {
|
|
11834
|
-
borderColor:
|
|
11835
|
-
backgroundColor:
|
|
11833
|
+
borderColor: colors28.DdsColorNeutralsGray6,
|
|
11834
|
+
backgroundColor: colors28.DdsColorNeutralsGray6
|
|
11836
11835
|
},
|
|
11837
11836
|
readOnly: {
|
|
11838
|
-
borderColor:
|
|
11839
|
-
backgroundColor:
|
|
11837
|
+
borderColor: colors28.DdsColorNeutralsGray6,
|
|
11838
|
+
backgroundColor: colors28.DdsColorNeutralsGray6
|
|
11840
11839
|
}
|
|
11841
11840
|
},
|
|
11842
11841
|
checkbox: {
|
|
11843
11842
|
indeterminate: {
|
|
11844
|
-
borderColor:
|
|
11845
|
-
backgroundColor:
|
|
11843
|
+
borderColor: colors28.DdsColorInteractiveBase,
|
|
11844
|
+
backgroundColor: colors28.DdsColorInteractiveBase
|
|
11846
11845
|
}
|
|
11847
11846
|
}
|
|
11848
11847
|
};
|
|
11849
11848
|
var container13 = {
|
|
11850
|
-
color:
|
|
11849
|
+
color: colors28.DdsColorNeutralsGray9,
|
|
11851
11850
|
disabled: {
|
|
11852
|
-
color:
|
|
11851
|
+
color: colors28.DdsColorNeutralsGray6
|
|
11853
11852
|
},
|
|
11854
11853
|
withLabel: {
|
|
11855
11854
|
paddingLeft: `${selectionControlSizeNumberPx + spacing33.SizesDdsSpacingX05NumberPx}px`
|
|
@@ -12372,27 +12371,27 @@ import styled76 from "styled-components";
|
|
|
12372
12371
|
|
|
12373
12372
|
// src/components/SkipToContent/SkipToContent.tokens.tsx
|
|
12374
12373
|
import { ddsBaseTokens as ddsBaseTokens55 } from "@norges-domstoler/dds-design-tokens";
|
|
12375
|
-
var { colors:
|
|
12376
|
-
var
|
|
12374
|
+
var { colors: colors29, spacing: spacing34 } = ddsBaseTokens55;
|
|
12375
|
+
var link4 = {
|
|
12377
12376
|
base: {
|
|
12378
|
-
color:
|
|
12377
|
+
color: colors29.DdsColorNeutralsWhite
|
|
12379
12378
|
},
|
|
12380
12379
|
hover: {
|
|
12381
|
-
color:
|
|
12380
|
+
color: colors29.DdsColorNeutralsWhite
|
|
12382
12381
|
}
|
|
12383
12382
|
};
|
|
12384
12383
|
var wrapper5 = {
|
|
12385
|
-
backgroundColor:
|
|
12384
|
+
backgroundColor: colors29.DdsColorPrimaryBase,
|
|
12386
12385
|
padding: spacing34.SizesDdsSpacingX025
|
|
12387
12386
|
};
|
|
12388
12387
|
var skipToContentTokens = {
|
|
12389
|
-
link:
|
|
12388
|
+
link: link4,
|
|
12390
12389
|
wrapper: wrapper5
|
|
12391
12390
|
};
|
|
12392
12391
|
|
|
12393
12392
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
12394
12393
|
import { jsx as jsx249 } from "react/jsx-runtime";
|
|
12395
|
-
var { wrapper: wrapper6, link:
|
|
12394
|
+
var { wrapper: wrapper6, link: link5 } = skipToContentTokens;
|
|
12396
12395
|
var Wrapper5 = styled76.div`
|
|
12397
12396
|
box-sizing: border-box;
|
|
12398
12397
|
position: absolute;
|
|
@@ -12422,7 +12421,7 @@ var Wrapper5 = styled76.div`
|
|
|
12422
12421
|
`;
|
|
12423
12422
|
var Link4 = styled76.a`
|
|
12424
12423
|
text-decoration: none;
|
|
12425
|
-
color: ${
|
|
12424
|
+
color: ${link5.base.color};
|
|
12426
12425
|
${getFontStyling(defaultTypographyType)}
|
|
12427
12426
|
|
|
12428
12427
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -12432,7 +12431,7 @@ var Link4 = styled76.a`
|
|
|
12432
12431
|
${focusVisibleOnDark}
|
|
12433
12432
|
}
|
|
12434
12433
|
&:hover {
|
|
12435
|
-
color: ${
|
|
12434
|
+
color: ${link5.base.color};
|
|
12436
12435
|
}
|
|
12437
12436
|
`;
|
|
12438
12437
|
var SkipToContent = forwardRef55(
|
|
@@ -12553,10 +12552,10 @@ SplitButton.displayName = "SplitButton";
|
|
|
12553
12552
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12554
12553
|
import {
|
|
12555
12554
|
Children as Children6,
|
|
12556
|
-
Fragment as
|
|
12555
|
+
Fragment as Fragment12,
|
|
12557
12556
|
cloneElement as cloneElement7,
|
|
12558
12557
|
forwardRef as forwardRef64,
|
|
12559
|
-
isValidElement as
|
|
12558
|
+
isValidElement as isValidElement8,
|
|
12560
12559
|
useEffect as useEffect26,
|
|
12561
12560
|
useState as useState28
|
|
12562
12561
|
} from "react";
|
|
@@ -12614,33 +12613,33 @@ function useIsInTableHead() {
|
|
|
12614
12613
|
|
|
12615
12614
|
// src/components/Table/normal/Table.tokens.tsx
|
|
12616
12615
|
import { ddsBaseTokens as ddsBaseTokens57 } from "@norges-domstoler/dds-design-tokens";
|
|
12617
|
-
var { font: font2, colors:
|
|
12616
|
+
var { font: font2, colors: colors30, border: border13, spacing: spacing35, iconSizes: iconSizes3, borderRadius: borderRadius9 } = ddsBaseTokens57;
|
|
12618
12617
|
var row = {
|
|
12619
12618
|
body: {
|
|
12620
12619
|
odd: {
|
|
12621
|
-
backgroundColor:
|
|
12620
|
+
backgroundColor: colors30.DdsColorNeutralsWhite
|
|
12622
12621
|
},
|
|
12623
12622
|
even: {
|
|
12624
|
-
backgroundColor:
|
|
12623
|
+
backgroundColor: colors30.DdsColorNeutralsGray1
|
|
12625
12624
|
},
|
|
12626
|
-
hover: { backgroundColor:
|
|
12625
|
+
hover: { backgroundColor: colors30.DdsColorInteractiveLightest },
|
|
12627
12626
|
selected: {
|
|
12628
|
-
backgroundColor:
|
|
12627
|
+
backgroundColor: colors30.DdsColorInteractiveLightest
|
|
12629
12628
|
},
|
|
12630
12629
|
mode: {
|
|
12631
12630
|
sum: {
|
|
12632
|
-
borderTop: `${border13.BordersDdsBorderStyleLightStrokeWeight} solid ${
|
|
12633
|
-
borderBottom: `${border13.BordersDdsBorderStyleLightStrokeWeight} solid ${
|
|
12634
|
-
backgroundColor:
|
|
12631
|
+
borderTop: `${border13.BordersDdsBorderStyleLightStrokeWeight} solid ${colors30.DdsColorNeutralsGray4}`,
|
|
12632
|
+
borderBottom: `${border13.BordersDdsBorderStyleLightStrokeWeight} solid ${colors30.DdsColorNeutralsGray4}`,
|
|
12633
|
+
backgroundColor: colors30.DdsColorNeutralsWhite
|
|
12635
12634
|
}
|
|
12636
12635
|
},
|
|
12637
12636
|
withDividers: {
|
|
12638
|
-
borderBottom: `1px solid ${
|
|
12637
|
+
borderBottom: `1px solid ${colors30.DdsColorNeutralsGray4}`
|
|
12639
12638
|
}
|
|
12640
12639
|
},
|
|
12641
12640
|
head: {
|
|
12642
12641
|
extraCompact: {
|
|
12643
|
-
backgroundColor:
|
|
12642
|
+
backgroundColor: colors30.DdsColorNeutralsWhite,
|
|
12644
12643
|
fontSize: font2.DdsFontBodySans01FontSize
|
|
12645
12644
|
}
|
|
12646
12645
|
}
|
|
@@ -12658,7 +12657,7 @@ var cell2 = {
|
|
|
12658
12657
|
}
|
|
12659
12658
|
},
|
|
12660
12659
|
head: {
|
|
12661
|
-
backgroundColor:
|
|
12660
|
+
backgroundColor: colors30.DdsColorPrimaryLightest
|
|
12662
12661
|
},
|
|
12663
12662
|
sort: {
|
|
12664
12663
|
gap: spacing35.SizesDdsSpacingX05,
|
|
@@ -12984,7 +12983,7 @@ Table2.Row = Row;
|
|
|
12984
12983
|
Table2.Foot = Foot;
|
|
12985
12984
|
|
|
12986
12985
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12987
|
-
import { Fragment as
|
|
12986
|
+
import { Fragment as Fragment13, jsx as jsx259, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
12988
12987
|
var { collapseButton: collapseButton2 } = tableTokens;
|
|
12989
12988
|
var CollapseButton = styled86.button`
|
|
12990
12989
|
${removeButtonStyling}
|
|
@@ -13034,9 +13033,9 @@ var CollapsibleRow = forwardRef64(
|
|
|
13034
13033
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
13035
13034
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
13036
13035
|
collapsibleIds.push(id);
|
|
13037
|
-
return /* @__PURE__ */ jsxs69(
|
|
13036
|
+
return /* @__PURE__ */ jsxs69(Fragment12, { children: [
|
|
13038
13037
|
/* @__PURE__ */ jsx259(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
13039
|
-
|
|
13038
|
+
isValidElement8(child) && cloneElement7(child, {
|
|
13040
13039
|
collapsibleProps: { isCollapsibleChild: true }
|
|
13041
13040
|
})
|
|
13042
13041
|
] }, `DL-${index}`);
|
|
@@ -13048,7 +13047,7 @@ var CollapsibleRow = forwardRef64(
|
|
|
13048
13047
|
const headerRow = () => {
|
|
13049
13048
|
if (type !== "head" || !isCollapsed)
|
|
13050
13049
|
return null;
|
|
13051
|
-
return /* @__PURE__ */ jsx259(StyledRow, { ref, type, ...rowProps, children: /* @__PURE__ */ jsxs69(
|
|
13050
|
+
return /* @__PURE__ */ jsx259(StyledRow, { ref, type, ...rowProps, children: /* @__PURE__ */ jsxs69(Fragment13, { children: [
|
|
13052
13051
|
definingColumnCells,
|
|
13053
13052
|
/* @__PURE__ */ jsxs69(Table2.Cell, { type: "head", layout: "center", children: [
|
|
13054
13053
|
"Utvid",
|
|
@@ -13089,9 +13088,9 @@ var CollapsibleRow = forwardRef64(
|
|
|
13089
13088
|
}
|
|
13090
13089
|
);
|
|
13091
13090
|
};
|
|
13092
|
-
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ jsxs69(
|
|
13091
|
+
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ jsxs69(Fragment13, { children: [
|
|
13093
13092
|
headerRow(),
|
|
13094
|
-
type === "body" && /* @__PURE__ */ jsxs69(
|
|
13093
|
+
type === "body" && /* @__PURE__ */ jsxs69(Fragment13, { children: [
|
|
13095
13094
|
rowWithChevron(),
|
|
13096
13095
|
childrenCollapsed ? null : collapsedRows
|
|
13097
13096
|
] })
|
|
@@ -13223,7 +13222,7 @@ Tabs.displayName = "Tabs";
|
|
|
13223
13222
|
// src/components/Tabs/Tab.tsx
|
|
13224
13223
|
import {
|
|
13225
13224
|
forwardRef as forwardRef67,
|
|
13226
|
-
useCallback as
|
|
13225
|
+
useCallback as useCallback8,
|
|
13227
13226
|
useEffect as useEffect28,
|
|
13228
13227
|
useRef as useRef32
|
|
13229
13228
|
} from "react";
|
|
@@ -13231,14 +13230,14 @@ import styled89, { css as css39 } from "styled-components";
|
|
|
13231
13230
|
|
|
13232
13231
|
// src/components/Tabs/Tabs.tokens.tsx
|
|
13233
13232
|
import { ddsBaseTokens as ddsBaseTokens58 } from "@norges-domstoler/dds-design-tokens";
|
|
13234
|
-
var { border: border14, spacing: spacing36, colors:
|
|
13233
|
+
var { border: border14, spacing: spacing36, colors: colors31 } = ddsBaseTokens58;
|
|
13235
13234
|
var tabList = {
|
|
13236
13235
|
borderBottom: `${border14.BordersDdsBorderStyleLightStrokeWeight} solid ${border14.BordersDdsBorderStyleLightStroke}`
|
|
13237
13236
|
};
|
|
13238
13237
|
var tab = {
|
|
13239
13238
|
base: {
|
|
13240
13239
|
borderBottom: `${border14.BordersDdsBorderStyleLightStrokeWeight} solid transparent`,
|
|
13241
|
-
color:
|
|
13240
|
+
color: colors31.DdsColorNeutralsGray7,
|
|
13242
13241
|
padding: spacing36.SizesDdsSpacingX05
|
|
13243
13242
|
},
|
|
13244
13243
|
row: {
|
|
@@ -13248,15 +13247,15 @@ var tab = {
|
|
|
13248
13247
|
gap: spacing36.SizesDdsSpacingX025
|
|
13249
13248
|
},
|
|
13250
13249
|
active: {
|
|
13251
|
-
backgroundColor:
|
|
13252
|
-
color:
|
|
13253
|
-
boxShadow: `inset 0 -2px 0 0 ${
|
|
13254
|
-
borderColor:
|
|
13250
|
+
backgroundColor: colors31.DdsColorInteractiveLightest,
|
|
13251
|
+
color: colors31.DdsColorInteractiveDarkest,
|
|
13252
|
+
boxShadow: `inset 0 -2px 0 0 ${colors31.DdsColorInteractiveDarker}`,
|
|
13253
|
+
borderColor: colors31.DdsColorInteractiveDarker
|
|
13255
13254
|
},
|
|
13256
13255
|
hover: {
|
|
13257
|
-
color:
|
|
13258
|
-
boxShadow: `inset 0 -2px 0 0 ${
|
|
13259
|
-
borderColor:
|
|
13256
|
+
color: colors31.DdsColorInteractiveDarkest,
|
|
13257
|
+
boxShadow: `inset 0 -2px 0 0 ${colors31.DdsColorInteractiveDarker}`,
|
|
13258
|
+
borderColor: colors31.DdsColorInteractiveDarker
|
|
13260
13259
|
}
|
|
13261
13260
|
};
|
|
13262
13261
|
var panel = {
|
|
@@ -13360,7 +13359,7 @@ var Button2 = styled89.button`
|
|
|
13360
13359
|
var Tab = forwardRef67((props, ref) => {
|
|
13361
13360
|
const {
|
|
13362
13361
|
active = false,
|
|
13363
|
-
icon:
|
|
13362
|
+
icon: icon11,
|
|
13364
13363
|
children,
|
|
13365
13364
|
focus,
|
|
13366
13365
|
setFocus,
|
|
@@ -13376,20 +13375,14 @@ var Tab = forwardRef67((props, ref) => {
|
|
|
13376
13375
|
useSetTabWidth(index, width);
|
|
13377
13376
|
const itemRef = useRef32(null);
|
|
13378
13377
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
13379
|
-
const {
|
|
13378
|
+
const { tabContentDirection } = useTabsContext();
|
|
13380
13379
|
useEffect28(() => {
|
|
13381
13380
|
var _a;
|
|
13382
13381
|
if (focus) {
|
|
13383
13382
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
13384
|
-
setHasTabFocus(true);
|
|
13385
13383
|
}
|
|
13386
13384
|
}, [focus]);
|
|
13387
|
-
|
|
13388
|
-
var _a;
|
|
13389
|
-
setHasTabFocus(false);
|
|
13390
|
-
(_a = tabPanelsRef == null ? void 0 : tabPanelsRef.current) == null ? void 0 : _a.focus();
|
|
13391
|
-
});
|
|
13392
|
-
const handleSelect = useCallback9(() => {
|
|
13385
|
+
const handleSelect = useCallback8(() => {
|
|
13393
13386
|
if (setFocus && index) {
|
|
13394
13387
|
setFocus(index);
|
|
13395
13388
|
}
|
|
@@ -13415,7 +13408,7 @@ var Tab = forwardRef67((props, ref) => {
|
|
|
13415
13408
|
onKeyDown: handleOnKeyDown,
|
|
13416
13409
|
tabIndex: focus ? 0 : -1,
|
|
13417
13410
|
children: [
|
|
13418
|
-
|
|
13411
|
+
icon11 && /* @__PURE__ */ jsx263(Icon, { icon: icon11, iconSize: "inherit" }),
|
|
13419
13412
|
/* @__PURE__ */ jsx263("span", { children })
|
|
13420
13413
|
]
|
|
13421
13414
|
}
|
|
@@ -13428,7 +13421,7 @@ import {
|
|
|
13428
13421
|
Children as Children7,
|
|
13429
13422
|
cloneElement as cloneElement8,
|
|
13430
13423
|
forwardRef as forwardRef68,
|
|
13431
|
-
isValidElement as
|
|
13424
|
+
isValidElement as isValidElement9,
|
|
13432
13425
|
useState as useState30
|
|
13433
13426
|
} from "react";
|
|
13434
13427
|
import styled90, { css as css40 } from "styled-components";
|
|
@@ -13468,15 +13461,14 @@ var TabList = forwardRef68(
|
|
|
13468
13461
|
handleTabChange,
|
|
13469
13462
|
tabListRef,
|
|
13470
13463
|
hasTabFocus,
|
|
13471
|
-
tabPanelsRef,
|
|
13472
13464
|
setHasTabFocus
|
|
13473
13465
|
} = useTabsContext();
|
|
13474
13466
|
const uniqueId = id != null ? id : `${tabsId}-tablist`;
|
|
13475
13467
|
const childrenArray = Children7.toArray(children).length;
|
|
13476
|
-
const [focus, setFocus] = useRoveFocus(childrenArray,
|
|
13468
|
+
const [focus, setFocus] = useRoveFocus(childrenArray, hasTabFocus, "row");
|
|
13477
13469
|
const combinedRef = useCombinedRef(ref, tabListRef);
|
|
13478
13470
|
const tabListChildren = Children7.map(children, (child, index) => {
|
|
13479
|
-
return
|
|
13471
|
+
return isValidElement9(child) && cloneElement8(child, {
|
|
13480
13472
|
id: `${tabsId}-tab-${index}`,
|
|
13481
13473
|
"aria-controls": `${tabsId}-panel-${index}`,
|
|
13482
13474
|
active: activeTab === index,
|
|
@@ -13487,28 +13479,34 @@ var TabList = forwardRef68(
|
|
|
13487
13479
|
});
|
|
13488
13480
|
});
|
|
13489
13481
|
const [widths, setWidths] = useState30([]);
|
|
13490
|
-
useOnKeyDown("Tab", () => {
|
|
13491
|
-
var _a;
|
|
13492
|
-
setHasTabFocus(false);
|
|
13493
|
-
(_a = tabPanelsRef == null ? void 0 : tabPanelsRef.current) == null ? void 0 : _a.focus();
|
|
13494
|
-
});
|
|
13495
|
-
useOnClickOutside((tabListRef == null ? void 0 : tabListRef.current) || null, () => {
|
|
13496
|
-
setHasTabFocus(false);
|
|
13497
|
-
});
|
|
13498
13482
|
const handleOnFocus = (event) => {
|
|
13499
13483
|
setHasTabFocus(true);
|
|
13500
13484
|
onFocus && onFocus(event);
|
|
13501
13485
|
};
|
|
13502
|
-
const
|
|
13503
|
-
|
|
13504
|
-
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
|
|
13486
|
+
const handleOnBlur = (event) => {
|
|
13487
|
+
var _a;
|
|
13488
|
+
if ((tabListRef == null ? void 0 : tabListRef.current) === event.relatedTarget) {
|
|
13489
|
+
setFocus(-1);
|
|
13490
|
+
}
|
|
13491
|
+
if (!((_a = tabListRef == null ? void 0 : tabListRef.current) == null ? void 0 : _a.contains(event.relatedTarget))) {
|
|
13492
|
+
setHasTabFocus(false);
|
|
13493
|
+
}
|
|
13510
13494
|
};
|
|
13511
|
-
return /* @__PURE__ */ jsx264(TabWidthContextProvider, { onChangeWidths: setWidths, children: /* @__PURE__ */ jsx264(
|
|
13495
|
+
return /* @__PURE__ */ jsx264(TabWidthContextProvider, { onChangeWidths: setWidths, children: /* @__PURE__ */ jsx264(
|
|
13496
|
+
TabRow,
|
|
13497
|
+
{
|
|
13498
|
+
...rest,
|
|
13499
|
+
ref: combinedRef,
|
|
13500
|
+
role: "tablist",
|
|
13501
|
+
"aria-label": "Bruk venste og h\xF8yre piltast for \xE5 bla",
|
|
13502
|
+
id: uniqueId,
|
|
13503
|
+
tabIndex: 0,
|
|
13504
|
+
onFocus: handleOnFocus,
|
|
13505
|
+
onBlur: handleOnBlur,
|
|
13506
|
+
$gridTemplateColumns: widths.join(" "),
|
|
13507
|
+
children: tabListChildren
|
|
13508
|
+
}
|
|
13509
|
+
) });
|
|
13512
13510
|
}
|
|
13513
13511
|
);
|
|
13514
13512
|
TabList.displayName = "TabList";
|
|
@@ -13553,7 +13551,7 @@ import {
|
|
|
13553
13551
|
Children as Children8,
|
|
13554
13552
|
cloneElement as cloneElement9,
|
|
13555
13553
|
forwardRef as forwardRef70,
|
|
13556
|
-
isValidElement as
|
|
13554
|
+
isValidElement as isValidElement10
|
|
13557
13555
|
} from "react";
|
|
13558
13556
|
import { jsx as jsx266 } from "react/jsx-runtime";
|
|
13559
13557
|
var TabPanels = forwardRef70(
|
|
@@ -13562,7 +13560,7 @@ var TabPanels = forwardRef70(
|
|
|
13562
13560
|
const combinedRef = useCombinedRef(ref, tabPanelsRef);
|
|
13563
13561
|
const panelChildren = Children8.map(children, (child, index) => {
|
|
13564
13562
|
const active = index === activeTab;
|
|
13565
|
-
return
|
|
13563
|
+
return isValidElement10(child) && cloneElement9(child, {
|
|
13566
13564
|
id: `${tabsId}-panel-${index}`,
|
|
13567
13565
|
"aria-labelledby": `${tabsId}-tab-${index}`,
|
|
13568
13566
|
active,
|
|
@@ -13580,7 +13578,7 @@ import styled92, { css as css42 } from "styled-components";
|
|
|
13580
13578
|
|
|
13581
13579
|
// src/components/Tag/Tag.tokens.tsx
|
|
13582
13580
|
import { ddsBaseTokens as ddsBaseTokens59 } from "@norges-domstoler/dds-design-tokens";
|
|
13583
|
-
var { colors:
|
|
13581
|
+
var { colors: colors32, borderRadius: borderRadius10, spacing: spacing37 } = ddsBaseTokens59;
|
|
13584
13582
|
var typographyType5 = "bodySans01";
|
|
13585
13583
|
var wrapper7 = {
|
|
13586
13584
|
border: "1px solid",
|
|
@@ -13600,13 +13598,13 @@ var wrapper7 = {
|
|
|
13600
13598
|
default: {
|
|
13601
13599
|
icon: void 0,
|
|
13602
13600
|
base: {
|
|
13603
|
-
backgroundColor:
|
|
13604
|
-
borderColor:
|
|
13601
|
+
backgroundColor: colors32.DdsColorNeutralsGray1,
|
|
13602
|
+
borderColor: colors32.DdsColorNeutralsGray3,
|
|
13605
13603
|
icon: void 0
|
|
13606
13604
|
},
|
|
13607
13605
|
strong: {
|
|
13608
|
-
backgroundColor:
|
|
13609
|
-
borderColor:
|
|
13606
|
+
backgroundColor: colors32.DdsColorNeutralsGray3,
|
|
13607
|
+
borderColor: colors32.DdsColorNeutralsGray3,
|
|
13610
13608
|
icon: void 0
|
|
13611
13609
|
}
|
|
13612
13610
|
},
|
|
@@ -13615,14 +13613,14 @@ var wrapper7 = {
|
|
|
13615
13613
|
base: {
|
|
13616
13614
|
...localMessageTokens.container.purpose.success,
|
|
13617
13615
|
icon: {
|
|
13618
|
-
color:
|
|
13616
|
+
color: colors32.DdsColorSuccessDarkest
|
|
13619
13617
|
}
|
|
13620
13618
|
},
|
|
13621
13619
|
strong: {
|
|
13622
|
-
backgroundColor:
|
|
13623
|
-
borderColor:
|
|
13620
|
+
backgroundColor: colors32.DdsColorSuccessLight,
|
|
13621
|
+
borderColor: colors32.DdsColorSuccessLight,
|
|
13624
13622
|
icon: {
|
|
13625
|
-
color:
|
|
13623
|
+
color: colors32.DdsColorNeutralsGray9
|
|
13626
13624
|
}
|
|
13627
13625
|
}
|
|
13628
13626
|
},
|
|
@@ -13631,14 +13629,14 @@ var wrapper7 = {
|
|
|
13631
13629
|
base: {
|
|
13632
13630
|
...localMessageTokens.container.purpose.danger,
|
|
13633
13631
|
icon: {
|
|
13634
|
-
color:
|
|
13632
|
+
color: colors32.DdsColorDangerDarkest
|
|
13635
13633
|
}
|
|
13636
13634
|
},
|
|
13637
13635
|
strong: {
|
|
13638
|
-
backgroundColor:
|
|
13639
|
-
borderColor:
|
|
13636
|
+
backgroundColor: colors32.DdsColorDangerLight,
|
|
13637
|
+
borderColor: colors32.DdsColorDangerLight,
|
|
13640
13638
|
icon: {
|
|
13641
|
-
color:
|
|
13639
|
+
color: colors32.DdsColorNeutralsGray9
|
|
13642
13640
|
}
|
|
13643
13641
|
}
|
|
13644
13642
|
},
|
|
@@ -13647,14 +13645,14 @@ var wrapper7 = {
|
|
|
13647
13645
|
base: {
|
|
13648
13646
|
...localMessageTokens.container.purpose.warning,
|
|
13649
13647
|
icon: {
|
|
13650
|
-
color:
|
|
13648
|
+
color: colors32.DdsColorWarningDarkest
|
|
13651
13649
|
}
|
|
13652
13650
|
},
|
|
13653
13651
|
strong: {
|
|
13654
|
-
backgroundColor:
|
|
13655
|
-
borderColor:
|
|
13652
|
+
backgroundColor: colors32.DdsColorWarningLight,
|
|
13653
|
+
borderColor: colors32.DdsColorWarningLight,
|
|
13656
13654
|
icon: {
|
|
13657
|
-
color:
|
|
13655
|
+
color: colors32.DdsColorNeutralsGray9
|
|
13658
13656
|
}
|
|
13659
13657
|
}
|
|
13660
13658
|
},
|
|
@@ -13663,14 +13661,14 @@ var wrapper7 = {
|
|
|
13663
13661
|
base: {
|
|
13664
13662
|
...localMessageTokens.container.purpose.info,
|
|
13665
13663
|
icon: {
|
|
13666
|
-
color:
|
|
13664
|
+
color: colors32.DdsColorInfoDarkest
|
|
13667
13665
|
}
|
|
13668
13666
|
},
|
|
13669
13667
|
strong: {
|
|
13670
|
-
backgroundColor:
|
|
13671
|
-
borderColor:
|
|
13668
|
+
backgroundColor: colors32.DdsColorInfoLight,
|
|
13669
|
+
borderColor: colors32.DdsColorInfoLight,
|
|
13672
13670
|
icon: {
|
|
13673
|
-
color:
|
|
13671
|
+
color: colors32.DdsColorNeutralsGray9
|
|
13674
13672
|
}
|
|
13675
13673
|
}
|
|
13676
13674
|
}
|
|
@@ -13696,7 +13694,7 @@ var Wrapper7 = styled92(TextOverflowEllipsisWrapper)`
|
|
|
13696
13694
|
border-color: ${wrapper8.purpose[$purpose][$strong ? "strong" : "base"].borderColor};
|
|
13697
13695
|
`}
|
|
13698
13696
|
`;
|
|
13699
|
-
var
|
|
13697
|
+
var StyledIcon4 = styled92(Icon)`
|
|
13700
13698
|
color: ${({ $purpose, $strong }) => {
|
|
13701
13699
|
var _a;
|
|
13702
13700
|
return (_a = wrapper8.purpose[$purpose][$strong ? "strong" : "base"].icon) == null ? void 0 : _a.color;
|
|
@@ -13714,7 +13712,7 @@ var Tag = forwardRef71((props, ref) => {
|
|
|
13714
13712
|
withIcon,
|
|
13715
13713
|
...rest
|
|
13716
13714
|
} = props;
|
|
13717
|
-
const
|
|
13715
|
+
const icon11 = tagTokens.wrapper.purpose[purpose].icon;
|
|
13718
13716
|
return /* @__PURE__ */ jsxs71(
|
|
13719
13717
|
Wrapper7,
|
|
13720
13718
|
{
|
|
@@ -13722,14 +13720,14 @@ var Tag = forwardRef71((props, ref) => {
|
|
|
13722
13720
|
ref,
|
|
13723
13721
|
$purpose: purpose,
|
|
13724
13722
|
$strong: strong,
|
|
13725
|
-
$withIcon: Boolean(withIcon &&
|
|
13723
|
+
$withIcon: Boolean(withIcon && icon11),
|
|
13726
13724
|
children: [
|
|
13727
|
-
withIcon &&
|
|
13728
|
-
|
|
13725
|
+
withIcon && icon11 && /* @__PURE__ */ jsx267(
|
|
13726
|
+
StyledIcon4,
|
|
13729
13727
|
{
|
|
13730
13728
|
$purpose: purpose,
|
|
13731
13729
|
$strong: strong,
|
|
13732
|
-
icon:
|
|
13730
|
+
icon: icon11,
|
|
13733
13731
|
iconSize: tagTokens.wrapper.icon.size
|
|
13734
13732
|
}
|
|
13735
13733
|
),
|
|
@@ -13784,7 +13782,7 @@ import styled94, { css as css43 } from "styled-components";
|
|
|
13784
13782
|
|
|
13785
13783
|
// src/components/TextInput/TextInput.tokens.tsx
|
|
13786
13784
|
import { ddsBaseTokens as ddsBaseTokens60 } from "@norges-domstoler/dds-design-tokens";
|
|
13787
|
-
var { colors:
|
|
13785
|
+
var { colors: colors33, spacing: spacing38, iconSizes: iconSizes4 } = ddsBaseTokens60;
|
|
13788
13786
|
var input5 = {
|
|
13789
13787
|
withIcon: {
|
|
13790
13788
|
medium: {
|
|
@@ -13800,11 +13798,11 @@ var input5 = {
|
|
|
13800
13798
|
};
|
|
13801
13799
|
var affix = {
|
|
13802
13800
|
border: {
|
|
13803
|
-
color:
|
|
13801
|
+
color: colors33.DdsColorNeutralsGray5
|
|
13804
13802
|
}
|
|
13805
13803
|
};
|
|
13806
|
-
var
|
|
13807
|
-
color:
|
|
13804
|
+
var icon9 = {
|
|
13805
|
+
color: colors33.DdsColorNeutralsGray9,
|
|
13808
13806
|
sizes: {
|
|
13809
13807
|
medium: {
|
|
13810
13808
|
top: spacing38.SizesDdsSpacingX075,
|
|
@@ -13822,22 +13820,22 @@ var icon10 = {
|
|
|
13822
13820
|
};
|
|
13823
13821
|
var textInputTokens = {
|
|
13824
13822
|
input: input5,
|
|
13825
|
-
icon:
|
|
13823
|
+
icon: icon9,
|
|
13826
13824
|
affix
|
|
13827
13825
|
};
|
|
13828
13826
|
|
|
13829
13827
|
// src/components/TextInput/TextInput.styles.tsx
|
|
13830
13828
|
var { iconSizes: iconSizes5 } = ddsBaseTokens61;
|
|
13831
|
-
var { input: input6, icon:
|
|
13829
|
+
var { input: input6, icon: icon10 } = textInputTokens;
|
|
13832
13830
|
var MessageContainer2 = styled94.div`
|
|
13833
13831
|
display: flex;
|
|
13834
13832
|
justify-content: space-between;
|
|
13835
13833
|
`;
|
|
13836
|
-
var
|
|
13834
|
+
var StyledIcon5 = styled94(Icon)`
|
|
13837
13835
|
position: absolute;
|
|
13838
|
-
color: ${
|
|
13836
|
+
color: ${icon10.color};
|
|
13839
13837
|
${({ $size, iconSize }) => css43`
|
|
13840
|
-
left: ${
|
|
13838
|
+
left: ${icon10.sizes[$size].left};
|
|
13841
13839
|
${iconSize === "small" ? css43`
|
|
13842
13840
|
top: ${`calc(50% - ${iconSizes5.DdsIconsizeSmallNumberPx / 2}px)`};
|
|
13843
13841
|
` : css43`
|
|
@@ -13919,7 +13917,7 @@ var TextInput2 = forwardRef72(
|
|
|
13919
13917
|
defaultValue,
|
|
13920
13918
|
"aria-required": ariaRequired,
|
|
13921
13919
|
"aria-describedby": ariaDescribedby,
|
|
13922
|
-
icon:
|
|
13920
|
+
icon: icon11,
|
|
13923
13921
|
prefix: prefix2,
|
|
13924
13922
|
suffix,
|
|
13925
13923
|
...rest
|
|
@@ -13951,7 +13949,7 @@ var TextInput2 = forwardRef72(
|
|
|
13951
13949
|
const hasTip = !!tip;
|
|
13952
13950
|
const hasLabel = !!label3;
|
|
13953
13951
|
const hasMessage = hasErrorMessage || hasTip || !!maxLength;
|
|
13954
|
-
const hasIcon = !!
|
|
13952
|
+
const hasIcon = !!icon11;
|
|
13955
13953
|
const hasAffix = !!(prefix2 != null ? prefix2 : suffix);
|
|
13956
13954
|
const characterCounterId = derivativeIdGenerator(
|
|
13957
13955
|
uniqueId,
|
|
@@ -13989,9 +13987,9 @@ var TextInput2 = forwardRef72(
|
|
|
13989
13987
|
if (hasIcon) {
|
|
13990
13988
|
extendedInput = /* @__PURE__ */ jsxs73(InputContainer, { children: [
|
|
13991
13989
|
/* @__PURE__ */ jsx268(
|
|
13992
|
-
|
|
13990
|
+
StyledIcon5,
|
|
13993
13991
|
{
|
|
13994
|
-
icon:
|
|
13992
|
+
icon: icon11,
|
|
13995
13993
|
iconSize: getFormInputIconSize(componentSize),
|
|
13996
13994
|
$size: componentSize
|
|
13997
13995
|
}
|
|
@@ -14067,7 +14065,7 @@ var useToggleBarContext = () => useContext13(ToggleBarContext);
|
|
|
14067
14065
|
|
|
14068
14066
|
// src/components/ToggleBar/ToggleBar.tokens.tsx
|
|
14069
14067
|
import { ddsBaseTokens as ddsBaseTokens62 } from "@norges-domstoler/dds-design-tokens";
|
|
14070
|
-
var { colors:
|
|
14068
|
+
var { colors: colors34, spacing: spacing39, border: border15, borderRadius: borderRadius11, fontPackages: fontPackages6 } = ddsBaseTokens62;
|
|
14071
14069
|
var typographyTypes6 = {
|
|
14072
14070
|
large: "bodySans04",
|
|
14073
14071
|
medium: "bodySans02",
|
|
@@ -14095,17 +14093,17 @@ var outerContainer7 = {
|
|
|
14095
14093
|
};
|
|
14096
14094
|
var label = {
|
|
14097
14095
|
base: {
|
|
14098
|
-
borderColor:
|
|
14099
|
-
borderRight: `${border15.BordersDdsBorderStyleLightStrokeWeight} solid ${
|
|
14100
|
-
borderTop: `${border15.BordersDdsBorderStyleLightStrokeWeight} solid ${
|
|
14101
|
-
borderBottom: `${border15.BordersDdsBorderStyleLightStrokeWeight} solid ${
|
|
14096
|
+
borderColor: colors34.DdsColorNeutralsGray5,
|
|
14097
|
+
borderRight: `${border15.BordersDdsBorderStyleLightStrokeWeight} solid ${colors34.DdsColorNeutralsGray5}`,
|
|
14098
|
+
borderTop: `${border15.BordersDdsBorderStyleLightStrokeWeight} solid ${colors34.DdsColorNeutralsGray5}`,
|
|
14099
|
+
borderBottom: `${border15.BordersDdsBorderStyleLightStrokeWeight} solid ${colors34.DdsColorNeutralsGray5}`
|
|
14102
14100
|
},
|
|
14103
14101
|
hover: {
|
|
14104
|
-
color:
|
|
14105
|
-
borderColor:
|
|
14102
|
+
color: colors34.DdsColorInteractiveDark,
|
|
14103
|
+
borderColor: colors34.DdsColorInteractiveDark
|
|
14106
14104
|
},
|
|
14107
14105
|
firstChild: {
|
|
14108
|
-
borderLeft: `${border15.BordersDdsBorderStyleLightStrokeWeight} solid ${
|
|
14106
|
+
borderLeft: `${border15.BordersDdsBorderStyleLightStrokeWeight} solid ${colors34.DdsColorNeutralsGray5}`,
|
|
14109
14107
|
borderTopLeftRadius: borderRadius11.RadiiDdsBorderRadius1Radius,
|
|
14110
14108
|
borderBottomLeftRadius: borderRadius11.RadiiDdsBorderRadius1Radius
|
|
14111
14109
|
},
|
|
@@ -14115,12 +14113,12 @@ var label = {
|
|
|
14115
14113
|
}
|
|
14116
14114
|
};
|
|
14117
14115
|
var content7 = {
|
|
14118
|
-
base: { backgroundColor:
|
|
14116
|
+
base: { backgroundColor: colors34.DdsColorNeutralsGray1 },
|
|
14119
14117
|
active: {
|
|
14120
|
-
color:
|
|
14121
|
-
borderColor:
|
|
14122
|
-
backgroundColor:
|
|
14123
|
-
boxShadow: `inset 0 0 0 1px ${
|
|
14118
|
+
color: colors34.DdsColorInteractiveDarkest,
|
|
14119
|
+
borderColor: colors34.DdsColorInteractiveDarker,
|
|
14120
|
+
backgroundColor: colors34.DdsColorInteractiveLightest,
|
|
14121
|
+
boxShadow: `inset 0 0 0 1px ${colors34.DdsColorInteractiveDarker}`
|
|
14124
14122
|
},
|
|
14125
14123
|
size: {
|
|
14126
14124
|
tiny: {
|
|
@@ -14336,7 +14334,7 @@ var ToggleRadio = forwardRef73(
|
|
|
14336
14334
|
checked,
|
|
14337
14335
|
"aria-label": ariaLabel,
|
|
14338
14336
|
"aria-labelledby": ariaLabelledBy,
|
|
14339
|
-
icon:
|
|
14337
|
+
icon: icon11,
|
|
14340
14338
|
label: label3,
|
|
14341
14339
|
htmlProps,
|
|
14342
14340
|
className,
|
|
@@ -14365,8 +14363,8 @@ var ToggleRadio = forwardRef73(
|
|
|
14365
14363
|
"aria-labelledby": ariaLabelledBy
|
|
14366
14364
|
}
|
|
14367
14365
|
),
|
|
14368
|
-
/* @__PURE__ */ jsxs75(Content2, { $size: group4.size, $justIcon: !!
|
|
14369
|
-
|
|
14366
|
+
/* @__PURE__ */ jsxs75(Content2, { $size: group4.size, $justIcon: !!icon11 && !label3, children: [
|
|
14367
|
+
icon11 && /* @__PURE__ */ jsx270(Icon, { icon: icon11, iconSize: "inherit" }),
|
|
14370
14368
|
label3 && /* @__PURE__ */ jsx270("span", { children: label3 })
|
|
14371
14369
|
] })
|
|
14372
14370
|
] });
|
|
@@ -14380,21 +14378,21 @@ import styled98, { css as css47 } from "styled-components";
|
|
|
14380
14378
|
|
|
14381
14379
|
// src/components/ToggleButton/ToggleButton.tokens.tsx
|
|
14382
14380
|
import { ddsBaseTokens as ddsBaseTokens63 } from "@norges-domstoler/dds-design-tokens";
|
|
14383
|
-
var { colors:
|
|
14381
|
+
var { colors: colors35, spacing: spacing40 } = ddsBaseTokens63;
|
|
14384
14382
|
var { button: button2 } = buttonTokens;
|
|
14385
14383
|
var { selectionControl: selectionControl3 } = selectionControlTokens;
|
|
14386
14384
|
var typographyType6 = typographyTypes.small;
|
|
14387
14385
|
var toggleButton = {
|
|
14388
14386
|
border: button2.base.border,
|
|
14389
|
-
backgroundColor:
|
|
14390
|
-
color:
|
|
14387
|
+
backgroundColor: colors35.DdsColorNeutralsWhite,
|
|
14388
|
+
color: colors35.DdsColorNeutralsGray7,
|
|
14391
14389
|
gap: spacing40.SizesDdsSpacingX05,
|
|
14392
14390
|
borderRadius: button2.appearances.rounded.base.borderRadius,
|
|
14393
14391
|
padding: button2.sizes.small.text.padding,
|
|
14394
14392
|
hover: selectionControl3.hover.base,
|
|
14395
14393
|
checked: {
|
|
14396
14394
|
...selectionControl3.checked.base,
|
|
14397
|
-
color:
|
|
14395
|
+
color: colors35.DdsColorNeutralsWhite,
|
|
14398
14396
|
hover: selectionControl3.checked.hover
|
|
14399
14397
|
}
|
|
14400
14398
|
};
|
|
@@ -14466,7 +14464,7 @@ var Container16 = styled98.label`
|
|
|
14466
14464
|
}
|
|
14467
14465
|
`;
|
|
14468
14466
|
var ToggleButton = forwardRef74(
|
|
14469
|
-
({ id, label: label3, icon:
|
|
14467
|
+
({ id, label: label3, icon: icon11, className, htmlProps, ...rest }, ref) => {
|
|
14470
14468
|
const generatedId = useId26();
|
|
14471
14469
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
14472
14470
|
return /* @__PURE__ */ jsxs76(Container16, { htmlFor: uniqueId, children: [
|
|
@@ -14478,8 +14476,8 @@ var ToggleButton = forwardRef74(
|
|
|
14478
14476
|
type: "checkbox"
|
|
14479
14477
|
}
|
|
14480
14478
|
),
|
|
14481
|
-
/* @__PURE__ */ jsxs76(Content3, { $hasIcon: !!
|
|
14482
|
-
|
|
14479
|
+
/* @__PURE__ */ jsxs76(Content3, { $hasIcon: !!icon11, children: [
|
|
14480
|
+
icon11 && /* @__PURE__ */ jsx271(Icon, { icon: icon11, iconSize: "inherit" }),
|
|
14483
14481
|
" ",
|
|
14484
14482
|
label3
|
|
14485
14483
|
] })
|