@norges-domstoler/dds-components 14.5.0 → 14.6.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.js +810 -825
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +653 -668
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1025,7 +1025,7 @@ var Input = import_styled_components4.default.input`
|
|
|
1025
1025
|
${selection}
|
|
1026
1026
|
}
|
|
1027
1027
|
|
|
1028
|
-
&:not(.disabled):not(.read-only):not(.active):hover,
|
|
1028
|
+
&:not(input):not(textarea):not(.disabled):not(.read-only):not(.active):hover,
|
|
1029
1029
|
&:hover:enabled:read-write {
|
|
1030
1030
|
${hoverInputfield}
|
|
1031
1031
|
}
|
|
@@ -1137,8 +1137,8 @@ var getElevation = (elevation) => {
|
|
|
1137
1137
|
return outerShadow.DdsShadow4Onlight;
|
|
1138
1138
|
}
|
|
1139
1139
|
};
|
|
1140
|
-
var getBorder = (
|
|
1141
|
-
switch (
|
|
1140
|
+
var getBorder = (borderStyle) => {
|
|
1141
|
+
switch (borderStyle) {
|
|
1142
1142
|
case "light":
|
|
1143
1143
|
return `${border3.BordersDdsBorderStyleLightStrokeWeight} solid ${border3.BordersDdsBorderStyleLightStroke}`;
|
|
1144
1144
|
case "dark":
|
|
@@ -9221,7 +9221,7 @@ var InlineEditInput = (0, import_react68.forwardRef)((props, ref) => {
|
|
|
9221
9221
|
});
|
|
9222
9222
|
|
|
9223
9223
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
9224
|
-
var
|
|
9224
|
+
var import_react70 = require("react");
|
|
9225
9225
|
|
|
9226
9226
|
// src/components/InternalHeader/InternalHeader.styles.tsx
|
|
9227
9227
|
var import_styled_components61 = __toESM(require("styled-components"));
|
|
@@ -9229,185 +9229,156 @@ var import_styled_components61 = __toESM(require("styled-components"));
|
|
|
9229
9229
|
// src/components/InternalHeader/InternalHeader.tokens.tsx
|
|
9230
9230
|
var import_dds_design_tokens43 = require("@norges-domstoler/dds-design-tokens");
|
|
9231
9231
|
var { border: border10, colors: colors23, spacing: spacing24 } = import_dds_design_tokens43.ddsBaseTokens;
|
|
9232
|
-
var
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
base: {
|
|
9238
|
-
color: colors23.DdsColorNeutralsGray9,
|
|
9239
|
-
backgroundColor: colors23.DdsColorNeutralsWhite,
|
|
9240
|
-
padding: `${spacing24.SizesDdsSpacingX075} ${spacing24.SizesDdsSpacingX15}`
|
|
9241
|
-
},
|
|
9242
|
-
hover: {
|
|
9243
|
-
color: colors23.DdsColorInteractiveDark
|
|
9244
|
-
},
|
|
9245
|
-
active: {
|
|
9246
|
-
color: colors23.DdsColorInteractiveDark
|
|
9247
|
-
},
|
|
9248
|
-
current: {
|
|
9249
|
-
color: colors23.DdsColorInteractiveDarkest,
|
|
9250
|
-
backgroundColor: colors23.DdsColorPrimaryLightest
|
|
9251
|
-
}
|
|
9252
|
-
};
|
|
9253
|
-
var outerContainer3 = {
|
|
9254
|
-
backgroundColor: colors23.DdsColorNeutralsWhite
|
|
9255
|
-
};
|
|
9256
|
-
var applicationNameWrapper = {
|
|
9257
|
-
padding: `${spacing24.SizesDdsSpacingX1} ${spacing24.SizesDdsSpacingX15}`
|
|
9258
|
-
};
|
|
9259
|
-
var lovisaWrapper = {
|
|
9260
|
-
padding: `${spacing24.SizesDdsSpacingX1} ${spacing24.SizesDdsSpacingX15}`,
|
|
9261
|
-
borderRight: borderStyle
|
|
9232
|
+
var bar = {
|
|
9233
|
+
backgroundColor: colors23.DdsColorNeutralsWhite,
|
|
9234
|
+
itemGap: spacing24.SizesDdsSpacingX1,
|
|
9235
|
+
minHeight: "57px",
|
|
9236
|
+
borderBottom: `${border10.BordersDdsBorderStyleLightStroke} solid ${border10.BordersDdsBorderStyleLightStrokeWeight}`
|
|
9262
9237
|
};
|
|
9263
|
-
var
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
hasContextMenu: {
|
|
9267
|
-
paddingRight: spacing24.SizesDdsSpacingX4
|
|
9268
|
-
}
|
|
9269
|
-
};
|
|
9270
|
-
var navigation2 = {
|
|
9271
|
-
borderBottom: borderStyle
|
|
9272
|
-
};
|
|
9273
|
-
var contextGroup = {
|
|
9274
|
-
right: spacing24.SizesDdsSpacingX075,
|
|
9275
|
-
top: spacing24.SizesDdsSpacingX025
|
|
9238
|
+
var separator = {
|
|
9239
|
+
color: border10.BordersDdsBorderStyleLightStroke,
|
|
9240
|
+
width: border10.BordersDdsBorderStyleLightStrokeWeight
|
|
9276
9241
|
};
|
|
9277
9242
|
var internalHeaderTokens = {
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
applicationNameWrapper,
|
|
9281
|
-
lovisaWrapper,
|
|
9282
|
-
banner,
|
|
9283
|
-
navigation: navigation2,
|
|
9284
|
-
contextGroup
|
|
9243
|
+
bar,
|
|
9244
|
+
separator
|
|
9285
9245
|
};
|
|
9286
9246
|
|
|
9287
9247
|
// src/components/InternalHeader/InternalHeader.styles.tsx
|
|
9288
|
-
var {
|
|
9289
|
-
|
|
9290
|
-
applicationNameWrapper: applicationNameWrapper2,
|
|
9291
|
-
lovisaWrapper: lovisaWrapper2,
|
|
9292
|
-
banner: banner2,
|
|
9293
|
-
navigation: navigation3,
|
|
9294
|
-
contextGroup: contextGroup2
|
|
9295
|
-
} = internalHeaderTokens;
|
|
9296
|
-
var OuterContainer = import_styled_components61.default.div`
|
|
9297
|
-
position: relative;
|
|
9248
|
+
var { bar: bar2, separator: separator2 } = internalHeaderTokens;
|
|
9249
|
+
var Bar2 = import_styled_components61.default.div`
|
|
9298
9250
|
*::selection {
|
|
9299
9251
|
${selection}
|
|
9300
9252
|
}
|
|
9301
|
-
background-color: ${
|
|
9302
|
-
`;
|
|
9303
|
-
var BannerWrapper = import_styled_components61.default.div`
|
|
9304
|
-
position: relative;
|
|
9253
|
+
background-color: ${bar2.backgroundColor};
|
|
9305
9254
|
display: flex;
|
|
9255
|
+
gap: ${bar2.itemGap};
|
|
9306
9256
|
align-items: center;
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
padding: ${applicationNameWrapper2.padding};
|
|
9320
|
-
`;
|
|
9321
|
-
var LovisaWrapper = import_styled_components61.default.div`
|
|
9322
|
-
padding: ${lovisaWrapper2.padding};
|
|
9323
|
-
border-right: ${lovisaWrapper2.borderRight};
|
|
9257
|
+
min-height: ${bar2.minHeight};
|
|
9258
|
+
border-bottom: ${bar2.borderBottom};
|
|
9259
|
+
|
|
9260
|
+
${({ $hasNavigation }) => $hasNavigation ? import_styled_components61.css`
|
|
9261
|
+
${ContextMenuGroup} {
|
|
9262
|
+
margin-left: auto;
|
|
9263
|
+
}
|
|
9264
|
+
` : import_styled_components61.css`
|
|
9265
|
+
${BarSeparator} {
|
|
9266
|
+
margin-left: auto;
|
|
9267
|
+
}
|
|
9268
|
+
`}
|
|
9324
9269
|
`;
|
|
9325
|
-
var
|
|
9326
|
-
border-
|
|
9270
|
+
var BarSeparator = import_styled_components61.default.div`
|
|
9271
|
+
border-left: ${separator2.width} solid ${separator2.color};
|
|
9272
|
+
align-self: stretch;
|
|
9327
9273
|
`;
|
|
9328
9274
|
var NavigationList = import_styled_components61.default.ul`
|
|
9329
9275
|
box-sizing: border-box;
|
|
9330
9276
|
display: flex;
|
|
9277
|
+
gap: ${bar2.itemGap};
|
|
9278
|
+
align-items: center;
|
|
9279
|
+
width: 100%;
|
|
9331
9280
|
${({ smallScreen }) => smallScreen && import_styled_components61.css`
|
|
9281
|
+
align-items: initial;
|
|
9332
9282
|
flex-direction: column;
|
|
9333
9283
|
`}
|
|
9334
9284
|
list-style-type: none;
|
|
9335
9285
|
padding: 0;
|
|
9336
9286
|
margin: 0;
|
|
9337
9287
|
`;
|
|
9338
|
-
var ContextMenuGroup = import_styled_components61.default.div
|
|
9339
|
-
position: absolute;
|
|
9340
|
-
top: ${contextGroup2.top};
|
|
9341
|
-
right: ${contextGroup2.right};
|
|
9342
|
-
`;
|
|
9288
|
+
var ContextMenuGroup = import_styled_components61.default.div``;
|
|
9343
9289
|
var StyledOverflowMenu = (0, import_styled_components61.default)(OverflowMenu)`
|
|
9344
9290
|
max-height: calc(100vh - 110px);
|
|
9345
9291
|
`;
|
|
9292
|
+
var NavLi = import_styled_components61.default.li`
|
|
9293
|
+
display: flex;
|
|
9294
|
+
`;
|
|
9346
9295
|
|
|
9347
|
-
// src/components/InternalHeader/
|
|
9296
|
+
// src/components/InternalHeader/NavigationItem.tsx
|
|
9348
9297
|
var import_react69 = require("react");
|
|
9349
9298
|
var import_styled_components62 = __toESM(require("styled-components"));
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9299
|
+
|
|
9300
|
+
// src/components/InternalHeader/NavigationItem.tokens.ts
|
|
9301
|
+
var import_dds_design_tokens44 = require("@norges-domstoler/dds-design-tokens");
|
|
9302
|
+
var navTokens5 = {
|
|
9303
|
+
base: {
|
|
9304
|
+
padding: [
|
|
9305
|
+
import_dds_design_tokens44.ddsBaseTokens.spacing.SizesDdsSpacingX075,
|
|
9306
|
+
import_dds_design_tokens44.ddsBaseTokens.spacing.SizesDdsSpacingX1
|
|
9307
|
+
].join(" "),
|
|
9308
|
+
borderRadius: import_dds_design_tokens44.ddsBaseTokens.borderRadius.RadiiDdsBorderRadius1Radius,
|
|
9309
|
+
backgroundColor: "transparent",
|
|
9310
|
+
color: import_dds_design_tokens44.ddsBaseTokens.colors.DdsColorNeutralsGray6,
|
|
9311
|
+
hover: {
|
|
9312
|
+
backgroundColor: import_dds_design_tokens44.ddsBaseTokens.colors.DdsColorNeutralsGray1,
|
|
9313
|
+
color: import_dds_design_tokens44.ddsBaseTokens.colors.DdsColorNeutralsGray9
|
|
9314
|
+
}
|
|
9315
|
+
},
|
|
9316
|
+
active: {
|
|
9317
|
+
base: {
|
|
9318
|
+
backgroundColor: import_dds_design_tokens44.ddsBaseTokens.colors.DdsColorInteractiveLightest,
|
|
9319
|
+
color: import_dds_design_tokens44.ddsBaseTokens.colors.DdsColorNeutralsGray9
|
|
9320
|
+
},
|
|
9321
|
+
hover: {
|
|
9322
|
+
backgroundColor: import_dds_design_tokens44.ddsBaseTokens.colors.DdsColorInteractiveLightest,
|
|
9323
|
+
color: import_dds_design_tokens44.ddsBaseTokens.colors.DdsColorNeutralsGray9
|
|
9324
|
+
}
|
|
9325
|
+
}
|
|
9326
|
+
};
|
|
9327
|
+
function getNavTokens({ active }) {
|
|
9328
|
+
return {
|
|
9329
|
+
...navTokens5.base,
|
|
9330
|
+
...active ? navTokens5.active.base : {},
|
|
9331
|
+
hover: {
|
|
9332
|
+
...navTokens5.base.hover,
|
|
9333
|
+
...active ? navTokens5.active.hover : {}
|
|
9334
|
+
}
|
|
9358
9335
|
};
|
|
9359
|
-
|
|
9360
|
-
});
|
|
9336
|
+
}
|
|
9361
9337
|
|
|
9362
9338
|
// src/components/InternalHeader/NavigationItem.tsx
|
|
9363
|
-
var
|
|
9364
|
-
var
|
|
9365
|
-
|
|
9366
|
-
var { navLink: navLink2 } = internalHeaderTokens;
|
|
9367
|
-
var Link3 = import_styled_components63.default.a.withConfig({
|
|
9368
|
-
shouldForwardProp: (prop) => prop !== "isCurrent"
|
|
9369
|
-
})`
|
|
9370
|
-
display: flex;
|
|
9371
|
-
align-items: center;
|
|
9372
|
-
height: 100%;
|
|
9373
|
-
box-sizing: border-box;
|
|
9339
|
+
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
9340
|
+
var Link3 = import_styled_components62.default.a`
|
|
9341
|
+
${getFontStyling("bodySans02")}
|
|
9374
9342
|
text-decoration: none;
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
}
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
${getFontStyling(typographyTypes3.navLink)}
|
|
9343
|
+
|
|
9344
|
+
color: ${({ $active }) => getNavTokens({ active: $active }).color};
|
|
9345
|
+
background-color: ${({ $active }) => getNavTokens({ active: $active }).backgroundColor};
|
|
9346
|
+
padding: ${({ $active }) => getNavTokens({ active: $active }).padding};
|
|
9347
|
+
border-radius: ${({ $active }) => getNavTokens({ active: $active }).borderRadius};
|
|
9348
|
+
|
|
9382
9349
|
&:hover {
|
|
9383
|
-
color: ${
|
|
9350
|
+
color: ${({ $active }) => getNavTokens({ active: $active }).hover.color};
|
|
9351
|
+
background-color: ${({ $active }) => getNavTokens({ active: $active }).hover.backgroundColor};
|
|
9384
9352
|
}
|
|
9353
|
+
|
|
9385
9354
|
&:active {
|
|
9386
|
-
color: ${
|
|
9355
|
+
color: ${getNavTokens({ active: true }).color};
|
|
9356
|
+
background-color: ${getNavTokens({ active: true }).backgroundColor};
|
|
9387
9357
|
}
|
|
9388
9358
|
&:focus-visible,
|
|
9389
9359
|
&.focus-visible {
|
|
9390
|
-
${
|
|
9360
|
+
${focusVisibleInset};
|
|
9361
|
+
}
|
|
9362
|
+
|
|
9363
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
9364
|
+
transition: background-color 0.2s;
|
|
9391
9365
|
}
|
|
9392
|
-
${({ isCurrent }) => isCurrent && import_styled_components63.css`
|
|
9393
|
-
color: ${navLink2.current.color};
|
|
9394
|
-
background-color: ${navLink2.current.backgroundColor};
|
|
9395
|
-
&:hover {
|
|
9396
|
-
color: ${navLink2.current.color};
|
|
9397
|
-
}
|
|
9398
|
-
`}
|
|
9399
9366
|
`;
|
|
9400
|
-
var NavigationItem2 = (0,
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9367
|
+
var NavigationItem2 = (0, import_react69.forwardRef)(({ title: title3, isCurrent, ...rest }, ref) => {
|
|
9368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
9369
|
+
Link3,
|
|
9370
|
+
{
|
|
9371
|
+
...rest,
|
|
9372
|
+
ref,
|
|
9373
|
+
"aria-current": isCurrent ? "page" : void 0,
|
|
9374
|
+
$active: isCurrent != null ? isCurrent : false,
|
|
9375
|
+
children: title3
|
|
9376
|
+
}
|
|
9377
|
+
);
|
|
9407
9378
|
});
|
|
9408
9379
|
|
|
9409
9380
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
9410
|
-
var
|
|
9381
|
+
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
9411
9382
|
var InternalHeader = (props) => {
|
|
9412
9383
|
const {
|
|
9413
9384
|
applicationDesc,
|
|
@@ -9423,11 +9394,11 @@ var InternalHeader = (props) => {
|
|
|
9423
9394
|
htmlProps,
|
|
9424
9395
|
...rest
|
|
9425
9396
|
} = props;
|
|
9426
|
-
const [contextMenuIsClosed, setContextMenuIsClosed] = (0,
|
|
9427
|
-
const [currentPage, setCurrentPage] = (0,
|
|
9397
|
+
const [contextMenuIsClosed, setContextMenuIsClosed] = (0, import_react70.useState)(true);
|
|
9398
|
+
const [currentPage, setCurrentPage] = (0, import_react70.useState)(
|
|
9428
9399
|
currentPageHref
|
|
9429
9400
|
);
|
|
9430
|
-
const buttonRef = (0,
|
|
9401
|
+
const buttonRef = (0, import_react70.useRef)(null);
|
|
9431
9402
|
const handleCurrentPageChange = (href) => {
|
|
9432
9403
|
setCurrentPage(href);
|
|
9433
9404
|
onCurrentPageChange && onCurrentPageChange();
|
|
@@ -9439,10 +9410,10 @@ var InternalHeader = (props) => {
|
|
|
9439
9410
|
const hasNavigationElements = !!navigationElements && navigationElements.length > 0;
|
|
9440
9411
|
const hasContextMenuElements = !!contextMenuElements && contextMenuElements.length > 0;
|
|
9441
9412
|
const hasNavInContextMenu = smallScreen && hasNavigationElements;
|
|
9442
|
-
const
|
|
9413
|
+
const navigation2 = hasNavigationElements && !smallScreen ? /* @__PURE__ */ (0, import_jsx_runtime229.jsx)("nav", { "aria-label": "sidenavigasjon", children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(NavigationList, { children: navigationElements.map((item, index) => {
|
|
9443
9414
|
const { href, ...rest2 } = item;
|
|
9444
9415
|
const isCurrent = href === currentPage;
|
|
9445
|
-
return /* @__PURE__ */ (0,
|
|
9416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(NavLi, { children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
9446
9417
|
NavigationItem2,
|
|
9447
9418
|
{
|
|
9448
9419
|
href,
|
|
@@ -9453,45 +9424,51 @@ var InternalHeader = (props) => {
|
|
|
9453
9424
|
) }, index);
|
|
9454
9425
|
}) }) }) : null;
|
|
9455
9426
|
const hasContextMenu = hasContextMenuElements || !!userProps || hasNavInContextMenu;
|
|
9456
|
-
return /* @__PURE__ */ (0,
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime229.jsxs)(
|
|
9428
|
+
Bar2,
|
|
9429
|
+
{
|
|
9430
|
+
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
9431
|
+
$hasNavigation: !!navigation2,
|
|
9432
|
+
children: [
|
|
9433
|
+
/* @__PURE__ */ (0, import_jsx_runtime229.jsx)(Typography, { typographyType: "bodySans02", bold: true, as: "span", children: applicationName }),
|
|
9434
|
+
/* @__PURE__ */ (0, import_jsx_runtime229.jsx)(Typography, { typographyType: "bodySans02", as: "span", children: applicationDesc }),
|
|
9435
|
+
/* @__PURE__ */ (0, import_jsx_runtime229.jsx)(BarSeparator, {}),
|
|
9436
|
+
navigation2,
|
|
9437
|
+
hasContextMenu && /* @__PURE__ */ (0, import_jsx_runtime229.jsxs)(ContextMenuGroup, { children: [
|
|
9438
|
+
/* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
9439
|
+
Button,
|
|
9440
|
+
{
|
|
9441
|
+
ref: buttonRef,
|
|
9442
|
+
icon: hasNavInContextMenu ? MenuIcon : MoreVerticalIcon,
|
|
9443
|
+
appearance: "borderless",
|
|
9444
|
+
purpose: "secondary",
|
|
9445
|
+
onClick: handleContextMenuClick,
|
|
9446
|
+
"aria-haspopup": "menu",
|
|
9447
|
+
"aria-expanded": !contextMenuIsClosed ? true : void 0,
|
|
9448
|
+
"aria-label": "\xE5pne meny"
|
|
9449
|
+
}
|
|
9450
|
+
),
|
|
9451
|
+
/* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
9452
|
+
StyledOverflowMenu,
|
|
9453
|
+
{
|
|
9454
|
+
isOpen: !contextMenuIsClosed,
|
|
9455
|
+
onClose: onOveflowMenuClose,
|
|
9456
|
+
anchorRef: buttonRef,
|
|
9457
|
+
navItems: hasNavInContextMenu ? navigationElements : void 0,
|
|
9458
|
+
items: hasContextMenuElements ? contextMenuElements : void 0,
|
|
9459
|
+
userProps
|
|
9460
|
+
}
|
|
9461
|
+
)
|
|
9462
|
+
] })
|
|
9463
|
+
]
|
|
9464
|
+
}
|
|
9465
|
+
);
|
|
9489
9466
|
};
|
|
9490
9467
|
InternalHeader.displayName = "InternalHeader";
|
|
9491
9468
|
|
|
9492
9469
|
// src/components/List/List.tsx
|
|
9493
|
-
var
|
|
9494
|
-
var
|
|
9470
|
+
var import_react71 = require("react");
|
|
9471
|
+
var import_styled_components63 = __toESM(require("styled-components"));
|
|
9495
9472
|
|
|
9496
9473
|
// src/components/List/bullets/jordskifterett_bullet1.svg
|
|
9497
9474
|
var jordskifterett_bullet1_default = 'data:image/svg+xml,<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<circle cx="6.7085" cy="6.7085" r="2.625" fill="%230B0D0E"/>%0A</svg>%0A';
|
|
@@ -9503,9 +9480,9 @@ var lagmannsrett_bullet2_default = 'data:image/svg+xml,<svg width="14" height="1
|
|
|
9503
9480
|
var tingrett_bullet3_default = 'data:image/svg+xml,<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path d="M6.70817 9.33333C8.80225 9.33333 10.4998 7.50516 10.4998 5.25H2.9165C2.9165 7.50516 4.61409 9.33333 6.70817 9.33333Z" fill="%230B0D0E"/>%0A</svg>%0A';
|
|
9504
9481
|
|
|
9505
9482
|
// src/components/List/List.tokens.tsx
|
|
9506
|
-
var
|
|
9507
|
-
var { spacing: spacing25 } =
|
|
9508
|
-
var { textDefault: textDefault4 } =
|
|
9483
|
+
var import_dds_design_tokens45 = require("@norges-domstoler/dds-design-tokens");
|
|
9484
|
+
var { spacing: spacing25 } = import_dds_design_tokens45.ddsBaseTokens;
|
|
9485
|
+
var { textDefault: textDefault4 } = import_dds_design_tokens45.ddsReferenceTokens;
|
|
9509
9486
|
var ulLiPaddingLeft = `1em + ${spacing25.SizesDdsSpacingX025}`;
|
|
9510
9487
|
var ulPaddingLeft = `${spacing25.SizesDdsSpacingX2} - (${ulLiPaddingLeft})`;
|
|
9511
9488
|
var list5 = {
|
|
@@ -9537,9 +9514,9 @@ var listTokens = {
|
|
|
9537
9514
|
};
|
|
9538
9515
|
|
|
9539
9516
|
// src/components/List/List.tsx
|
|
9540
|
-
var
|
|
9517
|
+
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
9541
9518
|
var { list: list6, listItem: listItem4, bullet: bullet2 } = listTokens;
|
|
9542
|
-
var StyledList =
|
|
9519
|
+
var StyledList = import_styled_components63.default.ul`
|
|
9543
9520
|
margin: ${list6.base.margin};
|
|
9544
9521
|
color: ${list6.base.color};
|
|
9545
9522
|
ul,
|
|
@@ -9550,13 +9527,13 @@ var StyledList = import_styled_components64.default.ul`
|
|
|
9550
9527
|
${selection}
|
|
9551
9528
|
}
|
|
9552
9529
|
|
|
9553
|
-
${({ $typographyType }) => $typographyType === "inherit" ?
|
|
9530
|
+
${({ $typographyType }) => $typographyType === "inherit" ? import_styled_components63.css`
|
|
9554
9531
|
font: inherit;
|
|
9555
|
-
` :
|
|
9532
|
+
` : import_styled_components63.css`
|
|
9556
9533
|
${getFontStyling($typographyType)}
|
|
9557
9534
|
`}
|
|
9558
9535
|
|
|
9559
|
-
${({ $listType }) => $listType === "unordered" ?
|
|
9536
|
+
${({ $listType }) => $listType === "unordered" ? import_styled_components63.css`
|
|
9560
9537
|
padding-left: ${list6.ul.paddingLeft};
|
|
9561
9538
|
list-style: none;
|
|
9562
9539
|
li {
|
|
@@ -9581,7 +9558,7 @@ var StyledList = import_styled_components64.default.ul`
|
|
|
9581
9558
|
background-image: ${`url('${tingrett_bullet3_default}')`};
|
|
9582
9559
|
}
|
|
9583
9560
|
}
|
|
9584
|
-
` :
|
|
9561
|
+
` : import_styled_components63.css`
|
|
9585
9562
|
padding-left: ${list6.ol.paddingLeft};
|
|
9586
9563
|
& > li > ol {
|
|
9587
9564
|
list-style-type: lower-alpha;
|
|
@@ -9591,7 +9568,7 @@ var StyledList = import_styled_components64.default.ul`
|
|
|
9591
9568
|
}
|
|
9592
9569
|
`}
|
|
9593
9570
|
`;
|
|
9594
|
-
var List2 = (0,
|
|
9571
|
+
var List2 = (0, import_react71.forwardRef)(
|
|
9595
9572
|
(props, ref) => {
|
|
9596
9573
|
const {
|
|
9597
9574
|
listType = "unordered",
|
|
@@ -9603,7 +9580,7 @@ var List2 = (0, import_react72.forwardRef)(
|
|
|
9603
9580
|
...rest
|
|
9604
9581
|
} = props;
|
|
9605
9582
|
const as = listType === "ordered" ? "ol" : "ul";
|
|
9606
|
-
return /* @__PURE__ */ (0,
|
|
9583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
9607
9584
|
StyledList,
|
|
9608
9585
|
{
|
|
9609
9586
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -9619,26 +9596,26 @@ var List2 = (0, import_react72.forwardRef)(
|
|
|
9619
9596
|
List2.displayName = "List";
|
|
9620
9597
|
|
|
9621
9598
|
// src/components/List/ListItem.tsx
|
|
9622
|
-
var
|
|
9623
|
-
var
|
|
9624
|
-
var
|
|
9625
|
-
var StyledListItem =
|
|
9599
|
+
var import_react72 = require("react");
|
|
9600
|
+
var import_styled_components64 = __toESM(require("styled-components"));
|
|
9601
|
+
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
9602
|
+
var StyledListItem = import_styled_components64.default.li`
|
|
9626
9603
|
line-height: ${listTokens.listItem.lineHeight};
|
|
9627
9604
|
`;
|
|
9628
|
-
var ListItem2 = (0,
|
|
9605
|
+
var ListItem2 = (0, import_react72.forwardRef)(
|
|
9629
9606
|
({ children, ...rest }, ref) => {
|
|
9630
|
-
return /* @__PURE__ */ (0,
|
|
9607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(StyledListItem, { ref, ...rest, children });
|
|
9631
9608
|
}
|
|
9632
9609
|
);
|
|
9633
9610
|
ListItem2.displayName = "ListItem";
|
|
9634
9611
|
|
|
9635
9612
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9636
|
-
var
|
|
9637
|
-
var
|
|
9613
|
+
var import_react73 = require("react");
|
|
9614
|
+
var import_styled_components65 = __toESM(require("styled-components"));
|
|
9638
9615
|
|
|
9639
9616
|
// src/components/LocalMessage/LocalMessage.tokens.tsx
|
|
9640
|
-
var
|
|
9641
|
-
var { colors: colors24, spacing: spacing26, borderRadius: borderRadius6, border: border11, outerShadow: outerShadow3 } =
|
|
9617
|
+
var import_dds_design_tokens46 = require("@norges-domstoler/dds-design-tokens");
|
|
9618
|
+
var { colors: colors24, spacing: spacing26, borderRadius: borderRadius6, border: border11, outerShadow: outerShadow3 } = import_dds_design_tokens46.ddsBaseTokens;
|
|
9642
9619
|
var container9 = {
|
|
9643
9620
|
base: {
|
|
9644
9621
|
boxShadow: outerShadow3.DdsShadow1Onlight,
|
|
@@ -9728,10 +9705,10 @@ var localMessageTokens = {
|
|
|
9728
9705
|
};
|
|
9729
9706
|
|
|
9730
9707
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9731
|
-
var
|
|
9708
|
+
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
9732
9709
|
var defaultWidth4 = "400px";
|
|
9733
9710
|
var { container: container10, icon: icon7, purposeVariants: purposeVariants3 } = localMessageTokens;
|
|
9734
|
-
var Container8 =
|
|
9711
|
+
var Container8 = import_styled_components65.default.div.withConfig({
|
|
9735
9712
|
shouldForwardProp: (prop) => {
|
|
9736
9713
|
const styleOnlyProps = [
|
|
9737
9714
|
"layout",
|
|
@@ -9757,7 +9734,7 @@ var Container8 = import_styled_components66.default.div.withConfig({
|
|
|
9757
9734
|
*::selection {
|
|
9758
9735
|
${selection}
|
|
9759
9736
|
}
|
|
9760
|
-
${({ purpose }) => purpose &&
|
|
9737
|
+
${({ purpose }) => purpose && import_styled_components65.css`
|
|
9761
9738
|
border-color: ${container10.purpose[purpose].borderColor};
|
|
9762
9739
|
background-color: ${container10.purpose[purpose].backgroundColor};
|
|
9763
9740
|
`}
|
|
@@ -9782,17 +9759,17 @@ function getGridTemplateColumns(layout, closable) {
|
|
|
9782
9759
|
}
|
|
9783
9760
|
return layout === "horisontal" ? "min-content 1fr" : "1fr";
|
|
9784
9761
|
}
|
|
9785
|
-
var MessageIconWrapper2 = (0,
|
|
9762
|
+
var MessageIconWrapper2 = (0, import_styled_components65.default)(Icon)`
|
|
9786
9763
|
grid-area: icon;
|
|
9787
9764
|
`;
|
|
9788
|
-
var TextContainer2 =
|
|
9765
|
+
var TextContainer2 = import_styled_components65.default.div`
|
|
9789
9766
|
grid-area: text;
|
|
9790
9767
|
`;
|
|
9791
|
-
var CloseButton = (0,
|
|
9768
|
+
var CloseButton = (0, import_styled_components65.default)(Button)`
|
|
9792
9769
|
grid-area: closeButton;
|
|
9793
9770
|
margin: -${container10.base.padding} 0;
|
|
9794
9771
|
`;
|
|
9795
|
-
var LocalMessage = (0,
|
|
9772
|
+
var LocalMessage = (0, import_react73.forwardRef)(
|
|
9796
9773
|
(props, ref) => {
|
|
9797
9774
|
const {
|
|
9798
9775
|
message: message2,
|
|
@@ -9807,7 +9784,7 @@ var LocalMessage = (0, import_react74.forwardRef)(
|
|
|
9807
9784
|
htmlProps,
|
|
9808
9785
|
...rest
|
|
9809
9786
|
} = props;
|
|
9810
|
-
const [isClosed, setClosed] = (0,
|
|
9787
|
+
const [isClosed, setClosed] = (0, import_react73.useState)(false);
|
|
9811
9788
|
const containerProps = {
|
|
9812
9789
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
9813
9790
|
purpose,
|
|
@@ -9817,18 +9794,18 @@ var LocalMessage = (0, import_react74.forwardRef)(
|
|
|
9817
9794
|
ref
|
|
9818
9795
|
};
|
|
9819
9796
|
if (isClosed) {
|
|
9820
|
-
return /* @__PURE__ */ (0,
|
|
9797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(import_jsx_runtime232.Fragment, {});
|
|
9821
9798
|
}
|
|
9822
|
-
return /* @__PURE__ */ (0,
|
|
9823
|
-
/* @__PURE__ */ (0,
|
|
9799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(Container8, { ...containerProps, children: [
|
|
9800
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
9824
9801
|
MessageIconWrapper2,
|
|
9825
9802
|
{
|
|
9826
9803
|
icon: purposeVariants3[purpose].icon,
|
|
9827
9804
|
color: icon7[purpose].color
|
|
9828
9805
|
}
|
|
9829
9806
|
),
|
|
9830
|
-
/* @__PURE__ */ (0,
|
|
9831
|
-
closable && /* @__PURE__ */ (0,
|
|
9807
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(TextContainer2, { children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Typography, { as: "span", children: message2 }) }),
|
|
9808
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
9832
9809
|
CloseButton,
|
|
9833
9810
|
{
|
|
9834
9811
|
icon: CloseIcon,
|
|
@@ -9848,14 +9825,14 @@ var LocalMessage = (0, import_react74.forwardRef)(
|
|
|
9848
9825
|
LocalMessage.displayName = "LocalMessage";
|
|
9849
9826
|
|
|
9850
9827
|
// src/components/Modal/Modal.tsx
|
|
9851
|
-
var
|
|
9828
|
+
var import_react74 = require("react");
|
|
9852
9829
|
var import_react_dom3 = require("react-dom");
|
|
9853
|
-
var
|
|
9830
|
+
var import_styled_components67 = __toESM(require("styled-components"));
|
|
9854
9831
|
|
|
9855
9832
|
// src/components/Modal/Backdrop/Backdrop.tsx
|
|
9856
|
-
var
|
|
9857
|
-
var
|
|
9858
|
-
var Backdrop =
|
|
9833
|
+
var import_dds_design_tokens47 = require("@norges-domstoler/dds-design-tokens");
|
|
9834
|
+
var import_styled_components66 = __toESM(require("styled-components"));
|
|
9835
|
+
var Backdrop = import_styled_components66.default.div.withConfig({
|
|
9859
9836
|
shouldForwardProp: (prop) => prop !== "isOpen"
|
|
9860
9837
|
})`
|
|
9861
9838
|
position: fixed;
|
|
@@ -9863,7 +9840,7 @@ var Backdrop = import_styled_components67.default.div.withConfig({
|
|
|
9863
9840
|
align-items: center;
|
|
9864
9841
|
justify-content: center;
|
|
9865
9842
|
background-color: ${changeRGBAAlpha(
|
|
9866
|
-
|
|
9843
|
+
import_dds_design_tokens47.ddsBaseTokens.colors.DdsColorNeutralsGray9,
|
|
9867
9844
|
0.5
|
|
9868
9845
|
)};
|
|
9869
9846
|
overflow-y: auto;
|
|
@@ -9900,8 +9877,8 @@ function handleElementWithBackdropUnmount(container16) {
|
|
|
9900
9877
|
}
|
|
9901
9878
|
|
|
9902
9879
|
// src/components/Modal/Modal.tokens.tsx
|
|
9903
|
-
var
|
|
9904
|
-
var { spacing: spacing27 } =
|
|
9880
|
+
var import_dds_design_tokens48 = require("@norges-domstoler/dds-design-tokens");
|
|
9881
|
+
var { spacing: spacing27 } = import_dds_design_tokens48.ddsBaseTokens;
|
|
9905
9882
|
var container11 = {
|
|
9906
9883
|
padding: `${spacing27.SizesDdsSpacingX1} ${spacing27.SizesDdsSpacingX1} ${spacing27.SizesDdsSpacingX15} ${spacing27.SizesDdsSpacingX15}`
|
|
9907
9884
|
};
|
|
@@ -9919,9 +9896,9 @@ var modalTokens = {
|
|
|
9919
9896
|
};
|
|
9920
9897
|
|
|
9921
9898
|
// src/components/Modal/Modal.tsx
|
|
9922
|
-
var
|
|
9899
|
+
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
9923
9900
|
var { container: container12, contentContainer: contentContainer6 } = modalTokens;
|
|
9924
|
-
var Container9 = (0,
|
|
9901
|
+
var Container9 = (0, import_styled_components67.default)(Paper)`
|
|
9925
9902
|
display: flex;
|
|
9926
9903
|
flex-direction: column-reverse;
|
|
9927
9904
|
min-width: 200px;
|
|
@@ -9935,16 +9912,16 @@ var Container9 = (0, import_styled_components68.default)(Paper)`
|
|
|
9935
9912
|
${focusVisible}
|
|
9936
9913
|
}
|
|
9937
9914
|
`;
|
|
9938
|
-
var ContentContainer3 =
|
|
9915
|
+
var ContentContainer3 = import_styled_components67.default.div`
|
|
9939
9916
|
display: grid;
|
|
9940
9917
|
padding-right: ${contentContainer6.paddingRight};
|
|
9941
9918
|
gap: ${contentContainer6.gap};
|
|
9942
9919
|
`;
|
|
9943
|
-
var HeaderContainer3 =
|
|
9944
|
-
var StyledButton3 = (0,
|
|
9920
|
+
var HeaderContainer3 = import_styled_components67.default.div``;
|
|
9921
|
+
var StyledButton3 = (0, import_styled_components67.default)(Button)`
|
|
9945
9922
|
align-self: flex-end;
|
|
9946
9923
|
`;
|
|
9947
|
-
var Modal = (0,
|
|
9924
|
+
var Modal = (0, import_react74.forwardRef)((props, ref) => {
|
|
9948
9925
|
const {
|
|
9949
9926
|
isOpen = false,
|
|
9950
9927
|
parentElement = document.body,
|
|
@@ -9958,7 +9935,7 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
9958
9935
|
htmlProps,
|
|
9959
9936
|
...rest
|
|
9960
9937
|
} = props;
|
|
9961
|
-
const generatedId = (0,
|
|
9938
|
+
const generatedId = (0, import_react74.useId)();
|
|
9962
9939
|
const modalId = id != null ? id : `${generatedId}-modal`;
|
|
9963
9940
|
const headerId = `${modalId}-header`;
|
|
9964
9941
|
const modalRef = useFocusTrap(isOpen, initialFocusRef);
|
|
@@ -9970,7 +9947,7 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
9970
9947
|
onClose();
|
|
9971
9948
|
}
|
|
9972
9949
|
};
|
|
9973
|
-
(0,
|
|
9950
|
+
(0, import_react74.useEffect)(() => {
|
|
9974
9951
|
if (isOpen) {
|
|
9975
9952
|
handleElementWithBackdropMount(document.body);
|
|
9976
9953
|
} else {
|
|
@@ -9982,7 +9959,7 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
9982
9959
|
useOnKeyDown(["Escape", "Esc"], () => handleClose());
|
|
9983
9960
|
const hasTransitionedIn = useMountTransition(isOpen, 200);
|
|
9984
9961
|
return isOpen || hasTransitionedIn ? (0, import_react_dom3.createPortal)(
|
|
9985
|
-
/* @__PURE__ */ (0,
|
|
9962
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(Backdrop, { isOpen: hasTransitionedIn && isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(
|
|
9986
9963
|
Container9,
|
|
9987
9964
|
{
|
|
9988
9965
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -9995,11 +9972,11 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
9995
9972
|
id: modalId,
|
|
9996
9973
|
elevation: 4,
|
|
9997
9974
|
children: [
|
|
9998
|
-
/* @__PURE__ */ (0,
|
|
9999
|
-
header3 && /* @__PURE__ */ (0,
|
|
9975
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(ContentContainer3, { children: [
|
|
9976
|
+
header3 && /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(HeaderContainer3, { id: headerId, children: typeof header3 === "string" ? /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(Typography, { typographyType: "headingSans03", children: header3 }) : header3 }),
|
|
10000
9977
|
children
|
|
10001
9978
|
] }),
|
|
10002
|
-
onClose && /* @__PURE__ */ (0,
|
|
9979
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
10003
9980
|
StyledButton3,
|
|
10004
9981
|
{
|
|
10005
9982
|
size: "small",
|
|
@@ -10019,63 +9996,63 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
10019
9996
|
Modal.displayName = "Modal";
|
|
10020
9997
|
|
|
10021
9998
|
// src/components/Modal/ModalBody.tsx
|
|
10022
|
-
var
|
|
10023
|
-
var
|
|
10024
|
-
var
|
|
10025
|
-
var Container10 =
|
|
10026
|
-
var ModalBody = (0,
|
|
9999
|
+
var import_react75 = require("react");
|
|
10000
|
+
var import_styled_components68 = __toESM(require("styled-components"));
|
|
10001
|
+
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
10002
|
+
var Container10 = import_styled_components68.default.div``;
|
|
10003
|
+
var ModalBody = (0, import_react75.forwardRef)(
|
|
10027
10004
|
(props, ref) => {
|
|
10028
10005
|
const { children, scrollable, id, className, htmlProps, height, ...rest } = props;
|
|
10029
10006
|
const containerProps = {
|
|
10030
10007
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
10031
10008
|
ref
|
|
10032
10009
|
};
|
|
10033
|
-
return scrollable ? /* @__PURE__ */ (0,
|
|
10010
|
+
return scrollable ? /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Container10, { ...containerProps, children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(ScrollableContainer, { contentHeight: height, children }) }) : /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Container10, { ...containerProps, children });
|
|
10034
10011
|
}
|
|
10035
10012
|
);
|
|
10036
10013
|
ModalBody.displayName = "ModalBody";
|
|
10037
10014
|
|
|
10038
10015
|
// src/components/Modal/ModalActions.tsx
|
|
10039
|
-
var
|
|
10040
|
-
var
|
|
10041
|
-
var
|
|
10042
|
-
var Container11 =
|
|
10016
|
+
var import_react76 = require("react");
|
|
10017
|
+
var import_styled_components69 = __toESM(require("styled-components"));
|
|
10018
|
+
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
10019
|
+
var Container11 = import_styled_components69.default.div`
|
|
10043
10020
|
display: flex;
|
|
10044
10021
|
flex-wrap: wrap;
|
|
10045
10022
|
gap: ${modalTokens.actionsContainer.gap};
|
|
10046
10023
|
`;
|
|
10047
|
-
var ModalActions = (0,
|
|
10024
|
+
var ModalActions = (0, import_react76.forwardRef)(
|
|
10048
10025
|
({ children, ...rest }, ref) => {
|
|
10049
10026
|
const containerProps = {
|
|
10050
10027
|
ref,
|
|
10051
10028
|
...rest
|
|
10052
10029
|
};
|
|
10053
|
-
return /* @__PURE__ */ (0,
|
|
10030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(Container11, { ...containerProps, children });
|
|
10054
10031
|
}
|
|
10055
10032
|
);
|
|
10056
10033
|
ModalActions.displayName = "ModalActions";
|
|
10057
10034
|
|
|
10058
10035
|
// src/components/Pagination/Pagination.tsx
|
|
10059
|
-
var
|
|
10060
|
-
var
|
|
10036
|
+
var import_react78 = require("react");
|
|
10037
|
+
var import_styled_components71 = __toESM(require("styled-components"));
|
|
10061
10038
|
|
|
10062
10039
|
// src/components/Pagination/Pagination.tokens.tsx
|
|
10063
|
-
var
|
|
10064
|
-
var { spacing: spacing28, colors: colors25 } =
|
|
10040
|
+
var import_dds_design_tokens49 = require("@norges-domstoler/dds-design-tokens");
|
|
10041
|
+
var { spacing: spacing28, colors: colors25 } = import_dds_design_tokens49.ddsBaseTokens;
|
|
10065
10042
|
var list7 = {
|
|
10066
10043
|
gap: spacing28.SizesDdsSpacingX075
|
|
10067
10044
|
};
|
|
10068
10045
|
var truncationIcon = {
|
|
10069
10046
|
color: colors25.DdsColorNeutralsGray7
|
|
10070
10047
|
};
|
|
10071
|
-
var
|
|
10048
|
+
var outerContainer3 = {
|
|
10072
10049
|
gap: spacing28.SizesDdsSpacingX075
|
|
10073
10050
|
};
|
|
10074
10051
|
var indicatorsContainer = {
|
|
10075
10052
|
gap: spacing28.SizesDdsSpacingX075
|
|
10076
10053
|
};
|
|
10077
10054
|
var paginationTokens = {
|
|
10078
|
-
outerContainer:
|
|
10055
|
+
outerContainer: outerContainer3,
|
|
10079
10056
|
indicatorsContainer,
|
|
10080
10057
|
truncationIcon,
|
|
10081
10058
|
list: list7
|
|
@@ -10115,16 +10092,16 @@ function PaginationGenerator(pagesAmount, activePage) {
|
|
|
10115
10092
|
}
|
|
10116
10093
|
|
|
10117
10094
|
// src/components/Select/Select.tsx
|
|
10118
|
-
var
|
|
10095
|
+
var import_react77 = require("react");
|
|
10119
10096
|
var import_react_select2 = __toESM(require("react-select"));
|
|
10120
10097
|
|
|
10121
10098
|
// src/components/Select/Select.styles.ts
|
|
10122
|
-
var
|
|
10099
|
+
var import_styled_components70 = __toESM(require("styled-components"));
|
|
10123
10100
|
|
|
10124
10101
|
// src/components/Select/Select.tokens.tsx
|
|
10125
|
-
var
|
|
10126
|
-
var { colors: colors26, spacing: spacing29, borderRadius: borderRadius7, border: border12 } =
|
|
10127
|
-
var { textDefault: textDefault5 } =
|
|
10102
|
+
var import_dds_design_tokens50 = require("@norges-domstoler/dds-design-tokens");
|
|
10103
|
+
var { colors: colors26, spacing: spacing29, borderRadius: borderRadius7, border: border12 } = import_dds_design_tokens50.ddsBaseTokens;
|
|
10104
|
+
var { textDefault: textDefault5 } = import_dds_design_tokens50.ddsReferenceTokens;
|
|
10128
10105
|
var placeholderTypographyTypes = {
|
|
10129
10106
|
medium: "supportingStylePlaceholderText01",
|
|
10130
10107
|
small: "supportingStylePlaceholderText02",
|
|
@@ -10135,7 +10112,7 @@ var multiValueLabelTypographyTypes = {
|
|
|
10135
10112
|
small: "bodySans01",
|
|
10136
10113
|
tiny: "supportingStyleTiny01"
|
|
10137
10114
|
};
|
|
10138
|
-
var
|
|
10115
|
+
var typographyTypes3 = {
|
|
10139
10116
|
control: inputTypographyTypes,
|
|
10140
10117
|
option: inputTypographyTypes,
|
|
10141
10118
|
placeholder: placeholderTypographyTypes,
|
|
@@ -10219,6 +10196,7 @@ var groupHeading = {
|
|
|
10219
10196
|
};
|
|
10220
10197
|
var option = {
|
|
10221
10198
|
base: {
|
|
10199
|
+
color: textDefault5.textColor,
|
|
10222
10200
|
gap: spacing29.SizesDdsSpacingX05,
|
|
10223
10201
|
padding: `${spacing29.SizesDdsSpacingX075}`,
|
|
10224
10202
|
backgroundColor: colors26.DdsColorNeutralsWhite
|
|
@@ -10232,6 +10210,7 @@ var option = {
|
|
|
10232
10210
|
backgroundColor: colors26.DdsColorInteractiveLightest
|
|
10233
10211
|
},
|
|
10234
10212
|
selected: {
|
|
10213
|
+
color: textDefault5.textColor,
|
|
10235
10214
|
backgroundColor: colors26.DdsColorNeutralsWhite
|
|
10236
10215
|
}
|
|
10237
10216
|
};
|
|
@@ -10306,7 +10285,7 @@ var prefix = "dds-select";
|
|
|
10306
10285
|
function getContainerControlPadding(componentSize, isMulti) {
|
|
10307
10286
|
return isMulti ? control2.isMulti.sizes[componentSize].padding : control2.sizes[componentSize].padding;
|
|
10308
10287
|
}
|
|
10309
|
-
var Container12 =
|
|
10288
|
+
var Container12 = import_styled_components70.default.div`
|
|
10310
10289
|
margin: 0;
|
|
10311
10290
|
width: ${({ $width }) => $width};
|
|
10312
10291
|
position: relative;
|
|
@@ -10315,23 +10294,23 @@ var Container12 = import_styled_components71.default.div`
|
|
|
10315
10294
|
${selection}
|
|
10316
10295
|
}
|
|
10317
10296
|
|
|
10318
|
-
${({ $componentSize, $isMulti }) =>
|
|
10297
|
+
${({ $componentSize, $isMulti }) => import_styled_components70.css`
|
|
10319
10298
|
.${prefix}__control {
|
|
10320
10299
|
padding: ${getContainerControlPadding($componentSize, $isMulti)};
|
|
10321
|
-
${getFontStyling(
|
|
10300
|
+
${getFontStyling(typographyTypes3.control[$componentSize], true)}
|
|
10322
10301
|
}
|
|
10323
10302
|
.${prefix}__option {
|
|
10324
|
-
${getFontStyling(
|
|
10303
|
+
${getFontStyling(typographyTypes3.option[$componentSize], true)}
|
|
10325
10304
|
}
|
|
10326
10305
|
.${prefix}__placeholder {
|
|
10327
|
-
${getFontStyling(
|
|
10306
|
+
${getFontStyling(typographyTypes3.placeholder[$componentSize])}
|
|
10328
10307
|
}
|
|
10329
10308
|
.${prefix}__menu-notice--no-options {
|
|
10330
|
-
${getFontStyling(
|
|
10309
|
+
${getFontStyling(typographyTypes3.noOptionsMessage[$componentSize])}
|
|
10331
10310
|
}
|
|
10332
10311
|
`}
|
|
10333
10312
|
|
|
10334
|
-
${({ $errorMessage }) => $errorMessage &&
|
|
10313
|
+
${({ $errorMessage }) => $errorMessage && import_styled_components70.css`
|
|
10335
10314
|
.${prefix}__control {
|
|
10336
10315
|
${dangerInputfield}
|
|
10337
10316
|
}
|
|
@@ -10350,7 +10329,7 @@ var Container12 = import_styled_components71.default.div`
|
|
|
10350
10329
|
color: ${dropdownIndicator2.hover.color};
|
|
10351
10330
|
}
|
|
10352
10331
|
|
|
10353
|
-
${({ $isDisabled, $readOnly }) => $readOnly ?
|
|
10332
|
+
${({ $isDisabled, $readOnly }) => $readOnly ? import_styled_components70.css`
|
|
10354
10333
|
.${prefix}__control {
|
|
10355
10334
|
border-color: ${control2.readOnly.borderColor};
|
|
10356
10335
|
background-color: ${control2.readOnly.backgroundColor};
|
|
@@ -10360,7 +10339,7 @@ var Container12 = import_styled_components71.default.div`
|
|
|
10360
10339
|
.${prefix}__dropdown-indicator {
|
|
10361
10340
|
color: ${dropdownIndicator2.readOnly.color};
|
|
10362
10341
|
}
|
|
10363
|
-
` : $isDisabled ?
|
|
10342
|
+
` : $isDisabled ? import_styled_components70.css`
|
|
10364
10343
|
cursor: not-allowed;
|
|
10365
10344
|
.${prefix}__control {
|
|
10366
10345
|
border-color: ${control2.disabled.borderColor};
|
|
@@ -10371,14 +10350,14 @@ var Container12 = import_styled_components71.default.div`
|
|
|
10371
10350
|
}
|
|
10372
10351
|
` : ""}
|
|
10373
10352
|
`;
|
|
10374
|
-
var InnerSingleValue =
|
|
10353
|
+
var InnerSingleValue = import_styled_components70.default.div`
|
|
10375
10354
|
overflow: hidden;
|
|
10376
10355
|
text-overflow: ellipsis;
|
|
10377
10356
|
white-space: nowrap;
|
|
10378
10357
|
box-sizing: border-box;
|
|
10379
10358
|
max-width: 100%;
|
|
10380
10359
|
`;
|
|
10381
|
-
var StyledIcon4 = (0,
|
|
10360
|
+
var StyledIcon4 = (0, import_styled_components70.default)(Icon)`
|
|
10382
10361
|
margin-right: ${icon9.marginRight};
|
|
10383
10362
|
`;
|
|
10384
10363
|
var getCustomStyles = (size2) => ({
|
|
@@ -10441,7 +10420,7 @@ var getCustomStyles = (size2) => ({
|
|
|
10441
10420
|
multiValueLabel: (provided) => ({
|
|
10442
10421
|
...provided,
|
|
10443
10422
|
padding: multiValueLabel2.padding,
|
|
10444
|
-
...getFontStyling(
|
|
10423
|
+
...getFontStyling(typographyTypes3.multiValueLabel[size2]),
|
|
10445
10424
|
color: multiValueLabel2.color
|
|
10446
10425
|
}),
|
|
10447
10426
|
multiValueRemove: (provided, state) => state.selectProps.isDisabled ? {
|
|
@@ -10475,11 +10454,15 @@ var getCustomStyles = (size2) => ({
|
|
|
10475
10454
|
marginTop: menu2.marginTop,
|
|
10476
10455
|
marginBottom: menu2.marginBottom
|
|
10477
10456
|
}),
|
|
10457
|
+
menuPortal: (provided) => ({
|
|
10458
|
+
...provided,
|
|
10459
|
+
zIndex: 99999
|
|
10460
|
+
}),
|
|
10478
10461
|
group: () => ({
|
|
10479
10462
|
boxSizing: "border-box"
|
|
10480
10463
|
}),
|
|
10481
10464
|
groupHeading: () => ({
|
|
10482
|
-
...getFontStyling(
|
|
10465
|
+
...getFontStyling(typographyTypes3.groupHeading),
|
|
10483
10466
|
color: groupHeading2.color,
|
|
10484
10467
|
padding: groupHeading2.padding
|
|
10485
10468
|
}),
|
|
@@ -10498,6 +10481,7 @@ var getCustomStyles = (size2) => ({
|
|
|
10498
10481
|
alignItems: "center",
|
|
10499
10482
|
gap: option2.base.gap,
|
|
10500
10483
|
padding: option2.base.padding,
|
|
10484
|
+
color: option2.base.color,
|
|
10501
10485
|
backgroundColor: option2.base.backgroundColor,
|
|
10502
10486
|
"@media (prefers-reduced-motion: no-preference)": {
|
|
10503
10487
|
transition: "color 0.2s, background-color 0.2s"
|
|
@@ -10507,6 +10491,7 @@ var getCustomStyles = (size2) => ({
|
|
|
10507
10491
|
backgroundColor: option2.hover.backgroundColor
|
|
10508
10492
|
},
|
|
10509
10493
|
...state.isSelected && {
|
|
10494
|
+
color: option2.selected.color,
|
|
10510
10495
|
backgroundColor: option2.selected.backgroundColor
|
|
10511
10496
|
},
|
|
10512
10497
|
...state.isFocused && {
|
|
@@ -10537,7 +10522,7 @@ var getCustomStyles = (size2) => ({
|
|
|
10537
10522
|
|
|
10538
10523
|
// src/components/Select/SelectComponents.tsx
|
|
10539
10524
|
var import_react_select = require("react-select");
|
|
10540
|
-
var
|
|
10525
|
+
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
10541
10526
|
var {
|
|
10542
10527
|
Option,
|
|
10543
10528
|
NoOptionsMessage,
|
|
@@ -10548,17 +10533,17 @@ var {
|
|
|
10548
10533
|
MultiValueRemove,
|
|
10549
10534
|
Control
|
|
10550
10535
|
} = import_react_select.components;
|
|
10551
|
-
var DDSOption = (props, componentSize) => /* @__PURE__ */ (0,
|
|
10552
|
-
props.isSelected && /* @__PURE__ */ (0,
|
|
10536
|
+
var DDSOption = (props, componentSize) => /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(Option, { ...props, children: [
|
|
10537
|
+
props.isSelected && /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Icon, { icon: CheckIcon, iconSize: getFormInputIconSize(componentSize) }),
|
|
10553
10538
|
props.children
|
|
10554
10539
|
] });
|
|
10555
|
-
var CustomOption = (props, Element) => /* @__PURE__ */ (0,
|
|
10556
|
-
var CustomSingleValue = (props, id, Element) => /* @__PURE__ */ (0,
|
|
10557
|
-
var DDSNoOptionsMessage = (props) => /* @__PURE__ */ (0,
|
|
10558
|
-
var DDSClearIndicator = (props, size2) => /* @__PURE__ */ (0,
|
|
10559
|
-
var DDSMultiValueRemove = (props) => /* @__PURE__ */ (0,
|
|
10560
|
-
var DDSDropdownIndicator = (props, size2) => /* @__PURE__ */ (0,
|
|
10561
|
-
var DDSInput = (props, ariaInvalid, ariaDescribedby) => /* @__PURE__ */ (0,
|
|
10540
|
+
var CustomOption = (props, Element) => /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Option, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Element, { ...props }) });
|
|
10541
|
+
var CustomSingleValue = (props, id, Element) => /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(SingleValue, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(InnerSingleValue, { id, children: Element ? /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Element, { ...props }) : props.children }) });
|
|
10542
|
+
var DDSNoOptionsMessage = (props) => /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(NoOptionsMessage, { ...props, children: "Ingen treff" });
|
|
10543
|
+
var DDSClearIndicator = (props, size2) => /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(ClearIndicator, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Icon, { icon: CloseSmallIcon, iconSize: getFormInputIconSize(size2) }) });
|
|
10544
|
+
var DDSMultiValueRemove = (props) => /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(MultiValueRemove, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Icon, { icon: CloseSmallIcon, iconSize: "small" }) });
|
|
10545
|
+
var DDSDropdownIndicator = (props, size2) => /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(DropdownIndicator, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Icon, { icon: ChevronDownIcon, iconSize: getFormInputIconSize(size2) }) });
|
|
10546
|
+
var DDSInput = (props, ariaInvalid, ariaDescribedby) => /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
10562
10547
|
Input2,
|
|
10563
10548
|
{
|
|
10564
10549
|
...props,
|
|
@@ -10566,13 +10551,13 @@ var DDSInput = (props, ariaInvalid, ariaDescribedby) => /* @__PURE__ */ (0, impo
|
|
|
10566
10551
|
"aria-describedby": ariaDescribedby
|
|
10567
10552
|
}
|
|
10568
10553
|
);
|
|
10569
|
-
var DDSControl = (props, componentSize, icon12) => /* @__PURE__ */ (0,
|
|
10570
|
-
icon12 && /* @__PURE__ */ (0,
|
|
10554
|
+
var DDSControl = (props, componentSize, icon12) => /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(Control, { ...props, children: [
|
|
10555
|
+
icon12 && /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(StyledIcon4, { icon: icon12, iconSize: getFormInputIconSize(componentSize) }),
|
|
10571
10556
|
props.children
|
|
10572
10557
|
] });
|
|
10573
10558
|
|
|
10574
10559
|
// src/components/Select/Select.tsx
|
|
10575
|
-
var
|
|
10560
|
+
var import_jsx_runtime237 = require("react/jsx-runtime");
|
|
10576
10561
|
var defaultWidth5 = "320px";
|
|
10577
10562
|
var getPlaceholder = (placeholder3, isMulti) => placeholder3 ? placeholder3 : isMulti ? "-- Velg en eller flere --" : "-- Velg fra listen --";
|
|
10578
10563
|
function SelectInner(props, ref) {
|
|
@@ -10601,7 +10586,7 @@ function SelectInner(props, ref) {
|
|
|
10601
10586
|
customSingleValueElement,
|
|
10602
10587
|
...rest
|
|
10603
10588
|
} = props;
|
|
10604
|
-
const generatedId = (0,
|
|
10589
|
+
const generatedId = (0, import_react77.useId)();
|
|
10605
10590
|
const uniqueId = id != null ? id : `${generatedId}-select`;
|
|
10606
10591
|
const singleValueId = !isMulti ? `${uniqueId}-singleValue` : void 0;
|
|
10607
10592
|
const hasLabel = !!label3;
|
|
@@ -10659,57 +10644,57 @@ function SelectInner(props, ref) {
|
|
|
10659
10644
|
menuPortalTarget: document == null ? void 0 : document.body,
|
|
10660
10645
|
...rest
|
|
10661
10646
|
};
|
|
10662
|
-
return /* @__PURE__ */ (0,
|
|
10663
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
10664
|
-
/* @__PURE__ */ (0,
|
|
10647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime237.jsxs)(Container12, { ...containerProps, children: [
|
|
10648
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Label, { htmlFor: uniqueId, showRequiredStyling, children: label3 }),
|
|
10649
|
+
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(import_react_select2.default, { ...reactSelectProps, ref }),
|
|
10665
10650
|
renderInputMessage(tip, tipId, errorMessage, errorMessageId)
|
|
10666
10651
|
] });
|
|
10667
10652
|
}
|
|
10668
|
-
var Select = (0,
|
|
10653
|
+
var Select = (0, import_react77.forwardRef)(SelectInner);
|
|
10669
10654
|
Select.displayName = "Select";
|
|
10670
10655
|
|
|
10671
10656
|
// src/components/Select/utils.ts
|
|
10672
10657
|
var createSelectOptions = (...args) => args.map((v) => ({ label: v, value: v }));
|
|
10673
10658
|
|
|
10674
10659
|
// src/components/Pagination/Pagination.tsx
|
|
10675
|
-
var
|
|
10676
|
-
var { outerContainer:
|
|
10677
|
-
var Nav2 =
|
|
10660
|
+
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
10661
|
+
var { outerContainer: outerContainer4, indicatorsContainer: indicatorsContainer2, truncationIcon: truncationIcon2, list: list8 } = paginationTokens;
|
|
10662
|
+
var Nav2 = import_styled_components71.default.nav`
|
|
10678
10663
|
display: flex;
|
|
10679
10664
|
align-items: center;
|
|
10680
10665
|
`;
|
|
10681
|
-
var List3 =
|
|
10666
|
+
var List3 = import_styled_components71.default.ol`
|
|
10682
10667
|
display: grid;
|
|
10683
10668
|
grid-auto-flow: column;
|
|
10684
10669
|
gap: ${list8.gap};
|
|
10685
10670
|
margin: 0;
|
|
10686
10671
|
padding: 0;
|
|
10687
10672
|
`;
|
|
10688
|
-
var ListItem3 =
|
|
10673
|
+
var ListItem3 = import_styled_components71.default.li`
|
|
10689
10674
|
display: inline-grid;
|
|
10690
10675
|
align-content: center;
|
|
10691
|
-
${({ $isHidden }) => $isHidden &&
|
|
10676
|
+
${({ $isHidden }) => $isHidden && import_styled_components71.css`
|
|
10692
10677
|
visibility: hidden;
|
|
10693
10678
|
`}
|
|
10694
10679
|
`;
|
|
10695
|
-
var
|
|
10680
|
+
var OuterContainer = import_styled_components71.default.div`
|
|
10696
10681
|
display: flex;
|
|
10697
|
-
gap: ${
|
|
10698
|
-
${({ $smallScreen }) => $smallScreen ?
|
|
10682
|
+
gap: ${outerContainer4.gap};
|
|
10683
|
+
${({ $smallScreen }) => $smallScreen ? import_styled_components71.css`
|
|
10699
10684
|
flex-direction: column;
|
|
10700
10685
|
align-items: center;
|
|
10701
|
-
` :
|
|
10686
|
+
` : import_styled_components71.css`
|
|
10702
10687
|
justify-content: space-between;
|
|
10703
10688
|
flex-wrap: wrap;
|
|
10704
10689
|
`}
|
|
10705
10690
|
`;
|
|
10706
|
-
var IndicatorsContainer =
|
|
10691
|
+
var IndicatorsContainer = import_styled_components71.default.div`
|
|
10707
10692
|
display: grid;
|
|
10708
10693
|
grid-auto-flow: column;
|
|
10709
10694
|
align-items: center;
|
|
10710
10695
|
gap: ${indicatorsContainer2.gap};
|
|
10711
10696
|
`;
|
|
10712
|
-
var Pagination = (0,
|
|
10697
|
+
var Pagination = (0, import_react78.forwardRef)(
|
|
10713
10698
|
(props, ref) => {
|
|
10714
10699
|
const {
|
|
10715
10700
|
itemsAmount,
|
|
@@ -10732,8 +10717,8 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10732
10717
|
htmlProps,
|
|
10733
10718
|
...rest
|
|
10734
10719
|
} = props;
|
|
10735
|
-
const [activePage, setActivePage] = (0,
|
|
10736
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
10720
|
+
const [activePage, setActivePage] = (0, import_react78.useState)(defaultActivePage);
|
|
10721
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react78.useState)(defaultItemsPerPage);
|
|
10737
10722
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
10738
10723
|
const items = PaginationGenerator(pagesLength, activePage);
|
|
10739
10724
|
const onPageChange = (event, page) => {
|
|
@@ -10752,7 +10737,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10752
10737
|
};
|
|
10753
10738
|
const listItems = items.length > 0 ? items.map((item, i) => {
|
|
10754
10739
|
const isActive = item === activePage;
|
|
10755
|
-
return /* @__PURE__ */ (0,
|
|
10740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ListItem3, { children: item !== "truncator" ? /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10756
10741
|
Button,
|
|
10757
10742
|
{
|
|
10758
10743
|
purpose: isActive ? "primary" : "secondary",
|
|
@@ -10764,7 +10749,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10764
10749
|
"aria-label": isActive ? `N\xE5v\xE6rende side (side ${item})` : `G\xE5 til side ${item}`,
|
|
10765
10750
|
children: item
|
|
10766
10751
|
}
|
|
10767
|
-
) : /* @__PURE__ */ (0,
|
|
10752
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10768
10753
|
Icon,
|
|
10769
10754
|
{
|
|
10770
10755
|
icon: MoreHorizontalIcon,
|
|
@@ -10772,7 +10757,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10772
10757
|
}
|
|
10773
10758
|
) }, `pagination-item-${i}`);
|
|
10774
10759
|
}) : void 0;
|
|
10775
|
-
const previousPageButton = /* @__PURE__ */ (0,
|
|
10760
|
+
const previousPageButton = /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10776
10761
|
Button,
|
|
10777
10762
|
{
|
|
10778
10763
|
purpose: "secondary",
|
|
@@ -10785,7 +10770,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10785
10770
|
"aria-label": "G\xE5 til forrige siden"
|
|
10786
10771
|
}
|
|
10787
10772
|
);
|
|
10788
|
-
const nextPageButton = /* @__PURE__ */ (0,
|
|
10773
|
+
const nextPageButton = /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10789
10774
|
Button,
|
|
10790
10775
|
{
|
|
10791
10776
|
purpose: "secondary",
|
|
@@ -10807,13 +10792,13 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10807
10792
|
};
|
|
10808
10793
|
const isOnFirstPage = activePage === 1;
|
|
10809
10794
|
const isOnLastPage = activePage === pagesLength;
|
|
10810
|
-
const
|
|
10811
|
-
/* @__PURE__ */ (0,
|
|
10795
|
+
const navigation2 = withPagination ? /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Nav2, { ref, "aria-label": "paginering", ...navProps, children: /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(List3, { children: [
|
|
10796
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ListItem3, { $isHidden: isOnFirstPage, "aria-hidden": isOnFirstPage, children: previousPageButton }),
|
|
10812
10797
|
listItems,
|
|
10813
|
-
/* @__PURE__ */ (0,
|
|
10798
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ListItem3, { $isHidden: isOnLastPage, "aria-hidden": isOnLastPage, children: nextPageButton })
|
|
10814
10799
|
] }) }) : null;
|
|
10815
|
-
const smallScreenNavigation = withPagination ? /* @__PURE__ */ (0,
|
|
10816
|
-
/* @__PURE__ */ (0,
|
|
10800
|
+
const smallScreenNavigation = withPagination ? /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Nav2, { ref, "aria-label": "paginering", ...navProps, children: /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(List3, { children: [
|
|
10801
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ListItem3, { $isHidden: isOnFirstPage, "aria-hidden": isOnFirstPage, children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10817
10802
|
Button,
|
|
10818
10803
|
{
|
|
10819
10804
|
purpose: "secondary",
|
|
@@ -10826,8 +10811,8 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10826
10811
|
"aria-label": "G\xE5 til f\xF8rste siden"
|
|
10827
10812
|
}
|
|
10828
10813
|
) }),
|
|
10829
|
-
/* @__PURE__ */ (0,
|
|
10830
|
-
/* @__PURE__ */ (0,
|
|
10814
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ListItem3, { $isHidden: isOnFirstPage, "aria-hidden": isOnFirstPage, children: previousPageButton }),
|
|
10815
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ListItem3, { children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10831
10816
|
Button,
|
|
10832
10817
|
{
|
|
10833
10818
|
size: "small",
|
|
@@ -10837,8 +10822,8 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10837
10822
|
children: activePage
|
|
10838
10823
|
}
|
|
10839
10824
|
) }),
|
|
10840
|
-
/* @__PURE__ */ (0,
|
|
10841
|
-
/* @__PURE__ */ (0,
|
|
10825
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ListItem3, { $isHidden: isOnLastPage, "aria-hidden": isOnLastPage, children: nextPageButton }),
|
|
10826
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ListItem3, { $isHidden: isOnLastPage, "aria-hidden": isOnLastPage, children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10842
10827
|
Button,
|
|
10843
10828
|
{
|
|
10844
10829
|
purpose: "secondary",
|
|
@@ -10854,10 +10839,10 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10854
10839
|
] }) }) : null;
|
|
10855
10840
|
const activePageFirstItem = activePage === 1 ? 1 : activePage * itemsPerPage - itemsPerPage + 1;
|
|
10856
10841
|
const activePageLastItem = activePage === pagesLength ? itemsAmount : activePage * itemsPerPage;
|
|
10857
|
-
const navigationToBeRendered = smallScreen ? smallScreenNavigation :
|
|
10858
|
-
return !withCounter && !withSelect ? navigationToBeRendered : /* @__PURE__ */ (0,
|
|
10859
|
-
/* @__PURE__ */ (0,
|
|
10860
|
-
withSelect && /* @__PURE__ */ (0,
|
|
10842
|
+
const navigationToBeRendered = smallScreen ? smallScreenNavigation : navigation2;
|
|
10843
|
+
return !withCounter && !withSelect ? navigationToBeRendered : /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(OuterContainer, { ...containerProps, children: [
|
|
10844
|
+
/* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(IndicatorsContainer, { children: [
|
|
10845
|
+
withSelect && /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10861
10846
|
Select,
|
|
10862
10847
|
{
|
|
10863
10848
|
options: selectOptions,
|
|
@@ -10872,7 +10857,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10872
10857
|
"aria-label": "Antall elementer per side"
|
|
10873
10858
|
}
|
|
10874
10859
|
),
|
|
10875
|
-
withCounter && /* @__PURE__ */ (0,
|
|
10860
|
+
withCounter && /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(Typography, { typographyType: "supportingStyleLabel01", as: "p", children: [
|
|
10876
10861
|
"Viser ",
|
|
10877
10862
|
activePageFirstItem,
|
|
10878
10863
|
"-",
|
|
@@ -10888,13 +10873,13 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10888
10873
|
Pagination.displayName = "Pagination";
|
|
10889
10874
|
|
|
10890
10875
|
// src/components/Popover/Popover.tsx
|
|
10891
|
-
var
|
|
10892
|
-
var
|
|
10893
|
-
var
|
|
10876
|
+
var import_dds_design_tokens52 = require("@norges-domstoler/dds-design-tokens");
|
|
10877
|
+
var import_react79 = require("react");
|
|
10878
|
+
var import_styled_components72 = __toESM(require("styled-components"));
|
|
10894
10879
|
|
|
10895
10880
|
// src/components/Popover/Popover.tokens.tsx
|
|
10896
|
-
var
|
|
10897
|
-
var { spacing: spacing30 } =
|
|
10881
|
+
var import_dds_design_tokens51 = require("@norges-domstoler/dds-design-tokens");
|
|
10882
|
+
var { spacing: spacing30 } = import_dds_design_tokens51.ddsBaseTokens;
|
|
10898
10883
|
var wrapper3 = {
|
|
10899
10884
|
padding: `${spacing30.SizesDdsSpacingX075} ${spacing30.SizesDdsSpacingX1} ${spacing30.SizesDdsSpacingX15} ${spacing30.SizesDdsSpacingX1}`
|
|
10900
10885
|
};
|
|
@@ -10918,10 +10903,10 @@ var popoverTokens2 = {
|
|
|
10918
10903
|
};
|
|
10919
10904
|
|
|
10920
10905
|
// src/components/Popover/Popover.tsx
|
|
10921
|
-
var
|
|
10922
|
-
var { spacing: Spacing } =
|
|
10906
|
+
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
10907
|
+
var { spacing: Spacing } = import_dds_design_tokens52.ddsBaseTokens;
|
|
10923
10908
|
var { wrapper: wrapper4, content: content4, closeButton: closeButton2, title: title2 } = popoverTokens2;
|
|
10924
|
-
var Wrapper4 = (0,
|
|
10909
|
+
var Wrapper4 = (0, import_styled_components72.default)(Paper)`
|
|
10925
10910
|
opacity: 0;
|
|
10926
10911
|
${({ $hasTransitionedIn, $isOpen }) => $hasTransitionedIn && visibilityTransition($hasTransitionedIn && $isOpen)}
|
|
10927
10912
|
position: absolute;
|
|
@@ -10932,7 +10917,7 @@ var Wrapper4 = (0, import_styled_components73.default)(Paper)`
|
|
|
10932
10917
|
&:focus-visible {
|
|
10933
10918
|
${focusVisible}
|
|
10934
10919
|
}
|
|
10935
|
-
${({ $sizeProps }) => $sizeProps &&
|
|
10920
|
+
${({ $sizeProps }) => $sizeProps && import_styled_components72.css`
|
|
10936
10921
|
width: ${$sizeProps.width};
|
|
10937
10922
|
height: ${$sizeProps.height};
|
|
10938
10923
|
min-width: ${$sizeProps.minWidth};
|
|
@@ -10941,20 +10926,20 @@ var Wrapper4 = (0, import_styled_components73.default)(Paper)`
|
|
|
10941
10926
|
max-height: ${$sizeProps.maxHeight};
|
|
10942
10927
|
`}
|
|
10943
10928
|
`;
|
|
10944
|
-
var TitleContainer =
|
|
10929
|
+
var TitleContainer = import_styled_components72.default.div`
|
|
10945
10930
|
margin-right: ${title2.marginRight};
|
|
10946
10931
|
`;
|
|
10947
|
-
var ContentContainer4 =
|
|
10948
|
-
${({ $withCloseButton, $hasTitle }) => $withCloseButton && !$hasTitle &&
|
|
10932
|
+
var ContentContainer4 = import_styled_components72.default.div`
|
|
10933
|
+
${({ $withCloseButton, $hasTitle }) => $withCloseButton && !$hasTitle && import_styled_components72.css`
|
|
10949
10934
|
margin-top: ${content4.noTitle.marginTop};
|
|
10950
10935
|
`}
|
|
10951
10936
|
`;
|
|
10952
|
-
var StyledButton4 = (0,
|
|
10937
|
+
var StyledButton4 = (0, import_styled_components72.default)(Button)`
|
|
10953
10938
|
position: absolute;
|
|
10954
10939
|
top: ${closeButton2.top};
|
|
10955
10940
|
right: ${closeButton2.right};
|
|
10956
10941
|
`;
|
|
10957
|
-
var Popover = (0,
|
|
10942
|
+
var Popover = (0, import_react79.forwardRef)(
|
|
10958
10943
|
(props, ref) => {
|
|
10959
10944
|
const {
|
|
10960
10945
|
title: title3,
|
|
@@ -10994,7 +10979,7 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
10994
10979
|
if (isOpen)
|
|
10995
10980
|
onClose && onClose();
|
|
10996
10981
|
});
|
|
10997
|
-
return isOpen || hasTransitionedIn ? /* @__PURE__ */ (0,
|
|
10982
|
+
return isOpen || hasTransitionedIn ? /* @__PURE__ */ (0, import_jsx_runtime239.jsxs)(
|
|
10998
10983
|
Wrapper4,
|
|
10999
10984
|
{
|
|
11000
10985
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -11007,8 +10992,8 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
11007
10992
|
elevation: 3,
|
|
11008
10993
|
border: "light",
|
|
11009
10994
|
children: [
|
|
11010
|
-
title3 && /* @__PURE__ */ (0,
|
|
11011
|
-
/* @__PURE__ */ (0,
|
|
10995
|
+
title3 && /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(TitleContainer, { children: typeof title3 === "string" ? /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(Typography, { typographyType: "headingSans02", children: title3 }) : title3 }),
|
|
10996
|
+
/* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
|
|
11012
10997
|
ContentContainer4,
|
|
11013
10998
|
{
|
|
11014
10999
|
$hasTitle: !!title3,
|
|
@@ -11016,7 +11001,7 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
11016
11001
|
children
|
|
11017
11002
|
}
|
|
11018
11003
|
),
|
|
11019
|
-
withCloseButton && /* @__PURE__ */ (0,
|
|
11004
|
+
withCloseButton && /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
|
|
11020
11005
|
StyledButton4,
|
|
11021
11006
|
{
|
|
11022
11007
|
icon: CloseIcon,
|
|
@@ -11035,8 +11020,8 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
11035
11020
|
Popover.displayName = "Popover";
|
|
11036
11021
|
|
|
11037
11022
|
// src/components/Popover/PopoverGroup.tsx
|
|
11038
|
-
var
|
|
11039
|
-
var
|
|
11023
|
+
var import_react80 = require("react");
|
|
11024
|
+
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
11040
11025
|
var PopoverGroup = ({
|
|
11041
11026
|
isOpen = false,
|
|
11042
11027
|
onCloseButtonClick,
|
|
@@ -11044,8 +11029,8 @@ var PopoverGroup = ({
|
|
|
11044
11029
|
children,
|
|
11045
11030
|
popoverId
|
|
11046
11031
|
}) => {
|
|
11047
|
-
const [open, setOpen] = (0,
|
|
11048
|
-
const generatedId = (0,
|
|
11032
|
+
const [open, setOpen] = (0, import_react80.useState)(isOpen);
|
|
11033
|
+
const generatedId = (0, import_react80.useId)();
|
|
11049
11034
|
const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
|
|
11050
11035
|
const handleOnCloseButtonClick = () => {
|
|
11051
11036
|
setOpen(false);
|
|
@@ -11055,8 +11040,8 @@ var PopoverGroup = ({
|
|
|
11055
11040
|
setOpen(!open);
|
|
11056
11041
|
onTriggerClick && onTriggerClick();
|
|
11057
11042
|
};
|
|
11058
|
-
const buttonRef = (0,
|
|
11059
|
-
const popoverRef = (0,
|
|
11043
|
+
const buttonRef = (0, import_react80.useRef)(null);
|
|
11044
|
+
const popoverRef = (0, import_react80.useRef)(null);
|
|
11060
11045
|
useOnKeyDown(["Esc", "Escape"], () => {
|
|
11061
11046
|
var _a;
|
|
11062
11047
|
if (open) {
|
|
@@ -11065,14 +11050,14 @@ var PopoverGroup = ({
|
|
|
11065
11050
|
}
|
|
11066
11051
|
});
|
|
11067
11052
|
const handleClose = () => setOpen(false);
|
|
11068
|
-
const Children9 =
|
|
11069
|
-
return (0,
|
|
11053
|
+
const Children9 = import_react80.Children.map(children, (child, childIndex) => {
|
|
11054
|
+
return (0, import_react80.isValidElement)(child) && (childIndex === 0 ? (0, import_react80.cloneElement)(child, {
|
|
11070
11055
|
"aria-haspopup": "dialog",
|
|
11071
11056
|
"aria-controls": uniquePopoverId,
|
|
11072
11057
|
"aria-expanded": open,
|
|
11073
11058
|
onClick: handleOnTriggerClick,
|
|
11074
11059
|
ref: buttonRef
|
|
11075
|
-
}) : (0,
|
|
11060
|
+
}) : (0, import_react80.cloneElement)(child, {
|
|
11076
11061
|
isOpen: open,
|
|
11077
11062
|
"aria-hidden": !open,
|
|
11078
11063
|
id: uniquePopoverId,
|
|
@@ -11082,27 +11067,27 @@ var PopoverGroup = ({
|
|
|
11082
11067
|
onClose: handleClose
|
|
11083
11068
|
}));
|
|
11084
11069
|
});
|
|
11085
|
-
return /* @__PURE__ */ (0,
|
|
11070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(import_jsx_runtime240.Fragment, { children: Children9 });
|
|
11086
11071
|
};
|
|
11087
11072
|
PopoverGroup.displayName = "PopoverGroup";
|
|
11088
11073
|
|
|
11089
11074
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
11090
|
-
var
|
|
11091
|
-
var
|
|
11075
|
+
var import_react83 = require("react");
|
|
11076
|
+
var import_styled_components74 = __toESM(require("styled-components"));
|
|
11092
11077
|
|
|
11093
11078
|
// src/components/ProgressTracker/ProgressTracker.context.tsx
|
|
11094
|
-
var
|
|
11095
|
-
var ProgressTrackerContext = (0,
|
|
11079
|
+
var import_react81 = require("react");
|
|
11080
|
+
var ProgressTrackerContext = (0, import_react81.createContext)(
|
|
11096
11081
|
{
|
|
11097
11082
|
activeStep: 0
|
|
11098
11083
|
}
|
|
11099
11084
|
);
|
|
11100
|
-
var useProgressTrackerContext = () => (0,
|
|
11085
|
+
var useProgressTrackerContext = () => (0, import_react81.useContext)(ProgressTrackerContext);
|
|
11101
11086
|
|
|
11102
11087
|
// src/components/ProgressTracker/ProgressTracker.tokens.tsx
|
|
11103
|
-
var
|
|
11104
|
-
var { colors: colors27, spacing: spacing31 } =
|
|
11105
|
-
var
|
|
11088
|
+
var import_dds_design_tokens53 = require("@norges-domstoler/dds-design-tokens");
|
|
11089
|
+
var { colors: colors27, spacing: spacing31 } = import_dds_design_tokens53.ddsBaseTokens;
|
|
11090
|
+
var typographyTypes4 = {
|
|
11106
11091
|
number: "bodySans01",
|
|
11107
11092
|
label: "bodySans03"
|
|
11108
11093
|
};
|
|
@@ -11179,9 +11164,9 @@ var progressTrackerTokens = {
|
|
|
11179
11164
|
};
|
|
11180
11165
|
|
|
11181
11166
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
11182
|
-
var
|
|
11183
|
-
var
|
|
11184
|
-
var
|
|
11167
|
+
var import_react82 = require("react");
|
|
11168
|
+
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11169
|
+
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
11185
11170
|
var toItemState = (active, completed, disabled) => {
|
|
11186
11171
|
if (disabled) {
|
|
11187
11172
|
return "disabled";
|
|
@@ -11193,13 +11178,13 @@ var toItemState = (active, completed, disabled) => {
|
|
|
11193
11178
|
}
|
|
11194
11179
|
};
|
|
11195
11180
|
var { itemNumber: itemNumber2, itemText: itemText2, itemContentWrapper: itemContentWrapper2 } = progressTrackerTokens;
|
|
11196
|
-
var ItemWrapper =
|
|
11181
|
+
var ItemWrapper = import_styled_components73.default.li`
|
|
11197
11182
|
flex: 1;
|
|
11198
11183
|
position: relative;
|
|
11199
11184
|
display: flex;
|
|
11200
11185
|
justify-content: center;
|
|
11201
11186
|
`;
|
|
11202
|
-
var ItemNumber =
|
|
11187
|
+
var ItemNumber = import_styled_components73.default.div`
|
|
11203
11188
|
transition:
|
|
11204
11189
|
background-color 0.2s,
|
|
11205
11190
|
border-color 0.2s,
|
|
@@ -11212,37 +11197,37 @@ var ItemNumber = import_styled_components74.default.div`
|
|
|
11212
11197
|
align-items: center;
|
|
11213
11198
|
justify-content: center;
|
|
11214
11199
|
z-index: 2;
|
|
11215
|
-
${getFontStyling(
|
|
11200
|
+
${getFontStyling(typographyTypes4.number)}
|
|
11216
11201
|
font-weight: 600;
|
|
11217
11202
|
|
|
11218
11203
|
${({ $state: state }) => {
|
|
11219
11204
|
switch (state) {
|
|
11220
11205
|
case "activeIncomplete":
|
|
11221
|
-
return
|
|
11206
|
+
return import_styled_components73.css`
|
|
11222
11207
|
border-color: ${itemNumber2.active.borderColor};
|
|
11223
11208
|
color: ${itemNumber2.active.color};
|
|
11224
11209
|
background-color: ${itemNumber2.active.backgroundColor};
|
|
11225
11210
|
`;
|
|
11226
11211
|
case "activeCompleted":
|
|
11227
|
-
return
|
|
11212
|
+
return import_styled_components73.css`
|
|
11228
11213
|
border-color: ${itemNumber2.completed.borderColor};
|
|
11229
11214
|
color: ${itemNumber2.completed.color};
|
|
11230
11215
|
background-color: ${itemNumber2.completed.backgroundColor};
|
|
11231
11216
|
`;
|
|
11232
11217
|
case "inactiveCompleted":
|
|
11233
|
-
return
|
|
11218
|
+
return import_styled_components73.css`
|
|
11234
11219
|
border-color: ${itemNumber2.completed.borderColor};
|
|
11235
11220
|
color: ${itemNumber2.completed.color};
|
|
11236
11221
|
background-color: ${itemNumber2.completed.backgroundColor};
|
|
11237
11222
|
`;
|
|
11238
11223
|
case "inactiveIncomplete":
|
|
11239
|
-
return
|
|
11224
|
+
return import_styled_components73.css`
|
|
11240
11225
|
border-color: ${itemNumber2.inactive.borderColor};
|
|
11241
11226
|
color: ${itemNumber2.inactive.color};
|
|
11242
11227
|
background-color: ${itemNumber2.inactive.backgroundColor};
|
|
11243
11228
|
`;
|
|
11244
11229
|
case "disabled":
|
|
11245
|
-
return
|
|
11230
|
+
return import_styled_components73.css`
|
|
11246
11231
|
border-color: ${itemNumber2.disabled.borderColor};
|
|
11247
11232
|
color: ${itemNumber2.disabled.color};
|
|
11248
11233
|
background-color: ${itemNumber2.disabled.backgroundColor};
|
|
@@ -11250,8 +11235,8 @@ var ItemNumber = import_styled_components74.default.div`
|
|
|
11250
11235
|
}
|
|
11251
11236
|
}}
|
|
11252
11237
|
`;
|
|
11253
|
-
var ItemText =
|
|
11254
|
-
${getFontStyling(
|
|
11238
|
+
var ItemText = import_styled_components73.default.div`
|
|
11239
|
+
${getFontStyling(typographyTypes4.label)}
|
|
11255
11240
|
text-align: start;
|
|
11256
11241
|
text-decoration: ${itemText2.textDecoration};
|
|
11257
11242
|
transition: text-decoration-color 0.2s;
|
|
@@ -11260,25 +11245,25 @@ var ItemText = import_styled_components74.default.div`
|
|
|
11260
11245
|
switch (state) {
|
|
11261
11246
|
case "activeCompleted":
|
|
11262
11247
|
case "activeIncomplete":
|
|
11263
|
-
return
|
|
11248
|
+
return import_styled_components73.css`
|
|
11264
11249
|
color: ${itemText2.active.color};
|
|
11265
11250
|
text-decoration-color: ${itemText2.active.textDecorationColor};
|
|
11266
11251
|
`;
|
|
11267
11252
|
case "inactiveCompleted":
|
|
11268
11253
|
case "inactiveIncomplete":
|
|
11269
|
-
return
|
|
11254
|
+
return import_styled_components73.css`
|
|
11270
11255
|
color: ${itemText2.inactive.color};
|
|
11271
11256
|
text-decoration-color: ${itemText2.inactive.textDecorationColor};
|
|
11272
11257
|
`;
|
|
11273
11258
|
case "disabled":
|
|
11274
|
-
return
|
|
11259
|
+
return import_styled_components73.css`
|
|
11275
11260
|
color: ${itemText2.disabled.color};
|
|
11276
11261
|
text-decoration: ${itemText2.disabled.textDecoration};
|
|
11277
11262
|
`;
|
|
11278
11263
|
}
|
|
11279
11264
|
}};
|
|
11280
11265
|
`;
|
|
11281
|
-
var ItemContentWrapper =
|
|
11266
|
+
var ItemContentWrapper = import_styled_components73.default.button`
|
|
11282
11267
|
background: none;
|
|
11283
11268
|
border: none;
|
|
11284
11269
|
margin: 0;
|
|
@@ -11295,7 +11280,7 @@ var ItemContentWrapper = import_styled_components74.default.button`
|
|
|
11295
11280
|
${focusVisible}
|
|
11296
11281
|
}
|
|
11297
11282
|
|
|
11298
|
-
${({ $state: state }) => state !== "disabled" &&
|
|
11283
|
+
${({ $state: state }) => state !== "disabled" && import_styled_components73.css`
|
|
11299
11284
|
cursor: pointer;
|
|
11300
11285
|
`}
|
|
11301
11286
|
`;
|
|
@@ -11313,16 +11298,16 @@ var ProgressTrackerItem = (props) => {
|
|
|
11313
11298
|
const styleProps = {
|
|
11314
11299
|
$state: toItemState(active, completed, disabled)
|
|
11315
11300
|
};
|
|
11316
|
-
const stepNumberContent = (0,
|
|
11301
|
+
const stepNumberContent = (0, import_react82.useMemo)(() => {
|
|
11317
11302
|
if (completed) {
|
|
11318
|
-
return /* @__PURE__ */ (0,
|
|
11303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(Icon, { icon: CheckIcon, iconSize: itemNumber2.iconSize });
|
|
11319
11304
|
}
|
|
11320
11305
|
if (icon12 !== void 0) {
|
|
11321
|
-
return /* @__PURE__ */ (0,
|
|
11306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(Icon, { icon: icon12, iconSize: itemNumber2.iconSize });
|
|
11322
11307
|
}
|
|
11323
11308
|
return index + 1;
|
|
11324
11309
|
}, [completed, icon12, index]);
|
|
11325
|
-
return /* @__PURE__ */ (0,
|
|
11310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(ItemWrapper, { "aria-current": active ? "step" : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime241.jsxs)(
|
|
11326
11311
|
ItemContentWrapper,
|
|
11327
11312
|
{
|
|
11328
11313
|
...styleProps,
|
|
@@ -11330,9 +11315,9 @@ var ProgressTrackerItem = (props) => {
|
|
|
11330
11315
|
onClick: !disabled && handleStepChange ? () => handleStepChange(index) : void 0,
|
|
11331
11316
|
disabled,
|
|
11332
11317
|
children: [
|
|
11333
|
-
/* @__PURE__ */ (0,
|
|
11334
|
-
/* @__PURE__ */ (0,
|
|
11335
|
-
/* @__PURE__ */ (0,
|
|
11318
|
+
/* @__PURE__ */ (0, import_jsx_runtime241.jsx)(ItemNumber, { ...styleProps, "aria-hidden": true, children: stepNumberContent }),
|
|
11319
|
+
/* @__PURE__ */ (0, import_jsx_runtime241.jsxs)(ItemText, { ...styleProps, children: [
|
|
11320
|
+
/* @__PURE__ */ (0, import_jsx_runtime241.jsx)(VisuallyHidden, { as: "span", children: getVisuallyHiddenText(active, completed, index) }),
|
|
11336
11321
|
children
|
|
11337
11322
|
] })
|
|
11338
11323
|
]
|
|
@@ -11342,8 +11327,8 @@ var ProgressTrackerItem = (props) => {
|
|
|
11342
11327
|
ProgressTrackerItem.displayName = "ProgressTracker.Item";
|
|
11343
11328
|
|
|
11344
11329
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
11345
|
-
var
|
|
11346
|
-
var ItemsWrapper =
|
|
11330
|
+
var import_jsx_runtime242 = require("react/jsx-runtime");
|
|
11331
|
+
var ItemsWrapper = import_styled_components74.default.ol`
|
|
11347
11332
|
display: flex;
|
|
11348
11333
|
flex-direction: column;
|
|
11349
11334
|
align-items: flex-start;
|
|
@@ -11351,7 +11336,7 @@ var ItemsWrapper = import_styled_components75.default.ol`
|
|
|
11351
11336
|
margin: 0;
|
|
11352
11337
|
padding: 0;
|
|
11353
11338
|
`;
|
|
11354
|
-
var ProgressTrackerConnector =
|
|
11339
|
+
var ProgressTrackerConnector = import_styled_components74.default.div`
|
|
11355
11340
|
margin-left: calc(
|
|
11356
11341
|
(${progressTrackerTokens.itemNumber.size} / 2) -
|
|
11357
11342
|
(${progressTrackerTokens.connector.width} / 2)
|
|
@@ -11361,7 +11346,7 @@ var ProgressTrackerConnector = import_styled_components75.default.div`
|
|
|
11361
11346
|
${progressTrackerTokens.connector.color};
|
|
11362
11347
|
`;
|
|
11363
11348
|
var ProgressTracker = (() => {
|
|
11364
|
-
const Res = (0,
|
|
11349
|
+
const Res = (0, import_react83.forwardRef)((props, ref) => {
|
|
11365
11350
|
const {
|
|
11366
11351
|
id,
|
|
11367
11352
|
activeStep = 0,
|
|
@@ -11371,12 +11356,12 @@ var ProgressTracker = (() => {
|
|
|
11371
11356
|
htmlProps,
|
|
11372
11357
|
...rest
|
|
11373
11358
|
} = props;
|
|
11374
|
-
const [thisActiveStep, setActiveStep] = (0,
|
|
11359
|
+
const [thisActiveStep, setActiveStep] = (0, import_react83.useState)(activeStep);
|
|
11375
11360
|
const handleChange = (step) => {
|
|
11376
11361
|
setActiveStep(step);
|
|
11377
11362
|
onStepChange && onStepChange(step);
|
|
11378
11363
|
};
|
|
11379
|
-
(0,
|
|
11364
|
+
(0, import_react83.useEffect)(() => {
|
|
11380
11365
|
if (activeStep !== void 0 && activeStep != thisActiveStep) {
|
|
11381
11366
|
setActiveStep(activeStep);
|
|
11382
11367
|
}
|
|
@@ -11385,20 +11370,20 @@ var ProgressTracker = (() => {
|
|
|
11385
11370
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
11386
11371
|
ref
|
|
11387
11372
|
};
|
|
11388
|
-
const steps = (0,
|
|
11373
|
+
const steps = (0, import_react83.useMemo)(() => {
|
|
11389
11374
|
const validChildren = removeInvalidChildren(children);
|
|
11390
11375
|
const itemsWithIndex = passIndexPropToProgressTrackerItem(validChildren);
|
|
11391
11376
|
const itemsWithConnectorsBetween = intersperseItemsWithConnector(itemsWithIndex);
|
|
11392
11377
|
return itemsWithConnectorsBetween;
|
|
11393
11378
|
}, [children]);
|
|
11394
|
-
return /* @__PURE__ */ (0,
|
|
11379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
|
|
11395
11380
|
ProgressTrackerContext.Provider,
|
|
11396
11381
|
{
|
|
11397
11382
|
value: {
|
|
11398
11383
|
activeStep: thisActiveStep,
|
|
11399
11384
|
handleStepChange: handleChange
|
|
11400
11385
|
},
|
|
11401
|
-
children: /* @__PURE__ */ (0,
|
|
11386
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("div", { role: "group", "aria-label": "progress", ...containerProps, children: /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(ItemsWrapper, { children: steps }) })
|
|
11402
11387
|
}
|
|
11403
11388
|
);
|
|
11404
11389
|
});
|
|
@@ -11407,43 +11392,43 @@ var ProgressTracker = (() => {
|
|
|
11407
11392
|
return Res;
|
|
11408
11393
|
})();
|
|
11409
11394
|
function removeInvalidChildren(children) {
|
|
11410
|
-
return
|
|
11395
|
+
return import_react83.Children.toArray(children).filter(import_react83.isValidElement);
|
|
11411
11396
|
}
|
|
11412
11397
|
function passIndexPropToProgressTrackerItem(children) {
|
|
11413
|
-
return
|
|
11398
|
+
return import_react83.Children.map(
|
|
11414
11399
|
children,
|
|
11415
|
-
(item, index) => (0,
|
|
11400
|
+
(item, index) => (0, import_react83.cloneElement)(item, {
|
|
11416
11401
|
...item.props,
|
|
11417
11402
|
index
|
|
11418
11403
|
})
|
|
11419
11404
|
);
|
|
11420
11405
|
}
|
|
11421
|
-
var intersperseItemsWithConnector = (children) =>
|
|
11406
|
+
var intersperseItemsWithConnector = (children) => import_react83.Children.map(children, (child, index) => {
|
|
11422
11407
|
if (index === 0) {
|
|
11423
11408
|
return child;
|
|
11424
11409
|
}
|
|
11425
|
-
return /* @__PURE__ */ (0,
|
|
11426
|
-
/* @__PURE__ */ (0,
|
|
11410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)(import_react83.Fragment, { children: [
|
|
11411
|
+
/* @__PURE__ */ (0, import_jsx_runtime242.jsx)(ProgressTrackerConnector, { "aria-hidden": true }),
|
|
11427
11412
|
child
|
|
11428
11413
|
] }, index);
|
|
11429
11414
|
});
|
|
11430
11415
|
|
|
11431
11416
|
// src/components/Search/Search.tsx
|
|
11432
|
-
var
|
|
11433
|
-
var
|
|
11417
|
+
var import_react86 = require("react");
|
|
11418
|
+
var import_styled_components76 = __toESM(require("styled-components"));
|
|
11434
11419
|
|
|
11435
11420
|
// src/components/Search/AutocompleteSearch.context.tsx
|
|
11436
|
-
var
|
|
11437
|
-
var AutocompleteSearchContext = (0,
|
|
11421
|
+
var import_react84 = require("react");
|
|
11422
|
+
var AutocompleteSearchContext = (0, import_react84.createContext)({});
|
|
11438
11423
|
var useAutocompleteSearch = () => {
|
|
11439
|
-
return (0,
|
|
11424
|
+
return (0, import_react84.useContext)(AutocompleteSearchContext);
|
|
11440
11425
|
};
|
|
11441
11426
|
|
|
11442
11427
|
// src/components/Search/Search.tokens.tsx
|
|
11443
|
-
var
|
|
11444
|
-
var { spacing: spacing32, iconSizes: iconSizes2, colors: colors28 } =
|
|
11445
|
-
var { textDefault: textDefault6 } =
|
|
11446
|
-
var
|
|
11428
|
+
var import_dds_design_tokens54 = require("@norges-domstoler/dds-design-tokens");
|
|
11429
|
+
var { spacing: spacing32, iconSizes: iconSizes2, colors: colors28 } = import_dds_design_tokens54.ddsBaseTokens;
|
|
11430
|
+
var { textDefault: textDefault6 } = import_dds_design_tokens54.ddsReferenceTokens;
|
|
11431
|
+
var typographyTypes5 = {
|
|
11447
11432
|
small: "bodySans01",
|
|
11448
11433
|
medium: "bodySans02",
|
|
11449
11434
|
large: "bodySans04"
|
|
@@ -11477,7 +11462,7 @@ var input3 = {
|
|
|
11477
11462
|
var horisontalContainer = {
|
|
11478
11463
|
gap: spacing32.SizesDdsSpacingX05
|
|
11479
11464
|
};
|
|
11480
|
-
var
|
|
11465
|
+
var outerContainer5 = {
|
|
11481
11466
|
gap: spacing32.SizesDdsSpacingX0125
|
|
11482
11467
|
};
|
|
11483
11468
|
var searchIcon = {
|
|
@@ -11514,7 +11499,7 @@ var searchTokens = {
|
|
|
11514
11499
|
searchIcon,
|
|
11515
11500
|
clearButton,
|
|
11516
11501
|
horisontalContainer,
|
|
11517
|
-
outerContainer:
|
|
11502
|
+
outerContainer: outerContainer5,
|
|
11518
11503
|
suggestionsContainer,
|
|
11519
11504
|
suggestionsHeader
|
|
11520
11505
|
};
|
|
@@ -11546,11 +11531,11 @@ function createEmptyChangeEvent(inputElementId) {
|
|
|
11546
11531
|
}
|
|
11547
11532
|
|
|
11548
11533
|
// src/components/Search/SearchSuggestions.tsx
|
|
11549
|
-
var
|
|
11550
|
-
var
|
|
11551
|
-
var
|
|
11534
|
+
var import_react85 = require("react");
|
|
11535
|
+
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11536
|
+
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
11552
11537
|
var { suggestionsContainer: suggestionsContainer2, suggestionsHeader: suggestionsHeader2 } = searchTokens;
|
|
11553
|
-
var SuggestionsContainer = (0,
|
|
11538
|
+
var SuggestionsContainer = (0, import_styled_components75.default)(Paper)`
|
|
11554
11539
|
${({ $isHidden }) => visibilityTransition(!$isHidden)};
|
|
11555
11540
|
position: absolute;
|
|
11556
11541
|
top: 100%;
|
|
@@ -11564,16 +11549,16 @@ var SuggestionsContainer = (0, import_styled_components76.default)(Paper)`
|
|
|
11564
11549
|
${scrollbarStyling.firefox}
|
|
11565
11550
|
${scrollbarStyling.webkit}
|
|
11566
11551
|
`;
|
|
11567
|
-
var MenuItem = (0,
|
|
11568
|
-
${({ $size }) => $size && getFontStyling(
|
|
11552
|
+
var MenuItem = (0, import_styled_components75.default)(OverflowMenuItem)`
|
|
11553
|
+
${({ $size }) => $size && getFontStyling(typographyTypes5[$size])}
|
|
11569
11554
|
`;
|
|
11570
|
-
var SuggestionsList =
|
|
11555
|
+
var SuggestionsList = import_styled_components75.default.ul`
|
|
11571
11556
|
${removeListStyling}
|
|
11572
11557
|
`;
|
|
11573
|
-
var SuggestionsHeader = (0,
|
|
11558
|
+
var SuggestionsHeader = (0, import_styled_components75.default)(Typography)`
|
|
11574
11559
|
padding-left: ${suggestionsHeader2.paddingLeft};
|
|
11575
11560
|
`;
|
|
11576
|
-
var SearchSuggestions = (0,
|
|
11561
|
+
var SearchSuggestions = (0, import_react85.forwardRef)((props, ref) => {
|
|
11577
11562
|
const {
|
|
11578
11563
|
id,
|
|
11579
11564
|
searchId,
|
|
@@ -11592,8 +11577,8 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11592
11577
|
);
|
|
11593
11578
|
const [focus, setFocus] = useRoveFocus(suggestions == null ? void 0 : suggestions.length, !showSuggestions);
|
|
11594
11579
|
const suggestionsToRender = maxSuggestions ? suggestions == null ? void 0 : suggestions.slice(maxSuggestions) : suggestions;
|
|
11595
|
-
const renderedSuggestions = /* @__PURE__ */ (0,
|
|
11596
|
-
return /* @__PURE__ */ (0,
|
|
11580
|
+
const renderedSuggestions = /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(SuggestionsList, { role: "listbox", "aria-labelledby": suggestionsHeaderId, children: suggestionsToRender.map((suggestion, index) => {
|
|
11581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)("li", { role: "option", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
11597
11582
|
MenuItem,
|
|
11598
11583
|
{
|
|
11599
11584
|
index,
|
|
@@ -11609,7 +11594,7 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11609
11594
|
) }, index);
|
|
11610
11595
|
}) });
|
|
11611
11596
|
const isHidden = !showSuggestions;
|
|
11612
|
-
return /* @__PURE__ */ (0,
|
|
11597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(
|
|
11613
11598
|
SuggestionsContainer,
|
|
11614
11599
|
{
|
|
11615
11600
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -11617,7 +11602,7 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11617
11602
|
$isHidden: isHidden,
|
|
11618
11603
|
"aria-hidden": isHidden,
|
|
11619
11604
|
children: [
|
|
11620
|
-
/* @__PURE__ */ (0,
|
|
11605
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
11621
11606
|
SuggestionsHeader,
|
|
11622
11607
|
{
|
|
11623
11608
|
typographyType: "supportingStyleTiny01",
|
|
@@ -11634,8 +11619,8 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11634
11619
|
SearchSuggestions.displayName = "SearchSuggestions";
|
|
11635
11620
|
|
|
11636
11621
|
// src/components/Search/Search.tsx
|
|
11637
|
-
var
|
|
11638
|
-
var { input: input4, outerContainer:
|
|
11622
|
+
var import_jsx_runtime244 = require("react/jsx-runtime");
|
|
11623
|
+
var { input: input4, outerContainer: outerContainer6, horisontalContainer: horisontalContainer2, searchIcon: searchIcon2, clearButton: clearButton2 } = searchTokens;
|
|
11639
11624
|
var getIconSize = (size2) => {
|
|
11640
11625
|
switch (size2) {
|
|
11641
11626
|
case "large":
|
|
@@ -11646,7 +11631,7 @@ var getIconSize = (size2) => {
|
|
|
11646
11631
|
return "small";
|
|
11647
11632
|
}
|
|
11648
11633
|
};
|
|
11649
|
-
var Input3 = (0,
|
|
11634
|
+
var Input3 = (0, import_styled_components76.default)(Input)`
|
|
11650
11635
|
&[type='search']::-webkit-search-decoration,
|
|
11651
11636
|
&[type='search']::-webkit-search-cancel-button,
|
|
11652
11637
|
&[type='search']::-webkit-search-results-button,
|
|
@@ -11655,45 +11640,45 @@ var Input3 = (0, import_styled_components77.default)(Input)`
|
|
|
11655
11640
|
}
|
|
11656
11641
|
padding-right: ${input4.base.paddingRight};
|
|
11657
11642
|
|
|
11658
|
-
${({ $componentSize }) =>
|
|
11643
|
+
${({ $componentSize }) => import_styled_components76.css`
|
|
11659
11644
|
padding-top: ${input4.sizes[$componentSize].paddingTop};
|
|
11660
11645
|
padding-bottom: ${input4.sizes[$componentSize].paddingBottom};
|
|
11661
11646
|
padding-left: ${input4.sizes[$componentSize].paddingLeft};
|
|
11662
|
-
${getFontStyling(
|
|
11647
|
+
${getFontStyling(typographyTypes5[$componentSize])}
|
|
11663
11648
|
`}
|
|
11664
11649
|
`;
|
|
11665
|
-
var StyledSearchIcon = (0,
|
|
11650
|
+
var StyledSearchIcon = (0, import_styled_components76.default)(Icon)`
|
|
11666
11651
|
position: absolute;
|
|
11667
11652
|
left: ${searchIcon2.base.left};
|
|
11668
11653
|
color: ${searchIcon2.base.color};
|
|
11669
|
-
${({ $size }) =>
|
|
11654
|
+
${({ $size }) => import_styled_components76.css`
|
|
11670
11655
|
top: ${searchTokens.searchIcon[$size].top};
|
|
11671
11656
|
`}
|
|
11672
11657
|
z-index: 1;
|
|
11673
11658
|
`;
|
|
11674
|
-
var StyledClearButton = (0,
|
|
11659
|
+
var StyledClearButton = (0, import_styled_components76.default)(Button)`
|
|
11675
11660
|
position: absolute;
|
|
11676
11661
|
right: ${clearButton2.right};
|
|
11677
11662
|
color: ${clearButton2.color};
|
|
11678
11663
|
top: ${clearButton2.top};
|
|
11679
11664
|
`;
|
|
11680
|
-
var
|
|
11665
|
+
var OuterContainer2 = import_styled_components76.default.div`
|
|
11681
11666
|
display: flex;
|
|
11682
11667
|
flex-direction: column;
|
|
11683
|
-
gap: ${
|
|
11668
|
+
gap: ${outerContainer6.gap};
|
|
11684
11669
|
`;
|
|
11685
|
-
var HorisontalContainer =
|
|
11686
|
-
${(props) => props.$hasSearchButton &&
|
|
11670
|
+
var HorisontalContainer = import_styled_components76.default.div`
|
|
11671
|
+
${(props) => props.$hasSearchButton && import_styled_components76.css`
|
|
11687
11672
|
display: grid;
|
|
11688
11673
|
grid-template-columns: 1fr auto;
|
|
11689
11674
|
gap: ${horisontalContainer2.gap};
|
|
11690
11675
|
`}
|
|
11691
11676
|
`;
|
|
11692
|
-
var InputContainer2 =
|
|
11677
|
+
var InputContainer2 = import_styled_components76.default.div`
|
|
11693
11678
|
position: relative;
|
|
11694
11679
|
display: flex;
|
|
11695
11680
|
`;
|
|
11696
|
-
var Search = (0,
|
|
11681
|
+
var Search = (0, import_react86.forwardRef)(
|
|
11697
11682
|
({
|
|
11698
11683
|
componentSize = "medium",
|
|
11699
11684
|
buttonProps,
|
|
@@ -11709,7 +11694,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11709
11694
|
...rest
|
|
11710
11695
|
}, ref) => {
|
|
11711
11696
|
var _a;
|
|
11712
|
-
const generatedId = (0,
|
|
11697
|
+
const generatedId = (0, import_react86.useId)();
|
|
11713
11698
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
11714
11699
|
const hasLabel = !!label3;
|
|
11715
11700
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
@@ -11718,7 +11703,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11718
11703
|
uniqueId,
|
|
11719
11704
|
"suggestions-description"
|
|
11720
11705
|
);
|
|
11721
|
-
const [hasValue, setHasValue] = (0,
|
|
11706
|
+
const [hasValue, setHasValue] = (0, import_react86.useState)(!!value);
|
|
11722
11707
|
const context = useAutocompleteSearch();
|
|
11723
11708
|
const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
|
|
11724
11709
|
const handleChange = (e) => {
|
|
@@ -11737,18 +11722,18 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11737
11722
|
} = buttonProps != null ? buttonProps : {};
|
|
11738
11723
|
const hasSuggestions = !!context.suggestions;
|
|
11739
11724
|
const showSearchButton = !!buttonProps && !!onClick;
|
|
11740
|
-
return /* @__PURE__ */ (0,
|
|
11741
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
11742
|
-
/* @__PURE__ */ (0,
|
|
11743
|
-
/* @__PURE__ */ (0,
|
|
11725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(OuterContainer2, { children: [
|
|
11726
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(Label, { htmlFor: uniqueId, children: label3 }),
|
|
11727
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsxs)("div", { children: [
|
|
11728
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(
|
|
11744
11729
|
HorisontalContainer,
|
|
11745
11730
|
{
|
|
11746
11731
|
$hasSearchButton: showSearchButton,
|
|
11747
11732
|
className,
|
|
11748
11733
|
style,
|
|
11749
11734
|
children: [
|
|
11750
|
-
/* @__PURE__ */ (0,
|
|
11751
|
-
/* @__PURE__ */ (0,
|
|
11735
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(InputContainer2, { children: [
|
|
11736
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
11752
11737
|
StyledSearchIcon,
|
|
11753
11738
|
{
|
|
11754
11739
|
icon: SearchIcon,
|
|
@@ -11756,7 +11741,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11756
11741
|
iconSize: getIconSize(componentSize)
|
|
11757
11742
|
}
|
|
11758
11743
|
),
|
|
11759
|
-
/* @__PURE__ */ (0,
|
|
11744
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
11760
11745
|
Input3,
|
|
11761
11746
|
{
|
|
11762
11747
|
...rest,
|
|
@@ -11779,8 +11764,8 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11779
11764
|
role: hasSuggestions ? "combobox" : void 0
|
|
11780
11765
|
}
|
|
11781
11766
|
),
|
|
11782
|
-
hasSuggestions && /* @__PURE__ */ (0,
|
|
11783
|
-
/* @__PURE__ */ (0,
|
|
11767
|
+
hasSuggestions && /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(import_jsx_runtime244.Fragment, { children: [
|
|
11768
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
11784
11769
|
SearchSuggestions,
|
|
11785
11770
|
{
|
|
11786
11771
|
id: suggestionsId,
|
|
@@ -11792,9 +11777,9 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11792
11777
|
componentSize
|
|
11793
11778
|
}
|
|
11794
11779
|
),
|
|
11795
|
-
/* @__PURE__ */ (0,
|
|
11780
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)(VisuallyHidden, { id: suggestionsDescriptionId, as: "span", children: "Bla i s\xF8keforslag med piltaster n\xE5r listen er utvidet." })
|
|
11796
11781
|
] }),
|
|
11797
|
-
hasValue && /* @__PURE__ */ (0,
|
|
11782
|
+
hasValue && /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
11798
11783
|
StyledClearButton,
|
|
11799
11784
|
{
|
|
11800
11785
|
icon: CloseSmallIcon,
|
|
@@ -11806,7 +11791,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11806
11791
|
}
|
|
11807
11792
|
)
|
|
11808
11793
|
] }),
|
|
11809
|
-
showSearchButton && /* @__PURE__ */ (0,
|
|
11794
|
+
showSearchButton && /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
11810
11795
|
Button,
|
|
11811
11796
|
{
|
|
11812
11797
|
size: componentSize,
|
|
@@ -11826,8 +11811,8 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11826
11811
|
Search.displayName = "Search";
|
|
11827
11812
|
|
|
11828
11813
|
// src/components/Search/SearchAutocompleteWrapper.tsx
|
|
11829
|
-
var
|
|
11830
|
-
var
|
|
11814
|
+
var import_react87 = require("react");
|
|
11815
|
+
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
11831
11816
|
var SearchAutocompleteWrapper = (props) => {
|
|
11832
11817
|
const {
|
|
11833
11818
|
value,
|
|
@@ -11838,12 +11823,12 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
11838
11823
|
onSuggestionSelection,
|
|
11839
11824
|
children
|
|
11840
11825
|
} = props;
|
|
11841
|
-
const [inputValue, setInputValue] = (0,
|
|
11842
|
-
const [suggestions, setSuggestions] = (0,
|
|
11843
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
11826
|
+
const [inputValue, setInputValue] = (0, import_react87.useState)(value != null ? value : "");
|
|
11827
|
+
const [suggestions, setSuggestions] = (0, import_react87.useState)([]);
|
|
11828
|
+
const [showSuggestions, setShowSuggestions] = (0, import_react87.useState)(false);
|
|
11844
11829
|
const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
|
|
11845
11830
|
const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
|
|
11846
|
-
(0,
|
|
11831
|
+
(0, import_react87.useEffect)(() => {
|
|
11847
11832
|
if (suggestions.length > 0) {
|
|
11848
11833
|
openSuggestions();
|
|
11849
11834
|
} else {
|
|
@@ -11888,8 +11873,8 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
11888
11873
|
const handleSetInputValue = (value2) => {
|
|
11889
11874
|
setInputValue(value2 != null ? value2 : "");
|
|
11890
11875
|
};
|
|
11891
|
-
const inputRef = (0,
|
|
11892
|
-
const suggestionsRef = (0,
|
|
11876
|
+
const inputRef = (0, import_react87.useRef)(null);
|
|
11877
|
+
const suggestionsRef = (0, import_react87.useRef)(null);
|
|
11893
11878
|
useOnClickOutside([inputRef.current, suggestionsRef.current], () => {
|
|
11894
11879
|
closeSuggestions();
|
|
11895
11880
|
});
|
|
@@ -11903,7 +11888,7 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
11903
11888
|
inputValue,
|
|
11904
11889
|
onSugggestionClick: handleSuggestionClick
|
|
11905
11890
|
};
|
|
11906
|
-
return /* @__PURE__ */ (0,
|
|
11891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(AutocompleteSearchContext.Provider, { value: contextProps, children });
|
|
11907
11892
|
};
|
|
11908
11893
|
SearchAutocompleteWrapper.displayName = "SearchAutocompleteWrapper";
|
|
11909
11894
|
|
|
@@ -11913,27 +11898,27 @@ Search2.AutocompleteWrapper = SearchAutocompleteWrapper;
|
|
|
11913
11898
|
Search2.Suggestions = SearchSuggestions;
|
|
11914
11899
|
|
|
11915
11900
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
11916
|
-
var
|
|
11901
|
+
var import_react89 = require("react");
|
|
11917
11902
|
|
|
11918
11903
|
// src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
|
|
11919
|
-
var
|
|
11920
|
-
var CheckboxGroupContext = (0,
|
|
11904
|
+
var import_react88 = require("react");
|
|
11905
|
+
var CheckboxGroupContext = (0, import_react88.createContext)(null);
|
|
11921
11906
|
var useCheckboxGroup = () => {
|
|
11922
|
-
return (0,
|
|
11907
|
+
return (0, import_react88.useContext)(CheckboxGroupContext);
|
|
11923
11908
|
};
|
|
11924
11909
|
|
|
11925
11910
|
// src/components/SelectionControl/SelectionControl.styles.tsx
|
|
11926
|
-
var
|
|
11911
|
+
var import_styled_components77 = __toESM(require("styled-components"));
|
|
11927
11912
|
|
|
11928
11913
|
// src/components/SelectionControl/SelectionControl.tokens.tsx
|
|
11929
|
-
var
|
|
11914
|
+
var import_dds_design_tokens55 = require("@norges-domstoler/dds-design-tokens");
|
|
11930
11915
|
|
|
11931
11916
|
// src/components/SelectionControl/SelectionControl.utils.tsx
|
|
11932
11917
|
var selectionControlSizeNumberPx = 18;
|
|
11933
11918
|
var selectionControlSize = `${selectionControlSizeNumberPx}px`;
|
|
11934
11919
|
|
|
11935
11920
|
// src/components/SelectionControl/SelectionControl.tokens.tsx
|
|
11936
|
-
var { colors: colors29, spacing: spacing33, borderRadius: borderRadius8 } =
|
|
11921
|
+
var { colors: colors29, spacing: spacing33, borderRadius: borderRadius8 } = import_dds_design_tokens55.ddsBaseTokens;
|
|
11937
11922
|
var checkmark = {
|
|
11938
11923
|
checkbox: {
|
|
11939
11924
|
borderColor: colors29.DdsColorNeutralsWhite
|
|
@@ -12038,7 +12023,7 @@ var {
|
|
|
12038
12023
|
groupContainer: groupContainer2,
|
|
12039
12024
|
outerGroupContainer: outerGroupContainer2
|
|
12040
12025
|
} = selectionControlTokens;
|
|
12041
|
-
var CustomSelectionControl =
|
|
12026
|
+
var CustomSelectionControl = import_styled_components77.default.span`
|
|
12042
12027
|
position: absolute;
|
|
12043
12028
|
left: 0;
|
|
12044
12029
|
box-sizing: border-box;
|
|
@@ -12048,7 +12033,7 @@ var CustomSelectionControl = import_styled_components78.default.span`
|
|
|
12048
12033
|
border-radius: ${selectionControl2.base.borderRadius};
|
|
12049
12034
|
height: ${selectionControl2.base.height};
|
|
12050
12035
|
width: ${selectionControl2.base.width};
|
|
12051
|
-
${({ $controlType }) => $controlType === "radio" &&
|
|
12036
|
+
${({ $controlType }) => $controlType === "radio" && import_styled_components77.css`
|
|
12052
12037
|
border-radius: 50%;
|
|
12053
12038
|
`}
|
|
12054
12039
|
&:after {
|
|
@@ -12057,7 +12042,7 @@ var CustomSelectionControl = import_styled_components78.default.span`
|
|
|
12057
12042
|
display: none;
|
|
12058
12043
|
}
|
|
12059
12044
|
`;
|
|
12060
|
-
var Container13 =
|
|
12045
|
+
var Container13 = import_styled_components77.default.label`
|
|
12061
12046
|
position: relative;
|
|
12062
12047
|
display: flex;
|
|
12063
12048
|
align-items: center;
|
|
@@ -12065,9 +12050,9 @@ var Container13 = import_styled_components78.default.label`
|
|
|
12065
12050
|
user-select: none;
|
|
12066
12051
|
width: fit-content;
|
|
12067
12052
|
color: ${container14.color};
|
|
12068
|
-
${({ $hasLabel }) => $hasLabel ?
|
|
12053
|
+
${({ $hasLabel }) => $hasLabel ? import_styled_components77.css`
|
|
12069
12054
|
padding-left: ${container14.withLabel.paddingLeft};
|
|
12070
|
-
` :
|
|
12055
|
+
` : import_styled_components77.css`
|
|
12071
12056
|
padding: ${container14.noLabel.padding};
|
|
12072
12057
|
`}
|
|
12073
12058
|
|
|
@@ -12111,7 +12096,7 @@ var Container13 = import_styled_components78.default.label`
|
|
|
12111
12096
|
border-color: ${selectionControl2.checked.hover.borderColor};
|
|
12112
12097
|
}
|
|
12113
12098
|
|
|
12114
|
-
${({ $error }) => $error &&
|
|
12099
|
+
${({ $error }) => $error && import_styled_components77.css`
|
|
12115
12100
|
&:hover input:enabled ~ ${CustomSelectionControl} {
|
|
12116
12101
|
background-color: ${selectionControl2.hover.danger.backgroundColor};
|
|
12117
12102
|
box-shadow: ${selectionControl2.hover.danger.boxShadow};
|
|
@@ -12145,11 +12130,11 @@ var Container13 = import_styled_components78.default.label`
|
|
|
12145
12130
|
display: block;
|
|
12146
12131
|
}
|
|
12147
12132
|
|
|
12148
|
-
${({ disabled }) => disabled &&
|
|
12133
|
+
${({ disabled }) => disabled && import_styled_components77.css`
|
|
12149
12134
|
cursor: not-allowed;
|
|
12150
12135
|
color: ${container14.disabled.color};
|
|
12151
12136
|
`}
|
|
12152
|
-
${({ $controlType }) => $controlType === "checkbox" ?
|
|
12137
|
+
${({ $controlType }) => $controlType === "checkbox" ? import_styled_components77.css`
|
|
12153
12138
|
${CustomSelectionControl}:after {
|
|
12154
12139
|
border: solid ${checkmark2.checkbox.borderColor};
|
|
12155
12140
|
|
|
@@ -12168,7 +12153,7 @@ var Container13 = import_styled_components78.default.label`
|
|
|
12168
12153
|
height: 1px;
|
|
12169
12154
|
transform: none;
|
|
12170
12155
|
}
|
|
12171
|
-
` :
|
|
12156
|
+
` : import_styled_components77.css`
|
|
12172
12157
|
${CustomSelectionControl}:after {
|
|
12173
12158
|
border-radius: 50%;
|
|
12174
12159
|
background-color: ${checkmark2.radio.backgroundColor};
|
|
@@ -12179,22 +12164,22 @@ var Container13 = import_styled_components78.default.label`
|
|
|
12179
12164
|
}
|
|
12180
12165
|
`}
|
|
12181
12166
|
`;
|
|
12182
|
-
var OuterGroupContainer =
|
|
12167
|
+
var OuterGroupContainer = import_styled_components77.default.div`
|
|
12183
12168
|
display: flex;
|
|
12184
12169
|
flex-direction: column;
|
|
12185
12170
|
gap: ${outerGroupContainer2.gap};
|
|
12186
12171
|
`;
|
|
12187
|
-
var GroupContainer =
|
|
12172
|
+
var GroupContainer = import_styled_components77.default.div`
|
|
12188
12173
|
display: flex;
|
|
12189
|
-
${({ $direction }) =>
|
|
12174
|
+
${({ $direction }) => import_styled_components77.css`
|
|
12190
12175
|
flex-direction: ${$direction};
|
|
12191
12176
|
gap: ${groupContainer2[$direction].gap};
|
|
12192
12177
|
`}
|
|
12193
12178
|
`;
|
|
12194
12179
|
|
|
12195
12180
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
12196
|
-
var
|
|
12197
|
-
var Checkbox = (0,
|
|
12181
|
+
var import_jsx_runtime246 = require("react/jsx-runtime");
|
|
12182
|
+
var Checkbox = (0, import_react89.forwardRef)(
|
|
12198
12183
|
(props, ref) => {
|
|
12199
12184
|
const {
|
|
12200
12185
|
id,
|
|
@@ -12209,7 +12194,7 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12209
12194
|
htmlProps = {},
|
|
12210
12195
|
...rest
|
|
12211
12196
|
} = props;
|
|
12212
|
-
const generatedId = (0,
|
|
12197
|
+
const generatedId = (0, import_react89.useId)();
|
|
12213
12198
|
const uniqueId = id != null ? id : `${generatedId}-checkbox`;
|
|
12214
12199
|
const checkboxGroup = useCheckboxGroup();
|
|
12215
12200
|
const hasLabel = !!label3;
|
|
@@ -12218,7 +12203,7 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12218
12203
|
className: htmlPropsClassName,
|
|
12219
12204
|
...restHtmlProps
|
|
12220
12205
|
} = htmlProps;
|
|
12221
|
-
return /* @__PURE__ */ (0,
|
|
12206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(
|
|
12222
12207
|
Container13,
|
|
12223
12208
|
{
|
|
12224
12209
|
$error: error || (checkboxGroup == null ? void 0 : checkboxGroup.error),
|
|
@@ -12229,7 +12214,7 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12229
12214
|
className: cn(className, htmlPropsClassName),
|
|
12230
12215
|
style,
|
|
12231
12216
|
children: [
|
|
12232
|
-
/* @__PURE__ */ (0,
|
|
12217
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
12233
12218
|
HiddenInput,
|
|
12234
12219
|
{
|
|
12235
12220
|
...getBaseHTMLProps(uniqueId, restHtmlProps, rest),
|
|
@@ -12249,8 +12234,8 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12249
12234
|
"data-indeterminate": indeterminate
|
|
12250
12235
|
}
|
|
12251
12236
|
),
|
|
12252
|
-
/* @__PURE__ */ (0,
|
|
12253
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
12237
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(CustomSelectionControl, { $controlType: "checkbox" }),
|
|
12238
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(Typography, { color: "inherit", as: "span", typographyType: "bodySans02", children: label3 })
|
|
12254
12239
|
]
|
|
12255
12240
|
}
|
|
12256
12241
|
);
|
|
@@ -12259,8 +12244,8 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12259
12244
|
Checkbox.displayName = "Checkbox";
|
|
12260
12245
|
|
|
12261
12246
|
// src/components/SelectionControl/Checkbox/CheckboxGroup.tsx
|
|
12262
|
-
var
|
|
12263
|
-
var
|
|
12247
|
+
var import_react90 = require("react");
|
|
12248
|
+
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
12264
12249
|
var CheckboxGroup = (props) => {
|
|
12265
12250
|
const {
|
|
12266
12251
|
label: label3,
|
|
@@ -12276,7 +12261,7 @@ var CheckboxGroup = (props) => {
|
|
|
12276
12261
|
...rest
|
|
12277
12262
|
} = props;
|
|
12278
12263
|
const { "aria-required": ariaRequired } = htmlProps;
|
|
12279
|
-
const generatedId = (0,
|
|
12264
|
+
const generatedId = (0, import_react90.useId)();
|
|
12280
12265
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-checkboxGroup`;
|
|
12281
12266
|
const hasErrorMessage = !!errorMessage;
|
|
12282
12267
|
const showRequiredMarker = required || ariaRequired;
|
|
@@ -12288,7 +12273,7 @@ var CheckboxGroup = (props) => {
|
|
|
12288
12273
|
uniqueGroupId,
|
|
12289
12274
|
tipId: tip ? tipId : void 0
|
|
12290
12275
|
};
|
|
12291
|
-
return /* @__PURE__ */ (0,
|
|
12276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(
|
|
12292
12277
|
OuterGroupContainer,
|
|
12293
12278
|
{
|
|
12294
12279
|
...getBaseHTMLProps(
|
|
@@ -12298,7 +12283,7 @@ var CheckboxGroup = (props) => {
|
|
|
12298
12283
|
rest
|
|
12299
12284
|
),
|
|
12300
12285
|
children: [
|
|
12301
|
-
/* @__PURE__ */ (0,
|
|
12286
|
+
/* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(
|
|
12302
12287
|
Typography,
|
|
12303
12288
|
{
|
|
12304
12289
|
as: "span",
|
|
@@ -12307,12 +12292,12 @@ var CheckboxGroup = (props) => {
|
|
|
12307
12292
|
children: [
|
|
12308
12293
|
label3,
|
|
12309
12294
|
" ",
|
|
12310
|
-
showRequiredMarker && /* @__PURE__ */ (0,
|
|
12295
|
+
showRequiredMarker && /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(RequiredMarker, {})
|
|
12311
12296
|
]
|
|
12312
12297
|
}
|
|
12313
12298
|
),
|
|
12314
12299
|
renderInputMessage(tip, tipId),
|
|
12315
|
-
/* @__PURE__ */ (0,
|
|
12300
|
+
/* @__PURE__ */ (0, import_jsx_runtime247.jsx)(CheckboxGroupContext.Provider, { value: { ...contextProps }, children: /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(
|
|
12316
12301
|
GroupContainer,
|
|
12317
12302
|
{
|
|
12318
12303
|
role: "group",
|
|
@@ -12330,17 +12315,17 @@ var CheckboxGroup = (props) => {
|
|
|
12330
12315
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
12331
12316
|
|
|
12332
12317
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
12333
|
-
var
|
|
12318
|
+
var import_react92 = require("react");
|
|
12334
12319
|
|
|
12335
12320
|
// src/components/SelectionControl/RadioButton/RadioButtonGroupContext.tsx
|
|
12336
|
-
var
|
|
12337
|
-
var RadioButtonGroupContext = (0,
|
|
12321
|
+
var import_react91 = require("react");
|
|
12322
|
+
var RadioButtonGroupContext = (0, import_react91.createContext)(null);
|
|
12338
12323
|
var useRadioButtonGroup = () => {
|
|
12339
|
-
return (0,
|
|
12324
|
+
return (0, import_react91.useContext)(RadioButtonGroupContext);
|
|
12340
12325
|
};
|
|
12341
12326
|
|
|
12342
12327
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
12343
|
-
var
|
|
12328
|
+
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
12344
12329
|
var isValueEqualToGroupValueOrFalsy = (value, group4) => {
|
|
12345
12330
|
if (typeof value !== "undefined" && value !== null && group4) {
|
|
12346
12331
|
if (typeof value === "number") {
|
|
@@ -12350,7 +12335,7 @@ var isValueEqualToGroupValueOrFalsy = (value, group4) => {
|
|
|
12350
12335
|
}
|
|
12351
12336
|
return !!value;
|
|
12352
12337
|
};
|
|
12353
|
-
var RadioButton = (0,
|
|
12338
|
+
var RadioButton = (0, import_react92.forwardRef)(
|
|
12354
12339
|
(props, ref) => {
|
|
12355
12340
|
const {
|
|
12356
12341
|
id,
|
|
@@ -12374,7 +12359,7 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12374
12359
|
style,
|
|
12375
12360
|
...restHtmlProps
|
|
12376
12361
|
} = htmlProps;
|
|
12377
|
-
const generatedId = (0,
|
|
12362
|
+
const generatedId = (0, import_react92.useId)();
|
|
12378
12363
|
const uniqueId = id != null ? id : `${generatedId}-radioButton`;
|
|
12379
12364
|
const hasLabel = !!label3;
|
|
12380
12365
|
const radioButtonGroup = useRadioButtonGroup();
|
|
@@ -12399,7 +12384,7 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12399
12384
|
"aria-describedby": describedByIds.length > 0 ? describedByIds.join(" ") : void 0,
|
|
12400
12385
|
"aria-invalid": error || (radioButtonGroup == null ? void 0 : radioButtonGroup.error) ? true : void 0
|
|
12401
12386
|
};
|
|
12402
|
-
return /* @__PURE__ */ (0,
|
|
12387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime248.jsxs)(
|
|
12403
12388
|
Container13,
|
|
12404
12389
|
{
|
|
12405
12390
|
$error: error || (radioButtonGroup == null ? void 0 : radioButtonGroup.error),
|
|
@@ -12411,9 +12396,9 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12411
12396
|
htmlFor: uniqueId,
|
|
12412
12397
|
$controlType: "radio",
|
|
12413
12398
|
children: [
|
|
12414
|
-
/* @__PURE__ */ (0,
|
|
12415
|
-
/* @__PURE__ */ (0,
|
|
12416
|
-
/* @__PURE__ */ (0,
|
|
12399
|
+
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(HiddenInput, { ...inputProps, ref }),
|
|
12400
|
+
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(CustomSelectionControl, { $controlType: "radio" }),
|
|
12401
|
+
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(Typography, { as: "span", children: children != null ? children : label3 })
|
|
12417
12402
|
]
|
|
12418
12403
|
}
|
|
12419
12404
|
);
|
|
@@ -12422,8 +12407,8 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12422
12407
|
RadioButton.displayName = "RadioButton";
|
|
12423
12408
|
|
|
12424
12409
|
// src/components/SelectionControl/RadioButton/RadioButtonGroup.tsx
|
|
12425
|
-
var
|
|
12426
|
-
var
|
|
12410
|
+
var import_react93 = require("react");
|
|
12411
|
+
var import_jsx_runtime249 = require("react/jsx-runtime");
|
|
12427
12412
|
var RadioButtonGroupInner = (props, ref) => {
|
|
12428
12413
|
const {
|
|
12429
12414
|
name,
|
|
@@ -12444,8 +12429,8 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12444
12429
|
...rest
|
|
12445
12430
|
} = props;
|
|
12446
12431
|
const { "aria-required": ariaRequired = false } = htmlProps;
|
|
12447
|
-
const [groupValue, setGroupValue] = (0,
|
|
12448
|
-
const generatedId = (0,
|
|
12432
|
+
const [groupValue, setGroupValue] = (0, import_react93.useState)(value);
|
|
12433
|
+
const generatedId = (0, import_react93.useId)();
|
|
12449
12434
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-radioButtonGroup`;
|
|
12450
12435
|
const handleChange = combineHandlers(
|
|
12451
12436
|
(e) => setGroupValue(e.target.value),
|
|
@@ -12465,7 +12450,7 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12465
12450
|
value: groupValue,
|
|
12466
12451
|
onChange: handleChange
|
|
12467
12452
|
};
|
|
12468
|
-
return /* @__PURE__ */ (0,
|
|
12453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
|
|
12469
12454
|
OuterGroupContainer,
|
|
12470
12455
|
{
|
|
12471
12456
|
...getBaseHTMLProps(
|
|
@@ -12476,7 +12461,7 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12476
12461
|
),
|
|
12477
12462
|
ref,
|
|
12478
12463
|
children: [
|
|
12479
|
-
/* @__PURE__ */ (0,
|
|
12464
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
|
|
12480
12465
|
Typography,
|
|
12481
12466
|
{
|
|
12482
12467
|
as: "span",
|
|
@@ -12485,12 +12470,12 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12485
12470
|
children: [
|
|
12486
12471
|
label3,
|
|
12487
12472
|
" ",
|
|
12488
|
-
showRequiredMarker && /* @__PURE__ */ (0,
|
|
12473
|
+
showRequiredMarker && /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(RequiredMarker, {})
|
|
12489
12474
|
]
|
|
12490
12475
|
}
|
|
12491
12476
|
),
|
|
12492
12477
|
renderInputMessage(tip, tipId),
|
|
12493
|
-
/* @__PURE__ */ (0,
|
|
12478
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsx)(RadioButtonGroupContext.Provider, { value: { ...contextProps }, children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
12494
12479
|
GroupContainer,
|
|
12495
12480
|
{
|
|
12496
12481
|
role: "radiogroup",
|
|
@@ -12506,16 +12491,16 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12506
12491
|
}
|
|
12507
12492
|
);
|
|
12508
12493
|
};
|
|
12509
|
-
var RadioButtonGroup = (0,
|
|
12494
|
+
var RadioButtonGroup = (0, import_react93.forwardRef)(RadioButtonGroupInner);
|
|
12510
12495
|
RadioButtonGroup.displayName = "RadioButtonGroup";
|
|
12511
12496
|
|
|
12512
12497
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
12513
|
-
var
|
|
12514
|
-
var
|
|
12498
|
+
var import_react94 = require("react");
|
|
12499
|
+
var import_styled_components78 = __toESM(require("styled-components"));
|
|
12515
12500
|
|
|
12516
12501
|
// src/components/SkipToContent/SkipToContent.tokens.tsx
|
|
12517
|
-
var
|
|
12518
|
-
var { colors: colors30, spacing: spacing34 } =
|
|
12502
|
+
var import_dds_design_tokens56 = require("@norges-domstoler/dds-design-tokens");
|
|
12503
|
+
var { colors: colors30, spacing: spacing34 } = import_dds_design_tokens56.ddsBaseTokens;
|
|
12519
12504
|
var link3 = {
|
|
12520
12505
|
base: {
|
|
12521
12506
|
color: colors30.DdsColorNeutralsWhite
|
|
@@ -12534,9 +12519,9 @@ var skipToContentTokens = {
|
|
|
12534
12519
|
};
|
|
12535
12520
|
|
|
12536
12521
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
12537
|
-
var
|
|
12522
|
+
var import_jsx_runtime250 = require("react/jsx-runtime");
|
|
12538
12523
|
var { wrapper: wrapper6, link: link4 } = skipToContentTokens;
|
|
12539
|
-
var Wrapper5 =
|
|
12524
|
+
var Wrapper5 = import_styled_components78.default.div`
|
|
12540
12525
|
box-sizing: border-box;
|
|
12541
12526
|
position: absolute;
|
|
12542
12527
|
top: ${({ $top: top }) => top};
|
|
@@ -12563,7 +12548,7 @@ var Wrapper5 = import_styled_components79.default.div`
|
|
|
12563
12548
|
opacity: 1;
|
|
12564
12549
|
}
|
|
12565
12550
|
`;
|
|
12566
|
-
var Link4 =
|
|
12551
|
+
var Link4 = import_styled_components78.default.a`
|
|
12567
12552
|
text-decoration: none;
|
|
12568
12553
|
color: ${link4.base.color};
|
|
12569
12554
|
${getFontStyling(defaultTypographyType)}
|
|
@@ -12578,7 +12563,7 @@ var Link4 = import_styled_components79.default.a`
|
|
|
12578
12563
|
color: ${link4.base.color};
|
|
12579
12564
|
}
|
|
12580
12565
|
`;
|
|
12581
|
-
var SkipToContent = (0,
|
|
12566
|
+
var SkipToContent = (0, import_react94.forwardRef)(
|
|
12582
12567
|
(props, ref) => {
|
|
12583
12568
|
const {
|
|
12584
12569
|
text = "Til hovedinnhold",
|
|
@@ -12593,13 +12578,13 @@ var SkipToContent = (0, import_react95.forwardRef)(
|
|
|
12593
12578
|
style,
|
|
12594
12579
|
...restHtmlProps
|
|
12595
12580
|
} = htmlProps;
|
|
12596
|
-
return /* @__PURE__ */ (0,
|
|
12581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(
|
|
12597
12582
|
Wrapper5,
|
|
12598
12583
|
{
|
|
12599
12584
|
$top: top,
|
|
12600
12585
|
className: cn(className, htmlPropsClassName),
|
|
12601
12586
|
style,
|
|
12602
|
-
children: /* @__PURE__ */ (0,
|
|
12587
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(Link4, { ...getBaseHTMLProps(id, restHtmlProps, rest), ref, children: text })
|
|
12603
12588
|
}
|
|
12604
12589
|
);
|
|
12605
12590
|
}
|
|
@@ -12607,14 +12592,14 @@ var SkipToContent = (0, import_react95.forwardRef)(
|
|
|
12607
12592
|
SkipToContent.displayName = "SkipToContent";
|
|
12608
12593
|
|
|
12609
12594
|
// src/components/SplitButton/SplitButton.tsx
|
|
12610
|
-
var
|
|
12611
|
-
var
|
|
12595
|
+
var import_react95 = require("react");
|
|
12596
|
+
var import_styled_components79 = __toESM(require("styled-components"));
|
|
12612
12597
|
|
|
12613
12598
|
// src/components/SplitButton/SplitButton.tokens.ts
|
|
12614
|
-
var
|
|
12599
|
+
var import_dds_design_tokens57 = require("@norges-domstoler/dds-design-tokens");
|
|
12615
12600
|
var mainButton = {
|
|
12616
12601
|
primary: {
|
|
12617
|
-
borderLeft: `1px solid ${
|
|
12602
|
+
borderLeft: `1px solid ${import_dds_design_tokens57.ddsBaseTokens.colors.DdsColorNeutralsWhite}`
|
|
12618
12603
|
}
|
|
12619
12604
|
};
|
|
12620
12605
|
var tokens3 = {
|
|
@@ -12622,11 +12607,11 @@ var tokens3 = {
|
|
|
12622
12607
|
};
|
|
12623
12608
|
|
|
12624
12609
|
// src/components/SplitButton/SplitButton.tsx
|
|
12625
|
-
var
|
|
12626
|
-
var Container14 =
|
|
12610
|
+
var import_jsx_runtime251 = require("react/jsx-runtime");
|
|
12611
|
+
var Container14 = import_styled_components79.default.div`
|
|
12627
12612
|
display: flex;
|
|
12628
12613
|
`;
|
|
12629
|
-
var MainButton = (0,
|
|
12614
|
+
var MainButton = (0, import_styled_components79.default)(Button)`
|
|
12630
12615
|
border-top-right-radius: 0;
|
|
12631
12616
|
border-bottom-right-radius: 0;
|
|
12632
12617
|
border-right: none;
|
|
@@ -12635,7 +12620,7 @@ var MainButton = (0, import_styled_components80.default)(Button)`
|
|
|
12635
12620
|
z-index: 0;
|
|
12636
12621
|
}
|
|
12637
12622
|
`;
|
|
12638
|
-
var OptionButton = (0,
|
|
12623
|
+
var OptionButton = (0, import_styled_components79.default)(Button)`
|
|
12639
12624
|
border-top-left-radius: 0;
|
|
12640
12625
|
border-bottom-left-radius: 0;
|
|
12641
12626
|
|
|
@@ -12653,7 +12638,7 @@ var OptionButton = (0, import_styled_components80.default)(Button)`
|
|
|
12653
12638
|
${(props) => props.purpose === "primary" && `border-left: ${tokens3.mainButton.primary.borderLeft}`};
|
|
12654
12639
|
}
|
|
12655
12640
|
`;
|
|
12656
|
-
var SplitButton = (0,
|
|
12641
|
+
var SplitButton = (0, import_react95.forwardRef)(
|
|
12657
12642
|
(props, ref) => {
|
|
12658
12643
|
const {
|
|
12659
12644
|
size: size2,
|
|
@@ -12661,14 +12646,14 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12661
12646
|
secondaryActions,
|
|
12662
12647
|
purpose = "primary"
|
|
12663
12648
|
} = props;
|
|
12664
|
-
const [isOpen, setIsOpen] = (0,
|
|
12649
|
+
const [isOpen, setIsOpen] = (0, import_react95.useState)(false);
|
|
12665
12650
|
const buttonStyleProps = {
|
|
12666
12651
|
appearance: "filled",
|
|
12667
12652
|
purpose,
|
|
12668
12653
|
size: size2
|
|
12669
12654
|
};
|
|
12670
|
-
return /* @__PURE__ */ (0,
|
|
12671
|
-
/* @__PURE__ */ (0,
|
|
12655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(Container14, { ref, children: [
|
|
12656
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
|
|
12672
12657
|
MainButton,
|
|
12673
12658
|
{
|
|
12674
12659
|
...buttonStyleProps,
|
|
@@ -12676,8 +12661,8 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12676
12661
|
iconPosition: "left"
|
|
12677
12662
|
}
|
|
12678
12663
|
),
|
|
12679
|
-
/* @__PURE__ */ (0,
|
|
12680
|
-
/* @__PURE__ */ (0,
|
|
12664
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(OverflowMenuGroup, { onToggle: () => setIsOpen(!isOpen), children: [
|
|
12665
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
|
|
12681
12666
|
OptionButton,
|
|
12682
12667
|
{
|
|
12683
12668
|
...buttonStyleProps,
|
|
@@ -12686,7 +12671,7 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12686
12671
|
purpose
|
|
12687
12672
|
}
|
|
12688
12673
|
),
|
|
12689
|
-
/* @__PURE__ */ (0,
|
|
12674
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(OverflowMenu, { items: secondaryActions, placement: "bottom-end" })
|
|
12690
12675
|
] })
|
|
12691
12676
|
] });
|
|
12692
12677
|
}
|
|
@@ -12694,56 +12679,56 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12694
12679
|
SplitButton.displayName = "SplitButton";
|
|
12695
12680
|
|
|
12696
12681
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12697
|
-
var
|
|
12698
|
-
var
|
|
12682
|
+
var import_react105 = require("react");
|
|
12683
|
+
var import_styled_components88 = __toESM(require("styled-components"));
|
|
12699
12684
|
|
|
12700
12685
|
// src/components/Table/collapsible/Table.context.tsx
|
|
12701
|
-
var
|
|
12702
|
-
var CollapsibleTableContext = (0,
|
|
12686
|
+
var import_react96 = require("react");
|
|
12687
|
+
var CollapsibleTableContext = (0, import_react96.createContext)({
|
|
12703
12688
|
headerValues: [],
|
|
12704
12689
|
definingColumnIndex: [0]
|
|
12705
12690
|
});
|
|
12706
|
-
var useCollapsibleTableContext = () => (0,
|
|
12691
|
+
var useCollapsibleTableContext = () => (0, import_react96.useContext)(CollapsibleTableContext);
|
|
12707
12692
|
|
|
12708
12693
|
// src/components/Table/normal/Body.tsx
|
|
12709
|
-
var
|
|
12710
|
-
var
|
|
12711
|
-
var
|
|
12712
|
-
var StyledBody =
|
|
12713
|
-
var Body2 = (0,
|
|
12694
|
+
var import_react97 = require("react");
|
|
12695
|
+
var import_styled_components80 = __toESM(require("styled-components"));
|
|
12696
|
+
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
12697
|
+
var StyledBody = import_styled_components80.default.tbody``;
|
|
12698
|
+
var Body2 = (0, import_react97.forwardRef)(
|
|
12714
12699
|
({ children, ...rest }, ref) => {
|
|
12715
12700
|
const bodyProps = {
|
|
12716
12701
|
...rest
|
|
12717
12702
|
};
|
|
12718
|
-
return /* @__PURE__ */ (0,
|
|
12703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(StyledBody, { ref, ...bodyProps, children });
|
|
12719
12704
|
}
|
|
12720
12705
|
);
|
|
12721
12706
|
Body2.displayName = "Table.Body";
|
|
12722
12707
|
|
|
12723
12708
|
// src/components/Table/normal/Cell.tsx
|
|
12724
|
-
var import_react100 = require("react");
|
|
12725
|
-
var import_styled_components83 = __toESM(require("styled-components"));
|
|
12726
|
-
|
|
12727
|
-
// src/components/Table/normal/Head.tsx
|
|
12728
12709
|
var import_react99 = require("react");
|
|
12729
12710
|
var import_styled_components82 = __toESM(require("styled-components"));
|
|
12730
|
-
|
|
12731
|
-
|
|
12732
|
-
var
|
|
12711
|
+
|
|
12712
|
+
// src/components/Table/normal/Head.tsx
|
|
12713
|
+
var import_react98 = require("react");
|
|
12714
|
+
var import_styled_components81 = __toESM(require("styled-components"));
|
|
12715
|
+
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
12716
|
+
var StyledHead = import_styled_components81.default.thead``;
|
|
12717
|
+
var Head = (0, import_react98.forwardRef)(
|
|
12733
12718
|
({ children, ...rest }, ref) => {
|
|
12734
|
-
return /* @__PURE__ */ (0,
|
|
12719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(StyledHead, { ref, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(HeadContext.Provider, { value: true, children }) });
|
|
12735
12720
|
}
|
|
12736
12721
|
);
|
|
12737
12722
|
Head.displayName = "Table.Head";
|
|
12738
|
-
var HeadContext = (0,
|
|
12723
|
+
var HeadContext = (0, import_react98.createContext)(false);
|
|
12739
12724
|
function useIsInTableHead() {
|
|
12740
|
-
const isInTableHead = (0,
|
|
12725
|
+
const isInTableHead = (0, import_react98.useContext)(HeadContext);
|
|
12741
12726
|
return isInTableHead;
|
|
12742
12727
|
}
|
|
12743
12728
|
|
|
12744
12729
|
// src/components/Table/normal/Table.tokens.tsx
|
|
12745
|
-
var
|
|
12746
|
-
var { font: font2, colors: colors31, border: border13, spacing: spacing35, iconSizes: iconSizes3, borderRadius: borderRadius9 } =
|
|
12730
|
+
var import_dds_design_tokens58 = require("@norges-domstoler/dds-design-tokens");
|
|
12731
|
+
var { font: font2, colors: colors31, border: border13, spacing: spacing35, iconSizes: iconSizes3, borderRadius: borderRadius9 } = import_dds_design_tokens58.ddsBaseTokens;
|
|
12747
12732
|
var row = {
|
|
12748
12733
|
body: {
|
|
12749
12734
|
odd: {
|
|
@@ -12814,20 +12799,20 @@ var tableTokens = {
|
|
|
12814
12799
|
};
|
|
12815
12800
|
|
|
12816
12801
|
// src/components/Table/normal/Cell.tsx
|
|
12817
|
-
var
|
|
12802
|
+
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
12818
12803
|
var { cell: cell3 } = tableTokens;
|
|
12819
12804
|
var getLayoutStyle = (layout) => {
|
|
12820
12805
|
switch (layout) {
|
|
12821
12806
|
case "center":
|
|
12822
|
-
return
|
|
12807
|
+
return import_styled_components82.css`
|
|
12823
12808
|
justify-content: center;
|
|
12824
12809
|
`;
|
|
12825
12810
|
case "right":
|
|
12826
|
-
return
|
|
12811
|
+
return import_styled_components82.css`
|
|
12827
12812
|
justify-content: flex-end;
|
|
12828
12813
|
`;
|
|
12829
12814
|
case "text and icon":
|
|
12830
|
-
return
|
|
12815
|
+
return import_styled_components82.css`
|
|
12831
12816
|
gap: ${cell3.layout.textAndIcon.gap};
|
|
12832
12817
|
`;
|
|
12833
12818
|
default:
|
|
@@ -12835,12 +12820,12 @@ var getLayoutStyle = (layout) => {
|
|
|
12835
12820
|
return;
|
|
12836
12821
|
}
|
|
12837
12822
|
};
|
|
12838
|
-
var StyledCell =
|
|
12839
|
-
${({ $type: type }) => type === "head" &&
|
|
12823
|
+
var StyledCell = import_styled_components82.default.td`
|
|
12824
|
+
${({ $type: type }) => type === "head" && import_styled_components82.css`
|
|
12840
12825
|
background-color: ${cell3.head.backgroundColor};
|
|
12841
12826
|
`}
|
|
12842
12827
|
`;
|
|
12843
|
-
var InnerCell =
|
|
12828
|
+
var InnerCell = import_styled_components82.default.div`
|
|
12844
12829
|
display: flex;
|
|
12845
12830
|
align-items: center;
|
|
12846
12831
|
${({ $layout: layout }) => getLayoutStyle(layout)}
|
|
@@ -12854,49 +12839,49 @@ var getTableCellType = (type) => {
|
|
|
12854
12839
|
return "td";
|
|
12855
12840
|
}
|
|
12856
12841
|
};
|
|
12857
|
-
var Cell2 = (0,
|
|
12842
|
+
var Cell2 = (0, import_react99.forwardRef)(
|
|
12858
12843
|
({ children, type: _type, layout = "left", collapsibleProps, ...rest }, ref) => {
|
|
12859
12844
|
const isInHead = useIsInTableHead();
|
|
12860
12845
|
const type = _type != null ? _type : isInHead ? "head" : "data";
|
|
12861
12846
|
const as = getTableCellType(type);
|
|
12862
12847
|
const { isCollapsibleChild } = collapsibleProps != null ? collapsibleProps : {};
|
|
12863
|
-
return isCollapsibleChild ? /* @__PURE__ */ (0,
|
|
12848
|
+
return isCollapsibleChild ? /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(DescriptionListDesc, { children }) : /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(StyledCell, { as, ref, $type: type, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(InnerCell, { $layout: layout, children }) });
|
|
12864
12849
|
}
|
|
12865
12850
|
);
|
|
12866
12851
|
Cell2.displayName = "Table.Cell";
|
|
12867
12852
|
|
|
12868
12853
|
// src/components/Table/normal/Foot.tsx
|
|
12869
|
-
var
|
|
12870
|
-
var
|
|
12871
|
-
var
|
|
12872
|
-
var StyledFoot =
|
|
12873
|
-
var Foot = (0,
|
|
12854
|
+
var import_react100 = require("react");
|
|
12855
|
+
var import_styled_components83 = __toESM(require("styled-components"));
|
|
12856
|
+
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
12857
|
+
var StyledFoot = import_styled_components83.default.tfoot``;
|
|
12858
|
+
var Foot = (0, import_react100.forwardRef)(
|
|
12874
12859
|
({ children, ...rest }, ref) => {
|
|
12875
|
-
return /* @__PURE__ */ (0,
|
|
12860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(StyledFoot, { ref, ...rest, children });
|
|
12876
12861
|
}
|
|
12877
12862
|
);
|
|
12878
12863
|
Foot.displayName = "Table.Foot";
|
|
12879
12864
|
|
|
12880
12865
|
// src/components/Table/normal/Row.tsx
|
|
12881
|
-
var
|
|
12866
|
+
var import_react101 = require("react");
|
|
12882
12867
|
|
|
12883
12868
|
// src/components/Table/normal/Table.styles.tsx
|
|
12884
|
-
var
|
|
12869
|
+
var import_styled_components84 = __toESM(require("styled-components"));
|
|
12885
12870
|
var { row: row2 } = tableTokens;
|
|
12886
12871
|
var bodyRowStyles = (mode, selected) => {
|
|
12887
|
-
return
|
|
12888
|
-
${mode === "sum" &&
|
|
12872
|
+
return import_styled_components84.css`
|
|
12873
|
+
${mode === "sum" && import_styled_components84.css`
|
|
12889
12874
|
font-weight: 600;
|
|
12890
12875
|
border-top: ${row2.body.mode.sum.borderTop};
|
|
12891
12876
|
border-bottom: ${row2.body.mode.sum.borderBottom};
|
|
12892
12877
|
background-color: ${row2.body.mode.sum.backgroundColor};
|
|
12893
12878
|
`}
|
|
12894
|
-
${selected &&
|
|
12879
|
+
${selected && import_styled_components84.css`
|
|
12895
12880
|
background-color: ${row2.body.selected.backgroundColor};
|
|
12896
12881
|
`}
|
|
12897
12882
|
`;
|
|
12898
12883
|
};
|
|
12899
|
-
var StyledRow =
|
|
12884
|
+
var StyledRow = import_styled_components84.default.tr`
|
|
12900
12885
|
@media (prefers-reduced-motion: no-preference) {
|
|
12901
12886
|
transition:
|
|
12902
12887
|
background-color 0.2s,
|
|
@@ -12906,11 +12891,11 @@ var StyledRow = import_styled_components85.default.tr`
|
|
|
12906
12891
|
|
|
12907
12892
|
${getFontStyling(defaultTypographyType, true)}
|
|
12908
12893
|
|
|
12909
|
-
${({ type }) => type === "head" &&
|
|
12894
|
+
${({ type }) => type === "head" && import_styled_components84.css`
|
|
12910
12895
|
font-weight: 600;
|
|
12911
12896
|
text-align: left;
|
|
12912
12897
|
`}
|
|
12913
|
-
${({ type, $mode: mode, $selected: selected, $hoverable: hoverable }) => type === "body" &&
|
|
12898
|
+
${({ type, $mode: mode, $selected: selected, $hoverable: hoverable }) => type === "body" && import_styled_components84.css`
|
|
12914
12899
|
&:nth-of-type(even) {
|
|
12915
12900
|
background-color: ${row2.body.even.backgroundColor};
|
|
12916
12901
|
${bodyRowStyles(mode, selected)}
|
|
@@ -12921,7 +12906,7 @@ var StyledRow = import_styled_components85.default.tr`
|
|
|
12921
12906
|
${bodyRowStyles(mode, selected)}
|
|
12922
12907
|
}
|
|
12923
12908
|
|
|
12924
|
-
${hoverable &&
|
|
12909
|
+
${hoverable && import_styled_components84.css`
|
|
12925
12910
|
&:hover {
|
|
12926
12911
|
background-color: ${row2.body.hover.backgroundColor};
|
|
12927
12912
|
}
|
|
@@ -12933,12 +12918,12 @@ var StyledRow = import_styled_components85.default.tr`
|
|
|
12933
12918
|
`;
|
|
12934
12919
|
|
|
12935
12920
|
// src/components/Table/normal/Row.tsx
|
|
12936
|
-
var
|
|
12937
|
-
var Row = (0,
|
|
12921
|
+
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
12922
|
+
var Row = (0, import_react101.forwardRef)(
|
|
12938
12923
|
({ type: _type, mode = "normal", hoverable, selected, children, ...rest }, ref) => {
|
|
12939
12924
|
const isInHeader = useIsInTableHead();
|
|
12940
12925
|
const type = _type != null ? _type : isInHeader ? "head" : "body";
|
|
12941
|
-
return /* @__PURE__ */ (0,
|
|
12926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
12942
12927
|
StyledRow,
|
|
12943
12928
|
{
|
|
12944
12929
|
type,
|
|
@@ -12955,11 +12940,11 @@ var Row = (0, import_react102.forwardRef)(
|
|
|
12955
12940
|
Row.displayName = "Table.Row";
|
|
12956
12941
|
|
|
12957
12942
|
// src/components/Table/normal/SortCell.tsx
|
|
12958
|
-
var
|
|
12959
|
-
var
|
|
12960
|
-
var
|
|
12943
|
+
var import_react102 = require("react");
|
|
12944
|
+
var import_styled_components85 = __toESM(require("styled-components"));
|
|
12945
|
+
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
12961
12946
|
var { cell: cell4 } = tableTokens;
|
|
12962
|
-
var StyledButton5 =
|
|
12947
|
+
var StyledButton5 = import_styled_components85.default.button`
|
|
12963
12948
|
${normalizeButton}
|
|
12964
12949
|
user-select: text;
|
|
12965
12950
|
${removeButtonStyling}
|
|
@@ -12972,19 +12957,19 @@ var StyledButton5 = import_styled_components86.default.button`
|
|
|
12972
12957
|
`;
|
|
12973
12958
|
var makeSortIcon = (isSorted, sortOrder) => {
|
|
12974
12959
|
if (!isSorted || !sortOrder) {
|
|
12975
|
-
return /* @__PURE__ */ (0,
|
|
12960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(Icon, { icon: UnfoldMoreIcon, iconSize: "inherit" });
|
|
12976
12961
|
}
|
|
12977
|
-
return sortOrder === "ascending" ? /* @__PURE__ */ (0,
|
|
12962
|
+
return sortOrder === "ascending" ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(Icon, { icon: ChevronDownIcon, iconSize: "inherit" }) : /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(Icon, { icon: ChevronUpIcon, iconSize: "inherit" });
|
|
12978
12963
|
};
|
|
12979
|
-
var SortCell = (0,
|
|
12980
|
-
({ isSorted, sortOrder, onClick, children, ...rest }, ref) => /* @__PURE__ */ (0,
|
|
12964
|
+
var SortCell = (0, import_react102.forwardRef)(
|
|
12965
|
+
({ isSorted, sortOrder, onClick, children, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
|
|
12981
12966
|
Cell2,
|
|
12982
12967
|
{
|
|
12983
12968
|
ref,
|
|
12984
12969
|
type: "head",
|
|
12985
12970
|
"aria-sort": isSorted && sortOrder ? sortOrder : void 0,
|
|
12986
12971
|
...rest,
|
|
12987
|
-
children: /* @__PURE__ */ (0,
|
|
12972
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)(
|
|
12988
12973
|
StyledButton5,
|
|
12989
12974
|
{
|
|
12990
12975
|
onClick,
|
|
@@ -13002,11 +12987,11 @@ var SortCell = (0, import_react103.forwardRef)(
|
|
|
13002
12987
|
SortCell.displayName = "Table.SortCell";
|
|
13003
12988
|
|
|
13004
12989
|
// src/components/Table/normal/Table.tsx
|
|
13005
|
-
var
|
|
13006
|
-
var
|
|
13007
|
-
var
|
|
12990
|
+
var import_react103 = require("react");
|
|
12991
|
+
var import_styled_components86 = __toESM(require("styled-components"));
|
|
12992
|
+
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
13008
12993
|
var { cell: cell5, row: row3 } = tableTokens;
|
|
13009
|
-
var StyledTable =
|
|
12994
|
+
var StyledTable = import_styled_components86.default.table`
|
|
13010
12995
|
border-spacing: 0;
|
|
13011
12996
|
border-collapse: collapse;
|
|
13012
12997
|
*::selection {
|
|
@@ -13014,13 +12999,13 @@ var StyledTable = import_styled_components87.default.table`
|
|
|
13014
12999
|
}
|
|
13015
13000
|
${scrollbarStyling.webkit}
|
|
13016
13001
|
${scrollbarStyling.firefox}
|
|
13017
|
-
${({ $density }) =>
|
|
13002
|
+
${({ $density }) => import_styled_components86.css`
|
|
13018
13003
|
td,
|
|
13019
13004
|
th {
|
|
13020
13005
|
padding: ${cell5.density[$density].padding};
|
|
13021
13006
|
}
|
|
13022
13007
|
`}
|
|
13023
|
-
${({ $density }) => $density === "extraCompact" &&
|
|
13008
|
+
${({ $density }) => $density === "extraCompact" && import_styled_components86.css`
|
|
13024
13009
|
th {
|
|
13025
13010
|
background-color: ${row3.head.extraCompact.backgroundColor};
|
|
13026
13011
|
font-size: ${row3.head.extraCompact.fontSize};
|
|
@@ -13034,7 +13019,7 @@ var StyledTable = import_styled_components87.default.table`
|
|
|
13034
13019
|
}
|
|
13035
13020
|
}
|
|
13036
13021
|
`}
|
|
13037
|
-
${({ $stickyHeader }) => $stickyHeader &&
|
|
13022
|
+
${({ $stickyHeader }) => $stickyHeader && import_styled_components86.css`
|
|
13038
13023
|
tr[type='head'] {
|
|
13039
13024
|
th[type='head'] {
|
|
13040
13025
|
position: sticky;
|
|
@@ -13043,15 +13028,15 @@ var StyledTable = import_styled_components87.default.table`
|
|
|
13043
13028
|
}
|
|
13044
13029
|
}
|
|
13045
13030
|
`}
|
|
13046
|
-
${({ $withDividers }) => $withDividers &&
|
|
13031
|
+
${({ $withDividers }) => $withDividers && import_styled_components86.css`
|
|
13047
13032
|
tr[type='body'] {
|
|
13048
13033
|
border-bottom: ${row3.body.withDividers.borderBottom};
|
|
13049
13034
|
}
|
|
13050
13035
|
`}
|
|
13051
13036
|
`;
|
|
13052
|
-
var Table = (0,
|
|
13037
|
+
var Table = (0, import_react103.forwardRef)(
|
|
13053
13038
|
({ density = "normal", stickyHeader, withDividers, children, ...rest }, ref) => {
|
|
13054
|
-
return /* @__PURE__ */ (0,
|
|
13039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(
|
|
13055
13040
|
StyledTable,
|
|
13056
13041
|
{
|
|
13057
13042
|
...rest,
|
|
@@ -13067,38 +13052,38 @@ var Table = (0, import_react104.forwardRef)(
|
|
|
13067
13052
|
Table.displayName = "Table";
|
|
13068
13053
|
|
|
13069
13054
|
// src/components/Table/normal/TableWrapper.tsx
|
|
13070
|
-
var
|
|
13071
|
-
var
|
|
13072
|
-
var
|
|
13073
|
-
var Wrapper6 =
|
|
13074
|
-
${({ $overflowX }) => $overflowX &&
|
|
13055
|
+
var import_react104 = require("react");
|
|
13056
|
+
var import_styled_components87 = __toESM(require("styled-components"));
|
|
13057
|
+
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
13058
|
+
var Wrapper6 = import_styled_components87.default.div`
|
|
13059
|
+
${({ $overflowX }) => $overflowX && import_styled_components87.css`
|
|
13075
13060
|
overflow-x: auto;
|
|
13076
13061
|
`}
|
|
13077
13062
|
${scrollbarStyling.webkit}
|
|
13078
13063
|
${scrollbarStyling.firefox}
|
|
13079
13064
|
`;
|
|
13080
13065
|
var TableWrapper = ({ children, ...rest }) => {
|
|
13081
|
-
const [overflowX, setOverflowX] = (0,
|
|
13082
|
-
const [windowWidth, setWindowWidth] = (0,
|
|
13066
|
+
const [overflowX, setOverflowX] = (0, import_react104.useState)(false);
|
|
13067
|
+
const [windowWidth, setWindowWidth] = (0, import_react104.useState)(window.innerWidth);
|
|
13083
13068
|
function isOverflowingX(event) {
|
|
13084
13069
|
return event.offsetWidth < event.scrollWidth;
|
|
13085
13070
|
}
|
|
13086
|
-
const wrapperRef = (0,
|
|
13087
|
-
(0,
|
|
13071
|
+
const wrapperRef = (0, import_react104.useRef)(null);
|
|
13072
|
+
(0, import_react104.useEffect)(() => {
|
|
13088
13073
|
if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
|
|
13089
13074
|
setOverflowX(true);
|
|
13090
13075
|
return;
|
|
13091
13076
|
}
|
|
13092
13077
|
setOverflowX(false);
|
|
13093
13078
|
}, [windowWidth]);
|
|
13094
|
-
(0,
|
|
13079
|
+
(0, import_react104.useEffect)(() => {
|
|
13095
13080
|
function handleResize() {
|
|
13096
13081
|
setWindowWidth(window.innerWidth);
|
|
13097
13082
|
}
|
|
13098
13083
|
window.addEventListener("resize", handleResize);
|
|
13099
13084
|
return () => window.removeEventListener("resize", handleResize);
|
|
13100
13085
|
});
|
|
13101
|
-
return /* @__PURE__ */ (0,
|
|
13086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(Wrapper6, { $overflowX: overflowX, ref: wrapperRef, ...rest, children });
|
|
13102
13087
|
};
|
|
13103
13088
|
TableWrapper.displayName = "Table.Wrapper";
|
|
13104
13089
|
|
|
@@ -13113,9 +13098,9 @@ Table2.Row = Row;
|
|
|
13113
13098
|
Table2.Foot = Foot;
|
|
13114
13099
|
|
|
13115
13100
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
13116
|
-
var
|
|
13101
|
+
var import_jsx_runtime260 = require("react/jsx-runtime");
|
|
13117
13102
|
var { collapseButton: collapseButton2 } = tableTokens;
|
|
13118
|
-
var CollapseButton =
|
|
13103
|
+
var CollapseButton = import_styled_components88.default.button`
|
|
13119
13104
|
${removeButtonStyling}
|
|
13120
13105
|
margin-left: auto;
|
|
13121
13106
|
margin-right: auto;
|
|
@@ -13130,12 +13115,12 @@ var CollapseButton = import_styled_components89.default.button`
|
|
|
13130
13115
|
${focusVisible}
|
|
13131
13116
|
}
|
|
13132
13117
|
`;
|
|
13133
|
-
var DescriptionListCell = (0,
|
|
13118
|
+
var DescriptionListCell = (0, import_styled_components88.default)(Cell2)`
|
|
13134
13119
|
& > div {
|
|
13135
13120
|
display: block;
|
|
13136
13121
|
}
|
|
13137
13122
|
`;
|
|
13138
|
-
var CollapsibleRow = (0,
|
|
13123
|
+
var CollapsibleRow = (0, import_react105.forwardRef)(
|
|
13139
13124
|
({ type: _type, mode = "normal", selected, hoverable, children, ...rest }, ref) => {
|
|
13140
13125
|
const isInHead = useIsInTableHead();
|
|
13141
13126
|
const type = _type != null ? _type : isInHead ? "head" : "body";
|
|
@@ -13147,14 +13132,14 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13147
13132
|
...rest
|
|
13148
13133
|
};
|
|
13149
13134
|
const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
|
|
13150
|
-
const [childrenCollapsed, setChildrenCollapsed] = (0,
|
|
13151
|
-
(0,
|
|
13135
|
+
const [childrenCollapsed, setChildrenCollapsed] = (0, import_react105.useState)(true);
|
|
13136
|
+
(0, import_react105.useEffect)(() => {
|
|
13152
13137
|
!isCollapsed && setChildrenCollapsed(true);
|
|
13153
13138
|
}, [isCollapsed]);
|
|
13154
13139
|
const collapsedHeaderValues = headerValues.filter(
|
|
13155
13140
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
13156
13141
|
);
|
|
13157
|
-
const childrenArray =
|
|
13142
|
+
const childrenArray = import_react105.Children.toArray(children);
|
|
13158
13143
|
const collapsedChildren = childrenArray.filter(
|
|
13159
13144
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
13160
13145
|
);
|
|
@@ -13163,25 +13148,25 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13163
13148
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
13164
13149
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
13165
13150
|
collapsibleIds.push(id);
|
|
13166
|
-
return /* @__PURE__ */ (0,
|
|
13167
|
-
/* @__PURE__ */ (0,
|
|
13168
|
-
(0,
|
|
13151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(import_react105.Fragment, { children: [
|
|
13152
|
+
/* @__PURE__ */ (0, import_jsx_runtime260.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
13153
|
+
(0, import_react105.isValidElement)(child) && (0, import_react105.cloneElement)(child, {
|
|
13169
13154
|
collapsibleProps: { isCollapsibleChild: true }
|
|
13170
13155
|
})
|
|
13171
13156
|
] }, `DL-${index}`);
|
|
13172
13157
|
}) : null;
|
|
13173
|
-
const collapsedRows = collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0,
|
|
13158
|
+
const collapsedRows = collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(StyledRow, { type, children: /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(DescriptionListCell, { colSpan: definingColumnIndex.length + 1, children: /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(DescriptionList, { children: collapsedRenderedChildren }) }) }) : null;
|
|
13174
13159
|
const definingColumnCells = childrenArray.slice().filter((column, index) => definingColumnIndex.indexOf(index) > -1).sort((a2, b) => {
|
|
13175
13160
|
return definingColumnIndex.indexOf(childrenArray.indexOf(a2)) - definingColumnIndex.indexOf(childrenArray.indexOf(b));
|
|
13176
13161
|
});
|
|
13177
13162
|
const headerRow = () => {
|
|
13178
13163
|
if (type !== "head" || !isCollapsed)
|
|
13179
13164
|
return null;
|
|
13180
|
-
return /* @__PURE__ */ (0,
|
|
13165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(StyledRow, { ref, type, ...rowProps, children: /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(import_jsx_runtime260.Fragment, { children: [
|
|
13181
13166
|
definingColumnCells,
|
|
13182
|
-
/* @__PURE__ */ (0,
|
|
13167
|
+
/* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(Table2.Cell, { type: "head", layout: "center", children: [
|
|
13183
13168
|
"Utvid",
|
|
13184
|
-
/* @__PURE__ */ (0,
|
|
13169
|
+
/* @__PURE__ */ (0, import_jsx_runtime260.jsx)(VisuallyHidden, { as: "span", children: "raden" })
|
|
13185
13170
|
] })
|
|
13186
13171
|
] }) });
|
|
13187
13172
|
};
|
|
@@ -13189,7 +13174,7 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13189
13174
|
const rowWithChevron = () => {
|
|
13190
13175
|
if (type !== "body" || !isCollapsed)
|
|
13191
13176
|
return null;
|
|
13192
|
-
return /* @__PURE__ */ (0,
|
|
13177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(
|
|
13193
13178
|
StyledRow,
|
|
13194
13179
|
{
|
|
13195
13180
|
ref,
|
|
@@ -13198,13 +13183,13 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13198
13183
|
"data-isopencollapsibleheader": !childrenCollapsed && true,
|
|
13199
13184
|
children: [
|
|
13200
13185
|
definingColumnCells,
|
|
13201
|
-
/* @__PURE__ */ (0,
|
|
13186
|
+
/* @__PURE__ */ (0, import_jsx_runtime260.jsx)(Table2.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(
|
|
13202
13187
|
CollapseButton,
|
|
13203
13188
|
{
|
|
13204
13189
|
onClick: () => setChildrenCollapsed(!childrenCollapsed),
|
|
13205
13190
|
"aria-expanded": !childrenCollapsed,
|
|
13206
13191
|
"aria-controls": idList,
|
|
13207
|
-
children: /* @__PURE__ */ (0,
|
|
13192
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(
|
|
13208
13193
|
AnimatedChevronUpDown,
|
|
13209
13194
|
{
|
|
13210
13195
|
isUp: childrenCollapsed ? false : true,
|
|
@@ -13218,30 +13203,30 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13218
13203
|
}
|
|
13219
13204
|
);
|
|
13220
13205
|
};
|
|
13221
|
-
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0,
|
|
13206
|
+
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(import_jsx_runtime260.Fragment, { children: [
|
|
13222
13207
|
headerRow(),
|
|
13223
|
-
type === "body" && /* @__PURE__ */ (0,
|
|
13208
|
+
type === "body" && /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(import_jsx_runtime260.Fragment, { children: [
|
|
13224
13209
|
rowWithChevron(),
|
|
13225
13210
|
childrenCollapsed ? null : collapsedRows
|
|
13226
13211
|
] })
|
|
13227
|
-
] }) : /* @__PURE__ */ (0,
|
|
13212
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(StyledRow, { ref, type, ...rowProps, children });
|
|
13228
13213
|
}
|
|
13229
13214
|
);
|
|
13230
13215
|
CollapsibleRow.displayName = "CollapsibleTable.Row";
|
|
13231
13216
|
|
|
13232
13217
|
// src/components/Table/collapsible/CollapsibleTable.tsx
|
|
13233
|
-
var
|
|
13234
|
-
var
|
|
13235
|
-
var
|
|
13236
|
-
var StyledTable2 = (0,
|
|
13218
|
+
var import_react106 = require("react");
|
|
13219
|
+
var import_styled_components89 = __toESM(require("styled-components"));
|
|
13220
|
+
var import_jsx_runtime261 = require("react/jsx-runtime");
|
|
13221
|
+
var StyledTable2 = (0, import_styled_components89.default)(Table2)`
|
|
13237
13222
|
width: 100%;
|
|
13238
|
-
${({ withDividers }) => withDividers &&
|
|
13223
|
+
${({ withDividers }) => withDividers && import_styled_components89.css`
|
|
13239
13224
|
tr[data-isopencollapsibleheader='true'] {
|
|
13240
13225
|
border-bottom: none;
|
|
13241
13226
|
}
|
|
13242
13227
|
`}
|
|
13243
13228
|
`;
|
|
13244
|
-
var CollapsibleTable = (0,
|
|
13229
|
+
var CollapsibleTable = (0, import_react106.forwardRef)((props, ref) => {
|
|
13245
13230
|
const {
|
|
13246
13231
|
density = "normal",
|
|
13247
13232
|
children,
|
|
@@ -13250,7 +13235,7 @@ var CollapsibleTable = (0, import_react107.forwardRef)((props, ref) => {
|
|
|
13250
13235
|
definingColumnIndex = [0],
|
|
13251
13236
|
...rest
|
|
13252
13237
|
} = props;
|
|
13253
|
-
return /* @__PURE__ */ (0,
|
|
13238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(
|
|
13254
13239
|
CollapsibleTableContext.Provider,
|
|
13255
13240
|
{
|
|
13256
13241
|
value: {
|
|
@@ -13258,7 +13243,7 @@ var CollapsibleTable = (0, import_react107.forwardRef)((props, ref) => {
|
|
|
13258
13243
|
headerValues,
|
|
13259
13244
|
definingColumnIndex
|
|
13260
13245
|
},
|
|
13261
|
-
children: /* @__PURE__ */ (0,
|
|
13246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(StyledTable2, { ref, density, ...rest, children })
|
|
13262
13247
|
}
|
|
13263
13248
|
);
|
|
13264
13249
|
});
|
|
@@ -13269,12 +13254,12 @@ var CollapsibleTable2 = CollapsibleTable;
|
|
|
13269
13254
|
CollapsibleTable2.Row = CollapsibleRow;
|
|
13270
13255
|
|
|
13271
13256
|
// src/components/Tabs/Tabs.tsx
|
|
13272
|
-
var
|
|
13273
|
-
var
|
|
13257
|
+
var import_react108 = require("react");
|
|
13258
|
+
var import_styled_components90 = __toESM(require("styled-components"));
|
|
13274
13259
|
|
|
13275
13260
|
// src/components/Tabs/Tabs.context.tsx
|
|
13276
|
-
var
|
|
13277
|
-
var TabsContext = (0,
|
|
13261
|
+
var import_react107 = require("react");
|
|
13262
|
+
var TabsContext = (0, import_react107.createContext)({
|
|
13278
13263
|
activeTab: 0,
|
|
13279
13264
|
tabsId: "",
|
|
13280
13265
|
handleTabChange: () => null,
|
|
@@ -13284,16 +13269,16 @@ var TabsContext = (0, import_react108.createContext)({
|
|
|
13284
13269
|
setHasTabFocus: () => null,
|
|
13285
13270
|
tabContentDirection: "row"
|
|
13286
13271
|
});
|
|
13287
|
-
var useTabsContext = () => (0,
|
|
13272
|
+
var useTabsContext = () => (0, import_react107.useContext)(TabsContext);
|
|
13288
13273
|
|
|
13289
13274
|
// src/components/Tabs/Tabs.tsx
|
|
13290
|
-
var
|
|
13291
|
-
var Container15 =
|
|
13292
|
-
${({ $width }) => $width &&
|
|
13275
|
+
var import_jsx_runtime262 = require("react/jsx-runtime");
|
|
13276
|
+
var Container15 = import_styled_components90.default.div`
|
|
13277
|
+
${({ $width }) => $width && import_styled_components90.css`
|
|
13293
13278
|
width: ${$width};
|
|
13294
13279
|
`};
|
|
13295
13280
|
`;
|
|
13296
|
-
var Tabs = (0,
|
|
13281
|
+
var Tabs = (0, import_react108.forwardRef)((props, ref) => {
|
|
13297
13282
|
const {
|
|
13298
13283
|
id,
|
|
13299
13284
|
activeTab,
|
|
@@ -13305,17 +13290,17 @@ var Tabs = (0, import_react109.forwardRef)((props, ref) => {
|
|
|
13305
13290
|
htmlProps,
|
|
13306
13291
|
...rest
|
|
13307
13292
|
} = props;
|
|
13308
|
-
const generatedId = (0,
|
|
13293
|
+
const generatedId = (0, import_react108.useId)();
|
|
13309
13294
|
const uniqueId = id != null ? id : `${generatedId}-tabs`;
|
|
13310
|
-
const [thisActiveTab, setActiveTab] = (0,
|
|
13311
|
-
const [hasTabFocus, setHasTabFocus] = (0,
|
|
13312
|
-
const tabListRef = (0,
|
|
13313
|
-
const tabPanelsRef = (0,
|
|
13295
|
+
const [thisActiveTab, setActiveTab] = (0, import_react108.useState)(activeTab != null ? activeTab : 0);
|
|
13296
|
+
const [hasTabFocus, setHasTabFocus] = (0, import_react108.useState)(false);
|
|
13297
|
+
const tabListRef = (0, import_react108.useRef)(null);
|
|
13298
|
+
const tabPanelsRef = (0, import_react108.useRef)(null);
|
|
13314
13299
|
const handleTabChange = (index) => {
|
|
13315
13300
|
setActiveTab(index);
|
|
13316
13301
|
onChange && onChange(index);
|
|
13317
13302
|
};
|
|
13318
|
-
(0,
|
|
13303
|
+
(0, import_react108.useEffect)(() => {
|
|
13319
13304
|
if (activeTab !== void 0 && activeTab !== thisActiveTab) {
|
|
13320
13305
|
setActiveTab(activeTab);
|
|
13321
13306
|
}
|
|
@@ -13324,7 +13309,7 @@ var Tabs = (0, import_react109.forwardRef)((props, ref) => {
|
|
|
13324
13309
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
13325
13310
|
ref
|
|
13326
13311
|
};
|
|
13327
|
-
return /* @__PURE__ */ (0,
|
|
13312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(
|
|
13328
13313
|
TabsContext.Provider,
|
|
13329
13314
|
{
|
|
13330
13315
|
value: {
|
|
@@ -13337,19 +13322,19 @@ var Tabs = (0, import_react109.forwardRef)((props, ref) => {
|
|
|
13337
13322
|
setHasTabFocus,
|
|
13338
13323
|
tabContentDirection
|
|
13339
13324
|
},
|
|
13340
|
-
children: /* @__PURE__ */ (0,
|
|
13325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(Container15, { ...containerProps, $width: width, children })
|
|
13341
13326
|
}
|
|
13342
13327
|
);
|
|
13343
13328
|
});
|
|
13344
13329
|
Tabs.displayName = "Tabs";
|
|
13345
13330
|
|
|
13346
13331
|
// src/components/Tabs/Tab.tsx
|
|
13347
|
-
var
|
|
13348
|
-
var
|
|
13332
|
+
var import_react110 = require("react");
|
|
13333
|
+
var import_styled_components91 = __toESM(require("styled-components"));
|
|
13349
13334
|
|
|
13350
13335
|
// src/components/Tabs/Tabs.tokens.tsx
|
|
13351
|
-
var
|
|
13352
|
-
var { border: border14, spacing: spacing36, colors: colors32 } =
|
|
13336
|
+
var import_dds_design_tokens59 = require("@norges-domstoler/dds-design-tokens");
|
|
13337
|
+
var { border: border14, spacing: spacing36, colors: colors32 } = import_dds_design_tokens59.ddsBaseTokens;
|
|
13353
13338
|
var tabList = {
|
|
13354
13339
|
borderBottom: `${border14.BordersDdsBorderStyleLightStrokeWeight} solid ${border14.BordersDdsBorderStyleLightStroke}`
|
|
13355
13340
|
};
|
|
@@ -13387,14 +13372,14 @@ var tabsTokens = {
|
|
|
13387
13372
|
};
|
|
13388
13373
|
|
|
13389
13374
|
// src/components/Tabs/TabWidthContext.tsx
|
|
13390
|
-
var
|
|
13391
|
-
var
|
|
13392
|
-
var TabContext = (0,
|
|
13375
|
+
var import_react109 = require("react");
|
|
13376
|
+
var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
13377
|
+
var TabContext = (0, import_react109.createContext)(null);
|
|
13393
13378
|
function TabWidthContextProvider({
|
|
13394
13379
|
children,
|
|
13395
13380
|
onChangeWidths
|
|
13396
13381
|
}) {
|
|
13397
|
-
return /* @__PURE__ */ (0,
|
|
13382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(
|
|
13398
13383
|
TabContext.Provider,
|
|
13399
13384
|
{
|
|
13400
13385
|
value: {
|
|
@@ -13418,17 +13403,17 @@ function TabWidthContextProvider({
|
|
|
13418
13403
|
);
|
|
13419
13404
|
}
|
|
13420
13405
|
function useSetTabWidth(index, width) {
|
|
13421
|
-
const context = (0,
|
|
13422
|
-
(0,
|
|
13406
|
+
const context = (0, import_react109.useContext)(TabContext);
|
|
13407
|
+
(0, import_react109.useLayoutEffect)(() => {
|
|
13423
13408
|
context == null ? void 0 : context.updateWidth(index, width);
|
|
13424
13409
|
return () => context == null ? void 0 : context.removeTab(index);
|
|
13425
13410
|
}, [index, width]);
|
|
13426
13411
|
}
|
|
13427
13412
|
|
|
13428
13413
|
// src/components/Tabs/Tab.tsx
|
|
13429
|
-
var
|
|
13414
|
+
var import_jsx_runtime264 = require("react/jsx-runtime");
|
|
13430
13415
|
var { tab: tab2 } = tabsTokens;
|
|
13431
|
-
var Button2 =
|
|
13416
|
+
var Button2 = import_styled_components91.default.button`
|
|
13432
13417
|
${normalizeButton}
|
|
13433
13418
|
${removeButtonStyling}
|
|
13434
13419
|
user-select: text;
|
|
@@ -13448,12 +13433,12 @@ var Button2 = import_styled_components92.default.button`
|
|
|
13448
13433
|
${focusVisibleTransitionValue};
|
|
13449
13434
|
}
|
|
13450
13435
|
|
|
13451
|
-
${({ $direction }) =>
|
|
13436
|
+
${({ $direction }) => import_styled_components91.css`
|
|
13452
13437
|
flex-direction: ${$direction};
|
|
13453
13438
|
gap: ${tab2[$direction].gap};
|
|
13454
13439
|
`};
|
|
13455
13440
|
|
|
13456
|
-
${({ $active }) => $active &&
|
|
13441
|
+
${({ $active }) => $active && import_styled_components91.css`
|
|
13457
13442
|
background-color: ${tab2.active.backgroundColor};
|
|
13458
13443
|
border-color: ${tab2.active.borderColor};
|
|
13459
13444
|
color: ${tab2.active.color};
|
|
@@ -13471,7 +13456,7 @@ var Button2 = import_styled_components92.default.button`
|
|
|
13471
13456
|
box-shadow: ${tab2.hover.boxShadow};
|
|
13472
13457
|
}
|
|
13473
13458
|
`;
|
|
13474
|
-
var Tab = (0,
|
|
13459
|
+
var Tab = (0, import_react110.forwardRef)((props, ref) => {
|
|
13475
13460
|
const {
|
|
13476
13461
|
active = false,
|
|
13477
13462
|
icon: icon12,
|
|
@@ -13488,10 +13473,10 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13488
13473
|
...rest
|
|
13489
13474
|
} = props;
|
|
13490
13475
|
useSetTabWidth(index, width);
|
|
13491
|
-
const itemRef = (0,
|
|
13476
|
+
const itemRef = (0, import_react110.useRef)(null);
|
|
13492
13477
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
13493
13478
|
const { tabPanelsRef, setHasTabFocus, tabContentDirection } = useTabsContext();
|
|
13494
|
-
(0,
|
|
13479
|
+
(0, import_react110.useEffect)(() => {
|
|
13495
13480
|
var _a;
|
|
13496
13481
|
if (focus) {
|
|
13497
13482
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
@@ -13503,7 +13488,7 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13503
13488
|
setHasTabFocus(false);
|
|
13504
13489
|
(_a = tabPanelsRef == null ? void 0 : tabPanelsRef.current) == null ? void 0 : _a.focus();
|
|
13505
13490
|
});
|
|
13506
|
-
const handleSelect = (0,
|
|
13491
|
+
const handleSelect = (0, import_react110.useCallback)(() => {
|
|
13507
13492
|
if (setFocus && index) {
|
|
13508
13493
|
setFocus(index);
|
|
13509
13494
|
}
|
|
@@ -13516,7 +13501,7 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13516
13501
|
handleSelect();
|
|
13517
13502
|
onKeyDown && onKeyDown(e);
|
|
13518
13503
|
};
|
|
13519
|
-
return /* @__PURE__ */ (0,
|
|
13504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime264.jsxs)(
|
|
13520
13505
|
Button2,
|
|
13521
13506
|
{
|
|
13522
13507
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -13529,8 +13514,8 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13529
13514
|
onKeyDown: handleOnKeyDown,
|
|
13530
13515
|
tabIndex: focus ? 0 : -1,
|
|
13531
13516
|
children: [
|
|
13532
|
-
icon12 && /* @__PURE__ */ (0,
|
|
13533
|
-
/* @__PURE__ */ (0,
|
|
13517
|
+
icon12 && /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(Icon, { icon: icon12, iconSize: "inherit" }),
|
|
13518
|
+
/* @__PURE__ */ (0, import_jsx_runtime264.jsx)("span", { children })
|
|
13534
13519
|
]
|
|
13535
13520
|
}
|
|
13536
13521
|
);
|
|
@@ -13538,18 +13523,18 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13538
13523
|
Tab.displayName = "Tab";
|
|
13539
13524
|
|
|
13540
13525
|
// src/components/Tabs/TabList.tsx
|
|
13541
|
-
var
|
|
13542
|
-
var
|
|
13543
|
-
var
|
|
13526
|
+
var import_react111 = require("react");
|
|
13527
|
+
var import_styled_components92 = __toESM(require("styled-components"));
|
|
13528
|
+
var import_jsx_runtime265 = require("react/jsx-runtime");
|
|
13544
13529
|
var { tabList: tabList2 } = tabsTokens;
|
|
13545
|
-
var autoFlow =
|
|
13530
|
+
var autoFlow = import_styled_components92.css`
|
|
13546
13531
|
grid-auto-flow: column;
|
|
13547
13532
|
grid-auto-columns: 1fr;
|
|
13548
13533
|
`;
|
|
13549
|
-
var templateColumns = (templateColumns2) =>
|
|
13534
|
+
var templateColumns = (templateColumns2) => import_styled_components92.css`
|
|
13550
13535
|
grid-template-columns: ${templateColumns2};
|
|
13551
13536
|
`;
|
|
13552
|
-
var TabRow =
|
|
13537
|
+
var TabRow = import_styled_components92.default.div`
|
|
13553
13538
|
border-bottom: ${tabList2.borderBottom};
|
|
13554
13539
|
display: grid;
|
|
13555
13540
|
${({ $gridTemplateColumns }) => $gridTemplateColumns === "" ? autoFlow : templateColumns($gridTemplateColumns)}
|
|
@@ -13568,7 +13553,7 @@ var TabRow = import_styled_components93.default.div`
|
|
|
13568
13553
|
outline: none;
|
|
13569
13554
|
}
|
|
13570
13555
|
`;
|
|
13571
|
-
var TabList = (0,
|
|
13556
|
+
var TabList = (0, import_react111.forwardRef)(
|
|
13572
13557
|
({ children, id, onFocus, ...rest }, ref) => {
|
|
13573
13558
|
const {
|
|
13574
13559
|
activeTab,
|
|
@@ -13580,11 +13565,11 @@ var TabList = (0, import_react112.forwardRef)(
|
|
|
13580
13565
|
setHasTabFocus
|
|
13581
13566
|
} = useTabsContext();
|
|
13582
13567
|
const uniqueId = id != null ? id : `${tabsId}-tablist`;
|
|
13583
|
-
const childrenArray =
|
|
13568
|
+
const childrenArray = import_react111.Children.toArray(children).length;
|
|
13584
13569
|
const [focus, setFocus] = useRoveFocus(childrenArray, !hasTabFocus, "row");
|
|
13585
13570
|
const combinedRef = useCombinedRef(ref, tabListRef);
|
|
13586
|
-
const tabListChildren =
|
|
13587
|
-
return (0,
|
|
13571
|
+
const tabListChildren = import_react111.Children.map(children, (child, index) => {
|
|
13572
|
+
return (0, import_react111.isValidElement)(child) && (0, import_react111.cloneElement)(child, {
|
|
13588
13573
|
id: `${tabsId}-tab-${index}`,
|
|
13589
13574
|
"aria-controls": `${tabsId}-panel-${index}`,
|
|
13590
13575
|
active: activeTab === index,
|
|
@@ -13594,7 +13579,7 @@ var TabList = (0, import_react112.forwardRef)(
|
|
|
13594
13579
|
onClick: () => handleTabChange(index)
|
|
13595
13580
|
});
|
|
13596
13581
|
});
|
|
13597
|
-
const [widths, setWidths] = (0,
|
|
13582
|
+
const [widths, setWidths] = (0, import_react111.useState)([]);
|
|
13598
13583
|
useOnKeyDown("Tab", () => {
|
|
13599
13584
|
var _a;
|
|
13600
13585
|
setHasTabFocus(false);
|
|
@@ -13616,32 +13601,32 @@ var TabList = (0, import_react112.forwardRef)(
|
|
|
13616
13601
|
tabIndex: 0,
|
|
13617
13602
|
onFocus: handleOnFocus
|
|
13618
13603
|
};
|
|
13619
|
-
return /* @__PURE__ */ (0,
|
|
13604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(TabWidthContextProvider, { onChangeWidths: setWidths, children: /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(TabRow, { ...tabListProps, $gridTemplateColumns: widths.join(" "), children: tabListChildren }) });
|
|
13620
13605
|
}
|
|
13621
13606
|
);
|
|
13622
13607
|
TabList.displayName = "TabList";
|
|
13623
13608
|
|
|
13624
13609
|
// src/components/Tabs/TabPanel.tsx
|
|
13625
|
-
var
|
|
13626
|
-
var
|
|
13627
|
-
var
|
|
13610
|
+
var import_react112 = require("react");
|
|
13611
|
+
var import_styled_components93 = __toESM(require("styled-components"));
|
|
13612
|
+
var import_jsx_runtime266 = require("react/jsx-runtime");
|
|
13628
13613
|
var { panel: panel2 } = tabsTokens;
|
|
13629
|
-
var Panel =
|
|
13614
|
+
var Panel = import_styled_components93.default.div`
|
|
13630
13615
|
padding: ${panel2.padding};
|
|
13631
13616
|
@media (prefers-reduced-motion: no-preference) {
|
|
13632
13617
|
transition: ${focusVisibleTransitionValue};
|
|
13633
13618
|
}
|
|
13634
13619
|
|
|
13635
|
-
${({ $active }) => !$active &&
|
|
13620
|
+
${({ $active }) => !$active && import_styled_components93.css`
|
|
13636
13621
|
display: none;
|
|
13637
13622
|
`}
|
|
13638
13623
|
&:focus-visible {
|
|
13639
13624
|
${focusVisible}
|
|
13640
13625
|
}
|
|
13641
13626
|
`;
|
|
13642
|
-
var TabPanel = (0,
|
|
13627
|
+
var TabPanel = (0, import_react112.forwardRef)(
|
|
13643
13628
|
({ active = false, children, id, className, htmlProps, ...rest }, ref) => {
|
|
13644
|
-
return /* @__PURE__ */ (0,
|
|
13629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(
|
|
13645
13630
|
Panel,
|
|
13646
13631
|
{
|
|
13647
13632
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -13657,33 +13642,33 @@ var TabPanel = (0, import_react113.forwardRef)(
|
|
|
13657
13642
|
TabPanel.displayName = "TabPanel";
|
|
13658
13643
|
|
|
13659
13644
|
// src/components/Tabs/TabPanels.tsx
|
|
13660
|
-
var
|
|
13661
|
-
var
|
|
13662
|
-
var TabPanels = (0,
|
|
13645
|
+
var import_react113 = require("react");
|
|
13646
|
+
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
13647
|
+
var TabPanels = (0, import_react113.forwardRef)(
|
|
13663
13648
|
({ children, ...rest }, ref) => {
|
|
13664
13649
|
const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
|
|
13665
13650
|
const combinedRef = useCombinedRef(ref, tabPanelsRef);
|
|
13666
|
-
const panelChildren =
|
|
13651
|
+
const panelChildren = import_react113.Children.map(children, (child, index) => {
|
|
13667
13652
|
const active = index === activeTab;
|
|
13668
|
-
return (0,
|
|
13653
|
+
return (0, import_react113.isValidElement)(child) && (0, import_react113.cloneElement)(child, {
|
|
13669
13654
|
id: `${tabsId}-panel-${index}`,
|
|
13670
13655
|
"aria-labelledby": `${tabsId}-tab-${index}`,
|
|
13671
13656
|
active,
|
|
13672
13657
|
"aria-expanded": active
|
|
13673
13658
|
});
|
|
13674
13659
|
});
|
|
13675
|
-
return /* @__PURE__ */ (0,
|
|
13660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)("div", { ref: combinedRef, ...rest, children: panelChildren });
|
|
13676
13661
|
}
|
|
13677
13662
|
);
|
|
13678
13663
|
TabPanels.displayName = "TabPanels";
|
|
13679
13664
|
|
|
13680
13665
|
// src/components/Tag/Tag.tsx
|
|
13681
|
-
var
|
|
13682
|
-
var
|
|
13666
|
+
var import_react114 = require("react");
|
|
13667
|
+
var import_styled_components94 = __toESM(require("styled-components"));
|
|
13683
13668
|
|
|
13684
13669
|
// src/components/Tag/Tag.tokens.tsx
|
|
13685
|
-
var
|
|
13686
|
-
var { colors: colors33, borderRadius: borderRadius10, spacing: spacing37 } =
|
|
13670
|
+
var import_dds_design_tokens60 = require("@norges-domstoler/dds-design-tokens");
|
|
13671
|
+
var { colors: colors33, borderRadius: borderRadius10, spacing: spacing37 } = import_dds_design_tokens60.ddsBaseTokens;
|
|
13687
13672
|
var typographyType5 = "bodySans01";
|
|
13688
13673
|
var wrapper7 = {
|
|
13689
13674
|
border: "1px solid",
|
|
@@ -13740,9 +13725,9 @@ var tagTokens = {
|
|
|
13740
13725
|
};
|
|
13741
13726
|
|
|
13742
13727
|
// src/components/Tag/Tag.tsx
|
|
13743
|
-
var
|
|
13728
|
+
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
13744
13729
|
var { wrapper: wrapper8 } = tagTokens;
|
|
13745
|
-
var Wrapper7 = (0,
|
|
13730
|
+
var Wrapper7 = (0, import_styled_components94.default)(TextOverflowEllipsisWrapper)`
|
|
13746
13731
|
display: inline-flex;
|
|
13747
13732
|
align-items: center;
|
|
13748
13733
|
gap: ${tagTokens.wrapper.icon.gap};
|
|
@@ -13750,18 +13735,18 @@ var Wrapper7 = (0, import_styled_components95.default)(TextOverflowEllipsisWrapp
|
|
|
13750
13735
|
border-radius: ${wrapper8.borderRadius};
|
|
13751
13736
|
padding: ${({ $withIcon }) => $withIcon ? wrapper8.icon.padding : wrapper8.padding};
|
|
13752
13737
|
${getFontStyling(typographyType5)}
|
|
13753
|
-
${({ $purpose }) =>
|
|
13738
|
+
${({ $purpose }) => import_styled_components94.css`
|
|
13754
13739
|
background-color: ${wrapper8.purpose[$purpose].backgroundColor};
|
|
13755
13740
|
border-color: ${wrapper8.purpose[$purpose].borderColor};
|
|
13756
13741
|
`}
|
|
13757
13742
|
`;
|
|
13758
|
-
var StyledIcon5 = (0,
|
|
13743
|
+
var StyledIcon5 = (0, import_styled_components94.default)(Icon)`
|
|
13759
13744
|
color: ${({ $purpose }) => {
|
|
13760
13745
|
var _a;
|
|
13761
13746
|
return (_a = wrapper8.purpose[$purpose].icon) == null ? void 0 : _a.color;
|
|
13762
13747
|
}};
|
|
13763
13748
|
`;
|
|
13764
|
-
var Tag = (0,
|
|
13749
|
+
var Tag = (0, import_react114.forwardRef)((props, ref) => {
|
|
13765
13750
|
const {
|
|
13766
13751
|
text,
|
|
13767
13752
|
purpose = "default",
|
|
@@ -13773,7 +13758,7 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13773
13758
|
...rest
|
|
13774
13759
|
} = props;
|
|
13775
13760
|
const icon12 = tagTokens.wrapper.purpose[purpose].icon;
|
|
13776
|
-
return /* @__PURE__ */ (0,
|
|
13761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime268.jsxs)(
|
|
13777
13762
|
Wrapper7,
|
|
13778
13763
|
{
|
|
13779
13764
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -13781,7 +13766,7 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13781
13766
|
$purpose: purpose,
|
|
13782
13767
|
$withIcon: Boolean(withIcon && icon12),
|
|
13783
13768
|
children: [
|
|
13784
|
-
withIcon && icon12 && /* @__PURE__ */ (0,
|
|
13769
|
+
withIcon && icon12 && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(
|
|
13785
13770
|
StyledIcon5,
|
|
13786
13771
|
{
|
|
13787
13772
|
$purpose: purpose,
|
|
@@ -13789,7 +13774,7 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13789
13774
|
iconSize: tagTokens.wrapper.icon.size
|
|
13790
13775
|
}
|
|
13791
13776
|
),
|
|
13792
|
-
/* @__PURE__ */ (0,
|
|
13777
|
+
/* @__PURE__ */ (0, import_jsx_runtime268.jsx)(TextOverflowEllipsisInner, { children: children != null ? children : text })
|
|
13793
13778
|
]
|
|
13794
13779
|
}
|
|
13795
13780
|
);
|
|
@@ -13797,21 +13782,21 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13797
13782
|
Tag.displayName = "Tag";
|
|
13798
13783
|
|
|
13799
13784
|
// src/components/TextInput/TextInput.tsx
|
|
13800
|
-
var
|
|
13801
|
-
var
|
|
13785
|
+
var import_react116 = require("react");
|
|
13786
|
+
var import_styled_components97 = __toESM(require("styled-components"));
|
|
13802
13787
|
|
|
13803
13788
|
// src/components/TextInput/CharCounter.tsx
|
|
13804
|
-
var
|
|
13805
|
-
var
|
|
13806
|
-
var
|
|
13807
|
-
var Wrapper8 = (0,
|
|
13789
|
+
var import_react115 = require("react");
|
|
13790
|
+
var import_styled_components95 = __toESM(require("styled-components"));
|
|
13791
|
+
var import_jsx_runtime269 = require("react/jsx-runtime");
|
|
13792
|
+
var Wrapper8 = (0, import_styled_components95.default)(Typography)`
|
|
13808
13793
|
margin-left: auto;
|
|
13809
13794
|
`;
|
|
13810
13795
|
function CharCounter(props) {
|
|
13811
13796
|
const { current, max, id, className, htmlProps, ...rest } = props;
|
|
13812
|
-
const generatedId = (0,
|
|
13797
|
+
const generatedId = (0, import_react115.useId)();
|
|
13813
13798
|
const uniqueId = id != null ? id : `${generatedId}-characterCounter`;
|
|
13814
|
-
return /* @__PURE__ */ (0,
|
|
13799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime269.jsxs)(
|
|
13815
13800
|
Wrapper8,
|
|
13816
13801
|
{
|
|
13817
13802
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
@@ -13829,12 +13814,12 @@ function CharCounter(props) {
|
|
|
13829
13814
|
var CharCounter_default = CharCounter;
|
|
13830
13815
|
|
|
13831
13816
|
// src/components/TextInput/TextInput.styles.tsx
|
|
13832
|
-
var
|
|
13833
|
-
var
|
|
13817
|
+
var import_dds_design_tokens62 = require("@norges-domstoler/dds-design-tokens");
|
|
13818
|
+
var import_styled_components96 = __toESM(require("styled-components"));
|
|
13834
13819
|
|
|
13835
13820
|
// src/components/TextInput/TextInput.tokens.tsx
|
|
13836
|
-
var
|
|
13837
|
-
var { colors: colors34, spacing: spacing38, iconSizes: iconSizes4 } =
|
|
13821
|
+
var import_dds_design_tokens61 = require("@norges-domstoler/dds-design-tokens");
|
|
13822
|
+
var { colors: colors34, spacing: spacing38, iconSizes: iconSizes4 } = import_dds_design_tokens61.ddsBaseTokens;
|
|
13838
13823
|
var input5 = {
|
|
13839
13824
|
withIcon: {
|
|
13840
13825
|
medium: {
|
|
@@ -13877,33 +13862,33 @@ var textInputTokens = {
|
|
|
13877
13862
|
};
|
|
13878
13863
|
|
|
13879
13864
|
// src/components/TextInput/TextInput.styles.tsx
|
|
13880
|
-
var { iconSizes: iconSizes5 } =
|
|
13865
|
+
var { iconSizes: iconSizes5 } = import_dds_design_tokens62.ddsBaseTokens;
|
|
13881
13866
|
var { input: input6, icon: icon11 } = textInputTokens;
|
|
13882
|
-
var MessageContainer2 =
|
|
13867
|
+
var MessageContainer2 = import_styled_components96.default.div`
|
|
13883
13868
|
display: flex;
|
|
13884
13869
|
justify-content: space-between;
|
|
13885
13870
|
`;
|
|
13886
|
-
var StyledIcon6 = (0,
|
|
13871
|
+
var StyledIcon6 = (0, import_styled_components96.default)(Icon)`
|
|
13887
13872
|
position: absolute;
|
|
13888
13873
|
color: ${icon11.color};
|
|
13889
|
-
${({ $size, iconSize }) =>
|
|
13874
|
+
${({ $size, iconSize }) => import_styled_components96.css`
|
|
13890
13875
|
left: ${icon11.sizes[$size].left};
|
|
13891
|
-
${iconSize === "small" ?
|
|
13876
|
+
${iconSize === "small" ? import_styled_components96.css`
|
|
13892
13877
|
top: ${`calc(50% - ${iconSizes5.DdsIconsizeSmallNumberPx / 2}px)`};
|
|
13893
|
-
` :
|
|
13878
|
+
` : import_styled_components96.css`
|
|
13894
13879
|
top: ${`calc(50% - ${iconSizes5.DdsIconsizeMediumNumberPx / 2}px)`};
|
|
13895
13880
|
`}
|
|
13896
13881
|
`}
|
|
13897
13882
|
z-index: 1;
|
|
13898
13883
|
`;
|
|
13899
|
-
var StyledInput = (0,
|
|
13900
|
-
${({ componentSize, $hasIcon }) => $hasIcon && componentSize &&
|
|
13884
|
+
var StyledInput = (0, import_styled_components96.default)(StatefulInput)`
|
|
13885
|
+
${({ componentSize, $hasIcon }) => $hasIcon && componentSize && import_styled_components96.css`
|
|
13901
13886
|
padding-left: ${input6.withIcon[componentSize].paddingLeft};
|
|
13902
13887
|
`}
|
|
13903
13888
|
`;
|
|
13904
13889
|
|
|
13905
13890
|
// src/components/TextInput/TextInput.tsx
|
|
13906
|
-
var
|
|
13891
|
+
var import_jsx_runtime270 = require("react/jsx-runtime");
|
|
13907
13892
|
var defaultWidth6 = "320px";
|
|
13908
13893
|
var defaultTinyWidth = "210px";
|
|
13909
13894
|
var getWidth = (size2, width) => {
|
|
@@ -13914,7 +13899,7 @@ var getWidth = (size2, width) => {
|
|
|
13914
13899
|
}
|
|
13915
13900
|
return defaultWidth6;
|
|
13916
13901
|
};
|
|
13917
|
-
var Affix =
|
|
13902
|
+
var Affix = import_styled_components97.default.span`
|
|
13918
13903
|
position: absolute;
|
|
13919
13904
|
height: 100%;
|
|
13920
13905
|
top: 50%;
|
|
@@ -13924,31 +13909,31 @@ var Affix = import_styled_components98.default.span`
|
|
|
13924
13909
|
pointer-events: none;
|
|
13925
13910
|
z-index: 1;
|
|
13926
13911
|
`;
|
|
13927
|
-
var Prefix = (0,
|
|
13912
|
+
var Prefix = (0, import_styled_components97.default)(Affix)`
|
|
13928
13913
|
left: 0;
|
|
13929
13914
|
margin-left: 8px;
|
|
13930
13915
|
padding-right: 8px;
|
|
13931
13916
|
border-right: 1px solid ${textInputTokens.affix.border.color};
|
|
13932
13917
|
|
|
13933
|
-
${({ readOnly }) => readOnly &&
|
|
13918
|
+
${({ readOnly }) => readOnly && import_styled_components97.css`
|
|
13934
13919
|
margin-left: 0;
|
|
13935
13920
|
padding-right: 0.5ch;
|
|
13936
13921
|
border-right: none;
|
|
13937
13922
|
`};
|
|
13938
13923
|
`;
|
|
13939
|
-
var Suffix = (0,
|
|
13924
|
+
var Suffix = (0, import_styled_components97.default)(Affix)`
|
|
13940
13925
|
right: 0;
|
|
13941
13926
|
margin-right: 8px;
|
|
13942
13927
|
padding-left: 8px;
|
|
13943
13928
|
border-left: 1px solid ${textInputTokens.affix.border.color};
|
|
13944
13929
|
|
|
13945
|
-
${({ readOnly }) => readOnly &&
|
|
13930
|
+
${({ readOnly }) => readOnly && import_styled_components97.css`
|
|
13946
13931
|
margin-right: 0;
|
|
13947
13932
|
padding-left: 0.5ch;
|
|
13948
13933
|
border-left: none;
|
|
13949
13934
|
`};
|
|
13950
13935
|
`;
|
|
13951
|
-
var TextInput2 = (0,
|
|
13936
|
+
var TextInput2 = (0, import_react116.forwardRef)(
|
|
13952
13937
|
({
|
|
13953
13938
|
label: label3,
|
|
13954
13939
|
disabled,
|
|
@@ -13974,14 +13959,14 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
13974
13959
|
suffix,
|
|
13975
13960
|
...rest
|
|
13976
13961
|
}, ref) => {
|
|
13977
|
-
const [text, setText] = (0,
|
|
13962
|
+
const [text, setText] = (0, import_react116.useState)(
|
|
13978
13963
|
getDefaultText(value, defaultValue)
|
|
13979
13964
|
);
|
|
13980
|
-
const prefixRef = (0,
|
|
13981
|
-
const suffixRef = (0,
|
|
13982
|
-
const [prefixLength, setPrefixLength] = (0,
|
|
13983
|
-
const [suffixLength, setSuffixLength] = (0,
|
|
13984
|
-
(0,
|
|
13965
|
+
const prefixRef = (0, import_react116.useRef)(null);
|
|
13966
|
+
const suffixRef = (0, import_react116.useRef)(null);
|
|
13967
|
+
const [prefixLength, setPrefixLength] = (0, import_react116.useState)(0);
|
|
13968
|
+
const [suffixLength, setSuffixLength] = (0, import_react116.useState)(0);
|
|
13969
|
+
(0, import_react116.useLayoutEffect)(() => {
|
|
13985
13970
|
if (prefixRef.current) {
|
|
13986
13971
|
setPrefixLength(prefixRef.current.offsetWidth);
|
|
13987
13972
|
}
|
|
@@ -13995,7 +13980,7 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
13995
13980
|
onChange(event);
|
|
13996
13981
|
}
|
|
13997
13982
|
};
|
|
13998
|
-
const generatedId = (0,
|
|
13983
|
+
const generatedId = (0, import_react116.useId)();
|
|
13999
13984
|
const uniqueId = id != null ? id : `${generatedId}-textInput`;
|
|
14000
13985
|
const hasErrorMessage = !!errorMessage;
|
|
14001
13986
|
const hasTip = !!tip;
|
|
@@ -14037,8 +14022,8 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14037
14022
|
const showRequiredStyling = !!(required || ariaRequired);
|
|
14038
14023
|
let extendedInput = null;
|
|
14039
14024
|
if (hasIcon) {
|
|
14040
|
-
extendedInput = /* @__PURE__ */ (0,
|
|
14041
|
-
/* @__PURE__ */ (0,
|
|
14025
|
+
extendedInput = /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(InputContainer, { children: [
|
|
14026
|
+
/* @__PURE__ */ (0, import_jsx_runtime270.jsx)(
|
|
14042
14027
|
StyledIcon6,
|
|
14043
14028
|
{
|
|
14044
14029
|
icon: icon12,
|
|
@@ -14046,7 +14031,7 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14046
14031
|
$size: componentSize
|
|
14047
14032
|
}
|
|
14048
14033
|
),
|
|
14049
|
-
/* @__PURE__ */ (0,
|
|
14034
|
+
/* @__PURE__ */ (0, import_jsx_runtime270.jsx)(
|
|
14050
14035
|
StyledInput,
|
|
14051
14036
|
{
|
|
14052
14037
|
ref,
|
|
@@ -14059,9 +14044,9 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14059
14044
|
)
|
|
14060
14045
|
] });
|
|
14061
14046
|
} else if (hasAffix) {
|
|
14062
|
-
extendedInput = /* @__PURE__ */ (0,
|
|
14063
|
-
prefix2 && /* @__PURE__ */ (0,
|
|
14064
|
-
/* @__PURE__ */ (0,
|
|
14047
|
+
extendedInput = /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(InputAffixContainer, { children: [
|
|
14048
|
+
prefix2 && /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(Prefix, { readOnly, ref: prefixRef, "aria-hidden": true, children: prefix2 }),
|
|
14049
|
+
/* @__PURE__ */ (0, import_jsx_runtime270.jsx)(
|
|
14065
14050
|
StatefulInput,
|
|
14066
14051
|
{
|
|
14067
14052
|
ref,
|
|
@@ -14073,12 +14058,12 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14073
14058
|
...generalInputProps
|
|
14074
14059
|
}
|
|
14075
14060
|
),
|
|
14076
|
-
suffix && /* @__PURE__ */ (0,
|
|
14061
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(Suffix, { readOnly, ref: suffixRef, "aria-hidden": true, children: suffix })
|
|
14077
14062
|
] });
|
|
14078
14063
|
}
|
|
14079
|
-
return /* @__PURE__ */ (0,
|
|
14080
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
14081
|
-
extendedInput ? extendedInput : /* @__PURE__ */ (0,
|
|
14064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(OuterInputContainer, { ...outerInputContainerProps, children: [
|
|
14065
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(Label, { htmlFor: uniqueId, showRequiredStyling, children: label3 }),
|
|
14066
|
+
extendedInput ? extendedInput : /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(
|
|
14082
14067
|
StatefulInput,
|
|
14083
14068
|
{
|
|
14084
14069
|
ref,
|
|
@@ -14088,9 +14073,9 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14088
14073
|
...generalInputProps
|
|
14089
14074
|
}
|
|
14090
14075
|
),
|
|
14091
|
-
hasMessage && /* @__PURE__ */ (0,
|
|
14076
|
+
hasMessage && /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(MessageContainer2, { children: [
|
|
14092
14077
|
renderInputMessage(tip, tipId, errorMessage, errorMessageId),
|
|
14093
|
-
maxLength && Number.isInteger(maxLength) && maxLength > 0 && withCharacterCounter && /* @__PURE__ */ (0,
|
|
14078
|
+
maxLength && Number.isInteger(maxLength) && maxLength > 0 && withCharacterCounter && /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(
|
|
14094
14079
|
CharCounter_default,
|
|
14095
14080
|
{
|
|
14096
14081
|
id: characterCounterId,
|
|
@@ -14105,20 +14090,20 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14105
14090
|
TextInput2.displayName = "TextInput";
|
|
14106
14091
|
|
|
14107
14092
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
14108
|
-
var
|
|
14109
|
-
var
|
|
14093
|
+
var import_react118 = require("react");
|
|
14094
|
+
var import_styled_components98 = __toESM(require("styled-components"));
|
|
14110
14095
|
|
|
14111
14096
|
// src/components/ToggleBar/ToggleBar.context.tsx
|
|
14112
|
-
var
|
|
14113
|
-
var ToggleBarContext = (0,
|
|
14097
|
+
var import_react117 = require("react");
|
|
14098
|
+
var ToggleBarContext = (0, import_react117.createContext)({
|
|
14114
14099
|
size: "medium"
|
|
14115
14100
|
});
|
|
14116
|
-
var useToggleBarContext = () => (0,
|
|
14101
|
+
var useToggleBarContext = () => (0, import_react117.useContext)(ToggleBarContext);
|
|
14117
14102
|
|
|
14118
14103
|
// src/components/ToggleBar/ToggleBar.tokens.tsx
|
|
14119
|
-
var
|
|
14120
|
-
var { colors: colors35, spacing: spacing39, border: border15, borderRadius: borderRadius11, fontPackages: fontPackages6 } =
|
|
14121
|
-
var
|
|
14104
|
+
var import_dds_design_tokens63 = require("@norges-domstoler/dds-design-tokens");
|
|
14105
|
+
var { colors: colors35, spacing: spacing39, border: border15, borderRadius: borderRadius11, fontPackages: fontPackages6 } = import_dds_design_tokens63.ddsBaseTokens;
|
|
14106
|
+
var typographyTypes6 = {
|
|
14122
14107
|
large: "bodySans04",
|
|
14123
14108
|
medium: "bodySans02",
|
|
14124
14109
|
small: "bodySans01",
|
|
@@ -14140,7 +14125,7 @@ var iconSizeLarge = `${calculateHeightWithLineHeight(
|
|
|
14140
14125
|
fontPackages6.body_sans_04.numbers.lineHeightNumber,
|
|
14141
14126
|
fontPackages6.body_sans_04.numbers.fontSizeNumber
|
|
14142
14127
|
)}px`;
|
|
14143
|
-
var
|
|
14128
|
+
var outerContainer7 = {
|
|
14144
14129
|
gap: spacing39.SizesDdsSpacingX0125
|
|
14145
14130
|
};
|
|
14146
14131
|
var label = {
|
|
@@ -14216,14 +14201,14 @@ var content5 = {
|
|
|
14216
14201
|
}
|
|
14217
14202
|
};
|
|
14218
14203
|
var toggleBarTokens = {
|
|
14219
|
-
outerContainer:
|
|
14204
|
+
outerContainer: outerContainer7,
|
|
14220
14205
|
content: content5,
|
|
14221
14206
|
label
|
|
14222
14207
|
};
|
|
14223
14208
|
|
|
14224
14209
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
14225
|
-
var
|
|
14226
|
-
var
|
|
14210
|
+
var import_jsx_runtime271 = require("react/jsx-runtime");
|
|
14211
|
+
var OuterContainer3 = import_styled_components98.default.div`
|
|
14227
14212
|
display: flex;
|
|
14228
14213
|
flex-direction: column;
|
|
14229
14214
|
gap: ${toggleBarTokens.outerContainer.gap};
|
|
@@ -14231,11 +14216,11 @@ var OuterContainer4 = import_styled_components99.default.div`
|
|
|
14231
14216
|
*::selection {
|
|
14232
14217
|
${selection}
|
|
14233
14218
|
}
|
|
14234
|
-
${({ $width }) => $width &&
|
|
14219
|
+
${({ $width }) => $width && import_styled_components98.css`
|
|
14235
14220
|
width: ${$width};
|
|
14236
14221
|
`}
|
|
14237
14222
|
`;
|
|
14238
|
-
var
|
|
14223
|
+
var Bar3 = import_styled_components98.default.div`
|
|
14239
14224
|
display: grid;
|
|
14240
14225
|
grid-auto-flow: column;
|
|
14241
14226
|
grid-auto-columns: 1fr;
|
|
@@ -14254,15 +14239,15 @@ var ToggleBar = (props) => {
|
|
|
14254
14239
|
id,
|
|
14255
14240
|
...rest
|
|
14256
14241
|
} = props;
|
|
14257
|
-
const generatedId = (0,
|
|
14242
|
+
const generatedId = (0, import_react118.useId)();
|
|
14258
14243
|
const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
|
|
14259
|
-
const [groupValue, setGroupValue] = (0,
|
|
14244
|
+
const [groupValue, setGroupValue] = (0, import_react118.useState)(value);
|
|
14260
14245
|
const handleChange = combineHandlers(
|
|
14261
14246
|
(e) => setGroupValue(e.target.value),
|
|
14262
14247
|
(e) => onChange && onChange(e, e.target.value)
|
|
14263
14248
|
);
|
|
14264
14249
|
const labelId = label3 && `${uniqueId}-label`;
|
|
14265
|
-
return /* @__PURE__ */ (0,
|
|
14250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
|
|
14266
14251
|
ToggleBarContext.Provider,
|
|
14267
14252
|
{
|
|
14268
14253
|
value: {
|
|
@@ -14271,16 +14256,16 @@ var ToggleBar = (props) => {
|
|
|
14271
14256
|
name,
|
|
14272
14257
|
value: groupValue
|
|
14273
14258
|
},
|
|
14274
|
-
children: /* @__PURE__ */ (0,
|
|
14275
|
-
|
|
14259
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(
|
|
14260
|
+
OuterContainer3,
|
|
14276
14261
|
{
|
|
14277
14262
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
14278
14263
|
role: "radiogroup",
|
|
14279
14264
|
"aria-labelledby": labelId != null ? labelId : htmlProps == null ? void 0 : htmlProps["aria-labelledby"],
|
|
14280
14265
|
$width: width,
|
|
14281
14266
|
children: [
|
|
14282
|
-
label3 && /* @__PURE__ */ (0,
|
|
14283
|
-
/* @__PURE__ */ (0,
|
|
14267
|
+
label3 && /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(Typography, { typographyType: "supportingStyleLabel01", id: labelId, children: label3 }),
|
|
14268
|
+
/* @__PURE__ */ (0, import_jsx_runtime271.jsx)(Bar3, { children })
|
|
14284
14269
|
]
|
|
14285
14270
|
}
|
|
14286
14271
|
)
|
|
@@ -14290,12 +14275,12 @@ var ToggleBar = (props) => {
|
|
|
14290
14275
|
ToggleBar.displayName = "ToggleBar";
|
|
14291
14276
|
|
|
14292
14277
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
14293
|
-
var
|
|
14278
|
+
var import_react119 = require("react");
|
|
14294
14279
|
|
|
14295
14280
|
// src/components/ToggleBar/ToggleRadio.styles.tsx
|
|
14296
|
-
var
|
|
14281
|
+
var import_styled_components99 = __toESM(require("styled-components"));
|
|
14297
14282
|
var { content: content6, label: label2 } = toggleBarTokens;
|
|
14298
|
-
var Content2 =
|
|
14283
|
+
var Content2 = import_styled_components99.default.span`
|
|
14299
14284
|
display: flex;
|
|
14300
14285
|
justify-content: center;
|
|
14301
14286
|
align-items: center;
|
|
@@ -14313,18 +14298,18 @@ var Content2 = import_styled_components100.default.span`
|
|
|
14313
14298
|
}
|
|
14314
14299
|
background-color: ${content6.base.backgroundColor};
|
|
14315
14300
|
|
|
14316
|
-
${({ $size, $justIcon }) =>
|
|
14317
|
-
${$justIcon ?
|
|
14301
|
+
${({ $size, $justIcon }) => import_styled_components99.css`
|
|
14302
|
+
${$justIcon ? import_styled_components99.css`
|
|
14318
14303
|
font-size: ${content6.size[$size].justIcon.fontSize};
|
|
14319
14304
|
padding: ${content6.size[$size].justIcon.padding};
|
|
14320
|
-
` :
|
|
14305
|
+
` : import_styled_components99.css`
|
|
14321
14306
|
gap: ${content6.size[$size].withText.gap};
|
|
14322
14307
|
padding: ${content6.size[$size].withText.padding};
|
|
14323
|
-
${getFontStyling(
|
|
14308
|
+
${getFontStyling(typographyTypes6[$size])}
|
|
14324
14309
|
`}
|
|
14325
14310
|
`}
|
|
14326
14311
|
`;
|
|
14327
|
-
var Label3 =
|
|
14312
|
+
var Label3 = import_styled_components99.default.label`
|
|
14328
14313
|
${Content2} {
|
|
14329
14314
|
border-right: ${label2.base.borderRight};
|
|
14330
14315
|
border-top: ${label2.base.borderTop};
|
|
@@ -14362,7 +14347,7 @@ var Label3 = import_styled_components100.default.label`
|
|
|
14362
14347
|
`;
|
|
14363
14348
|
|
|
14364
14349
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
14365
|
-
var
|
|
14350
|
+
var import_jsx_runtime272 = require("react/jsx-runtime");
|
|
14366
14351
|
var calculateChecked = (value, group4, checked) => {
|
|
14367
14352
|
if (typeof checked !== "undefined")
|
|
14368
14353
|
return checked;
|
|
@@ -14374,7 +14359,7 @@ var calculateChecked = (value, group4, checked) => {
|
|
|
14374
14359
|
}
|
|
14375
14360
|
return !!value;
|
|
14376
14361
|
};
|
|
14377
|
-
var ToggleRadio = (0,
|
|
14362
|
+
var ToggleRadio = (0, import_react119.forwardRef)(
|
|
14378
14363
|
(props, ref) => {
|
|
14379
14364
|
const {
|
|
14380
14365
|
value,
|
|
@@ -14388,15 +14373,15 @@ var ToggleRadio = (0, import_react120.forwardRef)(
|
|
|
14388
14373
|
id,
|
|
14389
14374
|
...rest
|
|
14390
14375
|
} = props;
|
|
14391
|
-
const generatedId = (0,
|
|
14376
|
+
const generatedId = (0, import_react119.useId)();
|
|
14392
14377
|
const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
|
|
14393
14378
|
const group4 = useToggleBarContext();
|
|
14394
14379
|
const handleChange = (event) => {
|
|
14395
14380
|
onChange && onChange(event);
|
|
14396
14381
|
(group4 == null ? void 0 : group4.onChange) && group4.onChange(event);
|
|
14397
14382
|
};
|
|
14398
|
-
return /* @__PURE__ */ (0,
|
|
14399
|
-
/* @__PURE__ */ (0,
|
|
14383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(Label3, { size: group4.size, htmlFor: uniqueId, children: [
|
|
14384
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14400
14385
|
HiddenInput,
|
|
14401
14386
|
{
|
|
14402
14387
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
@@ -14408,9 +14393,9 @@ var ToggleRadio = (0, import_react120.forwardRef)(
|
|
|
14408
14393
|
checked: calculateChecked(value, group4, checked)
|
|
14409
14394
|
}
|
|
14410
14395
|
),
|
|
14411
|
-
/* @__PURE__ */ (0,
|
|
14412
|
-
icon12 && /* @__PURE__ */ (0,
|
|
14413
|
-
label3 && /* @__PURE__ */ (0,
|
|
14396
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(Content2, { $size: group4.size, $justIcon: !!icon12 && !label3, children: [
|
|
14397
|
+
icon12 && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(Icon, { icon: icon12, iconSize: "inherit" }),
|
|
14398
|
+
label3 && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)("span", { children: label3 })
|
|
14414
14399
|
] })
|
|
14415
14400
|
] });
|
|
14416
14401
|
}
|
|
@@ -14418,12 +14403,12 @@ var ToggleRadio = (0, import_react120.forwardRef)(
|
|
|
14418
14403
|
ToggleRadio.displayName = "ToggleRadio";
|
|
14419
14404
|
|
|
14420
14405
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
14421
|
-
var
|
|
14422
|
-
var
|
|
14406
|
+
var import_react120 = require("react");
|
|
14407
|
+
var import_styled_components100 = __toESM(require("styled-components"));
|
|
14423
14408
|
|
|
14424
14409
|
// src/components/ToggleButton/ToggleButton.tokens.tsx
|
|
14425
|
-
var
|
|
14426
|
-
var { colors: colors36, spacing: spacing40 } =
|
|
14410
|
+
var import_dds_design_tokens64 = require("@norges-domstoler/dds-design-tokens");
|
|
14411
|
+
var { colors: colors36, spacing: spacing40 } = import_dds_design_tokens64.ddsBaseTokens;
|
|
14427
14412
|
var { button: button2 } = buttonTokens;
|
|
14428
14413
|
var { selectionControl: selectionControl3 } = selectionControlTokens;
|
|
14429
14414
|
var typographyType6 = typographyTypes.small;
|
|
@@ -14454,9 +14439,9 @@ var toggleButtonTokens = {
|
|
|
14454
14439
|
};
|
|
14455
14440
|
|
|
14456
14441
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
14457
|
-
var
|
|
14442
|
+
var import_jsx_runtime273 = require("react/jsx-runtime");
|
|
14458
14443
|
var { toggleButton: toggleButton2 } = toggleButtonTokens;
|
|
14459
|
-
var Content3 =
|
|
14444
|
+
var Content3 = import_styled_components100.default.span`
|
|
14460
14445
|
display: flex;
|
|
14461
14446
|
align-items: center;
|
|
14462
14447
|
width: 100%;
|
|
@@ -14478,7 +14463,7 @@ var Content3 = import_styled_components101.default.span`
|
|
|
14478
14463
|
${focusVisibleTransitionValue};
|
|
14479
14464
|
}
|
|
14480
14465
|
|
|
14481
|
-
${({ $hasIcon }) => $hasIcon &&
|
|
14466
|
+
${({ $hasIcon }) => $hasIcon && import_styled_components100.css`
|
|
14482
14467
|
gap: ${toggleButton2.gap};
|
|
14483
14468
|
`}
|
|
14484
14469
|
|
|
@@ -14492,7 +14477,7 @@ var Content3 = import_styled_components101.default.span`
|
|
|
14492
14477
|
border-color: ${toggleButton2.hover.borderColor};
|
|
14493
14478
|
}
|
|
14494
14479
|
`;
|
|
14495
|
-
var Container16 =
|
|
14480
|
+
var Container16 = import_styled_components100.default.label`
|
|
14496
14481
|
width: fit-content;
|
|
14497
14482
|
${HiddenInput}:checked + ${Content3} {
|
|
14498
14483
|
background-color: ${toggleButton2.checked.backgroundColor};
|
|
@@ -14508,12 +14493,12 @@ var Container16 = import_styled_components101.default.label`
|
|
|
14508
14493
|
${focusVisible}
|
|
14509
14494
|
}
|
|
14510
14495
|
`;
|
|
14511
|
-
var ToggleButton = (0,
|
|
14496
|
+
var ToggleButton = (0, import_react120.forwardRef)(
|
|
14512
14497
|
({ id, label: label3, icon: icon12, className, htmlProps, ...rest }, ref) => {
|
|
14513
|
-
const generatedId = (0,
|
|
14498
|
+
const generatedId = (0, import_react120.useId)();
|
|
14514
14499
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
14515
|
-
return /* @__PURE__ */ (0,
|
|
14516
|
-
/* @__PURE__ */ (0,
|
|
14500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(Container16, { htmlFor: uniqueId, children: [
|
|
14501
|
+
/* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
|
|
14517
14502
|
HiddenInput,
|
|
14518
14503
|
{
|
|
14519
14504
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
@@ -14521,8 +14506,8 @@ var ToggleButton = (0, import_react121.forwardRef)(
|
|
|
14521
14506
|
type: "checkbox"
|
|
14522
14507
|
}
|
|
14523
14508
|
),
|
|
14524
|
-
/* @__PURE__ */ (0,
|
|
14525
|
-
icon12 && /* @__PURE__ */ (0,
|
|
14509
|
+
/* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(Content3, { $hasIcon: !!icon12, children: [
|
|
14510
|
+
icon12 && /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(Icon, { icon: icon12, iconSize: "inherit" }),
|
|
14526
14511
|
" ",
|
|
14527
14512
|
label3
|
|
14528
14513
|
] })
|
|
@@ -14532,18 +14517,18 @@ var ToggleButton = (0, import_react121.forwardRef)(
|
|
|
14532
14517
|
ToggleButton.displayName = "ToggleButton";
|
|
14533
14518
|
|
|
14534
14519
|
// src/components/ToggleButton/ToggleButtonGroup.tsx
|
|
14535
|
-
var
|
|
14536
|
-
var
|
|
14537
|
-
var
|
|
14538
|
-
var Group2 =
|
|
14520
|
+
var import_react121 = require("react");
|
|
14521
|
+
var import_styled_components101 = __toESM(require("styled-components"));
|
|
14522
|
+
var import_jsx_runtime274 = require("react/jsx-runtime");
|
|
14523
|
+
var Group2 = import_styled_components101.default.div`
|
|
14539
14524
|
gap: ${toggleButtonTokens.group.gap};
|
|
14540
14525
|
display: flex;
|
|
14541
14526
|
flex-wrap: wrap;
|
|
14542
|
-
${({ direction }) =>
|
|
14527
|
+
${({ direction }) => import_styled_components101.css`
|
|
14543
14528
|
flex-direction: ${direction};
|
|
14544
14529
|
`}
|
|
14545
14530
|
`;
|
|
14546
|
-
var Container17 =
|
|
14531
|
+
var Container17 = import_styled_components101.default.div`
|
|
14547
14532
|
display: flex;
|
|
14548
14533
|
flex-direction: column;
|
|
14549
14534
|
gap: ${toggleButtonTokens.container.gap};
|
|
@@ -14559,7 +14544,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
14559
14544
|
htmlProps,
|
|
14560
14545
|
...rest
|
|
14561
14546
|
} = props;
|
|
14562
|
-
const generatedId = (0,
|
|
14547
|
+
const generatedId = (0, import_react121.useId)();
|
|
14563
14548
|
const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
|
|
14564
14549
|
const groupProps = {
|
|
14565
14550
|
direction
|
|
@@ -14569,8 +14554,8 @@ var ToggleButtonGroup = (props) => {
|
|
|
14569
14554
|
role: "group",
|
|
14570
14555
|
"aria-labelledby": label3 ? uniqueLabelId : void 0
|
|
14571
14556
|
};
|
|
14572
|
-
return /* @__PURE__ */ (0,
|
|
14573
|
-
!!label3 && /* @__PURE__ */ (0,
|
|
14557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime274.jsxs)(Container17, { ...containerProps, children: [
|
|
14558
|
+
!!label3 && /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(
|
|
14574
14559
|
Typography,
|
|
14575
14560
|
{
|
|
14576
14561
|
as: "span",
|
|
@@ -14579,7 +14564,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
14579
14564
|
children: label3
|
|
14580
14565
|
}
|
|
14581
14566
|
),
|
|
14582
|
-
/* @__PURE__ */ (0,
|
|
14567
|
+
/* @__PURE__ */ (0, import_jsx_runtime274.jsx)(Group2, { ...groupProps, children })
|
|
14583
14568
|
] });
|
|
14584
14569
|
};
|
|
14585
14570
|
ToggleButtonGroup.displayName = "ToggleButtonGroup";
|