@oslokommune/punkt-react 9.1.0 → 9.2.1
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 +20 -0
- package/dist/inputwrapper/InputWrapper.d.ts +2 -2
- package/dist/punkt-react.es.js +89 -92
- package/dist/punkt-react.umd.js +7 -7
- package/dist/select/Select.d.ts +2 -2
- package/dist/textarea/Textarea.d.ts +2 -2
- package/dist/textinput/Textinput.d.ts +2 -2
- package/package.json +4 -4
- package/src/components/inputwrapper/InputWrapper.tsx +18 -14
- package/src/components/select/Select.tsx +6 -7
- package/src/components/textarea/Textarea.tsx +7 -8
- package/src/components/textinput/Textinput.tsx +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [9.2.0](https://github.com/oslokommune/punkt/compare/9.1.0...9.2.0) (2023-10-10)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
* Props til inputs endret, required => requiredTag, optional => optionalTag (#1218). * feat(react,vue2,docs): Props til inputs endret, required => required, optional => optionalTag
|
|
15
|
+
|
|
16
|
+
Pluss fikset hjelpetekst i radio og checkbox, og useWrapper i komponenter som bruker inputWrapper
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
Ingen
|
|
21
|
+
|
|
22
|
+
### Chores
|
|
23
|
+
Ingen
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
|
|
8
28
|
## [9.1.0](https://github.com/oslokommune/punkt/compare/9.0.1...9.1.0) (2023-10-05)
|
|
9
29
|
|
|
10
30
|
### ⚠ BREAKING CHANGES
|
|
@@ -5,9 +5,9 @@ export interface IPktInputWrapper extends RefAttributes<HTMLElement> {
|
|
|
5
5
|
helptext?: string;
|
|
6
6
|
helptextDropdown?: string;
|
|
7
7
|
helptextDropdownButton?: string;
|
|
8
|
-
|
|
8
|
+
optionalTag?: boolean;
|
|
9
9
|
optionalText?: string;
|
|
10
|
-
|
|
10
|
+
requiredTag?: boolean;
|
|
11
11
|
requiredText?: string;
|
|
12
12
|
hasError?: boolean;
|
|
13
13
|
errorMessage?: string;
|
package/dist/punkt-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as b from "react";
|
|
2
2
|
import G, { useState as ue, useEffect as yt, forwardRef as B, useRef as on } from "react";
|
|
3
3
|
function sn(e) {
|
|
4
4
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -52,7 +52,7 @@ function un() {
|
|
|
52
52
|
return typeof u == "function" ? u : null;
|
|
53
53
|
}
|
|
54
54
|
var C = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
55
|
-
function
|
|
55
|
+
function g(t) {
|
|
56
56
|
{
|
|
57
57
|
for (var u = arguments.length, d = new Array(u > 1 ? u - 1 : 0), k = 1; k < u; k++)
|
|
58
58
|
d[k - 1] = arguments[k];
|
|
@@ -91,7 +91,7 @@ function un() {
|
|
|
91
91
|
function D(t) {
|
|
92
92
|
if (t == null)
|
|
93
93
|
return null;
|
|
94
|
-
if (typeof t.tag == "number" &&
|
|
94
|
+
if (typeof t.tag == "number" && g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
95
95
|
return t.displayName || t.name || null;
|
|
96
96
|
if (typeof t == "string")
|
|
97
97
|
return t;
|
|
@@ -192,7 +192,7 @@ function un() {
|
|
|
192
192
|
})
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
q < 0 &&
|
|
195
|
+
q < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
var Pe = C.ReactCurrentDispatcher, Se;
|
|
@@ -344,7 +344,7 @@ function un() {
|
|
|
344
344
|
} catch ($) {
|
|
345
345
|
N = $;
|
|
346
346
|
}
|
|
347
|
-
N && !(N instanceof Error) && (ke(R),
|
|
347
|
+
N && !(N instanceof Error) && (ke(R), g("%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).", k || "React class", d, x, typeof N), ke(null)), N instanceof Error && !(N.message in rt) && (rt[N.message] = !0, ke(R), g("Failed %s type: %s", d, N.message), ke(null));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
}
|
|
@@ -370,7 +370,7 @@ function un() {
|
|
|
370
370
|
}
|
|
371
371
|
function ot(t) {
|
|
372
372
|
if (Mt(t))
|
|
373
|
-
return
|
|
373
|
+
return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Bt(t)), lt(t);
|
|
374
374
|
}
|
|
375
375
|
var ie = C.ReactCurrentOwner, Yt = {
|
|
376
376
|
key: !0,
|
|
@@ -398,13 +398,13 @@ function un() {
|
|
|
398
398
|
function Ht(t, u) {
|
|
399
399
|
if (typeof t.ref == "string" && ie.current && u && ie.current.stateNode !== u) {
|
|
400
400
|
var d = D(ie.current.type);
|
|
401
|
-
je[d] || (
|
|
401
|
+
je[d] || (g('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', D(ie.current.type), t.ref), je[d] = !0);
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
function Kt(t, u) {
|
|
405
405
|
{
|
|
406
406
|
var d = function() {
|
|
407
|
-
it || (it = !0,
|
|
407
|
+
it || (it = !0, g("%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)", u));
|
|
408
408
|
};
|
|
409
409
|
d.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
410
410
|
get: d,
|
|
@@ -415,7 +415,7 @@ function un() {
|
|
|
415
415
|
function qt(t, u) {
|
|
416
416
|
{
|
|
417
417
|
var d = function() {
|
|
418
|
-
st || (st = !0,
|
|
418
|
+
st || (st = !0, g("%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)", u));
|
|
419
419
|
};
|
|
420
420
|
d.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
421
421
|
get: d,
|
|
@@ -529,7 +529,7 @@ Check the top-level render call using <` + d + ">.");
|
|
|
529
529
|
return;
|
|
530
530
|
pt[d] = !0;
|
|
531
531
|
var k = "";
|
|
532
|
-
t && t._owner && t._owner !== De.current && (k = " It was passed a child from " + D(t._owner.type) + "."), re(t),
|
|
532
|
+
t && t._owner && t._owner !== De.current && (k = " It was passed a child from " + D(t._owner.type) + "."), re(t), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', d, k), re(null);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
function dt(t, u) {
|
|
@@ -571,9 +571,9 @@ Check the top-level render call using <` + d + ">.");
|
|
|
571
571
|
} else if (u.PropTypes !== void 0 && !$e) {
|
|
572
572
|
$e = !0;
|
|
573
573
|
var R = D(u);
|
|
574
|
-
|
|
574
|
+
g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", R || "Unknown");
|
|
575
575
|
}
|
|
576
|
-
typeof u.getDefaultProps == "function" && !u.getDefaultProps.isReactClassApproved &&
|
|
576
|
+
typeof u.getDefaultProps == "function" && !u.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
function tn(t) {
|
|
@@ -581,11 +581,11 @@ Check the top-level render call using <` + d + ">.");
|
|
|
581
581
|
for (var u = Object.keys(t.props), d = 0; d < u.length; d++) {
|
|
582
582
|
var k = u[d];
|
|
583
583
|
if (k !== "children" && k !== "key") {
|
|
584
|
-
re(t),
|
|
584
|
+
re(t), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", k), re(null);
|
|
585
585
|
break;
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
t.ref !== null && (re(t),
|
|
588
|
+
t.ref !== null && (re(t), g("Invalid attribute `ref` supplied to `React.Fragment`."), re(null));
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
function mt(t, u, d, k, R, O) {
|
|
@@ -597,7 +597,7 @@ Check the top-level render call using <` + d + ">.");
|
|
|
597
597
|
var V = Zt(R);
|
|
598
598
|
V ? N += V : N += ut();
|
|
599
599
|
var $;
|
|
600
|
-
t === null ? $ = "null" : Te(t) ? $ = "array" : t !== void 0 && t.$$typeof === n ? ($ = "<" + (D(t.type) || "Unknown") + " />", N = " Did you accidentally export a JSX literal instead of a component?") : $ = typeof t,
|
|
600
|
+
t === null ? $ = "null" : Te(t) ? $ = "array" : t !== void 0 && t.$$typeof === n ? ($ = "<" + (D(t.type) || "Unknown") + " />", N = " Did you accidentally export a JSX literal instead of a component?") : $ = typeof t, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", $, N);
|
|
601
601
|
}
|
|
602
602
|
var L = Xt(t, u, d, R, O);
|
|
603
603
|
if (L == null)
|
|
@@ -611,7 +611,7 @@ Check the top-level render call using <` + d + ">.");
|
|
|
611
611
|
dt(z[ae], t);
|
|
612
612
|
Object.freeze && Object.freeze(z);
|
|
613
613
|
} else
|
|
614
|
-
|
|
614
|
+
g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
615
615
|
else
|
|
616
616
|
dt(z, t);
|
|
617
617
|
}
|
|
@@ -635,7 +635,7 @@ function fn(e, n) {
|
|
|
635
635
|
return !Ie[e] && typeof window.fetch == "function" && (Ie[e] = window.fetch(n + e + ".svg").then((r) => r.ok ? r.text() : (console.error("Missing icon: " + n + e + ".svg"), pn)).then((r) => r)), Promise.resolve(Ie[e]);
|
|
636
636
|
}
|
|
637
637
|
const y = ({ name: e, path: n, className: r = "", ...o }) => {
|
|
638
|
-
const a = "https://punkt-cdn.oslo.kommune.no/9.
|
|
638
|
+
const a = "https://punkt-cdn.oslo.kommune.no/9.2/icons/", [i, s] = ue(null);
|
|
639
639
|
return yt(() => {
|
|
640
640
|
if (!e)
|
|
641
641
|
return;
|
|
@@ -846,23 +846,23 @@ function Me() {
|
|
|
846
846
|
return e;
|
|
847
847
|
}, Me.apply(this, arguments);
|
|
848
848
|
}
|
|
849
|
-
const xe = /* @__PURE__ */
|
|
849
|
+
const xe = /* @__PURE__ */ b.createContext(null);
|
|
850
850
|
process.env.NODE_ENV !== "production" && (xe.displayName = "DataRouter");
|
|
851
|
-
const Rt = /* @__PURE__ */
|
|
851
|
+
const Rt = /* @__PURE__ */ b.createContext(null);
|
|
852
852
|
process.env.NODE_ENV !== "production" && (Rt.displayName = "DataRouterState");
|
|
853
|
-
const bn = /* @__PURE__ */
|
|
853
|
+
const bn = /* @__PURE__ */ b.createContext(null);
|
|
854
854
|
process.env.NODE_ENV !== "production" && (bn.displayName = "Await");
|
|
855
|
-
const te = /* @__PURE__ */
|
|
855
|
+
const te = /* @__PURE__ */ b.createContext(null);
|
|
856
856
|
process.env.NODE_ENV !== "production" && (te.displayName = "Navigation");
|
|
857
|
-
const Ke = /* @__PURE__ */
|
|
857
|
+
const Ke = /* @__PURE__ */ b.createContext(null);
|
|
858
858
|
process.env.NODE_ENV !== "production" && (Ke.displayName = "Location");
|
|
859
|
-
const le = /* @__PURE__ */
|
|
859
|
+
const le = /* @__PURE__ */ b.createContext({
|
|
860
860
|
outlet: null,
|
|
861
861
|
matches: [],
|
|
862
862
|
isDataRoute: !1
|
|
863
863
|
});
|
|
864
864
|
process.env.NODE_ENV !== "production" && (le.displayName = "Route");
|
|
865
|
-
const gn = /* @__PURE__ */
|
|
865
|
+
const gn = /* @__PURE__ */ b.createContext(null);
|
|
866
866
|
process.env.NODE_ENV !== "production" && (gn.displayName = "RouteError");
|
|
867
867
|
function Nn(e, n) {
|
|
868
868
|
let {
|
|
@@ -877,7 +877,7 @@ function Nn(e, n) {
|
|
|
877
877
|
let {
|
|
878
878
|
basename: o,
|
|
879
879
|
navigator: a
|
|
880
|
-
} =
|
|
880
|
+
} = b.useContext(te), {
|
|
881
881
|
hash: i,
|
|
882
882
|
pathname: s,
|
|
883
883
|
search: f
|
|
@@ -891,7 +891,7 @@ function Nn(e, n) {
|
|
|
891
891
|
});
|
|
892
892
|
}
|
|
893
893
|
function qe() {
|
|
894
|
-
return
|
|
894
|
+
return b.useContext(Ke) != null;
|
|
895
895
|
}
|
|
896
896
|
function pe() {
|
|
897
897
|
return qe() || (process.env.NODE_ENV !== "production" ? I(
|
|
@@ -899,16 +899,16 @@ function pe() {
|
|
|
899
899
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
900
900
|
// router loaded. We can help them understand how to avoid that.
|
|
901
901
|
"useLocation() may be used only in the context of a <Router> component."
|
|
902
|
-
) : I(!1)),
|
|
902
|
+
) : I(!1)), b.useContext(Ke).location;
|
|
903
903
|
}
|
|
904
904
|
const Pt = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
905
905
|
function St(e) {
|
|
906
|
-
|
|
906
|
+
b.useContext(te).static || b.useLayoutEffect(e);
|
|
907
907
|
}
|
|
908
908
|
function yn() {
|
|
909
909
|
let {
|
|
910
910
|
isDataRoute: e
|
|
911
|
-
} =
|
|
911
|
+
} = b.useContext(le);
|
|
912
912
|
return e ? Rn() : En();
|
|
913
913
|
}
|
|
914
914
|
function En() {
|
|
@@ -918,17 +918,17 @@ function En() {
|
|
|
918
918
|
// router loaded. We can help them understand how to avoid that.
|
|
919
919
|
"useNavigate() may be used only in the context of a <Router> component."
|
|
920
920
|
) : I(!1));
|
|
921
|
-
let e =
|
|
921
|
+
let e = b.useContext(xe), {
|
|
922
922
|
basename: n,
|
|
923
923
|
navigator: r
|
|
924
|
-
} =
|
|
924
|
+
} = b.useContext(te), {
|
|
925
925
|
matches: o
|
|
926
|
-
} =
|
|
926
|
+
} = b.useContext(le), {
|
|
927
927
|
pathname: a
|
|
928
|
-
} = pe(), i = JSON.stringify(xt(o).map((p) => p.pathnameBase)), s =
|
|
928
|
+
} = pe(), i = JSON.stringify(xt(o).map((p) => p.pathnameBase)), s = b.useRef(!1);
|
|
929
929
|
return St(() => {
|
|
930
930
|
s.current = !0;
|
|
931
|
-
}),
|
|
931
|
+
}), b.useCallback(function(p, c) {
|
|
932
932
|
if (c === void 0 && (c = {}), process.env.NODE_ENV !== "production" && Ee(s.current, Pt), !s.current)
|
|
933
933
|
return;
|
|
934
934
|
if (typeof p == "number") {
|
|
@@ -944,10 +944,10 @@ function we(e, n) {
|
|
|
944
944
|
relative: r
|
|
945
945
|
} = n === void 0 ? {} : n, {
|
|
946
946
|
matches: o
|
|
947
|
-
} =
|
|
947
|
+
} = b.useContext(le), {
|
|
948
948
|
pathname: a
|
|
949
949
|
} = pe(), i = JSON.stringify(xt(o).map((s) => s.pathnameBase));
|
|
950
|
-
return
|
|
950
|
+
return b.useMemo(() => wt(e, JSON.parse(i), a, r === "path"), [e, i, a, r]);
|
|
951
951
|
}
|
|
952
952
|
var Ye;
|
|
953
953
|
(function(e) {
|
|
@@ -961,11 +961,11 @@ function Ot(e) {
|
|
|
961
961
|
return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
962
962
|
}
|
|
963
963
|
function xn(e) {
|
|
964
|
-
let n =
|
|
964
|
+
let n = b.useContext(xe);
|
|
965
965
|
return n || (process.env.NODE_ENV !== "production" ? I(!1, Ot(e)) : I(!1)), n;
|
|
966
966
|
}
|
|
967
967
|
function wn(e) {
|
|
968
|
-
let n =
|
|
968
|
+
let n = b.useContext(le);
|
|
969
969
|
return n || (process.env.NODE_ENV !== "production" ? I(!1, Ot(e)) : I(!1)), n;
|
|
970
970
|
}
|
|
971
971
|
function Tt(e) {
|
|
@@ -978,10 +978,10 @@ function Cn() {
|
|
|
978
978
|
function Rn() {
|
|
979
979
|
let {
|
|
980
980
|
router: e
|
|
981
|
-
} = xn(Ye.UseNavigateStable), n = Tt(ge.UseNavigateStable), r =
|
|
981
|
+
} = xn(Ye.UseNavigateStable), n = Tt(ge.UseNavigateStable), r = b.useRef(!1);
|
|
982
982
|
return St(() => {
|
|
983
983
|
r.current = !0;
|
|
984
|
-
}),
|
|
984
|
+
}), b.useCallback(function(a, i) {
|
|
985
985
|
i === void 0 && (i = {}), process.env.NODE_ENV !== "production" && Ee(r.current, Pt), r.current && (typeof a == "number" ? e.navigate(a) : e.navigate(a, Me({
|
|
986
986
|
fromRouteId: n
|
|
987
987
|
}, i)));
|
|
@@ -1097,7 +1097,7 @@ function Ln(e, n) {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
const In = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset"], Fn = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"], An = ["reloadDocument", "replace", "method", "action", "onSubmit", "submit", "relative", "preventScrollReset"];
|
|
1099
1099
|
process.env.NODE_ENV;
|
|
1100
|
-
const Un = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", Vn = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Ne = /* @__PURE__ */
|
|
1100
|
+
const Un = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", Vn = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Ne = /* @__PURE__ */ b.forwardRef(function(n, r) {
|
|
1101
1101
|
let {
|
|
1102
1102
|
onClick: o,
|
|
1103
1103
|
relative: a,
|
|
@@ -1109,11 +1109,11 @@ const Un = typeof window < "u" && typeof window.document < "u" && typeof window.
|
|
|
1109
1109
|
preventScrollReset: m
|
|
1110
1110
|
} = n, v = Ge(n, In), {
|
|
1111
1111
|
basename: E
|
|
1112
|
-
} =
|
|
1112
|
+
} = b.useContext(te), w, S = !1;
|
|
1113
1113
|
if (typeof c == "string" && Vn.test(c) && (w = c, Un))
|
|
1114
1114
|
try {
|
|
1115
|
-
let
|
|
1116
|
-
j.origin ===
|
|
1115
|
+
let g = new URL(window.location.href), j = c.startsWith("//") ? new URL(g.protocol + c) : new URL(c), F = Be(j.pathname, E);
|
|
1116
|
+
j.origin === g.origin && F != null ? c = F + j.search + j.hash : S = !0;
|
|
1117
1117
|
} catch {
|
|
1118
1118
|
process.env.NODE_ENV !== "production" && Ee(!1, '<Link to="' + c + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.');
|
|
1119
1119
|
}
|
|
@@ -1126,12 +1126,12 @@ const Un = typeof window < "u" && typeof window.document < "u" && typeof window.
|
|
|
1126
1126
|
preventScrollReset: m,
|
|
1127
1127
|
relative: a
|
|
1128
1128
|
});
|
|
1129
|
-
function C(
|
|
1130
|
-
o && o(
|
|
1129
|
+
function C(g) {
|
|
1130
|
+
o && o(g), g.defaultPrevented || T(g);
|
|
1131
1131
|
}
|
|
1132
1132
|
return (
|
|
1133
1133
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1134
|
-
/* @__PURE__ */
|
|
1134
|
+
/* @__PURE__ */ b.createElement("a", ne({}, v, {
|
|
1135
1135
|
href: w || P,
|
|
1136
1136
|
onClick: S || i ? o : C,
|
|
1137
1137
|
ref: r,
|
|
@@ -1140,7 +1140,7 @@ const Un = typeof window < "u" && typeof window.document < "u" && typeof window.
|
|
|
1140
1140
|
);
|
|
1141
1141
|
});
|
|
1142
1142
|
process.env.NODE_ENV !== "production" && (Ne.displayName = "Link");
|
|
1143
|
-
const Wn = /* @__PURE__ */
|
|
1143
|
+
const Wn = /* @__PURE__ */ b.forwardRef(function(n, r) {
|
|
1144
1144
|
let {
|
|
1145
1145
|
"aria-current": o = "page",
|
|
1146
1146
|
caseSensitive: a = !1,
|
|
@@ -1151,40 +1151,40 @@ const Wn = /* @__PURE__ */ g.forwardRef(function(n, r) {
|
|
|
1151
1151
|
children: c
|
|
1152
1152
|
} = n, m = Ge(n, Fn), v = we(p, {
|
|
1153
1153
|
relative: m.relative
|
|
1154
|
-
}), E = pe(), w =
|
|
1154
|
+
}), E = pe(), w = b.useContext(Rt), {
|
|
1155
1155
|
navigator: S
|
|
1156
|
-
} =
|
|
1156
|
+
} = b.useContext(te), P = S.encodeLocation ? S.encodeLocation(v).pathname : v.pathname, T = E.pathname, C = w && w.navigation && w.navigation.location ? w.navigation.location.pathname : null;
|
|
1157
1157
|
a || (T = T.toLowerCase(), C = C ? C.toLowerCase() : null, P = P.toLowerCase());
|
|
1158
|
-
let
|
|
1158
|
+
let g = T === P || !s && T.startsWith(P) && T.charAt(P.length) === "/", j = C != null && (C === P || !s && C.startsWith(P) && C.charAt(P.length) === "/"), F = g ? o : void 0, A;
|
|
1159
1159
|
typeof i == "function" ? A = i({
|
|
1160
|
-
isActive:
|
|
1160
|
+
isActive: g,
|
|
1161
1161
|
isPending: j
|
|
1162
|
-
}) : A = [i,
|
|
1162
|
+
}) : A = [i, g ? "active" : null, j ? "pending" : null].filter(Boolean).join(" ");
|
|
1163
1163
|
let U = typeof f == "function" ? f({
|
|
1164
|
-
isActive:
|
|
1164
|
+
isActive: g,
|
|
1165
1165
|
isPending: j
|
|
1166
1166
|
}) : f;
|
|
1167
|
-
return /* @__PURE__ */
|
|
1167
|
+
return /* @__PURE__ */ b.createElement(Ne, ne({}, m, {
|
|
1168
1168
|
"aria-current": F,
|
|
1169
1169
|
className: A,
|
|
1170
1170
|
ref: r,
|
|
1171
1171
|
style: U,
|
|
1172
1172
|
to: p
|
|
1173
1173
|
}), typeof c == "function" ? c({
|
|
1174
|
-
isActive:
|
|
1174
|
+
isActive: g,
|
|
1175
1175
|
isPending: j
|
|
1176
1176
|
}) : c);
|
|
1177
1177
|
});
|
|
1178
1178
|
process.env.NODE_ENV !== "production" && (Wn.displayName = "NavLink");
|
|
1179
|
-
const Bn = /* @__PURE__ */
|
|
1179
|
+
const Bn = /* @__PURE__ */ b.forwardRef((e, n) => {
|
|
1180
1180
|
let r = Hn();
|
|
1181
|
-
return /* @__PURE__ */
|
|
1181
|
+
return /* @__PURE__ */ b.createElement(jt, ne({}, e, {
|
|
1182
1182
|
submit: r,
|
|
1183
1183
|
ref: n
|
|
1184
1184
|
}));
|
|
1185
1185
|
});
|
|
1186
1186
|
process.env.NODE_ENV !== "production" && (Bn.displayName = "Form");
|
|
1187
|
-
const jt = /* @__PURE__ */
|
|
1187
|
+
const jt = /* @__PURE__ */ b.forwardRef((e, n) => {
|
|
1188
1188
|
let {
|
|
1189
1189
|
reloadDocument: r,
|
|
1190
1190
|
replace: o,
|
|
@@ -1208,7 +1208,7 @@ const jt = /* @__PURE__ */ g.forwardRef((e, n) => {
|
|
|
1208
1208
|
preventScrollReset: c
|
|
1209
1209
|
});
|
|
1210
1210
|
};
|
|
1211
|
-
return /* @__PURE__ */
|
|
1211
|
+
return /* @__PURE__ */ b.createElement("form", ne({
|
|
1212
1212
|
ref: n,
|
|
1213
1213
|
method: v,
|
|
1214
1214
|
action: E,
|
|
@@ -1229,7 +1229,7 @@ function Mn(e) {
|
|
|
1229
1229
|
return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
1230
1230
|
}
|
|
1231
1231
|
function Yn(e) {
|
|
1232
|
-
let n =
|
|
1232
|
+
let n = b.useContext(xe);
|
|
1233
1233
|
return n || (process.env.NODE_ENV !== "production" ? I(!1, Mn(e)) : I(!1)), n;
|
|
1234
1234
|
}
|
|
1235
1235
|
function Jn(e, n) {
|
|
@@ -1242,7 +1242,7 @@ function Jn(e, n) {
|
|
|
1242
1242
|
} = n === void 0 ? {} : n, f = yn(), p = pe(), c = we(e, {
|
|
1243
1243
|
relative: s
|
|
1244
1244
|
});
|
|
1245
|
-
return
|
|
1245
|
+
return b.useCallback((m) => {
|
|
1246
1246
|
if (jn(m, r)) {
|
|
1247
1247
|
m.preventDefault();
|
|
1248
1248
|
let v = o !== void 0 ? o : We(p) === We(c);
|
|
@@ -1264,8 +1264,8 @@ function Hn() {
|
|
|
1264
1264
|
router: e
|
|
1265
1265
|
} = Yn(Je.UseSubmit), {
|
|
1266
1266
|
basename: n
|
|
1267
|
-
} =
|
|
1268
|
-
return
|
|
1267
|
+
} = b.useContext(te), r = Cn();
|
|
1268
|
+
return b.useCallback(function(o, a) {
|
|
1269
1269
|
a === void 0 && (a = {}), zn();
|
|
1270
1270
|
let {
|
|
1271
1271
|
action: i,
|
|
@@ -1290,7 +1290,7 @@ function Kn(e, n) {
|
|
|
1290
1290
|
relative: r
|
|
1291
1291
|
} = n === void 0 ? {} : n, {
|
|
1292
1292
|
basename: o
|
|
1293
|
-
} =
|
|
1293
|
+
} = b.useContext(te), a = b.useContext(le);
|
|
1294
1294
|
a || (process.env.NODE_ENV !== "production" ? I(!1, "useFormAction must be used inside a RouteContext") : I(!1));
|
|
1295
1295
|
let [i] = a.matches.slice(-1), s = ne({}, we(e || ".", {
|
|
1296
1296
|
relative: r
|
|
@@ -1650,7 +1650,7 @@ const $t = /* @__PURE__ */ sn(Gn), ir = B(
|
|
|
1650
1650
|
year: "numeric",
|
|
1651
1651
|
month: "long",
|
|
1652
1652
|
day: "numeric"
|
|
1653
|
-
}) : "", [a]), [
|
|
1653
|
+
}) : "", [a]), [g, j] = G.useState(!1), [F, A] = G.useState(0), [U, M] = G.useState(!1), H = G.useRef(null);
|
|
1654
1654
|
G.useEffect(() => (document.addEventListener("mouseup", K), window.addEventListener("scroll", W), () => {
|
|
1655
1655
|
document.removeEventListener("mouseup", K), window.removeEventListener("scroll", W);
|
|
1656
1656
|
}));
|
|
@@ -1676,7 +1676,7 @@ const $t = /* @__PURE__ */ sn(Gn), ir = B(
|
|
|
1676
1676
|
className: $t("pkt-header", {
|
|
1677
1677
|
"pkt-header--fixed": r,
|
|
1678
1678
|
"pkt-header--scroll-to-hide": o,
|
|
1679
|
-
"pkt-header--hidden":
|
|
1679
|
+
"pkt-header--hidden": g
|
|
1680
1680
|
}),
|
|
1681
1681
|
ref: T,
|
|
1682
1682
|
children: [
|
|
@@ -1687,7 +1687,7 @@ const $t = /* @__PURE__ */ sn(Gn), ir = B(
|
|
|
1687
1687
|
name: "oslologo",
|
|
1688
1688
|
className: "pkt-header__logo-svg",
|
|
1689
1689
|
"aria-hidden": "true",
|
|
1690
|
-
path: "https://punkt-cdn.oslo.kommune.no/9.
|
|
1690
|
+
path: "https://punkt-cdn.oslo.kommune.no/9.2/logos/"
|
|
1691
1691
|
}
|
|
1692
1692
|
) }) : /* @__PURE__ */ l(
|
|
1693
1693
|
"button",
|
|
@@ -1701,7 +1701,7 @@ const $t = /* @__PURE__ */ sn(Gn), ir = B(
|
|
|
1701
1701
|
name: "oslologo",
|
|
1702
1702
|
className: "pkt-header__logo-svg",
|
|
1703
1703
|
"aria-hidden": "true",
|
|
1704
|
-
path: "https://punkt-cdn.oslo.kommune.no/9.
|
|
1704
|
+
path: "https://punkt-cdn.oslo.kommune.no/9.2/logos/"
|
|
1705
1705
|
}
|
|
1706
1706
|
)
|
|
1707
1707
|
}
|
|
@@ -1724,7 +1724,7 @@ const $t = /* @__PURE__ */ sn(Gn), ir = B(
|
|
|
1724
1724
|
"li",
|
|
1725
1725
|
{
|
|
1726
1726
|
"data-testid": "usermenu",
|
|
1727
|
-
className: `pkt-header--has-dropdown ${U && !
|
|
1727
|
+
className: `pkt-header--has-dropdown ${U && !g ? "pkt-header--open-dropdown" : ""}`,
|
|
1728
1728
|
ref: H,
|
|
1729
1729
|
children: [
|
|
1730
1730
|
/* @__PURE__ */ h(
|
|
@@ -1832,9 +1832,9 @@ const Re = B(
|
|
|
1832
1832
|
helptext: r,
|
|
1833
1833
|
helptextDropdown: o,
|
|
1834
1834
|
helptextDropdownButton: a,
|
|
1835
|
-
|
|
1835
|
+
optionalTag: i = !1,
|
|
1836
1836
|
optionalText: s = "Valgfritt",
|
|
1837
|
-
|
|
1837
|
+
requiredTag: f = !1,
|
|
1838
1838
|
requiredText: p = "Må fylles ut",
|
|
1839
1839
|
hasError: c,
|
|
1840
1840
|
errorMessage: m,
|
|
@@ -1845,7 +1845,7 @@ const Re = B(
|
|
|
1845
1845
|
children: P,
|
|
1846
1846
|
className: T,
|
|
1847
1847
|
hasFieldset: C = !1
|
|
1848
|
-
},
|
|
1848
|
+
}, g) => {
|
|
1849
1849
|
const [j, F] = ue(!1), A = () => {
|
|
1850
1850
|
F(!j);
|
|
1851
1851
|
}, U = () => i ? "pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light" : f ? "pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige" : "", M = i ? s : f ? p : "", H = v ? "pkt-inputwrapper--disabled" : "", Y = E ? "pkt-inputwrapper--inline" : "", K = c ? "pkt-inputwrapper--error" : "", W = !!o && o !== "", _ = a || 'Les mer <span class="pkt-sr-only">om inputfeltet</span>', D = C ? "fieldset" : W ? "div" : "label", J = C ? "legend" : W ? "h2" : "span", q = w || (r ? `${e}-helptext` : void 0);
|
|
@@ -1855,7 +1855,7 @@ const Re = B(
|
|
|
1855
1855
|
className: ["pkt-inputwrapper", T, H, Y, K].join(
|
|
1856
1856
|
" "
|
|
1857
1857
|
),
|
|
1858
|
-
ref:
|
|
1858
|
+
ref: g,
|
|
1859
1859
|
children: [
|
|
1860
1860
|
S ? /* @__PURE__ */ l(ee, { children: /* @__PURE__ */ h(
|
|
1861
1861
|
D,
|
|
@@ -2026,10 +2026,10 @@ const cr = B(
|
|
|
2026
2026
|
fullwidth: E = !1,
|
|
2027
2027
|
label: w,
|
|
2028
2028
|
name: S,
|
|
2029
|
-
|
|
2029
|
+
optionalTag: P = !1,
|
|
2030
2030
|
optionalText: T,
|
|
2031
|
-
|
|
2032
|
-
requiredText:
|
|
2031
|
+
requiredTag: C = !1,
|
|
2032
|
+
requiredText: g,
|
|
2033
2033
|
...j
|
|
2034
2034
|
}, F) => {
|
|
2035
2035
|
const A = [o, "pkt-select"].join(" ");
|
|
@@ -2042,10 +2042,10 @@ const cr = B(
|
|
|
2042
2042
|
helptext: f,
|
|
2043
2043
|
helptextDropdown: p,
|
|
2044
2044
|
helptextDropdownButton: c,
|
|
2045
|
-
|
|
2045
|
+
optionalTag: P,
|
|
2046
2046
|
optionalText: T,
|
|
2047
|
-
|
|
2048
|
-
requiredText:
|
|
2047
|
+
requiredTag: C,
|
|
2048
|
+
requiredText: g,
|
|
2049
2049
|
hasError: s,
|
|
2050
2050
|
errorMessage: i,
|
|
2051
2051
|
disabled: a,
|
|
@@ -2059,7 +2059,6 @@ const cr = B(
|
|
|
2059
2059
|
"aria-invalid": s,
|
|
2060
2060
|
"aria-errormessage": `${m}-error`,
|
|
2061
2061
|
"aria-labelledby": n || `${m}-label`,
|
|
2062
|
-
"aria-required": C,
|
|
2063
2062
|
disabled: a,
|
|
2064
2063
|
id: m,
|
|
2065
2064
|
name: S || m,
|
|
@@ -2168,13 +2167,13 @@ const dr = B(
|
|
|
2168
2167
|
fullwidth: w = !1,
|
|
2169
2168
|
label: S,
|
|
2170
2169
|
name: P,
|
|
2171
|
-
|
|
2170
|
+
optionalTag: T = !1,
|
|
2172
2171
|
optionalText: C,
|
|
2173
|
-
|
|
2172
|
+
requiredTag: g = !1,
|
|
2174
2173
|
requiredText: j,
|
|
2175
2174
|
placeholder: F,
|
|
2176
2175
|
rows: A,
|
|
2177
|
-
useWrapper: U,
|
|
2176
|
+
useWrapper: U = !0,
|
|
2178
2177
|
onChange: M,
|
|
2179
2178
|
...H
|
|
2180
2179
|
}, Y) => {
|
|
@@ -2200,9 +2199,9 @@ const dr = B(
|
|
|
2200
2199
|
helptextDropdownButton: v,
|
|
2201
2200
|
inline: E,
|
|
2202
2201
|
label: S,
|
|
2203
|
-
|
|
2202
|
+
optionalTag: T,
|
|
2204
2203
|
optionalText: C,
|
|
2205
|
-
|
|
2204
|
+
requiredTag: g,
|
|
2206
2205
|
requiredText: j,
|
|
2207
2206
|
useWrapper: U,
|
|
2208
2207
|
children: [
|
|
@@ -2219,7 +2218,6 @@ const dr = B(
|
|
|
2219
2218
|
"aria-labelledby": W,
|
|
2220
2219
|
"aria-invalid": p,
|
|
2221
2220
|
"aria-errormessage": `${e}-error`,
|
|
2222
|
-
"aria-required": b,
|
|
2223
2221
|
...H,
|
|
2224
2222
|
onChange: q
|
|
2225
2223
|
}
|
|
@@ -2250,9 +2248,9 @@ const dr = B(
|
|
|
2250
2248
|
fullwidth: w = !1,
|
|
2251
2249
|
label: S,
|
|
2252
2250
|
name: P,
|
|
2253
|
-
|
|
2251
|
+
optionalTag: T = !1,
|
|
2254
2252
|
optionalText: C,
|
|
2255
|
-
|
|
2253
|
+
requiredTag: g = !1,
|
|
2256
2254
|
requiredText: j,
|
|
2257
2255
|
placeholder: F,
|
|
2258
2256
|
prefix: A,
|
|
@@ -2277,9 +2275,9 @@ const dr = B(
|
|
|
2277
2275
|
helptextDropdownButton: m,
|
|
2278
2276
|
inline: E,
|
|
2279
2277
|
label: S,
|
|
2280
|
-
|
|
2278
|
+
optionalTag: T,
|
|
2281
2279
|
optionalText: C,
|
|
2282
|
-
|
|
2280
|
+
requiredTag: g,
|
|
2283
2281
|
requiredText: j,
|
|
2284
2282
|
useWrapper: H,
|
|
2285
2283
|
children: /* @__PURE__ */ h("div", { className: "pkt-input__container", children: [
|
|
@@ -2296,7 +2294,6 @@ const dr = B(
|
|
|
2296
2294
|
autoComplete: o,
|
|
2297
2295
|
value: Y,
|
|
2298
2296
|
disabled: i,
|
|
2299
|
-
"aria-required": b,
|
|
2300
2297
|
"aria-invalid": f,
|
|
2301
2298
|
"aria-errormessage": `${e}-error`,
|
|
2302
2299
|
"aria-labelledby": D,
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(T,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],N):(T=typeof globalThis<"u"?globalThis:T||self,N(T["punkt-react"]={},T.React))})(this,function(T,N){"use strict";function Ut(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const
|
|
1
|
+
(function(T,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],N):(T=typeof globalThis<"u"?globalThis:T||self,N(T["punkt-react"]={},T.React))})(this,function(T,N){"use strict";function Ut(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const b=Ut(N);function Bt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pe={exports:{}},oe={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -14,17 +14,17 @@
|
|
|
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 Vt(){return Xe||(Xe=1,process.env.NODE_ENV!=="production"&&function(){var e=N,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),p=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),O=Symbol.iterator,S="@@iterator";function D(t){if(t===null||typeof t!="object")return null;var u=O&&t[O]||t[S];return typeof u=="function"?u:null}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function
|
|
17
|
+
*/var Xe;function Vt(){return Xe||(Xe=1,process.env.NODE_ENV!=="production"&&function(){var e=N,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),p=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),O=Symbol.iterator,S="@@iterator";function D(t){if(t===null||typeof t!="object")return null;var u=O&&t[O]||t[S];return typeof u=="function"?u:null}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(t){{for(var u=arguments.length,d=new Array(u>1?u-1:0),k=1;k<u;k++)d[k-1]=arguments[k];$("error",t,d)}}function $(t,u,d){{var k=P.ReactDebugCurrentFrame,R=k.getStackAddendum();R!==""&&(u+="%s",d=d.concat([R]));var j=d.map(function(x){return String(x)});j.unshift("Warning: "+u),Function.prototype.apply.call(console[t],console,j)}}var U=!1,B=!1,W=!1,Y=!1,q=!1,J;J=Symbol.for("react.module.reference");function K(t){return!!(typeof t=="string"||typeof t=="function"||t===o||t===i||q||t===a||t===c||t===h||Y||t===C||U||B||W||typeof t=="object"&&t!==null&&(t.$$typeof===w||t.$$typeof===v||t.$$typeof===s||t.$$typeof===p||t.$$typeof===f||t.$$typeof===J||t.getModuleId!==void 0))}function M(t,u,d){var k=t.displayName;if(k)return k;var R=u.displayName||u.name||"";return R!==""?d+"("+R+")":d}function _(t){return t.displayName||"Context"}function L(t){if(t==null)return null;if(typeof t.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case o:return"Fragment";case r:return"Portal";case i:return"Profiler";case a:return"StrictMode";case c:return"Suspense";case h:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case p:var u=t;return _(u)+".Consumer";case s:var d=t;return _(d._context)+".Provider";case f:return M(t,t.render,"ForwardRef");case v:var k=t.displayName||null;return k!==null?k:L(t.type)||"Memo";case w:{var R=t,j=R._payload,x=R._init;try{return L(x(j))}catch{return null}}}return null}var H=Object.assign,G=0,ee,te,fe,gt,Nt,yt,Et;function wt(){}wt.__reactDisabledLog=!0;function Wn(){{if(G===0){ee=console.log,te=console.info,fe=console.warn,gt=console.error,Nt=console.group,yt=console.groupCollapsed,Et=console.groupEnd;var t={configurable:!0,enumerable:!0,value:wt,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}G++}}function Vn(){{if(G--,G===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},t,{value:ee}),info:H({},t,{value:te}),warn:H({},t,{value:fe}),error:H({},t,{value:gt}),group:H({},t,{value:Nt}),groupCollapsed:H({},t,{value:yt}),groupEnd:H({},t,{value:Et})})}G<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ve=P.ReactCurrentDispatcher,Me;function ye(t,u,d){{if(Me===void 0)try{throw Error()}catch(R){var k=R.stack.trim().match(/\n( *(at )?)/);Me=k&&k[1]||""}return`
|
|
18
18
|
`+Me+t}}var Ye=!1,Ee;{var Mn=typeof WeakMap=="function"?WeakMap:Map;Ee=new Mn}function xt(t,u){if(!t||Ye)return"";{var d=Ee.get(t);if(d!==void 0)return d}var k;Ye=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var j;j=Ve.current,Ve.current=null,Wn();try{if(u){var x=function(){throw Error()};if(Object.defineProperty(x.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(x,[])}catch(X){k=X}Reflect.construct(t,[],x)}else{try{x.call()}catch(X){k=X}t.call(x.prototype)}}else{try{throw Error()}catch(X){k=X}t()}}catch(X){if(X&&k&&typeof X.stack=="string"){for(var E=X.stack.split(`
|
|
19
19
|
`),V=k.stack.split(`
|
|
20
20
|
`),I=E.length-1,F=V.length-1;I>=1&&F>=0&&E[I]!==V[F];)F--;for(;I>=1&&F>=0;I--,F--)if(E[I]!==V[F]){if(I!==1||F!==1)do if(I--,F--,F<0||E[I]!==V[F]){var z=`
|
|
21
|
-
`+E[I].replace(" at new "," at ");return t.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",t.displayName)),typeof t=="function"&&Ee.set(t,z),z}while(I>=1&&F>=0);break}}}finally{Ye=!1,Ve.current=j,Vn(),Error.prepareStackTrace=R}var le=t?t.displayName||t.name:"",At=le?ye(le):"";return typeof t=="function"&&Ee.set(t,At),At}function Yn(t,u,d){return xt(t,!1)}function Jn(t){var u=t.prototype;return!!(u&&u.isReactComponent)}function we(t,u,d){if(t==null)return"";if(typeof t=="function")return xt(t,Jn(t));if(typeof t=="string")return ye(t);switch(t){case c:return ye("Suspense");case h:return ye("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case f:return Yn(t.render);case v:return we(t.type,u,d);case w:{var k=t,R=k._payload,j=k._init;try{return we(j(R),u,d)}catch{}}}return""}var xe=Object.prototype.hasOwnProperty,Ct={},Pt=P.ReactDebugCurrentFrame;function Ce(t){if(t){var u=t._owner,d=we(t.type,t._source,u?u.type:null);Pt.setExtraStackFrame(d)}else Pt.setExtraStackFrame(null)}function Hn(t,u,d,k,R){{var j=Function.call.bind(xe);for(var x in t)if(j(t,x)){var E=void 0;try{if(typeof t[x]!="function"){var V=Error((k||"React class")+": "+d+" type `"+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[x]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw V.name="Invariant Violation",V}E=t[x](u,x,k,d,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(I){E=I}E&&!(E instanceof Error)&&(Ce(R),
|
|
21
|
+
`+E[I].replace(" at new "," at ");return t.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",t.displayName)),typeof t=="function"&&Ee.set(t,z),z}while(I>=1&&F>=0);break}}}finally{Ye=!1,Ve.current=j,Vn(),Error.prepareStackTrace=R}var le=t?t.displayName||t.name:"",At=le?ye(le):"";return typeof t=="function"&&Ee.set(t,At),At}function Yn(t,u,d){return xt(t,!1)}function Jn(t){var u=t.prototype;return!!(u&&u.isReactComponent)}function we(t,u,d){if(t==null)return"";if(typeof t=="function")return xt(t,Jn(t));if(typeof t=="string")return ye(t);switch(t){case c:return ye("Suspense");case h:return ye("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case f:return Yn(t.render);case v:return we(t.type,u,d);case w:{var k=t,R=k._payload,j=k._init;try{return we(j(R),u,d)}catch{}}}return""}var xe=Object.prototype.hasOwnProperty,Ct={},Pt=P.ReactDebugCurrentFrame;function Ce(t){if(t){var u=t._owner,d=we(t.type,t._source,u?u.type:null);Pt.setExtraStackFrame(d)}else Pt.setExtraStackFrame(null)}function Hn(t,u,d,k,R){{var j=Function.call.bind(xe);for(var x in t)if(j(t,x)){var E=void 0;try{if(typeof t[x]!="function"){var V=Error((k||"React class")+": "+d+" type `"+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[x]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw V.name="Invariant Violation",V}E=t[x](u,x,k,d,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(I){E=I}E&&!(E instanceof Error)&&(Ce(R),g("%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).",k||"React class",d,x,typeof E),Ce(null)),E instanceof Error&&!(E.message in Ct)&&(Ct[E.message]=!0,Ce(R),g("Failed %s type: %s",d,E.message),Ce(null))}}}var zn=Array.isArray;function Je(t){return zn(t)}function qn(t){{var u=typeof Symbol=="function"&&Symbol.toStringTag,d=u&&t[Symbol.toStringTag]||t.constructor.name||"Object";return d}}function Kn(t){try{return Rt(t),!1}catch{return!0}}function Rt(t){return""+t}function St(t){if(Kn(t))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qn(t)),Rt(t)}var pe=P.ReactCurrentOwner,Gn={key:!0,ref:!0,__self:!0,__source:!0},Ot,Tt,He;He={};function Xn(t){if(xe.call(t,"ref")){var u=Object.getOwnPropertyDescriptor(t,"ref").get;if(u&&u.isReactWarning)return!1}return t.ref!==void 0}function Zn(t){if(xe.call(t,"key")){var u=Object.getOwnPropertyDescriptor(t,"key").get;if(u&&u.isReactWarning)return!1}return t.key!==void 0}function Qn(t,u){if(typeof t.ref=="string"&&pe.current&&u&&pe.current.stateNode!==u){var d=L(pe.current.type);He[d]||(g('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',L(pe.current.type),t.ref),He[d]=!0)}}function er(t,u){{var d=function(){Ot||(Ot=!0,g("%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)",u))};d.isReactWarning=!0,Object.defineProperty(t,"key",{get:d,configurable:!0})}}function tr(t,u){{var d=function(){Tt||(Tt=!0,g("%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)",u))};d.isReactWarning=!0,Object.defineProperty(t,"ref",{get:d,configurable:!0})}}var nr=function(t,u,d,k,R,j,x){var E={$$typeof:n,type:t,key:u,ref:d,props:x,_owner:j};return E._store={},Object.defineProperty(E._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(E,"_self",{configurable:!1,enumerable:!1,writable:!1,value:k}),Object.defineProperty(E,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(E.props),Object.freeze(E)),E};function rr(t,u,d,k,R){{var j,x={},E=null,V=null;d!==void 0&&(St(d),E=""+d),Zn(u)&&(St(u.key),E=""+u.key),Xn(u)&&(V=u.ref,Qn(u,R));for(j in u)xe.call(u,j)&&!Gn.hasOwnProperty(j)&&(x[j]=u[j]);if(t&&t.defaultProps){var I=t.defaultProps;for(j in I)x[j]===void 0&&(x[j]=I[j])}if(E||V){var F=typeof t=="function"?t.displayName||t.name||"Unknown":t;E&&er(x,F),V&&tr(x,F)}return nr(t,E,V,R,k,pe.current,x)}}var ze=P.ReactCurrentOwner,jt=P.ReactDebugCurrentFrame;function ae(t){if(t){var u=t._owner,d=we(t.type,t._source,u?u.type:null);jt.setExtraStackFrame(d)}else jt.setExtraStackFrame(null)}var qe;qe=!1;function Ke(t){return typeof t=="object"&&t!==null&&t.$$typeof===n}function Dt(){{if(ze.current){var t=L(ze.current.type);if(t)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+t+"`."}return""}}function ar(t){{if(t!==void 0){var u=t.fileName.replace(/^.*[\\\/]/,""),d=t.lineNumber;return`
|
|
24
24
|
|
|
25
25
|
Check your code at `+u+":"+d+"."}return""}}var $t={};function lr(t){{var u=Dt();if(!u){var d=typeof t=="string"?t:t.displayName||t.name;d&&(u=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+d+">.")}return u}}function Lt(t,u){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var d=lr(u);if($t[d])return;$t[d]=!0;var k="";t&&t._owner&&t._owner!==ze.current&&(k=" It was passed a child from "+L(t._owner.type)+"."),ae(t),
|
|
27
|
+
Check the top-level render call using <`+d+">.")}return u}}function Lt(t,u){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var d=lr(u);if($t[d])return;$t[d]=!0;var k="";t&&t._owner&&t._owner!==ze.current&&(k=" It was passed a child from "+L(t._owner.type)+"."),ae(t),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',d,k),ae(null)}}function It(t,u){{if(typeof t!="object")return;if(Je(t))for(var d=0;d<t.length;d++){var k=t[d];Ke(k)&&Lt(k,u)}else if(Ke(t))t._store&&(t._store.validated=!0);else if(t){var R=D(t);if(typeof R=="function"&&R!==t.entries)for(var j=R.call(t),x;!(x=j.next()).done;)Ke(x.value)&&Lt(x.value,u)}}}function or(t){{var u=t.type;if(u==null||typeof u=="string")return;var d;if(typeof u=="function")d=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===f||u.$$typeof===v))d=u.propTypes;else return;if(d){var k=L(u);Hn(d,t.props,"prop",k,t)}else if(u.PropTypes!==void 0&&!qe){qe=!0;var R=L(u);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ir(t){{for(var u=Object.keys(t.props),d=0;d<u.length;d++){var k=u[d];if(k!=="children"&&k!=="key"){ae(t),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",k),ae(null);break}}t.ref!==null&&(ae(t),g("Invalid attribute `ref` supplied to `React.Fragment`."),ae(null))}}function Ft(t,u,d,k,R,j){{var x=K(t);if(!x){var E="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(E+=" 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 V=ar(R);V?E+=V:E+=Dt();var I;t===null?I="null":Je(t)?I="array":t!==void 0&&t.$$typeof===n?(I="<"+(L(t.type)||"Unknown")+" />",E=" Did you accidentally export a JSX literal instead of a component?"):I=typeof t,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",I,E)}var F=rr(t,u,d,R,j);if(F==null)return F;if(x){var z=u.children;if(z!==void 0)if(k)if(Je(z)){for(var le=0;le<z.length;le++)It(z[le],t);Object.freeze&&Object.freeze(z)}else g("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 It(z,t)}return t===o?ir(F):or(F),F}}function sr(t,u,d){return Ft(t,u,d,!0)}function cr(t,u,d){return Ft(t,u,d,!1)}var ur=cr,fr=sr;ie.Fragment=o,ie.jsx=ur,ie.jsxs=fr}()),ie}process.env.NODE_ENV==="production"?Pe.exports=Wt():Pe.exports=Vt();var Re=Pe.exports;const Z=Re.Fragment,l=Re.jsx,m=Re.jsxs,Se={},Mt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function Yt(e,n){return!Se[e]&&typeof window.fetch=="function"&&(Se[e]=window.fetch(n+e+".svg").then(r=>r.ok?r.text():(console.error("Missing icon: "+n+e+".svg"),Mt)).then(r=>r)),Promise.resolve(Se[e])}const y=({name:e,path:n,className:r="",...o})=>{const a="https://punkt-cdn.oslo.kommune.no/9.2/icons/",[i,s]=N.useState(null);return N.useEffect(()=>{if(!e)return;Yt(e,n||a).then(f=>s(f))},[e,n,a]),i?l("span",{className:`pkt-icon ${r}`,dangerouslySetInnerHTML:{__html:i},...o}):null},Ze=N.forwardRef(({children:e,className:n,skin:r="info",closeAlert:o=!1,onClose:a,title:i,date:s,ariaLive:p="polite",slim:f=!1,...c},h)=>{const v=[n,"pkt-alert",r&&`pkt-alert--${r}`,f&&"pkt-alert--slim"].filter(Boolean).join(" "),[w,C]=N.useState(!0),O=()=>{C(!1),a&&a()};return w?m("div",{...c,className:v,"aria-live":p,ref:h,children:[l(y,{className:"pkt-alert__icon",name:r==="info"?"alert-information":`alert-${r}`}),o&&l("div",{className:"pkt-alert__close",children:l("button",{type:"button",className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",tabIndex:0,"aria-label":"close",onClick:O,children:l(y,{name:"close",className:"pkt-btn__icon","aria-hidden":"true"})})}),i&&l("div",{className:"pkt-alert__title",children:i}),l("div",{className:"pkt-alert__text",children:e}),s&&m("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",s]})]}):null}),Jt=N.forwardRef(({href:e,text:n,onClick:r,className:o,...a},i)=>{const s=[o,"pkt-back-link"].filter(Boolean).join(" ");return l("nav",{ref:i,className:s,"aria-label":"Gå tilbake et steg",children:m("a",{href:e||"/",className:"pkt-link pkt-link--icon-left",onClick:()=>{r&&r()},...a,children:[l(y,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),l("span",{className:"pkt-back-link__text",children:n||"Forsiden"})]})})});/**
|
|
28
28
|
* @remix-run/router v1.7.1
|
|
29
29
|
*
|
|
30
30
|
* Copyright (c) Remix Software Inc.
|
|
@@ -42,7 +42,7 @@ Check the top-level render call using <`+d+">.")}return u}}function Lt(t,u){{if(
|
|
|
42
42
|
* LICENSE.md file in the root directory of this source tree.
|
|
43
43
|
*
|
|
44
44
|
* @license MIT
|
|
45
|
-
*/function Le(){return Le=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Le.apply(this,arguments)}const me=
|
|
45
|
+
*/function Le(){return Le=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Le.apply(this,arguments)}const me=b.createContext(null);process.env.NODE_ENV!=="production"&&(me.displayName="DataRouter");const lt=b.createContext(null);process.env.NODE_ENV!=="production"&&(lt.displayName="DataRouterState");const Xt=b.createContext(null);process.env.NODE_ENV!=="production"&&(Xt.displayName="Await");const Q=b.createContext(null);process.env.NODE_ENV!=="production"&&(Q.displayName="Navigation");const Ie=b.createContext(null);process.env.NODE_ENV!=="production"&&(Ie.displayName="Location");const re=b.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(re.displayName="Route");const Zt=b.createContext(null);process.env.NODE_ENV!=="production"&&(Zt.displayName="RouteError");function Qt(e,n){let{relative:r}=n===void 0?{}:n;Fe()||(process.env.NODE_ENV!=="production"?A(!1,"useHref() may be used only in the context of a <Router> component."):A(!1));let{basename:o,navigator:a}=b.useContext(Q),{hash:i,pathname:s,search:p}=he(e,{relative:r}),f=s;return o!=="/"&&(f=s==="/"?o:$e([o,s])),a.createHref({pathname:f,search:p,hash:i})}function Fe(){return b.useContext(Ie)!=null}function se(){return Fe()||(process.env.NODE_ENV!=="production"?A(!1,"useLocation() may be used only in the context of a <Router> component."):A(!1)),b.useContext(Ie).location}const ot="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function it(e){b.useContext(Q).static||b.useLayoutEffect(e)}function en(){let{isDataRoute:e}=b.useContext(re);return e?ln():tn()}function tn(){Fe()||(process.env.NODE_ENV!=="production"?A(!1,"useNavigate() may be used only in the context of a <Router> component."):A(!1));let e=b.useContext(me),{basename:n,navigator:r}=b.useContext(Q),{matches:o}=b.useContext(re),{pathname:a}=se(),i=JSON.stringify(nt(o).map(f=>f.pathnameBase)),s=b.useRef(!1);return it(()=>{s.current=!0}),b.useCallback(function(f,c){if(c===void 0&&(c={}),process.env.NODE_ENV!=="production"&&de(s.current,ot),!s.current)return;if(typeof f=="number"){r.go(f);return}let h=rt(f,JSON.parse(i),a,c.relative==="path");e==null&&n!=="/"&&(h.pathname=h.pathname==="/"?n:$e([n,h.pathname])),(c.replace?r.replace:r.push)(h,c.state,c)},[n,r,i,a,e])}function he(e,n){let{relative:r}=n===void 0?{}:n,{matches:o}=b.useContext(re),{pathname:a}=se(),i=JSON.stringify(nt(o).map(s=>s.pathnameBase));return b.useMemo(()=>rt(e,JSON.parse(i),a,r==="path"),[e,i,a,r])}var Ae;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(Ae||(Ae={}));var ke;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(ke||(ke={}));function st(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function nn(e){let n=b.useContext(me);return n||(process.env.NODE_ENV!=="production"?A(!1,st(e)):A(!1)),n}function rn(e){let n=b.useContext(re);return n||(process.env.NODE_ENV!=="production"?A(!1,st(e)):A(!1)),n}function ct(e){let n=rn(e),r=n.matches[n.matches.length-1];return r.route.id||(process.env.NODE_ENV!=="production"?A(!1,e+' can only be used on routes that contain a unique "id"'):A(!1)),r.route.id}function an(){return ct(ke.UseRouteId)}function ln(){let{router:e}=nn(Ae.UseNavigateStable),n=ct(ke.UseNavigateStable),r=b.useRef(!1);return it(()=>{r.current=!0}),b.useCallback(function(a,i){i===void 0&&(i={}),process.env.NODE_ENV!=="production"&&de(r.current,ot),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Le({fromRouteId:n},i)))},[e,n])}var ut;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(ut||(ut={})),new Promise(()=>{});/**
|
|
46
46
|
* React Router DOM v6.14.1
|
|
47
47
|
*
|
|
48
48
|
* Copyright (c) Remix Software Inc.
|
|
@@ -51,8 +51,8 @@ Check the top-level render call using <`+d+">.")}return u}}function Lt(t,u){{if(
|
|
|
51
51
|
* LICENSE.md file in the root directory of this source tree.
|
|
52
52
|
*
|
|
53
53
|
* @license MIT
|
|
54
|
-
*/function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ne.apply(this,arguments)}function Ue(e,n){if(e==null)return{};var r={},o=Object.keys(e),a,i;for(i=0;i<o.length;i++)a=o[i],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}const ve="get",_e="application/x-www-form-urlencoded";function be(e){return e!=null&&typeof e.tagName=="string"}function on(e){return be(e)&&e.tagName.toLowerCase()==="button"}function sn(e){return be(e)&&e.tagName.toLowerCase()==="form"}function cn(e){return be(e)&&e.tagName.toLowerCase()==="input"}function un(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fn(e,n){return e.button===0&&(!n||n==="_self")&&!un(e)}let ge=null;function pn(){if(ge===null)try{new FormData(document.createElement("form"),0),ge=!1}catch{ge=!0}return ge}const dn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Be(e){return e!=null&&!dn.has(e)?(process.env.NODE_ENV!=="production"&&de(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+_e+'"')),null):e}function mn(e,n){let r,o,a,i,s;if(sn(e)){let p=e.getAttribute("action");o=p?je(p,n):null,r=e.getAttribute("method")||ve,a=Be(e.getAttribute("enctype"))||_e,i=new FormData(e)}else if(on(e)||cn(e)&&(e.type==="submit"||e.type==="image")){let p=e.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||p.getAttribute("action");if(o=f?je(f,n):null,r=e.getAttribute("formmethod")||p.getAttribute("method")||ve,a=Be(e.getAttribute("formenctype"))||Be(p.getAttribute("enctype"))||_e,i=new FormData(p,e),!pn()){let{name:c,type:h,value:v}=e;if(h==="image"){let w=c?c+".":"";i.append(w+"x","0"),i.append(w+"y","0")}else c&&i.append(c,v)}}else{if(be(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ve,o=null,a=_e,s=e}return i&&a==="text/plain"&&(s=i,i=void 0),{action:o,method:r.toLowerCase(),encType:a,formData:i,body:s}}const hn=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],kn=["aria-current","caseSensitive","className","end","style","to","children"],vn=["reloadDocument","replace","method","action","onSubmit","submit","relative","preventScrollReset"];process.env.NODE_ENV;const _n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ne=g.forwardRef(function(n,r){let{onClick:o,relative:a,reloadDocument:i,replace:s,state:p,target:f,to:c,preventScrollReset:h}=n,v=Ue(n,hn),{basename:w}=g.useContext(Q),C,O=!1;if(typeof c=="string"&&bn.test(c)&&(C=c,_n))try{let b=new URL(window.location.href),$=c.startsWith("//")?new URL(b.protocol+c):new URL(c),U=je($.pathname,w);$.origin===b.origin&&U!=null?c=U+$.search+$.hash:O=!0}catch{process.env.NODE_ENV!=="production"&&de(!1,'<Link to="'+c+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let S=Qt(c,{relative:a}),D=wn(c,{replace:s,state:p,target:f,preventScrollReset:h,relative:a});function P(b){o&&o(b),b.defaultPrevented||D(b)}return g.createElement("a",ne({},v,{href:C||S,onClick:O||i?o:P,ref:r,target:f}))});process.env.NODE_ENV!=="production"&&(Ne.displayName="Link");const gn=g.forwardRef(function(n,r){let{"aria-current":o="page",caseSensitive:a=!1,className:i="",end:s=!1,style:p,to:f,children:c}=n,h=Ue(n,kn),v=he(f,{relative:h.relative}),w=se(),C=g.useContext(lt),{navigator:O}=g.useContext(Q),S=O.encodeLocation?O.encodeLocation(v).pathname:v.pathname,D=w.pathname,P=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;a||(D=D.toLowerCase(),P=P?P.toLowerCase():null,S=S.toLowerCase());let b=D===S||!s&&D.startsWith(S)&&D.charAt(S.length)==="/",$=P!=null&&(P===S||!s&&P.startsWith(S)&&P.charAt(S.length)==="/"),U=b?o:void 0,B;typeof i=="function"?B=i({isActive:b,isPending:$}):B=[i,b?"active":null,$?"pending":null].filter(Boolean).join(" ");let W=typeof p=="function"?p({isActive:b,isPending:$}):p;return g.createElement(Ne,ne({},h,{"aria-current":U,className:B,ref:r,style:W,to:f}),typeof c=="function"?c({isActive:b,isPending:$}):c)});process.env.NODE_ENV!=="production"&&(gn.displayName="NavLink");const Nn=g.forwardRef((e,n)=>{let r=Cn();return g.createElement(ft,ne({},e,{submit:r,ref:n}))});process.env.NODE_ENV!=="production"&&(Nn.displayName="Form");const ft=g.forwardRef((e,n)=>{let{reloadDocument:r,replace:o,method:a=ve,action:i,onSubmit:s,submit:p,relative:f,preventScrollReset:c}=e,h=Ue(e,vn),v=a.toLowerCase()==="get"?"get":"post",w=Pn(i,{relative:f}),C=O=>{if(s&&s(O),O.defaultPrevented)return;O.preventDefault();let S=O.nativeEvent.submitter,D=(S==null?void 0:S.getAttribute("formmethod"))||a;p(S||O.currentTarget,{method:D,replace:o,relative:f,preventScrollReset:c})};return g.createElement("form",ne({ref:n,method:v,action:w,onSubmit:r?s:C},h))});process.env.NODE_ENV!=="production"&&(ft.displayName="FormImpl"),process.env.NODE_ENV;var We;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(We||(We={}));var pt;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(pt||(pt={}));function yn(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function En(e){let n=g.useContext(me);return n||(process.env.NODE_ENV!=="production"?A(!1,yn(e)):A(!1)),n}function wn(e,n){let{target:r,replace:o,state:a,preventScrollReset:i,relative:s}=n===void 0?{}:n,p=en(),f=se(),c=he(e,{relative:s});return g.useCallback(h=>{if(fn(h,r)){h.preventDefault();let v=o!==void 0?o:Te(f)===Te(c);p(e,{replace:v,state:a,preventScrollReset:i,relative:s})}},[f,p,c,o,a,r,e,i,s])}function xn(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}function Cn(){let{router:e}=En(We.UseSubmit),{basename:n}=g.useContext(Q),r=an();return g.useCallback(function(o,a){a===void 0&&(a={}),xn();let{action:i,method:s,encType:p,formData:f,body:c}=mn(o,n);e.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:f,body:c,formMethod:a.method||s,formEncType:a.encType||p,replace:a.replace,fromRouteId:r})},[e,n,r])}function Pn(e,n){let{relative:r}=n===void 0?{}:n,{basename:o}=g.useContext(Q),a=g.useContext(re);a||(process.env.NODE_ENV!=="production"?A(!1,"useFormAction must be used inside a RouteContext"):A(!1));let[i]=a.matches.slice(-1),s=ne({},he(e||".",{relative:r})),p=se();if(e==null&&(s.search=p.search,s.hash=p.hash,i.route.index)){let f=new URLSearchParams(s.search);f.delete("index"),s.search=f.toString()?"?"+f.toString():""}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(s.pathname=s.pathname==="/"?o:$e([o,s.pathname])),Te(s)}const Rn=N.forwardRef(({breadcrumbs:e,navigationType:n,className:r,...o},a)=>{const i=e.slice(0,4),s=i[i.length-2],p=[r,"pkt-breadcrumbs"].filter(Boolean).join(" ");return m("nav",{ref:a,"aria-label":"brødsmulemeny",className:p,children:[l("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:i.map((f,c)=>l("li",{className:"pkt-breadcrumbs__item",children:c===i.length-1?l("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l("span",{className:"pkt-breadcrumbs__text",children:f.text})}):n==="router"?m(Ne,{to:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...o,children:[l(y,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l("span",{className:"pkt-breadcrumbs__text",children:f.text})]}):m("a",{href:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...o,children:[l(y,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l("span",{className:"pkt-breadcrumbs__text",children:f.text})]})},`breadcrumb-${c}`))}),n==="router"?m(Ne,{to:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...o,children:[l(y,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l("span",{className:"pkt-breadcrumbs__text",children:s.text})]}):m("a",{href:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...o,children:[l(y,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l("span",{className:"pkt-breadcrumbs__text",children:s.text})]})]})}),ce=N.forwardRef(({children:e,className:n,iconName:r="user",secondIconName:o="user",size:a="medium",skin:i="primary",type:s="button",variant:p="label-only",color:f,...c},h)=>{const v=[n,"pkt-btn",a&&`pkt-btn--${a}`,i&&`pkt-btn--${i}`,p&&`pkt-btn--${p}`,f&&`pkt-btn--${f}`].filter(Boolean).join(" ");return m("button",{...c,className:v,type:s,ref:h,children:[p!=="label-only"&&l(y,{className:"pkt-btn__icon",name:r}),l("span",{className:"pkt-btn__text",children:e}),p==="icons-right-and-left"&&l(y,{className:"pkt-btn__icon",name:o})]})});ce.displayName="PktButton";const dt=N.forwardRef(({id:e,hasTile:n=!1,disabled:r=!1,label:o,checkHelptext:a,hasError:i=!1,className:s,...p},f)=>{const c=[s,"pkt-input-check"].filter(Boolean).join(" ");return l("div",{className:c,children:m("div",{className:`pkt-input-check__input ${n?"pkt-input-check__input--tile":""}`,children:[l("input",{ref:f,className:`pkt-input-check__input-checkbox ${i?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:e,disabled:r,...p}),m("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[o,a&&l("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});dt.displayName="PktCheckbox";const Sn=({columnOne:e,columnTwo:n,socialLinks:r,className:o,personvernOgInfoLink:a="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var p,f;const s=[o,"pkt-footer"].filter(Boolean).join(" ");return l("footer",{className:s,"data-mode":"dark",children:m("div",{className:"pkt-footer__container",children:[m("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[m("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l("h2",{className:"pkt-footer__title",children:e.title}),m("ul",{className:"pkt-footer__list",children:[e.text&&l("li",{className:"pkt-footer__text",children:e.text}),(p=e.links)==null?void 0:p.map((c,h)=>l("li",{className:"pkt-footer__list-item",children:m("a",{className:`pkt-footer__link ${c.external?"pkt-link--external":""}`,href:c.href,target:c.openInNewTab?"_blank":"_self",rel:c.openInNewTab?"noopener noreferrer":void 0,children:[l(y,{className:"pkt-footer__link-icon",name:"chevron-right"}),c.text]})},`links-${h}`))]})]}),m("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l("h2",{className:"pkt-footer__title",children:n.title}),m("ul",{className:"pkt-footer__list",children:[n.text&&l("li",{className:"pkt-footer__text",children:n.text}),(f=n.links)==null?void 0:f.map((c,h)=>l("li",{className:"pkt-footer__list-item",children:m("a",{className:`pkt-footer__link ${c.external?"pkt-link--external":""}`,href:c.href,target:c.openInNewTab?"_blank":"_self",rel:c.openInNewTab?"noopener noreferrer":void 0,children:[l(y,{className:"pkt-footer__link-icon",name:"chevron-right"}),c.text]})},`links-${h}`))]})]}),m("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),m("ul",{className:"pkt-footer__list",children:[l("li",{className:"pkt-footer__list-item",children:m("a",{className:"pkt-footer__link",href:a,children:[l(y,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l("li",{className:"pkt-footer__list-item",children:m("a",{className:"pkt-footer__link",href:i,children:[l(y,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),r&&m("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l("div",{className:"pkt-footer__social-languages",children:r.filter(c=>c.language).map((c,h)=>l("div",{className:"pkt-footer__social-language",children:l("a",{href:c.href,"aria-label":`til ${c.language} versjon av nettsiden`,target:c.openInNewTab?"_blank":"_self",rel:c.openInNewTab?"noopener noreferrer":void 0,children:c.language})},`sociallinks-language-${h}`))}),l("div",{className:"pkt-footer__social-icons",children:r.filter(c=>c.iconName).map((c,h)=>l(N.Fragment,{children:l("a",{href:c.href,"aria-label":`til ${c.iconName}`,className:"pkt-footer__social-icon-link",target:c.openInNewTab?"_blank":"_self",rel:c.openInNewTab?"noopener noreferrer":void 0,children:l(y,{className:"pkt-footer__social-icon",name:c.iconName})})},`sociallinks-${h}`))})]})]})})},On=({links:e=[],personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",className:o})=>{const a=[o,"pkt-footer-simple"].filter(Boolean).join(" ");return l("footer",{className:a,"data-mode":"dark",children:l("div",{className:"pkt-footer-simple__container",children:m("ul",{className:"pkt-footer-simple__list",children:[e.map((i,s)=>l("li",{className:"pkt-footer-simple__list-item",children:m("a",{className:`pkt-footer-simple__link ${i.external?" pkt-link--external":""}`,href:i.href,target:i.openInNewTab?"_blank":"_self",rel:i.openInNewTab?"noopener noreferrer":void 0,children:[l(y,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),i.text]})},s)),l("li",{className:"pkt-footer-simple__list-item",children:m("a",{className:"pkt-footer-simple__link",href:n,children:[l(y,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l("li",{className:"pkt-footer-simple__list-item",children:m("a",{className:"pkt-footer-simple__link",href:r,children:[l(y,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})};var mt={exports:{}};/*!
|
|
54
|
+
*/function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ne.apply(this,arguments)}function Ue(e,n){if(e==null)return{};var r={},o=Object.keys(e),a,i;for(i=0;i<o.length;i++)a=o[i],!(n.indexOf(a)>=0)&&(r[a]=e[a]);return r}const ve="get",_e="application/x-www-form-urlencoded";function be(e){return e!=null&&typeof e.tagName=="string"}function on(e){return be(e)&&e.tagName.toLowerCase()==="button"}function sn(e){return be(e)&&e.tagName.toLowerCase()==="form"}function cn(e){return be(e)&&e.tagName.toLowerCase()==="input"}function un(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fn(e,n){return e.button===0&&(!n||n==="_self")&&!un(e)}let ge=null;function pn(){if(ge===null)try{new FormData(document.createElement("form"),0),ge=!1}catch{ge=!0}return ge}const dn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Be(e){return e!=null&&!dn.has(e)?(process.env.NODE_ENV!=="production"&&de(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+_e+'"')),null):e}function mn(e,n){let r,o,a,i,s;if(sn(e)){let p=e.getAttribute("action");o=p?je(p,n):null,r=e.getAttribute("method")||ve,a=Be(e.getAttribute("enctype"))||_e,i=new FormData(e)}else if(on(e)||cn(e)&&(e.type==="submit"||e.type==="image")){let p=e.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||p.getAttribute("action");if(o=f?je(f,n):null,r=e.getAttribute("formmethod")||p.getAttribute("method")||ve,a=Be(e.getAttribute("formenctype"))||Be(p.getAttribute("enctype"))||_e,i=new FormData(p,e),!pn()){let{name:c,type:h,value:v}=e;if(h==="image"){let w=c?c+".":"";i.append(w+"x","0"),i.append(w+"y","0")}else c&&i.append(c,v)}}else{if(be(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ve,o=null,a=_e,s=e}return i&&a==="text/plain"&&(s=i,i=void 0),{action:o,method:r.toLowerCase(),encType:a,formData:i,body:s}}const hn=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],kn=["aria-current","caseSensitive","className","end","style","to","children"],vn=["reloadDocument","replace","method","action","onSubmit","submit","relative","preventScrollReset"];process.env.NODE_ENV;const _n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ne=b.forwardRef(function(n,r){let{onClick:o,relative:a,reloadDocument:i,replace:s,state:p,target:f,to:c,preventScrollReset:h}=n,v=Ue(n,hn),{basename:w}=b.useContext(Q),C,O=!1;if(typeof c=="string"&&bn.test(c)&&(C=c,_n))try{let g=new URL(window.location.href),$=c.startsWith("//")?new URL(g.protocol+c):new URL(c),U=je($.pathname,w);$.origin===g.origin&&U!=null?c=U+$.search+$.hash:O=!0}catch{process.env.NODE_ENV!=="production"&&de(!1,'<Link to="'+c+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let S=Qt(c,{relative:a}),D=wn(c,{replace:s,state:p,target:f,preventScrollReset:h,relative:a});function P(g){o&&o(g),g.defaultPrevented||D(g)}return b.createElement("a",ne({},v,{href:C||S,onClick:O||i?o:P,ref:r,target:f}))});process.env.NODE_ENV!=="production"&&(Ne.displayName="Link");const gn=b.forwardRef(function(n,r){let{"aria-current":o="page",caseSensitive:a=!1,className:i="",end:s=!1,style:p,to:f,children:c}=n,h=Ue(n,kn),v=he(f,{relative:h.relative}),w=se(),C=b.useContext(lt),{navigator:O}=b.useContext(Q),S=O.encodeLocation?O.encodeLocation(v).pathname:v.pathname,D=w.pathname,P=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;a||(D=D.toLowerCase(),P=P?P.toLowerCase():null,S=S.toLowerCase());let g=D===S||!s&&D.startsWith(S)&&D.charAt(S.length)==="/",$=P!=null&&(P===S||!s&&P.startsWith(S)&&P.charAt(S.length)==="/"),U=g?o:void 0,B;typeof i=="function"?B=i({isActive:g,isPending:$}):B=[i,g?"active":null,$?"pending":null].filter(Boolean).join(" ");let W=typeof p=="function"?p({isActive:g,isPending:$}):p;return b.createElement(Ne,ne({},h,{"aria-current":U,className:B,ref:r,style:W,to:f}),typeof c=="function"?c({isActive:g,isPending:$}):c)});process.env.NODE_ENV!=="production"&&(gn.displayName="NavLink");const Nn=b.forwardRef((e,n)=>{let r=Cn();return b.createElement(ft,ne({},e,{submit:r,ref:n}))});process.env.NODE_ENV!=="production"&&(Nn.displayName="Form");const ft=b.forwardRef((e,n)=>{let{reloadDocument:r,replace:o,method:a=ve,action:i,onSubmit:s,submit:p,relative:f,preventScrollReset:c}=e,h=Ue(e,vn),v=a.toLowerCase()==="get"?"get":"post",w=Pn(i,{relative:f}),C=O=>{if(s&&s(O),O.defaultPrevented)return;O.preventDefault();let S=O.nativeEvent.submitter,D=(S==null?void 0:S.getAttribute("formmethod"))||a;p(S||O.currentTarget,{method:D,replace:o,relative:f,preventScrollReset:c})};return b.createElement("form",ne({ref:n,method:v,action:w,onSubmit:r?s:C},h))});process.env.NODE_ENV!=="production"&&(ft.displayName="FormImpl"),process.env.NODE_ENV;var We;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(We||(We={}));var pt;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(pt||(pt={}));function yn(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function En(e){let n=b.useContext(me);return n||(process.env.NODE_ENV!=="production"?A(!1,yn(e)):A(!1)),n}function wn(e,n){let{target:r,replace:o,state:a,preventScrollReset:i,relative:s}=n===void 0?{}:n,p=en(),f=se(),c=he(e,{relative:s});return b.useCallback(h=>{if(fn(h,r)){h.preventDefault();let v=o!==void 0?o:Te(f)===Te(c);p(e,{replace:v,state:a,preventScrollReset:i,relative:s})}},[f,p,c,o,a,r,e,i,s])}function xn(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}function Cn(){let{router:e}=En(We.UseSubmit),{basename:n}=b.useContext(Q),r=an();return b.useCallback(function(o,a){a===void 0&&(a={}),xn();let{action:i,method:s,encType:p,formData:f,body:c}=mn(o,n);e.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:f,body:c,formMethod:a.method||s,formEncType:a.encType||p,replace:a.replace,fromRouteId:r})},[e,n,r])}function Pn(e,n){let{relative:r}=n===void 0?{}:n,{basename:o}=b.useContext(Q),a=b.useContext(re);a||(process.env.NODE_ENV!=="production"?A(!1,"useFormAction must be used inside a RouteContext"):A(!1));let[i]=a.matches.slice(-1),s=ne({},he(e||".",{relative:r})),p=se();if(e==null&&(s.search=p.search,s.hash=p.hash,i.route.index)){let f=new URLSearchParams(s.search);f.delete("index"),s.search=f.toString()?"?"+f.toString():""}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(s.pathname=s.pathname==="/"?o:$e([o,s.pathname])),Te(s)}const Rn=N.forwardRef(({breadcrumbs:e,navigationType:n,className:r,...o},a)=>{const i=e.slice(0,4),s=i[i.length-2],p=[r,"pkt-breadcrumbs"].filter(Boolean).join(" ");return m("nav",{ref:a,"aria-label":"brødsmulemeny",className:p,children:[l("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:i.map((f,c)=>l("li",{className:"pkt-breadcrumbs__item",children:c===i.length-1?l("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l("span",{className:"pkt-breadcrumbs__text",children:f.text})}):n==="router"?m(Ne,{to:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...o,children:[l(y,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l("span",{className:"pkt-breadcrumbs__text",children:f.text})]}):m("a",{href:f.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...o,children:[l(y,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l("span",{className:"pkt-breadcrumbs__text",children:f.text})]})},`breadcrumb-${c}`))}),n==="router"?m(Ne,{to:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...o,children:[l(y,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l("span",{className:"pkt-breadcrumbs__text",children:s.text})]}):m("a",{href:s.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...o,children:[l(y,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l("span",{className:"pkt-breadcrumbs__text",children:s.text})]})]})}),ce=N.forwardRef(({children:e,className:n,iconName:r="user",secondIconName:o="user",size:a="medium",skin:i="primary",type:s="button",variant:p="label-only",color:f,...c},h)=>{const v=[n,"pkt-btn",a&&`pkt-btn--${a}`,i&&`pkt-btn--${i}`,p&&`pkt-btn--${p}`,f&&`pkt-btn--${f}`].filter(Boolean).join(" ");return m("button",{...c,className:v,type:s,ref:h,children:[p!=="label-only"&&l(y,{className:"pkt-btn__icon",name:r}),l("span",{className:"pkt-btn__text",children:e}),p==="icons-right-and-left"&&l(y,{className:"pkt-btn__icon",name:o})]})});ce.displayName="PktButton";const dt=N.forwardRef(({id:e,hasTile:n=!1,disabled:r=!1,label:o,checkHelptext:a,hasError:i=!1,className:s,...p},f)=>{const c=[s,"pkt-input-check"].filter(Boolean).join(" ");return l("div",{className:c,children:m("div",{className:`pkt-input-check__input ${n?"pkt-input-check__input--tile":""}`,children:[l("input",{ref:f,className:`pkt-input-check__input-checkbox ${i?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:e,disabled:r,...p}),m("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[o,a&&l("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});dt.displayName="PktCheckbox";const Sn=({columnOne:e,columnTwo:n,socialLinks:r,className:o,personvernOgInfoLink:a="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var p,f;const s=[o,"pkt-footer"].filter(Boolean).join(" ");return l("footer",{className:s,"data-mode":"dark",children:m("div",{className:"pkt-footer__container",children:[m("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[m("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l("h2",{className:"pkt-footer__title",children:e.title}),m("ul",{className:"pkt-footer__list",children:[e.text&&l("li",{className:"pkt-footer__text",children:e.text}),(p=e.links)==null?void 0:p.map((c,h)=>l("li",{className:"pkt-footer__list-item",children:m("a",{className:`pkt-footer__link ${c.external?"pkt-link--external":""}`,href:c.href,target:c.openInNewTab?"_blank":"_self",rel:c.openInNewTab?"noopener noreferrer":void 0,children:[l(y,{className:"pkt-footer__link-icon",name:"chevron-right"}),c.text]})},`links-${h}`))]})]}),m("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l("h2",{className:"pkt-footer__title",children:n.title}),m("ul",{className:"pkt-footer__list",children:[n.text&&l("li",{className:"pkt-footer__text",children:n.text}),(f=n.links)==null?void 0:f.map((c,h)=>l("li",{className:"pkt-footer__list-item",children:m("a",{className:`pkt-footer__link ${c.external?"pkt-link--external":""}`,href:c.href,target:c.openInNewTab?"_blank":"_self",rel:c.openInNewTab?"noopener noreferrer":void 0,children:[l(y,{className:"pkt-footer__link-icon",name:"chevron-right"}),c.text]})},`links-${h}`))]})]}),m("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),m("ul",{className:"pkt-footer__list",children:[l("li",{className:"pkt-footer__list-item",children:m("a",{className:"pkt-footer__link",href:a,children:[l(y,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l("li",{className:"pkt-footer__list-item",children:m("a",{className:"pkt-footer__link",href:i,children:[l(y,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),r&&m("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l("div",{className:"pkt-footer__social-languages",children:r.filter(c=>c.language).map((c,h)=>l("div",{className:"pkt-footer__social-language",children:l("a",{href:c.href,"aria-label":`til ${c.language} versjon av nettsiden`,target:c.openInNewTab?"_blank":"_self",rel:c.openInNewTab?"noopener noreferrer":void 0,children:c.language})},`sociallinks-language-${h}`))}),l("div",{className:"pkt-footer__social-icons",children:r.filter(c=>c.iconName).map((c,h)=>l(N.Fragment,{children:l("a",{href:c.href,"aria-label":`til ${c.iconName}`,className:"pkt-footer__social-icon-link",target:c.openInNewTab?"_blank":"_self",rel:c.openInNewTab?"noopener noreferrer":void 0,children:l(y,{className:"pkt-footer__social-icon",name:c.iconName})})},`sociallinks-${h}`))})]})]})})},On=({links:e=[],personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",className:o})=>{const a=[o,"pkt-footer-simple"].filter(Boolean).join(" ");return l("footer",{className:a,"data-mode":"dark",children:l("div",{className:"pkt-footer-simple__container",children:m("ul",{className:"pkt-footer-simple__list",children:[e.map((i,s)=>l("li",{className:"pkt-footer-simple__list-item",children:m("a",{className:`pkt-footer-simple__link ${i.external?" pkt-link--external":""}`,href:i.href,target:i.openInNewTab?"_blank":"_self",rel:i.openInNewTab?"noopener noreferrer":void 0,children:[l(y,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),i.text]})},s)),l("li",{className:"pkt-footer-simple__list-item",children:m("a",{className:"pkt-footer-simple__link",href:n,children:[l(y,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l("li",{className:"pkt-footer-simple__list-item",children:m("a",{className:"pkt-footer-simple__link",href:r,children:[l(y,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})};var mt={exports:{}};/*!
|
|
55
55
|
Copyright (c) 2018 Jed Watson.
|
|
56
56
|
Licensed under the MIT License (MIT), see
|
|
57
57
|
http://jedwatson.github.io/classnames
|
|
58
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function r(){for(var o=[],a=0;a<arguments.length;a++){var i=arguments[a];if(i){var s=typeof i;if(s==="string"||s==="number")o.push(i);else if(Array.isArray(i)){if(i.length){var p=r.apply(null,i);p&&o.push(p)}}else if(s==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){o.push(i.toString());continue}for(var f in i)n.call(i,f)&&i[f]&&o.push(f)}}}return o.join(" ")}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(mt);var Tn=mt.exports;const ht=Bt(Tn),jn=N.forwardRef(({logoLink:e="https://www.oslo.kommune.no/",serviceName:n,fixed:r=!0,scrollToHide:o=!0,user:a,userMenu:i,representing:s,userOptions:p,userMenuFooter:f,canChangeRepresentation:c=!0,showMenuButton:h=!1,showLogOutButton:v=!1,openMenu:w,logOut:C,changeRepresentation:O,...S},D)=>{const P=N.useMemo(()=>typeof(a==null?void 0:a.lastLoggedIn)=="string"?a.lastLoggedIn:a!=null&&a.lastLoggedIn?new Date(a.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[a]),[b,$]=N.useState(!1),[U,B]=N.useState(0),[W,Y]=N.useState(!1),q=N.useRef(null);N.useEffect(()=>(document.addEventListener("mouseup",K),window.addEventListener("scroll",M),()=>{document.removeEventListener("mouseup",K),window.removeEventListener("scroll",M)}));const J=()=>{Y(!W)},K=_=>{q.current&&!q.current.contains(_.target)&&Y(!1)},M=()=>{if(o){const _=window.pageYOffset||document.documentElement.scrollTop;if(_<0||Math.abs(_-U)<60)return;$(_>U),B(_)}};return m("header",{...S,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:ht("pkt-header",{"pkt-header--fixed":r,"pkt-header--scroll-to-hide":o,"pkt-header--hidden":b}),ref:D,children:[m("div",{className:"pkt-header__logo",children:[typeof e=="string"?l("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:e,children:l(y,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/9.1/logos/"})}):l("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:e,children:l(y,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/9.1/logos/"})}),l("span",{className:"pkt-header__logo-service",children:n})]}),l("nav",{className:"pkt-header__actions",children:m("ul",{className:"pkt-header__actions-row",children:[h&&l("li",{children:l(ce,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:w,children:"Meny"})}),(a||s)&&m("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${W&&!b?"pkt-header--open-dropdown":""}`,ref:q,children:[m("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":W,onClick:J,children:[l(y,{name:"user",className:"pkt-btn__icon"}),l("span",{className:"pkt-header__user-fullname",children:(s==null?void 0:s.name)||(a==null?void 0:a.name)}),l("span",{className:"pkt-header__user-shortname",children:(s==null?void 0:s.shortname)||(a==null?void 0:a.shortname)}),l(y,{name:"chevron-thin-down",className:"pkt-btn--closed"}),l(y,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),m("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[a&&m("li",{children:[l("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l("div",{className:"pkt-user-menu__name",children:a.name}),a.lastLoggedIn&&m("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l("time",{children:P})]})]}),i&&l("li",{children:l("ul",{className:"pkt-list",children:i.map((_,L)=>l("li",{children:typeof _.target=="string"?m("a",{href:_.target,className:"pkt-link",children:[_.iconName&&l(y,{name:_.iconName,className:"pkt-link__icon"}),_.title]}):m("button",{className:"pkt-link-button pkt-link",onClick:_.target,children:[_.iconName&&l(y,{name:_.iconName,className:"pkt-link__icon"}),_.title]})},`userMenu-${L}`))})}),(s||c)&&m("li",{children:[s&&m(Z,{children:[l("div",{className:"pkt-user-menu__label",children:"Representerer"}),l("div",{className:"pkt-user-menu__name",children:s.name}),s.orgNumber&&m("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",s.orgNumber]})]}),l("ul",{className:"pkt-list mt-size-16",children:c&&l("li",{children:m("button",{className:"pkt-link-button pkt-link",onClick:O,children:[l(y,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),l("li",{children:l("ul",{className:"pkt-list",children:(p||!v)&&m(Z,{children:[p==null?void 0:p.map((_,L)=>l("li",{children:typeof _.target=="string"?m("a",{href:_.target,className:"pkt-link",children:[_.iconName&&l(y,{name:_.iconName,className:"pkt-link__icon"}),_.title]}):m("button",{className:"pkt-link-button pkt-link",onClick:_.target,children:[_.iconName&&l(y,{name:_.iconName,className:"pkt-link__icon"}),_.title]})},`userOptions-${L}`)),!v&&l("li",{children:m("button",{className:"pkt-link-button pkt-link",onClick:C,children:[l(y,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),f&&l("li",{className:"footer",children:l("ul",{className:"pkt-list-horizontal bordered",children:f.map((_,L)=>l("li",{children:typeof _.target=="string"?l("a",{href:_.target,className:"pkt-link",children:_.title}):l("button",{className:"pkt-link-button pkt-link",onClick:_.target,children:_.title})},`userMenuFooter-${L}`))})})]})]}),v&&l("li",{children:l(ce,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:C,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),kt=N.forwardRef(({label:e,id:n,children:r,...o},a)=>m("div",{className:"pkt-form-group",children:[l("label",{htmlFor:n,className:"pkt-form-label",children:e}),l("input",{className:"pkt-form-input",id:n,...o,ref:a}),r]}));kt.displayName="PktInput";const ue=N.forwardRef(({forId:e,label:n,helptext:r,helptextDropdown:o,helptextDropdownButton:a,optional:i,optionalText:s="Valgfritt",required:p,requiredText:f="Må fylles ut",hasError:c,errorMessage:h,disabled:v,inline:w,ariaDescribedby:C,useWrapper:O=!0,children:S,className:D,hasFieldset:P=!1},b)=>{const[$,U]=N.useState(!1),B=()=>{U(!$)},W=()=>i?"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":"",Y=i?s:p?f:"",q=v?"pkt-inputwrapper--disabled":"",J=w?"pkt-inputwrapper--inline":"",K=c?"pkt-inputwrapper--error":"",M=!!o&&o!=="",_=a||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',L=P?"fieldset":M?"div":"label",H=P?"legend":M?"h2":"span",G=C||(r?`${e}-helptext`:void 0);return m("div",{className:["pkt-inputwrapper",D,q,J,K].join(" "),ref:b,children:[O?l(Z,{children:m(L,{htmlFor:e,"aria-describedby":M?"":C,className:`pkt-inputwrapper__label${P?" pkt-inputwrapper__fieldset":""}`,children:[m(H,{id:`${e}-label`,className:`${P?" pkt-inputwrapper__legend":""}`,children:[n,Y!==""&&l("span",{className:W(),children:Y})]}),r&&l("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,dangerouslySetInnerHTML:{__html:r}}),M&&o!==""&&m("div",{children:[l(ce,{skin:"tertiary",size:"small",variant:"icon-right",iconName:$?"chevron-thin-up":"chevron-thin-down",className:"pkt-inputwrapper__helptext-expandable pkt-link pkt-link--icon-right",onClick:B,children:l("span",{dangerouslySetInnerHTML:{__html:_}})}),l("div",{className:`pkt-inputwrapper__helptext ${$?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:l("span",{dangerouslySetInnerHTML:{__html:o}})}),l("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":G,children:n})]}),l(Z,{children:S})]})}):m(Z,{children:[l("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":G,id:`${e}-label`,children:n}),S]}),c&&h&&l("div",{children:l(Ze,{skin:"error","aria-live":"assertive",id:`${e}-error`,slim:!0,children:h})})]})});ue.displayName="PktInputWrapper";const vt=N.forwardRef(({children:e,className:n,iconName:r="user",openInNewTab:o=!1,skin:a="normal",href:i="#",external:s=!1,title:p},f)=>{const c=[n,"pkt-linkcard",a&&`pkt-linkcard--${a}`].filter(Boolean).join(" ");return m("a",{href:i,className:`pkt-linkcard pkt-link ${c}`,target:o?"_blank":"_self",rel:o?"noopener noreferrer":void 0,ref:f,children:[l(y,{className:"pkt-link__icon",name:r}),m("div",{className:"pkt-linkcard__content",children:[l("div",{className:`pkt-linkcard__title ${s?"pkt-link pkt-link--external":""}`,children:p}),l("div",{className:"pkt-linkcard__text",children:e})]})]})});vt.displayName="PktLinkCard";const Dn=({children:e,skin:n="beige",title:r,className:o,...a})=>{const i=["pkt-messagebox",n&&`pkt-messagebox--${n}`,o].filter(Boolean).join(" ");return m("div",{...a,className:i,children:[l("div",{className:"pkt-messagebox__title",children:r}),l("div",{className:"pkt-messagebox__text",children:e})]})},_t=N.forwardRef(({id:e,name:n,label:r,className:o,hasTile:a=!1,disabled:i=!1,checkHelptext:s,hasError:p=!1,...f},c)=>{const h=[o,"pkt-input-check"].filter(Boolean).join(" ");return l("div",{className:h,children:m("div",{className:`pkt-input-check__input ${a?"pkt-input-check__input--tile":""}`,children:[l("input",{ref:c,className:`pkt-input-check__input-checkbox ${p?"pkt-input-check__input-checkbox--error":""}`,type:"radio",id:e,disabled:i,name:n,...f}),m("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[r,s&&l("div",{className:"pkt-input-check__input-helptext",children:s})]})]})})});_t.displayName="PktRadioButton";const $n=N.forwardRef(({ariaDescribedby:e,ariaLabelledby:n,children:r,className:o,disabled:a=!1,errorMessage:i,hasError:s,helptext:p,helptextDropdown:f,helptextDropdownButton:c,id:h,inline:v=!1,fullwidth:w=!1,label:C,name:O,optional:S=!1,optionalText:D,required:P=!1,requiredText:b,...$},U)=>{const B=[o,"pkt-select"].join(" ");return l(ue,{className:B,forId:h,label:C,helptext:p,helptextDropdown:f,helptextDropdownButton:c,optional:S,optionalText:D,required:P,requiredText:b,hasError:s,errorMessage:i,disabled:a,inline:v,ariaDescribedby:e,children:l("select",{ref:U,className:`pkt-input ${w?"pkt-input--fullwidth":""}`,"aria-invalid":s,"aria-errormessage":`${h}-error`,"aria-labelledby":n||`${h}-label`,"aria-required":P,disabled:a,id:h,name:O||h,...$,children:r})})}),Ln=({isResponsive:e,children:n})=>e?l("div",{className:"pkt-table-container",children:n}):l(Z,{children:n}),In=({isResponsive:e,modifiers:{info:n=!1,success:r=!1,strong:o=!1,shadow:a=!1}={},children:i})=>l(Ln,{isResponsive:e,children:l("table",{className:ht("pkt-table",{"pkt-table--info":n,"pkt-table--success":r,"pkt-table--strong":o,"pkt-table--shadow":a}),children:i})}),Fn=({children:e})=>l("td",{className:"pkt-table__th",children:e}),An=({children:e})=>l("th",{className:"pkt-table__th",children:e}),bt=N.forwardRef(({children:e,className:n,skin:r="blue",textStyle:o="normal-text",size:a="medium",closeTag:i=!1,iconName:s="",type:p="button",ariaLabel:f="close",onClick:c=()=>{}},h)=>{const[v,w]=N.useState(!1),C=P=>{w(!0),c(P)},O=["pkt-tag",a&&`pkt-tag--${a}`,r&&`pkt-tag--${r}`,o&&`pkt-tag--${o}`,n].filter(Boolean).join(" "),S=["pkt-tag","pkt-btn","pkt-btn--tertiary",a&&`pkt-tag--${a}`,r&&`pkt-tag--${r}`,o&&`pkt-tag--${o}`,s&&i?"pkt-btn--icons-right-and-left":null,i&&!s?"pkt-btn--icon-right":null,n].filter(Boolean).join(" "),D=!v;return i&&s?l(Z,{children:D&&m("button",{className:S,type:p,"aria-label":f,onClick:C,ref:h,children:[l(y,{className:"pkt-tag__icon",name:s}),e,l(y,{className:"pkt-tag__close-btn",name:"close"})]})}):i?l(Z,{children:D&&m("button",{className:S,type:p,"aria-label":f,onClick:C,ref:h,children:[l(y,{className:"pkt-tag__close-btn",name:"close"}),e]})}):s?m("span",{className:O,children:[l(y,{className:"pkt-tag__icon",name:s}),e]}):l("span",{className:O,children:e})});bt.displayName="PktTag";const Un=N.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:r,counter:o,counterMaxLength:a,className:i,disabled:s,errorMessage:p,hasError:f,helptext:c,helptextDropdown:h,helptextDropdownButton:v,inline:w,fullwidth:C=!1,label:O,name:S,optional:D=!1,optionalText:P,required:b=!1,requiredText:$,placeholder:U,rows:B,useWrapper:W,onChange:Y,...q},J)=>{const K=[i,"pkt-textinput","pkt-textarea"].join(" "),M=r||`${e}-label`,_=N.useRef(null),[L,H]=N.useState(0),G=ee=>{var te,fe;if(o&&H(((fe=(te=ee.currentTarget)==null?void 0:te.value)==null?void 0:fe.length)||0),Y)return Y(ee)};return N.useEffect(()=>{var ee,te;typeof J=="function"&&J(_.current),o&&H(((te=(ee=_==null?void 0:_.current)==null?void 0:ee.value)==null?void 0:te.length)||0)},[J]),m(ue,{ariaDescribedby:n,className:K,disabled:s,errorMessage:p,forId:e,hasError:f,helptext:c,helptextDropdown:h,helptextDropdownButton:v,inline:w,label:O,optional:D,optionalText:P,required:b,requiredText:$,useWrapper:W,children:[l("textarea",{ref:_,className:`pkt-input ${C?"pkt-input--fullwidth":""} ${a&&L>a?"pkt-input--counter-error":""}`,name:S||e,id:e,placeholder:U,disabled:s,rows:B,"aria-labelledby":M,"aria-invalid":f,"aria-errormessage":`${e}-error`,"aria-required":b,...q,onChange:G}),o&&m("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[L||0,a&&`/${a}`]})]})}),Bn=N.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:r,autocomplete:o="off",className:a,disabled:i=!1,errorMessage:s,hasError:p=!1,helptext:f,helptextDropdown:c,helptextDropdownButton:h,iconNameRight:v,inline:w=!1,fullwidth:C=!1,label:O,name:S,optional:D=!1,optionalText:P,required:b=!1,requiredText:$,placeholder:U,prefix:B,suffix:W,type:Y="text",useWrapper:q=!0,value:J,...K},M)=>{const _=[a,"pkt-textinput"].join(" "),L=r||`${e}-label`;return l(ue,{ariaDescribedby:n,className:_,disabled:i,errorMessage:s,forId:e,hasError:p,helptext:f,helptextDropdown:c,helptextDropdownButton:h,inline:w,label:O,optional:D,optionalText:P,required:b,requiredText:$,useWrapper:q,children:m("div",{className:"pkt-input__container",children:[B&&l("div",{className:"pkt-input-prefix",children:B}),l("input",{ref:M,className:`pkt-input ${C?"pkt-input--fullwidth":""}`,type:Y,name:S||e,id:e,placeholder:U,autoComplete:o,value:J,disabled:i,"aria-required":b,"aria-invalid":p,"aria-errormessage":`${e}-error`,"aria-labelledby":L,...K}),W&&m("p",{className:"pkt-input-suffix",children:[W,v&&l(y,{className:"pkt-input-suffix-icon",name:v})]}),!W&&v&&l(y,{className:"pkt-input-icon",name:v})]})})});T.PktAlert=Ze,T.PktBackLink=Jt,T.PktBreadcrumbs=Rn,T.PktButton=ce,T.PktCheckbox=dt,T.PktFooter=Sn,T.PktFooterSimple=On,T.PktHeader=jn,T.PktIcon=y,T.PktInput=kt,T.PktInputWrapper=ue,T.PktLinkCard=vt,T.PktMessagebox=Dn,T.PktRadioButton=_t,T.PktSelect=$n,T.PktTable=In,T.PktTableData=Fn,T.PktTableHeader=An,T.PktTag=bt,T.PktTextarea=Un,T.PktTextinput=Bn,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
58
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function r(){for(var o=[],a=0;a<arguments.length;a++){var i=arguments[a];if(i){var s=typeof i;if(s==="string"||s==="number")o.push(i);else if(Array.isArray(i)){if(i.length){var p=r.apply(null,i);p&&o.push(p)}}else if(s==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){o.push(i.toString());continue}for(var f in i)n.call(i,f)&&i[f]&&o.push(f)}}}return o.join(" ")}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(mt);var Tn=mt.exports;const ht=Bt(Tn),jn=N.forwardRef(({logoLink:e="https://www.oslo.kommune.no/",serviceName:n,fixed:r=!0,scrollToHide:o=!0,user:a,userMenu:i,representing:s,userOptions:p,userMenuFooter:f,canChangeRepresentation:c=!0,showMenuButton:h=!1,showLogOutButton:v=!1,openMenu:w,logOut:C,changeRepresentation:O,...S},D)=>{const P=N.useMemo(()=>typeof(a==null?void 0:a.lastLoggedIn)=="string"?a.lastLoggedIn:a!=null&&a.lastLoggedIn?new Date(a.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[a]),[g,$]=N.useState(!1),[U,B]=N.useState(0),[W,Y]=N.useState(!1),q=N.useRef(null);N.useEffect(()=>(document.addEventListener("mouseup",K),window.addEventListener("scroll",M),()=>{document.removeEventListener("mouseup",K),window.removeEventListener("scroll",M)}));const J=()=>{Y(!W)},K=_=>{q.current&&!q.current.contains(_.target)&&Y(!1)},M=()=>{if(o){const _=window.pageYOffset||document.documentElement.scrollTop;if(_<0||Math.abs(_-U)<60)return;$(_>U),B(_)}};return m("header",{...S,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:ht("pkt-header",{"pkt-header--fixed":r,"pkt-header--scroll-to-hide":o,"pkt-header--hidden":g}),ref:D,children:[m("div",{className:"pkt-header__logo",children:[typeof e=="string"?l("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:e,children:l(y,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/9.2/logos/"})}):l("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:e,children:l(y,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/9.2/logos/"})}),l("span",{className:"pkt-header__logo-service",children:n})]}),l("nav",{className:"pkt-header__actions",children:m("ul",{className:"pkt-header__actions-row",children:[h&&l("li",{children:l(ce,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:w,children:"Meny"})}),(a||s)&&m("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${W&&!g?"pkt-header--open-dropdown":""}`,ref:q,children:[m("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":W,onClick:J,children:[l(y,{name:"user",className:"pkt-btn__icon"}),l("span",{className:"pkt-header__user-fullname",children:(s==null?void 0:s.name)||(a==null?void 0:a.name)}),l("span",{className:"pkt-header__user-shortname",children:(s==null?void 0:s.shortname)||(a==null?void 0:a.shortname)}),l(y,{name:"chevron-thin-down",className:"pkt-btn--closed"}),l(y,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),m("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[a&&m("li",{children:[l("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l("div",{className:"pkt-user-menu__name",children:a.name}),a.lastLoggedIn&&m("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l("time",{children:P})]})]}),i&&l("li",{children:l("ul",{className:"pkt-list",children:i.map((_,L)=>l("li",{children:typeof _.target=="string"?m("a",{href:_.target,className:"pkt-link",children:[_.iconName&&l(y,{name:_.iconName,className:"pkt-link__icon"}),_.title]}):m("button",{className:"pkt-link-button pkt-link",onClick:_.target,children:[_.iconName&&l(y,{name:_.iconName,className:"pkt-link__icon"}),_.title]})},`userMenu-${L}`))})}),(s||c)&&m("li",{children:[s&&m(Z,{children:[l("div",{className:"pkt-user-menu__label",children:"Representerer"}),l("div",{className:"pkt-user-menu__name",children:s.name}),s.orgNumber&&m("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",s.orgNumber]})]}),l("ul",{className:"pkt-list mt-size-16",children:c&&l("li",{children:m("button",{className:"pkt-link-button pkt-link",onClick:O,children:[l(y,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),l("li",{children:l("ul",{className:"pkt-list",children:(p||!v)&&m(Z,{children:[p==null?void 0:p.map((_,L)=>l("li",{children:typeof _.target=="string"?m("a",{href:_.target,className:"pkt-link",children:[_.iconName&&l(y,{name:_.iconName,className:"pkt-link__icon"}),_.title]}):m("button",{className:"pkt-link-button pkt-link",onClick:_.target,children:[_.iconName&&l(y,{name:_.iconName,className:"pkt-link__icon"}),_.title]})},`userOptions-${L}`)),!v&&l("li",{children:m("button",{className:"pkt-link-button pkt-link",onClick:C,children:[l(y,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),f&&l("li",{className:"footer",children:l("ul",{className:"pkt-list-horizontal bordered",children:f.map((_,L)=>l("li",{children:typeof _.target=="string"?l("a",{href:_.target,className:"pkt-link",children:_.title}):l("button",{className:"pkt-link-button pkt-link",onClick:_.target,children:_.title})},`userMenuFooter-${L}`))})})]})]}),v&&l("li",{children:l(ce,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:C,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),kt=N.forwardRef(({label:e,id:n,children:r,...o},a)=>m("div",{className:"pkt-form-group",children:[l("label",{htmlFor:n,className:"pkt-form-label",children:e}),l("input",{className:"pkt-form-input",id:n,...o,ref:a}),r]}));kt.displayName="PktInput";const ue=N.forwardRef(({forId:e,label:n,helptext:r,helptextDropdown:o,helptextDropdownButton:a,optionalTag:i=!1,optionalText:s="Valgfritt",requiredTag:p=!1,requiredText:f="Må fylles ut",hasError:c,errorMessage:h,disabled:v,inline:w,ariaDescribedby:C,useWrapper:O=!0,children:S,className:D,hasFieldset:P=!1},g)=>{const[$,U]=N.useState(!1),B=()=>{U(!$)},W=()=>i?"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":"",Y=i?s:p?f:"",q=v?"pkt-inputwrapper--disabled":"",J=w?"pkt-inputwrapper--inline":"",K=c?"pkt-inputwrapper--error":"",M=!!o&&o!=="",_=a||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',L=P?"fieldset":M?"div":"label",H=P?"legend":M?"h2":"span",G=C||(r?`${e}-helptext`:void 0);return m("div",{className:["pkt-inputwrapper",D,q,J,K].join(" "),ref:g,children:[O?l(Z,{children:m(L,{htmlFor:e,"aria-describedby":M?"":C,className:`pkt-inputwrapper__label${P?" pkt-inputwrapper__fieldset":""}`,children:[m(H,{id:`${e}-label`,className:`${P?" pkt-inputwrapper__legend":""}`,children:[n,Y!==""&&l("span",{className:W(),children:Y})]}),r&&l("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,dangerouslySetInnerHTML:{__html:r}}),M&&o!==""&&m("div",{children:[l(ce,{skin:"tertiary",size:"small",variant:"icon-right",iconName:$?"chevron-thin-up":"chevron-thin-down",className:"pkt-inputwrapper__helptext-expandable pkt-link pkt-link--icon-right",onClick:B,children:l("span",{dangerouslySetInnerHTML:{__html:_}})}),l("div",{className:`pkt-inputwrapper__helptext ${$?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:l("span",{dangerouslySetInnerHTML:{__html:o}})}),l("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":G,children:n})]}),l(Z,{children:S})]})}):m(Z,{children:[l("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":G,id:`${e}-label`,children:n}),S]}),c&&h&&l("div",{children:l(Ze,{skin:"error","aria-live":"assertive",id:`${e}-error`,slim:!0,children:h})})]})});ue.displayName="PktInputWrapper";const vt=N.forwardRef(({children:e,className:n,iconName:r="user",openInNewTab:o=!1,skin:a="normal",href:i="#",external:s=!1,title:p},f)=>{const c=[n,"pkt-linkcard",a&&`pkt-linkcard--${a}`].filter(Boolean).join(" ");return m("a",{href:i,className:`pkt-linkcard pkt-link ${c}`,target:o?"_blank":"_self",rel:o?"noopener noreferrer":void 0,ref:f,children:[l(y,{className:"pkt-link__icon",name:r}),m("div",{className:"pkt-linkcard__content",children:[l("div",{className:`pkt-linkcard__title ${s?"pkt-link pkt-link--external":""}`,children:p}),l("div",{className:"pkt-linkcard__text",children:e})]})]})});vt.displayName="PktLinkCard";const Dn=({children:e,skin:n="beige",title:r,className:o,...a})=>{const i=["pkt-messagebox",n&&`pkt-messagebox--${n}`,o].filter(Boolean).join(" ");return m("div",{...a,className:i,children:[l("div",{className:"pkt-messagebox__title",children:r}),l("div",{className:"pkt-messagebox__text",children:e})]})},_t=N.forwardRef(({id:e,name:n,label:r,className:o,hasTile:a=!1,disabled:i=!1,checkHelptext:s,hasError:p=!1,...f},c)=>{const h=[o,"pkt-input-check"].filter(Boolean).join(" ");return l("div",{className:h,children:m("div",{className:`pkt-input-check__input ${a?"pkt-input-check__input--tile":""}`,children:[l("input",{ref:c,className:`pkt-input-check__input-checkbox ${p?"pkt-input-check__input-checkbox--error":""}`,type:"radio",id:e,disabled:i,name:n,...f}),m("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[r,s&&l("div",{className:"pkt-input-check__input-helptext",children:s})]})]})})});_t.displayName="PktRadioButton";const $n=N.forwardRef(({ariaDescribedby:e,ariaLabelledby:n,children:r,className:o,disabled:a=!1,errorMessage:i,hasError:s,helptext:p,helptextDropdown:f,helptextDropdownButton:c,id:h,inline:v=!1,fullwidth:w=!1,label:C,name:O,optionalTag:S=!1,optionalText:D,requiredTag:P=!1,requiredText:g,...$},U)=>{const B=[o,"pkt-select"].join(" ");return l(ue,{className:B,forId:h,label:C,helptext:p,helptextDropdown:f,helptextDropdownButton:c,optionalTag:S,optionalText:D,requiredTag:P,requiredText:g,hasError:s,errorMessage:i,disabled:a,inline:v,ariaDescribedby:e,children:l("select",{ref:U,className:`pkt-input ${w?"pkt-input--fullwidth":""}`,"aria-invalid":s,"aria-errormessage":`${h}-error`,"aria-labelledby":n||`${h}-label`,disabled:a,id:h,name:O||h,...$,children:r})})}),Ln=({isResponsive:e,children:n})=>e?l("div",{className:"pkt-table-container",children:n}):l(Z,{children:n}),In=({isResponsive:e,modifiers:{info:n=!1,success:r=!1,strong:o=!1,shadow:a=!1}={},children:i})=>l(Ln,{isResponsive:e,children:l("table",{className:ht("pkt-table",{"pkt-table--info":n,"pkt-table--success":r,"pkt-table--strong":o,"pkt-table--shadow":a}),children:i})}),Fn=({children:e})=>l("td",{className:"pkt-table__th",children:e}),An=({children:e})=>l("th",{className:"pkt-table__th",children:e}),bt=N.forwardRef(({children:e,className:n,skin:r="blue",textStyle:o="normal-text",size:a="medium",closeTag:i=!1,iconName:s="",type:p="button",ariaLabel:f="close",onClick:c=()=>{}},h)=>{const[v,w]=N.useState(!1),C=P=>{w(!0),c(P)},O=["pkt-tag",a&&`pkt-tag--${a}`,r&&`pkt-tag--${r}`,o&&`pkt-tag--${o}`,n].filter(Boolean).join(" "),S=["pkt-tag","pkt-btn","pkt-btn--tertiary",a&&`pkt-tag--${a}`,r&&`pkt-tag--${r}`,o&&`pkt-tag--${o}`,s&&i?"pkt-btn--icons-right-and-left":null,i&&!s?"pkt-btn--icon-right":null,n].filter(Boolean).join(" "),D=!v;return i&&s?l(Z,{children:D&&m("button",{className:S,type:p,"aria-label":f,onClick:C,ref:h,children:[l(y,{className:"pkt-tag__icon",name:s}),e,l(y,{className:"pkt-tag__close-btn",name:"close"})]})}):i?l(Z,{children:D&&m("button",{className:S,type:p,"aria-label":f,onClick:C,ref:h,children:[l(y,{className:"pkt-tag__close-btn",name:"close"}),e]})}):s?m("span",{className:O,children:[l(y,{className:"pkt-tag__icon",name:s}),e]}):l("span",{className:O,children:e})});bt.displayName="PktTag";const Un=N.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:r,counter:o,counterMaxLength:a,className:i,disabled:s,errorMessage:p,hasError:f,helptext:c,helptextDropdown:h,helptextDropdownButton:v,inline:w,fullwidth:C=!1,label:O,name:S,optionalTag:D=!1,optionalText:P,requiredTag:g=!1,requiredText:$,placeholder:U,rows:B,useWrapper:W=!0,onChange:Y,...q},J)=>{const K=[i,"pkt-textinput","pkt-textarea"].join(" "),M=r||`${e}-label`,_=N.useRef(null),[L,H]=N.useState(0),G=ee=>{var te,fe;if(o&&H(((fe=(te=ee.currentTarget)==null?void 0:te.value)==null?void 0:fe.length)||0),Y)return Y(ee)};return N.useEffect(()=>{var ee,te;typeof J=="function"&&J(_.current),o&&H(((te=(ee=_==null?void 0:_.current)==null?void 0:ee.value)==null?void 0:te.length)||0)},[J]),m(ue,{ariaDescribedby:n,className:K,disabled:s,errorMessage:p,forId:e,hasError:f,helptext:c,helptextDropdown:h,helptextDropdownButton:v,inline:w,label:O,optionalTag:D,optionalText:P,requiredTag:g,requiredText:$,useWrapper:W,children:[l("textarea",{ref:_,className:`pkt-input ${C?"pkt-input--fullwidth":""} ${a&&L>a?"pkt-input--counter-error":""}`,name:S||e,id:e,placeholder:U,disabled:s,rows:B,"aria-labelledby":M,"aria-invalid":f,"aria-errormessage":`${e}-error`,...q,onChange:G}),o&&m("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[L||0,a&&`/${a}`]})]})}),Bn=N.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:r,autocomplete:o="off",className:a,disabled:i=!1,errorMessage:s,hasError:p=!1,helptext:f,helptextDropdown:c,helptextDropdownButton:h,iconNameRight:v,inline:w=!1,fullwidth:C=!1,label:O,name:S,optionalTag:D=!1,optionalText:P,requiredTag:g=!1,requiredText:$,placeholder:U,prefix:B,suffix:W,type:Y="text",useWrapper:q=!0,value:J,...K},M)=>{const _=[a,"pkt-textinput"].join(" "),L=r||`${e}-label`;return l(ue,{ariaDescribedby:n,className:_,disabled:i,errorMessage:s,forId:e,hasError:p,helptext:f,helptextDropdown:c,helptextDropdownButton:h,inline:w,label:O,optionalTag:D,optionalText:P,requiredTag:g,requiredText:$,useWrapper:q,children:m("div",{className:"pkt-input__container",children:[B&&l("div",{className:"pkt-input-prefix",children:B}),l("input",{ref:M,className:`pkt-input ${C?"pkt-input--fullwidth":""}`,type:Y,name:S||e,id:e,placeholder:U,autoComplete:o,value:J,disabled:i,"aria-invalid":p,"aria-errormessage":`${e}-error`,"aria-labelledby":L,...K}),W&&m("p",{className:"pkt-input-suffix",children:[W,v&&l(y,{className:"pkt-input-suffix-icon",name:v})]}),!W&&v&&l(y,{className:"pkt-input-icon",name:v})]})})});T.PktAlert=Ze,T.PktBackLink=Jt,T.PktBreadcrumbs=Rn,T.PktButton=ce,T.PktCheckbox=dt,T.PktFooter=Sn,T.PktFooterSimple=On,T.PktHeader=jn,T.PktIcon=y,T.PktInput=kt,T.PktInputWrapper=ue,T.PktLinkCard=vt,T.PktMessagebox=Dn,T.PktRadioButton=_t,T.PktSelect=$n,T.PktTable=In,T.PktTableData=Fn,T.PktTableHeader=An,T.PktTag=bt,T.PktTextarea=Un,T.PktTextinput=Bn,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
package/dist/select/Select.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ export interface IPktSelectProps extends SelectHTMLAttributes<HTMLSelectElement>
|
|
|
14
14
|
fullwidth?: boolean;
|
|
15
15
|
label: string;
|
|
16
16
|
name?: string;
|
|
17
|
-
|
|
17
|
+
optionalTag?: boolean;
|
|
18
18
|
optionalText?: string;
|
|
19
|
-
|
|
19
|
+
requiredTag?: boolean;
|
|
20
20
|
requiredText?: string;
|
|
21
21
|
}
|
|
22
22
|
export declare const PktSelect: React.ForwardRefExoticComponent<IPktSelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
@@ -15,9 +15,9 @@ export interface IPktTextareaProps extends TextareaHTMLAttributes<HTMLTextAreaEl
|
|
|
15
15
|
fullwidth?: boolean;
|
|
16
16
|
label: string;
|
|
17
17
|
name?: string;
|
|
18
|
-
|
|
18
|
+
optionalTag?: boolean;
|
|
19
19
|
optionalText?: string;
|
|
20
|
-
|
|
20
|
+
requiredTag?: boolean;
|
|
21
21
|
requiredText?: string;
|
|
22
22
|
placeholder?: string;
|
|
23
23
|
rows?: number;
|
|
@@ -15,9 +15,9 @@ export interface IPktTextinput extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
15
15
|
fullwidth?: boolean;
|
|
16
16
|
label: string;
|
|
17
17
|
name?: string;
|
|
18
|
-
|
|
18
|
+
optionalTag?: boolean;
|
|
19
19
|
optionalText?: string;
|
|
20
|
-
|
|
20
|
+
requiredTag?: boolean;
|
|
21
21
|
requiredText?: string;
|
|
22
22
|
placeholder?: string;
|
|
23
23
|
prefix?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "9.1
|
|
3
|
+
"version": "9.2.1",
|
|
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",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"test": "react-scripts test --env=jsdom"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@oslokommune/punkt-assets": "^9.
|
|
36
|
-
"@oslokommune/punkt-css": "^9.
|
|
35
|
+
"@oslokommune/punkt-assets": "^9.2.1",
|
|
36
|
+
"@oslokommune/punkt-css": "^9.2.1",
|
|
37
37
|
"@testing-library/jest-dom": "^5.16.5",
|
|
38
38
|
"@testing-library/react": "^14.0.0",
|
|
39
39
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
92
92
|
},
|
|
93
93
|
"license": "MIT",
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "0347e89a19b3d9c1a711ecfd60f8a5c6c732eadb"
|
|
95
95
|
}
|
|
@@ -9,9 +9,9 @@ export interface IPktInputWrapper extends RefAttributes<HTMLElement> {
|
|
|
9
9
|
helptext?: string
|
|
10
10
|
helptextDropdown?: string
|
|
11
11
|
helptextDropdownButton?: string
|
|
12
|
-
|
|
12
|
+
optionalTag?: boolean
|
|
13
13
|
optionalText?: string
|
|
14
|
-
|
|
14
|
+
requiredTag?: boolean
|
|
15
15
|
requiredText?: string
|
|
16
16
|
hasError?: boolean
|
|
17
17
|
errorMessage?: string
|
|
@@ -32,9 +32,9 @@ export const PktInputWrapper = forwardRef(
|
|
|
32
32
|
helptext,
|
|
33
33
|
helptextDropdown,
|
|
34
34
|
helptextDropdownButton,
|
|
35
|
-
|
|
35
|
+
optionalTag = false,
|
|
36
36
|
optionalText = 'Valgfritt',
|
|
37
|
-
|
|
37
|
+
requiredTag = false,
|
|
38
38
|
requiredText = 'Må fylles ut',
|
|
39
39
|
hasError,
|
|
40
40
|
errorMessage,
|
|
@@ -55,16 +55,16 @@ export const PktInputWrapper = forwardRef(
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const tagClass = () => {
|
|
58
|
-
if (
|
|
58
|
+
if (optionalTag) {
|
|
59
59
|
return 'pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light'
|
|
60
|
-
} else if (
|
|
60
|
+
} else if (requiredTag) {
|
|
61
61
|
return 'pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige'
|
|
62
62
|
} else {
|
|
63
63
|
return ''
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
const tagText =
|
|
67
|
+
const tagText = optionalTag ? optionalText : requiredTag ? requiredText : ''
|
|
68
68
|
|
|
69
69
|
const disabledClass = disabled ? 'pkt-inputwrapper--disabled' : ''
|
|
70
70
|
const inlineClass = inline ? 'pkt-inputwrapper--inline' : ''
|
|
@@ -81,8 +81,8 @@ export const PktInputWrapper = forwardRef(
|
|
|
81
81
|
const describedBy = ariaDescribedby
|
|
82
82
|
? ariaDescribedby
|
|
83
83
|
: helptext
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
? `${forId}-helptext`
|
|
85
|
+
: undefined
|
|
86
86
|
|
|
87
87
|
return (
|
|
88
88
|
<div
|
|
@@ -96,9 +96,13 @@ export const PktInputWrapper = forwardRef(
|
|
|
96
96
|
<LabelComponent
|
|
97
97
|
htmlFor={forId}
|
|
98
98
|
aria-describedby={hasDropDown ? '' : ariaDescribedby}
|
|
99
|
-
className={`pkt-inputwrapper__label${
|
|
99
|
+
className={`pkt-inputwrapper__label${
|
|
100
|
+
hasFieldset ? ' pkt-inputwrapper__fieldset' : ''
|
|
101
|
+
}`}
|
|
100
102
|
>
|
|
101
|
-
<LabelTextComponent
|
|
103
|
+
<LabelTextComponent
|
|
104
|
+
id={`${forId}-label`}
|
|
105
|
+
className={`${hasFieldset ? ' pkt-inputwrapper__legend' : ''}`}
|
|
102
106
|
>
|
|
103
107
|
{label}
|
|
104
108
|
{tagText !== '' && <span className={tagClass()}>{tagText}</span>}
|
|
@@ -123,10 +127,11 @@ export const PktInputWrapper = forwardRef(
|
|
|
123
127
|
<span dangerouslySetInnerHTML={{ __html: dropdownButton }} />
|
|
124
128
|
</PktButton>
|
|
125
129
|
<div
|
|
126
|
-
className={`pkt-inputwrapper__helptext ${
|
|
130
|
+
className={`pkt-inputwrapper__helptext ${
|
|
131
|
+
isHelpTextOpen
|
|
127
132
|
? 'pkt-inputwrapper__helptext-expandable-open'
|
|
128
133
|
: 'pkt-inputwrapper__helptext-expandable-closed'
|
|
129
|
-
|
|
134
|
+
}`}
|
|
130
135
|
>
|
|
131
136
|
<span dangerouslySetInnerHTML={{ __html: helptextDropdown }} />
|
|
132
137
|
</div>
|
|
@@ -138,7 +143,6 @@ export const PktInputWrapper = forwardRef(
|
|
|
138
143
|
<>{children}</>
|
|
139
144
|
</LabelComponent>
|
|
140
145
|
</>
|
|
141
|
-
|
|
142
146
|
) : (
|
|
143
147
|
<>
|
|
144
148
|
<label
|
|
@@ -17,9 +17,9 @@ export interface IPktSelectProps extends SelectHTMLAttributes<HTMLSelectElement>
|
|
|
17
17
|
fullwidth?: boolean
|
|
18
18
|
label: string
|
|
19
19
|
name?: string
|
|
20
|
-
|
|
20
|
+
optionalTag?: boolean
|
|
21
21
|
optionalText?: string
|
|
22
|
-
|
|
22
|
+
requiredTag?: boolean
|
|
23
23
|
requiredText?: string
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -41,9 +41,9 @@ export const PktSelect = forwardRef(
|
|
|
41
41
|
fullwidth = false,
|
|
42
42
|
label,
|
|
43
43
|
name,
|
|
44
|
-
|
|
44
|
+
optionalTag = false,
|
|
45
45
|
optionalText,
|
|
46
|
-
|
|
46
|
+
requiredTag = false,
|
|
47
47
|
requiredText,
|
|
48
48
|
...props
|
|
49
49
|
}: IPktSelectProps,
|
|
@@ -58,9 +58,9 @@ export const PktSelect = forwardRef(
|
|
|
58
58
|
helptext={helptext}
|
|
59
59
|
helptextDropdown={helptextDropdown}
|
|
60
60
|
helptextDropdownButton={helptextDropdownButton}
|
|
61
|
-
|
|
61
|
+
optionalTag={optionalTag}
|
|
62
62
|
optionalText={optionalText}
|
|
63
|
-
|
|
63
|
+
requiredTag={requiredTag}
|
|
64
64
|
requiredText={requiredText}
|
|
65
65
|
hasError={hasError}
|
|
66
66
|
errorMessage={errorMessage}
|
|
@@ -74,7 +74,6 @@ export const PktSelect = forwardRef(
|
|
|
74
74
|
aria-invalid={hasError}
|
|
75
75
|
aria-errormessage={`${id}-error`}
|
|
76
76
|
aria-labelledby={ariaLabelledby || `${id}-label`}
|
|
77
|
-
aria-required={required}
|
|
78
77
|
disabled={disabled}
|
|
79
78
|
id={id}
|
|
80
79
|
name={name || id}
|
|
@@ -26,9 +26,9 @@ export interface IPktTextareaProps extends TextareaHTMLAttributes<HTMLTextAreaEl
|
|
|
26
26
|
fullwidth?: boolean
|
|
27
27
|
label: string
|
|
28
28
|
name?: string
|
|
29
|
-
|
|
29
|
+
optionalTag?: boolean
|
|
30
30
|
optionalText?: string
|
|
31
|
-
|
|
31
|
+
requiredTag?: boolean
|
|
32
32
|
requiredText?: string
|
|
33
33
|
placeholder?: string
|
|
34
34
|
rows?: number
|
|
@@ -54,13 +54,13 @@ export const PktTextarea = forwardRef(
|
|
|
54
54
|
fullwidth = false,
|
|
55
55
|
label,
|
|
56
56
|
name,
|
|
57
|
-
|
|
57
|
+
optionalTag = false,
|
|
58
58
|
optionalText,
|
|
59
|
-
|
|
59
|
+
requiredTag = false,
|
|
60
60
|
requiredText,
|
|
61
61
|
placeholder,
|
|
62
62
|
rows,
|
|
63
|
-
useWrapper,
|
|
63
|
+
useWrapper = true,
|
|
64
64
|
onChange,
|
|
65
65
|
...props
|
|
66
66
|
}: IPktTextareaProps,
|
|
@@ -98,9 +98,9 @@ export const PktTextarea = forwardRef(
|
|
|
98
98
|
helptextDropdownButton={helptextDropdownButton}
|
|
99
99
|
inline={inline}
|
|
100
100
|
label={label}
|
|
101
|
-
|
|
101
|
+
optionalTag={optionalTag}
|
|
102
102
|
optionalText={optionalText}
|
|
103
|
-
|
|
103
|
+
requiredTag={requiredTag}
|
|
104
104
|
requiredText={requiredText}
|
|
105
105
|
useWrapper={useWrapper}
|
|
106
106
|
>
|
|
@@ -117,7 +117,6 @@ export const PktTextarea = forwardRef(
|
|
|
117
117
|
aria-labelledby={labelledBy}
|
|
118
118
|
aria-invalid={hasError}
|
|
119
119
|
aria-errormessage={`${id}-error`}
|
|
120
|
-
aria-required={required}
|
|
121
120
|
{...props}
|
|
122
121
|
onChange={handleChange}
|
|
123
122
|
/>
|
|
@@ -19,9 +19,9 @@ export interface IPktTextinput extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
19
19
|
fullwidth?: boolean
|
|
20
20
|
label: string
|
|
21
21
|
name?: string
|
|
22
|
-
|
|
22
|
+
optionalTag?: boolean
|
|
23
23
|
optionalText?: string
|
|
24
|
-
|
|
24
|
+
requiredTag?: boolean
|
|
25
25
|
requiredText?: string
|
|
26
26
|
placeholder?: string
|
|
27
27
|
prefix?: string
|
|
@@ -50,9 +50,9 @@ export const PktTextinput = forwardRef(
|
|
|
50
50
|
fullwidth = false,
|
|
51
51
|
label,
|
|
52
52
|
name,
|
|
53
|
-
|
|
53
|
+
optionalTag = false,
|
|
54
54
|
optionalText,
|
|
55
|
-
|
|
55
|
+
requiredTag = false,
|
|
56
56
|
requiredText,
|
|
57
57
|
placeholder,
|
|
58
58
|
prefix,
|
|
@@ -79,9 +79,9 @@ export const PktTextinput = forwardRef(
|
|
|
79
79
|
helptextDropdownButton={helptextDropdownButton}
|
|
80
80
|
inline={inline}
|
|
81
81
|
label={label}
|
|
82
|
-
|
|
82
|
+
optionalTag={optionalTag}
|
|
83
83
|
optionalText={optionalText}
|
|
84
|
-
|
|
84
|
+
requiredTag={requiredTag}
|
|
85
85
|
requiredText={requiredText}
|
|
86
86
|
useWrapper={useWrapper}
|
|
87
87
|
>
|
|
@@ -97,7 +97,6 @@ export const PktTextinput = forwardRef(
|
|
|
97
97
|
autoComplete={autocomplete}
|
|
98
98
|
value={value}
|
|
99
99
|
disabled={disabled}
|
|
100
|
-
aria-required={required}
|
|
101
100
|
aria-invalid={hasError}
|
|
102
101
|
aria-errormessage={`${id}-error`}
|
|
103
102
|
aria-labelledby={labelledBy}
|