@biblioteksentralen/react 3.0.0-beta.5 → 3.0.0-beta.7

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 CHANGED
@@ -1,5 +1,4 @@
1
- import * as _chakra_ui_react from '@chakra-ui/react';
2
- import { AlertRootProps, ButtonProps, BoxProps, InputProps, FieldLabelProps, LinkProps, ToastRootProps } from '@chakra-ui/react';
1
+ import { AlertRootProps, ButtonProps as ButtonProps$1, IconButtonProps as IconButtonProps$1, BoxProps, InputProps, FieldLabelProps, LinkProps, SystemConfig, ToastRootProps } from '@chakra-ui/react';
3
2
  export * from '@chakra-ui/react';
4
3
  import { ComponentWithAs, ThemeTypings } from '@chakra-ui/system';
5
4
  export { ResponsiveObject, StyleProps } from '@chakra-ui/system';
@@ -26,10 +25,21 @@ type CustomButtonVariants = "primary" | "secondary" | "tertiary";
26
25
  * Re-exporting chackras Button with a customised types
27
26
  * This causes both chakras native variants and our home-made variants to show up in auto-complete
28
27
  */
29
- type ButtonVariants = ButtonProps["variant"] | CustomButtonVariants;
30
- declare const Button: ComponentWithAs<"button", Modify<ButtonProps, {
28
+ type ButtonVariants = ButtonProps$1["variant"] | CustomButtonVariants;
29
+ type ButtonProps = Modify<ButtonProps$1, {
31
30
  variant?: ButtonVariants;
32
- }>>;
31
+ }>;
32
+ declare const Button: ComponentWithAs<"button", ButtonProps>;
33
+
34
+ /**
35
+ * Re-exporting chackras IconButton with a customised types
36
+ * This causes both chakras native variants and our home-made variants to show up in auto-complete
37
+ */
38
+ type IconButtonVariants = IconButtonProps$1["variant"] | CustomButtonVariants;
39
+ type IconButtonProps = Modify<IconButtonProps$1, {
40
+ variant?: IconButtonVariants;
41
+ }>;
42
+ declare const IconButton: ComponentWithAs<"button", IconButtonProps>;
33
43
 
34
44
  type Props$6 = {
35
45
  children: ReactNode;
@@ -82,6 +92,7 @@ declare function VisuallyHidden({ children, ...rest }: Props$3): React.JSX.Eleme
82
92
 
83
93
  interface Props$2 {
84
94
  children: ReactNode;
95
+ customTheme?: SystemConfig;
85
96
  }
86
97
  declare const BiblioteksentralenProvider: (props: Props$2) => React.JSX.Element;
87
98
 
@@ -118,9 +129,7 @@ declare function HashLinkTarget(props: Props): React.JSX.Element;
118
129
 
119
130
  declare const withErrorBoundary: <Props>(Component: React.ComponentType<Props>, boundaryName: string) => (props: Props & React.JSX.IntrinsicAttributes) => React.JSX.Element;
120
131
 
121
- declare const biblioteksentralenChakraTheme: _chakra_ui_react.SystemContext;
122
-
123
132
  declare const toaster: ToastRootProps;
124
133
  declare const Toaster: () => React.JSX.Element;
125
134
 
126
- export { Alert, BiblioteksentralenProvider, Button, ConditionalWrapper, ErrorBoundary, HashLinkTarget, HideWithCSS, Input, Link, Toaster, VisuallyHidden, biblioteksentralenChakraTheme, toaster, withErrorBoundary };
135
+ export { Alert, BiblioteksentralenProvider, Button, type ButtonProps, ConditionalWrapper, ErrorBoundary, HashLinkTarget, HideWithCSS, IconButton, type IconButtonProps, Input, Link, Toaster, VisuallyHidden, toaster, withErrorBoundary };
package/dist/index.js CHANGED
@@ -294,6 +294,9 @@ __export(src_exports, {
294
294
  HideWithCSS: function() {
295
295
  return HideWithCSS;
296
296
  },
297
+ IconButton: function() {
298
+ return IconButton;
299
+ },
297
300
  Input: function() {
298
301
  return Input;
299
302
  },
@@ -306,9 +309,6 @@ __export(src_exports, {
306
309
  VisuallyHidden: function() {
307
310
  return VisuallyHidden;
308
311
  },
309
- biblioteksentralenChakraTheme: function() {
310
- return biblioteksentralenChakraTheme;
311
- },
312
312
  colors: function() {
313
313
  return colors;
314
314
  },
@@ -429,25 +429,33 @@ function Alert(_param) {
429
429
  var colors2 = colorLookup[status];
430
430
  return /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Root, _object_spread({
431
431
  status: status,
432
+ fontSize: "md",
432
433
  border: "0.1rem solid",
433
434
  borderColor: colors2.color,
434
- backgroundColor: colors2.bg
435
- }, 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, {
435
+ backgroundColor: colors2.bg,
436
+ display: "flex",
437
+ flexWrap: "wrap"
438
+ }, variant === "inline" ? variantStyles[variant] : {}, rest), /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Indicator, {
439
+ marginX: "auto"
440
+ }, iconLookup[status]), /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Content, {
436
441
  color: "black"
437
442
  }, header && /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Title, null, header), /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Description, null, children)));
438
443
  }
439
444
  // src/components/Button.tsx
440
445
  var import_react3 = require("@chakra-ui/react");
441
446
  var Button = import_react3.Button;
447
+ // src/components/IconButton.tsx
448
+ var import_react4 = require("@chakra-ui/react");
449
+ var IconButton = import_react4.IconButton;
442
450
  // src/components/ConditionalWrapper.tsx
443
- var import_react4 = __toESM(require("react"));
451
+ var import_react5 = __toESM(require("react"));
444
452
  var ConditionalWrapper = function(param) {
445
453
  var condition = param.condition, children = param.children, Wrapper = param.wrapper;
446
- return condition ? /* @__PURE__ */ import_react4.default.createElement(Wrapper, null, children) : /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, children);
454
+ return condition ? /* @__PURE__ */ import_react5.default.createElement(Wrapper, null, children) : /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, children);
447
455
  };
448
456
  // src/components/HideWithCSS.tsx
449
- var import_react5 = require("@chakra-ui/react");
450
- var import_react6 = __toESM(require("react"));
457
+ var import_react6 = require("@chakra-ui/react");
458
+ var import_react7 = __toESM(require("react"));
451
459
  var HideWithCSS = function(_param) {
452
460
  var children = _param.children, above = _param.above, below = _param.below, chakraProps = _object_without_properties(_param, [
453
461
  "children",
@@ -457,22 +465,22 @@ var HideWithCSS = function(_param) {
457
465
  var display = _object_spread({}, !!below ? _define_property({
458
466
  base: "none"
459
467
  }, below, "block") : {}, !!above ? _define_property({}, above, "none") : {});
460
- return /* @__PURE__ */ import_react6.default.createElement(import_react5.Box, _object_spread_props(_object_spread({}, chakraProps), {
468
+ return /* @__PURE__ */ import_react7.default.createElement(import_react6.Box, _object_spread_props(_object_spread({}, chakraProps), {
461
469
  display: display
462
470
  }), children);
463
471
  };
464
472
  // src/components/Input.tsx
465
- var import_react9 = require("@chakra-ui/react");
466
- var import_react10 = __toESM(require("react"));
473
+ var import_react10 = require("@chakra-ui/react");
474
+ var import_react11 = __toESM(require("react"));
467
475
  // src/components/VisuallyHidden.tsx
468
- var import_react7 = __toESM(require("react"));
469
- var import_react8 = require("@chakra-ui/react");
476
+ var import_react8 = __toESM(require("react"));
477
+ var import_react9 = require("@chakra-ui/react");
470
478
  function VisuallyHidden(_param) {
471
479
  var children = _param.children, rest = _object_without_properties(_param, [
472
480
  "children"
473
481
  ]);
474
- var _import_react7_default_useState = _sliced_to_array(import_react7.default.useState(false), 2), forceShow = _import_react7_default_useState[0], setForceShow = _import_react7_default_useState[1];
475
- (0, import_react7.useEffect)(function() {
482
+ var _import_react8_default_useState = _sliced_to_array(import_react8.default.useState(false), 2), forceShow = _import_react8_default_useState[0], setForceShow = _import_react8_default_useState[1];
483
+ (0, import_react8.useEffect)(function() {
476
484
  if (isDevelopment()) {
477
485
  var handleKeyDown = function(ev) {
478
486
  if (ev.key === "Alt") {
@@ -492,7 +500,7 @@ function VisuallyHidden(_param) {
492
500
  };
493
501
  }
494
502
  }, []);
495
- return forceShow ? /* @__PURE__ */ import_react7.default.createElement("span", null, children) : /* @__PURE__ */ import_react7.default.createElement(import_react8.VisuallyHidden, {
503
+ return forceShow ? /* @__PURE__ */ import_react8.default.createElement("span", null, children) : /* @__PURE__ */ import_react8.default.createElement(import_react9.VisuallyHidden, {
496
504
  position: "fixed"
497
505
  }, children);
498
506
  }
@@ -505,19 +513,21 @@ var Input = function(props) {
505
513
  "errorMessage",
506
514
  "hideLabel"
507
515
  ]);
508
- var formLabel = /* @__PURE__ */ import_react10.default.createElement(import_react9.Field.Label, _object_spread({}, labelProps), label);
509
- return /* @__PURE__ */ import_react10.default.createElement(import_react9.Field.Root, {
516
+ var formLabel = /* @__PURE__ */ import_react11.default.createElement(import_react10.Field.Label, _object_spread({}, labelProps), label);
517
+ return /* @__PURE__ */ import_react11.default.createElement(import_react10.Field.Root, {
510
518
  invalid: !!errorMessage
511
- }, 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));
519
+ }, hideLabel ? /* @__PURE__ */ import_react11.default.createElement(VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ import_react11.default.createElement(import_react10.Field.HelperText, null, helperText), /* @__PURE__ */ import_react11.default.createElement(import_react10.Input, _object_spread({}, inputProps)), errorMessage && /* @__PURE__ */ import_react11.default.createElement(import_react10.Field.ErrorText, null, errorMessage));
512
520
  };
513
521
  // src/components/Link.tsx
514
- var import_react11 = require("@chakra-ui/react");
515
- var Link = import_react11.Link;
522
+ var import_react12 = require("@chakra-ui/react");
523
+ var Link = import_react12.Link;
516
524
  // src/BiblioteksentralenProvider.tsx
517
- var import_react19 = __toESM(require("react"));
518
- var import_react20 = require("@chakra-ui/react");
525
+ var import_react20 = __toESM(require("react"));
526
+ var import_react21 = require("@chakra-ui/react");
527
+ // src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
528
+ var import_react19 = require("@chakra-ui/react");
519
529
  // src/styles/chakraTheme/ButtonStyles.ts
520
- var import_react12 = require("@chakra-ui/react");
530
+ var import_react13 = require("@chakra-ui/react");
521
531
  var variants = {
522
532
  primary: {
523
533
  backgroundColor: colors.black,
@@ -544,7 +554,7 @@ var variants = {
544
554
  }
545
555
  }
546
556
  };
547
- var ButtonStyles = (0, import_react12.defineRecipe)({
557
+ var ButtonStyles = (0, import_react13.defineRecipe)({
548
558
  base: {
549
559
  border: "transparent 0.1em solid",
550
560
  borderRadius: "0.35em",
@@ -556,34 +566,43 @@ var ButtonStyles = (0, import_react12.defineRecipe)({
556
566
  }
557
567
  },
558
568
  variants: {
559
- variant: _object_spread({}, variants),
560
- sizes: {
569
+ variant: variants,
570
+ size: {
561
571
  sm: {
562
- padding: "0.2em 0.5em",
563
- fontSize: "1rem"
572
+ h: "8",
573
+ px: "2",
574
+ textStyle: "md"
575
+ },
576
+ md: {
577
+ textStyle: "md"
578
+ },
579
+ lg: {
580
+ h: "12",
581
+ textStyle: "lg"
564
582
  }
565
583
  }
566
584
  },
567
585
  defaultVariants: {
568
- variant: "primary"
586
+ variant: "primary",
587
+ size: "md"
569
588
  }
570
589
  });
571
590
  // src/styles/chakraTheme/ContainerStyles.ts
572
- var import_react13 = require("@chakra-ui/react");
573
- var ContainerStyles = (0, import_react13.defineRecipe)({
591
+ var import_react14 = require("@chakra-ui/react");
592
+ var ContainerStyles = (0, import_react14.defineRecipe)({
574
593
  base: {
575
594
  px: ".75rem"
576
595
  }
577
596
  });
578
597
  // src/styles/chakraTheme/HeadingStyles.ts
579
- var import_react14 = require("@chakra-ui/react");
580
- var HeadingStyles = (0, import_react14.defineRecipe)({
598
+ var import_react15 = require("@chakra-ui/react");
599
+ var HeadingStyles = (0, import_react15.defineRecipe)({
581
600
  base: {
582
601
  fontWeight: "600"
583
602
  }
584
603
  });
585
604
  // src/styles/chakraTheme/InputStyles.ts
586
- var import_react15 = require("@chakra-ui/react");
605
+ var import_react16 = require("@chakra-ui/react");
587
606
  var variants2 = {
588
607
  subtle: {
589
608
  backgroundColor: {
@@ -622,7 +641,7 @@ var variants2 = {
622
641
  }
623
642
  }
624
643
  };
625
- var InputStyles = (0, import_react15.defineRecipe)({
644
+ var InputStyles = (0, import_react16.defineRecipe)({
626
645
  base: {
627
646
  _placeholder: {
628
647
  color: {
@@ -632,14 +651,14 @@ var InputStyles = (0, import_react15.defineRecipe)({
632
651
  }
633
652
  },
634
653
  variants: {
635
- variant: _object_spread({}, variants2)
654
+ variant: variants2
636
655
  },
637
656
  defaultVariants: {
638
657
  variant: "subtle"
639
658
  }
640
659
  });
641
660
  // src/styles/chakraTheme/LinkStyles.ts
642
- var import_react16 = require("@chakra-ui/react");
661
+ var import_react17 = require("@chakra-ui/react");
643
662
  var variants3 = {
644
663
  plain: {
645
664
  textDecoration: "none",
@@ -654,17 +673,17 @@ var variants3 = {
654
673
  }
655
674
  }
656
675
  };
657
- var LinkStyles = (0, import_react16.defineRecipe)({
676
+ var LinkStyles = (0, import_react17.defineRecipe)({
658
677
  variants: {
659
- variant: _object_spread({}, variants3)
678
+ variant: variants3
660
679
  },
661
680
  defaultVariants: {
662
681
  variant: "underline"
663
682
  }
664
683
  });
665
684
  // src/styles/chakraTheme/SpinnerStyles.ts
666
- var import_react17 = require("@chakra-ui/react");
667
- var SpinnerStyles = (0, import_react17.defineRecipe)({
685
+ var import_react18 = require("@chakra-ui/react");
686
+ var SpinnerStyles = (0, import_react18.defineRecipe)({
668
687
  base: {
669
688
  animationDuration: ".8s",
670
689
  color: colors.accentBlueMedium,
@@ -692,12 +711,21 @@ var sizes = {
692
711
  container: container
693
712
  };
694
713
  // src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
695
- var import_react18 = require("@chakra-ui/react");
696
- var biblioteksentralenChakraTheme = (0, import_react18.createSystem)(import_react18.defaultConfig, {
714
+ var tokens = (0, import_react19.defineTokens)({
715
+ sizes: sizes
716
+ });
717
+ var globalHyphens = {
718
+ hyphens: "auto",
719
+ hyphenateLimitChars: "8 5 3"
720
+ };
721
+ var focusStyle = {
722
+ outline: "none !important",
723
+ boxShadow: "0 0 0 .1rem white, 0 0 0 .2rem black, 0 0 0 .3rem white !important",
724
+ transition: "box-shadow 0.1s ease-out"
725
+ };
726
+ var biblioteksentralenChakraTheme = (0, import_react19.defineConfig)({
697
727
  theme: {
698
- tokens: {
699
- sizes: sizes
700
- },
728
+ tokens: tokens,
701
729
  recipes: {
702
730
  heading: HeadingStyles,
703
731
  button: ButtonStyles,
@@ -718,21 +746,24 @@ var biblioteksentralenChakraTheme = (0, import_react18.createSystem)(import_reac
718
746
  "&:focus-within": {
719
747
  scrollBehavior: "smooth !important"
720
748
  }
721
- }
749
+ },
750
+ body: _object_spread({}, globalHyphens),
751
+ // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus
752
+ "*:focus-visible": focusStyle
722
753
  }
723
754
  });
724
755
  // src/BiblioteksentralenProvider.tsx
725
756
  var import_system = require("@chakra-ui/system");
726
757
  var BiblioteksentralenProvider = function(props) {
727
- return /* @__PURE__ */ import_react19.default.createElement(import_react20.ChakraProvider, {
728
- value: biblioteksentralenChakraTheme
729
- }, /* @__PURE__ */ import_react19.default.createElement(import_system.ColorModeProvider, _object_spread({}, props)));
758
+ return /* @__PURE__ */ import_react20.default.createElement(import_react21.ChakraProvider, {
759
+ value: (0, import_react21.createSystem)(import_react21.defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})
760
+ }, /* @__PURE__ */ import_react20.default.createElement(import_system.ColorModeProvider, _object_spread({}, props)));
730
761
  };
731
762
  // src/components/ErrorBoundary.tsx
732
- var import_react21 = require("@chakra-ui/react");
733
- var import_react22 = __toESM(require("react"));
763
+ var import_react22 = require("@chakra-ui/react");
764
+ var import_react23 = __toESM(require("react"));
734
765
  var StyledPre = function(props) {
735
- return /* @__PURE__ */ import_react22.default.createElement(import_react21.Box, _object_spread({
766
+ return /* @__PURE__ */ import_react23.default.createElement(import_react22.Box, _object_spread({
736
767
  as: "pre",
737
768
  paddingTop: "0.5rem",
738
769
  wordBreak: "break-all",
@@ -740,8 +771,8 @@ var StyledPre = function(props) {
740
771
  fontSize: "0.8rem"
741
772
  }, props));
742
773
  };
743
- var ErrorBoundary = /*#__PURE__*/ function(_import_react22_default_Component) {
744
- _inherits(ErrorBoundary, _import_react22_default_Component);
774
+ var ErrorBoundary = /*#__PURE__*/ function(_import_react23_default_Component) {
775
+ _inherits(ErrorBoundary, _import_react23_default_Component);
745
776
  var _super = _create_super(ErrorBoundary);
746
777
  function ErrorBoundary(props) {
747
778
  _class_call_check(this, ErrorBoundary);
@@ -775,9 +806,9 @@ var ErrorBoundary = /*#__PURE__*/ function(_import_react22_default_Component) {
775
806
  var stackTrace = (_this_state_errorInfo = this.state.errorInfo) === null || _this_state_errorInfo === void 0 ? void 0 : _this_state_errorInfo.componentStack;
776
807
  var errormsg = (_this_state_error = this.state.error) === null || _this_state_error === void 0 ? void 0 : _this_state_error.message;
777
808
  var info = this.props.boundaryName;
778
- return /* @__PURE__ */ import_react22.default.createElement("div", null, /* @__PURE__ */ import_react22.default.createElement(Alert, {
809
+ return /* @__PURE__ */ import_react23.default.createElement("div", null, /* @__PURE__ */ import_react23.default.createElement(Alert, {
779
810
  status: "error"
780
- }, /* @__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 || ""))));
811
+ }, /* @__PURE__ */ import_react23.default.createElement("p", null, "Beklager, det skjedde en teknisk feil."), isDevelopment() && (stackTrace || errormsg) && /* @__PURE__ */ import_react23.default.createElement("div", null, /* @__PURE__ */ import_react23.default.createElement(StyledPre, null, errormsg || ""), /* @__PURE__ */ import_react23.default.createElement(StyledPre, null, info || ""), /* @__PURE__ */ import_react23.default.createElement(StyledPre, null, stackTrace || ""))));
781
812
  }
782
813
  return this.props.children;
783
814
  }
@@ -793,15 +824,15 @@ var ErrorBoundary = /*#__PURE__*/ function(_import_react22_default_Component) {
793
824
  }
794
825
  ]);
795
826
  return ErrorBoundary;
796
- }(import_react22.default.Component);
827
+ }(import_react23.default.Component);
797
828
  // src/components/HashLinkTarget.tsx
798
- var import_react23 = require("@chakra-ui/react");
799
- var import_react24 = __toESM(require("react"));
829
+ var import_react24 = require("@chakra-ui/react");
830
+ var import_react25 = __toESM(require("react"));
800
831
  var focusOnRelativeParentStyle = {
801
832
  _focusWithin: {
802
833
  position: "static",
803
834
  boxShadow: "none",
804
- "&::after": {
835
+ "&::after": _object_spread({
805
836
  content: '""',
806
837
  position: "absolute",
807
838
  top: 0,
@@ -809,16 +840,15 @@ var focusOnRelativeParentStyle = {
809
840
  height: "100%",
810
841
  width: "100%",
811
842
  pointerEvents: "none",
812
- borderRadius: "0.25rem",
813
- boxShadow: "var(--chakra-shadows-outline)"
814
- }
843
+ borderRadius: "0.25rem"
844
+ }, focusStyle)
815
845
  }
816
846
  };
817
847
  function HashLinkTarget(props) {
818
- return /* @__PURE__ */ import_react24.default.createElement(import_react23.Box, {
848
+ return /* @__PURE__ */ import_react25.default.createElement(import_react24.Box, {
819
849
  position: "relative",
820
850
  css: props.focusOnParent ? focusOnRelativeParentStyle : void 0
821
- }, /* @__PURE__ */ import_react24.default.createElement(import_react23.Box, {
851
+ }, /* @__PURE__ */ import_react25.default.createElement(import_react24.Box, {
822
852
  id: props.id,
823
853
  tabIndex: props.focusOnParent ? -1 : void 0,
824
854
  position: "absolute",
@@ -829,18 +859,18 @@ function HashLinkTarget(props) {
829
859
  }));
830
860
  }
831
861
  // src/components/withErrorBoundary.tsx
832
- var import_react25 = __toESM(require("react"));
862
+ var import_react26 = __toESM(require("react"));
833
863
  var withErrorBoundary = function(Component, boundaryName) {
834
864
  return function(props) {
835
- return /* @__PURE__ */ import_react25.default.createElement(ErrorBoundary, {
865
+ return /* @__PURE__ */ import_react26.default.createElement(ErrorBoundary, {
836
866
  boundaryName: boundaryName
837
- }, /* @__PURE__ */ import_react25.default.createElement(Component, _object_spread({}, props)));
867
+ }, /* @__PURE__ */ import_react26.default.createElement(Component, _object_spread({}, props)));
838
868
  };
839
869
  };
840
870
  // src/components/ui/toaster.tsx
841
- var import_react26 = require("@chakra-ui/react");
842
- var import_react27 = __toESM(require("react"));
843
- var toaster = (0, import_react26.createToaster)({
871
+ var import_react27 = require("@chakra-ui/react");
872
+ var import_react28 = __toESM(require("react"));
873
+ var toaster = (0, import_react27.createToaster)({
844
874
  pauseOnPageIdle: true,
845
875
  offsets: {
846
876
  left: "50%",
@@ -850,27 +880,27 @@ var toaster = (0, import_react26.createToaster)({
850
880
  }
851
881
  });
852
882
  var Toaster = function() {
853
- return /* @__PURE__ */ import_react27.default.createElement(import_react26.Portal, null, /* @__PURE__ */ import_react27.default.createElement(import_react26.Toaster, {
883
+ return /* @__PURE__ */ import_react28.default.createElement(import_react27.Portal, null, /* @__PURE__ */ import_react28.default.createElement(import_react27.Toaster, {
854
884
  toaster: toaster,
855
885
  insetInline: {
856
886
  mdDown: "4"
857
887
  }
858
888
  }, function(toast) {
859
889
  if (typeof toast.render === "function") {
860
- return /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, toast.render());
890
+ return /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, toast.render());
861
891
  }
862
- return /* @__PURE__ */ import_react27.default.createElement(import_react26.Toast.Root, {
892
+ return /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Root, {
863
893
  width: {
864
894
  md: "sm"
865
895
  }
866
- }, toast.type === "loading" ? /* @__PURE__ */ import_react27.default.createElement(import_react26.Spinner, {
896
+ }, toast.type === "loading" ? /* @__PURE__ */ import_react28.default.createElement(import_react27.Spinner, {
867
897
  size: "sm",
868
898
  color: "blue.solid"
869
- }) : /* @__PURE__ */ import_react27.default.createElement(import_react26.Toast.Indicator, null), /* @__PURE__ */ import_react27.default.createElement(import_react26.Stack, {
899
+ }) : /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Indicator, null), /* @__PURE__ */ import_react28.default.createElement(import_react27.Stack, {
870
900
  gap: "1",
871
901
  flex: "1",
872
902
  maxWidth: "100%"
873
- }, toast.title && /* @__PURE__ */ import_react27.default.createElement(import_react26.Toast.Title, null, toast.title), toast.description && /* @__PURE__ */ import_react27.default.createElement(import_react26.Toast.Description, null, toast.description)), toast.action && /* @__PURE__ */ import_react27.default.createElement(import_react26.Toast.ActionTrigger, null, toast.action.label), toast.closable && /* @__PURE__ */ import_react27.default.createElement(import_react26.Toast.CloseTrigger, null));
903
+ }, toast.title && /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Title, null, toast.title), toast.description && /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Description, null, toast.description)), toast.action && /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.ActionTrigger, null, toast.action.label), toast.closable && /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.CloseTrigger, null));
874
904
  }));
875
905
  };
876
906
  // Annotate the CommonJS export names for ESM import in node:
@@ -882,11 +912,11 @@ var Toaster = function() {
882
912
  ErrorBoundary: ErrorBoundary,
883
913
  HashLinkTarget: HashLinkTarget,
884
914
  HideWithCSS: HideWithCSS,
915
+ IconButton: IconButton,
885
916
  Input: Input,
886
917
  Link: Link,
887
918
  Toaster: Toaster,
888
919
  VisuallyHidden: VisuallyHidden,
889
- biblioteksentralenChakraTheme: biblioteksentralenChakraTheme,
890
920
  colors: colors,
891
921
  toaster: toaster,
892
922
  withErrorBoundary: withErrorBoundary
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../../utils/src/date.ts","../../utils/src/colors.ts","../../utils/src/environment.ts","../src/components/Alert.tsx","../src/components/Button.tsx","../src/components/ConditionalWrapper.tsx","../src/components/HideWithCSS.tsx","../src/components/Input.tsx","../src/components/VisuallyHidden.tsx","../src/components/Link.tsx","../src/BiblioteksentralenProvider.tsx","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/components/ErrorBoundary.tsx","../src/components/HashLinkTarget.tsx","../src/components/withErrorBoundary.tsx","../src/components/ui/toaster.tsx"],"names":["import_react","React","colors","ChakraAlert","ChakraButton","ChakraVisuallyHidden","ChakraInput","ChakraLink","variants","ChakraToaster"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,6BAAd;;;ACAA,oBAAuB;AACvB,gBAAmB;ACDZ,IAAM,SAAS;EACpB,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,gBAAW;EACX,kBAAa;EACb,cAAc;EACd,aAAa;EACb,aAAa;EACb,gBAAgB;EAChB,kBAAkB;EAClB,cAAc;EACd,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,WAAW;EACX,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,mBAAmB;EACnB,SAAS;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;EACT;AACF;ACxCO,SAAS,gBAAyB;AACvC,SAAO,QAAQ,IAAI,aAAa;AAClC;;;ACAA,mBAAwE;AACxE,IAAAA,gBAAiC;AACjC,2BAAwD;AAMxD,IAAM,cAA6D;AAAA,EACjE,MAAM,EAAE,IAAI,OAAO,WAAW,OAAO,OAAO,iBAAiB;AAAA,EAC7D,SAAS,EA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M,UAAU,MAAM;AAC3B,SACE,+BAAAC,QAAA,cAAC,6BACC,+BAAAA,QAAA,cAAC,eAAAQ,SAAA,EAAc,SAAkB,aAAa,EAAE,QAAQ,IAAI,KACzD,CAAC,UAA0B;AAC1B,QAAI,OAAO,MAAM,WAAW,YAAY;AACtC,aAAO,+BAAAR,QAAA,6BAAAA,QAAA,gBAAG,MAAM,OAAO,CAAE;AAAA,IAC3B;AACA,WACE,+BAAAA,QAAA,cAAC,qBAAM,MAAN,EAAW,OAAO,EAAE,IAAI,KAAK,KAC3B,MAAM,SAAS,YAAY,+BAAAA,QAAA,cAAC,0BAAQ,MAAK,MAAK,OAAM,cAAa,IAAK,+BAAAA,QAAA,cAAC,qBAAM,WAAN,IAAgB,GACxF,+BAAAA,QAAA,cAAC,wBAAM,KAAI,KAAI,MAAK,KAAI,UAAS,UAC9B,MAAM,SAAS,+BAAAA,QAAA,cAAC,qBAAM,OAAN,MAAa,MAAM,KAAM,GACzC,MAAM,eAAe,+BAAAA,QAAA,cAAC,qBAAM,aAAN,MAAmB,MAAM,WAAY,CAC9D,GACC,MAAM,UAAU,+BAAAA,QAAA,cAAC,qBAAM,eAAN,MAAqB,MAAM,OAAO,KAAM,GACzD,MAAM,YAAY,+BAAAA,QAAA,cAAC,qBAAM,cAAN,IAAmB,CACzC;AAAA,EAEJ,CACF,CACF;AAEJ","sourcesContent":["export * from \"@chakra-ui/react\"; // Exports Chakra components first to override some components later\nexport type { StyleProps, ResponsiveObject } from \"@chakra-ui/system\"; // Exports Chakra system types\nexport { Alert } from \"./components/Alert\"; // Overrides Chakras Alert\nexport { Button } from \"./components/Button\"; // Overrides Chakras Button\nexport { ConditionalWrapper } from \"./components/ConditionalWrapper\"; // Overrides Chakras Input\nexport { HideWithCSS } from \"./components/HideWithCSS\"; // Overrides Chakras HideWithCSS\nexport { Input } from \"./components/Input\"; // Overrides Chakras Input\nexport { Link } from \"./components/Link\"; // Overrides Chakras Link\nexport { VisuallyHidden } from \"./components/VisuallyHidden\"; // Overrides Chakras VisuallyHidden\n\nexport { BiblioteksentralenProvider } from \"./BiblioteksentralenProvider\";\nexport { ErrorBoundary } from \"./components/ErrorBoundary\";\nexport { HashLinkTarget } from \"./components/HashLinkTarget\";\nexport { withErrorBoundary } from \"./components/withErrorBoundary\";\n\nexport { colors } from \"@biblioteksentralen/utils\"; // Re-export colors for convenience\nexport { biblioteksentralenChakraTheme } from \"./styles/chakraTheme/biblioteksentralenChakraTheme\";\n\n// Generated from cli: npmx @chakra-ui/cli snippet add\nexport { Toaster, toaster } from \"./components/ui/toaster\"; // Exports the Toaster component\n","import { format } from \"date-fns/format\";\nimport { nb } from \"date-fns/locale/nb\";\n\nexport function formaterDato(dato?: string, dateFnsformat = \"Pp\") {\n if (typeof dato !== \"string\") return \"Ukjent dato\";\n\n try {\n return format(new Date(dato), dateFnsformat, { locale: nb });\n } catch (e) {\n console.error(\"Kunne ikke formattere dato:\" + dato, e);\n return dato;\n }\n}\n","export const colors = {\n black: \"#000000\",\n grey90: \"#181818\",\n grey80: \"#333333\",\n grey60: \"#585858\",\n grey45: \"#8c8c8c\",\n grey30: \"#b2b2b2\",\n grey15: \"#d9d9d9\",\n grey10: \"#e5e5e5\",\n grey05: \"#f2f2f2\",\n white: \"#ffffff\",\n bsRødDark: \"#870010\",\n bsRødMedium: \"#d53d40\",\n accentPurple: \"#331433\",\n accentPeach: \"#ffba99\",\n accentGreen: \"#003b29\",\n accentBlueDark: \"#001740\",\n accentBlueMedium: \"#5996de\",\n accentYellow: \"#ffc970\",\n lightBlue: \"#dbe8ef\",\n lightGreen: \"#dbe0db\",\n lightPeach: \"#f4e7de\",\n lightPurple: \"#ece8f3\",\n statusRed: \"#ad313c\",\n statusYellow: \"#bc5600\",\n statusGreen: \"#24845b\",\n statusGreenLight: \"#edf4f1\",\n statusRedLight: \"#f8efef\",\n statusYellowLight: \"#fff6e4\",\n neptune: {\n \"100\": \"#CFE6E8\",\n \"200\": \"#9FCDD2\",\n \"300\": \"#6FB5BB\",\n \"400\": \"#3F9CA5\",\n \"500\": \"#0F838E\",\n \"600\": \"#0C6972\",\n \"700\": \"#094F55\",\n \"800\": \"#063439\",\n \"900\": \"#031A1C\",\n },\n};\n","export function isDevelopment(): boolean {\n return process.env.NODE_ENV === \"development\";\n}\n\nexport function isClient(): boolean {\n return typeof window !== \"undefined\";\n}\n\nexport function isServer(): boolean {\n return !isClient();\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { colors } from \"@biblioteksentralen/utils\";\nimport { AlertRootProps, Alert as ChakraAlert, SystemStyleObject } from \"@chakra-ui/react\";\nimport React, { ReactNode } from \"react\";\nimport { AlertCircle, CheckCircle, Info, XCircle } from \"react-feather\";\n\ntype Status = \"info\" | \"warning\" | \"success\" | \"error\";\ntype CustomVariants = \"inline\";\ntype Variants = AlertRootProps[\"variant\"] | CustomVariants;\n\nconst colorLookup: Record<Status, { bg: string; color: string }> = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed },\n};\n\nconst iconLookup: Record<Status, React.ReactElement> = {\n info: <Info strokeWidth={1.75} role=\"img\" aria-label=\"Informasjon\" />,\n warning: <AlertCircle strokeWidth={1.75} role=\"img\" aria-label=\"Advarsel\" />,\n success: <CheckCircle strokeWidth={1.75} role=\"img\" aria-label=\"Suksess\" />,\n error: <XCircle strokeWidth={1.75} role=\"img\" aria-label=\"Feil\" />,\n};\n\ninterface Props extends Modify<AlertRootProps, { variant?: Variants }> {\n children: ReactNode;\n header?: ReactNode;\n status: Status;\n variant?: Variants;\n}\n\nconst variantStyles: Record<CustomVariants, SystemStyleObject> = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\",\n },\n};\n\nexport function Alert({ status, children, variant, header, ...rest }: Props) {\n const colors = colorLookup[status];\n return (\n <ChakraAlert.Root\n status={status}\n border={`0.1rem solid`}\n borderColor={colors.color}\n backgroundColor={colors.bg}\n {...(variant === \"inline\" ? variantStyles[variant] : {})}\n {...rest}\n >\n <ChakraAlert.Indicator>{iconLookup[status]}</ChakraAlert.Indicator>\n <ChakraAlert.Content color=\"black\">\n {header && <ChakraAlert.Title>{header}</ChakraAlert.Title>}\n <ChakraAlert.Description>{children}</ChakraAlert.Description>\n </ChakraAlert.Content>\n </ChakraAlert.Root>\n );\n}\n","import React from \"react\";\nimport { Button as ChakraButton, ButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { Modify } from \"@biblioteksentralen/types\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras Button with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype ButtonVariants = ButtonProps[\"variant\"] | CustomButtonVariants;\nexport const Button = ChakraButton as ComponentWithAs<\"button\", Modify<ButtonProps, { variant?: ButtonVariants }>>;\n","import React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n wrapper: FunctionComponent<{ children: ReactNode }>;\n condition: boolean;\n};\n\n/**\n * Conditionally wrapps children with a component. If conditions are not met children mounted without the wrapper.\n */\nexport const ConditionalWrapper: FunctionComponent<Props> = ({ condition, children, wrapper: Wrapper }) =>\n condition ? <Wrapper>{children}</Wrapper> : <>{children}</>;\n","import { Box, BoxProps } from \"@chakra-ui/react\";\nimport { ThemeTypings } from \"@chakra-ui/system\";\nimport React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n above?: ThemeTypings[\"breakpoints\"];\n below?: ThemeTypings[\"breakpoints\"];\n} & Omit<BoxProps, \"display\">;\n\n/** Chakras <Hide /> component uses client side javascript to hide components. Causes components to flash on mobile while loading */\nexport const HideWithCSS: FunctionComponent<Props> = ({ children, above, below, ...chakraProps }) => {\n const display: BoxProps[\"display\"] = {\n ...(!!below ? { base: \"none\", [below]: \"block\" } : {}),\n ...(!!above ? { [above]: \"none\" } : {}),\n };\n\n return (\n <Box {...chakraProps} display={display}>\n {children}\n </Box>\n );\n};\n","import { Field, Input as ChakraInput, InputProps, FieldLabelProps } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\ninterface Props extends InputProps {\n label: string;\n hideLabel?: boolean;\n labelProps?: FieldLabelProps;\n helperText?: string;\n errorMessage?: string;\n}\n\n/**\n * Creating custom input-component to make sure label is always set (for accessibility)\n * 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\n */\nexport const Input = (props: Props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n\n const formLabel = <Field.Label {...labelProps}>{label}</Field.Label>;\n\n return (\n <Field.Root invalid={!!errorMessage}>\n {hideLabel ? <VisuallyHidden>{formLabel}</VisuallyHidden> : formLabel}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","import React, { HTMLAttributes, ReactNode, useEffect } from \"react\";\nimport { VisuallyHidden as ChakraVisuallyHidden } from \"@chakra-ui/react\";\nimport { isDevelopment } from \"@biblioteksentralen/utils\";\n\ninterface Props extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n}\n\n// https://www.joshwcomeau.com/snippets/react-components/visually-hidden/\nexport function VisuallyHidden({ children, ...rest }: Props) {\n const [forceShow, setForceShow] = React.useState(false);\n\n useEffect(() => {\n if (isDevelopment()) {\n const handleKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(true);\n }\n };\n const handleKeyUp = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(false);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n window.addEventListener(\"keyup\", handleKeyUp);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n window.removeEventListener(\"keyup\", handleKeyUp);\n };\n }\n }, []);\n\n // position=\"fixed\" løser bug der visually hidden ikke hindret tekst fra å ta plass i bredden\n return forceShow ? <span>{children}</span> : <ChakraVisuallyHidden position=\"fixed\">{children}</ChakraVisuallyHidden>;\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Link as ChakraLink, LinkProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomLinkVariants } from \"../styles/chakraTheme/LinkStyles\";\n\n/**\n * Re-exporting chackras Link with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype LinkVariants = LinkProps[\"variant\"] | CustomLinkVariants;\nexport const Link = ChakraLink as ComponentWithAs<\"a\", Modify<LinkProps, { variant?: LinkVariants }>>;\n","import React, { ReactNode } from \"react\";\nimport { ChakraProvider } from \"@chakra-ui/react\";\nimport { biblioteksentralenChakraTheme } from \"./styles/chakraTheme/biblioteksentralenChakraTheme\";\nimport { ColorModeProvider } from \"@chakra-ui/system\";\n\ninterface Props {\n children: ReactNode;\n}\n\nexport const BiblioteksentralenProvider = (props: Props) => (\n <ChakraProvider value={biblioteksentralenChakraTheme}>\n <ColorModeProvider {...props} />\n </ChakraProvider>\n);\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomButtonVariants = \"primary\" | \"secondary\" | \"tertiary\";\n\nconst variants: Record<CustomButtonVariants, SystemStyleObject> = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\",\n },\n },\n secondary: {\n borderColor: \"currentColor !important\",\n backgroundColor: \"transparent\",\n color: \"currentColor\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 50%, 0.15)\",\n },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: \"currentColor\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 50%, 0.15)\",\n color: \"currentColor\",\n },\n },\n};\n\nexport const ButtonStyles = defineRecipe({\n base: {\n border: \"transparent 0.1em solid\",\n borderRadius: \"0.35em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45} !important`,\n color: \"white !important\",\n opacity: 1,\n },\n },\n variants: {\n variant: {\n ...variants,\n },\n sizes: {\n sm: {\n padding: \"0.2em 0.5em\",\n fontSize: \"1rem\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const ContainerStyles = defineRecipe({\n base: {\n px: \".75rem\", // Padding left/right\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const HeadingStyles = defineRecipe({\n base: {\n fontWeight: \"600\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nconst variants: Record<string, SystemStyleObject> = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" },\n },\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n};\n\nexport const InputStyles = defineRecipe({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" },\n },\n },\n variants: {\n variant: { ...variants },\n },\n defaultVariants: {\n variant: \"subtle\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomLinkVariants = \"plain\" | \"underline\";\n\nconst variants: Record<CustomLinkVariants, SystemStyleObject> = {\n plain: {\n textDecoration: \"none\",\n _hover: {\n textDecoration: \"underline\",\n },\n },\n underline: {\n textDecoration: \"underline\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n variants: {\n variant: { ...variants },\n },\n defaultVariants: {\n variant: \"underline\",\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe } from \"@chakra-ui/react\";\n\nexport const SpinnerStyles = defineRecipe({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\",\n },\n});\n","const container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" }, // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" },\n};\n\nexport const sizes = {\n container,\n};\n","import { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\nimport { createSystem, defaultConfig } from \"@chakra-ui/react\";\n\nexport const biblioteksentralenChakraTheme = createSystem(defaultConfig, {\n theme: {\n tokens: {\n sizes,\n },\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles,\n },\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" },\n },\n },\n});\n","import { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { Alert } from \"./Alert\";\n\ninterface Props {\n boundaryName?: string;\n children: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\nconst StyledPre = (props: BoxProps) => (\n <Box as=\"pre\" paddingTop=\"0.5rem\" wordBreak=\"break-all\" whiteSpace=\"pre-wrap\" fontSize=\"0.8rem\" {...props} />\n);\n\nexport class ErrorBoundary extends React.Component<Props, State> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n\n return (\n <div>\n <Alert status=\"error\">\n <p>Beklager, det skjedde en teknisk feil.</p>\n {isDevelopment() && (stackTrace || errormsg) && (\n <div>\n <StyledPre>{errormsg || \"\"}</StyledPre>\n <StyledPre>{info || \"\"}</StyledPre>\n <StyledPre>{stackTrace || \"\"}</StyledPre>\n </div>\n )}\n </Alert>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n","import { Box } from \"@chakra-ui/react\";\nimport React from \"react\";\n\ninterface Props {\n id: string;\n /**\n * angir hvor mye luft til vil ha over HashLinkTarget ved bruk av hash-lenke, eks '4rem'\n */\n spaceAbove?: string;\n /**\n * angir om du vil ha fokusramme rundt komponenten som mounter HashLinkTarget. Da må komponenten du wrapper med ha position: relative | absolute el\n */\n focusOnParent?: boolean;\n}\n\nconst focusOnRelativeParentStyle = {\n _focusWithin: {\n position: \"static\",\n boxShadow: \"none\",\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n left: 0,\n height: \"100%\",\n width: \"100%\",\n pointerEvents: \"none\",\n borderRadius: \"0.25rem\",\n boxShadow: \"var(--chakra-shadows-outline)\",\n },\n },\n};\n\n/*\n * Komponent som sørger for luft over anchors (elementer man kan lenke til med hash-lenker feks <a href=\"#min-overskrift\">Ta meg til overskrift</a>)\n */\nexport function HashLinkTarget(props: Props) {\n return (\n <Box position=\"relative\" css={props.focusOnParent ? focusOnRelativeParentStyle : undefined}>\n <Box\n id={props.id}\n tabIndex={props.focusOnParent ? -1 : undefined}\n position=\"absolute\"\n top={`-${props.spaceAbove || \"2.5rem\"}`}\n _focus={{\n boxShadow: \"none !important\",\n }}\n />\n </Box>\n );\n}\n","import React from \"react\";\nimport { ErrorBoundary } from \"./ErrorBoundary\";\n\nexport const withErrorBoundary = <Props,>(Component: React.ComponentType<Props>, boundaryName: string) => {\n return (props: Props & React.JSX.IntrinsicAttributes) => (\n <ErrorBoundary boundaryName={boundaryName}>\n <Component {...props} />\n </ErrorBoundary>\n );\n};\n","\"use client\";\n\nimport {\n Toaster as ChakraToaster,\n Portal,\n Spinner,\n Stack,\n Toast,\n ToastRootProps,\n createToaster,\n} from \"@chakra-ui/react\";\nimport React from \"react\";\n\nexport const toaster: ToastRootProps = createToaster({\n pauseOnPageIdle: true,\n offsets: { left: \"50%\", top: \"50%\", right: \"50%\", bottom: \"50%\" },\n});\n\nexport const Toaster = () => {\n return (\n <Portal>\n <ChakraToaster toaster={toaster} insetInline={{ mdDown: \"4\" }}>\n {(toast: ToastRootProps) => {\n if (typeof toast.render === \"function\") {\n return <>{toast.render()}</>;\n }\n return (\n <Toast.Root width={{ md: \"sm\" }}>\n {toast.type === \"loading\" ? <Spinner size=\"sm\" color=\"blue.solid\" /> : <Toast.Indicator />}\n <Stack gap=\"1\" flex=\"1\" maxWidth=\"100%\">\n {toast.title && <Toast.Title>{toast.title}</Toast.Title>}\n {toast.description && <Toast.Description>{toast.description}</Toast.Description>}\n </Stack>\n {toast.action && <Toast.ActionTrigger>{toast.action.label}</Toast.ActionTrigger>}\n {toast.closable && <Toast.CloseTrigger />}\n </Toast.Root>\n );\n }}\n </ChakraToaster>\n </Portal>\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/index.ts","../../utils/src/date.ts","../../utils/src/colors.ts","../../utils/src/environment.ts","../src/components/Alert.tsx","../src/components/Button.tsx","../src/components/IconButton.tsx","../src/components/ConditionalWrapper.tsx","../src/components/HideWithCSS.tsx","../src/components/Input.tsx","../src/components/VisuallyHidden.tsx","../src/components/Link.tsx","../src/BiblioteksentralenProvider.tsx","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/components/ErrorBoundary.tsx","../src/components/HashLinkTarget.tsx","../src/components/withErrorBoundary.tsx","../src/components/ui/toaster.tsx"],"names":["import_react","React","colors","ChakraAlert","ChakraButton","ChakraIconButton","ChakraVisuallyHidden","ChakraInput","ChakraLink","variants","ChakraToaster"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,6BAAd;;;ACAA,oBAAuB;AACvB,gBAAmB;ACDZ,IAAM,SAAS;EACpB,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,gBAAW;EACX,kBAAa;EACb,cAAc;EACd,aAAa;EACb,aAAa;EACb,gBAAgB;EAChB,kBAAkB;EAClB,cAAc;EACd,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,WAAW;EACX,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,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AAa,IAAK,+BAAAA,QAAA,cAAC,qBAAM,WAAN,IAAgB,GACxF,+BAAAA,QAAA,cAAC,wBAAM,KAAI,KAAI,MAAK,KAAI,UAAS,UAC9B,MAAM,SAAS,+BAAAA,QAAA,cAAC,qBAAM,OAAN,MAAa,MAAM,KAAM,GACzC,MAAM,eAAe,+BAAAA,QAAA,cAAC,qBAAM,aAAN,MAAmB,MAAM,WAAY,CAC9D,GACC,MAAM,UAAU,+BAAAA,QAAA,cAAC,qBAAM,eAAN,MAAqB,MAAM,OAAO,KAAM,GACzD,MAAM,YAAY,+BAAAA,QAAA,cAAC,qBAAM,cAAN,IAAmB,CACzC;AAAA,EAEJ,CACF,CACF;AAEJ","sourcesContent":["export * from \"@chakra-ui/react\"; // Exports Chakra components first to override some components later\nexport type { StyleProps, ResponsiveObject } from \"@chakra-ui/system\"; // Exports Chakra system types\nexport { Alert } from \"./components/Alert\"; // Overrides Chakras Alert\nexport { Button, type ButtonProps } from \"./components/Button\"; // Overrides Chakras Button\nexport { IconButton, type IconButtonProps } from \"./components/IconButton\"; // Overrides Chakras IconButton\nexport { ConditionalWrapper } from \"./components/ConditionalWrapper\"; // Overrides Chakras Input\nexport { HideWithCSS } from \"./components/HideWithCSS\"; // Overrides Chakras HideWithCSS\nexport { Input } from \"./components/Input\"; // Overrides Chakras Input\nexport { Link } from \"./components/Link\"; // Overrides Chakras Link\nexport { VisuallyHidden } from \"./components/VisuallyHidden\"; // Overrides Chakras VisuallyHidden\n\nexport { BiblioteksentralenProvider } from \"./BiblioteksentralenProvider\";\nexport { ErrorBoundary } from \"./components/ErrorBoundary\";\nexport { HashLinkTarget } from \"./components/HashLinkTarget\";\nexport { withErrorBoundary } from \"./components/withErrorBoundary\";\n\nexport { colors } from \"@biblioteksentralen/utils\"; // Re-export colors for convenience\n\n// Generated from cli: npmx @chakra-ui/cli snippet add\nexport { Toaster, toaster } from \"./components/ui/toaster\"; // Exports the Toaster component\n","import { format } from \"date-fns/format\";\nimport { nb } from \"date-fns/locale/nb\";\n\nexport function formaterDato(dato?: string, dateFnsformat = \"Pp\") {\n if (typeof dato !== \"string\") return \"Ukjent dato\";\n\n try {\n return format(new Date(dato), dateFnsformat, { locale: nb });\n } catch (e) {\n console.error(\"Kunne ikke formattere dato:\" + dato, e);\n return dato;\n }\n}\n","export const colors = {\n black: \"#000000\",\n grey90: \"#181818\",\n grey80: \"#333333\",\n grey60: \"#585858\",\n grey45: \"#8c8c8c\",\n grey30: \"#b2b2b2\",\n grey15: \"#d9d9d9\",\n grey10: \"#e5e5e5\",\n grey05: \"#f2f2f2\",\n white: \"#ffffff\",\n bsRødDark: \"#870010\",\n bsRødMedium: \"#d53d40\",\n accentPurple: \"#331433\",\n accentPeach: \"#ffba99\",\n accentGreen: \"#003b29\",\n accentBlueDark: \"#001740\",\n accentBlueMedium: \"#5996de\",\n accentYellow: \"#ffc970\",\n lightBlue: \"#dbe8ef\",\n lightGreen: \"#dbe0db\",\n lightPeach: \"#f4e7de\",\n lightPurple: \"#ece8f3\",\n statusRed: \"#ad313c\",\n statusYellow: \"#bc5600\",\n statusGreen: \"#24845b\",\n statusGreenLight: \"#edf4f1\",\n statusRedLight: \"#f8efef\",\n statusYellowLight: \"#fff6e4\",\n neptune: {\n \"100\": \"#CFE6E8\",\n \"200\": \"#9FCDD2\",\n \"300\": \"#6FB5BB\",\n \"400\": \"#3F9CA5\",\n \"500\": \"#0F838E\",\n \"600\": \"#0C6972\",\n \"700\": \"#094F55\",\n \"800\": \"#063439\",\n \"900\": \"#031A1C\",\n },\n};\n","export function isDevelopment(): boolean {\n return process.env.NODE_ENV === \"development\";\n}\n\nexport function isClient(): boolean {\n return typeof window !== \"undefined\";\n}\n\nexport function isServer(): boolean {\n return !isClient();\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { colors } from \"@biblioteksentralen/utils\";\nimport { AlertRootProps, Alert as ChakraAlert, SystemStyleObject } from \"@chakra-ui/react\";\nimport React, { ReactNode } from \"react\";\nimport { AlertCircle, CheckCircle, Info, XCircle } from \"react-feather\";\n\ntype Status = \"info\" | \"warning\" | \"success\" | \"error\";\ntype CustomVariants = \"inline\";\ntype Variants = AlertRootProps[\"variant\"] | CustomVariants;\n\nconst colorLookup: Record<Status, { bg: string; color: string }> = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed },\n};\n\nconst iconLookup: Record<Status, React.ReactElement> = {\n info: <Info strokeWidth={1.75} role=\"img\" aria-label=\"Informasjon\" />,\n warning: <AlertCircle strokeWidth={1.75} role=\"img\" aria-label=\"Advarsel\" />,\n success: <CheckCircle strokeWidth={1.75} role=\"img\" aria-label=\"Suksess\" />,\n error: <XCircle strokeWidth={1.75} role=\"img\" aria-label=\"Feil\" />,\n};\n\ninterface Props extends Modify<AlertRootProps, { variant?: Variants }> {\n children: ReactNode;\n header?: ReactNode;\n status: Status;\n variant?: Variants;\n}\n\nconst variantStyles: Record<CustomVariants, SystemStyleObject> = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\",\n },\n};\n\nexport function Alert({ status, children, variant, header, ...rest }: Props) {\n const colors = colorLookup[status];\n return (\n <ChakraAlert.Root\n status={status}\n fontSize=\"md\"\n border={`0.1rem solid`}\n borderColor={colors.color}\n backgroundColor={colors.bg}\n display=\"flex\"\n flexWrap=\"wrap\"\n {...(variant === \"inline\" ? variantStyles[variant] : {})}\n {...rest}\n >\n <ChakraAlert.Indicator marginX=\"auto\">{iconLookup[status]}</ChakraAlert.Indicator>\n <ChakraAlert.Content color=\"black\">\n {header && <ChakraAlert.Title>{header}</ChakraAlert.Title>}\n <ChakraAlert.Description>{children}</ChakraAlert.Description>\n </ChakraAlert.Content>\n </ChakraAlert.Root>\n );\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Button as ChakraButton, ButtonProps as NativeButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras Button with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype ButtonVariants = NativeButtonProps[\"variant\"] | CustomButtonVariants;\nexport type ButtonProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const Button = ChakraButton as ComponentWithAs<\"button\", ButtonProps>;\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { IconButton as ChakraIconButton, IconButtonProps as ChakraIconButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras IconButton with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype IconButtonVariants = ChakraIconButtonProps[\"variant\"] | CustomButtonVariants;\nexport type IconButtonProps = Modify<ChakraIconButtonProps, { variant?: IconButtonVariants }>;\nexport const IconButton = ChakraIconButton as ComponentWithAs<\"button\", IconButtonProps>;\n","import React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n wrapper: FunctionComponent<{ children: ReactNode }>;\n condition: boolean;\n};\n\n/**\n * Conditionally wrapps children with a component. If conditions are not met children mounted without the wrapper.\n */\nexport const ConditionalWrapper: FunctionComponent<Props> = ({ condition, children, wrapper: Wrapper }) =>\n condition ? <Wrapper>{children}</Wrapper> : <>{children}</>;\n","import { Box, BoxProps } from \"@chakra-ui/react\";\nimport { ThemeTypings } from \"@chakra-ui/system\";\nimport React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n above?: ThemeTypings[\"breakpoints\"];\n below?: ThemeTypings[\"breakpoints\"];\n} & Omit<BoxProps, \"display\">;\n\n/** Chakras <Hide /> component uses client side javascript to hide components. Causes components to flash on mobile while loading */\nexport const HideWithCSS: FunctionComponent<Props> = ({ children, above, below, ...chakraProps }) => {\n const display: BoxProps[\"display\"] = {\n ...(!!below ? { base: \"none\", [below]: \"block\" } : {}),\n ...(!!above ? { [above]: \"none\" } : {}),\n };\n\n return (\n <Box {...chakraProps} display={display}>\n {children}\n </Box>\n );\n};\n","import { Field, Input as ChakraInput, InputProps, FieldLabelProps } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\ninterface Props extends InputProps {\n label: string;\n hideLabel?: boolean;\n labelProps?: FieldLabelProps;\n helperText?: string;\n errorMessage?: string;\n}\n\n/**\n * Creating custom input-component to make sure label is always set (for accessibility)\n * 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\n */\nexport const Input = (props: Props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n\n const formLabel = <Field.Label {...labelProps}>{label}</Field.Label>;\n\n return (\n <Field.Root invalid={!!errorMessage}>\n {hideLabel ? <VisuallyHidden>{formLabel}</VisuallyHidden> : formLabel}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","import React, { HTMLAttributes, ReactNode, useEffect } from \"react\";\nimport { VisuallyHidden as ChakraVisuallyHidden } from \"@chakra-ui/react\";\nimport { isDevelopment } from \"@biblioteksentralen/utils\";\n\ninterface Props extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n}\n\n// https://www.joshwcomeau.com/snippets/react-components/visually-hidden/\nexport function VisuallyHidden({ children, ...rest }: Props) {\n const [forceShow, setForceShow] = React.useState(false);\n\n useEffect(() => {\n if (isDevelopment()) {\n const handleKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(true);\n }\n };\n const handleKeyUp = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(false);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n window.addEventListener(\"keyup\", handleKeyUp);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n window.removeEventListener(\"keyup\", handleKeyUp);\n };\n }\n }, []);\n\n // position=\"fixed\" løser bug der visually hidden ikke hindret tekst fra å ta plass i bredden\n return forceShow ? <span>{children}</span> : <ChakraVisuallyHidden position=\"fixed\">{children}</ChakraVisuallyHidden>;\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Link as ChakraLink, LinkProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomLinkVariants } from \"../styles/chakraTheme/LinkStyles\";\n\n/**\n * Re-exporting chackras Link with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype LinkVariants = LinkProps[\"variant\"] | CustomLinkVariants;\nexport const Link = ChakraLink as ComponentWithAs<\"a\", Modify<LinkProps, { variant?: LinkVariants }>>;\n","import React, { ReactNode } from \"react\";\nimport { ChakraProvider, createSystem, defaultConfig, SystemConfig } from \"@chakra-ui/react\";\nimport { biblioteksentralenChakraTheme } from \"./styles/chakraTheme/biblioteksentralenChakraTheme\";\nimport { ColorModeProvider } from \"@chakra-ui/system\";\n\ninterface Props {\n children: ReactNode;\n customTheme?: SystemConfig;\n}\n\nexport const BiblioteksentralenProvider = (props: Props) => (\n <ChakraProvider value={createSystem(defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})}>\n <ColorModeProvider {...props} />\n </ChakraProvider>\n);\n","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\n\nconst tokens = defineTokens({\n sizes,\n});\n\n// https://blog.logrocket.com/guide-css-word-wrap-overflow-wrap-word-break/\n// https://medium.com/clear-left-thinking/all-you-need-to-know-about-hyphenation-in-css-2baee2d89179\n// Skrur på hyphens auto som default fordi vi har masse mikrotekster og små elementer der layout knekker uten dette, og vi lager stadig nye og glemmer å ta hensyn til dette.\n// Så kan man optionaly sette hyphens: none de stedene man ikke ønsker det, men har ikke sett noe som knekker/blir rart pga dette enda\nconst globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\", // minimum word-length / min letters first line / min letters second line\n};\n\nexport const focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .1rem white, 0 0 0 .2rem black, 0 0 0 .3rem white !important`,\n transition: \"box-shadow 0.1s ease-out\",\n};\n\nexport const biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles,\n },\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" },\n },\n body: {\n ...globalHyphens,\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle,\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomButtonVariants = \"primary\" | \"secondary\" | \"tertiary\";\n\nconst variants: Record<CustomButtonVariants, SystemStyleObject> = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\",\n },\n },\n secondary: {\n borderColor: \"currentColor !important\",\n backgroundColor: \"transparent\",\n color: \"currentColor\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 50%, 0.15)\",\n },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: \"currentColor\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 50%, 0.15)\",\n color: \"currentColor\",\n },\n },\n};\n\nexport const ButtonStyles = defineRecipe({\n base: {\n border: \"transparent 0.1em solid\",\n borderRadius: \"0.35em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45} !important`,\n color: \"white !important\",\n opacity: 1,\n },\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\",\n },\n md: {\n textStyle: \"md\",\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\",\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const ContainerStyles = defineRecipe({\n base: {\n px: \".75rem\", // Padding left/right\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const HeadingStyles = defineRecipe({\n base: {\n fontWeight: \"600\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nconst variants: Record<string, SystemStyleObject> = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" },\n },\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n};\n\nexport const InputStyles = defineRecipe({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" },\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"subtle\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomLinkVariants = \"plain\" | \"underline\";\n\nconst variants: Record<CustomLinkVariants, SystemStyleObject> = {\n plain: {\n textDecoration: \"none\",\n _hover: {\n textDecoration: \"underline\",\n },\n },\n underline: {\n textDecoration: \"underline\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n variants: {\n variant: variants ,\n },\n defaultVariants: {\n variant: \"underline\",\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe } from \"@chakra-ui/react\";\n\nexport const SpinnerStyles = defineRecipe({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\",\n },\n});\n","const container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" }, // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" },\n};\n\nexport const sizes = {\n container,\n};\n","import { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { Alert } from \"./Alert\";\n\ninterface Props {\n boundaryName?: string;\n children: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\nconst StyledPre = (props: BoxProps) => (\n <Box as=\"pre\" paddingTop=\"0.5rem\" wordBreak=\"break-all\" whiteSpace=\"pre-wrap\" fontSize=\"0.8rem\" {...props} />\n);\n\nexport class ErrorBoundary extends React.Component<Props, State> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n\n return (\n <div>\n <Alert status=\"error\">\n <p>Beklager, det skjedde en teknisk feil.</p>\n {isDevelopment() && (stackTrace || errormsg) && (\n <div>\n <StyledPre>{errormsg || \"\"}</StyledPre>\n <StyledPre>{info || \"\"}</StyledPre>\n <StyledPre>{stackTrace || \"\"}</StyledPre>\n </div>\n )}\n </Alert>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n","import { Box } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { focusStyle } from \"../styles/chakraTheme/biblioteksentralenChakraTheme\";\n\ninterface Props {\n id: string;\n /**\n * angir hvor mye luft til vil ha over HashLinkTarget ved bruk av hash-lenke, eks '4rem'\n */\n spaceAbove?: string;\n /**\n * angir om du vil ha fokusramme rundt komponenten som mounter HashLinkTarget. Da må komponenten du wrapper med ha position: relative | absolute el\n */\n focusOnParent?: boolean;\n}\n\nconst focusOnRelativeParentStyle = {\n _focusWithin: {\n position: \"static\",\n boxShadow: \"none\",\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n left: 0,\n height: \"100%\",\n width: \"100%\",\n pointerEvents: \"none\",\n borderRadius: \"0.25rem\",\n ...focusStyle,\n },\n },\n};\n\n/*\n * Komponent som sørger for luft over anchors (elementer man kan lenke til med hash-lenker feks <a href=\"#min-overskrift\">Ta meg til overskrift</a>)\n */\nexport function HashLinkTarget(props: Props) {\n return (\n <Box position=\"relative\" css={props.focusOnParent ? focusOnRelativeParentStyle : undefined}>\n <Box\n id={props.id}\n tabIndex={props.focusOnParent ? -1 : undefined}\n position=\"absolute\"\n top={`-${props.spaceAbove || \"2.5rem\"}`}\n _focus={{\n boxShadow: \"none !important\",\n }}\n />\n </Box>\n );\n}\n","import React from \"react\";\nimport { ErrorBoundary } from \"./ErrorBoundary\";\n\nexport const withErrorBoundary = <Props,>(Component: React.ComponentType<Props>, boundaryName: string) => {\n return (props: Props & React.JSX.IntrinsicAttributes) => (\n <ErrorBoundary boundaryName={boundaryName}>\n <Component {...props} />\n </ErrorBoundary>\n );\n};\n","\"use client\";\n\nimport {\n Toaster as ChakraToaster,\n Portal,\n Spinner,\n Stack,\n Toast,\n ToastRootProps,\n createToaster,\n} from \"@chakra-ui/react\";\nimport React from \"react\";\n\nexport const toaster: ToastRootProps = createToaster({\n pauseOnPageIdle: true,\n offsets: { left: \"50%\", top: \"50%\", right: \"50%\", bottom: \"50%\" },\n});\n\nexport const Toaster = () => {\n return (\n <Portal>\n <ChakraToaster toaster={toaster} insetInline={{ mdDown: \"4\" }}>\n {(toast: ToastRootProps) => {\n if (typeof toast.render === \"function\") {\n return <>{toast.render()}</>;\n }\n return (\n <Toast.Root width={{ md: \"sm\" }}>\n {toast.type === \"loading\" ? <Spinner size=\"sm\" color=\"blue.solid\" /> : <Toast.Indicator />}\n <Stack gap=\"1\" flex=\"1\" maxWidth=\"100%\">\n {toast.title && <Toast.Title>{toast.title}</Toast.Title>}\n {toast.description && <Toast.Description>{toast.description}</Toast.Description>}\n </Stack>\n {toast.action && <Toast.ActionTrigger>{toast.action.label}</Toast.ActionTrigger>}\n {toast.closable && <Toast.CloseTrigger />}\n </Toast.Root>\n );\n }}\n </ChakraToaster>\n </Portal>\n );\n};\n"]}
package/dist/index.mjs CHANGED
@@ -78,13 +78,16 @@ function Alert({ status, children, variant, header, ...rest }) {
78
78
  ChakraAlert.Root,
79
79
  {
80
80
  status,
81
+ fontSize: "md",
81
82
  border: `0.1rem solid`,
82
83
  borderColor: colors2.color,
83
84
  backgroundColor: colors2.bg,
85
+ display: "flex",
86
+ flexWrap: "wrap",
84
87
  ...variant === "inline" ? variantStyles[variant] : {},
85
88
  ...rest
86
89
  },
87
- /* @__PURE__ */ React.createElement(ChakraAlert.Indicator, null, iconLookup[status]),
90
+ /* @__PURE__ */ React.createElement(ChakraAlert.Indicator, { marginX: "auto" }, iconLookup[status]),
88
91
  /* @__PURE__ */ React.createElement(ChakraAlert.Content, { color: "black" }, header && /* @__PURE__ */ React.createElement(ChakraAlert.Title, null, header), /* @__PURE__ */ React.createElement(ChakraAlert.Description, null, children))
89
92
  );
90
93
  }
@@ -93,6 +96,10 @@ function Alert({ status, children, variant, header, ...rest }) {
93
96
  import { Button as ChakraButton } from "@chakra-ui/react";
94
97
  var Button = ChakraButton;
95
98
 
99
+ // src/components/IconButton.tsx
100
+ import { IconButton as ChakraIconButton } from "@chakra-ui/react";
101
+ var IconButton = ChakraIconButton;
102
+
96
103
  // src/components/ConditionalWrapper.tsx
97
104
  import React2 from "react";
98
105
  var ConditionalWrapper = ({ condition, children, wrapper: Wrapper }) => condition ? /* @__PURE__ */ React2.createElement(Wrapper, null, children) : /* @__PURE__ */ React2.createElement(React2.Fragment, null, children);
@@ -153,7 +160,10 @@ var Link = ChakraLink;
153
160
 
154
161
  // src/BiblioteksentralenProvider.tsx
155
162
  import React6 from "react";
156
- import { ChakraProvider } from "@chakra-ui/react";
163
+ import { ChakraProvider, createSystem, defaultConfig } from "@chakra-ui/react";
164
+
165
+ // src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
166
+ import { defineConfig, defineTokens } from "@chakra-ui/react";
157
167
 
158
168
  // src/styles/chakraTheme/ButtonStyles.ts
159
169
  import { defineRecipe } from "@chakra-ui/react";
@@ -195,18 +205,25 @@ var ButtonStyles = defineRecipe({
195
205
  }
196
206
  },
197
207
  variants: {
198
- variant: {
199
- ...variants
200
- },
201
- sizes: {
208
+ variant: variants,
209
+ size: {
202
210
  sm: {
203
- padding: "0.2em 0.5em",
204
- fontSize: "1rem"
211
+ h: "8",
212
+ px: "2",
213
+ textStyle: "md"
214
+ },
215
+ md: {
216
+ textStyle: "md"
217
+ },
218
+ lg: {
219
+ h: "12",
220
+ textStyle: "lg"
205
221
  }
206
222
  }
207
223
  },
208
224
  defaultVariants: {
209
- variant: "primary"
225
+ variant: "primary",
226
+ size: "md"
210
227
  }
211
228
  });
212
229
 
@@ -256,7 +273,7 @@ var InputStyles = defineRecipe4({
256
273
  }
257
274
  },
258
275
  variants: {
259
- variant: { ...variants2 }
276
+ variant: variants2
260
277
  },
261
278
  defaultVariants: {
262
279
  variant: "subtle"
@@ -281,7 +298,7 @@ var variants3 = {
281
298
  };
282
299
  var LinkStyles = defineRecipe5({
283
300
  variants: {
284
- variant: { ...variants3 }
301
+ variant: variants3
285
302
  },
286
303
  defaultVariants: {
287
304
  variant: "underline"
@@ -312,12 +329,22 @@ var sizes = {
312
329
  };
313
330
 
314
331
  // src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
315
- import { createSystem, defaultConfig } from "@chakra-ui/react";
316
- var biblioteksentralenChakraTheme = createSystem(defaultConfig, {
332
+ var tokens = defineTokens({
333
+ sizes
334
+ });
335
+ var globalHyphens = {
336
+ hyphens: "auto",
337
+ hyphenateLimitChars: "8 5 3"
338
+ // minimum word-length / min letters first line / min letters second line
339
+ };
340
+ var focusStyle = {
341
+ outline: "none !important",
342
+ boxShadow: `0 0 0 .1rem white, 0 0 0 .2rem black, 0 0 0 .3rem white !important`,
343
+ transition: "box-shadow 0.1s ease-out"
344
+ };
345
+ var biblioteksentralenChakraTheme = defineConfig({
317
346
  theme: {
318
- tokens: {
319
- sizes
320
- },
347
+ tokens,
321
348
  recipes: {
322
349
  heading: HeadingStyles,
323
350
  button: ButtonStyles,
@@ -333,13 +360,18 @@ var biblioteksentralenChakraTheme = createSystem(defaultConfig, {
333
360
  // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,
334
361
  // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)
335
362
  "&:focus-within": { scrollBehavior: "smooth !important" }
336
- }
363
+ },
364
+ body: {
365
+ ...globalHyphens
366
+ },
367
+ // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus
368
+ "*:focus-visible": focusStyle
337
369
  }
338
370
  });
339
371
 
340
372
  // src/BiblioteksentralenProvider.tsx
341
373
  import { ColorModeProvider } from "@chakra-ui/system";
342
- var BiblioteksentralenProvider = (props) => /* @__PURE__ */ React6.createElement(ChakraProvider, { value: biblioteksentralenChakraTheme }, /* @__PURE__ */ React6.createElement(ColorModeProvider, { ...props }));
374
+ var BiblioteksentralenProvider = (props) => /* @__PURE__ */ React6.createElement(ChakraProvider, { value: createSystem(defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {}) }, /* @__PURE__ */ React6.createElement(ColorModeProvider, { ...props }));
343
375
 
344
376
  // src/components/ErrorBoundary.tsx
345
377
  import { Box as Box2 } from "@chakra-ui/react";
@@ -384,7 +416,7 @@ var focusOnRelativeParentStyle = {
384
416
  width: "100%",
385
417
  pointerEvents: "none",
386
418
  borderRadius: "0.25rem",
387
- boxShadow: "var(--chakra-shadows-outline)"
419
+ ...focusStyle
388
420
  }
389
421
  }
390
422
  };
@@ -439,11 +471,11 @@ export {
439
471
  ErrorBoundary,
440
472
  HashLinkTarget,
441
473
  HideWithCSS,
474
+ IconButton,
442
475
  Input,
443
476
  Link,
444
477
  Toaster,
445
478
  VisuallyHidden,
446
- biblioteksentralenChakraTheme,
447
479
  colors,
448
480
  toaster,
449
481
  withErrorBoundary
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../../utils/src/colors.ts","../../utils/src/date.ts","../../utils/src/environment.ts","../../utils/src/random.ts","../../utils/src/slugifyString.ts","../../utils/src/sort/common.ts","../../utils/src/sort/sortAlphabetical.ts","../../utils/src/sort/sortArrayInGroups.ts","../../utils/src/sort/sortByMultiple.ts","../src/components/Alert.tsx","../src/components/Button.tsx","../src/components/ConditionalWrapper.tsx","../src/components/HideWithCSS.tsx","../src/components/Input.tsx","../src/components/VisuallyHidden.tsx","../src/components/Link.tsx","../src/BiblioteksentralenProvider.tsx","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/components/ErrorBoundary.tsx","../src/components/HashLinkTarget.tsx","../src/components/withErrorBoundary.tsx","../src/components/ui/toaster.tsx"],"sourcesContent":["export * from \"@chakra-ui/react\"; // Exports Chakra components first to override some components later\nexport type { StyleProps, ResponsiveObject } from \"@chakra-ui/system\"; // Exports Chakra system types\nexport { Alert } from \"./components/Alert\"; // Overrides Chakras Alert\nexport { Button } from \"./components/Button\"; // Overrides Chakras Button\nexport { ConditionalWrapper } from \"./components/ConditionalWrapper\"; // Overrides Chakras Input\nexport { HideWithCSS } from \"./components/HideWithCSS\"; // Overrides Chakras HideWithCSS\nexport { Input } from \"./components/Input\"; // Overrides Chakras Input\nexport { Link } from \"./components/Link\"; // Overrides Chakras Link\nexport { VisuallyHidden } from \"./components/VisuallyHidden\"; // Overrides Chakras VisuallyHidden\n\nexport { BiblioteksentralenProvider } from \"./BiblioteksentralenProvider\";\nexport { ErrorBoundary } from \"./components/ErrorBoundary\";\nexport { HashLinkTarget } from \"./components/HashLinkTarget\";\nexport { withErrorBoundary } from \"./components/withErrorBoundary\";\n\nexport { colors } from \"@biblioteksentralen/utils\"; // Re-export colors for convenience\nexport { biblioteksentralenChakraTheme } from \"./styles/chakraTheme/biblioteksentralenChakraTheme\";\n\n// Generated from cli: npmx @chakra-ui/cli snippet add\nexport { Toaster, toaster } from \"./components/ui/toaster\"; // Exports the Toaster component\n","export const colors = {\n black: \"#000000\",\n grey90: \"#181818\",\n grey80: \"#333333\",\n grey60: \"#585858\",\n grey45: \"#8c8c8c\",\n grey30: \"#b2b2b2\",\n grey15: \"#d9d9d9\",\n grey10: \"#e5e5e5\",\n grey05: \"#f2f2f2\",\n white: \"#ffffff\",\n bsRødDark: \"#870010\",\n bsRødMedium: \"#d53d40\",\n accentPurple: \"#331433\",\n accentPeach: \"#ffba99\",\n accentGreen: \"#003b29\",\n accentBlueDark: \"#001740\",\n accentBlueMedium: \"#5996de\",\n accentYellow: \"#ffc970\",\n lightBlue: \"#dbe8ef\",\n lightGreen: \"#dbe0db\",\n lightPeach: \"#f4e7de\",\n lightPurple: \"#ece8f3\",\n statusRed: \"#ad313c\",\n statusYellow: \"#bc5600\",\n statusGreen: \"#24845b\",\n statusGreenLight: \"#edf4f1\",\n statusRedLight: \"#f8efef\",\n statusYellowLight: \"#fff6e4\",\n neptune: {\n \"100\": \"#CFE6E8\",\n \"200\": \"#9FCDD2\",\n \"300\": \"#6FB5BB\",\n \"400\": \"#3F9CA5\",\n \"500\": \"#0F838E\",\n \"600\": \"#0C6972\",\n \"700\": \"#094F55\",\n \"800\": \"#063439\",\n \"900\": \"#031A1C\",\n },\n};\n","import { format } from \"date-fns/format\";\nimport { nb } from \"date-fns/locale/nb\";\n\nexport function formaterDato(dato?: string, dateFnsformat = \"Pp\") {\n if (typeof dato !== \"string\") return \"Ukjent dato\";\n\n try {\n return format(new Date(dato), dateFnsformat, { locale: nb });\n } catch (e) {\n console.error(\"Kunne ikke formattere dato:\" + dato, e);\n return dato;\n }\n}\n","export function isDevelopment(): boolean {\n return process.env.NODE_ENV === \"development\";\n}\n\nexport function isClient(): boolean {\n return typeof window !== \"undefined\";\n}\n\nexport function isServer(): boolean {\n return !isClient();\n}\n","export function randomFromArray<T>(array: T[]): T {\n return array[Math.floor(Math.random() * array.length)];\n}\n\nexport function seededRandomFromArray<T>(array: T[], seed: string): T {\n return array[Math.floor(seededRandom(seed) * array.length)];\n}\n\n// Returns a pseudo-random floating-point number in the range [0.0 -> 1.0] from a string seed\n// TODO, ser ikke ut til å gi helt jevn fordeling mellom 0 og 1, trenger kanskje litt kjærlighet\nexport function seededRandom(seed: string) {\n // Oversetter ikke-numeriske tegn til tall så de kan brukes som seed\n const numericSeed = Number(seed.replace(/\\D/g, (match) => `${match.charCodeAt(0)}`));\n const x = Math.sin(numericSeed) * 3333;\n return x - Math.floor(x);\n}\n","export const slugifyString = (value = \"\") =>\n value\n .trim()\n .toLowerCase()\n // Bytter ut typisk norske bokstaver æøå\n .replace(/æ/g, \"ae\")\n .replace(/å/g, \"a\")\n .replace(/ø/g, \"o\")\n // Bytter alle tegn som ikke er et regex-word med '-'\n .replace(/\\W/g, \"-\")\n // Bytter ut flere streker med enkelt strek \"----\" => \"-\"\n .replace(/-+/g, \"-\")\n .slice(0, 30);\n","export type GetSortIndex<T> = (element: T) => number | string;\n\nconst compareAlphabetically = (left: string, right: string) => left.localeCompare(right, [\"no-NO\"]);\n\nexport const compare = <T>(left: T, right: T, indexFunction?: GetSortIndex<T>) => {\n const leftIndex = indexFunction ? indexFunction(left) : left;\n const rightIndex = indexFunction ? indexFunction(right) : right;\n\n if (typeof leftIndex == \"number\" && typeof rightIndex == \"number\") return leftIndex - rightIndex;\n\n if (typeof leftIndex == \"string\" && typeof rightIndex == \"string\") {\n return compareAlphabetically(leftIndex, rightIndex);\n }\n\n throw new Error(\"Sort index function gives inconsistent index types\");\n};\n","import { GetSortIndex, compare } from \"./common\";\n\n/**\n * Alphabetical sorting restricted to Norwegian locale, for consistent sorting on server and client\n * (radash's `alphabetical()` is inconsistent between these two)\n */\nexport const sortAlphabetical = <T>(array: T[], indexFunction?: GetSortIndex<T>): T[] =>\n array.slice().sort((left, right) => compare(left, right, indexFunction));\n","export interface Group<T> {\n label: string;\n items: T[];\n}\n\nexport interface GroupedArray<T> extends Array<Group<T>> {}\n\n/* Tar et array og putter ting i grupper basert på gruppekategorier\n *\n * Feks\n *\n * const myArray = ['Apple', 'Aubergine', 'Lemon'];\n *\n * const inGroups = groupArray(myArray, item => item[0]);\n *\n * console.log(inGroups);\n *\n * // [{groupLabel: 'A', groupItems: ['Apple', 'Aubergine']}, {groupLabel: 'L', groupItems: ['Lemon']}]\n *\n * */\nexport function sortArrayInGroups<T>(\n items: T[],\n getGroupLabel: (element: T) => string,\n options?: { sortAlphabetically?: boolean }\n): GroupedArray<T> {\n const groups = items.reduce((acc: GroupedArray<T>, arrayEntry) => {\n const currentCategory = getGroupLabel(arrayEntry);\n const categoryIndex = acc.findIndex((group) => group.label === currentCategory);\n if (categoryIndex >= 0) {\n acc[categoryIndex].items.push(arrayEntry);\n } else {\n acc.push({\n label: currentCategory,\n items: [arrayEntry],\n });\n }\n return acc;\n }, []);\n\n return options?.sortAlphabetically ? groups.sort(sortByLabel) : groups;\n}\n\nfunction sortByLabel<T>(a: Group<T>, b: Group<T>) {\n if (a.label.toLowerCase() > b.label.toLowerCase()) return 1;\n if (a.label.toLowerCase() < b.label.toLowerCase()) return -1;\n return 0;\n}\n","import { AtLeastOne } from \"@biblioteksentralen/types\";\nimport { GetSortIndex, compare } from \"./common\";\n\n/**\n * Corresponds to lodash's sortBy called with several comparison functions (no equivalent in radash)\n */\nexport const sortByMultiple = <T>(array: T[], ...indexFunctions: AtLeastOne<GetSortIndex<T>>): T[] =>\n array.slice().sort((left, right) =>\n indexFunctions.slice(1).reduce(\n // If the previous comparison is 0, it means left and right are equal according to the previous\n // comparison function. That's also the only way it'll be falsy, therefore we can\n // use the or operator || to then apply the next comparison function.\n (previous, indexFunction) => previous || compare(left, right, indexFunction),\n compare(left, right, indexFunctions[0]) // Initial comparison\n )\n );\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { colors } from \"@biblioteksentralen/utils\";\nimport { AlertRootProps, Alert as ChakraAlert, SystemStyleObject } from \"@chakra-ui/react\";\nimport React, { ReactNode } from \"react\";\nimport { AlertCircle, CheckCircle, Info, XCircle } from \"react-feather\";\n\ntype Status = \"info\" | \"warning\" | \"success\" | \"error\";\ntype CustomVariants = \"inline\";\ntype Variants = AlertRootProps[\"variant\"] | CustomVariants;\n\nconst colorLookup: Record<Status, { bg: string; color: string }> = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed },\n};\n\nconst iconLookup: Record<Status, React.ReactElement> = {\n info: <Info strokeWidth={1.75} role=\"img\" aria-label=\"Informasjon\" />,\n warning: <AlertCircle strokeWidth={1.75} role=\"img\" aria-label=\"Advarsel\" />,\n success: <CheckCircle strokeWidth={1.75} role=\"img\" aria-label=\"Suksess\" />,\n error: <XCircle strokeWidth={1.75} role=\"img\" aria-label=\"Feil\" />,\n};\n\ninterface Props extends Modify<AlertRootProps, { variant?: Variants }> {\n children: ReactNode;\n header?: ReactNode;\n status: Status;\n variant?: Variants;\n}\n\nconst variantStyles: Record<CustomVariants, SystemStyleObject> = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\",\n },\n};\n\nexport function Alert({ status, children, variant, header, ...rest }: Props) {\n const colors = colorLookup[status];\n return (\n <ChakraAlert.Root\n status={status}\n border={`0.1rem solid`}\n borderColor={colors.color}\n backgroundColor={colors.bg}\n {...(variant === \"inline\" ? variantStyles[variant] : {})}\n {...rest}\n >\n <ChakraAlert.Indicator>{iconLookup[status]}</ChakraAlert.Indicator>\n <ChakraAlert.Content color=\"black\">\n {header && <ChakraAlert.Title>{header}</ChakraAlert.Title>}\n <ChakraAlert.Description>{children}</ChakraAlert.Description>\n </ChakraAlert.Content>\n </ChakraAlert.Root>\n );\n}\n","import React from \"react\";\nimport { Button as ChakraButton, ButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { Modify } from \"@biblioteksentralen/types\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras Button with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype ButtonVariants = ButtonProps[\"variant\"] | CustomButtonVariants;\nexport const Button = ChakraButton as ComponentWithAs<\"button\", Modify<ButtonProps, { variant?: ButtonVariants }>>;\n","import React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n wrapper: FunctionComponent<{ children: ReactNode }>;\n condition: boolean;\n};\n\n/**\n * Conditionally wrapps children with a component. If conditions are not met children mounted without the wrapper.\n */\nexport const ConditionalWrapper: FunctionComponent<Props> = ({ condition, children, wrapper: Wrapper }) =>\n condition ? <Wrapper>{children}</Wrapper> : <>{children}</>;\n","import { Box, BoxProps } from \"@chakra-ui/react\";\nimport { ThemeTypings } from \"@chakra-ui/system\";\nimport React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n above?: ThemeTypings[\"breakpoints\"];\n below?: ThemeTypings[\"breakpoints\"];\n} & Omit<BoxProps, \"display\">;\n\n/** Chakras <Hide /> component uses client side javascript to hide components. Causes components to flash on mobile while loading */\nexport const HideWithCSS: FunctionComponent<Props> = ({ children, above, below, ...chakraProps }) => {\n const display: BoxProps[\"display\"] = {\n ...(!!below ? { base: \"none\", [below]: \"block\" } : {}),\n ...(!!above ? { [above]: \"none\" } : {}),\n };\n\n return (\n <Box {...chakraProps} display={display}>\n {children}\n </Box>\n );\n};\n","import { Field, Input as ChakraInput, InputProps, FieldLabelProps } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\ninterface Props extends InputProps {\n label: string;\n hideLabel?: boolean;\n labelProps?: FieldLabelProps;\n helperText?: string;\n errorMessage?: string;\n}\n\n/**\n * Creating custom input-component to make sure label is always set (for accessibility)\n * 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\n */\nexport const Input = (props: Props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n\n const formLabel = <Field.Label {...labelProps}>{label}</Field.Label>;\n\n return (\n <Field.Root invalid={!!errorMessage}>\n {hideLabel ? <VisuallyHidden>{formLabel}</VisuallyHidden> : formLabel}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","import React, { HTMLAttributes, ReactNode, useEffect } from \"react\";\nimport { VisuallyHidden as ChakraVisuallyHidden } from \"@chakra-ui/react\";\nimport { isDevelopment } from \"@biblioteksentralen/utils\";\n\ninterface Props extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n}\n\n// https://www.joshwcomeau.com/snippets/react-components/visually-hidden/\nexport function VisuallyHidden({ children, ...rest }: Props) {\n const [forceShow, setForceShow] = React.useState(false);\n\n useEffect(() => {\n if (isDevelopment()) {\n const handleKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(true);\n }\n };\n const handleKeyUp = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(false);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n window.addEventListener(\"keyup\", handleKeyUp);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n window.removeEventListener(\"keyup\", handleKeyUp);\n };\n }\n }, []);\n\n // position=\"fixed\" løser bug der visually hidden ikke hindret tekst fra å ta plass i bredden\n return forceShow ? <span>{children}</span> : <ChakraVisuallyHidden position=\"fixed\">{children}</ChakraVisuallyHidden>;\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Link as ChakraLink, LinkProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomLinkVariants } from \"../styles/chakraTheme/LinkStyles\";\n\n/**\n * Re-exporting chackras Link with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype LinkVariants = LinkProps[\"variant\"] | CustomLinkVariants;\nexport const Link = ChakraLink as ComponentWithAs<\"a\", Modify<LinkProps, { variant?: LinkVariants }>>;\n","import React, { ReactNode } from \"react\";\nimport { ChakraProvider } from \"@chakra-ui/react\";\nimport { biblioteksentralenChakraTheme } from \"./styles/chakraTheme/biblioteksentralenChakraTheme\";\nimport { ColorModeProvider } from \"@chakra-ui/system\";\n\ninterface Props {\n children: ReactNode;\n}\n\nexport const BiblioteksentralenProvider = (props: Props) => (\n <ChakraProvider value={biblioteksentralenChakraTheme}>\n <ColorModeProvider {...props} />\n </ChakraProvider>\n);\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomButtonVariants = \"primary\" | \"secondary\" | \"tertiary\";\n\nconst variants: Record<CustomButtonVariants, SystemStyleObject> = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\",\n },\n },\n secondary: {\n borderColor: \"currentColor !important\",\n backgroundColor: \"transparent\",\n color: \"currentColor\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 50%, 0.15)\",\n },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: \"currentColor\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 50%, 0.15)\",\n color: \"currentColor\",\n },\n },\n};\n\nexport const ButtonStyles = defineRecipe({\n base: {\n border: \"transparent 0.1em solid\",\n borderRadius: \"0.35em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45} !important`,\n color: \"white !important\",\n opacity: 1,\n },\n },\n variants: {\n variant: {\n ...variants,\n },\n sizes: {\n sm: {\n padding: \"0.2em 0.5em\",\n fontSize: \"1rem\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const ContainerStyles = defineRecipe({\n base: {\n px: \".75rem\", // Padding left/right\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const HeadingStyles = defineRecipe({\n base: {\n fontWeight: \"600\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nconst variants: Record<string, SystemStyleObject> = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" },\n },\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n};\n\nexport const InputStyles = defineRecipe({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" },\n },\n },\n variants: {\n variant: { ...variants },\n },\n defaultVariants: {\n variant: \"subtle\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomLinkVariants = \"plain\" | \"underline\";\n\nconst variants: Record<CustomLinkVariants, SystemStyleObject> = {\n plain: {\n textDecoration: \"none\",\n _hover: {\n textDecoration: \"underline\",\n },\n },\n underline: {\n textDecoration: \"underline\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n variants: {\n variant: { ...variants },\n },\n defaultVariants: {\n variant: \"underline\",\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe } from \"@chakra-ui/react\";\n\nexport const SpinnerStyles = defineRecipe({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\",\n },\n});\n","const container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" }, // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" },\n};\n\nexport const sizes = {\n container,\n};\n","import { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\nimport { createSystem, defaultConfig } from \"@chakra-ui/react\";\n\nexport const biblioteksentralenChakraTheme = createSystem(defaultConfig, {\n theme: {\n tokens: {\n sizes,\n },\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles,\n },\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" },\n },\n },\n});\n","import { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { Alert } from \"./Alert\";\n\ninterface Props {\n boundaryName?: string;\n children: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\nconst StyledPre = (props: BoxProps) => (\n <Box as=\"pre\" paddingTop=\"0.5rem\" wordBreak=\"break-all\" whiteSpace=\"pre-wrap\" fontSize=\"0.8rem\" {...props} />\n);\n\nexport class ErrorBoundary extends React.Component<Props, State> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n\n return (\n <div>\n <Alert status=\"error\">\n <p>Beklager, det skjedde en teknisk feil.</p>\n {isDevelopment() && (stackTrace || errormsg) && (\n <div>\n <StyledPre>{errormsg || \"\"}</StyledPre>\n <StyledPre>{info || \"\"}</StyledPre>\n <StyledPre>{stackTrace || \"\"}</StyledPre>\n </div>\n )}\n </Alert>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n","import { Box } from \"@chakra-ui/react\";\nimport React from \"react\";\n\ninterface Props {\n id: string;\n /**\n * angir hvor mye luft til vil ha over HashLinkTarget ved bruk av hash-lenke, eks '4rem'\n */\n spaceAbove?: string;\n /**\n * angir om du vil ha fokusramme rundt komponenten som mounter HashLinkTarget. Da må komponenten du wrapper med ha position: relative | absolute el\n */\n focusOnParent?: boolean;\n}\n\nconst focusOnRelativeParentStyle = {\n _focusWithin: {\n position: \"static\",\n boxShadow: \"none\",\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n left: 0,\n height: \"100%\",\n width: \"100%\",\n pointerEvents: \"none\",\n borderRadius: \"0.25rem\",\n boxShadow: \"var(--chakra-shadows-outline)\",\n },\n },\n};\n\n/*\n * Komponent som sørger for luft over anchors (elementer man kan lenke til med hash-lenker feks <a href=\"#min-overskrift\">Ta meg til overskrift</a>)\n */\nexport function HashLinkTarget(props: Props) {\n return (\n <Box position=\"relative\" css={props.focusOnParent ? focusOnRelativeParentStyle : undefined}>\n <Box\n id={props.id}\n tabIndex={props.focusOnParent ? -1 : undefined}\n position=\"absolute\"\n top={`-${props.spaceAbove || \"2.5rem\"}`}\n _focus={{\n boxShadow: \"none !important\",\n }}\n />\n </Box>\n );\n}\n","import React from \"react\";\nimport { ErrorBoundary } from \"./ErrorBoundary\";\n\nexport const withErrorBoundary = <Props,>(Component: React.ComponentType<Props>, boundaryName: string) => {\n return (props: Props & React.JSX.IntrinsicAttributes) => (\n <ErrorBoundary boundaryName={boundaryName}>\n <Component {...props} />\n </ErrorBoundary>\n );\n};\n","\"use client\";\n\nimport {\n Toaster as ChakraToaster,\n Portal,\n Spinner,\n Stack,\n Toast,\n ToastRootProps,\n createToaster,\n} from \"@chakra-ui/react\";\nimport React from \"react\";\n\nexport const toaster: ToastRootProps = createToaster({\n pauseOnPageIdle: true,\n offsets: { left: \"50%\", top: \"50%\", right: \"50%\", bottom: \"50%\" },\n});\n\nexport const Toaster = () => {\n return (\n <Portal>\n <ChakraToaster toaster={toaster} insetInline={{ mdDown: \"4\" }}>\n {(toast: ToastRootProps) => {\n if (typeof toast.render === \"function\") {\n return <>{toast.render()}</>;\n }\n return (\n <Toast.Root width={{ md: \"sm\" }}>\n {toast.type === \"loading\" ? <Spinner size=\"sm\" color=\"blue.solid\" /> : <Toast.Indicator />}\n <Stack gap=\"1\" flex=\"1\" maxWidth=\"100%\">\n {toast.title && <Toast.Title>{toast.title}</Toast.Title>}\n {toast.description && <Toast.Description>{toast.description}</Toast.Description>}\n </Stack>\n {toast.action && <Toast.ActionTrigger>{toast.action.label}</Toast.ActionTrigger>}\n {toast.closable && <Toast.CloseTrigger />}\n </Toast.Root>\n );\n }}\n </ChakraToaster>\n </Portal>\n );\n};\n"],"mappings":";AAAA,cAAc;;;AEAd,SAAS,cAAc;AACvB,SAAS,UAAU;ADDZ,IAAM,SAAS;EACpB,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,gBAAW;EACX,kBAAa;EACb,cAAc;EACd,aAAa;EACb,aAAa;EACb,gBAAgB;EAChB,kBAAkB;EAClB,cAAc;EACd,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,WAAW;EACX,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,mBAAmB;EACnB,SAAS;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;EACT;AACF;AExCO,SAAS,gBAAyB;AACvC,SAAO,QAAQ,IAAI,aAAa;AAClC;;;AOAA,SAAyB,SAAS,mBAAsC;AACxE,OAAO,WAA0B;AACjC,SAAS,aAAa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AO,OAAO,QAAQ,MAAM;AAClE,CAAC;AAEM,IAAM,UAAU,MAAM;AAC3B,SACE,gBAAAA,QAAA,cAAC,cACC,gBAAAA,QAAA,cAAC,iBAAc,SAAkB,aAAa,EAAE,QAAQ,IAAI,KACzD,CAAC,UAA0B;AAC1B,QAAI,OAAO,MAAM,WAAW,YAAY;AACtC,aAAO,gBAAAA,QAAA,cAAAA,QAAA,gBAAG,MAAM,OAAO,CAAE;AAAA,IAC3B;AACA,WACE,gBAAAA,QAAA,cAAC,MAAM,MAAN,EAAW,OAAO,EAAE,IAAI,KAAK,KAC3B,MAAM,SAAS,YAAY,gBAAAA,QAAA,cAAC,WAAQ,MAAK,MAAK,OAAM,cAAa,IAAK,gBAAAA,QAAA,cAAC,MAAM,WAAN,IAAgB,GACxF,gBAAAA,QAAA,cAAC,SAAM,KAAI,KAAI,MAAK,KAAI,UAAS,UAC9B,MAAM,SAAS,gBAAAA,QAAA,cAAC,MAAM,OAAN,MAAa,MAAM,KAAM,GACzC,MAAM,eAAe,gBAAAA,QAAA,cAAC,MAAM,aAAN,MAAmB,MAAM,WAAY,CAC9D,GACC,MAAM,UAAU,gBAAAA,QAAA,cAAC,MAAM,eAAN,MAAqB,MAAM,OAAO,KAAM,GACzD,MAAM,YAAY,gBAAAA,QAAA,cAAC,MAAM,cAAN,IAAmB,CACzC;AAAA,EAEJ,CACF,CACF;AAEJ;","names":["colors","React","React","React","React","React","React","React","defineRecipe","defineRecipe","defineRecipe","variants","defineRecipe","variants","defineRecipe","React","Box","React","React","Box","Box","React","React","React","React"]}
1
+ {"version":3,"sources":["../src/index.ts","../../utils/src/colors.ts","../../utils/src/date.ts","../../utils/src/environment.ts","../../utils/src/random.ts","../../utils/src/slugifyString.ts","../../utils/src/sort/common.ts","../../utils/src/sort/sortAlphabetical.ts","../../utils/src/sort/sortArrayInGroups.ts","../../utils/src/sort/sortByMultiple.ts","../src/components/Alert.tsx","../src/components/Button.tsx","../src/components/IconButton.tsx","../src/components/ConditionalWrapper.tsx","../src/components/HideWithCSS.tsx","../src/components/Input.tsx","../src/components/VisuallyHidden.tsx","../src/components/Link.tsx","../src/BiblioteksentralenProvider.tsx","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/components/ErrorBoundary.tsx","../src/components/HashLinkTarget.tsx","../src/components/withErrorBoundary.tsx","../src/components/ui/toaster.tsx"],"sourcesContent":["export * from \"@chakra-ui/react\"; // Exports Chakra components first to override some components later\nexport type { StyleProps, ResponsiveObject } from \"@chakra-ui/system\"; // Exports Chakra system types\nexport { Alert } from \"./components/Alert\"; // Overrides Chakras Alert\nexport { Button, type ButtonProps } from \"./components/Button\"; // Overrides Chakras Button\nexport { IconButton, type IconButtonProps } from \"./components/IconButton\"; // Overrides Chakras IconButton\nexport { ConditionalWrapper } from \"./components/ConditionalWrapper\"; // Overrides Chakras Input\nexport { HideWithCSS } from \"./components/HideWithCSS\"; // Overrides Chakras HideWithCSS\nexport { Input } from \"./components/Input\"; // Overrides Chakras Input\nexport { Link } from \"./components/Link\"; // Overrides Chakras Link\nexport { VisuallyHidden } from \"./components/VisuallyHidden\"; // Overrides Chakras VisuallyHidden\n\nexport { BiblioteksentralenProvider } from \"./BiblioteksentralenProvider\";\nexport { ErrorBoundary } from \"./components/ErrorBoundary\";\nexport { HashLinkTarget } from \"./components/HashLinkTarget\";\nexport { withErrorBoundary } from \"./components/withErrorBoundary\";\n\nexport { colors } from \"@biblioteksentralen/utils\"; // Re-export colors for convenience\n\n// Generated from cli: npmx @chakra-ui/cli snippet add\nexport { Toaster, toaster } from \"./components/ui/toaster\"; // Exports the Toaster component\n","export const colors = {\n black: \"#000000\",\n grey90: \"#181818\",\n grey80: \"#333333\",\n grey60: \"#585858\",\n grey45: \"#8c8c8c\",\n grey30: \"#b2b2b2\",\n grey15: \"#d9d9d9\",\n grey10: \"#e5e5e5\",\n grey05: \"#f2f2f2\",\n white: \"#ffffff\",\n bsRødDark: \"#870010\",\n bsRødMedium: \"#d53d40\",\n accentPurple: \"#331433\",\n accentPeach: \"#ffba99\",\n accentGreen: \"#003b29\",\n accentBlueDark: \"#001740\",\n accentBlueMedium: \"#5996de\",\n accentYellow: \"#ffc970\",\n lightBlue: \"#dbe8ef\",\n lightGreen: \"#dbe0db\",\n lightPeach: \"#f4e7de\",\n lightPurple: \"#ece8f3\",\n statusRed: \"#ad313c\",\n statusYellow: \"#bc5600\",\n statusGreen: \"#24845b\",\n statusGreenLight: \"#edf4f1\",\n statusRedLight: \"#f8efef\",\n statusYellowLight: \"#fff6e4\",\n neptune: {\n \"100\": \"#CFE6E8\",\n \"200\": \"#9FCDD2\",\n \"300\": \"#6FB5BB\",\n \"400\": \"#3F9CA5\",\n \"500\": \"#0F838E\",\n \"600\": \"#0C6972\",\n \"700\": \"#094F55\",\n \"800\": \"#063439\",\n \"900\": \"#031A1C\",\n },\n};\n","import { format } from \"date-fns/format\";\nimport { nb } from \"date-fns/locale/nb\";\n\nexport function formaterDato(dato?: string, dateFnsformat = \"Pp\") {\n if (typeof dato !== \"string\") return \"Ukjent dato\";\n\n try {\n return format(new Date(dato), dateFnsformat, { locale: nb });\n } catch (e) {\n console.error(\"Kunne ikke formattere dato:\" + dato, e);\n return dato;\n }\n}\n","export function isDevelopment(): boolean {\n return process.env.NODE_ENV === \"development\";\n}\n\nexport function isClient(): boolean {\n return typeof window !== \"undefined\";\n}\n\nexport function isServer(): boolean {\n return !isClient();\n}\n","export function randomFromArray<T>(array: T[]): T {\n return array[Math.floor(Math.random() * array.length)];\n}\n\nexport function seededRandomFromArray<T>(array: T[], seed: string): T {\n return array[Math.floor(seededRandom(seed) * array.length)];\n}\n\n// Returns a pseudo-random floating-point number in the range [0.0 -> 1.0] from a string seed\n// TODO, ser ikke ut til å gi helt jevn fordeling mellom 0 og 1, trenger kanskje litt kjærlighet\nexport function seededRandom(seed: string) {\n // Oversetter ikke-numeriske tegn til tall så de kan brukes som seed\n const numericSeed = Number(seed.replace(/\\D/g, (match) => `${match.charCodeAt(0)}`));\n const x = Math.sin(numericSeed) * 3333;\n return x - Math.floor(x);\n}\n","export const slugifyString = (value = \"\") =>\n value\n .trim()\n .toLowerCase()\n // Bytter ut typisk norske bokstaver æøå\n .replace(/æ/g, \"ae\")\n .replace(/å/g, \"a\")\n .replace(/ø/g, \"o\")\n // Bytter alle tegn som ikke er et regex-word med '-'\n .replace(/\\W/g, \"-\")\n // Bytter ut flere streker med enkelt strek \"----\" => \"-\"\n .replace(/-+/g, \"-\")\n .slice(0, 30);\n","export type GetSortIndex<T> = (element: T) => number | string;\n\nconst compareAlphabetically = (left: string, right: string) => left.localeCompare(right, [\"no-NO\"]);\n\nexport const compare = <T>(left: T, right: T, indexFunction?: GetSortIndex<T>) => {\n const leftIndex = indexFunction ? indexFunction(left) : left;\n const rightIndex = indexFunction ? indexFunction(right) : right;\n\n if (typeof leftIndex == \"number\" && typeof rightIndex == \"number\") return leftIndex - rightIndex;\n\n if (typeof leftIndex == \"string\" && typeof rightIndex == \"string\") {\n return compareAlphabetically(leftIndex, rightIndex);\n }\n\n throw new Error(\"Sort index function gives inconsistent index types\");\n};\n","import { GetSortIndex, compare } from \"./common\";\n\n/**\n * Alphabetical sorting restricted to Norwegian locale, for consistent sorting on server and client\n * (radash's `alphabetical()` is inconsistent between these two)\n */\nexport const sortAlphabetical = <T>(array: T[], indexFunction?: GetSortIndex<T>): T[] =>\n array.slice().sort((left, right) => compare(left, right, indexFunction));\n","export interface Group<T> {\n label: string;\n items: T[];\n}\n\nexport interface GroupedArray<T> extends Array<Group<T>> {}\n\n/* Tar et array og putter ting i grupper basert på gruppekategorier\n *\n * Feks\n *\n * const myArray = ['Apple', 'Aubergine', 'Lemon'];\n *\n * const inGroups = groupArray(myArray, item => item[0]);\n *\n * console.log(inGroups);\n *\n * // [{groupLabel: 'A', groupItems: ['Apple', 'Aubergine']}, {groupLabel: 'L', groupItems: ['Lemon']}]\n *\n * */\nexport function sortArrayInGroups<T>(\n items: T[],\n getGroupLabel: (element: T) => string,\n options?: { sortAlphabetically?: boolean }\n): GroupedArray<T> {\n const groups = items.reduce((acc: GroupedArray<T>, arrayEntry) => {\n const currentCategory = getGroupLabel(arrayEntry);\n const categoryIndex = acc.findIndex((group) => group.label === currentCategory);\n if (categoryIndex >= 0) {\n acc[categoryIndex].items.push(arrayEntry);\n } else {\n acc.push({\n label: currentCategory,\n items: [arrayEntry],\n });\n }\n return acc;\n }, []);\n\n return options?.sortAlphabetically ? groups.sort(sortByLabel) : groups;\n}\n\nfunction sortByLabel<T>(a: Group<T>, b: Group<T>) {\n if (a.label.toLowerCase() > b.label.toLowerCase()) return 1;\n if (a.label.toLowerCase() < b.label.toLowerCase()) return -1;\n return 0;\n}\n","import { AtLeastOne } from \"@biblioteksentralen/types\";\nimport { GetSortIndex, compare } from \"./common\";\n\n/**\n * Corresponds to lodash's sortBy called with several comparison functions (no equivalent in radash)\n */\nexport const sortByMultiple = <T>(array: T[], ...indexFunctions: AtLeastOne<GetSortIndex<T>>): T[] =>\n array.slice().sort((left, right) =>\n indexFunctions.slice(1).reduce(\n // If the previous comparison is 0, it means left and right are equal according to the previous\n // comparison function. That's also the only way it'll be falsy, therefore we can\n // use the or operator || to then apply the next comparison function.\n (previous, indexFunction) => previous || compare(left, right, indexFunction),\n compare(left, right, indexFunctions[0]) // Initial comparison\n )\n );\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { colors } from \"@biblioteksentralen/utils\";\nimport { AlertRootProps, Alert as ChakraAlert, SystemStyleObject } from \"@chakra-ui/react\";\nimport React, { ReactNode } from \"react\";\nimport { AlertCircle, CheckCircle, Info, XCircle } from \"react-feather\";\n\ntype Status = \"info\" | \"warning\" | \"success\" | \"error\";\ntype CustomVariants = \"inline\";\ntype Variants = AlertRootProps[\"variant\"] | CustomVariants;\n\nconst colorLookup: Record<Status, { bg: string; color: string }> = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed },\n};\n\nconst iconLookup: Record<Status, React.ReactElement> = {\n info: <Info strokeWidth={1.75} role=\"img\" aria-label=\"Informasjon\" />,\n warning: <AlertCircle strokeWidth={1.75} role=\"img\" aria-label=\"Advarsel\" />,\n success: <CheckCircle strokeWidth={1.75} role=\"img\" aria-label=\"Suksess\" />,\n error: <XCircle strokeWidth={1.75} role=\"img\" aria-label=\"Feil\" />,\n};\n\ninterface Props extends Modify<AlertRootProps, { variant?: Variants }> {\n children: ReactNode;\n header?: ReactNode;\n status: Status;\n variant?: Variants;\n}\n\nconst variantStyles: Record<CustomVariants, SystemStyleObject> = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\",\n },\n};\n\nexport function Alert({ status, children, variant, header, ...rest }: Props) {\n const colors = colorLookup[status];\n return (\n <ChakraAlert.Root\n status={status}\n fontSize=\"md\"\n border={`0.1rem solid`}\n borderColor={colors.color}\n backgroundColor={colors.bg}\n display=\"flex\"\n flexWrap=\"wrap\"\n {...(variant === \"inline\" ? variantStyles[variant] : {})}\n {...rest}\n >\n <ChakraAlert.Indicator marginX=\"auto\">{iconLookup[status]}</ChakraAlert.Indicator>\n <ChakraAlert.Content color=\"black\">\n {header && <ChakraAlert.Title>{header}</ChakraAlert.Title>}\n <ChakraAlert.Description>{children}</ChakraAlert.Description>\n </ChakraAlert.Content>\n </ChakraAlert.Root>\n );\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Button as ChakraButton, ButtonProps as NativeButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras Button with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype ButtonVariants = NativeButtonProps[\"variant\"] | CustomButtonVariants;\nexport type ButtonProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const Button = ChakraButton as ComponentWithAs<\"button\", ButtonProps>;\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { IconButton as ChakraIconButton, IconButtonProps as ChakraIconButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras IconButton with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype IconButtonVariants = ChakraIconButtonProps[\"variant\"] | CustomButtonVariants;\nexport type IconButtonProps = Modify<ChakraIconButtonProps, { variant?: IconButtonVariants }>;\nexport const IconButton = ChakraIconButton as ComponentWithAs<\"button\", IconButtonProps>;\n","import React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n wrapper: FunctionComponent<{ children: ReactNode }>;\n condition: boolean;\n};\n\n/**\n * Conditionally wrapps children with a component. If conditions are not met children mounted without the wrapper.\n */\nexport const ConditionalWrapper: FunctionComponent<Props> = ({ condition, children, wrapper: Wrapper }) =>\n condition ? <Wrapper>{children}</Wrapper> : <>{children}</>;\n","import { Box, BoxProps } from \"@chakra-ui/react\";\nimport { ThemeTypings } from \"@chakra-ui/system\";\nimport React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n above?: ThemeTypings[\"breakpoints\"];\n below?: ThemeTypings[\"breakpoints\"];\n} & Omit<BoxProps, \"display\">;\n\n/** Chakras <Hide /> component uses client side javascript to hide components. Causes components to flash on mobile while loading */\nexport const HideWithCSS: FunctionComponent<Props> = ({ children, above, below, ...chakraProps }) => {\n const display: BoxProps[\"display\"] = {\n ...(!!below ? { base: \"none\", [below]: \"block\" } : {}),\n ...(!!above ? { [above]: \"none\" } : {}),\n };\n\n return (\n <Box {...chakraProps} display={display}>\n {children}\n </Box>\n );\n};\n","import { Field, Input as ChakraInput, InputProps, FieldLabelProps } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\ninterface Props extends InputProps {\n label: string;\n hideLabel?: boolean;\n labelProps?: FieldLabelProps;\n helperText?: string;\n errorMessage?: string;\n}\n\n/**\n * Creating custom input-component to make sure label is always set (for accessibility)\n * 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\n */\nexport const Input = (props: Props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n\n const formLabel = <Field.Label {...labelProps}>{label}</Field.Label>;\n\n return (\n <Field.Root invalid={!!errorMessage}>\n {hideLabel ? <VisuallyHidden>{formLabel}</VisuallyHidden> : formLabel}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","import React, { HTMLAttributes, ReactNode, useEffect } from \"react\";\nimport { VisuallyHidden as ChakraVisuallyHidden } from \"@chakra-ui/react\";\nimport { isDevelopment } from \"@biblioteksentralen/utils\";\n\ninterface Props extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n}\n\n// https://www.joshwcomeau.com/snippets/react-components/visually-hidden/\nexport function VisuallyHidden({ children, ...rest }: Props) {\n const [forceShow, setForceShow] = React.useState(false);\n\n useEffect(() => {\n if (isDevelopment()) {\n const handleKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(true);\n }\n };\n const handleKeyUp = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(false);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n window.addEventListener(\"keyup\", handleKeyUp);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n window.removeEventListener(\"keyup\", handleKeyUp);\n };\n }\n }, []);\n\n // position=\"fixed\" løser bug der visually hidden ikke hindret tekst fra å ta plass i bredden\n return forceShow ? <span>{children}</span> : <ChakraVisuallyHidden position=\"fixed\">{children}</ChakraVisuallyHidden>;\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Link as ChakraLink, LinkProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomLinkVariants } from \"../styles/chakraTheme/LinkStyles\";\n\n/**\n * Re-exporting chackras Link with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype LinkVariants = LinkProps[\"variant\"] | CustomLinkVariants;\nexport const Link = ChakraLink as ComponentWithAs<\"a\", Modify<LinkProps, { variant?: LinkVariants }>>;\n","import React, { ReactNode } from \"react\";\nimport { ChakraProvider, createSystem, defaultConfig, SystemConfig } from \"@chakra-ui/react\";\nimport { biblioteksentralenChakraTheme } from \"./styles/chakraTheme/biblioteksentralenChakraTheme\";\nimport { ColorModeProvider } from \"@chakra-ui/system\";\n\ninterface Props {\n children: ReactNode;\n customTheme?: SystemConfig;\n}\n\nexport const BiblioteksentralenProvider = (props: Props) => (\n <ChakraProvider value={createSystem(defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})}>\n <ColorModeProvider {...props} />\n </ChakraProvider>\n);\n","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\n\nconst tokens = defineTokens({\n sizes,\n});\n\n// https://blog.logrocket.com/guide-css-word-wrap-overflow-wrap-word-break/\n// https://medium.com/clear-left-thinking/all-you-need-to-know-about-hyphenation-in-css-2baee2d89179\n// Skrur på hyphens auto som default fordi vi har masse mikrotekster og små elementer der layout knekker uten dette, og vi lager stadig nye og glemmer å ta hensyn til dette.\n// Så kan man optionaly sette hyphens: none de stedene man ikke ønsker det, men har ikke sett noe som knekker/blir rart pga dette enda\nconst globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\", // minimum word-length / min letters first line / min letters second line\n};\n\nexport const focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .1rem white, 0 0 0 .2rem black, 0 0 0 .3rem white !important`,\n transition: \"box-shadow 0.1s ease-out\",\n};\n\nexport const biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles,\n },\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" },\n },\n body: {\n ...globalHyphens,\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle,\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomButtonVariants = \"primary\" | \"secondary\" | \"tertiary\";\n\nconst variants: Record<CustomButtonVariants, SystemStyleObject> = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\",\n },\n },\n secondary: {\n borderColor: \"currentColor !important\",\n backgroundColor: \"transparent\",\n color: \"currentColor\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 50%, 0.15)\",\n },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: \"currentColor\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 50%, 0.15)\",\n color: \"currentColor\",\n },\n },\n};\n\nexport const ButtonStyles = defineRecipe({\n base: {\n border: \"transparent 0.1em solid\",\n borderRadius: \"0.35em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45} !important`,\n color: \"white !important\",\n opacity: 1,\n },\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\",\n },\n md: {\n textStyle: \"md\",\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\",\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const ContainerStyles = defineRecipe({\n base: {\n px: \".75rem\", // Padding left/right\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const HeadingStyles = defineRecipe({\n base: {\n fontWeight: \"600\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nconst variants: Record<string, SystemStyleObject> = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" },\n },\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n};\n\nexport const InputStyles = defineRecipe({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" },\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"subtle\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomLinkVariants = \"plain\" | \"underline\";\n\nconst variants: Record<CustomLinkVariants, SystemStyleObject> = {\n plain: {\n textDecoration: \"none\",\n _hover: {\n textDecoration: \"underline\",\n },\n },\n underline: {\n textDecoration: \"underline\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n variants: {\n variant: variants ,\n },\n defaultVariants: {\n variant: \"underline\",\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe } from \"@chakra-ui/react\";\n\nexport const SpinnerStyles = defineRecipe({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\",\n },\n});\n","const container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" }, // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" },\n};\n\nexport const sizes = {\n container,\n};\n","import { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { Alert } from \"./Alert\";\n\ninterface Props {\n boundaryName?: string;\n children: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\nconst StyledPre = (props: BoxProps) => (\n <Box as=\"pre\" paddingTop=\"0.5rem\" wordBreak=\"break-all\" whiteSpace=\"pre-wrap\" fontSize=\"0.8rem\" {...props} />\n);\n\nexport class ErrorBoundary extends React.Component<Props, State> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n\n return (\n <div>\n <Alert status=\"error\">\n <p>Beklager, det skjedde en teknisk feil.</p>\n {isDevelopment() && (stackTrace || errormsg) && (\n <div>\n <StyledPre>{errormsg || \"\"}</StyledPre>\n <StyledPre>{info || \"\"}</StyledPre>\n <StyledPre>{stackTrace || \"\"}</StyledPre>\n </div>\n )}\n </Alert>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n","import { Box } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { focusStyle } from \"../styles/chakraTheme/biblioteksentralenChakraTheme\";\n\ninterface Props {\n id: string;\n /**\n * angir hvor mye luft til vil ha over HashLinkTarget ved bruk av hash-lenke, eks '4rem'\n */\n spaceAbove?: string;\n /**\n * angir om du vil ha fokusramme rundt komponenten som mounter HashLinkTarget. Da må komponenten du wrapper med ha position: relative | absolute el\n */\n focusOnParent?: boolean;\n}\n\nconst focusOnRelativeParentStyle = {\n _focusWithin: {\n position: \"static\",\n boxShadow: \"none\",\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n left: 0,\n height: \"100%\",\n width: \"100%\",\n pointerEvents: \"none\",\n borderRadius: \"0.25rem\",\n ...focusStyle,\n },\n },\n};\n\n/*\n * Komponent som sørger for luft over anchors (elementer man kan lenke til med hash-lenker feks <a href=\"#min-overskrift\">Ta meg til overskrift</a>)\n */\nexport function HashLinkTarget(props: Props) {\n return (\n <Box position=\"relative\" css={props.focusOnParent ? focusOnRelativeParentStyle : undefined}>\n <Box\n id={props.id}\n tabIndex={props.focusOnParent ? -1 : undefined}\n position=\"absolute\"\n top={`-${props.spaceAbove || \"2.5rem\"}`}\n _focus={{\n boxShadow: \"none !important\",\n }}\n />\n </Box>\n );\n}\n","import React from \"react\";\nimport { ErrorBoundary } from \"./ErrorBoundary\";\n\nexport const withErrorBoundary = <Props,>(Component: React.ComponentType<Props>, boundaryName: string) => {\n return (props: Props & React.JSX.IntrinsicAttributes) => (\n <ErrorBoundary boundaryName={boundaryName}>\n <Component {...props} />\n </ErrorBoundary>\n );\n};\n","\"use client\";\n\nimport {\n Toaster as ChakraToaster,\n Portal,\n Spinner,\n Stack,\n Toast,\n ToastRootProps,\n createToaster,\n} from \"@chakra-ui/react\";\nimport React from \"react\";\n\nexport const toaster: ToastRootProps = createToaster({\n pauseOnPageIdle: true,\n offsets: { left: \"50%\", top: \"50%\", right: \"50%\", bottom: \"50%\" },\n});\n\nexport const Toaster = () => {\n return (\n <Portal>\n <ChakraToaster toaster={toaster} insetInline={{ mdDown: \"4\" }}>\n {(toast: ToastRootProps) => {\n if (typeof toast.render === \"function\") {\n return <>{toast.render()}</>;\n }\n return (\n <Toast.Root width={{ md: \"sm\" }}>\n {toast.type === \"loading\" ? <Spinner size=\"sm\" color=\"blue.solid\" /> : <Toast.Indicator />}\n <Stack gap=\"1\" flex=\"1\" maxWidth=\"100%\">\n {toast.title && <Toast.Title>{toast.title}</Toast.Title>}\n {toast.description && <Toast.Description>{toast.description}</Toast.Description>}\n </Stack>\n {toast.action && <Toast.ActionTrigger>{toast.action.label}</Toast.ActionTrigger>}\n {toast.closable && <Toast.CloseTrigger />}\n </Toast.Root>\n );\n }}\n </ChakraToaster>\n </Portal>\n );\n};\n"],"mappings":";AAAA,cAAc;;;AEAd,SAAS,cAAc;AACvB,SAAS,UAAU;ADDZ,IAAM,SAAS;EACpB,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,gBAAW;EACX,kBAAa;EACb,cAAc;EACd,aAAa;EACb,aAAa;EACb,gBAAgB;EAChB,kBAAkB;EAClB,cAAc;EACd,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,WAAW;EACX,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,mBAAmB;EACnB,SAAS;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP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M,SAAS,gBAAAA,QAAA,cAAC,MAAM,OAAN,MAAa,MAAM,KAAM,GACzC,MAAM,eAAe,gBAAAA,QAAA,cAAC,MAAM,aAAN,MAAmB,MAAM,WAAY,CAC9D,GACC,MAAM,UAAU,gBAAAA,QAAA,cAAC,MAAM,eAAN,MAAqB,MAAM,OAAO,KAAM,GACzD,MAAM,YAAY,gBAAAA,QAAA,cAAC,MAAM,cAAN,IAAmB,CACzC;AAAA,EAEJ,CACF,CACF;AAEJ;","names":["colors","React","React","React","React","React","React","React","defineRecipe","defineRecipe","defineRecipe","variants","defineRecipe","variants","defineRecipe","React","Box","React","React","Box","Box","React","React","Box","React","React","React"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biblioteksentralen/react",
3
- "version": "3.0.0-beta.5",
3
+ "version": "3.0.0-beta.7",
4
4
  "description": "React library for reusable code in Biblioteksentralens js-apps",
5
5
  "keywords": [],
6
6
  "author": "Biblioteksentralen",