@oslokommune/punkt-react 3.4.0 → 3.4.2

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.
@@ -1,4 +1,4 @@
1
- (function(k,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(k=typeof globalThis<"u"?globalThis:k||self,x(k["punkt-react"]={},k.React))})(this,function(k,x){"use strict";var W={},Ae={get exports(){return W},set exports(i){W=i}},Y={};/**
1
+ (function(_,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],T):(_=typeof globalThis<"u"?globalThis:_||self,T(_["punkt-react"]={},_.React))})(this,function(_,T){"use strict";var Y={},Ae={get exports(){return Y},set exports(i){Y=i}},L={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ae;function Ie(){if(ae)return Y;ae=1;var i=x,l=Symbol.for("react.element"),u=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,p=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function _(g,m,N){var y,T={},O=null,M=null;N!==void 0&&(O=""+N),m.key!==void 0&&(O=""+m.key),m.ref!==void 0&&(M=m.ref);for(y in m)o.call(m,y)&&!f.hasOwnProperty(y)&&(T[y]=m[y]);if(g&&g.defaultProps)for(y in m=g.defaultProps,m)T[y]===void 0&&(T[y]=m[y]);return{$$typeof:l,type:g,key:O,ref:M,props:T,_owner:p.current}}return Y.Fragment=u,Y.jsx=_,Y.jsxs=_,Y}var $={};/**
9
+ */var ae;function Ie(){if(ae)return L;ae=1;var i=T,c=Symbol.for("react.element"),s=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,p=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function k(g,m,N){var y,x={},O=null,F=null;N!==void 0&&(O=""+N),m.key!==void 0&&(O=""+m.key),m.ref!==void 0&&(F=m.ref);for(y in m)l.call(m,y)&&!f.hasOwnProperty(y)&&(x[y]=m[y]);if(g&&g.defaultProps)for(y in m=g.defaultProps,m)x[y]===void 0&&(x[y]=m[y]);return{$$typeof:c,type:g,key:O,ref:F,props:x,_owner:p.current}}return L.Fragment=s,L.jsx=k,L.jsxs=k,L}var B={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,18 +14,18 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ne;function We(){return ne||(ne=1,process.env.NODE_ENV!=="production"&&function(){var i=x,l=Symbol.for("react.element"),u=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),g=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),ue=Symbol.iterator,Ke="@@iterator";function Xe(e){if(e===null||typeof e!="object")return null;var r=ue&&e[ue]||e[Ke];return typeof r=="function"?r:null}var F=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];qe("error",e,t)}}function qe(e,r,t){{var n=F.ReactDebugCurrentFrame,d=n.getStackAddendum();d!==""&&(r+="%s",t=t.concat([d]));var v=t.map(function(c){return String(c)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var Ze=!1,Qe=!1,er=!1,rr=!1,tr=!1,fe;fe=Symbol.for("react.module.reference");function ar(e){return!!(typeof e=="string"||typeof e=="function"||e===o||e===f||tr||e===p||e===N||e===y||rr||e===M||Ze||Qe||er||typeof e=="object"&&e!==null&&(e.$$typeof===O||e.$$typeof===T||e.$$typeof===_||e.$$typeof===g||e.$$typeof===m||e.$$typeof===fe||e.getModuleId!==void 0))}function nr(e,r,t){var n=e.displayName;if(n)return n;var d=r.displayName||r.name||"";return d!==""?t+"("+d+")":t}function de(e){return e.displayName||"Context"}function C(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case o:return"Fragment";case u:return"Portal";case f:return"Profiler";case p:return"StrictMode";case N:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case g:var r=e;return de(r)+".Consumer";case _:var t=e;return de(t._context)+".Provider";case m:return nr(e,e.render,"ForwardRef");case T:var n=e.displayName||null;return n!==null?n:C(e.type)||"Memo";case O:{var d=e,v=d._payload,c=d._init;try{return C(c(v))}catch{return null}}}return null}var D=Object.assign,L=0,pe,ve,me,he,be,_e,ke;function ge(){}ge.__reactDisabledLog=!0;function ir(){{if(L===0){pe=console.log,ve=console.info,me=console.warn,he=console.error,be=console.group,_e=console.groupCollapsed,ke=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}L++}}function or(){{if(L--,L===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:pe}),info:D({},e,{value:ve}),warn:D({},e,{value:me}),error:D({},e,{value:he}),group:D({},e,{value:be}),groupCollapsed:D({},e,{value:_e}),groupEnd:D({},e,{value:ke})})}L<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=F.ReactCurrentDispatcher,X;function V(e,r,t){{if(X===void 0)try{throw Error()}catch(d){var n=d.stack.trim().match(/\n( *(at )?)/);X=n&&n[1]||""}return`
18
- `+X+e}}var q=!1,U;{var sr=typeof WeakMap=="function"?WeakMap:Map;U=new sr}function ye(e,r){if(!e||q)return"";{var t=U.get(e);if(t!==void 0)return t}var n;q=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=K.current,K.current=null,ir();try{if(r){var c=function(){throw Error()};if(Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(j){n=j}Reflect.construct(e,[],c)}else{try{c.call()}catch(j){n=j}e.call(c.prototype)}}else{try{throw Error()}catch(j){n=j}e()}}catch(j){if(j&&n&&typeof j.stack=="string"){for(var s=j.stack.split(`
17
+ */var ne;function We(){return ne||(ne=1,process.env.NODE_ENV!=="production"&&function(){var i=T,c=Symbol.for("react.element"),s=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),g=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),F=Symbol.for("react.offscreen"),ue=Symbol.iterator,Ke="@@iterator";function Xe(e){if(e===null||typeof e!="object")return null;var r=ue&&e[ue]||e[Ke];return typeof r=="function"?r:null}var A=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];qe("error",e,t)}}function qe(e,r,t){{var n=A.ReactDebugCurrentFrame,d=n.getStackAddendum();d!==""&&(r+="%s",t=t.concat([d]));var v=t.map(function(u){return String(u)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var Ze=!1,Qe=!1,er=!1,rr=!1,tr=!1,fe;fe=Symbol.for("react.module.reference");function ar(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===f||tr||e===p||e===N||e===y||rr||e===F||Ze||Qe||er||typeof e=="object"&&e!==null&&(e.$$typeof===O||e.$$typeof===x||e.$$typeof===k||e.$$typeof===g||e.$$typeof===m||e.$$typeof===fe||e.getModuleId!==void 0))}function nr(e,r,t){var n=e.displayName;if(n)return n;var d=r.displayName||r.name||"";return d!==""?t+"("+d+")":t}function de(e){return e.displayName||"Context"}function C(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case l:return"Fragment";case s:return"Portal";case f:return"Profiler";case p:return"StrictMode";case N:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case g:var r=e;return de(r)+".Consumer";case k:var t=e;return de(t._context)+".Provider";case m:return nr(e,e.render,"ForwardRef");case x:var n=e.displayName||null;return n!==null?n:C(e.type)||"Memo";case O:{var d=e,v=d._payload,u=d._init;try{return C(u(v))}catch{return null}}}return null}var D=Object.assign,M=0,pe,ve,me,he,be,_e,ke;function ge(){}ge.__reactDisabledLog=!0;function ir(){{if(M===0){pe=console.log,ve=console.info,me=console.warn,he=console.error,be=console.group,_e=console.groupCollapsed,ke=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function or(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:pe}),info:D({},e,{value:ve}),warn:D({},e,{value:me}),error:D({},e,{value:he}),group:D({},e,{value:be}),groupCollapsed:D({},e,{value:_e}),groupEnd:D({},e,{value:ke})})}M<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=A.ReactCurrentDispatcher,X;function V(e,r,t){{if(X===void 0)try{throw Error()}catch(d){var n=d.stack.trim().match(/\n( *(at )?)/);X=n&&n[1]||""}return`
18
+ `+X+e}}var q=!1,U;{var sr=typeof WeakMap=="function"?WeakMap:Map;U=new sr}function ye(e,r){if(!e||q)return"";{var t=U.get(e);if(t!==void 0)return t}var n;q=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=K.current,K.current=null,ir();try{if(r){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(j){n=j}Reflect.construct(e,[],u)}else{try{u.call()}catch(j){n=j}e.call(u.prototype)}}else{try{throw Error()}catch(j){n=j}e()}}catch(j){if(j&&n&&typeof j.stack=="string"){for(var o=j.stack.split(`
19
19
  `),P=n.stack.split(`
20
- `),h=s.length-1,b=P.length-1;h>=1&&b>=0&&s[h]!==P[b];)b--;for(;h>=1&&b>=0;h--,b--)if(s[h]!==P[b]){if(h!==1||b!==1)do if(h--,b--,b<0||s[h]!==P[b]){var w=`
21
- `+s[h].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,w),w}while(h>=1&&b>=0);break}}}finally{q=!1,K.current=v,or(),Error.prepareStackTrace=d}var I=e?e.displayName||e.name:"",Fe=I?V(I):"";return typeof e=="function"&&U.set(e,Fe),Fe}function lr(e,r,t){return ye(e,!1)}function cr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function G(e,r,t){if(e==null)return"";if(typeof e=="function")return ye(e,cr(e));if(typeof e=="string")return V(e);switch(e){case N:return V("Suspense");case y:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case m:return lr(e.render);case T:return G(e.type,r,t);case O:{var n=e,d=n._payload,v=n._init;try{return G(v(d),r,t)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,Re={},Ee=F.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}function ur(e,r,t,n,d){{var v=Function.call.bind(H);for(var c in e)if(v(e,c)){var s=void 0;try{if(typeof e[c]!="function"){var P=Error((n||"React class")+": "+t+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}s=e[c](r,c,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(h){s=h}s&&!(s instanceof Error)&&(J(d),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,c,typeof s),J(null)),s instanceof Error&&!(s.message in Re)&&(Re[s.message]=!0,J(d),E("Failed %s type: %s",t,s.message),J(null))}}}var fr=Array.isArray;function Z(e){return fr(e)}function dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function pr(e){try{return Pe(e),!1}catch{return!0}}function Pe(e){return""+e}function Te(e){if(pr(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dr(e)),Pe(e)}var B=F.ReactCurrentOwner,vr={key:!0,ref:!0,__self:!0,__source:!0},Ne,we,Q;Q={};function mr(e){if(H.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function hr(e){if(H.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function br(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var t=C(B.current.type);Q[t]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',C(B.current.type),e.ref),Q[t]=!0)}}function _r(e,r){{var t=function(){Ne||(Ne=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function kr(e,r){{var t=function(){we||(we=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var gr=function(e,r,t,n,d,v,c){var s={$$typeof:l,type:e,key:r,ref:t,props:c,_owner:v};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function yr(e,r,t,n,d){{var v,c={},s=null,P=null;t!==void 0&&(Te(t),s=""+t),hr(r)&&(Te(r.key),s=""+r.key),mr(r)&&(P=r.ref,br(r,d));for(v in r)H.call(r,v)&&!vr.hasOwnProperty(v)&&(c[v]=r[v]);if(e&&e.defaultProps){var h=e.defaultProps;for(v in h)c[v]===void 0&&(c[v]=h[v])}if(s||P){var b=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&_r(c,b),P&&kr(c,b)}return gr(e,s,P,d,n,B.current,c)}}var ee=F.ReactCurrentOwner,xe=F.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}var re;re=!1;function te(e){return typeof e=="object"&&e!==null&&e.$$typeof===l}function Se(){{if(ee.current){var e=C(ee.current.type);if(e)return`
20
+ `),h=o.length-1,b=P.length-1;h>=1&&b>=0&&o[h]!==P[b];)b--;for(;h>=1&&b>=0;h--,b--)if(o[h]!==P[b]){if(h!==1||b!==1)do if(h--,b--,b<0||o[h]!==P[b]){var w=`
21
+ `+o[h].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,w),w}while(h>=1&&b>=0);break}}}finally{q=!1,K.current=v,or(),Error.prepareStackTrace=d}var W=e?e.displayName||e.name:"",Fe=W?V(W):"";return typeof e=="function"&&U.set(e,Fe),Fe}function lr(e,r,t){return ye(e,!1)}function cr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function G(e,r,t){if(e==null)return"";if(typeof e=="function")return ye(e,cr(e));if(typeof e=="string")return V(e);switch(e){case N:return V("Suspense");case y:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case m:return lr(e.render);case x:return G(e.type,r,t);case O:{var n=e,d=n._payload,v=n._init;try{return G(v(d),r,t)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,Re={},Ee=A.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}function ur(e,r,t,n,d){{var v=Function.call.bind(H);for(var u in e)if(v(e,u)){var o=void 0;try{if(typeof e[u]!="function"){var P=Error((n||"React class")+": "+t+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}o=e[u](r,u,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(h){o=h}o&&!(o instanceof Error)&&(J(d),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,u,typeof o),J(null)),o instanceof Error&&!(o.message in Re)&&(Re[o.message]=!0,J(d),E("Failed %s type: %s",t,o.message),J(null))}}}var fr=Array.isArray;function Z(e){return fr(e)}function dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function pr(e){try{return Pe(e),!1}catch{return!0}}function Pe(e){return""+e}function Te(e){if(pr(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dr(e)),Pe(e)}var $=A.ReactCurrentOwner,vr={key:!0,ref:!0,__self:!0,__source:!0},Ne,we,Q;Q={};function mr(e){if(H.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function hr(e){if(H.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function br(e,r){if(typeof e.ref=="string"&&$.current&&r&&$.current.stateNode!==r){var t=C($.current.type);Q[t]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',C($.current.type),e.ref),Q[t]=!0)}}function _r(e,r){{var t=function(){Ne||(Ne=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function kr(e,r){{var t=function(){we||(we=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var gr=function(e,r,t,n,d,v,u){var o={$$typeof:c,type:e,key:r,ref:t,props:u,_owner:v};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function yr(e,r,t,n,d){{var v,u={},o=null,P=null;t!==void 0&&(Te(t),o=""+t),hr(r)&&(Te(r.key),o=""+r.key),mr(r)&&(P=r.ref,br(r,d));for(v in r)H.call(r,v)&&!vr.hasOwnProperty(v)&&(u[v]=r[v]);if(e&&e.defaultProps){var h=e.defaultProps;for(v in h)u[v]===void 0&&(u[v]=h[v])}if(o||P){var b=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&_r(u,b),P&&kr(u,b)}return gr(e,o,P,d,n,$.current,u)}}var ee=A.ReactCurrentOwner,xe=A.ReactDebugCurrentFrame;function I(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}var re;re=!1;function te(e){return typeof e=="object"&&e!==null&&e.$$typeof===c}function Se(){{if(ee.current){var e=C(ee.current.type);if(e)return`
22
22
 
23
23
  Check the render method of \``+e+"`."}return""}}function Rr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
24
 
25
25
  Check your code at `+r+":"+t+"."}return""}}var Oe={};function Er(e){{var r=Se();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
26
 
27
- Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Er(r);if(Oe[t])return;Oe[t]=!0;var n="";e&&e._owner&&e._owner!==ee.current&&(n=" It was passed a child from "+C(e._owner.type)+"."),A(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),A(null)}}function je(e,r){{if(typeof e!="object")return;if(Z(e))for(var t=0;t<e.length;t++){var n=e[t];te(n)&&Ce(n,r)}else if(te(e))e._store&&(e._store.validated=!0);else if(e){var d=Xe(e);if(typeof d=="function"&&d!==e.entries)for(var v=d.call(e),c;!(c=v.next()).done;)te(c.value)&&Ce(c.value,r)}}}function Pr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===m||r.$$typeof===T))t=r.propTypes;else return;if(t){var n=C(r);ur(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!re){re=!0;var d=C(r);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}function De(e,r,t,n,d,v){{var c=ar(e);if(!c){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" 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 P=Rr(d);P?s+=P:s+=Se();var h;e===null?h="null":Z(e)?h="array":e!==void 0&&e.$$typeof===l?(h="<"+(C(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):h=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",h,s)}var b=yr(e,r,t,d,v);if(b==null)return b;if(c){var w=r.children;if(w!==void 0)if(n)if(Z(w)){for(var I=0;I<w.length;I++)je(w[I],e);Object.freeze&&Object.freeze(w)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else je(w,e)}return e===o?Tr(b):Pr(b),b}}function Nr(e,r,t){return De(e,r,t,!0)}function wr(e,r,t){return De(e,r,t,!1)}var xr=wr,Sr=Nr;$.Fragment=o,$.jsx=xr,$.jsxs=Sr}()),$}(function(i){process.env.NODE_ENV==="production"?i.exports=Ie():i.exports=We()})(Ae);const ie=W.Fragment,a=W.jsx,R=W.jsxs,S=({className:i,name:l,viewBox:u="0 0 32 32",...o})=>{const p=[i].filter(Boolean).join(" ");return a("svg",{...o,className:p,viewBox:u,children:a("use",{href:`#${l}`})})},Ye=({children:i,className:l,skin:u="info",closeAlert:o=!1,onClose:p,title:f,date:_,ariaLive:g="polite",...m})=>{const N=[l,"pkt-alert",u&&`pkt-alert--${u}`].filter(Boolean).join(" "),[y,T]=x.useState(!0),O=()=>{T(!1),p&&p()};return y?R("div",{...m,className:N,"aria-live":g,children:[a("div",{className:"pkt-alert__icon",children:a(S,{name:u==="info"?"alert-information":`alert-${u}`})}),o&&a("div",{className:"pkt-alert__close",children:a("button",{className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",tabIndex:0,"aria-label":"close",onClick:O,children:a(S,{name:"close",className:"pkt-btn__icon","aria-hidden":"true"})})}),f&&a("div",{className:"pkt-alert__title",children:f}),a("div",{className:"pkt-alert__text",children:i}),_&&R("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",_]})]}):null},oe=x.forwardRef(({children:i,className:l,iconName:u="user",secondIconName:o="user",size:p="medium",skin:f="primary",type:_="button",variant:g="label-only",...m},N)=>{const y=[l,"pkt-btn",p&&`pkt-btn--${p}`,f&&`pkt-btn--${f}`,g&&`pkt-btn--${g}`].filter(Boolean).join(" ");return R("button",{...m,className:y,type:_,ref:N,children:[a(S,{className:"pkt-btn__icon",name:u}),a("span",{className:"pkt-btn__text",children:i}),g==="icons-right-and-left"&&a(S,{className:"pkt-btn__icon",name:o})]})});oe.displayName="PktButton";const $e=({children:i,className:l,logoLink:u="https://www.oslo.kommune.no/",isLoggedIn:o=!1,representing:p="",canChangeRepresentation:f=!1,showLogInButton:_=!0,onLogIn:g,onLogOut:m,onChangeRepresentation:N,...y})=>{const T=[l,"pkt-header"].filter(Boolean).join(" ");return R("header",{id:"pkt-header",className:T,"aria-label":"Topp",children:[a("div",{className:"pkt-header__logo",children:a("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:u,children:a(S,{name:"oslologo",className:"pkt-header__logo-svg",viewBox:"0 0 60 31","aria-hidden":"true"})})}),R("div",{className:"pkt-header__actions",children:[o&&f&&R("button",{className:"pkt-btn pkt-btn--secondary pkt-btn--icon-right","aria-label":`Bytt bruker fra ${p}`,onClick:N,children:[a(S,{name:"user",className:"pkt-btn__icon pkt-show-tablet-up"}),a("span",{className:"pkt-header__action-change pkt-hide pkt-show-tablet-up ml-size-15",children:"Endre"}),a("span",{className:"pkt-btn__text pkt-hide-tablet-up",children:"Endre"}),a("span",{className:"pkt-btn__text--representing pkt-hide pkt-show-tablet-up",children:p})]}),o&&!f&&R("div",{className:"pkt-header__action",children:[a("span",{className:"pkt-header__action-text",children:a("span",{className:"pkt-btn__text pkt-header__action-textrow text-row-inline pkt-truncate-text",children:p})}),a("span",{className:"pkt-header__action-icon pkt-show-phablet-up",children:a(S,{name:"user"})})]}),_&&o&&R("button",{className:"pkt-btn pkt-btn--tertiary pkt-btn--icon-right","aria-label":"Logg ut",onClick:m,children:[a(S,{className:"pkt-btn__icon pkt-show-tablet-up",name:"exit"}),a("span",{className:"pkt-btn__text",children:"Logg ut"})]}),_&&!o&&R("button",{className:"pkt-btn pkt-btn--tertiary pkt-btn--icon-right","aria-label":"Logg inn",onClick:g,children:[a(S,{className:"pkt-btn__icon",name:"user"}),a("span",{className:"pkt-btn__text",children:"Logg inn"})]})]})]})},se=x.forwardRef(({label:i,id:l,children:u,...o},p)=>R("div",{className:"pkt-form-group",children:[a("label",{htmlFor:l,className:"pkt-form-label",children:i}),a("input",{className:"pkt-form-input",id:l,...o,ref:p}),u]}));se.displayName="PktInput";const Le=({children:i,className:l,iconName:u="user",skin:o="",href:p="#",title:f})=>{const _=[l,"pkt-linkcard",o&&`pkt-linkcard--${o}`].filter(Boolean).join(" ");return R("a",{href:p,className:`pkt-linkcard pkt-link ${_}`,children:[a(S,{className:"pkt-link__icon",name:u}),R("div",{className:"pkt-linkcard__content",children:[a("div",{className:"pkt-linkcard__title",children:f}),a("div",{className:"pkt-linkcard__text",children:i})]})]})},Be=({children:i,skin:l="beige",title:u,...o})=>{const p=["pkt-messagebox",l&&`pkt-messagebox--${l}`].filter(Boolean).join(" ");return R("div",{...o,className:p,children:[a("div",{className:"pkt-messagebox__title",children:u}),a("div",{className:"pkt-messagebox__text",children:i})]})},le=x.forwardRef(({id:i,label:l,...u},o)=>R("div",{className:"pkt-form-group",children:[a("label",{htmlFor:i,className:"pkt-form-label",children:l}),a("textarea",{className:"pkt-form-textarea",id:i,ref:o,...u})]}));le.displayName="PktTextarea";const ce=x.forwardRef(({id:i,name:l,label:u,value:o,...p},f)=>R("div",{className:"pkt-form-group",children:[a("input",{type:"radio",className:"pkt-form-check-input",id:i,name:l,value:o,ref:f,...p}),a("label",{className:"pkt-form-label",htmlFor:i,children:u})]}));ce.displayName="PktRadio";const Me=({label:i,children:l})=>R(ie,{children:[a("p",{children:i}),a("div",{className:"pkt-form-group",children:l})]});var z={},Ve={get exports(){return z},set exports(i){z=i}};/*!
27
+ Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Er(r);if(Oe[t])return;Oe[t]=!0;var n="";e&&e._owner&&e._owner!==ee.current&&(n=" It was passed a child from "+C(e._owner.type)+"."),I(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),I(null)}}function je(e,r){{if(typeof e!="object")return;if(Z(e))for(var t=0;t<e.length;t++){var n=e[t];te(n)&&Ce(n,r)}else if(te(e))e._store&&(e._store.validated=!0);else if(e){var d=Xe(e);if(typeof d=="function"&&d!==e.entries)for(var v=d.call(e),u;!(u=v.next()).done;)te(u.value)&&Ce(u.value,r)}}}function Pr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===m||r.$$typeof===x))t=r.propTypes;else return;if(t){var n=C(r);ur(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!re){re=!0;var d=C(r);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){I(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),I(null);break}}e.ref!==null&&(I(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}function De(e,r,t,n,d,v){{var u=ar(e);if(!u){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" 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 P=Rr(d);P?o+=P:o+=Se();var h;e===null?h="null":Z(e)?h="array":e!==void 0&&e.$$typeof===c?(h="<"+(C(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):h=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",h,o)}var b=yr(e,r,t,d,v);if(b==null)return b;if(u){var w=r.children;if(w!==void 0)if(n)if(Z(w)){for(var W=0;W<w.length;W++)je(w[W],e);Object.freeze&&Object.freeze(w)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else je(w,e)}return e===l?Tr(b):Pr(b),b}}function Nr(e,r,t){return De(e,r,t,!0)}function wr(e,r,t){return De(e,r,t,!1)}var xr=wr,Sr=Nr;B.Fragment=l,B.jsx=xr,B.jsxs=Sr}()),B}(function(i){process.env.NODE_ENV==="production"?i.exports=Ie():i.exports=We()})(Ae);const ie=Y.Fragment,a=Y.jsx,R=Y.jsxs,S=({className:i,name:c,viewBox:s="0 0 32 32",...l})=>{const p=[i].filter(Boolean).join(" ");return a("svg",{...l,className:p,viewBox:s,children:a("use",{href:`#${c}`})})},Ye=T.forwardRef(({children:i,className:c,skin:s="info",closeAlert:l=!1,onClose:p,title:f,date:k,ariaLive:g="polite",...m},N)=>{const y=[c,"pkt-alert",s&&`pkt-alert--${s}`].filter(Boolean).join(" "),[x,O]=T.useState(!0),F=()=>{O(!1),p&&p()};return x?R("div",{...m,className:y,"aria-live":g,ref:N,children:[a("div",{className:"pkt-alert__icon",children:a(S,{name:s==="info"?"alert-information":`alert-${s}`})}),l&&a("div",{className:"pkt-alert__close",children:a("button",{className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",tabIndex:0,"aria-label":"close",onClick:F,children:a(S,{name:"close",className:"pkt-btn__icon","aria-hidden":"true"})})}),f&&a("div",{className:"pkt-alert__title",children:f}),a("div",{className:"pkt-alert__text",children:i}),k&&R("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",k]})]}):null}),oe=T.forwardRef(({children:i,className:c,iconName:s="user",secondIconName:l="user",size:p="medium",skin:f="primary",type:k="button",variant:g="label-only",...m},N)=>{const y=[c,"pkt-btn",p&&`pkt-btn--${p}`,f&&`pkt-btn--${f}`,g&&`pkt-btn--${g}`].filter(Boolean).join(" ");return R("button",{...m,className:y,type:k,ref:N,children:[a(S,{className:"pkt-btn__icon",name:s}),a("span",{className:"pkt-btn__text",children:i}),g==="icons-right-and-left"&&a(S,{className:"pkt-btn__icon",name:l})]})});oe.displayName="PktButton";const Le=({className:i,logoLink:c="https://www.oslo.kommune.no/",isLoggedIn:s=!1,representing:l="",canChangeRepresentation:p=!1,showLogInButton:f=!0,onLogIn:k,onLogOut:g,onChangeRepresentation:m})=>{const N=[i,"pkt-header"].filter(Boolean).join(" ");return R("header",{id:"pkt-header",className:N,"aria-label":"Topp",children:[a("div",{className:"pkt-header__logo",children:a("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:c,children:a(S,{name:"oslologo",className:"pkt-header__logo-svg",viewBox:"0 0 60 31","aria-hidden":"true"})})}),R("div",{className:"pkt-header__actions",children:[s&&p&&R("button",{className:"pkt-btn pkt-btn--secondary pkt-btn--icon-right","aria-label":`Bytt bruker fra ${l}`,onClick:m,children:[a(S,{name:"user",className:"pkt-btn__icon pkt-show-tablet-up"}),a("span",{className:"pkt-header__action-change pkt-hide pkt-show-tablet-up ml-size-15",children:"Endre"}),a("span",{className:"pkt-btn__text pkt-hide-tablet-up",children:"Endre"}),a("span",{className:"pkt-btn__text--representing pkt-hide pkt-show-tablet-up",children:l})]}),s&&!p&&R("div",{className:"pkt-header__action",children:[a("span",{className:"pkt-header__action-text",children:a("span",{className:"pkt-btn__text pkt-header__action-textrow text-row-inline pkt-truncate-text",children:l})}),a("span",{className:"pkt-header__action-icon pkt-show-phablet-up",children:a(S,{name:"user"})})]}),f&&s&&R("button",{className:"pkt-btn pkt-btn--tertiary pkt-btn--icon-right","aria-label":"Logg ut",onClick:g,children:[a(S,{className:"pkt-btn__icon pkt-show-tablet-up",name:"exit"}),a("span",{className:"pkt-btn__text",children:"Logg ut"})]}),f&&!s&&R("button",{className:"pkt-btn pkt-btn--tertiary pkt-btn--icon-right","aria-label":"Logg inn",onClick:k,children:[a(S,{className:"pkt-btn__icon",name:"user"}),a("span",{className:"pkt-btn__text",children:"Logg inn"})]})]})]})},se=T.forwardRef(({label:i,id:c,children:s,...l},p)=>R("div",{className:"pkt-form-group",children:[a("label",{htmlFor:c,className:"pkt-form-label",children:i}),a("input",{className:"pkt-form-input",id:c,...l,ref:p}),s]}));se.displayName="PktInput";const Be=({children:i,className:c,iconName:s="user",skin:l="",href:p="#",title:f})=>{const k=[c,"pkt-linkcard",l&&`pkt-linkcard--${l}`].filter(Boolean).join(" ");return R("a",{href:p,className:`pkt-linkcard pkt-link ${k}`,children:[a(S,{className:"pkt-link__icon",name:s}),R("div",{className:"pkt-linkcard__content",children:[a("div",{className:"pkt-linkcard__title",children:f}),a("div",{className:"pkt-linkcard__text",children:i})]})]})},Me=({children:i,skin:c="beige",title:s,...l})=>{const p=["pkt-messagebox",c&&`pkt-messagebox--${c}`].filter(Boolean).join(" ");return R("div",{...l,className:p,children:[a("div",{className:"pkt-messagebox__title",children:s}),a("div",{className:"pkt-messagebox__text",children:i})]})},le=T.forwardRef(({id:i,name:c,label:s,value:l,...p},f)=>R("div",{className:"pkt-form-group",children:[a("input",{type:"radio",className:"pkt-form-check-input",id:i,name:c,value:l,ref:f,...p}),a("label",{className:"pkt-form-label",htmlFor:i,children:s})]}));le.displayName="PktRadio";const $e=({label:i,children:c})=>R(ie,{children:[a("p",{children:i}),a("div",{className:"pkt-form-group",children:c})]});var z={},Ve={get exports(){return z},set exports(i){z=i}};/*!
28
28
  Copyright (c) 2018 Jed Watson.
29
29
  Licensed under the MIT License (MIT), see
30
30
  http://jedwatson.github.io/classnames
31
- */(function(i){(function(){var l={}.hasOwnProperty;function u(){for(var o=[],p=0;p<arguments.length;p++){var f=arguments[p];if(f){var _=typeof f;if(_==="string"||_==="number")o.push(f);else if(Array.isArray(f)){if(f.length){var g=u.apply(null,f);g&&o.push(g)}}else if(_==="object"){if(f.toString!==Object.prototype.toString&&!f.toString.toString().includes("[native code]")){o.push(f.toString());continue}for(var m in f)l.call(f,m)&&f[m]&&o.push(m)}}}return o.join(" ")}i.exports?(u.default=u,i.exports=u):window.classNames=u})()})(Ve);const Ue=z,Ge=({isResponsive:i,children:l})=>i?a("div",{className:"pkt-table-container",children:l}):a(ie,{children:l}),He=({isResponsive:i,modifiers:{info:l=!1,success:u=!1,strong:o=!1,shadow:p=!1}={},children:f})=>a(Ge,{isResponsive:i,children:a("table",{className:Ue("pkt-table",{"pkt-table--info":l,"pkt-table--success":u,"pkt-table--strong":o,"pkt-table--shadow":p}),children:f})}),Je=({children:i})=>a("td",{className:"pkt-table__th",children:i}),ze=({children:i})=>a("th",{className:"pkt-table__th",children:i});k.PktAlert=Ye,k.PktButton=oe,k.PktHeader=$e,k.PktInput=se,k.PktLinkCard=Le,k.PktMessagebox=Be,k.PktRadio=ce,k.PktRadioGroup=Me,k.PktTable=He,k.PktTableData=Je,k.PktTableHeader=ze,k.PktTextarea=le,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
31
+ */(function(i){(function(){var c={}.hasOwnProperty;function s(){for(var l=[],p=0;p<arguments.length;p++){var f=arguments[p];if(f){var k=typeof f;if(k==="string"||k==="number")l.push(f);else if(Array.isArray(f)){if(f.length){var g=s.apply(null,f);g&&l.push(g)}}else if(k==="object"){if(f.toString!==Object.prototype.toString&&!f.toString.toString().includes("[native code]")){l.push(f.toString());continue}for(var m in f)c.call(f,m)&&f[m]&&l.push(m)}}}return l.join(" ")}i.exports?(s.default=s,i.exports=s):window.classNames=s})()})(Ve);const Ue=z,Ge=({isResponsive:i,children:c})=>i?a("div",{className:"pkt-table-container",children:c}):a(ie,{children:c}),He=({isResponsive:i,modifiers:{info:c=!1,success:s=!1,strong:l=!1,shadow:p=!1}={},children:f})=>a(Ge,{isResponsive:i,children:a("table",{className:Ue("pkt-table",{"pkt-table--info":c,"pkt-table--success":s,"pkt-table--strong":l,"pkt-table--shadow":p}),children:f})}),Je=({children:i})=>a("td",{className:"pkt-table__th",children:i}),ze=({children:i})=>a("th",{className:"pkt-table__th",children:i}),ce=T.forwardRef(({id:i,label:c,...s},l)=>R("div",{className:"pkt-form-group",children:[a("label",{htmlFor:i,className:"pkt-form-label",children:c}),a("textarea",{className:"pkt-form-textarea",id:i,ref:l,...s})]}));ce.displayName="PktTextarea",_.PktAlert=Ye,_.PktButton=oe,_.PktHeader=Le,_.PktInput=se,_.PktLinkCard=Be,_.PktMessagebox=Me,_.PktRadio=le,_.PktRadioGroup=$e,_.PktTable=He,_.PktTableData=Je,_.PktTableHeader=ze,_.PktTextarea=ce,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-react",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
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",
@@ -35,6 +35,7 @@
35
35
  "@oslokommune/punkt-css": "^3.3.1",
36
36
  "@testing-library/jest-dom": "^5.16.5",
37
37
  "@testing-library/react": "^14.0.0",
38
+ "@testing-library/user-event": "^14.4.3",
38
39
  "@types/jest": "^29.4.0",
39
40
  "@types/jest-axe": "^3.5.5",
40
41
  "@types/node": "^18.14.1",
@@ -89,5 +90,5 @@
89
90
  "url": "https://github.com/oslokommune/punkt/issues"
90
91
  },
91
92
  "license": "MIT",
92
- "gitHead": "5e6489b75d034b72fe83a8284b524c4bfb21038d"
93
+ "gitHead": "9652f37c67dcd894d3874ed44f9c266c0454be21"
93
94
  }
@@ -0,0 +1,38 @@
1
+
2
+ import { fireEvent, render } from '@testing-library/react';
3
+ import { axe, toHaveNoViolations } from 'jest-axe'
4
+ import React, { createRef } from 'react';
5
+
6
+ import { PktAlert } from './Alert';
7
+
8
+ expect.extend(toHaveNoViolations)
9
+
10
+ describe('PktAlert', () => {
11
+
12
+ test('ref works correctly', () => {
13
+ const ref = createRef<HTMLDivElement>();
14
+ const { unmount } = render(<PktAlert ref={ref}>Alert text</PktAlert>);
15
+ expect(ref.current).toBeInstanceOf(HTMLDivElement);
16
+
17
+ unmount();
18
+ expect(ref.current).toBe(null);
19
+ });
20
+
21
+ it('calls onClose when close button is clicked', () => {
22
+ const onClose = jest.fn();
23
+ const { getByLabelText } = render(<PktAlert closeAlert={true} onClose={onClose}>Hello World</PktAlert>);
24
+ fireEvent.click(getByLabelText('close'));
25
+ expect(onClose).toHaveBeenCalledTimes(1);
26
+ });
27
+
28
+ describe('accessibility', () => {
29
+ it('renders with no wcag errors with axe', async () => {
30
+ const { container } = render(<PktAlert title="Error" skin="error"></PktAlert>)
31
+ const results = await axe(container)
32
+
33
+ expect(results).toHaveNoViolations()
34
+ })
35
+ })
36
+ });
37
+
38
+
@@ -1,4 +1,5 @@
1
- import React, { useState } from 'react'
1
+ import React, { ForwardedRef, forwardRef, useState } from 'react'
2
+
2
3
  import { PktIcon } from '../icon/Icon'
3
4
 
4
5
  export interface IPktAlert extends React.HTMLAttributes<HTMLDivElement> {
@@ -10,7 +11,7 @@ export interface IPktAlert extends React.HTMLAttributes<HTMLDivElement> {
10
11
  ariaLive?: 'off' | 'polite' | 'assertive'
11
12
  }
12
13
 
13
- export const PktAlert: React.FC<IPktAlert> = ({
14
+ export const PktAlert = forwardRef(({
14
15
  children,
15
16
  className,
16
17
  skin = 'info',
@@ -20,7 +21,7 @@ export const PktAlert: React.FC<IPktAlert> = ({
20
21
  date,
21
22
  ariaLive = 'polite',
22
23
  ...props
23
- }) => {
24
+ }: IPktAlert, ref: ForwardedRef<HTMLDivElement>) => {
24
25
  const classes = [className, 'pkt-alert', skin && `pkt-alert--${skin}`].filter(Boolean).join(' ')
25
26
 
26
27
  const [isDisplayed, setIsDisplayed] = useState(true)
@@ -33,7 +34,7 @@ export const PktAlert: React.FC<IPktAlert> = ({
33
34
  }
34
35
 
35
36
  return isDisplayed ? (
36
- <div {...props} className={classes} aria-live={ariaLive}>
37
+ <div {...props} className={classes} aria-live={ariaLive} ref={ref}>
37
38
  <div className="pkt-alert__icon">
38
39
  <PktIcon name={skin === 'info' ? 'alert-information' : `alert-${skin}`} />
39
40
  </div>
@@ -41,6 +42,7 @@ export const PktAlert: React.FC<IPktAlert> = ({
41
42
  {closeAlert && (
42
43
  <div className="pkt-alert__close">
43
44
  <button
45
+
44
46
  className="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
45
47
  tabIndex={0}
46
48
  aria-label="close"
@@ -59,3 +61,4 @@ export const PktAlert: React.FC<IPktAlert> = ({
59
61
  </div>
60
62
  ) : null
61
63
  }
64
+ )
@@ -0,0 +1,28 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import userEvent from '@testing-library/user-event';
3
+ import { axe, toHaveNoViolations } from 'jest-axe'
4
+ import React, { createRef } from 'react';
5
+
6
+ import { PktButton } from './Button';
7
+
8
+ expect.extend(toHaveNoViolations)
9
+
10
+ test('forwardRef works correctly', () => {
11
+ const ref = createRef<HTMLButtonElement>();
12
+ render(<PktButton ref={ref}>Click me</PktButton>);
13
+
14
+ // Simulate a click on the button
15
+ userEvent.click(screen.getByText('Click me'));
16
+
17
+ // Check that the ref actually points to the button element
18
+ expect(ref.current).toBe(screen.getByRole('button'));
19
+ });
20
+
21
+ describe('accessibility', () => {
22
+ it('renders with no wcag errors with axe', async () => {
23
+ const { container } = render(<PktButton title="Normal" skin="primary"></PktButton>)
24
+ const results = await axe(container)
25
+
26
+ expect(results).toHaveNoViolations()
27
+ })
28
+ })
@@ -1,4 +1,5 @@
1
1
  import React from 'react'
2
+
2
3
  import { PktIcon } from '../icon/Icon'
3
4
 
4
5
  type HeaderProps = React.HTMLAttributes<HTMLDivElement> & {
@@ -13,7 +14,6 @@ type HeaderProps = React.HTMLAttributes<HTMLDivElement> & {
13
14
  }
14
15
 
15
16
  export const PktHeader: React.FC<HeaderProps> = ({
16
- children,
17
17
  className,
18
18
  logoLink = 'https://www.oslo.kommune.no/',
19
19
  isLoggedIn = false,
@@ -23,7 +23,6 @@ export const PktHeader: React.FC<HeaderProps> = ({
23
23
  onLogIn,
24
24
  onLogOut,
25
25
  onChangeRepresentation,
26
- ...props
27
26
  }) => {
28
27
  const classNames = [className, 'pkt-header'].filter(Boolean).join(' ')
29
28
  return (
@@ -4,9 +4,9 @@ export { PktHeader } from './header/Header'
4
4
  export { PktInput } from './input/Input'
5
5
  export { PktLinkCard } from './linkcard/LinkCard'
6
6
  export { PktMessagebox } from './messagebox/Messagebox'
7
- export { PktTextarea } from './textarea/Textarea'
8
7
  export { PktRadio } from './radio/Radio'
9
8
  export { PktRadioGroup } from './radioGroup/RadioGroup'
10
9
  export { PktTable } from './table/Table'
11
10
  export { PktTableData } from './table/TableData'
12
11
  export { PktTableHeader } from './table/TableHeader'
12
+ export { PktTextarea } from './textarea/Textarea'
@@ -1,12 +1,12 @@
1
1
  // Test med axe https://www.npmjs.com/package/jest-axe
2
- import * as React from 'react'
3
- import { render } from '@testing-library/react'
4
2
  import '@testing-library/jest-dom/extend-expect';
5
3
 
6
- import { PktLinkCard } from './LinkCard'
4
+ import { render } from '@testing-library/react'
5
+ import { axe, toHaveNoViolations } from 'jest-axe'
6
+ import * as React from 'react'
7
7
 
8
+ import { PktLinkCard } from './LinkCard'
8
9
 
9
- const { axe, toHaveNoViolations } = require('jest-axe')
10
10
  expect.extend(toHaveNoViolations)
11
11
 
12
12
 
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react'
1
+ import React from 'react'
2
2
 
3
3
  export interface IPktMessagebox extends React.HTMLAttributes<HTMLDivElement> {
4
4
  skin?: 'beige' | 'red' | 'green' | 'blue'
@@ -1,4 +1,5 @@
1
1
  import React, { ReactElement } from 'react'
2
+
2
3
  import { PktRadio } from '../radio/Radio'
3
4
 
4
5
  interface RadioGroupProps {
@@ -1,5 +1,5 @@
1
- import * as React from 'react'
2
1
  import { render } from '@testing-library/react'
2
+ import * as React from 'react'
3
3
 
4
4
  import { PktTable } from './Table'
5
5
  import { PktTableHeader } from './TableHeader'
@@ -1,5 +1,5 @@
1
- import * as React from 'react'
2
1
  import classNames from 'classnames'
2
+ import * as React from 'react'
3
3
 
4
4
  export type ModifierName = 'info' | 'success' | 'strong' | 'shadow'
5
5