@oslokommune/punkt-react 11.8.0 → 11.8.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.
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,41 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [11.8.2](https://github.com/oslokommune/punkt/compare/11.8.1...11.8.2) (2024-03-06)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
Ingen
|
|
18
|
+
|
|
19
|
+
### Chores
|
|
20
|
+
Ingen
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [11.8.1](https://github.com/oslokommune/punkt/compare/11.8.0...11.8.1) (2024-03-06)
|
|
26
|
+
|
|
27
|
+
### ⚠ BREAKING CHANGES
|
|
28
|
+
Ingen
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
Ingen
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
Ingen
|
|
35
|
+
|
|
36
|
+
### Chores
|
|
37
|
+
* sort and set common formatter rules (#1571).
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
|
|
8
43
|
## [11.8.0](https://github.com/oslokommune/punkt/compare/11.7.1...11.8.0) (2024-03-04)
|
|
9
44
|
|
|
10
45
|
### ⚠ BREAKING CHANGES
|
package/dist/punkt-react.es.js
CHANGED
|
@@ -2120,7 +2120,7 @@ const wr = B(
|
|
|
2120
2120
|
role: "status",
|
|
2121
2121
|
"aria-live": "polite",
|
|
2122
2122
|
"aria-busy": r,
|
|
2123
|
-
className: `pkt-loader--${l ? "inline" : "box"} ${e}`,
|
|
2123
|
+
className: `pkt-loader--${l ? "inline" : "box"} ${e || ""}`,
|
|
2124
2124
|
children: r ? /* @__PURE__ */ i(X, { children: k ? /* @__PURE__ */ h("div", { className: d, "data-testid": "pkt-loader", ref: u, ...p, children: [
|
|
2125
2125
|
/* @__PURE__ */ i(
|
|
2126
2126
|
E,
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -55,4 +55,4 @@ Check the top-level render call using <`+m+">.")}return p}}function Ut(t,p){{if(
|
|
|
55
55
|
Copyright (c) 2018 Jed Watson.
|
|
56
56
|
Licensed under the MIT License (MIT), see
|
|
57
57
|
http://jedwatson.github.io/classnames
|
|
58
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function a(){for(var l=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var s=typeof o;if(s==="string"||s==="number")l.push(o);else if(Array.isArray(o)){if(o.length){var c=a.apply(null,o);c&&l.push(c)}}else if(s==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){l.push(o.toString());continue}for(var f in o)n.call(o,f)&&o[f]&&l.push(f)}}}return l.join(" ")}e.exports?(a.default=a,e.exports=a):window.classNames=a})()})(_t);var Bn=_t.exports;const bt=Mt(Bn),Mn=b.forwardRef(({logoLink:e="https://www.oslo.kommune.no/",serviceName:n,fixed:a=!0,scrollToHide:l=!0,user:r,userMenu:o,representing:s,userOptions:c,userMenuFooter:f,canChangeRepresentation:u=!0,showMenuButton:d=!1,showLogOutButton:k=!1,openMenu:v,logOut:S,changeRepresentation:x,...$},I)=>{const E=b.useMemo(()=>typeof(r==null?void 0:r.lastLoggedIn)=="string"?r.lastLoggedIn:r!=null&&r.lastLoggedIn?new Date(r.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[r]),[C,_]=b.useState(!1),[j,V]=b.useState(0),[W,B]=b.useState(!1),J=b.useRef(null);b.useEffect(()=>(document.addEventListener("mouseup",G),window.addEventListener("scroll",z),()=>{document.removeEventListener("mouseup",G),window.removeEventListener("scroll",z)}));const M=()=>{B(!W)},G=N=>{J.current&&!J.current.contains(N.target)&&B(!1)},z=()=>{if(l){const N=window.pageYOffset||document.documentElement.scrollTop;if(N<0||Math.abs(N-j)<60)return;_(N>j),V(N)}};return h("header",{...$,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:bt("pkt-header",{"pkt-header--fixed":a,"pkt-header--scroll-to-hide":l,"pkt-header--hidden":C}),ref:I,children:[h("div",{className:"pkt-header__logo",children:[typeof e=="string"?i("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:e,children:i(w,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.8/logos/"})}):i("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:e,children:i(w,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.8/logos/"})}),i("span",{className:"pkt-header__logo-service",children:n})]}),i("nav",{className:"pkt-header__actions",children:h("ul",{className:"pkt-header__actions-row",children:[d&&i("li",{children:i(le,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:v,children:"Meny"})}),(r||s)&&h("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${W&&!C?"pkt-header--open-dropdown":""}`,ref:J,children:[h("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":W,onClick:M,children:[i(w,{name:"user",className:"pkt-btn__icon"}),i("span",{className:"pkt-header__user-fullname",children:(s==null?void 0:s.name)||(r==null?void 0:r.name)}),i("span",{className:"pkt-header__user-shortname",children:(s==null?void 0:s.shortname)||(r==null?void 0:r.shortname)}),i(w,{name:"chevron-thin-down",className:"pkt-btn--closed"}),i(w,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),h("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[r&&h("li",{children:[i("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),i("div",{className:"pkt-user-menu__name",children:r.name}),r.lastLoggedIn&&h("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",i("time",{children:E})]})]}),o&&i("li",{children:i("ul",{className:"pkt-list",children:o.map((N,L)=>i("li",{children:typeof N.target=="string"?h("a",{href:N.target,className:"pkt-link",children:[N.iconName&&i(w,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&i(w,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userMenu-${L}`))})}),(s||u)&&h("li",{children:[s&&h(X,{children:[i("div",{className:"pkt-user-menu__label",children:"Representerer"}),i("div",{className:"pkt-user-menu__name",children:s.name}),s.orgNumber&&h("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",s.orgNumber]})]}),i("ul",{className:"pkt-list mt-size-16",children:u&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:x,children:[i(w,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),i("li",{children:i("ul",{className:"pkt-list",children:(c||!k)&&h(X,{children:[c==null?void 0:c.map((N,L)=>i("li",{children:typeof N.target=="string"?h("a",{href:N.target,className:"pkt-link",children:[N.iconName&&i(w,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&i(w,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userOptions-${L}`)),!k&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:S,children:[i(w,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),f&&i("li",{className:"footer",children:i("ul",{className:"pkt-list-horizontal bordered",children:f.map((N,L)=>i("li",{children:typeof N.target=="string"?i("a",{href:N.target,className:"pkt-link",children:N.title}):i("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:N.title})},`userMenuFooter-${L}`))})})]})]}),k&&i("li",{children:i(le,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:S,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),gt=b.forwardRef(({label:e,id:n,children:a,...l},r)=>h("div",{className:"pkt-form-group",children:[i("label",{htmlFor:n,className:"pkt-form-label",children:e}),i("input",{className:"pkt-form-input",id:n,...l,ref:r}),a]}));gt.displayName="PktInput";const de=b.forwardRef(({forId:e,label:n,helptext:a,helptextDropdown:l,helptextDropdownButton:r,optionalTag:o=!1,optionalText:s="Valgfritt",requiredTag:c=!1,requiredText:f="Må fylles ut",hasError:u,errorMessage:d,disabled:k,inline:v,ariaDescribedby:S,useWrapper:x=!0,children:$,className:I,hasFieldset:E=!1},C)=>{const[_,j]=b.useState(!1),V=()=>{j(!_)},W=()=>o?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":c?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",B=o?s:c?f:"",J=k?"pkt-inputwrapper--disabled":"",M=v?"pkt-inputwrapper--inline":"",G=u?"pkt-inputwrapper--error":"",z=!!l&&l!=="",N=r||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',L=E?"fieldset":z?"div":"label",K=E?"legend":z?"h2":"span",q=S||(a?`${e}-helptext`:void 0);return h("div",{className:["pkt-inputwrapper",I,J,M,G].join(" "),ref:C,children:[x?i(X,{children:h(L,{htmlFor:E?void 0:e,"aria-describedby":z?void 0:S,className:`pkt-inputwrapper__label${E?" pkt-inputwrapper__fieldset":""}`,children:[h(K,{id:`${e}-label`,className:`${E?" pkt-inputwrapper__legend":""}`,children:[n,B!==""&&i("span",{className:W(),children:B})]}),a&&i("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,dangerouslySetInnerHTML:{__html:a}}),z&&l!==""&&h("div",{children:[i(le,{skin:"tertiary",size:"small",variant:"icon-right",iconName:_?"chevron-thin-up":"chevron-thin-down",className:"pkt-inputwrapper__helptext-expandable pkt-link pkt-link--icon-right",onClick:V,children:i("span",{dangerouslySetInnerHTML:{__html:N}})}),i("div",{className:`pkt-inputwrapper__helptext ${_?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i("span",{dangerouslySetInnerHTML:{__html:l}})}),!E&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":q,children:n})]}),i(X,{children:$})]})}):h(X,{children:[!E&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":q,id:`${e}-label`,children:n}),$]}),u&&d&&i("div",{children:i(et,{skin:"error","aria-live":"assertive",id:`${e}-error`,compact:!0,children:d})})]})});de.displayName="PktInputWrapper";const Nt=b.forwardRef(({children:e,className:n,iconName:a="user",openInNewTab:l=!1,skin:r="normal",href:o="#",external:s=!1,title:c,...f},u)=>{const d=[n,"pkt-linkcard",r&&`pkt-linkcard--${r}`].filter(Boolean).join(" ");return h("a",{...f,href:o,className:`pkt-linkcard pkt-link ${d}`,target:l?"_blank":"_self",rel:l?"noopener noreferrer":void 0,ref:u,children:[i(w,{className:"pkt-link__icon",name:a}),h("div",{className:"pkt-linkcard__content",children:[i("div",{className:`pkt-linkcard__title ${s?"pkt-link pkt-link--external":""}`,children:c}),i("div",{className:"pkt-linkcard__text",children:e})]})]})});Nt.displayName="PktLinkCard";const Yn=b.forwardRef(({className:e,message:n,size:a="medium",inline:l=!1,isLoading:r=!0,variant:o="rainbow",delay:s=0,children:c,...f},u)=>{const d=`pkt-loader pkt-loader--${a}`,[k,v]=b.useState(!(s>0));s>0&&setTimeout(()=>{v(!0)},s);const S=x=>x==="shapes"?"loader":x==="blue"?"spinner-blue":"spinner";return i("div",{role:"status","aria-live":"polite","aria-busy":r,className:`pkt-loader--${l?"inline":"box"} ${e}`,children:r?i(X,{children:k?h("div",{className:d,"data-testid":"pkt-loader",ref:u,...f,children:[i(w,{name:S(o),"aria-label":"loading",path:"https://punkt-cdn.oslo.kommune.no/11.8/animations/",className:`pkt-loader__svg pkt-loader__${o}`}),n&&i("p",{children:n})]}):null}):c})}),Kn=({children:e,className:n,compact:a=!1,skin:l="beige",title:r,...o})=>{const s=[n,"pkt-messagebox",l&&`pkt-messagebox--${l}`,a&&"pkt-messagebox--compact"].filter(Boolean).join(" ");return h("div",{...o,className:s,children:[r&&i("div",{className:"pkt-messagebox__title",children:r}),i("div",{className:"pkt-messagebox__text",children:e})]})},yt=b.forwardRef(({id:e,name:n,label:a,className:l,hasTile:r=!1,disabled:o=!1,checkHelptext:s,hasError:c=!1,...f},u)=>{const d=[l,"pkt-input-check"].filter(Boolean).join(" ");return i("div",{className:d,children:h("div",{className:`pkt-input-check__input ${r?"pkt-input-check__input--tile":""} ${o&&r?"pkt-input-check__input--tile-disabled":""}`,children:[i("input",{ref:u,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"radio",id:e,disabled:o,name:n,...f}),h("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[a,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]})]})})});yt.displayName="PktRadioButton";const Jn=b.forwardRef(({action:e,appearance:n="local",disabled:a=!1,fullwidth:l=!1,id:r,label:o,method:s="get",name:c,placeholder:f="Søk…",suggestions:u,value:d="",onSearch:k,onSuggestionClick:v,...S},x)=>{const $=(_,j)=>{_?_():v&&v(j)},I=`pkt-searchinput pkt-searchinput--${n} ${l?"pkt-searchinput--fullwidth":""}`;return h(e?"form":"div",{className:I,onSubmit:k&&(()=>k(d)),action:e||void 0,method:e?s:void 0,role:"search",ref:x,...S,children:[h(o?"label":"div",{htmlFor:o?r:void 0,className:o?"pkt-inputwrapper__label":"",children:[o&&i(X,{children:o}),h("div",{className:n==="local"?"pkt-input__container":"pkt-searchinput__field",children:[i("input",{className:`pkt-input ${l?"pkt-input--fullwidth":""}`,type:"search",name:c||r,id:r,placeholder:f,value:d,disabled:a,onInput:k&&(_=>k(_.currentTarget.value)),autoComplete:"off","aria-autocomplete":"list","aria-controls":`${r}-suggestions`}),i(le,{className:`pkt-searchinput__button ${n==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:n==="local"?"tertiary":"primary",color:n==="global"?"yellow":void 0,type:"submit",disabled:a,onClick:k&&(()=>k(d)),onKeyUp:k&&(_=>_.key==="Enter"&&k(d)),children:o||f})]})]}),u&&i("ul",{id:`${r}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:u.map((_,j)=>i("li",{children:b.createElement(_.href?"a":_.onClick?"button":"div",{href:_.href,className:`pkt-searchinput__suggestion ${_.onClick?"pkt-link-button":""} ${_.href||_.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:_.onClick?"button":void 0,onClick:()=>$(_.onClick,j),onKeyUp:()=>$(_.onClick,j)},h(X,{children:[_.title&&i("h3",{className:"pkt-searchinput__suggestion-title",children:_.title}),_.text&&i("p",{className:"pkt-searchinput__suggestion-text",children:_.text})]}))},`search-suggestion-${j}`))})]})}),zn=b.forwardRef(({ariaDescribedby:e,ariaLabelledby:n,children:a,className:l,disabled:r=!1,errorMessage:o,hasError:s,helptext:c,helptextDropdown:f,helptextDropdownButton:u,id:d,inline:k=!1,fullwidth:v=!1,label:S,name:x,optionalTag:$=!1,optionalText:I,requiredTag:E=!1,requiredText:C,..._},j)=>{const V=[l,"pkt-select"].join(" ");return i(de,{className:V,forId:d,label:S,helptext:c,helptextDropdown:f,helptextDropdownButton:u,optionalTag:$,optionalText:I,requiredTag:E,requiredText:C,hasError:s,errorMessage:o,disabled:r,inline:k,ariaDescribedby:e,children:i("select",{ref:j,className:`pkt-input ${v?"pkt-input--fullwidth":""}`,"aria-invalid":s,"aria-errormessage":`${d}-error`,"aria-labelledby":n||`${d}-label`,disabled:r,id:d,name:x||d,..._,children:a})})}),qn=({isResponsive:e,children:n})=>e?i("div",{className:"pkt-table-container",children:n}):i(X,{children:n}),Gn=({isResponsive:e,modifiers:{info:n=!1,success:a=!1,strong:l=!1,shadow:r=!1}={},children:o})=>i(qn,{isResponsive:e,children:i("table",{className:bt("pkt-table",{"pkt-table--info":n,"pkt-table--success":a,"pkt-table--strong":l,"pkt-table--shadow":r}),children:o})}),Hn=({children:e})=>i("td",{className:"pkt-table__th",children:e}),Xn=({children:e})=>i("th",{className:"pkt-table__th",children:e}),we=b.forwardRef(({children:e,className:n,skin:a="blue",textStyle:l="normal-text",size:r="medium",closeTag:o=!1,iconName:s="",type:c="button",ariaLabel:f="close",onClick:u=()=>{}},d)=>{const[k,v]=b.useState(!1),S=E=>{v(!0),u(E)},x=["pkt-tag",r&&`pkt-tag--${r}`,a&&`pkt-tag--${a}`,l&&`pkt-tag--${l}`,n].filter(Boolean).join(" "),$=["pkt-tag","pkt-btn","pkt-btn--tertiary",r&&`pkt-tag--${r}`,a&&`pkt-tag--${a}`,l&&`pkt-tag--${l}`,s&&o?"pkt-btn--icons-right-and-left":null,o&&!s?"pkt-btn--icon-right":null,n].filter(Boolean).join(" "),I=!k;return o&&s?i(X,{children:I&&h("button",{className:$,type:c,"aria-label":f,onClick:S,ref:d,children:[i(w,{className:"pkt-tag__icon",name:s}),e,i(w,{className:"pkt-tag__close-btn",name:"close"})]})}):o?i(X,{children:I&&h("button",{className:$,type:c,"aria-label":f,onClick:S,ref:d,children:[i(w,{className:"pkt-tag__close-btn",name:"close"}),e]})}):s?h("span",{className:x,children:[i(w,{className:"pkt-tag__icon",name:s}),e]}):i("span",{className:x,children:e})});we.displayName="PktTag";const Zn=b.forwardRef(({arrowNav:e=!0,tabs:n,onTabSelected:a},l)=>{const r=b.useRef([]);b.useEffect(()=>{r.current=r.current.slice(0,n.length)},[n]);const o=(c,f)=>{f.action&&f.action(c),a&&a(c)},s=(c,f)=>{var u,d;e&&(f.code==="ArrowLeft"&&c!==0&&((u=r.current[c-1])==null||u.focus()),f.code==="ArrowRight"&&c<n.length-1&&((d=r.current[c+1])==null||d.focus()),(f.code==="ArrowDown"||f.code==="Space")&&o(c,n[c]))};return i("div",{className:"pkt-tabs",ref:l,children:i("div",{className:"pkt-tabs__list",role:e?"tablist":"navigation",children:n.map((c,f)=>i(b.Fragment,{children:c.href?h("a",{"aria-selected":!!c.active,role:e?"tab":void 0,href:c.href,"aria-controls":c.controls,className:`pkt-tabs__link ${c.active?"active":""}`,onKeyUp:u=>s(f,u),onClick:()=>o(f,c),tabIndex:c.active||!e?void 0:-1,ref:u=>{r.current[f]=u},children:[c.icon&&i(w,{name:c.icon,className:"pkt-icon--small"}),c.text,c.tag&&i(we,{skin:c.tag.skin,size:"small",children:c.tag.text})]}):h("button",{"aria-selected":!!c.active,role:e?"tab":void 0,type:"button","aria-controls":c.controls,className:`pkt-tabs__button pkt-link-button ${c.active?"active":""}`,onKeyUp:u=>s(f,u),onClick:()=>o(f,c),tabIndex:c.active||!e?void 0:-1,ref:u=>{r.current[f]=u},children:[c.icon&&i(w,{name:c.icon,className:"pkt-icon--small"}),c.text,c.tag&&i(we,{skin:c.tag.skin,size:"small",children:c.tag.text})]},"b-"+f)},f))})})}),Qn=b.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:a,counter:l,counterMaxLength:r,className:o,disabled:s,errorMessage:c,hasError:f,helptext:u,helptextDropdown:d,helptextDropdownButton:k,inline:v,fullwidth:S=!1,label:x,name:$,optionalTag:I=!1,optionalText:E,requiredTag:C=!1,requiredText:_,placeholder:j,rows:V,useWrapper:W=!0,onChange:B,...J},M)=>{const G=[o,"pkt-textinput","pkt-textarea"].join(" "),z=a||`${e}-label`,N=b.useRef(null),[L,K]=b.useState(0),q=ee=>{var te,me;if(l&&K(((me=(te=ee.currentTarget)==null?void 0:te.value)==null?void 0:me.length)||0),B)return B(ee)};return b.useEffect(()=>{var ee,te;typeof M=="function"&&M(N.current),l&&K(((te=(ee=N==null?void 0:N.current)==null?void 0:ee.value)==null?void 0:te.length)||0)},[M]),h(de,{ariaDescribedby:n,className:G,disabled:s,errorMessage:c,forId:e,hasError:f,helptext:u,helptextDropdown:d,helptextDropdownButton:k,inline:v,label:x,optionalTag:I,optionalText:E,requiredTag:C,requiredText:_,useWrapper:W,children:[i("textarea",{ref:N,className:`pkt-input ${S?"pkt-input--fullwidth":""} ${r&&L>r?"pkt-input--counter-error":""}`,name:$||e,id:e,placeholder:j,disabled:s,rows:V,"aria-labelledby":z,"aria-invalid":f,"aria-errormessage":`${e}-error`,...J,onChange:q}),l&&h("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[L||0,r&&`/${r}`]})]})}),er=b.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:a,autocomplete:l="off",className:r,disabled:o=!1,errorMessage:s,hasError:c=!1,helptext:f,helptextDropdown:u,helptextDropdownButton:d,iconNameRight:k,inline:v=!1,fullwidth:S=!1,label:x,name:$,optionalTag:I=!1,optionalText:E,requiredTag:C=!1,requiredText:_,placeholder:j,prefix:V,suffix:W,type:B="text",useWrapper:J=!0,omitSearchIcon:M=!1,value:G,...z},N)=>{const L=[r,"pkt-textinput"].join(" "),K=a||`${e}-label`,q=B==="search"&&!k&&!M;return i(de,{ariaDescribedby:n,className:L,disabled:o,errorMessage:s,forId:e,hasError:c,helptext:f,helptextDropdown:u,helptextDropdownButton:d,inline:v,label:x,optionalTag:I,optionalText:E,requiredTag:C,requiredText:_,useWrapper:J,children:h("div",{className:"pkt-input__container",children:[V&&i("div",{className:"pkt-input-prefix",children:V}),i("input",{ref:N,className:`pkt-input ${S?"pkt-input--fullwidth":""}`,type:B,name:$||e,id:e,placeholder:j,autoComplete:l,value:G,disabled:o,"aria-invalid":c,"aria-errormessage":`${e}-error`,"aria-labelledby":K,...z}),W&&h("p",{className:"pkt-input-suffix",children:[W,k&&i(w,{className:"pkt-input-suffix-icon",name:k}),q&&i(w,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!W&&k&&i(w,{className:"pkt-input-icon",name:k}),!W&&q&&i(w,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});T.PktAlert=et,T.PktBackLink=Ht,T.PktBreadcrumbs=An,T.PktButton=le,T.PktCheckbox=vt,T.PktFooter=Vn,T.PktFooterSimple=Wn,T.PktHeader=Mn,T.PktIcon=w,T.PktIconContext=Qe,T.PktInput=gt,T.PktInputWrapper=de,T.PktLinkCard=Nt,T.PktLoader=Yn,T.PktMessagebox=Kn,T.PktRadioButton=yt,T.PktSearchInput=Jn,T.PktSelect=zn,T.PktTable=Gn,T.PktTableData=Hn,T.PktTableHeader=Xn,T.PktTabs=Zn,T.PktTag=we,T.PktTextarea=Qn,T.PktTextinput=er,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
58
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function a(){for(var l=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var s=typeof o;if(s==="string"||s==="number")l.push(o);else if(Array.isArray(o)){if(o.length){var c=a.apply(null,o);c&&l.push(c)}}else if(s==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){l.push(o.toString());continue}for(var f in o)n.call(o,f)&&o[f]&&l.push(f)}}}return l.join(" ")}e.exports?(a.default=a,e.exports=a):window.classNames=a})()})(_t);var Bn=_t.exports;const bt=Mt(Bn),Mn=b.forwardRef(({logoLink:e="https://www.oslo.kommune.no/",serviceName:n,fixed:a=!0,scrollToHide:l=!0,user:r,userMenu:o,representing:s,userOptions:c,userMenuFooter:f,canChangeRepresentation:u=!0,showMenuButton:d=!1,showLogOutButton:k=!1,openMenu:v,logOut:S,changeRepresentation:x,...$},I)=>{const E=b.useMemo(()=>typeof(r==null?void 0:r.lastLoggedIn)=="string"?r.lastLoggedIn:r!=null&&r.lastLoggedIn?new Date(r.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[r]),[C,_]=b.useState(!1),[j,V]=b.useState(0),[W,B]=b.useState(!1),J=b.useRef(null);b.useEffect(()=>(document.addEventListener("mouseup",G),window.addEventListener("scroll",z),()=>{document.removeEventListener("mouseup",G),window.removeEventListener("scroll",z)}));const M=()=>{B(!W)},G=N=>{J.current&&!J.current.contains(N.target)&&B(!1)},z=()=>{if(l){const N=window.pageYOffset||document.documentElement.scrollTop;if(N<0||Math.abs(N-j)<60)return;_(N>j),V(N)}};return h("header",{...$,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:bt("pkt-header",{"pkt-header--fixed":a,"pkt-header--scroll-to-hide":l,"pkt-header--hidden":C}),ref:I,children:[h("div",{className:"pkt-header__logo",children:[typeof e=="string"?i("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:e,children:i(w,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.8/logos/"})}):i("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:e,children:i(w,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/11.8/logos/"})}),i("span",{className:"pkt-header__logo-service",children:n})]}),i("nav",{className:"pkt-header__actions",children:h("ul",{className:"pkt-header__actions-row",children:[d&&i("li",{children:i(le,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:v,children:"Meny"})}),(r||s)&&h("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${W&&!C?"pkt-header--open-dropdown":""}`,ref:J,children:[h("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":W,onClick:M,children:[i(w,{name:"user",className:"pkt-btn__icon"}),i("span",{className:"pkt-header__user-fullname",children:(s==null?void 0:s.name)||(r==null?void 0:r.name)}),i("span",{className:"pkt-header__user-shortname",children:(s==null?void 0:s.shortname)||(r==null?void 0:r.shortname)}),i(w,{name:"chevron-thin-down",className:"pkt-btn--closed"}),i(w,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),h("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[r&&h("li",{children:[i("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),i("div",{className:"pkt-user-menu__name",children:r.name}),r.lastLoggedIn&&h("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",i("time",{children:E})]})]}),o&&i("li",{children:i("ul",{className:"pkt-list",children:o.map((N,L)=>i("li",{children:typeof N.target=="string"?h("a",{href:N.target,className:"pkt-link",children:[N.iconName&&i(w,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&i(w,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userMenu-${L}`))})}),(s||u)&&h("li",{children:[s&&h(X,{children:[i("div",{className:"pkt-user-menu__label",children:"Representerer"}),i("div",{className:"pkt-user-menu__name",children:s.name}),s.orgNumber&&h("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",s.orgNumber]})]}),i("ul",{className:"pkt-list mt-size-16",children:u&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:x,children:[i(w,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),i("li",{children:i("ul",{className:"pkt-list",children:(c||!k)&&h(X,{children:[c==null?void 0:c.map((N,L)=>i("li",{children:typeof N.target=="string"?h("a",{href:N.target,className:"pkt-link",children:[N.iconName&&i(w,{name:N.iconName,className:"pkt-link__icon"}),N.title]}):h("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:[N.iconName&&i(w,{name:N.iconName,className:"pkt-link__icon"}),N.title]})},`userOptions-${L}`)),!k&&i("li",{children:h("button",{className:"pkt-link-button pkt-link",onClick:S,children:[i(w,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),f&&i("li",{className:"footer",children:i("ul",{className:"pkt-list-horizontal bordered",children:f.map((N,L)=>i("li",{children:typeof N.target=="string"?i("a",{href:N.target,className:"pkt-link",children:N.title}):i("button",{className:"pkt-link-button pkt-link",onClick:N.target,children:N.title})},`userMenuFooter-${L}`))})})]})]}),k&&i("li",{children:i(le,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:S,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),gt=b.forwardRef(({label:e,id:n,children:a,...l},r)=>h("div",{className:"pkt-form-group",children:[i("label",{htmlFor:n,className:"pkt-form-label",children:e}),i("input",{className:"pkt-form-input",id:n,...l,ref:r}),a]}));gt.displayName="PktInput";const de=b.forwardRef(({forId:e,label:n,helptext:a,helptextDropdown:l,helptextDropdownButton:r,optionalTag:o=!1,optionalText:s="Valgfritt",requiredTag:c=!1,requiredText:f="Må fylles ut",hasError:u,errorMessage:d,disabled:k,inline:v,ariaDescribedby:S,useWrapper:x=!0,children:$,className:I,hasFieldset:E=!1},C)=>{const[_,j]=b.useState(!1),V=()=>{j(!_)},W=()=>o?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--blue-light":c?"pkt-tag pkt-tag--small pkt-tag--thin-text pkt-tag--beige":"",B=o?s:c?f:"",J=k?"pkt-inputwrapper--disabled":"",M=v?"pkt-inputwrapper--inline":"",G=u?"pkt-inputwrapper--error":"",z=!!l&&l!=="",N=r||'Les mer <span class="pkt-sr-only">om inputfeltet</span>',L=E?"fieldset":z?"div":"label",K=E?"legend":z?"h2":"span",q=S||(a?`${e}-helptext`:void 0);return h("div",{className:["pkt-inputwrapper",I,J,M,G].join(" "),ref:C,children:[x?i(X,{children:h(L,{htmlFor:E?void 0:e,"aria-describedby":z?void 0:S,className:`pkt-inputwrapper__label${E?" pkt-inputwrapper__fieldset":""}`,children:[h(K,{id:`${e}-label`,className:`${E?" pkt-inputwrapper__legend":""}`,children:[n,B!==""&&i("span",{className:W(),children:B})]}),a&&i("div",{className:"pkt-inputwrapper__helptext",id:`${e}-helptext`,dangerouslySetInnerHTML:{__html:a}}),z&&l!==""&&h("div",{children:[i(le,{skin:"tertiary",size:"small",variant:"icon-right",iconName:_?"chevron-thin-up":"chevron-thin-down",className:"pkt-inputwrapper__helptext-expandable pkt-link pkt-link--icon-right",onClick:V,children:i("span",{dangerouslySetInnerHTML:{__html:N}})}),i("div",{className:`pkt-inputwrapper__helptext ${_?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i("span",{dangerouslySetInnerHTML:{__html:l}})}),!E&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":q,children:n})]}),i(X,{children:$})]})}):h(X,{children:[!E&&i("label",{htmlFor:e,className:"pkt-sr-only","aria-describedby":q,id:`${e}-label`,children:n}),$]}),u&&d&&i("div",{children:i(et,{skin:"error","aria-live":"assertive",id:`${e}-error`,compact:!0,children:d})})]})});de.displayName="PktInputWrapper";const Nt=b.forwardRef(({children:e,className:n,iconName:a="user",openInNewTab:l=!1,skin:r="normal",href:o="#",external:s=!1,title:c,...f},u)=>{const d=[n,"pkt-linkcard",r&&`pkt-linkcard--${r}`].filter(Boolean).join(" ");return h("a",{...f,href:o,className:`pkt-linkcard pkt-link ${d}`,target:l?"_blank":"_self",rel:l?"noopener noreferrer":void 0,ref:u,children:[i(w,{className:"pkt-link__icon",name:a}),h("div",{className:"pkt-linkcard__content",children:[i("div",{className:`pkt-linkcard__title ${s?"pkt-link pkt-link--external":""}`,children:c}),i("div",{className:"pkt-linkcard__text",children:e})]})]})});Nt.displayName="PktLinkCard";const Yn=b.forwardRef(({className:e,message:n,size:a="medium",inline:l=!1,isLoading:r=!0,variant:o="rainbow",delay:s=0,children:c,...f},u)=>{const d=`pkt-loader pkt-loader--${a}`,[k,v]=b.useState(!(s>0));s>0&&setTimeout(()=>{v(!0)},s);const S=x=>x==="shapes"?"loader":x==="blue"?"spinner-blue":"spinner";return i("div",{role:"status","aria-live":"polite","aria-busy":r,className:`pkt-loader--${l?"inline":"box"} ${e||""}`,children:r?i(X,{children:k?h("div",{className:d,"data-testid":"pkt-loader",ref:u,...f,children:[i(w,{name:S(o),"aria-label":"loading",path:"https://punkt-cdn.oslo.kommune.no/11.8/animations/",className:`pkt-loader__svg pkt-loader__${o}`}),n&&i("p",{children:n})]}):null}):c})}),Kn=({children:e,className:n,compact:a=!1,skin:l="beige",title:r,...o})=>{const s=[n,"pkt-messagebox",l&&`pkt-messagebox--${l}`,a&&"pkt-messagebox--compact"].filter(Boolean).join(" ");return h("div",{...o,className:s,children:[r&&i("div",{className:"pkt-messagebox__title",children:r}),i("div",{className:"pkt-messagebox__text",children:e})]})},yt=b.forwardRef(({id:e,name:n,label:a,className:l,hasTile:r=!1,disabled:o=!1,checkHelptext:s,hasError:c=!1,...f},u)=>{const d=[l,"pkt-input-check"].filter(Boolean).join(" ");return i("div",{className:d,children:h("div",{className:`pkt-input-check__input ${r?"pkt-input-check__input--tile":""} ${o&&r?"pkt-input-check__input--tile-disabled":""}`,children:[i("input",{ref:u,className:`pkt-input-check__input-checkbox ${c?"pkt-input-check__input-checkbox--error":""}`,type:"radio",id:e,disabled:o,name:n,...f}),h("label",{className:"pkt-input-check__input-label",htmlFor:e,children:[a,s&&i("div",{className:"pkt-input-check__input-helptext",children:s})]})]})})});yt.displayName="PktRadioButton";const Jn=b.forwardRef(({action:e,appearance:n="local",disabled:a=!1,fullwidth:l=!1,id:r,label:o,method:s="get",name:c,placeholder:f="Søk…",suggestions:u,value:d="",onSearch:k,onSuggestionClick:v,...S},x)=>{const $=(_,j)=>{_?_():v&&v(j)},I=`pkt-searchinput pkt-searchinput--${n} ${l?"pkt-searchinput--fullwidth":""}`;return h(e?"form":"div",{className:I,onSubmit:k&&(()=>k(d)),action:e||void 0,method:e?s:void 0,role:"search",ref:x,...S,children:[h(o?"label":"div",{htmlFor:o?r:void 0,className:o?"pkt-inputwrapper__label":"",children:[o&&i(X,{children:o}),h("div",{className:n==="local"?"pkt-input__container":"pkt-searchinput__field",children:[i("input",{className:`pkt-input ${l?"pkt-input--fullwidth":""}`,type:"search",name:c||r,id:r,placeholder:f,value:d,disabled:a,onInput:k&&(_=>k(_.currentTarget.value)),autoComplete:"off","aria-autocomplete":"list","aria-controls":`${r}-suggestions`}),i(le,{className:`pkt-searchinput__button ${n==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:n==="local"?"tertiary":"primary",color:n==="global"?"yellow":void 0,type:"submit",disabled:a,onClick:k&&(()=>k(d)),onKeyUp:k&&(_=>_.key==="Enter"&&k(d)),children:o||f})]})]}),u&&i("ul",{id:`${r}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:u.map((_,j)=>i("li",{children:b.createElement(_.href?"a":_.onClick?"button":"div",{href:_.href,className:`pkt-searchinput__suggestion ${_.onClick?"pkt-link-button":""} ${_.href||_.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:_.onClick?"button":void 0,onClick:()=>$(_.onClick,j),onKeyUp:()=>$(_.onClick,j)},h(X,{children:[_.title&&i("h3",{className:"pkt-searchinput__suggestion-title",children:_.title}),_.text&&i("p",{className:"pkt-searchinput__suggestion-text",children:_.text})]}))},`search-suggestion-${j}`))})]})}),zn=b.forwardRef(({ariaDescribedby:e,ariaLabelledby:n,children:a,className:l,disabled:r=!1,errorMessage:o,hasError:s,helptext:c,helptextDropdown:f,helptextDropdownButton:u,id:d,inline:k=!1,fullwidth:v=!1,label:S,name:x,optionalTag:$=!1,optionalText:I,requiredTag:E=!1,requiredText:C,..._},j)=>{const V=[l,"pkt-select"].join(" ");return i(de,{className:V,forId:d,label:S,helptext:c,helptextDropdown:f,helptextDropdownButton:u,optionalTag:$,optionalText:I,requiredTag:E,requiredText:C,hasError:s,errorMessage:o,disabled:r,inline:k,ariaDescribedby:e,children:i("select",{ref:j,className:`pkt-input ${v?"pkt-input--fullwidth":""}`,"aria-invalid":s,"aria-errormessage":`${d}-error`,"aria-labelledby":n||`${d}-label`,disabled:r,id:d,name:x||d,..._,children:a})})}),qn=({isResponsive:e,children:n})=>e?i("div",{className:"pkt-table-container",children:n}):i(X,{children:n}),Gn=({isResponsive:e,modifiers:{info:n=!1,success:a=!1,strong:l=!1,shadow:r=!1}={},children:o})=>i(qn,{isResponsive:e,children:i("table",{className:bt("pkt-table",{"pkt-table--info":n,"pkt-table--success":a,"pkt-table--strong":l,"pkt-table--shadow":r}),children:o})}),Hn=({children:e})=>i("td",{className:"pkt-table__th",children:e}),Xn=({children:e})=>i("th",{className:"pkt-table__th",children:e}),we=b.forwardRef(({children:e,className:n,skin:a="blue",textStyle:l="normal-text",size:r="medium",closeTag:o=!1,iconName:s="",type:c="button",ariaLabel:f="close",onClick:u=()=>{}},d)=>{const[k,v]=b.useState(!1),S=E=>{v(!0),u(E)},x=["pkt-tag",r&&`pkt-tag--${r}`,a&&`pkt-tag--${a}`,l&&`pkt-tag--${l}`,n].filter(Boolean).join(" "),$=["pkt-tag","pkt-btn","pkt-btn--tertiary",r&&`pkt-tag--${r}`,a&&`pkt-tag--${a}`,l&&`pkt-tag--${l}`,s&&o?"pkt-btn--icons-right-and-left":null,o&&!s?"pkt-btn--icon-right":null,n].filter(Boolean).join(" "),I=!k;return o&&s?i(X,{children:I&&h("button",{className:$,type:c,"aria-label":f,onClick:S,ref:d,children:[i(w,{className:"pkt-tag__icon",name:s}),e,i(w,{className:"pkt-tag__close-btn",name:"close"})]})}):o?i(X,{children:I&&h("button",{className:$,type:c,"aria-label":f,onClick:S,ref:d,children:[i(w,{className:"pkt-tag__close-btn",name:"close"}),e]})}):s?h("span",{className:x,children:[i(w,{className:"pkt-tag__icon",name:s}),e]}):i("span",{className:x,children:e})});we.displayName="PktTag";const Zn=b.forwardRef(({arrowNav:e=!0,tabs:n,onTabSelected:a},l)=>{const r=b.useRef([]);b.useEffect(()=>{r.current=r.current.slice(0,n.length)},[n]);const o=(c,f)=>{f.action&&f.action(c),a&&a(c)},s=(c,f)=>{var u,d;e&&(f.code==="ArrowLeft"&&c!==0&&((u=r.current[c-1])==null||u.focus()),f.code==="ArrowRight"&&c<n.length-1&&((d=r.current[c+1])==null||d.focus()),(f.code==="ArrowDown"||f.code==="Space")&&o(c,n[c]))};return i("div",{className:"pkt-tabs",ref:l,children:i("div",{className:"pkt-tabs__list",role:e?"tablist":"navigation",children:n.map((c,f)=>i(b.Fragment,{children:c.href?h("a",{"aria-selected":!!c.active,role:e?"tab":void 0,href:c.href,"aria-controls":c.controls,className:`pkt-tabs__link ${c.active?"active":""}`,onKeyUp:u=>s(f,u),onClick:()=>o(f,c),tabIndex:c.active||!e?void 0:-1,ref:u=>{r.current[f]=u},children:[c.icon&&i(w,{name:c.icon,className:"pkt-icon--small"}),c.text,c.tag&&i(we,{skin:c.tag.skin,size:"small",children:c.tag.text})]}):h("button",{"aria-selected":!!c.active,role:e?"tab":void 0,type:"button","aria-controls":c.controls,className:`pkt-tabs__button pkt-link-button ${c.active?"active":""}`,onKeyUp:u=>s(f,u),onClick:()=>o(f,c),tabIndex:c.active||!e?void 0:-1,ref:u=>{r.current[f]=u},children:[c.icon&&i(w,{name:c.icon,className:"pkt-icon--small"}),c.text,c.tag&&i(we,{skin:c.tag.skin,size:"small",children:c.tag.text})]},"b-"+f)},f))})})}),Qn=b.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:a,counter:l,counterMaxLength:r,className:o,disabled:s,errorMessage:c,hasError:f,helptext:u,helptextDropdown:d,helptextDropdownButton:k,inline:v,fullwidth:S=!1,label:x,name:$,optionalTag:I=!1,optionalText:E,requiredTag:C=!1,requiredText:_,placeholder:j,rows:V,useWrapper:W=!0,onChange:B,...J},M)=>{const G=[o,"pkt-textinput","pkt-textarea"].join(" "),z=a||`${e}-label`,N=b.useRef(null),[L,K]=b.useState(0),q=ee=>{var te,me;if(l&&K(((me=(te=ee.currentTarget)==null?void 0:te.value)==null?void 0:me.length)||0),B)return B(ee)};return b.useEffect(()=>{var ee,te;typeof M=="function"&&M(N.current),l&&K(((te=(ee=N==null?void 0:N.current)==null?void 0:ee.value)==null?void 0:te.length)||0)},[M]),h(de,{ariaDescribedby:n,className:G,disabled:s,errorMessage:c,forId:e,hasError:f,helptext:u,helptextDropdown:d,helptextDropdownButton:k,inline:v,label:x,optionalTag:I,optionalText:E,requiredTag:C,requiredText:_,useWrapper:W,children:[i("textarea",{ref:N,className:`pkt-input ${S?"pkt-input--fullwidth":""} ${r&&L>r?"pkt-input--counter-error":""}`,name:$||e,id:e,placeholder:j,disabled:s,rows:V,"aria-labelledby":z,"aria-invalid":f,"aria-errormessage":`${e}-error`,...J,onChange:q}),l&&h("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":!0,children:[L||0,r&&`/${r}`]})]})}),er=b.forwardRef(({id:e,ariaDescribedby:n,ariaLabelledby:a,autocomplete:l="off",className:r,disabled:o=!1,errorMessage:s,hasError:c=!1,helptext:f,helptextDropdown:u,helptextDropdownButton:d,iconNameRight:k,inline:v=!1,fullwidth:S=!1,label:x,name:$,optionalTag:I=!1,optionalText:E,requiredTag:C=!1,requiredText:_,placeholder:j,prefix:V,suffix:W,type:B="text",useWrapper:J=!0,omitSearchIcon:M=!1,value:G,...z},N)=>{const L=[r,"pkt-textinput"].join(" "),K=a||`${e}-label`,q=B==="search"&&!k&&!M;return i(de,{ariaDescribedby:n,className:L,disabled:o,errorMessage:s,forId:e,hasError:c,helptext:f,helptextDropdown:u,helptextDropdownButton:d,inline:v,label:x,optionalTag:I,optionalText:E,requiredTag:C,requiredText:_,useWrapper:J,children:h("div",{className:"pkt-input__container",children:[V&&i("div",{className:"pkt-input-prefix",children:V}),i("input",{ref:N,className:`pkt-input ${S?"pkt-input--fullwidth":""}`,type:B,name:$||e,id:e,placeholder:j,autoComplete:l,value:G,disabled:o,"aria-invalid":c,"aria-errormessage":`${e}-error`,"aria-labelledby":K,...z}),W&&h("p",{className:"pkt-input-suffix",children:[W,k&&i(w,{className:"pkt-input-suffix-icon",name:k}),q&&i(w,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!W&&k&&i(w,{className:"pkt-input-icon",name:k}),!W&&q&&i(w,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});T.PktAlert=et,T.PktBackLink=Ht,T.PktBreadcrumbs=An,T.PktButton=le,T.PktCheckbox=vt,T.PktFooter=Vn,T.PktFooterSimple=Wn,T.PktHeader=Mn,T.PktIcon=w,T.PktIconContext=Qe,T.PktInput=gt,T.PktInputWrapper=de,T.PktLinkCard=Nt,T.PktLoader=Yn,T.PktMessagebox=Kn,T.PktRadioButton=yt,T.PktSearchInput=Jn,T.PktSelect=zn,T.PktTable=Gn,T.PktTableData=Hn,T.PktTableHeader=Xn,T.PktTabs=Zn,T.PktTag=we,T.PktTextarea=Qn,T.PktTextinput=er,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "11.8.
|
|
3
|
+
"version": "11.8.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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@oslokommune/punkt-assets": "^11.5.0",
|
|
36
|
-
"@oslokommune/punkt-css": "^11.
|
|
36
|
+
"@oslokommune/punkt-css": "^11.8.1",
|
|
37
37
|
"@testing-library/jest-dom": "^5.16.5",
|
|
38
38
|
"@testing-library/react": "^14.0.0",
|
|
39
39
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
92
92
|
},
|
|
93
93
|
"license": "MIT",
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "a7f83f699ffb08dd878ac0f91582640c96cfb8bf"
|
|
95
95
|
}
|
|
@@ -61,7 +61,7 @@ export const PktLoader = forwardRef(
|
|
|
61
61
|
role="status"
|
|
62
62
|
aria-live="polite"
|
|
63
63
|
aria-busy={isLoading}
|
|
64
|
-
className={`pkt-loader--${inline ? 'inline' : 'box'} ${className}`}
|
|
64
|
+
className={`pkt-loader--${inline ? 'inline' : 'box'} ${className ? className : ''}`}
|
|
65
65
|
>
|
|
66
66
|
{isLoading ? (
|
|
67
67
|
<>
|