@oslokommune/punkt-react 12.39.8 → 12.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22753,7 +22753,7 @@ var HL = Object.defineProperty, qL = Object.getOwnPropertyDescriptor, _y = (r, n
22753
22753
  return l && d && HL(n, i, d), d;
22754
22754
  };
22755
22755
  window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch;
22756
- window.pktIconPath = window.pktIconPath || "https://punkt-cdn.oslo.kommune.no/12.39/icons/";
22756
+ window.pktIconPath = window.pktIconPath || "https://punkt-cdn.oslo.kommune.no/12.40/icons/";
22757
22757
  const VL = (r) => new Promise((n) => setTimeout(n, r)), rw = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>', HD = {}, WL = async (r, n) => {
22758
22758
  let i = 0;
22759
22759
  for (; HD[n + r + ".svg"] === "fetching" && (i++, !(i > 50)); )
@@ -23068,7 +23068,7 @@ var aB = Object.defineProperty, iB = Object.getOwnPropertyDescriptor, Ds = (r, n
23068
23068
  (m = r[h]) && (d = (l ? m(n, i, d) : m(d)) || d);
23069
23069
  return l && d && aB(n, i, d), d;
23070
23070
  };
23071
- window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/12.39/animations/";
23071
+ window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/12.40/animations/";
23072
23072
  let qi = class extends Gr {
23073
23073
  constructor() {
23074
23074
  super(), this.internals = this.attachInternals(), this.defaultSlot = dn(), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.isLoading = !1, this.disabled = !1, this.loadingAnimationPath = window.pktAnimationPath, this.slotController = new za(this, this.defaultSlot), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeydown);
@@ -27692,7 +27692,7 @@ var oI = Object.defineProperty, sI = Object.getOwnPropertyDescriptor, fd = (r, n
27692
27692
  (m = r[h]) && (d = (l ? m(n, i, d) : m(d)) || d);
27693
27693
  return l && d && oI(n, i, d), d;
27694
27694
  };
27695
- window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/12.39/animations/";
27695
+ window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/12.40/animations/";
27696
27696
  let iu = class extends Gr {
27697
27697
  constructor() {
27698
27698
  super(), this.defaultSlot = dn(), this.delay = 0, this.inline = !1, this.isLoading = !0, this.message = null, this.size = "medium", this.variant = "shapes", this.loadingAnimationPath = window.pktAnimationPath, this._shouldDisplayLoader = !1, this.slotController = new za(this, this.defaultSlot);
@@ -29102,7 +29102,7 @@ const ou = /* @__PURE__ */ Dw(UI), ZH = Ir(
29102
29102
  name: "oslologo",
29103
29103
  className: "pkt-header__logo-svg",
29104
29104
  "aria-hidden": "true",
29105
- path: "https://punkt-cdn.oslo.kommune.no/12.39/logos/"
29105
+ path: "https://punkt-cdn.oslo.kommune.no/12.40/logos/"
29106
29106
  }
29107
29107
  ) }) : /* @__PURE__ */ L.jsx(
29108
29108
  "button",
@@ -29116,7 +29116,7 @@ const ou = /* @__PURE__ */ Dw(UI), ZH = Ir(
29116
29116
  name: "oslologo",
29117
29117
  className: "pkt-header__logo-svg",
29118
29118
  "aria-hidden": "true",
29119
- path: "https://punkt-cdn.oslo.kommune.no/12.39/logos/"
29119
+ path: "https://punkt-cdn.oslo.kommune.no/12.40/logos/"
29120
29120
  }
29121
29121
  )
29122
29122
  }
@@ -335,7 +335,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
335
335
  * @license
336
336
  * Copyright 2017 Google LLC
337
337
  * SPDX-License-Identifier: BSD-3-Clause
338
- */let i0=class extends Yy{};i0.directiveName="unsafeSVG",i0.resultType=2;const w1=Of(i0);var xP=Object.defineProperty,EP=Object.getOwnPropertyDescriptor,Tg=(n,r,i,l)=>{for(var c=l>1?void 0:l?EP(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&xP(r,i,c),c};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/12.39/icons/";const TP=n=>new Promise(r=>setTimeout(r,n)),Ky='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',o0={},AP=async(n,r)=>{let i=0;for(;o0[r+n+".svg"]==="fetching"&&(i++,!(i>50));)await TP(50);return localStorage.getItem(r+n+".svg")?Promise.resolve(localStorage.getItem(r+n+".svg")):typeof window.pktFetch=="function"?(o0[r+n+".svg"]="fetching",Promise.resolve(window.pktFetch(r+n+".svg").then(l=>l.ok?l.text():(console.error("Missing icon: "+r+n+".svg"),Ky)).then(l=>(l!==Ky&&localStorage.setItem(r+n+".svg",l),o0[r+n+".svg"]="fetched",l)))):Promise.resolve(Ky)};let Lf=class extends Hr{constructor(){super(...arguments),this.path=window.pktIconPath,this.name="",this.icon=w1(Ky),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(r,i,l){super.attributeChangedCallback(r,i,l),(r==="name"||r==="path")&&this.getIcon(this.name)}async updated(r){super.updated(r),(r.has("name")||r.has("path"))&&this.getIcon(this.name)}async getIcon(r=""){this._updatedProps.length>0?(this.path||(this.path,window.pktIconPath),this.icon=w1(await AP(this.name||"",this.path).then(i=>i)),this._updatedProps=[]):this._updatedProps.includes(r)||this._updatedProps.push(r)}render(){return be`${this.name&&this.icon}`}};Tg([z({type:String,reflect:!1})],Lf.prototype,"path",2),Tg([z({type:String,reflect:!0})],Lf.prototype,"name",2),Tg([z({type:SVGElement})],Lf.prototype,"icon",2),Tg([z({type:Array,noAccessor:!0})],Lf.prototype,"_updatedProps",2),Lf=Tg([dr("pkt-icon")],Lf);const FP={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},Qy={props:FP};var $P=Object.defineProperty,PP=Object.getOwnPropertyDescriptor,pc=(n,r,i,l)=>{for(var c=l>1?void 0:l?PP(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&$P(r,i,c),c};let dl=class extends Hr{constructor(){super(),this.defaultSlot=dn(),this.compact=Qy.props.compact.default,this.title="",this.skin=Qy.props.skin.default,this.ariaLive=Qy.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=Qy.props.closeAlert.default,this.date=null,this._isClosed=!1,this.close=r=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:r},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:r},bubbles:!0,composed:!0}))},this.slotController=new _a(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(r,i,l){r==="ariaLive"&&(this["aria-live"]=l),super.attributeChangedCallback(r,i,l)}updated(r){super.updated(r),r.has("ariaLive")&&(this["aria-live"]=this.ariaLive),r.has("_isClosed")&&k1(this,"pkt-hide",this._isClosed)}render(){const r={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},i={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return be`
338
+ */let i0=class extends Yy{};i0.directiveName="unsafeSVG",i0.resultType=2;const w1=Of(i0);var xP=Object.defineProperty,EP=Object.getOwnPropertyDescriptor,Tg=(n,r,i,l)=>{for(var c=l>1?void 0:l?EP(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&xP(r,i,c),c};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/12.40/icons/";const TP=n=>new Promise(r=>setTimeout(r,n)),Ky='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',o0={},AP=async(n,r)=>{let i=0;for(;o0[r+n+".svg"]==="fetching"&&(i++,!(i>50));)await TP(50);return localStorage.getItem(r+n+".svg")?Promise.resolve(localStorage.getItem(r+n+".svg")):typeof window.pktFetch=="function"?(o0[r+n+".svg"]="fetching",Promise.resolve(window.pktFetch(r+n+".svg").then(l=>l.ok?l.text():(console.error("Missing icon: "+r+n+".svg"),Ky)).then(l=>(l!==Ky&&localStorage.setItem(r+n+".svg",l),o0[r+n+".svg"]="fetched",l)))):Promise.resolve(Ky)};let Lf=class extends Hr{constructor(){super(...arguments),this.path=window.pktIconPath,this.name="",this.icon=w1(Ky),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(r,i,l){super.attributeChangedCallback(r,i,l),(r==="name"||r==="path")&&this.getIcon(this.name)}async updated(r){super.updated(r),(r.has("name")||r.has("path"))&&this.getIcon(this.name)}async getIcon(r=""){this._updatedProps.length>0?(this.path||(this.path,window.pktIconPath),this.icon=w1(await AP(this.name||"",this.path).then(i=>i)),this._updatedProps=[]):this._updatedProps.includes(r)||this._updatedProps.push(r)}render(){return be`${this.name&&this.icon}`}};Tg([z({type:String,reflect:!1})],Lf.prototype,"path",2),Tg([z({type:String,reflect:!0})],Lf.prototype,"name",2),Tg([z({type:SVGElement})],Lf.prototype,"icon",2),Tg([z({type:Array,noAccessor:!0})],Lf.prototype,"_updatedProps",2),Lf=Tg([dr("pkt-icon")],Lf);const FP={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},Qy={props:FP};var $P=Object.defineProperty,PP=Object.getOwnPropertyDescriptor,pc=(n,r,i,l)=>{for(var c=l>1?void 0:l?PP(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&$P(r,i,c),c};let dl=class extends Hr{constructor(){super(),this.defaultSlot=dn(),this.compact=Qy.props.compact.default,this.title="",this.skin=Qy.props.skin.default,this.ariaLive=Qy.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=Qy.props.closeAlert.default,this.date=null,this._isClosed=!1,this.close=r=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:r},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:r},bubbles:!0,composed:!0}))},this.slotController=new _a(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(r,i,l){r==="ariaLive"&&(this["aria-live"]=l),super.attributeChangedCallback(r,i,l)}updated(r){super.updated(r),r.has("ariaLive")&&(this["aria-live"]=this.ariaLive),r.has("_isClosed")&&k1(this,"pkt-hide",this._isClosed)}render(){const r={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},i={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return be`
339
339
  <div class=${It(r)}>
340
340
  <div class=${It(i)}>
341
341
  <pkt-icon
@@ -414,7 +414,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
414
414
  ></pkt-icon
415
415
  ><span class="pkt-back-link__text">${this.text}</span></a
416
416
  >
417
- </nav>`}};Jy([z({type:String,reflect:!0})],Ch.prototype,"href",2),Jy([z({type:String,reflect:!0})],Ch.prototype,"text",2),Jy([z({type:String,reflect:!0})],Ch.prototype,"ariaLabel",2),Ch=Jy([dr("pkt-backlink")],Ch);var zP=Object.defineProperty,UP=Object.getOwnPropertyDescriptor,Go=(n,r,i,l)=>{for(var c=l>1?void 0:l?UP(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&zP(r,i,c),c};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/12.39/animations/";let Di=class extends Hr{constructor(){super(),this.internals=this.attachInternals(),this.defaultSlot=dn(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new _a(this,this.defaultSlot),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown)}attributeChangedCallback(r,i,l){super.attributeChangedCallback(r,i,l),r==="disabled"&&l==="false"&&(this.disabled=!1),(r==="isloading"||r==="isLoading")&&l==="false"&&(this.isLoading=!1)}firstUpdated(r){super.firstUpdated(r),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}updated(r){super.updated(r),this.setAttribute("role","button"),this.internals.role="button",this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1),this.disabled?(this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1"),this.getAttribute("aria-disabled")!=="true"&&this.setAttribute("aria-disabled","true")):(this.getAttribute("tabindex")!=="0"&&this.setAttribute("tabindex","0"),this.getAttribute("aria-disabled")!=="false"&&this.removeAttribute("aria-disabled")),this.isLoading?this.getAttribute("aria-busy")!=="true"&&this.setAttribute("aria-busy","true"):this.hasAttribute("aria-busy")&&this.removeAttribute("aria-busy"),this.updateElementClasses()}render(){return be`
417
+ </nav>`}};Jy([z({type:String,reflect:!0})],Ch.prototype,"href",2),Jy([z({type:String,reflect:!0})],Ch.prototype,"text",2),Jy([z({type:String,reflect:!0})],Ch.prototype,"ariaLabel",2),Ch=Jy([dr("pkt-backlink")],Ch);var zP=Object.defineProperty,UP=Object.getOwnPropertyDescriptor,Go=(n,r,i,l)=>{for(var c=l>1?void 0:l?UP(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&zP(r,i,c),c};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/12.40/animations/";let Di=class extends Hr{constructor(){super(),this.internals=this.attachInternals(),this.defaultSlot=dn(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new _a(this,this.defaultSlot),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown)}attributeChangedCallback(r,i,l){super.attributeChangedCallback(r,i,l),r==="disabled"&&l==="false"&&(this.disabled=!1),(r==="isloading"||r==="isLoading")&&l==="false"&&(this.isLoading=!1)}firstUpdated(r){super.firstUpdated(r),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}updated(r){super.updated(r),this.setAttribute("role","button"),this.internals.role="button",this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1),this.disabled?(this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1"),this.getAttribute("aria-disabled")!=="true"&&this.setAttribute("aria-disabled","true")):(this.getAttribute("tabindex")!=="0"&&this.setAttribute("tabindex","0"),this.getAttribute("aria-disabled")!=="false"&&this.removeAttribute("aria-disabled")),this.isLoading?this.getAttribute("aria-busy")!=="true"&&this.setAttribute("aria-busy","true"):this.hasAttribute("aria-busy")&&this.removeAttribute("aria-busy"),this.updateElementClasses()}render(){return be`
418
418
  <div class="pkt-contents">
419
419
  ${this.isLoading?be`<pkt-icon
420
420
  class="pkt-btn__icon pkt-btn__spinner"
@@ -1126,7 +1126,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
1126
1126
 
1127
1127
  <div class="pkt-linkcard__text" ${qt(this.defaultSlot)}></div>
1128
1128
  </a>
1129
- `}};Uf([z({type:String,reflect:!0})],hc.prototype,"title",2),Uf([z({type:String,reflect:!0})],hc.prototype,"href",2),Uf([z({type:String,reflect:!0})],hc.prototype,"iconName",2),Uf([z({type:Boolean,reflect:!0})],hc.prototype,"external",2),Uf([z({type:Boolean,reflect:!0})],hc.prototype,"openInNewTab",2),Uf([z({type:String,reflect:!0})],hc.prototype,"skin",2),hc=Uf([dr("pkt-linkcard")],hc);var H3=Object.defineProperty,V3=Object.getOwnPropertyDescriptor,mc=(n,r,i,l)=>{for(var c=l>1?void 0:l?V3(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&H3(r,i,c),c};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/12.39/animations/";let pl=class extends Hr{constructor(){super(),this.defaultSlot=dn(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1,this.slotController=new _a(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(r){r.has("delay")&&this.setupLoader()}render(){const r=It({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),i=It({"pkt-contents":!0,"pkt-hide":this.isLoading});return be`<div role="status" aria-live="polite" .aria-busy=${this.isLoading} class=${r}>
1129
+ `}};Uf([z({type:String,reflect:!0})],hc.prototype,"title",2),Uf([z({type:String,reflect:!0})],hc.prototype,"href",2),Uf([z({type:String,reflect:!0})],hc.prototype,"iconName",2),Uf([z({type:Boolean,reflect:!0})],hc.prototype,"external",2),Uf([z({type:Boolean,reflect:!0})],hc.prototype,"openInNewTab",2),Uf([z({type:String,reflect:!0})],hc.prototype,"skin",2),hc=Uf([dr("pkt-linkcard")],hc);var H3=Object.defineProperty,V3=Object.getOwnPropertyDescriptor,mc=(n,r,i,l)=>{for(var c=l>1?void 0:l?V3(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&H3(r,i,c),c};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/12.40/animations/";let pl=class extends Hr{constructor(){super(),this.defaultSlot=dn(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1,this.slotController=new _a(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(r){r.has("delay")&&this.setupLoader()}render(){const r=It({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),i=It({"pkt-contents":!0,"pkt-hide":this.isLoading});return be`<div role="status" aria-live="polite" .aria-busy=${this.isLoading} class=${r}>
1130
1130
  ${this.isLoading&&this._shouldDisplayLoader?be`<div class="pkt-loader__spinner">
1131
1131
  <pkt-icon
1132
1132
  name=${this.getVariant(this.variant)}
@@ -1419,7 +1419,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
1419
1419
  Copyright (c) 2018 Jed Watson.
1420
1420
  Licensed under the MIT License (MIT), see
1421
1421
  http://jedwatson.github.io/classnames
1422
- */(function(n){(function(){var r={}.hasOwnProperty;function i(){for(var h="",m=0;m<arguments.length;m++){var D=arguments[m];D&&(h=c(h,l(D)))}return h}function l(h){if(typeof h=="string"||typeof h=="number")return h;if(typeof h!="object")return"";if(Array.isArray(h))return i.apply(null,h);if(h.toString!==Object.prototype.toString&&!h.toString.toString().includes("[native code]"))return h.toString();var m="";for(var D in h)r.call(h,D)&&h[D]&&(m=c(m,D));return m}function c(h,m){return m?h?h+" "+m:h+m:h}n.exports?(i.default=i,n.exports=i):window.classNames=i})()})(e_);var DO=e_.exports;const ml=By(DO),SO=$e.forwardRef(({className:n,logoLink:r="https://www.oslo.kommune.no/",serviceName:i,fixed:l=!0,scrollToHide:c=!0,user:h,userMenu:m,representing:D,userOptions:C,userMenuFooter:T,canChangeRepresentation:$=!0,showMenuButton:N=!1,showLogOutButton:O=!1,openMenu:B,logOut:I,changeRepresentation:K,children:Y,...Ce},J)=>{const G=$e.useMemo(()=>typeof(h==null?void 0:h.lastLoggedIn)=="string"?h.lastLoggedIn:h!=null&&h.lastLoggedIn?new Date(h.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[h]),[re,V]=$e.useState(!1),[ae,ce]=$e.useState(0),[Te,ke]=$e.useState(!1),Ge=$e.useRef(null);$e.useEffect(()=>(document&&(document.addEventListener("mouseup",Ke),window.addEventListener("scroll",nt)),()=>{document&&(document.removeEventListener("mouseup",Ke),window.removeEventListener("scroll",nt))}));const We=()=>{ke(!Te)},Ke=He=>{Ge.current&&!Ge.current.contains(He.target)&&ke(!1)},nt=()=>{if(c){const He=window.pageYOffset||document.documentElement.scrollTop;if(He<0||Math.abs(He-ae)<60)return;V(He>ae),ce(He)}};return L.jsxs("header",{...Ce,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:ml(n,"pkt-header",{"pkt-header--fixed":l,"pkt-header--scroll-to-hide":c,"pkt-header--hidden":re}),ref:J,children:[L.jsxs("div",{className:"pkt-header__logo",children:[typeof r=="string"?L.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:r,children:L.jsx(br,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.39/logos/"})}):L.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:r,children:L.jsx(br,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.39/logos/"})}),L.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:i})]}),L.jsx("nav",{className:"pkt-header__actions",children:L.jsxs("ul",{className:"pkt-header__actions-row",children:[N&&L.jsx("li",{children:L.jsx(Fd,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:B,children:"Meny"})}),(h||D)&&L.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${Te&&!re?"pkt-header--open-dropdown":""}`,ref:Ge,children:[L.jsxs("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":Te,onClick:We,children:[L.jsx(br,{name:"user",className:"pkt-btn__icon"}),L.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(D==null?void 0:D.name)||(h==null?void 0:h.name)}),L.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(D==null?void 0:D.shortname)||(h==null?void 0:h.shortname)}),L.jsx(br,{name:"chevron-thin-down",className:"pkt-btn--closed"}),L.jsx(br,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),L.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[h&&L.jsxs("li",{children:[L.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),L.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.lastLoggedIn&&L.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",L.jsx("time",{children:G})]})]}),m&&L.jsx("li",{children:L.jsx("ul",{className:"pkt-list",children:m.map((He,dt)=>L.jsx("li",{children:typeof He.target=="string"?L.jsxs("a",{href:He.target,className:"pkt-link",children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]}):L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]})},`userMenu-${dt}`))})}),(D||$)&&L.jsxs("li",{children:[D&&L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),L.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:D.name}),D.orgNumber&&L.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",D.orgNumber]})]}),L.jsx("ul",{className:"pkt-list mt-size-16",children:$&&L.jsx("li",{children:L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:K,children:[L.jsx(br,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),L.jsx("li",{children:L.jsx("ul",{className:"pkt-list",children:(C||!O)&&L.jsxs(L.Fragment,{children:[C==null?void 0:C.map((He,dt)=>L.jsx("li",{children:typeof He.target=="string"?L.jsxs("a",{href:He.target,className:"pkt-link",children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]}):L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]})},`userOptions-${dt}`)),!O&&L.jsx("li",{children:L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:I,children:[L.jsx(br,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),T&&L.jsx("li",{className:"footer",children:L.jsx("ul",{className:"pkt-list-horizontal bordered",children:T.map((He,dt)=>L.jsx("li",{children:typeof He.target=="string"?L.jsx("a",{href:He.target,className:"pkt-link",children:He.title}):L.jsx("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:He.title})},`userMenuFooter-${dt}`))})})]})]}),Y&&L.jsx("li",{children:Y}),O&&L.jsx("li",{children:L.jsx(Fd,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:I,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),CO=Or({tagName:"pkt-helptext",elementClass:_d,react:$e,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),t_=$e.forwardRef(({children:n,...r},i)=>L.jsx(CO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));t_.displayName="PktHelptext";const n_=$e.forwardRef(({label:n,id:r,children:i,...l},c)=>L.jsxs("div",{className:"pkt-form-group",children:[L.jsx("label",{htmlFor:r,className:"pkt-form-label",children:n}),L.jsx("input",{className:"pkt-form-input",id:r,...l,ref:c}),i]}));n_.displayName="PktInput";const _O=Or({tagName:"pkt-input-wrapper",elementClass:yr,react:$e,displayName:"PktInputWrapper",events:{onToggleHelpText:"toggleHelpText"}}),r_=$e.forwardRef(({children:n,helptext:r,...i},l)=>L.jsxs(_O,{ref:l,...i,children:[L.jsx("div",{className:"pkt-contents",slot:"helptext",children:r}),L.jsx("div",{className:"pkt-contents",children:n})]})),xO=Or({tagName:"pkt-link",elementClass:Ed,react:$e,displayName:"PktLink"}),a_=$e.forwardRef(({children:n,...r},i)=>L.jsx(xO,{...r,ref:i,children:L.jsx("span",{className:"pkt-contents",children:n})}));a_.displayName="PktLink";const EO=Or({tagName:"pkt-linkcard",elementClass:hc,react:$e,displayName:"PktLinkCard",events:{}}),i_=$e.forwardRef(({children:n,...r},i)=>L.jsx(EO,{ref:i,...r,children:L.jsx("div",{className:"pkt-contents",children:n})}));i_.displayName="PktLinkCard";const TO=Or({tagName:"pkt-loader",elementClass:pl,react:$e,displayName:"PktLoader",events:{}}),o_=$e.forwardRef(({children:n,...r},i)=>L.jsx(TO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));o_.displayName="PktLoader";const AO=Or({tagName:"pkt-messagebox",elementClass:Td,react:$e,displayName:"PktMessagebox",events:{onClose:"close"}}),s_=$e.forwardRef(({children:n,...r},i)=>L.jsx(AO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));s_.displayName="PktMessagebox";const FO=Or({tagName:"pkt-modal",elementClass:Qo,react:$e,displayName:"PktModal",events:{}}),l_=$e.forwardRef(({children:n,...r},i)=>L.jsx(FO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));l_.displayName="PktModal";/*!
1422
+ */(function(n){(function(){var r={}.hasOwnProperty;function i(){for(var h="",m=0;m<arguments.length;m++){var D=arguments[m];D&&(h=c(h,l(D)))}return h}function l(h){if(typeof h=="string"||typeof h=="number")return h;if(typeof h!="object")return"";if(Array.isArray(h))return i.apply(null,h);if(h.toString!==Object.prototype.toString&&!h.toString.toString().includes("[native code]"))return h.toString();var m="";for(var D in h)r.call(h,D)&&h[D]&&(m=c(m,D));return m}function c(h,m){return m?h?h+" "+m:h+m:h}n.exports?(i.default=i,n.exports=i):window.classNames=i})()})(e_);var DO=e_.exports;const ml=By(DO),SO=$e.forwardRef(({className:n,logoLink:r="https://www.oslo.kommune.no/",serviceName:i,fixed:l=!0,scrollToHide:c=!0,user:h,userMenu:m,representing:D,userOptions:C,userMenuFooter:T,canChangeRepresentation:$=!0,showMenuButton:N=!1,showLogOutButton:O=!1,openMenu:B,logOut:I,changeRepresentation:K,children:Y,...Ce},J)=>{const G=$e.useMemo(()=>typeof(h==null?void 0:h.lastLoggedIn)=="string"?h.lastLoggedIn:h!=null&&h.lastLoggedIn?new Date(h.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[h]),[re,V]=$e.useState(!1),[ae,ce]=$e.useState(0),[Te,ke]=$e.useState(!1),Ge=$e.useRef(null);$e.useEffect(()=>(document&&(document.addEventListener("mouseup",Ke),window.addEventListener("scroll",nt)),()=>{document&&(document.removeEventListener("mouseup",Ke),window.removeEventListener("scroll",nt))}));const We=()=>{ke(!Te)},Ke=He=>{Ge.current&&!Ge.current.contains(He.target)&&ke(!1)},nt=()=>{if(c){const He=window.pageYOffset||document.documentElement.scrollTop;if(He<0||Math.abs(He-ae)<60)return;V(He>ae),ce(He)}};return L.jsxs("header",{...Ce,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:ml(n,"pkt-header",{"pkt-header--fixed":l,"pkt-header--scroll-to-hide":c,"pkt-header--hidden":re}),ref:J,children:[L.jsxs("div",{className:"pkt-header__logo",children:[typeof r=="string"?L.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:r,children:L.jsx(br,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.40/logos/"})}):L.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:r,children:L.jsx(br,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.40/logos/"})}),L.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:i})]}),L.jsx("nav",{className:"pkt-header__actions",children:L.jsxs("ul",{className:"pkt-header__actions-row",children:[N&&L.jsx("li",{children:L.jsx(Fd,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:B,children:"Meny"})}),(h||D)&&L.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${Te&&!re?"pkt-header--open-dropdown":""}`,ref:Ge,children:[L.jsxs("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":Te,onClick:We,children:[L.jsx(br,{name:"user",className:"pkt-btn__icon"}),L.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(D==null?void 0:D.name)||(h==null?void 0:h.name)}),L.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(D==null?void 0:D.shortname)||(h==null?void 0:h.shortname)}),L.jsx(br,{name:"chevron-thin-down",className:"pkt-btn--closed"}),L.jsx(br,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),L.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[h&&L.jsxs("li",{children:[L.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),L.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.lastLoggedIn&&L.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",L.jsx("time",{children:G})]})]}),m&&L.jsx("li",{children:L.jsx("ul",{className:"pkt-list",children:m.map((He,dt)=>L.jsx("li",{children:typeof He.target=="string"?L.jsxs("a",{href:He.target,className:"pkt-link",children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]}):L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]})},`userMenu-${dt}`))})}),(D||$)&&L.jsxs("li",{children:[D&&L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),L.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:D.name}),D.orgNumber&&L.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",D.orgNumber]})]}),L.jsx("ul",{className:"pkt-list mt-size-16",children:$&&L.jsx("li",{children:L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:K,children:[L.jsx(br,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),L.jsx("li",{children:L.jsx("ul",{className:"pkt-list",children:(C||!O)&&L.jsxs(L.Fragment,{children:[C==null?void 0:C.map((He,dt)=>L.jsx("li",{children:typeof He.target=="string"?L.jsxs("a",{href:He.target,className:"pkt-link",children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]}):L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:[He.iconName&&L.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]})},`userOptions-${dt}`)),!O&&L.jsx("li",{children:L.jsxs("button",{className:"pkt-link-button pkt-link",onClick:I,children:[L.jsx(br,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),T&&L.jsx("li",{className:"footer",children:L.jsx("ul",{className:"pkt-list-horizontal bordered",children:T.map((He,dt)=>L.jsx("li",{children:typeof He.target=="string"?L.jsx("a",{href:He.target,className:"pkt-link",children:He.title}):L.jsx("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:He.title})},`userMenuFooter-${dt}`))})})]})]}),Y&&L.jsx("li",{children:Y}),O&&L.jsx("li",{children:L.jsx(Fd,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:I,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),CO=Or({tagName:"pkt-helptext",elementClass:_d,react:$e,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),t_=$e.forwardRef(({children:n,...r},i)=>L.jsx(CO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));t_.displayName="PktHelptext";const n_=$e.forwardRef(({label:n,id:r,children:i,...l},c)=>L.jsxs("div",{className:"pkt-form-group",children:[L.jsx("label",{htmlFor:r,className:"pkt-form-label",children:n}),L.jsx("input",{className:"pkt-form-input",id:r,...l,ref:c}),i]}));n_.displayName="PktInput";const _O=Or({tagName:"pkt-input-wrapper",elementClass:yr,react:$e,displayName:"PktInputWrapper",events:{onToggleHelpText:"toggleHelpText"}}),r_=$e.forwardRef(({children:n,helptext:r,...i},l)=>L.jsxs(_O,{ref:l,...i,children:[L.jsx("div",{className:"pkt-contents",slot:"helptext",children:r}),L.jsx("div",{className:"pkt-contents",children:n})]})),xO=Or({tagName:"pkt-link",elementClass:Ed,react:$e,displayName:"PktLink"}),a_=$e.forwardRef(({children:n,...r},i)=>L.jsx(xO,{...r,ref:i,children:L.jsx("span",{className:"pkt-contents",children:n})}));a_.displayName="PktLink";const EO=Or({tagName:"pkt-linkcard",elementClass:hc,react:$e,displayName:"PktLinkCard",events:{}}),i_=$e.forwardRef(({children:n,...r},i)=>L.jsx(EO,{ref:i,...r,children:L.jsx("div",{className:"pkt-contents",children:n})}));i_.displayName="PktLinkCard";const TO=Or({tagName:"pkt-loader",elementClass:pl,react:$e,displayName:"PktLoader",events:{}}),o_=$e.forwardRef(({children:n,...r},i)=>L.jsx(TO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));o_.displayName="PktLoader";const AO=Or({tagName:"pkt-messagebox",elementClass:Td,react:$e,displayName:"PktMessagebox",events:{onClose:"close"}}),s_=$e.forwardRef(({children:n,...r},i)=>L.jsx(AO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));s_.displayName="PktMessagebox";const FO=Or({tagName:"pkt-modal",elementClass:Qo,react:$e,displayName:"PktModal",events:{}}),l_=$e.forwardRef(({children:n,...r},i)=>L.jsx(FO,{...r,ref:i,children:L.jsx("div",{className:"pkt-contents",children:n})}));l_.displayName="PktModal";/*!
1423
1423
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
1424
1424
  *
1425
1425
  * Copyright (c) 2014-2017, Jon Schlinkert.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-react",
3
- "version": "12.39.8",
3
+ "version": "12.40.0",
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",
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@lit-labs/ssr-dom-shim": "^1.2.1",
40
40
  "@lit/react": "^1.0.7",
41
- "@oslokommune/punkt-elements": "^12.39.8",
41
+ "@oslokommune/punkt-elements": "^12.40.0",
42
42
  "angular-html-parser": "^6.0.2",
43
43
  "html-format": "^1.1.7",
44
44
  "prettier": "^3.3.3",
@@ -49,7 +49,7 @@
49
49
  "devDependencies": {
50
50
  "@babel/plugin-proposal-private-property-in-object": "^7.18.6",
51
51
  "@oslokommune/punkt-assets": "^12.39.2",
52
- "@oslokommune/punkt-css": "^12.39.8",
52
+ "@oslokommune/punkt-css": "^12.40.0",
53
53
  "@testing-library/jest-dom": "^6.5.0",
54
54
  "@testing-library/react": "^16.0.1",
55
55
  "@testing-library/user-event": "^14.5.2",
@@ -112,5 +112,5 @@
112
112
  "url": "https://github.com/oslokommune/punkt/issues"
113
113
  },
114
114
  "license": "MIT",
115
- "gitHead": "9837c1edd0b49ecdc14a46ede9442d30bdb9d908"
115
+ "gitHead": "01a4a75820f2c854bd51a4fa590bedf37e2ce8ce"
116
116
  }