@oslokommune/punkt-react 6.0.3 → 6.0.4
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/CHANGELOG.md +18 -0
- package/dist/header/Header.d.ts +3 -3
- package/dist/punkt-react.es.js +138 -122
- package/dist/punkt-react.umd.js +9 -9
- package/package.json +2 -2
- package/src/components/header/Header.tsx +26 -11
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [6.0.4](https://github.com/oslokommune/punkt/compare/6.0.3...6.0.4) (2023-08-30)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
* Tillat funksjon som logoLink i Header.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
Ingen
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
|
|
8
26
|
## [6.0.3](https://github.com/oslokommune/punkt/compare/6.0.2...6.0.3) (2023-08-30)
|
|
9
27
|
|
|
10
28
|
### ⚠ BREAKING CHANGES
|
package/dist/header/Header.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ interface User {
|
|
|
7
7
|
interface UserMenuItem {
|
|
8
8
|
iconName?: string;
|
|
9
9
|
title: string;
|
|
10
|
-
target: string |
|
|
10
|
+
target: string | (() => void);
|
|
11
11
|
}
|
|
12
12
|
interface Representing {
|
|
13
13
|
name?: string;
|
|
@@ -16,10 +16,10 @@ interface Representing {
|
|
|
16
16
|
}
|
|
17
17
|
interface UserMenuFooterItem {
|
|
18
18
|
title: string;
|
|
19
|
-
target: string |
|
|
19
|
+
target: string | (() => void);
|
|
20
20
|
}
|
|
21
21
|
interface IPktHeader extends HTMLAttributes<HTMLDivElement> {
|
|
22
|
-
logoLink?: string;
|
|
22
|
+
logoLink?: string | (() => void);
|
|
23
23
|
serviceName?: string;
|
|
24
24
|
fixed?: boolean;
|
|
25
25
|
scrollToHide?: boolean;
|
package/dist/punkt-react.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import D, { useState as ue, useEffect as vt, forwardRef as B } from "react";
|
|
2
|
-
function gt(
|
|
3
|
-
return
|
|
2
|
+
function gt(a) {
|
|
3
|
+
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
4
4
|
}
|
|
5
5
|
var xe = { exports: {} }, te = {};
|
|
6
6
|
/**
|
|
@@ -17,7 +17,7 @@ function bt() {
|
|
|
17
17
|
if (Ue)
|
|
18
18
|
return te;
|
|
19
19
|
Ue = 1;
|
|
20
|
-
var
|
|
20
|
+
var a = D, c = Symbol.for("react.element"), i = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, l = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
21
21
|
function m(o, p, y) {
|
|
22
22
|
var N, x = {}, T = null, j = null;
|
|
23
23
|
y !== void 0 && (T = "" + y), p.key !== void 0 && (T = "" + p.key), p.ref !== void 0 && (j = p.ref);
|
|
@@ -43,26 +43,26 @@ var re = {};
|
|
|
43
43
|
var Ve;
|
|
44
44
|
function Nt() {
|
|
45
45
|
return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() {
|
|
46
|
-
var
|
|
46
|
+
var a = D, c = Symbol.for("react.element"), i = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), o = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), N = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), j = Symbol.for("react.offscreen"), I = Symbol.iterator, O = "@@iterator";
|
|
47
47
|
function F(e) {
|
|
48
48
|
if (e === null || typeof e != "object")
|
|
49
49
|
return null;
|
|
50
50
|
var r = I && e[I] || e[O];
|
|
51
51
|
return typeof r == "function" ? r : null;
|
|
52
52
|
}
|
|
53
|
-
var C =
|
|
53
|
+
var C = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
54
54
|
function E(e) {
|
|
55
55
|
{
|
|
56
|
-
for (var r = arguments.length,
|
|
57
|
-
|
|
58
|
-
Q("error", e,
|
|
56
|
+
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), d = 1; d < r; d++)
|
|
57
|
+
n[d - 1] = arguments[d];
|
|
58
|
+
Q("error", e, n);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function Q(e, r,
|
|
61
|
+
function Q(e, r, n) {
|
|
62
62
|
{
|
|
63
63
|
var d = C.ReactDebugCurrentFrame, v = d.getStackAddendum();
|
|
64
|
-
v !== "" && (r += "%s",
|
|
65
|
-
var b =
|
|
64
|
+
v !== "" && (r += "%s", n = n.concat([v]));
|
|
65
|
+
var b = n.map(function(_) {
|
|
66
66
|
return String(_);
|
|
67
67
|
});
|
|
68
68
|
b.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, b);
|
|
@@ -77,12 +77,12 @@ function Nt() {
|
|
|
77
77
|
// with.
|
|
78
78
|
e.$$typeof === Y || e.getModuleId !== void 0));
|
|
79
79
|
}
|
|
80
|
-
function z(e, r,
|
|
80
|
+
function z(e, r, n) {
|
|
81
81
|
var d = e.displayName;
|
|
82
82
|
if (d)
|
|
83
83
|
return d;
|
|
84
84
|
var v = r.displayName || r.name || "";
|
|
85
|
-
return v !== "" ?
|
|
85
|
+
return v !== "" ? n + "(" + v + ")" : n;
|
|
86
86
|
}
|
|
87
87
|
function k(e) {
|
|
88
88
|
return e.displayName || "Context";
|
|
@@ -114,8 +114,8 @@ function Nt() {
|
|
|
114
114
|
var r = e;
|
|
115
115
|
return k(r) + ".Consumer";
|
|
116
116
|
case m:
|
|
117
|
-
var
|
|
118
|
-
return k(
|
|
117
|
+
var n = e;
|
|
118
|
+
return k(n._context) + ".Provider";
|
|
119
119
|
case p:
|
|
120
120
|
return z(e, e.render, "ForwardRef");
|
|
121
121
|
case x:
|
|
@@ -195,7 +195,7 @@ function Nt() {
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
var me = C.ReactCurrentDispatcher, ke;
|
|
198
|
-
function ne(e, r,
|
|
198
|
+
function ne(e, r, n) {
|
|
199
199
|
{
|
|
200
200
|
if (ke === void 0)
|
|
201
201
|
try {
|
|
@@ -217,9 +217,9 @@ function Nt() {
|
|
|
217
217
|
if (!e || he)
|
|
218
218
|
return "";
|
|
219
219
|
{
|
|
220
|
-
var
|
|
221
|
-
if (
|
|
222
|
-
return
|
|
220
|
+
var n = le.get(e);
|
|
221
|
+
if (n !== void 0)
|
|
222
|
+
return n;
|
|
223
223
|
}
|
|
224
224
|
var d;
|
|
225
225
|
he = !0;
|
|
@@ -284,14 +284,14 @@ function Nt() {
|
|
|
284
284
|
var Z = e ? e.displayName || e.name : "", Ye = Z ? ne(Z) : "";
|
|
285
285
|
return typeof e == "function" && le.set(e, Ye), Ye;
|
|
286
286
|
}
|
|
287
|
-
function Ke(e, r,
|
|
287
|
+
function Ke(e, r, n) {
|
|
288
288
|
return Te(e, !1);
|
|
289
289
|
}
|
|
290
290
|
function Xe(e) {
|
|
291
291
|
var r = e.prototype;
|
|
292
292
|
return !!(r && r.isReactComponent);
|
|
293
293
|
}
|
|
294
|
-
function oe(e, r,
|
|
294
|
+
function oe(e, r, n) {
|
|
295
295
|
if (e == null)
|
|
296
296
|
return "";
|
|
297
297
|
if (typeof e == "function")
|
|
@@ -309,11 +309,11 @@ function Nt() {
|
|
|
309
309
|
case p:
|
|
310
310
|
return Ke(e.render);
|
|
311
311
|
case x:
|
|
312
|
-
return oe(e.type, r,
|
|
312
|
+
return oe(e.type, r, n);
|
|
313
313
|
case T: {
|
|
314
314
|
var d = e, v = d._payload, b = d._init;
|
|
315
315
|
try {
|
|
316
|
-
return oe(b(v), r,
|
|
316
|
+
return oe(b(v), r, n);
|
|
317
317
|
} catch {
|
|
318
318
|
}
|
|
319
319
|
}
|
|
@@ -323,12 +323,12 @@ function Nt() {
|
|
|
323
323
|
var se = Object.prototype.hasOwnProperty, Ce = {}, je = C.ReactDebugCurrentFrame;
|
|
324
324
|
function ie(e) {
|
|
325
325
|
if (e) {
|
|
326
|
-
var r = e._owner,
|
|
327
|
-
je.setExtraStackFrame(
|
|
326
|
+
var r = e._owner, n = oe(e.type, e._source, r ? r.type : null);
|
|
327
|
+
je.setExtraStackFrame(n);
|
|
328
328
|
} else
|
|
329
329
|
je.setExtraStackFrame(null);
|
|
330
330
|
}
|
|
331
|
-
function Ze(e, r,
|
|
331
|
+
function Ze(e, r, n, d, v) {
|
|
332
332
|
{
|
|
333
333
|
var b = Function.call.bind(se);
|
|
334
334
|
for (var _ in e)
|
|
@@ -336,14 +336,14 @@ function Nt() {
|
|
|
336
336
|
var h = void 0;
|
|
337
337
|
try {
|
|
338
338
|
if (typeof e[_] != "function") {
|
|
339
|
-
var S = Error((d || "React class") + ": " +
|
|
339
|
+
var S = Error((d || "React class") + ": " + n + " type `" + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[_] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
340
340
|
throw S.name = "Invariant Violation", S;
|
|
341
341
|
}
|
|
342
|
-
h = e[_](r, _, d,
|
|
342
|
+
h = e[_](r, _, d, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
343
343
|
} catch (w) {
|
|
344
344
|
h = w;
|
|
345
345
|
}
|
|
346
|
-
h && !(h instanceof Error) && (ie(v), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", d || "React class",
|
|
346
|
+
h && !(h instanceof Error) && (ie(v), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", d || "React class", n, _, typeof h), ie(null)), h instanceof Error && !(h.message in Ce) && (Ce[h.message] = !0, ie(v), E("Failed %s type: %s", n, h.message), ie(null));
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
}
|
|
@@ -353,8 +353,8 @@ function Nt() {
|
|
|
353
353
|
}
|
|
354
354
|
function et(e) {
|
|
355
355
|
{
|
|
356
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag,
|
|
357
|
-
return
|
|
356
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
357
|
+
return n;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
function tt(e) {
|
|
@@ -396,40 +396,40 @@ function Nt() {
|
|
|
396
396
|
}
|
|
397
397
|
function lt(e, r) {
|
|
398
398
|
if (typeof e.ref == "string" && ee.current && r && ee.current.stateNode !== r) {
|
|
399
|
-
var
|
|
400
|
-
ve[
|
|
399
|
+
var n = P(ee.current.type);
|
|
400
|
+
ve[n] || (E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', P(ee.current.type), e.ref), ve[n] = !0);
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
function ot(e, r) {
|
|
404
404
|
{
|
|
405
|
-
var
|
|
405
|
+
var n = function() {
|
|
406
406
|
$e || ($e = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
407
407
|
};
|
|
408
|
-
|
|
409
|
-
get:
|
|
408
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
409
|
+
get: n,
|
|
410
410
|
configurable: !0
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
function st(e, r) {
|
|
415
415
|
{
|
|
416
|
-
var
|
|
416
|
+
var n = function() {
|
|
417
417
|
Ie || (Ie = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
418
418
|
};
|
|
419
|
-
|
|
420
|
-
get:
|
|
419
|
+
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
420
|
+
get: n,
|
|
421
421
|
configurable: !0
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
var it = function(e, r,
|
|
425
|
+
var it = function(e, r, n, d, v, b, _) {
|
|
426
426
|
var h = {
|
|
427
427
|
// This tag allows us to uniquely identify this as a React Element
|
|
428
428
|
$$typeof: c,
|
|
429
429
|
// Built-in properties that belong on the element
|
|
430
430
|
type: e,
|
|
431
431
|
key: r,
|
|
432
|
-
ref:
|
|
432
|
+
ref: n,
|
|
433
433
|
props: _,
|
|
434
434
|
// Record the component responsible for creating this element.
|
|
435
435
|
_owner: b
|
|
@@ -451,10 +451,10 @@ function Nt() {
|
|
|
451
451
|
value: v
|
|
452
452
|
}), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
|
|
453
453
|
};
|
|
454
|
-
function ct(e, r,
|
|
454
|
+
function ct(e, r, n, d, v) {
|
|
455
455
|
{
|
|
456
456
|
var b, _ = {}, h = null, S = null;
|
|
457
|
-
|
|
457
|
+
n !== void 0 && (Oe(n), h = "" + n), nt(r) && (Oe(r.key), h = "" + r.key), at(r) && (S = r.ref, lt(r, v));
|
|
458
458
|
for (b in r)
|
|
459
459
|
se.call(r, b) && !rt.hasOwnProperty(b) && (_[b] = r[b]);
|
|
460
460
|
if (e && e.defaultProps) {
|
|
@@ -472,8 +472,8 @@ function Nt() {
|
|
|
472
472
|
var ge = C.ReactCurrentOwner, Fe = C.ReactDebugCurrentFrame;
|
|
473
473
|
function X(e) {
|
|
474
474
|
if (e) {
|
|
475
|
-
var r = e._owner,
|
|
476
|
-
Fe.setExtraStackFrame(
|
|
475
|
+
var r = e._owner, n = oe(e.type, e._source, r ? r.type : null);
|
|
476
|
+
Fe.setExtraStackFrame(n);
|
|
477
477
|
} else
|
|
478
478
|
Fe.setExtraStackFrame(null);
|
|
479
479
|
}
|
|
@@ -497,10 +497,10 @@ Check the render method of \`` + e + "`.";
|
|
|
497
497
|
function ut(e) {
|
|
498
498
|
{
|
|
499
499
|
if (e !== void 0) {
|
|
500
|
-
var r = e.fileName.replace(/^.*[\\\/]/, ""),
|
|
500
|
+
var r = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
|
|
501
501
|
return `
|
|
502
502
|
|
|
503
|
-
Check your code at ` + r + ":" +
|
|
503
|
+
Check your code at ` + r + ":" + n + ".";
|
|
504
504
|
}
|
|
505
505
|
return "";
|
|
506
506
|
}
|
|
@@ -510,10 +510,10 @@ Check your code at ` + r + ":" + a + ".";
|
|
|
510
510
|
{
|
|
511
511
|
var r = De();
|
|
512
512
|
if (!r) {
|
|
513
|
-
var
|
|
514
|
-
|
|
513
|
+
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
514
|
+
n && (r = `
|
|
515
515
|
|
|
516
|
-
Check the top-level render call using <` +
|
|
516
|
+
Check the top-level render call using <` + n + ">.");
|
|
517
517
|
}
|
|
518
518
|
return r;
|
|
519
519
|
}
|
|
@@ -523,12 +523,12 @@ Check the top-level render call using <` + a + ">.");
|
|
|
523
523
|
if (!e._store || e._store.validated || e.key != null)
|
|
524
524
|
return;
|
|
525
525
|
e._store.validated = !0;
|
|
526
|
-
var
|
|
527
|
-
if (Ae[
|
|
526
|
+
var n = ft(r);
|
|
527
|
+
if (Ae[n])
|
|
528
528
|
return;
|
|
529
|
-
Ae[
|
|
529
|
+
Ae[n] = !0;
|
|
530
530
|
var d = "";
|
|
531
|
-
e && e._owner && e._owner !== ge.current && (d = " It was passed a child from " + P(e._owner.type) + "."), X(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',
|
|
531
|
+
e && e._owner && e._owner !== ge.current && (d = " It was passed a child from " + P(e._owner.type) + "."), X(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, d), X(null);
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
function Me(e, r) {
|
|
@@ -536,8 +536,8 @@ Check the top-level render call using <` + a + ">.");
|
|
|
536
536
|
if (typeof e != "object")
|
|
537
537
|
return;
|
|
538
538
|
if (_e(e))
|
|
539
|
-
for (var
|
|
540
|
-
var d = e[
|
|
539
|
+
for (var n = 0; n < e.length; n++) {
|
|
540
|
+
var d = e[n];
|
|
541
541
|
Ne(d) && Le(d, r);
|
|
542
542
|
}
|
|
543
543
|
else if (Ne(e))
|
|
@@ -555,18 +555,18 @@ Check the top-level render call using <` + a + ">.");
|
|
|
555
555
|
var r = e.type;
|
|
556
556
|
if (r == null || typeof r == "string")
|
|
557
557
|
return;
|
|
558
|
-
var
|
|
558
|
+
var n;
|
|
559
559
|
if (typeof r == "function")
|
|
560
|
-
|
|
560
|
+
n = r.propTypes;
|
|
561
561
|
else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
|
|
562
562
|
// Inner props are checked in the reconciler.
|
|
563
563
|
r.$$typeof === x))
|
|
564
|
-
|
|
564
|
+
n = r.propTypes;
|
|
565
565
|
else
|
|
566
566
|
return;
|
|
567
|
-
if (
|
|
567
|
+
if (n) {
|
|
568
568
|
var d = P(r);
|
|
569
|
-
Ze(
|
|
569
|
+
Ze(n, e.props, "prop", d, e);
|
|
570
570
|
} else if (r.PropTypes !== void 0 && !be) {
|
|
571
571
|
be = !0;
|
|
572
572
|
var v = P(r);
|
|
@@ -577,8 +577,8 @@ Check the top-level render call using <` + a + ">.");
|
|
|
577
577
|
}
|
|
578
578
|
function dt(e) {
|
|
579
579
|
{
|
|
580
|
-
for (var r = Object.keys(e.props),
|
|
581
|
-
var d = r[
|
|
580
|
+
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
|
|
581
|
+
var d = r[n];
|
|
582
582
|
if (d !== "children" && d !== "key") {
|
|
583
583
|
X(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", d), X(null);
|
|
584
584
|
break;
|
|
@@ -587,7 +587,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
587
587
|
e.ref !== null && (X(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), X(null));
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
|
-
function We(e, r,
|
|
590
|
+
function We(e, r, n, d, v, b) {
|
|
591
591
|
{
|
|
592
592
|
var _ = q(e);
|
|
593
593
|
if (!_) {
|
|
@@ -598,7 +598,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
598
598
|
var w;
|
|
599
599
|
e === null ? w = "null" : _e(e) ? w = "array" : e !== void 0 && e.$$typeof === c ? (w = "<" + (P(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : w = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", w, h);
|
|
600
600
|
}
|
|
601
|
-
var R = ct(e, r,
|
|
601
|
+
var R = ct(e, r, n, v, b);
|
|
602
602
|
if (R == null)
|
|
603
603
|
return R;
|
|
604
604
|
if (_) {
|
|
@@ -617,11 +617,11 @@ Check the top-level render call using <` + a + ">.");
|
|
|
617
617
|
return e === u ? dt(R) : pt(R), R;
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
|
-
function mt(e, r,
|
|
621
|
-
return We(e, r,
|
|
620
|
+
function mt(e, r, n) {
|
|
621
|
+
return We(e, r, n, !0);
|
|
622
622
|
}
|
|
623
|
-
function kt(e, r,
|
|
624
|
-
return We(e, r,
|
|
623
|
+
function kt(e, r, n) {
|
|
624
|
+
return We(e, r, n, !1);
|
|
625
625
|
}
|
|
626
626
|
var ht = kt, _t = mt;
|
|
627
627
|
re.Fragment = u, re.jsx = ht, re.jsxs = _t;
|
|
@@ -630,16 +630,16 @@ Check the top-level render call using <` + a + ">.");
|
|
|
630
630
|
process.env.NODE_ENV === "production" ? xe.exports = bt() : xe.exports = Nt();
|
|
631
631
|
var Ee = xe.exports;
|
|
632
632
|
const V = Ee.Fragment, t = Ee.jsx, s = Ee.jsxs, ye = {}, yt = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';
|
|
633
|
-
function xt(
|
|
634
|
-
return !ye[
|
|
633
|
+
function xt(a, c) {
|
|
634
|
+
return !ye[a] && typeof window.fetch == "function" && (ye[a] = window.fetch(c + a + ".svg").then((i) => i.ok ? i.text() : (console.error("Missing icon: " + c + a + ".svg"), yt)).then((i) => i)), Promise.resolve(ye[a]);
|
|
635
635
|
}
|
|
636
|
-
const g = ({ name:
|
|
636
|
+
const g = ({ name: a, path: c, className: i = "", ...u }) => {
|
|
637
637
|
const l = "https://punkt-cdn.oslo.kommune.no/6.0/icons/", [f, m] = ue(null);
|
|
638
638
|
return vt(() => {
|
|
639
|
-
if (!
|
|
639
|
+
if (!a)
|
|
640
640
|
return;
|
|
641
|
-
xt(
|
|
642
|
-
}, [
|
|
641
|
+
xt(a, c || l).then((p) => m(p));
|
|
642
|
+
}, [a, c, l]), f ? /* @__PURE__ */ t(
|
|
643
643
|
"span",
|
|
644
644
|
{
|
|
645
645
|
className: `pkt-icon ${i}`,
|
|
@@ -649,7 +649,7 @@ const g = ({ name: n, path: c, className: i = "", ...u }) => {
|
|
|
649
649
|
) : null;
|
|
650
650
|
}, Be = B(
|
|
651
651
|
({
|
|
652
|
-
children:
|
|
652
|
+
children: a,
|
|
653
653
|
className: c,
|
|
654
654
|
skin: i = "info",
|
|
655
655
|
closeAlert: u = !1,
|
|
@@ -682,7 +682,7 @@ const g = ({ name: n, path: c, className: i = "", ...u }) => {
|
|
|
682
682
|
}
|
|
683
683
|
) }),
|
|
684
684
|
f && /* @__PURE__ */ t("div", { className: "pkt-alert__title", children: f }),
|
|
685
|
-
/* @__PURE__ */ t("div", { className: "pkt-alert__text", children:
|
|
685
|
+
/* @__PURE__ */ t("div", { className: "pkt-alert__text", children: a }),
|
|
686
686
|
m && /* @__PURE__ */ s("div", { className: "pkt-alert__date", children: [
|
|
687
687
|
"Sist oppdatert: ",
|
|
688
688
|
m
|
|
@@ -691,7 +691,7 @@ const g = ({ name: n, path: c, className: i = "", ...u }) => {
|
|
|
691
691
|
}
|
|
692
692
|
), ce = B(
|
|
693
693
|
({
|
|
694
|
-
children:
|
|
694
|
+
children: a,
|
|
695
695
|
className: c,
|
|
696
696
|
iconName: i = "user",
|
|
697
697
|
secondIconName: u = "user",
|
|
@@ -712,22 +712,22 @@ const g = ({ name: n, path: c, className: i = "", ...u }) => {
|
|
|
712
712
|
].filter(Boolean).join(" ");
|
|
713
713
|
return /* @__PURE__ */ s("button", { ...y, className: x, type: m, ref: N, children: [
|
|
714
714
|
o !== "label-only" && /* @__PURE__ */ t(g, { className: "pkt-btn__icon", name: i }),
|
|
715
|
-
/* @__PURE__ */ t("span", { className: "pkt-btn__text", children:
|
|
715
|
+
/* @__PURE__ */ t("span", { className: "pkt-btn__text", children: a }),
|
|
716
716
|
o === "icons-right-and-left" && /* @__PURE__ */ t(g, { className: "pkt-btn__icon", name: u })
|
|
717
717
|
] });
|
|
718
718
|
}
|
|
719
719
|
);
|
|
720
720
|
ce.displayName = "PktButton";
|
|
721
|
-
const Ot = ({ columnOne:
|
|
721
|
+
const Ot = ({ columnOne: a, columnTwo: c, socialLinks: i, className: u }) => {
|
|
722
722
|
var f, m;
|
|
723
723
|
const l = [u, "pkt-footer"].filter(Boolean).join(" ");
|
|
724
724
|
return /* @__PURE__ */ t("footer", { className: l, "data-mode": "dark", children: /* @__PURE__ */ s("div", { className: "pkt-footer__container", children: [
|
|
725
725
|
/* @__PURE__ */ s("div", { className: "pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16", children: [
|
|
726
726
|
/* @__PURE__ */ s("div", { className: "pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up", children: [
|
|
727
|
-
/* @__PURE__ */ t("h2", { className: "pkt-footer__title", children:
|
|
727
|
+
/* @__PURE__ */ t("h2", { className: "pkt-footer__title", children: a.title }),
|
|
728
728
|
/* @__PURE__ */ s("ul", { className: "pkt-footer__list", children: [
|
|
729
|
-
|
|
730
|
-
(f =
|
|
729
|
+
a.text && /* @__PURE__ */ t("li", { className: "pkt-footer__text", children: a.text }),
|
|
730
|
+
(f = a.links) == null ? void 0 : f.map((o, p) => /* @__PURE__ */ t("li", { className: "pkt-footer__list-item", children: /* @__PURE__ */ s(
|
|
731
731
|
"a",
|
|
732
732
|
{
|
|
733
733
|
className: `pkt-footer__link ${o.external ? "pkt-link--external" : ""}`,
|
|
@@ -814,12 +814,12 @@ const Ot = ({ columnOne: n, columnTwo: c, socialLinks: i, className: u }) => {
|
|
|
814
814
|
] })
|
|
815
815
|
] }) });
|
|
816
816
|
}, $t = ({
|
|
817
|
-
links:
|
|
817
|
+
links: a = [],
|
|
818
818
|
className: c
|
|
819
819
|
}) => {
|
|
820
820
|
const i = [c, "pkt-footer-simple"].filter(Boolean).join(" ");
|
|
821
821
|
return /* @__PURE__ */ t("footer", { className: i, "data-mode": "dark", children: /* @__PURE__ */ t("div", { className: "pkt-footer-simple__container", children: /* @__PURE__ */ s("ul", { className: "pkt-footer-simple__list", children: [
|
|
822
|
-
|
|
822
|
+
a.map((u, l) => /* @__PURE__ */ t("li", { className: "pkt-footer-simple__list-item", children: /* @__PURE__ */ s(
|
|
823
823
|
"a",
|
|
824
824
|
{
|
|
825
825
|
className: `pkt-footer-simple__link ${u.external ? " pkt-link--external" : ""}`,
|
|
@@ -854,7 +854,7 @@ var He = { exports: {} };
|
|
|
854
854
|
Licensed under the MIT License (MIT), see
|
|
855
855
|
http://jedwatson.github.io/classnames
|
|
856
856
|
*/
|
|
857
|
-
(function(
|
|
857
|
+
(function(a) {
|
|
858
858
|
(function() {
|
|
859
859
|
var c = {}.hasOwnProperty;
|
|
860
860
|
function i() {
|
|
@@ -881,13 +881,13 @@ var He = { exports: {} };
|
|
|
881
881
|
}
|
|
882
882
|
return u.join(" ");
|
|
883
883
|
}
|
|
884
|
-
|
|
884
|
+
a.exports ? (i.default = i, a.exports = i) : window.classNames = i;
|
|
885
885
|
})();
|
|
886
886
|
})(He);
|
|
887
887
|
var Et = He.exports;
|
|
888
888
|
const Ge = /* @__PURE__ */ gt(Et), It = B(
|
|
889
889
|
({
|
|
890
|
-
logoLink:
|
|
890
|
+
logoLink: a = "https://www.oslo.kommune.no/",
|
|
891
891
|
serviceName: c,
|
|
892
892
|
fixed: i = !0,
|
|
893
893
|
scrollToHide: u = !0,
|
|
@@ -939,7 +939,7 @@ const Ge = /* @__PURE__ */ gt(Et), It = B(
|
|
|
939
939
|
ref: F,
|
|
940
940
|
children: [
|
|
941
941
|
/* @__PURE__ */ s("div", { className: "pkt-header__logo", children: [
|
|
942
|
-
/* @__PURE__ */ t("a", { "aria-label": "Tilbake til forside", className: "pkt-header__logo-link", href:
|
|
942
|
+
typeof a == "string" ? /* @__PURE__ */ t("a", { "aria-label": "Tilbake til forside", className: "pkt-header__logo-link", href: a, children: /* @__PURE__ */ t(
|
|
943
943
|
g,
|
|
944
944
|
{
|
|
945
945
|
name: "oslologo",
|
|
@@ -947,7 +947,23 @@ const Ge = /* @__PURE__ */ gt(Et), It = B(
|
|
|
947
947
|
"aria-hidden": "true",
|
|
948
948
|
path: "https://punkt-cdn.oslo.kommune.no/6.0/logos/"
|
|
949
949
|
}
|
|
950
|
-
) })
|
|
950
|
+
) }) : /* @__PURE__ */ t(
|
|
951
|
+
"button",
|
|
952
|
+
{
|
|
953
|
+
"aria-label": "Tilbake til forside",
|
|
954
|
+
className: "pkt-link-button pkt-link pkt-header__logo-link",
|
|
955
|
+
onClick: a,
|
|
956
|
+
children: /* @__PURE__ */ t(
|
|
957
|
+
g,
|
|
958
|
+
{
|
|
959
|
+
name: "oslologo",
|
|
960
|
+
className: "pkt-header__logo-svg",
|
|
961
|
+
"aria-hidden": "true",
|
|
962
|
+
path: "https://punkt-cdn.oslo.kommune.no/6.0/logos/"
|
|
963
|
+
}
|
|
964
|
+
)
|
|
965
|
+
}
|
|
966
|
+
),
|
|
951
967
|
/* @__PURE__ */ t("span", { className: "pkt-header__logo-service", children: c })
|
|
952
968
|
] }),
|
|
953
969
|
/* @__PURE__ */ t("nav", { className: "pkt-header__actions", children: /* @__PURE__ */ s("ul", { className: "pkt-header__actions-row", children: [
|
|
@@ -1060,8 +1076,8 @@ const Ge = /* @__PURE__ */ gt(Et), It = B(
|
|
|
1060
1076
|
);
|
|
1061
1077
|
}
|
|
1062
1078
|
), wt = D.forwardRef(
|
|
1063
|
-
({ label:
|
|
1064
|
-
/* @__PURE__ */ t("label", { htmlFor: c, className: "pkt-form-label", children:
|
|
1079
|
+
({ label: a, id: c, children: i, ...u }, l) => /* @__PURE__ */ s("div", { className: "pkt-form-group", children: [
|
|
1080
|
+
/* @__PURE__ */ t("label", { htmlFor: c, className: "pkt-form-label", children: a }),
|
|
1065
1081
|
/* @__PURE__ */ t("input", { className: "pkt-form-input", id: c, ...u, ref: l }),
|
|
1066
1082
|
i
|
|
1067
1083
|
] })
|
|
@@ -1069,7 +1085,7 @@ const Ge = /* @__PURE__ */ gt(Et), It = B(
|
|
|
1069
1085
|
wt.displayName = "PktInput";
|
|
1070
1086
|
const Rt = B(
|
|
1071
1087
|
({
|
|
1072
|
-
children:
|
|
1088
|
+
children: a,
|
|
1073
1089
|
className: c,
|
|
1074
1090
|
iconName: i = "user",
|
|
1075
1091
|
openInNewTab: u = !1,
|
|
@@ -1091,7 +1107,7 @@ const Rt = B(
|
|
|
1091
1107
|
/* @__PURE__ */ t(g, { className: "pkt-link__icon", name: i }),
|
|
1092
1108
|
/* @__PURE__ */ s("div", { className: "pkt-linkcard__content", children: [
|
|
1093
1109
|
/* @__PURE__ */ t("div", { className: `pkt-linkcard__title ${m ? "pkt-link pkt-link--external" : ""}`, children: o }),
|
|
1094
|
-
/* @__PURE__ */ t("div", { className: "pkt-linkcard__text", children:
|
|
1110
|
+
/* @__PURE__ */ t("div", { className: "pkt-linkcard__text", children: a })
|
|
1095
1111
|
] })
|
|
1096
1112
|
]
|
|
1097
1113
|
}
|
|
@@ -1100,7 +1116,7 @@ const Rt = B(
|
|
|
1100
1116
|
);
|
|
1101
1117
|
Rt.displayName = "PktLinkCard";
|
|
1102
1118
|
const Ft = ({
|
|
1103
|
-
children:
|
|
1119
|
+
children: a,
|
|
1104
1120
|
skin: c = "beige",
|
|
1105
1121
|
title: i,
|
|
1106
1122
|
...u
|
|
@@ -1108,23 +1124,23 @@ const Ft = ({
|
|
|
1108
1124
|
const l = ["pkt-messagebox", c && `pkt-messagebox--${c}`].filter(Boolean).join(" ");
|
|
1109
1125
|
return /* @__PURE__ */ s("div", { ...u, className: l, children: [
|
|
1110
1126
|
/* @__PURE__ */ t("div", { className: "pkt-messagebox__title", children: i }),
|
|
1111
|
-
/* @__PURE__ */ t("div", { className: "pkt-messagebox__text", children:
|
|
1127
|
+
/* @__PURE__ */ t("div", { className: "pkt-messagebox__text", children: a })
|
|
1112
1128
|
] });
|
|
1113
1129
|
}, Pt = B(
|
|
1114
|
-
({ id:
|
|
1115
|
-
/* @__PURE__ */ t("input", { type: "radio", className: "pkt-form-check-input", id:
|
|
1116
|
-
/* @__PURE__ */ t("label", { className: "pkt-form-label", htmlFor:
|
|
1130
|
+
({ id: a, name: c, label: i, value: u, ...l }, f) => /* @__PURE__ */ s("div", { className: "pkt-form-group", children: [
|
|
1131
|
+
/* @__PURE__ */ t("input", { type: "radio", className: "pkt-form-check-input", id: a, name: c, value: u, ref: f, ...l }),
|
|
1132
|
+
/* @__PURE__ */ t("label", { className: "pkt-form-label", htmlFor: a, children: i })
|
|
1117
1133
|
] })
|
|
1118
1134
|
);
|
|
1119
1135
|
Pt.displayName = "PktRadio";
|
|
1120
|
-
const Dt = ({ label:
|
|
1121
|
-
/* @__PURE__ */ t("p", { children:
|
|
1136
|
+
const Dt = ({ label: a, children: c }) => /* @__PURE__ */ s(V, { children: [
|
|
1137
|
+
/* @__PURE__ */ t("p", { children: a }),
|
|
1122
1138
|
/* @__PURE__ */ t("div", { className: "pkt-form-group", children: c })
|
|
1123
|
-
] }), Tt = ({ isResponsive:
|
|
1124
|
-
isResponsive:
|
|
1139
|
+
] }), Tt = ({ isResponsive: a, children: c }) => a ? /* @__PURE__ */ t("div", { className: "pkt-table-container", children: c }) : /* @__PURE__ */ t(V, { children: c }), At = ({
|
|
1140
|
+
isResponsive: a,
|
|
1125
1141
|
modifiers: { info: c = !1, success: i = !1, strong: u = !1, shadow: l = !1 } = {},
|
|
1126
1142
|
children: f
|
|
1127
|
-
}) => /* @__PURE__ */ t(Tt, { isResponsive:
|
|
1143
|
+
}) => /* @__PURE__ */ t(Tt, { isResponsive: a, children: /* @__PURE__ */ t(
|
|
1128
1144
|
"table",
|
|
1129
1145
|
{
|
|
1130
1146
|
className: Ge("pkt-table", {
|
|
@@ -1135,8 +1151,8 @@ const Dt = ({ label: n, children: c }) => /* @__PURE__ */ s(V, { children: [
|
|
|
1135
1151
|
}),
|
|
1136
1152
|
children: f
|
|
1137
1153
|
}
|
|
1138
|
-
) }), Lt = ({ children:
|
|
1139
|
-
children:
|
|
1154
|
+
) }), Lt = ({ children: a }) => /* @__PURE__ */ t("td", { className: "pkt-table__th", children: a }), Mt = ({ children: a }) => /* @__PURE__ */ t("th", { className: "pkt-table__th", children: a }), Ct = B(({
|
|
1155
|
+
children: a,
|
|
1140
1156
|
className: c,
|
|
1141
1157
|
skin: i = "blue",
|
|
1142
1158
|
textStyle: u = "normal-text",
|
|
@@ -1177,7 +1193,7 @@ const Dt = ({ label: n, children: c }) => /* @__PURE__ */ s(V, { children: [
|
|
|
1177
1193
|
ref: N,
|
|
1178
1194
|
children: [
|
|
1179
1195
|
/* @__PURE__ */ t(g, { className: "pkt-tag__icon", name: m }),
|
|
1180
|
-
|
|
1196
|
+
a,
|
|
1181
1197
|
/* @__PURE__ */ t(g, { className: "pkt-tag__close-btn", name: "close" })
|
|
1182
1198
|
]
|
|
1183
1199
|
}
|
|
@@ -1191,25 +1207,25 @@ const Dt = ({ label: n, children: c }) => /* @__PURE__ */ s(V, { children: [
|
|
|
1191
1207
|
ref: N,
|
|
1192
1208
|
children: [
|
|
1193
1209
|
/* @__PURE__ */ t(g, { className: "pkt-tag__close-btn", name: "close" }),
|
|
1194
|
-
|
|
1210
|
+
a
|
|
1195
1211
|
]
|
|
1196
1212
|
}
|
|
1197
1213
|
) }) : m ? /* @__PURE__ */ s("span", { className: I, children: [
|
|
1198
1214
|
/* @__PURE__ */ t(g, { className: "pkt-tag__icon", name: m }),
|
|
1199
|
-
|
|
1200
|
-
] }) : /* @__PURE__ */ t("span", { className: I, children:
|
|
1215
|
+
a
|
|
1216
|
+
] }) : /* @__PURE__ */ t("span", { className: I, children: a });
|
|
1201
1217
|
});
|
|
1202
1218
|
Ct.displayName = "PktTag";
|
|
1203
1219
|
const jt = B(
|
|
1204
|
-
({ id:
|
|
1205
|
-
/* @__PURE__ */ t("label", { htmlFor:
|
|
1206
|
-
/* @__PURE__ */ t("textarea", { className: "pkt-form-textarea", id:
|
|
1220
|
+
({ id: a, label: c, ...i }, u) => /* @__PURE__ */ s("div", { className: "pkt-form-group", children: [
|
|
1221
|
+
/* @__PURE__ */ t("label", { htmlFor: a, className: "pkt-form-label", children: c }),
|
|
1222
|
+
/* @__PURE__ */ t("textarea", { className: "pkt-form-textarea", id: a, ref: u, ...i })
|
|
1207
1223
|
] })
|
|
1208
1224
|
);
|
|
1209
1225
|
jt.displayName = "PktTextarea";
|
|
1210
1226
|
const Wt = B(
|
|
1211
1227
|
({
|
|
1212
|
-
id:
|
|
1228
|
+
id: a,
|
|
1213
1229
|
label: c,
|
|
1214
1230
|
name: i,
|
|
1215
1231
|
srOnlyLabel: u = !1,
|
|
@@ -1243,7 +1259,7 @@ const Wt = B(
|
|
|
1243
1259
|
/* @__PURE__ */ s(
|
|
1244
1260
|
G ? "div" : "label",
|
|
1245
1261
|
{
|
|
1246
|
-
htmlFor:
|
|
1262
|
+
htmlFor: a,
|
|
1247
1263
|
className: `pkt-textinput__label ${u ? "pkt-sr-only" : ""}`,
|
|
1248
1264
|
"aria-describedby": G ? "" : J,
|
|
1249
1265
|
children: [
|
|
@@ -1278,7 +1294,7 @@ const Wt = B(
|
|
|
1278
1294
|
/* @__PURE__ */ t(
|
|
1279
1295
|
"label",
|
|
1280
1296
|
{
|
|
1281
|
-
htmlFor:
|
|
1297
|
+
htmlFor: a,
|
|
1282
1298
|
className: "pkt-textinput__label pkt-sr-only",
|
|
1283
1299
|
"aria-describedby": J,
|
|
1284
1300
|
children: c
|
|
@@ -1293,8 +1309,8 @@ const Wt = B(
|
|
|
1293
1309
|
ref: A,
|
|
1294
1310
|
className: "pkt-textinput__input",
|
|
1295
1311
|
type: T,
|
|
1296
|
-
name: i ||
|
|
1297
|
-
id:
|
|
1312
|
+
name: i || a,
|
|
1313
|
+
id: a,
|
|
1298
1314
|
placeholder: x,
|
|
1299
1315
|
autoComplete: j,
|
|
1300
1316
|
value: I,
|
|
@@ -1313,8 +1329,8 @@ const Wt = B(
|
|
|
1313
1329
|
ref: A,
|
|
1314
1330
|
className: "pkt-textinput__input",
|
|
1315
1331
|
type: T,
|
|
1316
|
-
name: i ||
|
|
1317
|
-
id:
|
|
1332
|
+
name: i || a,
|
|
1333
|
+
id: a,
|
|
1318
1334
|
placeholder: x,
|
|
1319
1335
|
autoComplete: j,
|
|
1320
1336
|
value: I,
|
|
@@ -1337,8 +1353,8 @@ const Wt = B(
|
|
|
1337
1353
|
ref: A,
|
|
1338
1354
|
className: "pkt-textinput__input",
|
|
1339
1355
|
type: T,
|
|
1340
|
-
name: i ||
|
|
1341
|
-
id:
|
|
1356
|
+
name: i || a,
|
|
1357
|
+
id: a,
|
|
1342
1358
|
placeholder: x,
|
|
1343
1359
|
autoComplete: j,
|
|
1344
1360
|
value: I,
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(w,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],b):(w=typeof globalThis<"u"?globalThis:w||self,b(w["punkt-react"]={},w.React))})(this,function(w,b){"use strict";function Xe(
|
|
1
|
+
(function(w,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],b):(w=typeof globalThis<"u"?globalThis:w||self,b(w["punkt-react"]={},w.React))})(this,function(w,b){"use strict";function Xe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ue={exports:{}},Q={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Pe;function Ze(){if(Pe)return Q;Pe=1;var
|
|
9
|
+
*/var Pe;function Ze(){if(Pe)return Q;Pe=1;var n=b,c=Symbol.for("react.element"),s=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function m(o,p,E){var y,P={},S=null,O=null;E!==void 0&&(S=""+E),p.key!==void 0&&(S=""+p.key),p.ref!==void 0&&(O=p.ref);for(y in p)u.call(p,y)&&!f.hasOwnProperty(y)&&(P[y]=p[y]);if(o&&o.defaultProps)for(y in p=o.defaultProps,p)P[y]===void 0&&(P[y]=p[y]);return{$$typeof:c,type:o,key:S,ref:O,props:P,_owner:l.current}}return Q.Fragment=s,Q.jsx=m,Q.jsxs=m,Q}var ee={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var xe;function Qe(){return xe||(xe=1,process.env.NODE_ENV!=="production"&&function(){var
|
|
18
|
-
`+ve+e}}var ge=!1,oe;{var kt=typeof WeakMap=="function"?WeakMap:Map;oe=new kt}function Ae(e,r){if(!e||ge)return"";{var
|
|
17
|
+
*/var xe;function Qe(){return xe||(xe=1,process.env.NODE_ENV!=="production"&&function(){var n=b,c=Symbol.for("react.element"),s=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),o=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),D=Symbol.iterator,I="@@iterator";function A(e){if(e===null||typeof e!="object")return null;var r=D&&e[D]||e[I];return typeof r=="function"?r:null}var j=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(e){{for(var r=arguments.length,a=new Array(r>1?r-1:0),d=1;d<r;d++)a[d-1]=arguments[d];re("error",e,a)}}function re(e,r,a){{var d=j.ReactDebugCurrentFrame,g=d.getStackAddendum();g!==""&&(r+="%s",a=a.concat([g]));var N=a.map(function(_){return String(_)});N.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,N)}}var Y=!1,q=!1,H=!1,U=!1,L=!1,B;B=Symbol.for("react.module.reference");function J(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===f||L||e===l||e===E||e===y||U||e===O||Y||q||H||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===P||e.$$typeof===m||e.$$typeof===o||e.$$typeof===p||e.$$typeof===B||e.getModuleId!==void 0))}function z(e,r,a){var d=e.displayName;if(d)return d;var g=r.displayName||r.name||"";return g!==""?a+"("+g+")":a}function k(e){return e.displayName||"Context"}function C(e){if(e==null)return null;if(typeof e.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case s:return"Portal";case f:return"Profiler";case l:return"StrictMode";case E:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case o:var r=e;return k(r)+".Consumer";case m:var a=e;return k(a._context)+".Provider";case p:return z(e,e.render,"ForwardRef");case P:var d=e.displayName||null;return d!==null?d:C(e.type)||"Memo";case S:{var g=e,N=g._payload,_=g._init;try{return C(_(N))}catch{return null}}}return null}var V=Object.assign,K=0,me,ae,G,ke,he,Ie,Fe;function De(){}De.__reactDisabledLog=!0;function dt(){{if(K===0){me=console.log,ae=console.info,G=console.warn,ke=console.error,he=console.group,Ie=console.groupCollapsed,Fe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:De,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}K++}}function mt(){{if(K--,K===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},e,{value:me}),info:V({},e,{value:ae}),warn:V({},e,{value:G}),error:V({},e,{value:ke}),group:V({},e,{value:he}),groupCollapsed:V({},e,{value:Ie}),groupEnd:V({},e,{value:Fe})})}K<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var _e=j.ReactCurrentDispatcher,ve;function le(e,r,a){{if(ve===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);ve=d&&d[1]||""}return`
|
|
18
|
+
`+ve+e}}var ge=!1,oe;{var kt=typeof WeakMap=="function"?WeakMap:Map;oe=new kt}function Ae(e,r){if(!e||ge)return"";{var a=oe.get(e);if(a!==void 0)return a}var d;ge=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var N;N=_e.current,_e.current=null,dt();try{if(r){var _=function(){throw Error()};if(Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(M){d=M}Reflect.construct(e,[],_)}else{try{_.call()}catch(M){d=M}e.call(_.prototype)}}else{try{throw Error()}catch(M){d=M}e()}}catch(M){if(M&&d&&typeof M.stack=="string"){for(var h=M.stack.split(`
|
|
19
19
|
`),$=d.stack.split(`
|
|
20
20
|
`),T=h.length-1,R=$.length-1;T>=1&&R>=0&&h[T]!==$[R];)R--;for(;T>=1&&R>=0;T--,R--)if(h[T]!==$[R]){if(T!==1||R!==1)do if(T--,R--,R<0||h[T]!==$[R]){var F=`
|
|
21
|
-
`+h[T].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&oe.set(e,F),F}while(T>=1&&R>=0);break}}}finally{ge=!1,_e.current=N,mt(),Error.prepareStackTrace=
|
|
21
|
+
`+h[T].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&oe.set(e,F),F}while(T>=1&&R>=0);break}}}finally{ge=!1,_e.current=N,mt(),Error.prepareStackTrace=g}var Z=e?e.displayName||e.name:"",Ke=Z?le(Z):"";return typeof e=="function"&&oe.set(e,Ke),Ke}function ht(e,r,a){return Ae(e,!1)}function _t(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function ie(e,r,a){if(e==null)return"";if(typeof e=="function")return Ae(e,_t(e));if(typeof e=="string")return le(e);switch(e){case E:return le("Suspense");case y:return le("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return ht(e.render);case P:return ie(e.type,r,a);case S:{var d=e,g=d._payload,N=d._init;try{return ie(N(g),r,a)}catch{}}}return""}var se=Object.prototype.hasOwnProperty,Le={},Me=j.ReactDebugCurrentFrame;function ce(e){if(e){var r=e._owner,a=ie(e.type,e._source,r?r.type:null);Me.setExtraStackFrame(a)}else Me.setExtraStackFrame(null)}function vt(e,r,a,d,g){{var N=Function.call.bind(se);for(var _ in e)if(N(e,_)){var h=void 0;try{if(typeof e[_]!="function"){var $=Error((d||"React class")+": "+a+" type `"+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[_]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw $.name="Invariant Violation",$}h=e[_](r,_,d,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(T){h=T}h&&!(h instanceof Error)&&(ce(g),x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",d||"React class",a,_,typeof h),ce(null)),h instanceof Error&&!(h.message in Le)&&(Le[h.message]=!0,ce(g),x("Failed %s type: %s",a,h.message),ce(null))}}}var gt=Array.isArray;function be(e){return gt(e)}function bt(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function Nt(e){try{return We(e),!1}catch{return!0}}function We(e){return""+e}function Ye(e){if(Nt(e))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",bt(e)),We(e)}var ne=j.ReactCurrentOwner,yt={key:!0,ref:!0,__self:!0,__source:!0},Ue,Be,Ne;Ne={};function wt(e){if(se.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Et(e){if(se.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Pt(e,r){if(typeof e.ref=="string"&&ne.current&&r&&ne.current.stateNode!==r){var a=C(ne.current.type);Ne[a]||(x('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',C(ne.current.type),e.ref),Ne[a]=!0)}}function xt(e,r){{var a=function(){Ue||(Ue=!0,x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function Tt(e,r){{var a=function(){Be||(Be=!0,x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var Rt=function(e,r,a,d,g,N,_){var h={$$typeof:c,type:e,key:r,ref:a,props:_,_owner:N};return h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(h,"_self",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.defineProperty(h,"_source",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h};function Ct(e,r,a,d,g){{var N,_={},h=null,$=null;a!==void 0&&(Ye(a),h=""+a),Et(r)&&(Ye(r.key),h=""+r.key),wt(r)&&($=r.ref,Pt(r,g));for(N in r)se.call(r,N)&&!yt.hasOwnProperty(N)&&(_[N]=r[N]);if(e&&e.defaultProps){var T=e.defaultProps;for(N in T)_[N]===void 0&&(_[N]=T[N])}if(h||$){var R=typeof e=="function"?e.displayName||e.name||"Unknown":e;h&&xt(_,R),$&&Tt(_,R)}return Rt(e,h,$,g,d,ne.current,_)}}var ye=j.ReactCurrentOwner,Ve=j.ReactDebugCurrentFrame;function X(e){if(e){var r=e._owner,a=ie(e.type,e._source,r?r.type:null);Ve.setExtraStackFrame(a)}else Ve.setExtraStackFrame(null)}var we;we=!1;function Ee(e){return typeof e=="object"&&e!==null&&e.$$typeof===c}function He(){{if(ye.current){var e=C(ye.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function St(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function St(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),a=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+r+":"+
|
|
25
|
+
Check your code at `+r+":"+a+"."}return""}}var Ge={};function jt(e){{var r=He();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+
|
|
27
|
+
Check the top-level render call using <`+a+">.")}return r}}function qe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=jt(r);if(Ge[a])return;Ge[a]=!0;var d="";e&&e._owner&&e._owner!==ye.current&&(d=" It was passed a child from "+C(e._owner.type)+"."),X(e),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,d),X(null)}}function Je(e,r){{if(typeof e!="object")return;if(be(e))for(var a=0;a<e.length;a++){var d=e[a];Ee(d)&&qe(d,r)}else if(Ee(e))e._store&&(e._store.validated=!0);else if(e){var g=A(e);if(typeof g=="function"&&g!==e.entries)for(var N=g.call(e),_;!(_=N.next()).done;)Ee(_.value)&&qe(_.value,r)}}}function Ot(e){{var r=e.type;if(r==null||typeof r=="string")return;var a;if(typeof r=="function")a=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===p||r.$$typeof===P))a=r.propTypes;else return;if(a){var d=C(r);vt(a,e.props,"prop",d,e)}else if(r.PropTypes!==void 0&&!we){we=!0;var g=C(r);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",g||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $t(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var d=r[a];if(d!=="children"&&d!=="key"){X(e),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",d),X(null);break}}e.ref!==null&&(X(e),x("Invalid attribute `ref` supplied to `React.Fragment`."),X(null))}}function ze(e,r,a,d,g,N){{var _=J(e);if(!_){var h="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var $=St(g);$?h+=$:h+=He();var T;e===null?T="null":be(e)?T="array":e!==void 0&&e.$$typeof===c?(T="<"+(C(e.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):T=typeof e,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",T,h)}var R=Ct(e,r,a,g,N);if(R==null)return R;if(_){var F=r.children;if(F!==void 0)if(d)if(be(F)){for(var Z=0;Z<F.length;Z++)Je(F[Z],e);Object.freeze&&Object.freeze(F)}else x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Je(F,e)}return e===u?$t(R):Ot(R),R}}function It(e,r,a){return ze(e,r,a,!0)}function Ft(e,r,a){return ze(e,r,a,!1)}var Dt=Ft,At=It;ee.Fragment=u,ee.jsx=Dt,ee.jsxs=At}()),ee}process.env.NODE_ENV==="production"?ue.exports=Ze():ue.exports=Qe();var fe=ue.exports;const W=fe.Fragment,t=fe.jsx,i=fe.jsxs,pe={},et='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function tt(n,c){return!pe[n]&&typeof window.fetch=="function"&&(pe[n]=window.fetch(c+n+".svg").then(s=>s.ok?s.text():(console.error("Missing icon: "+c+n+".svg"),et)).then(s=>s)),Promise.resolve(pe[n])}const v=({name:n,path:c,className:s="",...u})=>{const l="https://punkt-cdn.oslo.kommune.no/6.0/icons/",[f,m]=b.useState(null);return b.useEffect(()=>{if(!n)return;tt(n,c||l).then(p=>m(p))},[n,c,l]),f?t("span",{className:`pkt-icon ${s}`,dangerouslySetInnerHTML:{__html:f},...u}):null},de=b.forwardRef(({children:n,className:c,skin:s="info",closeAlert:u=!1,onClose:l,title:f,date:m,ariaLive:o="polite",...p},E)=>{const y=[c,"pkt-alert",s&&`pkt-alert--${s}`].filter(Boolean).join(" "),[P,S]=b.useState(!0),O=()=>{S(!1),l&&l()};return P?i("div",{...p,className:y,"aria-live":o,ref:E,children:[t(v,{className:"pkt-alert__icon",name:s==="info"?"alert-information":`alert-${s}`}),u&&t("div",{className:"pkt-alert__close",children:t("button",{type:"button",className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",tabIndex:0,"aria-label":"close",onClick:O,children:t(v,{name:"close",className:"pkt-btn__icon","aria-hidden":"true"})})}),f&&t("div",{className:"pkt-alert__title",children:f}),t("div",{className:"pkt-alert__text",children:n}),m&&i("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",m]})]}):null}),te=b.forwardRef(({children:n,className:c,iconName:s="user",secondIconName:u="user",size:l="medium",skin:f="primary",type:m="button",variant:o="label-only",color:p,...E},y)=>{const P=[c,"pkt-btn",l&&`pkt-btn--${l}`,f&&`pkt-btn--${f}`,o&&`pkt-btn--${o}`,p&&`pkt-btn--${p}`].filter(Boolean).join(" ");return i("button",{...E,className:P,type:m,ref:y,children:[o!=="label-only"&&t(v,{className:"pkt-btn__icon",name:s}),t("span",{className:"pkt-btn__text",children:n}),o==="icons-right-and-left"&&t(v,{className:"pkt-btn__icon",name:u})]})});te.displayName="PktButton";const rt=({columnOne:n,columnTwo:c,socialLinks:s,className:u})=>{var f,m;const l=[u,"pkt-footer"].filter(Boolean).join(" ");return t("footer",{className:l,"data-mode":"dark",children:i("div",{className:"pkt-footer__container",children:[i("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[i("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[t("h2",{className:"pkt-footer__title",children:n.title}),i("ul",{className:"pkt-footer__list",children:[n.text&&t("li",{className:"pkt-footer__text",children:n.text}),(f=n.links)==null?void 0:f.map((o,p)=>t("li",{className:"pkt-footer__list-item",children:i("a",{className:`pkt-footer__link ${o.external?"pkt-link--external":""}`,href:o.href,target:o.openInNewTab?"_blank":"_self",rel:o.openInNewTab?"noopener noreferrer":void 0,children:[t(v,{className:"pkt-footer__link-icon",name:"chevron-right"}),o.text]})},`links-${p}`))]})]}),i("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[t("h2",{className:"pkt-footer__title",children:c.title}),i("ul",{className:"pkt-footer__list",children:[c.text&&t("li",{className:"pkt-footer__text",children:c.text}),(m=c.links)==null?void 0:m.map((o,p)=>t("li",{className:"pkt-footer__list-item",children:i("a",{className:`pkt-footer__link ${o.external?"pkt-link--external":""}`,href:o.href,target:o.openInNewTab?"_blank":"_self",rel:o.openInNewTab?"noopener noreferrer":void 0,children:[t(v,{className:"pkt-footer__link-icon",name:"chevron-right"}),o.text]})},`links-${p}`))]})]}),i("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[t("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),i("ul",{className:"pkt-footer__list",children:[t("li",{className:"pkt-footer__list-item",children:i("a",{className:"pkt-footer__link",href:"https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",children:[t(v,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),t("li",{className:"pkt-footer__list-item",children:i("a",{className:"pkt-footer__link",href:"https://www.oslo.kommune.no/tilgjengelighet/",children:[t(v,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),s&&i("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[t("div",{className:"pkt-footer__social-languages",children:s.filter(o=>o.language).map((o,p)=>t("div",{className:"pkt-footer__social-language",children:t("a",{href:o.href,"aria-label":`til ${o.language} versjon av nettsiden`,target:o.openInNewTab?"_blank":"_self",rel:o.openInNewTab?"noopener noreferrer":void 0,children:o.language})},`sociallinks-language-${p}`))}),t("div",{className:"pkt-footer__social-icons",children:s.filter(o=>o.iconName).map((o,p)=>t(b.Fragment,{children:t("a",{href:o.href,"aria-label":`til ${o.iconName}`,className:"pkt-footer__social-icon-link",target:o.openInNewTab?"_blank":"_self",rel:o.openInNewTab?"noopener noreferrer":void 0,children:t(v,{className:"pkt-footer__social-icon",name:o.iconName})})},`sociallinks-${p}`))})]})]})})},nt=({links:n=[],className:c})=>{const s=[c,"pkt-footer-simple"].filter(Boolean).join(" ");return t("footer",{className:s,"data-mode":"dark",children:t("div",{className:"pkt-footer-simple__container",children:i("ul",{className:"pkt-footer-simple__list",children:[n.map((u,l)=>t("li",{className:"pkt-footer-simple__list-item",children:i("a",{className:`pkt-footer-simple__link ${u.external?" pkt-link--external":""}`,href:u.href,target:u.openInNewTab?"_blank":"_self",rel:u.openInNewTab?"noopener noreferrer":void 0,children:[t(v,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),u.text]})},l)),t("li",{className:"pkt-footer-simple__list-item",children:i("a",{className:"pkt-footer-simple__link",href:"https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",children:[t(v,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),t("li",{className:"pkt-footer-simple__list-item",children:i("a",{className:"pkt-footer-simple__link",href:"https://www.oslo.kommune.no/tilgjengelighet/",children:[t(v,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})};var Te={exports:{}};/*!
|
|
28
28
|
Copyright (c) 2018 Jed Watson.
|
|
29
29
|
Licensed under the MIT License (MIT), see
|
|
30
30
|
http://jedwatson.github.io/classnames
|
|
31
|
-
*/(function(a){(function(){var c={}.hasOwnProperty;function s(){for(var u=[],l=0;l<arguments.length;l++){var f=arguments[l];if(f){var m=typeof f;if(m==="string"||m==="number")u.push(f);else if(Array.isArray(f)){if(f.length){var o=s.apply(null,f);o&&u.push(o)}}else if(m==="object"){if(f.toString!==Object.prototype.toString&&!f.toString.toString().includes("[native code]")){u.push(f.toString());continue}for(var p in f)c.call(f,p)&&f[p]&&u.push(p)}}}return u.join(" ")}a.exports?(s.default=s,a.exports=s):window.classNames=s})()})(Te);var at=Te.exports;const Re=Xe(at),lt=b.forwardRef(({logoLink:a="https://www.oslo.kommune.no/",serviceName:c,fixed:s=!0,scrollToHide:u=!0,user:l,userMenu:f,representing:m,userOptions:o,userMenuFooter:p,canChangeRepresentation:E=!0,showMenuButton:y=!1,showLogOutButton:P=!1,openMenu:S,logOut:O,changeRepresentation:D,...I},A)=>{const j=b.useMemo(()=>typeof(l==null?void 0:l.lastLoggedIn)=="string"?l.lastLoggedIn:l!=null&&l.lastLoggedIn?new Date(l.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[l]),[x,re]=b.useState(!1),[Y,q]=b.useState(0),[H,U]=b.useState(!1),L=b.useRef(null);b.useEffect(()=>(document.addEventListener("mouseup",J),window.addEventListener("scroll",z),()=>{document.removeEventListener("mouseup",J),window.removeEventListener("scroll",z)}));const B=()=>{U(!H)},J=k=>{L.current&&!L.current.contains(k.target)&&U(!1)},z=()=>{if(u){const k=window.pageYOffset||document.documentElement.scrollTop;if(k<0||Math.abs(k-Y)<60)return;re(k>Y),q(k)}};return i("header",{...I,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:Re("pkt-header",{"pkt-header--fixed":s,"pkt-header--scroll-to-hide":u,"pkt-header--hidden":x}),ref:A,children:[i("div",{className:"pkt-header__logo",children:[t("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:a,children:t(g,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/6.0/logos/"})}),t("span",{className:"pkt-header__logo-service",children:c})]}),t("nav",{className:"pkt-header__actions",children:i("ul",{className:"pkt-header__actions-row",children:[y&&t("li",{children:t(te,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:S,children:"Meny"})}),(l||m)&&i("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${H&&!x?"pkt-header--open-dropdown":""}`,ref:L,children:[i("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":H,onClick:B,children:[t(g,{name:"user",className:"pkt-btn__icon"}),t("span",{className:"pkt-header__user-fullname",children:(m==null?void 0:m.name)||(l==null?void 0:l.name)}),t("span",{className:"pkt-header__user-shortname",children:(m==null?void 0:m.shortname)||(l==null?void 0:l.shortname)}),t(g,{name:"chevron-thin-down",className:"pkt-btn--closed"}),t(g,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),i("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[l&&i("li",{children:[t("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),t("div",{className:"pkt-user-menu__name",children:l.name}),l.lastLoggedIn&&i("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",t("time",{children:j})]})]}),f&&t("li",{children:t("ul",{className:"pkt-list",children:f.map((k,C)=>t("li",{children:typeof k.target=="string"?i("a",{href:k.target,className:"pkt-link",children:[k.iconName&&t(g,{name:k.iconName,className:"pkt-link__icon"}),k.title]}):i("button",{className:"pkt-link-button pkt-link",onClick:k.target,children:[k.iconName&&t(g,{name:k.iconName,className:"pkt-link__icon"}),k.title]})},`userMenu-${C}`))})}),(m||E)&&i("li",{children:[m&&i(W,{children:[t("div",{className:"pkt-user-menu__label",children:"Representerer"}),t("div",{className:"pkt-user-menu__name",children:m.name}),m.orgNumber&&i("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",m.orgNumber]})]}),t("ul",{className:"pkt-list mt-size-16",children:E&&t("li",{children:i("button",{className:"pkt-link-button pkt-link",onClick:D,children:[t(g,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),t("li",{children:t("ul",{className:"pkt-list",children:(o||!P)&&i(W,{children:[o==null?void 0:o.map((k,C)=>t("li",{children:typeof k.target=="string"?i("a",{href:k.target,className:"pkt-link",children:[k.iconName&&t(g,{name:k.iconName,className:"pkt-link__icon"}),k.title]}):i("button",{className:"pkt-link-button pkt-link",onClick:k.target,children:[k.iconName&&t(g,{name:k.iconName,className:"pkt-link__icon"}),k.title]})},`userOptions-${C}`)),!P&&t("li",{children:i("button",{className:"pkt-link-button pkt-link",onClick:O,children:[t(g,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),p&&t("li",{className:"footer",children:t("ul",{className:"pkt-list-horizontal bordered",children:p.map((k,C)=>t("li",{children:typeof k.target=="string"?t("a",{href:k.target,className:"pkt-link",children:k.title}):t("button",{className:"pkt-link-button pkt-link",onClick:k.target,children:k.title})},`userMenuFooter-${C}`))})})]})]}),P&&t("li",{children:t(te,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:O,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),Ce=b.forwardRef(({label:a,id:c,children:s,...u},l)=>i("div",{className:"pkt-form-group",children:[t("label",{htmlFor:c,className:"pkt-form-label",children:a}),t("input",{className:"pkt-form-input",id:c,...u,ref:l}),s]}));Ce.displayName="PktInput";const Se=b.forwardRef(({children:a,className:c,iconName:s="user",openInNewTab:u=!1,skin:l="normal",href:f="#",external:m=!1,title:o},p)=>{const E=[c,"pkt-linkcard",l&&`pkt-linkcard--${l}`].filter(Boolean).join(" ");return i("a",{href:f,className:`pkt-linkcard pkt-link ${E}`,target:u?"_blank":"_self",rel:u?"noopener noreferrer":void 0,ref:p,children:[t(g,{className:"pkt-link__icon",name:s}),i("div",{className:"pkt-linkcard__content",children:[t("div",{className:`pkt-linkcard__title ${m?"pkt-link pkt-link--external":""}`,children:o}),t("div",{className:"pkt-linkcard__text",children:a})]})]})});Se.displayName="PktLinkCard";const ot=({children:a,skin:c="beige",title:s,...u})=>{const l=["pkt-messagebox",c&&`pkt-messagebox--${c}`].filter(Boolean).join(" ");return i("div",{...u,className:l,children:[t("div",{className:"pkt-messagebox__title",children:s}),t("div",{className:"pkt-messagebox__text",children:a})]})},je=b.forwardRef(({id:a,name:c,label:s,value:u,...l},f)=>i("div",{className:"pkt-form-group",children:[t("input",{type:"radio",className:"pkt-form-check-input",id:a,name:c,value:u,ref:f,...l}),t("label",{className:"pkt-form-label",htmlFor:a,children:s})]}));je.displayName="PktRadio";const it=({label:a,children:c})=>i(W,{children:[t("p",{children:a}),t("div",{className:"pkt-form-group",children:c})]}),st=({isResponsive:a,children:c})=>a?t("div",{className:"pkt-table-container",children:c}):t(W,{children:c}),ct=({isResponsive:a,modifiers:{info:c=!1,success:s=!1,strong:u=!1,shadow:l=!1}={},children:f})=>t(st,{isResponsive:a,children:t("table",{className:Re("pkt-table",{"pkt-table--info":c,"pkt-table--success":s,"pkt-table--strong":u,"pkt-table--shadow":l}),children:f})}),ut=({children:a})=>t("td",{className:"pkt-table__th",children:a}),ft=({children:a})=>t("th",{className:"pkt-table__th",children:a}),Oe=b.forwardRef(({children:a,className:c,skin:s="blue",textStyle:u="normal-text",size:l="medium",closeTag:f=!1,iconName:m="",type:o="button",ariaLabel:p="close",onClick:E=()=>{}},y)=>{const[P,S]=b.useState(!1),O=j=>{S(!0),E(j)},D=["pkt-tag",l&&`pkt-tag--${l}`,s&&`pkt-tag--${s}`,u&&`pkt-tag--${u}`,c].filter(Boolean).join(" "),I=["pkt-tag","pkt-btn","pkt-btn--tertiary",l&&`pkt-tag--${l}`,s&&`pkt-tag--${s}`,u&&`pkt-tag--${u}`,m&&f?"pkt-btn--icons-right-and-left":null,f&&!m?"pkt-btn--icon-right":null,c].filter(Boolean).join(" "),A=!P;return f&&m?t(W,{children:A&&i("button",{className:I,type:o,"aria-label":p,onClick:O,ref:y,children:[t(g,{className:"pkt-tag__icon",name:m}),a,t(g,{className:"pkt-tag__close-btn",name:"close"})]})}):f?t(W,{children:A&&i("button",{className:I,type:o,"aria-label":p,onClick:O,ref:y,children:[t(g,{className:"pkt-tag__close-btn",name:"close"}),a]})}):m?i("span",{className:D,children:[t(g,{className:"pkt-tag__icon",name:m}),a]}):t("span",{className:D,children:a})});Oe.displayName="PktTag";const $e=b.forwardRef(({id:a,label:c,...s},u)=>i("div",{className:"pkt-form-group",children:[t("label",{htmlFor:a,className:"pkt-form-label",children:c}),t("textarea",{className:"pkt-form-textarea",id:a,ref:u,...s})]}));$e.displayName="PktTextarea";const pt=b.forwardRef(({id:a,label:c,name:s,srOnlyLabel:u=!1,helptext:l,helptextDropdown:f,helptextDropdownButton:m,optional:o=!1,required:p=!1,hasError:E=!1,errorMessage:y,placeholder:P,type:S="text",autocomplete:O="off",value:D,suffix:I,prefix:A,iconNameRight:j,disabled:x=!1,inline:re=!1,ariaLabelledby:Y,ariaDescribedby:q,className:H,...U},L)=>{const[B,J]=b.useState(!1),z=()=>{J(!B)},k=()=>o?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":p?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",C=o?"Valgfritt":p?"Må fylles ut":"",ae=[H,"pkt-textinput",x?"pkt-textinput--disabled":"",re?"pkt-textinput--inline":"",E?"pkt-textinput--error":""].join(" "),G=!!f&&f!=="";return i("div",{className:ae,children:[i(G?"div":"label",{htmlFor:a,className:`pkt-textinput__label ${u?"pkt-sr-only":""}`,"aria-describedby":G?"":q,children:[i(G?"h2":"span",{children:[c,C!==""&&t("span",{className:k(),children:C})]}),l&&t("div",{className:"pkt-textinput__helptext",children:l}),G&&i(W,{children:[t(te,{skin:"tertiary",size:"small",variant:"icon-right",iconName:B?"chevron-thin-up":"chevron-thin-down",className:"pkt-textinput__helptext-expandable pkt-link pkt-link--icon-right",onClick:z,children:m||i(W,{children:["Les mer ",t("span",{className:"pkt-sr-only",children:"om inputfeltet"})]})}),t("div",{className:`pkt-textinput__helptext ${B?"pkt-textinput__helptext-expandable-open":"pkt-textinput__helptext-expandable-closed"}`,children:t(de,{children:f})}),t("label",{htmlFor:a,className:"pkt-textinput__label pkt-sr-only","aria-describedby":q,children:c})]}),A&&i("div",{className:"pkt-textinput__input-prefix-wrapper",children:[t("div",{className:"pkt-textinput__input-prefix",children:A}),t("input",{ref:L,className:"pkt-textinput__input",type:S,name:s||a,id:a,placeholder:P,autoComplete:O,value:D,disabled:x,"aria-required":p,"aria-invalid":E,"aria-labelledby":Y,...U})]}),!A&&(I||j)&&i("div",{className:"pkt-textinput__input-suffix-wrapper",children:[t("input",{ref:L,className:"pkt-textinput__input",type:S,name:s||a,id:a,placeholder:P,autoComplete:O,value:D,disabled:x,"aria-required":p,"aria-invalid":E,"aria-labelledby":Y,...U}),I&&i("p",{className:"pkt-textinput__input-suffix",children:[I,j&&t(g,{className:"pkt-textinput__input-suffix-icon",name:j})]}),!I&&j&&t(g,{className:"pkt-textinput__input-icon",name:j})]}),!A&&!I&&!j&&!f&&t("input",{ref:L,className:"pkt-textinput__input",type:S,name:s||a,id:a,placeholder:P,autoComplete:O,value:D,disabled:x,"aria-required":p,"aria-invalid":E,"aria-labelledby":Y,...U})]}),E&&t(de,{skin:"error","aria-live":"assertive",children:y})]})});w.PktAlert=de,w.PktButton=te,w.PktFooter=rt,w.PktFooterSimple=nt,w.PktHeader=lt,w.PktIcon=g,w.PktInput=Ce,w.PktLinkCard=Se,w.PktMessagebox=ot,w.PktRadio=je,w.PktRadioGroup=it,w.PktTable=ct,w.PktTableData=ut,w.PktTableHeader=ft,w.PktTag=Oe,w.PktTextarea=$e,w.PktTextinput=pt,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
|
31
|
+
*/(function(n){(function(){var c={}.hasOwnProperty;function s(){for(var u=[],l=0;l<arguments.length;l++){var f=arguments[l];if(f){var m=typeof f;if(m==="string"||m==="number")u.push(f);else if(Array.isArray(f)){if(f.length){var o=s.apply(null,f);o&&u.push(o)}}else if(m==="object"){if(f.toString!==Object.prototype.toString&&!f.toString.toString().includes("[native code]")){u.push(f.toString());continue}for(var p in f)c.call(f,p)&&f[p]&&u.push(p)}}}return u.join(" ")}n.exports?(s.default=s,n.exports=s):window.classNames=s})()})(Te);var at=Te.exports;const Re=Xe(at),lt=b.forwardRef(({logoLink:n="https://www.oslo.kommune.no/",serviceName:c,fixed:s=!0,scrollToHide:u=!0,user:l,userMenu:f,representing:m,userOptions:o,userMenuFooter:p,canChangeRepresentation:E=!0,showMenuButton:y=!1,showLogOutButton:P=!1,openMenu:S,logOut:O,changeRepresentation:D,...I},A)=>{const j=b.useMemo(()=>typeof(l==null?void 0:l.lastLoggedIn)=="string"?l.lastLoggedIn:l!=null&&l.lastLoggedIn?new Date(l.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[l]),[x,re]=b.useState(!1),[Y,q]=b.useState(0),[H,U]=b.useState(!1),L=b.useRef(null);b.useEffect(()=>(document.addEventListener("mouseup",J),window.addEventListener("scroll",z),()=>{document.removeEventListener("mouseup",J),window.removeEventListener("scroll",z)}));const B=()=>{U(!H)},J=k=>{L.current&&!L.current.contains(k.target)&&U(!1)},z=()=>{if(u){const k=window.pageYOffset||document.documentElement.scrollTop;if(k<0||Math.abs(k-Y)<60)return;re(k>Y),q(k)}};return i("header",{...I,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:Re("pkt-header",{"pkt-header--fixed":s,"pkt-header--scroll-to-hide":u,"pkt-header--hidden":x}),ref:A,children:[i("div",{className:"pkt-header__logo",children:[typeof n=="string"?t("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:n,children:t(v,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/6.0/logos/"})}):t("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:n,children:t(v,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/6.0/logos/"})}),t("span",{className:"pkt-header__logo-service",children:c})]}),t("nav",{className:"pkt-header__actions",children:i("ul",{className:"pkt-header__actions-row",children:[y&&t("li",{children:t(te,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:S,children:"Meny"})}),(l||m)&&i("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${H&&!x?"pkt-header--open-dropdown":""}`,ref:L,children:[i("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":H,onClick:B,children:[t(v,{name:"user",className:"pkt-btn__icon"}),t("span",{className:"pkt-header__user-fullname",children:(m==null?void 0:m.name)||(l==null?void 0:l.name)}),t("span",{className:"pkt-header__user-shortname",children:(m==null?void 0:m.shortname)||(l==null?void 0:l.shortname)}),t(v,{name:"chevron-thin-down",className:"pkt-btn--closed"}),t(v,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),i("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[l&&i("li",{children:[t("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),t("div",{className:"pkt-user-menu__name",children:l.name}),l.lastLoggedIn&&i("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",t("time",{children:j})]})]}),f&&t("li",{children:t("ul",{className:"pkt-list",children:f.map((k,C)=>t("li",{children:typeof k.target=="string"?i("a",{href:k.target,className:"pkt-link",children:[k.iconName&&t(v,{name:k.iconName,className:"pkt-link__icon"}),k.title]}):i("button",{className:"pkt-link-button pkt-link",onClick:k.target,children:[k.iconName&&t(v,{name:k.iconName,className:"pkt-link__icon"}),k.title]})},`userMenu-${C}`))})}),(m||E)&&i("li",{children:[m&&i(W,{children:[t("div",{className:"pkt-user-menu__label",children:"Representerer"}),t("div",{className:"pkt-user-menu__name",children:m.name}),m.orgNumber&&i("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",m.orgNumber]})]}),t("ul",{className:"pkt-list mt-size-16",children:E&&t("li",{children:i("button",{className:"pkt-link-button pkt-link",onClick:D,children:[t(v,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),t("li",{children:t("ul",{className:"pkt-list",children:(o||!P)&&i(W,{children:[o==null?void 0:o.map((k,C)=>t("li",{children:typeof k.target=="string"?i("a",{href:k.target,className:"pkt-link",children:[k.iconName&&t(v,{name:k.iconName,className:"pkt-link__icon"}),k.title]}):i("button",{className:"pkt-link-button pkt-link",onClick:k.target,children:[k.iconName&&t(v,{name:k.iconName,className:"pkt-link__icon"}),k.title]})},`userOptions-${C}`)),!P&&t("li",{children:i("button",{className:"pkt-link-button pkt-link",onClick:O,children:[t(v,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),p&&t("li",{className:"footer",children:t("ul",{className:"pkt-list-horizontal bordered",children:p.map((k,C)=>t("li",{children:typeof k.target=="string"?t("a",{href:k.target,className:"pkt-link",children:k.title}):t("button",{className:"pkt-link-button pkt-link",onClick:k.target,children:k.title})},`userMenuFooter-${C}`))})})]})]}),P&&t("li",{children:t(te,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:O,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),Ce=b.forwardRef(({label:n,id:c,children:s,...u},l)=>i("div",{className:"pkt-form-group",children:[t("label",{htmlFor:c,className:"pkt-form-label",children:n}),t("input",{className:"pkt-form-input",id:c,...u,ref:l}),s]}));Ce.displayName="PktInput";const Se=b.forwardRef(({children:n,className:c,iconName:s="user",openInNewTab:u=!1,skin:l="normal",href:f="#",external:m=!1,title:o},p)=>{const E=[c,"pkt-linkcard",l&&`pkt-linkcard--${l}`].filter(Boolean).join(" ");return i("a",{href:f,className:`pkt-linkcard pkt-link ${E}`,target:u?"_blank":"_self",rel:u?"noopener noreferrer":void 0,ref:p,children:[t(v,{className:"pkt-link__icon",name:s}),i("div",{className:"pkt-linkcard__content",children:[t("div",{className:`pkt-linkcard__title ${m?"pkt-link pkt-link--external":""}`,children:o}),t("div",{className:"pkt-linkcard__text",children:n})]})]})});Se.displayName="PktLinkCard";const ot=({children:n,skin:c="beige",title:s,...u})=>{const l=["pkt-messagebox",c&&`pkt-messagebox--${c}`].filter(Boolean).join(" ");return i("div",{...u,className:l,children:[t("div",{className:"pkt-messagebox__title",children:s}),t("div",{className:"pkt-messagebox__text",children:n})]})},je=b.forwardRef(({id:n,name:c,label:s,value:u,...l},f)=>i("div",{className:"pkt-form-group",children:[t("input",{type:"radio",className:"pkt-form-check-input",id:n,name:c,value:u,ref:f,...l}),t("label",{className:"pkt-form-label",htmlFor:n,children:s})]}));je.displayName="PktRadio";const it=({label:n,children:c})=>i(W,{children:[t("p",{children:n}),t("div",{className:"pkt-form-group",children:c})]}),st=({isResponsive:n,children:c})=>n?t("div",{className:"pkt-table-container",children:c}):t(W,{children:c}),ct=({isResponsive:n,modifiers:{info:c=!1,success:s=!1,strong:u=!1,shadow:l=!1}={},children:f})=>t(st,{isResponsive:n,children:t("table",{className:Re("pkt-table",{"pkt-table--info":c,"pkt-table--success":s,"pkt-table--strong":u,"pkt-table--shadow":l}),children:f})}),ut=({children:n})=>t("td",{className:"pkt-table__th",children:n}),ft=({children:n})=>t("th",{className:"pkt-table__th",children:n}),Oe=b.forwardRef(({children:n,className:c,skin:s="blue",textStyle:u="normal-text",size:l="medium",closeTag:f=!1,iconName:m="",type:o="button",ariaLabel:p="close",onClick:E=()=>{}},y)=>{const[P,S]=b.useState(!1),O=j=>{S(!0),E(j)},D=["pkt-tag",l&&`pkt-tag--${l}`,s&&`pkt-tag--${s}`,u&&`pkt-tag--${u}`,c].filter(Boolean).join(" "),I=["pkt-tag","pkt-btn","pkt-btn--tertiary",l&&`pkt-tag--${l}`,s&&`pkt-tag--${s}`,u&&`pkt-tag--${u}`,m&&f?"pkt-btn--icons-right-and-left":null,f&&!m?"pkt-btn--icon-right":null,c].filter(Boolean).join(" "),A=!P;return f&&m?t(W,{children:A&&i("button",{className:I,type:o,"aria-label":p,onClick:O,ref:y,children:[t(v,{className:"pkt-tag__icon",name:m}),n,t(v,{className:"pkt-tag__close-btn",name:"close"})]})}):f?t(W,{children:A&&i("button",{className:I,type:o,"aria-label":p,onClick:O,ref:y,children:[t(v,{className:"pkt-tag__close-btn",name:"close"}),n]})}):m?i("span",{className:D,children:[t(v,{className:"pkt-tag__icon",name:m}),n]}):t("span",{className:D,children:n})});Oe.displayName="PktTag";const $e=b.forwardRef(({id:n,label:c,...s},u)=>i("div",{className:"pkt-form-group",children:[t("label",{htmlFor:n,className:"pkt-form-label",children:c}),t("textarea",{className:"pkt-form-textarea",id:n,ref:u,...s})]}));$e.displayName="PktTextarea";const pt=b.forwardRef(({id:n,label:c,name:s,srOnlyLabel:u=!1,helptext:l,helptextDropdown:f,helptextDropdownButton:m,optional:o=!1,required:p=!1,hasError:E=!1,errorMessage:y,placeholder:P,type:S="text",autocomplete:O="off",value:D,suffix:I,prefix:A,iconNameRight:j,disabled:x=!1,inline:re=!1,ariaLabelledby:Y,ariaDescribedby:q,className:H,...U},L)=>{const[B,J]=b.useState(!1),z=()=>{J(!B)},k=()=>o?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":p?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",C=o?"Valgfritt":p?"Må fylles ut":"",ae=[H,"pkt-textinput",x?"pkt-textinput--disabled":"",re?"pkt-textinput--inline":"",E?"pkt-textinput--error":""].join(" "),G=!!f&&f!=="";return i("div",{className:ae,children:[i(G?"div":"label",{htmlFor:n,className:`pkt-textinput__label ${u?"pkt-sr-only":""}`,"aria-describedby":G?"":q,children:[i(G?"h2":"span",{children:[c,C!==""&&t("span",{className:k(),children:C})]}),l&&t("div",{className:"pkt-textinput__helptext",children:l}),G&&i(W,{children:[t(te,{skin:"tertiary",size:"small",variant:"icon-right",iconName:B?"chevron-thin-up":"chevron-thin-down",className:"pkt-textinput__helptext-expandable pkt-link pkt-link--icon-right",onClick:z,children:m||i(W,{children:["Les mer ",t("span",{className:"pkt-sr-only",children:"om inputfeltet"})]})}),t("div",{className:`pkt-textinput__helptext ${B?"pkt-textinput__helptext-expandable-open":"pkt-textinput__helptext-expandable-closed"}`,children:t(de,{children:f})}),t("label",{htmlFor:n,className:"pkt-textinput__label pkt-sr-only","aria-describedby":q,children:c})]}),A&&i("div",{className:"pkt-textinput__input-prefix-wrapper",children:[t("div",{className:"pkt-textinput__input-prefix",children:A}),t("input",{ref:L,className:"pkt-textinput__input",type:S,name:s||n,id:n,placeholder:P,autoComplete:O,value:D,disabled:x,"aria-required":p,"aria-invalid":E,"aria-labelledby":Y,...U})]}),!A&&(I||j)&&i("div",{className:"pkt-textinput__input-suffix-wrapper",children:[t("input",{ref:L,className:"pkt-textinput__input",type:S,name:s||n,id:n,placeholder:P,autoComplete:O,value:D,disabled:x,"aria-required":p,"aria-invalid":E,"aria-labelledby":Y,...U}),I&&i("p",{className:"pkt-textinput__input-suffix",children:[I,j&&t(v,{className:"pkt-textinput__input-suffix-icon",name:j})]}),!I&&j&&t(v,{className:"pkt-textinput__input-icon",name:j})]}),!A&&!I&&!j&&!f&&t("input",{ref:L,className:"pkt-textinput__input",type:S,name:s||n,id:n,placeholder:P,autoComplete:O,value:D,disabled:x,"aria-required":p,"aria-invalid":E,"aria-labelledby":Y,...U})]}),E&&t(de,{skin:"error","aria-live":"assertive",children:y})]})});w.PktAlert=de,w.PktButton=te,w.PktFooter=rt,w.PktFooterSimple=nt,w.PktHeader=lt,w.PktIcon=v,w.PktInput=Ce,w.PktLinkCard=Se,w.PktMessagebox=ot,w.PktRadio=je,w.PktRadioGroup=it,w.PktTable=ct,w.PktTableData=ut,w.PktTableHeader=ft,w.PktTag=Oe,w.PktTextarea=$e,w.PktTextinput=pt,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.4",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
91
91
|
},
|
|
92
92
|
"license": "MIT",
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "1fbab870b9287160dfbb1eab54eb34d20cd85701"
|
|
94
94
|
}
|
|
@@ -13,7 +13,7 @@ interface User {
|
|
|
13
13
|
interface UserMenuItem {
|
|
14
14
|
iconName?: string
|
|
15
15
|
title: string
|
|
16
|
-
target: string |
|
|
16
|
+
target: string | (() => void)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
interface Representing {
|
|
@@ -24,11 +24,11 @@ interface Representing {
|
|
|
24
24
|
|
|
25
25
|
interface UserMenuFooterItem {
|
|
26
26
|
title: string
|
|
27
|
-
target: string |
|
|
27
|
+
target: string | (() => void)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
interface IPktHeader extends HTMLAttributes<HTMLDivElement> {
|
|
31
|
-
logoLink?: string
|
|
31
|
+
logoLink?: string | (() => void)
|
|
32
32
|
serviceName?: string
|
|
33
33
|
fixed?: boolean
|
|
34
34
|
scrollToHide?: boolean
|
|
@@ -133,14 +133,29 @@ export const PktHeader = forwardRef(
|
|
|
133
133
|
ref={ref}
|
|
134
134
|
>
|
|
135
135
|
<div className="pkt-header__logo">
|
|
136
|
-
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
{typeof logoLink === 'string' ? (
|
|
137
|
+
<a aria-label="Tilbake til forside" className="pkt-header__logo-link" href={logoLink}>
|
|
138
|
+
<PktIcon
|
|
139
|
+
name="oslologo"
|
|
140
|
+
className="pkt-header__logo-svg"
|
|
141
|
+
aria-hidden="true"
|
|
142
|
+
path="https://punkt-cdn.oslo.kommune.no/latest/logos/"
|
|
143
|
+
></PktIcon>
|
|
144
|
+
</a>
|
|
145
|
+
) : (
|
|
146
|
+
<button
|
|
147
|
+
aria-label="Tilbake til forside"
|
|
148
|
+
className="pkt-link-button pkt-link pkt-header__logo-link"
|
|
149
|
+
onClick={logoLink}
|
|
150
|
+
>
|
|
151
|
+
<PktIcon
|
|
152
|
+
name="oslologo"
|
|
153
|
+
className="pkt-header__logo-svg"
|
|
154
|
+
aria-hidden="true"
|
|
155
|
+
path="https://punkt-cdn.oslo.kommune.no/latest/logos/"
|
|
156
|
+
></PktIcon>
|
|
157
|
+
</button>
|
|
158
|
+
)}
|
|
144
159
|
<span className="pkt-header__logo-service">{serviceName}</span>
|
|
145
160
|
</div>
|
|
146
161
|
<nav className="pkt-header__actions">
|