@biblioteksentralen/react 3.0.0-beta.8 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,4 @@
1
1
  "use strict";
2
- function _array_like_to_array(arr, len) {
3
- if (len == null || len > arr.length) len = arr.length;
4
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5
- return arr2;
6
- }
7
- function _array_with_holes(arr) {
8
- if (Array.isArray(arr)) return arr;
9
- }
10
2
  function _assert_this_initialized(self) {
11
3
  if (self === void 0) {
12
4
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -64,33 +56,6 @@ function _inherits(subClass, superClass) {
64
56
  });
65
57
  if (superClass) _set_prototype_of(subClass, superClass);
66
58
  }
67
- function _iterable_to_array_limit(arr, i) {
68
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
69
- if (_i == null) return;
70
- var _arr = [];
71
- var _n = true;
72
- var _d = false;
73
- var _s, _e;
74
- try {
75
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
76
- _arr.push(_s.value);
77
- if (i && _arr.length === i) break;
78
- }
79
- } catch (err) {
80
- _d = true;
81
- _e = err;
82
- } finally{
83
- try {
84
- if (!_n && _i["return"] != null) _i["return"]();
85
- } finally{
86
- if (_d) throw _e;
87
- }
88
- }
89
- return _arr;
90
- }
91
- function _non_iterable_rest() {
92
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
93
- }
94
59
  function _object_spread(target) {
95
60
  for(var i = 1; i < arguments.length; i++){
96
61
  var source = arguments[i] != null ? arguments[i] : {};
@@ -106,30 +71,6 @@ function _object_spread(target) {
106
71
  }
107
72
  return target;
108
73
  }
109
- function ownKeys(object, enumerableOnly) {
110
- var keys = Object.keys(object);
111
- if (Object.getOwnPropertySymbols) {
112
- var symbols = Object.getOwnPropertySymbols(object);
113
- if (enumerableOnly) {
114
- symbols = symbols.filter(function(sym) {
115
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
116
- });
117
- }
118
- keys.push.apply(keys, symbols);
119
- }
120
- return keys;
121
- }
122
- function _object_spread_props(target, source) {
123
- source = source != null ? source : {};
124
- if (Object.getOwnPropertyDescriptors) {
125
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
126
- } else {
127
- ownKeys(Object(source)).forEach(function(key) {
128
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
129
- });
130
- }
131
- return target;
132
- }
133
74
  function _object_without_properties(source, excluded) {
134
75
  if (source == null) return {};
135
76
  var target = _object_without_properties_loose(source, excluded);
@@ -170,21 +111,10 @@ function _set_prototype_of(o, p) {
170
111
  };
171
112
  return _set_prototype_of(o, p);
172
113
  }
173
- function _sliced_to_array(arr, i) {
174
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
175
- }
176
114
  function _type_of(obj) {
177
115
  "@swc/helpers - typeof";
178
116
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
179
117
  }
180
- function _unsupported_iterable_to_array(o, minLen) {
181
- if (!o) return;
182
- if (typeof o === "string") return _array_like_to_array(o, minLen);
183
- var n = Object.prototype.toString.call(o).slice(8, -1);
184
- if (n === "Object" && o.constructor) n = o.constructor.name;
185
- if (n === "Map" || n === "Set") return Array.from(n);
186
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
187
- }
188
118
  function _is_native_reflect_construct() {
189
119
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
190
120
  if (Reflect.construct.sham) return false;
@@ -209,6 +139,7 @@ function _create_super(Derived) {
209
139
  return _possible_constructor_return(this, result);
210
140
  };
211
141
  }
142
+ var _import_react10_defaultConfig_theme_recipes_button_variants, _import_react10_defaultConfig_theme_recipes_button, _import_react10_defaultConfig_theme_recipes, _import_react10_defaultConfig_theme;
212
143
  var __create = Object.create;
213
144
  var __defProp = Object.defineProperty;
214
145
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -273,50 +204,35 @@ var __toCommonJS = function(mod) {
273
204
  // src/index.ts
274
205
  var src_exports = {};
275
206
  __export(src_exports, {
276
- Alert: function() {
277
- return Alert;
207
+ AlertBS: function() {
208
+ return AlertBS;
278
209
  },
279
210
  BiblioteksentralenProvider: function() {
280
211
  return BiblioteksentralenProvider;
281
212
  },
282
- Button: function() {
283
- return Button;
284
- },
285
- ConditionalWrapper: function() {
286
- return ConditionalWrapper;
287
- },
288
- ErrorBoundary: function() {
289
- return ErrorBoundary;
290
- },
291
- HashLinkTarget: function() {
292
- return HashLinkTarget;
213
+ ButtonBS: function() {
214
+ return ButtonBS;
293
215
  },
294
- HideWithCSS: function() {
295
- return HideWithCSS;
216
+ ConditionalWrapperBS: function() {
217
+ return ConditionalWrapperBS;
296
218
  },
297
- IconButton: function() {
298
- return IconButton;
219
+ ErrorBoundaryBS: function() {
220
+ return ErrorBoundaryBS;
299
221
  },
300
- Input: function() {
301
- return Input;
222
+ HashLinkTargetBS: function() {
223
+ return HashLinkTargetBS;
302
224
  },
303
- Link: function() {
304
- return Link;
225
+ IconButtonBS: function() {
226
+ return IconButtonBS;
305
227
  },
306
- Toaster: function() {
307
- return Toaster;
308
- },
309
- VisuallyHidden: function() {
310
- return VisuallyHidden;
228
+ InputBS: function() {
229
+ return InputBS;
311
230
  },
312
231
  colors: function() {
313
232
  return colors;
314
233
  },
315
- toaster: function() {
316
- return toaster;
317
- },
318
- withErrorBoundary: function() {
319
- return withErrorBoundary;
234
+ withErrorBoundaryBS: function() {
235
+ return withErrorBoundaryBS;
320
236
  }
321
237
  });
322
238
  module.exports = __toCommonJS(src_exports);
@@ -368,7 +284,7 @@ var colors = {
368
284
  function isDevelopment() {
369
285
  return process.env.NODE_ENV === "development";
370
286
  }
371
- // src/components/Alert.tsx
287
+ // src/components/AlertBS.tsx
372
288
  var import_react = require("@chakra-ui/react");
373
289
  var import_react2 = __toESM(require("react"));
374
290
  var import_react_feather = require("react-feather");
@@ -419,7 +335,7 @@ var variantStyles = {
419
335
  padding: "0"
420
336
  }
421
337
  };
422
- function Alert(_param) {
338
+ function AlertBS(_param) {
423
339
  var status = _param.status, children = _param.children, variant = _param.variant, header = _param.header, rest = _object_without_properties(_param, [
424
340
  "status",
425
341
  "children",
@@ -441,71 +357,16 @@ function Alert(_param) {
441
357
  color: "black"
442
358
  }, header && /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Title, null, header), /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Description, null, children)));
443
359
  }
444
- // src/components/Button.tsx
360
+ // src/components/ButtonBS.tsx
445
361
  var import_react3 = require("@chakra-ui/react");
446
- var Button = import_react3.Button;
447
- // src/components/IconButton.tsx
362
+ var ButtonBS = import_react3.Button;
363
+ // src/components/IconButtonBS.tsx
448
364
  var import_react4 = require("@chakra-ui/react");
449
- var IconButton = import_react4.IconButton;
450
- // src/components/ConditionalWrapper.tsx
451
- var import_react5 = __toESM(require("react"));
452
- var ConditionalWrapper = function(param) {
453
- var condition = param.condition, children = param.children, Wrapper = param.wrapper;
454
- return condition ? /* @__PURE__ */ import_react5.default.createElement(Wrapper, null, children) : /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, children);
455
- };
456
- // src/components/HideWithCSS.tsx
457
- var import_react6 = require("@chakra-ui/react");
458
- var import_react7 = __toESM(require("react"));
459
- var HideWithCSS = function(_param) {
460
- var children = _param.children, above = _param.above, below = _param.below, chakraProps = _object_without_properties(_param, [
461
- "children",
462
- "above",
463
- "below"
464
- ]);
465
- var display = _object_spread({}, !!below ? _define_property({
466
- base: "none"
467
- }, below, "block") : {}, !!above ? _define_property({}, above, "none") : {});
468
- return /* @__PURE__ */ import_react7.default.createElement(import_react6.Box, _object_spread_props(_object_spread({}, chakraProps), {
469
- display: display
470
- }), children);
471
- };
472
- // src/components/Input.tsx
473
- var import_react10 = require("@chakra-ui/react");
474
- var import_react11 = __toESM(require("react"));
475
- // src/components/VisuallyHidden.tsx
476
- var import_react8 = __toESM(require("react"));
477
- var import_react9 = require("@chakra-ui/react");
478
- function VisuallyHidden(_param) {
479
- var children = _param.children, rest = _object_without_properties(_param, [
480
- "children"
481
- ]);
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() {
484
- if (isDevelopment()) {
485
- var handleKeyDown = function(ev) {
486
- if (ev.key === "Alt") {
487
- setForceShow(true);
488
- }
489
- };
490
- var handleKeyUp = function(ev) {
491
- if (ev.key === "Alt") {
492
- setForceShow(false);
493
- }
494
- };
495
- window.addEventListener("keydown", handleKeyDown);
496
- window.addEventListener("keyup", handleKeyUp);
497
- return function() {
498
- window.removeEventListener("keydown", handleKeyDown);
499
- window.removeEventListener("keyup", handleKeyUp);
500
- };
501
- }
502
- }, []);
503
- return forceShow ? /* @__PURE__ */ import_react8.default.createElement("span", null, children) : /* @__PURE__ */ import_react8.default.createElement(import_react9.VisuallyHidden, {
504
- position: "fixed"
505
- }, children);
506
- }
507
- // src/components/Input.tsx
508
- var Input = function(props) {
365
+ var IconButtonBS = import_react4.IconButton;
366
+ // src/components/InputBS.tsx
367
+ var import_react5 = require("@chakra-ui/react");
368
+ var import_react6 = __toESM(require("react"));
369
+ var InputBS = function(props) {
509
370
  var labelProps = props.labelProps, label = props.label, helperText = props.helperText, errorMessage = props.errorMessage, hideLabel = props.hideLabel, inputProps = _object_without_properties(props, [
510
371
  "labelProps",
511
372
  "label",
@@ -513,22 +374,91 @@ var Input = function(props) {
513
374
  "errorMessage",
514
375
  "hideLabel"
515
376
  ]);
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, {
377
+ var formLabel = /* @__PURE__ */ import_react6.default.createElement(import_react5.Field.Label, _object_spread({}, labelProps), label);
378
+ return /* @__PURE__ */ import_react6.default.createElement(import_react5.Field.Root, {
518
379
  invalid: !!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));
380
+ }, hideLabel ? /* @__PURE__ */ import_react6.default.createElement(import_react5.VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ import_react6.default.createElement(import_react5.Field.HelperText, null, helperText), /* @__PURE__ */ import_react6.default.createElement(import_react5.Input, _object_spread({}, inputProps)), errorMessage && /* @__PURE__ */ import_react6.default.createElement(import_react5.Field.ErrorText, null, errorMessage));
520
381
  };
521
- // src/components/Link.tsx
522
- var import_react12 = require("@chakra-ui/react");
523
- var Link = import_react12.Link;
524
- // src/BiblioteksentralenProvider.tsx
525
- var import_react20 = __toESM(require("react"));
526
- var import_react21 = require("@chakra-ui/react");
382
+ // src/components/ConditionalWrapperBS.tsx
383
+ var import_react7 = __toESM(require("react"));
384
+ var ConditionalWrapperBS = function(param) {
385
+ var condition = param.condition, children = param.children, Wrapper = param.wrapper;
386
+ return condition ? /* @__PURE__ */ import_react7.default.createElement(Wrapper, null, children) : /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, children);
387
+ };
388
+ // src/components/ErrorBoundaryBS.tsx
389
+ var import_react8 = require("@chakra-ui/react");
390
+ var import_react9 = __toESM(require("react"));
391
+ var StyledPre = function(props) {
392
+ return /* @__PURE__ */ import_react9.default.createElement(import_react8.Box, _object_spread({
393
+ as: "pre",
394
+ paddingTop: "0.5rem",
395
+ wordBreak: "break-all",
396
+ whiteSpace: "pre-wrap",
397
+ fontSize: "0.8rem"
398
+ }, props));
399
+ };
400
+ var ErrorBoundaryBS = /*#__PURE__*/ function(_import_react9_default_Component) {
401
+ _inherits(ErrorBoundaryBS, _import_react9_default_Component);
402
+ var _super = _create_super(ErrorBoundaryBS);
403
+ function ErrorBoundaryBS(props) {
404
+ _class_call_check(this, ErrorBoundaryBS);
405
+ var _this;
406
+ _this = _super.call(this, props);
407
+ _this.state = {
408
+ hasError: false
409
+ };
410
+ return _this;
411
+ }
412
+ _create_class(ErrorBoundaryBS, [
413
+ {
414
+ key: "componentDidCatch",
415
+ value: function componentDidCatch(error, errorInfo) {
416
+ this.setState({
417
+ hasError: true,
418
+ error: error,
419
+ errorInfo: errorInfo
420
+ });
421
+ console.error(error, {
422
+ errorInfo: errorInfo,
423
+ boundaryName: this.props.boundaryName
424
+ });
425
+ }
426
+ },
427
+ {
428
+ key: "render",
429
+ value: function render() {
430
+ if (this.state.hasError) {
431
+ var _this_state_errorInfo, _this_state_error;
432
+ var stackTrace = (_this_state_errorInfo = this.state.errorInfo) === null || _this_state_errorInfo === void 0 ? void 0 : _this_state_errorInfo.componentStack;
433
+ var errormsg = (_this_state_error = this.state.error) === null || _this_state_error === void 0 ? void 0 : _this_state_error.message;
434
+ var info = this.props.boundaryName;
435
+ return /* @__PURE__ */ import_react9.default.createElement("div", null, /* @__PURE__ */ import_react9.default.createElement(AlertBS, {
436
+ status: "error"
437
+ }, /* @__PURE__ */ import_react9.default.createElement("p", null, "Beklager, det skjedde en teknisk feil."), isDevelopment() && (stackTrace || errormsg) && /* @__PURE__ */ import_react9.default.createElement("div", null, /* @__PURE__ */ import_react9.default.createElement(StyledPre, null, errormsg || ""), /* @__PURE__ */ import_react9.default.createElement(StyledPre, null, info || ""), /* @__PURE__ */ import_react9.default.createElement(StyledPre, null, stackTrace || ""))));
438
+ }
439
+ return this.props.children;
440
+ }
441
+ }
442
+ ], [
443
+ {
444
+ key: "getDerivedStateFromError",
445
+ value: function getDerivedStateFromError(error) {
446
+ return {
447
+ hasError: true
448
+ };
449
+ }
450
+ }
451
+ ]);
452
+ return ErrorBoundaryBS;
453
+ }(import_react9.default.Component);
454
+ // src/components/HashLinkTargetBS.tsx
455
+ var import_react17 = require("@chakra-ui/react");
456
+ var import_react18 = __toESM(require("react"));
527
457
  // src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
528
- var import_react19 = require("@chakra-ui/react");
458
+ var import_react16 = require("@chakra-ui/react");
529
459
  // src/styles/chakraTheme/ButtonStyles.ts
530
- var import_react13 = require("@chakra-ui/react");
531
- var variants = {
460
+ var import_react10 = require("@chakra-ui/react");
461
+ var variants = _object_spread({
532
462
  primary: {
533
463
  backgroundColor: colors.black,
534
464
  color: "white",
@@ -538,26 +468,25 @@ var variants = {
538
468
  }
539
469
  },
540
470
  secondary: {
541
- borderColor: "currentColor !important",
542
- backgroundColor: "transparent",
471
+ borderColor: "currentColor",
543
472
  color: "currentColor",
473
+ backgroundColor: "transparent",
544
474
  _hover: {
545
- backgroundColor: "hsla(0deg, 0%, 50%, 0.15)"
475
+ backgroundColor: "currentColor/7"
546
476
  }
547
477
  },
548
478
  tertiary: {
549
- backgroundColor: "transparent",
550
479
  color: "currentColor",
480
+ backgroundColor: "transparent",
551
481
  _hover: {
552
- backgroundColor: "hsla(0deg, 0%, 50%, 0.15)",
553
- color: "currentColor"
482
+ backgroundColor: "currentColor/7"
554
483
  }
555
484
  }
556
- };
557
- var ButtonStyles = (0, import_react13.defineRecipe)({
485
+ }, (_import_react10_defaultConfig_theme = import_react10.defaultConfig.theme) === null || _import_react10_defaultConfig_theme === void 0 ? void 0 : (_import_react10_defaultConfig_theme_recipes = _import_react10_defaultConfig_theme.recipes) === null || _import_react10_defaultConfig_theme_recipes === void 0 ? void 0 : (_import_react10_defaultConfig_theme_recipes_button = _import_react10_defaultConfig_theme_recipes.button) === null || _import_react10_defaultConfig_theme_recipes_button === void 0 ? void 0 : (_import_react10_defaultConfig_theme_recipes_button_variants = _import_react10_defaultConfig_theme_recipes_button.variants) === null || _import_react10_defaultConfig_theme_recipes_button_variants === void 0 ? void 0 : _import_react10_defaultConfig_theme_recipes_button_variants.variant);
486
+ var ButtonStyles = (0, import_react10.defineRecipe)({
558
487
  base: {
559
- border: "transparent 0.1em solid",
560
- borderRadius: "0.35em",
488
+ borderColor: "transparent",
489
+ borderWidth: "0.1em",
561
490
  fontWeight: 600,
562
491
  _disabled: {
563
492
  backgroundColor: "".concat(colors.grey45),
@@ -588,21 +517,21 @@ var ButtonStyles = (0, import_react13.defineRecipe)({
588
517
  }
589
518
  });
590
519
  // src/styles/chakraTheme/ContainerStyles.ts
591
- var import_react14 = require("@chakra-ui/react");
592
- var ContainerStyles = (0, import_react14.defineRecipe)({
520
+ var import_react11 = require("@chakra-ui/react");
521
+ var ContainerStyles = (0, import_react11.defineRecipe)({
593
522
  base: {
594
523
  px: ".75rem"
595
524
  }
596
525
  });
597
526
  // src/styles/chakraTheme/HeadingStyles.ts
598
- var import_react15 = require("@chakra-ui/react");
599
- var HeadingStyles = (0, import_react15.defineRecipe)({
527
+ var import_react12 = require("@chakra-ui/react");
528
+ var HeadingStyles = (0, import_react12.defineRecipe)({
600
529
  base: {
601
530
  fontWeight: "600"
602
531
  }
603
532
  });
604
533
  // src/styles/chakraTheme/InputStyles.ts
605
- var import_react16 = require("@chakra-ui/react");
534
+ var import_react13 = require("@chakra-ui/react");
606
535
  var variants2 = {
607
536
  subtle: {
608
537
  backgroundColor: {
@@ -641,7 +570,7 @@ var variants2 = {
641
570
  }
642
571
  }
643
572
  };
644
- var InputStyles = (0, import_react16.defineRecipe)({
573
+ var InputStyles = (0, import_react13.defineRecipe)({
645
574
  base: {
646
575
  _placeholder: {
647
576
  color: {
@@ -657,33 +586,9 @@ var InputStyles = (0, import_react16.defineRecipe)({
657
586
  variant: "subtle"
658
587
  }
659
588
  });
660
- // src/styles/chakraTheme/LinkStyles.ts
661
- var import_react17 = require("@chakra-ui/react");
662
- var variants3 = {
663
- plain: {
664
- textDecoration: "none",
665
- _hover: {
666
- textDecoration: "underline"
667
- }
668
- },
669
- underline: {
670
- textDecoration: "underline",
671
- _hover: {
672
- textDecoration: "none"
673
- }
674
- }
675
- };
676
- var LinkStyles = (0, import_react17.defineRecipe)({
677
- variants: {
678
- variant: variants3
679
- },
680
- defaultVariants: {
681
- variant: "underline"
682
- }
683
- });
684
589
  // src/styles/chakraTheme/SpinnerStyles.ts
685
- var import_react18 = require("@chakra-ui/react");
686
- var SpinnerStyles = (0, import_react18.defineRecipe)({
590
+ var import_react14 = require("@chakra-ui/react");
591
+ var SpinnerStyles = (0, import_react14.defineRecipe)({
687
592
  base: {
688
593
  animationDuration: ".8s",
689
594
  color: colors.accentBlueMedium,
@@ -710,8 +615,41 @@ var container = {
710
615
  var sizes = {
711
616
  container: container
712
617
  };
618
+ // src/styles/chakraTheme/LinkStyles.ts
619
+ var import_react15 = require("@chakra-ui/react");
620
+ var variants3 = {
621
+ plain: {
622
+ color: "currentColor",
623
+ textDecoration: "none",
624
+ textDecorationColor: "currentColor/30",
625
+ _hover: {
626
+ textDecoration: "underline"
627
+ }
628
+ },
629
+ underline: {
630
+ color: "currentColor",
631
+ textDecoration: "underline",
632
+ textDecorationColor: "currentColor/30",
633
+ _hover: {
634
+ textDecoration: "none"
635
+ }
636
+ }
637
+ };
638
+ var LinkStyles = (0, import_react15.defineRecipe)({
639
+ base: {
640
+ _focus: {
641
+ outline: "none"
642
+ }
643
+ },
644
+ variants: {
645
+ variant: variants3
646
+ },
647
+ defaultVariants: {
648
+ variant: "underline"
649
+ }
650
+ });
713
651
  // src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
714
- var tokens = (0, import_react19.defineTokens)({
652
+ var tokens = (0, import_react16.defineTokens)({
715
653
  sizes: sizes
716
654
  });
717
655
  var globalHyphens = {
@@ -720,10 +658,10 @@ var globalHyphens = {
720
658
  };
721
659
  var focusStyle = {
722
660
  outline: "none !important",
723
- boxShadow: "0 0 0 .1rem white, 0 0 0 .2rem black, 0 0 0 .3rem white !important",
661
+ boxShadow: "0 0 0 .05rem ".concat(colors.white, ", 0 0 0 .25rem var(--bs-focus-ring-color, ").concat(colors.accentBlueMedium, "), 0 0 0 .3rem ").concat(colors.white, " !important"),
724
662
  transition: "box-shadow 0.1s ease-out"
725
663
  };
726
- var biblioteksentralenChakraTheme = (0, import_react19.defineConfig)({
664
+ var biblioteksentralenChakraTheme = (0, import_react16.defineConfig)({
727
665
  theme: {
728
666
  tokens: tokens,
729
667
  recipes: {
@@ -752,82 +690,7 @@ var biblioteksentralenChakraTheme = (0, import_react19.defineConfig)({
752
690
  "*:focus-visible": focusStyle
753
691
  }
754
692
  });
755
- // src/BiblioteksentralenProvider.tsx
756
- var import_system = require("@chakra-ui/system");
757
- var BiblioteksentralenProvider = function(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)));
761
- };
762
- // src/components/ErrorBoundary.tsx
763
- var import_react22 = require("@chakra-ui/react");
764
- var import_react23 = __toESM(require("react"));
765
- var StyledPre = function(props) {
766
- return /* @__PURE__ */ import_react23.default.createElement(import_react22.Box, _object_spread({
767
- as: "pre",
768
- paddingTop: "0.5rem",
769
- wordBreak: "break-all",
770
- whiteSpace: "pre-wrap",
771
- fontSize: "0.8rem"
772
- }, props));
773
- };
774
- var ErrorBoundary = /*#__PURE__*/ function(_import_react23_default_Component) {
775
- _inherits(ErrorBoundary, _import_react23_default_Component);
776
- var _super = _create_super(ErrorBoundary);
777
- function ErrorBoundary(props) {
778
- _class_call_check(this, ErrorBoundary);
779
- var _this;
780
- _this = _super.call(this, props);
781
- _this.state = {
782
- hasError: false
783
- };
784
- return _this;
785
- }
786
- _create_class(ErrorBoundary, [
787
- {
788
- key: "componentDidCatch",
789
- value: function componentDidCatch(error, errorInfo) {
790
- this.setState({
791
- hasError: true,
792
- error: error,
793
- errorInfo: errorInfo
794
- });
795
- console.error(error, {
796
- errorInfo: errorInfo,
797
- boundaryName: this.props.boundaryName
798
- });
799
- }
800
- },
801
- {
802
- key: "render",
803
- value: function render() {
804
- if (this.state.hasError) {
805
- var _this_state_errorInfo, _this_state_error;
806
- var stackTrace = (_this_state_errorInfo = this.state.errorInfo) === null || _this_state_errorInfo === void 0 ? void 0 : _this_state_errorInfo.componentStack;
807
- var errormsg = (_this_state_error = this.state.error) === null || _this_state_error === void 0 ? void 0 : _this_state_error.message;
808
- var info = this.props.boundaryName;
809
- return /* @__PURE__ */ import_react23.default.createElement("div", null, /* @__PURE__ */ import_react23.default.createElement(Alert, {
810
- status: "error"
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 || ""))));
812
- }
813
- return this.props.children;
814
- }
815
- }
816
- ], [
817
- {
818
- key: "getDerivedStateFromError",
819
- value: function getDerivedStateFromError(error) {
820
- return {
821
- hasError: true
822
- };
823
- }
824
- }
825
- ]);
826
- return ErrorBoundary;
827
- }(import_react23.default.Component);
828
- // src/components/HashLinkTarget.tsx
829
- var import_react24 = require("@chakra-ui/react");
830
- var import_react25 = __toESM(require("react"));
693
+ // src/components/HashLinkTargetBS.tsx
831
694
  var focusOnRelativeParentStyle = {
832
695
  _focusWithin: {
833
696
  position: "static",
@@ -844,11 +707,11 @@ var focusOnRelativeParentStyle = {
844
707
  }, focusStyle)
845
708
  }
846
709
  };
847
- function HashLinkTarget(props) {
848
- return /* @__PURE__ */ import_react25.default.createElement(import_react24.Box, {
710
+ function HashLinkTargetBS(props) {
711
+ return /* @__PURE__ */ import_react18.default.createElement(import_react17.Box, {
849
712
  position: "relative",
850
713
  css: props.focusOnParent ? focusOnRelativeParentStyle : void 0
851
- }, /* @__PURE__ */ import_react25.default.createElement(import_react24.Box, {
714
+ }, /* @__PURE__ */ import_react18.default.createElement(import_react17.Box, {
852
715
  id: props.id,
853
716
  tabIndex: props.focusOnParent ? -1 : void 0,
854
717
  position: "absolute",
@@ -858,67 +721,35 @@ function HashLinkTarget(props) {
858
721
  }
859
722
  }));
860
723
  }
861
- // src/components/withErrorBoundary.tsx
862
- var import_react26 = __toESM(require("react"));
863
- var withErrorBoundary = function(Component, boundaryName) {
724
+ // src/components/withErrorBoundaryBS.tsx
725
+ var import_react19 = __toESM(require("react"));
726
+ var withErrorBoundaryBS = function(Component, boundaryName) {
864
727
  return function(props) {
865
- return /* @__PURE__ */ import_react26.default.createElement(ErrorBoundary, {
728
+ return /* @__PURE__ */ import_react19.default.createElement(ErrorBoundaryBS, {
866
729
  boundaryName: boundaryName
867
- }, /* @__PURE__ */ import_react26.default.createElement(Component, _object_spread({}, props)));
730
+ }, /* @__PURE__ */ import_react19.default.createElement(Component, _object_spread({}, props)));
868
731
  };
869
732
  };
870
- // src/components/ui/toaster.tsx
871
- var import_react27 = require("@chakra-ui/react");
872
- var import_react28 = __toESM(require("react"));
873
- var toaster = (0, import_react27.createToaster)({
874
- pauseOnPageIdle: true,
875
- offsets: {
876
- left: "50%",
877
- top: "50%",
878
- right: "50%",
879
- bottom: "50%"
880
- }
881
- });
882
- var Toaster = function() {
883
- return /* @__PURE__ */ import_react28.default.createElement(import_react27.Portal, null, /* @__PURE__ */ import_react28.default.createElement(import_react27.Toaster, {
884
- toaster: toaster,
885
- insetInline: {
886
- mdDown: "4"
887
- }
888
- }, function(toast) {
889
- if (typeof toast.render === "function") {
890
- return /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, toast.render());
891
- }
892
- return /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Root, {
893
- width: {
894
- md: "sm"
895
- }
896
- }, toast.type === "loading" ? /* @__PURE__ */ import_react28.default.createElement(import_react27.Spinner, {
897
- size: "sm",
898
- color: "blue.solid"
899
- }) : /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Indicator, null), /* @__PURE__ */ import_react28.default.createElement(import_react27.Stack, {
900
- gap: "1",
901
- flex: "1",
902
- maxWidth: "100%"
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));
904
- }));
733
+ // src/BiblioteksentralenProvider.tsx
734
+ var import_react20 = __toESM(require("react"));
735
+ var import_react21 = require("@chakra-ui/react");
736
+ var import_system = require("@chakra-ui/system");
737
+ var BiblioteksentralenProvider = function(props) {
738
+ return /* @__PURE__ */ import_react20.default.createElement(import_react21.ChakraProvider, {
739
+ value: (0, import_react21.createSystem)(import_react21.defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})
740
+ }, /* @__PURE__ */ import_react20.default.createElement(import_system.ColorModeProvider, _object_spread({}, props)));
905
741
  };
906
742
  // Annotate the CommonJS export names for ESM import in node:
907
743
  0 && (module.exports = _object_spread({
908
- Alert: Alert,
744
+ AlertBS: AlertBS,
909
745
  BiblioteksentralenProvider: BiblioteksentralenProvider,
910
- Button: Button,
911
- ConditionalWrapper: ConditionalWrapper,
912
- ErrorBoundary: ErrorBoundary,
913
- HashLinkTarget: HashLinkTarget,
914
- HideWithCSS: HideWithCSS,
915
- IconButton: IconButton,
916
- Input: Input,
917
- Link: Link,
918
- Toaster: Toaster,
919
- VisuallyHidden: VisuallyHidden,
746
+ ButtonBS: ButtonBS,
747
+ ConditionalWrapperBS: ConditionalWrapperBS,
748
+ ErrorBoundaryBS: ErrorBoundaryBS,
749
+ HashLinkTargetBS: HashLinkTargetBS,
750
+ IconButtonBS: IconButtonBS,
751
+ InputBS: InputBS,
920
752
  colors: colors,
921
- toaster: toaster,
922
- withErrorBoundary: withErrorBoundary
753
+ withErrorBoundaryBS: withErrorBoundaryBS
923
754
  }, require("@chakra-ui/react")));
924
755
  //# sourceMappingURL=index.js.map