@oslokommune/punkt-react 12.7.3 → 12.8.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 +18 -0
- package/dist/punkt-react.es.js +871 -843
- package/dist/punkt-react.umd.js +3 -3
- package/package.json +4 -4
package/dist/punkt-react.umd.js
CHANGED
|
@@ -100,7 +100,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
100
100
|
* @license
|
|
101
101
|
* Copyright 2017 Google LLC
|
|
102
102
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
103
|
-
*/const ja={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Mr=e=>(...t)=>({_$litDirective$:e,values:t});let Pa=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,n,r){this._$Ct=t,this._$AM=n,this._$Ci=r}_$AS(t,n){return this.update(t,n)}update(t,n){return this.render(...n)}},Tn=class{constructor(t,...n){this.nodes=[],this.host=t,this.host.addController(this),this.slots=n,this.nodes=[]}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{var n;if(t.
|
|
103
|
+
*/const ja={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Mr=e=>(...t)=>({_$litDirective$:e,values:t});let Pa=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,n,r){this._$Ct=t,this._$AM=n,this._$Ci=r}_$AS(t,n){return this.update(t,n)}update(t,n){return this.render(...n)}},Tn=class{constructor(t,...n){this.nodes=[],this.host=t,this.host.addController(this),this.slots=n,this.nodes=[],this.observer=new MutationObserver(r=>this.handleMutations(r))}hostConnected(){this.updateNodes(),this.observer.observe(this.host,{childList:!0})}hostDisconnected(){this.observer.disconnect()}hostUpdated(){this.updateSlots()}updateNodes(){this.nodes=[],Array.from(this.host.childNodes).forEach(t=>{var n;if(t.nodeType===Node.TEXT_NODE&&(n=t.nodeValue)!=null&&n.trim()){const r=document==null?void 0:document.createElement("template");r.content.appendChild(t),this.nodes.push(r)}else this.isSlotElement(t)||this.nodes.push(t)})}updateSlots(){this.slots.forEach(t=>{if(!t.value)return;const n=t.value.getAttribute("name"),r=this.nodes.flatMap(i=>i.getAttribute&&i.getAttribute("slot")==n?this.nodeFromElement(i,t):[]).filter(i=>t.value&&!t.value.contains(i)&&!i.contains(t.value));r.length>0&&t.value.replaceChildren(...r)})}handleMutations(t){let n=!1;t.forEach(r=>{r.type==="childList"&&(r.addedNodes.forEach(i=>{var o;const u=i.nodeType===Node.ELEMENT_NODE&&!this.isSlotElement(i),c=i.nodeType===Node.TEXT_NODE&&((o=i.nodeValue)==null?void 0:o.trim());if(u)this.nodes.push(i),n=!0;else if(c){const d=document==null?void 0:document.createElement("template");d.content.appendChild(i),this.nodes.push(d),n=!0}}),r.removedNodes.forEach(i=>{this.nodes=this.nodes.filter(o=>o!==i),n=!0}))}),n&&this.updateSlots()}isSlotElement(t){return this.slots.some(n=>n.value===t)}nodeFromElement(t,n){var r;return t===((r=n.value)==null?void 0:r.parentNode)?[]:t instanceof HTMLTemplateElement?Array.from(t.content.childNodes):[t]}};/**
|
|
104
104
|
* @license
|
|
105
105
|
* Copyright 2020 Google LLC
|
|
106
106
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -124,7 +124,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
124
124
|
* @license
|
|
125
125
|
* Copyright 2017 Google LLC
|
|
126
126
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
127
|
-
*/class ns extends Oa{}ns.directiveName="unsafeSVG",ns.resultType=2;const jl=Mr(ns);var Rh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Hr=(e,t,n,r)=>{for(var i=r>1?void 0:r?qh(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Rh(t,n,i),i};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/12.
|
|
127
|
+
*/class ns extends Oa{}ns.directiveName="unsafeSVG",ns.resultType=2;const jl=Mr(ns);var Rh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Hr=(e,t,n,r)=>{for(var i=r>1?void 0:r?qh(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Rh(t,n,i),i};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/12.8/icons/";const Hh=e=>new Promise(t=>setTimeout(t,e)),Ma='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',rs={},Uh=async(e,t)=>{let n=0;for(;rs[t+e+".svg"]==="fetching"&&(n++,!(n>50));)await Hh(50);return localStorage.getItem(t+e+".svg")?Promise.resolve(localStorage.getItem(t+e+".svg")):typeof window.pktFetch=="function"?(rs[t+e+".svg"]="fetching",Promise.resolve(window.pktFetch(t+e+".svg").then(r=>r.ok?r.text():(console.error("Missing icon: "+t+e+".svg"),Ma)).then(r=>(r!==Ma&&localStorage.setItem(t+e+".svg",r),rs[t+e+".svg"]="fetched",r)))):Promise.resolve(Ma)};let Nn=class extends Bt{constructor(){super(...arguments),this.path=window.pktIconPath,this.name="",this.icon=jl(Ma),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,n,r){super.attributeChangedCallback(t,n,r),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){this._updatedProps.length>0?(this.path||(this.path,window.pktIconPath),this.icon=jl(await Uh(this.name||"",this.path).then(n=>n)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return K`${this.name&&this.icon}`}};Hr([O({type:String,reflect:!1})],Nn.prototype,"path",2),Hr([O({type:String,reflect:!0})],Nn.prototype,"name",2),Hr([O({type:SVGElement})],Nn.prototype,"icon",2),Hr([O({type:Array,noAccessor:!0})],Nn.prototype,"_updatedProps",2),Nn=Hr([Ot("pkt-icon")],Nn);const Wh="pkt-alert",Vh=!0,zh={onClose:{description:"React: Klikk-event for 'Lukk'-knappen"},close:{description:"Vue: Klikk-event for 'Lukk'-knappen"}},Gh={title:{name:"Tittel",description:"Tittelen som vises øverst i på meldingen",type:"string"},skin:{name:"Utseende",description:"Hvordan type melding er dette?",type:["info","success","warning","error"],default:"info"},date:{name:"Sist oppdatert",description:"Dato som vises nederst i på meldingen",type:"string"},ariaLive:{name:"aria-live",description:"Hvordan skal skjermleseren lese opp meldingen?",type:["off","polite","assertive"],default:"polite"},compact:{name:"Kompakt",description:"Gjør meldingen mindre",type:"boolean",default:!1},closeAlert:{name:"Vis 'Lukk'-knapp",description:"Viser 'Lukk'-knappen",type:"boolean",default:!1}},Yh={default:{description:"Innholdet i meldingen"}},Ra={name:Wh,"css-class":"pkt-alert","dark-mode":!0,isElement:Vh,events:zh,props:Gh,slots:Yh};var Kh=Object.defineProperty,Jh=Object.getOwnPropertyDescriptor,pn=(e,t,n,r)=>{for(var i=r>1?void 0:r?Jh(t,n):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=(r?u(t,n,i):u(i))||i);return r&&i&&Kh(t,n,i),i};let It=class extends Bt{constructor(){super(),this.defaultSlot=vt(),this.compact=Ra.props.compact.default,this.title="",this.skin=Ra.props.skin.default,this.ariaLive=Ra.props.ariaLive.default,this.closeAlert=Ra.props.closeAlert.default,this.date=null,this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new Tn(this,this.defaultSlot),this._isClosed=!1}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed};return K`
|
|
128
128
|
<div class=${He(t)} aria-live=${this.ariaLive}>
|
|
129
129
|
<pkt-icon
|
|
130
130
|
class="pkt-alert__icon"
|
|
@@ -547,7 +547,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
547
547
|
Copyright (c) 2018 Jed Watson.
|
|
548
548
|
Licensed under the MIT License (MIT), see
|
|
549
549
|
http://jedwatson.github.io/classnames
|
|
550
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",u=0;u<arguments.length;u++){var c=arguments[u];c&&(o=i(o,r(c)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var u="";for(var c in o)t.call(o,c)&&o[c]&&(u=i(u,c));return u}function i(o,u){return u?o?o+" "+u:o+u:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Jl);var Xm=Jl.exports;const Xe=Ea(Xm),Qm=M.forwardRef(({title:e,className:t,children:n,toggleProps:r,defaultOpen:i=!1,id:o},u)=>{const[c,d]=M.useState(i),h=r?r.isOpen:c,m=b=>b??void 0,v=(b,k)=>{b.preventDefault(),r!==void 0&&r.onToggleClick(b,k),d(!h)},y=Xe(t,"pkt-accordion-item");return g.jsxs("details",{className:y,ref:u,id:o,open:m(r?r.isOpen:c),children:[g.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${o}`,onClick:b=>v(b,o),children:[e,g.jsx(ce,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),g.jsx("div",{id:`pkt-accordion-item-content-${o}`,role:"region",className:"pkt-accordion-item__content",children:n})]})}),Zm=Sn({tagName:"pkt-alert",elementClass:It,react:M,displayName:"PktAlert",events:{onClose:"close"}}),us=M.forwardRef(({children:e,...t},n)=>g.jsx(Zm,{ref:n,...t,children:g.jsx("div",{className:"pkt-contents",children:e})}));us.displayName="PktAlert";const Xl=M.forwardRef(({href:e,text:t,onClick:n,className:r,...i},o)=>{const u=[r,"pkt-back-link"].filter(Boolean).join(" "),c=d=>{n&&n(d)};return g.jsx("nav",{ref:o,className:u,"aria-label":"Gå tilbake et steg",children:g.jsxs("a",{href:e||"/",className:"pkt-link pkt-link--icon-left",onClick:c,...i,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),g.jsx("span",{className:"pkt-back-link__text",children:t||"Forsiden"})]})})});Xl.displayName="PktBackLink";const eg=M.forwardRef(({breadcrumbs:e,navigationType:t,className:n,...r},i)=>{const o=e.slice(0,4),u=o[o.length-2],c=[n,"pkt-breadcrumbs"].filter(Boolean).join(" ");return g.jsxs("nav",{ref:i,"aria-label":"brødsmulemeny",className:c,children:[g.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:o.map((d,h)=>g.jsx("li",{className:"pkt-breadcrumbs__item",children:h===o.length-1?g.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?g.jsxs(xn.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...r,children:[g.jsx(ce,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):g.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...r,children:[g.jsx(ce,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${h}`))}),t==="router"?g.jsxs(xn.Link,{to:u.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...r,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:u.text})]}):g.jsxs("a",{href:u.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...r,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:u.text})]})]})}),In=M.forwardRef(({children:e,className:t,iconName:n="user",secondIconName:r="user",size:i="medium",skin:o="primary",type:u="button",variant:c="label-only",state:d,color:h,isLoading:m=!1,...v},y)=>{const b=[t,"pkt-btn",i&&`pkt-btn--${i}`,o&&`pkt-btn--${o}`,c&&`pkt-btn--${c}`,h&&`pkt-btn--${h}`,m&&"pkt-btn--active",d&&`pkt-btn--${d}`].filter(Boolean).join(" ");return g.jsxs("button",{...v,className:b,type:u,ref:y,children:[m&&g.jsx(ce,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:"https://punkt-cdn.oslo.kommune.no/12.7/animations/"}),c!=="label-only"&&g.jsx(ce,{className:"pkt-btn__icon",name:n}),g.jsx("span",{className:"pkt-btn__text",children:e}),c==="icons-right-and-left"&&g.jsx(ce,{className:"pkt-btn__icon",name:r})]})});In.displayName="PktButton";const tg=Sn({tagName:"pkt-card",elementClass:Jt,react:M,displayName:"PktCard",events:{}}),Ql=M.forwardRef(({children:e,...t},n)=>g.jsx(tg,{...t,ref:n,children:g.jsx("div",{className:"pkt-contents",children:e})}));Ql.displayName="PktCard";const Ua=M.forwardRef(({id:e,hasTile:t=!1,disabled:n=!1,label:r,labelPosition:i="right",hideLabel:o=!1,checkHelptext:u,hasError:c=!1,isSwitch:d=!1,className:h,...m},v)=>{const y=[h,"pkt-input-check"].filter(Boolean).join(" ");return g.jsx("div",{className:y,children:g.jsxs("div",{className:`pkt-input-check__input ${t?"pkt-input-check__input--tile":""} ${n&&t?"pkt-input-check__input--tile-disabled":""}`,children:[r&&i==="left"&&g.jsxs("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[r,u&&g.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]}),g.jsx("input",{ref:v,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",role:d?"switch":"checkbox",id:e,disabled:n,...m}),r&&i==="right"&&g.jsxs("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[r,u&&g.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]})]})})});Ua.displayName="PktCheckbox";const Zl=Sn({tagName:"pkt-datepicker",elementClass:Ie,react:M,displayName:"PktDatepicker",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),ng=({columnOne:e,columnTwo:t,socialLinks:n,className:r,personvernOgInfoLink:i="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:o="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var c,d;const u=[r,"pkt-footer"].filter(Boolean).join(" ");return g.jsx("footer",{className:u,"data-mode":"dark",children:g.jsxs("div",{className:"pkt-footer__container",children:[g.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:e.title}),g.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&g.jsx("li",{className:"pkt-footer__text",children:e.text}),(c=e.links)==null?void 0:c.map((h,m)=>g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:`pkt-footer__link ${h.external?"pkt-link--external":""}`,href:h.href,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),h.text]})},`links-${m}`))]})]}),g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:t.title}),g.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&g.jsx("li",{className:"pkt-footer__text",children:t.text}),(d=t.links)==null?void 0:d.map((h,m)=>g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:`pkt-footer__link ${h.external?"pkt-link--external":""}`,href:h.href,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),h.text]})},`links-${m}`))]})]}),g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),g.jsxs("ul",{className:"pkt-footer__list",children:[g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:"pkt-footer__link",href:i,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:"pkt-footer__link",href:o,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),n&&g.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[g.jsx("div",{className:"pkt-footer__social-languages",children:n.filter(h=>h.language).map((h,m)=>g.jsx("div",{className:"pkt-footer__social-language",children:g.jsx("a",{href:h.href,"aria-label":`til ${h.language} versjon av nettsiden`,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:h.language})},`sociallinks-language-${m}`))}),g.jsx("div",{className:"pkt-footer__social-icons",children:n.filter(h=>h.iconName).map((h,m)=>g.jsx(M.Fragment,{children:g.jsx("a",{href:h.href,"aria-label":`til ${h.iconName}`,className:"pkt-footer__social-icon-link",target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:g.jsx(ce,{className:"pkt-footer__social-icon",name:h.iconName})})},`sociallinks-${m}`))})]})]})})},rg=({links:e=[],personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:n="https://www.oslo.kommune.no/tilgjengelighet/",className:r})=>{const i=[r,"pkt-footer-simple"].filter(Boolean).join(" ");return g.jsx("footer",{className:i,"data-mode":"dark",children:g.jsx("div",{className:"pkt-footer-simple__container",children:g.jsxs("ul",{className:"pkt-footer-simple__list",children:[e.map((o,u)=>g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:`pkt-footer-simple__link ${o.external?" pkt-link--external":""}`,href:o.href,target:o.openInNewTab?"_blank":"_self",rel:o.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),o.text]})},u)),g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:"pkt-footer-simple__link",href:t,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:"pkt-footer-simple__link",href:n,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})},ag=M.forwardRef(({className:e,logoLink:t="https://www.oslo.kommune.no/",serviceName:n,fixed:r=!0,scrollToHide:i=!0,user:o,userMenu:u,representing:c,userOptions:d,userMenuFooter:h,canChangeRepresentation:m=!0,showMenuButton:v=!1,showLogOutButton:y=!1,openMenu:b,logOut:k,changeRepresentation:x,children:C,...T},F)=>{const S=M.useMemo(()=>typeof(o==null?void 0:o.lastLoggedIn)=="string"?o.lastLoggedIn:o!=null&&o.lastLoggedIn?new Date(o.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[o]),[A,_]=M.useState(!1),[$,P]=M.useState(0),[I,j]=M.useState(!1),V=M.useRef(null);M.useEffect(()=>(document&&(document.addEventListener("mouseup",G),window.addEventListener("scroll",L)),()=>{document&&(document.removeEventListener("mouseup",G),window.removeEventListener("scroll",L))}));const J=()=>{j(!I)},G=N=>{V.current&&!V.current.contains(N.target)&&j(!1)},L=()=>{if(i){const N=window.pageYOffset||document.documentElement.scrollTop;if(N<0||Math.abs(N-$)<60)return;_(N>$),P(N)}};return g.jsxs("header",{...T,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:Xe(e,"pkt-header",{"pkt-header--fixed":r,"pkt-header--scroll-to-hide":i,"pkt-header--hidden":A}),ref:F,children:[g.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?g.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:g.jsx(ce,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.7/logos/"})}):g.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:g.jsx(ce,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.7/logos/"})}),g.jsx("span",{className:"pkt-header__logo-service",children:n})]}),g.jsx("nav",{className:"pkt-header__actions",children:g.jsxs("ul",{className:"pkt-header__actions-row",children:[v&&g.jsx("li",{children:g.jsx(In,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:b,children:"Meny"})}),(o||c)&&g.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${I&&!A?"pkt-header--open-dropdown":""}`,ref:V,children:[g.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":I,onClick:J,children:[g.jsx(ce,{name:"user",className:"pkt-btn__icon"}),g.jsx("span",{className:"pkt-header__user-fullname",children:(c==null?void 0:c.name)||(o==null?void 0:o.name)}),g.jsx("span",{className:"pkt-header__user-shortname",children:(c==null?void 0:c.shortname)||(o==null?void 0:o.shortname)}),g.jsx(ce,{name:"chevron-thin-down",className:"pkt-btn--closed"}),g.jsx(ce,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),g.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[o&&g.jsxs("li",{children:[g.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),g.jsx("div",{className:"pkt-user-menu__name",children:o.name}),o.lastLoggedIn&&g.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",g.jsx("time",{children:S})]})]}),u&&g.jsx("li",{children:g.jsx("ul",{className:"pkt-list",children:u.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsxs("a",{href:N.target,className:"pkt-link",children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userMenu-${H}`))})}),(c||m)&&g.jsxs("li",{children:[c&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),g.jsx("div",{className:"pkt-user-menu__name",children:c.name}),c.orgNumber&&g.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",c.orgNumber]})]}),g.jsx("ul",{className:"pkt-list mt-size-16",children:m&&g.jsx("li",{children:g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:x,children:[g.jsx(ce,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),g.jsx("li",{children:g.jsx("ul",{className:"pkt-list",children:(d||!y)&&g.jsxs(g.Fragment,{children:[d==null?void 0:d.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsxs("a",{href:N.target,className:"pkt-link",children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userOptions-${H}`)),!y&&g.jsx("li",{children:g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:k,children:[g.jsx(ce,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),h&&g.jsx("li",{className:"footer",children:g.jsx("ul",{className:"pkt-list-horizontal bordered",children:h.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsx("a",{href:N.target,className:"pkt-link",children:N.title}):g.jsx("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:N.title})},`userMenuFooter-${H}`))})})]})]}),C&&g.jsx("li",{children:C}),y&&g.jsx("li",{children:g.jsx(In,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:k,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),eu=M.forwardRef(({label:e,id:t,children:n,...r},i)=>g.jsxs("div",{className:"pkt-form-group",children:[g.jsx("label",{htmlFor:t,className:"pkt-form-label",children:e}),g.jsx("input",{className:"pkt-form-input",id:t,...r,ref:i}),n]}));eu.displayName="PktInput";const ur=M.forwardRef(({forId:e,label:t,helptext:n,helptextDropdown:r,helptextDropdownButton:i,counter:o,counterCurrent:u,counterMaxLength:c,optionalTag:d=!1,optionalText:h="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",hasError:y,errorMessage:b,disabled:k,inline:x,ariaDescribedby:C,useWrapper:T=!0,children:F,className:S,hasFieldset:A=!1},_)=>{const[$,P]=M.useState(!1),I=()=>{P(!$)},j=()=>d?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":m?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",V=d?h:m?v:"",J=k?"pkt-inputwrapper--disabled":"",G=x?"pkt-inputwrapper--inline":"",L=y?"pkt-inputwrapper--error":"",N=!!r&&r!=="",H=i||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',Q=A?"fieldset":N?"div":"label",fe=A?"legend":N?"h2":"span",Z=C||(n?`${e}-helptext`:void 0);return g.jsxs("div",{className:["pkt-inputwrapper",S,J,G,L].join(" "),ref:_,children:[T?g.jsx(g.Fragment,{children:g.jsxs(Q,{htmlFor:A?void 0:e,"aria-describedby":N?void 0:C,className:`pkt-inputwrapper__label${A?" pkt-inputwrapper__fieldset":""}`,children:[g.jsxs(fe,{id:`${e}-label`,className:`${A?" pkt-inputwrapper__legend":""}`,children:[t,V!==""&&g.jsx("span",{className:j(),children:V})]}),n&&g.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,children:n}),N&&r!==""&&g.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[g.jsx(In,{skin:"tertiary",size:"small",variant:"icon-right",iconName:$?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:I,children:g.jsx("span",{dangerouslySetInnerHTML:{__html:H}})}),g.jsx("div",{className:`pkt-inputwrapper__helptext ${$?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:r}),!A&&g.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":Z,children:t})]}),g.jsx(g.Fragment,{children:F}),o&&g.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[u||0,c&&`/${c}`]})]})}):g.jsxs(g.Fragment,{children:[!A&&g.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":Z,id:`${e}-label`,children:t}),F]}),y&&b&&g.jsx("div",{children:g.jsx(us,{skin:"error","aria-live":"assertive",id:`${e}-error`,compact:!0,children:b})})]})});ur.displayName="PktInputWrapper";const ig=Sn({tagName:"pkt-link",elementClass:hn,react:M,displayName:"PktLink",events:{onClick:"click"}}),tu=M.forwardRef(({children:e,...t},n)=>g.jsx(ig,{...t,ref:n,children:g.jsx("span",{className:"pkt-contents",children:e})}));tu.displayName="PktLink";const nu=M.forwardRef(({children:e,className:t,iconName:n,openInNewTab:r=!1,skin:i="normal",href:o="#",external:u=!1,title:c,...d},h)=>{const m=[t,"pkt-linkcard",i&&`pkt-linkcard--${i}`].filter(Boolean).join(" ");return g.jsxs("a",{...d,href:o,className:`pkt-linkcard pkt-link ${m}`,target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,ref:h,children:[n&&g.jsx(ce,{className:"pkt-link__icon",name:n}),g.jsx("div",{className:`pkt-linkcard__title ${u?"pkt-link pkt-link--external":""}`,children:c}),g.jsx("div",{className:"pkt-linkcard__text",children:e})]})});nu.displayName="PktLinkCard";const ru=M.forwardRef(({className:e,message:t,size:n="medium",inline:r=!1,isLoading:i=!0,variant:o="rainbow",delay:u=0,children:c,...d},h)=>{const m=`pkt-loader pkt-loader--${n}`,[v,y]=M.useState(!(u>0));u>0&&setTimeout(()=>{y(!0)},u);const b=k=>k==="shapes"?"loader":k==="blue"?"spinner-blue":"spinner";return g.jsx("div",{role:"status","aria-live":"polite","aria-busy":i,className:`pkt-loader--${r?"inline":"box"} ${e||""}`,children:i?g.jsx(g.Fragment,{children:v?g.jsxs("div",{className:m,"data-testid":"pkt-loader",ref:h,...d,children:[g.jsx(ce,{name:b(o),path:"https://punkt-cdn.oslo.kommune.no/12.7/animations/",className:`pkt-loader__svg pkt-loader__${o}`}),t&&g.jsx("p",{children:t})]}):null}):c})});ru.displayName="PktLoader";const sg=Sn({tagName:"pkt-messagebox",elementClass:fn,react:M,displayName:"PktMessagebox",events:{onClose:"close"}}),au=M.forwardRef(({children:e,...t},n)=>g.jsx(sg,{...t,ref:n,children:g.jsx("div",{className:"pkt-contents",children:e})}));au.displayName="PktMessagebox";/*!
|
|
550
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",u=0;u<arguments.length;u++){var c=arguments[u];c&&(o=i(o,r(c)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var u="";for(var c in o)t.call(o,c)&&o[c]&&(u=i(u,c));return u}function i(o,u){return u?o?o+" "+u:o+u:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Jl);var Xm=Jl.exports;const Xe=Ea(Xm),Qm=M.forwardRef(({title:e,className:t,children:n,toggleProps:r,defaultOpen:i=!1,id:o},u)=>{const[c,d]=M.useState(i),h=r?r.isOpen:c,m=b=>b??void 0,v=(b,k)=>{b.preventDefault(),r!==void 0&&r.onToggleClick(b,k),d(!h)},y=Xe(t,"pkt-accordion-item");return g.jsxs("details",{className:y,ref:u,id:o,open:m(r?r.isOpen:c),children:[g.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${o}`,onClick:b=>v(b,o),children:[e,g.jsx(ce,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),g.jsx("div",{id:`pkt-accordion-item-content-${o}`,role:"region",className:"pkt-accordion-item__content",children:n})]})}),Zm=Sn({tagName:"pkt-alert",elementClass:It,react:M,displayName:"PktAlert",events:{onClose:"close"}}),us=M.forwardRef(({children:e,...t},n)=>g.jsx(Zm,{ref:n,...t,children:g.jsx("div",{className:"pkt-contents",children:e})}));us.displayName="PktAlert";const Xl=M.forwardRef(({href:e,text:t,onClick:n,className:r,...i},o)=>{const u=[r,"pkt-back-link"].filter(Boolean).join(" "),c=d=>{n&&n(d)};return g.jsx("nav",{ref:o,className:u,"aria-label":"Gå tilbake et steg",children:g.jsxs("a",{href:e||"/",className:"pkt-link pkt-link--icon-left",onClick:c,...i,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),g.jsx("span",{className:"pkt-back-link__text",children:t||"Forsiden"})]})})});Xl.displayName="PktBackLink";const eg=M.forwardRef(({breadcrumbs:e,navigationType:t,className:n,...r},i)=>{const o=e.slice(0,4),u=o[o.length-2],c=[n,"pkt-breadcrumbs"].filter(Boolean).join(" ");return g.jsxs("nav",{ref:i,"aria-label":"brødsmulemeny",className:c,children:[g.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:o.map((d,h)=>g.jsx("li",{className:"pkt-breadcrumbs__item",children:h===o.length-1?g.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?g.jsxs(xn.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...r,children:[g.jsx(ce,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):g.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...r,children:[g.jsx(ce,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${h}`))}),t==="router"?g.jsxs(xn.Link,{to:u.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...r,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:u.text})]}):g.jsxs("a",{href:u.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...r,children:[g.jsx(ce,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),g.jsx("span",{className:"pkt-breadcrumbs__text",children:u.text})]})]})}),In=M.forwardRef(({children:e,className:t,iconName:n="user",secondIconName:r="user",size:i="medium",skin:o="primary",type:u="button",variant:c="label-only",state:d,color:h,isLoading:m=!1,...v},y)=>{const b=[t,"pkt-btn",i&&`pkt-btn--${i}`,o&&`pkt-btn--${o}`,c&&`pkt-btn--${c}`,h&&`pkt-btn--${h}`,m&&"pkt-btn--active",d&&`pkt-btn--${d}`].filter(Boolean).join(" ");return g.jsxs("button",{...v,className:b,type:u,ref:y,children:[m&&g.jsx(ce,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:"https://punkt-cdn.oslo.kommune.no/12.8/animations/"}),c!=="label-only"&&g.jsx(ce,{className:"pkt-btn__icon",name:n}),g.jsx("span",{className:"pkt-btn__text",children:e}),c==="icons-right-and-left"&&g.jsx(ce,{className:"pkt-btn__icon",name:r})]})});In.displayName="PktButton";const tg=Sn({tagName:"pkt-card",elementClass:Jt,react:M,displayName:"PktCard",events:{}}),Ql=M.forwardRef(({children:e,...t},n)=>g.jsx(tg,{...t,ref:n,children:g.jsx("div",{className:"pkt-contents",children:e})}));Ql.displayName="PktCard";const Ua=M.forwardRef(({id:e,hasTile:t=!1,disabled:n=!1,label:r,labelPosition:i="right",hideLabel:o=!1,checkHelptext:u,hasError:c=!1,isSwitch:d=!1,className:h,...m},v)=>{const y=[h,"pkt-input-check"].filter(Boolean).join(" ");return g.jsx("div",{className:y,children:g.jsxs("div",{className:`pkt-input-check__input ${t?"pkt-input-check__input--tile":""} ${n&&t?"pkt-input-check__input--tile-disabled":""}`,children:[r&&i==="left"&&g.jsxs("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[r,u&&g.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]}),g.jsx("input",{ref:v,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",role:d?"switch":"checkbox",id:e,disabled:n,...m}),r&&i==="right"&&g.jsxs("label",{className:`pkt-input-check__input-label ${o?"pkt-sr-only":""}`,htmlFor:e,children:[r,u&&g.jsx("div",{className:"pkt-input-check__input-helptext",children:u})]})]})})});Ua.displayName="PktCheckbox";const Zl=Sn({tagName:"pkt-datepicker",elementClass:Ie,react:M,displayName:"PktDatepicker",events:{onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),ng=({columnOne:e,columnTwo:t,socialLinks:n,className:r,personvernOgInfoLink:i="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:o="https://www.oslo.kommune.no/tilgjengelighet/"})=>{var c,d;const u=[r,"pkt-footer"].filter(Boolean).join(" ");return g.jsx("footer",{className:u,"data-mode":"dark",children:g.jsxs("div",{className:"pkt-footer__container",children:[g.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:e.title}),g.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&g.jsx("li",{className:"pkt-footer__text",children:e.text}),(c=e.links)==null?void 0:c.map((h,m)=>g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:`pkt-footer__link ${h.external?"pkt-link--external":""}`,href:h.href,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),h.text]})},`links-${m}`))]})]}),g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:t.title}),g.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&g.jsx("li",{className:"pkt-footer__text",children:t.text}),(d=t.links)==null?void 0:d.map((h,m)=>g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:`pkt-footer__link ${h.external?"pkt-link--external":""}`,href:h.href,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),h.text]})},`links-${m}`))]})]}),g.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[g.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),g.jsxs("ul",{className:"pkt-footer__list",children:[g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:"pkt-footer__link",href:i,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),g.jsx("li",{className:"pkt-footer__list-item",children:g.jsxs("a",{className:"pkt-footer__link",href:o,children:[g.jsx(ce,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})]})]}),n&&g.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[g.jsx("div",{className:"pkt-footer__social-languages",children:n.filter(h=>h.language).map((h,m)=>g.jsx("div",{className:"pkt-footer__social-language",children:g.jsx("a",{href:h.href,"aria-label":`til ${h.language} versjon av nettsiden`,target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:h.language})},`sociallinks-language-${m}`))}),g.jsx("div",{className:"pkt-footer__social-icons",children:n.filter(h=>h.iconName).map((h,m)=>g.jsx(M.Fragment,{children:g.jsx("a",{href:h.href,"aria-label":`til ${h.iconName}`,className:"pkt-footer__social-icon-link",target:h.openInNewTab?"_blank":"_self",rel:h.openInNewTab?"noopener noreferrer":void 0,children:g.jsx(ce,{className:"pkt-footer__social-icon",name:h.iconName})})},`sociallinks-${m}`))})]})]})})},rg=({links:e=[],personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:n="https://www.oslo.kommune.no/tilgjengelighet/",className:r})=>{const i=[r,"pkt-footer-simple"].filter(Boolean).join(" ");return g.jsx("footer",{className:i,"data-mode":"dark",children:g.jsx("div",{className:"pkt-footer-simple__container",children:g.jsxs("ul",{className:"pkt-footer-simple__list",children:[e.map((o,u)=>g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:`pkt-footer-simple__link ${o.external?" pkt-link--external":""}`,href:o.href,target:o.openInNewTab?"_blank":"_self",rel:o.openInNewTab?"noopener noreferrer":void 0,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),o.text]})},u)),g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:"pkt-footer-simple__link",href:t,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),g.jsx("li",{className:"pkt-footer-simple__list-item",children:g.jsxs("a",{className:"pkt-footer-simple__link",href:n,children:[g.jsx(ce,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})})]})})})},ag=M.forwardRef(({className:e,logoLink:t="https://www.oslo.kommune.no/",serviceName:n,fixed:r=!0,scrollToHide:i=!0,user:o,userMenu:u,representing:c,userOptions:d,userMenuFooter:h,canChangeRepresentation:m=!0,showMenuButton:v=!1,showLogOutButton:y=!1,openMenu:b,logOut:k,changeRepresentation:x,children:C,...T},F)=>{const S=M.useMemo(()=>typeof(o==null?void 0:o.lastLoggedIn)=="string"?o.lastLoggedIn:o!=null&&o.lastLoggedIn?new Date(o.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[o]),[A,_]=M.useState(!1),[$,P]=M.useState(0),[I,j]=M.useState(!1),V=M.useRef(null);M.useEffect(()=>(document&&(document.addEventListener("mouseup",G),window.addEventListener("scroll",L)),()=>{document&&(document.removeEventListener("mouseup",G),window.removeEventListener("scroll",L))}));const J=()=>{j(!I)},G=N=>{V.current&&!V.current.contains(N.target)&&j(!1)},L=()=>{if(i){const N=window.pageYOffset||document.documentElement.scrollTop;if(N<0||Math.abs(N-$)<60)return;_(N>$),P(N)}};return g.jsxs("header",{...T,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:Xe(e,"pkt-header",{"pkt-header--fixed":r,"pkt-header--scroll-to-hide":i,"pkt-header--hidden":A}),ref:F,children:[g.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?g.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:g.jsx(ce,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.8/logos/"})}):g.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:g.jsx(ce,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.8/logos/"})}),g.jsx("span",{className:"pkt-header__logo-service",children:n})]}),g.jsx("nav",{className:"pkt-header__actions",children:g.jsxs("ul",{className:"pkt-header__actions-row",children:[v&&g.jsx("li",{children:g.jsx(In,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:b,children:"Meny"})}),(o||c)&&g.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${I&&!A?"pkt-header--open-dropdown":""}`,ref:V,children:[g.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":I,onClick:J,children:[g.jsx(ce,{name:"user",className:"pkt-btn__icon"}),g.jsx("span",{className:"pkt-header__user-fullname",children:(c==null?void 0:c.name)||(o==null?void 0:o.name)}),g.jsx("span",{className:"pkt-header__user-shortname",children:(c==null?void 0:c.shortname)||(o==null?void 0:o.shortname)}),g.jsx(ce,{name:"chevron-thin-down",className:"pkt-btn--closed"}),g.jsx(ce,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),g.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[o&&g.jsxs("li",{children:[g.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),g.jsx("div",{className:"pkt-user-menu__name",children:o.name}),o.lastLoggedIn&&g.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",g.jsx("time",{children:S})]})]}),u&&g.jsx("li",{children:g.jsx("ul",{className:"pkt-list",children:u.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsxs("a",{href:N.target,className:"pkt-link",children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userMenu-${H}`))})}),(c||m)&&g.jsxs("li",{children:[c&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),g.jsx("div",{className:"pkt-user-menu__name",children:c.name}),c.orgNumber&&g.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",c.orgNumber]})]}),g.jsx("ul",{className:"pkt-list mt-size-16",children:m&&g.jsx("li",{children:g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:x,children:[g.jsx(ce,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),g.jsx("li",{children:g.jsx("ul",{className:"pkt-list",children:(d||!y)&&g.jsxs(g.Fragment,{children:[d==null?void 0:d.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsxs("a",{href:N.target,className:"pkt-link",children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&g.jsx(ce,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userOptions-${H}`)),!y&&g.jsx("li",{children:g.jsxs("button",{className:"pkt-link-button pkt-link",onClick:k,children:[g.jsx(ce,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),h&&g.jsx("li",{className:"footer",children:g.jsx("ul",{className:"pkt-list-horizontal bordered",children:h.map((N,H)=>g.jsx("li",{children:typeof N.target=="string"?g.jsx("a",{href:N.target,className:"pkt-link",children:N.title}):g.jsx("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:N.title})},`userMenuFooter-${H}`))})})]})]}),C&&g.jsx("li",{children:C}),y&&g.jsx("li",{children:g.jsx(In,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:k,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),eu=M.forwardRef(({label:e,id:t,children:n,...r},i)=>g.jsxs("div",{className:"pkt-form-group",children:[g.jsx("label",{htmlFor:t,className:"pkt-form-label",children:e}),g.jsx("input",{className:"pkt-form-input",id:t,...r,ref:i}),n]}));eu.displayName="PktInput";const ur=M.forwardRef(({forId:e,label:t,helptext:n,helptextDropdown:r,helptextDropdownButton:i,counter:o,counterCurrent:u,counterMaxLength:c,optionalTag:d=!1,optionalText:h="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",hasError:y,errorMessage:b,disabled:k,inline:x,ariaDescribedby:C,useWrapper:T=!0,children:F,className:S,hasFieldset:A=!1},_)=>{const[$,P]=M.useState(!1),I=()=>{P(!$)},j=()=>d?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":m?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",V=d?h:m?v:"",J=k?"pkt-inputwrapper--disabled":"",G=x?"pkt-inputwrapper--inline":"",L=y?"pkt-inputwrapper--error":"",N=!!r&&r!=="",H=i||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',Q=A?"fieldset":N?"div":"label",fe=A?"legend":N?"h2":"span",Z=C||(n?`${e}-helptext`:void 0);return g.jsxs("div",{className:["pkt-inputwrapper",S,J,G,L].join(" "),ref:_,children:[T?g.jsx(g.Fragment,{children:g.jsxs(Q,{htmlFor:A?void 0:e,"aria-describedby":N?void 0:C,className:`pkt-inputwrapper__label${A?" pkt-inputwrapper__fieldset":""}`,children:[g.jsxs(fe,{id:`${e}-label`,className:`${A?" pkt-inputwrapper__legend":""}`,children:[t,V!==""&&g.jsx("span",{className:j(),children:V})]}),n&&g.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,children:n}),N&&r!==""&&g.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[g.jsx(In,{skin:"tertiary",size:"small",variant:"icon-right",iconName:$?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:I,children:g.jsx("span",{dangerouslySetInnerHTML:{__html:H}})}),g.jsx("div",{className:`pkt-inputwrapper__helptext ${$?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:r}),!A&&g.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":Z,children:t})]}),g.jsx(g.Fragment,{children:F}),o&&g.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[u||0,c&&`/${c}`]})]})}):g.jsxs(g.Fragment,{children:[!A&&g.jsx("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":Z,id:`${e}-label`,children:t}),F]}),y&&b&&g.jsx("div",{children:g.jsx(us,{skin:"error","aria-live":"assertive",id:`${e}-error`,compact:!0,children:b})})]})});ur.displayName="PktInputWrapper";const ig=Sn({tagName:"pkt-link",elementClass:hn,react:M,displayName:"PktLink",events:{onClick:"click"}}),tu=M.forwardRef(({children:e,...t},n)=>g.jsx(ig,{...t,ref:n,children:g.jsx("span",{className:"pkt-contents",children:e})}));tu.displayName="PktLink";const nu=M.forwardRef(({children:e,className:t,iconName:n,openInNewTab:r=!1,skin:i="normal",href:o="#",external:u=!1,title:c,...d},h)=>{const m=[t,"pkt-linkcard",i&&`pkt-linkcard--${i}`].filter(Boolean).join(" ");return g.jsxs("a",{...d,href:o,className:`pkt-linkcard pkt-link ${m}`,target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,ref:h,children:[n&&g.jsx(ce,{className:"pkt-link__icon",name:n}),g.jsx("div",{className:`pkt-linkcard__title ${u?"pkt-link pkt-link--external":""}`,children:c}),g.jsx("div",{className:"pkt-linkcard__text",children:e})]})});nu.displayName="PktLinkCard";const ru=M.forwardRef(({className:e,message:t,size:n="medium",inline:r=!1,isLoading:i=!0,variant:o="rainbow",delay:u=0,children:c,...d},h)=>{const m=`pkt-loader pkt-loader--${n}`,[v,y]=M.useState(!(u>0));u>0&&setTimeout(()=>{y(!0)},u);const b=k=>k==="shapes"?"loader":k==="blue"?"spinner-blue":"spinner";return g.jsx("div",{role:"status","aria-live":"polite","aria-busy":i,className:`pkt-loader--${r?"inline":"box"} ${e||""}`,children:i?g.jsx(g.Fragment,{children:v?g.jsxs("div",{className:m,"data-testid":"pkt-loader",ref:h,...d,children:[g.jsx(ce,{name:b(o),path:"https://punkt-cdn.oslo.kommune.no/12.8/animations/",className:`pkt-loader__svg pkt-loader__${o}`}),t&&g.jsx("p",{children:t})]}):null}):c})});ru.displayName="PktLoader";const sg=Sn({tagName:"pkt-messagebox",elementClass:fn,react:M,displayName:"PktMessagebox",events:{onClose:"close"}}),au=M.forwardRef(({children:e,...t},n)=>g.jsx(sg,{...t,ref:n,children:g.jsx("div",{className:"pkt-contents",children:e})}));au.displayName="PktMessagebox";/*!
|
|
551
551
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
552
552
|
*
|
|
553
553
|
* 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.
|
|
3
|
+
"version": "12.8.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",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@oslokommune/punkt-assets": "^12.7.3",
|
|
50
|
-
"@oslokommune/punkt-css": "^12.
|
|
51
|
-
"@oslokommune/punkt-elements": "^12.
|
|
50
|
+
"@oslokommune/punkt-css": "^12.8.1",
|
|
51
|
+
"@oslokommune/punkt-elements": "^12.8.1",
|
|
52
52
|
"@testing-library/jest-dom": "^6.5.0",
|
|
53
53
|
"@testing-library/react": "^16.0.1",
|
|
54
54
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
112
112
|
},
|
|
113
113
|
"license": "MIT",
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "5ef8d6c7ba6a986e3a3267a970089be4758420a7"
|
|
115
115
|
}
|