@biblioteksentralen/react 3.0.0-beta.12 → 3.0.0-beta.13
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 +32 -56
- package/dist/index.js +157 -291
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +89 -137
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
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,7 +139,7 @@ function _create_super(Derived) {
|
|
|
209
139
|
return _possible_constructor_return(this, result);
|
|
210
140
|
};
|
|
211
141
|
}
|
|
212
|
-
var
|
|
142
|
+
var _import_react10_defaultConfig_theme_recipes_button_variants, _import_react10_defaultConfig_theme_recipes_button, _import_react10_defaultConfig_theme_recipes, _import_react10_defaultConfig_theme;
|
|
213
143
|
var __create = Object.create;
|
|
214
144
|
var __defProp = Object.defineProperty;
|
|
215
145
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -275,43 +205,34 @@ var __toCommonJS = function(mod) {
|
|
|
275
205
|
var src_exports = {};
|
|
276
206
|
__export(src_exports, {
|
|
277
207
|
AlertBS: function() {
|
|
278
|
-
return
|
|
208
|
+
return AlertBS;
|
|
279
209
|
},
|
|
280
210
|
BiblioteksentralenProvider: function() {
|
|
281
211
|
return BiblioteksentralenProvider;
|
|
282
212
|
},
|
|
283
213
|
ButtonBS: function() {
|
|
284
|
-
return
|
|
214
|
+
return ButtonBS;
|
|
285
215
|
},
|
|
286
216
|
ConditionalWrapperBS: function() {
|
|
287
|
-
return
|
|
217
|
+
return ConditionalWrapperBS;
|
|
288
218
|
},
|
|
289
219
|
ErrorBoundaryBS: function() {
|
|
290
|
-
return
|
|
220
|
+
return ErrorBoundaryBS;
|
|
291
221
|
},
|
|
292
222
|
HashLinkTargetBS: function() {
|
|
293
|
-
return
|
|
294
|
-
},
|
|
295
|
-
HideWithCSSBS: function() {
|
|
296
|
-
return HideWithCSS;
|
|
223
|
+
return HashLinkTargetBS;
|
|
297
224
|
},
|
|
298
225
|
IconButtonBS: function() {
|
|
299
|
-
return
|
|
226
|
+
return IconButtonBS;
|
|
300
227
|
},
|
|
301
228
|
InputBS: function() {
|
|
302
|
-
return
|
|
303
|
-
},
|
|
304
|
-
LinkBS: function() {
|
|
305
|
-
return Link;
|
|
306
|
-
},
|
|
307
|
-
VisuallyHiddenBS: function() {
|
|
308
|
-
return VisuallyHidden;
|
|
229
|
+
return InputBS;
|
|
309
230
|
},
|
|
310
231
|
colors: function() {
|
|
311
232
|
return colors;
|
|
312
233
|
},
|
|
313
234
|
withErrorBoundaryBS: function() {
|
|
314
|
-
return
|
|
235
|
+
return withErrorBoundaryBS;
|
|
315
236
|
}
|
|
316
237
|
});
|
|
317
238
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -363,7 +284,7 @@ var colors = {
|
|
|
363
284
|
function isDevelopment() {
|
|
364
285
|
return process.env.NODE_ENV === "development";
|
|
365
286
|
}
|
|
366
|
-
// src/components/
|
|
287
|
+
// src/components/AlertBS.tsx
|
|
367
288
|
var import_react = require("@chakra-ui/react");
|
|
368
289
|
var import_react2 = __toESM(require("react"));
|
|
369
290
|
var import_react_feather = require("react-feather");
|
|
@@ -414,7 +335,7 @@ var variantStyles = {
|
|
|
414
335
|
padding: "0"
|
|
415
336
|
}
|
|
416
337
|
};
|
|
417
|
-
function
|
|
338
|
+
function AlertBS(_param) {
|
|
418
339
|
var status = _param.status, children = _param.children, variant = _param.variant, header = _param.header, rest = _object_without_properties(_param, [
|
|
419
340
|
"status",
|
|
420
341
|
"children",
|
|
@@ -436,71 +357,16 @@ function Alert(_param) {
|
|
|
436
357
|
color: "black"
|
|
437
358
|
}, header && /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Title, null, header), /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Description, null, children)));
|
|
438
359
|
}
|
|
439
|
-
// src/components/
|
|
360
|
+
// src/components/ButtonBS.tsx
|
|
440
361
|
var import_react3 = require("@chakra-ui/react");
|
|
441
|
-
var
|
|
442
|
-
// src/components/
|
|
362
|
+
var ButtonBS = import_react3.Button;
|
|
363
|
+
// src/components/IconButtonBS.tsx
|
|
443
364
|
var import_react4 = require("@chakra-ui/react");
|
|
444
|
-
var
|
|
445
|
-
// src/components/
|
|
446
|
-
var import_react5 =
|
|
447
|
-
var
|
|
448
|
-
|
|
449
|
-
return condition ? /* @__PURE__ */ import_react5.default.createElement(Wrapper, null, children) : /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, children);
|
|
450
|
-
};
|
|
451
|
-
// src/components/HideWithCSS.tsx
|
|
452
|
-
var import_react6 = require("@chakra-ui/react");
|
|
453
|
-
var import_react7 = __toESM(require("react"));
|
|
454
|
-
var HideWithCSS = function(_param) {
|
|
455
|
-
var children = _param.children, above = _param.above, below = _param.below, chakraProps = _object_without_properties(_param, [
|
|
456
|
-
"children",
|
|
457
|
-
"above",
|
|
458
|
-
"below"
|
|
459
|
-
]);
|
|
460
|
-
var display = _object_spread({}, !!below ? _define_property({
|
|
461
|
-
base: "none"
|
|
462
|
-
}, below, "block") : {}, !!above ? _define_property({}, above, "none") : {});
|
|
463
|
-
return /* @__PURE__ */ import_react7.default.createElement(import_react6.Box, _object_spread_props(_object_spread({}, chakraProps), {
|
|
464
|
-
display: display
|
|
465
|
-
}), children);
|
|
466
|
-
};
|
|
467
|
-
// src/components/Input.tsx
|
|
468
|
-
var import_react10 = require("@chakra-ui/react");
|
|
469
|
-
var import_react11 = __toESM(require("react"));
|
|
470
|
-
// src/components/VisuallyHidden.tsx
|
|
471
|
-
var import_react8 = __toESM(require("react"));
|
|
472
|
-
var import_react9 = require("@chakra-ui/react");
|
|
473
|
-
function VisuallyHidden(_param) {
|
|
474
|
-
var children = _param.children, rest = _object_without_properties(_param, [
|
|
475
|
-
"children"
|
|
476
|
-
]);
|
|
477
|
-
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];
|
|
478
|
-
(0, import_react8.useEffect)(function() {
|
|
479
|
-
if (isDevelopment()) {
|
|
480
|
-
var handleKeyDown = function(ev) {
|
|
481
|
-
if (ev.key === "Alt") {
|
|
482
|
-
setForceShow(true);
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
var handleKeyUp = function(ev) {
|
|
486
|
-
if (ev.key === "Alt") {
|
|
487
|
-
setForceShow(false);
|
|
488
|
-
}
|
|
489
|
-
};
|
|
490
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
491
|
-
window.addEventListener("keyup", handleKeyUp);
|
|
492
|
-
return function() {
|
|
493
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
494
|
-
window.removeEventListener("keyup", handleKeyUp);
|
|
495
|
-
};
|
|
496
|
-
}
|
|
497
|
-
}, []);
|
|
498
|
-
return forceShow ? /* @__PURE__ */ import_react8.default.createElement("span", null, children) : /* @__PURE__ */ import_react8.default.createElement(import_react9.VisuallyHidden, {
|
|
499
|
-
position: "fixed"
|
|
500
|
-
}, children);
|
|
501
|
-
}
|
|
502
|
-
// src/components/Input.tsx
|
|
503
|
-
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) {
|
|
504
370
|
var labelProps = props.labelProps, label = props.label, helperText = props.helperText, errorMessage = props.errorMessage, hideLabel = props.hideLabel, inputProps = _object_without_properties(props, [
|
|
505
371
|
"labelProps",
|
|
506
372
|
"label",
|
|
@@ -508,21 +374,90 @@ var Input = function(props) {
|
|
|
508
374
|
"errorMessage",
|
|
509
375
|
"hideLabel"
|
|
510
376
|
]);
|
|
511
|
-
var formLabel = /* @__PURE__ */
|
|
512
|
-
return /* @__PURE__ */
|
|
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, {
|
|
513
379
|
invalid: !!errorMessage
|
|
514
|
-
}, hideLabel ? /* @__PURE__ */
|
|
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));
|
|
515
381
|
};
|
|
516
|
-
// src/components/
|
|
517
|
-
var
|
|
518
|
-
var
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
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"));
|
|
522
457
|
// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
|
|
523
|
-
var
|
|
458
|
+
var import_react16 = require("@chakra-ui/react");
|
|
524
459
|
// src/styles/chakraTheme/ButtonStyles.ts
|
|
525
|
-
var
|
|
460
|
+
var import_react10 = require("@chakra-ui/react");
|
|
526
461
|
var variants = _object_spread({
|
|
527
462
|
primary: {
|
|
528
463
|
backgroundColor: colors.black,
|
|
@@ -536,8 +471,8 @@ var variants = _object_spread({
|
|
|
536
471
|
borderColor: "currentColor"
|
|
537
472
|
},
|
|
538
473
|
tertiary: {}
|
|
539
|
-
}, (
|
|
540
|
-
var ButtonStyles = (0,
|
|
474
|
+
}, (_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);
|
|
475
|
+
var ButtonStyles = (0, import_react10.defineRecipe)({
|
|
541
476
|
base: {
|
|
542
477
|
borderColor: "transparent",
|
|
543
478
|
borderWidth: "0.1em",
|
|
@@ -576,21 +511,21 @@ var ButtonStyles = (0, import_react13.defineRecipe)({
|
|
|
576
511
|
}
|
|
577
512
|
});
|
|
578
513
|
// src/styles/chakraTheme/ContainerStyles.ts
|
|
579
|
-
var
|
|
580
|
-
var ContainerStyles = (0,
|
|
514
|
+
var import_react11 = require("@chakra-ui/react");
|
|
515
|
+
var ContainerStyles = (0, import_react11.defineRecipe)({
|
|
581
516
|
base: {
|
|
582
517
|
px: ".75rem"
|
|
583
518
|
}
|
|
584
519
|
});
|
|
585
520
|
// src/styles/chakraTheme/HeadingStyles.ts
|
|
586
|
-
var
|
|
587
|
-
var HeadingStyles = (0,
|
|
521
|
+
var import_react12 = require("@chakra-ui/react");
|
|
522
|
+
var HeadingStyles = (0, import_react12.defineRecipe)({
|
|
588
523
|
base: {
|
|
589
524
|
fontWeight: "600"
|
|
590
525
|
}
|
|
591
526
|
});
|
|
592
527
|
// src/styles/chakraTheme/InputStyles.ts
|
|
593
|
-
var
|
|
528
|
+
var import_react13 = require("@chakra-ui/react");
|
|
594
529
|
var variants2 = {
|
|
595
530
|
subtle: {
|
|
596
531
|
backgroundColor: {
|
|
@@ -629,7 +564,7 @@ var variants2 = {
|
|
|
629
564
|
}
|
|
630
565
|
}
|
|
631
566
|
};
|
|
632
|
-
var InputStyles = (0,
|
|
567
|
+
var InputStyles = (0, import_react13.defineRecipe)({
|
|
633
568
|
base: {
|
|
634
569
|
_placeholder: {
|
|
635
570
|
color: {
|
|
@@ -645,37 +580,9 @@ var InputStyles = (0, import_react16.defineRecipe)({
|
|
|
645
580
|
variant: "subtle"
|
|
646
581
|
}
|
|
647
582
|
});
|
|
648
|
-
// src/styles/chakraTheme/LinkStyles.ts
|
|
649
|
-
var import_react17 = require("@chakra-ui/react");
|
|
650
|
-
var variants3 = {
|
|
651
|
-
plain: {
|
|
652
|
-
color: "currentColor",
|
|
653
|
-
textDecoration: "none",
|
|
654
|
-
textDecorationColor: "currentColor/30",
|
|
655
|
-
_hover: {
|
|
656
|
-
textDecoration: "underline"
|
|
657
|
-
}
|
|
658
|
-
},
|
|
659
|
-
underline: {
|
|
660
|
-
color: "currentColor",
|
|
661
|
-
textDecoration: "underline",
|
|
662
|
-
textDecorationColor: "currentColor/30",
|
|
663
|
-
_hover: {
|
|
664
|
-
textDecoration: "none"
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
var LinkStyles = (0, import_react17.defineRecipe)({
|
|
669
|
-
variants: {
|
|
670
|
-
variant: variants3
|
|
671
|
-
},
|
|
672
|
-
defaultVariants: {
|
|
673
|
-
variant: "underline"
|
|
674
|
-
}
|
|
675
|
-
});
|
|
676
583
|
// src/styles/chakraTheme/SpinnerStyles.ts
|
|
677
|
-
var
|
|
678
|
-
var SpinnerStyles = (0,
|
|
584
|
+
var import_react14 = require("@chakra-ui/react");
|
|
585
|
+
var SpinnerStyles = (0, import_react14.defineRecipe)({
|
|
679
586
|
base: {
|
|
680
587
|
animationDuration: ".8s",
|
|
681
588
|
color: colors.accentBlueMedium,
|
|
@@ -702,8 +609,36 @@ var container = {
|
|
|
702
609
|
var sizes = {
|
|
703
610
|
container: container
|
|
704
611
|
};
|
|
612
|
+
// src/styles/chakraTheme/LinkStyles.ts
|
|
613
|
+
var import_react15 = require("@chakra-ui/react");
|
|
614
|
+
var variants3 = {
|
|
615
|
+
plain: {
|
|
616
|
+
color: "currentColor",
|
|
617
|
+
textDecoration: "none",
|
|
618
|
+
textDecorationColor: "currentColor/30",
|
|
619
|
+
_hover: {
|
|
620
|
+
textDecoration: "underline"
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
underline: {
|
|
624
|
+
color: "currentColor",
|
|
625
|
+
textDecoration: "underline",
|
|
626
|
+
textDecorationColor: "currentColor/30",
|
|
627
|
+
_hover: {
|
|
628
|
+
textDecoration: "none"
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
var LinkStyles = (0, import_react15.defineRecipe)({
|
|
633
|
+
variants: {
|
|
634
|
+
variant: variants3
|
|
635
|
+
},
|
|
636
|
+
defaultVariants: {
|
|
637
|
+
variant: "underline"
|
|
638
|
+
}
|
|
639
|
+
});
|
|
705
640
|
// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
|
|
706
|
-
var tokens = (0,
|
|
641
|
+
var tokens = (0, import_react16.defineTokens)({
|
|
707
642
|
sizes: sizes
|
|
708
643
|
});
|
|
709
644
|
var globalHyphens = {
|
|
@@ -715,7 +650,7 @@ var focusStyle = {
|
|
|
715
650
|
boxShadow: "0 0 0 .1rem white, 0 0 0 .2rem black, 0 0 0 .3rem white !important",
|
|
716
651
|
transition: "box-shadow 0.1s ease-out"
|
|
717
652
|
};
|
|
718
|
-
var biblioteksentralenChakraTheme = (0,
|
|
653
|
+
var biblioteksentralenChakraTheme = (0, import_react16.defineConfig)({
|
|
719
654
|
theme: {
|
|
720
655
|
tokens: tokens,
|
|
721
656
|
recipes: {
|
|
@@ -744,82 +679,7 @@ var biblioteksentralenChakraTheme = (0, import_react19.defineConfig)({
|
|
|
744
679
|
"*:focus-visible": focusStyle
|
|
745
680
|
}
|
|
746
681
|
});
|
|
747
|
-
// src/
|
|
748
|
-
var import_system = require("@chakra-ui/system");
|
|
749
|
-
var BiblioteksentralenProvider = function(props) {
|
|
750
|
-
return /* @__PURE__ */ import_react20.default.createElement(import_react21.ChakraProvider, {
|
|
751
|
-
value: (0, import_react21.createSystem)(import_react21.defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})
|
|
752
|
-
}, /* @__PURE__ */ import_react20.default.createElement(import_system.ColorModeProvider, _object_spread({}, props)));
|
|
753
|
-
};
|
|
754
|
-
// src/components/ErrorBoundary.tsx
|
|
755
|
-
var import_react22 = require("@chakra-ui/react");
|
|
756
|
-
var import_react23 = __toESM(require("react"));
|
|
757
|
-
var StyledPre = function(props) {
|
|
758
|
-
return /* @__PURE__ */ import_react23.default.createElement(import_react22.Box, _object_spread({
|
|
759
|
-
as: "pre",
|
|
760
|
-
paddingTop: "0.5rem",
|
|
761
|
-
wordBreak: "break-all",
|
|
762
|
-
whiteSpace: "pre-wrap",
|
|
763
|
-
fontSize: "0.8rem"
|
|
764
|
-
}, props));
|
|
765
|
-
};
|
|
766
|
-
var ErrorBoundary = /*#__PURE__*/ function(_import_react23_default_Component) {
|
|
767
|
-
_inherits(ErrorBoundary, _import_react23_default_Component);
|
|
768
|
-
var _super = _create_super(ErrorBoundary);
|
|
769
|
-
function ErrorBoundary(props) {
|
|
770
|
-
_class_call_check(this, ErrorBoundary);
|
|
771
|
-
var _this;
|
|
772
|
-
_this = _super.call(this, props);
|
|
773
|
-
_this.state = {
|
|
774
|
-
hasError: false
|
|
775
|
-
};
|
|
776
|
-
return _this;
|
|
777
|
-
}
|
|
778
|
-
_create_class(ErrorBoundary, [
|
|
779
|
-
{
|
|
780
|
-
key: "componentDidCatch",
|
|
781
|
-
value: function componentDidCatch(error, errorInfo) {
|
|
782
|
-
this.setState({
|
|
783
|
-
hasError: true,
|
|
784
|
-
error: error,
|
|
785
|
-
errorInfo: errorInfo
|
|
786
|
-
});
|
|
787
|
-
console.error(error, {
|
|
788
|
-
errorInfo: errorInfo,
|
|
789
|
-
boundaryName: this.props.boundaryName
|
|
790
|
-
});
|
|
791
|
-
}
|
|
792
|
-
},
|
|
793
|
-
{
|
|
794
|
-
key: "render",
|
|
795
|
-
value: function render() {
|
|
796
|
-
if (this.state.hasError) {
|
|
797
|
-
var _this_state_errorInfo, _this_state_error;
|
|
798
|
-
var stackTrace = (_this_state_errorInfo = this.state.errorInfo) === null || _this_state_errorInfo === void 0 ? void 0 : _this_state_errorInfo.componentStack;
|
|
799
|
-
var errormsg = (_this_state_error = this.state.error) === null || _this_state_error === void 0 ? void 0 : _this_state_error.message;
|
|
800
|
-
var info = this.props.boundaryName;
|
|
801
|
-
return /* @__PURE__ */ import_react23.default.createElement("div", null, /* @__PURE__ */ import_react23.default.createElement(Alert, {
|
|
802
|
-
status: "error"
|
|
803
|
-
}, /* @__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 || ""))));
|
|
804
|
-
}
|
|
805
|
-
return this.props.children;
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
], [
|
|
809
|
-
{
|
|
810
|
-
key: "getDerivedStateFromError",
|
|
811
|
-
value: function getDerivedStateFromError(error) {
|
|
812
|
-
return {
|
|
813
|
-
hasError: true
|
|
814
|
-
};
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
]);
|
|
818
|
-
return ErrorBoundary;
|
|
819
|
-
}(import_react23.default.Component);
|
|
820
|
-
// src/components/HashLinkTarget.tsx
|
|
821
|
-
var import_react24 = require("@chakra-ui/react");
|
|
822
|
-
var import_react25 = __toESM(require("react"));
|
|
682
|
+
// src/components/HashLinkTargetBS.tsx
|
|
823
683
|
var focusOnRelativeParentStyle = {
|
|
824
684
|
_focusWithin: {
|
|
825
685
|
position: "static",
|
|
@@ -836,11 +696,11 @@ var focusOnRelativeParentStyle = {
|
|
|
836
696
|
}, focusStyle)
|
|
837
697
|
}
|
|
838
698
|
};
|
|
839
|
-
function
|
|
840
|
-
return /* @__PURE__ */
|
|
699
|
+
function HashLinkTargetBS(props) {
|
|
700
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react17.Box, {
|
|
841
701
|
position: "relative",
|
|
842
702
|
css: props.focusOnParent ? focusOnRelativeParentStyle : void 0
|
|
843
|
-
}, /* @__PURE__ */
|
|
703
|
+
}, /* @__PURE__ */ import_react18.default.createElement(import_react17.Box, {
|
|
844
704
|
id: props.id,
|
|
845
705
|
tabIndex: props.focusOnParent ? -1 : void 0,
|
|
846
706
|
position: "absolute",
|
|
@@ -850,15 +710,24 @@ function HashLinkTarget(props) {
|
|
|
850
710
|
}
|
|
851
711
|
}));
|
|
852
712
|
}
|
|
853
|
-
// src/components/
|
|
854
|
-
var
|
|
855
|
-
var
|
|
713
|
+
// src/components/withErrorBoundaryBS.tsx
|
|
714
|
+
var import_react19 = __toESM(require("react"));
|
|
715
|
+
var withErrorBoundaryBS = function(Component, boundaryName) {
|
|
856
716
|
return function(props) {
|
|
857
|
-
return /* @__PURE__ */
|
|
717
|
+
return /* @__PURE__ */ import_react19.default.createElement(ErrorBoundaryBS, {
|
|
858
718
|
boundaryName: boundaryName
|
|
859
|
-
}, /* @__PURE__ */
|
|
719
|
+
}, /* @__PURE__ */ import_react19.default.createElement(Component, _object_spread({}, props)));
|
|
860
720
|
};
|
|
861
721
|
};
|
|
722
|
+
// src/BiblioteksentralenProvider.tsx
|
|
723
|
+
var import_react20 = __toESM(require("react"));
|
|
724
|
+
var import_react21 = require("@chakra-ui/react");
|
|
725
|
+
var import_system = require("@chakra-ui/system");
|
|
726
|
+
var BiblioteksentralenProvider = function(props) {
|
|
727
|
+
return /* @__PURE__ */ import_react20.default.createElement(import_react21.ChakraProvider, {
|
|
728
|
+
value: (0, import_react21.createSystem)(import_react21.defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})
|
|
729
|
+
}, /* @__PURE__ */ import_react20.default.createElement(import_system.ColorModeProvider, _object_spread({}, props)));
|
|
730
|
+
};
|
|
862
731
|
// Annotate the CommonJS export names for ESM import in node:
|
|
863
732
|
0 && (module.exports = _object_spread({
|
|
864
733
|
AlertBS: AlertBS,
|
|
@@ -867,11 +736,8 @@ var withErrorBoundary = function(Component, boundaryName) {
|
|
|
867
736
|
ConditionalWrapperBS: ConditionalWrapperBS,
|
|
868
737
|
ErrorBoundaryBS: ErrorBoundaryBS,
|
|
869
738
|
HashLinkTargetBS: HashLinkTargetBS,
|
|
870
|
-
HideWithCSSBS: HideWithCSSBS,
|
|
871
739
|
IconButtonBS: IconButtonBS,
|
|
872
740
|
InputBS: InputBS,
|
|
873
|
-
LinkBS: LinkBS,
|
|
874
|
-
VisuallyHiddenBS: VisuallyHiddenBS,
|
|
875
741
|
colors: colors,
|
|
876
742
|
withErrorBoundaryBS: withErrorBoundaryBS
|
|
877
743
|
}, require("@chakra-ui/react")));
|