@biblioteksentralen/react 3.0.0-beta.11 → 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/README.md +11 -11
- package/dist/index.d.ts +31 -59
- package/dist/index.js +172 -350
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +88 -161
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
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;
|
|
@@ -274,50 +204,35 @@ var __toCommonJS = function(mod) {
|
|
|
274
204
|
// src/index.ts
|
|
275
205
|
var src_exports = {};
|
|
276
206
|
__export(src_exports, {
|
|
277
|
-
|
|
278
|
-
return
|
|
207
|
+
AlertBS: function() {
|
|
208
|
+
return AlertBS;
|
|
279
209
|
},
|
|
280
210
|
BiblioteksentralenProvider: function() {
|
|
281
211
|
return BiblioteksentralenProvider;
|
|
282
212
|
},
|
|
283
|
-
|
|
284
|
-
return
|
|
285
|
-
},
|
|
286
|
-
ConditionalWrapper: function() {
|
|
287
|
-
return ConditionalWrapper;
|
|
288
|
-
},
|
|
289
|
-
ErrorBoundary: function() {
|
|
290
|
-
return ErrorBoundary;
|
|
213
|
+
ButtonBS: function() {
|
|
214
|
+
return ButtonBS;
|
|
291
215
|
},
|
|
292
|
-
|
|
293
|
-
return
|
|
216
|
+
ConditionalWrapperBS: function() {
|
|
217
|
+
return ConditionalWrapperBS;
|
|
294
218
|
},
|
|
295
|
-
|
|
296
|
-
return
|
|
219
|
+
ErrorBoundaryBS: function() {
|
|
220
|
+
return ErrorBoundaryBS;
|
|
297
221
|
},
|
|
298
|
-
|
|
299
|
-
return
|
|
222
|
+
HashLinkTargetBS: function() {
|
|
223
|
+
return HashLinkTargetBS;
|
|
300
224
|
},
|
|
301
|
-
|
|
302
|
-
return
|
|
225
|
+
IconButtonBS: function() {
|
|
226
|
+
return IconButtonBS;
|
|
303
227
|
},
|
|
304
|
-
|
|
305
|
-
return
|
|
306
|
-
},
|
|
307
|
-
Toaster: function() {
|
|
308
|
-
return Toaster;
|
|
309
|
-
},
|
|
310
|
-
VisuallyHidden: function() {
|
|
311
|
-
return VisuallyHidden;
|
|
228
|
+
InputBS: function() {
|
|
229
|
+
return InputBS;
|
|
312
230
|
},
|
|
313
231
|
colors: function() {
|
|
314
232
|
return colors;
|
|
315
233
|
},
|
|
316
|
-
|
|
317
|
-
return
|
|
318
|
-
},
|
|
319
|
-
withErrorBoundary: function() {
|
|
320
|
-
return withErrorBoundary;
|
|
234
|
+
withErrorBoundaryBS: function() {
|
|
235
|
+
return withErrorBoundaryBS;
|
|
321
236
|
}
|
|
322
237
|
});
|
|
323
238
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -369,7 +284,7 @@ var colors = {
|
|
|
369
284
|
function isDevelopment() {
|
|
370
285
|
return process.env.NODE_ENV === "development";
|
|
371
286
|
}
|
|
372
|
-
// src/components/
|
|
287
|
+
// src/components/AlertBS.tsx
|
|
373
288
|
var import_react = require("@chakra-ui/react");
|
|
374
289
|
var import_react2 = __toESM(require("react"));
|
|
375
290
|
var import_react_feather = require("react-feather");
|
|
@@ -420,7 +335,7 @@ var variantStyles = {
|
|
|
420
335
|
padding: "0"
|
|
421
336
|
}
|
|
422
337
|
};
|
|
423
|
-
function
|
|
338
|
+
function AlertBS(_param) {
|
|
424
339
|
var status = _param.status, children = _param.children, variant = _param.variant, header = _param.header, rest = _object_without_properties(_param, [
|
|
425
340
|
"status",
|
|
426
341
|
"children",
|
|
@@ -442,71 +357,16 @@ function Alert(_param) {
|
|
|
442
357
|
color: "black"
|
|
443
358
|
}, header && /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Title, null, header), /* @__PURE__ */ import_react2.default.createElement(import_react.Alert.Description, null, children)));
|
|
444
359
|
}
|
|
445
|
-
// src/components/
|
|
360
|
+
// src/components/ButtonBS.tsx
|
|
446
361
|
var import_react3 = require("@chakra-ui/react");
|
|
447
|
-
var
|
|
448
|
-
// src/components/
|
|
362
|
+
var ButtonBS = import_react3.Button;
|
|
363
|
+
// src/components/IconButtonBS.tsx
|
|
449
364
|
var import_react4 = require("@chakra-ui/react");
|
|
450
|
-
var
|
|
451
|
-
// src/components/
|
|
452
|
-
var import_react5 =
|
|
453
|
-
var
|
|
454
|
-
|
|
455
|
-
return condition ? /* @__PURE__ */ import_react5.default.createElement(Wrapper, null, children) : /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, children);
|
|
456
|
-
};
|
|
457
|
-
// src/components/HideWithCSS.tsx
|
|
458
|
-
var import_react6 = require("@chakra-ui/react");
|
|
459
|
-
var import_react7 = __toESM(require("react"));
|
|
460
|
-
var HideWithCSS = function(_param) {
|
|
461
|
-
var children = _param.children, above = _param.above, below = _param.below, chakraProps = _object_without_properties(_param, [
|
|
462
|
-
"children",
|
|
463
|
-
"above",
|
|
464
|
-
"below"
|
|
465
|
-
]);
|
|
466
|
-
var display = _object_spread({}, !!below ? _define_property({
|
|
467
|
-
base: "none"
|
|
468
|
-
}, below, "block") : {}, !!above ? _define_property({}, above, "none") : {});
|
|
469
|
-
return /* @__PURE__ */ import_react7.default.createElement(import_react6.Box, _object_spread_props(_object_spread({}, chakraProps), {
|
|
470
|
-
display: display
|
|
471
|
-
}), children);
|
|
472
|
-
};
|
|
473
|
-
// src/components/Input.tsx
|
|
474
|
-
var import_react10 = require("@chakra-ui/react");
|
|
475
|
-
var import_react11 = __toESM(require("react"));
|
|
476
|
-
// src/components/VisuallyHidden.tsx
|
|
477
|
-
var import_react8 = __toESM(require("react"));
|
|
478
|
-
var import_react9 = require("@chakra-ui/react");
|
|
479
|
-
function VisuallyHidden(_param) {
|
|
480
|
-
var children = _param.children, rest = _object_without_properties(_param, [
|
|
481
|
-
"children"
|
|
482
|
-
]);
|
|
483
|
-
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];
|
|
484
|
-
(0, import_react8.useEffect)(function() {
|
|
485
|
-
if (isDevelopment()) {
|
|
486
|
-
var handleKeyDown = function(ev) {
|
|
487
|
-
if (ev.key === "Alt") {
|
|
488
|
-
setForceShow(true);
|
|
489
|
-
}
|
|
490
|
-
};
|
|
491
|
-
var handleKeyUp = function(ev) {
|
|
492
|
-
if (ev.key === "Alt") {
|
|
493
|
-
setForceShow(false);
|
|
494
|
-
}
|
|
495
|
-
};
|
|
496
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
497
|
-
window.addEventListener("keyup", handleKeyUp);
|
|
498
|
-
return function() {
|
|
499
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
500
|
-
window.removeEventListener("keyup", handleKeyUp);
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
}, []);
|
|
504
|
-
return forceShow ? /* @__PURE__ */ import_react8.default.createElement("span", null, children) : /* @__PURE__ */ import_react8.default.createElement(import_react9.VisuallyHidden, {
|
|
505
|
-
position: "fixed"
|
|
506
|
-
}, children);
|
|
507
|
-
}
|
|
508
|
-
// src/components/Input.tsx
|
|
509
|
-
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) {
|
|
510
370
|
var labelProps = props.labelProps, label = props.label, helperText = props.helperText, errorMessage = props.errorMessage, hideLabel = props.hideLabel, inputProps = _object_without_properties(props, [
|
|
511
371
|
"labelProps",
|
|
512
372
|
"label",
|
|
@@ -514,21 +374,90 @@ var Input = function(props) {
|
|
|
514
374
|
"errorMessage",
|
|
515
375
|
"hideLabel"
|
|
516
376
|
]);
|
|
517
|
-
var formLabel = /* @__PURE__ */
|
|
518
|
-
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, {
|
|
519
379
|
invalid: !!errorMessage
|
|
520
|
-
}, 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));
|
|
521
381
|
};
|
|
522
|
-
// src/components/
|
|
523
|
-
var
|
|
524
|
-
var
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
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"));
|
|
528
457
|
// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
|
|
529
|
-
var
|
|
458
|
+
var import_react16 = require("@chakra-ui/react");
|
|
530
459
|
// src/styles/chakraTheme/ButtonStyles.ts
|
|
531
|
-
var
|
|
460
|
+
var import_react10 = require("@chakra-ui/react");
|
|
532
461
|
var variants = _object_spread({
|
|
533
462
|
primary: {
|
|
534
463
|
backgroundColor: colors.black,
|
|
@@ -542,8 +471,8 @@ var variants = _object_spread({
|
|
|
542
471
|
borderColor: "currentColor"
|
|
543
472
|
},
|
|
544
473
|
tertiary: {}
|
|
545
|
-
}, (
|
|
546
|
-
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)({
|
|
547
476
|
base: {
|
|
548
477
|
borderColor: "transparent",
|
|
549
478
|
borderWidth: "0.1em",
|
|
@@ -582,21 +511,21 @@ var ButtonStyles = (0, import_react13.defineRecipe)({
|
|
|
582
511
|
}
|
|
583
512
|
});
|
|
584
513
|
// src/styles/chakraTheme/ContainerStyles.ts
|
|
585
|
-
var
|
|
586
|
-
var ContainerStyles = (0,
|
|
514
|
+
var import_react11 = require("@chakra-ui/react");
|
|
515
|
+
var ContainerStyles = (0, import_react11.defineRecipe)({
|
|
587
516
|
base: {
|
|
588
517
|
px: ".75rem"
|
|
589
518
|
}
|
|
590
519
|
});
|
|
591
520
|
// src/styles/chakraTheme/HeadingStyles.ts
|
|
592
|
-
var
|
|
593
|
-
var HeadingStyles = (0,
|
|
521
|
+
var import_react12 = require("@chakra-ui/react");
|
|
522
|
+
var HeadingStyles = (0, import_react12.defineRecipe)({
|
|
594
523
|
base: {
|
|
595
524
|
fontWeight: "600"
|
|
596
525
|
}
|
|
597
526
|
});
|
|
598
527
|
// src/styles/chakraTheme/InputStyles.ts
|
|
599
|
-
var
|
|
528
|
+
var import_react13 = require("@chakra-ui/react");
|
|
600
529
|
var variants2 = {
|
|
601
530
|
subtle: {
|
|
602
531
|
backgroundColor: {
|
|
@@ -635,7 +564,7 @@ var variants2 = {
|
|
|
635
564
|
}
|
|
636
565
|
}
|
|
637
566
|
};
|
|
638
|
-
var InputStyles = (0,
|
|
567
|
+
var InputStyles = (0, import_react13.defineRecipe)({
|
|
639
568
|
base: {
|
|
640
569
|
_placeholder: {
|
|
641
570
|
color: {
|
|
@@ -651,37 +580,9 @@ var InputStyles = (0, import_react16.defineRecipe)({
|
|
|
651
580
|
variant: "subtle"
|
|
652
581
|
}
|
|
653
582
|
});
|
|
654
|
-
// src/styles/chakraTheme/LinkStyles.ts
|
|
655
|
-
var import_react17 = require("@chakra-ui/react");
|
|
656
|
-
var variants3 = {
|
|
657
|
-
plain: {
|
|
658
|
-
color: "currentColor",
|
|
659
|
-
textDecoration: "none",
|
|
660
|
-
textDecorationColor: "currentColor/30",
|
|
661
|
-
_hover: {
|
|
662
|
-
textDecoration: "underline"
|
|
663
|
-
}
|
|
664
|
-
},
|
|
665
|
-
underline: {
|
|
666
|
-
color: "currentColor",
|
|
667
|
-
textDecoration: "underline",
|
|
668
|
-
textDecorationColor: "currentColor/30",
|
|
669
|
-
_hover: {
|
|
670
|
-
textDecoration: "none"
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
};
|
|
674
|
-
var LinkStyles = (0, import_react17.defineRecipe)({
|
|
675
|
-
variants: {
|
|
676
|
-
variant: variants3
|
|
677
|
-
},
|
|
678
|
-
defaultVariants: {
|
|
679
|
-
variant: "underline"
|
|
680
|
-
}
|
|
681
|
-
});
|
|
682
583
|
// src/styles/chakraTheme/SpinnerStyles.ts
|
|
683
|
-
var
|
|
684
|
-
var SpinnerStyles = (0,
|
|
584
|
+
var import_react14 = require("@chakra-ui/react");
|
|
585
|
+
var SpinnerStyles = (0, import_react14.defineRecipe)({
|
|
685
586
|
base: {
|
|
686
587
|
animationDuration: ".8s",
|
|
687
588
|
color: colors.accentBlueMedium,
|
|
@@ -708,8 +609,36 @@ var container = {
|
|
|
708
609
|
var sizes = {
|
|
709
610
|
container: container
|
|
710
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
|
+
});
|
|
711
640
|
// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
|
|
712
|
-
var tokens = (0,
|
|
641
|
+
var tokens = (0, import_react16.defineTokens)({
|
|
713
642
|
sizes: sizes
|
|
714
643
|
});
|
|
715
644
|
var globalHyphens = {
|
|
@@ -721,7 +650,7 @@ var focusStyle = {
|
|
|
721
650
|
boxShadow: "0 0 0 .1rem white, 0 0 0 .2rem black, 0 0 0 .3rem white !important",
|
|
722
651
|
transition: "box-shadow 0.1s ease-out"
|
|
723
652
|
};
|
|
724
|
-
var biblioteksentralenChakraTheme = (0,
|
|
653
|
+
var biblioteksentralenChakraTheme = (0, import_react16.defineConfig)({
|
|
725
654
|
theme: {
|
|
726
655
|
tokens: tokens,
|
|
727
656
|
recipes: {
|
|
@@ -750,82 +679,7 @@ var biblioteksentralenChakraTheme = (0, import_react19.defineConfig)({
|
|
|
750
679
|
"*:focus-visible": focusStyle
|
|
751
680
|
}
|
|
752
681
|
});
|
|
753
|
-
// src/
|
|
754
|
-
var import_system = require("@chakra-ui/system");
|
|
755
|
-
var BiblioteksentralenProvider = function(props) {
|
|
756
|
-
return /* @__PURE__ */ import_react20.default.createElement(import_react21.ChakraProvider, {
|
|
757
|
-
value: (0, import_react21.createSystem)(import_react21.defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})
|
|
758
|
-
}, /* @__PURE__ */ import_react20.default.createElement(import_system.ColorModeProvider, _object_spread({}, props)));
|
|
759
|
-
};
|
|
760
|
-
// src/components/ErrorBoundary.tsx
|
|
761
|
-
var import_react22 = require("@chakra-ui/react");
|
|
762
|
-
var import_react23 = __toESM(require("react"));
|
|
763
|
-
var StyledPre = function(props) {
|
|
764
|
-
return /* @__PURE__ */ import_react23.default.createElement(import_react22.Box, _object_spread({
|
|
765
|
-
as: "pre",
|
|
766
|
-
paddingTop: "0.5rem",
|
|
767
|
-
wordBreak: "break-all",
|
|
768
|
-
whiteSpace: "pre-wrap",
|
|
769
|
-
fontSize: "0.8rem"
|
|
770
|
-
}, props));
|
|
771
|
-
};
|
|
772
|
-
var ErrorBoundary = /*#__PURE__*/ function(_import_react23_default_Component) {
|
|
773
|
-
_inherits(ErrorBoundary, _import_react23_default_Component);
|
|
774
|
-
var _super = _create_super(ErrorBoundary);
|
|
775
|
-
function ErrorBoundary(props) {
|
|
776
|
-
_class_call_check(this, ErrorBoundary);
|
|
777
|
-
var _this;
|
|
778
|
-
_this = _super.call(this, props);
|
|
779
|
-
_this.state = {
|
|
780
|
-
hasError: false
|
|
781
|
-
};
|
|
782
|
-
return _this;
|
|
783
|
-
}
|
|
784
|
-
_create_class(ErrorBoundary, [
|
|
785
|
-
{
|
|
786
|
-
key: "componentDidCatch",
|
|
787
|
-
value: function componentDidCatch(error, errorInfo) {
|
|
788
|
-
this.setState({
|
|
789
|
-
hasError: true,
|
|
790
|
-
error: error,
|
|
791
|
-
errorInfo: errorInfo
|
|
792
|
-
});
|
|
793
|
-
console.error(error, {
|
|
794
|
-
errorInfo: errorInfo,
|
|
795
|
-
boundaryName: this.props.boundaryName
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
},
|
|
799
|
-
{
|
|
800
|
-
key: "render",
|
|
801
|
-
value: function render() {
|
|
802
|
-
if (this.state.hasError) {
|
|
803
|
-
var _this_state_errorInfo, _this_state_error;
|
|
804
|
-
var stackTrace = (_this_state_errorInfo = this.state.errorInfo) === null || _this_state_errorInfo === void 0 ? void 0 : _this_state_errorInfo.componentStack;
|
|
805
|
-
var errormsg = (_this_state_error = this.state.error) === null || _this_state_error === void 0 ? void 0 : _this_state_error.message;
|
|
806
|
-
var info = this.props.boundaryName;
|
|
807
|
-
return /* @__PURE__ */ import_react23.default.createElement("div", null, /* @__PURE__ */ import_react23.default.createElement(Alert, {
|
|
808
|
-
status: "error"
|
|
809
|
-
}, /* @__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 || ""))));
|
|
810
|
-
}
|
|
811
|
-
return this.props.children;
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
], [
|
|
815
|
-
{
|
|
816
|
-
key: "getDerivedStateFromError",
|
|
817
|
-
value: function getDerivedStateFromError(error) {
|
|
818
|
-
return {
|
|
819
|
-
hasError: true
|
|
820
|
-
};
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
]);
|
|
824
|
-
return ErrorBoundary;
|
|
825
|
-
}(import_react23.default.Component);
|
|
826
|
-
// src/components/HashLinkTarget.tsx
|
|
827
|
-
var import_react24 = require("@chakra-ui/react");
|
|
828
|
-
var import_react25 = __toESM(require("react"));
|
|
682
|
+
// src/components/HashLinkTargetBS.tsx
|
|
829
683
|
var focusOnRelativeParentStyle = {
|
|
830
684
|
_focusWithin: {
|
|
831
685
|
position: "static",
|
|
@@ -842,11 +696,11 @@ var focusOnRelativeParentStyle = {
|
|
|
842
696
|
}, focusStyle)
|
|
843
697
|
}
|
|
844
698
|
};
|
|
845
|
-
function
|
|
846
|
-
return /* @__PURE__ */
|
|
699
|
+
function HashLinkTargetBS(props) {
|
|
700
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react17.Box, {
|
|
847
701
|
position: "relative",
|
|
848
702
|
css: props.focusOnParent ? focusOnRelativeParentStyle : void 0
|
|
849
|
-
}, /* @__PURE__ */
|
|
703
|
+
}, /* @__PURE__ */ import_react18.default.createElement(import_react17.Box, {
|
|
850
704
|
id: props.id,
|
|
851
705
|
tabIndex: props.focusOnParent ? -1 : void 0,
|
|
852
706
|
position: "absolute",
|
|
@@ -856,67 +710,35 @@ function HashLinkTarget(props) {
|
|
|
856
710
|
}
|
|
857
711
|
}));
|
|
858
712
|
}
|
|
859
|
-
// src/components/
|
|
860
|
-
var
|
|
861
|
-
var
|
|
713
|
+
// src/components/withErrorBoundaryBS.tsx
|
|
714
|
+
var import_react19 = __toESM(require("react"));
|
|
715
|
+
var withErrorBoundaryBS = function(Component, boundaryName) {
|
|
862
716
|
return function(props) {
|
|
863
|
-
return /* @__PURE__ */
|
|
717
|
+
return /* @__PURE__ */ import_react19.default.createElement(ErrorBoundaryBS, {
|
|
864
718
|
boundaryName: boundaryName
|
|
865
|
-
}, /* @__PURE__ */
|
|
719
|
+
}, /* @__PURE__ */ import_react19.default.createElement(Component, _object_spread({}, props)));
|
|
866
720
|
};
|
|
867
721
|
};
|
|
868
|
-
// src/
|
|
869
|
-
var
|
|
870
|
-
var
|
|
871
|
-
var
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
right: "50%",
|
|
877
|
-
bottom: "50%"
|
|
878
|
-
}
|
|
879
|
-
});
|
|
880
|
-
var Toaster = function() {
|
|
881
|
-
return /* @__PURE__ */ import_react28.default.createElement(import_react27.Portal, null, /* @__PURE__ */ import_react28.default.createElement(import_react27.Toaster, {
|
|
882
|
-
toaster: toaster,
|
|
883
|
-
insetInline: {
|
|
884
|
-
mdDown: "4"
|
|
885
|
-
}
|
|
886
|
-
}, function(toast) {
|
|
887
|
-
if (typeof toast.render === "function") {
|
|
888
|
-
return /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, toast.render());
|
|
889
|
-
}
|
|
890
|
-
return /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Root, {
|
|
891
|
-
width: {
|
|
892
|
-
md: "sm"
|
|
893
|
-
}
|
|
894
|
-
}, toast.type === "loading" ? /* @__PURE__ */ import_react28.default.createElement(import_react27.Spinner, {
|
|
895
|
-
size: "sm",
|
|
896
|
-
color: "blue.solid"
|
|
897
|
-
}) : /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Indicator, null), /* @__PURE__ */ import_react28.default.createElement(import_react27.Stack, {
|
|
898
|
-
gap: "1",
|
|
899
|
-
flex: "1",
|
|
900
|
-
maxWidth: "100%"
|
|
901
|
-
}, 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));
|
|
902
|
-
}));
|
|
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)));
|
|
903
730
|
};
|
|
904
731
|
// Annotate the CommonJS export names for ESM import in node:
|
|
905
732
|
0 && (module.exports = _object_spread({
|
|
906
|
-
|
|
733
|
+
AlertBS: AlertBS,
|
|
907
734
|
BiblioteksentralenProvider: BiblioteksentralenProvider,
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
Input: Input,
|
|
915
|
-
Link: Link,
|
|
916
|
-
Toaster: Toaster,
|
|
917
|
-
VisuallyHidden: VisuallyHidden,
|
|
735
|
+
ButtonBS: ButtonBS,
|
|
736
|
+
ConditionalWrapperBS: ConditionalWrapperBS,
|
|
737
|
+
ErrorBoundaryBS: ErrorBoundaryBS,
|
|
738
|
+
HashLinkTargetBS: HashLinkTargetBS,
|
|
739
|
+
IconButtonBS: IconButtonBS,
|
|
740
|
+
InputBS: InputBS,
|
|
918
741
|
colors: colors,
|
|
919
|
-
|
|
920
|
-
withErrorBoundary: withErrorBoundary
|
|
742
|
+
withErrorBoundaryBS: withErrorBoundaryBS
|
|
921
743
|
}, require("@chakra-ui/react")));
|
|
922
744
|
//# sourceMappingURL=index.js.map
|