@norges-domstoler/dds-components 14.1.0 → 14.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +103 -78
- package/dist/index.d.ts +103 -78
- package/dist/index.js +1740 -1705
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1955 -1906
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -216,7 +216,7 @@ __export(src_exports, {
|
|
|
216
216
|
PublishIcon: () => PublishIcon,
|
|
217
217
|
QuestionAnswerIcon: () => QuestionAnswerIcon,
|
|
218
218
|
RadioButton: () => RadioButton,
|
|
219
|
-
RadioButtonGroup: () =>
|
|
219
|
+
RadioButtonGroup: () => RadioButtonGroup,
|
|
220
220
|
ReceiptIcon: () => ReceiptIcon,
|
|
221
221
|
RedoIcon: () => RedoIcon,
|
|
222
222
|
RefreshIcon: () => RefreshIcon,
|
|
@@ -244,7 +244,7 @@ __export(src_exports, {
|
|
|
244
244
|
TabList: () => TabList,
|
|
245
245
|
TabPanel: () => TabPanel,
|
|
246
246
|
TabPanels: () => TabPanels,
|
|
247
|
-
Table: () =>
|
|
247
|
+
Table: () => Table,
|
|
248
248
|
Tabs: () => Tabs,
|
|
249
249
|
Tag: () => Tag,
|
|
250
250
|
TextArea: () => TextArea,
|
|
@@ -280,6 +280,7 @@ __export(src_exports, {
|
|
|
280
280
|
WarningIcon: () => WarningIcon,
|
|
281
281
|
ZoomInIcon: () => ZoomInIcon,
|
|
282
282
|
ZoomOutIcon: () => ZoomOutIcon,
|
|
283
|
+
calendarDateToNativeDate: () => calendarDateToNativeDate,
|
|
283
284
|
cn: () => cn,
|
|
284
285
|
createSelectOptions: () => createSelectOptions,
|
|
285
286
|
dangerInputfield: () => dangerInputfield,
|
|
@@ -317,7 +318,9 @@ __export(src_exports, {
|
|
|
317
318
|
isInlineElement: () => isInlineElement,
|
|
318
319
|
isKeyboardEvent: () => isKeyboardEvent,
|
|
319
320
|
isRelativeGridColumn: () => isRelativeGridColumn,
|
|
321
|
+
nativeDateToCalendarDate: () => nativeDateToCalendarDate,
|
|
320
322
|
nativeDateToDateValue: () => nativeDateToDateValue,
|
|
323
|
+
nativeDateToTime: () => nativeDateToTime,
|
|
321
324
|
normalizeButton: () => normalizeButton,
|
|
322
325
|
outlineOffset: () => outlineOffset,
|
|
323
326
|
removeButtonStyling: () => removeButtonStyling,
|
|
@@ -447,135 +450,55 @@ var inputTokens = {
|
|
|
447
450
|
container
|
|
448
451
|
};
|
|
449
452
|
|
|
450
|
-
// src/components/
|
|
451
|
-
var
|
|
452
|
-
var { colors: Colors } = import_dds_design_tokens2.ddsBaseTokens;
|
|
453
|
-
var dangerInputfield = {
|
|
454
|
-
borderColor: Colors.DdsColorDangerBase,
|
|
455
|
-
boxShadow: `0 0 0 1px ${Colors.DdsColorDangerBase}`
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
// src/components/helpers/styling/focus.tsx
|
|
459
|
-
var import_dds_design_tokens3 = require("@norges-domstoler/dds-design-tokens");
|
|
460
|
-
var { border: border2 } = import_dds_design_tokens3.ddsBaseTokens;
|
|
461
|
-
var focusInputfield = {
|
|
462
|
-
outline: "none",
|
|
463
|
-
borderColor: border2.BordersDdsBorderFocusInputfieldStroke,
|
|
464
|
-
boxShadow: `0 0 0 2px ${border2.BordersDdsBorderFocusInputfieldStroke}`
|
|
465
|
-
};
|
|
466
|
-
var focusDangerInputfield = {
|
|
467
|
-
borderColor: border2.BordersDdsBorderFocusInputfieldStroke,
|
|
468
|
-
boxShadow: `0 0 0 2px ${border2.BordersDdsBorderFocusInputfieldStroke}`
|
|
469
|
-
};
|
|
470
|
-
|
|
471
|
-
// src/components/helpers/styling/focusVisible.tsx
|
|
472
|
-
var import_dds_design_tokens4 = require("@norges-domstoler/dds-design-tokens");
|
|
473
|
-
var { border: Border, spacing: spacing2 } = import_dds_design_tokens4.ddsBaseTokens;
|
|
474
|
-
var outlineOffset = spacing2.SizesDdsSpacingX0125;
|
|
475
|
-
var focusVisible = {
|
|
476
|
-
outline: `${Border.BordersDdsBorderFocusBaseStrokeWeight} ${Border.BordersDdsBorderFocusBaseStroke} solid`,
|
|
477
|
-
outlineOffset
|
|
478
|
-
};
|
|
479
|
-
var focusVisibleOnDark = {
|
|
480
|
-
outline: `${Border.BordersDdsBorderFocusOndarkStrokeWeight} ${Border.BordersDdsBorderFocusOndarkStroke} solid`,
|
|
481
|
-
outlineOffset
|
|
482
|
-
};
|
|
483
|
-
var focusVisibleTransitionValue = "outline-offset 0.2s";
|
|
484
|
-
var focusVisibleWithBorder = {
|
|
485
|
-
outline: "none",
|
|
486
|
-
borderColor: Border.BordersDdsBorderFocusCardStroke,
|
|
487
|
-
boxShadow: `inset 0 0 0 1px ${Border.BordersDdsBorderFocusCardStroke}`
|
|
488
|
-
};
|
|
489
|
-
var focusVisibleThickWithBorderOnDark = {
|
|
490
|
-
outline: "none",
|
|
491
|
-
borderColor: Border.BordersDdsBorderFocusOndarkStroke,
|
|
492
|
-
boxShadow: `inset 0 0 0 1px ${Border.BordersDdsBorderFocusOndarkStroke}`
|
|
493
|
-
};
|
|
494
|
-
var focusVisibleInset = {
|
|
495
|
-
outline: "none",
|
|
496
|
-
boxShadow: `inset 0 0 0 2px ${Border.BordersDdsBorderFocusCardStroke}`
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
// src/components/helpers/styling/hideInput.tsx
|
|
500
|
-
var hideInput = {
|
|
501
|
-
clip: "rect(0 0 0 0)",
|
|
502
|
-
position: "absolute",
|
|
503
|
-
height: "1px",
|
|
504
|
-
width: "1px",
|
|
505
|
-
margin: 0
|
|
506
|
-
};
|
|
507
|
-
|
|
508
|
-
// src/components/helpers/styling/hover.tsx
|
|
509
|
-
var import_dds_design_tokens5 = require("@norges-domstoler/dds-design-tokens");
|
|
510
|
-
var { border: Border2, colors: Colors2 } = import_dds_design_tokens5.ddsBaseTokens;
|
|
511
|
-
var hoverWithBorder = {
|
|
512
|
-
borderColor: Border2.BordersDdsBorderFocusInputfieldStroke,
|
|
513
|
-
boxShadow: `inset 0 0 0 1px ${Border2.BordersDdsBorderFocusInputfieldStroke}`
|
|
514
|
-
};
|
|
515
|
-
var hoverInputfield = {
|
|
516
|
-
borderColor: Border2.BordersDdsBorderFocusInputfieldStroke,
|
|
517
|
-
boxShadow: `0 0 0 1px ${Border2.BordersDdsBorderFocusInputfieldStroke}`
|
|
518
|
-
};
|
|
519
|
-
var hoverDangerInputfield = {
|
|
520
|
-
borderColor: Colors2.DdsColorDangerBase,
|
|
521
|
-
boxShadow: `0 0 0 1px ${Colors2.DdsColorDangerBase}`
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
// src/components/helpers/styling/normalize.tsx
|
|
525
|
-
var normalizeButton = {
|
|
526
|
-
margin: 0,
|
|
527
|
-
textTransform: "none"
|
|
528
|
-
};
|
|
529
|
-
|
|
530
|
-
// src/components/helpers/styling/removeButtonStyling.tsx
|
|
531
|
-
var removeButtonStyling = {
|
|
532
|
-
background: "none",
|
|
533
|
-
color: "inherit",
|
|
534
|
-
border: "none",
|
|
535
|
-
padding: 0,
|
|
536
|
-
font: "inherit",
|
|
537
|
-
cursor: "pointer",
|
|
538
|
-
outline: "inherit"
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
// src/components/helpers/styling/removeListStyling.tsx
|
|
542
|
-
var removeListStyling = {
|
|
543
|
-
listStyle: "none",
|
|
544
|
-
padding: 0,
|
|
545
|
-
margin: 0
|
|
546
|
-
};
|
|
453
|
+
// src/components/Typography/Caption/Caption.tsx
|
|
454
|
+
var import_react3 = require("react");
|
|
547
455
|
|
|
548
|
-
// src/
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
color: colors2.DdsColorNeutralsGray9,
|
|
553
|
-
backgroundColor: colors2.DdsColorTertiaryLightest
|
|
554
|
-
};
|
|
456
|
+
// src/utils/dom.ts
|
|
457
|
+
function cn(...classNames) {
|
|
458
|
+
return classNames.filter(Boolean).join(" ");
|
|
459
|
+
}
|
|
555
460
|
|
|
556
|
-
// src/
|
|
557
|
-
var
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
461
|
+
// src/types/BaseComponentProps.ts
|
|
462
|
+
var getBaseHTMLProps = (id, htmlPropsOrClassName, htmlPropsOrUnknownProps, unknownPropsOrUndefined) => {
|
|
463
|
+
if (typeof htmlPropsOrClassName === "string" || unknownPropsOrUndefined != void 0) {
|
|
464
|
+
const {
|
|
465
|
+
id: idFromHtmlProps,
|
|
466
|
+
className: classNameFromHtmlProps,
|
|
467
|
+
...restHTMLProps
|
|
468
|
+
} = htmlPropsOrUnknownProps != null ? htmlPropsOrUnknownProps : {};
|
|
469
|
+
const propId = id != null ? id : idFromHtmlProps;
|
|
470
|
+
const propClassName = cn(
|
|
471
|
+
htmlPropsOrClassName,
|
|
472
|
+
classNameFromHtmlProps
|
|
473
|
+
);
|
|
474
|
+
return {
|
|
475
|
+
...unknownPropsOrUndefined,
|
|
476
|
+
...restHTMLProps,
|
|
477
|
+
...propClassName && { className: propClassName },
|
|
478
|
+
...propId && { id: propId }
|
|
479
|
+
};
|
|
480
|
+
} else {
|
|
481
|
+
const {
|
|
482
|
+
id: htmlPropsId,
|
|
483
|
+
className: htmlPropsClassName,
|
|
484
|
+
...restHTMLProps
|
|
485
|
+
} = htmlPropsOrClassName != null ? htmlPropsOrClassName : {};
|
|
486
|
+
const propId = id != null ? id : htmlPropsId;
|
|
487
|
+
return {
|
|
488
|
+
...htmlPropsOrUnknownProps,
|
|
489
|
+
...restHTMLProps,
|
|
490
|
+
...htmlPropsClassName && { className: htmlPropsClassName },
|
|
491
|
+
...propId && { id: propId }
|
|
492
|
+
};
|
|
493
|
+
}
|
|
568
494
|
};
|
|
569
495
|
|
|
570
|
-
// src/components/Typography/Caption/Caption.tsx
|
|
571
|
-
var import_react3 = require("react");
|
|
572
|
-
|
|
573
496
|
// src/components/Typography/Typography/TextOverflowEllipsis/TextOverflowEllipsis.tsx
|
|
574
|
-
var
|
|
575
|
-
var TextOverflowEllipsisWrapper =
|
|
497
|
+
var import_styled_components3 = __toESM(require("styled-components"));
|
|
498
|
+
var TextOverflowEllipsisWrapper = import_styled_components3.default.span`
|
|
576
499
|
max-width: 100%;
|
|
577
500
|
`;
|
|
578
|
-
var TextOverflowEllipsisInner =
|
|
501
|
+
var TextOverflowEllipsisInner = import_styled_components3.default.span`
|
|
579
502
|
white-space: nowrap;
|
|
580
503
|
overflow: hidden;
|
|
581
504
|
text-overflow: ellipsis;
|
|
@@ -583,26 +506,134 @@ var TextOverflowEllipsisInner = import_styled_components4.default.span`
|
|
|
583
506
|
|
|
584
507
|
// src/components/Typography/Typography/Typography.tsx
|
|
585
508
|
var import_react2 = require("react");
|
|
586
|
-
var
|
|
509
|
+
var import_styled_components7 = __toESM(require("styled-components"));
|
|
510
|
+
|
|
511
|
+
// src/components/Typography/Typography/Typography.styles.ts
|
|
512
|
+
var import_dds_design_tokens3 = require("@norges-domstoler/dds-design-tokens");
|
|
513
|
+
var import_styled_components4 = require("styled-components");
|
|
514
|
+
|
|
515
|
+
// src/components/Typography/Typography/openExternal.svg
|
|
516
|
+
var openExternal_default = 'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path d="M19 19H5V5H12V3H5C4.46957 3 3.96086 3.21071 3.58579 3.58579C3.21071 3.96086 3 4.46957 3 5V19C3 19.5304 3.21071 20.0391 3.58579 20.4142C3.96086 20.7893 4.46957 21 5 21H19C20.1 21 21 20.1 21 19V12H19V19ZM14 3V5H17.59L7.76 14.83L9.17 16.24L19 6.41V10H21V3H14Z" fill="%230B0D0E"/>%0A</svg>%0A';
|
|
517
|
+
|
|
518
|
+
// src/components/Typography/Typography/Typography.utils.ts
|
|
519
|
+
var defaultTypographyType = "bodySans02";
|
|
520
|
+
var getElementType = (element3) => {
|
|
521
|
+
switch (element3) {
|
|
522
|
+
case "a":
|
|
523
|
+
return "a";
|
|
524
|
+
case "headingSans01":
|
|
525
|
+
return "h6";
|
|
526
|
+
case "headingSans02":
|
|
527
|
+
return "h5";
|
|
528
|
+
case "headingSans03":
|
|
529
|
+
return "h4";
|
|
530
|
+
case "headingSans04":
|
|
531
|
+
return "h3";
|
|
532
|
+
case "headingSans05":
|
|
533
|
+
return "h2";
|
|
534
|
+
case "headingSans06":
|
|
535
|
+
case "headingSans07":
|
|
536
|
+
case "headingSans08":
|
|
537
|
+
return "h1";
|
|
538
|
+
case "supportingStyleLabel01":
|
|
539
|
+
return "label";
|
|
540
|
+
case "bodySans01":
|
|
541
|
+
case "bodySans02":
|
|
542
|
+
case "bodySans03":
|
|
543
|
+
case "bodySans04":
|
|
544
|
+
case "leadSans01":
|
|
545
|
+
case "leadSans02":
|
|
546
|
+
case "leadSans03":
|
|
547
|
+
case "leadSans04":
|
|
548
|
+
case "leadSans05":
|
|
549
|
+
case "supportingStyleHelperText01":
|
|
550
|
+
case "supportingStylePlaceholderText01":
|
|
551
|
+
case "supportingStylePlaceholderText02":
|
|
552
|
+
case "supportingStylePlaceholderText03":
|
|
553
|
+
case "supportingStyleTiny01":
|
|
554
|
+
case "supportingStyleTiny02":
|
|
555
|
+
default:
|
|
556
|
+
return "p";
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
var isHeading = (type) => {
|
|
560
|
+
return true;
|
|
561
|
+
};
|
|
562
|
+
var inlineElements = [
|
|
563
|
+
"a",
|
|
564
|
+
"abbr",
|
|
565
|
+
"audio",
|
|
566
|
+
"b",
|
|
567
|
+
"bdi",
|
|
568
|
+
"bdo",
|
|
569
|
+
"big",
|
|
570
|
+
"br",
|
|
571
|
+
"button",
|
|
572
|
+
"canvas",
|
|
573
|
+
"cite",
|
|
574
|
+
"code",
|
|
575
|
+
"data",
|
|
576
|
+
"datalist",
|
|
577
|
+
"del",
|
|
578
|
+
"dfn",
|
|
579
|
+
"em",
|
|
580
|
+
"embed",
|
|
581
|
+
"i",
|
|
582
|
+
"iframe",
|
|
583
|
+
"img",
|
|
584
|
+
"input",
|
|
585
|
+
"ins",
|
|
586
|
+
"kbd",
|
|
587
|
+
"label",
|
|
588
|
+
"map",
|
|
589
|
+
"mark",
|
|
590
|
+
"meter",
|
|
591
|
+
"noscript",
|
|
592
|
+
"object",
|
|
593
|
+
"output",
|
|
594
|
+
"picture",
|
|
595
|
+
"progress",
|
|
596
|
+
"q",
|
|
597
|
+
"ruby",
|
|
598
|
+
"s",
|
|
599
|
+
"samp",
|
|
600
|
+
"script",
|
|
601
|
+
"select",
|
|
602
|
+
"slot",
|
|
603
|
+
"small",
|
|
604
|
+
"span",
|
|
605
|
+
"strong",
|
|
606
|
+
"sub",
|
|
607
|
+
"sup",
|
|
608
|
+
"svg",
|
|
609
|
+
"template",
|
|
610
|
+
"textarea",
|
|
611
|
+
"time",
|
|
612
|
+
"u",
|
|
613
|
+
"var",
|
|
614
|
+
"video",
|
|
615
|
+
"wbr"
|
|
616
|
+
];
|
|
617
|
+
var isInlineElement = (as) => inlineElements.indexOf(as) !== -1;
|
|
587
618
|
|
|
588
619
|
// src/components/Typography/Typography.tokens.tsx
|
|
589
|
-
var
|
|
590
|
-
var { colors:
|
|
591
|
-
var { textDefault } =
|
|
620
|
+
var import_dds_design_tokens2 = require("@norges-domstoler/dds-design-tokens");
|
|
621
|
+
var { colors: colors2, fontPackages, spacing: spacing2 } = import_dds_design_tokens2.ddsBaseTokens;
|
|
622
|
+
var { textDefault } = import_dds_design_tokens2.ddsReferenceTokens;
|
|
592
623
|
var a = {
|
|
593
624
|
base: {
|
|
594
|
-
color:
|
|
625
|
+
color: colors2.DdsColorInteractiveBase
|
|
595
626
|
},
|
|
596
627
|
margins: {
|
|
597
628
|
marginTop: 0,
|
|
598
629
|
marginBottom: fontPackages.body_sans_02.paragraph.paragraphSpacing
|
|
599
630
|
},
|
|
600
631
|
hover: {
|
|
601
|
-
color:
|
|
632
|
+
color: colors2.DdsColorInteractiveDark
|
|
602
633
|
},
|
|
603
634
|
icon: {
|
|
604
|
-
marginTop:
|
|
605
|
-
marginLeft:
|
|
635
|
+
marginTop: spacing2.SizesDdsSpacingX025,
|
|
636
|
+
marginLeft: spacing2.SizesDdsSpacingX025
|
|
606
637
|
}
|
|
607
638
|
};
|
|
608
639
|
var bold = {
|
|
@@ -616,7 +647,7 @@ var headingSans01 = {
|
|
|
616
647
|
margins: {
|
|
617
648
|
marginTop: 0,
|
|
618
649
|
marginBottom: fontPackages.heading_sans_01.paragraph.paragraphSpacing,
|
|
619
|
-
paddingTop:
|
|
650
|
+
paddingTop: spacing2.SpacingDdsSpacingPaddingTopHeadingSans01Top
|
|
620
651
|
}
|
|
621
652
|
};
|
|
622
653
|
var headingSans02 = {
|
|
@@ -627,7 +658,7 @@ var headingSans02 = {
|
|
|
627
658
|
margins: {
|
|
628
659
|
marginTop: 0,
|
|
629
660
|
marginBottom: fontPackages.heading_sans_02.paragraph.paragraphSpacing,
|
|
630
|
-
paddingTop:
|
|
661
|
+
paddingTop: spacing2.SpacingDdsSpacingPaddingTopHeadingSans02Top
|
|
631
662
|
}
|
|
632
663
|
};
|
|
633
664
|
var headingSans03 = {
|
|
@@ -638,7 +669,7 @@ var headingSans03 = {
|
|
|
638
669
|
margins: {
|
|
639
670
|
marginTop: 0,
|
|
640
671
|
marginBottom: fontPackages.heading_sans_03.paragraph.paragraphSpacing,
|
|
641
|
-
paddingTop:
|
|
672
|
+
paddingTop: spacing2.SpacingDdsSpacingPaddingTopHeadingSans03Top
|
|
642
673
|
}
|
|
643
674
|
};
|
|
644
675
|
var headingSans04 = {
|
|
@@ -649,7 +680,7 @@ var headingSans04 = {
|
|
|
649
680
|
margins: {
|
|
650
681
|
marginTop: 0,
|
|
651
682
|
marginBottom: fontPackages.heading_sans_04.paragraph.paragraphSpacing,
|
|
652
|
-
paddingTop:
|
|
683
|
+
paddingTop: spacing2.SpacingDdsSpacingPaddingTopHeadingSans04Top
|
|
653
684
|
}
|
|
654
685
|
};
|
|
655
686
|
var headingSans05 = {
|
|
@@ -660,7 +691,7 @@ var headingSans05 = {
|
|
|
660
691
|
margins: {
|
|
661
692
|
marginTop: 0,
|
|
662
693
|
marginBottom: fontPackages.heading_sans_05.paragraph.paragraphSpacing,
|
|
663
|
-
paddingTop:
|
|
694
|
+
paddingTop: spacing2.SpacingDdsSpacingPaddingTopHeadingSans05Top
|
|
664
695
|
}
|
|
665
696
|
};
|
|
666
697
|
var headingSans06 = {
|
|
@@ -671,7 +702,7 @@ var headingSans06 = {
|
|
|
671
702
|
margins: {
|
|
672
703
|
marginTop: 0,
|
|
673
704
|
marginBottom: fontPackages.heading_sans_06.paragraph.paragraphSpacing,
|
|
674
|
-
paddingTop:
|
|
705
|
+
paddingTop: spacing2.SpacingDdsSpacingPaddingTopHeadingSans06Top
|
|
675
706
|
}
|
|
676
707
|
};
|
|
677
708
|
var headingSans07 = {
|
|
@@ -682,7 +713,7 @@ var headingSans07 = {
|
|
|
682
713
|
margins: {
|
|
683
714
|
marginTop: 0,
|
|
684
715
|
marginBottom: fontPackages.heading_sans_07.paragraph.paragraphSpacing,
|
|
685
|
-
paddingTop:
|
|
716
|
+
paddingTop: spacing2.SpacingDdsSpacingPaddingTopHeadingSans07Top
|
|
686
717
|
}
|
|
687
718
|
};
|
|
688
719
|
var headingSans08 = {
|
|
@@ -693,7 +724,7 @@ var headingSans08 = {
|
|
|
693
724
|
margins: {
|
|
694
725
|
marginTop: 0,
|
|
695
726
|
marginBottom: fontPackages.heading_sans_08.paragraph.paragraphSpacing,
|
|
696
|
-
paddingTop:
|
|
727
|
+
paddingTop: spacing2.SpacingDdsSpacingPaddingTopHeadingSans08Top
|
|
697
728
|
}
|
|
698
729
|
};
|
|
699
730
|
var bodySans01 = {
|
|
@@ -788,7 +819,7 @@ var leadSans05 = {
|
|
|
788
819
|
};
|
|
789
820
|
var supportingStyleLabel01 = {
|
|
790
821
|
base: {
|
|
791
|
-
color:
|
|
822
|
+
color: colors2.DdsColorNeutralsGray7,
|
|
792
823
|
font: fontPackages.supportingStyle_label_01.base,
|
|
793
824
|
margin: 0
|
|
794
825
|
},
|
|
@@ -799,7 +830,7 @@ var supportingStyleLabel01 = {
|
|
|
799
830
|
};
|
|
800
831
|
var supportingStyleHelperText01 = {
|
|
801
832
|
base: {
|
|
802
|
-
color:
|
|
833
|
+
color: colors2.DdsColorNeutralsGray6,
|
|
803
834
|
font: fontPackages.supportingStyle_helpertext_01.base,
|
|
804
835
|
margin: 0
|
|
805
836
|
},
|
|
@@ -810,7 +841,7 @@ var supportingStyleHelperText01 = {
|
|
|
810
841
|
};
|
|
811
842
|
var supportingStylePlaceholderText01 = {
|
|
812
843
|
base: {
|
|
813
|
-
color:
|
|
844
|
+
color: colors2.DdsColorNeutralsGray6,
|
|
814
845
|
font: fontPackages.supportingStyle_placeholdertext_01.base,
|
|
815
846
|
margin: 0
|
|
816
847
|
},
|
|
@@ -821,7 +852,7 @@ var supportingStylePlaceholderText01 = {
|
|
|
821
852
|
};
|
|
822
853
|
var supportingStylePlaceholderText02 = {
|
|
823
854
|
base: {
|
|
824
|
-
color:
|
|
855
|
+
color: colors2.DdsColorNeutralsGray6,
|
|
825
856
|
font: fontPackages.supportingStyle_placeholdertext_02.base,
|
|
826
857
|
margin: 0
|
|
827
858
|
},
|
|
@@ -832,7 +863,7 @@ var supportingStylePlaceholderText02 = {
|
|
|
832
863
|
};
|
|
833
864
|
var supportingStylePlaceholderText03 = {
|
|
834
865
|
base: {
|
|
835
|
-
color:
|
|
866
|
+
color: colors2.DdsColorNeutralsGray6,
|
|
836
867
|
font: fontPackages.supportingStyle_placeholdertext_03.base,
|
|
837
868
|
margin: 0
|
|
838
869
|
},
|
|
@@ -897,127 +928,17 @@ var typographyTokens = {
|
|
|
897
928
|
};
|
|
898
929
|
|
|
899
930
|
// src/components/Typography/Typography/Typography.styles.ts
|
|
900
|
-
var
|
|
901
|
-
|
|
902
|
-
// src/components/Typography/Typography/openExternal.svg
|
|
903
|
-
var openExternal_default = 'data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path d="M19 19H5V5H12V3H5C4.46957 3 3.96086 3.21071 3.58579 3.58579C3.21071 3.96086 3 4.46957 3 5V19C3 19.5304 3.21071 20.0391 3.58579 20.4142C3.96086 20.7893 4.46957 21 5 21H19C20.1 21 21 20.1 21 19V12H19V19ZM14 3V5H17.59L7.76 14.83L9.17 16.24L19 6.41V10H21V3H14Z" fill="%230B0D0E"/>%0A</svg>%0A';
|
|
904
|
-
|
|
905
|
-
// src/components/Typography/Typography/Typography.styles.ts
|
|
906
|
-
var import_dds_design_tokens8 = require("@norges-domstoler/dds-design-tokens");
|
|
907
|
-
|
|
908
|
-
// src/components/Typography/Typography/Typography.utils.ts
|
|
909
|
-
var defaultTypographyType = "bodySans02";
|
|
910
|
-
var getElementType = (element3) => {
|
|
911
|
-
switch (element3) {
|
|
912
|
-
case "a":
|
|
913
|
-
return "a";
|
|
914
|
-
case "headingSans01":
|
|
915
|
-
return "h6";
|
|
916
|
-
case "headingSans02":
|
|
917
|
-
return "h5";
|
|
918
|
-
case "headingSans03":
|
|
919
|
-
return "h4";
|
|
920
|
-
case "headingSans04":
|
|
921
|
-
return "h3";
|
|
922
|
-
case "headingSans05":
|
|
923
|
-
return "h2";
|
|
924
|
-
case "headingSans06":
|
|
925
|
-
case "headingSans07":
|
|
926
|
-
case "headingSans08":
|
|
927
|
-
return "h1";
|
|
928
|
-
case "supportingStyleLabel01":
|
|
929
|
-
return "label";
|
|
930
|
-
case "bodySans01":
|
|
931
|
-
case "bodySans02":
|
|
932
|
-
case "bodySans03":
|
|
933
|
-
case "bodySans04":
|
|
934
|
-
case "leadSans01":
|
|
935
|
-
case "leadSans02":
|
|
936
|
-
case "leadSans03":
|
|
937
|
-
case "leadSans04":
|
|
938
|
-
case "leadSans05":
|
|
939
|
-
case "supportingStyleHelperText01":
|
|
940
|
-
case "supportingStylePlaceholderText01":
|
|
941
|
-
case "supportingStylePlaceholderText02":
|
|
942
|
-
case "supportingStylePlaceholderText03":
|
|
943
|
-
case "supportingStyleTiny01":
|
|
944
|
-
case "supportingStyleTiny02":
|
|
945
|
-
default:
|
|
946
|
-
return "p";
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
var isHeading = (type) => {
|
|
950
|
-
return true;
|
|
951
|
-
};
|
|
952
|
-
var inlineElements = [
|
|
953
|
-
"a",
|
|
954
|
-
"abbr",
|
|
955
|
-
"audio",
|
|
956
|
-
"b",
|
|
957
|
-
"bdi",
|
|
958
|
-
"bdo",
|
|
959
|
-
"big",
|
|
960
|
-
"br",
|
|
961
|
-
"button",
|
|
962
|
-
"canvas",
|
|
963
|
-
"cite",
|
|
964
|
-
"code",
|
|
965
|
-
"data",
|
|
966
|
-
"datalist",
|
|
967
|
-
"del",
|
|
968
|
-
"dfn",
|
|
969
|
-
"em",
|
|
970
|
-
"embed",
|
|
971
|
-
"i",
|
|
972
|
-
"iframe",
|
|
973
|
-
"img",
|
|
974
|
-
"input",
|
|
975
|
-
"ins",
|
|
976
|
-
"kbd",
|
|
977
|
-
"label",
|
|
978
|
-
"map",
|
|
979
|
-
"mark",
|
|
980
|
-
"meter",
|
|
981
|
-
"noscript",
|
|
982
|
-
"object",
|
|
983
|
-
"output",
|
|
984
|
-
"picture",
|
|
985
|
-
"progress",
|
|
986
|
-
"q",
|
|
987
|
-
"ruby",
|
|
988
|
-
"s",
|
|
989
|
-
"samp",
|
|
990
|
-
"script",
|
|
991
|
-
"select",
|
|
992
|
-
"slot",
|
|
993
|
-
"small",
|
|
994
|
-
"span",
|
|
995
|
-
"strong",
|
|
996
|
-
"sub",
|
|
997
|
-
"sup",
|
|
998
|
-
"svg",
|
|
999
|
-
"template",
|
|
1000
|
-
"textarea",
|
|
1001
|
-
"time",
|
|
1002
|
-
"u",
|
|
1003
|
-
"var",
|
|
1004
|
-
"video",
|
|
1005
|
-
"wbr"
|
|
1006
|
-
];
|
|
1007
|
-
var isInlineElement = (as) => inlineElements.indexOf(as) !== -1;
|
|
1008
|
-
|
|
1009
|
-
// src/components/Typography/Typography/Typography.styles.ts
|
|
1010
|
-
var { border: border3, colors: colors4 } = import_dds_design_tokens8.ddsBaseTokens;
|
|
931
|
+
var { border: border2, colors: colors3 } = import_dds_design_tokens3.ddsBaseTokens;
|
|
1011
932
|
var focusVisibleLink = {
|
|
1012
933
|
outline: "none",
|
|
1013
|
-
backgroundColor:
|
|
1014
|
-
color:
|
|
934
|
+
backgroundColor: border2.BordersDdsBorderFocusBaseStroke,
|
|
935
|
+
color: colors3.DdsColorNeutralsWhite,
|
|
1015
936
|
textDecoration: "none"
|
|
1016
937
|
};
|
|
1017
938
|
var focusVisibleLinkOnDark = {
|
|
1018
939
|
outline: "none",
|
|
1019
|
-
backgroundColor:
|
|
1020
|
-
color:
|
|
940
|
+
backgroundColor: border2.BordersDdsBorderFocusOndarkStroke,
|
|
941
|
+
color: colors3.DdsColorNeutralsGray9,
|
|
1021
942
|
textDecoration: "none"
|
|
1022
943
|
};
|
|
1023
944
|
var focusVisibleLinkTransitionValue = "background-color 0.2s, text-decoration 0.2s, color 0.2s";
|
|
@@ -1028,35 +949,35 @@ var getFontStyling = (type, withColor) => {
|
|
|
1028
949
|
};
|
|
1029
950
|
};
|
|
1030
951
|
var getAdditionalFontStyle = (bold2, italic, underline) => {
|
|
1031
|
-
return
|
|
1032
|
-
${bold2 &&
|
|
952
|
+
return import_styled_components4.css`
|
|
953
|
+
${bold2 && import_styled_components4.css`
|
|
1033
954
|
font-weight: ${typographyTokens.style.bold.fontWeight};
|
|
1034
955
|
`}
|
|
1035
|
-
${italic &&
|
|
956
|
+
${italic && import_styled_components4.css`
|
|
1036
957
|
font-style: italic;
|
|
1037
958
|
`}
|
|
1038
|
-
${underline &&
|
|
959
|
+
${underline && import_styled_components4.css`
|
|
1039
960
|
text-decoration: underline;
|
|
1040
961
|
`}
|
|
1041
962
|
`;
|
|
1042
963
|
};
|
|
1043
|
-
var getMarginStyling = (typographyType7, element3, withMargins) => withMargins ?
|
|
1044
|
-
${isInlineElement(element3) && element3 !== "a" &&
|
|
964
|
+
var getMarginStyling = (typographyType7, element3, withMargins) => withMargins ? import_styled_components4.css`
|
|
965
|
+
${isInlineElement(element3) && element3 !== "a" && import_styled_components4.css`
|
|
1045
966
|
display: block;
|
|
1046
967
|
`}
|
|
1047
968
|
margin-top: ${typographyTokens.typographyType[typographyType7].margins.marginTop};
|
|
1048
969
|
margin-bottom: ${typographyTokens.typographyType[typographyType7].margins.marginBottom};
|
|
1049
|
-
${isHeading(typographyType7) &&
|
|
970
|
+
${isHeading(typographyType7) && import_styled_components4.css`
|
|
1050
971
|
padding-top: ${typographyTokens.typographyType[typographyType7].margins.paddingTop};
|
|
1051
972
|
`}
|
|
1052
|
-
` :
|
|
973
|
+
` : import_styled_components4.css`
|
|
1053
974
|
margin: 0;
|
|
1054
975
|
`;
|
|
1055
|
-
var getAnchorStyling = (external, interactionStyling, typographyType7, withMargins) =>
|
|
1056
|
-
${typographyType7 ?
|
|
976
|
+
var getAnchorStyling = (external, interactionStyling, typographyType7, withMargins) => import_styled_components4.css`
|
|
977
|
+
${typographyType7 ? import_styled_components4.css`
|
|
1057
978
|
${typographyTokens.typographyType[typographyType7].base.font};
|
|
1058
979
|
${getMarginStyling(typographyType7, "a", withMargins)}
|
|
1059
|
-
` :
|
|
980
|
+
` : import_styled_components4.css`
|
|
1060
981
|
font: inherit;
|
|
1061
982
|
${getMarginStyling("a", "a", withMargins)}
|
|
1062
983
|
`}
|
|
@@ -1066,7 +987,7 @@ var getAnchorStyling = (external, interactionStyling, typographyType7, withMargi
|
|
|
1066
987
|
@media (prefers-reduced-motion: no-preference) {
|
|
1067
988
|
transition: ${focusVisibleLinkTransitionValue};
|
|
1068
989
|
}
|
|
1069
|
-
${external &&
|
|
990
|
+
${external && import_styled_components4.css`
|
|
1070
991
|
padding-right: calc(1em + ${typographyTokens.typographyType.a.icon.marginLeft});
|
|
1071
992
|
position: relative;
|
|
1072
993
|
&::after {
|
|
@@ -1083,11 +1004,11 @@ var getAnchorStyling = (external, interactionStyling, typographyType7, withMargi
|
|
|
1083
1004
|
`}
|
|
1084
1005
|
&:hover {
|
|
1085
1006
|
color: ${typographyTokens.typographyType.a.hover.color};
|
|
1086
|
-
${(interactionStyling == null ? void 0 : interactionStyling.hover) &&
|
|
1007
|
+
${(interactionStyling == null ? void 0 : interactionStyling.hover) && import_styled_components4.css`
|
|
1087
1008
|
${interactionStyling.hover}
|
|
1088
1009
|
`}
|
|
1089
1010
|
}
|
|
1090
|
-
${(interactionStyling == null ? void 0 : interactionStyling.active) &&
|
|
1011
|
+
${(interactionStyling == null ? void 0 : interactionStyling.active) && import_styled_components4.css`
|
|
1091
1012
|
&:active {
|
|
1092
1013
|
${interactionStyling.active}
|
|
1093
1014
|
}
|
|
@@ -1097,50 +1018,10 @@ var getAnchorStyling = (external, interactionStyling, typographyType7, withMargi
|
|
|
1097
1018
|
}
|
|
1098
1019
|
`;
|
|
1099
1020
|
|
|
1100
|
-
// src/utils/dom.ts
|
|
1101
|
-
function cn(...classNames) {
|
|
1102
|
-
return classNames.filter(Boolean).join(" ");
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
// src/types/BaseComponentProps.ts
|
|
1106
|
-
var getBaseHTMLProps = (id, htmlPropsOrClassName, htmlPropsOrUnknownProps, unknownPropsOrUndefined) => {
|
|
1107
|
-
if (typeof htmlPropsOrClassName === "string" || unknownPropsOrUndefined != void 0) {
|
|
1108
|
-
const {
|
|
1109
|
-
id: idFromHtmlProps,
|
|
1110
|
-
className: classNameFromHtmlProps,
|
|
1111
|
-
...restHTMLProps
|
|
1112
|
-
} = htmlPropsOrUnknownProps != null ? htmlPropsOrUnknownProps : {};
|
|
1113
|
-
const propId = id != null ? id : idFromHtmlProps;
|
|
1114
|
-
const propClassName = cn(
|
|
1115
|
-
htmlPropsOrClassName,
|
|
1116
|
-
classNameFromHtmlProps
|
|
1117
|
-
);
|
|
1118
|
-
return {
|
|
1119
|
-
...unknownPropsOrUndefined,
|
|
1120
|
-
...restHTMLProps,
|
|
1121
|
-
...propClassName && { className: propClassName },
|
|
1122
|
-
...propId && { id: propId }
|
|
1123
|
-
};
|
|
1124
|
-
} else {
|
|
1125
|
-
const {
|
|
1126
|
-
id: htmlPropsId,
|
|
1127
|
-
className: htmlPropsClassName,
|
|
1128
|
-
...restHTMLProps
|
|
1129
|
-
} = htmlPropsOrClassName != null ? htmlPropsOrClassName : {};
|
|
1130
|
-
const propId = id != null ? id : htmlPropsId;
|
|
1131
|
-
return {
|
|
1132
|
-
...htmlPropsOrUnknownProps,
|
|
1133
|
-
...restHTMLProps,
|
|
1134
|
-
...htmlPropsClassName && { className: htmlPropsClassName },
|
|
1135
|
-
...propId && { id: propId }
|
|
1136
|
-
};
|
|
1137
|
-
}
|
|
1138
|
-
};
|
|
1139
|
-
|
|
1140
1021
|
// src/utils/color.tsx
|
|
1141
|
-
var
|
|
1142
|
-
var { colors:
|
|
1143
|
-
var { textDefault: textDefault2 } =
|
|
1022
|
+
var import_dds_design_tokens4 = require("@norges-domstoler/dds-design-tokens");
|
|
1023
|
+
var { colors: colors4 } = import_dds_design_tokens4.ddsBaseTokens;
|
|
1024
|
+
var { textDefault: textDefault2 } = import_dds_design_tokens4.ddsReferenceTokens;
|
|
1144
1025
|
var changeRGBAAlpha = (value, alpha) => {
|
|
1145
1026
|
if (!value.startsWith("rgba(") || !value.endsWith(")")) {
|
|
1146
1027
|
return "";
|
|
@@ -1148,22 +1029,22 @@ var changeRGBAAlpha = (value, alpha) => {
|
|
|
1148
1029
|
return value.replace(/[\d.]+\)$/g, alpha.toString() + ")");
|
|
1149
1030
|
};
|
|
1150
1031
|
var textColors = {
|
|
1151
|
-
interactive:
|
|
1152
|
-
primary:
|
|
1153
|
-
danger:
|
|
1154
|
-
success:
|
|
1155
|
-
warning:
|
|
1032
|
+
interactive: colors4.DdsColorInteractiveBase,
|
|
1033
|
+
primary: colors4.DdsColorPrimaryBase,
|
|
1034
|
+
danger: colors4.DdsColorDangerBase,
|
|
1035
|
+
success: colors4.DdsColorSuccessBase,
|
|
1036
|
+
warning: colors4.DdsColorWarningBase,
|
|
1156
1037
|
onLight: textDefault2.textColor,
|
|
1157
|
-
onDark:
|
|
1158
|
-
gray1:
|
|
1159
|
-
gray2:
|
|
1160
|
-
gray3:
|
|
1161
|
-
gray4:
|
|
1162
|
-
gray5:
|
|
1163
|
-
gray6:
|
|
1164
|
-
gray7:
|
|
1165
|
-
gray8:
|
|
1166
|
-
gray9:
|
|
1038
|
+
onDark: colors4.DdsColorNeutralsWhite,
|
|
1039
|
+
gray1: colors4.DdsColorNeutralsGray1,
|
|
1040
|
+
gray2: colors4.DdsColorNeutralsGray2,
|
|
1041
|
+
gray3: colors4.DdsColorNeutralsGray3,
|
|
1042
|
+
gray4: colors4.DdsColorNeutralsGray4,
|
|
1043
|
+
gray5: colors4.DdsColorNeutralsGray5,
|
|
1044
|
+
gray6: colors4.DdsColorNeutralsGray6,
|
|
1045
|
+
gray7: colors4.DdsColorNeutralsGray7,
|
|
1046
|
+
gray8: colors4.DdsColorNeutralsGray8,
|
|
1047
|
+
gray9: colors4.DdsColorNeutralsGray9
|
|
1167
1048
|
};
|
|
1168
1049
|
var textColorsArray = [
|
|
1169
1050
|
"interactive",
|
|
@@ -1228,47 +1109,45 @@ var spaceSeparatedIdListGenerator = (values) => {
|
|
|
1228
1109
|
};
|
|
1229
1110
|
|
|
1230
1111
|
// src/components/InputMessage/InputMessage.tsx
|
|
1231
|
-
var
|
|
1112
|
+
var import_react = require("react");
|
|
1113
|
+
var import_styled_components6 = __toESM(require("styled-components"));
|
|
1232
1114
|
|
|
1233
1115
|
// src/components/InputMessage/InputMessage.tokens.tsx
|
|
1234
|
-
var
|
|
1235
|
-
var { colors:
|
|
1116
|
+
var import_dds_design_tokens5 = require("@norges-domstoler/dds-design-tokens");
|
|
1117
|
+
var { colors: colors5, spacing: spacing3 } = import_dds_design_tokens5.ddsBaseTokens;
|
|
1236
1118
|
var message = {
|
|
1237
1119
|
tip: {
|
|
1238
|
-
backgroundColor:
|
|
1120
|
+
backgroundColor: colors5.DdsColorNeutralsWhite
|
|
1239
1121
|
},
|
|
1240
1122
|
error: {
|
|
1241
|
-
padding: `${
|
|
1242
|
-
color:
|
|
1243
|
-
backgroundColor:
|
|
1244
|
-
gap:
|
|
1123
|
+
padding: `${spacing3.SizesDdsSpacingX025} ${spacing3.SizesDdsSpacingX05}`,
|
|
1124
|
+
color: colors5.DdsColorDangerBase,
|
|
1125
|
+
backgroundColor: colors5.DdsColorDangerLightest,
|
|
1126
|
+
gap: spacing3.SizesDdsSpacingX05
|
|
1245
1127
|
}
|
|
1246
1128
|
};
|
|
1247
1129
|
var icon = {
|
|
1248
|
-
marginTop:
|
|
1130
|
+
marginTop: spacing3.SizesDdsSpacingX0125
|
|
1249
1131
|
};
|
|
1250
1132
|
var inputMessageTokens = {
|
|
1251
1133
|
message,
|
|
1252
1134
|
icon
|
|
1253
1135
|
};
|
|
1254
1136
|
|
|
1255
|
-
// src/components/InputMessage/InputMessage.tsx
|
|
1256
|
-
var import_react = require("react");
|
|
1257
|
-
|
|
1258
1137
|
// src/components/Icon/Icon.tsx
|
|
1259
|
-
var
|
|
1138
|
+
var import_dds_design_tokens6 = require("@norges-domstoler/dds-design-tokens");
|
|
1260
1139
|
var getSize = (iconSize) => {
|
|
1261
1140
|
switch (iconSize) {
|
|
1262
1141
|
case "small":
|
|
1263
|
-
return
|
|
1142
|
+
return import_dds_design_tokens6.ddsBaseTokens.iconSizes.DdsIconsizeSmall;
|
|
1264
1143
|
case "medium":
|
|
1265
|
-
return
|
|
1144
|
+
return import_dds_design_tokens6.ddsBaseTokens.iconSizes.DdsIconsizeMedium;
|
|
1266
1145
|
case "large":
|
|
1267
|
-
return
|
|
1146
|
+
return import_dds_design_tokens6.ddsBaseTokens.iconSizes.DdsIconsizeLarge;
|
|
1268
1147
|
case "inherit":
|
|
1269
1148
|
return "1em";
|
|
1270
1149
|
default:
|
|
1271
|
-
return
|
|
1150
|
+
return import_dds_design_tokens6.ddsBaseTokens.iconSizes.DdsIconsizeMedium;
|
|
1272
1151
|
}
|
|
1273
1152
|
};
|
|
1274
1153
|
function Icon(props) {
|
|
@@ -1295,10 +1174,10 @@ function Icon(props) {
|
|
|
1295
1174
|
Icon.displayName = "Icon";
|
|
1296
1175
|
|
|
1297
1176
|
// src/components/Icon/utils/StyledSvg.ts
|
|
1298
|
-
var
|
|
1177
|
+
var import_styled_components5 = __toESM(require("styled-components"));
|
|
1299
1178
|
var size = 24;
|
|
1300
1179
|
var sizePx = `${size}px`;
|
|
1301
|
-
var StyledSvg =
|
|
1180
|
+
var StyledSvg = import_styled_components5.default.svg.attrs(
|
|
1302
1181
|
({ height, width, fill }) => {
|
|
1303
1182
|
return {
|
|
1304
1183
|
height: height ? height : sizePx,
|
|
@@ -2493,14 +2372,14 @@ function LibraryAddIcon(props) {
|
|
|
2493
2372
|
|
|
2494
2373
|
// src/components/InputMessage/InputMessage.tsx
|
|
2495
2374
|
var import_jsx_runtime157 = require("react/jsx-runtime");
|
|
2496
|
-
var InputMessageWrapper =
|
|
2375
|
+
var InputMessageWrapper = import_styled_components6.default.div.withConfig({
|
|
2497
2376
|
shouldForwardProp: (prop) => prop !== "messageType"
|
|
2498
2377
|
})`
|
|
2499
2378
|
display: flex;
|
|
2500
2379
|
width: fit-content;
|
|
2501
2380
|
word-break: break-word;
|
|
2502
2381
|
max-width: 100%;
|
|
2503
|
-
${({ messageType }) => messageType === "error" ?
|
|
2382
|
+
${({ messageType }) => messageType === "error" ? import_styled_components6.css`
|
|
2504
2383
|
color: ${inputMessageTokens.message.error.color};
|
|
2505
2384
|
background-color: ${inputMessageTokens.message.error.backgroundColor};
|
|
2506
2385
|
padding: ${inputMessageTokens.message.error.padding};
|
|
@@ -2568,7 +2447,7 @@ var calculateHeightWithLineHeight = (lineHeight, fontSize) => {
|
|
|
2568
2447
|
|
|
2569
2448
|
// src/components/Typography/Typography/Typography.tsx
|
|
2570
2449
|
var import_jsx_runtime159 = require("react/jsx-runtime");
|
|
2571
|
-
var StyledTypography =
|
|
2450
|
+
var StyledTypography = import_styled_components7.default.p.withConfig({
|
|
2572
2451
|
shouldForwardProp: (prop) => {
|
|
2573
2452
|
const styleOnlyProps = [
|
|
2574
2453
|
"externalLink",
|
|
@@ -2590,19 +2469,19 @@ var StyledTypography = import_styled_components8.default.p.withConfig({
|
|
|
2590
2469
|
${selection}
|
|
2591
2470
|
}
|
|
2592
2471
|
|
|
2593
|
-
${({ typographyType: typographyType7, externalLink, interactionProps }) => typographyType7 === "a" ?
|
|
2472
|
+
${({ typographyType: typographyType7, externalLink, interactionProps }) => typographyType7 === "a" ? import_styled_components7.css`
|
|
2594
2473
|
${getAnchorStyling(externalLink, interactionProps)}
|
|
2595
|
-
` :
|
|
2474
|
+
` : import_styled_components7.css`
|
|
2596
2475
|
color: ${typographyTokens.typographyType[typographyType7].base.color};
|
|
2597
2476
|
${typographyTokens.typographyType[typographyType7].base.font};
|
|
2598
2477
|
`}
|
|
2599
2478
|
|
|
2600
|
-
${({ interactionProps }) => (interactionProps == null ? void 0 : interactionProps.hover) &&
|
|
2479
|
+
${({ interactionProps }) => (interactionProps == null ? void 0 : interactionProps.hover) && import_styled_components7.css`
|
|
2601
2480
|
&:hover {
|
|
2602
2481
|
${interactionProps.hover}
|
|
2603
2482
|
}
|
|
2604
2483
|
`}
|
|
2605
|
-
${({ interactionProps }) => (interactionProps == null ? void 0 : interactionProps.active) &&
|
|
2484
|
+
${({ interactionProps }) => (interactionProps == null ? void 0 : interactionProps.active) && import_styled_components7.css`
|
|
2606
2485
|
&:active {
|
|
2607
2486
|
${interactionProps.active}
|
|
2608
2487
|
}
|
|
@@ -2759,9 +2638,9 @@ Legend.displayName = "Legend";
|
|
|
2759
2638
|
|
|
2760
2639
|
// src/components/Typography/Link/Link.tsx
|
|
2761
2640
|
var import_react7 = require("react");
|
|
2762
|
-
var
|
|
2641
|
+
var import_styled_components8 = __toESM(require("styled-components"));
|
|
2763
2642
|
var import_jsx_runtime164 = require("react/jsx-runtime");
|
|
2764
|
-
var StyledLink =
|
|
2643
|
+
var StyledLink = import_styled_components8.default.a`
|
|
2765
2644
|
${({ $external, $typographyType, $withMargins }) => getAnchorStyling($external, void 0, $typographyType, $withMargins)}
|
|
2766
2645
|
`;
|
|
2767
2646
|
var Link = (0, import_react7.forwardRef)((props, ref) => {
|
|
@@ -2814,89 +2693,209 @@ var Paragraph = (0, import_react8.forwardRef)(
|
|
|
2814
2693
|
);
|
|
2815
2694
|
Paragraph.displayName = "Paragraph";
|
|
2816
2695
|
|
|
2817
|
-
// src/components/helpers/
|
|
2818
|
-
var
|
|
2819
|
-
var
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
border-color: ${input2.base.borderColor};
|
|
2825
|
-
background-color: ${input2.base.backgroundColor};
|
|
2826
|
-
padding: ${input2.base.padding};
|
|
2827
|
-
width: 100%;
|
|
2828
|
-
margin: 0;
|
|
2829
|
-
box-sizing: border-box;
|
|
2830
|
-
box-shadow: none;
|
|
2831
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
2832
|
-
transition:
|
|
2833
|
-
box-shadow 0.2s,
|
|
2834
|
-
border-color 0.2s,
|
|
2835
|
-
background-color 0.2s;
|
|
2836
|
-
}
|
|
2837
|
-
&[type='text'],
|
|
2838
|
-
&[type='password'],
|
|
2839
|
-
&[type='number'],
|
|
2840
|
-
&[type='tel'],
|
|
2841
|
-
&[type='date'],
|
|
2842
|
-
&[type='url'],
|
|
2843
|
-
&[type='email'],
|
|
2844
|
-
&[type='search'],
|
|
2845
|
-
&[type='datetime-local'] {
|
|
2846
|
-
-webkit-appearance: none;
|
|
2847
|
-
}
|
|
2848
|
-
&::selection {
|
|
2849
|
-
${selection}
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2852
|
-
&:not(.disabled):not(.read-only):not(.active):hover,
|
|
2853
|
-
&:hover:enabled:read-write {
|
|
2854
|
-
${hoverInputfield}
|
|
2855
|
-
}
|
|
2856
|
-
&:not(.disabled):not(.read-only):focus-within,
|
|
2857
|
-
&.active,
|
|
2858
|
-
&:focus:enabled:read-write,
|
|
2859
|
-
&:active:enabled:read-write {
|
|
2860
|
-
${focusInputfield}
|
|
2861
|
-
}
|
|
2862
|
-
`;
|
|
2863
|
-
var StatefulInput = (0, import_styled_components10.default)(Input).withConfig({
|
|
2864
|
-
shouldForwardProp: (prop) => {
|
|
2865
|
-
const stylingProps = [
|
|
2866
|
-
"componentSize",
|
|
2867
|
-
"hasErrorMessage",
|
|
2868
|
-
"prefixLength",
|
|
2869
|
-
"suffixLength"
|
|
2870
|
-
];
|
|
2871
|
-
return !stylingProps.some((styleProp) => styleProp === prop);
|
|
2872
|
-
}
|
|
2873
|
-
})`
|
|
2874
|
-
-webkit-appearance: textfield;
|
|
2696
|
+
// src/components/helpers/styling/danger.tsx
|
|
2697
|
+
var import_dds_design_tokens7 = require("@norges-domstoler/dds-design-tokens");
|
|
2698
|
+
var { colors: Colors } = import_dds_design_tokens7.ddsBaseTokens;
|
|
2699
|
+
var dangerInputfield = {
|
|
2700
|
+
borderColor: Colors.DdsColorDangerBase,
|
|
2701
|
+
boxShadow: `0 0 0 1px ${Colors.DdsColorDangerBase}`
|
|
2702
|
+
};
|
|
2875
2703
|
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2704
|
+
// src/components/helpers/styling/focus.tsx
|
|
2705
|
+
var import_dds_design_tokens8 = require("@norges-domstoler/dds-design-tokens");
|
|
2706
|
+
var { border: border3 } = import_dds_design_tokens8.ddsBaseTokens;
|
|
2707
|
+
var focusInputfield = {
|
|
2708
|
+
outline: "none",
|
|
2709
|
+
borderColor: border3.BordersDdsBorderFocusInputfieldStroke,
|
|
2710
|
+
boxShadow: `0 0 0 2px ${border3.BordersDdsBorderFocusInputfieldStroke}`
|
|
2711
|
+
};
|
|
2712
|
+
var focusDangerInputfield = {
|
|
2713
|
+
borderColor: border3.BordersDdsBorderFocusInputfieldStroke,
|
|
2714
|
+
boxShadow: `0 0 0 2px ${border3.BordersDdsBorderFocusInputfieldStroke}`
|
|
2715
|
+
};
|
|
2882
2716
|
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2717
|
+
// src/components/helpers/styling/focusVisible.tsx
|
|
2718
|
+
var import_dds_design_tokens9 = require("@norges-domstoler/dds-design-tokens");
|
|
2719
|
+
var { border: Border, spacing: spacing4 } = import_dds_design_tokens9.ddsBaseTokens;
|
|
2720
|
+
var outlineOffset = spacing4.SizesDdsSpacingX0125;
|
|
2721
|
+
var focusVisible = {
|
|
2722
|
+
outline: `${Border.BordersDdsBorderFocusBaseStrokeWeight} ${Border.BordersDdsBorderFocusBaseStroke} solid`,
|
|
2723
|
+
outlineOffset
|
|
2724
|
+
};
|
|
2725
|
+
var focusVisibleOnDark = {
|
|
2726
|
+
outline: `${Border.BordersDdsBorderFocusOndarkStrokeWeight} ${Border.BordersDdsBorderFocusOndarkStroke} solid`,
|
|
2727
|
+
outlineOffset
|
|
2728
|
+
};
|
|
2729
|
+
var focusVisibleTransitionValue = "outline-offset 0.2s";
|
|
2730
|
+
var focusVisibleWithBorder = {
|
|
2731
|
+
outline: "none",
|
|
2732
|
+
borderColor: Border.BordersDdsBorderFocusCardStroke,
|
|
2733
|
+
boxShadow: `inset 0 0 0 1px ${Border.BordersDdsBorderFocusCardStroke}`
|
|
2734
|
+
};
|
|
2735
|
+
var focusVisibleThickWithBorderOnDark = {
|
|
2736
|
+
outline: "none",
|
|
2737
|
+
borderColor: Border.BordersDdsBorderFocusOndarkStroke,
|
|
2738
|
+
boxShadow: `inset 0 0 0 1px ${Border.BordersDdsBorderFocusOndarkStroke}`
|
|
2739
|
+
};
|
|
2740
|
+
var focusVisibleInset = {
|
|
2741
|
+
outline: "none",
|
|
2742
|
+
boxShadow: `inset 0 0 0 2px ${Border.BordersDdsBorderFocusCardStroke}`
|
|
2743
|
+
};
|
|
2744
|
+
|
|
2745
|
+
// src/components/helpers/styling/hideInput.tsx
|
|
2746
|
+
var hideInput = {
|
|
2747
|
+
clip: "rect(0 0 0 0)",
|
|
2748
|
+
position: "absolute",
|
|
2749
|
+
height: "1px",
|
|
2750
|
+
width: "1px",
|
|
2751
|
+
margin: 0
|
|
2752
|
+
};
|
|
2753
|
+
|
|
2754
|
+
// src/components/helpers/styling/hover.tsx
|
|
2755
|
+
var import_dds_design_tokens10 = require("@norges-domstoler/dds-design-tokens");
|
|
2756
|
+
var { border: Border2, colors: Colors2 } = import_dds_design_tokens10.ddsBaseTokens;
|
|
2757
|
+
var hoverWithBorder = {
|
|
2758
|
+
borderColor: Border2.BordersDdsBorderFocusInputfieldStroke,
|
|
2759
|
+
boxShadow: `inset 0 0 0 1px ${Border2.BordersDdsBorderFocusInputfieldStroke}`
|
|
2760
|
+
};
|
|
2761
|
+
var hoverInputfield = {
|
|
2762
|
+
borderColor: Border2.BordersDdsBorderFocusInputfieldStroke,
|
|
2763
|
+
boxShadow: `0 0 0 1px ${Border2.BordersDdsBorderFocusInputfieldStroke}`
|
|
2764
|
+
};
|
|
2765
|
+
var hoverDangerInputfield = {
|
|
2766
|
+
borderColor: Colors2.DdsColorDangerBase,
|
|
2767
|
+
boxShadow: `0 0 0 1px ${Colors2.DdsColorDangerBase}`
|
|
2768
|
+
};
|
|
2769
|
+
|
|
2770
|
+
// src/components/helpers/styling/normalize.tsx
|
|
2771
|
+
var normalizeButton = {
|
|
2772
|
+
margin: 0,
|
|
2773
|
+
textTransform: "none"
|
|
2774
|
+
};
|
|
2775
|
+
|
|
2776
|
+
// src/components/helpers/styling/removeButtonStyling.tsx
|
|
2777
|
+
var removeButtonStyling = {
|
|
2778
|
+
background: "none",
|
|
2779
|
+
color: "inherit",
|
|
2780
|
+
border: "none",
|
|
2781
|
+
padding: 0,
|
|
2782
|
+
font: "inherit",
|
|
2783
|
+
cursor: "pointer",
|
|
2784
|
+
outline: "inherit"
|
|
2785
|
+
};
|
|
2786
|
+
|
|
2787
|
+
// src/components/helpers/styling/removeListStyling.tsx
|
|
2788
|
+
var removeListStyling = {
|
|
2789
|
+
listStyle: "none",
|
|
2790
|
+
padding: 0,
|
|
2791
|
+
margin: 0
|
|
2792
|
+
};
|
|
2793
|
+
|
|
2794
|
+
// src/components/helpers/styling/selection.tsx
|
|
2795
|
+
var import_dds_design_tokens11 = require("@norges-domstoler/dds-design-tokens");
|
|
2796
|
+
var { colors: colors6 } = import_dds_design_tokens11.ddsBaseTokens;
|
|
2797
|
+
var selection = {
|
|
2798
|
+
color: colors6.DdsColorNeutralsGray9,
|
|
2799
|
+
backgroundColor: colors6.DdsColorTertiaryLightest
|
|
2800
|
+
};
|
|
2801
|
+
|
|
2802
|
+
// src/components/helpers/styling/visibilityTransition.tsx
|
|
2803
|
+
var import_styled_components9 = require("styled-components");
|
|
2804
|
+
var visibilityTransition = (open) => {
|
|
2805
|
+
return import_styled_components9.css`
|
|
2806
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
2807
|
+
transition:
|
|
2808
|
+
visibility 0.4s,
|
|
2809
|
+
opacity 0.2s;
|
|
2810
|
+
}
|
|
2811
|
+
visibility: ${open ? "visible" : "hidden"};
|
|
2812
|
+
opacity: ${open ? 1 : 0};
|
|
2813
|
+
`;
|
|
2814
|
+
};
|
|
2815
|
+
|
|
2816
|
+
// src/components/helpers/Input/Input.styles.tsx
|
|
2817
|
+
var { input: input2, container: container2 } = inputTokens;
|
|
2818
|
+
var Input = import_styled_components10.default.input`
|
|
2819
|
+
position: relative;
|
|
2820
|
+
color: ${input2.base.color};
|
|
2821
|
+
border-radius: ${input2.base.borderRadius};
|
|
2822
|
+
border: ${input2.base.border};
|
|
2823
|
+
border-color: ${input2.base.borderColor};
|
|
2824
|
+
background-color: ${input2.base.backgroundColor};
|
|
2825
|
+
padding: ${input2.base.padding};
|
|
2826
|
+
width: 100%;
|
|
2827
|
+
margin: 0;
|
|
2828
|
+
box-sizing: border-box;
|
|
2829
|
+
box-shadow: none;
|
|
2830
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
2831
|
+
transition:
|
|
2832
|
+
box-shadow 0.2s,
|
|
2833
|
+
border-color 0.2s,
|
|
2834
|
+
background-color 0.2s;
|
|
2835
|
+
}
|
|
2836
|
+
&[type='text'],
|
|
2837
|
+
&[type='password'],
|
|
2838
|
+
&[type='number'],
|
|
2839
|
+
&[type='tel'],
|
|
2840
|
+
&[type='date'],
|
|
2841
|
+
&[type='url'],
|
|
2842
|
+
&[type='email'],
|
|
2843
|
+
&[type='search'],
|
|
2844
|
+
&[type='datetime-local'] {
|
|
2845
|
+
-webkit-appearance: none;
|
|
2846
|
+
}
|
|
2847
|
+
&::selection {
|
|
2848
|
+
${selection}
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
&:not(.disabled):not(.read-only):not(.active):hover,
|
|
2852
|
+
&:hover:enabled:read-write {
|
|
2853
|
+
${hoverInputfield}
|
|
2854
|
+
}
|
|
2855
|
+
&:not(.disabled):not(.read-only):focus-within,
|
|
2856
|
+
&.active,
|
|
2857
|
+
&:focus:enabled:read-write,
|
|
2858
|
+
&:active:enabled:read-write {
|
|
2859
|
+
${focusInputfield}
|
|
2860
|
+
}
|
|
2861
|
+
`;
|
|
2862
|
+
var StatefulInput = (0, import_styled_components10.default)(Input).withConfig({
|
|
2863
|
+
shouldForwardProp: (prop) => {
|
|
2864
|
+
const stylingProps = [
|
|
2865
|
+
"componentSize",
|
|
2866
|
+
"hasErrorMessage",
|
|
2867
|
+
"prefixLength",
|
|
2868
|
+
"suffixLength"
|
|
2869
|
+
];
|
|
2870
|
+
return !stylingProps.some((styleProp) => styleProp === prop);
|
|
2871
|
+
}
|
|
2872
|
+
})`
|
|
2873
|
+
-webkit-appearance: textfield;
|
|
2874
|
+
|
|
2875
|
+
padding-left: ${({ prefixLength, readOnly }) => prefixLength && (readOnly ? `${prefixLength}px !important` : `calc(${input2.affix.gap}px + ${prefixLength}px) !important`)};
|
|
2876
|
+
padding-right: ${({ suffixLength, readOnly }) => suffixLength && (readOnly ? `${suffixLength}px !important` : `calc(${input2.affix.gap}px + ${suffixLength}px) !important`)};
|
|
2877
|
+
${({ componentSize }) => componentSize && import_styled_components10.css`
|
|
2878
|
+
padding: ${input2.sizes[componentSize].padding};
|
|
2879
|
+
${getFontStyling(inputTypographyTypes[componentSize])}
|
|
2880
|
+
`}
|
|
2881
|
+
|
|
2882
|
+
${({ hasErrorMessage }) => hasErrorMessage && import_styled_components10.css`
|
|
2883
|
+
${dangerInputfield}
|
|
2884
|
+
&:not(.disabled):hover,
|
|
2885
|
+
&:hover:enabled:read-write {
|
|
2886
|
+
${hoverDangerInputfield}
|
|
2887
|
+
}
|
|
2888
|
+
&:not(.disabled):focus-within,
|
|
2889
|
+
&:focus-within:enabled:read-write,
|
|
2890
|
+
&:active:enabled:read-write {
|
|
2891
|
+
${focusDangerInputfield}
|
|
2892
|
+
}
|
|
2893
|
+
`}
|
|
2894
|
+
&:not(.disabled).read-only,
|
|
2895
|
+
&:enabled:read-only {
|
|
2896
|
+
border: none;
|
|
2897
|
+
outline: none;
|
|
2898
|
+
cursor: default;
|
|
2900
2899
|
background-color: ${input2.readOnly.backgroundColor};
|
|
2901
2900
|
padding-left: 0;
|
|
2902
2901
|
}
|
|
@@ -2933,6 +2932,7 @@ function getDefaultText(value, defaultValue) {
|
|
|
2933
2932
|
}
|
|
2934
2933
|
|
|
2935
2934
|
// src/components/helpers/Paper/Paper.tsx
|
|
2935
|
+
var import_dds_design_tokens13 = require("@norges-domstoler/dds-design-tokens");
|
|
2936
2936
|
var import_styled_components11 = __toESM(require("styled-components"));
|
|
2937
2937
|
|
|
2938
2938
|
// src/components/helpers/Paper/Paper.tokens.tsx
|
|
@@ -2948,7 +2948,6 @@ var paperTokens = {
|
|
|
2948
2948
|
};
|
|
2949
2949
|
|
|
2950
2950
|
// src/components/helpers/Paper/Paper.tsx
|
|
2951
|
-
var import_dds_design_tokens13 = require("@norges-domstoler/dds-design-tokens");
|
|
2952
2951
|
var { outerShadow, border: border4 } = import_dds_design_tokens13.ddsBaseTokens;
|
|
2953
2952
|
var getElevation = (elevation) => {
|
|
2954
2953
|
switch (elevation) {
|
|
@@ -2989,8 +2988,8 @@ var Paper = import_styled_components11.default.div.withConfig({
|
|
|
2989
2988
|
`;
|
|
2990
2989
|
|
|
2991
2990
|
// src/components/helpers/RequiredMarker/RequiredMarker.tsx
|
|
2992
|
-
var import_styled_components12 = __toESM(require("styled-components"));
|
|
2993
2991
|
var import_dds_design_tokens14 = require("@norges-domstoler/dds-design-tokens");
|
|
2992
|
+
var import_styled_components12 = __toESM(require("styled-components"));
|
|
2994
2993
|
var import_jsx_runtime166 = require("react/jsx-runtime");
|
|
2995
2994
|
var MarkerWrapper = import_styled_components12.default.span`
|
|
2996
2995
|
color: ${import_dds_design_tokens14.ddsBaseTokens.colors.DdsColorDangerBase};
|
|
@@ -3273,16 +3272,16 @@ function useRoveFocus(size2, reset, direction = "column") {
|
|
|
3273
3272
|
}
|
|
3274
3273
|
|
|
3275
3274
|
// src/hooks/useScreenSize.tsx
|
|
3276
|
-
var import_react17 = require("react");
|
|
3277
3275
|
var import_dds_design_tokens16 = require("@norges-domstoler/dds-design-tokens");
|
|
3276
|
+
var import_react17 = require("react");
|
|
3278
3277
|
var { breakpoints } = import_dds_design_tokens16.ddsBaseTokens;
|
|
3279
|
-
var ScreenSize = /* @__PURE__ */ ((
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
return
|
|
3278
|
+
var ScreenSize = /* @__PURE__ */ ((ScreenSize2) => {
|
|
3279
|
+
ScreenSize2[ScreenSize2["XSmall"] = 0] = "XSmall";
|
|
3280
|
+
ScreenSize2[ScreenSize2["Small"] = 1] = "Small";
|
|
3281
|
+
ScreenSize2[ScreenSize2["Medium"] = 2] = "Medium";
|
|
3282
|
+
ScreenSize2[ScreenSize2["Large"] = 3] = "Large";
|
|
3283
|
+
ScreenSize2[ScreenSize2["XLarge"] = 4] = "XLarge";
|
|
3284
|
+
return ScreenSize2;
|
|
3286
3285
|
})(ScreenSize || {});
|
|
3287
3286
|
var screenSizesAndMediaQueries = [
|
|
3288
3287
|
[
|
|
@@ -3341,6 +3340,7 @@ var getLiteralScreenSize = (screenSize) => {
|
|
|
3341
3340
|
};
|
|
3342
3341
|
|
|
3343
3342
|
// src/components/AppShell/AppShell.tsx
|
|
3343
|
+
var import_development_utils3 = require("@norges-domstoler/development-utils");
|
|
3344
3344
|
var import_styled_components24 = __toESM(require("styled-components"));
|
|
3345
3345
|
|
|
3346
3346
|
// src/components/AppShell/AppShell.tokens.ts
|
|
@@ -3410,95 +3410,48 @@ var floatingActionButtons = {
|
|
|
3410
3410
|
};
|
|
3411
3411
|
var appShellTokens = { navigation, floatingActionButtons };
|
|
3412
3412
|
|
|
3413
|
-
// src/components/AppShell/
|
|
3414
|
-
var import_react27 = require("react");
|
|
3415
|
-
var import_styled_components23 = __toESM(require("styled-components"));
|
|
3416
|
-
|
|
3417
|
-
// src/components/Divider/Divider.tsx
|
|
3413
|
+
// src/components/AppShell/AppShellContext.tsx
|
|
3418
3414
|
var import_react18 = require("react");
|
|
3419
|
-
var import_styled_components13 = __toESM(require("styled-components"));
|
|
3420
|
-
|
|
3421
|
-
// src/components/Divider/Divider.tokens.tsx
|
|
3422
|
-
var import_dds_design_tokens18 = require("@norges-domstoler/dds-design-tokens");
|
|
3423
|
-
var { border: border5, spacing: spacing6 } = import_dds_design_tokens18.ddsBaseTokens;
|
|
3424
|
-
var divider = {
|
|
3425
|
-
borderTop: `${border5.BordersDdsBorderStyleLightStrokeWeight} solid`,
|
|
3426
|
-
marginTop: spacing6.SizesDdsSpacingX1,
|
|
3427
|
-
marginBottom: spacing6.SizesDdsSpacingX1,
|
|
3428
|
-
color: {
|
|
3429
|
-
primary: {
|
|
3430
|
-
borderColor: border5.BordersDdsBorderStyleDarkStroke
|
|
3431
|
-
},
|
|
3432
|
-
primaryLighter: {
|
|
3433
|
-
borderColor: border5.BordersDdsBorderStyleLightStroke
|
|
3434
|
-
}
|
|
3435
|
-
}
|
|
3436
|
-
};
|
|
3437
|
-
var dividerTokens = {
|
|
3438
|
-
...divider
|
|
3439
|
-
};
|
|
3440
|
-
|
|
3441
|
-
// src/components/Divider/Divider.tsx
|
|
3442
3415
|
var import_jsx_runtime167 = require("react/jsx-runtime");
|
|
3443
|
-
var
|
|
3444
|
-
border: 0;
|
|
3445
|
-
background-color: transparent;
|
|
3446
|
-
border-top: ${dividerTokens.borderTop};
|
|
3447
|
-
margin-top: ${dividerTokens.marginTop};
|
|
3448
|
-
margin-bottom: ${dividerTokens.marginBottom};
|
|
3449
|
-
${({ color }) => color && import_styled_components13.css`
|
|
3450
|
-
border-color: ${dividerTokens.color[color].borderColor};
|
|
3451
|
-
`}
|
|
3452
|
-
`;
|
|
3453
|
-
var Divider = (0, import_react18.forwardRef)((props, ref) => {
|
|
3454
|
-
const { color = "primary", id, className, htmlProps, ...rest } = props;
|
|
3455
|
-
const lineProps = {
|
|
3456
|
-
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
3457
|
-
color
|
|
3458
|
-
};
|
|
3459
|
-
return /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(StyledDivider, { ref, ...lineProps });
|
|
3460
|
-
});
|
|
3461
|
-
Divider.displayName = "Divider";
|
|
3462
|
-
|
|
3463
|
-
// src/components/AppShell/Navigation/NavigationItem.tsx
|
|
3464
|
-
var import_styled_components14 = __toESM(require("styled-components"));
|
|
3465
|
-
|
|
3466
|
-
// src/components/AppShell/AppShellContext.tsx
|
|
3467
|
-
var import_react19 = require("react");
|
|
3468
|
-
var import_jsx_runtime168 = require("react/jsx-runtime");
|
|
3469
|
-
var AppShellContext = (0, import_react19.createContext)({
|
|
3416
|
+
var AppShellContext = (0, import_react18.createContext)({
|
|
3470
3417
|
isOpen: false,
|
|
3471
3418
|
setOpen: () => null
|
|
3472
3419
|
});
|
|
3473
3420
|
var AppShellContextProvider = ({
|
|
3474
3421
|
children
|
|
3475
3422
|
}) => {
|
|
3476
|
-
const [isOpen, setOpen] = (0,
|
|
3477
|
-
return /* @__PURE__ */ (0,
|
|
3423
|
+
const [isOpen, setOpen] = (0, import_react18.useState)(false);
|
|
3424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(AppShellContext.Provider, { value: { isOpen, setOpen }, children });
|
|
3478
3425
|
};
|
|
3479
3426
|
var useAppShellContext = () => {
|
|
3480
|
-
return (0,
|
|
3427
|
+
return (0, import_react18.useContext)(AppShellContext);
|
|
3481
3428
|
};
|
|
3482
3429
|
|
|
3430
|
+
// src/components/AppShell/Navigation/Navigation.tsx
|
|
3431
|
+
var import_development_utils2 = require("@norges-domstoler/development-utils");
|
|
3432
|
+
var import_react27 = require("react");
|
|
3433
|
+
var import_styled_components23 = __toESM(require("styled-components"));
|
|
3434
|
+
|
|
3483
3435
|
// src/components/AppShell/Navigation/NavigationItem.tsx
|
|
3484
|
-
var
|
|
3436
|
+
var import_styled_components13 = __toESM(require("styled-components"));
|
|
3437
|
+
var import_jsx_runtime168 = require("react/jsx-runtime");
|
|
3485
3438
|
var { navigation: navTokens } = appShellTokens;
|
|
3486
3439
|
var navItemTokens = navTokens.navigationItems.item;
|
|
3487
|
-
var IconContainer =
|
|
3440
|
+
var IconContainer = import_styled_components13.default.div`
|
|
3488
3441
|
grid-area: icon;
|
|
3489
3442
|
display: flex;
|
|
3490
3443
|
align-items: center;
|
|
3491
3444
|
`;
|
|
3492
|
-
var TextContainer =
|
|
3445
|
+
var TextContainer = import_styled_components13.default.span`
|
|
3493
3446
|
grid-area: text;
|
|
3494
3447
|
`;
|
|
3495
|
-
var ChevronContainer =
|
|
3448
|
+
var ChevronContainer = import_styled_components13.default.div`
|
|
3496
3449
|
display: flex;
|
|
3497
3450
|
align-items: center;
|
|
3498
3451
|
opacity: 0;
|
|
3499
3452
|
grid-area: chevron;
|
|
3500
3453
|
`;
|
|
3501
|
-
var BaseLink =
|
|
3454
|
+
var BaseLink = import_styled_components13.default.a`
|
|
3502
3455
|
padding: ${navItemTokens.padding};
|
|
3503
3456
|
gap: ${navItemTokens.gap};
|
|
3504
3457
|
border-radius: ${navItemTokens.borderRadius};
|
|
@@ -3521,7 +3474,7 @@ var BaseLink = import_styled_components14.default.a`
|
|
|
3521
3474
|
background-color: ${navItemTokens.active.backgroundColor};
|
|
3522
3475
|
}
|
|
3523
3476
|
`;
|
|
3524
|
-
var InternalNavItem = (0,
|
|
3477
|
+
var InternalNavItem = (0, import_styled_components13.default)(BaseLink)`
|
|
3525
3478
|
display: grid;
|
|
3526
3479
|
align-items: center;
|
|
3527
3480
|
grid-template-areas: 'icon text chevron';
|
|
@@ -3531,7 +3484,7 @@ var InternalNavItem = (0, import_styled_components14.default)(BaseLink)`
|
|
|
3531
3484
|
opacity: 1;
|
|
3532
3485
|
}
|
|
3533
3486
|
`;
|
|
3534
|
-
var ExternalNavItem = (0,
|
|
3487
|
+
var ExternalNavItem = (0, import_styled_components13.default)(BaseLink)`
|
|
3535
3488
|
display: flex;
|
|
3536
3489
|
flex-direction: row;
|
|
3537
3490
|
align-items: center;
|
|
@@ -3559,12 +3512,12 @@ var NavigationItem = ({
|
|
|
3559
3512
|
setOpen(false);
|
|
3560
3513
|
};
|
|
3561
3514
|
if (external) {
|
|
3562
|
-
return /* @__PURE__ */ (0,
|
|
3515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)(ExternalNavItem, { as: Comp, ...rest, onClick, children: [
|
|
3563
3516
|
children,
|
|
3564
|
-
/* @__PURE__ */ (0,
|
|
3517
|
+
/* @__PURE__ */ (0, import_jsx_runtime168.jsx)(Icon, { icon: OpenExternalIcon, iconSize: "inherit" })
|
|
3565
3518
|
] });
|
|
3566
3519
|
}
|
|
3567
|
-
return /* @__PURE__ */ (0,
|
|
3520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)(
|
|
3568
3521
|
InternalNavItem,
|
|
3569
3522
|
{
|
|
3570
3523
|
as: Comp,
|
|
@@ -3572,37 +3525,17 @@ var NavigationItem = ({
|
|
|
3572
3525
|
onClick,
|
|
3573
3526
|
className: [active ? "active" : "", rest.className].join(" "),
|
|
3574
3527
|
children: [
|
|
3575
|
-
/* @__PURE__ */ (0,
|
|
3576
|
-
/* @__PURE__ */ (0,
|
|
3577
|
-
/* @__PURE__ */ (0,
|
|
3528
|
+
/* @__PURE__ */ (0, import_jsx_runtime168.jsx)(IconContainer, { children: icon12 && /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(Icon, { icon: icon12 }) }),
|
|
3529
|
+
/* @__PURE__ */ (0, import_jsx_runtime168.jsx)(TextContainer, { children }),
|
|
3530
|
+
/* @__PURE__ */ (0, import_jsx_runtime168.jsx)(ChevronContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(Icon, { icon: ChevronRightIcon }) })
|
|
3578
3531
|
]
|
|
3579
3532
|
}
|
|
3580
3533
|
);
|
|
3581
3534
|
};
|
|
3582
3535
|
NavigationItem.displayName = "AppShell.NavItem";
|
|
3583
3536
|
|
|
3584
|
-
// src/components/AppShell/Navigation/TopBar.tsx
|
|
3585
|
-
var import_styled_components22 = __toESM(require("styled-components"));
|
|
3586
|
-
var import_development_utils = require("@norges-domstoler/development-utils");
|
|
3587
|
-
|
|
3588
|
-
// src/components/AppShell/Navigation/EmbeteIcon.tsx
|
|
3589
|
-
var import_jsx_runtime170 = require("react/jsx-runtime");
|
|
3590
|
-
var EmbeteIcon = ({ type, ...rest }) => {
|
|
3591
|
-
switch (type) {
|
|
3592
|
-
case "jordskifterett":
|
|
3593
|
-
return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(JordskifterettIcon, { ...rest });
|
|
3594
|
-
case "tingrett":
|
|
3595
|
-
return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(TingrettIcon, { ...rest });
|
|
3596
|
-
case "lagmannsrett":
|
|
3597
|
-
return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(LagmannsrettIcon, { ...rest });
|
|
3598
|
-
case "h\xF8yesterett":
|
|
3599
|
-
case void 0:
|
|
3600
|
-
return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(PersonIcon, { ...rest });
|
|
3601
|
-
}
|
|
3602
|
-
};
|
|
3603
|
-
|
|
3604
3537
|
// src/components/AppShell/Navigation/NavigationLogo.tsx
|
|
3605
|
-
var
|
|
3538
|
+
var import_styled_components14 = __toESM(require("styled-components"));
|
|
3606
3539
|
var { navigation: navTokens2 } = appShellTokens;
|
|
3607
3540
|
var fontPackage = (small) => {
|
|
3608
3541
|
if (small) {
|
|
@@ -3610,7 +3543,7 @@ var fontPackage = (small) => {
|
|
|
3610
3543
|
}
|
|
3611
3544
|
return navTokens2.logoAndVersion.logo;
|
|
3612
3545
|
};
|
|
3613
|
-
var NavigationLogo =
|
|
3546
|
+
var NavigationLogo = import_styled_components14.default.a.withConfig({
|
|
3614
3547
|
shouldForwardProp: (prop) => prop !== "small"
|
|
3615
3548
|
})`
|
|
3616
3549
|
font-size: ${({ small }) => fontPackage(small).fontSize};
|
|
@@ -3622,12 +3555,35 @@ var NavigationLogo = import_styled_components15.default.a.withConfig({
|
|
|
3622
3555
|
text-align: middle;
|
|
3623
3556
|
`;
|
|
3624
3557
|
|
|
3625
|
-
// src/components/
|
|
3626
|
-
var
|
|
3558
|
+
// src/components/AppShell/Navigation/TopBar.tsx
|
|
3559
|
+
var import_development_utils = require("@norges-domstoler/development-utils");
|
|
3560
|
+
var import_styled_components22 = __toESM(require("styled-components"));
|
|
3561
|
+
|
|
3562
|
+
// src/components/AppShell/Navigation/EmbeteIcon.tsx
|
|
3563
|
+
var import_jsx_runtime169 = require("react/jsx-runtime");
|
|
3564
|
+
var EmbeteIcon = ({ type, ...rest }) => {
|
|
3565
|
+
switch (type) {
|
|
3566
|
+
case "jordskifterett":
|
|
3567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(JordskifterettIcon, { ...rest });
|
|
3568
|
+
case "tingrett":
|
|
3569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(TingrettIcon, { ...rest });
|
|
3570
|
+
case "lagmannsrett":
|
|
3571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(LagmannsrettIcon, { ...rest });
|
|
3572
|
+
case "h\xF8yesterett":
|
|
3573
|
+
case void 0:
|
|
3574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(PersonIcon, { ...rest });
|
|
3575
|
+
}
|
|
3576
|
+
};
|
|
3577
|
+
|
|
3578
|
+
// src/components/Button/Button.tsx
|
|
3579
|
+
var import_react20 = require("react");
|
|
3580
|
+
|
|
3581
|
+
// src/components/Button/Button.styles.tsx
|
|
3582
|
+
var import_styled_components15 = __toESM(require("styled-components"));
|
|
3627
3583
|
|
|
3628
3584
|
// src/components/Button/Button.tokens.tsx
|
|
3629
|
-
var
|
|
3630
|
-
var { colors: colors9, border:
|
|
3585
|
+
var import_dds_design_tokens18 = require("@norges-domstoler/dds-design-tokens");
|
|
3586
|
+
var { colors: colors9, border: border5, spacing: spacing6, fontPackages: fontPackages3, borderRadius: borderRadius3, outerShadow: outerShadow2 } = import_dds_design_tokens18.ddsBaseTokens;
|
|
3631
3587
|
var typographyTypes = {
|
|
3632
3588
|
large: "bodySans04",
|
|
3633
3589
|
medium: "bodySans02",
|
|
@@ -3650,7 +3606,7 @@ var iconSizeLargePx = calculateHeightWithLineHeight(
|
|
|
3650
3606
|
fontPackages3.body_sans_04.numbers.lineHeightNumber,
|
|
3651
3607
|
fontPackages3.body_sans_04.numbers.fontSizeNumber
|
|
3652
3608
|
);
|
|
3653
|
-
var svgOffset =
|
|
3609
|
+
var svgOffset = spacing6.SizesDdsSpacingX0125NumberPx;
|
|
3654
3610
|
var filledButtonColors = {
|
|
3655
3611
|
primary: {
|
|
3656
3612
|
base: {
|
|
@@ -3715,7 +3671,7 @@ var sizes = {
|
|
|
3715
3671
|
justIcon: {
|
|
3716
3672
|
icon: {
|
|
3717
3673
|
fontSize: `${iconSizeLargePx + svgOffset}px`,
|
|
3718
|
-
padding:
|
|
3674
|
+
padding: spacing6.SizesDdsSpacingX1
|
|
3719
3675
|
},
|
|
3720
3676
|
wrapper: {
|
|
3721
3677
|
height: `${iconSizeLargePx}px`,
|
|
@@ -3723,15 +3679,15 @@ var sizes = {
|
|
|
3723
3679
|
}
|
|
3724
3680
|
},
|
|
3725
3681
|
text: {
|
|
3726
|
-
padding: `${
|
|
3682
|
+
padding: `${spacing6.SizesDdsSpacingX1} ${spacing6.SizesDdsSpacingX2NumberPx - 2}px`
|
|
3727
3683
|
},
|
|
3728
|
-
textAndIcon: { gap:
|
|
3684
|
+
textAndIcon: { gap: spacing6.SizesDdsSpacingX1 }
|
|
3729
3685
|
},
|
|
3730
3686
|
medium: {
|
|
3731
3687
|
justIcon: {
|
|
3732
3688
|
icon: {
|
|
3733
3689
|
fontSize: `${iconSizeMediumPx + svgOffset}px`,
|
|
3734
|
-
padding:
|
|
3690
|
+
padding: spacing6.SizesDdsSpacingX075
|
|
3735
3691
|
},
|
|
3736
3692
|
wrapper: {
|
|
3737
3693
|
height: `${iconSizeMediumPx}px`,
|
|
@@ -3739,15 +3695,15 @@ var sizes = {
|
|
|
3739
3695
|
}
|
|
3740
3696
|
},
|
|
3741
3697
|
text: {
|
|
3742
|
-
padding: `${
|
|
3698
|
+
padding: `${spacing6.SizesDdsSpacingX075} ${spacing6.SizesDdsSpacingX15NumberPx - 2}px`
|
|
3743
3699
|
},
|
|
3744
|
-
textAndIcon: { gap:
|
|
3700
|
+
textAndIcon: { gap: spacing6.SizesDdsSpacingX075 }
|
|
3745
3701
|
},
|
|
3746
3702
|
small: {
|
|
3747
3703
|
justIcon: {
|
|
3748
3704
|
icon: {
|
|
3749
3705
|
fontSize: `${iconSizeSmallPx + svgOffset}px`,
|
|
3750
|
-
padding:
|
|
3706
|
+
padding: spacing6.SizesDdsSpacingX05
|
|
3751
3707
|
},
|
|
3752
3708
|
wrapper: {
|
|
3753
3709
|
height: `${iconSizeSmallPx}px`,
|
|
@@ -3755,15 +3711,15 @@ var sizes = {
|
|
|
3755
3711
|
}
|
|
3756
3712
|
},
|
|
3757
3713
|
text: {
|
|
3758
|
-
padding: `${
|
|
3714
|
+
padding: `${spacing6.SizesDdsSpacingX05} ${spacing6.SizesDdsSpacingX1NumberPx - 2}px`
|
|
3759
3715
|
},
|
|
3760
|
-
textAndIcon: { gap:
|
|
3716
|
+
textAndIcon: { gap: spacing6.SizesDdsSpacingX05 }
|
|
3761
3717
|
},
|
|
3762
3718
|
tiny: {
|
|
3763
3719
|
justIcon: {
|
|
3764
3720
|
icon: {
|
|
3765
3721
|
fontSize: `${iconSizeTinyPx + svgOffset}px`,
|
|
3766
|
-
padding:
|
|
3722
|
+
padding: spacing6.SizesDdsSpacingX025
|
|
3767
3723
|
},
|
|
3768
3724
|
wrapper: {
|
|
3769
3725
|
height: `${iconSizeTinyPx}px`,
|
|
@@ -3771,9 +3727,9 @@ var sizes = {
|
|
|
3771
3727
|
}
|
|
3772
3728
|
},
|
|
3773
3729
|
text: {
|
|
3774
|
-
padding: `${
|
|
3730
|
+
padding: `${spacing6.SizesDdsSpacingX025} ${spacing6.SizesDdsSpacingX075}`
|
|
3775
3731
|
},
|
|
3776
|
-
textAndIcon: { gap:
|
|
3732
|
+
textAndIcon: { gap: spacing6.SizesDdsSpacingX05 }
|
|
3777
3733
|
}
|
|
3778
3734
|
};
|
|
3779
3735
|
var appearances = {
|
|
@@ -3957,7 +3913,7 @@ var appearances = {
|
|
|
3957
3913
|
};
|
|
3958
3914
|
var button = {
|
|
3959
3915
|
base: {
|
|
3960
|
-
border: `${
|
|
3916
|
+
border: `${border5.BordersDdsBorderStyleLightStrokeWeight} solid`
|
|
3961
3917
|
},
|
|
3962
3918
|
sizes,
|
|
3963
3919
|
appearances
|
|
@@ -3966,102 +3922,7 @@ var buttonTokens = {
|
|
|
3966
3922
|
button
|
|
3967
3923
|
};
|
|
3968
3924
|
|
|
3969
|
-
// src/components/Spinner/Spinner.tsx
|
|
3970
|
-
var import_react20 = __toESM(require("react"));
|
|
3971
|
-
var import_styled_components16 = __toESM(require("styled-components"));
|
|
3972
|
-
var import_dds_design_tokens20 = require("@norges-domstoler/dds-design-tokens");
|
|
3973
|
-
var import_jsx_runtime171 = require("react/jsx-runtime");
|
|
3974
|
-
var StyledSpinner = import_styled_components16.default.svg`
|
|
3975
|
-
display: block;
|
|
3976
|
-
width: ${({ $size }) => $size};
|
|
3977
|
-
height: ${({ $size }) => $size};
|
|
3978
|
-
stroke-dasharray: 90, 150;
|
|
3979
|
-
animation: rotate 1.5s linear infinite;
|
|
3980
|
-
animation-delay: ${({ $outerAnimationDelay }) => $outerAnimationDelay}ms;
|
|
3981
|
-
|
|
3982
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
3983
|
-
animation: rotate 2s linear infinite;
|
|
3984
|
-
}
|
|
3985
|
-
|
|
3986
|
-
@keyframes rotate {
|
|
3987
|
-
100% {
|
|
3988
|
-
transform: rotate(360deg);
|
|
3989
|
-
}
|
|
3990
|
-
}
|
|
3991
|
-
`;
|
|
3992
|
-
var Circle = import_styled_components16.default.circle`
|
|
3993
|
-
stroke: ${({ $color }) => $color && getTextColor($color)};
|
|
3994
|
-
stroke-linecap: round;
|
|
3995
|
-
|
|
3996
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
3997
|
-
animation: dash 1.5s ease-in-out infinite;
|
|
3998
|
-
animation-delay: ${({ $innerAnimationDelay }) => $innerAnimationDelay}ms;
|
|
3999
|
-
|
|
4000
|
-
@keyframes dash {
|
|
4001
|
-
0% {
|
|
4002
|
-
stroke-dasharray: 1, 150;
|
|
4003
|
-
stroke-dashoffset: 0;
|
|
4004
|
-
}
|
|
4005
|
-
50% {
|
|
4006
|
-
stroke-dasharray: 90, 150;
|
|
4007
|
-
stroke-dashoffset: -35;
|
|
4008
|
-
}
|
|
4009
|
-
100% {
|
|
4010
|
-
stroke-dasharray: 90, 150;
|
|
4011
|
-
stroke-dashoffset: -124;
|
|
4012
|
-
}
|
|
4013
|
-
}
|
|
4014
|
-
}
|
|
4015
|
-
`;
|
|
4016
|
-
function Spinner(props) {
|
|
4017
|
-
const {
|
|
4018
|
-
size: size2 = import_dds_design_tokens20.ddsBaseTokens.iconSizes.DdsIconsizeMedium,
|
|
4019
|
-
color = "interactive",
|
|
4020
|
-
tooltip = "Innlasting p\xE5g\xE5r",
|
|
4021
|
-
id,
|
|
4022
|
-
className,
|
|
4023
|
-
htmlProps,
|
|
4024
|
-
...rest
|
|
4025
|
-
} = props;
|
|
4026
|
-
const mountTime = import_react20.default.useRef(Date.now());
|
|
4027
|
-
const outerAnimationDelay = -(mountTime.current % 2e3);
|
|
4028
|
-
const innerAnimationDelay = -(mountTime.current % 1500);
|
|
4029
|
-
const generatedId = (0, import_react20.useId)();
|
|
4030
|
-
const uniqueId = `${generatedId}-spinnerTitle`;
|
|
4031
|
-
const spinnerProps = {
|
|
4032
|
-
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
4033
|
-
$outerAnimationDelay: outerAnimationDelay,
|
|
4034
|
-
$size: size2
|
|
4035
|
-
};
|
|
4036
|
-
return /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)(
|
|
4037
|
-
StyledSpinner,
|
|
4038
|
-
{
|
|
4039
|
-
viewBox: "0 0 50 50",
|
|
4040
|
-
role: "img",
|
|
4041
|
-
"aria-labelledby": uniqueId,
|
|
4042
|
-
...spinnerProps,
|
|
4043
|
-
children: [
|
|
4044
|
-
tooltip && /* @__PURE__ */ (0, import_jsx_runtime171.jsx)("title", { id: uniqueId, children: tooltip }),
|
|
4045
|
-
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
|
|
4046
|
-
Circle,
|
|
4047
|
-
{
|
|
4048
|
-
$innerAnimationDelay: innerAnimationDelay,
|
|
4049
|
-
$color: color,
|
|
4050
|
-
cx: "25",
|
|
4051
|
-
cy: "25",
|
|
4052
|
-
r: "20",
|
|
4053
|
-
fill: "none",
|
|
4054
|
-
strokeWidth: "4"
|
|
4055
|
-
}
|
|
4056
|
-
)
|
|
4057
|
-
]
|
|
4058
|
-
}
|
|
4059
|
-
);
|
|
4060
|
-
}
|
|
4061
|
-
Spinner.displayName = "Spinner";
|
|
4062
|
-
|
|
4063
3925
|
// src/components/Button/Button.styles.tsx
|
|
4064
|
-
var import_styled_components17 = __toESM(require("styled-components"));
|
|
4065
3926
|
var {
|
|
4066
3927
|
button: { base, sizes: sizes2, appearances: appearances2 }
|
|
4067
3928
|
} = buttonTokens;
|
|
@@ -4069,7 +3930,7 @@ var getAppearanceAndPurposeStyling = (appearance, purpose) => {
|
|
|
4069
3930
|
switch (appearance) {
|
|
4070
3931
|
case "filled":
|
|
4071
3932
|
case "rounded":
|
|
4072
|
-
return
|
|
3933
|
+
return import_styled_components15.css`
|
|
4073
3934
|
background-color: ${appearances2[appearance].purpose[purpose].base.backgroundColor};
|
|
4074
3935
|
border-color: ${appearances2[appearance].purpose[purpose].base.borderColor};
|
|
4075
3936
|
&:hover {
|
|
@@ -4082,7 +3943,7 @@ var getAppearanceAndPurposeStyling = (appearance, purpose) => {
|
|
|
4082
3943
|
}
|
|
4083
3944
|
`;
|
|
4084
3945
|
case "ghost":
|
|
4085
|
-
return
|
|
3946
|
+
return import_styled_components15.css`
|
|
4086
3947
|
background-color: ${appearances2.ghost.base.backgroundColor};
|
|
4087
3948
|
border-color: ${appearances2.ghost.purpose[purpose].base.borderColor};
|
|
4088
3949
|
&:hover {
|
|
@@ -4097,7 +3958,7 @@ var getAppearanceAndPurposeStyling = (appearance, purpose) => {
|
|
|
4097
3958
|
}
|
|
4098
3959
|
`;
|
|
4099
3960
|
case "borderless":
|
|
4100
|
-
return
|
|
3961
|
+
return import_styled_components15.css`
|
|
4101
3962
|
background-color: ${appearances2.borderless.base.backgroundColor};
|
|
4102
3963
|
border-color: ${appearances2.borderless.base.borderColor};
|
|
4103
3964
|
text-decoration: ${appearances2.borderless.base.textDecoration};
|
|
@@ -4113,7 +3974,7 @@ var getAppearanceAndPurposeStyling = (appearance, purpose) => {
|
|
|
4113
3974
|
`;
|
|
4114
3975
|
}
|
|
4115
3976
|
};
|
|
4116
|
-
var ButtonWrapper =
|
|
3977
|
+
var ButtonWrapper = import_styled_components15.default.button.withConfig({
|
|
4117
3978
|
shouldForwardProp: (prop) => {
|
|
4118
3979
|
const styleOnlyProps = [
|
|
4119
3980
|
"appearance",
|
|
@@ -4150,14 +4011,14 @@ var ButtonWrapper = import_styled_components17.default.button.withConfig({
|
|
|
4150
4011
|
${focusVisibleTransitionValue};
|
|
4151
4012
|
}
|
|
4152
4013
|
|
|
4153
|
-
${({ appearance, purpose }) =>
|
|
4014
|
+
${({ appearance, purpose }) => import_styled_components15.css`
|
|
4154
4015
|
border-radius: ${appearances2[appearance].base.borderRadius};
|
|
4155
4016
|
box-shadow: ${appearances2[appearance].base.boxShadow};
|
|
4156
4017
|
color: ${appearances2[appearance].purpose[purpose].base.color};
|
|
4157
4018
|
${getAppearanceAndPurposeStyling(appearance, purpose)}
|
|
4158
4019
|
`}
|
|
4159
4020
|
|
|
4160
|
-
${({ hasIcon, hasLabel, appearance, purpose }) => hasIcon && !hasLabel && appearance === "borderless" &&
|
|
4021
|
+
${({ hasIcon, hasLabel, appearance, purpose }) => hasIcon && !hasLabel && appearance === "borderless" && import_styled_components15.css`
|
|
4161
4022
|
&:hover {
|
|
4162
4023
|
border-color: ${appearances2[appearance].purpose[purpose].icon.hover.borderColor};
|
|
4163
4024
|
box-shadow: ${appearances2[appearance].purpose[purpose].icon.hover.boxShadow};
|
|
@@ -4167,23 +4028,23 @@ var ButtonWrapper = import_styled_components17.default.button.withConfig({
|
|
|
4167
4028
|
box-shadow: ${appearances2[appearance].purpose[purpose].icon.active.boxShadow};
|
|
4168
4029
|
}
|
|
4169
4030
|
`}
|
|
4170
|
-
${({ hasIcon, hasLabel, size: size2 }) => hasIcon && hasLabel &&
|
|
4031
|
+
${({ hasIcon, hasLabel, size: size2 }) => hasIcon && hasLabel && import_styled_components15.css`
|
|
4171
4032
|
gap: ${sizes2[size2].textAndIcon.gap};
|
|
4172
4033
|
`}
|
|
4173
4034
|
|
|
4174
|
-
${({ size: size2, hasLabel }) => hasLabel ?
|
|
4035
|
+
${({ size: size2, hasLabel }) => hasLabel ? import_styled_components15.css`
|
|
4175
4036
|
${getFontStyling(typographyTypes[size2])}
|
|
4176
4037
|
padding: ${sizes2[size2].text.padding};
|
|
4177
|
-
` :
|
|
4038
|
+
` : import_styled_components15.css`
|
|
4178
4039
|
font-size: ${sizes2[size2].justIcon.icon.fontSize};
|
|
4179
4040
|
padding: ${sizes2[size2].justIcon.icon.padding};
|
|
4180
4041
|
`}
|
|
4181
4042
|
|
|
4182
|
-
${({ fullWidth, hasIcon, hasLabel, isLoading, iconPosition }) => fullWidth && (!hasIcon || !hasLabel || isLoading ?
|
|
4043
|
+
${({ fullWidth, hasIcon, hasLabel, isLoading, iconPosition }) => fullWidth && (!hasIcon || !hasLabel || isLoading ? import_styled_components15.css`
|
|
4183
4044
|
justify-content: center;
|
|
4184
|
-
` : hasIcon && hasLabel && iconPosition === "left" ?
|
|
4045
|
+
` : hasIcon && hasLabel && iconPosition === "left" ? import_styled_components15.css`
|
|
4185
4046
|
justify-content: left;
|
|
4186
|
-
` :
|
|
4047
|
+
` : import_styled_components15.css`
|
|
4187
4048
|
justify-content: space-between;
|
|
4188
4049
|
`)}
|
|
4189
4050
|
|
|
@@ -4195,7 +4056,7 @@ var ButtonWrapper = import_styled_components17.default.button.withConfig({
|
|
|
4195
4056
|
${selection}
|
|
4196
4057
|
}
|
|
4197
4058
|
`;
|
|
4198
|
-
var StyledIconWrapperSpan =
|
|
4059
|
+
var StyledIconWrapperSpan = import_styled_components15.default.span.withConfig({
|
|
4199
4060
|
shouldForwardProp: (prop) => {
|
|
4200
4061
|
const styleOnlyProps = [
|
|
4201
4062
|
"iconPosition",
|
|
@@ -4210,31 +4071,125 @@ var StyledIconWrapperSpan = import_styled_components17.default.span.withConfig({
|
|
|
4210
4071
|
display: flex;
|
|
4211
4072
|
align-items: center;
|
|
4212
4073
|
justify-content: center;
|
|
4213
|
-
${({ absolutePosition }) => absolutePosition &&
|
|
4074
|
+
${({ absolutePosition }) => absolutePosition && import_styled_components15.css`
|
|
4214
4075
|
position: absolute;
|
|
4215
4076
|
`}
|
|
4216
|
-
${({ isHidden }) => isHidden &&
|
|
4077
|
+
${({ isHidden }) => isHidden && import_styled_components15.css`
|
|
4217
4078
|
visibility: hidden;
|
|
4218
4079
|
`}
|
|
4219
|
-
${({ justIcon, size: size2 }) => justIcon &&
|
|
4080
|
+
${({ justIcon, size: size2 }) => justIcon && import_styled_components15.css`
|
|
4220
4081
|
height: ${sizes2[size2].justIcon.wrapper.height};
|
|
4221
4082
|
width: ${sizes2[size2].justIcon.wrapper.width};
|
|
4222
4083
|
`}
|
|
4223
4084
|
`;
|
|
4224
|
-
var Label2 =
|
|
4085
|
+
var Label2 = import_styled_components15.default.span.withConfig({
|
|
4225
4086
|
shouldForwardProp: (prop) => prop !== "isHidden"
|
|
4226
4087
|
})`
|
|
4227
|
-
${({ isHidden }) => isHidden &&
|
|
4088
|
+
${({ isHidden }) => isHidden && import_styled_components15.css`
|
|
4228
4089
|
visibility: hidden;
|
|
4229
4090
|
`}
|
|
4230
4091
|
`;
|
|
4231
4092
|
|
|
4093
|
+
// src/components/Spinner/Spinner.tsx
|
|
4094
|
+
var import_dds_design_tokens19 = require("@norges-domstoler/dds-design-tokens");
|
|
4095
|
+
var import_react19 = require("react");
|
|
4096
|
+
var import_styled_components16 = __toESM(require("styled-components"));
|
|
4097
|
+
var import_jsx_runtime170 = require("react/jsx-runtime");
|
|
4098
|
+
var StyledSpinner = import_styled_components16.default.svg`
|
|
4099
|
+
display: block;
|
|
4100
|
+
width: ${({ $size }) => $size};
|
|
4101
|
+
height: ${({ $size }) => $size};
|
|
4102
|
+
stroke-dasharray: 90, 150;
|
|
4103
|
+
animation: rotate 1.5s linear infinite;
|
|
4104
|
+
animation-delay: ${({ $outerAnimationDelay }) => $outerAnimationDelay}ms;
|
|
4105
|
+
|
|
4106
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
4107
|
+
animation: rotate 2s linear infinite;
|
|
4108
|
+
}
|
|
4109
|
+
|
|
4110
|
+
@keyframes rotate {
|
|
4111
|
+
100% {
|
|
4112
|
+
transform: rotate(360deg);
|
|
4113
|
+
}
|
|
4114
|
+
}
|
|
4115
|
+
`;
|
|
4116
|
+
var Circle = import_styled_components16.default.circle`
|
|
4117
|
+
stroke: ${({ $color }) => $color && getTextColor($color)};
|
|
4118
|
+
stroke-linecap: round;
|
|
4119
|
+
|
|
4120
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
4121
|
+
animation: dash 1.5s ease-in-out infinite;
|
|
4122
|
+
animation-delay: ${({ $innerAnimationDelay }) => $innerAnimationDelay}ms;
|
|
4123
|
+
|
|
4124
|
+
@keyframes dash {
|
|
4125
|
+
0% {
|
|
4126
|
+
stroke-dasharray: 1, 150;
|
|
4127
|
+
stroke-dashoffset: 0;
|
|
4128
|
+
}
|
|
4129
|
+
50% {
|
|
4130
|
+
stroke-dasharray: 90, 150;
|
|
4131
|
+
stroke-dashoffset: -35;
|
|
4132
|
+
}
|
|
4133
|
+
100% {
|
|
4134
|
+
stroke-dasharray: 90, 150;
|
|
4135
|
+
stroke-dashoffset: -124;
|
|
4136
|
+
}
|
|
4137
|
+
}
|
|
4138
|
+
}
|
|
4139
|
+
`;
|
|
4140
|
+
function Spinner(props) {
|
|
4141
|
+
const {
|
|
4142
|
+
size: size2 = import_dds_design_tokens19.ddsBaseTokens.iconSizes.DdsIconsizeMedium,
|
|
4143
|
+
color = "interactive",
|
|
4144
|
+
tooltip = "Innlasting p\xE5g\xE5r",
|
|
4145
|
+
id,
|
|
4146
|
+
className,
|
|
4147
|
+
htmlProps,
|
|
4148
|
+
...rest
|
|
4149
|
+
} = props;
|
|
4150
|
+
const mountTime = (0, import_react19.useRef)(Date.now());
|
|
4151
|
+
const outerAnimationDelay = -(mountTime.current % 2e3);
|
|
4152
|
+
const innerAnimationDelay = -(mountTime.current % 1500);
|
|
4153
|
+
const generatedId = (0, import_react19.useId)();
|
|
4154
|
+
const uniqueId = `${generatedId}-spinnerTitle`;
|
|
4155
|
+
const spinnerProps = {
|
|
4156
|
+
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
4157
|
+
$outerAnimationDelay: outerAnimationDelay,
|
|
4158
|
+
$size: size2
|
|
4159
|
+
};
|
|
4160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)(
|
|
4161
|
+
StyledSpinner,
|
|
4162
|
+
{
|
|
4163
|
+
viewBox: "0 0 50 50",
|
|
4164
|
+
role: "img",
|
|
4165
|
+
"aria-labelledby": uniqueId,
|
|
4166
|
+
...spinnerProps,
|
|
4167
|
+
children: [
|
|
4168
|
+
tooltip && /* @__PURE__ */ (0, import_jsx_runtime170.jsx)("title", { id: uniqueId, children: tooltip }),
|
|
4169
|
+
/* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
|
|
4170
|
+
Circle,
|
|
4171
|
+
{
|
|
4172
|
+
$innerAnimationDelay: innerAnimationDelay,
|
|
4173
|
+
$color: color,
|
|
4174
|
+
cx: "25",
|
|
4175
|
+
cy: "25",
|
|
4176
|
+
r: "20",
|
|
4177
|
+
fill: "none",
|
|
4178
|
+
strokeWidth: "4"
|
|
4179
|
+
}
|
|
4180
|
+
)
|
|
4181
|
+
]
|
|
4182
|
+
}
|
|
4183
|
+
);
|
|
4184
|
+
}
|
|
4185
|
+
Spinner.displayName = "Spinner";
|
|
4186
|
+
|
|
4232
4187
|
// src/components/Button/Button.tsx
|
|
4233
|
-
var
|
|
4188
|
+
var import_jsx_runtime171 = require("react/jsx-runtime");
|
|
4234
4189
|
var {
|
|
4235
4190
|
button: { sizes: sizes3, appearances: appearances3 }
|
|
4236
4191
|
} = buttonTokens;
|
|
4237
|
-
var Button = (0,
|
|
4192
|
+
var Button = (0, import_react20.forwardRef)(
|
|
4238
4193
|
(props, ref) => {
|
|
4239
4194
|
const {
|
|
4240
4195
|
label: label3,
|
|
@@ -4284,28 +4239,28 @@ var Button = (0, import_react21.forwardRef)(
|
|
|
4284
4239
|
onBlur
|
|
4285
4240
|
};
|
|
4286
4241
|
const isIconButton = !hasLabel && hasIcon;
|
|
4287
|
-
const iconElement = icon12 && /* @__PURE__ */ (0,
|
|
4242
|
+
const iconElement = icon12 && /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
|
|
4288
4243
|
StyledIconWrapperSpan,
|
|
4289
4244
|
{
|
|
4290
4245
|
size: size2,
|
|
4291
4246
|
isHidden: hasIcon && loading,
|
|
4292
4247
|
justIcon: isIconButton,
|
|
4293
|
-
children: /* @__PURE__ */ (0,
|
|
4248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(Icon, { icon: icon12, iconSize: "inherit" })
|
|
4294
4249
|
}
|
|
4295
4250
|
);
|
|
4296
|
-
return /* @__PURE__ */ (0,
|
|
4297
|
-
!isIconButton && /* @__PURE__ */ (0,
|
|
4251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)(ButtonWrapper, { ...wrapperProps, "aria-disabled": loading, children: [
|
|
4252
|
+
!isIconButton && /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)(import_jsx_runtime171.Fragment, { children: [
|
|
4298
4253
|
iconPosition === "left" && iconElement,
|
|
4299
|
-
/* @__PURE__ */ (0,
|
|
4254
|
+
/* @__PURE__ */ (0, import_jsx_runtime171.jsx)(Label2, { isHidden: loading, "aria-hidden": loading, children: children != null ? children : label3 }),
|
|
4300
4255
|
iconPosition === "right" && iconElement
|
|
4301
4256
|
] }),
|
|
4302
4257
|
isIconButton && iconElement,
|
|
4303
|
-
loading && /* @__PURE__ */ (0,
|
|
4258
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
|
|
4304
4259
|
StyledIconWrapperSpan,
|
|
4305
4260
|
{
|
|
4306
4261
|
size: size2,
|
|
4307
4262
|
absolutePosition: hasIcon || hasLabel,
|
|
4308
|
-
children: /* @__PURE__ */ (0,
|
|
4263
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(
|
|
4309
4264
|
Spinner,
|
|
4310
4265
|
{
|
|
4311
4266
|
color: appearances3[appearance].purpose[purpose].base.color,
|
|
@@ -4324,64 +4279,289 @@ Button.displayName = "Button";
|
|
|
4324
4279
|
var import_react25 = require("react");
|
|
4325
4280
|
var import_styled_components21 = __toESM(require("styled-components"));
|
|
4326
4281
|
|
|
4327
|
-
// src/components/
|
|
4328
|
-
var
|
|
4329
|
-
var
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
var import_dds_design_tokens21 = require("@norges-domstoler/dds-design-tokens");
|
|
4333
|
-
var scrollbarWidthNumberPx = 10;
|
|
4334
|
-
var scrollbarWidth = `${scrollbarWidthNumberPx}px`;
|
|
4335
|
-
var { colors: colors10, spacing: spacing8 } = import_dds_design_tokens21.ddsBaseTokens;
|
|
4336
|
-
var track = {
|
|
4337
|
-
backgroundColor: "transparent",
|
|
4338
|
-
borderRadius: "100px",
|
|
4339
|
-
width: scrollbarWidth
|
|
4340
|
-
};
|
|
4341
|
-
var thumb = {
|
|
4282
|
+
// src/components/OverflowMenu/OverflowMenu.tokens.tsx
|
|
4283
|
+
var import_dds_design_tokens20 = require("@norges-domstoler/dds-design-tokens");
|
|
4284
|
+
var { border: border6, borderRadius: borderRadius4, colors: colors10, spacing: spacing7, fontPackages: fontPackages4 } = import_dds_design_tokens20.ddsBaseTokens;
|
|
4285
|
+
var typographyType = "bodySans01";
|
|
4286
|
+
var element = {
|
|
4342
4287
|
base: {
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4288
|
+
color: colors10.DdsColorNeutralsGray9,
|
|
4289
|
+
textDecoration: "none",
|
|
4290
|
+
backgroundColor: colors10.DdsColorNeutralsWhite,
|
|
4291
|
+
padding: `${spacing7.SizesDdsSpacingX075} ${spacing7.SizesDdsSpacingX1}`,
|
|
4292
|
+
gap: spacing7.SizesDdsSpacingX025
|
|
4293
|
+
}
|
|
4294
|
+
};
|
|
4295
|
+
var iconHeight = calculateHeightWithLineHeight(
|
|
4296
|
+
fontPackages4.body_sans_01.numbers.lineHeightNumber,
|
|
4297
|
+
fontPackages4.body_sans_01.numbers.fontSizeNumber
|
|
4298
|
+
);
|
|
4299
|
+
var link = {
|
|
4300
|
+
iconWrapper: {
|
|
4301
|
+
height: `${iconHeight}px`
|
|
4346
4302
|
},
|
|
4347
4303
|
hover: {
|
|
4348
|
-
backgroundColor: colors10.
|
|
4304
|
+
backgroundColor: colors10.DdsColorInteractiveLightest
|
|
4305
|
+
},
|
|
4306
|
+
active: {
|
|
4307
|
+
backgroundColor: colors10.DdsColorInteractiveLightest
|
|
4349
4308
|
}
|
|
4350
4309
|
};
|
|
4351
|
-
var
|
|
4352
|
-
|
|
4310
|
+
var container3 = {
|
|
4311
|
+
border: `${border6.BordersDdsBorderStyleLightStrokeWeight} ${border6.BordersDdsBorderStyleLightStroke} solid `,
|
|
4312
|
+
backgroundColor: colors10.DdsColorNeutralsWhite,
|
|
4313
|
+
borderRadius: borderRadius4.RadiiDdsBorderRadius1Radius
|
|
4353
4314
|
};
|
|
4354
|
-
var
|
|
4355
|
-
|
|
4315
|
+
var divider = {
|
|
4316
|
+
marginRight: spacing7.SizesDdsSpacingX15,
|
|
4317
|
+
marginLeft: spacing7.SizesDdsSpacingX15
|
|
4356
4318
|
};
|
|
4357
|
-
var
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4319
|
+
var overflowMenuTokens = {
|
|
4320
|
+
container: container3,
|
|
4321
|
+
element,
|
|
4322
|
+
link,
|
|
4323
|
+
divider,
|
|
4324
|
+
offset: spacing7.SizesDdsSpacingX0125NumberPx
|
|
4363
4325
|
};
|
|
4364
4326
|
|
|
4365
|
-
// src/components/
|
|
4366
|
-
var
|
|
4367
|
-
var
|
|
4368
|
-
var
|
|
4369
|
-
var
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4327
|
+
// src/components/OverflowMenu/OverflowMenuItem.tsx
|
|
4328
|
+
var import_react21 = require("react");
|
|
4329
|
+
var import_styled_components17 = __toESM(require("styled-components"));
|
|
4330
|
+
var import_jsx_runtime172 = require("react/jsx-runtime");
|
|
4331
|
+
var { element: element2, link: link2 } = overflowMenuTokens;
|
|
4332
|
+
var elementBaseCSS = import_styled_components17.css`
|
|
4333
|
+
display: flex;
|
|
4334
|
+
box-sizing: border-box;
|
|
4335
|
+
color: ${element2.base.color};
|
|
4336
|
+
text-decoration: ${element2.base.textDecoration};
|
|
4337
|
+
background-color: ${element2.base.backgroundColor};
|
|
4338
|
+
padding: ${element2.base.padding};
|
|
4339
|
+
gap: ${element2.base.gap};
|
|
4340
|
+
${getFontStyling(typographyType)}
|
|
4341
|
+
`;
|
|
4342
|
+
var Span = import_styled_components17.default.span`
|
|
4343
|
+
${elementBaseCSS}
|
|
4344
|
+
`;
|
|
4345
|
+
var Link2 = import_styled_components17.default.a`
|
|
4346
|
+
${normalizeButton}
|
|
4347
|
+
text-align: left;
|
|
4348
|
+
user-select: text;
|
|
4349
|
+
border: none;
|
|
4350
|
+
cursor: pointer;
|
|
4351
|
+
outline: inherit;
|
|
4352
|
+
width: 100%;
|
|
4353
|
+
${elementBaseCSS}
|
|
4354
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
4355
|
+
transition: background-color 0.2s;
|
|
4356
|
+
}
|
|
4357
|
+
&:hover {
|
|
4358
|
+
background-color: ${link2.hover.backgroundColor};
|
|
4359
|
+
}
|
|
4360
|
+
&:active {
|
|
4361
|
+
background-color: ${link2.active.backgroundColor};
|
|
4362
|
+
}
|
|
4363
|
+
&:focus-visible,
|
|
4364
|
+
&.focus-visible {
|
|
4365
|
+
${focusVisibleLink}
|
|
4366
|
+
}
|
|
4367
|
+
`;
|
|
4368
|
+
var IconWrapper = import_styled_components17.default.span`
|
|
4369
|
+
display: flex;
|
|
4370
|
+
align-items: center;
|
|
4371
|
+
height: ${link2.iconWrapper.height};
|
|
4372
|
+
`;
|
|
4373
|
+
var isAnchorProps2 = (props) => props.href !== void 0;
|
|
4374
|
+
var isButtonProps = (props) => props.href === void 0 && props.onClick !== void 0;
|
|
4375
|
+
var OverflowMenuItem = (0, import_react21.forwardRef)((props, ref) => {
|
|
4376
|
+
const {
|
|
4377
|
+
title: title3,
|
|
4378
|
+
icon: icon12,
|
|
4379
|
+
focus,
|
|
4380
|
+
setFocus,
|
|
4381
|
+
index,
|
|
4382
|
+
id,
|
|
4383
|
+
className,
|
|
4384
|
+
htmlProps = {},
|
|
4385
|
+
...rest
|
|
4386
|
+
} = props;
|
|
4387
|
+
const { onKeyDown } = htmlProps;
|
|
4388
|
+
let href;
|
|
4389
|
+
let onClick;
|
|
4390
|
+
if (isAnchorProps2(props)) {
|
|
4391
|
+
href = props.href;
|
|
4392
|
+
} else if (isButtonProps(props)) {
|
|
4393
|
+
onClick = props.onClick;
|
|
4394
|
+
}
|
|
4395
|
+
const itemRef = (0, import_react21.useRef)(null);
|
|
4396
|
+
const combinedRef = useCombinedRef(ref, itemRef);
|
|
4397
|
+
(0, import_react21.useEffect)(() => {
|
|
4398
|
+
var _a;
|
|
4399
|
+
if (focus) {
|
|
4400
|
+
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
4401
|
+
}
|
|
4402
|
+
}, [focus]);
|
|
4403
|
+
const handleSelect = (0, import_react21.useCallback)(() => {
|
|
4404
|
+
if (setFocus && index) {
|
|
4405
|
+
setFocus(index);
|
|
4406
|
+
}
|
|
4407
|
+
}, [index, setFocus]);
|
|
4408
|
+
const handleOnClick = (e) => {
|
|
4409
|
+
handleSelect();
|
|
4410
|
+
onClick && onClick(e);
|
|
4411
|
+
};
|
|
4412
|
+
const handleOnKeyDown = (e) => {
|
|
4413
|
+
handleSelect();
|
|
4414
|
+
onKeyDown && onKeyDown(e);
|
|
4415
|
+
};
|
|
4416
|
+
const linkProps = {
|
|
4417
|
+
href,
|
|
4418
|
+
onClick: handleOnClick,
|
|
4419
|
+
onKeyDown: handleOnKeyDown,
|
|
4420
|
+
role: "menuitem",
|
|
4421
|
+
tabIndex: focus ? 0 : -1
|
|
4422
|
+
};
|
|
4423
|
+
const iconElement = icon12 && /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(Icon, { iconSize: "inherit", icon: icon12 });
|
|
4424
|
+
if (!href && !onClick) {
|
|
4425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)(Span, { ...{ ...getBaseHTMLProps(id, className, htmlProps, rest), ref }, children: [
|
|
4426
|
+
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)(IconWrapper, { children: iconElement }),
|
|
4427
|
+
title3
|
|
4428
|
+
] });
|
|
4429
|
+
}
|
|
4430
|
+
if (!href) {
|
|
4431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)(
|
|
4432
|
+
Link2,
|
|
4433
|
+
{
|
|
4434
|
+
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
4435
|
+
...linkProps,
|
|
4436
|
+
as: "button",
|
|
4437
|
+
ref: combinedRef,
|
|
4438
|
+
children: [
|
|
4439
|
+
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)(IconWrapper, { children: iconElement }),
|
|
4440
|
+
title3
|
|
4441
|
+
]
|
|
4442
|
+
}
|
|
4443
|
+
);
|
|
4444
|
+
}
|
|
4445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)(
|
|
4446
|
+
Link2,
|
|
4447
|
+
{
|
|
4448
|
+
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
4449
|
+
...linkProps,
|
|
4450
|
+
as: "a",
|
|
4451
|
+
ref: combinedRef,
|
|
4452
|
+
children: [
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime172.jsx)(IconWrapper, { children: iconElement }),
|
|
4454
|
+
title3
|
|
4455
|
+
]
|
|
4456
|
+
}
|
|
4457
|
+
);
|
|
4458
|
+
});
|
|
4459
|
+
OverflowMenuItem.displayName = "OverflowMenuItem";
|
|
4460
|
+
|
|
4461
|
+
// src/components/Divider/Divider.tsx
|
|
4462
|
+
var import_react22 = require("react");
|
|
4463
|
+
var import_styled_components18 = __toESM(require("styled-components"));
|
|
4464
|
+
|
|
4465
|
+
// src/components/Divider/Divider.tokens.tsx
|
|
4466
|
+
var import_dds_design_tokens21 = require("@norges-domstoler/dds-design-tokens");
|
|
4467
|
+
var { border: border7, spacing: spacing8 } = import_dds_design_tokens21.ddsBaseTokens;
|
|
4468
|
+
var divider2 = {
|
|
4469
|
+
borderTop: `${border7.BordersDdsBorderStyleLightStrokeWeight} solid`,
|
|
4470
|
+
marginTop: spacing8.SizesDdsSpacingX1,
|
|
4471
|
+
marginBottom: spacing8.SizesDdsSpacingX1,
|
|
4472
|
+
color: {
|
|
4473
|
+
primary: {
|
|
4474
|
+
borderColor: border7.BordersDdsBorderStyleDarkStroke
|
|
4475
|
+
},
|
|
4476
|
+
primaryLighter: {
|
|
4477
|
+
borderColor: border7.BordersDdsBorderStyleLightStroke
|
|
4478
|
+
}
|
|
4479
|
+
}
|
|
4480
|
+
};
|
|
4481
|
+
var dividerTokens = {
|
|
4482
|
+
...divider2
|
|
4483
|
+
};
|
|
4484
|
+
|
|
4485
|
+
// src/components/Divider/Divider.tsx
|
|
4486
|
+
var import_jsx_runtime173 = require("react/jsx-runtime");
|
|
4487
|
+
var StyledDivider = import_styled_components18.default.hr`
|
|
4488
|
+
border: 0;
|
|
4489
|
+
background-color: transparent;
|
|
4490
|
+
border-top: ${dividerTokens.borderTop};
|
|
4491
|
+
margin-top: ${dividerTokens.marginTop};
|
|
4492
|
+
margin-bottom: ${dividerTokens.marginBottom};
|
|
4493
|
+
${({ color }) => color && import_styled_components18.css`
|
|
4494
|
+
border-color: ${dividerTokens.color[color].borderColor};
|
|
4495
|
+
`}
|
|
4496
|
+
`;
|
|
4497
|
+
var Divider = (0, import_react22.forwardRef)((props, ref) => {
|
|
4498
|
+
const { color = "primary", id, className, htmlProps, ...rest } = props;
|
|
4499
|
+
const lineProps = {
|
|
4500
|
+
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
4501
|
+
color
|
|
4502
|
+
};
|
|
4503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(StyledDivider, { ref, ...lineProps });
|
|
4504
|
+
});
|
|
4505
|
+
Divider.displayName = "Divider";
|
|
4506
|
+
|
|
4507
|
+
// src/components/ScrollableContainer/Scrollbar.tsx
|
|
4508
|
+
var import_react23 = require("react");
|
|
4509
|
+
var import_styled_components19 = __toESM(require("styled-components"));
|
|
4510
|
+
|
|
4511
|
+
// src/components/ScrollableContainer/ScrollableContainer.tokens.tsx
|
|
4512
|
+
var import_dds_design_tokens22 = require("@norges-domstoler/dds-design-tokens");
|
|
4513
|
+
var scrollbarWidthNumberPx = 10;
|
|
4514
|
+
var scrollbarWidth = `${scrollbarWidthNumberPx}px`;
|
|
4515
|
+
var { colors: colors11, spacing: spacing9 } = import_dds_design_tokens22.ddsBaseTokens;
|
|
4516
|
+
var track = {
|
|
4517
|
+
backgroundColor: "transparent",
|
|
4518
|
+
borderRadius: "100px",
|
|
4519
|
+
width: scrollbarWidth
|
|
4520
|
+
};
|
|
4521
|
+
var thumb = {
|
|
4522
|
+
base: {
|
|
4523
|
+
backgroundColor: colors11.DdsColorPrimaryDarkest.slice(0, -2) + "0.35)",
|
|
4524
|
+
borderRadius: "100px",
|
|
4525
|
+
width: scrollbarWidth
|
|
4526
|
+
},
|
|
4527
|
+
hover: {
|
|
4528
|
+
backgroundColor: colors11.DdsColorPrimaryDarkest.slice(0, -2) + "0.5)"
|
|
4529
|
+
}
|
|
4530
|
+
};
|
|
4531
|
+
var content = {
|
|
4532
|
+
paddingRight: spacing9.SizesDdsSpacingX05
|
|
4533
|
+
};
|
|
4534
|
+
var outerContainer = {
|
|
4535
|
+
padding: spacing9.SizesDdsSpacingX025
|
|
4536
|
+
};
|
|
4537
|
+
var scrollbarTokens = {
|
|
4538
|
+
minThumbHeightPx: 15,
|
|
4539
|
+
track,
|
|
4540
|
+
thumb,
|
|
4541
|
+
content,
|
|
4542
|
+
outerContainer
|
|
4543
|
+
};
|
|
4544
|
+
|
|
4545
|
+
// src/components/ScrollableContainer/Scrollbar.tsx
|
|
4546
|
+
var import_jsx_runtime174 = require("react/jsx-runtime");
|
|
4547
|
+
var { track: track2, thumb: thumb2, minThumbHeightPx } = scrollbarTokens;
|
|
4548
|
+
var ScrollbarOuterWrapper = import_styled_components19.default.div``;
|
|
4549
|
+
var ScrollbarElements = import_styled_components19.default.div`
|
|
4550
|
+
display: block;
|
|
4551
|
+
height: 100%;
|
|
4552
|
+
position: relative;
|
|
4553
|
+
display: grid;
|
|
4554
|
+
justify-items: center;
|
|
4555
|
+
`;
|
|
4556
|
+
var Track = import_styled_components19.default.div`
|
|
4557
|
+
bottom: 0;
|
|
4558
|
+
top: 0;
|
|
4559
|
+
position: absolute;
|
|
4380
4560
|
background-color: ${track2.backgroundColor};
|
|
4381
4561
|
border-radius: ${track2.borderRadius};
|
|
4382
4562
|
width: ${track2.width};
|
|
4383
4563
|
`;
|
|
4384
|
-
var Thumb =
|
|
4564
|
+
var Thumb = import_styled_components19.default.div`
|
|
4385
4565
|
position: absolute;
|
|
4386
4566
|
background-color: ${thumb2.base.backgroundColor};
|
|
4387
4567
|
border-radius: ${thumb2.base.borderRadius};
|
|
@@ -4393,15 +4573,15 @@ var Thumb = import_styled_components18.default.div`
|
|
|
4393
4573
|
`;
|
|
4394
4574
|
var Scrollbar = (props) => {
|
|
4395
4575
|
const { id, className, htmlProps, contentRef, ...rest } = props;
|
|
4396
|
-
const trackRef = (0,
|
|
4397
|
-
const thumbRef = (0,
|
|
4398
|
-
const [thumbHeight, setThumbHeight] = (0,
|
|
4399
|
-
const [isScrollable, setIsScrollable] = (0,
|
|
4400
|
-
const [thumbTop, setThumbTop] = (0,
|
|
4401
|
-
const observer = (0,
|
|
4402
|
-
const [scrollStartPosition, setScrollStartPosition] = (0,
|
|
4403
|
-
const [initialScrollTop, setInitialScrollTop] = (0,
|
|
4404
|
-
const [isDragging, setIsDragging] = (0,
|
|
4576
|
+
const trackRef = (0, import_react23.useRef)(null);
|
|
4577
|
+
const thumbRef = (0, import_react23.useRef)(null);
|
|
4578
|
+
const [thumbHeight, setThumbHeight] = (0, import_react23.useState)(minThumbHeightPx);
|
|
4579
|
+
const [isScrollable, setIsScrollable] = (0, import_react23.useState)(true);
|
|
4580
|
+
const [thumbTop, setThumbTop] = (0, import_react23.useState)(0);
|
|
4581
|
+
const observer = (0, import_react23.useRef)(null);
|
|
4582
|
+
const [scrollStartPosition, setScrollStartPosition] = (0, import_react23.useState)(0);
|
|
4583
|
+
const [initialScrollTop, setInitialScrollTop] = (0, import_react23.useState)(0);
|
|
4584
|
+
const [isDragging, setIsDragging] = (0, import_react23.useState)(false);
|
|
4405
4585
|
function handleResize(ref, trackSize) {
|
|
4406
4586
|
const { clientHeight, scrollHeight } = ref;
|
|
4407
4587
|
setIsScrollable(clientHeight !== scrollHeight);
|
|
@@ -4409,7 +4589,7 @@ var Scrollbar = (props) => {
|
|
|
4409
4589
|
Math.max(clientHeight / scrollHeight * trackSize, minThumbHeightPx)
|
|
4410
4590
|
);
|
|
4411
4591
|
}
|
|
4412
|
-
const handleTrackClick = (0,
|
|
4592
|
+
const handleTrackClick = (0, import_react23.useCallback)(
|
|
4413
4593
|
(e) => {
|
|
4414
4594
|
if (contentRef == null ? void 0 : contentRef.current) {
|
|
4415
4595
|
const { current: trackCurrent } = trackRef;
|
|
@@ -4433,7 +4613,7 @@ var Scrollbar = (props) => {
|
|
|
4433
4613
|
},
|
|
4434
4614
|
[thumbHeight]
|
|
4435
4615
|
);
|
|
4436
|
-
const handleThumbPositioning = (0,
|
|
4616
|
+
const handleThumbPositioning = (0, import_react23.useCallback)(() => {
|
|
4437
4617
|
if (!(contentRef == null ? void 0 : contentRef.current) || !trackRef.current || !thumbRef.current) {
|
|
4438
4618
|
return;
|
|
4439
4619
|
}
|
|
@@ -4443,7 +4623,7 @@ var Scrollbar = (props) => {
|
|
|
4443
4623
|
newTop = Math.min(newTop, clientHeight - thumbHeight);
|
|
4444
4624
|
setThumbTop(newTop);
|
|
4445
4625
|
}, []);
|
|
4446
|
-
(0,
|
|
4626
|
+
(0, import_react23.useEffect)(() => {
|
|
4447
4627
|
if ((contentRef == null ? void 0 : contentRef.current) && trackRef.current) {
|
|
4448
4628
|
const ref = contentRef.current;
|
|
4449
4629
|
const { clientHeight } = trackRef.current;
|
|
@@ -4459,18 +4639,18 @@ var Scrollbar = (props) => {
|
|
|
4459
4639
|
};
|
|
4460
4640
|
}
|
|
4461
4641
|
}, []);
|
|
4462
|
-
const handleThumbMousedown = (0,
|
|
4642
|
+
const handleThumbMousedown = (0, import_react23.useCallback)((e) => {
|
|
4463
4643
|
setScrollStartPosition(e.clientY);
|
|
4464
4644
|
if (contentRef == null ? void 0 : contentRef.current)
|
|
4465
4645
|
setInitialScrollTop(contentRef.current.scrollTop);
|
|
4466
4646
|
setIsDragging(true);
|
|
4467
4647
|
}, []);
|
|
4468
|
-
const handleThumbMouseup = (0,
|
|
4648
|
+
const handleThumbMouseup = (0, import_react23.useCallback)(() => {
|
|
4469
4649
|
if (isDragging) {
|
|
4470
4650
|
setIsDragging(false);
|
|
4471
4651
|
}
|
|
4472
4652
|
}, [isDragging]);
|
|
4473
|
-
const handleThumbMousemove = (0,
|
|
4653
|
+
const handleThumbMousemove = (0, import_react23.useCallback)(
|
|
4474
4654
|
(e) => {
|
|
4475
4655
|
if (contentRef == null ? void 0 : contentRef.current) {
|
|
4476
4656
|
if (isDragging) {
|
|
@@ -4489,7 +4669,7 @@ var Scrollbar = (props) => {
|
|
|
4489
4669
|
},
|
|
4490
4670
|
[isDragging, scrollStartPosition, thumbHeight]
|
|
4491
4671
|
);
|
|
4492
|
-
(0,
|
|
4672
|
+
(0, import_react23.useEffect)(() => {
|
|
4493
4673
|
document.addEventListener("mousemove", handleThumbMousemove);
|
|
4494
4674
|
document.addEventListener("mouseup", handleThumbMouseup);
|
|
4495
4675
|
document.addEventListener("mouseleave", handleThumbMouseup);
|
|
@@ -4499,13 +4679,13 @@ var Scrollbar = (props) => {
|
|
|
4499
4679
|
document.removeEventListener("mouseleave", handleThumbMouseup);
|
|
4500
4680
|
};
|
|
4501
4681
|
}, [handleThumbMousemove, handleThumbMouseup]);
|
|
4502
|
-
return isScrollable ? /* @__PURE__ */ (0,
|
|
4682
|
+
return isScrollable ? /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
|
|
4503
4683
|
ScrollbarOuterWrapper,
|
|
4504
4684
|
{
|
|
4505
4685
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
4506
|
-
children: /* @__PURE__ */ (0,
|
|
4507
|
-
/* @__PURE__ */ (0,
|
|
4508
|
-
/* @__PURE__ */ (0,
|
|
4686
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(ScrollbarElements, { children: [
|
|
4687
|
+
/* @__PURE__ */ (0, import_jsx_runtime174.jsx)(Track, { ref: trackRef, onClick: handleTrackClick }),
|
|
4688
|
+
/* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
|
|
4509
4689
|
Thumb,
|
|
4510
4690
|
{
|
|
4511
4691
|
style: {
|
|
@@ -4523,18 +4703,18 @@ var Scrollbar = (props) => {
|
|
|
4523
4703
|
Scrollbar.displayName = "Scrollbar";
|
|
4524
4704
|
|
|
4525
4705
|
// src/components/ScrollableContainer/ScrollableContainer.tsx
|
|
4526
|
-
var
|
|
4527
|
-
var
|
|
4528
|
-
var
|
|
4706
|
+
var import_react24 = require("react");
|
|
4707
|
+
var import_styled_components20 = __toESM(require("styled-components"));
|
|
4708
|
+
var import_jsx_runtime175 = require("react/jsx-runtime");
|
|
4529
4709
|
var { track: track3, content: content2, outerContainer: outerContainer2 } = scrollbarTokens;
|
|
4530
|
-
var StyledScrollableContainer =
|
|
4710
|
+
var StyledScrollableContainer = import_styled_components20.default.div`
|
|
4531
4711
|
grid-template: auto / 1fr ${track3.width};
|
|
4532
4712
|
overflow: hidden;
|
|
4533
4713
|
position: relative;
|
|
4534
4714
|
display: grid;
|
|
4535
4715
|
padding: ${outerContainer2.padding};
|
|
4536
4716
|
`;
|
|
4537
|
-
var Content =
|
|
4717
|
+
var Content = import_styled_components20.default.div`
|
|
4538
4718
|
height: ${({ $height }) => $height};
|
|
4539
4719
|
overflow: auto;
|
|
4540
4720
|
scrollbar-width: none;
|
|
@@ -4560,14 +4740,14 @@ var ScrollableContainer = (props) => {
|
|
|
4560
4740
|
htmlProps,
|
|
4561
4741
|
...rest
|
|
4562
4742
|
} = props;
|
|
4563
|
-
const ref = (0,
|
|
4564
|
-
return /* @__PURE__ */ (0,
|
|
4743
|
+
const ref = (0, import_react24.useRef)(null);
|
|
4744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(
|
|
4565
4745
|
StyledScrollableContainer,
|
|
4566
4746
|
{
|
|
4567
4747
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
4568
4748
|
children: [
|
|
4569
|
-
/* @__PURE__ */ (0,
|
|
4570
|
-
/* @__PURE__ */ (0,
|
|
4749
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(Content, { $height: contentHeight, ref, tabIndex: 0, children }),
|
|
4750
|
+
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(Scrollbar, { contentRef: ref })
|
|
4571
4751
|
]
|
|
4572
4752
|
}
|
|
4573
4753
|
);
|
|
@@ -4605,187 +4785,6 @@ var scrollbarStyling = {
|
|
|
4605
4785
|
}
|
|
4606
4786
|
};
|
|
4607
4787
|
|
|
4608
|
-
// src/components/OverflowMenu/OverflowMenuItem.tsx
|
|
4609
|
-
var import_react24 = require("react");
|
|
4610
|
-
var import_styled_components20 = __toESM(require("styled-components"));
|
|
4611
|
-
|
|
4612
|
-
// src/components/OverflowMenu/OverflowMenu.tokens.tsx
|
|
4613
|
-
var import_dds_design_tokens22 = require("@norges-domstoler/dds-design-tokens");
|
|
4614
|
-
var { border: border7, borderRadius: borderRadius4, colors: colors11, spacing: spacing9, fontPackages: fontPackages4 } = import_dds_design_tokens22.ddsBaseTokens;
|
|
4615
|
-
var typographyType = "bodySans01";
|
|
4616
|
-
var element = {
|
|
4617
|
-
base: {
|
|
4618
|
-
color: colors11.DdsColorNeutralsGray9,
|
|
4619
|
-
textDecoration: "none",
|
|
4620
|
-
backgroundColor: colors11.DdsColorNeutralsWhite,
|
|
4621
|
-
padding: `${spacing9.SizesDdsSpacingX075} ${spacing9.SizesDdsSpacingX1}`,
|
|
4622
|
-
gap: spacing9.SizesDdsSpacingX025
|
|
4623
|
-
}
|
|
4624
|
-
};
|
|
4625
|
-
var iconHeight = calculateHeightWithLineHeight(
|
|
4626
|
-
fontPackages4.body_sans_01.numbers.lineHeightNumber,
|
|
4627
|
-
fontPackages4.body_sans_01.numbers.fontSizeNumber
|
|
4628
|
-
);
|
|
4629
|
-
var link = {
|
|
4630
|
-
iconWrapper: {
|
|
4631
|
-
height: `${iconHeight}px`
|
|
4632
|
-
},
|
|
4633
|
-
hover: {
|
|
4634
|
-
backgroundColor: colors11.DdsColorInteractiveLightest
|
|
4635
|
-
},
|
|
4636
|
-
active: {
|
|
4637
|
-
backgroundColor: colors11.DdsColorInteractiveLightest
|
|
4638
|
-
}
|
|
4639
|
-
};
|
|
4640
|
-
var container3 = {
|
|
4641
|
-
border: `${border7.BordersDdsBorderStyleLightStrokeWeight} ${border7.BordersDdsBorderStyleLightStroke} solid `,
|
|
4642
|
-
backgroundColor: colors11.DdsColorNeutralsWhite,
|
|
4643
|
-
borderRadius: borderRadius4.RadiiDdsBorderRadius1Radius
|
|
4644
|
-
};
|
|
4645
|
-
var divider2 = {
|
|
4646
|
-
marginRight: spacing9.SizesDdsSpacingX15,
|
|
4647
|
-
marginLeft: spacing9.SizesDdsSpacingX15
|
|
4648
|
-
};
|
|
4649
|
-
var overflowMenuTokens = {
|
|
4650
|
-
container: container3,
|
|
4651
|
-
element,
|
|
4652
|
-
link,
|
|
4653
|
-
divider: divider2,
|
|
4654
|
-
offset: spacing9.SizesDdsSpacingX0125NumberPx
|
|
4655
|
-
};
|
|
4656
|
-
|
|
4657
|
-
// src/components/OverflowMenu/OverflowMenuItem.tsx
|
|
4658
|
-
var import_jsx_runtime175 = require("react/jsx-runtime");
|
|
4659
|
-
var { element: element2, link: link2 } = overflowMenuTokens;
|
|
4660
|
-
var elementBaseCSS = import_styled_components20.css`
|
|
4661
|
-
display: flex;
|
|
4662
|
-
box-sizing: border-box;
|
|
4663
|
-
color: ${element2.base.color};
|
|
4664
|
-
text-decoration: ${element2.base.textDecoration};
|
|
4665
|
-
background-color: ${element2.base.backgroundColor};
|
|
4666
|
-
padding: ${element2.base.padding};
|
|
4667
|
-
gap: ${element2.base.gap};
|
|
4668
|
-
${getFontStyling(typographyType)}
|
|
4669
|
-
`;
|
|
4670
|
-
var Span = import_styled_components20.default.span`
|
|
4671
|
-
${elementBaseCSS}
|
|
4672
|
-
`;
|
|
4673
|
-
var Link2 = import_styled_components20.default.a`
|
|
4674
|
-
${normalizeButton}
|
|
4675
|
-
text-align: left;
|
|
4676
|
-
user-select: text;
|
|
4677
|
-
border: none;
|
|
4678
|
-
cursor: pointer;
|
|
4679
|
-
outline: inherit;
|
|
4680
|
-
width: 100%;
|
|
4681
|
-
${elementBaseCSS}
|
|
4682
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
4683
|
-
transition: background-color 0.2s;
|
|
4684
|
-
}
|
|
4685
|
-
&:hover {
|
|
4686
|
-
background-color: ${link2.hover.backgroundColor};
|
|
4687
|
-
}
|
|
4688
|
-
&:active {
|
|
4689
|
-
background-color: ${link2.active.backgroundColor};
|
|
4690
|
-
}
|
|
4691
|
-
&:focus-visible,
|
|
4692
|
-
&.focus-visible {
|
|
4693
|
-
${focusVisibleLink}
|
|
4694
|
-
}
|
|
4695
|
-
`;
|
|
4696
|
-
var IconWrapper = import_styled_components20.default.span`
|
|
4697
|
-
display: flex;
|
|
4698
|
-
align-items: center;
|
|
4699
|
-
height: ${link2.iconWrapper.height};
|
|
4700
|
-
`;
|
|
4701
|
-
var isAnchorProps2 = (props) => props.href !== void 0;
|
|
4702
|
-
var isButtonProps = (props) => props.href === void 0 && props.onClick !== void 0;
|
|
4703
|
-
var OverflowMenuItem = (0, import_react24.forwardRef)((props, ref) => {
|
|
4704
|
-
const {
|
|
4705
|
-
title: title3,
|
|
4706
|
-
icon: icon12,
|
|
4707
|
-
focus,
|
|
4708
|
-
setFocus,
|
|
4709
|
-
index,
|
|
4710
|
-
id,
|
|
4711
|
-
className,
|
|
4712
|
-
htmlProps = {},
|
|
4713
|
-
...rest
|
|
4714
|
-
} = props;
|
|
4715
|
-
const { onKeyDown } = htmlProps;
|
|
4716
|
-
let href;
|
|
4717
|
-
let onClick;
|
|
4718
|
-
if (isAnchorProps2(props)) {
|
|
4719
|
-
href = props.href;
|
|
4720
|
-
} else if (isButtonProps(props)) {
|
|
4721
|
-
onClick = props.onClick;
|
|
4722
|
-
}
|
|
4723
|
-
const itemRef = (0, import_react24.useRef)(null);
|
|
4724
|
-
const combinedRef = useCombinedRef(ref, itemRef);
|
|
4725
|
-
(0, import_react24.useEffect)(() => {
|
|
4726
|
-
var _a;
|
|
4727
|
-
if (focus) {
|
|
4728
|
-
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
4729
|
-
}
|
|
4730
|
-
}, [focus]);
|
|
4731
|
-
const handleSelect = (0, import_react24.useCallback)(() => {
|
|
4732
|
-
if (setFocus && index) {
|
|
4733
|
-
setFocus(index);
|
|
4734
|
-
}
|
|
4735
|
-
}, [index, setFocus]);
|
|
4736
|
-
const handleOnClick = (e) => {
|
|
4737
|
-
handleSelect();
|
|
4738
|
-
onClick && onClick(e);
|
|
4739
|
-
};
|
|
4740
|
-
const handleOnKeyDown = (e) => {
|
|
4741
|
-
handleSelect();
|
|
4742
|
-
onKeyDown && onKeyDown(e);
|
|
4743
|
-
};
|
|
4744
|
-
const linkProps = {
|
|
4745
|
-
href,
|
|
4746
|
-
onClick: handleOnClick,
|
|
4747
|
-
onKeyDown: handleOnKeyDown,
|
|
4748
|
-
role: "menuitem",
|
|
4749
|
-
tabIndex: focus ? 0 : -1
|
|
4750
|
-
};
|
|
4751
|
-
const iconElement = icon12 && /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(Icon, { iconSize: "inherit", icon: icon12 });
|
|
4752
|
-
if (!href && !onClick) {
|
|
4753
|
-
return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(Span, { ...{ ...getBaseHTMLProps(id, className, htmlProps, rest), ref }, children: [
|
|
4754
|
-
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(IconWrapper, { children: iconElement }),
|
|
4755
|
-
title3
|
|
4756
|
-
] });
|
|
4757
|
-
}
|
|
4758
|
-
if (!href) {
|
|
4759
|
-
return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(
|
|
4760
|
-
Link2,
|
|
4761
|
-
{
|
|
4762
|
-
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
4763
|
-
...linkProps,
|
|
4764
|
-
as: "button",
|
|
4765
|
-
ref: combinedRef,
|
|
4766
|
-
children: [
|
|
4767
|
-
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(IconWrapper, { children: iconElement }),
|
|
4768
|
-
title3
|
|
4769
|
-
]
|
|
4770
|
-
}
|
|
4771
|
-
);
|
|
4772
|
-
}
|
|
4773
|
-
return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(
|
|
4774
|
-
Link2,
|
|
4775
|
-
{
|
|
4776
|
-
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
4777
|
-
...linkProps,
|
|
4778
|
-
as: "a",
|
|
4779
|
-
ref: combinedRef,
|
|
4780
|
-
children: [
|
|
4781
|
-
/* @__PURE__ */ (0, import_jsx_runtime175.jsx)(IconWrapper, { children: iconElement }),
|
|
4782
|
-
title3
|
|
4783
|
-
]
|
|
4784
|
-
}
|
|
4785
|
-
);
|
|
4786
|
-
});
|
|
4787
|
-
OverflowMenuItem.displayName = "OverflowMenuItem";
|
|
4788
|
-
|
|
4789
4788
|
// src/components/OverflowMenu/OverflowMenu.tsx
|
|
4790
4789
|
var import_jsx_runtime176 = require("react/jsx-runtime");
|
|
4791
4790
|
var { container: container4, divider: divider3 } = overflowMenuTokens;
|
|
@@ -5100,7 +5099,6 @@ var TopBar = ({
|
|
|
5100
5099
|
};
|
|
5101
5100
|
|
|
5102
5101
|
// src/components/AppShell/Navigation/Navigation.tsx
|
|
5103
|
-
var import_development_utils2 = require("@norges-domstoler/development-utils");
|
|
5104
5102
|
var import_jsx_runtime179 = require("react/jsx-runtime");
|
|
5105
5103
|
var { navigation: navTokens4 } = appShellTokens;
|
|
5106
5104
|
var Sidebar = import_styled_components23.default.div.withConfig({
|
|
@@ -5240,7 +5238,6 @@ var Navigation = ({
|
|
|
5240
5238
|
};
|
|
5241
5239
|
|
|
5242
5240
|
// src/components/AppShell/AppShell.tsx
|
|
5243
|
-
var import_development_utils3 = require("@norges-domstoler/development-utils");
|
|
5244
5241
|
var import_jsx_runtime180 = require("react/jsx-runtime");
|
|
5245
5242
|
var AppShellContainer = import_styled_components24.default.div`
|
|
5246
5243
|
display: flex;
|
|
@@ -5300,8 +5297,8 @@ AppShell2.NavItem = NavigationItem;
|
|
|
5300
5297
|
var import_react29 = require("react");
|
|
5301
5298
|
|
|
5302
5299
|
// src/components/SelectionControl/RadioButton/RadioButtonGroupContext.tsx
|
|
5303
|
-
var import_react28 =
|
|
5304
|
-
var RadioButtonGroupContext = import_react28.
|
|
5300
|
+
var import_react28 = require("react");
|
|
5301
|
+
var RadioButtonGroupContext = (0, import_react28.createContext)(null);
|
|
5305
5302
|
var useRadioButtonGroup = () => {
|
|
5306
5303
|
return (0, import_react28.useContext)(RadioButtonGroupContext);
|
|
5307
5304
|
};
|
|
@@ -5743,15 +5740,15 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
5743
5740
|
}
|
|
5744
5741
|
);
|
|
5745
5742
|
};
|
|
5746
|
-
var
|
|
5747
|
-
|
|
5743
|
+
var RadioButtonGroup = (0, import_react30.forwardRef)(RadioButtonGroupInner);
|
|
5744
|
+
RadioButtonGroup.displayName = "RadioButtonGroup";
|
|
5748
5745
|
|
|
5749
5746
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
5750
5747
|
var import_react32 = require("react");
|
|
5751
5748
|
|
|
5752
5749
|
// src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
|
|
5753
|
-
var import_react31 =
|
|
5754
|
-
var CheckboxGroupContext = import_react31.
|
|
5750
|
+
var import_react31 = require("react");
|
|
5751
|
+
var CheckboxGroupContext = (0, import_react31.createContext)(null);
|
|
5755
5752
|
var useCheckboxGroup = () => {
|
|
5756
5753
|
return (0, import_react31.useContext)(CheckboxGroupContext);
|
|
5757
5754
|
};
|
|
@@ -5897,6 +5894,38 @@ CheckboxGroup.displayName = "CheckboxGroup";
|
|
|
5897
5894
|
var import_react35 = require("react");
|
|
5898
5895
|
var import_styled_components28 = __toESM(require("styled-components"));
|
|
5899
5896
|
|
|
5897
|
+
// src/components/TextInput/CharCounter.tsx
|
|
5898
|
+
var import_react34 = require("react");
|
|
5899
|
+
var import_styled_components26 = __toESM(require("styled-components"));
|
|
5900
|
+
var import_jsx_runtime185 = require("react/jsx-runtime");
|
|
5901
|
+
var Wrapper = (0, import_styled_components26.default)(Typography)`
|
|
5902
|
+
margin-left: auto;
|
|
5903
|
+
`;
|
|
5904
|
+
function CharCounter(props) {
|
|
5905
|
+
const { current, max, id, className, htmlProps, ...rest } = props;
|
|
5906
|
+
const generatedId = (0, import_react34.useId)();
|
|
5907
|
+
const uniqueId = id != null ? id : `${generatedId}-characterCounter`;
|
|
5908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
|
|
5909
|
+
Wrapper,
|
|
5910
|
+
{
|
|
5911
|
+
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
5912
|
+
forwardedAs: "div",
|
|
5913
|
+
typographyType: "supportingStyleHelperText01",
|
|
5914
|
+
"aria-label": `${current} av ${max} tegn skrevet`,
|
|
5915
|
+
children: [
|
|
5916
|
+
current,
|
|
5917
|
+
"/",
|
|
5918
|
+
max
|
|
5919
|
+
]
|
|
5920
|
+
}
|
|
5921
|
+
);
|
|
5922
|
+
}
|
|
5923
|
+
var CharCounter_default = CharCounter;
|
|
5924
|
+
|
|
5925
|
+
// src/components/TextInput/TextInput.styles.tsx
|
|
5926
|
+
var import_dds_design_tokens25 = require("@norges-domstoler/dds-design-tokens");
|
|
5927
|
+
var import_styled_components27 = __toESM(require("styled-components"));
|
|
5928
|
+
|
|
5900
5929
|
// src/components/TextInput/TextInput.tokens.tsx
|
|
5901
5930
|
var import_dds_design_tokens24 = require("@norges-domstoler/dds-design-tokens");
|
|
5902
5931
|
var { colors: colors13, spacing: spacing11, iconSizes } = import_dds_design_tokens24.ddsBaseTokens;
|
|
@@ -5941,37 +5970,7 @@ var textInputTokens = {
|
|
|
5941
5970
|
affix
|
|
5942
5971
|
};
|
|
5943
5972
|
|
|
5944
|
-
// src/components/TextInput/CharCounter.tsx
|
|
5945
|
-
var import_react34 = require("react");
|
|
5946
|
-
var import_styled_components26 = __toESM(require("styled-components"));
|
|
5947
|
-
var import_jsx_runtime185 = require("react/jsx-runtime");
|
|
5948
|
-
var Wrapper = (0, import_styled_components26.default)(Typography)`
|
|
5949
|
-
margin-left: auto;
|
|
5950
|
-
`;
|
|
5951
|
-
function CharCounter(props) {
|
|
5952
|
-
const { current, max, id, className, htmlProps, ...rest } = props;
|
|
5953
|
-
const generatedId = (0, import_react34.useId)();
|
|
5954
|
-
const uniqueId = id != null ? id : `${generatedId}-characterCounter`;
|
|
5955
|
-
return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(
|
|
5956
|
-
Wrapper,
|
|
5957
|
-
{
|
|
5958
|
-
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
5959
|
-
forwardedAs: "div",
|
|
5960
|
-
typographyType: "supportingStyleHelperText01",
|
|
5961
|
-
"aria-label": `${current} av ${max} tegn skrevet`,
|
|
5962
|
-
children: [
|
|
5963
|
-
current,
|
|
5964
|
-
"/",
|
|
5965
|
-
max
|
|
5966
|
-
]
|
|
5967
|
-
}
|
|
5968
|
-
);
|
|
5969
|
-
}
|
|
5970
|
-
var CharCounter_default = CharCounter;
|
|
5971
|
-
|
|
5972
5973
|
// src/components/TextInput/TextInput.styles.tsx
|
|
5973
|
-
var import_styled_components27 = __toESM(require("styled-components"));
|
|
5974
|
-
var import_dds_design_tokens25 = require("@norges-domstoler/dds-design-tokens");
|
|
5975
5974
|
var { iconSizes: iconSizes2 } = import_dds_design_tokens25.ddsBaseTokens;
|
|
5976
5975
|
var { input: input4, icon: icon3 } = textInputTokens;
|
|
5977
5976
|
var MessageContainer = import_styled_components27.default.div`
|
|
@@ -6200,7 +6199,7 @@ var TextInput2 = (0, import_react35.forwardRef)(
|
|
|
6200
6199
|
TextInput2.displayName = "TextInput";
|
|
6201
6200
|
|
|
6202
6201
|
// src/components/Select/Select.tsx
|
|
6203
|
-
var import_react36 =
|
|
6202
|
+
var import_react36 = require("react");
|
|
6204
6203
|
var import_react_select2 = __toESM(require("react-select"));
|
|
6205
6204
|
|
|
6206
6205
|
// src/components/Select/Select.styles.ts
|
|
@@ -6749,15 +6748,15 @@ function SelectInner(props, ref) {
|
|
|
6749
6748
|
renderInputMessage(tip, tipId, errorMessage, errorMessageId)
|
|
6750
6749
|
] });
|
|
6751
6750
|
}
|
|
6752
|
-
var Select = import_react36.
|
|
6751
|
+
var Select = (0, import_react36.forwardRef)(SelectInner);
|
|
6753
6752
|
Select.displayName = "Select";
|
|
6754
6753
|
|
|
6755
6754
|
// src/components/Select/utils.ts
|
|
6756
6755
|
var createSelectOptions = (...args) => args.map((v) => ({ label: v, value: v }));
|
|
6757
6756
|
|
|
6758
6757
|
// src/components/GlobalMessage/GlobalMessage.tsx
|
|
6759
|
-
var import_styled_components30 = __toESM(require("styled-components"));
|
|
6760
6758
|
var import_react37 = require("react");
|
|
6759
|
+
var import_styled_components30 = __toESM(require("styled-components"));
|
|
6761
6760
|
|
|
6762
6761
|
// src/components/GlobalMessage/GlobalMessage.tokens.tsx
|
|
6763
6762
|
var import_dds_design_tokens27 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -6903,8 +6902,8 @@ var GlobalMessage = (0, import_react37.forwardRef)(
|
|
|
6903
6902
|
GlobalMessage.displayName = "GlobalMessage";
|
|
6904
6903
|
|
|
6905
6904
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
6906
|
-
var import_styled_components31 = __toESM(require("styled-components"));
|
|
6907
6905
|
var import_react38 = require("react");
|
|
6906
|
+
var import_styled_components31 = __toESM(require("styled-components"));
|
|
6908
6907
|
|
|
6909
6908
|
// src/components/LocalMessage/LocalMessage.tokens.tsx
|
|
6910
6909
|
var import_dds_design_tokens28 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -7121,31 +7120,6 @@ LocalMessage.displayName = "LocalMessage";
|
|
|
7121
7120
|
var import_react41 = require("react");
|
|
7122
7121
|
var import_styled_components34 = __toESM(require("styled-components"));
|
|
7123
7122
|
|
|
7124
|
-
// src/components/VisuallyHidden/VisuallyHidden.tsx
|
|
7125
|
-
var import_styled_components32 = __toESM(require("styled-components"));
|
|
7126
|
-
var import_jsx_runtime191 = require("react/jsx-runtime");
|
|
7127
|
-
var Wrapper2 = import_styled_components32.default.span`
|
|
7128
|
-
position: absolute;
|
|
7129
|
-
width: 1px;
|
|
7130
|
-
height: 1px;
|
|
7131
|
-
margin: 0px;
|
|
7132
|
-
padding: 0px;
|
|
7133
|
-
top: 0px;
|
|
7134
|
-
inset-inline-start: 0px;
|
|
7135
|
-
overflow: hidden;
|
|
7136
|
-
clip: rect(0, 0, 0, 0);
|
|
7137
|
-
clip-path: inset(50%);
|
|
7138
|
-
border: 0px;
|
|
7139
|
-
`;
|
|
7140
|
-
var VisuallyHidden = (props) => {
|
|
7141
|
-
const { children, id, className, htmlProps, as, ...rest } = props;
|
|
7142
|
-
if (as === "div") {
|
|
7143
|
-
return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(Wrapper2, { ...getBaseHTMLProps(id, className, htmlProps, rest), as, children });
|
|
7144
|
-
}
|
|
7145
|
-
return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(Wrapper2, { ...getBaseHTMLProps(id, className, htmlProps, rest), children });
|
|
7146
|
-
};
|
|
7147
|
-
VisuallyHidden.displayName = "VisuallyHidden";
|
|
7148
|
-
|
|
7149
7123
|
// src/components/Search/AutocompleteSearch.context.tsx
|
|
7150
7124
|
var import_react39 = require("react");
|
|
7151
7125
|
var AutocompleteSearchContext = (0, import_react39.createContext)({});
|
|
@@ -7260,11 +7234,11 @@ function createEmptyChangeEvent(inputElementId) {
|
|
|
7260
7234
|
}
|
|
7261
7235
|
|
|
7262
7236
|
// src/components/Search/SearchSuggestions.tsx
|
|
7263
|
-
var import_styled_components33 = __toESM(require("styled-components"));
|
|
7264
7237
|
var import_react40 = require("react");
|
|
7265
|
-
var
|
|
7238
|
+
var import_styled_components32 = __toESM(require("styled-components"));
|
|
7239
|
+
var import_jsx_runtime191 = require("react/jsx-runtime");
|
|
7266
7240
|
var { suggestionsContainer: suggestionsContainer2, suggestionsHeader: suggestionsHeader2 } = searchTokens;
|
|
7267
|
-
var SuggestionsContainer = (0,
|
|
7241
|
+
var SuggestionsContainer = (0, import_styled_components32.default)(Paper)`
|
|
7268
7242
|
${({ $isHidden }) => visibilityTransition(!$isHidden)};
|
|
7269
7243
|
position: absolute;
|
|
7270
7244
|
top: 100%;
|
|
@@ -7278,13 +7252,13 @@ var SuggestionsContainer = (0, import_styled_components33.default)(Paper)`
|
|
|
7278
7252
|
${scrollbarStyling.firefox}
|
|
7279
7253
|
${scrollbarStyling.webkit}
|
|
7280
7254
|
`;
|
|
7281
|
-
var MenuItem = (0,
|
|
7255
|
+
var MenuItem = (0, import_styled_components32.default)(OverflowMenuItem)`
|
|
7282
7256
|
${({ $size }) => $size && getFontStyling(typographyTypes3[$size])}
|
|
7283
7257
|
`;
|
|
7284
|
-
var SuggestionsList =
|
|
7258
|
+
var SuggestionsList = import_styled_components32.default.ul`
|
|
7285
7259
|
${removeListStyling}
|
|
7286
7260
|
`;
|
|
7287
|
-
var SuggestionsHeader = (0,
|
|
7261
|
+
var SuggestionsHeader = (0, import_styled_components32.default)(Typography)`
|
|
7288
7262
|
padding-left: ${suggestionsHeader2.paddingLeft};
|
|
7289
7263
|
`;
|
|
7290
7264
|
var SearchSuggestions = (0, import_react40.forwardRef)((props, ref) => {
|
|
@@ -7306,8 +7280,8 @@ var SearchSuggestions = (0, import_react40.forwardRef)((props, ref) => {
|
|
|
7306
7280
|
);
|
|
7307
7281
|
const [focus, setFocus] = useRoveFocus(suggestions == null ? void 0 : suggestions.length, !showSuggestions);
|
|
7308
7282
|
const suggestionsToRender = maxSuggestions ? suggestions == null ? void 0 : suggestions.slice(maxSuggestions) : suggestions;
|
|
7309
|
-
const renderedSuggestions = /* @__PURE__ */ (0,
|
|
7310
|
-
return /* @__PURE__ */ (0,
|
|
7283
|
+
const renderedSuggestions = /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(SuggestionsList, { role: "listbox", "aria-labelledby": suggestionsHeaderId, children: suggestionsToRender.map((suggestion, index) => {
|
|
7284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("li", { role: "option", children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
7311
7285
|
MenuItem,
|
|
7312
7286
|
{
|
|
7313
7287
|
index,
|
|
@@ -7323,7 +7297,7 @@ var SearchSuggestions = (0, import_react40.forwardRef)((props, ref) => {
|
|
|
7323
7297
|
) }, index);
|
|
7324
7298
|
}) });
|
|
7325
7299
|
const isHidden = !showSuggestions;
|
|
7326
|
-
return /* @__PURE__ */ (0,
|
|
7300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(
|
|
7327
7301
|
SuggestionsContainer,
|
|
7328
7302
|
{
|
|
7329
7303
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -7331,7 +7305,7 @@ var SearchSuggestions = (0, import_react40.forwardRef)((props, ref) => {
|
|
|
7331
7305
|
$isHidden: isHidden,
|
|
7332
7306
|
"aria-hidden": isHidden,
|
|
7333
7307
|
children: [
|
|
7334
|
-
/* @__PURE__ */ (0,
|
|
7308
|
+
/* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
|
|
7335
7309
|
SuggestionsHeader,
|
|
7336
7310
|
{
|
|
7337
7311
|
typographyType: "supportingStyleTiny01",
|
|
@@ -7347,6 +7321,31 @@ var SearchSuggestions = (0, import_react40.forwardRef)((props, ref) => {
|
|
|
7347
7321
|
});
|
|
7348
7322
|
SearchSuggestions.displayName = "SearchSuggestions";
|
|
7349
7323
|
|
|
7324
|
+
// src/components/VisuallyHidden/VisuallyHidden.tsx
|
|
7325
|
+
var import_styled_components33 = __toESM(require("styled-components"));
|
|
7326
|
+
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
7327
|
+
var Wrapper2 = import_styled_components33.default.span`
|
|
7328
|
+
position: absolute;
|
|
7329
|
+
width: 1px;
|
|
7330
|
+
height: 1px;
|
|
7331
|
+
margin: 0px;
|
|
7332
|
+
padding: 0px;
|
|
7333
|
+
top: 0px;
|
|
7334
|
+
inset-inline-start: 0px;
|
|
7335
|
+
overflow: hidden;
|
|
7336
|
+
clip: rect(0, 0, 0, 0);
|
|
7337
|
+
clip-path: inset(50%);
|
|
7338
|
+
border: 0px;
|
|
7339
|
+
`;
|
|
7340
|
+
var VisuallyHidden = (props) => {
|
|
7341
|
+
const { children, id, className, htmlProps, as, ...rest } = props;
|
|
7342
|
+
if (as === "div") {
|
|
7343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(Wrapper2, { ...getBaseHTMLProps(id, className, htmlProps, rest), as, children });
|
|
7344
|
+
}
|
|
7345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(Wrapper2, { ...getBaseHTMLProps(id, className, htmlProps, rest), children });
|
|
7346
|
+
};
|
|
7347
|
+
VisuallyHidden.displayName = "VisuallyHidden";
|
|
7348
|
+
|
|
7350
7349
|
// src/components/Search/Search.tsx
|
|
7351
7350
|
var import_jsx_runtime193 = require("react/jsx-runtime");
|
|
7352
7351
|
var { input: input6, outerContainer: outerContainer4, horisontalContainer: horisontalContainer2, searchIcon: searchIcon2, clearButton: clearButton2 } = searchTokens;
|
|
@@ -7626,9 +7625,41 @@ var Search2 = Search;
|
|
|
7626
7625
|
Search2.AutocompleteWrapper = SearchAutocompleteWrapper;
|
|
7627
7626
|
Search2.Suggestions = SearchSuggestions;
|
|
7628
7627
|
|
|
7629
|
-
// src/components/Table/
|
|
7628
|
+
// src/components/Table/Body.tsx
|
|
7630
7629
|
var import_react43 = require("react");
|
|
7631
7630
|
var import_styled_components35 = __toESM(require("styled-components"));
|
|
7631
|
+
var import_jsx_runtime195 = require("react/jsx-runtime");
|
|
7632
|
+
var StyledBody = import_styled_components35.default.tbody``;
|
|
7633
|
+
var Body = (0, import_react43.forwardRef)(
|
|
7634
|
+
({ children, ...rest }, ref) => {
|
|
7635
|
+
const bodyProps = {
|
|
7636
|
+
...rest
|
|
7637
|
+
};
|
|
7638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(StyledBody, { ref, ...bodyProps, children });
|
|
7639
|
+
}
|
|
7640
|
+
);
|
|
7641
|
+
Body.displayName = "Table.Body";
|
|
7642
|
+
|
|
7643
|
+
// src/components/Table/Cell.tsx
|
|
7644
|
+
var import_react49 = require("react");
|
|
7645
|
+
var import_styled_components41 = __toESM(require("styled-components"));
|
|
7646
|
+
|
|
7647
|
+
// src/components/Table/Head.tsx
|
|
7648
|
+
var import_react44 = require("react");
|
|
7649
|
+
var import_styled_components36 = __toESM(require("styled-components"));
|
|
7650
|
+
var import_jsx_runtime196 = require("react/jsx-runtime");
|
|
7651
|
+
var StyledHead = import_styled_components36.default.thead``;
|
|
7652
|
+
var Head = (0, import_react44.forwardRef)(
|
|
7653
|
+
({ children, ...rest }, ref) => {
|
|
7654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(StyledHead, { ref, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(HeadContext.Provider, { value: true, children }) });
|
|
7655
|
+
}
|
|
7656
|
+
);
|
|
7657
|
+
Head.displayName = "Table.Head";
|
|
7658
|
+
var HeadContext = (0, import_react44.createContext)(false);
|
|
7659
|
+
function useIsInTableHead() {
|
|
7660
|
+
const isInTableHead = (0, import_react44.useContext)(HeadContext);
|
|
7661
|
+
return isInTableHead;
|
|
7662
|
+
}
|
|
7632
7663
|
|
|
7633
7664
|
// src/components/Table/Table.tokens.tsx
|
|
7634
7665
|
var import_dds_design_tokens30 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -7702,235 +7733,9 @@ var tableTokens = {
|
|
|
7702
7733
|
collapseButton
|
|
7703
7734
|
};
|
|
7704
7735
|
|
|
7705
|
-
// src/components/
|
|
7706
|
-
var import_jsx_runtime195 = require("react/jsx-runtime");
|
|
7707
|
-
var { cell: cell2, row: row2 } = tableTokens;
|
|
7708
|
-
var StyledTable = import_styled_components35.default.table`
|
|
7709
|
-
border-spacing: 0;
|
|
7710
|
-
border-collapse: collapse;
|
|
7711
|
-
*::selection {
|
|
7712
|
-
${selection}
|
|
7713
|
-
}
|
|
7714
|
-
${scrollbarStyling.webkit}
|
|
7715
|
-
${scrollbarStyling.firefox}
|
|
7716
|
-
${({ $density }) => import_styled_components35.css`
|
|
7717
|
-
td,
|
|
7718
|
-
th {
|
|
7719
|
-
padding: ${cell2.density[$density].padding};
|
|
7720
|
-
}
|
|
7721
|
-
`}
|
|
7722
|
-
${({ $density }) => $density === "extraCompact" && import_styled_components35.css`
|
|
7723
|
-
th {
|
|
7724
|
-
background-color: ${row2.head.extraCompact.backgroundColor};
|
|
7725
|
-
font-size: ${row2.head.extraCompact.fontSize};
|
|
7726
|
-
}
|
|
7727
|
-
tr[type='body'] {
|
|
7728
|
-
&:nth-of-type(even) {
|
|
7729
|
-
background-color: ${row2.body.odd.backgroundColor};
|
|
7730
|
-
}
|
|
7731
|
-
&:nth-of-type(odd) {
|
|
7732
|
-
background-color: ${row2.body.even.backgroundColor};
|
|
7733
|
-
}
|
|
7734
|
-
}
|
|
7735
|
-
`}
|
|
7736
|
-
${({ $stickyHeader }) => $stickyHeader && import_styled_components35.css`
|
|
7737
|
-
tr[type='head'] {
|
|
7738
|
-
th[type='head'] {
|
|
7739
|
-
position: sticky;
|
|
7740
|
-
top: 0;
|
|
7741
|
-
z-index: 50;
|
|
7742
|
-
}
|
|
7743
|
-
}
|
|
7744
|
-
`}
|
|
7745
|
-
${({ $withDividers }) => $withDividers && import_styled_components35.css`
|
|
7746
|
-
tr[type='body'] {
|
|
7747
|
-
border-bottom: ${row2.body.withDividers.borderBottom};
|
|
7748
|
-
}
|
|
7749
|
-
`}
|
|
7750
|
-
`;
|
|
7751
|
-
var Table = (0, import_react43.forwardRef)(
|
|
7752
|
-
({ density = "normal", stickyHeader, withDividers, children, ...rest }, ref) => {
|
|
7753
|
-
return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
7754
|
-
StyledTable,
|
|
7755
|
-
{
|
|
7756
|
-
...rest,
|
|
7757
|
-
ref,
|
|
7758
|
-
$density: density,
|
|
7759
|
-
$stickyHeader: stickyHeader,
|
|
7760
|
-
$withDividers: withDividers,
|
|
7761
|
-
children
|
|
7762
|
-
}
|
|
7763
|
-
);
|
|
7764
|
-
}
|
|
7765
|
-
);
|
|
7766
|
-
Table.displayName = "Table";
|
|
7767
|
-
|
|
7768
|
-
// src/components/Table/collapsible/CollapsibleTable.tsx
|
|
7736
|
+
// src/components/DescriptionList/DescriptionList.tsx
|
|
7769
7737
|
var import_react45 = require("react");
|
|
7770
|
-
var import_styled_components36 = __toESM(require("styled-components"));
|
|
7771
|
-
|
|
7772
|
-
// src/components/Table/collapsible/Table.context.tsx
|
|
7773
|
-
var import_react44 = require("react");
|
|
7774
|
-
var CollapsibleTableContext = (0, import_react44.createContext)({
|
|
7775
|
-
headerValues: [],
|
|
7776
|
-
definingColumnIndex: [0]
|
|
7777
|
-
});
|
|
7778
|
-
var useCollapsibleTableContext = () => (0, import_react44.useContext)(CollapsibleTableContext);
|
|
7779
|
-
|
|
7780
|
-
// src/components/Table/collapsible/CollapsibleTable.tsx
|
|
7781
|
-
var import_jsx_runtime196 = require("react/jsx-runtime");
|
|
7782
|
-
var StyledTable2 = (0, import_styled_components36.default)(Table)`
|
|
7783
|
-
width: 100%;
|
|
7784
|
-
${({ withDividers }) => withDividers && import_styled_components36.css`
|
|
7785
|
-
tr[data-isopencollapsibleheader='true'] {
|
|
7786
|
-
border-bottom: none;
|
|
7787
|
-
}
|
|
7788
|
-
`}
|
|
7789
|
-
`;
|
|
7790
|
-
var CollapsibleTable = (0, import_react45.forwardRef)((props, ref) => {
|
|
7791
|
-
const {
|
|
7792
|
-
density = "normal",
|
|
7793
|
-
children,
|
|
7794
|
-
isCollapsed,
|
|
7795
|
-
headerValues,
|
|
7796
|
-
definingColumnIndex = [0],
|
|
7797
|
-
...rest
|
|
7798
|
-
} = props;
|
|
7799
|
-
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
7800
|
-
CollapsibleTableContext.Provider,
|
|
7801
|
-
{
|
|
7802
|
-
value: {
|
|
7803
|
-
isCollapsed,
|
|
7804
|
-
headerValues,
|
|
7805
|
-
definingColumnIndex
|
|
7806
|
-
},
|
|
7807
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(StyledTable2, { ref, density, ...rest, children })
|
|
7808
|
-
}
|
|
7809
|
-
);
|
|
7810
|
-
});
|
|
7811
|
-
CollapsibleTable.displayName = "CollapsibleTable";
|
|
7812
|
-
|
|
7813
|
-
// src/components/Table/Head.tsx
|
|
7814
|
-
var import_react46 = require("react");
|
|
7815
7738
|
var import_styled_components37 = __toESM(require("styled-components"));
|
|
7816
|
-
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
7817
|
-
var StyledHead = import_styled_components37.default.thead``;
|
|
7818
|
-
var Head = (0, import_react46.forwardRef)(
|
|
7819
|
-
({ children, ...rest }, ref) => {
|
|
7820
|
-
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(StyledHead, { ref, ...rest, children });
|
|
7821
|
-
}
|
|
7822
|
-
);
|
|
7823
|
-
Head.displayName = "Table.Head";
|
|
7824
|
-
|
|
7825
|
-
// src/components/Table/Body.tsx
|
|
7826
|
-
var import_react47 = require("react");
|
|
7827
|
-
var import_styled_components38 = __toESM(require("styled-components"));
|
|
7828
|
-
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
7829
|
-
var StyledBody = import_styled_components38.default.tbody``;
|
|
7830
|
-
var Body = (0, import_react47.forwardRef)(
|
|
7831
|
-
({ children, ...rest }, ref) => {
|
|
7832
|
-
const bodyProps = {
|
|
7833
|
-
...rest
|
|
7834
|
-
};
|
|
7835
|
-
return /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(StyledBody, { ref, ...bodyProps, children });
|
|
7836
|
-
}
|
|
7837
|
-
);
|
|
7838
|
-
Body.displayName = "Table.Body";
|
|
7839
|
-
|
|
7840
|
-
// src/components/Table/Foot.tsx
|
|
7841
|
-
var import_react48 = require("react");
|
|
7842
|
-
var import_styled_components39 = __toESM(require("styled-components"));
|
|
7843
|
-
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
7844
|
-
var StyledFoot = import_styled_components39.default.tfoot``;
|
|
7845
|
-
var Foot = (0, import_react48.forwardRef)(
|
|
7846
|
-
({ children, ...rest }, ref) => {
|
|
7847
|
-
return /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(StyledFoot, { ref, ...rest, children });
|
|
7848
|
-
}
|
|
7849
|
-
);
|
|
7850
|
-
Foot.displayName = "Table.Foot";
|
|
7851
|
-
|
|
7852
|
-
// src/components/Table/Row.tsx
|
|
7853
|
-
var import_react49 = require("react");
|
|
7854
|
-
|
|
7855
|
-
// src/components/Table/Table.styles.tsx
|
|
7856
|
-
var import_styled_components40 = __toESM(require("styled-components"));
|
|
7857
|
-
var { row: row3 } = tableTokens;
|
|
7858
|
-
var bodyRowStyles = (mode, selected) => {
|
|
7859
|
-
return import_styled_components40.css`
|
|
7860
|
-
${mode === "sum" && import_styled_components40.css`
|
|
7861
|
-
font-weight: 600;
|
|
7862
|
-
border-top: ${row3.body.mode.sum.borderTop};
|
|
7863
|
-
border-bottom: ${row3.body.mode.sum.borderBottom};
|
|
7864
|
-
background-color: ${row3.body.mode.sum.backgroundColor};
|
|
7865
|
-
`}
|
|
7866
|
-
${selected && import_styled_components40.css`
|
|
7867
|
-
background-color: ${row3.body.selected.backgroundColor};
|
|
7868
|
-
`}
|
|
7869
|
-
`;
|
|
7870
|
-
};
|
|
7871
|
-
var StyledRow = import_styled_components40.default.tr`
|
|
7872
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
7873
|
-
transition:
|
|
7874
|
-
background-color 0.2s,
|
|
7875
|
-
border-color 0.2s,
|
|
7876
|
-
box-shadow 0.2s;
|
|
7877
|
-
}
|
|
7878
|
-
|
|
7879
|
-
${getFontStyling(defaultTypographyType, true)}
|
|
7880
|
-
|
|
7881
|
-
${({ type }) => type === "head" && import_styled_components40.css`
|
|
7882
|
-
font-weight: 600;
|
|
7883
|
-
text-align: left;
|
|
7884
|
-
`}
|
|
7885
|
-
${({ type, $mode: mode, $selected: selected, $hoverable: hoverable }) => type === "body" && import_styled_components40.css`
|
|
7886
|
-
&:nth-of-type(even) {
|
|
7887
|
-
background-color: ${row3.body.even.backgroundColor};
|
|
7888
|
-
${bodyRowStyles(mode, selected)}
|
|
7889
|
-
}
|
|
7890
|
-
|
|
7891
|
-
&:nth-of-type(odd) {
|
|
7892
|
-
background-color: ${row3.body.odd.backgroundColor};
|
|
7893
|
-
${bodyRowStyles(mode, selected)}
|
|
7894
|
-
}
|
|
7895
|
-
|
|
7896
|
-
${hoverable && import_styled_components40.css`
|
|
7897
|
-
&:hover {
|
|
7898
|
-
background-color: ${row3.body.hover.backgroundColor};
|
|
7899
|
-
}
|
|
7900
|
-
`}
|
|
7901
|
-
&:focus-visible, &.focus-visible {
|
|
7902
|
-
${focusVisibleInset}
|
|
7903
|
-
}
|
|
7904
|
-
`}
|
|
7905
|
-
`;
|
|
7906
|
-
|
|
7907
|
-
// src/components/Table/Row.tsx
|
|
7908
|
-
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
7909
|
-
var Row = (0, import_react49.forwardRef)(
|
|
7910
|
-
({ type = "body", mode = "normal", hoverable, selected, children, ...rest }, ref) => {
|
|
7911
|
-
return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
7912
|
-
StyledRow,
|
|
7913
|
-
{
|
|
7914
|
-
type,
|
|
7915
|
-
$mode: mode,
|
|
7916
|
-
$hoverable: hoverable,
|
|
7917
|
-
$selected: selected,
|
|
7918
|
-
ref,
|
|
7919
|
-
...rest,
|
|
7920
|
-
children
|
|
7921
|
-
}
|
|
7922
|
-
);
|
|
7923
|
-
}
|
|
7924
|
-
);
|
|
7925
|
-
Row.displayName = "Table.Row";
|
|
7926
|
-
|
|
7927
|
-
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
7928
|
-
var import_react55 = require("react");
|
|
7929
|
-
var import_styled_components46 = __toESM(require("styled-components"));
|
|
7930
|
-
|
|
7931
|
-
// src/components/DescriptionList/DescriptionList.tsx
|
|
7932
|
-
var import_react50 = require("react");
|
|
7933
|
-
var import_styled_components41 = __toESM(require("styled-components"));
|
|
7934
7739
|
|
|
7935
7740
|
// src/components/DescriptionList/DescriptionList.tokens.tsx
|
|
7936
7741
|
var import_dds_design_tokens31 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -7978,19 +7783,19 @@ var descriptionListTokens = {
|
|
|
7978
7783
|
};
|
|
7979
7784
|
|
|
7980
7785
|
// src/components/DescriptionList/DescriptionList.tsx
|
|
7981
|
-
var
|
|
7786
|
+
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
7982
7787
|
var { term: term2, desc: desc2, list: list2 } = descriptionListTokens;
|
|
7983
|
-
var DList =
|
|
7788
|
+
var DList = import_styled_components37.default.dl.withConfig({
|
|
7984
7789
|
shouldForwardProp: (prop) => prop !== "appearance" && prop !== "direction"
|
|
7985
7790
|
})`
|
|
7986
7791
|
margin: 0;
|
|
7987
7792
|
*::selection {
|
|
7988
7793
|
${selection}
|
|
7989
7794
|
}
|
|
7990
|
-
${({ appearance }) => appearance &&
|
|
7795
|
+
${({ appearance }) => appearance && import_styled_components37.css`
|
|
7991
7796
|
dt {
|
|
7992
7797
|
color: ${term2.appearance[appearance].color};
|
|
7993
|
-
${appearance === "bold" &&
|
|
7798
|
+
${appearance === "bold" && import_styled_components37.css`
|
|
7994
7799
|
font-weight: 600;
|
|
7995
7800
|
`}
|
|
7996
7801
|
}
|
|
@@ -8013,7 +7818,7 @@ var DList = import_styled_components41.default.dl.withConfig({
|
|
|
8013
7818
|
margin-top: ${list2.beforeNextTerm.marginTop};
|
|
8014
7819
|
}
|
|
8015
7820
|
`;
|
|
8016
|
-
var DescriptionList = (0,
|
|
7821
|
+
var DescriptionList = (0, import_react45.forwardRef)((props, ref) => {
|
|
8017
7822
|
const {
|
|
8018
7823
|
appearance = "bold",
|
|
8019
7824
|
direction = "column",
|
|
@@ -8029,44 +7834,44 @@ var DescriptionList = (0, import_react50.forwardRef)((props, ref) => {
|
|
|
8029
7834
|
direction,
|
|
8030
7835
|
ref
|
|
8031
7836
|
};
|
|
8032
|
-
return /* @__PURE__ */ (0,
|
|
7837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(DList, { ...dListProps, children });
|
|
8033
7838
|
});
|
|
8034
7839
|
DescriptionList.displayName = "DescriptionList";
|
|
8035
7840
|
|
|
8036
7841
|
// src/components/DescriptionList/DescriptionListTerm.tsx
|
|
8037
|
-
var
|
|
8038
|
-
var
|
|
8039
|
-
var
|
|
8040
|
-
var DListTerm =
|
|
8041
|
-
var DescriptionListTerm = (0,
|
|
7842
|
+
var import_react46 = require("react");
|
|
7843
|
+
var import_styled_components38 = __toESM(require("styled-components"));
|
|
7844
|
+
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
7845
|
+
var DListTerm = import_styled_components38.default.dt``;
|
|
7846
|
+
var DescriptionListTerm = (0, import_react46.forwardRef)(({ children, ...rest }, ref) => {
|
|
8042
7847
|
const dListTermProps = {
|
|
8043
7848
|
ref,
|
|
8044
7849
|
...rest
|
|
8045
7850
|
};
|
|
8046
|
-
return /* @__PURE__ */ (0,
|
|
7851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(DListTerm, { ...dListTermProps, children });
|
|
8047
7852
|
});
|
|
8048
7853
|
DescriptionListTerm.displayName = "DescriptionListTerm";
|
|
8049
7854
|
|
|
8050
7855
|
// src/components/DescriptionList/DescriptionListDesc.tsx
|
|
8051
|
-
var
|
|
8052
|
-
var
|
|
8053
|
-
var
|
|
8054
|
-
var DListDesc =
|
|
7856
|
+
var import_react47 = require("react");
|
|
7857
|
+
var import_styled_components39 = __toESM(require("styled-components"));
|
|
7858
|
+
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
7859
|
+
var DListDesc = import_styled_components39.default.dd`
|
|
8055
7860
|
margin-inline-start: 0;
|
|
8056
7861
|
align-items: center;
|
|
8057
7862
|
display: flex;
|
|
8058
7863
|
color: ${descriptionListTokens.desc.base.color};
|
|
8059
7864
|
gap: ${descriptionListTokens.desc.base.gap};
|
|
8060
7865
|
`;
|
|
8061
|
-
var DescriptionListDesc = (0,
|
|
7866
|
+
var DescriptionListDesc = (0, import_react47.forwardRef)((props, ref) => {
|
|
8062
7867
|
const { children, icon: icon12, id, className, htmlProps, ...rest } = props;
|
|
8063
7868
|
const dListDescProps = {
|
|
8064
7869
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
8065
7870
|
children,
|
|
8066
7871
|
ref
|
|
8067
7872
|
};
|
|
8068
|
-
return /* @__PURE__ */ (0,
|
|
8069
|
-
icon12 && /* @__PURE__ */ (0,
|
|
7873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime199.jsxs)(DListDesc, { ...dListDescProps, children: [
|
|
7874
|
+
icon12 && /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(Icon, { icon: icon12 }),
|
|
8070
7875
|
" ",
|
|
8071
7876
|
children
|
|
8072
7877
|
] });
|
|
@@ -8074,15 +7879,15 @@ var DescriptionListDesc = (0, import_react52.forwardRef)((props, ref) => {
|
|
|
8074
7879
|
DescriptionListDesc.displayName = "DescriptionListDesc";
|
|
8075
7880
|
|
|
8076
7881
|
// src/components/DescriptionList/DescriptionListGroup.tsx
|
|
8077
|
-
var
|
|
8078
|
-
var
|
|
8079
|
-
var
|
|
8080
|
-
var DListGroup =
|
|
7882
|
+
var import_react48 = require("react");
|
|
7883
|
+
var import_styled_components40 = __toESM(require("styled-components"));
|
|
7884
|
+
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
7885
|
+
var DListGroup = import_styled_components40.default.div`
|
|
8081
7886
|
margin: ${({ margin }) => margin ? margin : descriptionListTokens.group.base.margin};
|
|
8082
7887
|
${({ minWidth }) => minWidth && `min-width: ${minWidth}`}
|
|
8083
7888
|
${({ maxWidth }) => maxWidth && `max-width: ${maxWidth}`}
|
|
8084
7889
|
`;
|
|
8085
|
-
var DescriptionListGroup = (0,
|
|
7890
|
+
var DescriptionListGroup = (0, import_react48.forwardRef)((props, ref) => {
|
|
8086
7891
|
const {
|
|
8087
7892
|
children,
|
|
8088
7893
|
margin,
|
|
@@ -8101,66 +7906,130 @@ var DescriptionListGroup = (0, import_react53.forwardRef)((props, ref) => {
|
|
|
8101
7906
|
minWidth,
|
|
8102
7907
|
maxWidth
|
|
8103
7908
|
};
|
|
8104
|
-
return /* @__PURE__ */ (0,
|
|
7909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(DListGroup, { ...dListGroupProps, children });
|
|
8105
7910
|
});
|
|
8106
7911
|
DescriptionListGroup.displayName = "DescriptionListGroup";
|
|
8107
7912
|
|
|
8108
7913
|
// src/components/Table/Cell.tsx
|
|
8109
|
-
var
|
|
8110
|
-
var
|
|
8111
|
-
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
8112
|
-
var { cell: cell3 } = tableTokens;
|
|
7914
|
+
var import_jsx_runtime201 = require("react/jsx-runtime");
|
|
7915
|
+
var { cell: cell2 } = tableTokens;
|
|
8113
7916
|
var getLayoutStyle = (layout) => {
|
|
8114
7917
|
switch (layout) {
|
|
8115
7918
|
case "center":
|
|
8116
|
-
return
|
|
7919
|
+
return import_styled_components41.css`
|
|
8117
7920
|
justify-content: center;
|
|
8118
7921
|
`;
|
|
8119
7922
|
case "right":
|
|
8120
|
-
return
|
|
7923
|
+
return import_styled_components41.css`
|
|
8121
7924
|
justify-content: flex-end;
|
|
8122
7925
|
`;
|
|
8123
7926
|
case "text and icon":
|
|
8124
|
-
return
|
|
8125
|
-
gap: ${
|
|
7927
|
+
return import_styled_components41.css`
|
|
7928
|
+
gap: ${cell2.layout.textAndIcon.gap};
|
|
8126
7929
|
`;
|
|
8127
7930
|
default:
|
|
8128
7931
|
case "left":
|
|
8129
7932
|
return;
|
|
8130
7933
|
}
|
|
8131
|
-
};
|
|
8132
|
-
var StyledCell =
|
|
8133
|
-
${({ $type: type }) => type === "head" &&
|
|
8134
|
-
background-color: ${
|
|
7934
|
+
};
|
|
7935
|
+
var StyledCell = import_styled_components41.default.td`
|
|
7936
|
+
${({ $type: type }) => type === "head" && import_styled_components41.css`
|
|
7937
|
+
background-color: ${cell2.head.backgroundColor};
|
|
7938
|
+
`}
|
|
7939
|
+
`;
|
|
7940
|
+
var InnerCell = import_styled_components41.default.div`
|
|
7941
|
+
display: flex;
|
|
7942
|
+
align-items: center;
|
|
7943
|
+
${({ $layout: layout }) => getLayoutStyle(layout)}
|
|
7944
|
+
`;
|
|
7945
|
+
var getTableCellType = (type) => {
|
|
7946
|
+
switch (type) {
|
|
7947
|
+
case "head":
|
|
7948
|
+
return "th";
|
|
7949
|
+
default:
|
|
7950
|
+
case "data":
|
|
7951
|
+
return "td";
|
|
7952
|
+
}
|
|
7953
|
+
};
|
|
7954
|
+
var Cell = (0, import_react49.forwardRef)(
|
|
7955
|
+
({ children, type: _type, layout = "left", collapsibleProps, ...rest }, ref) => {
|
|
7956
|
+
const isInHead = useIsInTableHead();
|
|
7957
|
+
const type = _type != null ? _type : isInHead ? "head" : "data";
|
|
7958
|
+
const as = getTableCellType(type);
|
|
7959
|
+
const { isCollapsibleChild } = collapsibleProps != null ? collapsibleProps : {};
|
|
7960
|
+
return isCollapsibleChild ? /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(DescriptionListDesc, { children }) : /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(StyledCell, { as, ref, $type: type, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(InnerCell, { $layout: layout, children }) });
|
|
7961
|
+
}
|
|
7962
|
+
);
|
|
7963
|
+
Cell.displayName = "Table.Cell";
|
|
7964
|
+
|
|
7965
|
+
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
7966
|
+
var import_react51 = require("react");
|
|
7967
|
+
var import_styled_components43 = __toESM(require("styled-components"));
|
|
7968
|
+
|
|
7969
|
+
// src/components/Table/collapsible/Table.context.tsx
|
|
7970
|
+
var import_react50 = require("react");
|
|
7971
|
+
var CollapsibleTableContext = (0, import_react50.createContext)({
|
|
7972
|
+
headerValues: [],
|
|
7973
|
+
definingColumnIndex: [0]
|
|
7974
|
+
});
|
|
7975
|
+
var useCollapsibleTableContext = () => (0, import_react50.useContext)(CollapsibleTableContext);
|
|
7976
|
+
|
|
7977
|
+
// src/components/Table/Table.styles.tsx
|
|
7978
|
+
var import_styled_components42 = __toESM(require("styled-components"));
|
|
7979
|
+
var { row: row2 } = tableTokens;
|
|
7980
|
+
var bodyRowStyles = (mode, selected) => {
|
|
7981
|
+
return import_styled_components42.css`
|
|
7982
|
+
${mode === "sum" && import_styled_components42.css`
|
|
7983
|
+
font-weight: 600;
|
|
7984
|
+
border-top: ${row2.body.mode.sum.borderTop};
|
|
7985
|
+
border-bottom: ${row2.body.mode.sum.borderBottom};
|
|
7986
|
+
background-color: ${row2.body.mode.sum.backgroundColor};
|
|
7987
|
+
`}
|
|
7988
|
+
${selected && import_styled_components42.css`
|
|
7989
|
+
background-color: ${row2.body.selected.backgroundColor};
|
|
7990
|
+
`}
|
|
7991
|
+
`;
|
|
7992
|
+
};
|
|
7993
|
+
var StyledRow = import_styled_components42.default.tr`
|
|
7994
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
7995
|
+
transition:
|
|
7996
|
+
background-color 0.2s,
|
|
7997
|
+
border-color 0.2s,
|
|
7998
|
+
box-shadow 0.2s;
|
|
7999
|
+
}
|
|
8000
|
+
|
|
8001
|
+
${getFontStyling(defaultTypographyType, true)}
|
|
8002
|
+
|
|
8003
|
+
${({ type }) => type === "head" && import_styled_components42.css`
|
|
8004
|
+
font-weight: 600;
|
|
8005
|
+
text-align: left;
|
|
8006
|
+
`}
|
|
8007
|
+
${({ type, $mode: mode, $selected: selected, $hoverable: hoverable }) => type === "body" && import_styled_components42.css`
|
|
8008
|
+
&:nth-of-type(even) {
|
|
8009
|
+
background-color: ${row2.body.even.backgroundColor};
|
|
8010
|
+
${bodyRowStyles(mode, selected)}
|
|
8011
|
+
}
|
|
8012
|
+
|
|
8013
|
+
&:nth-of-type(odd) {
|
|
8014
|
+
background-color: ${row2.body.odd.backgroundColor};
|
|
8015
|
+
${bodyRowStyles(mode, selected)}
|
|
8016
|
+
}
|
|
8017
|
+
|
|
8018
|
+
${hoverable && import_styled_components42.css`
|
|
8019
|
+
&:hover {
|
|
8020
|
+
background-color: ${row2.body.hover.backgroundColor};
|
|
8021
|
+
}
|
|
8022
|
+
`}
|
|
8023
|
+
&:focus-visible, &.focus-visible {
|
|
8024
|
+
${focusVisibleInset}
|
|
8025
|
+
}
|
|
8135
8026
|
`}
|
|
8136
8027
|
`;
|
|
8137
|
-
var InnerCell = import_styled_components45.default.div`
|
|
8138
|
-
display: flex;
|
|
8139
|
-
align-items: center;
|
|
8140
|
-
${({ $layout: layout }) => getLayoutStyle(layout)}
|
|
8141
|
-
`;
|
|
8142
|
-
var getTableCellType = (type) => {
|
|
8143
|
-
switch (type) {
|
|
8144
|
-
case "head":
|
|
8145
|
-
return "th";
|
|
8146
|
-
default:
|
|
8147
|
-
case "data":
|
|
8148
|
-
return "td";
|
|
8149
|
-
}
|
|
8150
|
-
};
|
|
8151
|
-
var Cell = (0, import_react54.forwardRef)(
|
|
8152
|
-
({ children, type = "data", layout = "left", collapsibleProps, ...rest }, ref) => {
|
|
8153
|
-
const as = getTableCellType(type);
|
|
8154
|
-
const { isCollapsibleChild } = collapsibleProps != null ? collapsibleProps : {};
|
|
8155
|
-
return isCollapsibleChild ? /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(DescriptionListDesc, { children }) : /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(StyledCell, { as, ref, $type: type, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(InnerCell, { $layout: layout, children }) });
|
|
8156
|
-
}
|
|
8157
|
-
);
|
|
8158
|
-
Cell.displayName = "Table.Cell";
|
|
8159
8028
|
|
|
8160
8029
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
8161
|
-
var
|
|
8030
|
+
var import_jsx_runtime202 = require("react/jsx-runtime");
|
|
8162
8031
|
var { collapseButton: collapseButton2 } = tableTokens;
|
|
8163
|
-
var CollapseButton =
|
|
8032
|
+
var CollapseButton = import_styled_components43.default.button`
|
|
8164
8033
|
${removeButtonStyling}
|
|
8165
8034
|
margin-left: auto;
|
|
8166
8035
|
margin-right: auto;
|
|
@@ -8175,13 +8044,15 @@ var CollapseButton = import_styled_components46.default.button`
|
|
|
8175
8044
|
${focusVisible}
|
|
8176
8045
|
}
|
|
8177
8046
|
`;
|
|
8178
|
-
var DescriptionListCell = (0,
|
|
8047
|
+
var DescriptionListCell = (0, import_styled_components43.default)(Cell)`
|
|
8179
8048
|
& > div {
|
|
8180
8049
|
display: block;
|
|
8181
8050
|
}
|
|
8182
8051
|
`;
|
|
8183
|
-
var CollapsibleRow = (0,
|
|
8184
|
-
({ type
|
|
8052
|
+
var CollapsibleRow = (0, import_react51.forwardRef)(
|
|
8053
|
+
({ type: _type, mode = "normal", selected, hoverable, children, ...rest }, ref) => {
|
|
8054
|
+
const isInHead = useIsInTableHead();
|
|
8055
|
+
const type = _type != null ? _type : isInHead ? "head" : "body";
|
|
8185
8056
|
const rowProps = {
|
|
8186
8057
|
$type: type,
|
|
8187
8058
|
$mode: mode,
|
|
@@ -8190,14 +8061,14 @@ var CollapsibleRow = (0, import_react55.forwardRef)(
|
|
|
8190
8061
|
...rest
|
|
8191
8062
|
};
|
|
8192
8063
|
const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
|
|
8193
|
-
const [childrenCollapsed, setChildrenCollapsed] = (0,
|
|
8194
|
-
(0,
|
|
8064
|
+
const [childrenCollapsed, setChildrenCollapsed] = (0, import_react51.useState)(true);
|
|
8065
|
+
(0, import_react51.useEffect)(() => {
|
|
8195
8066
|
!isCollapsed && setChildrenCollapsed(true);
|
|
8196
8067
|
}, [isCollapsed]);
|
|
8197
8068
|
const collapsedHeaderValues = headerValues.filter(
|
|
8198
8069
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
8199
8070
|
);
|
|
8200
|
-
const childrenArray =
|
|
8071
|
+
const childrenArray = import_react51.Children.toArray(children);
|
|
8201
8072
|
const collapsedChildren = childrenArray.filter(
|
|
8202
8073
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
8203
8074
|
);
|
|
@@ -8206,25 +8077,25 @@ var CollapsibleRow = (0, import_react55.forwardRef)(
|
|
|
8206
8077
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
8207
8078
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
8208
8079
|
collapsibleIds.push(id);
|
|
8209
|
-
return /* @__PURE__ */ (0,
|
|
8210
|
-
/* @__PURE__ */ (0,
|
|
8211
|
-
(0,
|
|
8080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(import_react51.Fragment, { children: [
|
|
8081
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
8082
|
+
(0, import_react51.isValidElement)(child) && (0, import_react51.cloneElement)(child, {
|
|
8212
8083
|
collapsibleProps: { isCollapsibleChild: true }
|
|
8213
8084
|
})
|
|
8214
8085
|
] }, `DL-${index}`);
|
|
8215
8086
|
}) : null;
|
|
8216
|
-
const collapsedRows = collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0,
|
|
8087
|
+
const collapsedRows = collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(StyledRow, { type, children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(DescriptionListCell, { colSpan: definingColumnIndex.length + 1, children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(DescriptionList, { children: collapsedRenderedChildren }) }) }) : null;
|
|
8217
8088
|
const definingColumnCells = childrenArray.slice().filter((column, index) => definingColumnIndex.indexOf(index) > -1).sort((a2, b) => {
|
|
8218
8089
|
return definingColumnIndex.indexOf(childrenArray.indexOf(a2)) - definingColumnIndex.indexOf(childrenArray.indexOf(b));
|
|
8219
8090
|
});
|
|
8220
8091
|
const headerRow = () => {
|
|
8221
8092
|
if (type !== "head" || !isCollapsed)
|
|
8222
8093
|
return null;
|
|
8223
|
-
return /* @__PURE__ */ (0,
|
|
8094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(StyledRow, { ref, type, ...rowProps, children: /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(import_jsx_runtime202.Fragment, { children: [
|
|
8224
8095
|
definingColumnCells,
|
|
8225
|
-
/* @__PURE__ */ (0,
|
|
8096
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(Table.Cell, { type: "head", layout: "center", children: [
|
|
8226
8097
|
"Utvid",
|
|
8227
|
-
/* @__PURE__ */ (0,
|
|
8098
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(VisuallyHidden, { as: "span", children: "raden" })
|
|
8228
8099
|
] })
|
|
8229
8100
|
] }) });
|
|
8230
8101
|
};
|
|
@@ -8232,7 +8103,7 @@ var CollapsibleRow = (0, import_react55.forwardRef)(
|
|
|
8232
8103
|
const rowWithChevron = () => {
|
|
8233
8104
|
if (type !== "body" || !isCollapsed)
|
|
8234
8105
|
return null;
|
|
8235
|
-
return /* @__PURE__ */ (0,
|
|
8106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(
|
|
8236
8107
|
StyledRow,
|
|
8237
8108
|
{
|
|
8238
8109
|
ref,
|
|
@@ -8241,13 +8112,13 @@ var CollapsibleRow = (0, import_react55.forwardRef)(
|
|
|
8241
8112
|
"data-isopencollapsibleheader": !childrenCollapsed && true,
|
|
8242
8113
|
children: [
|
|
8243
8114
|
definingColumnCells,
|
|
8244
|
-
/* @__PURE__ */ (0,
|
|
8115
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(Table.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
8245
8116
|
CollapseButton,
|
|
8246
8117
|
{
|
|
8247
8118
|
onClick: () => setChildrenCollapsed(!childrenCollapsed),
|
|
8248
8119
|
"aria-expanded": !childrenCollapsed,
|
|
8249
8120
|
"aria-controls": idList,
|
|
8250
|
-
children: /* @__PURE__ */ (0,
|
|
8121
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
8251
8122
|
AnimatedChevronUpDown,
|
|
8252
8123
|
{
|
|
8253
8124
|
isUp: childrenCollapsed ? false : true,
|
|
@@ -8261,17 +8132,154 @@ var CollapsibleRow = (0, import_react55.forwardRef)(
|
|
|
8261
8132
|
}
|
|
8262
8133
|
);
|
|
8263
8134
|
};
|
|
8264
|
-
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0,
|
|
8135
|
+
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(import_jsx_runtime202.Fragment, { children: [
|
|
8265
8136
|
headerRow(),
|
|
8266
|
-
type === "body" && /* @__PURE__ */ (0,
|
|
8137
|
+
type === "body" && /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(import_jsx_runtime202.Fragment, { children: [
|
|
8267
8138
|
rowWithChevron(),
|
|
8268
8139
|
childrenCollapsed ? null : collapsedRows
|
|
8269
8140
|
] })
|
|
8270
|
-
] }) : /* @__PURE__ */ (0,
|
|
8141
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(StyledRow, { ref, type, ...rowProps, children });
|
|
8271
8142
|
}
|
|
8272
8143
|
);
|
|
8273
8144
|
CollapsibleRow.displayName = "CollapsibleTable.Row";
|
|
8274
8145
|
|
|
8146
|
+
// src/components/Table/collapsible/CollapsibleTable.tsx
|
|
8147
|
+
var import_react53 = require("react");
|
|
8148
|
+
var import_styled_components45 = __toESM(require("styled-components"));
|
|
8149
|
+
|
|
8150
|
+
// src/components/Table/Table.tsx
|
|
8151
|
+
var import_react52 = require("react");
|
|
8152
|
+
var import_styled_components44 = __toESM(require("styled-components"));
|
|
8153
|
+
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
8154
|
+
var { cell: cell3, row: row3 } = tableTokens;
|
|
8155
|
+
var StyledTable = import_styled_components44.default.table`
|
|
8156
|
+
border-spacing: 0;
|
|
8157
|
+
border-collapse: collapse;
|
|
8158
|
+
*::selection {
|
|
8159
|
+
${selection}
|
|
8160
|
+
}
|
|
8161
|
+
${scrollbarStyling.webkit}
|
|
8162
|
+
${scrollbarStyling.firefox}
|
|
8163
|
+
${({ $density }) => import_styled_components44.css`
|
|
8164
|
+
td,
|
|
8165
|
+
th {
|
|
8166
|
+
padding: ${cell3.density[$density].padding};
|
|
8167
|
+
}
|
|
8168
|
+
`}
|
|
8169
|
+
${({ $density }) => $density === "extraCompact" && import_styled_components44.css`
|
|
8170
|
+
th {
|
|
8171
|
+
background-color: ${row3.head.extraCompact.backgroundColor};
|
|
8172
|
+
font-size: ${row3.head.extraCompact.fontSize};
|
|
8173
|
+
}
|
|
8174
|
+
tr[type='body'] {
|
|
8175
|
+
&:nth-of-type(even) {
|
|
8176
|
+
background-color: ${row3.body.odd.backgroundColor};
|
|
8177
|
+
}
|
|
8178
|
+
&:nth-of-type(odd) {
|
|
8179
|
+
background-color: ${row3.body.even.backgroundColor};
|
|
8180
|
+
}
|
|
8181
|
+
}
|
|
8182
|
+
`}
|
|
8183
|
+
${({ $stickyHeader }) => $stickyHeader && import_styled_components44.css`
|
|
8184
|
+
tr[type='head'] {
|
|
8185
|
+
th[type='head'] {
|
|
8186
|
+
position: sticky;
|
|
8187
|
+
top: 0;
|
|
8188
|
+
z-index: 50;
|
|
8189
|
+
}
|
|
8190
|
+
}
|
|
8191
|
+
`}
|
|
8192
|
+
${({ $withDividers }) => $withDividers && import_styled_components44.css`
|
|
8193
|
+
tr[type='body'] {
|
|
8194
|
+
border-bottom: ${row3.body.withDividers.borderBottom};
|
|
8195
|
+
}
|
|
8196
|
+
`}
|
|
8197
|
+
`;
|
|
8198
|
+
var Table2 = (0, import_react52.forwardRef)(
|
|
8199
|
+
({ density = "normal", stickyHeader, withDividers, children, ...rest }, ref) => {
|
|
8200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
8201
|
+
StyledTable,
|
|
8202
|
+
{
|
|
8203
|
+
...rest,
|
|
8204
|
+
ref,
|
|
8205
|
+
$density: density,
|
|
8206
|
+
$stickyHeader: stickyHeader,
|
|
8207
|
+
$withDividers: withDividers,
|
|
8208
|
+
children
|
|
8209
|
+
}
|
|
8210
|
+
);
|
|
8211
|
+
}
|
|
8212
|
+
);
|
|
8213
|
+
Table2.displayName = "Table";
|
|
8214
|
+
|
|
8215
|
+
// src/components/Table/collapsible/CollapsibleTable.tsx
|
|
8216
|
+
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
8217
|
+
var StyledTable2 = (0, import_styled_components45.default)(Table2)`
|
|
8218
|
+
width: 100%;
|
|
8219
|
+
${({ withDividers }) => withDividers && import_styled_components45.css`
|
|
8220
|
+
tr[data-isopencollapsibleheader='true'] {
|
|
8221
|
+
border-bottom: none;
|
|
8222
|
+
}
|
|
8223
|
+
`}
|
|
8224
|
+
`;
|
|
8225
|
+
var CollapsibleTable = (0, import_react53.forwardRef)((props, ref) => {
|
|
8226
|
+
const {
|
|
8227
|
+
density = "normal",
|
|
8228
|
+
children,
|
|
8229
|
+
isCollapsed,
|
|
8230
|
+
headerValues,
|
|
8231
|
+
definingColumnIndex = [0],
|
|
8232
|
+
...rest
|
|
8233
|
+
} = props;
|
|
8234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
8235
|
+
CollapsibleTableContext.Provider,
|
|
8236
|
+
{
|
|
8237
|
+
value: {
|
|
8238
|
+
isCollapsed,
|
|
8239
|
+
headerValues,
|
|
8240
|
+
definingColumnIndex
|
|
8241
|
+
},
|
|
8242
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(StyledTable2, { ref, density, ...rest, children })
|
|
8243
|
+
}
|
|
8244
|
+
);
|
|
8245
|
+
});
|
|
8246
|
+
CollapsibleTable.displayName = "CollapsibleTable";
|
|
8247
|
+
|
|
8248
|
+
// src/components/Table/Foot.tsx
|
|
8249
|
+
var import_react54 = require("react");
|
|
8250
|
+
var import_styled_components46 = __toESM(require("styled-components"));
|
|
8251
|
+
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
8252
|
+
var StyledFoot = import_styled_components46.default.tfoot``;
|
|
8253
|
+
var Foot = (0, import_react54.forwardRef)(
|
|
8254
|
+
({ children, ...rest }, ref) => {
|
|
8255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(StyledFoot, { ref, ...rest, children });
|
|
8256
|
+
}
|
|
8257
|
+
);
|
|
8258
|
+
Foot.displayName = "Table.Foot";
|
|
8259
|
+
|
|
8260
|
+
// src/components/Table/Row.tsx
|
|
8261
|
+
var import_react55 = require("react");
|
|
8262
|
+
var import_jsx_runtime206 = require("react/jsx-runtime");
|
|
8263
|
+
var Row = (0, import_react55.forwardRef)(
|
|
8264
|
+
({ type: _type, mode = "normal", hoverable, selected, children, ...rest }, ref) => {
|
|
8265
|
+
const isInHeader = useIsInTableHead();
|
|
8266
|
+
const type = _type != null ? _type : isInHeader ? "head" : "body";
|
|
8267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
8268
|
+
StyledRow,
|
|
8269
|
+
{
|
|
8270
|
+
type,
|
|
8271
|
+
$mode: mode,
|
|
8272
|
+
$hoverable: hoverable,
|
|
8273
|
+
$selected: selected,
|
|
8274
|
+
ref,
|
|
8275
|
+
...rest,
|
|
8276
|
+
children
|
|
8277
|
+
}
|
|
8278
|
+
);
|
|
8279
|
+
}
|
|
8280
|
+
);
|
|
8281
|
+
Row.displayName = "Table.Row";
|
|
8282
|
+
|
|
8275
8283
|
// src/components/Table/SortCell.tsx
|
|
8276
8284
|
var import_react56 = require("react");
|
|
8277
8285
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
@@ -8356,14 +8364,14 @@ var TableWrapper = ({ children, ...rest }) => {
|
|
|
8356
8364
|
TableWrapper.displayName = "Table.Wrapper";
|
|
8357
8365
|
|
|
8358
8366
|
// src/components/Table/index.ts
|
|
8359
|
-
var
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
+
var Table = Table2;
|
|
8368
|
+
Table.Wrapper = TableWrapper;
|
|
8369
|
+
Table.Head = Head;
|
|
8370
|
+
Table.Body = Body;
|
|
8371
|
+
Table.Cell = Cell;
|
|
8372
|
+
Table.SortCell = SortCell;
|
|
8373
|
+
Table.Row = Row;
|
|
8374
|
+
Table.Foot = Foot;
|
|
8367
8375
|
var CollapsibleTable2 = CollapsibleTable;
|
|
8368
8376
|
CollapsibleTable2.Row = CollapsibleRow;
|
|
8369
8377
|
|
|
@@ -8455,6 +8463,28 @@ Breadcrumbs.displayName = "Breadcrumbs";
|
|
|
8455
8463
|
var import_react60 = require("react");
|
|
8456
8464
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
8457
8465
|
|
|
8466
|
+
// src/components/Pagination/Pagination.tokens.tsx
|
|
8467
|
+
var import_dds_design_tokens33 = require("@norges-domstoler/dds-design-tokens");
|
|
8468
|
+
var { spacing: spacing19, colors: colors21 } = import_dds_design_tokens33.ddsBaseTokens;
|
|
8469
|
+
var list5 = {
|
|
8470
|
+
gap: spacing19.SizesDdsSpacingX075
|
|
8471
|
+
};
|
|
8472
|
+
var truncationIcon = {
|
|
8473
|
+
color: colors21.DdsColorNeutralsGray7
|
|
8474
|
+
};
|
|
8475
|
+
var outerContainer5 = {
|
|
8476
|
+
gap: spacing19.SizesDdsSpacingX075
|
|
8477
|
+
};
|
|
8478
|
+
var indicatorsContainer = {
|
|
8479
|
+
gap: spacing19.SizesDdsSpacingX075
|
|
8480
|
+
};
|
|
8481
|
+
var paginationTokens = {
|
|
8482
|
+
outerContainer: outerContainer5,
|
|
8483
|
+
indicatorsContainer,
|
|
8484
|
+
truncationIcon,
|
|
8485
|
+
list: list5
|
|
8486
|
+
};
|
|
8487
|
+
|
|
8458
8488
|
// src/components/Pagination/paginationGenerator.tsx
|
|
8459
8489
|
var arrayRange = (start, end) => {
|
|
8460
8490
|
const length = end - start + 1;
|
|
@@ -8488,28 +8518,6 @@ function PaginationGenerator(pagesAmount, activePage) {
|
|
|
8488
8518
|
return arrayRange(1, pagesAmount);
|
|
8489
8519
|
}
|
|
8490
8520
|
|
|
8491
|
-
// src/components/Pagination/Pagination.tokens.tsx
|
|
8492
|
-
var import_dds_design_tokens33 = require("@norges-domstoler/dds-design-tokens");
|
|
8493
|
-
var { spacing: spacing19, colors: colors21 } = import_dds_design_tokens33.ddsBaseTokens;
|
|
8494
|
-
var list5 = {
|
|
8495
|
-
gap: spacing19.SizesDdsSpacingX075
|
|
8496
|
-
};
|
|
8497
|
-
var truncationIcon = {
|
|
8498
|
-
color: colors21.DdsColorNeutralsGray7
|
|
8499
|
-
};
|
|
8500
|
-
var outerContainer5 = {
|
|
8501
|
-
gap: spacing19.SizesDdsSpacingX075
|
|
8502
|
-
};
|
|
8503
|
-
var indicatorsContainer = {
|
|
8504
|
-
gap: spacing19.SizesDdsSpacingX075
|
|
8505
|
-
};
|
|
8506
|
-
var paginationTokens = {
|
|
8507
|
-
outerContainer: outerContainer5,
|
|
8508
|
-
indicatorsContainer,
|
|
8509
|
-
truncationIcon,
|
|
8510
|
-
list: list5
|
|
8511
|
-
};
|
|
8512
|
-
|
|
8513
8521
|
// src/components/Pagination/Pagination.tsx
|
|
8514
8522
|
var import_jsx_runtime211 = require("react/jsx-runtime");
|
|
8515
8523
|
var { outerContainer: outerContainer6, indicatorsContainer: indicatorsContainer2, truncationIcon: truncationIcon2, list: list6 } = paginationTokens;
|
|
@@ -9420,12 +9428,27 @@ var StyledOverflowMenu = (0, import_styled_components57.default)(OverflowMenu)`
|
|
|
9420
9428
|
max-height: calc(100vh - 110px);
|
|
9421
9429
|
`;
|
|
9422
9430
|
|
|
9423
|
-
// src/components/InternalHeader/
|
|
9431
|
+
// src/components/InternalHeader/InternalHeaderListItem.tsx
|
|
9424
9432
|
var import_react68 = require("react");
|
|
9425
9433
|
var import_styled_components58 = __toESM(require("styled-components"));
|
|
9426
9434
|
var import_jsx_runtime219 = require("react/jsx-runtime");
|
|
9435
|
+
var Li = import_styled_components58.default.li`
|
|
9436
|
+
box-sizing: border-box;
|
|
9437
|
+
`;
|
|
9438
|
+
var InternalHeaderListItem = (0, import_react68.forwardRef)(({ children, ...rest }, ref) => {
|
|
9439
|
+
const props = {
|
|
9440
|
+
ref,
|
|
9441
|
+
...rest
|
|
9442
|
+
};
|
|
9443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(Li, { ...props, children });
|
|
9444
|
+
});
|
|
9445
|
+
|
|
9446
|
+
// src/components/InternalHeader/NavigationItem.tsx
|
|
9447
|
+
var import_react69 = require("react");
|
|
9448
|
+
var import_styled_components59 = __toESM(require("styled-components"));
|
|
9449
|
+
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
9427
9450
|
var { navLink: navLink2 } = internalHeaderTokens;
|
|
9428
|
-
var Link3 =
|
|
9451
|
+
var Link3 = import_styled_components59.default.a.withConfig({
|
|
9429
9452
|
shouldForwardProp: (prop) => prop !== "isCurrent"
|
|
9430
9453
|
})`
|
|
9431
9454
|
display: flex;
|
|
@@ -9450,7 +9473,7 @@ var Link3 = import_styled_components58.default.a.withConfig({
|
|
|
9450
9473
|
&.focus-visible {
|
|
9451
9474
|
${focusVisible};
|
|
9452
9475
|
}
|
|
9453
|
-
${({ isCurrent }) => isCurrent &&
|
|
9476
|
+
${({ isCurrent }) => isCurrent && import_styled_components59.css`
|
|
9454
9477
|
color: ${navLink2.current.color};
|
|
9455
9478
|
background-color: ${navLink2.current.backgroundColor};
|
|
9456
9479
|
&:hover {
|
|
@@ -9458,28 +9481,13 @@ var Link3 = import_styled_components58.default.a.withConfig({
|
|
|
9458
9481
|
}
|
|
9459
9482
|
`}
|
|
9460
9483
|
`;
|
|
9461
|
-
var NavigationItem2 = (0,
|
|
9484
|
+
var NavigationItem2 = (0, import_react69.forwardRef)(({ title: title3, isCurrent, ...rest }, ref) => {
|
|
9462
9485
|
const linkProps = {
|
|
9463
9486
|
ref,
|
|
9464
9487
|
isCurrent,
|
|
9465
9488
|
...rest
|
|
9466
9489
|
};
|
|
9467
|
-
return /* @__PURE__ */ (0,
|
|
9468
|
-
});
|
|
9469
|
-
|
|
9470
|
-
// src/components/InternalHeader/InternalHeaderListItem.tsx
|
|
9471
|
-
var import_react69 = require("react");
|
|
9472
|
-
var import_styled_components59 = __toESM(require("styled-components"));
|
|
9473
|
-
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
9474
|
-
var Li = import_styled_components59.default.li`
|
|
9475
|
-
box-sizing: border-box;
|
|
9476
|
-
`;
|
|
9477
|
-
var InternalHeaderListItem = (0, import_react69.forwardRef)(({ children, ...rest }, ref) => {
|
|
9478
|
-
const props = {
|
|
9479
|
-
ref,
|
|
9480
|
-
...rest
|
|
9481
|
-
};
|
|
9482
|
-
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(Li, { ...props, children });
|
|
9490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(Link3, { ...linkProps, "aria-current": isCurrent ? "page" : void 0, children: title3 });
|
|
9483
9491
|
});
|
|
9484
9492
|
|
|
9485
9493
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
@@ -9827,49 +9835,28 @@ var Tooltip = (0, import_react72.forwardRef)(
|
|
|
9827
9835
|
),
|
|
9828
9836
|
/* @__PURE__ */ (0, import_jsx_runtime223.jsx)(
|
|
9829
9837
|
"path",
|
|
9830
|
-
{
|
|
9831
|
-
fillRule: "evenodd",
|
|
9832
|
-
clipRule: "evenodd",
|
|
9833
|
-
d: "M26.5.5l-6.732 6.94a2.5 2.5 0 01-3.536 0L9.5.5H11l5.94 6.232a1.5 1.5 0 002.12 0L25 .5h1.5z",
|
|
9834
|
-
fill: svgArrow2.border.fill
|
|
9835
|
-
}
|
|
9836
|
-
)
|
|
9837
|
-
] }) })
|
|
9838
|
-
] })
|
|
9839
|
-
] });
|
|
9840
|
-
}
|
|
9841
|
-
);
|
|
9842
|
-
Tooltip.displayName = "Tooltip";
|
|
9843
|
-
|
|
9844
|
-
// src/components/Modal/Modal.tsx
|
|
9845
|
-
var import_react73 = require("react");
|
|
9846
|
-
var import_styled_components63 = __toESM(require("styled-components"));
|
|
9847
|
-
|
|
9848
|
-
// src/components/Modal/Modal.tokens.tsx
|
|
9849
|
-
var import_dds_design_tokens40 = require("@norges-domstoler/dds-design-tokens");
|
|
9850
|
-
var { spacing: spacing25 } = import_dds_design_tokens40.ddsBaseTokens;
|
|
9851
|
-
var container11 = {
|
|
9852
|
-
padding: `${spacing25.SizesDdsSpacingX1} ${spacing25.SizesDdsSpacingX1} ${spacing25.SizesDdsSpacingX15} ${spacing25.SizesDdsSpacingX15}`
|
|
9853
|
-
};
|
|
9854
|
-
var contentContainer3 = {
|
|
9855
|
-
paddingRight: spacing25.SizesDdsSpacingX1,
|
|
9856
|
-
gap: spacing25.SizesDdsSpacingX1
|
|
9857
|
-
};
|
|
9858
|
-
var actionsContainer = {
|
|
9859
|
-
gap: spacing25.SizesDdsSpacingX1
|
|
9860
|
-
};
|
|
9861
|
-
var modalTokens = {
|
|
9862
|
-
container: container11,
|
|
9863
|
-
contentContainer: contentContainer3,
|
|
9864
|
-
actionsContainer
|
|
9865
|
-
};
|
|
9838
|
+
{
|
|
9839
|
+
fillRule: "evenodd",
|
|
9840
|
+
clipRule: "evenodd",
|
|
9841
|
+
d: "M26.5.5l-6.732 6.94a2.5 2.5 0 01-3.536 0L9.5.5H11l5.94 6.232a1.5 1.5 0 002.12 0L25 .5h1.5z",
|
|
9842
|
+
fill: svgArrow2.border.fill
|
|
9843
|
+
}
|
|
9844
|
+
)
|
|
9845
|
+
] }) })
|
|
9846
|
+
] })
|
|
9847
|
+
] });
|
|
9848
|
+
}
|
|
9849
|
+
);
|
|
9850
|
+
Tooltip.displayName = "Tooltip";
|
|
9866
9851
|
|
|
9867
9852
|
// src/components/Modal/Modal.tsx
|
|
9853
|
+
var import_react73 = require("react");
|
|
9868
9854
|
var import_react_dom2 = require("react-dom");
|
|
9855
|
+
var import_styled_components63 = __toESM(require("styled-components"));
|
|
9869
9856
|
|
|
9870
9857
|
// src/components/Modal/Backdrop/Backdrop.tsx
|
|
9858
|
+
var import_dds_design_tokens40 = require("@norges-domstoler/dds-design-tokens");
|
|
9871
9859
|
var import_styled_components62 = __toESM(require("styled-components"));
|
|
9872
|
-
var import_dds_design_tokens41 = require("@norges-domstoler/dds-design-tokens");
|
|
9873
9860
|
var Backdrop = import_styled_components62.default.div.withConfig({
|
|
9874
9861
|
shouldForwardProp: (prop) => prop !== "isOpen"
|
|
9875
9862
|
})`
|
|
@@ -9878,7 +9865,7 @@ var Backdrop = import_styled_components62.default.div.withConfig({
|
|
|
9878
9865
|
align-items: center;
|
|
9879
9866
|
justify-content: center;
|
|
9880
9867
|
background-color: ${changeRGBAAlpha(
|
|
9881
|
-
|
|
9868
|
+
import_dds_design_tokens40.ddsBaseTokens.colors.DdsColorNeutralsGray9,
|
|
9882
9869
|
0.5
|
|
9883
9870
|
)};
|
|
9884
9871
|
overflow-y: auto;
|
|
@@ -9914,6 +9901,25 @@ function handleElementWithBackdropUnmount(container18) {
|
|
|
9914
9901
|
window.scrollTo(0, scrollY * -1);
|
|
9915
9902
|
}
|
|
9916
9903
|
|
|
9904
|
+
// src/components/Modal/Modal.tokens.tsx
|
|
9905
|
+
var import_dds_design_tokens41 = require("@norges-domstoler/dds-design-tokens");
|
|
9906
|
+
var { spacing: spacing25 } = import_dds_design_tokens41.ddsBaseTokens;
|
|
9907
|
+
var container11 = {
|
|
9908
|
+
padding: `${spacing25.SizesDdsSpacingX1} ${spacing25.SizesDdsSpacingX1} ${spacing25.SizesDdsSpacingX15} ${spacing25.SizesDdsSpacingX15}`
|
|
9909
|
+
};
|
|
9910
|
+
var contentContainer3 = {
|
|
9911
|
+
paddingRight: spacing25.SizesDdsSpacingX1,
|
|
9912
|
+
gap: spacing25.SizesDdsSpacingX1
|
|
9913
|
+
};
|
|
9914
|
+
var actionsContainer = {
|
|
9915
|
+
gap: spacing25.SizesDdsSpacingX1
|
|
9916
|
+
};
|
|
9917
|
+
var modalTokens = {
|
|
9918
|
+
container: container11,
|
|
9919
|
+
contentContainer: contentContainer3,
|
|
9920
|
+
actionsContainer
|
|
9921
|
+
};
|
|
9922
|
+
|
|
9917
9923
|
// src/components/Modal/Modal.tsx
|
|
9918
9924
|
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
9919
9925
|
var { container: container12, contentContainer: contentContainer4 } = modalTokens;
|
|
@@ -10272,12 +10278,6 @@ var import_date3 = require("@internationalized/date");
|
|
|
10272
10278
|
var import_calendar2 = require("@react-aria/calendar");
|
|
10273
10279
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
10274
10280
|
|
|
10275
|
-
// src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
|
|
10276
|
-
var import_react78 = require("react");
|
|
10277
|
-
var import_calendar = require("@react-aria/calendar");
|
|
10278
|
-
var import_date = require("@internationalized/date");
|
|
10279
|
-
var import_styled_components67 = __toESM(require("styled-components"));
|
|
10280
|
-
|
|
10281
10281
|
// src/components/date-inputs/DatePicker/Calendar/Calendar.tokens.ts
|
|
10282
10282
|
var import_dds_design_tokens43 = require("@norges-domstoler/dds-design-tokens");
|
|
10283
10283
|
var cellVariantStyles = {
|
|
@@ -10346,6 +10346,12 @@ var popover = {
|
|
|
10346
10346
|
};
|
|
10347
10347
|
var calendarTokens = { grid, cell: cell5, popover };
|
|
10348
10348
|
|
|
10349
|
+
// src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
|
|
10350
|
+
var import_date = require("@internationalized/date");
|
|
10351
|
+
var import_calendar = require("@react-aria/calendar");
|
|
10352
|
+
var import_react78 = require("react");
|
|
10353
|
+
var import_styled_components67 = __toESM(require("styled-components"));
|
|
10354
|
+
|
|
10349
10355
|
// src/components/date-inputs/DatePicker/constants.ts
|
|
10350
10356
|
var locale = "no-NO";
|
|
10351
10357
|
var timezone = "Europe/Oslo";
|
|
@@ -10607,20 +10613,87 @@ function Calendar(props) {
|
|
|
10607
10613
|
Calendar.displayName = "Calendar";
|
|
10608
10614
|
|
|
10609
10615
|
// src/components/date-inputs/DatePicker/DatePicker.tsx
|
|
10610
|
-
var import_datepicker4 = require("@react-
|
|
10611
|
-
var import_datepicker5 = require("@react-
|
|
10616
|
+
var import_datepicker4 = require("@react-aria/datepicker");
|
|
10617
|
+
var import_datepicker5 = require("@react-stately/datepicker");
|
|
10612
10618
|
var import_react85 = require("react");
|
|
10613
10619
|
|
|
10620
|
+
// src/components/date-inputs/DatePicker/CalendarPopover.tsx
|
|
10621
|
+
var import_react79 = require("react");
|
|
10622
|
+
var import_styled_components70 = __toESM(require("styled-components"));
|
|
10623
|
+
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
10624
|
+
var { popover: popoverTokens } = calendarTokens;
|
|
10625
|
+
var CalendarPopoverContext = (0, import_react79.createContext)({
|
|
10626
|
+
anchorRef: null,
|
|
10627
|
+
isOpen: false,
|
|
10628
|
+
onClose: () => null
|
|
10629
|
+
});
|
|
10630
|
+
var CalendarPopover = ({
|
|
10631
|
+
children,
|
|
10632
|
+
isOpen,
|
|
10633
|
+
onClose
|
|
10634
|
+
}) => {
|
|
10635
|
+
const anchorRef = (0, import_react79.useRef)(null);
|
|
10636
|
+
useOnKeyDown("Escape", onClose);
|
|
10637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(CalendarPopoverContext.Provider, { value: { anchorRef, isOpen, onClose }, children });
|
|
10638
|
+
};
|
|
10639
|
+
var Anchor = import_styled_components70.default.div`
|
|
10640
|
+
display: inline-flex;
|
|
10641
|
+
`;
|
|
10642
|
+
var CalendarPopoverAnchor = ({
|
|
10643
|
+
children
|
|
10644
|
+
}) => {
|
|
10645
|
+
const { anchorRef } = (0, import_react79.useContext)(CalendarPopoverContext);
|
|
10646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Anchor, { ref: anchorRef != null ? anchorRef : void 0, children });
|
|
10647
|
+
};
|
|
10648
|
+
var PopoverContentContainer = import_styled_components70.default.div`
|
|
10649
|
+
background-color: ${popoverTokens.backgroundColor};
|
|
10650
|
+
border: ${popoverTokens.border};
|
|
10651
|
+
border-radius: ${popoverTokens.borderRadius};
|
|
10652
|
+
padding: ${popoverTokens.padding};
|
|
10653
|
+
z-index: ${popoverTokens.zIndex};
|
|
10654
|
+
`;
|
|
10655
|
+
var CalendarPopoverContent = ({
|
|
10656
|
+
children
|
|
10657
|
+
}) => {
|
|
10658
|
+
const ref = (0, import_react79.useRef)(null);
|
|
10659
|
+
const { refs, styles } = useFloatPosition(null, {
|
|
10660
|
+
placement: "bottom-start"
|
|
10661
|
+
});
|
|
10662
|
+
const { isOpen, onClose, anchorRef } = (0, import_react79.useContext)(CalendarPopoverContext);
|
|
10663
|
+
const combinedRef = useCombinedRef(refs.setFloating, ref);
|
|
10664
|
+
useOnClickOutside(ref.current, onClose);
|
|
10665
|
+
(0, import_react79.useEffect)(() => {
|
|
10666
|
+
var _a;
|
|
10667
|
+
refs.setReference((_a = anchorRef == null ? void 0 : anchorRef.current) != null ? _a : null);
|
|
10668
|
+
}, []);
|
|
10669
|
+
if (!isOpen)
|
|
10670
|
+
return null;
|
|
10671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
10672
|
+
PopoverContentContainer,
|
|
10673
|
+
{
|
|
10674
|
+
ref: combinedRef,
|
|
10675
|
+
style: styles.floating,
|
|
10676
|
+
onBlur: (e) => {
|
|
10677
|
+
const newFocus = e.relatedTarget;
|
|
10678
|
+
if (ref.current && !ref.current.contains(newFocus)) {
|
|
10679
|
+
onClose();
|
|
10680
|
+
}
|
|
10681
|
+
},
|
|
10682
|
+
children
|
|
10683
|
+
}
|
|
10684
|
+
);
|
|
10685
|
+
};
|
|
10686
|
+
|
|
10614
10687
|
// src/components/date-inputs/DatePicker/DateField/DateField.tsx
|
|
10615
|
-
var
|
|
10688
|
+
var import_date5 = require("@internationalized/date");
|
|
10616
10689
|
var import_datepicker2 = require("@react-aria/datepicker");
|
|
10617
10690
|
var import_datepicker3 = require("@react-stately/datepicker");
|
|
10618
|
-
var
|
|
10691
|
+
var import_react83 = require("react");
|
|
10619
10692
|
|
|
10620
|
-
// src/components/date-inputs/DatePicker/DateField/
|
|
10621
|
-
var
|
|
10622
|
-
var
|
|
10623
|
-
var
|
|
10693
|
+
// src/components/date-inputs/DatePicker/DateField/CalendarButton.tsx
|
|
10694
|
+
var import_button = require("@react-aria/button");
|
|
10695
|
+
var import_react80 = require("react");
|
|
10696
|
+
var import_styled_components71 = __toESM(require("styled-components"));
|
|
10624
10697
|
|
|
10625
10698
|
// src/components/date-inputs/DatePicker/DatePicker.tokens.ts
|
|
10626
10699
|
var import_dds_design_tokens44 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -10713,92 +10786,7 @@ var datePickerTokens = {
|
|
|
10713
10786
|
calendarButton
|
|
10714
10787
|
};
|
|
10715
10788
|
|
|
10716
|
-
// src/components/date-inputs/DatePicker/DateField/DateSegment.tsx
|
|
10717
|
-
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
10718
|
-
var {
|
|
10719
|
-
datefield: { segment: segmentTokens }
|
|
10720
|
-
} = datePickerTokens;
|
|
10721
|
-
var Segment = import_styled_components70.default.div`
|
|
10722
|
-
display: block;
|
|
10723
|
-
width: max-content;
|
|
10724
|
-
font-variant-numeric: tabular-nums;
|
|
10725
|
-
outline: none;
|
|
10726
|
-
padding: ${segmentTokens.padding.y} ${segmentTokens.padding.x};
|
|
10727
|
-
${({ $componentSize }) => import_styled_components70.css`
|
|
10728
|
-
font-family: ${segmentTokens[$componentSize].font.fontFamily};
|
|
10729
|
-
font-size: ${segmentTokens[$componentSize].font.fontSize};
|
|
10730
|
-
font-style: ${segmentTokens[$componentSize].font.fontStyle};
|
|
10731
|
-
font-weight: ${segmentTokens[$componentSize].font.fontWeight};
|
|
10732
|
-
line-height: ${segmentTokens[$componentSize].font.lineHeight};
|
|
10733
|
-
`}
|
|
10734
|
-
|
|
10735
|
-
&:focus:not([aria-readonly]) {
|
|
10736
|
-
background-color: ${segmentTokens.focus.backgroundColor};
|
|
10737
|
-
color: ${segmentTokens.focus.textColor};
|
|
10738
|
-
}
|
|
10739
|
-
`;
|
|
10740
|
-
var SegmentPlaceholder = import_styled_components70.default.span`
|
|
10741
|
-
display: block;
|
|
10742
|
-
width: 100%;
|
|
10743
|
-
font-variant-numeric: tabular-nums;
|
|
10744
|
-
|
|
10745
|
-
${({ $componentSize }) => import_styled_components70.css`
|
|
10746
|
-
font-family: ${segmentTokens[$componentSize].placeholder.fontFamily};
|
|
10747
|
-
font-size: ${segmentTokens[$componentSize].placeholder.fontSize};
|
|
10748
|
-
font-style: ${segmentTokens[$componentSize].placeholder.fontStyle};
|
|
10749
|
-
font-weight: ${segmentTokens[$componentSize].placeholder.fontWeight};
|
|
10750
|
-
line-height: ${segmentTokens[$componentSize].placeholder.lineHeight};
|
|
10751
|
-
color: ${segmentTokens[$componentSize].placeholder.textColor};
|
|
10752
|
-
`}
|
|
10753
|
-
|
|
10754
|
-
${Segment}:focus & {
|
|
10755
|
-
color: ${segmentTokens.focus.textColor};
|
|
10756
|
-
}
|
|
10757
|
-
`;
|
|
10758
|
-
function DateSegment({
|
|
10759
|
-
segment: segment2,
|
|
10760
|
-
state,
|
|
10761
|
-
componentSize
|
|
10762
|
-
}) {
|
|
10763
|
-
var _a;
|
|
10764
|
-
const ref = (0, import_react79.useRef)(null);
|
|
10765
|
-
const { segmentProps } = (0, import_datepicker.useDateSegment)(segment2, state, ref);
|
|
10766
|
-
return /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(
|
|
10767
|
-
Segment,
|
|
10768
|
-
{
|
|
10769
|
-
...segmentProps,
|
|
10770
|
-
$componentSize: componentSize,
|
|
10771
|
-
ref,
|
|
10772
|
-
style: {
|
|
10773
|
-
...segmentProps.style,
|
|
10774
|
-
minWidth: segment2.maxValue != null ? String(segment2.maxValue).length + "ch" : void 0
|
|
10775
|
-
},
|
|
10776
|
-
children: [
|
|
10777
|
-
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
10778
|
-
SegmentPlaceholder,
|
|
10779
|
-
{
|
|
10780
|
-
"aria-hidden": "true",
|
|
10781
|
-
$componentSize: componentSize,
|
|
10782
|
-
style: {
|
|
10783
|
-
visibility: segment2.isPlaceholder ? void 0 : "hidden",
|
|
10784
|
-
height: segment2.isPlaceholder ? void 0 : 0,
|
|
10785
|
-
width: segment2.isPlaceholder ? void 0 : 0,
|
|
10786
|
-
pointerEvents: "none"
|
|
10787
|
-
},
|
|
10788
|
-
children: segment2.placeholder
|
|
10789
|
-
}
|
|
10790
|
-
),
|
|
10791
|
-
segment2.isPlaceholder ? "" : segment2.text.padStart(String((_a = segment2.maxValue) != null ? _a : "").length, "0")
|
|
10792
|
-
]
|
|
10793
|
-
}
|
|
10794
|
-
);
|
|
10795
|
-
}
|
|
10796
|
-
DateSegment.displayName = "DateSegment";
|
|
10797
|
-
|
|
10798
10789
|
// src/components/date-inputs/DatePicker/DateField/CalendarButton.tsx
|
|
10799
|
-
var import_button = require("@react-aria/button");
|
|
10800
|
-
var import_styled_components71 = __toESM(require("styled-components"));
|
|
10801
|
-
var import_react80 = require("react");
|
|
10802
10790
|
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
10803
10791
|
var StyledButton4 = import_styled_components71.default.button`
|
|
10804
10792
|
${normalizeButton}
|
|
@@ -10835,55 +10823,144 @@ var StyledButton4 = import_styled_components71.default.button`
|
|
|
10835
10823
|
outline: none;
|
|
10836
10824
|
}
|
|
10837
10825
|
|
|
10838
|
-
*::selection {
|
|
10839
|
-
${selection}
|
|
10826
|
+
*::selection {
|
|
10827
|
+
${selection}
|
|
10828
|
+
}
|
|
10829
|
+
`;
|
|
10830
|
+
function CalendarButton({
|
|
10831
|
+
componentSize,
|
|
10832
|
+
...props
|
|
10833
|
+
}) {
|
|
10834
|
+
const ref = (0, import_react80.useRef)(null);
|
|
10835
|
+
const { buttonProps } = (0, import_button.useButton)(props, ref);
|
|
10836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
10837
|
+
StyledButton4,
|
|
10838
|
+
{
|
|
10839
|
+
...buttonProps,
|
|
10840
|
+
ref,
|
|
10841
|
+
type: "button",
|
|
10842
|
+
$isDisabled: props.isDisabled,
|
|
10843
|
+
$componentSize: componentSize,
|
|
10844
|
+
onClick: (e) => {
|
|
10845
|
+
var _a;
|
|
10846
|
+
if (!props.isDisabled) {
|
|
10847
|
+
(_a = buttonProps.onClick) == null ? void 0 : _a.call(buttonProps, e);
|
|
10848
|
+
}
|
|
10849
|
+
},
|
|
10850
|
+
className: [props.isDisabled ? "disabled" : false].filter(Boolean).join(" "),
|
|
10851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
10852
|
+
Icon,
|
|
10853
|
+
{
|
|
10854
|
+
icon: CalendarIcon,
|
|
10855
|
+
iconSize: componentSize === "medium" ? "medium" : "small"
|
|
10856
|
+
}
|
|
10857
|
+
)
|
|
10858
|
+
}
|
|
10859
|
+
);
|
|
10860
|
+
}
|
|
10861
|
+
|
|
10862
|
+
// src/components/date-inputs/DatePicker/DateField/DateSegment.tsx
|
|
10863
|
+
var import_datepicker = require("@react-aria/datepicker");
|
|
10864
|
+
var import_react81 = require("react");
|
|
10865
|
+
var import_styled_components72 = __toESM(require("styled-components"));
|
|
10866
|
+
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
10867
|
+
var {
|
|
10868
|
+
datefield: { segment: segmentTokens }
|
|
10869
|
+
} = datePickerTokens;
|
|
10870
|
+
var Segment = import_styled_components72.default.div`
|
|
10871
|
+
display: block;
|
|
10872
|
+
width: max-content;
|
|
10873
|
+
font-variant-numeric: tabular-nums;
|
|
10874
|
+
outline: none;
|
|
10875
|
+
padding: ${segmentTokens.padding.y} ${segmentTokens.padding.x};
|
|
10876
|
+
${({ $componentSize }) => import_styled_components72.css`
|
|
10877
|
+
font-family: ${segmentTokens[$componentSize].font.fontFamily};
|
|
10878
|
+
font-size: ${segmentTokens[$componentSize].font.fontSize};
|
|
10879
|
+
font-style: ${segmentTokens[$componentSize].font.fontStyle};
|
|
10880
|
+
font-weight: ${segmentTokens[$componentSize].font.fontWeight};
|
|
10881
|
+
line-height: ${segmentTokens[$componentSize].font.lineHeight};
|
|
10882
|
+
`}
|
|
10883
|
+
|
|
10884
|
+
&:focus:not([aria-readonly]) {
|
|
10885
|
+
background-color: ${segmentTokens.focus.backgroundColor};
|
|
10886
|
+
color: ${segmentTokens.focus.textColor};
|
|
10887
|
+
}
|
|
10888
|
+
`;
|
|
10889
|
+
var SegmentPlaceholder = import_styled_components72.default.span`
|
|
10890
|
+
display: block;
|
|
10891
|
+
width: 100%;
|
|
10892
|
+
font-variant-numeric: tabular-nums;
|
|
10893
|
+
|
|
10894
|
+
${({ $componentSize }) => import_styled_components72.css`
|
|
10895
|
+
font-family: ${segmentTokens[$componentSize].placeholder.fontFamily};
|
|
10896
|
+
font-size: ${segmentTokens[$componentSize].placeholder.fontSize};
|
|
10897
|
+
font-style: ${segmentTokens[$componentSize].placeholder.fontStyle};
|
|
10898
|
+
font-weight: ${segmentTokens[$componentSize].placeholder.fontWeight};
|
|
10899
|
+
line-height: ${segmentTokens[$componentSize].placeholder.lineHeight};
|
|
10900
|
+
color: ${segmentTokens[$componentSize].placeholder.textColor};
|
|
10901
|
+
`}
|
|
10902
|
+
|
|
10903
|
+
${Segment}:focus & {
|
|
10904
|
+
color: ${segmentTokens.focus.textColor};
|
|
10840
10905
|
}
|
|
10841
10906
|
`;
|
|
10842
|
-
function
|
|
10843
|
-
|
|
10844
|
-
|
|
10907
|
+
function DateSegment({
|
|
10908
|
+
segment: segment2,
|
|
10909
|
+
state,
|
|
10910
|
+
componentSize
|
|
10845
10911
|
}) {
|
|
10846
|
-
|
|
10847
|
-
const
|
|
10848
|
-
|
|
10849
|
-
|
|
10912
|
+
var _a;
|
|
10913
|
+
const ref = (0, import_react81.useRef)(null);
|
|
10914
|
+
const { segmentProps } = (0, import_datepicker.useDateSegment)(segment2, state, ref);
|
|
10915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(
|
|
10916
|
+
Segment,
|
|
10850
10917
|
{
|
|
10851
|
-
...
|
|
10852
|
-
ref,
|
|
10853
|
-
type: "button",
|
|
10854
|
-
$isDisabled: props.isDisabled,
|
|
10918
|
+
...segmentProps,
|
|
10855
10919
|
$componentSize: componentSize,
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
|
|
10860
|
-
}
|
|
10920
|
+
ref,
|
|
10921
|
+
style: {
|
|
10922
|
+
...segmentProps.style,
|
|
10923
|
+
minWidth: segment2.maxValue != null ? String(segment2.maxValue).length + "ch" : void 0
|
|
10861
10924
|
},
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10925
|
+
children: [
|
|
10926
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
10927
|
+
SegmentPlaceholder,
|
|
10928
|
+
{
|
|
10929
|
+
"aria-hidden": "true",
|
|
10930
|
+
$componentSize: componentSize,
|
|
10931
|
+
style: {
|
|
10932
|
+
visibility: segment2.isPlaceholder ? void 0 : "hidden",
|
|
10933
|
+
height: segment2.isPlaceholder ? void 0 : 0,
|
|
10934
|
+
width: segment2.isPlaceholder ? void 0 : 0,
|
|
10935
|
+
pointerEvents: "none"
|
|
10936
|
+
},
|
|
10937
|
+
children: segment2.placeholder
|
|
10938
|
+
}
|
|
10939
|
+
),
|
|
10940
|
+
segment2.isPlaceholder ? "" : segment2.text.padStart(String((_a = segment2.maxValue) != null ? _a : "").length, "0")
|
|
10941
|
+
]
|
|
10870
10942
|
}
|
|
10871
10943
|
);
|
|
10872
10944
|
}
|
|
10945
|
+
DateSegment.displayName = "DateSegment";
|
|
10873
10946
|
|
|
10874
10947
|
// src/components/date-inputs/common/DateInput.tsx
|
|
10875
|
-
var
|
|
10876
|
-
var
|
|
10877
|
-
var
|
|
10878
|
-
var DateFieldContainer =
|
|
10948
|
+
var import_react82 = require("react");
|
|
10949
|
+
var import_styled_components73 = __toESM(require("styled-components"));
|
|
10950
|
+
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
10951
|
+
var DateFieldContainer = import_styled_components73.default.div`
|
|
10879
10952
|
display: inline-flex;
|
|
10880
10953
|
flex-direction: column;
|
|
10881
10954
|
gap: ${datePickerTokens.labelGap};
|
|
10882
10955
|
`;
|
|
10883
|
-
var InputDiv = (0,
|
|
10956
|
+
var InputDiv = (0, import_styled_components73.default)(StatefulInput).attrs({
|
|
10884
10957
|
as: "div"
|
|
10885
10958
|
})`
|
|
10886
|
-
|
|
10959
|
+
${({ $width, componentSize = "medium" }) => $width ? import_styled_components73.css`
|
|
10960
|
+
width: ${$width};
|
|
10961
|
+
` : import_styled_components73.css`
|
|
10962
|
+
min-width: ${datePickerTokens.datefield[componentSize].minWidth};
|
|
10963
|
+
`}
|
|
10887
10964
|
display: inline-flex;
|
|
10888
10965
|
flex-direction: row;
|
|
10889
10966
|
gap: ${datePickerTokens.gap};
|
|
@@ -10891,11 +10968,11 @@ var InputDiv = (0, import_styled_components72.default)(StatefulInput).attrs({
|
|
|
10891
10968
|
padding-left: ${({ componentSize = "medium" }) => datePickerTokens.datefield[componentSize].paddingX};
|
|
10892
10969
|
padding-right: ${({ componentSize = "medium" }) => datePickerTokens.datefield[componentSize].paddingX};
|
|
10893
10970
|
`;
|
|
10894
|
-
var DateSegmentContainer =
|
|
10971
|
+
var DateSegmentContainer = import_styled_components73.default.div`
|
|
10895
10972
|
display: flex;
|
|
10896
10973
|
flex-direction: row;
|
|
10897
10974
|
`;
|
|
10898
|
-
var DateInput = (0,
|
|
10975
|
+
var DateInput = (0, import_react82.forwardRef)(
|
|
10899
10976
|
({
|
|
10900
10977
|
errorMessage,
|
|
10901
10978
|
tip,
|
|
@@ -10911,6 +10988,7 @@ var DateInput = (0, import_react81.forwardRef)(
|
|
|
10911
10988
|
prefix: button3,
|
|
10912
10989
|
labelProps,
|
|
10913
10990
|
fieldProps,
|
|
10991
|
+
width,
|
|
10914
10992
|
...props
|
|
10915
10993
|
}, forwardedRef) => {
|
|
10916
10994
|
var _a;
|
|
@@ -10918,12 +10996,13 @@ var DateInput = (0, import_react81.forwardRef)(
|
|
|
10918
10996
|
const hasTip = !!tip;
|
|
10919
10997
|
const hasLabel = props.label != null;
|
|
10920
10998
|
const hasMessage = hasErrorMessage || hasTip;
|
|
10921
|
-
return /* @__PURE__ */ (0,
|
|
10922
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
10923
|
-
/* @__PURE__ */ (0,
|
|
10999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(DateFieldContainer, { className, ref: forwardedRef, children: [
|
|
11000
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(Label, { ...labelProps, showRequiredStyling: required, children: props.label }),
|
|
11001
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(
|
|
10924
11002
|
InputDiv,
|
|
10925
11003
|
{
|
|
10926
11004
|
...fieldProps,
|
|
11005
|
+
$width: width,
|
|
10927
11006
|
style,
|
|
10928
11007
|
disabled,
|
|
10929
11008
|
componentSize,
|
|
@@ -10936,11 +11015,11 @@ var DateInput = (0, import_react81.forwardRef)(
|
|
|
10936
11015
|
),
|
|
10937
11016
|
children: [
|
|
10938
11017
|
button3,
|
|
10939
|
-
/* @__PURE__ */ (0,
|
|
11018
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(DateSegmentContainer, { children })
|
|
10940
11019
|
]
|
|
10941
11020
|
}
|
|
10942
11021
|
),
|
|
10943
|
-
hasMessage && /* @__PURE__ */ (0,
|
|
11022
|
+
hasMessage && /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
10944
11023
|
InputMessage,
|
|
10945
11024
|
{
|
|
10946
11025
|
messageType: hasErrorMessage ? "error" : "tip",
|
|
@@ -10953,18 +11032,18 @@ var DateInput = (0, import_react81.forwardRef)(
|
|
|
10953
11032
|
DateInput.displayName = "DateInput";
|
|
10954
11033
|
|
|
10955
11034
|
// src/components/date-inputs/DatePicker/DateField/DateField.tsx
|
|
10956
|
-
var
|
|
10957
|
-
var DateField = (0,
|
|
11035
|
+
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
11036
|
+
var DateField = (0, import_react83.forwardRef)(
|
|
10958
11037
|
({ componentSize = "medium", buttonProps, ...props }, forwardedRef) => {
|
|
10959
11038
|
const state = (0, import_datepicker3.useDateFieldState)({
|
|
10960
11039
|
...props,
|
|
10961
11040
|
locale,
|
|
10962
11041
|
createCalendar: import_date5.createCalendar
|
|
10963
11042
|
});
|
|
10964
|
-
const ref = (0,
|
|
11043
|
+
const ref = (0, import_react83.useRef)(null);
|
|
10965
11044
|
const { labelProps, fieldProps } = (0, import_datepicker2.useDateField)(props, state, ref);
|
|
10966
11045
|
const disabled = props.isDisabled || !!fieldProps["aria-disabled"];
|
|
10967
|
-
return /* @__PURE__ */ (0,
|
|
11046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
10968
11047
|
DateInput,
|
|
10969
11048
|
{
|
|
10970
11049
|
...props,
|
|
@@ -10975,7 +11054,7 @@ var DateField = (0, import_react82.forwardRef)(
|
|
|
10975
11054
|
ref: forwardedRef,
|
|
10976
11055
|
internalRef: ref,
|
|
10977
11056
|
readOnly: props.isReadOnly,
|
|
10978
|
-
prefix: !props.isReadOnly && /* @__PURE__ */ (0,
|
|
11057
|
+
prefix: !props.isReadOnly && /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
10979
11058
|
CalendarButton,
|
|
10980
11059
|
{
|
|
10981
11060
|
componentSize,
|
|
@@ -10985,7 +11064,7 @@ var DateField = (0, import_react82.forwardRef)(
|
|
|
10985
11064
|
),
|
|
10986
11065
|
labelProps,
|
|
10987
11066
|
fieldProps,
|
|
10988
|
-
children: state.segments.map((segment2, i) => /* @__PURE__ */ (0,
|
|
11067
|
+
children: state.segments.map((segment2, i) => /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
10989
11068
|
DateSegment,
|
|
10990
11069
|
{
|
|
10991
11070
|
componentSize,
|
|
@@ -11000,76 +11079,9 @@ var DateField = (0, import_react82.forwardRef)(
|
|
|
11000
11079
|
);
|
|
11001
11080
|
DateField.displayName = "DateField";
|
|
11002
11081
|
|
|
11003
|
-
// src/components/date-inputs/DatePicker/CalendarPopover.tsx
|
|
11004
|
-
var import_react83 = require("react");
|
|
11005
|
-
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11006
|
-
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
11007
|
-
var { popover: popoverTokens } = calendarTokens;
|
|
11008
|
-
var CalendarPopoverContext = (0, import_react83.createContext)({
|
|
11009
|
-
anchorRef: null,
|
|
11010
|
-
isOpen: false,
|
|
11011
|
-
onClose: () => null
|
|
11012
|
-
});
|
|
11013
|
-
var CalendarPopover = ({
|
|
11014
|
-
children,
|
|
11015
|
-
isOpen,
|
|
11016
|
-
onClose
|
|
11017
|
-
}) => {
|
|
11018
|
-
const anchorRef = (0, import_react83.useRef)(null);
|
|
11019
|
-
useOnKeyDown("Escape", onClose);
|
|
11020
|
-
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(CalendarPopoverContext.Provider, { value: { anchorRef, isOpen, onClose }, children });
|
|
11021
|
-
};
|
|
11022
|
-
var Anchor = import_styled_components73.default.div`
|
|
11023
|
-
display: inline-flex;
|
|
11024
|
-
`;
|
|
11025
|
-
var CalendarPopoverAnchor = ({
|
|
11026
|
-
children
|
|
11027
|
-
}) => {
|
|
11028
|
-
const { anchorRef } = (0, import_react83.useContext)(CalendarPopoverContext);
|
|
11029
|
-
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Anchor, { ref: anchorRef != null ? anchorRef : void 0, children });
|
|
11030
|
-
};
|
|
11031
|
-
var PopoverContentContainer = import_styled_components73.default.div`
|
|
11032
|
-
background-color: ${popoverTokens.backgroundColor};
|
|
11033
|
-
border: ${popoverTokens.border};
|
|
11034
|
-
border-radius: ${popoverTokens.borderRadius};
|
|
11035
|
-
padding: ${popoverTokens.padding};
|
|
11036
|
-
z-index: ${popoverTokens.zIndex};
|
|
11037
|
-
`;
|
|
11038
|
-
var CalendarPopoverContent = ({
|
|
11039
|
-
children
|
|
11040
|
-
}) => {
|
|
11041
|
-
const ref = (0, import_react83.useRef)(null);
|
|
11042
|
-
const { refs, styles } = useFloatPosition(null, {
|
|
11043
|
-
placement: "bottom-start"
|
|
11044
|
-
});
|
|
11045
|
-
const { isOpen, onClose, anchorRef } = (0, import_react83.useContext)(CalendarPopoverContext);
|
|
11046
|
-
const combinedRef = useCombinedRef(refs.setFloating, ref);
|
|
11047
|
-
useOnClickOutside(ref.current, onClose);
|
|
11048
|
-
(0, import_react83.useEffect)(() => {
|
|
11049
|
-
var _a;
|
|
11050
|
-
refs.setReference((_a = anchorRef == null ? void 0 : anchorRef.current) != null ? _a : null);
|
|
11051
|
-
}, []);
|
|
11052
|
-
if (!isOpen)
|
|
11053
|
-
return null;
|
|
11054
|
-
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
11055
|
-
PopoverContentContainer,
|
|
11056
|
-
{
|
|
11057
|
-
ref: combinedRef,
|
|
11058
|
-
style: styles.floating,
|
|
11059
|
-
onBlur: (e) => {
|
|
11060
|
-
const newFocus = e.relatedTarget;
|
|
11061
|
-
if (ref.current && !ref.current.contains(newFocus)) {
|
|
11062
|
-
onClose();
|
|
11063
|
-
}
|
|
11064
|
-
},
|
|
11065
|
-
children
|
|
11066
|
-
}
|
|
11067
|
-
);
|
|
11068
|
-
};
|
|
11069
|
-
|
|
11070
11082
|
// src/components/date-inputs/utils/useFocusManagerRef.ts
|
|
11071
|
-
var import_react84 = require("react");
|
|
11072
11083
|
var import_focus = require("@react-aria/focus");
|
|
11084
|
+
var import_react84 = require("react");
|
|
11073
11085
|
function useFocusManagerRef(ref) {
|
|
11074
11086
|
const domRef = (0, import_react84.useRef)(null);
|
|
11075
11087
|
(0, import_react84.useImperativeHandle)(ref, () => ({
|
|
@@ -11093,14 +11105,14 @@ var import_jsx_runtime237 = require("react/jsx-runtime");
|
|
|
11093
11105
|
var refIsFocusable = (ref) => {
|
|
11094
11106
|
return typeof ref === "object" && ref !== null && "focus" in ref;
|
|
11095
11107
|
};
|
|
11096
|
-
function _DatePicker({ errorMessage, componentSize, tip, style, ...props }, forwardedRef) {
|
|
11097
|
-
const state = (0,
|
|
11108
|
+
function _DatePicker({ errorMessage, componentSize, tip, style, width, ...props }, forwardedRef) {
|
|
11109
|
+
const state = (0, import_datepicker5.useDatePickerState)(props);
|
|
11098
11110
|
const domRef = useFocusManagerRef(
|
|
11099
11111
|
refIsFocusable(import_react85.forwardRef) ? forwardedRef : null
|
|
11100
11112
|
);
|
|
11101
11113
|
const ref = (0, import_react85.useRef)(null);
|
|
11102
11114
|
const combinedRef = useCombinedRef(ref, domRef);
|
|
11103
|
-
const { buttonProps, calendarProps, fieldProps } = (0,
|
|
11115
|
+
const { buttonProps, calendarProps, fieldProps } = (0, import_datepicker4.useDatePicker)(
|
|
11104
11116
|
{ ...props, granularity: "day" },
|
|
11105
11117
|
state,
|
|
11106
11118
|
ref
|
|
@@ -11117,7 +11129,8 @@ function _DatePicker({ errorMessage, componentSize, tip, style, ...props }, forw
|
|
|
11117
11129
|
errorMessage,
|
|
11118
11130
|
buttonProps,
|
|
11119
11131
|
isOpen: state.isOpen,
|
|
11120
|
-
style
|
|
11132
|
+
style,
|
|
11133
|
+
width
|
|
11121
11134
|
}
|
|
11122
11135
|
) }),
|
|
11123
11136
|
/* @__PURE__ */ (0, import_jsx_runtime237.jsx)(CalendarPopoverContent, { children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Calendar, { ...calendarProps }) })
|
|
@@ -11127,9 +11140,9 @@ var DatePicker = (0, import_react85.forwardRef)(_DatePicker);
|
|
|
11127
11140
|
DatePicker.displayName = "DatePicker";
|
|
11128
11141
|
|
|
11129
11142
|
// src/components/date-inputs/TimePicker/TimePicker.tsx
|
|
11130
|
-
var import_react86 = require("react");
|
|
11131
11143
|
var import_datepicker6 = require("@react-aria/datepicker");
|
|
11132
11144
|
var import_datepicker7 = require("@react-stately/datepicker");
|
|
11145
|
+
var import_react86 = require("react");
|
|
11133
11146
|
var import_styled_components74 = __toESM(require("styled-components"));
|
|
11134
11147
|
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
11135
11148
|
var TimePickerIcon = (0, import_styled_components74.default)(Icon)`
|
|
@@ -11137,7 +11150,7 @@ var TimePickerIcon = (0, import_styled_components74.default)(Icon)`
|
|
|
11137
11150
|
width: ${({ $componentSize }) => datePickerTokens.calendarButton[$componentSize].size};
|
|
11138
11151
|
margin-left: -1px; // To align with TextInputs icons
|
|
11139
11152
|
`;
|
|
11140
|
-
function _TimePicker({ componentSize = "medium", ...props }, forwardedRef) {
|
|
11153
|
+
function _TimePicker({ componentSize = "medium", width, ...props }, forwardedRef) {
|
|
11141
11154
|
const ref = (0, import_react86.useRef)(null);
|
|
11142
11155
|
const state = (0, import_datepicker7.useTimeFieldState)({
|
|
11143
11156
|
...props,
|
|
@@ -11153,6 +11166,7 @@ function _TimePicker({ componentSize = "medium", ...props }, forwardedRef) {
|
|
|
11153
11166
|
DateInput,
|
|
11154
11167
|
{
|
|
11155
11168
|
...props,
|
|
11169
|
+
width,
|
|
11156
11170
|
disabled,
|
|
11157
11171
|
required: props.isRequired,
|
|
11158
11172
|
componentSize,
|
|
@@ -11192,6 +11206,26 @@ function nativeDateToDateValue(date, timeZone = "Europe/Oslo") {
|
|
|
11192
11206
|
function dateValueToNativeDate(date, timeZone = "Europe/Oslo") {
|
|
11193
11207
|
return date.toDate(timeZone);
|
|
11194
11208
|
}
|
|
11209
|
+
function nativeDateToCalendarDate(date) {
|
|
11210
|
+
return new import_date6.CalendarDate(
|
|
11211
|
+
date.getFullYear(),
|
|
11212
|
+
date.getMonth() + 1,
|
|
11213
|
+
date.getDate()
|
|
11214
|
+
);
|
|
11215
|
+
}
|
|
11216
|
+
function nativeDateToTime(date) {
|
|
11217
|
+
return new import_date6.Time(date.getHours(), date.getMinutes(), date.getSeconds());
|
|
11218
|
+
}
|
|
11219
|
+
function calendarDateToNativeDate(date, time = new import_date6.Time(12, 0, 0, 0)) {
|
|
11220
|
+
return new Date(
|
|
11221
|
+
date.year,
|
|
11222
|
+
date.month - 1,
|
|
11223
|
+
date.day,
|
|
11224
|
+
time.hour,
|
|
11225
|
+
time.minute,
|
|
11226
|
+
time.second
|
|
11227
|
+
);
|
|
11228
|
+
}
|
|
11195
11229
|
|
|
11196
11230
|
// src/components/Popover/Popover.tsx
|
|
11197
11231
|
var import_dds_design_tokens46 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -11560,8 +11594,8 @@ var ToggleButtonGroup = (props) => {
|
|
|
11560
11594
|
ToggleButtonGroup.displayName = "ToggleButtonGroup";
|
|
11561
11595
|
|
|
11562
11596
|
// src/components/Tabs/Tabs.tsx
|
|
11563
|
-
var import_styled_components78 = __toESM(require("styled-components"));
|
|
11564
11597
|
var import_react92 = require("react");
|
|
11598
|
+
var import_styled_components78 = __toESM(require("styled-components"));
|
|
11565
11599
|
|
|
11566
11600
|
// src/components/Tabs/Tabs.context.tsx
|
|
11567
11601
|
var import_react91 = require("react");
|
|
@@ -12435,6 +12469,15 @@ ToggleRadio.displayName = "ToggleRadio";
|
|
|
12435
12469
|
// src/components/Grid/Grid.tsx
|
|
12436
12470
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
12437
12471
|
|
|
12472
|
+
// src/components/Grid/Grid.context.tsx
|
|
12473
|
+
var import_react104 = require("react");
|
|
12474
|
+
var GridContext = (0, import_react104.createContext)({
|
|
12475
|
+
screenSize: 3 /* Large */
|
|
12476
|
+
});
|
|
12477
|
+
var useGridContext = () => {
|
|
12478
|
+
return (0, import_react104.useContext)(GridContext);
|
|
12479
|
+
};
|
|
12480
|
+
|
|
12438
12481
|
// src/components/Grid/Grid.tokens.tsx
|
|
12439
12482
|
var import_dds_design_tokens52 = require("@norges-domstoler/dds-design-tokens");
|
|
12440
12483
|
var { grid: grid2, spacing: spacing33 } = import_dds_design_tokens52.ddsBaseTokens;
|
|
@@ -12529,15 +12572,6 @@ var gridTokens2 = {
|
|
|
12529
12572
|
}
|
|
12530
12573
|
};
|
|
12531
12574
|
|
|
12532
|
-
// src/components/Grid/Grid.context.tsx
|
|
12533
|
-
var import_react104 = require("react");
|
|
12534
|
-
var GridContext = (0, import_react104.createContext)({
|
|
12535
|
-
screenSize: 3 /* Large */
|
|
12536
|
-
});
|
|
12537
|
-
var useGridContext = () => {
|
|
12538
|
-
return (0, import_react104.useContext)(GridContext);
|
|
12539
|
-
};
|
|
12540
|
-
|
|
12541
12575
|
// src/components/Grid/Grid.tsx
|
|
12542
12576
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
12543
12577
|
var getHooksGridStyling = (screenSize, maxWidth, rowGap) => {
|
|
@@ -13656,6 +13690,7 @@ var File = (props) => {
|
|
|
13656
13690
|
};
|
|
13657
13691
|
|
|
13658
13692
|
// src/components/FileUploader/useFileUploader.ts
|
|
13693
|
+
var import_file_selector = require("file-selector");
|
|
13659
13694
|
var import_react116 = require("react");
|
|
13660
13695
|
|
|
13661
13696
|
// src/components/FileUploader/fileUploaderReducer.ts
|
|
@@ -13693,9 +13728,6 @@ var fileUploaderReducer = (state, action) => {
|
|
|
13693
13728
|
}
|
|
13694
13729
|
};
|
|
13695
13730
|
|
|
13696
|
-
// src/components/FileUploader/useFileUploader.ts
|
|
13697
|
-
var import_file_selector = require("file-selector");
|
|
13698
|
-
|
|
13699
13731
|
// src/components/FileUploader/utils.ts
|
|
13700
13732
|
var import_attr_accept = __toESM(require("attr-accept"));
|
|
13701
13733
|
var preventDefaults = (event) => {
|
|
@@ -14111,65 +14143,14 @@ BackLink.displayName = "BackLink";
|
|
|
14111
14143
|
// src/components/Feedback/Feedback.tsx
|
|
14112
14144
|
var import_react119 = require("react");
|
|
14113
14145
|
|
|
14114
|
-
// src/components/Feedback/
|
|
14115
|
-
var import_styled_components100 = __toESM(require("styled-components"));
|
|
14146
|
+
// src/components/Feedback/CommentComponent.tsx
|
|
14116
14147
|
var import_dds_design_tokens61 = require("@norges-domstoler/dds-design-tokens");
|
|
14148
|
+
var import_styled_components100 = __toESM(require("styled-components"));
|
|
14117
14149
|
var import_jsx_runtime272 = require("react/jsx-runtime");
|
|
14118
|
-
var
|
|
14119
|
-
display: flex;
|
|
14120
|
-
gap: ${import_dds_design_tokens61.ddsBaseTokens.spacing.SizesDdsSpacingX1};
|
|
14121
|
-
${({ $layout }) => import_styled_components100.css`
|
|
14122
|
-
flex-direction: ${$layout === "horizontal" ? "row" : "column"};
|
|
14123
|
-
align-items: ${$layout === "horizontal" ? "center" : "start"};
|
|
14124
|
-
`}
|
|
14125
|
-
`;
|
|
14126
|
-
var RatingButton = (0, import_styled_components100.default)(Button)`
|
|
14127
|
-
padding: 0px;
|
|
14128
|
-
color: ${import_dds_design_tokens61.ddsBaseTokens.colors.DdsColorNeutralsGray7};
|
|
14129
|
-
`;
|
|
14130
|
-
var RatingComponent = ({
|
|
14131
|
-
layout,
|
|
14132
|
-
ratingLabel,
|
|
14133
|
-
loading,
|
|
14134
|
-
thumbUpTooltip,
|
|
14135
|
-
thumbDownTooltip,
|
|
14136
|
-
handleRatingChange
|
|
14137
|
-
}) => {
|
|
14138
|
-
return /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(RatingContainer, { $layout: layout, children: [
|
|
14139
|
-
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(Label, { children: ratingLabel }),
|
|
14140
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(Spinner, { tooltip: "Laster opp tilbakemelding ..." }) : /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(HStack, { gap: "x1", children: [
|
|
14141
|
-
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(Tooltip, { text: thumbUpTooltip, children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14142
|
-
RatingButton,
|
|
14143
|
-
{
|
|
14144
|
-
htmlProps: { "aria-label": thumbUpTooltip },
|
|
14145
|
-
icon: Thumbup,
|
|
14146
|
-
appearance: "borderless",
|
|
14147
|
-
onClick: () => handleRatingChange("positive"),
|
|
14148
|
-
size: "large"
|
|
14149
|
-
}
|
|
14150
|
-
) }),
|
|
14151
|
-
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(Tooltip, { text: thumbDownTooltip, children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14152
|
-
RatingButton,
|
|
14153
|
-
{
|
|
14154
|
-
htmlProps: { "aria-label": thumbDownTooltip },
|
|
14155
|
-
icon: Thumbdown,
|
|
14156
|
-
appearance: "borderless",
|
|
14157
|
-
onClick: () => handleRatingChange("negative"),
|
|
14158
|
-
size: "large"
|
|
14159
|
-
}
|
|
14160
|
-
) }) })
|
|
14161
|
-
] })
|
|
14162
|
-
] });
|
|
14163
|
-
};
|
|
14164
|
-
|
|
14165
|
-
// src/components/Feedback/CommentComponent.tsx
|
|
14166
|
-
var import_styled_components101 = __toESM(require("styled-components"));
|
|
14167
|
-
var import_dds_design_tokens62 = require("@norges-domstoler/dds-design-tokens");
|
|
14168
|
-
var import_jsx_runtime273 = require("react/jsx-runtime");
|
|
14169
|
-
var IconLabelSpan = import_styled_components101.default.span`
|
|
14150
|
+
var IconLabelSpan = import_styled_components100.default.span`
|
|
14170
14151
|
display: inline-flex;
|
|
14171
14152
|
align-items: center;
|
|
14172
|
-
gap: ${
|
|
14153
|
+
gap: ${import_dds_design_tokens61.ddsBaseTokens.spacing.SizesDdsSpacingX05};
|
|
14173
14154
|
`;
|
|
14174
14155
|
var CommentComponent = ({
|
|
14175
14156
|
rating,
|
|
@@ -14181,21 +14162,21 @@ var CommentComponent = ({
|
|
|
14181
14162
|
handleSubmit,
|
|
14182
14163
|
handleFeedbackTextChange
|
|
14183
14164
|
}) => {
|
|
14184
|
-
return /* @__PURE__ */ (0,
|
|
14185
|
-
/* @__PURE__ */ (0,
|
|
14186
|
-
/* @__PURE__ */ (0,
|
|
14165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(VStack, { gap: "x1", align: "flex-start", children: [
|
|
14166
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(IconLabelSpan, { children: [
|
|
14167
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14187
14168
|
Icon,
|
|
14188
14169
|
{
|
|
14189
14170
|
icon: rating === "positive" ? ThumbupFilled : ThumbdownFilled,
|
|
14190
|
-
color:
|
|
14171
|
+
color: import_dds_design_tokens61.ddsBaseTokens.colors.DdsColorInteractiveBase
|
|
14191
14172
|
}
|
|
14192
14173
|
),
|
|
14193
|
-
/* @__PURE__ */ (0,
|
|
14174
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(Paragraph, { children: [
|
|
14194
14175
|
ratingSubmittedTitle,
|
|
14195
14176
|
" "
|
|
14196
14177
|
] })
|
|
14197
14178
|
] }),
|
|
14198
|
-
/* @__PURE__ */ (0,
|
|
14179
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14199
14180
|
TextArea,
|
|
14200
14181
|
{
|
|
14201
14182
|
value: feedbackText,
|
|
@@ -14204,7 +14185,7 @@ var CommentComponent = ({
|
|
|
14204
14185
|
tip: "Ikke send inn personopplysninger eller annen sensitiv informasjon"
|
|
14205
14186
|
}
|
|
14206
14187
|
),
|
|
14207
|
-
/* @__PURE__ */ (0,
|
|
14188
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14208
14189
|
Button,
|
|
14209
14190
|
{
|
|
14210
14191
|
purpose: "secondary",
|
|
@@ -14217,6 +14198,57 @@ var CommentComponent = ({
|
|
|
14217
14198
|
] });
|
|
14218
14199
|
};
|
|
14219
14200
|
|
|
14201
|
+
// src/components/Feedback/RatingComponent.tsx
|
|
14202
|
+
var import_dds_design_tokens62 = require("@norges-domstoler/dds-design-tokens");
|
|
14203
|
+
var import_styled_components101 = __toESM(require("styled-components"));
|
|
14204
|
+
var import_jsx_runtime273 = require("react/jsx-runtime");
|
|
14205
|
+
var RatingContainer = import_styled_components101.default.div`
|
|
14206
|
+
display: flex;
|
|
14207
|
+
gap: ${import_dds_design_tokens62.ddsBaseTokens.spacing.SizesDdsSpacingX1};
|
|
14208
|
+
${({ $layout }) => import_styled_components101.css`
|
|
14209
|
+
flex-direction: ${$layout === "horizontal" ? "row" : "column"};
|
|
14210
|
+
align-items: ${$layout === "horizontal" ? "center" : "start"};
|
|
14211
|
+
`}
|
|
14212
|
+
`;
|
|
14213
|
+
var RatingButton = (0, import_styled_components101.default)(Button)`
|
|
14214
|
+
padding: 0px;
|
|
14215
|
+
color: ${import_dds_design_tokens62.ddsBaseTokens.colors.DdsColorNeutralsGray7};
|
|
14216
|
+
`;
|
|
14217
|
+
var RatingComponent = ({
|
|
14218
|
+
layout,
|
|
14219
|
+
ratingLabel,
|
|
14220
|
+
loading,
|
|
14221
|
+
thumbUpTooltip,
|
|
14222
|
+
thumbDownTooltip,
|
|
14223
|
+
handleRatingChange
|
|
14224
|
+
}) => {
|
|
14225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(RatingContainer, { $layout: layout, children: [
|
|
14226
|
+
/* @__PURE__ */ (0, import_jsx_runtime273.jsx)(Label, { children: ratingLabel }),
|
|
14227
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(Spinner, { tooltip: "Laster opp tilbakemelding ..." }) : /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(HStack, { gap: "x1", children: [
|
|
14228
|
+
/* @__PURE__ */ (0, import_jsx_runtime273.jsx)(Tooltip, { text: thumbUpTooltip, children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
|
|
14229
|
+
RatingButton,
|
|
14230
|
+
{
|
|
14231
|
+
htmlProps: { "aria-label": thumbUpTooltip },
|
|
14232
|
+
icon: Thumbup,
|
|
14233
|
+
appearance: "borderless",
|
|
14234
|
+
onClick: () => handleRatingChange("positive"),
|
|
14235
|
+
size: "large"
|
|
14236
|
+
}
|
|
14237
|
+
) }),
|
|
14238
|
+
/* @__PURE__ */ (0, import_jsx_runtime273.jsx)(Tooltip, { text: thumbDownTooltip, children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
|
|
14239
|
+
RatingButton,
|
|
14240
|
+
{
|
|
14241
|
+
htmlProps: { "aria-label": thumbDownTooltip },
|
|
14242
|
+
icon: Thumbdown,
|
|
14243
|
+
appearance: "borderless",
|
|
14244
|
+
onClick: () => handleRatingChange("negative"),
|
|
14245
|
+
size: "large"
|
|
14246
|
+
}
|
|
14247
|
+
) }) })
|
|
14248
|
+
] })
|
|
14249
|
+
] });
|
|
14250
|
+
};
|
|
14251
|
+
|
|
14220
14252
|
// src/components/Feedback/Feedback.tsx
|
|
14221
14253
|
var import_jsx_runtime274 = require("react/jsx-runtime");
|
|
14222
14254
|
var Feedback = ({
|
|
@@ -14544,6 +14576,7 @@ var Feedback = ({
|
|
|
14544
14576
|
WarningIcon,
|
|
14545
14577
|
ZoomInIcon,
|
|
14546
14578
|
ZoomOutIcon,
|
|
14579
|
+
calendarDateToNativeDate,
|
|
14547
14580
|
cn,
|
|
14548
14581
|
createSelectOptions,
|
|
14549
14582
|
dangerInputfield,
|
|
@@ -14581,7 +14614,9 @@ var Feedback = ({
|
|
|
14581
14614
|
isInlineElement,
|
|
14582
14615
|
isKeyboardEvent,
|
|
14583
14616
|
isRelativeGridColumn,
|
|
14617
|
+
nativeDateToCalendarDate,
|
|
14584
14618
|
nativeDateToDateValue,
|
|
14619
|
+
nativeDateToTime,
|
|
14585
14620
|
normalizeButton,
|
|
14586
14621
|
outlineOffset,
|
|
14587
14622
|
removeButtonStyling,
|