@biblioteksentralen/react 2.0.0 → 3.0.0-beta.1
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.ts +18 -14
- package/dist/index.js +168 -185
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +124 -152
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _chakra_ui_react from '@chakra-ui/react';
|
|
2
|
+
import { AlertRootProps, ButtonProps, BoxProps, InputProps, FieldLabelProps, LinkProps } from '@chakra-ui/react';
|
|
2
3
|
export * from '@chakra-ui/react';
|
|
3
|
-
import React, { ReactNode, FunctionComponent, HTMLAttributes, ErrorInfo } from 'react';
|
|
4
4
|
import { Modify } from '@biblioteksentralen/types';
|
|
5
|
+
import React, { ReactNode, FunctionComponent, HTMLAttributes, ErrorInfo } from 'react';
|
|
6
|
+
import { ComponentWithAs, ThemeTypings } from '@chakra-ui/system';
|
|
5
7
|
export { colors } from '@biblioteksentralen/utils';
|
|
6
|
-
import { ChakraTheme as ChakraTheme$1 } from '@chakra-ui/theme';
|
|
7
8
|
|
|
8
|
-
type Status =
|
|
9
|
-
type
|
|
10
|
-
|
|
9
|
+
type Status = "info" | "warning" | "success" | "error";
|
|
10
|
+
type CustomVariants = "inline";
|
|
11
|
+
type Variants = AlertRootProps["variant"] | CustomVariants;
|
|
12
|
+
interface Props$7 extends Modify<AlertRootProps, {
|
|
13
|
+
variant?: Variants;
|
|
14
|
+
}> {
|
|
11
15
|
children: ReactNode;
|
|
16
|
+
header?: ReactNode;
|
|
12
17
|
status: Status;
|
|
13
18
|
variant?: Variants;
|
|
14
19
|
}
|
|
15
|
-
declare function Alert({ status, children, variant, ...rest }: Props$7): React.JSX.Element;
|
|
20
|
+
declare function Alert({ status, children, variant, header, ...rest }: Props$7): React.JSX.Element;
|
|
16
21
|
|
|
17
22
|
type CustomButtonVariants = "primary" | "secondary" | "tertiary";
|
|
18
23
|
|
|
@@ -48,7 +53,7 @@ declare const HideWithCSS: FunctionComponent<Props$5>;
|
|
|
48
53
|
interface Props$4 extends InputProps {
|
|
49
54
|
label: string;
|
|
50
55
|
hideLabel?: boolean;
|
|
51
|
-
labelProps?:
|
|
56
|
+
labelProps?: FieldLabelProps;
|
|
52
57
|
helperText?: string;
|
|
53
58
|
errorMessage?: string;
|
|
54
59
|
}
|
|
@@ -56,9 +61,9 @@ interface Props$4 extends InputProps {
|
|
|
56
61
|
* Creating custom input-component to make sure label is always set (for accessibility)
|
|
57
62
|
* Also handles some common needs (helper text and error message. For more advanced input-components we leave it to the consumers to compose custom input-components based on Chakra
|
|
58
63
|
*/
|
|
59
|
-
declare const Input:
|
|
64
|
+
declare const Input: (props: Props$4) => React.JSX.Element;
|
|
60
65
|
|
|
61
|
-
type CustomLinkVariants = "plain";
|
|
66
|
+
type CustomLinkVariants = "plain" | "underline";
|
|
62
67
|
|
|
63
68
|
/**
|
|
64
69
|
* Re-exporting chackras Link with a customised types
|
|
@@ -76,7 +81,6 @@ declare function VisuallyHidden({ children, ...rest }: Props$3): React.JSX.Eleme
|
|
|
76
81
|
|
|
77
82
|
interface Props$2 {
|
|
78
83
|
children: ReactNode;
|
|
79
|
-
customTheme?: Partial<ChakraTheme>;
|
|
80
84
|
}
|
|
81
85
|
declare const BiblioteksentralenProvider: (props: Props$2) => React.JSX.Element;
|
|
82
86
|
|
|
@@ -95,7 +99,7 @@ declare class ErrorBoundary extends React.Component<Props$1, State> {
|
|
|
95
99
|
hasError: boolean;
|
|
96
100
|
};
|
|
97
101
|
componentDidCatch(error: any, errorInfo: any): void;
|
|
98
|
-
render(): string | number | boolean | Iterable<React.ReactNode> | React.
|
|
102
|
+
render(): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
interface Props {
|
|
@@ -111,8 +115,8 @@ interface Props {
|
|
|
111
115
|
}
|
|
112
116
|
declare function HashLinkTarget(props: Props): React.JSX.Element;
|
|
113
117
|
|
|
114
|
-
declare const withErrorBoundary: <Props>(Component: React.ComponentType<Props>, boundaryName: string) => React.
|
|
118
|
+
declare const withErrorBoundary: <Props>(Component: React.ComponentType<Props>, boundaryName: string) => (props: Props & React.JSX.IntrinsicAttributes) => React.JSX.Element;
|
|
115
119
|
|
|
116
|
-
declare const biblioteksentralenChakraTheme:
|
|
120
|
+
declare const biblioteksentralenChakraTheme: _chakra_ui_react.SystemContext;
|
|
117
121
|
|
|
118
122
|
export { Alert, BiblioteksentralenProvider, Button, ConditionalWrapper, ErrorBoundary, HashLinkTarget, HideWithCSS, Input, Link, VisuallyHidden, biblioteksentralenChakraTheme, withErrorBoundary };
|
package/dist/index.js
CHANGED
|
@@ -414,33 +414,21 @@ var variantStyles = {
|
|
|
414
414
|
}
|
|
415
415
|
};
|
|
416
416
|
function Alert(_param) {
|
|
417
|
-
var status = _param.status, children = _param.children, variant = _param.variant, rest = _object_without_properties(_param, [
|
|
417
|
+
var status = _param.status, children = _param.children, variant = _param.variant, header = _param.header, rest = _object_without_properties(_param, [
|
|
418
418
|
"status",
|
|
419
419
|
"children",
|
|
420
|
-
"variant"
|
|
420
|
+
"variant",
|
|
421
|
+
"header"
|
|
421
422
|
]);
|
|
422
423
|
var colors2 = colorLookup[status];
|
|
423
|
-
return /* @__PURE__ */ import_react2.default.createElement(import_react.
|
|
424
|
-
|
|
425
|
-
flexWrap: "wrap",
|
|
426
|
-
alignItems: "center",
|
|
427
|
-
gridGap: "0.5em 0.6em",
|
|
428
|
-
background: "white",
|
|
424
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Root, _object_spread({
|
|
425
|
+
status: status,
|
|
429
426
|
border: "0.1rem solid",
|
|
430
427
|
borderColor: colors2.color,
|
|
431
|
-
backgroundColor: colors2.bg
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
},
|
|
435
|
-
color: colors2.color,
|
|
436
|
-
flex: "0 0",
|
|
437
|
-
marginLeft: "auto",
|
|
438
|
-
marginRight: "auto",
|
|
439
|
-
lineHeight: "1",
|
|
440
|
-
fontSize: "1.5em"
|
|
441
|
-
}, iconLookup[status]), /* @__PURE__ */ import_react2.default.createElement(import_react.Box, {
|
|
442
|
-
flex: "1"
|
|
443
|
-
}, children));
|
|
428
|
+
backgroundColor: colors2.bg
|
|
429
|
+
}, variant === "inline" ? variantStyles[variant] : {}, rest), /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Indicator, null, iconLookup[status]), /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Content, {
|
|
430
|
+
color: "black"
|
|
431
|
+
}, header && /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Title, null, header), /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Description, null, children)));
|
|
444
432
|
}
|
|
445
433
|
// src/components/Button.tsx
|
|
446
434
|
var import_react3 = require("@chakra-ui/react");
|
|
@@ -503,7 +491,7 @@ function VisuallyHidden(_param) {
|
|
|
503
491
|
}, children);
|
|
504
492
|
}
|
|
505
493
|
// src/components/Input.tsx
|
|
506
|
-
var Input =
|
|
494
|
+
var Input = function(props) {
|
|
507
495
|
var labelProps = props.labelProps, label = props.label, helperText = props.helperText, errorMessage = props.errorMessage, hideLabel = props.hideLabel, inputProps = _object_without_properties(props, [
|
|
508
496
|
"labelProps",
|
|
509
497
|
"label",
|
|
@@ -511,25 +499,19 @@ var Input = (0, import_react10.forwardRef)(function(props, ref) {
|
|
|
511
499
|
"errorMessage",
|
|
512
500
|
"hideLabel"
|
|
513
501
|
]);
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}, helperText), /* @__PURE__ */ import_react10.default.createElement(import_react9.Input, _object_spread({
|
|
520
|
-
ref: ref
|
|
521
|
-
}, inputProps)), errorMessage && /* @__PURE__ */ import_react10.default.createElement(import_react9.FormErrorMessage, {
|
|
522
|
-
color: colors.statusRed,
|
|
523
|
-
fontWeight: 600
|
|
524
|
-
}, errorMessage));
|
|
525
|
-
});
|
|
502
|
+
var formLabel = /* @__PURE__ */ import_react10.default.createElement(import_react9.Field.Label, _object_spread({}, labelProps), label);
|
|
503
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react9.Field.Root, {
|
|
504
|
+
invalid: !!errorMessage
|
|
505
|
+
}, hideLabel ? /* @__PURE__ */ import_react10.default.createElement(VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ import_react10.default.createElement(import_react9.Field.HelperText, null, helperText), /* @__PURE__ */ import_react10.default.createElement(import_react9.Input, _object_spread({}, inputProps)), errorMessage && /* @__PURE__ */ import_react10.default.createElement(import_react9.Field.ErrorText, null, errorMessage));
|
|
506
|
+
};
|
|
526
507
|
// src/components/Link.tsx
|
|
527
508
|
var import_react11 = require("@chakra-ui/react");
|
|
528
509
|
var Link = import_react11.Link;
|
|
529
510
|
// src/BiblioteksentralenProvider.tsx
|
|
530
|
-
var
|
|
531
|
-
var
|
|
511
|
+
var import_react19 = __toESM(require("react"));
|
|
512
|
+
var import_react20 = require("@chakra-ui/react");
|
|
532
513
|
// src/styles/chakraTheme/ButtonStyles.ts
|
|
514
|
+
var import_react12 = require("@chakra-ui/react");
|
|
533
515
|
var variants = {
|
|
534
516
|
primary: {
|
|
535
517
|
backgroundColor: colors.black,
|
|
@@ -540,7 +522,7 @@ var variants = {
|
|
|
540
522
|
}
|
|
541
523
|
},
|
|
542
524
|
secondary: {
|
|
543
|
-
borderColor: "currentColor",
|
|
525
|
+
borderColor: "currentColor !important",
|
|
544
526
|
backgroundColor: "transparent",
|
|
545
527
|
color: "currentColor",
|
|
546
528
|
_hover: {
|
|
@@ -556,8 +538,8 @@ var variants = {
|
|
|
556
538
|
}
|
|
557
539
|
}
|
|
558
540
|
};
|
|
559
|
-
var ButtonStyles = {
|
|
560
|
-
|
|
541
|
+
var ButtonStyles = (0, import_react12.defineRecipe)({
|
|
542
|
+
base: {
|
|
561
543
|
border: "transparent 0.1em solid",
|
|
562
544
|
borderRadius: "0.35em",
|
|
563
545
|
fontWeight: 600,
|
|
@@ -567,181 +549,184 @@ var ButtonStyles = {
|
|
|
567
549
|
opacity: 1
|
|
568
550
|
}
|
|
569
551
|
},
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
552
|
+
variants: {
|
|
553
|
+
variant: _object_spread({}, variants),
|
|
554
|
+
sizes: {
|
|
555
|
+
sm: {
|
|
556
|
+
padding: "0.2em 0.5em",
|
|
557
|
+
fontSize: "1rem"
|
|
558
|
+
}
|
|
574
559
|
}
|
|
575
560
|
},
|
|
576
|
-
|
|
577
|
-
defaultProps: {
|
|
561
|
+
defaultVariants: {
|
|
578
562
|
variant: "primary"
|
|
579
563
|
}
|
|
580
|
-
};
|
|
581
|
-
// src/styles/chakraTheme/CheckboxStyles.ts
|
|
582
|
-
var import_react12 = require("@chakra-ui/react");
|
|
583
|
-
var import_anatomy = require("@chakra-ui/anatomy");
|
|
584
|
-
var _ref = (0, import_react12.createMultiStyleConfigHelpers)(import_anatomy.checkboxAnatomy.keys), definePartsStyle = _ref.definePartsStyle, defineMultiStyleConfigWithTypeIssue = _ref.defineMultiStyleConfig;
|
|
585
|
-
var defineMultiStyleConfig = defineMultiStyleConfigWithTypeIssue;
|
|
586
|
-
var baseStyle = definePartsStyle({
|
|
587
|
-
control: {
|
|
588
|
-
background: "white"
|
|
589
|
-
}
|
|
590
|
-
});
|
|
591
|
-
var CheckboxStyles = defineMultiStyleConfig({
|
|
592
|
-
baseStyle: baseStyle
|
|
593
564
|
});
|
|
594
565
|
// src/styles/chakraTheme/ContainerStyles.ts
|
|
595
|
-
var
|
|
596
|
-
|
|
566
|
+
var import_react13 = require("@chakra-ui/react");
|
|
567
|
+
var ContainerStyles = (0, import_react13.defineRecipe)({
|
|
568
|
+
base: {
|
|
597
569
|
px: ".75rem"
|
|
598
570
|
}
|
|
599
|
-
};
|
|
571
|
+
});
|
|
600
572
|
// src/styles/chakraTheme/HeadingStyles.ts
|
|
601
|
-
var
|
|
602
|
-
|
|
573
|
+
var import_react14 = require("@chakra-ui/react");
|
|
574
|
+
var HeadingStyles = (0, import_react14.defineRecipe)({
|
|
575
|
+
base: {
|
|
603
576
|
fontWeight: "600"
|
|
604
577
|
}
|
|
605
|
-
};
|
|
578
|
+
});
|
|
606
579
|
// src/styles/chakraTheme/InputStyles.ts
|
|
607
|
-
var
|
|
608
|
-
var
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
580
|
+
var import_react15 = require("@chakra-ui/react");
|
|
581
|
+
var variants2 = {
|
|
582
|
+
subtle: {
|
|
583
|
+
backgroundColor: {
|
|
584
|
+
_light: "gray.200",
|
|
585
|
+
_dark: "whiteAlpha.100"
|
|
586
|
+
},
|
|
587
|
+
_hover: {
|
|
588
|
+
bg: {
|
|
589
|
+
_light: "gray.300",
|
|
590
|
+
_dark: "whiteAlpha.200"
|
|
615
591
|
}
|
|
616
|
-
}
|
|
592
|
+
}
|
|
617
593
|
},
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
bg: (0, import_theme_tools.mode)("gray.200", "whiteAlpha.100")(props),
|
|
623
|
-
_hover: {
|
|
624
|
-
bg: (0, import_theme_tools.mode)("gray.300", "whiteAlpha.200")(props)
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
};
|
|
594
|
+
outline: {
|
|
595
|
+
borderColor: {
|
|
596
|
+
_light: "gray.300",
|
|
597
|
+
_dark: "whiteAlpha.300"
|
|
628
598
|
},
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
borderColor: (0, import_theme_tools.mode)("gray.400", "whiteAlpha.400")(props)
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
};
|
|
638
|
-
},
|
|
639
|
-
flushed: function(props) {
|
|
640
|
-
return {
|
|
641
|
-
field: {
|
|
642
|
-
borderColor: (0, import_theme_tools.mode)("gray.300", "whiteAlpha.300")(props),
|
|
643
|
-
_hover: {
|
|
644
|
-
borderColor: (0, import_theme_tools.mode)("gray.400", "whiteAlpha.400")(props)
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
};
|
|
599
|
+
_hover: {
|
|
600
|
+
borderColor: {
|
|
601
|
+
_light: "gray.400",
|
|
602
|
+
_dark: "whiteAlpha.400"
|
|
603
|
+
}
|
|
648
604
|
}
|
|
649
605
|
},
|
|
650
|
-
|
|
651
|
-
|
|
606
|
+
flushed: {
|
|
607
|
+
borderColor: {
|
|
608
|
+
_light: "gray.300",
|
|
609
|
+
_dark: "whiteAlpha.300"
|
|
610
|
+
},
|
|
611
|
+
_hover: {
|
|
612
|
+
borderColor: {
|
|
613
|
+
_light: "gray.400",
|
|
614
|
+
_dark: "whiteAlpha.400"
|
|
615
|
+
}
|
|
616
|
+
}
|
|
652
617
|
}
|
|
653
618
|
};
|
|
619
|
+
var InputStyles = (0, import_react15.defineRecipe)({
|
|
620
|
+
base: {
|
|
621
|
+
_placeholder: {
|
|
622
|
+
color: {
|
|
623
|
+
_light: "gray.500",
|
|
624
|
+
_dark: "whiteAlpha.500"
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
variants: {
|
|
629
|
+
variant: _object_spread({}, variants2)
|
|
630
|
+
},
|
|
631
|
+
defaultVariants: {
|
|
632
|
+
variant: "subtle"
|
|
633
|
+
}
|
|
634
|
+
});
|
|
654
635
|
// src/styles/chakraTheme/LinkStyles.ts
|
|
655
|
-
var
|
|
636
|
+
var import_react16 = require("@chakra-ui/react");
|
|
637
|
+
var variants3 = {
|
|
656
638
|
plain: {
|
|
657
639
|
textDecoration: "none",
|
|
658
640
|
_hover: {
|
|
659
641
|
textDecoration: "underline"
|
|
660
642
|
}
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
var LinkStyles = {
|
|
664
|
-
baseStyle: {
|
|
643
|
+
},
|
|
644
|
+
underline: {
|
|
665
645
|
textDecoration: "underline",
|
|
666
646
|
_hover: {
|
|
667
647
|
textDecoration: "none"
|
|
668
648
|
}
|
|
669
|
-
},
|
|
670
|
-
variants: variants2
|
|
671
|
-
};
|
|
672
|
-
// src/styles/chakraTheme/ModalStyles.ts
|
|
673
|
-
var ModalStyles = {
|
|
674
|
-
baseStyle: {
|
|
675
|
-
// Fix for modal height on Safari iOS:
|
|
676
|
-
// https://github.com/chakra-ui/chakra-ui/issues/4680#issuecomment-1301640929
|
|
677
|
-
dialogContainer: {
|
|
678
|
-
"@supports(height: -webkit-fill-available)": {},
|
|
679
|
-
height: "100%"
|
|
680
|
-
}
|
|
681
649
|
}
|
|
682
650
|
};
|
|
651
|
+
var LinkStyles = (0, import_react16.defineRecipe)({
|
|
652
|
+
variants: {
|
|
653
|
+
variant: _object_spread({}, variants3)
|
|
654
|
+
},
|
|
655
|
+
defaultVariants: {
|
|
656
|
+
variant: "underline"
|
|
657
|
+
}
|
|
658
|
+
});
|
|
683
659
|
// src/styles/chakraTheme/SpinnerStyles.ts
|
|
684
|
-
var
|
|
685
|
-
var SpinnerStyles = {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
660
|
+
var import_react17 = require("@chakra-ui/react");
|
|
661
|
+
var SpinnerStyles = (0, import_react17.defineRecipe)({
|
|
662
|
+
base: {
|
|
663
|
+
animationDuration: ".8s",
|
|
664
|
+
color: colors.accentBlueMedium,
|
|
665
|
+
// Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color
|
|
666
|
+
borderWidth: ".175em"
|
|
667
|
+
}
|
|
691
668
|
});
|
|
692
669
|
// src/styles/chakraTheme/sizes.ts
|
|
693
670
|
var container = {
|
|
694
|
-
sm:
|
|
695
|
-
|
|
696
|
-
|
|
671
|
+
sm: {
|
|
672
|
+
value: "40rem"
|
|
673
|
+
},
|
|
674
|
+
md: {
|
|
675
|
+
value: "48rem"
|
|
676
|
+
},
|
|
677
|
+
lg: {
|
|
678
|
+
value: "56rem"
|
|
679
|
+
},
|
|
697
680
|
// Forsøker 56rem som standardbredde etter testing med Katrine
|
|
698
|
-
xl:
|
|
681
|
+
xl: {
|
|
682
|
+
value: "80rem"
|
|
683
|
+
}
|
|
699
684
|
};
|
|
700
685
|
var sizes = {
|
|
701
686
|
container: container
|
|
702
687
|
};
|
|
703
688
|
// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
|
|
704
|
-
var
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}
|
|
689
|
+
var import_react18 = require("@chakra-ui/react");
|
|
690
|
+
var biblioteksentralenChakraTheme = (0, import_react18.createSystem)(import_react18.defaultConfig, {
|
|
691
|
+
theme: {
|
|
692
|
+
tokens: {
|
|
693
|
+
sizes: sizes
|
|
694
|
+
},
|
|
695
|
+
recipes: {
|
|
696
|
+
heading: HeadingStyles,
|
|
697
|
+
button: ButtonStyles,
|
|
698
|
+
input: InputStyles,
|
|
699
|
+
link: LinkStyles,
|
|
700
|
+
container: ContainerStyles,
|
|
701
|
+
spinner: SpinnerStyles
|
|
718
702
|
}
|
|
719
703
|
},
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
}
|
|
704
|
+
globalCss: {
|
|
705
|
+
html: {
|
|
706
|
+
fontSize: {
|
|
707
|
+
base: "112.5%",
|
|
708
|
+
md: "120%"
|
|
709
|
+
},
|
|
710
|
+
// Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,
|
|
711
|
+
// men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)
|
|
712
|
+
"&:focus-within": {
|
|
713
|
+
scrollBehavior: "smooth !important"
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
});
|
|
732
718
|
// src/BiblioteksentralenProvider.tsx
|
|
733
|
-
var
|
|
734
|
-
var BiblioteksentralenProvider = function(props)
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
}, props.children);
|
|
719
|
+
var import_system = require("@chakra-ui/system");
|
|
720
|
+
var BiblioteksentralenProvider = function(props) {
|
|
721
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react20.ChakraProvider, {
|
|
722
|
+
value: biblioteksentralenChakraTheme
|
|
723
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_system.ColorModeProvider, _object_spread({}, props)));
|
|
739
724
|
};
|
|
740
725
|
// src/components/ErrorBoundary.tsx
|
|
741
|
-
var
|
|
742
|
-
var
|
|
726
|
+
var import_react21 = require("@chakra-ui/react");
|
|
727
|
+
var import_react22 = __toESM(require("react"));
|
|
743
728
|
var StyledPre = function(props) {
|
|
744
|
-
return /* @__PURE__ */
|
|
729
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react21.Box, _object_spread({
|
|
745
730
|
as: "pre",
|
|
746
731
|
paddingTop: "0.5rem",
|
|
747
732
|
wordBreak: "break-all",
|
|
@@ -749,8 +734,8 @@ var StyledPre = function(props) {
|
|
|
749
734
|
fontSize: "0.8rem"
|
|
750
735
|
}, props));
|
|
751
736
|
};
|
|
752
|
-
var ErrorBoundary = /*#__PURE__*/ function(
|
|
753
|
-
_inherits(ErrorBoundary,
|
|
737
|
+
var ErrorBoundary = /*#__PURE__*/ function(_import_react22_default_Component) {
|
|
738
|
+
_inherits(ErrorBoundary, _import_react22_default_Component);
|
|
754
739
|
var _super = _create_super(ErrorBoundary);
|
|
755
740
|
function ErrorBoundary(props) {
|
|
756
741
|
_class_call_check(this, ErrorBoundary);
|
|
@@ -784,9 +769,9 @@ var ErrorBoundary = /*#__PURE__*/ function(_import_react17_default_Component) {
|
|
|
784
769
|
var stackTrace = (_this_state_errorInfo = this.state.errorInfo) === null || _this_state_errorInfo === void 0 ? void 0 : _this_state_errorInfo.componentStack;
|
|
785
770
|
var errormsg = (_this_state_error = this.state.error) === null || _this_state_error === void 0 ? void 0 : _this_state_error.message;
|
|
786
771
|
var info = this.props.boundaryName;
|
|
787
|
-
return /* @__PURE__ */
|
|
772
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", null, /* @__PURE__ */ import_react22.default.createElement(Alert, {
|
|
788
773
|
status: "error"
|
|
789
|
-
}, /* @__PURE__ */
|
|
774
|
+
}, /* @__PURE__ */ import_react22.default.createElement("p", null, "Beklager, det skjedde en teknisk feil."), isDevelopment() && (stackTrace || errormsg) && /* @__PURE__ */ import_react22.default.createElement("div", null, /* @__PURE__ */ import_react22.default.createElement(StyledPre, null, errormsg || ""), /* @__PURE__ */ import_react22.default.createElement(StyledPre, null, info || ""), /* @__PURE__ */ import_react22.default.createElement(StyledPre, null, stackTrace || ""))));
|
|
790
775
|
}
|
|
791
776
|
return this.props.children;
|
|
792
777
|
}
|
|
@@ -802,12 +787,12 @@ var ErrorBoundary = /*#__PURE__*/ function(_import_react17_default_Component) {
|
|
|
802
787
|
}
|
|
803
788
|
]);
|
|
804
789
|
return ErrorBoundary;
|
|
805
|
-
}(
|
|
790
|
+
}(import_react22.default.Component);
|
|
806
791
|
// src/components/HashLinkTarget.tsx
|
|
807
|
-
var
|
|
808
|
-
var
|
|
792
|
+
var import_react23 = require("@chakra-ui/react");
|
|
793
|
+
var import_react24 = __toESM(require("react"));
|
|
809
794
|
var focusOnRelativeParentStyle = {
|
|
810
|
-
|
|
795
|
+
_focusWithin: {
|
|
811
796
|
position: "static",
|
|
812
797
|
boxShadow: "none",
|
|
813
798
|
"&::after": {
|
|
@@ -824,10 +809,10 @@ var focusOnRelativeParentStyle = {
|
|
|
824
809
|
}
|
|
825
810
|
};
|
|
826
811
|
function HashLinkTarget(props) {
|
|
827
|
-
return /* @__PURE__ */
|
|
812
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_react23.Box, {
|
|
828
813
|
position: "relative",
|
|
829
|
-
|
|
830
|
-
}, /* @__PURE__ */
|
|
814
|
+
css: props.focusOnParent ? focusOnRelativeParentStyle : void 0
|
|
815
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react23.Box, {
|
|
831
816
|
id: props.id,
|
|
832
817
|
tabIndex: props.focusOnParent ? -1 : void 0,
|
|
833
818
|
position: "absolute",
|
|
@@ -838,15 +823,13 @@ function HashLinkTarget(props) {
|
|
|
838
823
|
}));
|
|
839
824
|
}
|
|
840
825
|
// src/components/withErrorBoundary.tsx
|
|
841
|
-
var
|
|
826
|
+
var import_react25 = __toESM(require("react"));
|
|
842
827
|
var withErrorBoundary = function(Component, boundaryName) {
|
|
843
|
-
return
|
|
844
|
-
return /* @__PURE__ */
|
|
828
|
+
return function(props) {
|
|
829
|
+
return /* @__PURE__ */ import_react25.default.createElement(ErrorBoundary, {
|
|
845
830
|
boundaryName: boundaryName
|
|
846
|
-
}, /* @__PURE__ */
|
|
847
|
-
|
|
848
|
-
})));
|
|
849
|
-
});
|
|
831
|
+
}, /* @__PURE__ */ import_react25.default.createElement(Component, _object_spread({}, props)));
|
|
832
|
+
};
|
|
850
833
|
};
|
|
851
834
|
// Annotate the CommonJS export names for ESM import in node:
|
|
852
835
|
0 && (module.exports = _object_spread({
|