@biblioteksentralen/react 3.0.0-beta.9 → 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.d.ts +32 -59
- package/dist/index.js +186 -359
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +106 -172
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -6
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
|
-
|
|
277
|
-
return
|
|
207
|
+
AlertBS: function() {
|
|
208
|
+
return AlertBS;
|
|
278
209
|
},
|
|
279
210
|
BiblioteksentralenProvider: function() {
|
|
280
211
|
return BiblioteksentralenProvider;
|
|
281
212
|
},
|
|
282
|
-
|
|
283
|
-
return
|
|
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
|
-
|
|
295
|
-
return
|
|
216
|
+
ConditionalWrapperBS: function() {
|
|
217
|
+
return ConditionalWrapperBS;
|
|
296
218
|
},
|
|
297
|
-
|
|
298
|
-
return
|
|
219
|
+
ErrorBoundaryBS: function() {
|
|
220
|
+
return ErrorBoundaryBS;
|
|
299
221
|
},
|
|
300
|
-
|
|
301
|
-
return
|
|
222
|
+
HashLinkTargetBS: function() {
|
|
223
|
+
return HashLinkTargetBS;
|
|
302
224
|
},
|
|
303
|
-
|
|
304
|
-
return
|
|
225
|
+
IconButtonBS: function() {
|
|
226
|
+
return IconButtonBS;
|
|
305
227
|
},
|
|
306
|
-
|
|
307
|
-
return
|
|
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
|
-
|
|
316
|
-
return
|
|
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/
|
|
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
|
|
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/
|
|
360
|
+
// src/components/ButtonBS.tsx
|
|
445
361
|
var import_react3 = require("@chakra-ui/react");
|
|
446
|
-
var
|
|
447
|
-
// src/components/
|
|
362
|
+
var ButtonBS = import_react3.Button;
|
|
363
|
+
// src/components/IconButtonBS.tsx
|
|
448
364
|
var import_react4 = require("@chakra-ui/react");
|
|
449
|
-
var
|
|
450
|
-
// src/components/
|
|
451
|
-
var import_react5 =
|
|
452
|
-
var
|
|
453
|
-
|
|
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__ */
|
|
517
|
-
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, {
|
|
518
379
|
invalid: !!errorMessage
|
|
519
|
-
}, 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));
|
|
520
381
|
};
|
|
521
|
-
// src/components/
|
|
522
|
-
var
|
|
523
|
-
var
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
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
|
|
458
|
+
var import_react16 = require("@chakra-ui/react");
|
|
529
459
|
// src/styles/chakraTheme/ButtonStyles.ts
|
|
530
|
-
var
|
|
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
|
|
542
|
-
backgroundColor: "transparent",
|
|
471
|
+
borderColor: "currentColor",
|
|
543
472
|
color: "currentColor",
|
|
473
|
+
backgroundColor: "transparent",
|
|
544
474
|
_hover: {
|
|
545
|
-
backgroundColor: "
|
|
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: "
|
|
553
|
-
color: "currentColor"
|
|
482
|
+
backgroundColor: "currentColor/7"
|
|
554
483
|
}
|
|
555
484
|
}
|
|
556
|
-
};
|
|
557
|
-
var ButtonStyles = (0,
|
|
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
|
-
|
|
560
|
-
|
|
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
|
|
592
|
-
var ContainerStyles = (0,
|
|
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
|
|
599
|
-
var HeadingStyles = (0,
|
|
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
|
|
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,
|
|
573
|
+
var InputStyles = (0, import_react13.defineRecipe)({
|
|
645
574
|
base: {
|
|
646
575
|
_placeholder: {
|
|
647
576
|
color: {
|
|
@@ -657,37 +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
|
-
color: "currentColor",
|
|
665
|
-
textDecoration: "none",
|
|
666
|
-
textDecorationColor: "currentColor/30",
|
|
667
|
-
_hover: {
|
|
668
|
-
textDecoration: "underline"
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
underline: {
|
|
672
|
-
color: "currentColor",
|
|
673
|
-
textDecoration: "underline",
|
|
674
|
-
textDecorationColor: "currentColor/30",
|
|
675
|
-
_hover: {
|
|
676
|
-
textDecoration: "none"
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
};
|
|
680
|
-
var LinkStyles = (0, import_react17.defineRecipe)({
|
|
681
|
-
variants: {
|
|
682
|
-
variant: variants3
|
|
683
|
-
},
|
|
684
|
-
defaultVariants: {
|
|
685
|
-
variant: "underline"
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
589
|
// src/styles/chakraTheme/SpinnerStyles.ts
|
|
689
|
-
var
|
|
690
|
-
var SpinnerStyles = (0,
|
|
590
|
+
var import_react14 = require("@chakra-ui/react");
|
|
591
|
+
var SpinnerStyles = (0, import_react14.defineRecipe)({
|
|
691
592
|
base: {
|
|
692
593
|
animationDuration: ".8s",
|
|
693
594
|
color: colors.accentBlueMedium,
|
|
@@ -714,8 +615,41 @@ var container = {
|
|
|
714
615
|
var sizes = {
|
|
715
616
|
container: container
|
|
716
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
|
+
});
|
|
717
651
|
// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
|
|
718
|
-
var tokens = (0,
|
|
652
|
+
var tokens = (0, import_react16.defineTokens)({
|
|
719
653
|
sizes: sizes
|
|
720
654
|
});
|
|
721
655
|
var globalHyphens = {
|
|
@@ -724,10 +658,10 @@ var globalHyphens = {
|
|
|
724
658
|
};
|
|
725
659
|
var focusStyle = {
|
|
726
660
|
outline: "none !important",
|
|
727
|
-
boxShadow: "0 0 0 .
|
|
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"),
|
|
728
662
|
transition: "box-shadow 0.1s ease-out"
|
|
729
663
|
};
|
|
730
|
-
var biblioteksentralenChakraTheme = (0,
|
|
664
|
+
var biblioteksentralenChakraTheme = (0, import_react16.defineConfig)({
|
|
731
665
|
theme: {
|
|
732
666
|
tokens: tokens,
|
|
733
667
|
recipes: {
|
|
@@ -756,82 +690,7 @@ var biblioteksentralenChakraTheme = (0, import_react19.defineConfig)({
|
|
|
756
690
|
"*:focus-visible": focusStyle
|
|
757
691
|
}
|
|
758
692
|
});
|
|
759
|
-
// src/
|
|
760
|
-
var import_system = require("@chakra-ui/system");
|
|
761
|
-
var BiblioteksentralenProvider = function(props) {
|
|
762
|
-
return /* @__PURE__ */ import_react20.default.createElement(import_react21.ChakraProvider, {
|
|
763
|
-
value: (0, import_react21.createSystem)(import_react21.defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})
|
|
764
|
-
}, /* @__PURE__ */ import_react20.default.createElement(import_system.ColorModeProvider, _object_spread({}, props)));
|
|
765
|
-
};
|
|
766
|
-
// src/components/ErrorBoundary.tsx
|
|
767
|
-
var import_react22 = require("@chakra-ui/react");
|
|
768
|
-
var import_react23 = __toESM(require("react"));
|
|
769
|
-
var StyledPre = function(props) {
|
|
770
|
-
return /* @__PURE__ */ import_react23.default.createElement(import_react22.Box, _object_spread({
|
|
771
|
-
as: "pre",
|
|
772
|
-
paddingTop: "0.5rem",
|
|
773
|
-
wordBreak: "break-all",
|
|
774
|
-
whiteSpace: "pre-wrap",
|
|
775
|
-
fontSize: "0.8rem"
|
|
776
|
-
}, props));
|
|
777
|
-
};
|
|
778
|
-
var ErrorBoundary = /*#__PURE__*/ function(_import_react23_default_Component) {
|
|
779
|
-
_inherits(ErrorBoundary, _import_react23_default_Component);
|
|
780
|
-
var _super = _create_super(ErrorBoundary);
|
|
781
|
-
function ErrorBoundary(props) {
|
|
782
|
-
_class_call_check(this, ErrorBoundary);
|
|
783
|
-
var _this;
|
|
784
|
-
_this = _super.call(this, props);
|
|
785
|
-
_this.state = {
|
|
786
|
-
hasError: false
|
|
787
|
-
};
|
|
788
|
-
return _this;
|
|
789
|
-
}
|
|
790
|
-
_create_class(ErrorBoundary, [
|
|
791
|
-
{
|
|
792
|
-
key: "componentDidCatch",
|
|
793
|
-
value: function componentDidCatch(error, errorInfo) {
|
|
794
|
-
this.setState({
|
|
795
|
-
hasError: true,
|
|
796
|
-
error: error,
|
|
797
|
-
errorInfo: errorInfo
|
|
798
|
-
});
|
|
799
|
-
console.error(error, {
|
|
800
|
-
errorInfo: errorInfo,
|
|
801
|
-
boundaryName: this.props.boundaryName
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
},
|
|
805
|
-
{
|
|
806
|
-
key: "render",
|
|
807
|
-
value: function render() {
|
|
808
|
-
if (this.state.hasError) {
|
|
809
|
-
var _this_state_errorInfo, _this_state_error;
|
|
810
|
-
var stackTrace = (_this_state_errorInfo = this.state.errorInfo) === null || _this_state_errorInfo === void 0 ? void 0 : _this_state_errorInfo.componentStack;
|
|
811
|
-
var errormsg = (_this_state_error = this.state.error) === null || _this_state_error === void 0 ? void 0 : _this_state_error.message;
|
|
812
|
-
var info = this.props.boundaryName;
|
|
813
|
-
return /* @__PURE__ */ import_react23.default.createElement("div", null, /* @__PURE__ */ import_react23.default.createElement(Alert, {
|
|
814
|
-
status: "error"
|
|
815
|
-
}, /* @__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 || ""))));
|
|
816
|
-
}
|
|
817
|
-
return this.props.children;
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
], [
|
|
821
|
-
{
|
|
822
|
-
key: "getDerivedStateFromError",
|
|
823
|
-
value: function getDerivedStateFromError(error) {
|
|
824
|
-
return {
|
|
825
|
-
hasError: true
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
]);
|
|
830
|
-
return ErrorBoundary;
|
|
831
|
-
}(import_react23.default.Component);
|
|
832
|
-
// src/components/HashLinkTarget.tsx
|
|
833
|
-
var import_react24 = require("@chakra-ui/react");
|
|
834
|
-
var import_react25 = __toESM(require("react"));
|
|
693
|
+
// src/components/HashLinkTargetBS.tsx
|
|
835
694
|
var focusOnRelativeParentStyle = {
|
|
836
695
|
_focusWithin: {
|
|
837
696
|
position: "static",
|
|
@@ -848,11 +707,11 @@ var focusOnRelativeParentStyle = {
|
|
|
848
707
|
}, focusStyle)
|
|
849
708
|
}
|
|
850
709
|
};
|
|
851
|
-
function
|
|
852
|
-
return /* @__PURE__ */
|
|
710
|
+
function HashLinkTargetBS(props) {
|
|
711
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react17.Box, {
|
|
853
712
|
position: "relative",
|
|
854
713
|
css: props.focusOnParent ? focusOnRelativeParentStyle : void 0
|
|
855
|
-
}, /* @__PURE__ */
|
|
714
|
+
}, /* @__PURE__ */ import_react18.default.createElement(import_react17.Box, {
|
|
856
715
|
id: props.id,
|
|
857
716
|
tabIndex: props.focusOnParent ? -1 : void 0,
|
|
858
717
|
position: "absolute",
|
|
@@ -862,67 +721,35 @@ function HashLinkTarget(props) {
|
|
|
862
721
|
}
|
|
863
722
|
}));
|
|
864
723
|
}
|
|
865
|
-
// src/components/
|
|
866
|
-
var
|
|
867
|
-
var
|
|
724
|
+
// src/components/withErrorBoundaryBS.tsx
|
|
725
|
+
var import_react19 = __toESM(require("react"));
|
|
726
|
+
var withErrorBoundaryBS = function(Component, boundaryName) {
|
|
868
727
|
return function(props) {
|
|
869
|
-
return /* @__PURE__ */
|
|
728
|
+
return /* @__PURE__ */ import_react19.default.createElement(ErrorBoundaryBS, {
|
|
870
729
|
boundaryName: boundaryName
|
|
871
|
-
}, /* @__PURE__ */
|
|
730
|
+
}, /* @__PURE__ */ import_react19.default.createElement(Component, _object_spread({}, props)));
|
|
872
731
|
};
|
|
873
732
|
};
|
|
874
|
-
// src/
|
|
875
|
-
var
|
|
876
|
-
var
|
|
877
|
-
var
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
right: "50%",
|
|
883
|
-
bottom: "50%"
|
|
884
|
-
}
|
|
885
|
-
});
|
|
886
|
-
var Toaster = function() {
|
|
887
|
-
return /* @__PURE__ */ import_react28.default.createElement(import_react27.Portal, null, /* @__PURE__ */ import_react28.default.createElement(import_react27.Toaster, {
|
|
888
|
-
toaster: toaster,
|
|
889
|
-
insetInline: {
|
|
890
|
-
mdDown: "4"
|
|
891
|
-
}
|
|
892
|
-
}, function(toast) {
|
|
893
|
-
if (typeof toast.render === "function") {
|
|
894
|
-
return /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, toast.render());
|
|
895
|
-
}
|
|
896
|
-
return /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Root, {
|
|
897
|
-
width: {
|
|
898
|
-
md: "sm"
|
|
899
|
-
}
|
|
900
|
-
}, toast.type === "loading" ? /* @__PURE__ */ import_react28.default.createElement(import_react27.Spinner, {
|
|
901
|
-
size: "sm",
|
|
902
|
-
color: "blue.solid"
|
|
903
|
-
}) : /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Indicator, null), /* @__PURE__ */ import_react28.default.createElement(import_react27.Stack, {
|
|
904
|
-
gap: "1",
|
|
905
|
-
flex: "1",
|
|
906
|
-
maxWidth: "100%"
|
|
907
|
-
}, 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));
|
|
908
|
-
}));
|
|
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)));
|
|
909
741
|
};
|
|
910
742
|
// Annotate the CommonJS export names for ESM import in node:
|
|
911
743
|
0 && (module.exports = _object_spread({
|
|
912
|
-
|
|
744
|
+
AlertBS: AlertBS,
|
|
913
745
|
BiblioteksentralenProvider: BiblioteksentralenProvider,
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
Input: Input,
|
|
921
|
-
Link: Link,
|
|
922
|
-
Toaster: Toaster,
|
|
923
|
-
VisuallyHidden: VisuallyHidden,
|
|
746
|
+
ButtonBS: ButtonBS,
|
|
747
|
+
ConditionalWrapperBS: ConditionalWrapperBS,
|
|
748
|
+
ErrorBoundaryBS: ErrorBoundaryBS,
|
|
749
|
+
HashLinkTargetBS: HashLinkTargetBS,
|
|
750
|
+
IconButtonBS: IconButtonBS,
|
|
751
|
+
InputBS: InputBS,
|
|
924
752
|
colors: colors,
|
|
925
|
-
|
|
926
|
-
withErrorBoundary: withErrorBoundary
|
|
753
|
+
withErrorBoundaryBS: withErrorBoundaryBS
|
|
927
754
|
}, require("@chakra-ui/react")));
|
|
928
755
|
//# sourceMappingURL=index.js.map
|